How desert-oasis/dual-sync-mitm works
This repository provides two C++ demonstrations of meet-in-the-middle preimage attacks against 44-step SHA-256: a standard preimage attack and a partial-target pseudo-preimage variant. Each executable enters its attack from main; the attack code builds neutral structures, expands SHA-256 states forward and backward, and matches candidates. The second variant documents that it omits the padding rule. Both directories also contain a conventional SHA-256 implementation, but the sampled excerpts do not establish whether the attack routines call it; those connections are therefore omitted.
Main entry points: src/main.cpp Attack entry · src/main.cpp Neutral structure · include/SHA256.h SHA-256 API · include/SHA256.h SHA-256 API
Components 19
Standard preimage attack
- Attack entry
SHA256-44/src/main.cpp - Neutral structure
SHA256-44/src/main.cpp - Forward expansion
SHA256-44/src/main.cpp - Backward expansion
SHA256-44/src/main.cpp - Candidate matching
SHA256-44/src/main.cpp - Match table
SHA256-44/src/main.cpp - Attack results
SHA256-44/src/main.cpp
Partial-target attack
- Attack entry
SHA256-44_partial_pseudo_preimage/src/main.cpp - Neutral structure
SHA256-44_partial_pseudo_preimage/src/main.cpp - Forward expansion
SHA256-44_partial_pseudo_preimage/src/main.cpp - Backward expansion
SHA256-44_partial_pseudo_preimage/src/main.cpp - Partial matching
SHA256-44_partial_pseudo_preimage/src/main.cpp - Match table
SHA256-44_partial_pseudo_preimage/src/main.cpp - Trial results
SHA256-44_partial_pseudo_preimage/src/main.cpp
SHA-256 utility
- SHA-256 implementation
SHA256-44/src/SHA256.cpp - SHA-256 API
SHA256-44/include/SHA256.h - SHA-256 implementation
SHA256-44_partial_pseudo_preimage/src/SHA256.cpp - SHA-256 API
SHA256-44_partial_pseudo_preimage/include/SHA256.h
Other components
- Engineer
Connections 18
- Engineer → Attack entry: runs
- Attack entry → Neutral structure: calls PseudoPreimage_MITM
- Neutral structure → Forward expansion: seeds states
- Neutral structure → Backward expansion: seeds states
- Forward expansion → Match table: stores match keys
- Backward expansion → Match table: looks up keys
- Backward expansion → Candidate matching: checks candidates
- Candidate matching → Attack results: reports results
- Engineer → Attack entry: runs
- Attack entry → Neutral structure: calls BuildIS
- Attack entry → Forward expansion: runs trial expansion
- Attack entry → Backward expansion: runs trial expansion
- Forward expansion → Match table: stores match keys
- Backward expansion → Match table: looks up keys
- Backward expansion → Partial matching: checks target bits
- Attack entry → Trial results: reports trials
- SHA-256 API → SHA-256 implementation: declares
- SHA-256 API → SHA-256 implementation: declares