14 lines
620 B
Java
14 lines
620 B
Java
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
|
|
public class HashGen {
|
|
public static void main(String[] args) {
|
|
BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(10);
|
|
String rawPassword = "Admin@12345";
|
|
String hash = encoder.encode(rawPassword);
|
|
System.out.println("=== BCrypt Hash Generator ===");
|
|
System.out.println("Raw password: " + rawPassword);
|
|
System.out.println("Cost factor: 10");
|
|
System.out.println("BCrypt hash: " + hash);
|
|
System.out.println("Verify match: " + encoder.matches(rawPassword, hash));
|
|
}
|
|
} |