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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trngcomm-1.1.2.tar.gz.
File metadata
- Download URL: trngcomm-1.1.2.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e05da66f4fba9978abf616a1cbb0ac0c25f28d2a8e2dbb3742a7782fce3fbb9
|
|
| MD5 |
8de16e982f896e0227382fe9a9cd7348
|
|
| BLAKE2b-256 |
669e0e993189b0f1b0e7f8aa1b050f6430cbaa930334c43191abe017363941af
|
File details
Details for the file trngcomm-1.1.2-py3-none-any.whl.
File metadata
- Download URL: trngcomm-1.1.2-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc009a7bb4196b3fabeb21a3dce111df2fc63794f12265472bd86f17135d38cb
|
|
| MD5 |
f46cc24b64e9a33b091421cbf45f5014
|
|
| BLAKE2b-256 |
1980d40c2fffac6871e8de240f3f6af93a4a416987218ba1a61805ae6f7d4620
|