Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN C The provided file ciphertext.txt contains a message which has been encrypted using a simple substitution cipher. You are to create a program which

IN C

The provided file ciphertext.txt contains a message which has been encrypted using a simple substitution cipher. You are to create a program which can assist a cryptanalyst by providing the following functionality:

1. Compute and display the frequency analysis of the ciphertext. 2. Decrypt the ciphertext using a key provided by the analyst. 3. Guess the key of the cipher.

In order to guess the key, the following procedure should be followed:

1. Compute the frequency ordering of the letters appearing in the ciphertext, and guess a potential decryption key by mapping them to the standard English letter frequency ordering: ETAOINSHRDLCUMWFGYPBVKJXQZ. 2. Analyze the quality of your potential key by counting the number of words from the provided dic- tionary.txt file which appear in the decoded message. 3. Permute the guessed key in order to increase the number of dictionary words the decrypted text contains, until further permutations no longer improve its quality.

Your program should print out the final key that it computed as well as the resulting decoded message. Do not forget that your program must also be able to facilitate manual cryptanalysis as described above your program is not expected to reproduce the exact plaintext, but rather get close enough such that an analyst (or you, in this case) can easily determine the true key.

ciphertext.txt contains :

KEKPRLBNOLMKYBPRGPBMMLTJLJBAZIPTKVRLKPVILIVJBAZWBATVKYBWUSMLIRAKIPVGPBMTPORLIRRL KSJBNCYLIEKJBAZWBATVKYIPSBQRLKATVKPBNOLRBAIGKNVATVRWNVRQNCBQICCBQRLKARLTVTVOBTPO RBAIGKTRLIWYQBWCIWOKJBAZIPTKVCTGKOBBOCKIPYATJWBVBQRRBOKRUIJGRLKRWNVRRLKSCBVRKEKP TQRLKSVNJJKKYTPCTATRTPOOBEKWPAKPRVNWEKTCCIPJKKEKPTQRLKSVNJJKKYTPTAZWBETPORLKTWBM PTPRKWPICVKJNWTRSRLKUKVRRLKSCCUKIUCKRBVISTVMKLIEKVKJNWKYBNWVKCEKVQWBARLKPVIKDJKZ RQBWRLKZIWRVRLIRMKKTRLKWYBPRGPBMIUBNRBWJIPRRICGIUBNR

Dictionary.txt contains all possible words from the regular english dictio

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions