3

I'm building a system that generates PGP key and store private key in secret vault. One thing I'm not fully understanding is the need for passphrase.

I can generate a random passphrase during the key generation and then store it in the secret vault along side with the private key, but I'm wondering if it has any benefit.

If I store both passphrase and private key in the same place and that place can be considered secure, is there any additional benefit of using the passphrase? Or just storing the private key securely is enough?

2 Answers 2

4

The benefit of a passphrase is an added layer of protection for your keys assuming that the attacker has no way of associating the passphrase and the key.

Let's assume an attacker gained access to this vault.

If it has both the passphrase and the key, then it matters not if the passphrase was randomly generated or what, they key is essentially (for lack of a better word) 'breached'.

If it has only the key with no passphrase, then the same result applies. Your keys are 'breached'.

If this vault has the keys with a passphrase (which isn't stored in the same vault), then your keys are a lot safe, and if generated properly, secured.

2

PGP operates with key pairs - a public and a private key, whereby the private key should be kept secret.

By default private keys are stored encrypted, for which a passphrase is required to decrypt them when needed to be used. This way, if the vault is compromised somehow, the attacker wouldn't be able to use the private key without decrypting it first (for which they need to find or brute force the passphrase somehow). Therefore, if you don't have a passphrase, the private key is merely stored in a file on the user's home directory.

If I store both passphrase and private key in the same place and that place can be considered secure, is there any additional benefit of using the passphrase?

Your description of "that place can be considered secure" is critical to this aspect. And if you can trust that definition for your purpose, then the passphrase loses relevance.

If however your "secure secret vault" turns out not to be secure, then what you are doing is effectively leaving the keys on your front door. Or on an unlocked box outside the front door.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.