In: Computer Science
Write a short message of between 15 and 40 characters to your classmates. Encode it using a linear affine cipher with n=26. Post the message to the “Encrypted Messages” thread but do not give the “a” and “b” that you utilized.
Also post your own initial response thread in which you propose at least one way that you might try to decipher messages without the key.
Message:
HELLO FRIENDS NICE TO MEET YOU
encoding the message with n=26
Encryption(x) = (a*x + b)mod n = (a*x + b)mod 26
X values for alphabets
A B C D E F G H I J K L M
0 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
N O P Q R S T U V W X Y Z
encrypting given message:
WELCOME TO THE CLASS
a =17, b=20
Message | W | E | L | C | O | M | E | T | O | T | H | E | C | L | A | S | S |
Equivalent numeric (x) | 22 | 4 | 11 | 2 | 14 | 12 | 4 | 19 | 14 | 19 | 7 | 4 | 2 | 11 | 0 | 18 | 18 |
Encrypted(x) = (a*x +b)%26 | (17* 22 +20)%26 = 4 | (17* 4 +20)%26 = 10 | (17* 11 +20)%26 = 25 | (17* 2 +20)%26 = 2 | (17* 14 +20)%26 = 24 | (17* 12 +20)%26 = 16 | (17* 4 +20)%26 = 10 | (17* 19 +20)%26 = 5 | (17* 14 +20)%26 = 24 | (17* 19 +20)%26 = 5 | (17* 7 +20)%26 = 9 | (17* 4 +20)%26 = 10 | (17* 2 +20)%26 = 2 | (17* 11 +20)%26 = 25 | (17* 0 +20)%26 = 20 | (17* 18 +20)%26 = 14 | (17* 18 +20)%26 = 14 |
Decrypted Messgae | E | K | Z | C | Y | Q | K | F | Y | F | J | K | C | Z | U | O | O |
Encrypted Message is : EKZCYQK FY FJK CZUOO
To Decrypt the message use ;
D ( x ) = a^-1 ( x - b ) mod n
n=26