SlideShare a Scribd company logo
1 of 3
Download to read offline
ISE334: Com. and E-Commerce Security Recitation 3
Semester 2 5772 29 March 2012
Simplified DES
1 Introduction
In this lab we will work through a simplified version of the DES algorithm. The algorithm is not crypto-
graphically secure, but its operations are similar enough to the DES operation to give a better feeling for
how it works.
We will proceed by reading the Simplified DES algorithm description in the Stallings section. We will
then work through a full example in class.
2 Full Example
Let the plaintext be the string 0010 1000. Let the 10 bit key be 1100011110.
2.1 Key Generation
The keys k1 and k2 are derived using the functions P10, Shift, and P8.
P10 is defined as follows:
P10
3 5 2 7 4 10 1 9 8 6
P8 is defined to be as follows:
P8
6 3 7 4 8 5 10 9
The first key k1 is therefore equal to:
Bit # 1 2 3 4 5 6 7 8 9 10
K 1 1 0 0 0 1 1 1 1 0
P10(K) 0 0 1 1 0 0 1 1 1 1
Shift(P10(K)) 0 1 1 0 0 1 1 1 1 0
P8(Shift(P10(K))) 1 1 1 0 1 0 0 1
The second key k2 is derived in a similar manner:
Bit # 1 2 3 4 5 6 7 8 9 10
K 1 1 0 0 0 1 1 1 1 0
P10(K) 0 0 1 1 0 0 1 1 1 1
Shift3
(P10(K))) 1 0 0 0 1 1 1 0 1 1
P8(Shift2
(P10(K))) 1 0 1 0 0 1 1 1
So we have the two keys k1 = {1110 1001} and k2 = {1010 0111}
2.2 Initial and Final Permutation
The plaintext undergoes an initial permutation when it enters the encryption function, IP. It undergoes a
reverse final permutation at the end IP−1
.
The function IP is defined as follows:
1
IP
2 6 3 1 4 8 5 7
The function IP−1
is defined as follows:
IP−1
4 1 3 5 7 2 8 6
Applied to the input, we have the following after the initial permutation:
Bit # 1 2 3 4 5 6 7 8
P 0 0 1 0 1 0 0 0
IP(P) 0 0 1 0 0 0 1 0
2.3 Functions fK, SW, K
• The function fk is defined as follows. Let P = (L, R), then fK(L, R) = (L ⊕ F(R, SK), R).
• The function SW just switches the two halves of the plaintext, so SW(L, R) → (R, L)
• The function F(p, k) takes a four bit string p and eight bit key k and produces a four bit output. It
performs the following steps.
1. First it runs an expansion permutation E/P:
E/P
4 1 2 3 2 3 4 1
2. Then it XORs the key with the result of the E/P function
3. Then it substitutes the two halves based on the S-Boxes.
4. Finally, the output from the S-Boxes undergoes the P4 permutation:
P4
2 4 3 1
Applying the functions, we must perform the following steps: IP−1
◦ fK2
◦ SW ◦ fK1
◦ IP
1. We have already calculated IP(P) = {0010 0010}. Applying the next functions:
2. fK1
(L, R) = f{1110 1001}(0010 0010) = (0010 ⊕ F(0010, {1110 1001}), 0010)
3. F(0010, {1110 1001}) = P4 ◦ SBoxes ◦ {1110 1001} ⊕ (E/P(0010))
4. The steps are:
Bit # 1 2 3 4 5 6 7 8
R 0 0 1 0
E/P(R) 0 0 0 1 0 1 0 0
k1 1 1 1 0 1 0 0 1
E/P(R)⊕k1 1 1 1 1 1 1 0 1
SBoxes(E/P(R)⊕k1) 1 0 0 0
P4(Sboxes(E/P(R)⊕k1)) 0 0 0 1
5. The result from F is therefore 0001
6. Calculating we then have fk1
(L, R) = (0010 ⊕ 0001, 0010) = (0011, 0010)
7. So far, then L = 0011 and R = 0010. SW just swaps them so R = 0011 and L = 0010.
8. We now do the calculation of fk2 (L, R) = f{1010 0111}(0010 0011) = (0010⊕F(0011, {1010 0111}, 0011))
2
9. The steps for F are as above:
Bit # 1 2 3 4 5 6 7 8
R 0 0 1 1
E/P(R) 1 0 0 1 0 1 1 0
k2 1 0 1 0 0 1 1 1
E/P(R)⊕k2 0 0 1 1 0 0 0 1
SBoxes(E/P(R)⊕k2) 1 0 1 0
P4(Sboxes(E/P(R)⊕k2)) 0 0 1 1
10. So now we have the outcome of F as 0011
11. Calculating we then have fk2
(L, R) = (0010 ⊕ 0011, 0011) = (0001, 0011)
12. Last, we perform the IP−1
permutation:
Bit # 1 2 3 4 5 6 7 8
R,L 0 0 0 1 0 0 1 1
IP−1
(R,L) 1 0 0 0 1 0 1 0
13. So the final result of the encryption is 1000 1010.
3

