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.1.1.tar.gz (15.0 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.1.1-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for trngcomm-1.1.1.tar.gz
Algorithm Hash digest
SHA256 f4a0907ad3b17e372dfef415a0417c98c037e9d0148fb9f8ad49a0aae93175a7
MD5 c2ab2b0d65b6699e304794534eed8882
BLAKE2b-256 bf41aaa7a372f47d5c2fb449103fdb97210fa0e635d0eb7abc130771b7f19c88

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trngcomm-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.7 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2a2736b03fc06e316a98c2a534505438c3abafbd1424972beb2e8cc2a9f737b8
MD5 181ba4852fddcc04a23081add706eb42
BLAKE2b-256 50cc327dd8955465368e0c8afce31881de214b8cd824dd2b010460827030da3a

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