-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use StandardPolicy by default and allow NullPolicy when the user wants it #29
Comments
My strong recommendation, as discussed elsewhere today, is to expose a safe-by-default API with as few knobs (in the vein of NaCL) as possible. Specifically, please don't use the NullPolicy, and avoid adding a policy parameter. |
As @nwalfield suggested, we should remove all references to the |
After I moved the code to start using only
Now, I generated this encrypted file using
And the steps were as mentioned below:
Now, if I encrypt the text using
I think this means Update: It seems If we don't allow, then it means we can not decrypt any of the old encrypted files via |
Trying it out using
So, it appears that the message is encrypted using 3DES. NIST deprecated 3DES in 2017.
Perhaps you can't. But, I'm not sure why this is so bad. Is Secure Drop really being used to read old messages? |
Thank you for this example, now I learned how to get better errors. I read the source of
Yes, many times the sources are communicating over many months. Or people may want to use this to decrypt something encrypted many years ago. @nwalfield can we allow Also it is sad to see that |
Looking at tests/files/hellopublic.asc, there is a Hash preferences subpacket, but not Symmetric Algorithm preferences subpacket, which would explain why gpg is falling back to 3DES. How did you create that key?
|
FWIW, I just created a key with 'sq key generate' and the Symmetric algo preferences subpacket is present.
|
I used this call https://github.com/kushaldas/johnnycanencrypt/blob/master/src/lib.rs#L378 , maybe I must add the symmetric algo preference there. |
I just now created another set of keys, and they also have proper |
The
Yes, there was a bug. The preferred algorithm packets were added to the subkey binding signatures instead of the user id self signatures. |
Ah, this explains. Means I just have to recreate the keys, and update all tests now :) |
It was fixed in this commit: https://gitlab.com/sequoia-pgp/sequoia/-/commit/87b02b2bae6cc8ee838c8f46208a56339ebf3316 |
Fixes #29 uses StandardPolicy everywhere
Right now the implementation uses NullPolicy through out the codebase. But, this is insecure (allows
md5
orsha1
) and should not be used. This will only required when dealing with old keys.Any new key created using the module should be fine and use StandardPolicy as default.
We add a policy parameter while creating the
KeyStore
object, and only ifNone
is used as argument, we should use theNullPolicy
or elseStandardPolicy
as default.The text was updated successfully, but these errors were encountered: