legatus / crypto
此包已被废弃,不再维护。作者建议使用 castor/crypto 包代替。
简单且安全的通用任务加密实现
0.3.1
2020-12-29 20:25 UTC
Requires
- php: >=7.4
- ext-json: *
- ext-sodium: *
- lcobucci/clock: ^1.3
Requires (Dev)
- adlawson/vfs: ^0.12.1
- friendsofphp/php-cs-fixer: ^2.16
- phpunit/phpunit: ^9.0
- vimeo/psalm: ^3.7
README
简单且安全的通用任务加密实现
安装
您可以使用 Composer 安装 Crypto 组件
composer require legatus/crypto
快速开始
<?php use Legatus\Support\LegatusCipher; use Legatus\Support\SodiumKey; $secret = SodiumKey::generate()->getBytes(); $cipher = new LegatusCipher($secret); $encrypted = $cipher->encrypt('message'); // You can optionally pass a ttl for verification try { $message = $cipher->decrypt($encrypted, 3600); echo $message; // Writes: "message" } catch (Legatus\Support\ExpiredCipher $e) { // The encrypted message has passed the ttl } catch (Legatus\Support\InvalidCipher $e) { // The encrypted message is invalid }
有关更多详细信息,您可以在此处查看 在线文档。
项目状态 & 发布流程
尽管这个库仍在开发中,但它经过良好测试,应该足够稳定,可以在生产环境中使用。
当前版本号为 0.x.y。当引入非破坏性更改(添加新方法、优化现有代码等)时,y 会增加。
当引入破坏性更改时,总是开始一个新的 0.x 版本周期。
因此,将您的项目锁定到特定的发布周期,例如 0.2.* 是安全的。
如果您需要升级到较新的发布周期,请查看 发布历史 以获取每个后续 0.x.0 版本引入的更改列表。
社区
我们还没有社区频道。如果您想帮忙,可以告诉我!
贡献
阅读贡献指南以了解您如何为 Legatus 贡献。
安全问题
请通过电子邮件私下报告安全问题,并在披露前给我们一个宽限期。
关于 Legatus
Legatus 是由 Matías Navarro Carter 领导的个人开源项目,并由贡献者开发。