Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. $length = 60;
  2. $salt = "MySalt";
  3. $interation = 3000;
  4. $bytes = openssl_pbkdf2("mypasspharse", $salt, $length, $interation, "sha1");
  5.  
  6. $value1 = substr($bytes, 0, 10);
  7. $value2 = substr($bytes, 10, 20);
  8. $value3 = substr($bytes, 30, 30);
  9.  
  10. return array('value1' => $value1, 'value2' => $value2, 'value3' => $value3);
  11.  
  12. SecretKeyFactory factory = SecretKeyFactory
  13. .getInstance("PBKDF2WithHmacSHA1");
  14. PBEKeySpec spec = new PBEKeySpec(passphrase.toCharArray(),
  15. salt.getBytes("UTF-8"), interation, length);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement