Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please do answer this. I need your help! Thank you so much!!! It could be written in any programming language. In mini-project 1, you are

Please do answer this. I need your help! Thank you so much!!! It could be written in any programming language.image text in transcribed

image text in transcribed

In mini-project 1, you are first asked to implement a simple Vigenere Cipher. The plaintext/ciphertext should only contain letters, you do not need to check the validity of the input (that is, we assume that the input is always valid). Spaces in the plaintext should be removed. The algorithm for encryption is: Ek(m) = m + K mod 26 The algorithm for decryption is: Ek(m) = m - K mod 26 Your input/output should be text strings, with both uppercase and lowercase letters. The same letter in upper and lower cases are treated as the same. That is, both "A" and "a" must be converted to "1" (or "o") in your program. Next, you are expected to implement a brute force password cracker based on the Vigenere Cipher you just implemented. 1. Your password cracker is expected to take three parameters: (1) a string of ciphertext; (2) an integer keyLength that denotes the length of the key; and (3) an integer first WordLength that denotes the length of the first word of the plaintext. 2. Your password cracker will test every possible key that has the length of keyLength: from all "A"s to all "Z"s. You cannot exploit the dictionary to guess the key, since the key may not be a valid word. 3. For each key candidate, you will generate a "plaintext", and compare it with the dictionary. In particular, you only need to check if the first word (number of letters of the word is given in firstWordLength) is a valid word in the dictionary. To do this, you need to load the dictionary into memory before processing any key, and search if the first word of the "plaintext" is in the dictionary. If Yes, display the plaintext and the key. However, do not stop, as the "plaintext" might be wrong. 4. Efficiency is very important in evaluating each "plaintext" candidate. 5. In some cases, a wrong key may generate a valid first word. Hence, you may get several "plaintexts" after all possible keys are tested. This is acceptable. You can look at the outputs and determine which key is correct. Use the brute force password cracker for the Vigenere Cipher you implemented in Project 2 to decrypt the following messages: 1. "MSOKKJCOSXOEEKDTOSLGFWCMCHSUSGX"; key length - 2; firstWordLength - 6 OOPCULNWFRCFQAQJGPNARMEYUODYOUNRGWORQEPVARCEPBBSCEQYEARAJUYGWWYACYWBPRNEJBMDTEAEYCCFJNENSGWAQR TSJTGXNRQRMDGFEEPHSJRGFCFMACCB" keyLength=3; firstWordLength = 7 3. "MTZHZEOQKASVBDOWMWMKMNYIIHVWPEXJA keyLength=4; firstWordLength = 10 4. 'HUETNMIXVTMQWZTQMMZUNZXNSSBLNSJVSJQDLKR" keyLength-5; firstWordLength - 11 5. "LDWMEKPOPSWNOAVBIDHIPCEWAETYRVOAUPSINOVDIEDHCDSELHCCPVHRPOHZUSERSFS" keyLength=6; firstWordLength = 9 6. 'WWLZWWPBWHZDKBTXLDCGOTGTGRWAQWZSDHEMXLBELUMO" keyLength7; firstWordLength = 13 When key length increases, cracking becomes slow. Please optimize your code, and at least finish the first 5. Please record the time needed to decrypt each message. Please submit your code and a short report. The report shall demonstrate the plaintexts that you discovered. The report shall also discuss the performance (efficiency) of password cracking. In mini-project 1, you are first asked to implement a simple Vigenere Cipher. The plaintext/ciphertext should only contain letters, you do not need to check the validity of the input (that is, we assume that the input is always valid). Spaces in the plaintext should be removed. The algorithm for encryption is: Ek(m) = m + K mod 26 The algorithm for decryption is: Ek(m) = m - K mod 26 Your input/output should be text strings, with both uppercase and lowercase letters. The same letter in upper and lower cases are treated as the same. That is, both "A" and "a" must be converted to "1" (or "o") in your program. Next, you are expected to implement a brute force password cracker based on the Vigenere Cipher you just implemented. 1. Your password cracker is expected to take three parameters: (1) a string of ciphertext; (2) an integer keyLength that denotes the length of the key; and (3) an integer first WordLength that denotes the length of the first word of the plaintext. 2. Your password cracker will test every possible key that has the length of keyLength: from all "A"s to all "Z"s. You cannot exploit the dictionary to guess the key, since the key may not be a valid word. 3. For each key candidate, you will generate a "plaintext", and compare it with the dictionary. In particular, you only need to check if the first word (number of letters of the word is given in firstWordLength) is a valid word in the dictionary. To do this, you need to load the dictionary into memory before processing any key, and search if the first word of the "plaintext" is in the dictionary. If Yes, display the plaintext and the key. However, do not stop, as the "plaintext" might be wrong. 4. Efficiency is very important in evaluating each "plaintext" candidate. 5. In some cases, a wrong key may generate a valid first word. Hence, you may get several "plaintexts" after all possible keys are tested. This is acceptable. You can look at the outputs and determine which key is correct. Use the brute force password cracker for the Vigenere Cipher you implemented in Project 2 to decrypt the following messages: 1. "MSOKKJCOSXOEEKDTOSLGFWCMCHSUSGX"; key length - 2; firstWordLength - 6 OOPCULNWFRCFQAQJGPNARMEYUODYOUNRGWORQEPVARCEPBBSCEQYEARAJUYGWWYACYWBPRNEJBMDTEAEYCCFJNENSGWAQR TSJTGXNRQRMDGFEEPHSJRGFCFMACCB" keyLength=3; firstWordLength = 7 3. "MTZHZEOQKASVBDOWMWMKMNYIIHVWPEXJA keyLength=4; firstWordLength = 10 4. 'HUETNMIXVTMQWZTQMMZUNZXNSSBLNSJVSJQDLKR" keyLength-5; firstWordLength - 11 5. "LDWMEKPOPSWNOAVBIDHIPCEWAETYRVOAUPSINOVDIEDHCDSELHCCPVHRPOHZUSERSFS" keyLength=6; firstWordLength = 9 6. 'WWLZWWPBWHZDKBTXLDCGOTGTGRWAQWZSDHEMXLBELUMO" keyLength7; firstWordLength = 13 When key length increases, cracking becomes slow. Please optimize your code, and at least finish the first 5. Please record the time needed to decrypt each message. Please submit your code and a short report. The report shall demonstrate the plaintexts that you discovered. The report shall also discuss the performance (efficiency) of password cracking

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

Database Processing

Authors: David Kroenke

11th Edition

0132302675, 9780132302678

More Books

Students also viewed these Databases questions

Question

=+What kinds of problems need to be overcome?

Answered: 1 week ago