SlideShare a Scribd company logo
MEP: Codes and Ciphers, Unit 12 One-Time Pads
1
Pupil Text
12 One-Time Pads
A one-time pad is a random collection of letters, e.g. FXIPUF, which can be used to
encrypt messages with complete security (i.e. it is impossible to recover the message
without knowing the key).
Suppose we wish to encrypt the message SECRET. There are three main methods for
doing this, all of which involve a slightly different arithmetic from normal.
The arithmetic is called modular arithmetic. If the result of a sum is bigger than or equal
to 26, we only consider the remainder after division by 26.
Thus 16 11 27 1+ = = ( )mod 26
and 11 5 55 3× = = ( )mod 26
Negative numbers follow the same rule, but we add 26 repeatedly rather than subtract.
So 11 16 5− = −
= − + = ( )5 26 21 mod 26
26 is known as the modulus of the arithmetic. Note that 26 0= ( )mod 26 .
You should already be familiar with this type of arithmetic when telling time:
for example, three hours after 11 o'clock is
11 3 14+ =
= 2 o'clock
which is the same as saying
11 3 14+ =
= ( )2 mod 12
For this reason, modular arithmetic is also known as 'clock arithmetic'.
We treat each letter of the alphabet as a number between 0 and 25. We can use any order
we like, but a sensible one would be A B= =1 2, , ..., Y Z= =25 0, . We ignore spaces
between words.
So using numbers our message becomes
CS E TER
319 5 20518
We do the same to our one-time pad,
IF X FUP
96 24 62116
MEP: Codes and Ciphers, Unit 12 One-Time Pads
2
Pupil Text
Method 1: Additive key
Here we just add modulo 26 each letter of the message (plaintext) with its corresponding
key.
Hence
S F (mod 26) Y+ ⇒ + = ⇒19 6 25
E X (mod 26) C+ ⇒ + = ⇒5 24 3 , etc.
This gives the message Y C L H Z Z, which without the one-time pad is very difficult to
decrypt (decode).
If you have the one-time pad, i.e. the key, decryption is relatively simple; you just reverse
the process by taking the key from the coded messages.
Here, we have
Y C L H Z Z 25 3 12 8 0 0
– F X I P U F – 6 24 9 16 21 6
S E C R E T 19 5 3 18 5 20
Note
The encrypted letters are arranged in groups of five rather than with the spacing of the
plaintext words they represent.
Exercise 1
Use the one-time pad PJKVA RJGME BWJBH to encrypt the following messages:
a) NICE ONE CYRIL
b) KEEP BRITAIN TIDY
Method 2: Subtractive key
This works in a similar way to Method 1, but here the value of the key is subtracted
modulo 26 from the value of the plaintext.
For the message, SECRET, we have
S F (mod 26) M− ⇒ − = ⇒19 6 13
E X (mod 26) G− ⇒ − = ⇒5 24 7 , etc.
This gives the message M G T B J N.
Again, with the one-time pad, decryption is straightforward. This time you add the key,
giving
M G T B J N 13 7 20 2 10 14
+ F X I P U F + 6 24 9 16 21 6
S E C R E T 19 5 3 18 5 20
⇐
⇒
⇐
⇒
MEP: Codes and Ciphers, Unit 12 One-Time Pads
3
Pupil Text
Exercise 2
Repeat Exercise 1, using the one-time pad as a subtractive key.
Activity 1 (Method 3: Minuend)
There is a third method, namely 'minuend', which is the reverse of subtraction. Here the
value of the plaintext is subtracted from the key.
Use this method to encrypt and decrypt SECRET. (Hint: to decrypt, you again subtract
from the key.)
Exercise 3
Use the one-time pad PJKVA RJGME BWJBH to decrypt the following messages:
a) IXLLD JKJXQ GMYR (additive key)
b) CJDTK WEDYD QWUL (subtractive key)
c) SBVRZ ZENPV ND (minuend)
From now on we will just work with the 'additive key' method.
Exercise 4
a) Use the one-time pad DNCRG ZBQCS PQRXZ GNPI to decrypt the message
CCXFL VGIKT TZLQO NCEM.
b) Now decrypt the same message using pad WXABC QFUGF ELGYJ UTXY.
The one practical problem with this method is that if you are sending a message to
someone, that someone has to know what the key is. How do you distribute keys in such
a way that they are not made public?
The usual method is to physically deliver key on paper, floppy disk, etc. Another way
round the problem is not to use totally random letters, but rather letters from some known
scheme. This has its problems too as you will see in the next activity.
Activity 2
You intercept the following message:
TGFVJ ZFWDB ATBBT XRKUY ZJQYO PFF
You know that the sender always begins his encrypted messages with the word SECRET.
a) What are the first six letters of the key?
b) How do you think the key might continue? Use this to decrypt the message.
MEP: Codes and Ciphers, Unit 12 One-Time Pads
4
Pupil Text
It can be helpful when deciphering the plaintext if you know, for example, that a message
has been padded with dummy letters, e.g. XXX, or that each message begins with today's
date.
Activity 3
You intercept another message from the same person:
IJBLW ZKJDI CXYUY UTVCF PQQDQ XJAPT LSGKK GUVJF FOCFK CCG.
a) What are the first six letters of the key?
b) Does this help you recover the rest of the message?

More Related Content

What's hot

Diabolic Str8ts #6, #7, and #9
Diabolic Str8ts #6, #7, and #9Diabolic Str8ts #6, #7, and #9
Diabolic Str8ts #6, #7, and #9
SlowThinker
 
Polynomial long division
Polynomial long divisionPolynomial long division
Polynomial long division
Deepak Kumar
 
8th alg -l9.5
8th alg -l9.58th alg -l9.5
8th alg -l9.5
jdurst65
 
Algebra 1 unit 1.1
Algebra 1 unit 1.1Algebra 1 unit 1.1
Algebra 1 unit 1.1
Mark Ryder
 
Synthetic Division Notes
Synthetic Division NotesSynthetic Division Notes
Synthetic Division Notes
cmorgancavo
 
Sudoku
SudokuSudoku
Sudoku
b p
 
Str8ts Weekly Extreme #70 - Step-by-step Solution
Str8ts Weekly Extreme #70 - Step-by-step SolutionStr8ts Weekly Extreme #70 - Step-by-step Solution
Str8ts Weekly Extreme #70 - Step-by-step Solution
SlowThinker
 
Interactive Voting - Year 5, Brackets
Interactive Voting   - Year 5, BracketsInteractive Voting   - Year 5, Brackets
Interactive Voting - Year 5, Brackets
Qwizdom UK
 
Swifter Taipei 聊聊 Swift 遊樂場、變數常數、數字與運算
Swifter Taipei 聊聊 Swift 遊樂場、變數常數、數字與運算Swifter Taipei 聊聊 Swift 遊樂場、變數常數、數字與運算
Swifter Taipei 聊聊 Swift 遊樂場、變數常數、數字與運算
Xue Xin Tsai
 
Polynomial long division
Polynomial long divisionPolynomial long division
Polynomial long division
holdil35
 
7.6 notes b
7.6 notes b7.6 notes b
7.6 notes b
mbetzel
 
3XRC4
3XRC43XRC4
March 12, 2015
March 12, 2015March 12, 2015
March 12, 2015
khyps13
 
Data transfer using bipartite graph
Data transfer using bipartite graphData transfer using bipartite graph
Data transfer using bipartite graph
SwathiSundari
 
Simple Overview Caesar and RSA Encryption_by_Tarek_Gaber
Simple Overview Caesar and RSA Encryption_by_Tarek_GaberSimple Overview Caesar and RSA Encryption_by_Tarek_Gaber
Simple Overview Caesar and RSA Encryption_by_Tarek_Gaber
Tarek Gaber
 
Graphing and Solving Inequalities
Graphing and Solving InequalitiesGraphing and Solving Inequalities
Graphing and Solving Inequalities
brittanyhurley1
 
Algebra 7 Point 2
Algebra 7 Point 2Algebra 7 Point 2
Algebra 7 Point 2
herbison
 
3
33
Trig identities
Trig identitiesTrig identities
Trig identities
drkamalpanchal
 

What's hot (19)

