Guest User

Untitled

a guest
May 17th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  1. <?php
  2.  
  3. include 'cryptastic.php';
  4.  
  5. $salt = 'salt';
  6. $pass = $_POST['pass'];
  7. $msg = $_POST['msg'];
  8.  
  9. //echo $msg . "<br />";
  10.  
  11. $encryption = new cryptastic;
  12.  
  13. $key = $encryption->pbkdf2($pass, $salt, 1000, 32) or
  14.     die("Failed to generate secret key.");
  15.  
  16. //$encrypted = $encryption->encrypt($msg, $key) or
  17. //  die("Failed to complete encryption.");
  18.  
  19. //echo $encrypted . "<br /><br />\n";
  20.  
  21. $decrypted = $encryption->decrypt($msg, $key) or
  22.     die("Failed to complete decryption");
  23.  
  24. echo $decrypted . "<br /><br />\n";
  25.  
  26.  
  27. ?>
Add Comment
Please, Sign In to add comment