Question: Problem 2: (10/30 cases) In cryptograms, each character is encoded into another. The frequency of letters in text has been studied for use in cryptanalysis

Problem 2: (10/30 cases) In cryptograms, each character is encoded into another. The frequency of letters in text has been studied for use in cryptanalysis and frequency analysis in particular, dating back to the Iraqi mathematician Al-Kindi (c. 801-873 ADI, who formally developed the method (the ciphers breakable by this technique go back at least to the Caesar cipher invented by Julus Caesar, so this method could have been explored in classical times). If the text is long enough, ane can, as a strategy, use the frequency of occurrence of each character. The most frequently occurring character will likely be the code for an e, because e is the most frequently used letter of the English alphabet. Design a class Named CryptGram,java with the following requirements: Data Members: a Letter(it is provided] array named orderedFrequency to store frequency of the 26 alphabetic letters. (Letterll orderedFrequency Methods public void createletterfrequency(String text) public int getFrequencyByCharlchar letter) public String encodelString textToBeEncoded) public String decode(String textToBeDecoded) uency create the letter frequenc y from the argument passed to this method, the letter freq The method: createletterFrequency, array MUST by sorted by frequency, for example, the first three letter elements in the array may look like. d(2r(slal6L which means d appears in the file twice, r five time, instance, el9l and c(9), c[9] should be placed before el9) and a six times. If the frequencies are ties, then being ordered by alphabetic order. For The method: getFrequencyBychar r, returns the number of times the char passed as argument appears in the file The method: encode, encodes the String and returns encoded String. The text to be encoded is encrypted as follows: each character in the text will be encrypted to the character in the letter frequency array: orderedFrequency. For example, letter a or A will be encrypted to the letter of the first element in the orderedFrequency array. The letter z or Z will be encrypted to t element in the orderedFrequency array he letter of the last The method: decode, reverse the encode process and decrypt the text lignore cases) To test your program, click on the CryptGramTester.class and Run JUnit button
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
