Skip to content

CrescentMnn/des

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

36 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Data Encryption Standard

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.

Project overview

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).

Project Structure

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.

DES overview

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.

Project build

g++ -I ./include src/*.cpp des_encryption.cpp -o DES_build

CONSIDERATIONS

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.

About

A simple DES in c++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages