Engineering
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.

answer
Answers: 3

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 18:10, caitlynnpatton1208
Water in a partially filled large tank is to be supplied to the roof top, which is 8 m above the water level in the tank, through a 2.2-cm-internal-diameter pipe by maintaining a constant air pressure of 300 kpa (gage) in the tank. if the head loss in the piping is 2 m of water, determine the discharge rate of the supply of water to the roof top in liters per second.
Answers: 3
image
Engineering, 04.07.2019 18:10, katelynn73
Atmospheric air has a temperature (dry bulb) of 80° f and a wet bulb temperature of 60° f when the barometric pressure is 14.696 psia. determine the specific humidity, grains/lb dry air. a. 11.4 c. 55.8 d. 22.5 b. 44.1
Answers: 1
image
Engineering, 04.07.2019 18:20, kodyclancy
Aquick transition of the operating speed of a shaft from its critical speed will whirl amplitude. (a) increase (b) limit (c) not affect (d) zero
Answers: 2
image
Engineering, 04.07.2019 18:20, safiyabrowne7594
Ahe-xe mixture containing a 0.75 mole fraction of helium is used for cooling electronics in an avionics application. at a temperature of 300 k and atmospheric pressure, calculate the mass fraction of helium and the mass density, molar concentration and molecular weight of the mixture. if the cooling capacity is 10 l, what is the mass of the coolant?
Answers: 3
Do you know the correct answer?
Introduction
the vigenère cipher is a method of encrypting alphabetic text by using a series o...

Questions in other subjects:

Konu
Biology, 17.11.2020 01:50
Konu
Spanish, 17.11.2020 01:50
Konu
Advanced Placement (AP), 17.11.2020 01:50
Konu
Computers and Technology, 17.11.2020 01:50