-
-
Save miklobit/00cda0b46832bfa6d1c10ecdce710e3a to your computer and use it in GitHub Desktop.
BCryptPasswordEncoder
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 org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; | |
import java.util.Scanner; | |
public class BCryptPasswordEncoderRun { | |
public static void main(String[] args) { | |
System.out.println("Generate BCrypt encoded string of a raw password."); | |
System.out.println("Enter raw password:"); | |
Scanner s = new Scanner(System.in); | |
String rawPassword = s.nextLine(); | |
String encodedPassword = new BCryptPasswordEncoder().encode(rawPassword); | |
System.out.println("Encoded password:"); | |
System.out.println(encodedPassword); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment