-
Generate a public/private key pair!
gpg --generate-key
-
Export a public key
gpg --output name_of_file.gpg --export email_of_user
-
Import a public key
gpg --import name_of_file.gpg
-
Encrypt a file
gpg --recipient address@example.com --output encrypted_file.gpg --encrypt name_of_file.txt
-
Decrypt a file
gpg --output name_of_file.txt --decrypt encypted_file.gpg
-
Sign and encrypt a file
gpg --recipient address@example.com --encrypt --sign name_of_file.txt
The output flag is use the specify the name of the newly created file.