defuse/php-encryption
Composer 安装命令:
composer require defuse/php-encryption
包简介
Secure PHP Encryption Library
关键字:
README 文档
README
composer require defuse/php-encryption
This is a library for encrypting data with a key or password in PHP. It requires PHP 5.6 or newer and OpenSSL 1.0.1 or newer. We recommend using a version of PHP that still has security support, which at the time of writing means PHP 8.0 or later. Using this library with an unsupported version of PHP could lead to security vulnerabilities.
The current version of php-encryption is v2.4.0. This library is expected to
remain stable and supported by its authors with security and bugfixes until at
least January 1st, 2024.
The library is a joint effort between Taylor Hornby and Scott Arciszewski as well as numerous open-source contributors.
What separates this library from other PHP encryption libraries is, firstly, that it is secure. The authors used to encounter insecure PHP encryption code on a daily basis, so they created this library to bring more security to the ecosystem. Secondly, this library is "difficult to misuse." Like libsodium, its API is designed to be easy to use in a secure way and hard to use in an insecure way.
Dependencies
This library requires no special dependencies except for PHP 5.6 or newer with the OpenSSL extensions (version 1.0.1 or later) enabled (this is the default). It uses random_compat, which is bundled in with this library so that your users will not need to follow any special installation steps.
Getting Started
Start with the Tutorial. You can find instructions for obtaining this library's code securely in the Installing and Verifying documentation.
After you've read the tutorial and got the code, refer to the formal documentation for each of the classes this library provides:
If you encounter difficulties, see the FAQ answers. The fixes to the most commonly-reported problems are explained there.
If you're a cryptographer and want to understand the nitty-gritty details of how this library works, look at the Cryptography Details documentation.
If you're interested in contributing to this library, see the Internal Developer Documentation.
Other Language Support
This library is intended for server-side PHP software that needs to encrypt data at rest. If you are building software that needs to encrypt client-side, or building a system that requires cross-platform encryption/decryption support, we strongly recommend using libsodium instead.
Examples
If the documentation is not enough for you to understand how to use this library, then you can look at an example project that uses this library:
Security Audit Status
This code has not been subjected to a formal, paid, security audit. However, it has received lots of review from members of the PHP security community, and the authors are experienced with cryptography. In all likelihood, you are safer using this library than almost any other encryption library for PHP.
If you use this library as a part of your business and would like to help fund a formal audit, please contact Taylor Hornby.
Public Keys
The GnuPG public key used to sign the current and new releases is available in dist/signingkey-new.asc. Its fingerprint is:
6DD6 E677 0281 5846 FC85 25A3 DD2E 507F 7BDB 1669
You can verify it against Taylor Hornby's contact page and twitter.
Older releases were signed with a (now-expired) available in dist/signingkey-old.asc. The old key's fingerprint is:
2FA6 1D8D 99B9 2658 6BAC 3D53 385E E055 A129 1538
The old key's fingerprint can be verified against Taylor Hornby's contact page and twitter.
A signature of this new key by the old key is available in dist/signingkey-new.asc.sig.
defuse/php-encryption 适用场景与选型建议
defuse/php-encryption 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 174.81M 次下载、GitHub Stars 达 3.87k, 最近一次更新时间为 2015 年 03 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「security」 「cryptography」 「encryption」 「crypto」 「aes」 「openssl」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 defuse/php-encryption 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 defuse/php-encryption 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 defuse/php-encryption 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
DUKPT implementation in PHP
A simple PHP class to encrypt a string and decrypt an encrypted string
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
Provide a way to secure accesses to all routes of an symfony application.
Encryption with AES-256 and HMAC-SHA256
Allows installation of Laravel where the PHP Mcrypt extension is not available. Provides encryption using OpenSSL, or by disabling encryption entierly.
统计信息
- 总下载量: 174.81M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3901
- 点击次数: 54
- 依赖项目数: 233
- 推荐数: 26
其他信息
- 授权协议: MIT
- 更新时间: 2015-03-14