-
Notifications
You must be signed in to change notification settings - Fork 19
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
document the purpose of associated data #14
Comments
it's arbitrary data that one could include with the password and salt to compute the hash value. its value is entirely up to you. i think the phase, "optional associated data" hits the nail on its head. do you have a better suggestion? |
How is that different from the salt? |
Salt is a nonce, AD might not be. |
This is not clear from the documentation, which does not mention a difference between the salt and the AD (besides the minimal length). Couldn't you just append the AD to the salt? If yes, why have another parameter for that? |
why don't you have a look at the argon2 spec? |
Unfortunately the spec is not very clear on that part. The salt and the associated data enter the algorithm differently, but their conceptual difference is not explained. I opened an issue with the question in the official Argon2 repository. (See P-H-C/phc-winner-argon2#151.) |
AD is a common inclusion in authenticated cryptographic constructions; it is not unique to Argon2. Usually, it would be used where you wish to have some identifier or descriptor of the encrypted contents that can be read without decryption, but is authenticated by the same system that the contents themselves are. There are variants on this, of course, so one must study the algorithm description to be sure (or find a reputable summary). |
The discussion on the official repository I think flushes out the idea well enough to get the point across. If you use the AD input, it produces a different result than appending to the salt due to the order of operations, but it acts like a longer salt as far as the cryptographic context is concerned. It can tie a series of operations to a constant within a given system and/or for a specific purpose, something that all operations must contain to produce the same results. The benefit of using the dedicated input is no need on the part of the programmer to manipulate the salt in order to extend it. As pointed out there, however, it can impact the encoding of the output and force the use of the CTX structure input instead of just an encoded string. |
See P-H-C/phc-winner-argon2#143 regarding encoded strings, the Associated Data and KeyID fields are not produced during the encoded string output, and are not parsed during input, so you are forced to use the context input method when you use either field. Implementation hurdle, but not a show-stopper. |
I got this comment They quotes from here: https://github.com/P-H-C/phc-winner-argon2
Something like this would be useful in this library. |
Right now it is not clear what purpose the associated data serves. It would be great if it could be documented.
The text was updated successfully, but these errors were encountered: