krmgns/cryptee
最新稳定版本:3.0.1
Composer 安装命令:
composer require krmgns/cryptee
包简介
Pretty easy, fast and secure two-way encryption with PHP.
README 文档
README
For Cryptee/2.0, PHP/7.4 or newer version is required, but older Cryptee versions (1.0, 1.1, 1.2) work with older PHP versions as well.
You can install it via Composer using the command below on console:
composer require krmgns/cryptee
Usage
use Cryptee\Cryptee; // Keep this key in save! $key = '4]%gmHo"e:]*hR(NQ?B...'; $str = 'Lorem ipsum dolor.'; $c = new Cryptee($key); // Or hex way. // $c = new Cryptee($key, Cryptee::HEX); $crypted = $c->crypt($str); $encoded = $c->encode($str); $decoded = $c->decode($encoded); printf("Crypted String: %s\n", $crypted); printf("Encoded String: %s\n", $encoded); printf("Decoded String: %s\n", $decoded); // Crypted String: X�/����;���-6�[�� // Encoded String: WJAv2/6x5Du/5IXjLTakW+jr // Decoded String: Lorem ipsum dolor.
Using Different Keys
// Keep these keys in save! const FOO_KEY = 'z:W;[*l>Eq.h"t)cs#XhU\+!=S]#q)\yG-...'; const BAR_KEY = 'SNz6@b*/k(iw!plOVeTBWxpL[1$;la|kb2...'; $cFoo = new Cryptee(FOO_KEY); $cBar = new Cryptee(BAR_KEY);
Generating Keys
You can generate new keys calling Cryptee::generateKey() method with/without $length argument as key length. Default length is 128.
统计信息
- 总下载量: 199
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2024-01-26