optiwariindia / cryptography
使用AES算法轻松加密
1.0
2021-07-07 02:07 UTC
Requires
- lib-openssl: *
This package is auto-updated.
Last update: 2024-09-07 09:10:21 UTC
README
特性
- 支持多种算法
- 可通过composer安装
- 多语言异常
- 易于设置和使用
为什么你应该使用
我们一直在研究多种加密方法,并将它们集成到项目中。该库的基本思想是使你的项目足够安全,以保护你的客户。你可以存储重要信息,如凭证等。
如何使用
安装
使用composer安装 composer require optiwariindia/cryptography
初始化
$crypt=new optiwariindia\cryptography();
列出支持的算法
print_r($crypt->listAlgo());
加密
$crypt->algo("AES-128-CBC");
$iv=$crypt->iv();
$crypt->key("SuperSecretKey");
list($cypher,$tag)=$crypt->encrypt("message");
解密
$crypt->algo("AES-128-CBC");
$iv=$crypt->iv();
$crypt->key("SuperSecretKey");
$text=$crypt->decrypt($cypher,$tag);