Last active
March 7, 2018 14:56
-
-
Save lkdocs/6526697 to your computer and use it in GitHub Desktop.
This file contains 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
<? | |
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