Question: One time - honored method for two spies to communicate is by means of a book code. Suppose you and your friend have identical copies

One time-honored method for two spies to communicate is by means of a book code. Suppose you and your friend have identical copies of the same identical book perhaps an 1853 copy of Jane Austins Emma (which is on the Guardian newspapers list of the 100 best novels in the English Language)-- and you want to send secret messages to each other. Instead of sending the words in the message, you send the page number and word offset for any given word in the message. Your friend decodes the message by looking for each word on its page. The computerized version of a book code is similar. The .txt file containing the book is read into the computer, normalized (remove everything but words and single spaces between them), and then moved into an ordered set of strings containing the words. To encode a message, you locate an occurrence of that word in the ordered set representing the book, and place that index in the encoded message. To decode a word, you use the order number in the coded message to locate the original word. Note that multiple occurrences of a word are quite likely and improve the quality of the code (why?). The multiple positions of each word should be stored with each word and randomly chosen during the encoding process. Your assignment is to implement a C# tool for encoding and decoding words using a computer book code. Use a C# WINDOWS FORM APP (not another type of windows project or it will receive a grade of 0). Unless specified otherwise, use windows for apps for all the assignments in 2263. We will be using 2.txt books from gutenberg.org, mainly The Brothers Karamazov by Fyodor Dosoyevsky (gutenberg.org/cache/epub/28054/pg28054.txt ), and Pride and Prejudice by Jane Austen (gutenberg.org/cache/epub/1342/pg1342.txt).2.(50 points) Create the Encoding Data Structure and Encode the Clear Message. Provide buttons and text boxes to allow the user to read in a text file containing the book and another text file containing the clear message (clear.txt) that are stored in the same folder as your .exe (under bin/debug or similar). Display the clear text in a textbox. Create a Dictionary> to provide a mapping between each unique word in the book and the set of units indicating the position of all the occurrences of that word in the book. occupies in the book. Note you may need something other than an int. Then write out a .txt file (and display it in a second textbox) containing the encoded message as a series of unsigned integers encoding each word in the clear text as a numeric position number of that word in the book. To encode the clear text, for each word, randomly choose one of those position numbers associated with that word. Note that every time that word is encoded, it most-likely will be encoded as a different numeric number, making the code much more difficult to crack.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!