S-AES: Gets your hands dirty with actual computation
This work is presented as an assignment task at ACM Winter School on Cyber Security 2020 (21–31 Dec) organized by VIT Vellore.
Special Thanks to: Prof. Aswani Kumar Cherukuri, School of Information Technology, VIT Vellore.
S-AES is a Simplified version of AES, having all modules of AES but with reduced key size of 16 bits, the block size of 16 bits and the number of rounds to 2 rounds.
Let’s take an example:
Consider following are the 16 bits inputs for the encryption:
Plain Text (PT) = 0110 1111 0110 1011
Key (K) = 1010011100111011
Part 1: Key Generation:
This step is also known as Key Expansion. In this step, we generate 3 round keys (k0, k1 and k2), used in each round. First of all, the given 16 bits are divided into two parts of 8 bits named each as w0 and w1. So w0 = 10100111 and w1 = 00111011
Here, the first key k0 = w0 w1 = 1010011100111011
Following figures is used for key expansion:
Following figure shows detailed calculations when we apply above computations with our input.
So we got all the key as follows:
k0 = w0 w1 = 1010011100111011 (A73B)
k1 = w2 w3 = 0001110000100111 (1C27)
k2 = w4 w5 = 0111011001010001 (7651)
So we are done with Part 1 of Key Generation for S-AES. Now move to Part 2.
Part 2: Actual Encryption and Decryption Process:
Following are the details of operations performed during encryption and decryption process.
- Addition means XOR operation.
- SubNibble means applying SubWord (given in above diagram).
- ShiftRow means value at [1,0] is exchanged with [1,1].
- MixColumn means multiply with [1 4 4 1]. for this, a table is used (Given below).
Following table is used for mix column operation:
Following are the computation details performed step-by-step during encryption process:
So we have Cipher Text (CT) = 0000 0111 0011 1000. Now its time to decrypt it. It is simply the reverse process of above flow diagram (encryption process). Only SubNibble is the inverse operation (going from output to input) and MixColumn is inverse (matrix is given in below diagram).
Following are the computation details performed during decryption process:
Example 2: Now take one more example:
Plain Text (PT) = 0001 1010 0010 0011
Key (K) = 0010 0100 0111 0101
Following are the details of key generation step:
Following are the encryption details:
Now its time to get your hands dirty for decryption process.
In case of any doubts or issues with respect to computation done above, please drop a message and I would be happy to get things cleared for you!