

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Key Derivation Functions
incomplete
2: Argon2 – Storing Passwords
incomplete
3: Argon2 Phc Review
incomplete
4: Salts
incomplete
5: Why Are KDFs Slow?
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Let's look at the output string we generate for Argon2id using the PHC format:
$argon2id$v=19$m=65536,t=3,p=2$<saltBase64>$<hashBase64>
This isn't just a hash. It's a self-describing string with:
65536 = 64MiBBecause it embeds the parameters and salt, you can tune settings later and still verify old hashes.
A salt is a random chunk of data added to a password before it is hashed so that its output hash will differ from the hash of the same password with a different salt. We'll talk about these in more detail soon. Again, we need it to be stored in the output so that we can use it to check the hash later.
The hash is the Argon2id–derived key: the result of running the password together with the salt and the chosen parameters (m, t, p) through the KDF. In the PHC string it's the final, base64 (no padding) field:
$argon2id$v=19$m=...,t=...,p=...$<saltBase64>$<hashBase64>
^^^^^^^^^^^
It's not reversible. To verify a password, you recompute the derived key using the stored salt and parameters, then compare the new bytes to the stored hash using a constant-time check.