Salty HMACs!
Project description
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 :]
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
File details
Details for the file hashfish-1.1.0.tar.gz
.
File metadata
- Download URL: hashfish-1.1.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10ba35495211a21bd61120c48849f93993d3bac9a2686da525aceaa7aeb136e8 |
|
MD5 | dbebe62d444c13c8bfb10e5567b6ceab |
|
BLAKE2b-256 | 9e662892e34774ea60cad94c7ff686dc10bc132a78ea97ceec46f32c8ae62d7f |
File details
Details for the file hashfish-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: hashfish-1.1.0-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad91ecfb02eebf448bd88756124c8d287b44891722562e2162d74475b2a2e2c0 |
|
MD5 | fb2d40e83ee52dbf1d0315b0b0ba101e |
|
BLAKE2b-256 | 88a503a0b5257d561bdd241d87b426b024927a1b93ca1990dbe8425a9b98d021 |