Better HN
topnewbestaskshowjobs
Log inSign up

CiPHPerCoder

6,663 karma · joined Feb 25, 2016 (10y ago) · 1,775 submissions

My name is Scott. I do a lot of open source security research, and cryptography.

Previously AWS Cryptography (2019 - 2023).

Unless otherwise stated, my opinions are my own and do not reflect my employer.

https://scottarc.blog/about/

Submissions

901.

Libsodium Audit Results(privateinternetaccess.com ↗)

9 points · by CiPHPerCoder · 9y ago · 2 comments

comment 9y ago · link · parent

> While the flawed 'Secure' indicator on every HTTPS site will go away soon in favour of negative indicators for non-HTTPS connections

Isn't this good for your business model?

> the worrying thing here is the researchers didn't really examine their own biases.

Okay, so, how much money is CertSimple willing to offer up in the form of research grants to address these unanswered questions?

comment 9y ago · link · parent

Okay, maybe Ubuntu stopped being stupid and only Debian is still guilty of this?

This used to be a huge problem. I've since convinced [most PHP devs I talk to] to stop using distro-provided packages, in favor of deb.sury.org.

comment 9y ago · link · parent

That was years ago, IIRC.

PHP has gotten better about "no BC breaks in patch versions" over the years, but the Debian/Ubuntu teams still insist on making people effectively run e.g. 7.1.8 while the version indicator says 7.1.1.

It makes feature detection a nightmare.

comment 9y ago · link · parent

They backport patches and lie about the version number, to maintain the illusion of stability. It really pisses off the PHP community.

https://github.com/ircmaxell/password_compat/issues/90

comment 9y ago · link · parent

Virtually everything in the paragonie namespace on Packagist generates zero revenue, but we built and maintain them because we want to make the PHP ecosystem more secure by default.

https://packagist.org/packages/paragonie

907.

Joomla 3.8 to be the first large CMS to adopt libsodium support(twitter.com ↗)

1 points · by CiPHPerCoder · 9y ago · discuss

comment 9y ago · link · parent

For PHP integration, have you considered hooking into CSP-Builder? (It's MIT licensed, so you can just make a private fork for internal use forever, but if you upstream your changes, I'd greatly appreciate it.)

https://github.com/paragonie/csp-builder

comment 9y ago · link · parent

Interestingly, I looked through their entire CSV and was surprised to find one of my projects in their 5000 most popular set. Unfortunately, it was a reading list (awesome-appsec), not an actual software project. But still, kind of neat.

comment 9y ago · link · parent

> There's been absolutely zero effort to overhaul the core PHP API which is, on the whole, absolute junk.

If you were involved with the internals team at all, you would know this is not true.

911.

Why You Want to Hire Us to Audit Your Source Code(paragonie.com ↗)

3 points · by CiPHPerCoder · 9y ago · discuss

comment 9y ago · link · parent

82% of the websites on the Internet are powered by PHP, not Java.

A lot of these decisions are based on "what will pay the bills today and in the immediate future?" rather than purist idealism.

A lot of businesses use Java. Java experience is more useful for getting into mobile app development with Android. There's value to be had in learning and writing Java. But the demand for PHP doesn't cease to exist because Java is cool or useful.

https://w3techs.com/technologies/overview/programming_langua...

comment 9y ago · link · parent

"Don't write PHP, write Hack instead" is probably a better title for this post.

The author could have chosen to write about PHP best practices that are ignored in the ecosystem at large, but instead chose to evangelize HHVM features.

For anyone who currently writes PHP like it's 2009 and wants to learn a better way (without dropping PHP entirely):

http://www.phptherightway.com/

https://planet.nomadphp.com/

https://www.reddit.com/r/phpsec/

If anyone prefers to drop PHP entirely, that's fine too, but that's not the only good answer and pretending that all PHP is bad (like many of the comments on this thread already do) is very disingenuous.

comment 9y ago · link · parent

The only real blockchain is CBC mode. (Cipher Block Chaining)

What you're describing is a cryptocurrency, or some other form of cryptographically assured distributed ledger with a proof of work.

