A simplified version of DES (Data Encryption Standard) Algorithm. It is designed to demonstrate the encryption process using a minimal version of the DES algorithm.
S-DES is used for educational purposes, as it demonstrates the process of key generation, substitution-permutation, and encryption. It operates on 8-bit plaintext and uses a 10-bit key for encryption. This implementation takes:
- A plaintext (8 bits in binary format)
- A key (10 bits in binary format)
as command line arguments and outputs the corresponding ciphertext. If arguments are not given, two default values for plaintext and key are used.
Clone the repository using the following command, and change directory:
git clone https://github.com/kallenosf/Simplified-DES.git
cd Simplified-DESBuild the binary using make:
makeRun the compiled binary with the following format:
./sdes [plaintext] [key]- [plaintext]: An 8-bit binary string representing the plaintext to be encrypted (e.g., 10011010)
- [key]: A 10-bit binary string representing the encryption key (e.g., 1110001110)
./sdes 10101010 1100110011Output:
SIMPLIFIED DES
--------------
plainText = 10101010
key = 1100110011
cipherText = 11101001
The program implements the following diagram:
These are the steps:
- Key Generation:
- Derives two subkeys (K1 and K2) from the 10-bit input key using permutation and shifting operations.
- Initial Permutation (IP):
- Rearranges the 8-bit plaintext input into a predefined order.
- Rounds:
- Executes two rounds of encryption using the Feistel structure and the subkeys K1 and K2.
- Final Permutation (Inverse IP):
- Applies the inverse of the initial permutation to produce the final ciphertext.
To remove the compiled binary and other generated files, run:
make clean