Author: Aly Graham, with Claude (Anthropic) — analysis, code assistance, and testing.
In short: an open-source, honestly-benchmarked combined PRNG design.
FilteredSelectionPRNG (v1.1) has streamed 8 GiB clean through PractRand
with no anomalies, but its cycle-length proof at real (101/103-component)
scale is still an open problem, and no independent cryptanalysis has been
done against that real configuration. If you work on PRNG testing or
cryptanalysis, the single most useful thing to look at is either of those
two gaps — see v1.1/README.md's Period / cycle
structure and Cryptographic analysis sections. Feedback, issues,
and PRs are genuinely welcome; see Quick start below to try it in a
couple of lines.
v1.1/— the current released design:FilteredSelectionPRNG(recommended) andCombinedPRNG. Full writeup, statistical testing, and cryptographic analysis in v1.1/README.md.v2.0-results/— pre-release test results for the next-generation design (PractRand, predictability, and cryptographic-attack testing, run at real production scale). Source code is not yet published, pending a decision on patent counsel; see v2.0-results/README_v2.0_test_results.md.
See CHANGELOG.md for version history.
Using the already-validated, shipped 101+103 increment set, from
inside v1.1/:
from pgprng_generator import FilteredSelectionPRNG
INCS_101, INCS_103 = [], []
with open("pgprng_increments_101_103.csv") as f:
next(f) # header
for line in f:
ens, inc = line.strip().split(",")
(INCS_101 if ens == "101" else INCS_103).append(int(inc))
gen = FilteredSelectionPRNG(INCS_101, INCS_103) # fresh secrets-random seeds by default
for _ in range(5):
print(hex(gen.next()))MIT License — see LICENSE. Anyone may use, modify, and redistribute this code, including commercially, as long as the copyright notice is kept.