Unpredictable random number generation for cryptography (random + secrets module combined.)
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
secretrandom
The combination of the random and the secrets module for unpredictable number generation
Includes:
- Password & passcode generation for authentication.
- Random number generation as the random module.
- Powered with ⚡true optimization and unpredictability.⚡
Documentation guide
All functions:
randpwd()— Password generationrandcode()— Passcode and PIN generationrandint()— Random whole integer generationrandflt()— Random float generationchoice()— For random choicesshuffle()— For random shuffles
randpwd()
Generates strong or weak passwords based on the length (1st argument) and the strength (2nd argument).
import secretrandom
password = secretrandom.randpwd(17, 'strong')
print(password) # Prints out strong password with 17 chars.
NOT RECOMMENDED! Generate weak passwords for examples.
password = secretrandom.randpwd(0, 'weak')
print(password) # Prints out weak password like Tran$f0rm3rsr0ck!
randcode()
Generates passcodes or PINs based on the length as the only argument.
passcode = secretrandom.randcode(6)
print(passcode) # Prints out passcode with 6 integers
randint()
Random whole integer generator starting from 1st arg to 2nd arg with steps (3rd arg)
random_num = secretrandom.randint(1, 4)
print(random_num) # Prints out a number between 1-4
OR
random_num = secretrandom.randint(1, 6, 2)
print(random_num) # Prints out a number either 2, 4, or 6
randflt()
Random float generator from 1st arg to 2nd arg
random_flt = secretrandom.randflt(1, 2)
print(random_flt) # Prints out random float from 1 to 2 (like 1.673)
choice()
Chooses part of a list of values.
choice = secretrandom.choice('abcd')
print(choice) # Prints out what it chose (either a, b, c, or d)
And finally shuffle()
Shuffles a list of values.
data = ['a', 'b', 'c', 'd']
secretrandom.shuffle(data)
print(data) # Shuffles the list of values.
Any questions? Email here
Project details
Release history Release notifications | RSS feed
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 secretrandom-1.0.0rc1.tar.gz.
File metadata
- Download URL: secretrandom-1.0.0rc1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
074b147d8fc76becd3b3a6f8b32d6fc9a0828e5ec6f7e38f65f5c10f6c4ea433
|
|
| MD5 |
4ecc5ade4196ceca30295c664464de83
|
|
| BLAKE2b-256 |
6a91a2744c3f0e61af9a8d8a212cd663d5702f88ccf7cac7a1144865f9cc3502
|
File details
Details for the file secretrandom-1.0.0rc1-py3-none-any.whl.
File metadata
- Download URL: secretrandom-1.0.0rc1-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40bcbba6b5f56bd4316f614a6d6ae5034ef79bd3b3d7cd1fa1333fabfcf7ed88
|
|
| MD5 |
6f690b58fdc4c0a65551b17c008e2080
|
|
| BLAKE2b-256 |
1078c4f3c591e37b223b8a8224c6d3882355855c096187811b917dce30525ad7
|