定制 codezero/encrypter 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

codezero/encrypter

最新稳定版本:2.0.2

Composer 安装命令:

composer require codezero/encrypter

包简介

Encrypt and decrypt strings in PHP.

README 文档

README

GitHub release License Build Status Code Coverage Scrutinizer Code Quality Total Downloads

ko-fi

Encrypt and decrypt strings in PHP.

This package includes an adapter for Laravel's Encrypter that adheres to my Encrypter interface. This can be used in vanilla PHP. Other implementations might be added in the future.

Installation

Install this package through Composer:

composer require codezero/encrypter

Vanilla PHP Implementation

Autoload the vendor classes:

require_once 'vendor/autoload.php'; // Path may vary

Choose a key. You will need the same key that was used to encrypt a string, to decrypt it.

$key = 'my secret key';

And then use the DefaultEncrypter implementation:

$encrypter = new \CodeZero\Encrypter\DefaultEncrypter($key);

Usage

Encrypt a string

$encrypted = $encrypter->encrypt('some string');

Decrypt an encrypted string

try { $decrypted = $encrypter->decrypt($encrypted); } catch (\CodeZero\Encrypter\DecryptException $exception) { // Decryption failed... }

Testing

$ composer run test 

Security

If you discover any security related issues, please e-mail me instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固