krmgns/cryptee 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 6
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2024-01-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固