Any Kotlin-specific library is going to be less mature than the Java standard library equivalent, which matters a lot for anything cryptographic.
n
Nathan Kleinschmidt
04/14/2022, 3:29 PM
I haven’t used PBKDF2 before - looks like it’s similar to BCrypt, with salts. Are you using the Spring Security library?
n
nschulzke
04/14/2022, 5:38 PM
You could do that and it would be a very safe bet, but I'm not.
r
Robert Menke
04/14/2022, 7:18 PM
PBKDF2 is NOT similar to bcrypt. PBKDF = password based key derivation function. You are using a password to derive a key. This is not even remotely the same as bcrypt, which is a hashing algorithm with an associated cost that helps prevent someone from using brute force to crack passwords on your system.
n
nschulzke
04/14/2022, 8:02 PM
Many people do use pbkdf2 to hash passwords to prevent brute force attacks on a leaked database, and as near as I can tell this use is still blessed by NIST. BCrypt is better at resisting such attacks because attackers can't use GPUs as easily, and it is probably the correct choice going forward, but comparing the two is not comparing apples to oranges. They're both widely used for the same purpose: hashing passwords to slow down brute force attacks.
h
hfhbd
04/14/2022, 9:12 PM
I would just use BCrypt with the spring-security-crypto, simple, secure and widely used.