More Related Content

Viewers also liked

как создать облачное хранилище SkyDrive
как создать облачное хранилище   SkyDriveкак создать облачное хранилище   SkyDrive
как создать облачное хранилище SkyDriveChalenko
 
ตัวอย่างโครงงาน
ตัวอย่างโครงงานตัวอย่างโครงงาน
ตัวอย่างโครงงานnoeiinoii
 
Daily option news letter 06 aug 2013
Daily option news letter 06 aug 2013Daily option news letter 06 aug 2013
Daily option news letter 06 aug 2013Rakhi Tips Provider
 
Daily agri news letter 15 july 2013
Daily agri news letter 15 july 2013Daily agri news letter 15 july 2013
Daily agri news letter 15 july 2013Rakhi Tips Provider
 
4th of July fireworks from Adler Planetarium
4th of July fireworks from Adler Planetarium4th of July fireworks from Adler Planetarium
4th of July fireworks from Adler Planetariumdwhobrey
 
โครงงานคอมพิวเตอร์
โครงงานคอมพิวเตอร์ โครงงานคอมพิวเตอร์
โครงงานคอมพิวเตอร์ noeiinoii
 

Viewers also liked (12)

как создать облачное хранилище SkyDrive
как создать облачное хранилище   SkyDriveкак создать облачное хранилище   SkyDrive
как создать облачное хранилище SkyDrive
 
Com
ComCom
Com
 
ตัวอย่างโครงงาน
ตัวอย่างโครงงานตัวอย่างโครงงาน
ตัวอย่างโครงงาน
 
Daily option news letter 06 aug 2013
Daily option news letter 06 aug 2013Daily option news letter 06 aug 2013
Daily option news letter 06 aug 2013
 
Rails introduction
Rails introductionRails introduction
Rails introduction
 
Potential business initiatives project update #1
Potential business initiatives  project update #1Potential business initiatives  project update #1
Potential business initiatives project update #1
 
THREAT TO THE HOMELAND: IRAN'S EXTENDING INFLUENCE IN THE WESTERN HEMISPHERE-...
THREAT TO THE HOMELAND: IRAN'S EXTENDING INFLUENCE IN THE WESTERN HEMISPHERE-...THREAT TO THE HOMELAND: IRAN'S EXTENDING INFLUENCE IN THE WESTERN HEMISPHERE-...
THREAT TO THE HOMELAND: IRAN'S EXTENDING INFLUENCE IN THE WESTERN HEMISPHERE-...
 
Daily agri news letter 15 july 2013
Daily agri news letter 15 july 2013Daily agri news letter 15 july 2013
Daily agri news letter 15 july 2013
 
4th of July fireworks from Adler Planetarium
4th of July fireworks from Adler Planetarium4th of July fireworks from Adler Planetarium
4th of July fireworks from Adler Planetarium
 
Transforming primary care
Transforming primary careTransforming primary care
Transforming primary care
 
โครงงานคอมพิวเตอร์
โครงงานคอมพิวเตอร์ โครงงานคอมพิวเตอร์
โครงงานคอมพิวเตอร์
 
Eng--Brochure
Eng--BrochureEng--Brochure
Eng--Brochure
 

Similar to 334 recitation3-sdes

DES Simplified
DES SimplifiedDES Simplified
DES SimplifiedShiraz316
 
Ch03 Ch06 Des And Others
Ch03 Ch06 Des And OthersCh03 Ch06 Des And Others
Ch03 Ch06 Des And Othersnathanurag
 
About the computer of the important field
About the computer               of the important fieldAbout the computer               of the important field
About the computer of the important fieldshubhamgupta7133
 
class5jf.pptx Block cipher in information security
class5jf.pptx Block cipher in information securityclass5jf.pptx Block cipher in information security
class5jf.pptx Block cipher in information security23017156038
 
TCN  5080  -­‐‑  Project  1  Description  C.docx
TCN  5080  -­‐‑  Project  1  Description  C.docxTCN  5080  -­‐‑  Project  1  Description  C.docx
TCN  5080  -­‐‑  Project  1  Description  C.docxssuserf9c51d
 
32 bit ALU Chip Design using IBM 130nm process technology
32 bit ALU Chip Design using IBM 130nm process technology32 bit ALU Chip Design using IBM 130nm process technology
32 bit ALU Chip Design using IBM 130nm process technologyBharat Biyani
 
Computer Security Lecture 5: Simplified Advanced Encryption Standard
Computer Security Lecture 5: Simplified Advanced Encryption StandardComputer Security Lecture 5: Simplified Advanced Encryption Standard
Computer Security Lecture 5: Simplified Advanced Encryption StandardMohamed Loey
 
Linear Cryptanalysis Lecture 線形解読法
Linear Cryptanalysis Lecture 線形解読法Linear Cryptanalysis Lecture 線形解読法
Linear Cryptanalysis Lecture 線形解読法Kai Katsumata
 
Digital Electronics and Computer Language
Digital Electronics and Computer Language Digital Electronics and Computer Language
Digital Electronics and Computer Language Manthan Chavda
 
Bt0064 logic design1
Bt0064 logic design1Bt0064 logic design1
Bt0064 logic design1Techglyphs
 

Similar to 334 recitation3-sdes (20)

S-DES.ppt
S-DES.pptS-DES.ppt
S-DES.ppt
 
DES Simplified
DES SimplifiedDES Simplified
DES Simplified
 
Ch03 Ch06 Des And Others
Ch03 Ch06 Des And OthersCh03 Ch06 Des And Others
Ch03 Ch06 Des And Others
 
section-7.ppt
section-7.pptsection-7.ppt
section-7.ppt
 
Ch03 des
Ch03 desCh03 des
Ch03 des
 
About the computer of the important field
About the computer               of the important fieldAbout the computer               of the important field
About the computer of the important field
 
funnel shifter
funnel shifterfunnel shifter
funnel shifter
 
class5jf.pptx Block cipher in information security
class5jf.pptx Block cipher in information securityclass5jf.pptx Block cipher in information security
class5jf.pptx Block cipher in information security
 
DES Block Cipher Hao Qi
DES Block Cipher Hao QiDES Block Cipher Hao Qi
DES Block Cipher Hao Qi
 
Wepwhacker !
Wepwhacker !Wepwhacker !
Wepwhacker !
 
TCN  5080  -­‐‑  Project  1  Description  C.docx
TCN  5080  -­‐‑  Project  1  Description  C.docxTCN  5080  -­‐‑  Project  1  Description  C.docx
TCN  5080  -­‐‑  Project  1  Description  C.docx
 
combinational_ckt.pdf
combinational_ckt.pdfcombinational_ckt.pdf
combinational_ckt.pdf
 
Multipliers in VLSI
Multipliers in VLSIMultipliers in VLSI
Multipliers in VLSI
 
32 bit ALU Chip Design using IBM 130nm process technology
32 bit ALU Chip Design using IBM 130nm process technology32 bit ALU Chip Design using IBM 130nm process technology
32 bit ALU Chip Design using IBM 130nm process technology
 
Computer Security Lecture 5: Simplified Advanced Encryption Standard
Computer Security Lecture 5: Simplified Advanced Encryption StandardComputer Security Lecture 5: Simplified Advanced Encryption Standard
Computer Security Lecture 5: Simplified Advanced Encryption Standard
 
Linear Cryptanalysis Lecture 線形解読法
Linear Cryptanalysis Lecture 線形解読法Linear Cryptanalysis Lecture 線形解読法
Linear Cryptanalysis Lecture 線形解読法
 
Digital Electronics and Computer Language
Digital Electronics and Computer Language Digital Electronics and Computer Language
Digital Electronics and Computer Language
 
Bt0064 logic design1
Bt0064 logic design1Bt0064 logic design1
Bt0064 logic design1
 
3-Block Ciphers and DES.pdf
3-Block Ciphers and DES.pdf3-Block Ciphers and DES.pdf
3-Block Ciphers and DES.pdf
 
Data Formats used by Computers
Data Formats used by ComputersData Formats used by Computers
Data Formats used by Computers
 

Recently uploaded

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 

