8 Aes 02 02 2024

Download as pdf or txt
Download as pdf or txt
You are on page 1of 51

CSI3002- Applied

Cryptography and Network


Security

Dr. Iyappan Perumal


Assistant Professor Senior Grade 2
School of Computer Science & Engineering
VIT, Vellore.
CSI3002- Applied Cryptography
and Network Security
 Module-1: Introduction to Cryptography
 Module-2: Symmetric Key Cryptography
 Module-3: Asymmetric Key Cryptography
 Module-4: Hash Functions and Authentication
 Module-5: Basic Applied Cryptography
 Module-6: Advanced Applied Cryptography
 Module-7: Web and Wireless Security
 Module 8: Recent trends
CSI3002- Applied Cryptography
and Network Security
Text Books:
1. Stallings, William, “Cryptography and network security: principles
and practice”, 7th Edition, Pearson Publishers, 2017.
2. Behrouz A.Forouzan, “Cryptography & Network Security”, 6th
Edition, McGraw Hill Company, 2017.

Reference Books:
1. Kaufman, Perlman and Speciner, “Network Security: Private
Communication in a Public World”, 2nd edition, Pearson Publishers ,
2002.
2. Menezes, van Oorschot, and Vanstone, “The Handbook of Applied
Cryptography”, 20th Edition, WILEY, 2015.
3. H. Silverman, “A Friendly Introduction to Number Theory,” 4th
Edition, Boston: Pearson, 2012.
Module 2: Symmetric Cryptography
(4 Hours)
 Block Ciphers
◦ DES
◦ Triple DES
◦ AES
 Stream Ciphers
AES
 Advanced Encryption Standard (AES) is a
symmetric-key block cipher published by
the National Institute of Standards and
Technology (NIST) in December 2001.
 A replacement for DES was needed, US
NIST issued call for ciphers in 1997.
 15 candidates accepted in Jun 98, 5 were
shortlisted in Aug 99.
AES Competition Requirements
 Private key symmetric block cipher

 128-bit data, 128/192/256-bit keys

 Stronger & faster than Triple-DES

 Provide full specification & design details

 Both C & Java implementations


AES Evaluation Criteria
 Initial criteria:
 Security – effort for practical cryptanalysis
 Cost – in terms of computational efficiency
 Algorithm & Implementation characteristics

 Final criteria
 General security
 Ease of software & hardware implementation
 Implementation attacks
 Flexibility (in encrypt/decrypt, keying, other
factors)
AES Shortlist
 After testing and evaluation, shortlist in Aug-99
◦ MARS (IBM) - complex, fast, high security margin
◦ RC6 (USA) - v. simple, v. fast, low security margin
◦ Rijndael (Belgium) - clean, fast, good security
margin
◦ Serpent (Euro) - slow, clean, v. high security margin
◦ Two fish (USA) - complex, v. fast, high security
margin

 Found contrast between algorithms with


◦ Few complex rounds versus many simple rounds
◦ Refined versions of existing ciphers versus new
proposals
The AES Cipher - Rijndael
 Rijndael was selected as the AES in Oct-
2000
 Designed by Vincent Rijmen and Joan Daemen
in Belgium
 Issued as FIPS PUB 197 standard in Nov-2001
 An iterative rather than Feistel cipher V. Rijmen

 Processes data as block of 4 columns of 4


bytes (128 bits)
 Operates on entire data block in every round

 Rijndael design:
 Simplicity
 Has 128/192/256 bit keys, 128 bits data J. Daemen

 Resistant against known attacks


 Speed and code compactness on many CPUs
Basic AES - AES Conceptual Scheme
Plaintext (128 bits)

AES Key (128-256 bits)

Ciphertext (128 bits)


AES – Data to Remember
 Private key symmetric block cipher

 128-bit plain text data, 128/192/256-bit keys

 Number of subkeys-44 each of size 32bits/1 word/4

bytes

 Keys are processed in words- 1 word=32bits

 No of Rounds- 10

 Each round = 4 sub keys(128 bits/4 words/16 bytes)

 Pre-round Calculation-4 sub keys(128bits/4 words/16

bytes)
General design of AES encryption
cipher
 AES is a non-Feistel cipher that encrypts and decrypts a data block of 128 bits
 Rounds are (almost) identical
◦ First and last round are a little different
w0,w1,w2,w3

w4,w5,w6,w7
Overall Structure
High Level Description
Key • Round keys are derived from the cipher key
Expansion using Rijndael's key schedule

• AddRoundKey : Each byte of the state is


Initial Round combined with the round key using bitwise xor

• SubBytes : non-linear substitution step


• ShiftRows : transposition step
Rounds • MixColumns : mixing operation of each column.
• AddRoundKey

• SubBytes
Final Round • ShiftRows No MixColumns
• AddRoundKey
AES Data Units/Representations

Byte(Group of 8 bits) Word(Group of 32 bits)

Block(Group of 128 bits) Intermediate


W0 results are
stored

State Array (Group of 128 bits)


16
16
128-bit values
 Data block viewed as 4-by-4 table of bytes
 Represented as 4 by 4 matrix of 8-bit bytes.
 Key is expanded to array of 32 bits words

1 byte
Input and Output Array Representation
1 byte
in0 in4 in8 in12

in1 in5 in9 in13

in2 in6 in10 in14

in3 in7 in11 in15

op0 op4 op8 op12

op1 op5 op9 op13

op2 op6 op10 op14

op3 op7 op11 op15


Key Representation- 128 bit key
w1 w2 w3 w4

k0 k4 k8 k12

k1 k5 k9 k13

k2 k6 k10 k14

k3 k7 k11 k15

• 128bit key- considered as 4 Words( 32 bits each)


• From this 4 words we have to generate 44 words

w0 w1 w2 ….. ….. ….. w43


Block-to-state and state-to-block
transformation
Example: Changing plaintext to state
Structure of Each Round
Transformations
 AES uses four types of Transformations
◦ Substitution
◦ Permutation,
◦ Mixing
◦ Key-adding
Sub Bytes: Byte Substitution
 A simple substitution of each byte
◦ Provide a confusion

 Uses only one S-box( as like DES) of 16x16 bytes


containing a permutation of all 256 8-bit values

 Each byte of state is replaced by byte indexed by row (left


4-bits) & column (right 4-bits)
◦ eg. byte {95} is replaced by byte in row 9 column 5
◦ which has value {2A}
 Sub Bytes operation involves 16 independent byte-to-byte
transformations.
 Using Table look up process or GF(28) field
Sub Bytes transformations

8 bits

8 bits

First Four- Row number


Next Four- Column Number
Sub Bytes Operation
 The Sub Bytes operation involves 16 independent byte-to-
byte transformations. • Interpret the byte as two hexadecimal digits
xy
S1,1 = xy16

x’y’16
Sub Bytes Table- Sub Bytes
transformation table
Inv SubBytes TransformationTable
Sample Sub Byte Transformation

 The SubBytes and InvSubBytes


transformations are inverses of each other.
Shift Rows
 Shifting, which permutes the bytes.
 A circular byte shift in each row.
◦ 1st row is unchanged
◦ 2nd row does 1 byte circular shift to left
◦ 3rd row does 2 byte circular shift to left
◦ 4th row does 3 byte circular shift to left
 In the encryption, the transformation is
called Shift Rows
 In the decryption, the transformation is
called InvShiftRows and the shifting is to the
right
Shift Rows transformation
ShiftRows Scheme
ShiftRows and InvShiftRows
Mix Columns
 Shift Rows and Mix Columns provide diffusion
to the cipher
 Each column is processed separately
 Each byte is replaced by a value dependent on
all 4 bytes in the column
MixColumns Scheme Predefined constant
matrix

The MixColumns transformation operates at the column level; it


transforms each column of the state to a new column.
Constant Matrix used by
MixColumn and Inv MixColumn
Mix Columns transformation-
Example
Key Adding(XOR) Process.
 Most important transformation is the one
that includes the cipher key.
 Adding the cipher key in each round.
 AES uses key expansion process- Creates
Nr+1 round keys from the given cipher
key.
AddRoundKey
 XOR state with 128-bits of the round key

 AddRoundKey proceeds one column at a time.


◦ adds a round key word with each state column matrix
◦ the operation is matrix addition

 Inverse for decryption identical


◦ since XOR own inverse, with reversed keys

 Designed to be as simple as possible


AddRoundKey Scheme

Output received from


mix columns
Add RoundKey transformation
Key Expansion Process
 AES-128 version (10 rounds), there are 44
words
 AES-192 version (12 rounds), there are 52
words
 AES-256 version (14 rounds), there are 60
words.

 Each round key is made of four


words(4*32= 128 bits)
AES Round
AES Key Scheduling – 128 bits
 Takes 128-bits (16-bytes) key and expands
into array of 44 32-bit words
Key Expansion Scheme
Key Expansion submodule
 RotWord performs a one byte circular left shift on a
word For example:

RotWord[b0,b1,b2,b3] = [b1,b2,b3,b0]

 SubWord performs a byte substitution on each byte of


input word using the S-box

 SubWord(RotWord(temp)) is XORed with RCon[j]


– the round constant
Round Constant (RCon)
 RCON is a word in which the three rightmost bytes are zero
 It is different for each round and defined as:
RCon[j] = (RCon[j],0,0,0)
where RCon[1] =1 , RCon[j] = 2 * RCon[j-1]
Key Expansion Example (1st Round)
• Example of expansion of a 128-bit cipher key
Cipher key = 2b7e151628aed2a6abf7158809cf4f3c
w0=2b7e1516 w1=28aed2a6 w2=abf71588 w3=09cf4f3c

i wi-1 RotWord SubWord Rcon[i/4] ti w[i-4] wi

4 09cf4f3c cf4f3c09 8a84eb01 01000000 8b84eb01 2b7e1516 a0fafe17

5 a0fafe17 - - - - 28aed2a6 88542cb1

6 88542cb1 - - - - Abf71588 23a33939

7 23a33939 - - - - 09cf4f3c 2a6c7605


AES Security
 AES was designed after DES.
 Most of the known attacks on DES were already tested
on AES.
 Brute-Force Attack
◦ AES is definitely more secure than DES due to the larger-size
key.
 Statistical Attacks
◦ Numerous tests have failed to do statistical analysis of the
cipher text
 Differential and Linear Attacks
◦ There are no differential and linear attacks on AES as yet.
Implementation Aspects
 The algorithms used in AES are so simple that
they can be easily implemented using cheap
processors and a minimum amount of memory.

 Very efficient

 Implementation was a key factor in its selection


as the AES cipher
Thank You

You might also like