Created
May 2, 2015 15:08
-
-
Save freretuc/4be873016da77bbeb9e7 to your computer and use it in GitHub Desktop.
Encrypt string with PHP.
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 | |
| $content = "secret"; | |
| $public = file_get_contents("public.pem"); | |
| openssl_public_encrypt($content, $crypted, $public, OPENSSL_PKCS1_OAEP_PADDING); | |
| echo base64_encode($crypted); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment