是否有任何 PHP 5.3 类提供 RSA 加密/解密而无需填充?
我有私钥和公钥、p、q 和模数。
最佳答案
您可以使用 phpseclib, a pure PHP RSA implementation :
<?php
include('Crypt/RSA.php');
$privatekey = file_get_contents('private.key');
$rsa = new Crypt_RSA();
$rsa->loadKey($privatekey);
$plaintext = new Math_BigInteger('aaaaaa');
echo $rsa->_exponentiate($plaintext)->toBytes();
?>
关于php - 在 PHP 中使用 RSA 加密和解密文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4484246/