Question: Cracking a Shift Cipher in C code using the provided Method Write a C program for cracking a shift cipher using Method three in the

Cracking a Shift Cipher in C code using the provided Method

Write a C program for cracking a shift cipher using Method three in the lecture notes ( Method 3 is in Upload Files).

Questions: a) Does your program yield the correct result? Give the main reason if it does not. b) At Step 2 in Method 3 (Page 15-16, Lecture notes), why does Ai have to shift to the left? Why does it have to be circular shift? c) At Step 3 in Method 3, why does it require to be divided by the total number of ciphertext letters? What happen if no division is performed? d) For a given piece of plaintext, it is not unusual that it does not contain any Q or Z. Does this affect the chance of success for this method? Why?

*A result page should include the assigned ciphertext, the decryption key, and the plaintext. Letter count and a list of inner product values should be also included. An example result page will be uploaded as well.

Cracking a Shift Cipher in C code using the provided Method Write

a C program for cracking a shift cipher using Method three in

Example Result page:

The given ciphertext =

LKSDDGNWJOZWFALKTWZAFVMKLZWFVAKUJWWLDQEHGAJGLLMJFWVSOSQZWOGFVWJWVZWOGMDVZSJVDQZSNWJWUGYFAKWVLZWUGGDWXXAUAWFLNGAUWGXEAKKVWTWFZSEUMJAGMKZWKSAVLGZAEKWDXLZWFWPLVSQZWOGFVWJWVOZWLZWJHWJZSHKLZWQZSVIMSJJWDDWVLZWQKHGCWDALLDWLGWSUZGLZWJLZWYAJDZWLZGMYZLDGGCWVSFPAGMKLZWJWOWJWVSJCUAJUDWKMFVWJZWJWQWKALOSKSTGMLZSDXHSKLLOGAFLZWSXLWJFGGFOZWFLZWLJSAFUSEWLGSZSDLZWSVKOWJWHGCWVGMLGXOAFVGOKSDALLDWCFGLGXEWFOWJWUDMKLWJWVTQLZWKAVWGXLZWDAFWDGGCAFYSFVHGAFLAFYSLKGEWLZAFYMFVWJLZWVAFAFYUSJHGAJGLDWSFWVGMLSFVKHGCWLGLZWOSYGFDAL

Number of letters in the ciphertext: 500

The letter count =

#A = 31

#B = 0

#C = 7

#D = 23

#E = 7

#F = 32

#G = 42

#H = 9

#I = 1

#J = 29

#K = 23

#L = 48

#M = 14

#N = 3

#O = 15

#P = 2

#Q = 8

#R = 0

#S = 31

#T = 4

#U = 12

#V = 28

#W = 76

#X = 9

#Y = 8

#Z = 38

A list of inner products W x A[i] is

W x A[0] = 15.558540

W x A[1] = 19.014769

W x A[2] = 17.970610

W x A[3] = 15.588570

W x A[4] = 22.058081

W x A[5] = 19.117109

W x A[6] = 15.791729

W x A[7] = 19.283600

W x A[8] = 33.719940

W x A[9] = 19.814350

W x A[10] = 14.638941

W x A[11] = 17.543077

W x A[12] = 22.688768

W x A[13] = 16.179268

W x A[14] = 17.018162

W x A[15] = 19.557261

W x A[16] = 16.493910

W x A[17] = 17.305021

W x A[18] = 20.193243

W x A[19] = 22.776030

W x A[20] = 18.627439

W x A[21] = 20.435139

W x A[22] = 19.329590

W x A[23] = 23.654518

W x A[24] = 19.406801

W x A[25] = 16.380529

The max inner product W x A[8] = 33.719940, so the decryption key most likely is 8.

Attempted decryption result with the decrytion key 8:

TSALLOVERWHENITSBEHINDUSTHENDISCREETLYMPOIROTTURNEDAWAYHEWONDEREDHEWOULDHARDLYHAVERECOGNISEDTHECOOLEFFICIENTVOICEOFMISSDEBENHAMCURIOUSHESAIDTOHIMSELFTHENEXTDAYHEWONDEREDWHETHERPERHAPSTHEYHADQUARRELLEDTHEYSPOKELITTLETOEACHOTHERTHEGIRLHETHOUGHTLOOKEDANXIOUSTHEREWEREDARKCIRCLESUNDERHEREYESITWASABOUTHALFPASTTWOINTHEAFTERNOONWHENTHETRAINCAMETOAHALTHEADSWEREPOKEDOUTOFWINDOWSALITTLEKNOTOFMENWERECLUSTEREDBYTHESIDEOFTHELINELOOKINGANDPOINTINGATSOMETHINGUNDERTHEDININGCARPOIROTLEANEDOUTANDSPOKETOTHEWAGONLIT

Cracking Shift Cipher (Method Three) Method 3 (A better method for programming): 1. Write English Letter Frequencies as a vector A A-(0.08167, 0.01492, 0.02782, 0.04253, ..., 0.01974, 0.00074); Let A, denote vector A circular shifted to the left by i places. For example, A (0.01492, 0.02782, 0.04253, Count the occurrences of the letters in the ciphertext, and divided them by the total number of letters; 2. 0.01974, 0.00074, 0.08167) 3. Cracking Shift Cipher (Method Three) Method 3 (A better method for programming): 1. Write English Letter Frequencies as a vector A A-(0.08167, 0.01492, 0.02782, 0.04253, ..., 0.01974, 0.00074); Let A, denote vector A circular shifted to the left by i places. For example, A (0.01492, 0.02782, 0.04253, Count the occurrences of the letters in the ciphertext, and divided them by the total number of letters; 2. 0.01974, 0.00074, 0.08167) 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!