hyper-boy / sm
There is no license information available for the latest version (1.0.0) of this package.
国密 sm3 sm4
This package's canonical repository appears to be gone and the package has been frozen as a result.
1.0.0
2024-09-03 23:37 UTC
Requires
- php: >=5.6.0
This package is not auto-updated.
Last update: 2024-09-04 12:40:48 UTC
README
介绍
国密
安装教程
php composer.phar require hyper-boy/sm:*
使用说明
use HyperBoy\SM\SM3;
$sm3 = new Sm3();
$sm3->sign('hello world');
use HyperBoy\SM\SM4;
$key = '11111111111111111';
$iv = '11111111111111111';
$sm4 = new Sm4($key);
// 加密
$sm4->enDataCbc('hello world', $iv);
// 解密密
$sm4->deDataCbc('h6pI9AvIvXOUVeREFhbe2w==', $iv);