Skip to main content

SECURITY NOTICE
THIS MODULE MAY NOT BE SUITABLE FOR FULL PRODUCTION USE
IT MAY OR MAY NOT BE SECURE - NO SEURITY EXPERT HAS CHECKED.
IF YOU ARE GOING TO USE THIS MODULE, PLEASE REVIEW THE CODE FIRST,
OR ASK A SECURITY EXPERT TO DO SO.

Introduction

The hashfish python module allows you to easily use salted HMACs for data hashing. It acts as a simple "wrapper" for some of the functions in the hmac module from the standard library. Hashfish allows you to hash data and check the hashes using a quick and easy implementation; one function is for hashing, one for generating secure salt, and one function is for checking (+ one for testing).

Usage

The usage for hashfish is simple; an example script is shown below:

import hashfish

msg = 'Hello, world!' # Message
key = 'Some key...' # Key/Password
slt = hashfish.new_salt() # Length of choice may be used by changing the length keyword argument. Default is 16 characters long.
dmd = 'sha256' # Algorithm to use. See hmac.new(...).
mac = hashfish.new_salty_hmac(msg, key, slt, dmd) # Actually create the HMAC.
print(verify_salty_hmac(mac, msg, key, dmd)) # Test if verified. Should return [bool] True.

Technical ⚙️

Testing

In order to test the module, either run as main or call hashfish.test().
The test code is pretty much the same as the example code.

Credits

Credits go to:
Pigeon Nation :]

Release files for hashfish 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hashfish 1.1.0
File Size Uploaded
hashfish-1.1.0.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hashfish 1.1.0
File Interpreter ABI Platform
hashfish-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.5 kB

Release files / hashfish-1.1.0.tar.gz

Download URL hashfish-1.1.0.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
10ba35495211a21bd61120c48849f93993d3bac9a2686da525aceaa7aeb136e8
BLAKE2b-256 checksum
How to use checksums
9e662892e34774ea60cad94c7ff686dc10bc132a78ea97ceec46f32c8ae62d7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / hashfish-1.1.0-py3-none-any.whl

Download URL hashfish-1.1.0-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad91ecfb02eebf448bd88756124c8d287b44891722562e2162d74475b2a2e2c0
BLAKE2b-256 checksum
How to use checksums
88a503a0b5257d561bdd241d87b426b024927a1b93ca1990dbe8425a9b98d021
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page