View the step-by-step solution to:

COP2271 MATLAB Spring 2016 Assignment 5 Due: February 26 (Friday) at 11:59 pm Polybius Square Cipher Decryption Implement a decryption cipher to...

Decipher the text using the secret table provided in the attached file.

Secret text :

336163 6432651163236455226316
22456564451641 616632633134
616632633141 2461253334
22456564451641 24616311634616 5631 1645426311 1645643334
616632633141 2461253334
22456564451641 2461631163 6416 5631 1645426311 1645643334
616632633141 6452 456152 424533 6433 2524253151

COP2271 MATLAB Spring 2016 Assignment 5 Due: February 26 (Friday) at 11:59 pm Polybius Square Cipher Decryption Implement a decryption cipher to decode messages from text files. Key programming concepts: if statements, loops, strings, file input Approximate lines of code: 30 (does not include comments or white space) Program Inputs and Outputs Display to the user the following information/questions: Enter file to decrypt: The user will always enter a file that exists and needs to be decrypted and your program must display the answer as: Decrypted message: XXX where XXX is the decrypted message for every line in the chosen file Assignment Details: This assignment will give you a brief introduction into cryptography using the Polybius Square Cipher! Cryptography allows us to encode and decode messages that are difficult to decipher without knowledge of a secret key/table/code. Cryptography is a rich subject in its own right, but we will not have time to cover it in detail. Please check out the numerous online resources if you want more information. This particular cipher depends upon the following secret table, which has the 26 letters from the alphabet along with 10 common punctuation marks, randomly arranged in a 6 by 6 grid: 1 2 3 4 5 6 1 R ) V J ; S 2 K L D W A Q 3 Y N T ? G 4 : P ( X U 5 . , ! Z B M 6 H F E I C O The main idea is to replace letters in your secret message with the corresponding row and column number from the table. The encrypted message will then have two numbers that represent a single letter. For example, lets encrypt the following message: ATTACK AT DAWN 1
Background image of page 1
COP2271 MATLAB Spring 2016 Assignment 5 Due: February 26 (Friday) at 11:59 pm Letter Corresponding Number A 25 T 33 C 65 K 21 D 23 W 24 N 32 The individual letters from the message correspond to the following numbers: Putting these numbers together, gives us the following encoded message: 253333256521 2533 23252432 To decode the message, you just do the reverse process! Given two numbers, use the first number as the row and the second as the column in the polybius grid to find the corresponding letter. Sample Output The following test cases do not cover all possible scenarios ( develop your own! ) but should indicate if your code is on the right track. Canvas has three file for you to test: Decrypt 1.txt , Decrypt 2.txt , and Decrypt 3.txt . Each file contains a famous movie quote that needs de- crypting! Test Case 1: Enter file to decrypt: Decrypt_1.txt Decrypted message: THE INCREDIBLES LUCIUS: HONEY? HONEY: WHAT? LUCIUS: WHERE’S MY SUPER SUIT? HONEY: WHAT? LUCIUS: WHERE IS MY SUPER SUIT? HONEY: I, UH, PUT IT AWAY. Test Case 2: Enter file to decrypt: Decrypt_2.txt Decrypted message: INDEPENDENCE DAY AND SHOULD WE WIN THE DAY, THE FOURTH OF JULY WILL NO LONGER BE KNOWN AS AN AMERICAN HOLIDAY, BUT AS THE DAY THE WORLD DECLARED IN ONE VOICE: "WE WILL NOT GO QUIETLY INTO THE NIGHT!" WE WILL NOT VANISH WITHOUT A FIGHT! WE’RE GOING TO LIVE ON! WE’RE GOING TO SURVIVE! TODAY WE CELEBRATE OUR INDEPENDENCE DAY! 2
Background image of page 2
Show entire document
Sign up to view the entire interaction

Top Answer

You are very welcome. Actually, I'm much better at Python, but I can do matlab. Your... View the full answer


% -------------------------------------------------------------------Polybius Square Cipher Decryption

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.


Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask a homework question - tutors are online