Skip to main content

Cryptography-inspired random generation experiment

Project description

senol-randomizer

An RNG-core-based random data generator written in a cryptographic style, but lacking any cryptographic proof, which creates an information asymmetry between the program and urandom.


logo

python License Status Type Github

Installation

pip install senol-randomizer

How does it work?

  • First, it takes 256-bit numbers from /dev/urandom.
  • Second, it processes these numbers using the powmod() function from the gmpy library, applying the operation a b modn, and does this for each n.
  • The list of n values consists of 256-bit prime numbers.
  • This output is also used in the generation of other data types.

How To Use?

Function Name Description Arguments Returns
newstr() Create random string with unicode range. num:int, min_val:int, max_val:int str
newint() Create random integer with range. min_val:int, max_val:int int
newfloat() Create random float with range. min_val:int, max_val:int float
newbyte() Create random bytes. num:int bytes
newbool() Create random bool. No Argument bool
RNG() Core of library, create random big integer without range. No argument int
choice() Selects a random element from the list. lst:list any
compress() Maps the given number into the range between min and max in a way that minimizes modulo bias. value,min_val:int,max_val:int int
shuffle() Shuffles the given list and returns it. lst:list list

RNG Function Tests

Statistical test results based on NIST SP 800-22 Rev. 1a test suite.

Test P-Value Result
monobit_test 0.046613138703915244 PASS
frequency_within_block_test 0.6787903492122158 PASS
runs_test 0.33232036052397196 PASS
longest_run_ones_in_a_block_test 0.21020703185565603 PASS
binary_matrix_rank_test 0.2571877713800565 PASS
dft_test 0.8685773273998374 PASS
non_overlapping_template_matching_test 0.893926430778068 PASS
overlapping_template_matching_test 0.7796009868841686 PASS
maurers_universal_test 0.9802530560443485 PASS
linear_complexity_test 0.4685290247356243 PASS
serial_test 0.5630465232357214 PASS
approximate_entropy_test 0.5631130245829565 PASS
cumulative_sums_test 0.039939937090386124 PASS
random_excursion_test 0.5178616373360564 PASS
random_excursion_variant_test 0.14694060874229203 PASS

Tests performed with 1 Mibibit (33,554,432 bits) of output data.
15/15 PASS — Work in progress.


Project Repo GithubProject Repo PyPI

Author Github ProfileAuthor PyPI Profile

--Batuhan Şenol

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

senol_randomizer-0.2.2.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

senol_randomizer-0.2.2-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file senol_randomizer-0.2.2.tar.gz.

File metadata

  • Download URL: senol_randomizer-0.2.2.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for senol_randomizer-0.2.2.tar.gz
Algorithm Hash digest
SHA256 8391a844d0ccd7d27adb4dc24fe2dc60faf1abaa3d117731a3e9f820970effd1
MD5 83a58a8df985756964eb94744886e01c
BLAKE2b-256 ffe20a89380f5fed139862063c5e30f6465a974a21af155d3581a49d0369eefb

See more details on using hashes here.

File details

Details for the file senol_randomizer-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for senol_randomizer-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d81c8a90a54e5287089947d2c1611f25d091ca28cb2e3ec78f76828fc8fa69e6
MD5 3e792808c8257bdb9abdfa8df9215e93
BLAKE2b-256 30f72562d162688be1b70201d622d120871a26f08d998069b0e482d86d4f260c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page