Red Hat System Administration III - Unit 4 - Encrypting Files with GnuPG
Overview
- Public-key encryption (aka asymmentric encryption)
- Anything encrypted by public key, can only decrypted by private key
- GNU Privacy Guard:
- GnuPG or GPG is an open-source implementation of OpenPGP
GPG Commands
- Generate a key pair:
gpg --gen-key
- List public keys
gpg --list-keys
- Export a public key
gpg --export --armor -o file.key key-id
- Import a public key
gpg --import key
- Encrypt a file
gpg --encrypt --armor -r <key-id> <file>
- Decrypt a file
gpg --decrpyt <file>
- Can encrypt with public key and send via to person with private key to decrypt
- Can encrypt with private key and send to people with public key to decrypt