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

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 18:10, settasav9641
Abrake has a normal braking torque of 2.8 kip in and heat-dissipating cast-iron surfaces whose mass is 40 lbm. suppose a load is brought to rest in 8.0 s from an initial angular speed of 1600 rev/min using the normal braking torque; estimate the temperature rise of the heat dissipating surfaces.
Answers: 3
image
Engineering, 04.07.2019 18:10, bckyanne3
Afull journal bearing has a journal diameter of 27 mm, with a unilateral tolerance of -0.028 mm. the bushing bore has a diameter of 27.028 mm and a unilateral tolerance of 0.04 mm. the l/d ratio is 0.5. the load is 1.3 kn and the journal runs at 1200 rev/min. if the average viscosity is 50 mpa-s, find the minimum film thickness, the power loss, and the side flow for the minimum clearance assembly.
Answers: 1
image
Engineering, 04.07.2019 18:10, lerasteidl
Determine whether or not it is possible to compress air adiabatically from k to 140 kpa and 400 k. what is the entropy change during this process?
Answers: 3
image
Engineering, 04.07.2019 19:10, gabigalvis1091
What is the main objective of using reheat rankine cycle?
Answers: 3
You know the right answer?
Introduction
the vigenère cipher is a method of encrypting alphabetic text by using a series o...

Questions in other subjects: