2017 © Pedro Peláez
 

php php-rsa

php rsa加密解密

image

niklaslu/php-rsa

php rsa加密解密

  • Thursday, April 20, 2017
  • by niklauslu
  • Repository
  • 1 Watchers
  • 1 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 22 % Grown

The README.md

php-rsa

php rsa 加密解密类, (*1)

使用示例 demo.php, (*2)

<?php

require_once 'vendor/autoload.php';

$Rsa = new \niklaslu\Rsa();

$publicKey = $Rsa->getPublicKeyStr();
echo $publicKey;
echo "<br>";

$pravateKey = $Rsa->getPrivateKeyStr();

echo $pravateKey;
echo "<br>";

$data = 'data1';

// 通过私钥加密
$enc = $Rsa->encryptByPrivate($data);
echo $enc;
echo "<br>";

// 通过公钥解密
$dec = $Rsa->decryptByPublic($enc);
echo $dec;
echo "<br>";


$data = 'data2';

// 通过公钥加密
$enc = $Rsa->encryptByPublic($data);
echo $enc;
echo "<br>";

// 通过私钥解密
$dec = $Rsa->decryptByPrivate($enc);
echo $dec;
echo "<br>";

The Versions

20/04 2017

dev-master

9999999-dev

php rsa加密解密

  Sources   Download

MIT

by niklaslu

20/04 2017

1.0.0

1.0.0.0

php rsa加密解密

  Sources   Download

MIT

by niklaslu