SlideShare a Scribd company logo
Computer –Based Symmetric
Key Cryptographic Algorithm
Ciphers
• Mechanism that decides the process of
encryption/decryption
• Stream Cipher: Bit-by-bit encryption /
decryption
• Block Cipher: Block-by-block encryption /
decryption
Types of Cipher
Algorithm Types
Stream Ciphers Block Ciphers
Stream Cipher Example
Pay 100 010111001
100101011
ZTU91_^%D
+
11001001
Plain text
Cipher text
XOR operation with the key
In normal
format
In binary
format
Block Cipher Example
FOUR _AND_ FOUR Plain text
Encrypt Encrypt Encrypt
VFa% VFa%
*yT1x Cipher text
(a) The Encryption Process at the sender’s end
VFa% VFa%
*yT1x Cipher text
Decrypt Decrypt Decrypt
FOUR _AND_ FOUR Plain text
(b) The Decryption Process at the receiver’s end
Algorithm Modes
• Add randomness to block cipher
• Otherwise, block cipher becomes
predictable
• Four main modes
Algorithm Modes
Algorithm Modes
Electronic Code
Book (ECB)
Cipher Block
Chaining (CBC)
Cipher Feedback
(CFB)
Output Feedback
(OFB)
These two modes work
on block ciphers.
These two modes work
on block ciphers acting
as stream ciphers.
Encryption in ECB Mode
Encrypt
Plain text block 1
Key
Cipher text block 1
Step 1
Encrypt
Plain text block 2
Key
Cipher text block 2
Step 2
Encrypt
Plain text block n
Key
Cipher text block n
Step n
Decryption in ECB Mode
Decrypt
Cipher text block 1
Key
Plain text block 1
Step 1
Decrypt
Cipher text block 2
Key
Plain text block 2
Step 2
Decrypt
Cipher text block n
Key
Plain text block n
Step n
Encryption in CBC Mode
Encrypt
Plain text block 1
IV
Cipher text block
1
Step 1
Encrypt
Plain text block 2
Cipher text block
2
Step 2
Encrypt
Plain text block n
Cipher text block
n
Step n
Key
XOR XOR
Key Key
XOR
Decryption in CBC Mode
Decrypt
Cipher text block 1
IV
Plain text block 1
Step 1
Decrypt
Cipher text block 2
Plain text block 2
Step 2
Decrypt
Cipher text block n
Plain text block n
Step n
Key
XOR XOR
Key Key
XOR
Encryption in CFB Mode
IV
(Shift register)
Encrypt
Key
Take just the
leftmost 8 bits
XOR
Plain text 8 bits
Cipher text
8 bits
IV
(Shift register)
Encrypt
Key
Take just the
leftmost 8 bits
XOR
Plain text 8 bits
IV
(Shift register)
Encrypt
Key
Take just the
leftmost 8 bits
XOR
Plain text 8 bits
Cipher text
8 bits
Cipher text
8 bits
Encryption in OFB Mode
IV
(Shift register)
Encrypt
Key
Take just the
leftmost 8 bits
XOR
Plain text j bits
Cipher text j
bits
IV
(Shift register)
Encrypt
Key
Take just the
leftmost 8 bits
XOR
Plain text j bits
IV
(Shift register)
Encrypt
Key
Take just the
leftmost 8 bits
XOR
Plain text j bits
Cipher text j
bits
Cipher text j
bits
Symmetric Key Cryptography
• Same key used for encryption and
decryption
• Examples: DES, IDEA, RC5, Blowfish,
AES
• Quite popular and fast
Symmetric Key Cryptography
Plain
text
Encrypt
with
symmetric
key
Plain
text
Decrypt
with
symmetric
key
Sender
(A)
Net
wor
k
Receive
r
(B)
Cipher
text
Cipher
text
Conceptual View of DES
64-bit
Plain text
56-bit Key
DES
64-bit
Cipher
text
Block 1
64-bit
Plain text
56-bit Key
DES
64-bit
Cipher
text
Block 2
64-bit
Plain text
56-bit Key
DES
64-bit
Cipher
text
Block n

Discarding of every 8th bit of the
original key
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
Key discarding process
Original 64-bit key
Key discarding process
Resulting 56 bit key
Broad Level Steps in DES
Initial Permutation (IP)
LPT RPT
16 rounds 16 rounds
Key Key
Final Permutation (FP)
Step 1
Step 2
Step 3
Step 4
Step 5
Step 6
Plain text (64 bits)
Cipher text (64 bits)
Idea of Initial Permutation(IP)
Bit position in the plain
text block
To be overwritten with the contents of
this bit position
1
2
3
…
64
58
50
42
…
7
Initial Permutation(IP) table
58 50 42 34 26 18 10 2 60 52 44 36 28 20 12 4
62 54 46 38 30 22 14 6 64 56 48 40 32 24 16 8
57 49 41 33 25 17 9 1 59 51 43 35 27 19 11 3
61 53 45 37 29 21 13 5 63 55 47 39 31 23 15 7
Details of One Round in DES
Key Transformation
Expansion Permutation
S-Box Substitution
P-Box Permutation
XOR and Swap
Key transformation
Round 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Number of key
bits shifted
1 1 2 2 2 2 2 2 1 2 2 2 2 2 2 1
Compression permutation
14 17 11 24 1 5 3 28 15 6 21 10
23 19 12 4 26 8 16 7 27 20 13 2
41 52 31 37 47 55 30 40 51 45 33 48
44 49 39 56 34 53 46 42 50 36 29 32
Expansion permutation
•Division of 32-bit RPT into eight 4 bit blocks
RPT expansion permutation
process
RPT expansion permutation table
32 1 2 3 4 5 4 5 6 7 8 9
8 9 10 11 12 13 12 13 14 15 16 17
16 17 18 19 20 21 20 21 22 23 24 25
24 25 26 27 28 29 28 29 30 31 32 1
S-box Subtitution
Key Transformation (Compress
key from 56 bits to 48 bits)
Expansion permutation (Expand
RPT from 32 bits to 48 bits)
48 bit key 48 bit RPT
XOR
S- box Substitution
S-Box Substitution
48 bit Input block
6 bit sub block 6 bit sub block 6 bit sub block
S-box 1 S-box 2 S-box 8
4 bit Output 4 bit Output 4 bit Output
32 bit Output block
S-box 1
14 4 13 1 2 15 11 8 3 10 6 12 5 9 0 7
0 15 7 4 14 2 13 1 10 6 12 11 9 5 3 8
4 1 14 8 13 6 2 11 15 12 9 7 3 10 5 0
15 12 8 2 4 9 1 7 5 11 3 14 10 0 6 13
Selecting an entity in a s-box
based on the 6-bit input
4 bit column number
b1 b6
b2 b3 b4 b5
2 bit row number
P-box Permutation
16 7 20 21 29 12 28 17 1 15 23 26 5 18 31 10
2 8 24 14 32 27 3 9 19 13 30 6 22 11 4 25
XOR and Swap
Original 64 bit Plain text block
32 bit LPT block 32 bit RPT block
1. Key transformation
2. Expansion Permutation
3. S-box Substitution
4. P-box Permutation
XOR
32 bit LPT block 32 bit RPT block
Next Round
Final Permutation
40 8 48 16 56 24 64 32 39 7 47 15 55 23 63 31
38 6 46 14 54 22 62 30 37 5 45 13 53 21 61 29
36 4 44 12 52 20 60 28 35 3 43 11 51 19 59 27
34 2 42 10 50 18 58 26 33 1 41 9 49 17 57 25
Modified Versions of DES
• Double DES: Perform DES twice with two
different keys
• Triple DES with Three Different Keys
• Triple DES with Two Different Keys
Double DES Encryption
Original
Plain Text
Encrypt
K1
Cipher
Text
Encrypt
K2
Cipher
Text
Double DES Decryption
Original
Plain Text
Decrypt
K2
Decrypt
K1
Cipher
Text
Cipher
Text
Double DES Mathematically
Expressed
P Encrypt
K1
Temporary
result (T)
Encrypt
K2
C
EK1(P) EK2(EK1(P))
T =
EK1(P)
C =
EK2(EK1(P))
Triple DES
Original
Plain Text
Encrypt
K1
Cipher
Text 1
Encrypt
K2
Cipher
Text 2
Encrypt
K3
Final Cipher
Text
Triple DES with Two Keys
Original
Plain Text
Encrypt
K1
Cipher
Text 1
Decrypt
K2
Cipher
Text 2
Encrypt
K1
Final Cipher
Text
Broad Level Steps in IDEA
( International Data Encryption Algorithm)
Input Plain Text (64 bits)
P1 (16 bits) P2 (16 bits) P3 (16 bits) P4 (16 bits)
Round 1
K1
.
. K6
Round 2
K7
.
. K12

