mikeching/yii2-rsa

yii2-rsa

Installs: 10

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 1

Open Issues: 0

Type:yii2-extension

dev-master 2015-12-15 16:09 UTC

This package is not auto-updated.

Last update: 2024-11-13 19:20:09 UTC


README

composer.json

"require": {
    "mikeching/yii2-rsa": "*"
},

example:

use mikeching\rsa\Rsa;

//init
set private and public key to you common/config/params.php
$str = 'yii2-rsa';

//private encrypt -> public decrypt
$enStr = Rsa::rsaPrivateEncrypt($str);
echo $enStr;
$deStr = Rsa::rsaPublicDecrypt($enStr);
echo $deStr;

//public encrypt -> private decrypt
$enStr = Rsa::rsaPublicEncrypt($str);
echo $enStr;
$deStr = Rsa::rsaPrivateDecrypt($enStr);
echo $deStr;