Recently uploaded (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 

334 recitation3-sdes

  • 1. ISE334: Com. and E-Commerce Security Recitation 3 Semester 2 5772 29 March 2012 Simplified DES 1 Introduction In this lab we will work through a simplified version of the DES algorithm. The algorithm is not crypto- graphically secure, but its operations are similar enough to the DES operation to give a better feeling for how it works. We will proceed by reading the Simplified DES algorithm description in the Stallings section. We will then work through a full example in class. 2 Full Example Let the plaintext be the string 0010 1000. Let the 10 bit key be 1100011110. 2.1 Key Generation The keys k1 and k2 are derived using the functions P10, Shift, and P8. P10 is defined as follows: P10 3 5 2 7 4 10 1 9 8 6 P8 is defined to be as follows: P8 6 3 7 4 8 5 10 9 The first key k1 is therefore equal to: Bit # 1 2 3 4 5 6 7 8 9 10 K 1 1 0 0 0 1 1 1 1 0 P10(K) 0 0 1 1 0 0 1 1 1 1 Shift(P10(K)) 0 1 1 0 0 1 1 1 1 0 P8(Shift(P10(K))) 1 1 1 0 1 0 0 1 The second key k2 is derived in a similar manner: Bit # 1 2 3 4 5 6 7 8 9 10 K 1 1 0 0 0 1 1 1 1 0 P10(K) 0 0 1 1 0 0 1 1 1 1 Shift3 (P10(K))) 1 0 0 0 1 1 1 0 1 1 P8(Shift2 (P10(K))) 1 0 1 0 0 1 1 1 So we have the two keys k1 = {1110 1001} and k2 = {1010 0111} 2.2 Initial and Final Permutation The plaintext undergoes an initial permutation when it enters the encryption function, IP. It undergoes a reverse final permutation at the end IP−1 . The function IP is defined as follows: 1
  • 2. IP 2 6 3 1 4 8 5 7 The function IP−1 is defined as follows: IP−1 4 1 3 5 7 2 8 6 Applied to the input, we have the following after the initial permutation: Bit # 1 2 3 4 5 6 7 8 P 0 0 1 0 1 0 0 0 IP(P) 0 0 1 0 0 0 1 0 2.3 Functions fK, SW, K • The function fk is defined as follows. Let P = (L, R), then fK(L, R) = (L ⊕ F(R, SK), R). • The function SW just switches the two halves of the plaintext, so SW(L, R) → (R, L) • The function F(p, k) takes a four bit string p and eight bit key k and produces a four bit output. It performs the following steps. 1. First it runs an expansion permutation E/P: E/P 4 1 2 3 2 3 4 1 2. Then it XORs the key with the result of the E/P function 3. Then it substitutes the two halves based on the S-Boxes. 4. Finally, the output from the S-Boxes undergoes the P4 permutation: P4 2 4 3 1 Applying the functions, we must perform the following steps: IP−1 ◦ fK2 ◦ SW ◦ fK1 ◦ IP 1. We have already calculated IP(P) = {0010 0010}. Applying the next functions: 2. fK1 (L, R) = f{1110 1001}(0010 0010) = (0010 ⊕ F(0010, {1110 1001}), 0010) 3. F(0010, {1110 1001}) = P4 ◦ SBoxes ◦ {1110 1001} ⊕ (E/P(0010)) 4. The steps are: Bit # 1 2 3 4 5 6 7 8 R 0 0 1 0 E/P(R) 0 0 0 1 0 1 0 0 k1 1 1 1 0 1 0 0 1 E/P(R)⊕k1 1 1 1 1 1 1 0 1 SBoxes(E/P(R)⊕k1) 1 0 0 0 P4(Sboxes(E/P(R)⊕k1)) 0 0 0 1 5. The result from F is therefore 0001 6. Calculating we then have fk1 (L, R) = (0010 ⊕ 0001, 0010) = (0011, 0010) 7. So far, then L = 0011 and R = 0010. SW just swaps them so R = 0011 and L = 0010. 8. We now do the calculation of fk2 (L, R) = f{1010 0111}(0010 0011) = (0010⊕F(0011, {1010 0111}, 0011)) 2
  • 3. 9. The steps for F are as above: Bit # 1 2 3 4 5 6 7 8 R 0 0 1 1 E/P(R) 1 0 0 1 0 1 1 0 k2 1 0 1 0 0 1 1 1 E/P(R)⊕k2 0 0 1 1 0 0 0 1 SBoxes(E/P(R)⊕k2) 1 0 1 0 P4(Sboxes(E/P(R)⊕k2)) 0 0 1 1 10. So now we have the outcome of F as 0011 11. Calculating we then have fk2 (L, R) = (0010 ⊕ 0011, 0011) = (0001, 0011) 12. Last, we perform the IP−1 permutation: Bit # 1 2 3 4 5 6 7 8 R,L 0 0 0 1 0 0 1 1 IP−1 (R,L) 1 0 0 0 1 0 1 0 13. So the final result of the encryption is 1000 1010. 3