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

RNG Function Tests

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

Test P-Value Result
monobit_test 8.16e-13 FAIL
frequency_within_block_test 0.0106 PASS
runs_test 0.0 FAIL
longest_run_ones_in_a_block_test 0.9619 PASS
binary_matrix_rank_test 0.2564 PASS
dft_test 0.9358 PASS
non_overlapping_template_matching_test -1.2962 FAIL
overlapping_template_matching_test 0.9626 PASS
maurers_universal_test 0.3559 PASS
linear_complexity_test 0.1545 PASS
serial_test 2.22e-21 FAIL
approximate_entropy_test 1.86e-21 FAIL
cumulative_sums_test 5.78e-13 FAIL
random_excursion_test 0.2308 PASS
random_excursion_variant_test 0.1234 PASS

Tests performed with 1 Mibibit (33,554,432 bits) of output data.
10/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.0.tar.gz (11.6 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.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: senol_randomizer-0.2.0.tar.gz
  • Upload date:
  • Size: 11.6 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.0.tar.gz
Algorithm Hash digest
SHA256 e17d5390271094c63dc7c7cbc14c2312c09819bf654e49264356ffe2a8f4f36d
MD5 0a604b7d4e3522d97cf0b3eff05962c9
BLAKE2b-256 1eb0df86a30f66127fa1f0e1857c948459db753aeb6ddc7b54763d52690357a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for senol_randomizer-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b55983f1ac7ff8e78142f34a5f6ef86be4d01ae5c7d5eaa13a21257f9c8c6e5
MD5 fd4857dff88706e3ad8f0536dc295cc8
BLAKE2b-256 507958c6c1139f618fae06fe03928dc4aa82fb1723c5db66b73846d3737ab6bd

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