Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this task, we are wanting to automate the process of decrypting a string using the vigenere cipher. That is , this code will figure
In this task, we are wanting to automate the process of decrypting a string using the vigenere cipher. That is
this code will figure out the key used to encrypt some text.
In the main body, prompt the user for a ciphertext string encoded by the vigenere cipher with some key
possibly unknown Then prompt the user for a substring that we know has to be in the plaintext and a
maximum size of the key from to let us say Your code should then bruteforce the vigenere cipher by
decrypting the text using a possible key and then examining the possible plaintext for the substring. If the
substring is in the possible plaintext, your code should print it out as a possible result, along with the key found,
and then prompt the user if they would like to continue. You should also stop at every increment of keysize and
ask them if they wish to continue the brute force.
For example, suppose you had some text encoded by a vigenere cipher, fozuakgchql but you did not know
the key. However, you are confident this string had the word dog in it Your task is to prompt for the encoded
string and then try different possible keys. You would do this as follows:
Starting with a as a possible key, decode your ciphertext. Then search that text for the string dog If dog is
in it that is a possible success. Now this could be by chance, so show the result, the key used and prompt the
user to continue or not.
After a try b and then c and so on until z At this point, prompt the user asking if they would like to
continue? If so start this time with aa then ab and ac until you get to zz Keep repeating this until the
maximum as specified previously
In Java Please
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started