You are on page 1of 22

Our lady of Fatima university

COLLEGE OF ARTS AND SCIENCES


Math and Physics Department
Pampanga Campus

MATM111
MATHEMATICS AS A TOOL:
Cryptography
Engr. Dave Joseph V. Gangcuangco
Lecturer
V. Mathematics as a Tool: Cryptography

5.1 5.2. 5.3. Check


Coding Theory Cryptography Codes and
and Modular Digits
Arithmetic

Learning Outline
V. Mathematics as a Tool: Cryptography
At the end of the chapter the students are expected:

Perform the coding of a word text using the


different method.

Decrypt the different message.

Learning Outcomes
CODES AND CRYPTOGRAPHY
Cryptography
Cryptology - is defined as the science of making
communication incomprehensible to all people except
those who have the right to read and understand it.

The study of cryptology consists of two parts:


• cryptography- which concerns itself with the secrecy system
itself and its design, and
• cryptanalysis- which concerns itself with the breaking of the
secrecy system above.
CODES AND CRYPTOGRAPHY
Cryptography
CRYPTOGRAPHY
Originated from the Greek works
KRYPTO which means hidden
and GRAPHENE means writing.

Is a method of making and


breaking of secret codes.

 It uses two processes such as


encryption and decryption.
CODES AND CRYPTOGRAPHY
Cryptography
CRYPTOGRAPHY
It is a method that is commonly used in military,
some government agency’s transaction, business firm
such as bank, insurance, etc. to source secrecy of the
information.
CODES AND CRYPTOGRAPHY
Cryptography
ENCRYPTION DECRYPTION
Is the process of transforming Is the process of
plain text into code form using a returning/converting back the
certain algorithm. coded message into plain text.
CODES AND CRYPTOGRAPHY
Cryptography
PLAIN TEXT
Refers to the original message.

CIPHER TEXT
Refers to the coded message.

Refers to the strings of information that is used to reveal the encrypted


message into readable form.
CODES AND CRYPTOGRAPHY
Cryptography
SIMPLE METHODS OF CRYPTOGRAPHY
Shift Cipher (Ceaser Cipher)
It is the simplest type of substitution cipher.
It uses shift in forming the key cryptography.
The cipher text is obtained from taking an
equivalent of a single letter of the alphabet to
another letter by doing a uniform number of shifts
either left or right.
Each letter of the alphabet should be matched
exactly to one letter of the cipher alphabet.
CODES AND CRYPTOGRAPHY
Cryptography
Shift Cipher (Ceaser Cipher)
 illustrations: Using a shift of 3 to the left (the commonly used number of shifts)

*Note: 1st line of letters are the English Alphabet while the 2nd row are the equivalent
cipher character/alphabet.
CODES AND CRYPTOGRAPHY
Cryptography
Shift Cipher (Ceaser Cipher)
 illustrations: Using a shift of 5 to the right

*Note: 1st line of letters are the English Alphabet while the 2nd row are the equivalent
cipher character/alphabet.
EXAMPLE
1. Using the key of shift of 3 to the left, encrypt the Word
P D W KH P D WL F V
“ MATHEMATICS”
EXAMPLE

Z OV M Q L DO XME V
EXAMPLE

GOD I S GOOD
CODES AND CRYPTOGRAPHY
Cryptography
SIMPLE METHODS OF CRYPTOGRAPHY
Modulo Operator
 The sender of the message uses the key K
to encrypt and to decrypt the secret
message.

 The key K may have any integer value from


0-25 and this will be shared to the person/s
who will be receiving the secret message.
CODES AND CRYPTOGRAPHY
Cryptography
Modulo Operator
To encrypt the message:
1. Express the letters of the alphabet into an integer from 0 to 25,
that matches its order, for example A = 0, B = 1, C = 3 ….., then
label them as C
2. Calculate Y = (C+ K) mod 26 , for every letter of the message.
3. Convert the number Y into a letter following the order of the
letter of the alphabet.
EXAMPLE
N HFS IT NY
1. Encrypt the message “I CAN DO IT” Let K = 5

I (8+ 5)mod26 D (3+ 5)mod26


13mod26= 13 (N) 8mod26 = 8 (I)
C (2+ 5)mod26 O (14 + 5)mod26
7mod26 = 7 (H) 19mod26= 19 (T)
A (0+ 5)mod26
T (19 + 5)mod26
5mod26 = 5 (F)
24mod26= 24 (Y)
N (13 + 5)mod26
18mod26= 18 (S)
EXAMPLE

I (8+ 10)mod26 E (4 + 10)mod26


18mod26= 18 (S) 14mod26= 14 (O)
L (11+ 10)mod26 Y (24+ 10)mod26
21mod26= 21 (V) 34mod26= 8 (I)
O (14+ 10)mod26 O (14+ 10)mod26
24mod26= 24 (Y) 24mod26= 24 (Y)
V (21+ 10)mod26 U (20+ 10)mod26
31mod26= 5 (F) 30mod26= 4 (E)
CODES AND CRYPTOGRAPHY
Cryptography
Modulo Operator
To decrypt the message:
1. Express the letters of the alphabet into an integer from 0 to 25,
that matches its order, for example A = 0, B = 1, C = 3 ….., then
label them as Y
2. Calculate C = (Y - K) mod 26 , for every letter of the decrypted
message.
3. Convert the number C into a letter following the order of the
letter of the alphabet.
EXAMPLE C = (Y - K) mod 26

R (17 - 5) mod26 N (13 - 5) mod26 K (10 - 5) mod26


12mod26= 12 (M) 8mod26 = 8 (I) 5mod26 = 5 (F)
R (17 - 5) mod26 X (23 - 5) mod26 Z (25 - 5) mod26
12mod26= 12 (M) 18mod26= 18 (S) 20mod26= 20 (U)
B (1 - 5) mod26 S (18 - 5) mod26
-4mod26 13mod26= 13 (N)
26 – 4 = 22 (W)

You might also like