GnuPG (GNU Privacy Guard) is a cryptographic tool for encrypting files and managing digital signatures on GNU/Linux systems.
Generate GPG keys
Follow the prompts to create your key pair. Use a strong passphrase.
Import public keys
Verify key fingerprints
Always verify imported keys to prevent attacks:
Compare this fingerprint with the key owner through a secure channel.
Encrypt files
Encrypt a file for someone else:
The --armor
flag creates ASCII output instead of binary format.
For multiple recipients:
Decrypt files
Digital signatures
Sign a file:
Verify signatures:
Key management
List keys:
Export your public key:
Git integration
Sign your commits:
Configuration
Create ~/.gnupg/gpg.conf
:
cipher-algo AES256
digest-algo SHA512
keyid-format 0xlong
with-fingerprint
GnuPG is essential for securing files and verifying authenticity in academic and development workflows.