over 2 years ago
build.gradle
apply plugin: 'java'
apply plugin: 'eclipse'

repositories {
    mavenCentral()
}

dependencies {
    compile 'org.springframework.security:spring-security-core:4.0.1.RELEASE'
}
Test1.java
package com.sam.test;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class Test1 {

    public static void main(String[] args) {
        int i = 0;
        BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
        while (i < 10) {
            String password = "123456";
            
            String hashedPassword = passwordEncoder.encode(password);
     
            System.out.println(hashedPassword);
            i++;
        }
        
        System.out.println(passwordEncoder.matches("123456ergnesiougsefwewfwer34Tt1", "$2a$10$Ja8bUpc2cacAB0EvXcj1JO2i4PgGWWvxaQ.FSZ.prQdCkEFEQNNBi"));
    }
}
$2a$10$RjV.cEW29EGHXZZfFNoQFOz/J.PVVvkc2MWdUv1XQQhwWUfDSw7fa
$2a$10$pPKzHES6BE6YV9pqZwpaeeZEpA7jf24WWUdctXpmyzyk7z4kBh.2S
$2a$10$F9sRVVH90yRtnjJeC28HQOtWMDwqD1FqQ/Lhjf4UGRmVVA7HoJjxK
$2a$10$Dst6SnEdB2g1L9o0LfJoQ.Y8XwKoaKkoSkGNMxKsOaRRdHvB5yysy
$2a$10$igeXt7sS7jguvQBl4ILzy.DICtQa6zkdGiCp9u/lQ2KDv/wPU9E7W
$2a$10$lD00aUWxJG/Xiq5bMHdhZOHbaEHKpYAAs8k847Q0Vq7nQVNX1pRu.
$2a$10$fgLEGoiVPIKXw8h2qYtUp.UrcQawvXYZDEEj1AUwORUNFu70i5il.
$2a$10$d4nNA9OSjfPWvaKsDScxAuwBlUpX909fY1/Pwq7lsZhZ0Vx/DZF4W
$2a$10$hgQqIohovnGbA.UbIzom8OanIHyrA3lMRH3JMQcO.3saJ5XMujRl.
$2a$10$c85hYXPx4niZCCkmxeqXHOriQvvaWBSd9SVpYoq2ZAbs0uUa1ESL.
false
← Fastjson and Jackson example JDK8 Date Time →
 
comments powered by Disqus