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

Codes Cryptography

The document discusses two cipher techniques: the Caesar cipher and the decimation cipher. The Caesar cipher involves shifting letters of the alphabet by a set number of positions. The decimation cipher assigns numbers to letters and uses multiplication to encrypt messages based on a key value. An example is provided to encrypt the phrase "BIOLOGY IS A NATURAL SCIENCE" using the decimation cipher with a key of 5.

Uploaded by

Vea Dela Rama
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views19 pages

Codes Cryptography

The document discusses two cipher techniques: the Caesar cipher and the decimation cipher. The Caesar cipher involves shifting letters of the alphabet by a set number of positions. The decimation cipher assigns numbers to letters and uses multiplication to encrypt messages based on a key value. An example is provided to encrypt the phrase "BIOLOGY IS A NATURAL SCIENCE" using the decimation cipher with a key of 5.

Uploaded by

Vea Dela Rama
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

CODES

-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 MN 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 3.
OR 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 : MATHEMATICSISBEAUTIFUL

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

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
C is replaced Example:
7 15 by O.
9 3 F is replaced by J. Why?
11 19 Why?
15 7 F=5
C=2
17 23
5 X 7 = 35
19 11 2 x 7 = 14
21 5 35mod26 = 9 (the remainder)
23 17 14 is assigned J has the value 9.
25 25
to letter O. 13
To decode an encrypted message: Table of DECIMATION CIPHER DECRYPTION VALUES

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

15 is used to decrypt the message 19 11

as it has the property that 21 5

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

Decryption Example 1: Encryption Value ( p ) -


key
Decryption Value ( i )

Using p = 5, decrypt M K O U N K U 3 9
In decryption, encryption value p = 5 5 21
has decryption value i of 21 . 7
Copy the message, give enough
15
space between letters.9 3
Solution:
11 19
M K O U N K U Original position number
15 7
original position number multiplied by 21
12 10 14 20 13 10 20 17
(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 = were greater23than 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

Decrypt: 3 9
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
ACTIVITY 10 - DECIMATION CIPHER Table of 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 10. 3 9
b. USE CAPITAL LETTERS
5 21
c. NO SPACE BETWEEN LETTERS
d. NO SPACE BETWEEN WORDS 7 15
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

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy