My question is what would be more secure, generating 2 hashes (one key and one hash) with the same password and two different salt values, or generating one long hash with a single salt, taking the first half as a secret key and the second half as a hash for the password.

I would be interested in the security differences of both approaches and in the perfomance differences. I would assume that generating one long hash will be faster than generating 2 short hashes, however i am not sure if the difference is relevant for practical purposes.
As for the security getting the password will be practically impossible in both cases, however i am using the first half of the hash as a key, not the password itself. I am unsure how hard it is to guess a hash given one half of it.

I am working on a bibifi contest and have to create a secure logfile. The catch is, that i am receiving only a password and i cannot pass along any information except in the log itself. For the log i need to check the integrity of the file and the correctness of a given password (and distinguish the two cases).

To be able to do this i thought about generating two argon2 hash values with the same password and different salt values, appending everything to the file and mac all of it to ensure integrity. The file would then look like this:

  • $\begingroup$ It "should" be fine, assuming no attacks are found on the hash function to correlate its output this way. But why risk it? Performance difference should be trivial to calculate, depending on what hash functions you're considering. $\endgroup$ May 24 at 17:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.