paragonie/sodium_compat
Pure-PHP polyfill for PHP’s Sodium (libsodium) cryptography API. Transparently uses the native sodium extension when available; otherwise falls back to a compatible implementation. v1 supports PHP 5.2+ incl. 32-bit; v2 targets PHP 8.1+ only.
Read: A vulnerability in libsodium
This fixes a congruent issue in the main branch of the PHP implementation.
For older PHP versions, see v1.24.0 instead.
Read: A vulnerability in libsodium
This fixes a congruent issue in the v1.x branch of the PHP implementation.
The biggest change (besides unit testing) in this release is the optimization of Curve25519 field arithmetic by using object properties instead of an internal array. This skips some internal overhead in PHP (i.e., hash tables and memory allocation) that we ultimately never needed.
Beyond that, we mostly expanded our unit test coverage. We're running Infection to identify code that can be mutated without the test suite failing, and it's identified a lot of false positives but also some useful information. The end result? We've fixed a few bugs.
Util::(strlen|substr) by @takaram in https://github.com/paragonie/sodium_compat/pull/201Full Changelog: https://github.com/paragonie/sodium_compat/compare/v2.3.1...v2.4.0
We backported some optimizations from #198 by replacing the array in the Curve25519 field element with 10 integer object properties instead. The result is a 7% to 12% speedup for the overall PHPUnit suite.
Full Changelog: https://github.com/paragonie/sodium_compat/compare/v1.22.0...v1.23.0
Deletes the erroneous PSR-0 autoloader declaration from composer.json, fixing #196
Full Changelog: https://github.com/paragonie/sodium_compat/compare/v2.3.0...v2.3.1
[!IMPORTANT] The previous version of sodium_compat was overly permissible with
sodium_base642bin()when the*_NO_PADDINGvariants were specified, which was not compatible with ext-sodium. This has been fixed in v2.3.0.
If you need the old behavior in the meantime, you can call ParagonIE_Core_Base64_Original::decode() or ParagonIE_Core_Base64_UrlSafe:decode() to get lax padding enabled.
Aside from this fix, most of the changes were to the unit test suite in order to improve our mutation testing metrics.
Full Changelog: https://github.com/paragonie/sodium_compat/compare/v2.2.0...v2.3.0
[!IMPORTANT] The previous version of sodium_compat was overly permissible with
sodium_base642bin()when the*_NO_PADDINGvariants were specified, which was not compatible with ext-sodium. This has been fixed in v1.22.0.
If you need the old behavior in the meantime, you can call ParagonIE_Core_Base64_Original::decode() or ParagonIE_Core_Base64_UrlSafe:decode() to get lax padding enabled.
Full Changelog: https://github.com/paragonie/sodium_compat/compare/v1.21.2...v1.22.0
Version 2.2.0 of Sodium_Compat is mostly a maintenance release. Some dev-dependencies were changed in order to facilitate mutation and fuzz testing in CI. No significant changes to the src directory were required as a result of this additional testing.
Full Changelog: https://github.com/paragonie/sodium_compat/compare/v2.1.0...v2.2.0
Full Changelog: https://github.com/paragonie/sodium_compat/compare/v1.21.1...v1.21.2
Full Changelog: https://github.com/paragonie/sodium_compat/compare/v2.0.1...v2.1.0
We pulled v2.0.0 to prevent v2.x from being installed on 32-bit systems.
Full Changelog: https://github.com/paragonie/sodium_compat/compare/v2.0.0...v2.0.1
Full Changelog: https://github.com/paragonie/sodium_compat/compare/v1.21.0...v1.21.1
While this is not the final v1.x release, we will be releasing a new major version soon. See the updated major version policy in our readme for specific guidance.
Beyond that, this is a bog standard feature release. It contains no security fixes, but additional features (including the AEGIS AEAD mode used by libsodium, expected to land in PHP 8.4).
Full Changelog: https://github.com/paragonie/sodium_compat/compare/v1.20.1...v1.21.0
[@covers](https://github.com/covers) tag by @jrfnl in https://github.com/paragonie/sodium_compat/pull/164Full Changelog: https://github.com/paragonie/sodium_compat/compare/v1.20.0...v1.20.1
Full Changelog: https://github.com/paragonie/sodium_compat/compare/v1.19.0...v1.20.0
If you had a specific bit pattern in your Poly1305 key and ciphertext, you would generate an invalid authentication tag. This was caught by the ChaCha20-Poly1305 tests included in Project Wycheproof.
We don't believe this is a security issue because:
Additionally, if you turned fast multiplication on, you would have not triggered the bug at all.
This slows down our Poly1305 implementation slightly.
$ignore parameter to sodium_hex2bin() polyfill
autoload-fast.php include path issue with Wordfence plugin for WordPressEd25519 is included, so too is the class it inherits from.sodium_crypto_stream_xchacha20_xor_ic()
sodium_crypto_scalarmult_ristretto255() that was producing incorrect results in PHP 8.1
ge_scalarmult()New: Implements Ristretto255.
Ristretto is a technique for constructing prime order elliptic curve groups with non-malleable encodings. It extends Mike Hamburg's Decaf approach to cofactor elimination to support cofactor-8 curves such as Curve25519.
This is a new feature landing in PHP 8.1 for advanced users. Among other things, Ristretto allows you to easily build modern password-authenticated key exchanges, e.g. CPace.
Special thanks to Tony Arcieri, Frank Denis, Isis Lovecruft, Mike Hamburg, and Henry de Valence for making this release possible.
crypto_kx()sodium_crypto_stream_xchacha20_xorsodium_crypto_stream_xchacha20
How can I help you explore Laravel packages today?