akimimi/encrypt 问题修复 & 功能扩展

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

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

akimimi/encrypt

最新稳定版本:1.0.2

Composer 安装命令:

composer require akimimi/encrypt

包简介

Encrypt and decrypt utilities for Akimimi Team.

README 文档

README

Build Status

Description

This library provides encrypt and decrypt algorithm utilities.

AesEcbEncrypt class provides 128/192/256 bits AES ECB encrypt and decrypt algorithm, with zero padding by default.

AesCbcEncrypt class provides 128/192/256 bits AES CBC encrypt and decrypt algorithm, with zero padding by default.

Sm4CbcEncrypt class provides 128 bits SM4 CBC encrypt and decrypt algorithm, with PKCS5 padding for data by default, and zero padding for password.

Installation

This library support Add require with composer CLI.

composer require akimimi/encrypt

Otherwise, add require to your composer.json.

{
  "require": {
     "akimimi/encrypt": ">=1.0.0"
  }
}

Use Composer to install requires

composer install

Usage

After installation by composer, you can declare use for class.

<?php
use Akimimi\Encrypt\AesEcbEncrypt;

$password = "123456";
$data = "akimimi";

$encryptUtil = new AesEcbEncrypt(16); // 128 bit
$encryptUtil->setPassword($password);
$encryptedStr = $encryptUtil->encrypt($data); // 0x2582ec23698d74912c044ef3e29ac86b

Data can be encoded and decoded in encrypt stages with an encoder set up for encrypt utility.

<?php
use Akimimi\Encrypt\AesEcbEncrypt;
use Akimimi\Encrypt\Base64Encoder;

$password = "123456";
$data = "akimimi";

$encryptUtil = new AesEcbEncrypt(16); // 128 bit
$encryptUtil->setBytesEncoder(new Base64Encoder());
$encryptUtil->setPassword($password);
$encryptedStr = $encryptUtil->encrypt($data); // JYLsI2mNdJEsBE7z4prIaw==
$decryptedStr = $encryptUtil->decrypt($encryptedStr); // akimimi

Uninstall

With composer, we can remove library with composer CLI.

composer remove akimimi/encrypt

统计信息

  • 总下载量: 17
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固