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

Reproducible builds, combined with digital signatures and an append-only cryptographic ledger, solve a lot of these trust issues.

https://paragonie.com/blog/2016/10/guide-automatic-security-...

comment 6y ago · link · parent

> Stewart Baker, an attorney at the Washington, D.C. office of Steptoe & Johnson LLP and a former assistant secretary of policy at the U.S. Department of Homeland Security, said the BlueLeaks data is unlikely to shed much light on police misconduct, but could expose sensitive law enforcement investigations and even endanger lives.

But then there was this: https://twitter.com/NatSecGeek/status/1273329710576152581

comment 6y ago · link · parent

Yep: https://asecure.cloud/a/scp_kms_delete_keys/

comment 6y ago · link · parent

If you use the AWS Encryption SDK, you can cache your data keys and reduce your calls to KMS: https://docs.aws.amazon.com/encryption-sdk/latest/developer-...

comment 6y ago · link · parent

> Not if the root of trust is secured by a proof-of-work blockchain

https://tonyarcieri.com/on-the-dangers-of-a-blockchain-monoc...

https://paragonie.com/blog/2017/07/chronicle-will-make-you-q...

> Not if zone operators upgrade to ECDSA as defined for DNSSEC in https://tools.ietf.org/html/rfc6605

First: That's a big "if". Lots of RSA legacy support.

Furthermore, ECDSA is so bad that Ed25519 and Ed448 are even coming to FIPS 186-5 later this year.

Citing ECDSA adoption in DNSSEC doesn't make as strong of a case as you might think.

156.

Private key of DigiCert Certificate Transparency log compromised(feistyduck.com ↗)

79 points · by CiPHPerCoder · 6y ago · 39 comments

comment 6y ago · link · parent

I don't want to sound dismissive, but I don't think their acquisition is going to be enough for them to compete with AWS.

https://www.camao.one/de-de/referenzen

Unless they have some other cards they haven't played yet, this sounds more like a headline intended for investors rather than customers.

comment 6y ago · link · parent

> Even with PHP7, PHP still feels like it is playing catch up. There is nothing new or revolutionary in PHP7, just adopting features present in other major languages.

Of the first programming languages that cater to novices to some degree (which is important to project health, because excessive gatekeeping is toxic), PHP was the first to make Curve25519 and Argon2id widely available (through the sodium extension). (7.2)

Even with the "just use FFI" mindset of other languages, the experience is janky at best.

