CipherForge is a modular encryption and decryption platform built in Java using JavaFX. It demonstrates strong object-oriented design principles, a clean separation of concerns and an extensible architecture for implementing multiple encryption algorithms.
CipherForge is designed as a pluggable encryption framework that allows users to encrypt and decrypt text and files using different algorithms through a graphical interface.
The project focuses on:
- Object-Oriented Programming principles
- Strategy Design Pattern
- Modular and scalable architecture
- Separation of UI and business logic
- Desktop application development using JavaFX
| Feature | Status |
|---|---|
EncryptionStrategy interface |
✅ Done |
CaesarStrategy |
✅ Done |
AESStrategy (CBC mode) |
✅ Done |
FileEncryptionUtil |
✅ Done |
EncryptionContext |
✅ Done |
FileHandler |
✅ Done |
EncryptionException |
✅ Done |
InvalidKeyException |
✅ Done |
| JavaFX UI (FXML + CSS) | ✅ Done |
MainApp entry point |
✅ Done |
| UML Diagrams | ✅ Done |
MainApp.java
│
ConsoleUI.java
│
EncryptionContext.java
│
┌─────────────┴─────────────┐
│ │
AESStrategy CaesarStrategy
│
FileEncryptionUtil
│
EncryptionStrategy
(interface)
│
┌──────────────┴──────────────┐
│ │
EncryptionException InvalidKeyException
| Concept | Where |
|---|---|
| Encapsulation | Private fields with controlled access throughout |
| Abstraction | EncryptionStrategy interface |
| Inheritance | AESStrategy, CaesarStrategy implement interface |
| Polymorphism | encrypt(), decrypt() behave differently per class |
| Composition | EncryptionContext has-a EncryptionStrategy |
| Method Overriding | Each strategy overrides interface methods |
| Exception Handling | EncryptionException, InvalidKeyException |
| Packages | Modular structure across crypto, context, util |
| Design Pattern | Strategy Pattern |
src/
├── crypto/
│ ├── EncryptionStrategy.java ← Strategy interface
│ ├── CaesarStrategy.java ← Caesar Cipher
│ ├── AESStrategy.java ← AES-128 CBC
│ └── FileEncryptionUtil.java ← File encryption via AES
├── context/
│ └── EncryptionContext.java ← Strategy selector
├── util/
│ └── FileHandler.java ← File read/write
├── exceptions/
│ ├── EncryptionException.java
│ └── InvalidKeyException.java
├── ui/
│ ├── fxml/ ← Layout files
│ ├── css/ ← Styling
│ └── controllers/ ← UI controllers
└── MainApp.java ← Entry point
Shifts each character by a numeric key value.
Input : "HELLO", key = 3
Output : "KHOOR"
Simple substitution cipher used for testing system flow.
Industry-standard symmetric block cipher using Java Cryptography API.
| Property | Value |
|---|---|
| Mode | CBC (Cipher Block Chaining) |
| Key | Any string → SHA-256 → 16 bytes |
| IV | Random 16 bytes per encryption |
| Output | Base64 encoded string |
| Block Size | 16 bytes |
| Rounds | 10 |
Encrypts any file type using AES internally.
| Operation | Flow |
|---|---|
| Encrypt | file bytes → Base64 → AES encrypt → .encrypted |
| Decrypt | .encrypted → AES decrypt → Base64 → original file |
| Decision | Reason |
|---|---|
| CBC mode instead of ECB | ECB leaks patterns - identical blocks produce identical ciphertext. CBC chains each block to the previous output. |
| SHA-256 key derivation | AES needs exactly 16 bytes. SHA-256 converts any password to a fixed output. Zero-padding is guessable. |
| SecureRandom for IV | Regular Random is predictable if seed is known. SecureRandom uses hardware entropy, truly unpredictable. |
| IV prepended to output | Decryptor needs same IV. Stored as first 16 bytes of output. |
| Base64 encoding | Raw bytes corrupt in String form. Base64 is safe and printable. |
| Error | Handled By |
|---|---|
| Invalid key format | InvalidKeyException |
| Null strategy | EncryptionException |
| File read/write errors | FileHandler + exceptions |
| AES key length issues | buildKey() via SHA-256 |
User Input → MainApp → EncryptionContext → Strategy → Output
- User selects algorithm (AES / Caesar)
- User provides input data and key
- Context sets the chosen strategy
- Strategy performs encryption or decryption
- Result is displayed to the user
🚧 Full setup instructions will be added once the project compiles end-to-end.
Requirements: JDK 17+, JavaFX SDK. No external dependencies.
# Clone the repository
git clone https://github.com/tanushrijadhav/encryption-decryption-oopd-java.git
cd encryption-decryption-oopd-java
# Run the batch file
run.bat
| Member | Responsibility | Modules |
|---|---|---|
| Tanushri Jadhav | Crypto logic - Caesar, AES, interface | crypto/ |
| Tanushka Gulhane | Context, File Handling, Exceptions | context/, util/, exceptions/ |
| Advait Gajewar | MainApp, UI, Integration | ui/, MainApp.java |
- Practical implementation of OOP concepts
- Understanding of the Strategy Design Pattern
- Hands-on experience with Java Cryptography API
- Modular software design
- Team collaboration using GitHub
This project is for educational and demonstration purposes.
OOPD Mini Project