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 2y ago · link · parent

> Obvious limitations is that you can't use the fields for sorting in queries (ORDER BY), and depending if deterministic encryption is not enabled, you can't use it in filters (WHERE) either. Same applies for any T-SQL logic on the data fields - because the encrypted blob is opaque to SQL Server - it is decrypted client-side. There is no workaround, except for pulling the data locally and sorting client-side.

This is a reasonable limitation when you're aware of the attacks on Order Revealing Encryption: https://blog.cryptographyengineering.com/2019/02/11/attack-o...

comment 2y ago · link · parent

The thing that's security theater isn't encrypting at rest in general.

The thing that's security theater is encrypting insecurely, or failing to authenticate your access patterns, such that an attacker with privileged access to your database hardware can realistically get all the plaintext records they want.

comment 2y ago · link · parent

Andy Jassy decided that it was time to Return To Office.

I was hired in 2019 as a fully remote employee. This means my options in 2023 were a) move to Seattle or b) walk. I chose to walk.

The leadership of the Cryptography org fought tooth and nail to get an exception for me, but were unable to do so. I still hold everyone in AWS Cryptography in high regard.

comment 2y ago · link · parent

Thanks for clarifying, and confirming at least one of my suspicions.

All I can say here is, "Yikes."

If you (or, well, anyone) ever need an honest third party to audit a cryptography design--whether it's because you suspect bullshit or just want assurance that it's actually a good design--talk to the Crypto team at Trail of Bits.

https://www.trailofbits.com/services/software-assurance/cryp...

comment 2y ago · link · parent

> I wonder if OP works in healthcare

No, I work in applied cryptography.

When I joined Amazon, the team I was hired on was called AWS Crypto Tools (which owned the AWS Encryption SDK, among other developer tools), while another team was called Transport Libraries (which owned S2N).

When I left in 2023, they started adopting more of the "Encryption At Rest" lingo for what was previously called Crypto Tools. I don't know if they landed on different verbage since then.

> after HIPAA passed encryption at rest was the buzz word of the decade as it was one of the primary requirement of HIPAA.

Interesting. Thanks for sharing.

comment 2y ago · link · parent

> The main threat to encrypting health information is actually dishonest cryptographers.

Wow, okay, you have me hooked.

> instead of searching for user Michael Knight in a database of cancer patients, you hash the name, use a bloom filter to determine if the hash exists in the protected data set or not

The protocol you loosely described here could be either totally fine or horrendously broken depending on the implementation details and architecture of the application. Not to mention the universal cryptography concerns; i.e., key management.

> and then tell your regulators and the public that the foreign jurisdiction research assistants hired from fiverr don't have access to your health information because everything is encrypted and we only compare hashes.

You've said "hashes" twice now, so I have to ask:

1. Are they only hashing, or are they using a keyed hash (e.g., HMAC)?

2. Are they doing something ridiculous like using MD5?

If you're familiar with cryptography at all, passing around MD5(data) is vastly different from truncating HMAC-SHA384(data, staticKey) to a few bits and protecting staticKey with an HSM.

Without more detail, I can't tell if your assertion that cryptographers are being dishonest is warranted. It's sort of like simplifying RSA encryption to "multiplying integers". Yes, that's what's happening on some level, but some essential information was omitted.

comment 2y ago · link · parent

> That said, it would be helpful for us i² [i squared] folks to have some of the more basic terms explained. Although "encryption at rest" is somewhat understandable, it would be pleasant to have it explained.

That's helpful feedback, actually. What terms seemed opaque or misleading to you as you read it? I'm always happy to fix mistakes in blog posts to improve clarity.

> For example what are the other kinds?

I contrast "encryption at rest" with "encryption in transit" (i.e., TLS) and "end-to-end encryption" (E2EE for short; i.e., what Signal gives you).

comment 2y ago · link · parent

> Are you the author of the paragonie website? The coincidence was startling. If so, I greatly thank you for the resource.

Thanks. Yes, I'm one of the authors.

comment 2y ago · link · parent

> I’d say the author is being so restrictive in the scope of threats that it isn’t very useful.

Loss of control of the hard disks may have many different ways it can manifest in the real world, but from a cryptography and software development perspective, is congruent to other flavors of the same underlying problem.

That's not being "restrictive", it's recognizing the common denominator.

comment 2y ago · link · parent

> As someone who has issues remembering where they left their house keys at times, I want this on a bloody coffee cup/t-shirt.

I've heard this quote a lot over the years, but the first person who said it was probably Lea Kissner, the former CISO of Twitter.

Here's their most recent post of the same statement: https://hachyderm.io/@leak/110784289970982813

comment 2y ago · link · parent

