this post was submitted on 11 Sep 2023
90 points (98.9% liked)

Programming

17354 readers
408 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
 

In this article, I explain how AES encryption works and how the algorithm is implemented.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 28 points 1 year ago* (last edited 1 year ago) (3 children)

That’s a very good explanation.

Now forget you read that and never ever implement that yourself in production situations. Instead rely on hardware implementations and established libraries.

AES is practically impossible to implement without introducing huge side channels. Verification of side channel resistance is a huge issue.

[–] [email protected] 2 points 1 year ago

Yes, but (there is always a but) it does not apply if you implement off-line encryption. Meaning no on-line service encrypting / decrypting attacker provided data (such as SSL / TLS / HTTPS). Meaning if you are running the cipher on your own computer with your own keys / plaintexts / ciphertexts. There is nobody to snoop time differences or power usage differences when using different key / different ciphertext. Then I would suggest this is fine. The only one who can attack you is yourself. In fact, I implemented AES from scratch in C89 language, this source code is at the same time compatible with C++14 constexpr evaluation mode. I also implemented the Serpent cipher, Serpent was an AES candidate back then when there were no AES and Rijndael was not AES yet. The code is on my GitHub page.

load more comments (2 replies)