Skip to main content

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 20251115

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 20251115
File Size Uploaded Provenance Actions
ppdeep-20251115.tar.gz 4.4 kB Without provenance Details for ppdeep-20251115.tar.gz

Built distribution (wheel)

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

Total release size: 9.1 kB

Release files / ppdeep-20251115.tar.gz

Download URL ppdeep-20251115.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c6fdb5117b0eebfbe91a117b3c89f4de5d161a7a0c1a2d3023a065a676727b7c
BLAKE2b-256 checksum
How to use checksums
6a507a56c6309633f92f9e58ae60d76be5c1a01ade92ec33d49881eccff9b446
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-20251115-py3-none-any.whl

Download URL ppdeep-20251115-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
845c6b598ddcae0714992011cf856826690e3fd1c0bf80b38cecfaa9089c0d34
BLAKE2b-256 checksum
How to use checksums
79e63d549ea4bfa1ebbf3e0f8b8c18d5081026f24c9ff61c81e7603751bbd7a4
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

Security for ppdeep 20251115

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.

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