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

From what /r/crypto says, they leak metadata to the database server.

https://www.reddit.com/r/crypto/comments/6e5jjz/building_sea...

comment 9y ago · link · parent

> Can someone explain why it's not simple to brute force the hash in the blind index?

You're not bruteforcing H(m) here. You're trying to bruteforce H(m, k) without knowing k. To make matters worse, k is a random string of 128+ bits, generated by a CSPRNG.

comment 9y ago · link · parent

Here's the killer feature of my approach: Each filter has its own HMAC/Argon2 key, so it becomes less useful for what I like to call crossword puzzle attacks. (I hope that's easier to understand than a wordy explanation of how such an attack would work.)

comment 9y ago · link · parent

> I disagree with the dishonorable mention as you've only considered the naive case which you can build upon to avoid the issues mentioned. Consider a design where everything is AES-256 encrypted in the application and the database just receives an encrypted binary. You can build an in-memory cache for situations where you need to search sensitive information (first name, last name, ssn) by using a tokenizer and using a technology like Erlang term storage. It will be eventually consistent which should be fine for our use case since that type of information does not change that often and the cache recompute can be done asynchronously.

https://tonyarcieri.com/all-the-crypto-code-youve-ever-writt...

https://blog.filippo.io/the-ecb-penguin/

There are defensible positions for which ECB mode is acceptable. I wouldn't classify the scenario you described as one of them.

> If someone gets unauthorized access to the server you are already screwed since your application can get access to the plain text data in order to serve requests.

If someone gets unauthorized access to the webserver, yes, it's game over.

If someone gets unauthorized access to the database server, and it's a separate machine from the webserver, then your analysis here isn't applicable.

That's the threat model alluded to in the beginning of the article, but if it's not your threat model, then you may reach different conclusions about the best way to protect data. (You may not even use encryption, for example.)

comment 9y ago · link · parent

The practical reason: https://3v4l.org/LEar1 (No SIV in that list.) It's also not present in libsodium or (shudder) mcrypt.

What property are you hoping to extract out of AES-SIV in particular? (And would AEZ, HS1-SIV, AES-SIV-GCM, etc. solve your problem?)

From what I understand, SIV mode still uses a nonce, but it doesn't explode if you reuse it for different messages. Are you aiming for nonce-less encryption?

The end goal that was being worked towards in the article (Argon2-derived Bloom filters for partial searching) is a little more useful than nonce-less encryption.

comment 9y ago · link · parent

Laravel and Symfony get counted through Packagist. WordPress does not.

Basically, 28 million + (number of WordPress 4.4+ installs) = total installed base of random_compat

comment 9y ago · link · parent

Roughly 15,000 for Halite https://packagist.org/packages/paragonie/halite

Less than 10 for Airship. There's a lot of reasons for that, though (aside from the fact that we built it to be Tor-friendly, so it's nontrivial to measure how many installs exist in the world): We only supported PostgreSQL and only users capable of installing libsodium from PECL could use it. PHP 7.2 will make it possible for everyone to use Airship version 2, and MySQL 8 will add CTEs so we might be able to support the more mainstream database. https://wiki.php.net/rfc/libsodium

comment 9y ago · link · parent

I've tried it. I've failed at it.

Halite is a libsodium wrapper for PHP projects that emphasizes ease-of-use and difficulty to misuse: https://github.com/paragonie/halite

CMS Airship is a secure-by-default content management system (think WordPress, Drupal, Joomla, etc.): https://github.com/paragonie/airship

Both projects are released under GPL but offer commercial licenses. In two years, I've only had one person ever inquire about a commercial license, and they backed out.

One of the libraries I wrote has an installed base of (not counting WordPress) over 28 million, yet I rarely hear from its users: https://packagist.org/packages/paragonie/random_compat

The barrier isn't legal or philosophical, it's that a lot of very useful open source software (especially libraries that developers interface with) are infrastructure rather than window dressing, which is largely invisible to organizations.

If you only develop window-dressing libraries, then the stuff 'patio11 has said here over the years might hold true. But if you're trying to build a more secure Internet by giving developers better tools, nobody wants to pay you for that.

999.

Guide to Building Searchable Encrypted Databases with PHP and SQL(paragonie.com ↗)

2 points · by CiPHPerCoder · 9y ago · discuss

1000.

Building Searchable Encrypted Databases with PHP and SQL(paragonie.com ↗)

59 points · by CiPHPerCoder · 9y ago · 30 comments

1001.

Building Searchable Encrypted Databases with PHP and SQL(paragonie.com ↗)

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

1002.

Building Searchable Encrypted Databases with PHP and SQL(paragonie.com ↗)

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

comment 9y ago · link · parent

Sure, a couple of questions:

1. How do you measure "largeness" of a git repo?

2. How are you confident that you have the largest?

3. How much technical debt does that translate to?

comment 9y ago · link · parent

> The political concerns extend beyond the company's own internals. They must appear enterprisey if they expect to be treated enterprisey. Today, enterprises have "data science" departments and blow $100k/mo on useless crap. If they're not doing that, it's a liability for the whole company, not just from the petty territorial perspective of one individual. It doesn't matter that it's possible to accomplish the same thing with one one-hundredth of the monthly expense. The enterprise signaling is worth the cost.

