0% found this document useful (0 votes)
114 views6 pages

CRYPTOLOGYmmw

mmw

Uploaded by

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

CRYPTOLOGYmmw

mmw

Uploaded by

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

Activity No.

___

CRYPTOLOGY

I. Introduction

Cryptology is the study of making and breaking secret codes.

Related to codes on books and grocery items are secret codes. These codes are
used to send messages between people, companies or nations. It is hoped that by devising
a code that is difficult to break, the sender can prevent the communication from being
read if it is intercepted by an unauthorized person (Aufmann et.al, 2013).

II. Objectives

At the end of this activity, you should be able to:

1. Code a message.

2. Decode a message.

3. Write messages using cyclical coding.

4. Apply modular arithmetic to cyclical encryption of messages.

III. Concepts

Definition of Terms:

1. Plaintext- it is a message before it is coded.

2. Ciphertext- is the message after it has been written in code.

3. Encryption – a method of changing from plaintext to ciphertext.

4. Decryption – a reverse process of encryption. This is to convert the


ciphertext message to plaintext.

Example 1: Jose Rizal’s poem entitled “TO THE PHILIPPINES” converted to


ciphertext is “PK PDA LDEHELLEJAO”

In this example, “TO THE PHILIPPINES” was encrypted by substituting each


letter in plaintext with the letter that is 22 letters after that letter in the alphabet.

1
This method is called a cyclical coding scheme, wherein each letter of the
alphabet is shifted the same number of positions. The original alphabet and the substitute
alphabet are shown below.

Table 1

A B C D E F G H I J K L MN O P Q R S T U V WX Y Z
WX Y Z AB C D E FG H I J K L M N O P Q R S T U V

Question: (Decryption) Using the cyclical coding scheme described above, where each
letter is replaced by the one 22 letters after the letter, what is the plaintext word that
corresponds to the ciphertext YKZA?

Answer: _______________.

Cyclical encrypting using the alphabet is related to modular arithmetic. To


encrypt messages using cyclical coding, the following table can be used; wherein each
letter of the alphabet is associated with a number.

Table 2
Numerical Equivalents for the Letters of the Alphabet

AB C D E FG 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 shift each letter of the plaintext message m positions,
then the corresponding letter in the ciphertext message is given by c≡ (p + m) mod 26,
where p is the numerical equivalent of the plaintext letter and c is the numerical
equivalent of the ciphertext letter.

The letter Z is coded as 0 because 26 ≡ 0 mod 26.

To code the plaintext letter T in the word THE (in Example 1),

m = 22 (each letter was shifted 22 positions)

p = 20 (T is the 20th letter).

Using the congruence c≡ (p + m) mod 26, we have

c ≡ (20 + 22) mod 26

c ≡42 mod 26
2
c ≡16

The 16th letter is P. Thus T is coded as P.

To decode the letter H (which is in ciphertext in Example 1), we use the


congruence,

p ≡ (c + n) mod 26, where n = 26 – m.

Now we have

p ≡ (8 + 4) mod 26

p ≡12 mod 26

p ≡ 12

The 12th letter is L. Thus H is decoded as L.

Example 2: Write Messages Using Cyclical Coding

a. Use the cyclical alphabetic encrypting code that shifts each letter 8 positions to code
COVID VACCINE.

Solution:

The encrypting congruence is c≡(p + 8)mod 26. Replace p by the numerical


equivalent of each letter of plaintext and determine c. The results for COVID VACCINE
are shown:

C c≡(3+8) mod 26 ≡11 mod 26 ≡11, Code C as K

O c≡(15+8)mod 26 ≡23 mod 26 ≡23, Code O as W

V c≡(22+8)mod 26 ≡30 mod 26≡4, Code V as D

I c≡(9+8)mod 26 ≡17 mod 26 ≡17, Code I as Q

D c≡(4+8)mod 26 ≡12mod 26 ≡12, Code D as L

V c≡(22+8)mod 26 ≡30 mod 26 ≡4, Code V as D

A c≡(1+8)mod 26 ≡ 9mod 26 ≡9, Code A as I

3
C c≡(3+8) mod 26 ≡11 mod 26 ≡11, Code C as K

C c≡(3+8) mod 26 ≡11 mod 26 ≡11, Code C as K

I c≡(9+8)mod 26 ≡17 mod 26 ≡17, Code I as Q

N c≡(14+8)mod 26 ≡22 mod 26 ≡22, Code N as V

E c≡(5+8)mod 26 ≡13 mod 26 ≡13, Code E as M

b. Use the cyclical alphabetic encrypting code that shifts each letter 18 positions to
decode the encrypted message HSFVWEAU.

Solution:

Because m=18, n = 26 – 18=8. The ciphertext is decoded by using the congruence


p ≡ (c + 8) mod 26. The results for HSFVWEAU are shown:

H p ≡¿ ) mod 26 ≡16 mod 26 ≡16 , Decode H as P.

S p ≡¿ +8) mod 26 ≡27 mod 26 ≡1 , Decode S as A.

F p ≡¿ +8) mod 26 ≡14 mod 26 ≡14 , Decode F as N.

V p ≡¿ +8) mod 26 ≡30 mod 26 ≡ 4 , Decode V as D.

W p ≡¿ +8) mod 26 ≡31mod 26 ≡5 , Decode W as E.

E p≡¿ +8) mod 26 ≡13 mod 26 ≡13 , Decode E as M.

A p ≡¿ +8) mod 26 ≡ 9mod 26 ≡ 9 , Decode A as I.

U p ≡¿ +8) mod 26 ≡29 mod 26 ≡3 , Decode U as C.

The practicality of a cyclical alphabetic coding scheme is limited because it is


relatively easy for a cryptologist to determine the coding scheme. A coding scheme that
is a little more difficult to break is based on the congruence c ≡¿ ap+m) mod 26, where a
and 26 do not have a common factor. The reason why a and 26 cannot have a common
factor is related to the procedure for determining the decoding congruence.

4
Example 3: Use the congruence c ≡ (3p+1) mod 26 to encode the message SWAB
TESTS.
Solution:
The encrypting congruence is c ≡ (3p+1) mod 26. Replace p by the numerical
equivalent of each letter from Table 2 and determine c. The results for SWAB TESTS are
shown below.
S c≡(3·19+1) mod 26 ≡58 mod 26 ≡6 , Code S as F.
W c≡(3·23+1) mod 26 ≡70 mod 26 ≡18 , Code Was R.
A c≡(3·1+1) mod 26 ≡ 4 mod 26 ≡ 4 , Code A as D.
B c≡(3·2+1) mod 26 ≡7 mod 26 ≡7 , Code B as G.

T c≡(3·20+1) mod 26 ≡61 mod 26 ≡ 9, Code T as I.


E c≡(3·5+1) mod 26 ≡16 mod 26 ≡16 , Code E as P.
S c≡(3·19+1) mod 26 ≡58 mod 26 ≡6 , Code S as F.
T c≡(3·20+1) mod 26 ≡61 mod 26 ≡ 9, Code T as I.
S c≡(3·19+1) mod 26 ≡58 mod 26 ≡6 , Code S as F.

Using the congruence given in this example, the plaintext is coded in ciphertext as
FRDG IPFIF.

Decoding a message that was encrypted using the congruence c ≡ (ap+m) mod n
requires solving the congruence for p. This method relies on multiplicative inverses. In
this method, we solve the congruence used in Example 3 for p, that is:
c = 3p + 1
c – 1 = 3p • Subtract 1 from each side of the equation.
9 (c – 1) = 9 (3p) • Multiply each side of the equation by the
multiplicative inverse of 3. Because 9·3≡ 1 mod 26,
multiply each side by 9.
[9 (c – 1)] mod 26 ≡ p

5
Using the preceding congruence equation, we can decode the ciphertext message
FRDG IPFIF. The method for decoding FRDG is shown below.
F [9 (6– 1)] mod 26 ≡ 45 mod 26 ≡ 19, Decode F as S.
R [9 (18– 1)] mod 26 ≡ 153 mod 26 ≡ 23, Decode R as W.
D [9 (4– 1)] mod 26 ≡ 27 mod 26 ≡ 1, Decode D as A.
G [9 (7– 1)] mod 26 ≡ 54 mod 26≡ 2, Decode G as B.

IV. Practice Exercises


A. Encode the message by using a cyclical alphabetic encrypting code that shifts the
message by the stated number of positions.

1. 6 positions: COMMUNITY QUARANTINE

2. 9 positions: LOCKDOWN

B. Use a cyclical alphabetic encrypting code that shifts the letters by the stated number of
positions to decode the encrypted message.

8 positions: VWJWLG QA XMZNMKB

C. Use a cyclical alphabetic encrypting code to decode the encrypted message.

1. YBZAM HK YEBZAM

2. AOB HVS HCFDSRCSG

D. Use the encrypting congruence c ≡ (3p+2) mod 26 to code the message SOCIAL
DISTANCING.

REFERENCES:

Aufmann et.al, 2013. Mathematical Excursions. Third Edition. © Brooks/Cole, Cengage


Learning

You might also like