Live data from Hacker News

Cryptography 101 with Alfred Menezes

cryptography101.ca

11–20 of 20 posts

Re: Cryptography 101 with Alfred Menezes

#11
post #9
post #8

Earlier quoted context omitted.

It's not new, and some people would disagree on some minor elements -- but a good place to start was regularly this blog from approximately Matasano/NCC Group members, called Cryptographic Right Answers [1]. It's very clear, gives straight forward answers in clear fashion -- and with multiple opinions often aligning. It was updated a few times, I wonder if the equivalent exists for PQ? Edit/Update: Found the PQ one @…

> Random IDs > Latacora, 2018: Use 256-bit random numbers. > Latacora, 2024: You should get 100 lava lamps, point a camera to them and use the frames as seed for a PRNG. Man, is my boss gonna be surprised what's getting requisition ordered this morning.

This is how Cloudflare does (did?) PRNG

Re: Cryptography 101 with Alfred Menezes

#12
post #5

What I would like, but haven’t found yet, is a cheat sheet on what up to date encryption method or algorithm one should use for whatever need. A kind of requirement -> algorithm dictionary. Like, I need to authenticate that a client is a known identity. What algo? How to use it? What to avoid? I need to sign a message or document. How? I need to verify said message. How? I need to store passwords. How? I know some cr…

> Like, I need to authenticate that a client is a known identity. What algo?

In this case, you're asking the wrong question.

When people say "what algo?" in such a context, the answers will be flavored as "Ed25519 vs secp256k1 vs RSA-PKCS1v1.5" when you should first be asking "what level of abstraction am I dealing with?" and "what are the constraints?"

Like, maybe "algo" isn't even a relevant concern.

If I were designing a simple token-based auth scheme today, I'd reach for PASETO. Unless I need interop with a third-party provider, who almost universally use JWTs and prevent me from having any say or choice in the matter.

With PASETO, you don't need to know, or even care, about "what algo?" You only need to consider mode, which is more of a use-case question.

But with JWTs, you not only have to care about "what algo?" your system needs to be very delicate in how it processes them. https://www.howmanydayssinceajwtalgnonevuln.com

I cannot imagine proactively writing a cheat sheet for every possible use case. You might be tempted to use AI to solve this problem on demand, but the cost of a hallucination here is pretty high.

If you find yourself regularly asking this question, I'd recommend just hiring a cryptography consultant.

Re: Cryptography 101 with Alfred Menezes

#14
Something I've been curious about lately:

With symmetric algorithms, e.g. AES, and modes of operation, is there a "best" one? Currently GCM seems to be quite popular. Is there something (an AEAD?) better? Now that the patent of OCB(3?) is expired, is it worth changing?

Re: Cryptography 101 with Alfred Menezes

#15

Something I've been curious about lately: With symmetric algorithms, e.g. AES, and modes of operation, is there a "best" one? Currently GCM seems to be quite popular. Is there something (an AEAD?) better? Now that the patent of OCB(3?) is expired, is it worth changing?

I wrote a deep dive into this in 2020, but not much has changed since then.

https://soatok.blog/2020/07/12/comparison-of-symmetric-encry...

EDIT: Actually, the parts about OPAQUE are no longer relevant because they changed the protocol before the RFC was final to not need encryption, but that was just an example of where you'd make this sort of trade-off decision, so the rest of the article is still relevant.

Re: Cryptography 101 with Alfred Menezes

#16

Something I've been curious about lately: With symmetric algorithms, e.g. AES, and modes of operation, is there a "best" one? Currently GCM seems to be quite popular. Is there something (an AEAD?) better? Now that the patent of OCB(3?) is expired, is it worth changing?

I wrote a deep dive into this in 2020, but not much has changed since then. https://soatok.blog/2020/07/12/comparison-of-symmetric-encry... EDIT: Actually, the parts about OPAQUE are no longer relevant because they changed the protocol before the RFC was final to not need encryption, but that was just an example of where you'd make this sort of trade-off decision, so the rest of the article is still relevant.

Oh hey, the AEGIS poll looks like it's due today [1].

Committing, better performance, random nonces - let's go.

[1] https://datatracker.ietf.org/doc/draft-irtf-cfrg-aegis-aead

Re: Cryptography 101 with Alfred Menezes

#18
post #16

Earlier quoted context omitted.

I wrote a deep dive into this in 2020, but not much has changed since then. https://soatok.blog/2020/07/12/comparison-of-symmetric-encry... EDIT: Actually, the parts about OPAQUE are no longer relevant because they changed the protocol before the RFC was final to not need encryption, but that was just an example of where you'd make this sort of trade-off decision, so the rest of the article is still relevant.

Oh hey, the AEGIS poll looks like it's due today [1]. Committing, better performance, random nonces - let's go. [1] https://datatracker.ietf.org/doc/draft-irtf-cfrg-aegis-aead

Oh sweet.

Re: Cryptography 101 with Alfred Menezes

#19
post #5

What I would like, but haven’t found yet, is a cheat sheet on what up to date encryption method or algorithm one should use for whatever need. A kind of requirement -> algorithm dictionary. Like, I need to authenticate that a client is a known identity. What algo? How to use it? What to avoid? I need to sign a message or document. How? I need to verify said message. How? I need to store passwords. How? I know some cr…

Google’s Tink crypto library had a slightly technical page to help with that: https://developers.google.com/tink/choose-primitive

Having used Tink, I can't stand it.

I'd love to just replace it with age for all use encryption use cases, but unfortunately age doesn't do AEAD without involving a password.

Re: Cryptography 101 with Alfred Menezes

#20
post #5

What I would like, but haven’t found yet, is a cheat sheet on what up to date encryption method or algorithm one should use for whatever need. A kind of requirement -> algorithm dictionary. Like, I need to authenticate that a client is a known identity. What algo? How to use it? What to avoid? I need to sign a message or document. How? I need to verify said message. How? I need to store passwords. How? I know some cr…

Update: I have found https://cryptobook.nakov.com/

I think it‘s pretty good.

Post reply on HN