Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. $data = 'Olá, Wallace!';
  2.  
  3. $encryption_key = openssl_random_pseudo_bytes(32);
  4.  
  5. $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('AES-256-CBC'));
  6.  
  7. $encrypted = openssl_encrypt($data, 'AES-256-CBC', $encryption_key, 0, $iv);
  8.  
  9. if (false === $encrypted) {
  10.  
  11. var_dump(openssl_error_string());
  12.  
  13. exit;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement