(AES BLOCK CIPHER)
(INFORMATION SECURITY)
Miss FATIMA SHAHZADI
1
Outline
• Introduction to AES
• AES Algorithm description
• How AES works
• Key Generation
• AES Encryption
• AES Decryption
• Modes of operation
• References
2
Introduction
Advanced Encryption Standard (AES Ciphers)
• Is a cybersecurity technology
• Refers to the process of concealing electronic data
• A computer security standard for cryptographically securing electronic
information.
• AES algorithm cannot yet be cracked, it would take billions of years for a
supercomputer to crack a AES key.
• Quantum computers can break AES algorithms quicker.
3
AES algorithm description
• Key expansion:
Creates new keys, known as round keys, for each subsequent round of
encryption, using Rijndael’s key schedule.
• Round key addition:
during which the initial round key is added to the mix of data that has been
divided.
• Byte substitution:
which substitutes every byte with a different byte based on the Rijndael S -box
substitution box
4
AES algorithm description
• Row shifting:
moves every row of the divided data one space to the left for the second row,
two spaces to the left for the third row, and three spaces to the left for the
fourth row.
• Column mixing:
uses a pre-established matrix to multiply the divided data’s columns and create
a new block of code.
• Round key addition:
during which another round key is added to the mixture of columns. After this
initial round, the process is repeated nine, 11, or 13 times, depending on
whether the AES algorithm is using a key length of 128 bits, 192 bits, or 256
bits. 128-bit AES encryption undergoes 10 transformation rounds; 192-bit AES
encryption undergoes 12 transformation rounds; and 256-bit AES encryption
undergoes 14 transformation rounds
5
Presentation Title 2/1/20XX 6
Presentation Title 2/1/20XX 7
Presentation Title 2/1/20XX 8
9
How AES works
Key Generation
10
Key Generation
• After ROTWORD we do sub byte.
• Sub byte is a predefined table.
• In sub byte first hexadecimal
character become row and second
become column.
• Intersection point become new byte.
11
Sub byte Table
12
Key Generation
After doing rot word and sub byte of last column we get this column.
13
Key Generation
14
Presentation Title 2/1/20XX 15
Key Generation
16
AES Encryption
Rounds :
• There are three rounds in AES Encryption
Presentation Title 2/1/20XX 17
Initial Round Main Round Final Round
• XOR with round key 0 • Sub byte
• Shift Rows
• Mix Columns
• Add round key
• Sub byte
• Shift Rows
• Add last round key
AES Encryption
18
AES Encryption
19
AES Encryption
20
AES Encryption
Encryption Example Explanation
https://www.cryptool.org/en/cto/aes-step-by-step
21
AES Decryption
AES Inverse Sub byte
22
AES Decryption
AES Inverse Shift rows
23
AES Decryption
AES Inverse Mix Columns
Presentation Title 2/1/20XX 24
AES Decryption
25
AES Decryption
26
AES Decryption
27
AES Decryption
AES Inverse Round Key
Here first matrix is state array and second is round key
28
AES Decryption
After XOR of state array and round key out put is plain text as following
29
Modes of Operation
• A mode of operation which describes how to repeatedly apply DES or AES (both encryption and
decryption) on plaintexts (and ciphertexts) with large size.
• Has an initialization value (IV), which is a random bit string with same length as a block.
There are 5 modes of operation,
1. ECB mode: Electronic Code Book mode
2. CBC mode: Cipher Block Chaining mode
3. CFB mode: Cipher Feedback mode
4. OFB mode: Output Feedback mode
5. CTR mode: Counter mode
30
Electronic Code BOOK (ECB)
• Electronic code book is the easiest block cipher mode of functioning.
• It is easier because of direct encryption of each block of input plaintext and output is in form of
blocks of encrypted ciphertext.
• Generally, if a message is larger than b bits in size, it can be broken down into a bunch of blocks
and the procedure is repeated.
• Requires the last block padded before encryption if it's to short
31
ECB Encryption/Decryption
32
ECB Encryption/Decryption
• In ECB Following formulas are use for encryption and decryption
• Encryption
Ci = EK(Bi)
• Decryption
Bi = DK(Ci)
33
Cipher Block Chaining Mode (CBC)
• Cipher block chaining or CBC is an advancement made on ECB
• In CBC, the previous cipher block is given as input to the next encryption algorithm
after XOR with the original plaintext block.
• A cipher block is produced by encrypting an XOR output of the previous cipher block
and present plaintext block.
34
CBC Encryption
35
CBC Decryption
36
CBC Encryption/Decryption
• In CBC Following formulas are use for encryption and decryption
• Encryption
Ci = EK(Bi ⊕ Ci-1)
• Decryption
Bi = DK(Ci)⊕(Ci-1)
37
Cipher Feedback Mode (CFM)
• In this mode, the ciphertext of any plaintext unit is a function of all the preceding plaintext. In this case,
rather than blocks of b bits, the plaintext is divided into segments of s bits.
• For encryption, input to the encryption function is a b-bit shift register that is initially set to some initialization vector (IV).
• The leftmost (most significant) s bits of the output of the encryption function are XORed with the
first segment of plaintext.
• contents of the shift register are shifted left by s bits
• For decryption, the same scheme is used, except that the received ciphertext unit is XORed with the output of
the encryption
38
CFM Encryption
39
CFM Decryption
40
CFM Encryption/Decryption
• In CFM Following formulas are use for encryption and decryption
• Encryption
Ci = EK(Ci-1) ⊕ Bi
• Decryption
Bi = EK(Ci-1)⊕(Ci)
41
Output Feedback Mode (OFM)
• Follows nearly the same process as the Cipher Feedback mode except that it sends the encrypted
output as feedback instead of the actual cipher which is XOR output.
• In this output feedback mode, all bits of the block are sent instead of sending selected s bits.
• Holds great resistance towards bit transmission errors.
42
OFM Encryption
43
OFM Decryption
44
OFM Encryption/Decryption
• The following formula depicts how a sequence of pad vectors is created:
Vi = EK(Vi-1)
where EK denotes the block encryption algorithm using key K and Vi and Vi -1 are adjacent
vectors.
Once the sequence of pad vectors is generated, encryption with the OFB mode can be carried out
using the following formula:
Ci = Vi ⊕
Decryption:
Bi = Vi ⊕ Ci
45
Counter Mode (CTR)
• The Counter Mode or CTR is a simple counter based block cipher implementation in cryptography.
• Each or every time a counter initiated value is encrypted and given as input to XOR with plaintext or
original text which results in ciphertext block.
• The CTR mode is independent of feedback use and thus can be implemented in parallel in this
mode.
• Similar to the OFB mode, but with the key stream generated slightly different.
• it's fast because it can run in parallel and it only use the encryption algorithm.
46
CTR Encryption
47
CTR Decryption
48
CTR Encryption/Decryption
• In the CTR mode, we start off with a random seed, s, and compute pad vectors according to
the formula:
Vi = EK(s+i-1)
• Encryption
Ci = Vi ⊕ Bi
• Decryption
Bi = Vi ⊕ Ci
49
References
• https://youtu.be/Q_hi2jWg6dc
• https://youtu.be/Xm37066R38E
• https://www.educative.io/answers/what-is-ecb#:~:text=ECB%20
• https://www.educative.io/answers/what-is-
cbc#:~:text=CBC%20also%20involves%20block%20chaining,correspo
nding%20to%20Bi%2D1
50