If you think I'm wrong, look in the original Bitcoin paper and search for "blockchain".

comment 9y ago · link · parent

Sufficient side-channel resistance for real world uses, sufficient GPU resistance. It's the best of both worlds. It's also going to be the libsodium default in the next release.

It's literally two passes that are memory independent, then two that are memory dependent, when r = 4.

comment 9y ago · link · parent

No I haven't. I didn't invent PBKDF2-Scrypt along the way.

comment 9y ago · link · parent

Okay, let's throw in an invalid curve attack vulnerability and call it even. I'll contact NIST for a grant. Let's get this ball rolling!

comment 9y ago · link · parent

Instead of password hashes, why don't we just use Argon2id as a KDF to produce an Ed25519 keypair, and then publish the (salt, memcost, opscost, Ed25519 public key)?

I can throw this into a structure indistinguishable from a blockchain if any VCs want to invest ;)

comment 9y ago · link · parent

No, that is not a thorough overview, that is a rant.

http://www.phpsadness.com/ is more helpful.

comment 9y ago · link · parent

> 7.x is better than 5.x but not GOOD ENOUGH.

What would make it good enough? Be specific.

comment 9y ago · link · parent

This is off topic and reads a bit like a personal attack, but if you want to have a level-headed discussion about Airship's design and implementation, https://github.com/paragonie/airship/issues

A lot has changed since you last looked at it, and a lot will change before the v2.0.0 rewrite is complete.

comment 9y ago · link · parent

Then your previous statement about PHP versions is irrelevant, and you should answer the question you were asked. To wit:

> Given how much has been deprecated/removed since 5.2, would you care to list some that remain?

For the version coming out at the end of the year, what is still insecure that leads you to believe "there is not an $x where that a statement is true"?

comment 9y ago · link · parent

Nope. https://3v4l.org/J45qU

comment 9y ago · link · parent

Yes, Psalm is great. We use it in a lot of our projects, and in the future will be using it in all of them. We absolutely love it. (It's on my "to blog about" queue.)

comment 9y ago · link · parent

I assume they meant the use of a cryptographic hash function (which is wrong) instead of a password hash function (which, as the name implies, is suitable for password storage).

For example, I see a lot of this construction in proprietary code:

    $passwordHash = md5(md5($password) . md5($salt));
    if ($storedHash == $passwordHash) {
        // Authenticated successfully
    }
I'm quick to find these offending snippets and migrate our clients to use password_hash() and password_verify().

comment 9y ago · link · parent

That's a separate concern from truthiness. And if you aren't using nullable types (a 7.1+ feature), passing NULL gives you a TypeError. :)

comment 9y ago · link · parent

> Truthiness (e.g. 0 == false, '0' == true, 'false' == true, etc.) makes it easier to introduce bugs.

Use === instead; except for cryptography, where you want hash_equals().

> There's a lot of discipline/linting still required in PHP, whereas other languages won't even compile if you do something risky.

And/or just use scalar type declarations: https://3v4l.org/SJKe1

comment 9y ago · link · parent

> it's hardly single-handed

I can't emphasize this enough.

Libsodium was Frank Denis's project, which was spawned by NaCl by cryptographers Dan Bernstein, Tanja Lange, and Peter Schwabe.

The participants who voted on the RFC, for the most part, were involved in the technical discussions over the past two years since I first mentioned the notion of doing so (before the PHP 7.0 release).

Similarly, there were 13 people who contributed to the libsodium-php repository (ext/libsodium in PECL). Every single one of them had to consent to relicensing the extension to easily get merged into PHP, and we all did.

I often joke that I'm the worst C developer in all of infosec, but there's some truth to that when it comes to modifying the PHP core.

My main role in the ext/sodium project was saying, "We should do this," and somehow getting people to listen.

929.

Simply Secure PHP Cryptography(paragonie.com ↗)

147 points · by CiPHPerCoder · 9y ago · 86 comments

930.

It Turns Out, 2017 Is the Year of Simply Secure PHP Cryptography(paragonie.com ↗)

1 points · by CiPHPerCoder · 9y ago · discuss

1
303132
60