Live data from Hacker News

Understanding how AES encryption works

nakabonne.dev

11–20 of 41 posts

Re: Understanding how AES encryption works

#12
post #11

Wait, this is the official Go implementation of AES for when AES-specific hardware instructions aren't available? It's not bitsliced. Doesn't that make it vulnerable to timing attacks?

Is there any software-base implementation of AES that is NOT vulnerable to timing attacks and other side channel weakness and with reasonable performance (to the limit of the hardware)?

Re: Understanding how AES encryption works

#13

> I don't want to snipe but it's a peeve of mine: every article about AES talks about SubBytes and ShiftRows or whatever, which is information you will never, ever use, even if your career takes a turn into cryptography engineering, but nobody talks about block cipher modes, which are basically the most important thing you can know about block cryptography. This article is called, "Understanding how AES works". Are y…

[deleted]

Re: Understanding how AES encryption works

#14
post #2

I don't want to snipe but it's a peeve of mine: every article about AES talks about SubBytes and ShiftRows or whatever, which is information you will never, ever use , even if your career takes a turn into cryptography engineering, but nobody talks about block cipher modes, which are basically the most important thing you can know about block cryptography.

But it’s an article about AES, which is the block cipher. Block cipher modes are important to a larger solution built on AES, but they are orthogonal and not even specific to AES.

Re: Understanding how AES encryption works

#15
post #9
post #7

shameless plug: if you want to learn how it works, implement it! There's a tutorial for that: https://davidwong.fr/blockbreakers/aes.html

That tutorial looks really cool. I'm slightly concerned with the tutorial leaving the implementation details to the user, and the tutorial basically saying: "Remember: to test your function, you can use the test vectors from the appendix A.1 of the AES standard. " Bad AES implementations suffer from variety of attacks including cache timing attacks etc. and since you've worked for NCC etc. I'm sure you know a ton abo…

I don‘t think this tutorials aim is to use this implementation in production. I can understand the security risks but it‘s easier to understand and maybe improve a technology when one takes it apart first.

Re: Understanding how AES encryption works

#16
post #2

I don't want to snipe but it's a peeve of mine: every article about AES talks about SubBytes and ShiftRows or whatever, which is information you will never, ever use , even if your career takes a turn into cryptography engineering, but nobody talks about block cipher modes, which are basically the most important thing you can know about block cryptography.

To be fair, I'm not in cryptography engineering and had to understand all those details for an implementation security review. But I completely agree on the block cipher modes thing, a lot of people don't realize what they are doing and just use whatever sounds good, even if it is ECB and it is not relevant in the context.

The example image in the wikipedia section on ECB is pretty damning:

https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation...

Re: Understanding how AES encryption works

#17
post #12
post #11

Wait, this is the official Go implementation of AES for when AES-specific hardware instructions aren't available? It's not bitsliced. Doesn't that make it vulnerable to timing attacks?

Is there any software-base implementation of AES that is NOT vulnerable to timing attacks and other side channel weakness and with reasonable performance (to the limit of the hardware)?

I was under the impression there were, but I'm no expert. [1]

[1] https://www.iacr.org/archive/ches2009/57470001/57470001.pdf

Re: Understanding how AES encryption works

#18
post #2

I don't want to snipe but it's a peeve of mine: every article about AES talks about SubBytes and ShiftRows or whatever, which is information you will never, ever use , even if your career takes a turn into cryptography engineering, but nobody talks about block cipher modes, which are basically the most important thing you can know about block cryptography.

yea, I agree - this is being shared a lot on threads about cryptography on HN but, anyway, I'll just share it again, can't harm. The (fantastic) challenges on http://cryptopals.com/ do a pretty great job in explaining and outlining the differences between various cipher modes

Re: Understanding how AES encryption works

#19
post #15
post #9

Earlier quoted context omitted.

That tutorial looks really cool. I'm slightly concerned with the tutorial leaving the implementation details to the user, and the tutorial basically saying: "Remember: to test your function, you can use the test vectors from the appendix A.1 of the AES standard. " Bad AES implementations suffer from variety of attacks including cache timing attacks etc. and since you've worked for NCC etc. I'm sure you know a ton abo…

I don‘t think this tutorials aim is to use this implementation in production. I can understand the security risks but it‘s easier to understand and maybe improve a technology when one takes it apart first.

Agreed. I hope the guide goes as far as to start explaining how AES-NI can be utilized, and how constant time implementations can be written. I think the only improvements we can expect for AES (considering it's standardized) is wider deployment of proper implementations of it.

Re: Understanding how AES encryption works

#20

This is my "textbook" implementation of AES128, which follows the FIPS specification as closely as possible (in python): https://github.com/DavidBuchanan314/aes-playground It also includes from-scratch Galois field arithmetic functions.

Looks really nice and educational. I'm a big fan of reeinventing the wheel for understanding certain primitives better. I did the same for ECC. Once it's done it's really liberating because you don't have to consider these things black magic anymore.
Post reply on HN