Skip to content

StudentfromPSU/Differential-Cryptanalysis-of-DES

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Differential Cryptanalysis of DES πŸ”

Implementation of the DES (Data Encryption Standard) algorithm in C++
with a practical demonstration of differential cryptanalysis on the last round S-box.


πŸ“Œ Project Overview

This project includes:

  • Full implementation of DES encryption
  • Key schedule generation
  • S-box processing
  • Differential distribution table construction
  • Plaintext pair generation with controlled input differences
  • Subkey recovery for S-box 1 (last round)
  • Statistical analysis of attack success rate

The project demonstrates how differential cryptanalysis can partially recover subkey bits of the final round in DES.


🧠 What is Implemented

πŸ”Ή DES Core

  • Initial permutation (IP)
  • Final permutation (IP⁻¹)
  • Expansion permutation (E)
  • 8 S-boxes
  • P permutation
  • 16-round Feistel structure
  • Key schedule (PC-1, PC-2, left shifts)

πŸ”Ή Differential Cryptanalysis

  • Differential distribution table construction
  • Plaintext pair generation with fixed Ξ”P
  • Ciphertext difference analysis
  • Subkey candidate ranking
  • Real key verification
  • Success rate calculation

πŸ›  Technologies

  • C++
  • STL (vector, map, algorithm, bitset)
  • Random generation (mt19937)
  • Bitwise operations

πŸ“Š Example Output

  • Encrypted ciphertext (HEX)
  • Real last-round subkey bits
  • Top key candidates
  • Match statistics
  • Attack success rate (%)

🎯 Educational Purpose

This project was developed as an educational demonstration of:

  • Symmetric encryption internals
  • Feistel network structure
  • Practical cryptanalysis concepts
  • Statistical key recovery techniques

⚠ Disclaimer

DES is cryptographically broken and should not be used in real systems. This implementation is for educational and research purposes only.


πŸ‘¨β€πŸ’» Author: Stanislau Chaiko

About

C++ implementation of DES with practical differential cryptanalysis demonstration

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages