【发布时间】:2014-07-17 19:33:08
【问题描述】:
我生成了用于加密目的的公钥和私钥。有一个密码短语连接到私钥,但我知道我不应该像这样以纯文本形式显示它。
我应该怎么做才能保护这个密码,使它不以纯文本形式显示?
// $data = encrypted data using RSA public key
// $key = the key that came along with the encrypted data
// find private key
$pkeyid = openssl_get_privatekey("file:///path/to/private.pem", "PASSWORD");
// try and decrypt the data using private key
openssl_open($data, $decrypted_data, $key, $pkeyid);
// if all went well, show decrypted data
echo $decrypted_data;
【问题讨论】:
标签: php encryption rsa