paragonie/sodium_compat
Pure PHP implementation of libsodium; uses the PHP extension if it exists
v2.5.2
152M downloads/mo
#303 most downloaded on Packagist
paragonie/sodium_compat
What this package is like to depend on
Last release 5 days ago
18 Aug 2026
Release timing varies
gaps range from 9 days to 13 months
Rarely documented
notes for 10 of 85 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
85 releases · first in 2017
13 releases in the last 12 months
see the full history below
Release timeline
85 releases · Jan 2017 to Aug 2026Releases
latest 60 of 85-
v2.5.218 Aug 2026Release notes
Open source →What's Changed
- Fix cryptographic boundary and validation failures by @paragonie-security in #208
Full Changelog: v2.5.1...v2.5.2
-
v2.5.118 Aug 2026Release notes
Open source →What's Changed
- Fix Ed25519 main subgroup validation by @paragonie-security in #206
Full Changelog: v2.5.0...v2.5.1
-
v2.5.030 Dec 2025Release notes
Open source →Security Fix
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.
-
v2.4.006 Oct 2025Release notes
Open source →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.
What's Changed
- Optimize curve25519 field element by removing array by @paragonie-security in #198
- Remove dead or redundant code of
Util::(strlen|substr)by @takaram in #201 - Improve Unit Testing Coverage by @paragonie-security in #200
- Bigfixes and Improved Test Coverage by @paragonie-security in #202
New Contributors
Full Changelog: v2.3.1...v2.4.0
-
v2.3.130 Sep 2025Release notes
Open source →Deletes the erroneous PSR-0 autoloader declaration from composer.json, fixing #196
Full Changelog: v2.3.0...v2.3.1
-
v2.3.030 Sep 2025Release notes
Open source →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()orParagonIE_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.
What's Changed
- Fix CI for Fuzz/Mutation Tests by @paragonie-security in #190
- Update .gitattributes for psalm files by @erikn69 in #192
- Fix flaky test for PHP 8.1+ by @paragonie-security in #193
- Test enhancements + base64 no-padding fix by @paragonie-security in #194
New Contributors
Full Changelog: v2.2.0...v2.3.0
-
v2.2.021 Sep 2025Nothing published for this version
-
v2.1.004 Sep 2024Nothing published for this version
-
v2.0.124 Apr 2024Nothing published for this version
-
v1.24.218 Aug 2026Release notes
Open source →What's Changed
- Backport cryptographic boundary and validation fixes by @paragonie-security in #209
Full Changelog: v1.24.1...v1.24.2
-
v1.24.118 Aug 2026Release notes
Open source →What's Changed
- Fix Ed25519 main subgroup validation by @paragonie-security in #207
Full Changelog: v1.24.0...v1.24.1
-
v1.24.030 Dec 2025Release notes
Open source →Security Fix
Read: A vulnerability in libsodium
This fixes a congruent issue in the v1.x branch of the PHP implementation.
-
v1.23.006 Oct 2025Release notes
Open source →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.
What's Changed
- Backport #198 to v1.x by @paragonie-security in #199
- Backport Fixes from v2 ro v1.x branch by @paragonie-security in #203
Full Changelog: v1.22.0...v1.23.0
-
v1.22.030 Sep 2025Nothing published for this version
-
v1.21.219 Sep 2025Nothing published for this version
-
v1.21.122 Apr 2024Nothing published for this version
-
v1.21.019 Apr 2024Nothing published for this version
-
v1.20.105 Apr 2024Nothing published for this version
-
v1.20.030 Apr 2023Nothing published for this version
-
v1.19.026 Sep 2022Nothing published for this version
-
v1.18.123 Sep 2022Nothing published for this version
-
v1.18.013 Sep 2022Nothing published for this version
-
v1.17.123 Mar 2022Nothing published for this version
-
v1.17.010 Aug 2021Nothing published for this version
-
v1.16.125 May 2021Nothing published for this version
-
v1.16.014 May 2021Nothing published for this version
-
v1.15.417 Apr 2021Nothing published for this version
-
v1.15.314 Apr 2021Nothing published for this version
-
v1.15.214 Apr 2021Nothing published for this version
-
v1.15.114 Apr 2021Nothing published for this version
-
v1.15.014 Apr 2021Nothing published for this version
-
v1.14.003 Dec 2020Nothing published for this version
-
v1.13.020 Mar 2020Nothing published for this version
-
v1.12.230 Dec 2019Nothing published for this version
-
v1.12.107 Nov 2019Nothing published for this version
-
v1.12.019 Oct 2019Nothing published for this version
-
v1.11.418 Oct 2019Nothing published for this version
-
v1.11.317 Oct 2019Nothing published for this version
-
v1.11.217 Oct 2019Nothing published for this version
-
v1.11.112 Sep 2019Nothing published for this version
-
v1.11.011 Sep 2019Nothing published for this version
-
v1.10.112 Jul 2019Nothing published for this version
-
v1.10.013 May 2019Nothing published for this version
-
v1.9.409 May 2019Nothing published for this version
-
v1.9.309 May 2019Nothing published for this version
-
v1.9.209 May 2019Nothing published for this version
-
v1.9.120 Mar 2019Nothing published for this version
-
v1.9.006 Mar 2019Nothing published for this version
-
v1.8.103 Jan 2019Nothing published for this version
-
v1.8.029 Nov 2018Nothing published for this version
-
v1.7.022 Sep 2018Nothing published for this version
-
v1.6.621 Sep 2018Nothing published for this version
-
v1.6.514 Sep 2018Nothing published for this version
-
v1.6.429 Aug 2018Nothing published for this version
-
v1.6.306 Jun 2018Nothing published for this version
-
v1.6.222 May 2018Nothing published for this version
-
v1.6.121 Mar 2018Nothing published for this version
-
v1.6.015 Feb 2018Nothing published for this version
-
v1.5.630 Jan 2018Nothing published for this version
-
v1.5.518 Jan 2018Nothing published for this version