Sie sind auf Seite 1von 3

Tlali PS 200900770

Simplified AES report


TABLE OF CONTENTS
Introduction
Overview of how S-AES encryption and decryption work
Encryption and decryption basics of the hereof implementation
Conclusion

INTRODUCTION
S-AES is to AES just as S-DES is to DES. In fact, the structure of S-AES is exactly the
same as AES. The differences are in the key size (16 bits), the block size (16 bits) and the number
of rounds (3 rounds). Here is an overview

OVERVIEW OF HOW S-AES ENCYPTION AND DECRYPTION


WORK
ENCRYPTION
KEY GENERATION/KEY EXPANSION
We start first with key generation overview.In simple AES we generate up to 3 keys as we go up
to 3 rounds: Split input key into 2 words, wo and w1,
Key0:
key0=wow1 concatenated (the input key)
key1:
key1=w2w3; where w2=w0 XORg(w1); g(w1)=R(i) XOR SubNib(RotNIb(w1)) and R(i)=binary
representation of (Xi+2mod x4+x+1) +remaining zeros bits to make a total of 8 bits
where i= 1 because this is round 1
therefore w2=w0 XOR R(1) XOR SubNib(RotNib(w1))
=w0 XOR 1000 0000 XOR SubNib(RotNib(w1))
w3=w1 XOR w2
Key2:
Key2=w4w5; where w4=w2 XOR g(w3); g(w3)=R(i) XOR SubNib(RotNIb(w3)) and R(i)=binary
representation of (Xi+2 mod x4+x+1) +remaining zeros bits to make a total of 8 bits
Where i=2 because we are in round 2
therefore w4=w2 XOR R(2) XOR SubNib(RotNib(w3))
=w2 XOR 0011 0000 XOR SubNib(RotNib(w3))
w5= w3 XOR w4
NIBBLE SUBSTITUTION

This is a 4by 4 matrix of nibble values called S-BOX. It is a permutation of all possible 4bit
values .Use it to substitute each input nibble, leftmost 2 bits of nibbles are used as row values
and rightmost 2bits as column values,as shown in the figure below

SHIFT ROW
The next step is to shift rows(in fact shifting the second row). The first row is left unaltered and
second row is shifted i.e we perform a one nibble circula shift of second row as shown below

Example

MIX COLUMN
After shifting rows we mix the columns. Each column is multiplied by the matrix (1
4)
(4
1)
The last round does not have this stage of operation, i.e it does up to shift row operation
The transformation can be defined by the following matrix
multiplication on State [as in the figure below]

Performing the matrix multiplication, we get

ADDROUNDKEYS
Round 0: AddRound0Key=plaintext XOR Key0
Round1:

AddRound1Key=Output of Round1 Mix column XOR Key1

Round2(the last round) : AddRound2Key= Output of Round2 shift Row Operation of round2 XOR Key2
This is the last operation that gives a cipher corresponding to inputted key at the beginning;

DECRYPTION
Decryption works the same way as encryption in that it has the same main operations in encreption.We
use here the same keys generated in encryption and for nibble substution we use inverse S-BOX .

Encryption and decryption basics of the hereof implementation


The implementation hereof uses this requirements(As in S-AES): 16 bit secret key, 16 bit expanded key..
There are three(3) encryption rounds: the first, second main rounds and one final round.
The structure of the rounds are taken directly from the S- AES specification
InitialRound() {
addRoundKey()
}
MainRound() {
subBytes()
shiftRows()
mixColumns()
addRoundKey()
}
FinalRound(state) {
subBytes()
shiftRows()
addRoundKey()
}

Das könnte Ihnen auch gefallen