This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Encrypt $plaintext using $rsa_public_key | |
| * | |
| * To decrypt the data the RSA private that corresponds to the $rsa_public_key is required. | |
| * | |
| * Because public key crypto is not suitable for arbitrary length data, encryption is done in two steps | |
| * 1. Generate a random symmetric key and encrypt the plaintext with that key |