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 "your-email@example.com" -r "recipient@example.com" message.txt
Decrypt a message:
gpg -o decrypted-message.txt -d message.txt.gpg
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
tar -xzvf archive.tar.gz
gpg --gen-key
gpg -e -u "Your Name" -r "Your Name" message.txt
gpg -d message.txt.gpg
gpg --import theirkey.gpg
gpg -e -u "Your Name" -r "Their Name" message.txt
Exporting Your Public Key:
gpg --list-keys
gpg --export -a "Your Name" > public.key