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

comment 9y ago · link · parent

PoC has stood for "Proof of Concept" for a long time, so probably not.

It is amusing to read it as "People of Color || GTFO" as a statement demanding racial equality in companies' hiring practices.

962.

Libsodium Quick Reference(paragonie.com ↗)

3 points · by CiPHPerCoder · 9y ago · discuss

comment 9y ago · link · parent

I'd like to see packages be handled differently to where nothing is forked.

Instead of pinning to, say PHP 7.1.5, pin to 7.1 and stop backporting fixes. It's okay to have 7.1.6.

comment 9y ago · link · parent

I think I meant to respond to the parent comment, not yours. But that was hours ago.

comment 9y ago · link · parent

That's called post-quantum cryptography, not quantum cryptography.

comment 9y ago · link · parent

I found the video linked at the bottom interesting too: https://www.youtube.com/watch?v=rENyyRwxpHo

I'd never heard of Laniakea before.

967.

Libsodium Quick Reference: Similar Functions and Their Use-Cases(paragonie.com ↗)

3 points · by CiPHPerCoder · 9y ago · discuss

968.

Show HN: Sodium_compat, a Pure PHP implementation of libsodium (stable release)(github.com ↗)

1 points · by CiPHPerCoder · 9y ago · discuss

969.

Libsodium Quick Reference: Similarly-Named Functions and Their Use-Cases(paragonie.com ↗)

3 points · by CiPHPerCoder · 9y ago · 1 comment

comment 9y ago · link · parent

My previous comment is RFC 2119 compliant.

comment 9y ago · link · parent

Given that Signal was designed specifically for mobile users not desktop users, that's not a problem for its target audience.

Wire looks promising for desktop users.

comment 9y ago · link · parent

Client software (anything that runs on the user's device) should be open source for two reasons:

1. It's easier to audit, although binary analysis is still useful (and reverse engineers are often better at finding security holes than someone doing a source code review).

2. Reproducible builds.

Server software doesn't need to be open source. If you have E2E in your open source software, you don't need to trust the servers at all: https://paragonie.com/blog/2016/03/client-authenticity-is-no...

comment 9y ago · link · parent

This has been discussed before. Read these two threads:

https://news.ycombinator.com/item?id=6915741

https://news.ycombinator.com/item?id=10713064

comment 9y ago · link · parent

> Facebook mines WhatsApp metadata [1].

Thomas addressed this:

If you're worried about Facebook seeing your metadata, which is a sane worry, Wire is approximately as slick and usable as WhatsApp with mostly the same underpinnings.

> I'm not sure I'd elevate WhatsApp over iMessage

I would! Consider the following: https://blog.cryptographyengineering.com/2016/03/21/attack-o...

That sort of attack is not possible against WhatsApp.

975.

Show HN: Sodium_compat, a Pure PHP implementation of libsodium (stable release)(github.com ↗)

2 points · by CiPHPerCoder · 9y ago · discuss

976.

Libsodium Quick Reference: Similarly-Named Functions and Their Use-Cases(paragonie.com ↗)

3 points · by CiPHPerCoder · 9y ago · discuss

977.

Guide to Automatic Security Updates for PHP Developers (2016)(paragonie.com ↗)

3 points · by CiPHPerCoder · 9y ago · discuss

comment 9y ago · link · parent

There are multiple elements to unpack here. The obvious pre-crime problem other commenters raise. The fact that terrorism is such a rare risk it isn't worthy of our attention.

But I'd like to raise another objection: Homomorphic encryption does not provide integrity over the ciphertext, which could open the door to active attacks against the systems that undermine its privacy goals.

https://news.ycombinator.com/item?id=14443191

https://paragonie.com/blog/2016/08/crypto-misnomers-zero-kno...

If you really need to build such a dangerous and needless system, would you want it to be built with such an error-prone cryptographic design? I'd say "No".

comment 9y ago · link · parent

There's also a bad joke here.

Can't have Alzheimer's without Al.

EDIT: Oh come on HN, periodic table jokes are in right now.

comment 9y ago · link · parent

Focusing time on climate change has the benefit of being right. This is good for the collective.

Focusing on blockchains has the benefit of being potentially profitable. This is good for the individual trying to get ahead of their competition in the rat race of life.

Guess which incentivizes human behavior more?

comment 9y ago · link · parent

I think a good model for crypto code documentation is https://github.com/defuse/php-encryption#getting-started

comment 9y ago · link · parent

It's in the Wikipedia entry, even. https://en.wikipedia.org/wiki/Galois/Counter_Mode

GCM = CTR + GMAC

If you're, elsewhere, using GMAC for some reason and getting a different result when you combine it with CTR mode: Well, that's weird. I'd have to have two implementations to compare to analyze further. But otherwise, this conversation is moot.

comment 9y ago · link · parent

> BLAKE2 was a SHA-3 finalist, and thus by definition isn't vulnerable to length extension either.

BLAKE2 wasn't, but BLAKE was.

Aside: Most people should continue to use HMAC-SHA256 instead of worrying about LEAs and justifying a switch to non-HMAC H(secret || message) constructions.

comment 9y ago · link · parent

So you mean something like this?

    $nonce = sodium_crypto_generichash($message, '', 24);
    $ciphertext = $nonce . sodium_crypto_aead_xchacha20poly1305_ietf_encrypt(
        $message,
        $nonce,
        $nonce,
        $key
    );
That solves the literal search problem, but none of the others.

However, in my experience[1], when it comes to deterministic encryption, most PHP developers will use ECB mode, or CBC mode with a NULL IV.

[1]: https://meta.stackoverflow.com/q/293930/2224584

comment 9y ago · link · parent

What are some constructions you'd consider "fair"?

comment 9y ago · link · parent

> Even without the key the system is still vulnerable to frequency analysis. For example if it were used to store passwords an simple sort and count would reveal accounts that have common passwords which could then be brute forced using lists of the most common passwords found on the internet.

I would hope, very strongly, that nobody would encrypt passwords, but instead, hash them: https://paragonie.com/blog/2016/02/how-safely-store-password...

comment 9y ago · link · parent

> Seems fair enough to me, though the article could do with a lead-in that explains what's being protected, the premise that the database server is a separate machine, etc.

Okay, I've added a section that spells this out explicitly and unambiguously. https://paragonie.com/blog/2017/05/building-searchable-encry...

comment 9y ago · link · parent

Right, but if you can compromise the webserver, you can get the key and defeat any application-layer encryption a PHP developer would have access to, thereby rendering any other threat models uninterestingly broken.

If you can keep the webserver secure, and on separate hardware from the database, you can protect against some attacks rather than no attacks. And if your database server is used by multiple verticals within a single company, this is an even more defensible design decision to make.

comment 9y ago · link · parent

> If you (for example) encrypt first names of people (or any other data point that is not unique per entry) using this scheme, then HMAC will reveal all the rows that have the same first name. You can then use frequency analysis to determine with high probablity what the encrypted names are.

This is where things get difficult to explain, because most health care programs are going to care about compliance first and foremost. So with that in mind:

1. You probably don't need to encrypt their first name to be e.g. HIPAA compliant, but...

2. Using a very short Bloom filter increases the odds of false positive collisions. Combine this with Argon2 and aggressive rate limiting, and now you've frustrated frequency analysis and chosen plaintext attacks greatly.

Given the threat model that we've given (database is not the same machine as the webserver, and the database server is what gets compromised), I can't see a better solution.

comment 9y ago · link · parent

This is assuming that:

  - The webserver and database server are on separate bare-metal
  - The database gets compromised, not the webserver
1
323334
60