Created
October 9, 2019 21:09
-
-
Save mangei/e70a243236cdd0a53565f76f66c2e065 to your computer and use it in GitHub Desktop.
BCryptPasswordEncoder
This file contains 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