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. O(n) 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.3.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.3-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: senol_randomizer-0.2.3.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.3.tar.gz
Algorithm Hash digest
SHA256 7b814ed1abd08354f4705db629cce916a5ed89c7584f0a8566944bd851487ad0
MD5 1c5377677db17a3601c6abe072e4f4eb
BLAKE2b-256 de3e09c5b9bd431164240162183eb52da734b44073b2c7024889347c6337fd82

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for senol_randomizer-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 afdaa389fecd77d7c749e86999dcacb587d60e3640d8d90fe195c0077b003594
MD5 6e96004f951d1ed784b12fd3adb54d13
BLAKE2b-256 f36b27f5bf70c110cf88367426a5b9e85ae7b5bd73d17004a1311226896fd7da

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