ppdeep
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 20260221
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ppdeep-20260221.tar.gz | 4.6 kB | Without provenance | Details for ppdeep-20260221.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ppdeep-20260221-py3-none-any.whl | Python 3 | none | any | Details for ppdeep-20260221-py3-none-any.whl |
Total release size: 9.3 kB
Release files / ppdeep-20260221.tar.gz
| Download URL | ppdeep-20260221.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8be1f4164b7ad2f7c40a51a664d3176701e40b2f9c1b96d18eeffaf06dfeff94
|
|
BLAKE2b-256 checksum How to use checksums |
ef6c4b97c7c1f7dcb4ee0c8d3534284e7f1a638dee6dccd5d0a8f7d9fa6dac3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / ppdeep-20260221-py3-none-any.whl
| Download URL | ppdeep-20260221-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e46d5130afeb0c73155568df9fcab41e2ff1ff04e95a29970b3da5b129f0ec34
|
|
BLAKE2b-256 checksum How to use checksums |
267871a6ae21b086f979ebf6a4f169c94f8e005e45df317cc6bc63187aae439e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Security for ppdeep 20260221
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.