HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
paragonie
sodium_compat
PHP2017–2022
paragonie / sodium_compat

sodium_compat

Pure PHP polyfill for ext/sodium

2Distinct people
12Mentions
0Explicit recommenders
933GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Pure PHP polyfill for ext/sodium

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year12 dated mentions

Observed mentions: 2017-01-06 03:27:23 UTC to 2022-01-24 16:35:13 UTC.

02468102017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 10 mentions; 5 submissions, 5 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2022

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC1055
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC101
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101

What Hacker News says

12 sources
> Find 10 people who have adopted Poly1305 and ask them what Poly1305 does better than GCM. Two things, one of which cannot be credited to Poly1305 directly. 1. Poly1305 is easier to implement without introducing side-channels (modulo integer multiplication on some CPUs; in which case, I defer to Thomas Pornin on how to avoid them). 2. The Chapoly constructions that use Poly1305 do so in a way that leaking the one-time Poly1305 key doesn't buy you much. (This is the one that cannot be attributed to Poly1305 directly.) Others may have better or different answers. I implemented it in PHP [1], so anyone reading this thread should keep that in mind. :) [1] https://github.com/paragonie/sodium_compat/blob/f3b2d775a50d...
In Self-encrypting deception: weaknesses in the encryption of solid state drives [pdf]
> This is something that I would love to see happen with open source projects: That won't happen. But not for lack of trying! My consulting company, Paragon Initiative Enterprises, has produced over a dozen high quality open source projects that make it easier to write secure PHP software. For starters, we wrote an entire CMS that has secure automatic updates baked into its core as a first-class feature (including for extension developers): https://paragonie.com/project/airship Worried about SQL injection? EasyDB makes it easy and intuitive to use prepared statements. https://github.com/paragonie/easydb Need Content-Security-Policy headers quickly and easily? You want CSP-Builder: https://paragonie.com/project/csp-builder Want all the security of libsodium with an even simpler interface and a separate class for dealing with the filesystem
Read the rest
? Check out Halite: https://paragonie.com/project/halite Want to stop CSRF (including replay attacks)? https://github.com/paragonie/anti-csrf Want to quickly examine the differences between two PHP Archives (e.g. for reproducible builds)? https://github.com/paragonie/pharaoh We even wrote the community's accepted interface for generating cryptographically secure random numbers in PHP 5 projects: https://github.com/paragonie/random_compat And coming soon (pending an audit), a pure-PHP implementation of libsodium that will likely be adopted by WordPress so its automatic updates are Ed25519 secured: https://github.com/paragonie/sodium_compat And even more: https://paragonie.com/projects Guess how many clients we've gotten from all this open source software we wrote over the past two years that demonstrably improves the security posture of software written in PHP? Zero. My solution: Our next project isn't going to be OSS, and it's unlikely that any of our future ones will be unless it's intended to be a giveaway. The open source + consulting business model may sound good in theory, but it simply doesn't work. (Though, I will grant that it's possible that the "consulting about someone else's open source project" is more sustainable, due to near-zero investment in said project itself.)
In Sandstorm is returning to its community roots
SEEKING WORK | REMOTE | Orlando, FL Need to shore up the security of your web-based software? Need someone who can work within real-world security requirements? PHP powers over 82% of websites on the Internet today, though it's often shunned by other information security professionals. For most companies, rewriting everything from scratch in a different language is not a viable strategy for minimizing the risk to themselves or their customers. Is it possible for software written in PHP to be secure (in spite of what other security experts say)? Yes. If you still have doubts, get in touch. My research and professional background mostly consists of software development, web application security, applied cryptography, code auditing, and penetration testing. You may find much of my recent open source security research here: https://paragonie.
Read the rest
com/security/advisories A sample of PHP projects I've developed or contributed to significantly: - random_compat - PHP 5 polyfill for the CSPRNG functions introduced in PHP 7; this security library has over 19 million installs according to Packagist - https://github.com/paragonie/random_compat - sodium_compat - A pure-PHP implementation of much of modern elliptic curve cryptography and (AEAD) symmetric encryption - https://github.com/paragonie/sodium_compat - CMS Airship - A secure-by-default content management system - https://paragonie.com/project/airship - CSP-Builder - A developer utility to promote the adoption of Content-Security-Policy headers - https://github.com/paragonie/csp-builder I can be reached via https://paragonie.com/contact or email: security@paragonie.com
In Ask HN: Freelancer? Seeking freelancer? (February 2017)
> Implementing crypto primitives in an interpreted language is full of hazards for side channel attacks - being constant time is just the first step. Cache behavior, branch predictor attacks, etc are also important. And all of the above applies to native code crypto too. When you add an interpreter on top, a ton of new side channels are introduced. These are the sort of things I'm hoping can be addressed in the planned third-party audit: https://github.com/paragonie/sodium_compat/issues/8 If it turns out that this project is helplessly insecure and there's no way to make it reasonably secure, I'm never tagging v1.0.0. Dead stop. > The motivation for this project seems to be "not every PHP programmer can install native libs on their $5 hosting platform", which IMO is a pretty poor justification for a new crypto library. Feel free to disagr
Read the rest
ee on this. I'm specifically more concerned with the second-order effect of what you've described; namely, PHP projects can't require ext/libsodium because they can't expect everyone to easily install it. I want to get everyone off mcrypt, unauthenticated AES-CBC, RSA encryption with PKCS1v1.5 padding, etc. I'd like to get Ed25519 signature verification built into automatic updates throughout the entire ecosystem. Sodium_compat was the only reasonable strategy to accomplish these goals, given real-world constraints. > Good thing is that this library will use native libsodium if available, so hopefully the impact of side channels in this isn't that great. I'm hoping there aren't any, but if there are, that installing the PHP extension mitigates them entirely. It'll make it easier to convince $5 hosting platforms to install the extension. :)
In Show HN: Sodium_compat, a Pure PHP implementation of libsodium
There's even more work to be done on the WordPress front (and PHP in general for that matter): making automatic updates secure even if the server gets hacked. https://core.trac.wordpress.org/ticket/39309 https://github.com/paragonie/sodium_compat I'm currently writing a pure-PHP libsodium polyfill that, once audited, will be proposed to shore up the security of PHP projects the whole world over. Among other things, this means that everyone will be able to adopt Argon2i for password hashing even if they support PHP 5.2.4 like WordPress does. Ideally, everyone would get in the habit of updating to the latest versions more rapidly. But when 27% of the Internet runs software that refuses to modernize, that becomes a huge risk to the rest of the Internet.
In Myths about /dev/urandom (2014)

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.