paragonie/constant_time_encoding
Composer 安装命令:
composer require paragonie/constant_time_encoding
包简介
Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)
关键字:
README 文档
README
Based on the constant-time base64 implementation made by Steve "Sc00bz" Thomas, this library aims to offer character encoding functions that do not leak information about what you are encoding/decoding via processor cache misses. Further reading on cache-timing attacks.
Our fork offers the following enhancements:
mbstring.func_overloadresistance- Unit tests
- Composer- and Packagist-ready
- Base16 encoding
- Base32 encoding
- Uses
pack()andunpack()instead ofchr()andord()
PHP Version Requirements
Version 3 of this library should work on PHP 8 or newer.
Version 2 of this library should work on PHP 7 or newer. See the v2.x branch.
For PHP 5 support, see the v1.x branch.
If you are adding this as a dependency to a project intended to work on PHP 5 through 8.4, please set the required version to ^1|^2|^3.
How to Install
composer require paragonie/constant_time_encoding
How to Use
use ParagonIE\ConstantTime\Encoding; // possibly (if applicable): // require 'vendor/autoload.php'; $data = random_bytes(32); echo Encoding::base64Encode($data), "\n"; echo Encoding::base32EncodeUpper($data), "\n"; echo Encoding::base32Encode($data), "\n"; echo Encoding::hexEncode($data), "\n"; echo Encoding::hexEncodeUpper($data), "\n";
Example output:
1VilPkeVqirlPifk5scbzcTTbMT2clp+Zkyv9VFFasE=
2VMKKPSHSWVCVZJ6E7SONRY3ZXCNG3GE6ZZFU7TGJSX7KUKFNLAQ====
2vmkkpshswvcvzj6e7sonry3zxcng3ge6zzfu7tgjsx7kukfnlaq====
d558a53e4795aa2ae53e27e4e6c71bcdc4d36cc4f6725a7e664caff551456ac1
D558A53E4795AA2AE53E27E4E6C71BDCC4D36CC4F6725A7E664CAFF551456AC1
If you only need a particular variant, you can just reference the required class like so:
use ParagonIE\ConstantTime\Base64; use ParagonIE\ConstantTime\Base32; $data = random_bytes(32); echo Base64::encode($data), "\n"; echo Base32::encode($data), "\n";
Example output:
1VilPkeVqirlPifk5scbzcTTbMT2clp+Zkyv9VFFasE=
2vmkkpshswvcvzj6e7sonry3zxcng3ge6zzfu7tgjsx7kukfnlaq====
Support Contracts
If your company uses this library in their products or services, you may be interested in purchasing a support contract from Paragon Initiative Enterprises.
paragonie/constant_time_encoding 适用场景与选型建议
paragonie/constant_time_encoding 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 360.43M 次下载、GitHub Stars 达 903, 最近一次更新时间为 2016 年 03 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「base64」 「base32」 「encoding」 「rfc4648」 「hex」 「base16」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 paragonie/constant_time_encoding 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 paragonie/constant_time_encoding 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 paragonie/constant_time_encoding 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
integration of the Panda encoding services into the Symfony2 Framework
Sets of digits or characters that may be used for base conversions, encoding and decoding tasks, and input validation
Implementation of bitcoin cash base32 addresses
FileBundle manages uploads and manipulations of files for the Kitpages CMS Bundle
Base 32 encoder / decoder
AMWSCAN (Antimalware Scanner) is a php antimalware/antivirus scanner console script written in php for scan your project. This can work on php projects and a lot of others platform.
统计信息
- 总下载量: 360.43M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 908
- 点击次数: 31
- 依赖项目数: 152
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2016-03-12