Skip to content

scheehan/pySecureTokenGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python License: MIT

Cryptographically strong pseudo-random number generator

This is a tool to generate cryptographically strong random numbers suitable for managing data such as passwords, account authentication, security tokens, and related secrets.

All available features were creates based upon python secrets module as pseudo-random number generator. The purposes for this tool were meant to cover most common use cases like need to generate multiple random hash value or taken for specific purposes with a single tool.

Features

  • bytes: Generate a random byte string containing nbytes number of bytes.
  • XKCD: Generate an XKCD-style passphrase based upon a simple american dict compressed file.
  • hex: Generate a random text string, in hexadecimal.
  • urlsafe: Generate a random URL-safe text string, containing nbytes random bytes. The text is Base64 encoded, so on average each byte results in approximately 1.3 characters.
  • passwd: Generate a random alphanumeric string with special symbol characters without whitespace.

Information about Python Secrets module

Installation

git clone https://github.com/scheehan/pySecureTokenGenerator
cd pySecureTokenGenerator

Sample How-to steps

Sample acceptable argument

powershell_ran_sample

Generate random URLSafe token for one-time password recovery link ran under Windows Power Shell

python .\pyGhash.py --urlsafe 16 | Tee-Object -Variable MyVariable
echo 'http://www.example.com/pass-recover=$MyVariable'

powershell_ran_sample

Generate random URLSafe token for one-time password recovery link ran under Linux Bash

# python3 PySecretsGen.py --urlsafe 16 | { read MyVariable; echo "http://www.example.com/pass-recover=$MyVariable";}

bash_ran_sample

Generate a random alphanumeric string with special symbol characters without whitespace.

powershell_ran_passwd_sample

Generate a XKCD-style passphrase based upon a simple american dict compressed file.

powershell_ran_xkcd_sample

About

Cryptographically strong pseudo-random number generator

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages