-
Notifications
You must be signed in to change notification settings - Fork 42
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
"Key length is not legal" when using a binary secret key #45
Comments
here's the example from the README:
Just disable key size checking. It worked for me! I know very little about crypto, so I don't know what this implies, but since it seems to work on the surface... |
@sovattha is your key contains any null byte \x0? |
@tugrul Hi, no my key does not contain any null byte. I created a test here. Just click Run.
Hope this helps you guys helping me :-) |
I also encountered the same problem ! |
Hope someone help me ~ |
Hello,
I would like to encrypt a string using the algorithm 'rijndael-128' in 'ecb' mode.
My key is in binary format.
I create my key with the following code.
Then I would like to encrypt my message with the key using:
secret.length
is 32. But I get the message:Key length is not legal.
If I leave the key validation size, I get:
Invalid key size. Available key size are [16, 24, 32]
I know the key should be either a string or a buffer. I did convert my key into a buffer:
It works, but the result is not the one expected.
Would you have any suggestion?
The text was updated successfully, but these errors were encountered: