subject
Engineering, 04.09.2019 17:10 gugu1004

Introduction
the vigenère cipher is a method of encrypting alphabetic text by using a series of different caesar ciphers based on the letters of a keyword. it is a simple form of polyalphabetic substitution. encryption through this method generates a file that appears to be a collection of random characters. you'll be applying what you've learned about java to write a program to determine if a text file is either in english or has been encrypted. your program will do this by computing a value called the phi-statistic.
background
the phi-statistic is a measure of how closely the frequency distribution of the individual characters in a text match that of english. in english text, the individual characters tend to occur with fairly consistent frequencies. for example, the letter 'e' is most common, followed by 't', 'a', etc. a collection of random characters will have frequencies that are all roughly the same. to compute the phi-statistic of a suspected english text requires the following: compute the number of occurrences of each character in the text. suppose that character ‘a’ occurs fa times and that there are n distinct characters. then phi = f1 (f1 - 1) + f2 (f2 - 1) + … + fn (fn - 1) for example, the text jnmsv tmkri ptdgt ieyjz rgbnl nspyb has a phi-statistic equal to 30 (there are 9 characters that occur twice, two that occur 3 times, and the rest occur once). one application of the phi-statistic is to automatically recognize english text. this is done by comparing the expected or average value of phi for both english text and random text with the computed value. the expected value of phi for english text is expectedenglish = 0.0661 n (n-1) where n is the number of characters in the text. for random text, it is expectedrandom = 0.0385 n (n-1) . the previous example has n=30, so we compute expectedenglish = 0.0661 * 30 * (29) = 57.507 and expectedrandom = 0.0385 * 30 * (29) = 33.495 . thus, since the computed value of 30 is closer to 33.495 than to 57.507, we conclude that the text is most likely a random collection of characters (which, in fact, it
objective
compute the phi-statistic for a text file and determine whether it is probably english or a vigenère cipher..
processing
compute the phi-statistic corresponding to all the text contained in the lines of input. for this computation, you should ignore all non-alphabetic characters, and process each letter as its upper-case equivalent, i. e., treat 'a' and 'a' as the same character. also, compute the expected values of phi for english and random text of the same length as the input, counting only the alphabetic characters.

ansver
Answers: 3

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Asingle-geared blanking press has a stroke of 200 mm and a rated capacity of 320 kn. a cam driven ram is assumed to be capable of delivering the full press load at constant force during the last 15 percent of a constant-velocity stroke. the camshaft has an average speed of 90 rev/min and is geared to the flywheel shaft at a 6: 1 ratio. the total work done is to include an allowance of 16 percent for friction a) estimate the maximum energy fluctuation b) find the rim weight for an effective diameter of 1.2 m and a coefficient of speed fluctuation of 0.10
Answers: 1
question
Engineering, 04.07.2019 18:20
Vibration monitoring this technique uses the noise or vibration created by mechanical equipment and in seme cases by plant systems to detemine their actual condtion. a)- true b)- false
Answers: 2
question
Engineering, 04.07.2019 18:20
Inspection for bearing condition will include: (clo4) a)-color b)-smell c)-size d)-none of the above
Answers: 1
question
Engineering, 04.07.2019 18:20
Steam enters a converging nozzle at 3.0 mpa and 500°c with a at 1.8 mpa. for a nozzle exit area of 32 cm2, determine the exit velocity, mass flow rate, and exit mach number if the nozzle: negligible velocity, and it exits (a) is isentropic (b) has an efficiency of 94 percent
Answers: 2
You know the right answer?
Introduction
the vigenère cipher is a method of encrypting alphabetic text by using a series o...
Questions
question
English, 17.09.2020 06:01
question
Biology, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01
question
Business, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01
question
English, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01
question
Physics, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01
question
Physics, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01
question
Mathematics, 17.09.2020 06:01