-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Enforce 192-bit key length for TripleDES #13928
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
Enforce 192-bit key length for TripleDES #13928
Conversation
TripleDES now emits a deprecation warning when 8-byte (single DES) or 16-byte (two-key) keys are passed. In a future release, only 24-byte (192-bit) keys will be accepted. Users needing single DES or two-key Triple DES compatibility should expand the key themselves: - Single DES (8 bytes): key + key + key - Two-key 3DES (16 bytes): key + key[:8]
f0177b0 to
1937220
Compare
|
Have we tagged our downstreams to let them know about this? |
|
No, I was going to let the warning play that role. (Since this is a warning and not an immediate breakage.) |
|
We definitely have a recurring issue where people just generate the default, or sometimes even the shortest available, key for tests. And we don't have good infrastructure for responsiveness to warnings 😬 |
|
@glyph good news, the problem is far dumber: https://github.com/twisted/twisted/blob/506d17fb71abf213dc77cfe7b55eb1fafb5f2437/src/twisted/conch/test/test_transport.py#L702-L705 this assumes all keys have a size of 16 bytes, but that's wrong for 3des, it's key size is 24 bytes. If you fix that, I think twisted will be good. |
|
OK, unless I hear otherwise, I assume Twisted is good now |
|
Thanks a lot for the heads up, I've drafted a PR on our side to have this ready.
Heh yeah, for compat with ancient IPSEC, Kerberos and TLS cases. |
|
thanks for jumping on this! |
TripleDES now only accepts 24-byte (192-bit) keys. Users needing single DES (1-key) or two-key Triple DES compatibility must expand the key themselves:
This change removes the automatic key expansion that was previously done in the TripleDES constructor, making the key length requirement explicit and preventing accidental use of weaker key configurations.