A secure Java desktop application for encrypting and decrypting text and files using modern cryptographic standards.
The Encryption & Decryption Tool is a desktop application developed in Java Swing that enables users to securely encrypt and decrypt both text and binary files using password-based encryption.
Unlike many academic encryption projects that only support text files, this application is designed to work with virtually any file type including:
- DOCX
- ZIP
- PNG
- JPG
- EXE
- MP4
- MP3
- TXT
- and many more.
The project combines a user-friendly graphical interface with modern cryptographic techniques such as AES-256 GCM, PBKDF2, and SHA-256 to provide confidentiality, authentication, and integrity verification.
- Encrypt plain text
- Decrypt encrypted text
- Password-based encryption
- AES-GCM authenticated encryption
- Base64 encoded encrypted output
Supports encryption and decryption of almost every file type:
- π PDF
- πΌ JPG
- πΌ PNG
- π¦ ZIP
- π DOCX
- π΅ MP3
- π¬ MP4
- β EXE
- π TXT
- Any binary file
- AES-256 GCM Encryption
- PBKDF2 Password Key Derivation
- 120000 PBKDF2 Iterations
- Random Salt Generation
- Random Initialization Vector (IV)
- SHA-256 Integrity Verification
- Authentication Failure Detection
- Password-Based Encryption
- Binary-Safe Encryption
- Secure Encrypted File Container
- Java Swing Interface
- Input Text Area
- Output Text Area
- Password Field
- Encrypt Text Button
- Decrypt Text Button
- Encrypt File Button
- Decrypt File Button
- Copy Output Button
- Clear Button
- Status Bar
- File Chooser Integration
Replace these screenshots with your latest screenshots if necessary.
+--------------------+
| Java Swing GUI |
+---------+----------+
|
|
βΌ
EncryptionFrame.java
|
|
βΌ
FileEncryptionService.java
|
|
βΌ
CryptoUtils.java
|
+-------------------+------------------+
| |
βΌ βΌ
AES-256 GCM PBKDF2 Key Derivation
Encryption SHA-256 Integrity
encryption-decryption-tool-java-gui
β
βββ screenshots/
β βββ phase7.png
β βββ imagenc.png
β βββ pdfenc.png
β βββ zip.png
β
βββ sample_files/
β βββ test.txt
β βββ test.txt.enc
β βββ test.txt.enc.dec
β
βββ src/
β β
β βββ crypto/
β β βββ CryptoUtils.java
β β βββ CryptoException.java
β β βββ DecryptedData.java (if separated)
β β
β βββ service/
β β βββ FileEncryptionService.java
β β
β βββ gui/
β β βββ EncryptionFrame.java
β β
β βββ main/
β β βββ Main.java
β β βββ CryptoTest.java
β β
β βββ utils/
β βββ (Optional logging utilities)
β
βββ README.md
βββ LICENSE
| Category | Technology |
|---|---|
| Language | Java |
| GUI | Java Swing |
| Encryption | AES-256 GCM |
| Key Derivation | PBKDF2WithHmacSHA256 |
| Integrity | SHA-256 |
| Randomness | SecureRandom |
| Build Tool | javac |
| IDE | VS Code / IntelliJ IDEA |
| Platform | Windows / Linux / macOS |
AES (Advanced Encryption Standard) is one of the world's most trusted symmetric encryption algorithms.
This project uses:
- AES-256
- GCM Mode
- NoPadding
AES-GCM provides:
- Confidentiality
- Authentication
- Integrity Protection
Instead of directly using the password as an encryption key, this project derives a secure key using:
- PBKDF2WithHmacSHA256
- 120000 iterations
- Random 16-byte salt
- 256-bit key generation
This significantly improves resistance against brute-force and dictionary attacks.
SHA-256 is used to verify file integrity after decryption.
The application detects:
- File tampering
- Data corruption
- Authentication failures
- Wrong passwords
- Modern AES-GCM authenticated encryption
- Binary-safe encryption for any file type
- Password-based key derivation with PBKDF2
- SHA-256 integrity verification
- User-friendly Java Swing desktop interface
- Clean modular project structure
- Suitable for educational and portfolio purposes
Before running the project, ensure the following software is installed:
- Java JDK 17 or later
- Git
- VS Code / IntelliJ IDEA (Recommended)
Verify Java installation:
java -version
javac -versiongit clone https://github.com/vyawaha/encryption-decryption-tool-java-gui.gitMove into the project directory:
cd encryption-decryption-tool-java-guiOpen Terminal / PowerShell inside the src directory.
cd src
javac crypto/*.java service/*.java gui/*.java main/*.javajava main.MainThe Java Swing GUI will launch.
- Launch the application.
- Enter plain text into the Input Text area.
- Enter a password.
- Click Encrypt Text.
- The encrypted output is displayed in the Output Text area.
- Paste encrypted text into the Input Text area.
- Enter the same password used during encryption.
- Click Decrypt Text.
- The original text appears in the Output Text area.
- Click Encrypt File.
- Select any supported file.
- Enter a password.
- The encrypted file is saved with:
filename.ext.enc
Example:
report.pdf
becomes
report.pdf.enc
- Click Decrypt File.
- Select the encrypted file.
Example:
report.pdf.enc
- Enter the correct password.
- The decrypted file is restored.
The application supports virtually every binary and text file format.
| Category | Examples |
|---|---|
| Documents | PDF, DOC, DOCX, TXT |
| Images | PNG, JPG, JPEG, BMP |
| Archives | ZIP, RAR (as binary data) |
| Audio | MP3, WAV |
| Video | MP4, AVI |
| Executables | EXE |
| Source Code | Java, Python, C, C++, HTML |
| Others | Any binary file |
User Input
β
βΌ
Password
β
βΌ
PBKDF2 Key Derivation
β
βΌ
AES-256 GCM Encryption
β
βΌ
Encrypted Container
β
βΌ
Save .enc File
Encrypted File
β
βΌ
Read Container
β
βΌ
Verify Header
β
βΌ
Generate AES Key
β
βΌ
AES-GCM Authentication
β
βΌ
SHA-256 Integrity Check
β
βΌ
Restore Original File
Each encrypted file stores the following information:
+------------------------------------------------------+
| MAGIC HEADER |
+------------------------------------------------------+
| VERSION |
+------------------------------------------------------+
| ORIGINAL FILE NAME |
+------------------------------------------------------+
| ORIGINAL FILE SIZE |
+------------------------------------------------------+
| SHA-256 HASH |
+------------------------------------------------------+
| RANDOM SALT |
+------------------------------------------------------+
| RANDOM IV |
+------------------------------------------------------+
| AES-GCM ENCRYPTED DATA |
+------------------------------------------------------+
This design allows the application to validate encrypted files before decryption and detect corruption or incorrect passwords.
Input:
Hello Encryption Tool
Password:
password123
Output:
RU5DUg...
Input:
photo.jpg
Output:
photo.jpg.enc
Input:
document.pdf
Output:
document.pdf.enc
Input:
archive.zip
Output:
archive.zip.enc
Attempting to decrypt with an incorrect password results in an authentication failure, preventing unauthorized access to the original data.
| Phase | Status |
|---|---|
| Project Setup | β |
| Java Swing GUI | β |
| AES Encryption Module | β |
| GUI Integration | β |
| File Encryption | β |
| Binary Safe Encryption | β |
| Secure File Workflow | β |
| Secure Encryption Container | β |
This project was built with the following objectives:
- Modular architecture
- Separation of GUI and cryptographic logic
- Reusable encryption utilities
- Binary-safe file processing
- Password-based security
- Clean and maintainable Java code
- Beginner-friendly project structure suitable for learning and portfolio demonstration
encryption-decryption-tool-java-gui/
β
βββ src/
β βββ crypto/
β β βββ CryptoUtils.java
β β βββ CryptoException.java
β β βββ ...
β β
β βββ gui/
β β βββ EncryptionFrame.java
β β βββ ...
β β
β βββ service/
β β βββ FileEncryptionService.java
β β βββ ...
β β
β βββ main/
β βββ Main.java
β βββ CryptoTest.java
β
βββ screenshots/
β βββ phase1.png
β βββ phase2.png
β βββ phase3.png
β βββ phase4.png
β βββ phase5.png
β βββ phase6.png
β βββ phase7.png
β βββ imagenc.png
β βββ pdfenc.png
β βββ zip.png
β
βββ sample_files/
β
βββ README.md
β
βββ LICENSE
git clone https://github.com/vyawaha/encryption-decryption-tool-java-gui.gitOpen in
- IntelliJ IDEA
- Eclipse
- VS Code
cd src
javac crypto/*.java service/*.java gui/*.java main/*.javajava main.Main- Enter plain text
- Enter password
- Click Encrypt Text
- Copy encrypted text
- Paste encrypted text
- Enter same password
- Click Decrypt Text
- Original text is restored
- Click Encrypt File
- Select any file
- Choose password
- Encrypted file (.enc) is created
- Click Decrypt File
- Select encrypted file
- Enter correct password
- Original file is restored
- AES-256 Encryption
- GCM Authenticated Encryption
- PBKDF2-HMAC-SHA256
- Random Salt
- Random IV
- SHA-256 Integrity Verification
- Password-Based Key Derivation
- Authentication Failure Detection
- Binary Safe Encryption
- Secure Container Format
- Base64 Support for Text Encryption
- Cross Platform Compatibility
- Java Swing Interface
- Dual Text Panels
- Password Field
- Encrypt Button
- Decrypt Button
- Copy Output
- Clear Output
- Encrypt File
- Decrypt File
- Status Bar
- Error Dialogs
- Success Notifications
- File Chooser Integration
This application supports encryption of virtually any file because it works directly with binary data.
Examples include:
- TXT
- DOC
- DOCX
- XLS
- XLSX
- PPT
- PPTX
- JPG
- JPEG
- PNG
- GIF
- BMP
- MP3
- WAV
- MP4
- AVI
- ZIP
- RAR
- 7Z
- EXE
- DLL
- ISO
- CSV
- JSON
- XML
- HTML
- CSS
- Java Files
- Python Files
- C++
- Any Binary File
The application has been tested with multiple text inputs and binary file formats to verify correctness, integrity, and authentication.
- β Plain text encryption
- β Plain text decryption
- β Unicode text support
- β Large text encryption
- β Empty input validation
- β Wrong password detection
- β Authentication failure handling
- β TXT Files
- β PDF Files
- β JPG Images
- β PNG Images
- β ZIP Archives
- β Java Source Files
- β Binary Files
- β Random Salt Generation
- β Random IV Generation
- β AES-GCM Authentication Tag Verification
- β SHA-256 Integrity Verification
- β Password-Based Key Derivation
- β Tampered File Detection
The project can be extended with several enterprise-grade capabilities.
- Dark Mode UI
- Drag & Drop File Support
- Batch File Encryption
- Folder Encryption
- Recursive Directory Encryption
- Progress Bar
- Multi-threaded Encryption
- Secure File Deletion
- Compression Before Encryption
- Digital Signatures
- Public Key (RSA/ECC) Encryption
- Hardware Security Module (HSM) Support
- Cloud Storage Integration
- Automatic Update Checker
- Cross-Platform Installer
- Command Line Interface (CLI)
- Logging Dashboard
- Plugin Architecture
- Internationalization (i18n)
- Unit Testing with JUnit
This project demonstrates practical implementation of several important computer science and cybersecurity concepts.
- Symmetric Encryption
- AES-256
- AES-GCM
- PBKDF2
- Secure Random Number Generation
- SHA-256 Hashing
- Authentication Tags
- Password-Based Encryption
- Object-Oriented Programming
- Exception Handling
- File I/O
- Byte Streams
- Swing GUI Development
- Event Handling
- Java NIO
- Modular Architecture
- Layered Architecture
- Separation of Concerns
- Reusable Utility Classes
- Service Layer Design
- Error Handling
- Maintainable Code Structure
Through this project, the following skills were applied:
- Java Swing GUI Development
- Cryptography Fundamentals
- Secure Password-Based Encryption
- Binary File Processing
- Java NIO File Operations
- Exception Handling
- Secure Coding Practices
- Desktop Application Development
- Software Architecture
- Git & GitHub Workflow
Contributions are welcome.
If you would like to improve this project:
- Fork the repository.
- Create a new feature branch.
- Commit your changes.
- Push the branch.
- Open a Pull Request.
If you found this project helpful:
β Star the repository
π΄ Fork the repository
π Report bugs
π‘ Suggest new features
Muktai Vyawahare
Computer Science Engineering Student
GitHub: https://github.com/vyawaha/encryption-decryption-tool-java-gui.git
This project is licensed under the MIT License.
You are free to use, modify, and distribute this software in accordance with the terms of the license.
This project was inspired by modern encryption utilities and built using Java's standard cryptography libraries.
Special thanks to the Java community and open-source ecosystem for providing excellent documentation and APIs.











