- Generate a new GPG key pair:
gpg --full-generate-key
- List all keys in your GPG keyring:
gpg --list-keys
- List all the secret keys in your GPG keyring:
gpg --list-secret-keys
- Encrypt a message:
gpg -e -u "[email protected]" -r "[email protected]" message.txt
This creates message.txt.gpg
.
- Decrypt a message:
gpg -o decrypted-message.txt -d message.txt.gpg
This creates decrypted-message.txt
.
- Create a tarball from the folder you want to encrypt:
tar -czvf archive.tar.gz /path/to/folder_to_encrypt
- Encrypt the tarball using GPG:
gpg -e -r [email protected] archive.tar.gz
- Decrypt the GPG file to a tarball:
gpg -o archive.tar.gz -d archive.tar.gz.gpg
- Extract the tarball to the original folder:
tar -xzvf archive.tar.gz
- Generate a Key Pair:
gpg --gen-key
- Encrypt the Message:
gpg -e -u "Your Name" -r "Your Name" message.txt
- Decrypt the Message:
gpg -d message.txt.gpg
- Import Their Public Key:
gpg --import theirkey.gpg
- Encrypt the Message:
gpg -e -u "Your Name" -r "Their Name" message.txt
- Exporting Your Public Key:
gpg --list-keys
gpg --export -a "Your Name" > public.key