PHP code example of xiaowu / laravel-rsa
1. Go to this page and download the library: Download xiaowu/laravel-rsa library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
xiaowu / laravel-rsa example snippets
php artisan lararsa:config
$data = '待处理数据';
方式一:
$sign = LaraRsa::createdSign($data); // 生成签名
$result = LaraRsa::verifySign($data, $sign); // 验证签名
$result = LaraRsa::encrypt($data); // 加密
$result = LaraRsa::decrypt($data); // 解密
方式二:
$LaraRsa = new LaraRsa();
$sign = $LaraRsa->createdSign($data); // 生成签名
$result = $LaraRsa->verifySign($data, $sign); // 验证签名
$result = $LaraRsa->encrypt($data); // 加密
$result = $LaraRsa->decrypt($data); // 解密