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
Apump is used to circulate hot water in a home heating system. water enters the well-insulated pump operating at steady state at a rate of 0.42 gal/min. the inlet pressure and temperature are 14.7 lbf/in.2, and 180°f, respectively; at the exit the pressure is 60 lbf/in.2 the pump requires 1/15 hp of power input. water can be modeled as an incompressible substance with constant density of 60.58 lb/ft3 and constant specific heat of 1 btu/lb or. neglecting kinetic and potential energy effects, determine the temperature change, in °r, as the water flows through the pump.
Answers: 1
question
Engineering, 04.07.2019 18:20
Most leaks in reciprocating air compressors can be detected and minimized by: (clo4) a)-detecting leakage areas using ultrasonic acoustic detector. b)-tightening joints and connections c)-replacing faulty equipment d)-all of the given options
Answers: 2
question
Engineering, 04.07.2019 18:20
For a gate width of 2 m into the paper, determine the force required to hold the gate abc at its location.
Answers: 1
question
Engineering, 04.07.2019 18:20
For each of the following process: a) sketch the p-v diagram, b)sketch t-s diagram, c) sketch t-v diagram, d) sketch the boundary work on one of the diagrams (a, b or c) and e) sketch the reversible heat transfer on one of the diagrams (a, b or c): 1- isobaric process from compressed liquid to superheated vapor 2- isothermal process from compressed liquid to superheated vapor 3- isentropic process from compressed liquid to superheated vapor
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
question
Mathematics, 05.05.2020 23:33
Questions on the website: 13722362