loading...

re: How to Securely Store a Password in Java VIEW POST

FULL DISCUSSION
 
// Java
import java.security.SecureRandom;

private static final SecureRandom RAND = new SecureRandom();

System.out.println(RAND)

Just in case someone ever asks me why I refuse to use Java ;)

// JavaScript/TypeScript
import { hash } from 'bcrypt'

const random: string = hash('seed', 10)

console.log(random)

Very nice article though!

 

You can use BCrypt in Java as well Hashing passwords in Java with BCrypt.

public String hash(String password) {
    return BCrypt.hashpw(password, BCrypt.gensalt(logRounds));
}

public boolean verifyHash(String password, String hash) {
    return BCrypt.checkpw(password, hash);
}
Code of Conduct Report abuse