The Data Encryption Standard is a symmetrical encryption implementation, consisting of a key of 56 bits and a 64 bit plaintext block which is going to be encrypted, it was developed in 1970 at IBM.
DES is now considered depreciated since its 56 bit key is considered to be relatively short, thus making this an insecure way of encrypting data, but nonetheless it still is a historically significant encryption standard.
This project has as a goal to implement DES in c++, where we provide a key and the user can input the plaintext into out program and see the ciphertext output, this project also serves as a stepping stone for a bigger project in which i will implement this same algorithm (and possibly AES).
des-implementation/
βββ des_encryption.cpp # Main program
βββ include/ # Header files
β βββ encryption.h
β βββ ip.h
β βββ keys.h
β βββ output.h
β βββ pc.h
βββ src/ # Implementation files
β βββ encryption.cpp # Feistel, S-boxes, permutations
β βββ ip.cpp # Initial/final permutation
β βββ keys.cpp # Key schedule
β βββ output.cpp # I/O utilities
β βββ pc.cpp # PC1/PC2 permutations
β βββ test_*.cpp # Unit tests (not in final build)
βββ images/ # Documentation images for README.md
Note: Test files (test_*.cpp) are used for development and verification only.
It operates through a Feistel network consisting of 16 rounds, where each round applies substitution and permutation operations using a unique subkey generated by the key schedule process. The key schedule derives these subkeys from the main key through a series of bit shifts and permutations. By combining substitution (confusion) and permutation (diffusion), DES effectively obscures the relationship between the plaintext, ciphertext, and key, serving as a foundational algorithm in modern cryptography, even though it is now considered insecure by todayβs standards.
g++ -I ./include src/*.cpp des_encryption.cpp -o DES_build
It is important to note that this DES implementation was done merely for educational purposes (specifically for a class assignment) in which i decided to code the implementation myself to get a better grasp of how this enccrytpion standard worked, it should also be noted that you should avoid using personally made crypto, as it is often the most insecure way of adopting these standards, even if its an implementation of a secure and widely used standard.