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

Helloww

The document describes a cipher on the alphabet Z27 with encryption function C = aM + b (mod 27), where a and b are the secret key. It then provides instructions for a program to implement the cipher to encrypt and decrypt files, accepting parameters for the key, input/output files, and encryption/decryption mode. It also provides a ciphertext message and asks to decrypt it using statistical cryptanalysis, writing out the steps taken. Hints are given that it is in English, punctuation is unchanged, and case is preserved, and the key length is between 2-6 characters.

Uploaded by

Tanzeel Hassan
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)
121 views4 pages

Helloww

The document describes a cipher on the alphabet Z27 with encryption function C = aM + b (mod 27), where a and b are the secret key. It then provides instructions for a program to implement the cipher to encrypt and decrypt files, accepting parameters for the key, input/output files, and encryption/decryption mode. It also provides a ciphertext message and asks to decrypt it using statistical cryptanalysis, writing out the steps taken. Hints are given that it is in English, punctuation is unchanged, and case is preserved, and the key length is between 2-6 characters.

Uploaded by

Tanzeel Hassan
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/ 4

Part 1.

a b c d e f g h i j
0 1 2 3 4 5 6 7 8 9
k l m n o p q r s t
10 11 12 13 14 15 16 17 18 19
u v w x y z ,
20 21 22 23 24 25 26

Consider a cipher on the alphabet Z27 = {a, b, c, d… z, comma} as the table above the encryption
function with key (a, b):

C = aM + b (mod 27).

1. Implement the cipher using C++ or Java. (5 marks)


The program should be able to do both encryption and decryption. All characters, no matter
uppercase or lowercase, will be encrypted/decrypted to lowercase characters. Other characters
not in the table will be unchanged.

The program should accept the following parameters: a flag to indicate encryption or decryption,
a set of secret key, an input file name, and an output file name. For example:
myProgram -key a b -encrypt -in file1.txt -out file2.txt
myProgram -key a b -decrypt -in file2.txt -out file3.txt
The program should be able to detect invalid key and display an error message if it
encounters an invalid key.
Note: screen cap the programme output to demo your result; you may be asked to run your
submitted program in the tutorial.

Part 2.
Use statistical cryptanalysis to decrypt the following message. You must write down the steps.
[Answer without steps will not be given any mark.] (3 marks)

Message:
Jrqee seammtrn hidntw ypvt xytig afgk ryk dui jfg twid. Le’gi edt giraln wlge llvihtv kwe llfae
qyjxntwj bosic uog yiqac hvaikiin bn hidnt azal jpkxmpxvay bebt strjt, bjx wdr xx kd hpzv p
cweere px ndrzmev, dgsets lmca ctvkpicpp qeciwxt uvfb btmev ah ietrvc vufxgztni ees txqv
tfumtxecx rh pdwjxbai. Kwe qmxvehx npsii fu txqv pns ietrvc yppeieh djvzcg emtzue ees
dtpzkegc, nwec xyt dgset ih lfkegmev rpxytr ilrc mdzzcg. Wsmtrxrx xs cittshein sxrtt twijt dgsets
bep qe djktn sicxvtvzcg ilzcgh (pzze usfs ach stvtvrveh) xypt civs td fv zeex ddsipp jpgmxwt pru
coi hvaikiitd qc r eagetwuii fg sdqvihxrx.

Hints:
1. It’s written in English
2. All Punctuation is unchanged
3. All upper case characters in plaintext is kept in upper case in ciphertext; all lower case
characters in plaintext is kept in lower case in ciphertext
4. The length of key is in the range of 2 to 6.

You might also like