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 @@ - - -
-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
+ ```
-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`.
-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
+ ```
- gpg -e -r your-email@example.com archive.tar.gz
-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
+ ```
- tar -xzvf archive.tar.gz
-gpg --gen-key
+1. **Generate a Key Pair**:
+ ```bash
+ gpg --gen-key
+ ```
- 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
+ ```
- gpg -d message.txt.gpg
-gpg --import theirkey.gpg
+1. **Import Their Public Key**:
+ ```bash
+ gpg --import theirkey.gpg
+ ```
- gpg -e -u "Your Name" -r "Their Name" message.txt
-Exporting Your Public Key:
+1. **Exporting Your Public Key:** + ```bash + gpg --list-keys + gpg --export -a "Your Name" > public.key + ``` -gpg --list-keys
+```
- gpg --export -a "Your Name" > public.key
-