AES Presentation.pptx

  • 1.
    (AES BLOCK CIPHER) (INFORMATIONSECURITY) Miss FATIMA SHAHZADI 1
  • 2.
    Outline • Introduction toAES • AES Algorithm description • How AES works • Key Generation • AES Encryption • AES Decryption • Modes of operation • References 2
  • 3.
    Introduction Advanced Encryption Standard(AES Ciphers) • Is a cybersecurity technology • Refers to the process of concealing electronic data • A computer security standard for cryptographically securing electronic information. • AES algorithm cannot yet be cracked, it would take billions of years for a supercomputer to crack a AES key. • Quantum computers can break AES algorithms quicker. 3
  • 4.
    AES algorithm description •Key expansion: Creates new keys, known as round keys, for each subsequent round of encryption, using Rijndael’s key schedule. • Round key addition: during which the initial round key is added to the mix of data that has been divided. • Byte substitution: which substitutes every byte with a different byte based on the Rijndael S -box substitution box 4
  • 5.
    AES algorithm description •Row shifting: moves every row of the divided data one space to the left for the second row, two spaces to the left for the third row, and three spaces to the left for the fourth row. • Column mixing: uses a pre-established matrix to multiply the divided data’s columns and create a new block of code. • Round key addition: during which another round key is added to the mixture of columns. After this initial round, the process is repeated nine, 11, or 13 times, depending on whether the AES algorithm is using a key length of 128 bits, 192 bits, or 256 bits. 128-bit AES encryption undergoes 10 transformation rounds; 192-bit AES encryption undergoes 12 transformation rounds; and 256-bit AES encryption undergoes 14 transformation rounds 5
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
    Key Generation • AfterROTWORD we do sub byte. • Sub byte is a predefined table. • In sub byte first hexadecimal character become row and second become column. • Intersection point become new byte. 11
  • 12.
  • 13.
    Key Generation After doingrot word and sub byte of last column we get this column. 13
  • 14.
  • 15.
  • 16.
  • 17.
    AES Encryption Rounds : •There are three rounds in AES Encryption Presentation Title 2/1/20XX 17 Initial Round Main Round Final Round • XOR with round key 0 • Sub byte • Shift Rows • Mix Columns • Add round key • Sub byte • Shift Rows • Add last round key
  • 18.
  • 19.
  • 20.
  • 21.
    AES Encryption Encryption ExampleExplanation https://www.cryptool.org/en/cto/aes-step-by-step 21
  • 22.
  • 23.
  • 24.
    AES Decryption AES InverseMix Columns Presentation Title 2/1/20XX 24
  • 25.
  • 26.
  • 27.
  • 28.
    AES Decryption AES InverseRound Key Here first matrix is state array and second is round key 28
  • 29.
    AES Decryption After XORof state array and round key out put is plain text as following 29
  • 30.
    Modes of Operation •A mode of operation which describes how to repeatedly apply DES or AES (both encryption and decryption) on plaintexts (and ciphertexts) with large size. • Has an initialization value (IV), which is a random bit string with same length as a block. There are 5 modes of operation, 1. ECB mode: Electronic Code Book mode 2. CBC mode: Cipher Block Chaining mode 3. CFB mode: Cipher Feedback mode 4. OFB mode: Output Feedback mode 5. CTR mode: Counter mode 30
  • 31.
    Electronic Code BOOK(ECB) • Electronic code book is the easiest block cipher mode of functioning. • It is easier because of direct encryption of each block of input plaintext and output is in form of blocks of encrypted ciphertext. • Generally, if a message is larger than b bits in size, it can be broken down into a bunch of blocks and the procedure is repeated. • Requires the last block padded before encryption if it's to short 31
  • 32.
  • 33.
    ECB Encryption/Decryption • InECB Following formulas are use for encryption and decryption • Encryption Ci = EK(Bi) • Decryption Bi = DK(Ci) 33
  • 34.
    Cipher Block ChainingMode (CBC) • Cipher block chaining or CBC is an advancement made on ECB • In CBC, the previous cipher block is given as input to the next encryption algorithm after XOR with the original plaintext block. • A cipher block is produced by encrypting an XOR output of the previous cipher block and present plaintext block. 34
  • 35.
  • 36.
  • 37.
    CBC Encryption/Decryption • InCBC Following formulas are use for encryption and decryption • Encryption Ci = EK(Bi ⊕ Ci-1) • Decryption Bi = DK(Ci)⊕(Ci-1) 37
  • 38.
    Cipher Feedback Mode(CFM) • In this mode, the ciphertext of any plaintext unit is a function of all the preceding plaintext. In this case, rather than blocks of b bits, the plaintext is divided into segments of s bits. • For encryption, input to the encryption function is a b-bit shift register that is initially set to some initialization vector (IV). • The leftmost (most significant) s bits of the output of the encryption function are XORed with the first segment of plaintext. • contents of the shift register are shifted left by s bits • For decryption, the same scheme is used, except that the received ciphertext unit is XORed with the output of the encryption 38
  • 39.
  • 40.
  • 41.
    CFM Encryption/Decryption • InCFM Following formulas are use for encryption and decryption • Encryption Ci = EK(Ci-1) ⊕ Bi • Decryption Bi = EK(Ci-1)⊕(Ci) 41
  • 42.
    Output Feedback Mode(OFM) • Follows nearly the same process as the Cipher Feedback mode except that it sends the encrypted output as feedback instead of the actual cipher which is XOR output. • In this output feedback mode, all bits of the block are sent instead of sending selected s bits. • Holds great resistance towards bit transmission errors. 42
  • 43.
  • 44.
  • 45.
    OFM Encryption/Decryption • Thefollowing formula depicts how a sequence of pad vectors is created: Vi = EK(Vi-1) where EK denotes the block encryption algorithm using key K and Vi and Vi -1 are adjacent vectors. Once the sequence of pad vectors is generated, encryption with the OFB mode can be carried out using the following formula: Ci = Vi ⊕ Decryption: Bi = Vi ⊕ Ci 45
  • 46.
    Counter Mode (CTR) •The Counter Mode or CTR is a simple counter based block cipher implementation in cryptography. • Each or every time a counter initiated value is encrypted and given as input to XOR with plaintext or original text which results in ciphertext block. • The CTR mode is independent of feedback use and thus can be implemented in parallel in this mode. • Similar to the OFB mode, but with the key stream generated slightly different. • it's fast because it can run in parallel and it only use the encryption algorithm. 46
  • 47.
  • 48.
  • 49.
    CTR Encryption/Decryption • Inthe CTR mode, we start off with a random seed, s, and compute pad vectors according to the formula: Vi = EK(s+i-1) • Encryption Ci = Vi ⊕ Bi • Decryption Bi = Vi ⊕ Ci 49
  • 50.
    References • https://youtu.be/Q_hi2jWg6dc • https://youtu.be/Xm37066R38E •https://www.educative.io/answers/what-is-ecb#:~:text=ECB%20 • https://www.educative.io/answers/what-is- cbc#:~:text=CBC%20also%20involves%20block%20chaining,correspo nding%20to%20Bi%2D1 50