For example: Before sodium-plus [1] came along (which was something I created, so I'm removing it from the table for my criticism of the JS crypto ecosystem), JavaScript required knowing which of the following packages to install: [2] [3] [4]

There was no guidance available anywhere. Some of these APIs were suitable for browsers, others for mobile devices, and still others for server-side JavaScript. And their APIs were subtly incompatible with each other.

Java's in a similar situation [5] today.

> Java (Java Native Access): libsodium-jna

> Java (Android): Lazysodium for Android

> Java (Android): Libstodium

> Java (Android): Robosodium

> Java (Android): libsodium-JNI

> Java: Apache Tuweni (crypto module)

> Java: Lazysodium for Java

> Java: jsodium

> Java: Kalium

Yikes.

With PHP7, you just had to update to the latest version (and make sure your OS package vendor isn't huffing or eating glue, which was rare but still existent) and you had it.

There are probably still languages and runtimes today that make using modern cryptography (Ed25519, X25519, etc.) a miserable experience.

Miserable experiences moving to modern cryptography keep peoples' projects trapped in an early 2000's RSA-PKCS#1v1.5 + AES-CBC hellscape reminiscent of SSLv3 but somehow worse.

Thus, I would argue that what PHP did with libsodium counts as revolutionary.

Your move, $languagesThatHackerNewsFindSexierThanPHP

[1]: https://github.com/paragonie/sodium-plus

[2]: https://www.npmjs.com/package/libsodium-wrappers

[3]: https://github.com/sodium-friends/sodium-native

[4]: https://www.npmjs.com/package/sodium

[5]: https://libsodium.gitbook.io/doc/bindings_for_other_language...

comment 6y ago · link · parent

> I really hope you're planning some agility in PASETO otherwise it's de-facto s* protocol that will have to be thrown away within a few years upon the first cryptographic weakness, breaking all applications that dared to adopt it.

Instead of cipher agility, PASETO uses versioned protocols.

My DEFCON Crypto & Privacy Village talk (slides and YouTube video at https://paseto.io for the curious) covered this distinction in detail.

comment 6y ago · link · parent

I'll be sending an email to CFRG, probably next week, with any spec changes.

But before I resuscitate PASETO, XChaCha20 needs an RFC. It's pending IRTF kick-off.

https://tools.ietf.org/html/draft-irtf-cfrg-xchacha-03

comment 6y ago · link · parent

The default is to not enforce any rules beyond the cryptographic signatures.

If you need any other validations, it's entirely up to you to specify what those are.

You might care about checking `exp`, but I might instead care about `iat` with a hard-coded token lifetime.

PASETO supports whatever zany business logic developers need, but doesn't enforce anything by default.

But once you add a rule to your parser, it will fail-closed on those rules.

> A token without timestamp will never be valid if a rule for checking timestamp is added in the parser?

Correct.

If your parser is set to check timestamps and one is invalid or omitted, it throws an exception.

comment 6y ago · link · parent

PASETO has the same "claims" as JWT, except they're ISO 8601 timestamps rather than integers (UNIX timestamps).

They're not required (as they weren't in JWT). If you want to use them, use them. The parser will validate them if you want it to.

https://github.com/paragonie/paseto/blob/master/src/Rules/No...

https://github.com/paragonie/paseto/tree/master/docs/02-PHP-...

comment 6y ago · link · parent

Yep, that's a fair assessment.

If you want ultra-simplicity and don't need clearsigned tokens (i.e. signed by a third party), you can get away with just using Branca. PASETO covers both use cases.

comment 6y ago · link · parent

Simple answer: Because secure cryptography is backwards-incompatible with insecure cryptography, and the JOSE standards have a lot of legacy cruft that will be hard to jettison.

If you're going to put in the work (which I am), you might as well start with a clean slate rather than trying to piecemeal security improvements into their design-by-committee spec.

comment 6y ago · link · parent

Nothing from 2020 yet. XChaCha has to be prioritized first.

comment 6y ago · link · parent

Yes, Tink is acceptable too. :)

comment 6y ago · link · parent

PGP isn't great either: https://latacora.micro.blog/2019/07/16/the-pgp-problem.html

Better options for PGP use cases:

- AWS Encryption SDK: https://docs.aws.amazon.com/encryption-sdk/latest/developer-...

- age https://age-encryption.org

- Magic Wormhole https://github.com/warner/magic-wormhole

- NaCl/libsodium (and/or usability wrappers) https://libsodium.gitbook.io/doc/

Better options for JWE use cases:

- PASETO: https://paseto.io

- Branca: https://branca.io

comment 6y ago · link · parent

CFRG

comment 6y ago · link · parent

> > Even giving the user a choice of ciphers to use is a recipe for disaster.

> How so? I'm still learning this stuff, so I'm genuinely curious.

https://paragonie.com/blog/2019/10/against-agility-in-crypto... :)

comment 6y ago · link · parent

https://github.com/auth0/node-jsonwebtoken/blob/5f10bf9957a2...

The end result depends entirely on the behavior of JavaScript's Array.indexOf() implementation.

comment 6y ago · link · parent

Tired: {"alg":"none"}

Wired: {"alg":"nonE"}

The JOSE standards (including JWT) are a gift that keeps on giving to attackers.

I designed an alternative format in 2018 called PASETO, which doesn't contain the JOSE foot-guns. (I'm pushing for an IETF RFC this year.)

https://paseto.io

EDIT: Also, this affected their Authentication API rather than their JWT library.

If you use their JWT library, well, it certainly allows this kind of horrendous misuse... but it is not, per se, vulnerable.

172.

Auth0 JWT Auth Bypass: Case-Sensitive Blacklisting Is Harmful(insomniasec.com ↗)

195 points · by CiPHPerCoder · 6y ago · 92 comments

comment 6y ago · link · parent

