本文实例讲述了php基于openssl的rsa加密解密。分享给大家供大家参考,具体如下:
<?php
$config = array(
//config =>D:/phpserver/Lighttpd/openssl.cnf,
//'config' =>'D:/phpStudy/Lighttpd/OpenSSL.cnf',
'private_key_bits' => 1024, // Size of Key.
'private_key_type' => OPENSSL_KEYTYPE_RSA
);
//$res = openssl_pkey_new();
$res = openss