Answered step by step
Verified Expert Solution
Link Copied!

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 1 to 10 let us say). Your code should then brute-force 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

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

Step: 3

blur-text-image

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

Ai And The Lottery Defying Odds With Intelligent Prediction

Authors: Gary Covella Ph D

1st Edition

B0CND1ZB98, 979-8223302568

More Books

Students also viewed these Databases questions

Question

Explain the steps involved in training programmes.

Answered: 1 week ago

Question

What are the need and importance of training ?

Answered: 1 week ago

Question

What is job rotation ?

Answered: 1 week ago