I've tried to get a public key size of DSA/Elgamal PGP certificate. Using the Cleopatra I find out that there is actually two public keys - one with DSA with key size 1024 bits and the other Elgamal with 2048 bits. Now my question is which of this key sizes is the actual key size for this certificate and more importantly, why?

  • $\begingroup$ Usually DSA is just used for signatures while El Gamal is used for decryption. $\endgroup$ – Maarten Bodewes Jul 1 '16 at 22:21
  • $\begingroup$ I mean, it could be both, display the certificate here in base 64 so we can be sure $\endgroup$ – Maarten Bodewes Jul 3 '16 at 21:42
  • $\begingroup$ I maybe figure it out. It's just because I use the Bouncy Castle library to get the size of the key size. But I expect to return a key size of El-Gamal algo, instead the DSA key size is returned. DSA in this case is a master key, however El-Gamal is a subkey. I think it's kind of related to this. :) $\endgroup$ – user4881671 Jul 18 '16 at 5:40
  • $\begingroup$ What does ‘actual key size’ mean—what is the metric of key size that is relevant to you? Are you trying to find storage costs? Estimate attack costs? Estimate computation costs? $\endgroup$ – Squeamish Ossifrage Apr 18 '19 at 2:23
  • 1
    $\begingroup$ Note that PGP principals can have many different keys associated with them. There's always one primary key which is used to certify subkeys, but you might have (say) a primary certification key, an encryption subkey, a long-term signature subkey, a short-term email signature subkey, and an authentication subkey. $\endgroup$ – Squeamish Ossifrage Apr 19 '19 at 4:05

It's extremely likely that 1024 is the master key size as authentication and signing are usually the main purposes of PGP. The key used for encryption is generally valid for a shorter time and is therefore a subkey of the master key. So both 1024 and 2048 bit public keys are included in the PGP certificate.

Note that the key size for encoding the key will be larger and the key strength (compared to e.g. an AES key) will be much less.

Both 1024 and 2048 bit keys are rather small for common purposes. It is highly advisable to upgrade to larger, RSA based keys. For more information about key sizes and their strengths, please take a look at https://keylength.com.

| improve this answer | |

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.