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 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
shuffle() Create random url safe strings. length:int str

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.4.tar.gz (11.9 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.4-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for senol_randomizer-0.2.4.tar.gz
Algorithm Hash digest
SHA256 e4c89a122d03d0f10c566a6e7c9f27f06952fe1c7a7a23f5948004f241c03806
MD5 b212a4f893470ec252a3ded48ae06098
BLAKE2b-256 a81d9cbcd2cf8a6055cd29992a16343d26d50b203ccfb308bdf49c4054c3c952

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for senol_randomizer-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 75ba836f48abb3f37ab6716051af602cc6930648b96170dcaa9e51b1b96c8f2a
MD5 6f02d1f9592315c6aae2274cc94dc644
BLAKE2b-256 58508488256f18cad909ba78fec74937d3b4ed7defc7ebb45893f6187d6ad36f

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