Comments (10)
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?
from argon2rs.
How is that different from the salt?
from argon2rs.
Salt is a nonce, AD might not be.
from argon2rs.
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?
from argon2rs.
why don't you have a look at the argon2 spec?
from argon2rs.
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.)
from argon2rs.
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).
from argon2rs.
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.
from argon2rs.
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.
from argon2rs.
I got this comment
They quotes from here: https://github.com/P-H-C/phc-winner-argon2
The secret parameter, which is used for keyed hashing. This allows a secret key to be input at hashing time (from some external location) and be folded into the value of the hash. This means that even if your salts and hashes are compromised, an attacker cannot brute-force to find the password without the key.
The ad parameter, which is used to fold any additional data into the hash value. Functionally, this behaves almost exactly like the secret or salt parameters; the ad parameter is folding into the value of the hash. However, this parameter is used for different data. The salt should be a random string stored alongside your password. The secret should be a random key only usable at hashing time. The ad is for any other data.
Something like this would be useful in this library.
from argon2rs.
Related Issues (20)
- `cargo bench --features=simd` crashes the compiler HOT 3
- Support using AVX and even AVX512 HOT 7
- Hash doesn't add the fields & verification example HOT 4
- Separate cargon dependency from the rest of the benchmark and test suites. HOT 1
- Making argon2rs #![no_std] - lanes configuration? HOT 7
- Please include a copy of the license in the root of the repository HOT 1
- Documentation suggests 2i is safer
- Add support for Argon2id Variant
- panics if k.len() > 32
- Display hash value in standard PHC String Format HOT 2
- Another hash from other tools/libs HOT 2
- Generate a random, universally unique salt automatically HOT 6
- release a new version
- Display hash value in standard PHC String Format
- Update to `ARGON_VERSION_13` (version 19). HOT 4
- Transfer to RustCrypto?
- Relicense under dual MIT/Apache-2.0 HOT 3
- Consider use of inline asm/other optimizations HOT 4
- Implement std::error::Error for error types HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from argon2rs.