Académique Documents
Professionnel Documents
Culture Documents
ENCRYPTION
&
DECRYPTION
Knowledge
Skills
Values
https://www.youtube.com/watch?v=ur3iGrDTTE4
https://www.youtube.com/watch?v=-3G0McSHRoU
ENCRYPTION & DECRYPTION
https://www.youtube.com/watch?v=TYX691q2J2c
https://www.youtube.com/watch?v=_C25CwNlVjA
ENCRYPTION & DECRYPTION
CRYPTOGRAPHY CRYPTANALYSIS
The art and science of keeping The art and science of breaking
message secure encoded data
In cryptography, we start with the unencrypted data, referred
to as plaintext. Plaintext is encrypted into ciphertext, which will
in turn (usually) be decrypted back into usable plaintext.
Suppose we have a plaintext(P) intended to be transmitted, the message to be
encrypted.
Example 1.
“I have been trying to buy you a nice gift like gold or an antique
but prices now are really high.”
Example 3
S a Gail
Susan says i llies. Matt
a lets e jovial.
t sSusan feel v eElated? Angry?
n
a. Caesar’s cipher, shift cipher, Caesar's code or Caesar shift –cyclical shift of the
plaintext alphabet which uses shift of 3(the shift parameter is used as the key).
Julius Caesar used to send encoded and secure messages to generals in the
Roman army.
Plain: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Cipher: D E F GH I J KLM NO P Q R S T U VW X Y Z A B C
When encrypting, a person looks up each letter of the
message in the "plain" line and writes down the
corresponding letter in the "cipher" line. Julius Caesar
100BC-400BC
Plain: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Cipher: D E F G H I J K LM N O P Q R S T U V W X Y Z A B C
Plaintext: DCODE
Ciphertext: GFRGH
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
Example 2.
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
To compute C + D, for example, we convert C and D to numbers and get
2 + 3 = 5, then convert 5 back into a letter (F)
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
_________________________________________________________
Example 2.
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
17 9 9 24 3 19 25 5 24 24 12 9 7 19 22 18 9 22
−
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
____________________________________________________________________
12 4 4 19 -2 14 20 0 19 19 7 4 2 14 17 13 4 17
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
Example 1. Encode the message HELLO, key (3,7)
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
H E L L O
7 4 11 11 14
2
H
Example 1. Encode the message HELLO, key (3,7)
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
H E L L O
7 4 11 11 14
Example 1. Encode the message HELLO, key (3,7)
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
H E L L O
7 4 11 11 14
40
40 26(1) + 14
L
Example 1. Encode the message HELLO, key (3,7)
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
H E L L O
7 4 11 11 14
49
40 26(1) + 23
O
Therefore, the ciphertext of HELLO is CTOOX!
Example 2. Encode the message I AM A SECRET, key (15,7)
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
I AM A S E C R E T
8 0 12 0 18 4 2 17 4 19
Example 2. Encode the message I AM A SECRET, key (15,7)
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
I AM A S E C R E T
8 0 12 0 18 4 2 17 4 19
Example 2. Encode the message I AM A SECRET, key (15,7)
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
I AM A S E C R E T
8 0 12 0 18 4 2 17 4 19
Example 2. Encode the message I AM A SECRET, key (15,7)
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
I A M A S E C R E T
8 0 12 0 18 4 2 17 4 19 Plaintext
23 7 5 7 17 15 11 2 15 6 Ciphertext
X H F H R P L C P G
Example 3. Encode the message RUN, key (7,5)
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
R U N
17 20 13
124
Example 3. Encode the message RUN, key (7,5)
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
R U N
17 20 13
145
145
Example 3. Encode the message RUN, key (7,5)
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
R U N
17 20 13
96
96
N
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
.
.
.
inverse
. . . . .
. . . . .
. . . . .
Example 4. Decode the message X HF H RPLCPG, key (15,7)
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
Example 4. Decode the message X HF H RPLCPG, key (15,7)
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
Example 4. Decode the message X HF H RPLCPG, key (15,7)
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
23 7 5 7 17 15 11 2 15 6 Ciphertext
X H F H R P L C P G
I A M A S E C R E T
8 0 12 0 18 4 2 17 4 19 Plaintext
c. The Atbash cipher (600 B.C.)is a particular type of
monoalphabetic monoalphabetic cipher formed by taking the
alphabet and mapping it to its reverse, so that the first letter
becomes the last letter, the second letter becomes the second to last
letter, and so on. For example, the English alphabet would work like
this:
Plain: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Cipher: Z Y X W V U T S RQ P O N M L K J I H G F E D C B A
History: The name derives from the first, last, second, and second to
the last Hebrew letters(Aleph-Tav-Beth-Shin)
In the Bible
Cipher: Z Y X W V U T S RQ P O N M L K J I H G F E D C B A
Example 2.
MVEVI HFIIVMWVI
Decoded Message:
NEVER SURRENDER
Example 3.
A B C D E FG H I J K LM N O PQ R S T U V W X Y Z
E F G H I J K L M N O P Q R ST U V W X Y Z A B C D
D C BAZYXWVUTS R Q PO N M LK J I H G F E
Message:
Freemason letters
d. Pigpen Cipher(18th century)-also known as the masonic cipher, Freemason’s
cipher, napoleon cipher, and tic-tac-toe cipher is a geometric simple substitution
cipher, which exchanges letters for symbols which are fragments of a grid.
1.
Decrypted word:
PARALLELOGRAM
2.
Decrypted word:
QUADRILATERAL
Variations of the Pigpen Cipher
Standard Pigpen Cipher Variation 1
Variation 3
Plain text S A V E T H E Q U E E N
x 18 0 21 4 19 7 4 16 20 4 4 13
Keystream 1 11 0 3 4 1 11 0 3 4 1 11
19 11 21 7 23 8 15 16 23 8 5 24
Cipher text T L V H X I P Q X I F Y
e. The Vigenere Cipher-originally described by
Giovan Battista Bellaso in 1553 but was named for
Blaise de Vigenere as he developed a stronger
autokey cipher
-a poly-alphabetic substitution
that uses a key and a table. It allows replacing a
letter by another one which is not always the same.
The Vigenere Cipher Table
Blaise de Vigenere
1523-1596
How to encrypt using the table:
Blaise de Vigenere
1523-1596
Plaintext: DCODE
Key: KEY
1. Choose a keyword. Repeat this key phrase over and over until it is the
same length as the plaintext.
Plaintext: DCODE
Key: KEYKE
How to encrypt using the table:
Blaise de Vigenere
1523-1596
Plaintext: DCODE
Key: KEYKE
2. Locate the first letter of the plaintext message in the first line of the table
and the first letter of the key on the left column. The cipher letter is at the
intersection.
Intersection cell is N.
How to encrypt using the table:
Blaise de Vigenere
1523-1596
Plaintext: DCODE
Key: KEYKE
3. Locate the second letter of the plaintext message in the first line of the
table and the second letter of the key on the left column. The cipher letter is
at the intersection.
Intersection cell is G.
How to encrypt using the table
Blaise de Vigenere
1523-1596
Plaintext: DCODE
Key: KEYKE
3. Continue this procedure, until the last letter of the plaintext is paired
correspondingly with the last letter of the key.
Ciphertext: NGMNI
How to decrypt using the table
Blaise de Vigenere
1523-1596
Key: KEYKE
Ciphertext: NGMNI
1. Locate the first letter of the key on the first column, and on the row of it, find
the first letter of the ciphertext which is N. Then go up in the column to read
the first letter of the plaintext.
The letter is D.
How to decrypt using the table
Blaise de Vigenere
1523-1596
Key: KEYKE
Ciphertext: NGMNI
2. Locate the second letter of the key on the first column, and on the row of it, find
the second letter of the ciphertext which is G. Then go up in the column to read
the second letter of the plaintext.
The letter is C.
How to decrypt using the table
Blaise de Vigenere
1523-1596
Key: KEYKE
Ciphertext: NGMNI
3. Continue this procedure, until the last letter of the key is paired
correspondingly with the last letter of ciphertext.
Plaintext: DCODE
Using Modular Arithmetic
To encrypt:
Plaintext: DCODE
Key: KEYKE
Blaise de Vigenere
1523-1596
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
Plaintext
+
Key
__________________________________________
38/26=1R12
N G M N I Ciphertext
Using Modular Arithmetic
To decrypt
Ciphertext: NG M N I
Key: KE Y K E
Blaise de Vigenere
1523-1596
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
Ciphertext
─
Key
__________________________________________
− 12+26=14
D C O D E Plaintext
Example 2.
Encode the message “IT WAS EARTH ALL ALONG” with the keyword “APES
Blaise de Vigenere
1523-1596
Plaintext: I T WA S E A RT H A L L A L O N G
Key: AP E S A P E S A P E S A P E S A P
Ciphertext: I I A S S T E J T W E D L P P G N V
Example 2.
Decode the message “I I A S S T E J T W E D L P P G N V” with the keyword
“APES
Blaise de Vigenere
1523-1596
Key: A P E S A P E S A P E S A P E S A P
Ciphertext: I I A S S T E J T W E D L P P G N V
Plaintext: I T W A S E A R T H A L L A L O N G
Example 2. Modular Arithmetic
Blaise de Vigenere
Encode the message “It was Earth all along” with the keyword “APES” 1523-1596
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
To decode the message, we simply subtract the repeated code word
from the ciphertext.
Blaise de Vigenere
1523-1596
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
3. Transposition Ciphers
https://www.youtube.com/watch?v=VRiN9M0v3ZQ
c. The Route Cipher
d. Columnar Transposition Cipher
e. Myszkowski Transposition Cipher
f. Permutation Cipher
Quantum cryptography
exploit the laws of quantum mechanics to send messages that are provably unhackable.
https://www.youtube.com/watch?v=axE4lNL8uuk
https://www.youtube.com/watch?v=CiS8gbkDISY
REFERENCES:
1. Nocon E. & Nocon R. (2016). Essential Mathematics for the
Modern World. Quezon City: C&E Publishing, Inc.
2. http://pages.mtu.edu/~shene/NSF-4/Tutorial/VIG/Vig-Base.
html
3. https://learncryptography.com/classical-encryption/playfair
-cipher
4. https://www.youtube.com/watch?v=VRiN9M0v3ZQ
5. https://www.youtube.com/watch?v=TYX691q2J2c
Thank you very much!