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
Machinery that is a key part of the process and without which the plant or process cannot function is classifed as: (clo4) a)-critical machinery b)-essential machinery c)-general purpose machinery d)-none of the specified options.
Answers: 1
question
Engineering, 04.07.2019 18:20
Agas mixture consists of 8 kmol of h2 and 2 kmol of n2. determine the mass of each gas and the apparent gas constant of the mixture.
Answers: 3
question
Engineering, 04.07.2019 19:10
A)-explain briefly the importance of standards in engineering design. b)- what is patent? c)-explain the relationship between these standards: b.s. and b.s.en d)- in engineering design concepts, types of loads and how they act are important factors. explain.
Answers: 3
question
Engineering, 04.07.2019 19:10
Agas is compressed from vi 0.3 m, p 1 bar to of v2 0.1 m3, p2--3 bar. pressure and volume are related linearly during the process. for the gas, find the work, in kj.
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
Mathematics, 08.04.2020 00:17
question
Mathematics, 08.04.2020 00:18
Questions on the website: 13722363