It sounds to me like you read a different article than I wrote.

The point of my article was not "Encryption-At-Rest Is Bad" as you seem to have taken it to mean.

Rather, the point is that other techniques, when you sit down and actually think them through, do not provide any significant value over just phoning it in with Full Disk Encryption.

How you get from "software libraries that encrypt-at-rest routinely fail to provide value on top of full disk encryption" to "Scott says FDE is bad" is unclear.

Additionally: From a software perspective, the risks you all outlined are morally equivalent to the hard drives grew legs and walked because they are the same risk; namely, loss of control of the actual hard drives.

The article in question is focused on threats when those drives are plugged in and the keys are being used to encrypt/decrypt data. As several others have pointed out already, I explicitly state this, repeatedly. I don't know how to make it more clear.

comment 2y ago · link · parent

Was it similar to this? https://github.com/facebookarchive/php-graph-sdk/pull/552#is...

comment 2y ago · link · parent

> Not sure what the state the art is in searchable encryption for db indexes, but just trying to do stuff that requires a scan becomes untenable due to having to read and decrypt on the client to find it or aggregate it.

There are a lot of different approaches, but the one CipherSweet uses is actually simple.

First, take the HMAC() of the plaintext (or of some pre-determined transformation of the plaintext), with a static key.

Now, throw away most of it, except a few bits. Store those.

Later, when you want to query your database, perform the same operation on your query.

One of two things will happen:

1. Despite most of the bits being discarded, you will find your plaintext.

2. With overwhelming probability, you will also find some false positives. This will be significantly less than a full table scan (O(log N) vs O(N)). Your library needs to filter those out.

This simple abstraction gives you k-anonymity. The only difficulty is, you need to know how many bits to keep. This is not trivial and requires knowing the shape of your data.

https://ciphersweet.paragonie.com/security#blind-index-infor...

I proposed the same technique to AWS, who adopted it under the name Beacons for the AWS Database Encryption SDK.

https://docs.aws.amazon.com/database-encryption-sdk/latest/d...

44.

Loss of Key Control Security in NIST SP 800-108(scottarc.blog ↗)

1 points · by CiPHPerCoder · 2y ago · discuss

45.

Encryption at Rest: Whose Threat Model Is It Anyway?(scottarc.blog ↗)

2 points · by CiPHPerCoder · 2y ago · discuss

comment 2y ago · link · parent

> In terms of JWT vs other ways of doing this, is there any evidence that JWTs are more vulnerable that other approaches? Clearly there are vulnerabilities is other approaches as well.

Contrast JWTs with PASETO implementations when you make that sort of analysis.

i.e., pick any that support v3/v4 and try to attack them the same way that JWT implementations have been vulnerable, or worse ways: https://paseto.io

comment 2y ago · link · parent

https://github.com/firebase/php-jwt/issues/351

comment 2y ago · link · parent

The vulnerability is usually in verifiers rather than signers.

See, for example:

https://github.com/firebase/php-jwt/issues/351

comment 2y ago · link · parent

> The article misses the point of JWT: it's dead simple to implement.

Implementing it securely, however, is far from dead simple.

https://scottarc.blog/2023/09/06/how-to-write-a-secure-jwt-l...

comment 2y ago · link · parent

> Packagist is mostly a graveyard of libraries that people have coded up for their exact niche use-case 8 years ago (with no updates since), with little flexiblity beyond that (like you would see for libraries in other ecosystems).

Could you provide some examples? I wrote a lot of PHP libraries over the years, and while some are definitely stale because nobody uses them (and thus I have no incentive to keep the lights on), the only time I see dead packages, they're actually forks of other open source software that people contributed exactly one commit to (to change the package name).

comment 2y ago · link · parent

This why I postulated "a new kind of cyber insurance" rather than what the industry has already cooked up.

The implication is: This new insurance would be legally obligated to actually fund stuff.

comment 2y ago · link · parent

I've filed a bug in my backlog to add a doodle of a cool bear somewhere in the post.

comment 2y ago · link · parent

> One insurance company pays, they all benefit. Companies would simply wait for someone else to pay. There would need to be some kind of government agency forcing all of them to pay in.

Sure, with some caveats: You can scope it down to only very large companies very easily.

> They would pass the costs to customers. In essence, your suggestion leads to a Cyber tax collected by the IRS.

That's a bit oversimplified, I think. To the companies affected by the regulation, sure. Not every company would need to buy in. (At least, I hope not. Mom and pop shops aren't exactly flush with cash!)

> Next they have to divvy up the funding to pay OSS developers. Now you have the same problem you started with.

It's the spirit of the same problem, but the distribution is different.

Before, it's "make the US government funnel taxpayer dollars into OSS directly". Now it's "the US government forces megacorps to buy insurance, and the insurance companies figure out how to minimize risk by investing in the supply chain" one layer removed.

One reason why this might be better than the original version of the problem is that you can simply (but not easily; nothing in politics is ever easy) reproduce the same regulations and insurance business models in other countries, and the load is now balanced across the globe. Then the whims of individual countries' leadership is no longer a single point of failure.

In the abstract, you are correct. But the details matter.

Of course, I could be wrong. I'm not an expert on policy, economics, or law.

comment 2y ago · link · parent

> What I don’t understand is why you are proposing a model (insurance) that doesn’t work in practice, and is susceptible to high levels of corruption. Why this would work differently in the case of open source.

The legal/regulation problems here are valid concerns, but the model is a bit different.

The primary corruption of insurance has a lot to do with their ability to deny paying for what they ought to cover. That's a problem. The incentives at play pretty much guarantee it will always be a problem, for which strong regulations are necessary. We don't have strong regulations in the USA for e.g., health insurance, so I can understand why the word "insurance" is unattractive.

> Why this would work differently in the case of open source.

Great question.

The very incentive that makes insurance highly corrupt is what I'm proposing be leveraged to benefit open source developers.

A hypothetical insurance company would want to minimize their downside (paying money out), in order to maximize profits, because that's the economical system we live in today. The model I'm proposing is that investing in "the supply chain" would provide resources to offset risk.

On the other side, companies will want to minimize their spend on insurance. An insurance provider may offer reduced rates for companies that demonstrate some measurable commitment to security and responsible data handling practices (a.k.a. not collecting data they don't need in the first place, in case a breach does occur).

This insurance provides a currently absent mechanism for security assessors to affect positive change that protects the rest of us even if the company doesn't want to actually put in the effort.

That's why I proposed it as a contender.

comment 2y ago · link · parent

> Just because it can by beaten doesn’t mean making it harder isn’t useful.

Fair.

> This person/team used a VPN. Masking your location is a big red flag for just dev work like this. These things could be exposed in UI.

I disagree strongly, and am surprised to hear this argument on Hacker News of all places.

comment 2y ago · link · parent

I've argued in a blog post [1] that we need to delineate between "open source developer" and "supplier". If we don't do that, calling thankless unpaid volunteers and hobbyists a "supply chain" is kind of insulting [2].

I don't believe that "identity verification" for F/OSS developers is a good idea. Suppliers? Sure. That can be a contract negotiation when you decide how much you pay for it.

Also, I don't think identity verification helps when your adversary is a nation state, which can just falsify government identification if it suits them.

[1] https://scottarc.blog/2024/04/04/open-source-supply-chains-a...

[2] https://crankysec.com/blog/supply/

57.

Open Source, Supply Chains, and Bears(scottarc.blog ↗)

18 points · by CiPHPerCoder · 2y ago · 14 comments

comment 2y ago · link · parent

Even funnier if you manage to click "Declassify" :)

comment 3y ago · link · parent

Hi. Blog post author here.

There's multiple factors behind this.

For one, the IETF already has a JOSE working group. This working group doesn't see it necessary to have a competing standard, and will stonewall any effort within the IETF to make a competing design. Dealing with their gatekeeping and tut-tutting over "why make a new design instead of just ironing out the deficits of JOSE?" is a full time job.

For the past few years, I've also not been able to email any IETF mailing list without Legal's permission from my employer. This is due to how broadly the IETF interprets "IP contribution". It was so stupid that I had to harass our IP lawyer for 2 weeks (in conjunction with a Sr. Principal Engineer who was deeply confused why they wouldn't even respond to my tickets, emails, or Slack messages) to get them to let me send an email to the COSE working group mailing list to inform them of a security footgun that was being proposed: https://mailarchive.ietf.org/arch/msg/cose/k6VnQkSNgyD1TsCMQ...

The permission I finally eeked out of Legal was only to send that initial message and nothing else, so Google's Sophie Schmieg had to fill in the blanks when they responded with questions: https://mailarchive.ietf.org/arch/msg/cose/BPKWnJraRblWEC9nu...

There are no technical reasons why there cannot be a PASETO RFC, or a PASERK RFC. The only objections are political or (from Amazon's side) very stupid.

I'm likely to be fired soon for refusing to relocate in accordance with Andy "Jasshole" Jassy's top-down RTT mandate, so I don't feel any incentive to hold my tongue on this matter.

I've personally given up on the IETF, and will instead be contributing PASETO and PASERK to the C2SP initiative, which I believe is more suitable for cryptographic specifications.

https://github.com/C2SP/C2SP

12345
60