I think you misunderstood what I'm talking about here.

  [ App (Java -> Dvorak) ]--.
                             >--- Same CPU
  [ Web Browser with JS  ]--`
My argument wasn't about "it" running in a web browser. I was arguing that side-channel attacks that can be exploited from a browser on the same CPU (as per djb's AES cache attack paper) are pretty bad, considering "trick user into opening a webpage" is a pretty low-hanging fruit attack vector.

comment 6y ago · link · parent

> If you have a system working with CBC+HMAC, what's the advantage to shouldering that additional risk?

The details you probably want me to put here are a bit fuzzy still, and I've solicited others' to provide clarity and insight into the specifics, so I apologize if this is hand-wavy, but your question deserves an answer.

Given:

Most smartphones are built on ARM architecture. At the very least, I'm confident about Android being ARM. I've never purchased an Apple product in my life, and can't rightly say much about their internals.

ARM before ARMv8-A did not provide hardware AES. https://en.wikipedia.org/wiki/ARM_architecture#ARMv8-A

Adiantum cites the Cortex-A7 as one example processor that does not provide hardware-accelerated AES: https://security.googleblog.com/2019/02/introducing-adiantum...

"In order to offer low cost options, device manufacturers sometimes use low-end processors such as the ARM Cortex-A7, which does not have hardware support for AES. On these devices, AES is so slow that it would result in a poor user experience; apps would take much longer to launch, and the device would generally feel much slower."

Even for smartphones that use ARMv8-A and newer, OEM weirdness can get in the way of that. Without tearing a specific model of a specific phone apart, I can't really give you much more information than that.

The advantage to the additional risk of ChaPoly is to not cough up keys to JavaScript running in a web browser capable of leveraging a cache-timing attack against software AES, in the smartphones that most people can afford.

That is to say, while it's true that the CSPRNG failure mode of ChaPoly is bad (but relies on conditions the attacker probably can't control), the failure mode of software AES is equally bad and can be influenced by an attacker.

> In a new design, I'd recommend Chapoly too. But this isn't a new design. Changing things has cost.

If there is significant market share where the device has a reliable CSPRNG but not hardware AES (post-OEM tampering), I'd argue that the security gain of a ChaPoly migration is worth the cost of changing, in particular.

The ratcheting changes are mostly a hygiene issue and probably won't be meaningfully important. I was just being nitpicky.

comment 6y ago · link · parent

You're entitled to your thing. Granted, CBC mode has a better misuse story than CTR, but an extended-nonce ChaPoly AEAD is likely to be safer in most of Signal's installed userbase (n.b. the same userbase Matrix and Jitsi would be targeting in a lot of cases), given the ARM SIMD (AES-NI equivalent) situation.

comment 6y ago · link · parent

It's like a standard padding oracle attack, but 4 billion times slower (on average) and requires 4 billion times more CPU work and bandwidth, and you have to be able to distinguish between a HMAC failure and a padding error.

(a.k.a. isn't happening)

comment 6y ago · link · parent

It's only weird if you put Signal's specific design decisions from 2013 on a pedestal and declare it perfect and incapable of being improved.

(N.b. I don't expect my specific suggestions to be adopted. However, I view complaining without offering solutions to be poor form, so I offered some alongside my complaints.)

Of course, any deviation from Signal's design can and should be vetted by the same experts that vetted Signal's. And if they're unavailable to vet the derivations, the conservative thing to do is grit your teeth and bear Signal's legacy until they become available.

However, if Signal still targets Android 4.4 phones in 2020, there's a lot of devices without AES-NI and thus improving upon their AES-CBC design decision is worth probing at least.

comment 6y ago · link · parent

> I do not understand your "confused deputy" attack. Can you outline it in more detail?

I'm literally referring to "the iMessage attack".

If you recall, iMessage did ECDSA(AES(m, ek), sk) without an intermediary HMAC. Libolm does have an (albeit truncated) HMAC, so the attack doesn't apply at all here. But it's still a design smell.

If I could extend their construction (which looks like the setup to the iMessage attack, without the punchline) into a real attack, I would have just disclosed it to them and not commented publicly.

How the attack I envision would work if their HMAC suddenly got erased from the protocol: Establish a multi-device setup, flip bits in ciphertext you want to decrypt, sign with Ed25519, observe padding oracle.

(A truncated HMAC does prevent that in the real world, but at a 32-bit security level rather than a 128-bit security level.)

These are (somewhat nitpicky) design critiques, not security vulnerabilities. :)

Edit to add: Also, the iMessage attack had some other weirdness that isn't relevant for what I'm describing, but was very relevant for iMessage being broken.

comment 6y ago · link · parent

> Could you (or Arathorn) expand on why Olm should deviate from the Signal protocol, instead of trying to reproduce it as closely as possible?

Because the only premise for strictly adhering to the Signal protocol has been invalidated by Moxie's personality.

With a false premise, why maintain a true conclusion?

In my OP comment, I outlined some criticisms of what they're doing, and suggested ways to improve it. Some of these (dropping AES-CBC+HMAC for AES-CTR+HMAC) have meaningful gains but, strictly speaking, are not Signal-compat.

The change to the ratcheting protocol adds a layer of indirection in the forward secrecy, but that also deviates from Signal. (My proposed change would make it closer to what the Noise Protocol Framework does.)

> Which requirements are different?

The technical requirements aren't changed, but you can get better performance AND security on more platforms by using XChaCha20 instead of AES-CBC, so that's a meaningful security gain that Signal cannot boast (i.e. in the context of legacy Android devices).

1
567
60