⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠

Text Elements

Input

128bits

(16 bytes)

010101111010110101010011101101011011101

Key

128bit (16bytes) 192bit (24bytes) 256bit (32bytes)

010101111010110101010011101101011011101

Output

Same length as key

Encryption Algorithm

Input:

16 bytes.

A 4x4 matrix is made from these bytes

1

2

3

4

5

6

7

8

9

10

11

12

13

15

14

16

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

  1. Add round key

  2. Sub bytes

  3. Shift Rows

Repeated β€˜n’ rounds.

if key = 128 bits, n= 10 if key = 192 bits, n= 12 if key = 256 bits, n= 14

Confusion

A single change does not have a predictable change in the output

101101

β†’ 22222211

β†’ 22222222

101100

101100 β†’ 0920319203

Diffusion

Certain words in the english language appear more often.

To make the cipher secure, information in the plaintext, should be spread out evenly.

the rascal fox jumped out

re traf jth eutc slomuhs

As a convention, for every single bit changed in the plaintext, there is a change to about half of the bits in the ciphertext

1011101010101

0

1011

plain:

cipher

1010101110

1011101010

Input is turned into a matrix

Then, it goes through a cycle of β€˜n’ rounds

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

XOR

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

Input

Key β€˜n’

  1. Add round key

Single key turned to many

XOR performed with the corresponding round key

  1. Sub bytes

The # of keys corresponds to how many rounds are required

  1. Mix Columns

  2. Add round key

Skipped last round

Then there is a key expansion.

A B C D E F G H …

F I B O Q J M Z

Symmetric Cipher

Plaintext

Key

Any encryption algorithm where the same key is used to encrypt and decrypt

and

A special substitution cipher where each byte is replaced with another byte.

They use the S-Box to determine what to replace with

  1. Mix Columns

Goal is to diffuse information.

For each column, there is an expression for how to combine its 4bytes to get a new value for each byte

A is evaluated first, then B, then C, then D. subsequent bytes are dependent on the previous byte’s value

  1. Shift rows

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

No shift for top row

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

1 left shift for row 2

2 left shift for row 3

3 left shift for row 4

Embedded files

d453f24d89ff70b763e16311309f02d33243b00a: Pasted Image 20240409220845_893.png 981d37f32e7080eec6e04c30b1221375a29bab7c: Pasted Image 20240409221231_999.png