Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $length = 60;
- $salt = "MySalt";
- $interation = 3000;
- $bytes = openssl_pbkdf2("mypasspharse", $salt, $length, $interation, "sha1");
- $value1 = substr($bytes, 0, 10);
- $value2 = substr($bytes, 10, 20);
- $value3 = substr($bytes, 30, 30);
- return array('value1' => $value1, 'value2' => $value2, 'value3' => $value3);
- SecretKeyFactory factory = SecretKeyFactory
- .getInstance("PBKDF2WithHmacSHA1");
- PBEKeySpec spec = new PBEKeySpec(passphrase.toCharArray(),
- salt.getBytes("UTF-8"), interation, length);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement