linux poison RSS
linux poison Email

HowTo Use GPG

1. Key Generation

gpg # Initialize GPG for this user (e.g. create ~/.gnupg). Only have to run once.
gpg --gen-key # Start key generation process. Follow prompts.

2. Viewing Keys

gpg --list-keys # View public keys
gpg --list-secret-keys # View private keys

3. Exporting Public Keys

gpg --export # Exports key in binary format
gpg --export --armor # Export in a usable, ASCII format

4. Importing Public Keys

gpg --import /path/to/public/key/file

5. Encrypting a Message

gpg --encrypt --armor --recipient message_file # Creates encrypted message in an ASCII format

6. Decrypting a Message

gpg encrypted_message_file

You will be prompted for the filename to use for the output of the decryption process.
7. Encrypting with a Symmetric Key

gpg --symmetric --armor message_file

8. Signing and Encrypting a Message

gpg --sign --encrypt --armor --recipient message_file

9. Creating a Detached Signature

gpg --detach-sign --armor message_file # Sender
gpg --verify message_file.asc message_file # Recipient

10. Signing Another's Public Key

A is going to sign B's key.

# First, A must do:
gpg --sign-key B
gpg --export --armor B > B.key

# Then, B must do:
gpg --import B.key


Post a Comment

Related Posts with Thumbnails