Saturday, June 16, 2018

How Advanced Encryption Standard (AES) works

Advanced Encryption Standard

In 2001 after an open competition an encryption algorithm named Rijndael that was invented by cryptographers Joan Daemen and Vincent Rijmen was standardized as AES with minor modifications by NIST in 2001. So far there is no attack found against AES that is better than brute force method.  Original Rijandaeil allows different key and block sizes of 128,192 and 256 bits but in AES standard only 128-bit block size is allowed. However key sizes of 128, 192 and 256 bit are allowed.

AES Steps

During AES Algorithm processing a 4 by 4 array of bytes knows as state is modified using multiple rounds. Full encryption requires 10 to 14 rounds depending on the size of the key. Following table shows the key sizes and required number of rounds.
Key Size
Number of rounds required
128 bit
10 rounds
192 bit
12 rounds
256 bit
14 rounds

Once the state is initialized with the input to the cipher, four operations are performed in four stages in order to encrypt the input. These stages are AddRoundKey, SubBytes, ShiftRows, and MixColumns.
1.    In AddRoundKey step, the state array is XORed with a subkey which is derived from the master key.
2.    This is the substitution step where a lookup table (S-box) is used to replace all bytes of the state array.
3.    This step is used to shift each row except the first one in the state array to the left in a cyclic and incremental manner.
4.    Finally, all bytes are mixed in this step in a linear fashion column-wise.

The steps above describe one round of AES. In the Final round (either 10, 12 or 14 depending on the key size), Stage 4 is replaced with Addroundkey to ensure that first three steps cannot just be simply inverted back.
AES block diagram, showing 1stround, in last round mixing step is not performed
Various cryptocurrency wallets use AES encryption to encrypt locally stored data. Especially in bitcoin wallet, AES 256 in CBC mode is used.

1 comment:

  1. Pretty section of content. I just stumbled upon your site and in accession capital to assert that I
    acquire actually enjoyed your blog posts. 룰렛

    ReplyDelete

Thrilled to see that my book Mastering blockchain - the third edition is a best-seller at Amazon!  https://www.amazon.com/Mastering-Blockcha...