linux poison RSS
linux poison Email

Using 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

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

Alice is going to sign Bob's key.

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

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


0 comments:

Post a Comment

Related Posts with Thumbnails