CMSC203 Fall 2026 Assignment #3 – Java Cryptography: Vigenere, Playfair and Caesar Ciphers Answered

$35.00

Explore Java cryptography with a downloadable ZIP file covering Vigenere, Playfair, and Caesar cipher implementations. This programming resource addresses encryption and decryption methods, ASCII character validation, string processing, keyword-based encryption, JUnit testing, pseudocode, and UML class design requirements.

Original Work ?

Download Details:

  • Name: Assignment3-alfcwu.zip
  • Type: zip
  • Size: 954.62 KB

Category: You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (1 vote)

CMSC203 Fall 2026 Assignment #3 focuses on implementing classical cryptography algorithms in Java using the Vigenere, Playfair, and Caesar ciphers. The assignment explores encryption, decryption, ASCII character validation, string manipulation, loops, arrays, and ArrayLists. Students implement the CryptoManager class, integrate its methods with a provided GUI, and perform JUnit testing.

Assignment Description

In cryptography, encryption is the process of encoding a message or information in such a way that only authorized parties can access it and those who are not authorized cannot. In an encryption scheme, the intended information or message, referred to as plaintext, is encrypted using an encryption algorithm – a cipher – generating ciphertext that can be read only if decrypted.

 

The Enigma machines were a family of portable cipher machines with rotor scramblers that became Nazi Germany‘s principal crypto-system. It was broken by the Polish General Staff’s Cipher Bureau in December 1932, with the aid of French-supplied intelligence material obtained from a German spy.

Enigma machine used by Nazi Germany

during World War II

Assignment Description

 

 

 

 

 

 

Write a Java program to encrypt and decrypt a phrase using three approaches, each insecure by modern standards.

The first approach is called the Vigenere Cipher. Vigenere encryption is a method of encrypting alphabetic text based on the letters of a keyword.

The second approach is Playfair Cipher. It encrypts two letters (a digraph) at a time instead of just one.

The third approach is Caesar Cipher which is a simple substitution cipher.

 

Concepts covered by this assignment

 

 

 

 

 

  • Using loops
  • String and character processing
  • ASCII codes
  • Array
  • ArrayList

 

Classes

 

 

 

Data Manager class – CryptoManager

  • Implement each of the methods specified in this file. This version as provided will print error messages in the console, because they are just skeletons.

Each of the methods are static, so there is no need to create an instance of the Data Manager.

The methods are described below.

  • public static boolean isStringInBounds (String plainText)
  • This method determines if a string is within the allowable bounds of ASCII codes according to the LOWER_RANGE and UPPER_RANGE characters.
  • The parameter plainText is the string to be encrypted.
  • The method returns true if all characters are within the allowable bounds, false if any character is outside.
  • public static String vigenereEncryption (String plainText, String key)
  • This method encrypts a string according to the Vigenere Cipher.
  • The parameter plainText is an uppercase string to be encrypted.
  • The parameter integer key specifies the key to be used in encrypting the plaintext.
  • The method returns the encrypted string.
  • If the plainText is not in bounds, the method returns:
    • The selected string is not in bounds, Try again.
  • public static String vigenereDecryption (String encryptedText, String key)
  • This method decrypts a string according to the Vigenere Cipher.
  • This is the inverse of the vigenereEncryption method.
  • The parameter encryptedText is the encrypted string to be decrypted, and key is the integer used to encrypt the original text.
  • The method returns the original plain text string.
  • public static String playfairEncryption (String plainText, String key)
  • This method encrypts a string according to the Playfair
  • The parameter plainText is an uppercase string to be encrypted.
  • The parameter integer key specifies the key to be used in encrypting the plaintext.
  • The method returns the encrypted string.
  • If the plainText is not in bounds, the method returns:
    • The selected string is not in bounds, Try again.
  • public static String playfairDecryption (String encryptedText, String key)
  • This method decrypts a string according to the Playfair Cipher.
  • This is the inverse of the playfairEncryption method.
  • The parameter encryptedText is the encrypted string to be decrypted, and key is the integer used to encrypt the original text.
  • The method returns the original plain text string.
  • public static String caesarEncryption (String plainText, int key)
  • This method encrypts a string according to the Caesar
  • The parameter plainText is an uppercase string to be encrypted.
  • The parameter integer key specifies the key to be used in encrypting the plaintext.
  • The method returns the encrypted string.
  • If the plainText is not in bounds, the method returns:
    • The selected string is not in bounds, Try again.
  • public static String caesarDecryption (String encryptedText, int key)
  • This method decrypts a string according to the Caesar
  • This is the inverse of the caesarEncryption
  • The parameter encryptedText is the encrypted string to be decrypted, and key is the integer used to encrypt the original text.
  • The method returns the original plain text string.

Add additional methods if you wish to make your logic easier to follow.

 

GUI Driver class – FXDriver and FXMainPane

A Graphical User Interface (GUI) is provided.  Be sure that the GUI will compile and run with your methods. The GUI will not compile if your method headers in CryptoManager.java are not exactly in the format specified.  When you first run the application, your methods will all throw exceptions, which will be caught by the GUI and printed out in the console.

The GUI takes care of capitalizing your input strings.

Do not modify the GUI.

 

 

JUnit Test

Two JUnit test files have been provided; CryptoManagerGFATest and CryptoManagerTestPublic.

Once your methods are implemented, run each JUnit test.  Ensure that the JUnit tests all succeed.

You must create another JUnit test file, named CryptoManagerTestStudent to test every public method of the CryptoManager class, except setUp and tearDown methods.

You can take a look at provided CryptoManagerTestPublic and create similar test cases, however your test string values must be different.

 

Assignment Details

 

 

Since our specified range does not include lower-case letters, the GUI (provided) will change strings to upper case.  You can find the ASCII table at http://www.asciitable.com/, or many other places on the Internet.

 

Vigenere Cipher:

Vigenere Cipher is a method of encrypting alphabetic text based on the letters of a keyword. It works as below:

  • Choose a keyword (e.g., KEY).
  • Repeat the keyword to match the length of the plaintext.
  • Each letter in the plaintext is shifted by the position of the
  • corresponding letter in the keyword (A = 0, B = 1, …, Z = 25).

 

Playfair Cipher:

Playfair Cipher encrypts two letters at a time instead of just one. It works as follows:

  • A matrix (8X8 in our case) is built using a keyword
  • Plaintext is split into letter pairs (e.g., ME ET YO UR).
  • Encryption rules depend on the positions of the letters in the matrix:
    • Same row: replace each letter with the one to its right.
    • Same column: replace each with the one below.
    • Rectangle: replace each letter with the one in its own row but in the column of the other letter in the pair.

 

Caesar Cipher:

Caesar Cipher is a simple substitution cipher. It works as below:

  • Choose a number (e.g., KEY).
  • Replaces each letter in the message with “KEY” number of positions down the alphabet.
  • For example, with a shift of 3, ‘A’ would become ‘D’, ‘B’ would become ‘E’, and so on.

 

Your program will implement several methods that are specified in the file “CryptoManager.java”.  A Graphical User Interface is provided, as well as a test file, that you should use to make sure your methods work correctly.  Be sure to follow the naming exactly, as the tests will not work otherwise.

There are several features of Java that we have not yet covered in class.  Just follow the syntax specified in this document and in the file CryptoManager.java.  First, the required methods are “static”, which just means that they are available from the class even if an instance has not been created.  To call a static method, for example, “public static void myMethod();” the syntax is CryptoManager.myMethod();.  Another feature that may be useful in this project is the method charAt(i) on a string, which returns a character at position i of a string (zero-based).  So “thisString”.charAt(3); would return the char ‘s’.

 

Examples

 

 

 

 

 

 

 

 

 

 

 

Deliverables

 

 

 

 

 

Deliverables / Submissions and Deliverable format:

  • The Java application must compile and run correctly, otherwise the project grade will be zero.
  • The detailed grading rubric is provided in the assignment rubric excel file.
  • Your source code should contain proper indentation and documentation.
  • Documentation within a source code should include.
    • additional Comments to clarify a code, if needed
    • class description comments at the top of each program containing the course name, the project number, your name, the date, and platform/compiler that you used to develop the project, for example:

/*

* Class: CMSC203

* Instructor:

* Description: (Give a brief description for each Class)

* Due: MM/DD/YYYY

* Platform/compiler:

* I pledge that I have completed the programming  assignment independently.

*  I have not copied the code from a student or any source.

*  I have not given my code to any student.

*  Print your Name here: __________

*/

 

Design

  • Turn in pseudo-code for each of the methods specified in CryptoManager.java. Your pseudo-code should be part-way between English and java.  There is no need to spell out all the details of variable declaration, etc., but by the same token, the pseudo-code needs to have enough detail that a competent Java programmer could implement it.
  • Turn in a UML class diagram specifying the methods and fields.

 

Implementation

Note: Only submit the files that are created/modified by per requirement. DO NOT submit the files that are already provided for you.

 

The deliverables will be packaged as follows. Two compressed files in the following formats:

  • zip, a compressed file in the zip format, with the following:
  • src folder:
    • java
    • java
    • Word document that includes (use provided template):
      1. Pseudocode for each of the methods specified in CryptoManager.java.
      2. UML Class Diagram
      3. Test Plan
      4. Screenshots:
        1. Screen snapshots of outputs from Eclipse based on your Test Plan
        2. Screen snapshots of Junit Tests with extended methods’ tests
        3. Screen shot of src folder files in your GitHub
      5. Lessons Learned: Provide answers to the questions listed below:
        1. Write about your Learning Experience, highlighting your lessons learned and learning experience from working on this project.
        2. What have you learned?
        3. What did you struggle with?

 

 

  • FirstInitialLastNamezip, a compressed file containing one or more Java files (This folder SHOULD NOT contain any folders and it SHOULD contain Java source file only that are created/modified by you per requirement.)
  • java
  • java

Solution Overview

The solution covers the implementation of CryptoManager static methods for ASCII bounds validation, Vigenere encryption and decryption, 8×8 Playfair cipher processing, and Caesar cipher operations. It also addresses student-developed JUnit tests, pseudocode, UML class design, and test planning.