0% found this document useful (0 votes)
102 views

Congruence. Let, , and . We Say "A Is Congruent To B Modulo M", and

The document discusses modular arithmetic and its applications in cryptography. It provides examples of using modular arithmetic to find the least residue of a number modulo another number. It then discusses how modular arithmetic can be used in cryptography, including the Caesar cipher and a cyclic alphabetic coding scheme. The Caesar cipher involves shifting each letter of the alphabet by a fixed number of positions to encrypt a message. Examples are given of encrypting and decrypting messages using the Caesar cipher with different shift amounts. The cyclic alphabetic coding scheme also uses modular arithmetic to encrypt messages by mapping letters to numbers and shifting the numerical equivalent. Examples demonstrate encrypting messages using this scheme.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views

Congruence. Let, , and . We Say "A Is Congruent To B Modulo M", and

The document discusses modular arithmetic and its applications in cryptography. It provides examples of using modular arithmetic to find the least residue of a number modulo another number. It then discusses how modular arithmetic can be used in cryptography, including the Caesar cipher and a cyclic alphabetic coding scheme. The Caesar cipher involves shifting each letter of the alphabet by a fixed number of positions to encrypt a message. Examples are given of encrypting and decrypting messages using the Caesar cipher with different shift amounts. The cyclic alphabetic coding scheme also uses modular arithmetic to encrypt messages by mapping letters to numbers and shifting the numerical equivalent. Examples demonstrate encrypting messages using this scheme.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

B.

Mathematical System
• Modular Arithmetic
Congruence. Let 𝑎, 𝑏 ∈ 𝒁, and 𝑚 ∈ 𝑵. We say ”a is congruent to b modulo m”, and
write “𝑎 ≡ 𝑏(mod 𝑚),” if 𝑚|(𝑎 − 𝑏). The integer m is called the modulus of the congruence.
If a is not congruent to b modulo m, we write “𝑎 ≢ 𝑏(mod 𝑚).
In addition, if 𝑚 > 0 and r is the remainder when the division algorithmis used to
divide b by m, then r is called the least residue of b (mod m).

Example 1. Find the least residue of the following:


a. 11(mod 8)
b. 4(mod 9)
c. 25(mod 5)
d. −11(mod 6)
e. −3(mod 7)

Solution:
a. 11(mod 8)
11 ÷ 8 = 1 𝑟 3 (r stands for remaider)
3 ≡ 11(mod 8)
The least residue of 11(mod 8) is 3.

b. 4(mod 9)
3 is less than 9, therefore the least residue of 4(mod 9) is 4.

c. 25(mod 5)
25 ÷ 5 = 5
0 ≡ 5(mod 8)
3 × 5 is exactly equal to 5 (no remainder), therefore the least residue of 25(mod 5)
is 0.

d. −11(mod 6)
For this problem keep on adding 6 to -11 until you reach a positive number less
than 6.
−11 + 6 = −5
−5 + 6 = 1
1 ≡ −11(mod 6)
The least residue of −11(mod 6) is 1.

e. −3(mod 7)
For this problem keep on adding 7 to -3 until you reach a positive number less
than 7.
−3 + 7 = 4
4 ≡ −3(mod 7)
The least residue of −3(mod 7) is 4.

Example 2. Evaluate each of the following


a. 24 + 39(mod 11)
b. 72 + 56(mod 3)
c. 34 − 16(mod 5)
d. 17 − 28(mod 6)

Solution:
b. 24 + 39(mod 11)
63(mod 11)
63 ÷ 11 = 5 𝑟 8
8 ≡ 24 + 39(mod 11)

c. 72 + 56(mod 3)
128(mod 3)
128 ÷ 3 = 42 𝑟 2
2 ≡ 72 + 56(mod 3)

d. 34 − 16(mod 5)
18(mod 5)
18 ÷ 5 = 3 𝑟 3
3 ≡ 34 − 16(mod 5)

e. 17 − 28(mod 6)
−11(mod 6)
1 ≡ −11(mod 6) (see Example 1d.)

• Application of Modular Arithmetic


a. Cryptology
1. Simple Substitution Cipher
If an individual wanted to secretly store or communicate messages they make
use of cryptology. It involves a technique to obscure a message so outsiders
cannot read the message. The use of codes is ancient, Julius Caesar used this
simple encryption scheme by jumbling the letters of the alphabet according to
some rule.
A substitution cipher replaces each letter in the message with a different
letter, following some established mapping. One good example of a substitution
cipher is the Caesar Cipher ( or shift cipher). Julius Caesar used the cipher method
in his private correspondence. In this cipher, each letter is replaced with a letter of
some fixed number of positions later in the alphabet. For example if we use a shif
of 6, then letter A would be replaced by letter g, the letter 6 positions later in the
alphabet. See illustration below on how shifting is done.
Example 1. Use the Caesar cipher with shift 6 to encrypt the message: SEND THE
SECURITY.
Solution:
Use the mapping below to encrypt the message SEND THE SECURITY.
Plain text Letter (Original)

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
g h i j k l m n o p q r s t u v w x y z a b c d e f
Cipher text Letter

S E N D T H E S E C U R I T Y
y k t j z n k Y k i a x o z e

Encrypted Message: yktj znk ykiaxoze

Example 2. Decrypt the message amm gwc vmfb emms if it was encrypted using
a shift cipher with shift of 8.
Solution:
We start by writing out the character mapping by shifting the alphabet, with A
mapping I, eight characters later in the alphabet.
Plain text Letter (Original)

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
i j k l m n o p q r s t u v w x y z a b c d e f g h
Cipher text Letter

We now work backward to decrypt the message.

a m m g w c v m f b e m m s

S E E Y O U N E X T W E E K

Decrypted Message: SEE YOU NEXT WEEK

Example 3. Use the Caesar cipher with shift 7 to encrypt the message: GIVE ME
APPLE.
Solution:
Use the mapping below to encrypt the message GIVE ME APPLE.
Plain text Letter (Original)
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
h i j k l m n o p q r s t u v w x y z a b c d e f g
Cipher text Letter

G I V E M E A P P L E
n p c l t l h w w s L

Encrypted Message: npcl tl hwwsl

Example 4. Decrypt the message xqlyhuvlwb if it was encrypted using a shift


cipher with shift of 3.
Solution:
We start by writing out the character mapping by shifting the alphabet, with A
mapping d, three characters later in the alphabet.
Plain text Letter (Original)

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
Cipher text Letter

We now work backward to decrypt the message.

x q l y h u v l w b

U N I V E R S I T Y

Decrypted Message: UNIVERSITY

2. Cyclic Alphabetic Coding Scheme


A cyclical encrypting using the alphabet is related to modular arithmetic, we
will start with the normal alphabet and map each letter with a number as shown in
the figure below.

Numerical Equivalents for the Letters of the Alphabet

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
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 0

If the encrypting code is to be shifted each letter of the plain text message
(original message) m positions, then the equivalent letters in the cipher text
message is given by 𝑐 ≡ (𝑝 + 𝑚)(mod 26); where p is the numerical equivalent (see
figure above) of the plain text message and c is the numerical equivalent of the
cipher text message. Note that a and 26 should be relatively prime.
Example 1. Use the cyclical alphabetic encrypting code that shifts each letter 5
position to code WINSTON THE GREAT.
Solution:
The encrypting congruence is 𝑐 ≡ (𝑝 + 5)(mod 26)

We first replace p by the numerical equivalent of each letter of plain text using
the table below.
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
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 0

Then we solve c and after establishing the values of c we code it using the table
above.

W = 23 𝑐 ≡ (23 + 5)(mod 26) ≡ 28 (mod 26) ≡ 2 Code W to B


I=9 𝑐 ≡ (9 + 5)(mod 26) ≡ 14 (mod 26) ≡ 14 Code I to N
N = 14 𝑐 ≡ (14 + 5)(mod 26) ≡ 19 (mod 26) ≡ 19 Code N to S
S = 19 𝑐 ≡ (19 + 5)(mod 26) ≡ 24 (mod 26) ≡ 24 Code S to X
T = 20 𝑐 ≡ (20 + 5)(mod 26) ≡ 25 (mod 26) ≡ 25 Code T to Y
O = 15 𝑐 ≡ (15 + 5)(mod 26) ≡ 20 (mod 26) ≡ 20 Code O to T
H=8 𝑐 ≡ (8 + 5)(mod 26) ≡ 13 (mod 26) ≡ 13 Code H to M
E=5 𝑐 ≡ (5 + 5)(mod 26) ≡ 10 (mod 26) ≡ 10 Code E to J
G=7 𝑐 ≡ (7 + 5)(mod 26) ≡ 12 (mod 26) ≡ 12 Code G to L
R = 18 𝑐 ≡ (18 + 5)(mod 26) ≡ 23 (mod 26) ≡ 23 Code R to W
A=1 𝑐 ≡ (1 + 5)(mod 26) ≡ 6 (mod 26) ≡ 6 Code A to F

