Advertisement
Guest User

Untitled

a guest
May 20th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.25 KB | None | 0 0
  1. <?php
  2.  
  3. $plaintext = 'zzzzzz';
  4. $key = str_repeat('k', 32);
  5. $nonce = str_repeat('n', 12);
  6. $aad = '';
  7.  
  8. $r = openssl_encrypt(
  9.     $plaintext,
  10.     'aes-128-gcm',
  11.     $key,
  12.     OPENSSL_RAW_DATA,
  13.     $nonce,
  14.     $newtag,
  15.     $aad
  16. );
  17.  
  18. echo bin2hex($r);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement