SecurityInnovation / PGPy

Pretty Good Privacy for Python
BSD 3-Clause "New" or "Revised" License
317 stars 99 forks source link

[Bug] DSA GPG Keys not working #376

Closed hqnna closed 3 years ago

hqnna commented 3 years ago

I am trying to use a DSA based GPG key on a service that uses this project (https://sr.ht) and get an error

We were unable to encrypt a test message with this key

This emplies that the library/project i'd imagine is failing to encrypt a message using DSA based keys? Is there any way this can get looked into?

Commod0re commented 3 years ago

so, DSA is incapable of doing any encryption operations whatsoever - it is a sign/verify only key format.

Typically, DSA keys are paired with an ElGamal subkey for handling encryption. Unfortunately, our crypto library does not support ElGamal at all. If you look at the implementation progress documentation page you will see that we support most relevant operations for DSA (sign/verify only, as mentioned), but we only support loading ElGamal keys at this time

Commod0re commented 3 years ago

it's something we'd like to support someday; see #108

Commod0re commented 3 years ago

if you can edit the key, you could add a subkey where we do support encryption/decryption operations like RSA or ECDH, but unfortunately that's the best workaround we can offer for now