This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static org.springframework.security.crypto.bcrypt.BCrypt.hashpw; | |
import static org.springframework.security.crypto.bcrypt.BCrypt.gensalt; | |
import static org.springframework.security.crypto.bcrypt.BCrypt.checkpw; | |
public class CryptoTest { | |
public static void main(String[] args) { | |
String plainText = "Password123"; | |
String hash = hashpw(plainText, gensalt(12)); | |
if (checkpw(plainText, hash)) { | |
System.out.println("Hashing verified."); |
NewerOlder