Skip to content

Instantly share code, notes, and snippets.

View Nickster258's full-sized avatar
... classic

Nicholas Stonecipher Nickster258

... classic
View GitHub Profile
@craSH
craSH / Password.java
Last active June 12, 2024 05:13
A simple example Java class to safely generate and verify bcrypt password hashes for use in authentication systems.
/**
* Author: Ian Gallagher <igallagher@securityinnovation.com>
*
* This code utilizes jBCrypt, which you need installed to use.
* jBCrypt: http://www.mindrot.org/projects/jBCrypt/
*/
public class Password {
// Define the BCrypt workload to use when generating password hashes. 10-31 is a valid value.
private static int workload = 12;