A simple Python script for generating a variety of hashes from safe urandom entropy.

Overview

Hashgen

A simple Python script for generating a variety of hashes from safe urandom entropy.

For whenever you need a random hash (e.g. generating an app secret) or a random password (although random words make for better passwords).

How to use

Download the script, either cd to it or put it somewhere in your path, then simply run the script followed by the hashing algorithm of your choice. Running the script with no arguments will present this help page:

usage: hashgen [-h] [--blake2b] [--sha3] [--sha256] [--sha384] [--sha512] [--version]

Generate a random blake2b, SHA3-384, SHA256, SHA384, or SHA512 hash using safe entropy from urandom.

optional arguments:
  -h, --help      show this help message and exit
  --blake2b, -b   hashes random entropy using blake2b
  --sha3, -3      hashes random entropy using sha3-384
  --sha256, -256  hashes random entropy using sha256
  --sha384, -384  hashes random entropy using sha384
  --sha512, -512  hashes random entropy using sha512
  --version, -v   show program version and exit

https://github.com/X448NAX/Hashgen

Usage example, assuming the script is in your path:

hashgen --blake2b
4de2ca0a16e9f8a038e0d53639a00c8b010d6e164a868a149a40a875438f1c92f232b2bf1cda1d9d06d36407a2359ed2f9ba766330d529c8978a6a575a695f1e

If it's not in your path:

python3 hashgen.py -3
26b75e69d89497c00b12430de11f1693da47ce537f9a4f2aad8e145a977f92c7ae8c617ecfa26109524d914dcba9af68

Simple as that!

Future functionality

I plan to add functionality to this here and there. If there's something you think would benefit it feel free to submit a PR.

Dependencies

None. Hashgen was created specifically to only use hash functions built into the native Python hashlib library. If you are having issues, make sure you are using at least Python 3.6. I tested against 3.9 when creating this.

Additional hashes from third party libraries may be added in the future, but core functionality will be focused on those natively supported by Python.

Disclaimer

This is a personal hobby project. It has not been audited. However it is using urandom for entropy and makes use of industry standard hashing algorithms, I have not "rolled my own crypto." If you are particularly concerned with security I recommend using at least 384 bit hashes.

Algorithms with known practical hash collision attacks such as MD5 and SHA1 are not and will not be included.

You might also like...
Python library for generating CycloneDX SBOMs

Python Library for generating CycloneDX This CycloneDX module for Python can generate valid CycloneDX bill-of-material document containing an aggregat

Hypothesis strategies for generating Python programs, something like CSmith

hypothesmith Hypothesis strategies for generating Python programs, something like CSmith. This is definitely pre-alpha, but if you want to play with i

Python script to commit to your github for a perfect commit streak. This is purely for education purposes, please don't use this script to do bad stuff.

Daily-Git-Commit Commit to repo every day for the perfect commit streak Requirments pip install -r requirements.txt Setup Download this repository. Cr

This program is meant to take the pain out of generating nice bash PS1 prompts.
This program is meant to take the pain out of generating nice bash PS1 prompts.

TOC PS1 Installation / Quickstart License Other Docs Examples PS1 Command Help PS1 ↑ This program is meant to take the pain out of generating nice bas

Generating rent availability info from Effort rent

Rent-info Generating rent availability info from Effort rent Pre-Installation Latest version of python Pip module json, os, requests, datetime, time i

A NetBox Plugin that gives a UI for generating, comparing and deploying configurations to devices.

netbox_config_plugin - A plugin to generate, compare and deploy configurations This plugin allows you to execute your code to generate a config for a

A feed generator. Currently supports generating RSS feeds from Google, Bing, and Yahoo news.

A feed generator. Currently supports generating RSS feeds from Google, Bing, and Yahoo news.

A multi purpose password managing and generating tool called Kyper.

Kyper A multi purpose password managing and generating tool called Kyper. Setup The setup for Kyper is fairly simple only involving the command python

Owner
Xanspie
Xanspie
A simple script for generating screenshots with Vapoursynth

Vapoursynth-Screenshots A simple script for generating screenshots with Vapoursynth. About I'm lazy, and hate changing variables for each batch of scr

null 7 Dec 31, 2022
An kind of operating system portal to a variety of apps with pure python

pyos An kind of operating system portal to a variety of apps. Installation Run this on your terminal: git clone https://github.com/arjunj132/pyos.git

null 1 Jan 22, 2022
DownTime-Score is a Small project aimed to Monitor the performance and the availabillity of a variety of the Vital and Critical Moroccan Web Portals

DownTime-Score DownTime-Score is a Small project aimed to Monitor the performance and the availabillity of a variety of the Vital and Critical Morocca

adnane-tebbaa 5 Apr 30, 2022
A beacon generator using Cobalt Strike and a variety of tools.

Beaconator is an aggressor script for Cobalt Strike used to generate either staged or stageless shellcode and packing the generated shellcode using your tool of choice.

Capt. Meelo 441 Dec 17, 2022
Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.

Advent Of Code 2021 - Python English Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels th

Coral Izquierdo Muñiz 2 Jan 9, 2022
An Advent calendar of small programming puzzles for a variety of skill sets and skill levels.

Advent of Code 2021 The Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be sol

Evan Cope 0 Feb 13, 2022
Null safe support for Python

Null Safe Python Null safe support for Python. Installation pip install nullsafe Quick Start Dummy Class class Dummy: pass Normal Python code: o =

Paaksing 13 Nov 17, 2022
Safe temperature monitor for baby's room. Made for Raspberry Pi Pico.

Baby Safe Temperature Monitor This project is meant to build a temperature safety monitor for a baby or small child's room. Studies have shown the ris

Jeff Geerling 72 Oct 9, 2022
Make your functions return something meaningful, typed, and safe!

Make your functions return something meaningful, typed, and safe! Features Brings functional programming to Python land Provides a bunch of primitives

dry-python 2.5k Jan 3, 2023
Скрипт позволяет заводить задачи в Панель мониторинга YouTrack на основе парсинга сайта safe-surf.ru

Скрипт позволяет заводить задачи в Панель мониторинга YouTrack на основе парсинга сайта safe-surf.ru

Bad_karma 3 Feb 12, 2022