Skip to main content

This is a pure-Python library for computing context triggered piecewise hashes (CTPH), also called fuzzy hashes, or often ssdeep after the name of a popular tool. At a very high level, fuzzy hashing is a way to determine whether two inputs are similar, rather than identical. Fuzzy hashes are widely adopted in digital forensics and malware detection.

This implementation is based on SpamSum by Dr. Andrew Tridgell.

Usage

To compute a fuzzy hash, simply use hash() function:

` >>> import ppdeep >>> h1 = ppdeep.hash('The equivalence of mass and energy translates into the well-known E = mc²') >>> h1 '3:RC0qYX4LBFA0dxEq4z2LRK+oCKI9VnXn:RvqpLB60dx8ilK+owX' >>> h2 = ppdeep.hash('The equivalence of mass and energy translates into the well-known E = MC2') >>> h2 '3:RC0qYX4LBFA0dxEq4z2LRK+oCKI99:RvqpLB60dx8ilK+oA' `

To calculate level of similarity, use compare() function which returns an integer value from 0 to 100 (full match):

` >>> ppdeep.compare(h1, h2) 34 `

Function hash_from_file() accepts a filename as argument and calculates the hash of the contents of the file:

` >>> ppdeep.hash_from_file('.bash_history') '1536:EXM36dG36x3KW732vOAcg3EP1qKlKozcK0z5G+lEPTssl/7eO7HOBF:tKlKozcWT0' `

Installation

` $ pip install ppdeep `

If you want to use the latest version of the code, you can install it from Git:

` $ git clone https://github.com/elceef/ppdeep.git $ cd ppdeep $ pip install . `

Metadata

Release files for ppdeep 20250622

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

Source distribution (sdist)

Source distribution for ppdeep 20250622
File Size Uploaded
ppdeep-20250622.tar.gz 4.4 kB Details

Built distribution (wheel)

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

Total release size: 8.9 kB

Release files / ppdeep-20250622.tar.gz

Download URL ppdeep-20250622.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
40a11c369f01f8ae5e13ed833af7e430c225f58fa04b77651aa49681e41ed46c
BLAKE2b-256 checksum
How to use checksums
002f673b0021cf84c37976cada5643c87ddb1c3f17695805612c3afc7a48d609
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

Release files / ppdeep-20250622-py3-none-any.whl

Download URL ppdeep-20250622-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bf5b3aef29cef859f65aa3f73177c739a2c442bd049a01728148b2a59a99ed7
BLAKE2b-256 checksum
How to use checksums
e636004999d5fc88c92fc093b393e9fd546458456bb9b110fc5fd52b8e8d72a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

Release history Release notifications | RSS feed

This release

20250622 This release

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