3 ms·
> You shouldn't be using a KDF that takes significantly longer when the password gets bigger. Your KDF necessarily takes longer when the password gets longer a
by masklinn 7y ago
> You shouldn't be using a KDF that takes significantly longer when the password gets bigger.
Your KDF necessarily takes longer when the password gets longer as it's a hash function and thus O(n).
For typical password sizes (typically under 64 bytes), you're below the hash's blocksize so the effect is nil and you can treat it as a constant but it will start coming into play as the size of the key and thus the number of blocks to feed into the hash increases.
- Dylan16807 7y agoA KDF is not a hash function, and I said "significantly" for a reason. If adding a megabyte of input causes the original megabyte to get hashed or otherwise processed once, then you pass the test. If adding a megabyte of input causes the original megabyte to get fed into your algorithm 100000 times, then you fail the test.