PHP加解密相关函数

2/11/2016来源:PHP技巧人气:1127

openssl_public_encrypt()  - Encrypts data with public key
openssl_public_decrypt()  - Decrypts data with public key
openssl_PRivate_encrypt() - Encrypts data with private key
openssl_private_decrypt() - Decrypts data with private key

OPENSSL
    openssl genrsa -des3 -out privkey.pem 2048
    openssl rsa -in privkey.pem -out privkey.pem
    openssl rsa -in privkey.pem -pubout -out public.key

https://github.com/flyfishsoft/codebase/blob/master/common/lib/rsa.php