Round 8
K43
.
. K48
Output Transformation
K49
.
. K52
C1 (16 bits) C2 (16 bits) C3 (16 bits) C4 (16 bits)
Output Cipher Text (64 bits)
Details of one round in IDEA
Step 2: Add *P2 and K2
Step 3: Add * P3 and K3
Step 1: Multiply * P1 and K1
Step 4: Multiply *P4 and K4
Step 5: XOR the result of step 1 and step 3
Step 6: XOR the result of step 2 and step 4
Step 7: Multiply* the result of step 5 with K5
Details of one round in IDEA
Step 9: Multiply * the results of Step 8 with K6
Step 10: Add* the results of step 7 and step 9
Step 8: Add * the results of Step 6 and step 7
Step11: XOR the results of step 1 and step 9
Step 12: XOR the result of step 3 and step 9
Step 13: XOR the result of step 2 and step 10
Step 14: XOR the result of step 4 and step 10
Modulo operation
•Addition with modulo 216 i.e. addition
modulo 65536
•Multiplication with modulo 216 + 1 i.e.
multiplication modulo 65537.
Detail of sub key generation and use
• Bit position 1-96 of the key are used. 97-128 remain unused.
•Bit 97-128 are first used. Circular left shift of 25 bits occurs.
As per new key bit position 26-89 are used. Bit position 90-
128 and 1-25 remain unused.
Details of the output transformation
Step 2: Add * R2 and K2
Step 3: Add*R3 and K3
step 1: Multiply *R1 and K1
Step 4: Multiply * R4 and K4
Encryption using RC5
First, divide the original plain text into two blocks of equal size.
Call them as A and B.
Add A and S[0] to produce C.
Add B and S[1] to produce D.
1. XOR C and D to produce E. 4. XOR D and F to produce G.
2. Circular-left shift E by D bits.
3. Add E and S[2i] to produce F.
5. Circular-left shift G by F bits.
6. Add G and S[2i + 1] to produce H.
Increment i by 1.
Check:
Is i > r?
Stop
Yes
No
Note: First perform all the left-hand side steps,
and then come to the right hand side steps, as
indicated by the step numbers.
Call F as C
(i.e. C = F)
Call H as D
(i.e. D = H)
RC5 Encryption
A = A + S[0]
B = B + S[1]
For i = 1 to r
A = ((A XOR B) <<< B) + S[2i]
B = ((B XOR A) <<< A) + S[2i + 1]
Next i
RC5 Decryption
For i = r to 1 step –1 (i.e. decrement i each time by 1)
B = ((B – S[2i + 1]) >>> A) XOR A
A = ((A – S[2i]) >>> B) XOR B
Next i
B = B – S[1]
A = A – S[0]
Blowfish
Plain text (64 bits)
32 bits 32 bits
XOR
P1 (32 bits)
F XOR
XOR
P2 (32 bits)
F XOR
13 more rounds
XOR F XOR
P16 (32 bits)
XOR
P18 (32 bits) XOR
P17 (32 bits)
32 bits 32 bits
Cipher text (64 bits)
Blowfish Function
32-bit
XL block
S-box 1
8 bits 32 bits
S-box 2
8 bits 32 bits
XOR
S-box 3
8 bits 32 bits
XOR
S-box 4
8 bits 32 bits
XOR
32-bit
output
The Description of Rijndael
• Do the following one –time initialization
process
–Expand the 16 byte key to get the
actual Key block to be used
–Do one time initialization of the 16
byte plain text block( called as State)
–XOR the State with the Key block
The Description of Rijndael
• For each round do the following
–Apply S-box to each of the plain text bytes
–Rotate row k of the plain text block by k
bytes
–Perform a mix columns operation
–XOR the state with the key block
Rijndael (AES)
Step 1: Byte Substitution
Step 2: Shift Rows
Step 3: Mix Columns
Step 4: Round Key Addition
Repeat these four
steps 10, 12 or 14
times.
AES Key Generation
16-byte key
Expanded into 11 arrays, each of size 4 x 4
AES Key Expansion – 1
16-byte key
To be expanded into 11 arrays, each of size 4 x 4
Copied, as is
AES S-Box
Ad

Recommended

data ebncryption standard with example.pptx
data ebncryption standard with example.pptx
ajajkhan16
 
03 UNIT-2.pdf
03 UNIT-2.pdf
31ABINESHWARANG
 
Cryptographic algorithms
Cryptographic algorithms
Anamika Singh
 
Cryptographic algorithms
Cryptographic algorithms
Anamika Singh
 
Overview on Cryptography and Network Security
Overview on Cryptography and Network Security
Dr. Rupa Ch
 
Data Encryption standard in cryptography
Data Encryption standard in cryptography
NithyasriA2
 
data encryption standard algorithm in cryptography
data encryption standard algorithm in cryptography
sweetysinghal2
 
DATA ENCRYPTION STANDARD ALGORITHM , PPT
DATA ENCRYPTION STANDARD ALGORITHM , PPT
pg636002
 
Block ciphers &amp; public key cryptography
Block ciphers &amp; public key cryptography
RAMPRAKASHT1
 
Fundamentals of Information Encryption
Fundamentals of Information Encryption
Amna Magzoub
 
Cryptographic Algorithms: DES and RSA
Cryptographic Algorithms: DES and RSA
aritraranjan
 
3-Block Ciphers and DES.pdf
3-Block Ciphers and DES.pdf
MuhammadShoaibHussai2
 
DATA ENCRYPTION STANDARD (DES) / lucifer
DATA ENCRYPTION STANDARD (DES) / lucifer
sahadcse8bu
 
4-DES.pdf
4-DES.pdf
ShimoFcis
 
DES (Data Encryption Standard) Algorithm
DES (Data Encryption Standard) Algorithm
SamEhlinger
 
DES Presentation.pptx for Information Security, A common Subject
DES Presentation.pptx for Information Security, A common Subject
kashafbutt72
 
Information and network security 20 data encryption standard des
Information and network security 20 data encryption standard des
Vaibhav Khanna
 
4255596.ppt
4255596.ppt
ShahidMehmood285010
 
section-8.ppt
section-8.ppt
DeepakPrajapati868260
 
Network Security Lec4
Network Security Lec4
Federal Urdu University
 
Software EngineeringModule 2 (Complete).pptx
Software EngineeringModule 2 (Complete).pptx
20PZSB7038SachinP1
 
1 DES.pdf
1 DES.pdf
nitin571047
 
Cryptography
Cryptography
Smruti Ranjan Sahoo
 
Jaimin chp-8 - network security-new -use this - 2011 batch
Jaimin chp-8 - network security-new -use this - 2011 batch
Jaimin Jani
 
TCN  5080  -­‐‑  Project  1  Description  C.docx
TCN  5080  -­‐‑  Project  1  Description  C.docx
ssuserf9c51d
 
Analysis of Cryptographic Algorithms
Analysis of Cryptographic Algorithms
ijsrd.com
 
A combined approach using triple des and blowfish
A combined approach using triple des and blowfish
eSAT Publishing House
 
Computer security module 2
Computer security module 2
Deepak John
 
Assisting Individuals and Families to Promote and Maintain Health – Unit 7 | ...
Assisting Individuals and Families to Promote and Maintain Health – Unit 7 | ...
RAKESH SAJJAN
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 6-14-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 6-14-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 

More Related Content

Similar to Cryptography Symmetric Key Algorithm (CSE) (20)

Block ciphers &amp; public key cryptography
Block ciphers &amp; public key cryptography
RAMPRAKASHT1
 
Fundamentals of Information Encryption
Fundamentals of Information Encryption
Amna Magzoub
 
Cryptographic Algorithms: DES and RSA
Cryptographic Algorithms: DES and RSA
aritraranjan
 
3-Block Ciphers and DES.pdf
3-Block Ciphers and DES.pdf
MuhammadShoaibHussai2
 
DATA ENCRYPTION STANDARD (DES) / lucifer
DATA ENCRYPTION STANDARD (DES) / lucifer
sahadcse8bu
 
4-DES.pdf
4-DES.pdf
ShimoFcis
 
DES (Data Encryption Standard) Algorithm
DES (Data Encryption Standard) Algorithm
SamEhlinger
 
DES Presentation.pptx for Information Security, A common Subject
DES Presentation.pptx for Information Security, A common Subject
kashafbutt72
 
Information and network security 20 data encryption standard des
Information and network security 20 data encryption standard des
Vaibhav Khanna
 
4255596.ppt
4255596.ppt
ShahidMehmood285010
 
section-8.ppt
section-8.ppt
DeepakPrajapati868260
 
Network Security Lec4
Network Security Lec4
Federal Urdu University
 
Software EngineeringModule 2 (Complete).pptx
Software EngineeringModule 2 (Complete).pptx
20PZSB7038SachinP1
 
1 DES.pdf
1 DES.pdf
nitin571047
 
Cryptography
Cryptography
Smruti Ranjan Sahoo
 
Jaimin chp-8 - network security-new -use this - 2011 batch
Jaimin chp-8 - network security-new -use this - 2011 batch
Jaimin Jani
 
TCN  5080  -­‐‑  Project  1  Description  C.docx
TCN  5080  -­‐‑  Project  1  Description  C.docx
ssuserf9c51d
 
Analysis of Cryptographic Algorithms
Analysis of Cryptographic Algorithms
ijsrd.com
 
A combined approach using triple des and blowfish
A combined approach using triple des and blowfish
eSAT Publishing House
 
Computer security module 2
Computer security module 2
Deepak John
 
Block ciphers &amp; public key cryptography
Block ciphers &amp; public key cryptography
RAMPRAKASHT1
 
Fundamentals of Information Encryption
Fundamentals of Information Encryption
Amna Magzoub
 
Cryptographic Algorithms: DES and RSA
Cryptographic Algorithms: DES and RSA
aritraranjan
 
DATA ENCRYPTION STANDARD (DES) / lucifer
DATA ENCRYPTION STANDARD (DES) / lucifer
sahadcse8bu
 
DES (Data Encryption Standard) Algorithm
DES (Data Encryption Standard) Algorithm
SamEhlinger
 
