I see more and more people starting using pgp encryption and this is a good thing.
But peoples often store XOR use PGP in the wrong way.
The worst example is given by keybase. I really like the concept of signed account’s certifications, domain verification and PGP registry, but this service offers you to store and backup your private key for you, to use the secure chat or the encrypted git for example. Sharing your private key is always a bad idea, even if it is with the most secure webservice in the world or if it is your mom.
I also use proton mail, how uses a nice in-browser key generation and encryption. But your private key, who was generated in the client web browser, is stored in the Protonmail server (or in another place, who knows ?). Fortunately, you can only get back your public key, so in case of account stealing, the attacker cannot get back your private key (but he can still use decryption inside Protonmail). So Protonmail is a good way to protect you against man-in-the-middle attack, but it is useless if you already encrypt your communications with PGP.
So my recommendation is:
- Never share your private key, in any context;
- Encrypt each device where your private key is stored (PC, mobile, server …);
- Choose a UNIQUE and strong passphrase;
- Think carefully about your backup methods :
About this last point, I think a good way to do that is to split your private key and encrypt each parts and store them is a safe place. Let’s detail this method.
Respecting the Kerckhoffs’s principle, I will share with you my personal method to backup my pgp private key.
First, I export my private key in ASCII form and put it in a file:
gpg --export-secret-keys --armor email@example.com > privatekey
You notice I use openGPG, but the principle remains the same for the others software.
Then I split my private key in N part. N is your level of paranoia. You can do this with the following command:
split -n N privatekey --numeric-suffix privatekey
Now you have N files
privatekeyN-1 who all contains a part of your private key.
We can now encrypte each part one by one. We will de a simple symmetric encryption like :
gpg --symmetric privatekey00
Use a different and strong passphrase for each part. Using a password manager (eg. Keepass) is a nice way to do it, except if you store your password database and your backup in the same place.
You can now dispatch yours
privatekeyN.gpg in safe places, in usb keys for example. I also suggest you store the keys with his checksum, and control integrity each time you transfer/manipulate an encrypted part of the private key.
(open source and trusted by devs everywhere ❤️)