-
-
Save miklobit/0a57ad91e761c957f5c3757d047e8f18 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