How to export your private key to an ASCII / text file in GnuPG

Once you have generated your key pair, you need to make sure you back it up safely, to prevent the loss of the keys if the computer crashes or is re-installed.

We normally export the private key to an ASCII / text file for safe-keeping off the computer on a USB drive. Basically, as a backup. Secondly, files encrypted or signed with an older key will not be decryptable or verifiable with any other key. The key is also stored elsewhere to help recover it if the computer crashes. Since this is your private / secret key, you need to make sure that it is not accessed by others.

Open a terminal window on your Ubuntu system and enter the following command.
$ gpg --export-secret-keys --armor john.doe@emaildomain.com > johndoesec.asc <enter>

The private / secret key will be exported to a file johndoesec.asc.

Exports the secret key into an armoured ASCII file. Store this file safely somewhere, where it will not get lost.

You can also copy your private key to your Android phone or device and use Android Privacy Guard app with K-9 Mail app to send signed as well as encrypted emails to those who you know. Note that to encrypt the email, you need to have the public key of the person you want to send the encrypted email to.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s