SlideShare a Scribd company logo
1 of 57
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

More Related Content

Similar to Cryptography Symmetric Key Algorithm (CSE)

Computer archi&mp
Computer archi&mpComputer archi&mp
Computer archi&mp
MSc CST
 
Ch03 Ch06 Des And Others
Ch03 Ch06 Des And OthersCh03 Ch06 Des And Others
Ch03 Ch06 Des And Others
nathanurag
 
Kaizen cso002 l1
Kaizen cso002 l1Kaizen cso002 l1
Kaizen cso002 l1
asslang
 
Different types of Symmetric key Cryptography
Different types of Symmetric key CryptographyDifferent types of Symmetric key Cryptography
Different types of Symmetric key Cryptography
subhradeep mitra
 

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

3-Block Ciphers and DES.pdf
3-Block Ciphers and DES.pdf3-Block Ciphers and DES.pdf
3-Block Ciphers and DES.pdf
 
Twofish
TwofishTwofish
Twofish
 
Block Cipher.cryptography_miu_year5.pptx
Block Cipher.cryptography_miu_year5.pptxBlock Cipher.cryptography_miu_year5.pptx
Block Cipher.cryptography_miu_year5.pptx
 
1 DES.pdf
1 DES.pdf1 DES.pdf
1 DES.pdf
 
javaPrimitiveTypes.pptx
javaPrimitiveTypes.pptxjavaPrimitiveTypes.pptx
javaPrimitiveTypes.pptx
 
Computer Security Lecture 4: Block Ciphers and the Data Encryption Standard
Computer Security Lecture 4: Block Ciphers and the Data Encryption StandardComputer Security Lecture 4: Block Ciphers and the Data Encryption Standard
Computer Security Lecture 4: Block Ciphers and the Data Encryption Standard
 
Computer archi&mp
Computer archi&mpComputer archi&mp
Computer archi&mp
 
Cryptographic Algorithms: DES and RSA
Cryptographic Algorithms: DES and RSACryptographic Algorithms: DES and RSA
Cryptographic Algorithms: DES and RSA
 
Information and network security 20 data encryption standard des
Information and network security 20 data encryption standard desInformation and network security 20 data encryption standard des
Information and network security 20 data encryption standard des
 
chap3.pdf
chap3.pdfchap3.pdf
chap3.pdf
 
Trible data encryption standard (3DES)
Trible data encryption standard (3DES)Trible data encryption standard (3DES)
Trible data encryption standard (3DES)
 
Overview on Cryptography and Network Security
Overview on Cryptography and Network SecurityOverview on Cryptography and Network Security
Overview on Cryptography and Network Security
 
Ch03 Ch06 Des And Others
Ch03 Ch06 Des And OthersCh03 Ch06 Des And Others
Ch03 Ch06 Des And Others
 
The Understanding of GOST Cryptography Technique
The Understanding of GOST Cryptography TechniqueThe Understanding of GOST Cryptography Technique
The Understanding of GOST Cryptography Technique
 
ch03_block_ciphers_nemo (2) (1).ppt
ch03_block_ciphers_nemo (2) (1).pptch03_block_ciphers_nemo (2) (1).ppt
ch03_block_ciphers_nemo (2) (1).ppt
 
Understand data representation on CPU 1
Understand data representation on CPU 1Understand data representation on CPU 1
Understand data representation on CPU 1
 
Kaizen cso002 l1
Kaizen cso002 l1Kaizen cso002 l1
Kaizen cso002 l1
 
AES Encryption
AES EncryptionAES Encryption
AES Encryption
 
Different types of Symmetric key Cryptography
Different types of Symmetric key CryptographyDifferent types of Symmetric key Cryptography
Different types of Symmetric key Cryptography
 
Basic arithmetic, instruction execution and program
Basic arithmetic, instruction execution and programBasic arithmetic, instruction execution and program
Basic arithmetic, instruction execution and program
 

Recently uploaded

Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answers
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
 

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