DES Presentation.pptx for Information Security, A common Subject
DES Presentation.pptx for Information Security, A common Subject
kashafbutt72
 
Information and network security 20 data encryption standard des
Information and network security 20 data encryption standard des
Vaibhav Khanna
 
Software EngineeringModule 2 (Complete).pptx
Software EngineeringModule 2 (Complete).pptx
20PZSB7038SachinP1
 
Jaimin chp-8 - network security-new -use this - 2011 batch
Jaimin chp-8 - network security-new -use this - 2011 batch
Jaimin Jani
 
TCN  5080  -­‐‑  Project  1  Description  C.docx
TCN  5080  -­‐‑  Project  1  Description  C.docx
ssuserf9c51d
 
Analysis of Cryptographic Algorithms
Analysis of Cryptographic Algorithms
ijsrd.com
 
A combined approach using triple des and blowfish
A combined approach using triple des and blowfish
eSAT Publishing House
 
Computer security module 2
Computer security module 2
Deepak John
 

Recently uploaded (20)

Assisting Individuals and Families to Promote and Maintain Health – Unit 7 | ...
Assisting Individuals and Families to Promote and Maintain Health – Unit 7 | ...
RAKESH SAJJAN
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 6-14-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 6-14-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
ENGLISH-5 Q1 Lesson 1.pptx - Story Elements
ENGLISH-5 Q1 Lesson 1.pptx - Story Elements
Mayvel Nadal
 
Environmental Science, Environmental Health, and Sanitation – Unit 3 | B.Sc N...
Environmental Science, Environmental Health, and Sanitation – Unit 3 | B.Sc N...
RAKESH SAJJAN
 
Values Education 10 Quarter 1 Module .pptx
Values Education 10 Quarter 1 Module .pptx
JBPafin
 
Community Health Nursing Approaches, Concepts, Roles & Responsibilities – Uni...
Community Health Nursing Approaches, Concepts, Roles & Responsibilities – Uni...
RAKESH SAJJAN
 
LDMMIA Yoga S10 Free Workshop Grad Level
LDMMIA Yoga S10 Free Workshop Grad Level
LDM & Mia eStudios
 
NSUMD_M1 Library Orientation_June 11, 2025.pptx
NSUMD_M1 Library Orientation_June 11, 2025.pptx
Julie Sarpy
 
Battle of Bookworms 2025 - U25 Literature Quiz by Pragya
Battle of Bookworms 2025 - U25 Literature Quiz by Pragya
Pragya - UEM Kolkata Quiz Club
 
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
parmarjuli1412
 
How payment terms are configured in Odoo 18
How payment terms are configured in Odoo 18
Celine George
 
Health Care Planning and Organization of Health Care at Various Levels – Unit...
Health Care Planning and Organization of Health Care at Various Levels – Unit...
RAKESH SAJJAN
 
GREAT QUIZ EXCHANGE 2025 - GENERAL QUIZ.pptx
GREAT QUIZ EXCHANGE 2025 - GENERAL QUIZ.pptx
Ronisha Das
 
LDM Recording Presents Yogi Goddess by LDMMIA
LDM Recording Presents Yogi Goddess by LDMMIA
LDM & Mia eStudios
 
Birnagar High School Platinum Jubilee Quiz.pptx
Birnagar High School Platinum Jubilee Quiz.pptx
Sourav Kr Podder
 
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
 
Chalukyas of Gujrat, Solanki Dynasty NEP.pptx
Chalukyas of Gujrat, Solanki Dynasty NEP.pptx
Dr. Ravi Shankar Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
VCE Literature Section A Exam Response Guide
VCE Literature Section A Exam Response Guide
jpinnuck
 
2025 June Year 9 Presentation: Subject selection.pptx
2025 June Year 9 Presentation: Subject selection.pptx
mansk2
 
K12 Tableau User Group virtual event June 18, 2025
K12 Tableau User Group virtual event June 18, 2025
dogden2
 
Assisting Individuals and Families to Promote and Maintain Health – Unit 7 | ...
Assisting Individuals and Families to Promote and Maintain Health – Unit 7 | ...
RAKESH SAJJAN
 
ENGLISH-5 Q1 Lesson 1.pptx - Story Elements
ENGLISH-5 Q1 Lesson 1.pptx - Story Elements
Mayvel Nadal
 
Environmental Science, Environmental Health, and Sanitation – Unit 3 | B.Sc N...
Environmental Science, Environmental Health, and Sanitation – Unit 3 | B.Sc N...
RAKESH SAJJAN
 
Values Education 10 Quarter 1 Module .pptx
Values Education 10 Quarter 1 Module .pptx
JBPafin
 
Community Health Nursing Approaches, Concepts, Roles & Responsibilities – Uni...
Community Health Nursing Approaches, Concepts, Roles & Responsibilities – Uni...
RAKESH SAJJAN
 
