0% found this document useful (0 votes)
13 views19 pages

Codes Cryptography

The document discusses cryptography, focusing on the Caesar Cipher and Decimation Cipher as methods for encoding and decoding messages. It explains the processes of encryption and decryption, providing examples and activities for practice. The document is prepared by Prof. Jean D. Centina and references a mathematics textbook.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views19 pages

Codes Cryptography

The document discusses cryptography, focusing on the Caesar Cipher and Decimation Cipher as methods for encoding and decoding messages. It explains the processes of encryption and decryption, providing examples and activities for practice. The document is prepared by Prof. Jean D. Centina and references a mathematics textbook.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

-CRYPTOGRAPHY-

A. CAESAR CIPHER
B. DECIMATION
CIPHER
Prepared by:
PROF. JEAN D. CENTINA
DAVAO DEL NORTE STATE COLLEGE

REFERENCE: pp. 200-204 of MATHEMATICS in the Modern World


by Balthazar, Ragasa, and Evangelista
CRYPTOGRAPHY
-the study of methods to write and solve secret codes. (Stewart, p. 616)

- Diplomats and military personnel sometimes engage in highly


confidential matters that they need to send information securely by
using secret codes.

- ENCRYPTION is the process of encoding messages through secret


codes.

2
Importance of Cryptographic
Programs
• Prevent hackers from
• using your email address
• Making calls using your mobile number to access private information
• Used to determine first-hand data communicated through electronic
transactions

• Example:
• USA President Bill Clinton and Ireland President Bertie Ahern used
unique signing code to ensure authenticity of intergovernmental
document
3
CRYPTOGRAPHIC PROGRAMS

A. Caesar Cipher
• Also known as Caesar Code
• Used by Julius Caesar in sending messages to his troops.
• Makes use of the letters of the English alphabet with integers 0 to 25

A -0
B -1
C - 2
D - 3 ; and so on…

4
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

Then, to encrypt a message, replace a letter of the message in position i by a letter in


position (i + 3).

Example:
X, Y, and Z are replaced with
B in a message is replaced by E (1 + 3 = 4)
A, B, and C, respectively!
F is replaced by I (5 + 3 = 8)
L is replaced by O (11 + 3 = 14)

There is shifting of letters 3 positions to the right!


5
There is shifting of letters 3 positions to the right.
X, Y, and Z are replaced with A, B, and C, respectively!

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
D E F G H I J K L M N O P Q R S T U V W X Y Z A B C

6
HOW ARE MESSAGES SENT?
1.
SENDER COMPOSES A MESSAGE OR 3.
INFORMATION IN PLAINTEXT THE CODED MESSAGE IS SENT TO THE RECEIVER.

2.
THE MESSAGE IS CONVERTED TO CODED FORM
CIPHERTEXT – the result of encryption; 4.
ENCRYPTION – the process of making the
message unreadable anyone except to the one THE MESSAGE IS CONVERTED BACK TO CODED
with the key. FORM (CIPHERTEXT – the result of encryption)

7
EXAMPLE 1

Using the table below, encrypt the message: “WE ARE CLOSE TO VICTORY”
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
D E F G H I J K L M N O P Q R S T U V W X Y Z A B C

SOLUTION:
• MESSAGE WE ARE CLOSE TO VICTORY
• Replace the letters ZH DUH FORVH WR YLFWRUB -the encrypted message
of the message
with the letters in
the second row.

answer: ZHDUHFORVHWRYLFWRUB

8
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
D E F G H I J K L M N O P Q R S T U V W X Y Z A B C

EXAMPLE 2

Decrypt the message: “PDWKHPDWLFVLVEHDXWLIXO”

SOLUTION:
• MESSAGE PDWKHPDWLFVLVEHDXWLIXO.

• Replace the letters of the message with MATHEMATICSISBEAUTIFUL


the letters in the first row.
-the decrypted message

Answer : MATHEMATICS IS BEAUTIFUL

9
ACTIVITY 10 – CAESAR CIPHER
Instruction: Write your answers on a sheet of paper then encode them in the google form for Activity 10.

A. Using CAESAR CIPHER Table, give the equivalent letter for each of the letters in the English alphabet. (26
points)

B. Use the Caesar cipher to encrypt the following messages:


(Use CAPITAL LETTERS in your answers.)
1. SAVE THE PRISONERS OF WAR
2. MATHEMATICS IS INTERESTING
3. MODERN DAY HEROES
4. EDUCATION IS IMPORTANT
C. Decrypt the following messages which were encrypted using the Caesar cipher:
(Use CAPITAL LETTERS in your answers.)
5. VWXGBKDUG
6. EHKRQHVWDOOWKHWLPH
7. UHVSHFWWKHHOGHUOB LINK FOR GOOGLE FORM WILL BE SENT IN THE CLASS GC
8. ORYHIRUFRXQWUB

CAESAR CIPHER
A B C D E F G H I J K L MN O P Q R S T U VWX Y Z
D E F G H I J K L MN O P Q R S T U VWX Y Z A B C 10
CODES
-CRYPTOGRAPHY-
B. DECIMATION CIPHER
Prepared by:
PROF. JEAN D. CENTINA
DAVAO DEL NORTE STATE COLLEGE

REFERENCE: pp. 200-204 of MATHEMATICS in the Modern World


by Balthazar, Ragasa, and Evangelista
CRYPTOGRAPHIC PROGRAMS
B. Decimation Cipher
Step 1
Assign the 26 letters of the English alphabet the numbers 0 to 25 in order.
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
Step 2
Select an odd integer p between 3 and 25 except 13 (13 is a factor of 26).
Make sure that p and 26 have no common prime divisors.
Step 3
Replace the letter in the message with the position value i with the letter of
numerical value pi mod26.
12
DECIMATION CIPHER TABLE
LETTERS
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
POSITION
NUMBER 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
Table of DECIMATION CIPHER & DECRYPTION p = 15, F (5) will be replaced by X (75MOD26);
VALUES the remainder is 23 (X)
Encryption Value ( p ) - Decryption Value ( i ) Example However, when pi is equal to or
key
greater than 26, use pi mod 26 to
3 9
If p is 7, find the replacement for the letter.
5 21
7 15 C is replaced Example:
9 3 by O.
11 19 F is replaced by J. Why?
15 7 Why?
17 23 F=5
19 11 C=2
21 5 5 X 7 = 35
23 17 2 x 7 = 14
25 25 35mod26 = 9 (the remainder)
14 is assigned J has the value 9.
to letter O. 13
Table of DECIMATION CIPHER DECRYPTION VALUES
To decode an encrypted message:
Encryption Value ( p ) - key Decryption Value ( i )
Use the same method, 3 9
but 5 21
multiply the numerical value for 7 15
each encrypted letter by 15;
9 3
because 15 corresponds to 7 in the
11 19
table, 15 is the decryption value
15 7
for 7.
17 23
19 11
15 is used to decrypt the message
21 5
as it has the property that
15 X 7 = 105 23 17

105mod26 = 1 25 25

14
Example :
Encrypt the message “BIOLOGY IS A NATURAL SCIENCE” using decimation cipher and p = 5 .
DECIMATION CIPHER TABLE

LETTERS 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
POSITION
NUMBER 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
Steps Solution

• Message BIOLOGY IS A NATURAL SCIENCE

B I O L O G Y I S A N A T U R A L S C I E N C E
• Position 1 8 14 11 14 6 24 8 18 0 13 0 19 20 17 0 11 18 2 8 4 13 2 4

• Position x 5 5 40 70 55 70 30 120 40 90 0 65 0 95 100 85 0 55 90 10 40 20 65 10 20


( let p = 5)

• New position 5 14 18 3 18 4 16 14 12 0 13 0 17 22 7 0 3 12 10 14 20 13 10 20
( pi mod26 )

Based on the F O S D S E Q O M A N A R W H A D M K O U N K U
new position, The encrypted message.
replace with the
corresponding
letter
15
DECIMATION CIPHER TABLE

LETTERS 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
POSITION
NUMBER 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
Table of DECIMATION CIPHER
DECRYPTION VALUES
Example 2 for Decimation Cipher, USING p = 19, encode JEAN
Encryption Value Decryption Value
message J E A N ( p ) - key (i)
Original
position 9 4 0 13 3 9
no.
5 21
Original
position
171 76 0 247
is x 19 7 15
Since the
given p is
19
9 3
Divide by 26 since 171 is more 11 19
New
position 15 24 0 13
( pimod26 ) than 26, there is no 26 in the table.
The The remainder is 15. 15 7
remainder
if pi mod26 17 23
is equal to
or more
than 26 19 11
Replaced
letters
P Y A N 21 5
23 17
ANSWER: PYAN
25 25
DECIMATION CIPHER TABLE

LETTERS 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
POSITION
NUMBER 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
DECRYPTION Table of DECIMATION CIPHER DECRYPTION VALUES
Encryption Value ( p ) - Decryption Value ( i )
Decryption Example 1: key
Using p = 5, decrypt M K O U N K U 3 9

In decryption, encryption value p = 5 5 21


7 15
has decryption value i of 21 . Copy the message, give enough
space between letters.9 3
Solution: 11 19
M K O U N K U Original position number
15 7
12 10 14 20 13 10 20 original position number
17 multiplied by 21
(the i or decryption value for 5)
23

Multiply by 21 19 11
252 210 294 420 273 210 420 The remainders,
21 after 5
dividing by 26 (numbers
Using pi mod 26 = 23
were greater than 26)
17

18 2 8 4 13 2 4 25 25
Letters corresponding to numbers above them
S C I E N C E (answer) 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
Table of DECIMATION CIPHER DECRYPTION VALUES
DECRYPTION Encryption Value ( p ) - Decryption Value ( i )
Example 2 key
3 9
Decrypt: 5 21
LFSAG 7 15
Use encryption value p = 11. 9 3
Solution: 11 19

L F S A G 15 7
17 23
11 5 18 0 6 19 11
Multiply by 19 21 5
209 95 342 0 114
23 17
pi mod 26 =
25 25
1 17 4 0 10 (Remainders)
B R E A K (answer)
18
Table of DECIMATION CIPHER
ACTIVITY 11 - DECIMATION CIPHER DECRYPTION VALUES
Instructions: Encryption Value Decryption Value
a. Write your answers first on a sheet of paper then ( p ) - key (i)
encode them in the google form for Activity 11. 3 9
b. USE CAPITAL LETTERS 5 21
c. NO SPACE BETWEEN LETTERS
7 15
d. NO SPACE BETWEEN WORDS
9 3
1. Use the decimation cipher with the key 17 to encrypt the 11 19
phrase 15 7
I LOVE TO DANCE. 17 23
2. Use the decimation cipher with the key 9 to encrypt 19 11
DAVAO DEL NORTE. 21 5
23 17
3. Decrypt: GUVCPN, encryption value p = 7 25 25
DECIMATION CIPHER TABLE

LETTERS 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
POSITION
NUMBER 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 1925

You might also like