Welcome to the Python DES Implementation repository! This project provides a clear and concise implementation of the Data Encryption Standard (DES) symmetric encryption algorithm. It is designed for educational purposes and aims to help users understand the core concepts of symmetric cryptography.
The Data Encryption Standard (DES) is a symmetric-key algorithm for the encryption of digital data. It uses a fixed-size key and operates on blocks of data, making it a fundamental concept in the field of cryptography. This implementation focuses on key schedule generation, Feistel rounds, and verifying standard test vectors to ensure correctness.
- Complete DES Algorithm: Implement the full DES algorithm, including all necessary components.
- Key Schedule Generation: Generate subkeys for each round of encryption.
- Feistel Structure: Utilize the Feistel network structure for encryption and decryption.
- Test Vector Verification: Verify outputs against standard test vectors to ensure accuracy.
- Educational Resource: Ideal for students and educators in data security labs.
To install the project, follow these steps:
-
Clone the repository:
git clone https://github.com/obi090/python-des-implementation.git
-
Navigate to the project directory:
cd python-des-implementation
-
Install the required packages:
pip install -r requirements.txt
To use the DES implementation, follow these steps:
-
Import the necessary classes from the module:
from des import DES
-
Create an instance of the DES class:
des = DES(key)
-
Encrypt or decrypt data:
encrypted_data = des.encrypt(plaintext) decrypted_data = des.decrypt(encrypted_data)
-
Verify results against known test vectors.
The key schedule generation process is critical in DES. It derives 16 subkeys from the original key, which are used in each round of the Feistel structure. The implementation follows these steps:
- Initial Permutation: The original key undergoes an initial permutation.
- Splitting: The key is split into two halves.
- Circular Shifts: Each half is subjected to left circular shifts.
- Subkey Generation: Permutations are applied to create the subkeys.
The DES algorithm consists of 16 rounds of processing, each involving the following steps:
- Initial Permutation: The data block undergoes an initial permutation.
- Feistel Function: Each round applies the Feistel function, which combines the right half of the data with the subkey.
- Swap: The left and right halves are swapped after each round.
- Final Permutation: The final output undergoes a permutation to produce the ciphertext.
Verification is crucial to ensure that the implementation adheres to the DES standard. The project includes a set of standard test vectors that can be used to validate the encryption and decryption processes.
- Each test vector consists of a plaintext, a key, and the expected ciphertext.
- The implementation compares the output against these expected values to confirm accuracy.
We welcome contributions to enhance this project. If you would like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or fix.
- Make your changes and commit them.
- Push your branch and create a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or suggestions, feel free to reach out:
- Author: Your Name
- Email: your.email@example.com
You can find the latest releases of this project here. Please download and execute the files as needed.
We encourage you to explore the Releases section for updates and new features.
Thank you for checking out the Python DES Implementation! We hope this project aids in your understanding of symmetric encryption and enhances your skills in cryptography. Happy coding!