Skip to content

Instantly share code, notes, and snippets.

@eeertekin
Created June 9, 2017 07:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eeertekin/f256665d6ef8b463d8e662477fbe5581 to your computer and use it in GitHub Desktop.
Save eeertekin/f256665d6ef8b463d8e662477fbe5581 to your computer and use it in GitHub Desktop.
<?
## Example in PHP
class Decryption
{
public $privateKey = '{yourPrivateKey}';
public function decrypt($data)
{
if (openssl_private_decrypt(base64_decode($data), $decryptedData, $this->privateKey))
return $decryptedData;
return "Decryption failed!";
}
}
# For more details, you can check the openssl_private_decrypt function in PHP Manual.
# http://us.php.net/manual/en/function.openssl-private-decrypt.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment