-
Notifications
You must be signed in to change notification settings - Fork 28
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
Inconsistent use of bytes length/encodings? #86
Comments
I'm not sure I understand the question. Doesn't UTF8 deterministically encode all base64 strings? Where does the inconsistency arise? |
The thing is that the lib is encoding the bytes with one encoding and decoding it with a different one. The decoding is not explicit in this lib, but is done by the pbkdf2 of the crypto module. |
So, I assume, with my newbie cryptography knowledge, that the entropy is by definition the same regardless of how you encode the bytes. If that is the only desirable property of the salt, it may be alright. |
createSalt
generateskeyLength
bytes and then transform it in a base64 string. This string is passed topbkdf2
as salt, but pbkdf2 treats strings as utf8, so the given salt is not the same random sequence of bytes generated early.Can be assumed that the salt is still random even if has been expanded by the inconsistent use of the encodings? Are there any security implications? Usually in cryptography when you introduce some fixed points you open yourself to some kind of attacks.
The text was updated successfully, but these errors were encountered: