我可以加密小字符串,但是当它超过 118 个字符时它似乎不起作用?任何想法 ?
private function encryptData($plaintext) {
$plaintext = '{ "id":"1" "name":"Bottled Beer" "description":"" "parent_id":"111" "taxonomy":"SIMPLE_PLU" },{ "id":"2" "name":"Stout" }';
$publicKey = "../ssh_keys/coasts/public/pub.pem";
$fp=fopen($publicKey,"r");
$pub_key_string=fread($fp,8192);
fclose($fp);
$pubKey = openssl_pkey_get_public($pub_key_string);
openssl_public_encrypt($plaintext, $encrypted, $pubKey);
return $encrypted;
}