-1
$\begingroup$

I want to make it as hard as possible to brute force data I hash. How can I make hashing take X seconds?

$\endgroup$
2

1 Answer 1

2
$\begingroup$

Consider using key derivation functions like Argon2 or Lyra2. Unlike hash functions like SHA3 which are fast by design, key derivation functions are designed to consume much resources and make brute-forcing much harder.

Argon2 has for instance following parameters:

  • The number of iterations
  • Memory factor
  • The number of threads or lanes

An attacker can use powerful CPUs or GPUs and run many brute-forcing processes in parallel. To limit such parallel computations you may increase the memory factor. Depending on the factor, this can mean higher costs for an attacker to buy/rent more memory.

On the other hand, keep in mind usability. If these data are requested often by users, may be they cannot wait to long, may be they will accept delays not more than 1-2 seconds.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.