A robust, modern Java-based library implementing well-known classical ciphers with a focus on clean architecture and best practices.
The library provides implementations for the following ciphers:
- Substitution Cipher: Monoalphabetic character replacement.
- Permutation Cipher: Block-based character transposition.
- Transposition Cipher: Columnar transposition.
- Affine Cipher: Mathematical substitution using modular arithmetic.
- Vigenere Cipher: Polyalphabetic substitution using a keyword.
- JDK 21 or higher
- Gradle (optional,
gradlewwrapper included)
./gradlew buildThe library includes a demonstration in the Library class:
./gradlew run./gradlew testimport org.example.cipher.VigenereCipher;
import org.example.cipher.Cipher;
public class Example {
public static void main(String[] args) {
Cipher vigenere = new VigenereCipher("KEYWORD");
String ciphertext = vigenere.encrypt("Hello World");
String plaintext = vigenere.decrypt(ciphertext);
}
}