W I N S T O N T H E G R E A T
B N S X Y T S Y M J L W J F Y

Cipher text: BNSXYTS YMJ LWJFY

Example 2. Apply the cyclical alphabetic decrypting code that shifts each letter 6
position to code ATYZUVVGHRK.
Solution:
We first replace c by the numerical equivalent of each letter of cipher text and
find p. Because the position of 𝑚 = 6, 𝑛 = 26 − 𝑚 = 26 − 6 = 20. The cipher text is
decoded by using the congruence 𝑝 ≡ (𝑐 + 20)(mod 26). The result of ATYZUVVGHRK
as reflected below.

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
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 0

A=1 𝑝 ≡ (1 + 20)(mod 26) ≡ 21(mod 26) ≡ 21 Decode A as U


T = 20 𝑝 ≡ (20 + 20)(mod 26) ≡ 40(mod 26) ≡ 14 Decode T as N
Y = 25 𝑝 ≡ (25 + 20)(mod 26) ≡ 45(mod 26) ≡ 19 Decode Y as S
Z=0 𝑝 ≡ (0 + 20)(mod 26) ≡ 46(mod 26) ≡ 20 Decode Z as T
U = 21 𝑝 ≡ (21 + 20)(mod 26) ≡ 41(mod 26) ≡ 15 Decode U as O
V = 22 𝑝 ≡ (22 + 20)(mod 26) ≡ 42(mod 26) ≡ 16 Decode V as P
G=7 𝑝 ≡ (7 + 20)(mod 26) ≡ 27(mod 26) ≡ 1 Decode G as A
H=8 𝑝 ≡ (8 + 20)(mod 26) ≡ 28(mod 26) ≡ 2 Decode H as B
R = 18 𝑝 ≡ (18 + 20)(mod 26) ≡ 38(mod 26) ≡ 12 Decode R as L
K = 10 𝑝 ≡ (10 + 20)(mod 26) ≡ 30(mod 26) ≡ 5 Decode K as E

A T Y Z U V V G H R K
U N S T O P P A B L E

Plain text: UNSTOPPABLE

Example 3. Use the congruence 𝑐 ≡ (3𝑝 + 2)(mod 26) to encode the message QUIZ
TODAY.
Solution:
The encrypting congruence is 𝑐 ≡ (3𝑝 + 2)(mod 26)
We first replace p by the numerical equivalent of each letter of plain text using
the table below.
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
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 0

Then we solve c and after establishing the values of c we code it using the table
above.

The results for the message QUIZ TODAY is shown below.

Q = 17 𝑐 ≡ [3(17) + 2](mod 26) ≡ 53 (mod 26) ≡ 1 Code Q as A


U = 21 𝑐 ≡ [3(21) + 2](mod 26) ≡ 65 (mod 26) ≡ 13 Code U as M
I=9 𝑐 ≡ [3(9) + 2](mod 26) ≡ 29 (mod 26) ≡ 3 Code I as C
Z=0 𝑐 ≡ [3(0) + 2](mod 26) ≡ 2 (mod 26) ≡ 2 Code Z as B
T = 20 𝑐 ≡ [3(20) + 2](mod 26) ≡ 62 (mod 26) ≡ 10 Code T as J
O = 15 𝑐 ≡ [3(15) + 2](mod 26) ≡ 47 (mod 26) ≡ 21 Code O as U
D=4 𝑐 ≡ [3(4) + 2](mod 26) ≡ 14 (mod 26) ≡ 14 Code D as N
A=1 𝑐 ≡ [3(1) + 2](mod 26) ≡ 5 (mod 26) ≡ 5 Code A as E
Y= 25 𝑐 ≡ [3(25) + 2](mod 26) ≡ 77 (mod 26) ≡ 25 Code Y as Y

Q U I Z T O D A Y
A M C B J U N E Y
Cipher text: AMCB JUNEY

REFERENCES:
1. Nocon, R. C., & Nocon, E. G. (2018). Essential Mathematics for the Modern World.
Quezon City: C & E Publishing, Inc.

2. Reyes, J. A. (2018). Mathematis in the Modern World. Intramuros Manila: Unlimited


Books Library Services & Publishing Inc.

3. Sirug, W. S. (2018). Mathematics in the Modern World. Intramuros, Manila:


Mindshapers Co., Inc.

You might also like