Skip to main content

ssdeep Python Wrapper

This is a straightforward Python wrapper for ssdeep by Jesse Kornblum, which is a library for computing context triggered piecewise hashes (CTPH). Also called fuzzy hashes, CTPH can match inputs that have homologies. Such inputs have sequences of identical bytes in the same order, although bytes in between these sequences may be different in both content and length.

Latest Version License Python Versions Latest Docs CodeQL tests CI test status on Linux CI test status on Debian CI test status on Debian

How to use it

To compute a fuzzy hash, use hash function:

>>> import ssdeep
>>> hash1 = ssdeep.hash('Also called fuzzy hashes, Ctph can match inputs that have homologies.')
>>> hash1
'3:AXGBicFlgVNhBGcL6wCrFQEv:AXGHsNhxLsr2C'
>>> hash2 = ssdeep.hash('Also called fuzzy hashes, CTPH can match inputs that have homologies.')
>>> hash2
'3:AXGBicFlIHBGcL6wCrFQEv:AXGH6xLsr2C'

The compare function returns the match between 2 hashes, an integer value from 0 (no match) to 100.

>>> ssdeep.compare(hash1, hash2)
22

More examples are available in the python-ssdeep documentation.

Install

If all requirements are met it is possible to install the wrapper by using pip or easy_install.

$ pip install ssdeep

The build will fail if the ssdeep library isn’t installed. To use the included version of the ssdeep library use the following command.

$ BUILD_LIB=1 pip install ssdeep

For more information have a look at the python-ssdeep documentation.

Tested on …

  • CentOS 7

  • Debian 8, 9

  • Ubuntu 14.04, 16.04, 18.04

Documentation

Feel free to use the prebuild python-ssdeep documentation or use the steps below to build the documentation.

$ cd docs
$ pip install -r requirements.txt
$ make html

Licensing

The code is licensed under the terms of the LGPLv3+.

This wrapper includes the unchanged source distribution of ssdeep version 2.14.1. It is licensed under the GPLv2.

Release files for thoth-ssdeep 3.4.1

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

Built distribution (wheel)

Table of built distributions (wheels) for thoth-ssdeep 3.4.1
File Interpreter ABI Platform
thoth_ssdeep-3.4.1-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details

Release files / thoth_ssdeep-3.4.1-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL thoth_ssdeep-3.4.1-cp311-cp311-manylinux_2_28_x86_64.whl
Size 33.7 kB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
8df0b32c5b6aaa6423a0b053d2bd6949e26a7db8e398a89a0a509de9575f9ddf
BLAKE2b-256 checksum
How to use checksums
39d73ba1597a293c13db0cc735f3991a00a0432d43fb1fd9603187aa8e604761
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.6

Release history Release notifications | RSS feed

This release

3.4.1 This release

1 release file

3.4

5 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