From 83a943d550531dc7eeae77aacea39ca60fd7c786 Mon Sep 17 00:00:00 2001 From: "$./Netrunner_&" <114373528+00xNetrunner@users.noreply.github.com> Date: Sun, 15 Oct 2023 22:28:39 +0100 Subject: [PATCH] Update GPG_Cheatsheet.md --- GPG_Cheatsheet.md | 155 ++++++++++++++++++++++------------------------ 1 file changed, 75 insertions(+), 80 deletions(-) diff --git a/GPG_Cheatsheet.md b/GPG_Cheatsheet.md index a178816..5cfbc3f 100644 --- a/GPG_Cheatsheet.md +++ b/GPG_Cheatsheet.md @@ -1,106 +1,101 @@ - - - - GPG Cheatsheet 🛡️ - - - -

GPG Cheatsheet 🛡️

+```markdown +# GPG Cheatsheet 🔐 -

🔑 Key Management

+## Key Management 🔑 -

Generate a new GPG key pair:

-gpg --full-generate-key +- **Generate a new GPG key pair:** + ```bash + gpg --full-generate-key + ``` -

List all keys in your GPG keyring:

-gpg --list-keys +- **List all keys in your GPG keyring:** + ```bash + gpg --list-keys + ``` -

List all the secret keys in your GPG keyring:

-gpg --list-secret-keys +- **List all the secret keys in your GPG keyring:** + ```bash + gpg --list-secret-keys + ``` -

🔒 Message Encryption and Decryption

+## Message Encryption and Decryption 💌 -

Encrypt a message:

-gpg -e -u "your-email@example.com" -r "recipient@example.com" message.txt +- **Encrypt a message:** + ```bash + gpg -e -u "your-email@example.com" -r "recipient@example.com" message.txt + ``` + This creates `message.txt.gpg`. -

Decrypt a message:

-gpg -o decrypted-message.txt -d message.txt.gpg +- **Decrypt a message:** + ```bash + gpg -o decrypted-message.txt -d message.txt.gpg + ``` + This creates `decrypted-message.txt`. -

📁 GPG Folder Encryption Cheat Sheet

+## GPG Folder Encryption Cheat Sheet 📂 -

Encrypting a Folder

+### Encrypting a Folder 🔒 -
    -
  1. Create a tarball from the folder you want to encrypt:
  2. - tar -czvf archive.tar.gz /path/to/folder_to_encrypt +1. **Create a tarball from the folder you want to encrypt:** + ```bash + tar -czvf archive.tar.gz /path/to/folder_to_encrypt + ``` -
  3. Encrypt the tarball using GPG:
  4. - gpg -e -r your-email@example.com archive.tar.gz -
+2. **Encrypt the tarball using GPG:** + ```bash + gpg -e -r your-email@example.com archive.tar.gz + ``` -

Decrypting a Folder

+### Decrypting a Folder 🔓 -
    -
  1. Decrypt the GPG file to a tarball:
  2. - gpg -o archive.tar.gz -d archive.tar.gz.gpg +1. **Decrypt the GPG file to a tarball:** + ```bash + gpg -o archive.tar.gz -d archive.tar.gz.gpg + ``` -
  3. Extract the tarball to the original folder:
  4. - tar -xzvf archive.tar.gz -
+2. **Extract the tarball to the original folder:** + ```bash + tar -xzvf archive.tar.gz + ``` -

✉️ Encrypting a Message for Yourself: [Different Method]

+## Encrypting a message for yourself: [Different Method] 🤔 -
    -
  1. Generate a Key Pair:
  2. - gpg --gen-key +1. **Generate a Key Pair**: + ```bash + gpg --gen-key + ``` -
  3. Encrypt the Message:
  4. - gpg -e -u "Your Name" -r "Your Name" message.txt +2. **Encrypt the Message**: + ```bash + gpg -e -u "Your Name" -r "Your Name" message.txt + ``` -
  5. Decrypt the Message:
  6. - gpg -d message.txt.gpg -
+3. **Decrypt the Message**: + ```bash + gpg -d message.txt.gpg + ``` -

👥 Encrypting a Message for Someone Else:

+## Encrypting a message for someone else: 🤝 -
    -
  1. Import Their Public Key:
  2. - gpg --import theirkey.gpg +1. **Import Their Public Key**: + ```bash + gpg --import theirkey.gpg + ``` -
  3. Encrypt the Message:
  4. - gpg -e -u "Your Name" -r "Their Name" message.txt -
+2. **Encrypt the Message**: + ```bash + gpg -e -u "Your Name" -r "Their Name" message.txt + ``` -

🔄 Exporting & Importing Keys

+## Exporting & Importing Keys 📤📥 -

Exporting Your Public Key:

+1. **Exporting Your Public Key:** + ```bash + gpg --list-keys + gpg --export -a "Your Name" > public.key + ``` -
    -
  1. List your keys to find the one you want to export:
  2. - gpg --list-keys +``` -
  3. Export it to a file:
  4. - gpg --export -a "Your Name" > public.key -
- - - +Feel free to upload this to your GitHub repository!