Please write in C++ :) In this task, we are wanting to automate the process of decrypting a string using the Vigenere c
Posted: Tue Jul 05, 2022 10:27 am
Please write in C++ :)In this task, we are wanting to automate the process of decryptinga string using the Vigenere cipher. That is, thiscode will figure out the key used to encrypt some text. In the mainbody, prompt the user for a ciphertext string encoded by theVigenere cipher with some key (possibly unknown). Then prompt theuser for a substring that we know has to be in the plaintext and amaximum size of the key (from 1 to 10 let us say). Your code shouldthen brute-force the Vigenere cipher by decrypting the text using apossible key and then examining the possible plaintext for thesubstring. If the substring is in the possible plaintext, your codeshould print it out as a possible result, along with the key found,and then prompt the user if they would like to continue. You shouldalso stop at every increment of keysize and ask them if they wishto continue the brute force.For example, suppose you had some text encoded by a Vigenerecipher, “fozuakgchql”, but you did not know the key. However, youare confident this string had the word “dog” in it. Your task is toprompt 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. Thensearch that text for the string “dog”. If dog is in it, that is apossible 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 theuser asking if they would like to continue? If so, start this timewith “aa”, then “ab” and “ac”, until you get to “zz”. Keeprepeating this until the maximum as specified previously.