NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
▲(Post-Quantum) Cryptographic Right Answers (words.filippo.io)
luizfelberti 1 hours ago [-]
I really never managed to understand why we keep suggesting SHA-256 even though we know it's vulnerable to length extension attacks?

Everywhere else in cryptography we favor recommendations that are harder to misuse, or that shrink the surface area of "things you have to think about and get right", but for some reason SHA-256 keeps finding its way into new designs (such as Git 3.0), even though things would be much nicer if I never had to remember that length extensions are a thing :/

On another note, as someone who defaults to BLAKE3 unless I have a good reason not to, it would be nice to have more context on Filippo's comment about it being very fast "but complex and uncommon enough that you want to have a good reason to use it and a good reason to trust your implementation".

I've peeked into the guts of Zig's BLAKE3 implementation before, it's merkle-tree-ish and not very scary looking, the primitives are a lot more recognizable than Keccak for example...

tptacek 57 minutes ago [-]
Because length extension attacks only matter if you're doing something you should never be doing: hand-rolling your own keyed hash constructions. Everybody uses HMAC (you even see it in SHA3 systems), and so length extension doesn't matter. Meanwhile, SHA2 has hardware support.

I like BLAKE3 just fine. Nobody's really going to ding you for using it (or SHA3 for that matter). But it would not be sound practice to tear SHA2 out of a system that was already using it.

Two other notes:

(1) The article explicitly recommends HMAC-SHA2, not SHA2 by itself.

(2) Where it does recommend SHA2 directly (for hashing, not authentication), it recommends 512/256, which is truncated and can't be length-extended.

djohnmustard 17 minutes ago [-]
I think the original comment still stands though right? You can hand roll a keyed hash if you use sha3 or a truncated sha2. It saves you having to do two hash operations
BoppreH 2 hours ago [-]
Excellent post as always.

Filippo is my favorite way to keep myself abreast of the newest (professionally relevant!) drama in the cryptography community. As a colleague said today, "life is too short to read through all the TLS working group mailing list".

hdmoore 8 hours ago [-]
Hurray for mostly-non-controversial opinions!
pluto_modadic 3 hours ago [-]
Okay - so... they're saying... don't use p384? :3
woodruffw 2 hours ago [-]
As far as I know, P384 has never been a “right answer.”
commandersaki 3 hours ago [-]
Meh don't care about the actual PQ parts. I'm with Peter Gutmann [0] in that PQ is just a waste of time and draining resources that could be put to better use.

[0] https://www.youtube.com/watch?v=xa4Ok7WNFHY

woodruffw 18 minutes ago [-]
Guttman's talk is entertaining, but his argument around attacker behavior does not hold water: the attacker persona who is willing to do something very noisy (like use SQL injection on a server) is not the same persona that's interested in cryptographic breaks. OWASP measures the former, not the latter.
paulnpace 4 hours ago [-]
Why can't I use rclone?
tptacek 59 minutes ago [-]
This gets into the weird history of these "Right Answers" documents, which I deeply regret ever help make into a thing. Colin Percival wrote the first one, in the long-long-ago, and he's the author of Tarsnap, a (very good) encrypted backup service. I wrote the next "Right Answers" document as a response to Percival's, because I felt his "Right Answers" were very idiosyncratic and wanted to put conservative normie answers on the record. Because I like Colin (and Tarsnap), my "Right Answers" had a Tarsnap recommendation, and so have subsequent ones.

I think it's past time for this "Right Answers" cryptography meme to die, though. Filippo's PQC recommendations are good. Let's hope this is the last such document we ever need.

thadt 33 minutes ago [-]
> I think it's past time for this "Right Answers" cryptography meme to die, though.

Politely disagree. I read Colin's when it came out and it was as useful in 2009 as Filippo's is today. If you only pay attention to the cryptography community every few years when you need it for something, then usually a whole lot has happened in the interval. It is incredibly useful to get the perspective of someone paying attention to give you a breakdown of "where we're at today".

A great example is the other conversation about SHA-256. Colin's recommendation was "hey, better plan to migrate from this in the future." The thing that's happened between then and now is, well, SHA-256 is actually still 'ok' when used in current constructions. That's useful to know in 2026.

If I get busy building stuff, it'll be nice to have a check-in again in a few years (or earlier if something significant happens first).

doomrobo 3 hours ago [-]
rclone isn't a backup tool, it's a file transfer tool
commandersaki 3 hours ago [-]
Never heard of rclone but probably not a Cryptographic right answer because encryption isn't always on.
zarzavat 3 hours ago [-]
> Password handling: Argon2id or scrypt. But have you considered passkeys instead?

I hate passkeys and if your service doesn't offer an alternative then I'm not using your service.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 22:03:57 GMT+0000 (Coordinated Universal Time) with Vercel.