paragonie/constant_time_encoding
Fast, secure constant-time encoding/decoding utilities for PHP. Provides Base32, Base64 (incl. URL-safe), and Hex implementations designed to reduce timing side-channel leaks. Ideal for cryptography, tokens, and security-sensitive data handling.
Backported fix from https://github.com/paragonie/constant_time_encoding/releases/tag/v3.1.3
Full Changelog: https://github.com/paragonie/constant_time_encoding/compare/v2.8.1...v2.8.2
This release fixes a bug with base64 codecs when ext-sodium installed.
Full Changelog: https://github.com/paragonie/constant_time_encoding/compare/v3.1.2...v3.1.3
I'm going to continue backporting important fixes to v2.x for PHP 7 support while there is still significant v2 usage.
Full Changelog: https://github.com/paragonie/constant_time_encoding/compare/v2.8.0...v2.8.1
Thanks @TimWolla for identifying a performance hit caused by attempting to find global functions such as strlen() in the current namespace before the global namespace.
Full Changelog: https://github.com/paragonie/constant_time_encoding/compare/v3.1.1...v3.1.2
mbstring.func_overload compatibility layer by @TimWolla in https://github.com/paragonie/constant_time_encoding/pull/58Full Changelog: https://github.com/paragonie/constant_time_encoding/compare/v3.1.0...v3.1.1
This release backports the ext-sodium performance enhancement from v3.1.0.
Full Changelog: https://github.com/paragonie/constant_time_encoding/compare/v2.7.0...v2.8.0
Important: If you enable ext-sodium, some codecs will now be faster with our library: hex, base64, base64url. This requires the actual extension be installed; sodium_compat will not provide these implementations.
As with the recent sodium_compat release, this library now incorporates fuzz-testing and mutation testing as part of our development strategy. Fuzz testing is enabled on pull requests; mutation tests on releases.
The current metrics for a mutation test run (using the latest version of Infection):
1782 mutations were generated:
1470 mutants were killed by Test Framework
296 covered mutants were not detected
5 errors were encountered
11 time outs were encountered
Metrics:
Mutation Code Coverage: 100%
Covered Code MSI: 83%
We set the minimum MSI for covered code to 80% by policy, but will slowly be increasing it in future releases.
Base32::doEncode()’s $pad parameter by @TimWolla in https://github.com/paragonie/constant_time_encoding/pull/60Full Changelog: https://github.com/paragonie/constant_time_encoding/compare/v3.0.0...v3.1.0
SensitiveParameter attribute to all string parameters by @TimWolla in https://github.com/paragonie/constant_time_encoding/pull/48CanonicalTrait::getNextChar() an abstract method instead a `@m… by @TimWolla in https://github.com/paragonie/constant_time_encoding/pull/54Full Changelog: https://github.com/paragonie/constant_time_encoding/compare/v2.6.3...v2.7.0
Hex\ global namespace qualifiersdecode($str, true)).decodeNoPadding() to Base32, Base64, and its child classes.
= padding at all.Supports PHP 7.3, 7.4, and 8.x (currently only for testing against the master branch in Travis CI)
Base32::encodeUnpadded() from v1.x branch.encodeUnpadded() added to Base64.encodeUnpadded() to Base32 and Base64 (and their derived classes). Satisfies #9.Fix composer.json typo.
Previous tag was a false alarm. This is the real deal.
This library is now type-safe. Encoding functions (e.g. Base64::decode()) will always return a string or throw a RangeException. They will never return false.
Furthermore, type safety is assured with Psalm.
Throw a RangeException instead of returning false in a function with a return type of string.
Handle an edge-case reported in #4
Handle edge-case reported in #4
Binary.Version 2 will require PHP 7 and use scalar type declarations.
How can I help you explore Laravel packages today?