Skip to main content

Communicate with a TRNG device.

Project description

TRNG Communicator

For their Capstone project, Adel Khaldi, Lucas Rodrigues, and Ethan Zornosa create a True Random Number Generator (TRNG) device to improve the security of encryption keys and other programs that require random numbers. This device connects to a computer through using USB-A and serves random bits to the computer upon request. This package contains the functions required to request bits from the device in your Python project.

Requesting Bits

First, import the reqbits function.
from TRNGCom.util import reqbits

reqbits takes one parameter, the number of random bits for the device to return. The device will return all requested bits in a bytes literal encoded with utf-8. Use this random bytes literal object for your random number needs.

Example

reqbits(1000) returns 1000 random bits as a bytestream literal of length 1000.

The device stores the requested number of bits in an unsigned long, meaning you can request roughly 4 billion bits. The device is capable of serving approximately 3000 bits per second, so keep in mind that large requests will take time to process and may slow down your program.

About the TRNG device

The TRNG device is a state machine with 5 states. You can identify the state the device is in from the color of the device's LED.

WAIT (WHITE) - The device is waiting for a request.
HANDSHAKE (YELLOW) - The device has received a request and is echoing the request back as part of a 3-way handshake.
HANDSHAKE2 (BLUE) - The device has echoed the request back and is waiting for final confirmation from the computer.
ERROR (RED) - The 3-way handshake failed, and the device is waiting to be reset by the computer closing its serial port.
ACTIVE (GREEN) - The device is sampling an analog signal from the Chaotic Boolean Oscillator circuit and transmitting the info to the computer.

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

trngcomm-1.0.1.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

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

trngcomm-1.0.1-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file trngcomm-1.0.1.tar.gz.

File metadata

  • Download URL: trngcomm-1.0.1.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for trngcomm-1.0.1.tar.gz
Algorithm Hash digest
SHA256 de543e5331566c284ef51c967f6bedc3e0b7fe342409f29f7be6648484899a40
MD5 99c99106abbad18538ee44601fa5b5ac
BLAKE2b-256 760d6047af963a2ef628fd97edfce9d4a2c14e59de7d1f749b3b65b99b88c030

See more details on using hashes here.

File details

Details for the file trngcomm-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: trngcomm-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for trngcomm-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 81231425512c04a1d3fb96a2926d29d0f899542f1c86bf4c3d16076bdac5fc16
MD5 4d9ed483f2d18e3bfb627d97a508e622
BLAKE2b-256 adf8c29d7d44afc10407d4d13a8c4764b11b834dd47cd615eb750452e5b9de0c

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