Created
April 20, 2016 18:48
-
-
Save dmgig/798a6a851660a951854fe3d553b54640 to your computer and use it in GitHub Desktop.
PHP Public Key Encryption
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 | |
| $publicKey = "file://Users/dgiglio/.ssh/mykey.pem"; | |
| $plaintext = "String to encrypt"; | |
| openssl_public_encrypt($plaintext, $encrypted, $publicKey); | |
| echo $encrypted; //encrypted string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment