A technical research platform dedicated to the exploration of cryptographic primitives and the implementation of advanced cryptanalytic attacks. This repository serves as an engineering workbench for testing high-throughput stream ciphers, stochastic key recovery, and algebraic state reconstruction.
Laboratory 01: Substitution Cryptanalysis Modular statistical environment for substitution ciphers utilizing n-gram frequency distributions and Chi-Square divergence testing to quantify linguistic similarity.
Laboratory 02: Classical Cipher Suite Automated brute-force engine for Caesar and Affine ciphers implementing the Extended Euclidean Algorithm and result-pattern orchestration for explicit error handling.
Laboratory 03: Heuristic Key Recovery
Stochastic cryptanalysis workbench utilizing Metropolis-Hastings and Simulated Annealing with Unsafe hot-path optimizations—achieving a 99.5% reduction in execution time (from 100s to 519ms).
Laboratory 04: LCG State Reconstruction Known-plaintext attack implementation targeting Linear Congruential Generators, leveraging arbitrary-precision arithmetic to solve systems of linear congruences.
Laboratory 05: LFSR & GF(2) Solvers
Stream cipher analysis framework featuring a zero-allocation Gaussian elimination solver over stackalloc buffers.
Laboratory 06: Geffe Correlation Attack Divide-and-conquer statistical attack suite targeting non-linear Geffe combiners through Pearson Rho correlation coefficients to recover internal states in sub-linear time.
Laboratory 07: Trivium SIMD & Cube Attack High-throughput Trivium implementation leveraging AVX2 SIMD parallelization (8-stream) and algebraic Cube Attacks—reaching peak throughput of 70 Gbps.
-
High-Performance Compute: Extensive use of
Span<T>,stackalloc, andUnsafepointer arithmetic to achieve zero-allocation in cryptographic hot paths. -
Vectorization: Implementation of AVX2 intrinsics to parallelize stream cipher state updates, processing 8 independent streams in 256-bit registers.
-
Advanced Cryptanalysis: Application of stochastic (MCMC) and algebraic (Cube Attack) methods to break ciphers without exhaustive key searches.
-
Compilation Strategy: Systematic use of Native AOT (
PublishAot) to ensure predictable execution latency and minimal memory footprint.
- Languages: C# 13, C# 14
- Runtimes: .NET 9.0, .NET 10.0
- Numerical Core:
System.Numerics.BigInteger, CustomXoshiro256PRNG - Low-Level Tools: AVX2 SIMD Intrinsics,
System.Runtime.CompilerServices.Unsafe, andstackalloc - Deployment: Native AOT for self-contained, high-performance binaries
- Validation: All implementations verified against Known Answer Tests (KAT) or through Monte Carlo simulations to ensure statistical reliability.
- Optimization Principles: Focus on cache locality, branchless programming, and zero-allocation in execution "hot loops".
- Architecture: Adherence to Vertical Slice and Layered DDD-Lite principles to maintain modularity in performance-critical kernels.
Kamil Fudala
This project is licensed under the MIT License.