Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pgprng — "Pretty Good PRNG": combined/coupled generator experiments

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.

Project layout

  • v1.1/ — the current released design: FilteredSelectionPRNG (recommended) and CombinedPRNG. 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.

Quick start (v1.1)

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()))

License

MIT License — see LICENSE. Anyone may use, modify, and redistribute this code, including commercially, as long as the copyright notice is kept.

About

Pretty Good PRNG — combined/coupled PRNG Python code and experimental results

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages