This repository contains an implementation of a Chaos-based Pseudo-Random Number Generator (PRNG). It uses the 3D Lorenz System as an entropy source and applies a sophisticated Quantization Pipeline to transform deterministic chaotic flows into uncorrelated bitstreams.
The theoretical framework for this implementation is detailed in the accompanying paper: Quantization Techniques in Chaos-Based PRNGs.
Chaotic systems are inherently continuous and deterministic. To be used in digital cryptography, they must undergo Quantization. This project implements a robust three-stage pipeline to address the core challenges of chaotic PRNGs:
- The Correlation Problem: Breaking the continuity of the Lorenz flow.
- Dynamic Degradation: Preventing the "collapse" into limit cycles caused by finite 64-bit float precision.
- The Bias Trap: Ensuring a perfectly uniform 50/50 distribution of bits.
The generator processes the Lorenz state
-
Magnification: States are multiplied by
$10^{14}$ to shift high-entropy microscopic fluctuations into the integer domain. -
LSB Extraction: The 8 least significant bits are extracted via bitwise masking (
& 0xFF). -
XOR Mixing: The bits from all three dimensions are combined (
$Q = x_{lsb} \oplus y_{lsb} \oplus z_{lsb}$ ) to eliminate structural symmetry and maximize diffusion.
This project was implemented in Julia to achieve the "best of both worlds":
- Performance: Execution speed matching C/C++ for the heavy numerical integration (RK4).
- Ergonomics: Syntax as clean and readable as Python.
- Bitwise Efficiency: Highly efficient handling of large-integer scaling and bitwise XOR operations.
.
βββ docs/
β βββ Quantization_Techniques_in_Pseudo_Random_Numbers_Generators.pdf # The paper
βββ output/
β βββ plot1_waveform.png
| |-- plot2_phase_raster.png
| |-- plot3_acf.png
| |-- plot4_returnmap.png
βββ scripts/
β βββ main.jl # Core simulation code
β βββ required-packages.jl # Loads the required packages
βββ README.md