Skip to main content

PureHLE

Pure Python hash length extension.

Installation

pip install purehle

Usage

Information used in the examples:

  • Hash of key + DE: 2ecdde3959051d913f61b14579ea136d
  • Length of key: 3
  • Data to append: F

CLI

> purehle -d 2ecdde3959051d913f61b14579ea136d -o DE -l 3 -a F

Using hash type MD5.
Hash (hex): d542ef0939e3c366f3eca18d4fa0bc77
Hash (bytes): b'\xd5B\xef\t9\xe3\xc3f\xf3\xec\xa1\x8dO\xa0\xbcw'
Data (hex): 4445800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000280000000000000046
Data (bytes): b'DE\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00(\x00\x00\x00\x00\x00\x00\x00F'

Module

import purehle

hle = purehle.MD5(bytes.fromhex("2ecdde3959051d913f61b14579ea136d"), b"DE")
padding, m = hle.with_length(3)
m.update(b"F")
data = hle.original + padding + b"F"

data  # b"DE\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00(\x00\x00\x00\x00\x00\x00\x00F"
m.hexdigest() # d542ef0939e3c366f3eca18d4fa0bc77

Supported Hash Algorithms

  • MD5 (MD%)
  • SHA-1 (SHA1)
  • SHA-256 (SHA256)
  • SHA-512 (SHA512)

Release files for purehle 1.0.1

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

Source distribution (sdist)

Source distribution for purehle 1.0.1
File Size Uploaded
purehle-1.0.1.tar.gz 6.1 kB Details

Built distribution (wheel)

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

Total release size: 14.1 kB

Release files / purehle-1.0.1.tar.gz

Download URL purehle-1.0.1.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c35342a9566cd589c03b2859f873f9e1c25cce0ed11e82d4df9a91b39865e09d
BLAKE2b-256 checksum
How to use checksums
9d8b8686980265a0224d2f43180abc2f96a01068e326d3ea55dce5502ed3faef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.2

Release files / purehle-1.0.1-py3-none-any.whl

Download URL purehle-1.0.1-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf6a03896b1789eb1c5e0f00e732395b584720a573ea9fa38622ee9fd6a6d0e8
BLAKE2b-256 checksum
How to use checksums
6c7d3a79ddafc5fa47deb9d2ac32ce2ee99344c707aa0234b5683a15ff2c2910
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.2

Release history Release notifications | RSS feed

This release

1.0.1 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