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

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

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

phlib/encrypt

最新稳定版本:3.0.0

Composer 安装命令:

composer require phlib/encrypt

包简介

Generic class for performing encryption

README 文档

README

Code Checks Codecov Latest Stable Version Total Downloads Licence

PHP encryption/decryption tool

Install

Via Composer

$ composer require phlib/encrypt

Usage

Creation of an encryptor

$encryptor = new \Phlib\Encrypt\Encryptor\OpenSsl($encryptionPassword);

The encryption password should be a random string of data, preferably at least 32 bytes long, and should be stored on the server. For example, this could be a configuration value or constant (perhaps base64 encoded depending on how the value needs to be stored).

The same encryption password must be used to decrypt as was used to encrypt.

Example of creating an encryption password

$encryptionPassword = \openssl_random_pseudo_bytes(32);

Encrypt/decrypt some data

$encryptor = new \Phlib\Encrypt\Encryptor\OpenSsl($encryptionPassword);
$myData    = 'some sensitive data which needs encrypting';

$encrypted = $encryptor->encrypt($myData);

// $encryptor could be a completely different instance here,
// so long as it is initialised with the same encryption password
$decrypted = $encryptor->decrypt(encrypted);

License

This package is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/.

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 5
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0
  • 更新时间: 2016-02-12