This is a great opportunity to sell $400/mo. enterprise solutions for $100k/mo.

comment 9y ago · link · parent

I'm characterizing it as a protocol/design flaw in something that bills itself as the most secure X, sure, but I haven't done anything to describe it as "huge".

Are you being needlessly defensive?

comment 9y ago · link · parent

If your application-layer cryptography protocol is not secure in isolation, what argument do you have against making it secure in isolation?

comment 9y ago · link · parent

If you call your project "the most secure X" and you're doing something related to X in a very sub-optimal way (i.e. not using AEAD modes), what happens if someone uses your code as a reference point for writing their own crypto for a protocol that doesn't use IPFS? What if, instead of a specific instance of copying code out of context, people learn bad habits from your code and then defend their choices until they're blue in the face because they copied it off of "the most secure" reference implementation?

A lot of problems, many unforeseeable, are easily prevented by using authenticated encryption.

> You're just not presenting a convincing argument for why it's OK to trust the code but not the data when they're both served out of the same place. Do you understand that they're both served from the same place? If somebody can modify the data, they can just as easily modify the code and make it do whatever they want. Do you understand that?

Yes, and this has been covered to death to the point that I'm sick of hearing it: https://www.nccgroup.trust/us/about-us/newsroom-and-events/b...

One could easily build a Chrome extension that still uses your IPFS gateway for shipping ciphertext. Now you've got the code at rest (so transport-layer integrity doesn't undermine the code being executed), but the data is still reliant on IPFS.

Let's do a thought experiment.

First, move your code to a Chrome extension (which makes the code immutable), then give the attacker an enormous amount of power. For a moment, assume that an attacker can totally defeat IPFS. It doesn't matter how they do it. Is your application-layer cryptography protocol still secure?

comment 9y ago · link · parent

A lot of crypto engineering problems go out the window if you just trust the messages you're receiving. That doesn't mean it's okay to use unauthenticated encryption in 2017.

> EDIT: (Since HN won't let me reply to you): There is no mode of operation in which it's safe to use Hardbin without trusting the messages you're receiving, authenticated encryption or not.

> Since the code and the data are both served out of IPFS at the same time, checking the message integrity is pointless. If somebody controlled the IPFS node you're using and wanted to do something malicious, they could more easily just add some code to ship the decryption key off to a remote server than perform an attack on the unauthenticated encryption.

http://www.cryptofails.com/post/121201011592/reasoning-by-le...

comment 9y ago · link · parent

First, read this: https://tonyarcieri.com/all-the-crypto-code-youve-ever-writt...

Second, what is the threat model where you trust IPFS but still need to encrypt client-side? Unauthenticated CBC mode totally defeats the point of encryption, but encryption totally defeats the point of trusting IPFS.

Why not just-- crazy idea!-- use authenticated encryption even if you trust IPFS?

comment 9y ago · link · parent

CBC mode isn't exactly a saving grace here, since it's unauthenticated.

comment 9y ago · link · parent

https://github.com/jes/hardbin/issues/1

You don't exactly need clairvoyance to predict this outcome.

comment 9y ago · link · parent

I've had other reasons to want to switch. It's still not enough to pull the trigger though.

comment 9y ago · link · parent

I'm seriously considering switching to Gitlab. Multiple assignees makes sense for large projects.

comment 9y ago · link · parent

There are 4+N keys involved.

  - The attacker's RSA private key (UNKNOWN)
  - The attacker's RSA public key (KNOWN)
  - The local device's RSA private key (KNOWN, but then poorly wiped)
    - This is encrypted with the attacker's RSA public key
  - The local device's RSA public key (KNOWN)
  - A separate AES key for each file
    - These are encrypted with the local device's RSA public key
How decryption should work: Get the local device's RSA private key from the attacker (EDIT: this is not the attacker's RSA private key, it's the local one), then you can decrypt the AES key for each file.

comment 9y ago · link · parent

I know a lot of LGBT folks who use Telegram for non-serious stuff. Mostly shooting the shit, and using stickers for amusing reactions and whatnot.

My original comment probably should've used a semicolon before "Use Signal or WhatsApp instead."

comment 9y ago · link · parent

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

comment 9y ago · link · parent

(In case anyone got lost halfway through tptacek's comment, my name is Scott.)

comment 9y ago · link · parent

> If the rumours are correct, NSA has a backdoor to both signal and whatsapp

The rumors you heard are both wrong and stupid.

comment 9y ago · link · parent

> I find the recommendation to just use Whatsapp weird.

For most WhatsApp users, the alternative to WhatsApp for most people is unencrypted SMS, which gives metadata and the contents of the communication to anyone with modest skill and a $50 budget. I like to think WhatsApp's use of the Signal protocol makes it preferable to SMS.

comment 9y ago · link · parent

Regular reminder that Telegram's encryption protocol, MTProto, is not secure, and you should not ever rely on it for privacy. Use Signal or WhatsApp instead.

https://eprint.iacr.org/2015/1177.pdf

http://www.cryptofails.com/post/70546720222/telegrams-crypta...

1
333435
60