LDMMIA Yoga S10 Free Workshop Grad Level
LDMMIA Yoga S10 Free Workshop Grad Level
LDM & Mia eStudios
 
NSUMD_M1 Library Orientation_June 11, 2025.pptx
NSUMD_M1 Library Orientation_June 11, 2025.pptx
Julie Sarpy
 
Battle of Bookworms 2025 - U25 Literature Quiz by Pragya
Battle of Bookworms 2025 - U25 Literature Quiz by Pragya
Pragya - UEM Kolkata Quiz Club
 
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
parmarjuli1412
 
How payment terms are configured in Odoo 18
How payment terms are configured in Odoo 18
Celine George
 
Health Care Planning and Organization of Health Care at Various Levels – Unit...
Health Care Planning and Organization of Health Care at Various Levels – Unit...
RAKESH SAJJAN
 
GREAT QUIZ EXCHANGE 2025 - GENERAL QUIZ.pptx
GREAT QUIZ EXCHANGE 2025 - GENERAL QUIZ.pptx
Ronisha Das
 
LDM Recording Presents Yogi Goddess by LDMMIA
LDM Recording Presents Yogi Goddess by LDMMIA
LDM & Mia eStudios
 
Birnagar High School Platinum Jubilee Quiz.pptx
Birnagar High School Platinum Jubilee Quiz.pptx
Sourav Kr Podder
 
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
 
VCE Literature Section A Exam Response Guide
VCE Literature Section A Exam Response Guide
jpinnuck
 
2025 June Year 9 Presentation: Subject selection.pptx
2025 June Year 9 Presentation: Subject selection.pptx
mansk2
 
K12 Tableau User Group virtual event June 18, 2025
K12 Tableau User Group virtual event June 18, 2025
dogden2
 
Ad

