phpseclib decrypt and encrypt data with only public key
问题 Hi I would like to know why RSA can be performed (encrypt/decrypt) with only one public key in phpseclib? $rsa is an instance of phpseclib/Crypt/RSA.php (link: https://github.com/phpseclib/phpseclib/blob/master/phpseclib/Crypt/RSA.php) $publicKey keys here are the same. function encryptData($data, $publicKey) { $rsa = new Crypt_RSA(); $rsa->loadKey($publicKey); // public key $rsa->setEncryptionMode(CRYPT_RSA_ENCRYPTION_PKCS1); $output = $rsa->encrypt($data); return base64_encode($output); }