1
$\begingroup$

Is the symmetric key derived for AES only dependent on the passphrase?

Is it possible to generate the encryption key such that it is based on my primary GPG private key and temporary passphrase? In this case, the attacker would have to know the passphrase as well as my GPG key to decrypt the text.

$\endgroup$
2
  • 1
    $\begingroup$ What GPG and PGP call symmetric does not use a privatekey (which they call secret). If you use what they call publickey encryption it uses your static private key and its password, but no 'temporary' password. $\endgroup$ Feb 17, 2021 at 2:41
  • $\begingroup$ So, there is no straightforward way to get a symmetric key from a temporary passphrase and my static private key? $\endgroup$
    – sanket1729
    Feb 17, 2021 at 20:01

1 Answer 1

-1
$\begingroup$

In GPG the symmetric key used to encrypt data is generated randomly. That key is then wrapped (encrypted) using a public key or multiple public keys and anyone with any of those private keys can then unwrap (decrypt) the symmetric key and decrypt the data. Typically, private keys are protected with passwords. So yes, under normal circumstances, an attacker would need a copy of your encrypted private key and knowledge of your password in order to decrypt data sent to you.

Notice I said "multiple public keys" above. So, anyone who's public key was included can decrypt the data so if multiple people are included in then any of them can decrypt the data and the compromise of any of their private keys or passwords would result in that encrypt data being compromised as well.

$\endgroup$
2
  • 2
    $\begingroup$ The classic and default encryption in PGP and GPG is as you describe hybrid: nonce DEK wrapped by RSA, ElG, or ECDH. But what PGP and GPG call symmetric is wrapping the DEK by password-based encryption (only) using a derivation they call s2k (String To Key). See gnupg.org/documentation/manuals/gnupg/… and tools.ietf.org/html/rfc4880#section-5.3 . $\endgroup$ Feb 17, 2021 at 2:38
  • $\begingroup$ @dave_thompson_085, yes my question is asking whether the String part (String to key) function only dependent on the passphrase I entered. Your comment in the question answers it, I will mark it as accepted if you post it as an answer. $\endgroup$
    – sanket1729
    Feb 17, 2021 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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