Cryptography Symmetric Key Algorithm (CSE)

  • 1. Computer –Based Symmetric Key Cryptographic Algorithm
  • 2. Ciphers • Mechanism that decides the process of encryption/decryption • Stream Cipher: Bit-by-bit encryption / decryption • Block Cipher: Block-by-block encryption / decryption
  • 3. Types of Cipher Algorithm Types Stream Ciphers Block Ciphers
  • 4. Stream Cipher Example Pay 100 010111001 100101011 ZTU91_^%D + 11001001 Plain text Cipher text XOR operation with the key In normal format In binary format
  • 5. Block Cipher Example FOUR _AND_ FOUR Plain text Encrypt Encrypt Encrypt VFa% VFa% *yT1x Cipher text (a) The Encryption Process at the sender’s end VFa% VFa% *yT1x Cipher text Decrypt Decrypt Decrypt FOUR _AND_ FOUR Plain text (b) The Decryption Process at the receiver’s end
  • 6. Algorithm Modes • Add randomness to block cipher • Otherwise, block cipher becomes predictable • Four main modes
  • 7. Algorithm Modes Algorithm Modes Electronic Code Book (ECB) Cipher Block Chaining (CBC) Cipher Feedback (CFB) Output Feedback (OFB) These two modes work on block ciphers. These two modes work on block ciphers acting as stream ciphers.
  • 8. Encryption in ECB Mode Encrypt Plain text block 1 Key Cipher text block 1 Step 1 Encrypt Plain text block 2 Key Cipher text block 2 Step 2 Encrypt Plain text block n Key Cipher text block n Step n
  • 9. Decryption in ECB Mode Decrypt Cipher text block 1 Key Plain text block 1 Step 1 Decrypt Cipher text block 2 Key Plain text block 2 Step 2 Decrypt Cipher text block n Key Plain text block n Step n
  • 10. Encryption in CBC Mode Encrypt Plain text block 1 IV Cipher text block 1 Step 1 Encrypt Plain text block 2 Cipher text block 2 Step 2 Encrypt Plain text block n Cipher text block n Step n Key XOR XOR Key Key XOR
  • 11. Decryption in CBC Mode Decrypt Cipher text block 1 IV Plain text block 1 Step 1 Decrypt Cipher text block 2 Plain text block 2 Step 2 Decrypt Cipher text block n Plain text block n Step n Key XOR XOR Key Key XOR
  • 12. Encryption in CFB Mode IV (Shift register) Encrypt Key Take just the leftmost 8 bits XOR Plain text 8 bits Cipher text 8 bits IV (Shift register) Encrypt Key Take just the leftmost 8 bits XOR Plain text 8 bits IV (Shift register) Encrypt Key Take just the leftmost 8 bits XOR Plain text 8 bits Cipher text 8 bits Cipher text 8 bits
  • 13. Encryption in OFB Mode IV (Shift register) Encrypt Key Take just the leftmost 8 bits XOR Plain text j bits Cipher text j bits IV (Shift register) Encrypt Key Take just the leftmost 8 bits XOR Plain text j bits IV (Shift register) Encrypt Key Take just the leftmost 8 bits XOR Plain text j bits Cipher text j bits Cipher text j bits
  • 14. Symmetric Key Cryptography • Same key used for encryption and decryption • Examples: DES, IDEA, RC5, Blowfish, AES • Quite popular and fast
  • 16. Conceptual View of DES 64-bit Plain text 56-bit Key DES 64-bit Cipher text Block 1 64-bit Plain text 56-bit Key DES 64-bit Cipher text Block 2 64-bit Plain text 56-bit Key DES 64-bit Cipher text Block n 
  • 17. Discarding of every 8th bit of the original key 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
  • 18. Key discarding process Original 64-bit key Key discarding process Resulting 56 bit key
  • 19. Broad Level Steps in DES Initial Permutation (IP) LPT RPT 16 rounds 16 rounds Key Key Final Permutation (FP) Step 1 Step 2 Step 3 Step 4 Step 5 Step 6 Plain text (64 bits) Cipher text (64 bits)
  • 20. Idea of Initial Permutation(IP) Bit position in the plain text block To be overwritten with the contents of this bit position 1 2 3 … 64 58 50 42 … 7
  • 21. Initial Permutation(IP) table 58 50 42 34 26 18 10 2 60 52 44 36 28 20 12 4 62 54 46 38 30 22 14 6 64 56 48 40 32 24 16 8 57 49 41 33 25 17 9 1 59 51 43 35 27 19 11 3 61 53 45 37 29 21 13 5 63 55 47 39 31 23 15 7
  • 22. Details of One Round in DES Key Transformation Expansion Permutation S-Box Substitution P-Box Permutation XOR and Swap
  • 23. Key transformation Round 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Number of key bits shifted 1 1 2 2 2 2 2 2 1 2 2 2 2 2 2 1
  • 24. Compression permutation 14 17 11 24 1 5 3 28 15 6 21 10 23 19 12 4 26 8 16 7 27 20 13 2 41 52 31 37 47 55 30 40 51 45 33 48 44 49 39 56 34 53 46 42 50 36 29 32
  • 25. Expansion permutation •Division of 32-bit RPT into eight 4 bit blocks
  • 27. RPT expansion permutation table 32 1 2 3 4 5 4 5 6 7 8 9 8 9 10 11 12 13 12 13 14 15 16 17 16 17 18 19 20 21 20 21 22 23 24 25 24 25 26 27 28 29 28 29 30 31 32 1
  • 28. S-box Subtitution Key Transformation (Compress key from 56 bits to 48 bits) Expansion permutation (Expand RPT from 32 bits to 48 bits) 48 bit key 48 bit RPT XOR S- box Substitution
  • 29. S-Box Substitution 48 bit Input block 6 bit sub block 6 bit sub block 6 bit sub block S-box 1 S-box 2 S-box 8 4 bit Output 4 bit Output 4 bit Output 32 bit Output block
  • 30. S-box 1 14 4 13 1 2 15 11 8 3 10 6 12 5 9 0 7 0 15 7 4 14 2 13 1 10 6 12 11 9 5 3 8 4 1 14 8 13 6 2 11 15 12 9 7 3 10 5 0 15 12 8 2 4 9 1 7 5 11 3 14 10 0 6 13
  • 31. Selecting an entity in a s-box based on the 6-bit input 4 bit column number b1 b6 b2 b3 b4 b5 2 bit row number
  • 32. P-box Permutation 16 7 20 21 29 12 28 17 1 15 23 26 5 18 31 10 2 8 24 14 32 27 3 9 19 13 30 6 22 11 4 25
  • 33. XOR and Swap Original 64 bit Plain text block 32 bit LPT block 32 bit RPT block 1. Key transformation 2. Expansion Permutation 3. S-box Substitution 4. P-box Permutation XOR 32 bit LPT block 32 bit RPT block Next Round
  • 34. Final Permutation 40 8 48 16 56 24 64 32 39 7 47 15 55 23 63 31 38 6 46 14 54 22 62 30 37 5 45 13 53 21 61 29 36 4 44 12 52 20 60 28 35 3 43 11 51 19 59 27 34 2 42 10 50 18 58 26 33 1 41 9 49 17 57 25
  • 35. Modified Versions of DES • Double DES: Perform DES twice with two different keys • Triple DES with Three Different Keys • Triple DES with Two Different Keys
  • 36. Double DES Encryption Original Plain Text Encrypt K1 Cipher Text Encrypt K2 Cipher Text
  • 37. Double DES Decryption Original Plain Text Decrypt K2 Decrypt K1 Cipher Text Cipher Text
  • 38. Double DES Mathematically Expressed P Encrypt K1 Temporary result (T) Encrypt K2 C EK1(P) EK2(EK1(P)) T = EK1(P) C = EK2(EK1(P))
  • 39. Triple DES Original Plain Text Encrypt K1 Cipher Text 1 Encrypt K2 Cipher Text 2 Encrypt K3 Final Cipher Text
  • 40. Triple DES with Two Keys Original Plain Text Encrypt K1 Cipher Text 1 Decrypt K2 Cipher Text 2 Encrypt K1 Final Cipher Text
  • 41. Broad Level Steps in IDEA ( International Data Encryption Algorithm) Input Plain Text (64 bits) P1 (16 bits) P2 (16 bits) P3 (16 bits) P4 (16 bits) Round 1 K1 . . K6 Round 2 K7 . . K12  Round 8 K43 . . K48 Output Transformation K49 . . K52 C1 (16 bits) C2 (16 bits) C3 (16 bits) C4 (16 bits) Output Cipher Text (64 bits)
  • 42. Details of one round in IDEA Step 2: Add *P2 and K2 Step 3: Add * P3 and K3 Step 1: Multiply * P1 and K1 Step 4: Multiply *P4 and K4 Step 5: XOR the result of step 1 and step 3 Step 6: XOR the result of step 2 and step 4 Step 7: Multiply* the result of step 5 with K5
  • 43. Details of one round in IDEA Step 9: Multiply * the results of Step 8 with K6 Step 10: Add* the results of step 7 and step 9 Step 8: Add * the results of Step 6 and step 7 Step11: XOR the results of step 1 and step 9 Step 12: XOR the result of step 3 and step 9 Step 13: XOR the result of step 2 and step 10 Step 14: XOR the result of step 4 and step 10
  • 44. Modulo operation •Addition with modulo 216 i.e. addition modulo 65536 •Multiplication with modulo 216 + 1 i.e. multiplication modulo 65537.
  • 45. Detail of sub key generation and use • Bit position 1-96 of the key are used. 97-128 remain unused. •Bit 97-128 are first used. Circular left shift of 25 bits occurs. As per new key bit position 26-89 are used. Bit position 90- 128 and 1-25 remain unused.
  • 46. Details of the output transformation Step 2: Add * R2 and K2 Step 3: Add*R3 and K3 step 1: Multiply *R1 and K1 Step 4: Multiply * R4 and K4
  • 47. Encryption using RC5 First, divide the original plain text into two blocks of equal size. Call them as A and B. Add A and S[0] to produce C. Add B and S[1] to produce D. 1. XOR C and D to produce E. 4. XOR D and F to produce G. 2. Circular-left shift E by D bits. 3. Add E and S[2i] to produce F. 5. Circular-left shift G by F bits. 6. Add G and S[2i + 1] to produce H. Increment i by 1. Check: Is i > r? Stop Yes No Note: First perform all the left-hand side steps, and then come to the right hand side steps, as indicated by the step numbers. Call F as C (i.e. C = F) Call H as D (i.e. D = H)
  • 48. RC5 Encryption A = A + S[0] B = B + S[1] For i = 1 to r A = ((A XOR B) <<< B) + S[2i] B = ((B XOR A) <<< A) + S[2i + 1] Next i
  • 49. RC5 Decryption For i = r to 1 step –1 (i.e. decrement i each time by 1) B = ((B – S[2i + 1]) >>> A) XOR A A = ((A – S[2i]) >>> B) XOR B Next i B = B – S[1] A = A – S[0]
  • 50. Blowfish Plain text (64 bits) 32 bits 32 bits XOR P1 (32 bits) F XOR XOR P2 (32 bits) F XOR 13 more rounds XOR F XOR P16 (32 bits) XOR P18 (32 bits) XOR P17 (32 bits) 32 bits 32 bits Cipher text (64 bits)
  • 51. Blowfish Function 32-bit XL block S-box 1 8 bits 32 bits S-box 2 8 bits 32 bits XOR S-box 3 8 bits 32 bits XOR S-box 4 8 bits 32 bits XOR 32-bit output
  • 52. The Description of Rijndael • Do the following one –time initialization process –Expand the 16 byte key to get the actual Key block to be used –Do one time initialization of the 16 byte plain text block( called as State) –XOR the State with the Key block
  • 53. The Description of Rijndael • For each round do the following –Apply S-box to each of the plain text bytes –Rotate row k of the plain text block by k bytes –Perform a mix columns operation –XOR the state with the key block
  • 54. Rijndael (AES) Step 1: Byte Substitution Step 2: Shift Rows Step 3: Mix Columns Step 4: Round Key Addition Repeat these four steps 10, 12 or 14 times.
  • 55. AES Key Generation 16-byte key Expanded into 11 arrays, each of size 4 x 4
  • 56. AES Key Expansion – 1 16-byte key To be expanded into 11 arrays, each of size 4 x 4 Copied, as is