Diabolic Str8ts #6, #7, and #9
Diabolic Str8ts #6, #7, and #9Diabolic Str8ts #6, #7, and #9
Diabolic Str8ts #6, #7, and #9
 
Polynomial long division
Polynomial long divisionPolynomial long division
Polynomial long division
 
8th alg -l9.5
8th alg -l9.58th alg -l9.5
8th alg -l9.5
 
Algebra 1 unit 1.1
Algebra 1 unit 1.1Algebra 1 unit 1.1
Algebra 1 unit 1.1
 
Synthetic Division Notes
Synthetic Division NotesSynthetic Division Notes
Synthetic Division Notes
 
Sudoku
SudokuSudoku
Sudoku
 
Str8ts Weekly Extreme #70 - Step-by-step Solution
Str8ts Weekly Extreme #70 - Step-by-step SolutionStr8ts Weekly Extreme #70 - Step-by-step Solution
Str8ts Weekly Extreme #70 - Step-by-step Solution
 
Interactive Voting - Year 5, Brackets
Interactive Voting   - Year 5, BracketsInteractive Voting   - Year 5, Brackets
Interactive Voting - Year 5, Brackets
 
Swifter Taipei 聊聊 Swift 遊樂場、變數常數、數字與運算
Swifter Taipei 聊聊 Swift 遊樂場、變數常數、數字與運算Swifter Taipei 聊聊 Swift 遊樂場、變數常數、數字與運算
Swifter Taipei 聊聊 Swift 遊樂場、變數常數、數字與運算
 
Polynomial long division
Polynomial long divisionPolynomial long division
Polynomial long division
 
7.6 notes b
7.6 notes b7.6 notes b
7.6 notes b
 
3XRC4
3XRC43XRC4
3XRC4
 
March 12, 2015
March 12, 2015March 12, 2015
March 12, 2015
 
Data transfer using bipartite graph
Data transfer using bipartite graphData transfer using bipartite graph
Data transfer using bipartite graph
 
Simple Overview Caesar and RSA Encryption_by_Tarek_Gaber
Simple Overview Caesar and RSA Encryption_by_Tarek_GaberSimple Overview Caesar and RSA Encryption_by_Tarek_Gaber
Simple Overview Caesar and RSA Encryption_by_Tarek_Gaber
 
Graphing and Solving Inequalities
Graphing and Solving InequalitiesGraphing and Solving Inequalities
Graphing and Solving Inequalities
 
Algebra 7 Point 2
Algebra 7 Point 2Algebra 7 Point 2
Algebra 7 Point 2
 
3
33
3
 
Trig identities
Trig identitiesTrig identities
Trig identities
 

Viewers also liked

Stream ciphers
Stream ciphersStream ciphers
Stream ciphers
degarden
 
Stream ciphers presentation
Stream ciphers presentationStream ciphers presentation
Stream ciphers presentation
degarden
 
Block Cipher vs. Stream Cipher
Block Cipher vs. Stream CipherBlock Cipher vs. Stream Cipher
Block Cipher vs. Stream Cipher
Amirul Wiramuda
 
cryptography
cryptographycryptography
cryptography
Abhijeet Singh
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network security
patisa
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
Uday Meena
 
Cryptography
CryptographyCryptography
Cryptography
Shivanand Arur
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
kusum sharma
 

Viewers also liked (8)

Stream ciphers
Stream ciphersStream ciphers
Stream ciphers
 
Stream ciphers presentation
Stream ciphers presentationStream ciphers presentation
Stream ciphers presentation
 
Block Cipher vs. Stream Cipher
Block Cipher vs. Stream CipherBlock Cipher vs. Stream Cipher
Block Cipher vs. Stream Cipher
 
cryptography
cryptographycryptography
cryptography
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network security
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 

Similar to OTP basic

Rsa example
Rsa exampleRsa example
Rsa example
Abhishek Kesharwani
 
Known plaintext attack of hill cipher
Known plaintext attack of hill cipherKnown plaintext attack of hill cipher
Known plaintext attack of hill cipher
MinghongGao
 
Applications of ode and matrices soluti0n
Applications of ode and matrices soluti0nApplications of ode and matrices soluti0n
Applications of ode and matrices soluti0n
Faizan Shabbir
 
How to invent a new cryptosystem.pdf
How to invent a new cryptosystem.pdfHow to invent a new cryptosystem.pdf
How to invent a new cryptosystem.pdf
MihailIulianPlea1
 
27-Equivalent under modulo-27-Oct-2020Material_I_27-Oct-2020_Cryptography_.pdf
27-Equivalent under modulo-27-Oct-2020Material_I_27-Oct-2020_Cryptography_.pdf27-Equivalent under modulo-27-Oct-2020Material_I_27-Oct-2020_Cryptography_.pdf
27-Equivalent under modulo-27-Oct-2020Material_I_27-Oct-2020_Cryptography_.pdf
Mohamedshabana38
 
CSE1107 Chinese Remainder Theorem in Discrete Mathmatics.pptx
CSE1107 Chinese Remainder Theorem in Discrete Mathmatics.pptxCSE1107 Chinese Remainder Theorem in Discrete Mathmatics.pptx
CSE1107 Chinese Remainder Theorem in Discrete Mathmatics.pptx
gbikorno
 
Algebra factoring
Algebra factoringAlgebra factoring
Algebra factoring
TrabahoLang
 
03 Chapter MATLAB finite precision arithmatic
03 Chapter MATLAB finite precision arithmatic03 Chapter MATLAB finite precision arithmatic
03 Chapter MATLAB finite precision arithmatic
Dr. Mohammed Danish
 
01 - DAA - PPT.pptx
01 - DAA - PPT.pptx01 - DAA - PPT.pptx
01 - DAA - PPT.pptx
KokilaK25
 
Stanford splash spring 2016 basic programming
Stanford splash spring 2016 basic programmingStanford splash spring 2016 basic programming
Stanford splash spring 2016 basic programming
Yu-Sheng (Yosen) Chen
 
02 Notes Divide and Conquer
02 Notes Divide and Conquer02 Notes Divide and Conquer
02 Notes Divide and Conquer
Andres Mendez-Vazquez
 
rational expressions
rational expressionsrational expressions
rational expressions
TrabahoLang
 
A Comparison Of Methods For Solving MAX-SAT Problems
A Comparison Of Methods For Solving MAX-SAT ProblemsA Comparison Of Methods For Solving MAX-SAT Problems
A Comparison Of Methods For Solving MAX-SAT Problems
Karla Adamson
 
internal assement 3
internal assement 3internal assement 3
internal assement 3
Saturnin Pugnet
 
SAS Homework Help
SAS Homework HelpSAS Homework Help
SAS Homework Help
Statistics Homework Helper
 
Karatsuba algorithm for fast mltiplication
Karatsuba algorithm for fast mltiplicationKaratsuba algorithm for fast mltiplication
Karatsuba algorithm for fast mltiplication
Atul Singh
 
Carry save addition
Carry save additionCarry save addition
Carry save addition
MICKYJINDAL
 
Chapter 01.ppt
Chapter 01.pptChapter 01.ppt
Chapter 01.ppt
JulijaKaraliunaite1
 
Chapter 01.ppt
Chapter 01.pptChapter 01.ppt
Chapter 01.ppt
JulijaKaraliunaite1
 
Square
SquareSquare
Square
Mohd Shanu
 

Similar to OTP basic (20)

Rsa example
Rsa exampleRsa example
Rsa example
 
Known plaintext attack of hill cipher
Known plaintext attack of hill cipherKnown plaintext attack of hill cipher
Known plaintext attack of hill cipher
 
Applications of ode and matrices soluti0n
Applications of ode and matrices soluti0nApplications of ode and matrices soluti0n
Applications of ode and matrices soluti0n
 
How to invent a new cryptosystem.pdf
How to invent a new cryptosystem.pdfHow to invent a new cryptosystem.pdf
How to invent a new cryptosystem.pdf
 
