A Java Swing desktop application for decrypting messages encrypted with the Data Encryption Standard (DES) across multiple cipher modes. Designed with a clean and intuitive GUI, it provides real-time input validation, clear error handling, and accurate decryption results.
The DES Decryption Tool bridges cryptographic theory with practical implementation. It enables users to:
- Enter a DES key
- Select a cipher mode (e.g., ECB, CBC)
- Provide an Initialization Vector (IV) if required
- Paste ciphertext to decrypt
The application validates inputs, provides actionable error messages, and displays the decrypted plaintext.
- User-Friendly Interface – Built with Java Swing for a responsive and intuitive desktop experience.
- Multiple Cipher Mode Support – Includes ECB, CBC, and other DES-compatible modes.
- Real-Time Input Validation – Detects missing or invalid entries before processing.
- Detailed Error Handling – Provides clear, actionable troubleshooting feedback.
- Lightweight & Portable – Simple JAR execution; no complex setup required.
- Java JDK 8+
- Apache NetBeans 11.2 (recommended) or another Java IDE
git clone https://github.com/tmfontan/DESDecryptionTool.git
Note: This application was designed and tested using Apache NetBeans 11.2.
- Launch the application.
- Enter your DES key.
- Select the desired cipher mode.
- Provide an Initialization Vector (IV) if the mode requires it.
- Paste your ciphertext into the input field.
- Click Decrypt to view the plaintext result.
The GUI application is composed of seven separate classes:
-
- Responsible for creating the main GUI window form and handling most of the component functionality.
- Uses Swing components such as
JFrame
,JLabel
,JTextField
,JButton
,JTextArea
, andJComboBox
. - Provides fields for entering the 16-character HEX Security Key and Initialization Vector (IV) depending on cipher mode.
- Includes input and output text areas, a cipher mode dropdown, and buttons to decrypt or clear inputs.
- Ensures a user-friendly layout for decrypting messages.
-
- Creates a pop-up window shown when the user attempts decryption without filling in all required fields.
- Displays which fields are missing and highlights the missing input fields.
- Denoted by the title “Warning” and includes a yellow caution emblem.
-
- Displays warnings for invalid input, such as:
- Non-hexadecimal characters
- Invalid key or IV length (not 16 characters)
- Larger than the first warning window to display detailed error messages.
- Titled “Warning”, with a caution emblem and a message table listing all invalid fields.
- Displays warnings for invalid input, such as:
-
- Handles decryption failure errors.
- Similar design to the warning frames but titled “Error”, with a red/white failure icon.
- Used to display reasons for failed decryption attempts.
Note: These GUI classes (and others) also contain TaskHandler inner classes that spawn and execute separate event queue threads for heavy data manipulation. This is explained further in the source code via comments.
-
- Contains decryption methods for different DES cipher modes.
- Formats input strings and converts them into their hexadecimal byte-equivalent forms.
- Uses the external Bouncy Castle Security JAR (
bcprov-jdk15on-1.66.jar
) for cryptographic operations. - Provides the encryption and decryption logic for processing encrypted messages.
Note: The JAR file comes from Maven but is not included by default in NetBeans. It must be added manually under the project’s
External Jars
directory. -
- Creates object instances to return results from a decryption attempt.
- Returns:
- A Boolean flag indicating success or failure.
- An error code and details if an exception occurs.
- The decrypted plaintext if successful.
- Allows the GUI to display clear results or errors to the user.
-
StringToByteArrayConversionResult
- Responsible for converting strings to byte arrays for decryption.
- Handles hex string parsing, including tricky cases like extra whitespace.
- Ensures formatting is correct before passing values into decryption.
- Returns conversion results as objects, including failure information if input was poorly formatted.
Planned enhancements and future improvements:
- Add support for Triple DES (3DES) decryption.
- Implement file-based decryption for batch processing.
- Introduce a dark mode UI theme for better accessibility.
- Provide export functionality to save decrypted text directly to files.
- Add automated unit tests to improve reliability and maintainability.
Contributions are welcome! If you’d like to improve this project:
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
. - Make your changes and commit:
git commit -m "Add feature"
. - Push to your branch:
git push origin feature-name
. - Submit a pull request.
Please ensure your contributions align with the project’s coding style and include relevant documentation or updates to the README if necessary.
This project is licensed under the MIT License.