-
Notifications
You must be signed in to change notification settings - Fork 204
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
Trait for weak keys #1738
Comments
Sounds interesting. Do you imagine something like this? trait WeakKeyTest: KeySizeUser {
fn weak_key_test(key: &Key<Self>) -> Result<(), WeakKeyError>;
} One open question is whether we should have a default impl which returns |
Something along those lines, and a: impl<T> for Key<T> where T: WeakKeyTest {
fn is_weak(&self) -> Result<(), WeakKeyError> {
T:weak_key_test(self)
}
} To make it a bit more convenient to use. I guess |
This was referenced Jan 29, 2025
tarcieri
pushed a commit
to RustCrypto/block-ciphers
that referenced
this issue
Feb 11, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would be great to get a trait to test for weak keys.
For example there are 64 known weak keys for DES (https://en.wikipedia.org/wiki/Weak_key#Weak_keys_in_DES), or an AES key with zeros on the upper half.
The purpose is the rejection of weak keys as specified in the TPM spec section 11.4.10.4:
https://trustedcomputinggroup.org/wp-content/uploads/TPM-2.0-1.83-Part-1-Architecture.pdf#page=82
The text was updated successfully, but these errors were encountered: