Skip to main content

Noise-Based-Random-Number-Generator

This random number generator leverages the inherent noise found in images captured by low-tech cameras to produce truly random numbers.

INSTALLATION

pip install noiserandom

How it works

The program captures multiple images in JPG format and randomly selects one to generate a random number. It utilizes images because older, low-tech cameras often contain significant white noise, which is a result of different random effects. Since those phenomena are inherently random, and if the camera is pointed at a dynamic scene such as a fish tank, a street, a forest , etc, the combination of a randomly chosen image and naturally occurring noise makes the process extremely difficult to reverse engineer.

Noises.

Each of these factors contributes to the overall noise level in the final image. In high-end cameras, many of these sources are mitigated through advanced sensor designs, cooling systems, and image processing algorithms. Low-tech cameras, however, often expose these weaknesses more clearly, resulting in images with a higher noise floor especially under conditions of low light or high gain.

This list should provide a clear overview of the effects that contribute to image noise in lower-performing camera systems.

  • Shot Noise

    • What it is: This is the inherent randomness in the arrival of photons at the sensor. Because light itself is made up of particles, the number that hit each sensor element will fluctuate, causing noise.

    • Why it’s significant: In low-light or lower sensitivity cameras, these variations become more apparent due to a lower photon count.

  • Dark Current Noise

    • What it is: Even in complete darkness, sensor pixels generate electrons due to thermal energy. This random generation, called dark current, results in noise.

    • Why it’s significant: Lower-tech sensors, which often lack sophisticated cooling or low-noise design, show higher dark current noise especially noticeable in long exposures or higher temperatures.

  • Read Noise

    • What it is: This noise arises during the process of converting the sensor’s charge to a digital signal. It includes disturbances from the sensor’s electronics, such as amplifiers and analog-to-digital converters (ADCs).

    • Why it’s significant: Cameras with less advanced electronics and lower-quality ADCs tend to exhibit higher levels of read noise.

  • Thermal (Johnson-Nyquist) Noise

    • What it is: Thermal agitation of electrons within the sensor’s circuits creates random fluctuations, commonly known as thermal noise.

    • Why it’s significant: This becomes a more dominant effect in systems without effective thermal management or when the sensor is operating at higher temperatures.

  • Fixed-Pattern Noise (FPN)

    • What it is: FPN is a pattern of noise that remains constant across images it originates from slight variations in sensor pixel responses or electronic circuits.

    • Why it’s significant: In low tech cameras where calibration and compensation routines are less robust, fixed-pattern noise can be noticeable as persistent spots or patterns in images.

  • Quantization Noise

    • What it is: During the analog-to-digital conversion process, continuous signals are approximated by discrete digital values. The rounding (quantization) errors introduce additional noise.

    • Why it’s significant: Lower-resolution ADCs or sensors with limited bit depth (which are common in older or simpler cameras) result in higher quantization noise.

  • Amplifier Noise

    • What it is: In many imaging systems, signals from the sensor are amplified before being digitized. The amplification process, especially when not using low-noise amplifiers, can introduce additional noise.

    • Why it’s significant: Low-tech cameras may employ more basic amplification hardware, leading to more pronounced noise artifacts.

  • Interference and External Noise

    • What it is: Electromagnetic interference from nearby electronic components or poor shielding can add stray signals into the sensor’s output.

    • Why it’s significant: In less advanced camera designs, insufficient electromagnetic shielding can result in visible noise patterns or erratic pixel behavior.

How to use

Example 1 (Random Integer)

#Firts import it

from noiserandom import NoiseRandom

#Then write the path that the images are going to be saved

path = "images" #This must be an existing folder

#After that create your object
noise_random = NoiseRandom(path=path,strength=10) #The strength is the number of images (min=1)

#Get your random number

random_number = noise_random.randomInt()

#print your random number

print(random_number)

Example 2 (Random Integer with 2048 bits)

#Firts import it

from noiserandom import NoiseRandom

#Then write the path that the images are going to be saved

path = "images" #This must be an existing folder

#After that create your object
noise_random = NoiseRandom(path=path,strength=10) #The strength is the number of images (min=1)

#Get your random number

random_number = noise_random.random2048()

#print your random number

print(random_number)

Example 3 (Random Prime Integer with 2048 bits)

#Firts import it

from noiserandom import NoiseRandom

#Then write the path that the images are going to be saved

path = "images" #This must be an existing folder

#After that create your object
noise_random = NoiseRandom(path=path,strength=10) #The strength is the number of images (min=1)

#Get your random number

random_number = noise_random.randomPrime2048()

#print your random number

print(random_number)

Example 4 (Get the bytes of the image scrambled)

#Firts import it

from noiserandom import NoiseRandom

#Then write the path that the images are going to be saved

path = "images" #This must be an existing folder

#After that create your object
noise_random = NoiseRandom(path=path,strength=10) #The strength is the number of images (min=1)

#Get your bytes

random_bytes = noise_random.randomInt(True)

#print your bytes

print(random_bytes)

Metadata

Release files for noiserandom 2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for noiserandom 2
File Size Uploaded
noiserandom-2.tar.gz 5.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for noiserandom 2
File Interpreter ABI Platform
noiserandom-2-py3-none-any.whl Python 3 none any Details

Total release size: 11.7 kB

Release files / noiserandom-2.tar.gz

Download URL noiserandom-2.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3d7b5a2ae10eb5bcad4a902f87877b9d4835083b9a28810102fff9de7b626731
BLAKE2b-256 checksum
How to use checksums
a39a354760ab27057039f0366ed264c1b186b6b5d14457bd9af718a9612cf046
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / noiserandom-2-py3-none-any.whl

Download URL noiserandom-2-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3639f13be5e634779f6529daf6ff177315bc1c10b9404e8606fc81ab0b400df0
BLAKE2b-256 checksum
How to use checksums
c64af24849623b2d6324f36f5b18a440a27ee98a3d8329485d61321a347120cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

2.1

2 release files

This release

2 This release

2 release files

1.6

2 release files

1.5

2 release files

1.4.3

2 release files

1.4.1

2 release files

1.4

2 release files

1.3

2 release files

1.2

3 release files

1.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page