From bfd369317e112b7976c494ab5531aca5d4bd2754 Mon Sep 17 00:00:00 2001 From: "$./Netrunner_&" <114373528+00xNetrunner@users.noreply.github.com> Date: Sun, 15 Oct 2023 22:46:05 +0100 Subject: [PATCH] Update GPG_Cheatsheet.md --- GPG_Cheatsheet.md | 122 ++++++++++++++++++++++++++-------------------- 1 file changed, 69 insertions(+), 53 deletions(-) diff --git a/GPG_Cheatsheet.md b/GPG_Cheatsheet.md index 5cfbc3f..c0b6142 100644 --- a/GPG_Cheatsheet.md +++ b/GPG_Cheatsheet.md @@ -1,3 +1,4 @@ +Here is the GPG cheatsheet converted to Markdown: ```markdown # GPG Cheatsheet 🔐 @@ -5,97 +6,112 @@ ## Key Management 🔑 - **Generate a new GPG key pair:** - ```bash - gpg --full-generate-key - ``` -- **List all keys in your GPG keyring:** - ```bash - gpg --list-keys - ``` +```bash +gpg --full-generate-key +``` + +- **List all keys in your GPG keyring:** + +```bash +gpg --list-keys +``` - **List all the secret keys in your GPG keyring:** - ```bash - gpg --list-secret-keys - ``` + +```bash +gpg --list-secret-keys +``` ## Message Encryption and Decryption 💌 - **Encrypt a message:** - ```bash - gpg -e -u "your-email@example.com" -r "recipient@example.com" message.txt - ``` - This creates `message.txt.gpg`. + +```bash +gpg -e -u "your-email@example.com" -r "recipient@example.com" message.txt +``` + +This creates `message.txt.gpg`. - **Decrypt a message:** - ```bash - gpg -o decrypted-message.txt -d message.txt.gpg - ``` - This creates `decrypted-message.txt`. + +```bash +gpg -o decrypted-message.txt -d message.txt.gpg +``` + +This creates `decrypted-message.txt`. ## GPG Folder Encryption Cheat Sheet 📂 ### Encrypting a Folder 🔒 1. **Create a tarball from the folder you want to encrypt:** - ```bash - tar -czvf archive.tar.gz /path/to/folder_to_encrypt - ``` -2. **Encrypt the tarball using GPG:** - ```bash - gpg -e -r your-email@example.com archive.tar.gz - ``` +```bash +tar -czvf archive.tar.gz /path/to/folder_to_encrypt +``` + +2. **Encrypt the tarball using GPG:** + +```bash +gpg -e -r your-email@example.com archive.tar.gz +``` ### Decrypting a Folder 🔓 1. **Decrypt the GPG file to a tarball:** - ```bash - gpg -o archive.tar.gz -d archive.tar.gz.gpg - ``` + +```bash +gpg -o archive.tar.gz -d archive.tar.gz.gpg +``` 2. **Extract the tarball to the original folder:** - ```bash - tar -xzvf archive.tar.gz - ``` + +```bash +tar -xzvf archive.tar.gz +``` ## Encrypting a message for yourself: [Different Method] 🤔 1. **Generate a Key Pair**: - ```bash - gpg --gen-key - ``` + +```bash +gpg --gen-key +``` 2. **Encrypt the Message**: - ```bash - gpg -e -u "Your Name" -r "Your Name" message.txt - ``` -3. **Decrypt the Message**: - ```bash - gpg -d message.txt.gpg - ``` +```bash +gpg -e -u "Your Name" -r "Your Name" message.txt +``` -## Encrypting a message for someone else: 🤝 +3. **Decrypt the Message**: + +```bash +gpg -d message.txt.gpg +``` + +## Encrypting a message for someone else: 🤝 1. **Import Their Public Key**: - ```bash - gpg --import theirkey.gpg - ``` + +```bash +gpg --import theirkey.gpg +``` 2. **Encrypt the Message**: - ```bash - gpg -e -u "Your Name" -r "Their Name" message.txt - ``` + +```bash +gpg -e -u "Your Name" -r "Their Name" message.txt +``` ## Exporting & Importing Keys 📤📥 1. **Exporting Your Public Key:** - ```bash - gpg --list-keys - gpg --export -a "Your Name" > public.key - ``` +```bash +gpg --list-keys +gpg --export -a "Your Name" > public.key ``` -Feel free to upload this to your GitHub repository! +Let me know if you need any changes!