27-Equivalent under modulo-27-Oct-2020Material_I_27-Oct-2020_Cryptography_.pdf
27-Equivalent under modulo-27-Oct-2020Material_I_27-Oct-2020_Cryptography_.pdf27-Equivalent under modulo-27-Oct-2020Material_I_27-Oct-2020_Cryptography_.pdf
27-Equivalent under modulo-27-Oct-2020Material_I_27-Oct-2020_Cryptography_.pdf
 
CSE1107 Chinese Remainder Theorem in Discrete Mathmatics.pptx
CSE1107 Chinese Remainder Theorem in Discrete Mathmatics.pptxCSE1107 Chinese Remainder Theorem in Discrete Mathmatics.pptx
CSE1107 Chinese Remainder Theorem in Discrete Mathmatics.pptx
 
Algebra factoring
Algebra factoringAlgebra factoring
Algebra factoring
 
03 Chapter MATLAB finite precision arithmatic
03 Chapter MATLAB finite precision arithmatic03 Chapter MATLAB finite precision arithmatic
03 Chapter MATLAB finite precision arithmatic
 
01 - DAA - PPT.pptx
01 - DAA - PPT.pptx01 - DAA - PPT.pptx
01 - DAA - PPT.pptx
 
Stanford splash spring 2016 basic programming
Stanford splash spring 2016 basic programmingStanford splash spring 2016 basic programming
Stanford splash spring 2016 basic programming
 
02 Notes Divide and Conquer
02 Notes Divide and Conquer02 Notes Divide and Conquer
02 Notes Divide and Conquer
 
rational expressions
rational expressionsrational expressions
rational expressions
 
A Comparison Of Methods For Solving MAX-SAT Problems
A Comparison Of Methods For Solving MAX-SAT ProblemsA Comparison Of Methods For Solving MAX-SAT Problems
A Comparison Of Methods For Solving MAX-SAT Problems
 
internal assement 3
internal assement 3internal assement 3
internal assement 3
 
SAS Homework Help
SAS Homework HelpSAS Homework Help
SAS Homework Help
 
Karatsuba algorithm for fast mltiplication
Karatsuba algorithm for fast mltiplicationKaratsuba algorithm for fast mltiplication
Karatsuba algorithm for fast mltiplication
 
Carry save addition
Carry save additionCarry save addition
Carry save addition
 
Chapter 01.ppt
Chapter 01.pptChapter 01.ppt
Chapter 01.ppt
 
Chapter 01.ppt
Chapter 01.pptChapter 01.ppt
Chapter 01.ppt
 
Square
SquareSquare
Square
 

Recently uploaded

Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
ImMuslim
 
Nutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour TrainingNutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour Training
melliereed
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
RamseyBerglund
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
giancarloi8888
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
سمير بسيوني
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
Juneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School DistrictJuneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School District
David Douglas School District
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
Iris Thiele Isip-Tan
 
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
EduSkills OECD
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
blueshagoo1
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
National Information Standards Organization (NISO)
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
RidwanHassanYusuf
 
Stack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 MicroprocessorStack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 Microprocessor
JomonJoseph58
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
nitinpv4ai
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 

Recently uploaded (20)

Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
 
Nutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour TrainingNutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour Training
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
Juneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School DistrictJuneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School District
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
 
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
 
Stack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 MicroprocessorStack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 Microprocessor
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 

OTP basic

  • 1. MEP: Codes and Ciphers, Unit 12 One-Time Pads 1 Pupil Text 12 One-Time Pads A one-time pad is a random collection of letters, e.g. FXIPUF, which can be used to encrypt messages with complete security (i.e. it is impossible to recover the message without knowing the key). Suppose we wish to encrypt the message SECRET. There are three main methods for doing this, all of which involve a slightly different arithmetic from normal. The arithmetic is called modular arithmetic. If the result of a sum is bigger than or equal to 26, we only consider the remainder after division by 26. Thus 16 11 27 1+ = = ( )mod 26 and 11 5 55 3× = = ( )mod 26 Negative numbers follow the same rule, but we add 26 repeatedly rather than subtract. So 11 16 5− = − = − + = ( )5 26 21 mod 26 26 is known as the modulus of the arithmetic. Note that 26 0= ( )mod 26 . You should already be familiar with this type of arithmetic when telling time: for example, three hours after 11 o'clock is 11 3 14+ = = 2 o'clock which is the same as saying 11 3 14+ = = ( )2 mod 12 For this reason, modular arithmetic is also known as 'clock arithmetic'. We treat each letter of the alphabet as a number between 0 and 25. We can use any order we like, but a sensible one would be A B= =1 2, , ..., Y Z= =25 0, . We ignore spaces between words. So using numbers our message becomes CS E TER 319 5 20518 We do the same to our one-time pad, IF X FUP 96 24 62116
  • 2. MEP: Codes and Ciphers, Unit 12 One-Time Pads 2 Pupil Text Method 1: Additive key Here we just add modulo 26 each letter of the message (plaintext) with its corresponding key. Hence S F (mod 26) Y+ ⇒ + = ⇒19 6 25 E X (mod 26) C+ ⇒ + = ⇒5 24 3 , etc. This gives the message Y C L H Z Z, which without the one-time pad is very difficult to decrypt (decode). If you have the one-time pad, i.e. the key, decryption is relatively simple; you just reverse the process by taking the key from the coded messages. Here, we have Y C L H Z Z 25 3 12 8 0 0 – F X I P U F – 6 24 9 16 21 6 S E C R E T 19 5 3 18 5 20 Note The encrypted letters are arranged in groups of five rather than with the spacing of the plaintext words they represent. Exercise 1 Use the one-time pad PJKVA RJGME BWJBH to encrypt the following messages: a) NICE ONE CYRIL b) KEEP BRITAIN TIDY Method 2: Subtractive key This works in a similar way to Method 1, but here the value of the key is subtracted modulo 26 from the value of the plaintext. For the message, SECRET, we have S F (mod 26) M− ⇒ − = ⇒19 6 13 E X (mod 26) G− ⇒ − = ⇒5 24 7 , etc. This gives the message M G T B J N. Again, with the one-time pad, decryption is straightforward. This time you add the key, giving M G T B J N 13 7 20 2 10 14 + F X I P U F + 6 24 9 16 21 6 S E C R E T 19 5 3 18 5 20 ⇐ ⇒ ⇐ ⇒
  • 3. MEP: Codes and Ciphers, Unit 12 One-Time Pads 3 Pupil Text Exercise 2 Repeat Exercise 1, using the one-time pad as a subtractive key. Activity 1 (Method 3: Minuend) There is a third method, namely 'minuend', which is the reverse of subtraction. Here the value of the plaintext is subtracted from the key. Use this method to encrypt and decrypt SECRET. (Hint: to decrypt, you again subtract from the key.) Exercise 3 Use the one-time pad PJKVA RJGME BWJBH to decrypt the following messages: a) IXLLD JKJXQ GMYR (additive key) b) CJDTK WEDYD QWUL (subtractive key) c) SBVRZ ZENPV ND (minuend) From now on we will just work with the 'additive key' method. Exercise 4 a) Use the one-time pad DNCRG ZBQCS PQRXZ GNPI to decrypt the message CCXFL VGIKT TZLQO NCEM. b) Now decrypt the same message using pad WXABC QFUGF ELGYJ UTXY. The one practical problem with this method is that if you are sending a message to someone, that someone has to know what the key is. How do you distribute keys in such a way that they are not made public? The usual method is to physically deliver key on paper, floppy disk, etc. Another way round the problem is not to use totally random letters, but rather letters from some known scheme. This has its problems too as you will see in the next activity. Activity 2 You intercept the following message: TGFVJ ZFWDB ATBBT XRKUY ZJQYO PFF You know that the sender always begins his encrypted messages with the word SECRET. a) What are the first six letters of the key? b) How do you think the key might continue? Use this to decrypt the message.
  • 4. MEP: Codes and Ciphers, Unit 12 One-Time Pads 4 Pupil Text It can be helpful when deciphering the plaintext if you know, for example, that a message has been padded with dummy letters, e.g. XXX, or that each message begins with today's date. Activity 3 You intercept another message from the same person: IJBLW ZKJDI CXYUY UTVCF PQQDQ XJAPT LSGKK GUVJF FOCFK CCG. a) What are the first six letters of the key? b) Does this help you recover the rest of the message?