2
$\begingroup$

I think GPG is difficult to understand . All the different versions and policies and algorythms . But today I got really confused . I tried to create a 3072 bit DSA key ( which as far as I undestand DSA can only be used for signing ) and encrypted some data with it . And well ... It worked . So here are my questions :

1) Why does The Digital Signing Algoryhtm encrypt data and why is this even an option in gpg ?

2) Is with DSA "encrypted" ( if it even is ) data secure ?

$\endgroup$
2
  • $\begingroup$ You are absolutely right that GPG is hard to understand! However, it is hard to tell exactly what you did from this description. It is more likely that you generated two key pairs, with a DSA key pair as your primary one, and an encryption key as a subkey. You'll have to write down a transcript of what operations you did to ‘encrypt’ data with it, and what gpg --list-keys reports, and if you have a file foo.gpg, what pgpdump < foo.gpg reports. But you should assemble all this into a query to a GnuPG support forum, not crypto.se. $\endgroup$ Nov 8, 2017 at 22:49
  • $\begingroup$ DSA is not used for encryption, and it is probably not a good idea to use it for signing either. If you generate a DSA key you either chose ‚sign only‘ or generate an ElGamal subkey which is used for encryption. $\endgroup$
    – eckes
    Nov 9, 2017 at 3:57

1 Answer 1

5
$\begingroup$

Why does The Digital Signing Algorithm encrypt data [...]?

You can't encrypt data using DSA.
However gpg supports ElGamal encryption, which is an encryption scheme which can be quite naturally derived from the Diffie-Hellman key exchange and typically gpg pairs "DSA signing" with "ElGamal encryption". Why is it paired like that? Because (in theory) you could use your DSA public key for ElGamal encryption and both scheme's security is strongly related to the discrete logarithm problem, so it makes sense pairing them.

Why is this even an option in gpg ?

Back in the day, the dark ages of crypto, RSA was patented. That is you needed to license it from RSA (the company) to use it. This is one of the reasons why DSA was developed and as established above pairing ElGamal with DSA makes sense. Now of course gpg was also affected by the patent issues surrounding RSA which is (I could imagine) why they originally offered only DSA / ElGamal. The RSA patents have expired in the 2000s which is why we have now RSA for everything and DSA / ElGamal mostly is left in for backwards compatibility and to let users a choice on factoring vs discrete logarithm based security.

Is with DSA "encrypted" ( if it even is ) data secure ?

As this means that the data is actually encrypted with ElGamal and only used to encrypt the key for hybrid encryption, I'm very confident that this is actually secure.

$\endgroup$

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.