0% found this document useful (0 votes)
176 views4 pages

Lesson Title: Codes and Cryptography Lesson Intended Learning Outcomes (Lilo)

1. The document discusses codes and cryptography, beginning with an explanation of modular arithmetic and how it relates to topics like time on a 12-hour clock, universal product codes, and validating credit card numbers. 2. Encryption methods are explained, including shift ciphers and their use to encrypt and decrypt messages. 3. Key aspects of communication security are defined, like cryptography, encryption, decryption, and classical cryptosystems such as shift ciphers.

Uploaded by

yasmin
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)
176 views4 pages

Lesson Title: Codes and Cryptography Lesson Intended Learning Outcomes (Lilo)

1. The document discusses codes and cryptography, beginning with an explanation of modular arithmetic and how it relates to topics like time on a 12-hour clock, universal product codes, and validating credit card numbers. 2. Encryption methods are explained, including shift ciphers and their use to encrypt and decrypt messages. 3. Key aspects of communication security are defined, like cryptography, encryption, decryption, and classical cryptosystems such as shift ciphers.

Uploaded by

yasmin
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/ 4

LESSON TITLE: CODES AND CRYPTOGRAPHY

LESSON INTENDED LEARNING OUTCOMES (LILO):


At the end of the lesson, the student shall:

1. explain and apply the concept of modular arithmetic;


2. solve examples of codes using the concept of modular arithmetic;
3. explain and solve examples of communication security;

LESSON GUIDE:
Learning Guide: Time Learning Resources
Allotment
1. Discuss and illustrate what modular
Mathematics in the Modern
arithmetic is.
World;
2. Explain and examples of codes applied to Week 16-17
Calingasan, et al
UPS, credit card,etc. (Week 18 is pp 315-344
3. Discuss and illustrate different security Final
systems such as shift cipher, etc. Examination)

Self-Directed Activity:
Look for an actual situation where you can apply
methods of codes and security.

LEARNING CONTENT:

During this time of technology and advanced communication, enormous amount of


information are passed from one point to another using different media. Thus, there is a need
to secure these information using codes or other methods, one of these is called cryptography.
But before going to the specific topics of these codes and cryptography, we will first be aware
that most of these rely on the mathematical concept called modular arithmetic.

Modulo n

Two integers a and b are said to be congruent modulo n, where n is a natural number, if
𝑎−𝑏
is an integer. In this case, we write a≡b mod n. The number n is called the modulus. The
𝑛
statement a≡b mod n is called congruence.
Furthermore, if a ≡ b mod n and a and b are whole numbers, then a and b have the same
remainder when divided by n or in ordinary terms, when we divide a with n, the remainder is b.

Example: Determine whether the congruence is true.


29−8
a. 29 ≡ 8 mod 3. This is true or congruent because = 7 and 7 is a whole number.
3
29 8
Furthermore, and 3 have the same remainder which is 2.
3

15−4
b. 15 ≡ 4 mod 6. This is false or not congruent because is not a whole number.
6

One simple application of this is in terms of determining the time using the 12-hour clock, like:

a) What is 7 hours after 8 o’clock?


This can be done by counting 7 hours from 8 o’clock which is 3 o’clock. But using the
8+7 15
above formula, this can be computed by =12 ≡ 3 mod 12.This means that if we
12
divided 15 with 2, we get 3 as the remainder and this what we would want to get.

b) But what if the problem is; What 70 hours after 7 o’clock? So it will take time to count
70 hours from 8 o’clock. But what we can do is to add 70 hours to 7 o’clock and that
77
this will be 77. So using the formula, ≡ 5 mod 12. This means that it will be 5 o’clock.
12

Another important application of this concept is in Universal Product Code or UPC or bar
codes found in the different items like grocery and almost all items sold in the stores. They are
very helpful to keep track of inventory. This means that its purpose is to make it easy to
identify product features such as the brand name, item, size, etc.

The UPC is a 12-digit number that satisfi es a congruence equation that is similar to the
one for ISBNs. The last digit is the check digit. If we label the 12 digits of the UPC as d1, d2, ... ,
d12, we can write a formula for the UPC check digit d12.

The formula for determining d12 is:

d12 = (3𝑑1 + 𝑑2 + 3𝑑3 + 𝑑4 + 3𝑑5 + 𝑑6 + 3𝑑7 + 𝑑8 + 3𝑑9 +𝑑10 + 3𝑑11) mod 10 and based on this
formula, d12 should be 0, If not 0, then the UPC is not valid.

This can also be applied in determining whether a credit card is valid or not is calculated
by calculating the last digit using the following steps:

=Beginning with the next-to-last digit (the last digit is the check digit) and reading from
right to left, double every other digit. If a digit becomes a two-digit number after being
doubled, treat the number as two individual digits. Now find the sum of the new list of digits;
the final sum must be equal to sum mod 10. The last digit must be equal to d16 = 10-sum mod
10. (Example, if the sum is 34 then this is 4 mod 10, thus, the last digit is 10-4 =6.)

d16 = (𝑑15 +2 𝑑14 + 𝑑13 +2𝑑12 + 𝑑11 + 2𝑑10 + 𝑑9 + 2𝑑8 + 𝑑7 + 2𝑑6 + 𝑑5+2𝑑4 + 𝑑3 + 2𝑑2 + 𝑑1) mod
10

Example: Check if this is a valid Credit Card Number; 5234 8213 3410 1298.

d16 = (9 +2x2 + 1 +2x0 +1 + 2x4 + 3 + 2x3 + 1 + 2x2 + 8 +2x4 + 3 + 2x2 + 5) mod 10 = 65 mod
10 since this 5 mod 10, the credit card number is not valid.

COMMUNICATION SECURITY:

• Cryptography: process of making and using codes to secure transmission of information

• Encryption: converting original message into a form unreadable by unauthorized


individuals (vs decryption)

• Cryptanalysis: process of obtaining original message from encrypted message without


knowing algorithms

Cryptology: science of encryption; combines cryptography and cryptanalysis

Classical Cryptosystems

• Shift Ciphers (Caesar) y= (x+k )mod 26

• Affine Ciphers y=ax+b (mod 26)

• Vigenere Ciphers codes=(02,14,03,04,18)

Shift Ciphers

Each letter in the plaintext is replaced by a letter some fixed number of positions down
the alphabet
Each letter in the plaintext is replaced by a letter some fixed number of positions down
the alphabet

EXAMPLE:

a) Encrypt “Pray for Marawi” using a shift cypher k = 11,

that is, apply the formula

c = (p + 11) mod 26

Where c is the ciphertext and p is the plaintext.

plain P R A Y F O R M A R A W I
p 15 17 0 24 6 14 17 12 0 17 0 22 8
C 0 2 11 9 17 25 18 23 11 2 11 7 19
ciphr A C L J R Z S X L C L H T

b) Decrypt: GUNBLOFYM using k=20 (backward)


p = (c- 20) mod 26

ciphr G U N B L O F Y M
C 6 20 13 1 11 14 5 24 12
p 12 0 19 7 17 20 11 4 18
plain M A T H R U L E S

Post Test:
Answer the following questions from the textbook: Mathematics in the Modern World;
Calingasan, et al

p 340 # 2, 4

p 343 # 16, 17, 18

You might also like