CS152 Principles of Computer Science II – Spring 2022 Project 1 – Polymorphic Cryptography 40 points Due: Feb. 4 For this project, you will augment the cryptography code we wrote in class in two...

I need help to create a playfair and a grille cipher


CS152 Principles of Computer Science II – Spring 2022 Project 1 – Polymorphic Cryptography 40 points Due: Feb. 4 For this project, you will augment the cryptography code we wrote in class in two important ways: 1. You will now allow a main driver program that allows the user to specify a series of crypto- graphic schemes and then either encrypt or decrypt inputted text. 2. Add two new cryptographic schemes: a PlayfairCode and a GrilleCoder. These will be described on a separate Encryption Methods sheet. Cryptographic Class Hierarchy : The four different encryption methods used in this project form the following hierarchy: KeyCoder ArrayCoder GrilleCoder Coder SubstitutionCoder PlayfairCoder ��� ��� �� HHH HHH HH ������������ PPPPPPPPPPPP Driver Program : Your driver program will have two main components. The first component will get input from the user which specifies: 1. the series of encryption schemes to use to encrypt/decrypt (and any other necessary information for each scheme such as a key). 2. whether or not to encryt or decrypt. You should allow the user to specify up to 10 ciphers. For example, the user might first choose to use array encryption, following by a substitution encryption using the key "Westminster", followed by another array encryption, and ending with a grille encryption. The second component of the driver program will them perform the encryption/decryption. Read in a single line of text, pass it through whatever series of ciphers the user specified, and then output the final result. Playfair and Grille coder code Note: You may want to read the Encryption Methods sheet before reading the following: 1. For the PlayfairCode you will only need to provide two constructors (as in the code we wrote for the SubstitutionCoder) and encrypt and decrypt methods. (over) 2. For the GridCoder we will represent grilles as a 2-dimensional boolean array, where true values represent hole squares and false values represent covered squares. In the example used in the Encryption Methods sheet, the first row of this array would be {false, true, false, false, false, true}. 3. You should create two constructors for your GrilleCoder class – a zero-argument con- structor and one that takes a grille as an argument. You should also provide a getter and setter for the grille as well (and of course encrypt am decrypt methods). 4. Care must be taken when designing a grille since you must ensure every square in the grid is exposed exactly once. We can discuss this in class if necessary. 5. I’ll let you figure out the decryption process for both of these methods.
Feb 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here