Created
June 1, 2012 17:00
-
-
Save volker48/2853610 to your computer and use it in GitHub Desktop.
PBKDF2 Java sample
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
SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1"); | |
KeySpec keyspec = new PBEKeySpec("password".toCharArray(), salt, 1000, 128); | |
Key key = factory.generateSecret(keyspec); | |
System.out.println(key.getClass().getName()); | |
System.out.println(Arrays.toString(key.getEncoded())); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment