Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2014
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.29 KB | None | 0 0
  1. <?php
  2. include('Crypt/RSA.php');
  3.  
  4. $rsa = new Crypt_RSA();
  5. $rsa->loadKey('...'); // public key
  6.  
  7. $plaintext = '...';
  8.  
  9. //$rsa->setEncryptionMode(CRYPT_RSA_ENCRYPTION_OAEP);
  10. $ciphertext = $rsa->encrypt($plaintext);
  11.  
  12. $rsa->loadKey('...'); // private key
  13. echo $rsa->decrypt($ciphertext);
  14. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement