Skip to content


GNU Privacy Guard (GnuPG or GPG),replacement of PGP(Pretty Good Privacy) a free-software tool used to bring out encryption, it features a versatile key management system.


$ sudo apt install gnupg


To create Public and Private Keys
$ gpg --gen-key
List Keys
$ gpg --fingerprint ibaydan
Register To Key server
$ gpg --keyserver --send-keys 003D114F
Export Public Key in ASCII formats
$ gpg --armor --output pubkey.txt --export 'ibaydan'
Encrypt A file
$ gpg --encrypt --recipient 'ibayadan' --output ServerPass.txt.enc ServerPass.txt
Decrypt A file
$ gpg --output foo.txt --decrypt ServerPass.txt.enc
List Installed Keys
$ gpg --list-keys
Delete Key
$ gpg --delete-key ibayadan
Delete Key with Secret Keys
$ gpg --delete-secret-keys ''


For more information about the tool,

$ man gpg