This Java project implements the classic Caesar cipher for message encryption and decryption as part of a modular arithmetic lab. Users can encrypt plaintext messages, decrypt ciphertext when the key is known, and attempt to decrypt without the key by trying all possible shifts.
- Utilize the modulo function in Java to implement a simple cryptographic algorithm.
- Learn to read data from standard input.
- Practice encrypting and decrypting data using the Caesar cipher.
The Encode class takes a plaintext message and a numerical key from standard input and outputs the encoded message using the Caesar cipher.
- Run the
Encodeprogram. - Input the plaintext message.
- Input the numerical key for encryption.
- Receive the encoded message as output.
The Decode class takes a ciphertext message and the numerical key that was used for encryption from standard input and outputs the original plaintext message.
- Run the
Decodeprogram. - Input the ciphertext message.
- Input the numerical key used for encryption.
- Receive the decoded plaintext message as output.
The AllKeys class takes a ciphertext message from standard input and outputs all 26 possible plaintext decodings, one for each possible key in the Caesar cipher.
- Run the
AllKeysprogram. - Input the ciphertext message.
- Review all 26 possible decodings to find the one that makes sense.
Contributions to enhance functionality or improve the codebase are welcome. Please adhere to clean code practices and provide comments where necessary.