Skip to main content

Python wrapper for ssdeep library

Project description

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.

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

The hash_from_file accepts filename as argument and calculates the hash of the contents of the file.

>>> ssdeep.hash_from_file('/etc/resolv.conf')
'3:S3yE29cFrrMOoiECAaHJgvn:S3m+COoiUCuvn'

This wrapper includes the unchanged source distribution of ssdeep version 2.5 and has no external dependencies.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ssdeep-2.5.tar.gz (329.7 kB view details)

Uploaded Source

File details

Details for the file ssdeep-2.5.tar.gz.

File metadata

  • Download URL: ssdeep-2.5.tar.gz
  • Upload date:
  • Size: 329.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ssdeep-2.5.tar.gz
Algorithm Hash digest
SHA256 597bb1192da85bf476262156e433baf3b08de4552b52c81eb228b56e3f9374c2
MD5 fd9e5271c01ca389cc621ae306327ab6
BLAKE2b-256 aa0bb2a2459bb7c94e458a340e96baf9b77b0835efcaefc5acfc5d4b96eef077

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page