Skip to content

Instantly share code, notes, and snippets.

@lkdocs
Last active March 7, 2018 14:56
Show Gist options
  • Save lkdocs/6526697 to your computer and use it in GitHub Desktop.
Save lkdocs/6526697 to your computer and use it in GitHub Desktop.
<?
public function rsa_decrypt($key, $package) {
$rsa = new Crypt_RSA();
$rsa->setHash("sha256");
$rsa->setSignatureMode(CRYPT_RSA_SIGNATURE_PKCS1);
$rsa->loadKey($key);
$signature = base64_encode($rsa->sign(base64_decode($package)));
return $signature;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment