0% found this document useful (0 votes)
46 views3 pages

Caesar Cipher Encryption and Decryption

The document provides examples of encrypting and decrypting messages using Caesar cipher and an alphabetic encoding cipher. For Caesar cipher, it gives examples of encrypting messages with shifts of 13 and 4, and decrypting messages with shifts of 6 and 17. For the alphabetic encoding cipher, it encrypts the message 'SYSTEM' with the congruence c ≡ (p + 7)(mod 26) and decrypts the message 'IRUIQ' with the congruence p ≡ (c + 6)(mod 26).
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)
46 views3 pages

Caesar Cipher Encryption and Decryption

The document provides examples of encrypting and decrypting messages using Caesar cipher and an alphabetic encoding cipher. For Caesar cipher, it gives examples of encrypting messages with shifts of 13 and 4, and decrypting messages with shifts of 6 and 17. For the alphabetic encoding cipher, it encrypts the message 'SYSTEM' with the congruence c ≡ (p + 7)(mod 26) and decrypts the message 'IRUIQ' with the congruence p ≡ (c + 6)(mod 26).
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

A. Encrypt the following messages using Caesar Cipher. BOX THE ENCRYPTED MESSAGE.

(10 points each)

1. Message: ATTACK AT NIGHT, with shift 13

Solution: Use the mapping below to encrypt the message ATTACK AT NIGHT

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

A T T A C K A T N I G H T
n g g n p x n g a v t u g

Encrypted Message: nggnpx ng avtug

2. Message: TAKE CONTROL, with shift 4

Solution: Use the mapping below to encrypt the message TAKE CONTROL

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

T A K E C O N T R O L
x e o i g s r x v s p

Encrypted Message: xeoi gsrxvsp

B. Decrypt the following messages using Caesar Cipher. BOX THE DECRYPTED MESSAGE. (10 points

each)
1. hxuznkx, with shift 6

Solution: We start by writing out the character mapping by shifting the alphabet, with A mapping G, six
characters later in 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
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

h x u z n k X
B R O T T E R

Decrypted Message: BROTHER

2. cr grkizr, with shift 17

Solution: We start by writing out the character mapping by shifting the alphabet, with A mapping R,
seventeenth characters later in 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
r s t u v w x y z a b c d e f g h i j k l m n o p q

c r g r k i z r
L A P A T R I A

Decrypted Message: LA PATRIA

C. Determine the cipher text of the given message below using alphabetic encrypting code. (10 points)

Message: SYSTEM Encrypting Congruence: 𝑐 ≡ (𝑝 + 7)(mod 26)


Solution:

The encrypting congruence is 𝑐 ≡ (𝑝 + 7)(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.

S= 19 c ≡ (19 + 7)(mod 26) ≡ 26 (mod 26) ≡ 0 Code S to Z


Y= 25 c ≡ (25 + 7)(mod 26) ≡ 32 (mod 26) ≡ 6 Code Y to F
S= 19 c ≡ (19 + 7)(mod 26) ≡ 26 (mod 26) ≡ 0 Code S to Z
T= 20 c ≡ (20 + 7)(mod 26) ≡ 27 (mod 26) ≡ 1 Code T to A
E= 5 c ≡ (5 + 7)(mod 26) ≡ 12(mod 26) ≡ 12 Code E to L
M= 13 c ≡ (13 + 7)(mod 26) ≡ 20 (mod 26) ≡ 20 Code M to T

Cipher Text: ZFZALT

D. Determine the plain text of the given message below using alphabetic encrypting code. (10 points)

Message: IRUIQ Decrypting Congruence: 𝑝 ≡ (𝑐 + 6)(mod 26)

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

I= 9 c ≡ (9 + 20)(mod 26) ≡ 29(mod 26) ≡ 3 Decode I as C


R= 18 c ≡ (18 + 20)(mod 26) ≡38(mod 26) ≡ 12 Decode R as L
U= 21 c ≡ (21 + 20)(mod 26) ≡41(mod 26) ≡ 15 Decode U as O
I= 9 c ≡ (9 + 20)(mod 26) ≡ 29(mod 26) ≡ 3 Decode I as C
Q= 17 c ≡ (17 + 20)(mod 26) ≡37(mod 26) ≡11 Decode Q as K

Plain text: CLOCK

You might also like