encryption with gpg
Generate key
$ gpg --gen-keyList keys
$ gpg --list-keysEncrypt Data
With a passprhare
$ gpg -ca -o output.txt.gpg input.txtwith a certificate and from STDOUT
$ gpg -eaor if you know the name already (can be key, name or email)
$ gpg -ea -r "Ahmy"Decrypt Data
$ gpg -d file.txt.gpgExport
Public key
$ gpg --export -a "name" > public.key-a is to create armored ascii output.
Private Key
$ gpg --export-secret-key -a "name" > private.keyImport
Public key
$ gpg --export-secret-key -a "name" > private.keyPrivate Key
$ gpg --allow-secret-key-import --import private.keyDeleting
Public Key
$ gpg --delete-key "Real Name"Private Key
$ gpg --delete-secret-key "Real Name"Extend the expiration
gpg --edit-key "name"Select the key to extend
gpg> key 1
gpg> expireSend key to a key server
gpg --keyserver keyserver.ubuntu.com --send-key "name"Last updated
Was this helpful?