Skip to main content

Pure-Python library for computing fuzzy hashes (ssdeep)

Project description

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. Andrews Tridgell.

Usage

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

`python >>> 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):

`python >>> ppdeep.compare(h1, h2) 29 `

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

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

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

ppdeep-20200503.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

ppdeep-20200503-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file ppdeep-20200503.tar.gz.

File metadata

  • Download URL: ppdeep-20200503.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.1.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.7.5

File hashes

Hashes for ppdeep-20200503.tar.gz
Algorithm Hash digest
SHA256 86f7e0739cf0d6cdae1a9f1e58eddd63eccaa5a2767329f1d24638c8bd536a86
MD5 bbb5817f89dbd90fa8622ccc7dc156ac
BLAKE2b-256 d2da21eb561f5aaaebf5bc0f67a7761eff672bdd3f9e06306b4272ca367c1e14

See more details on using hashes here.

File details

Details for the file ppdeep-20200503-py3-none-any.whl.

File metadata

  • Download URL: ppdeep-20200503-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.1.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.7.5

File hashes

Hashes for ppdeep-20200503-py3-none-any.whl
Algorithm Hash digest
SHA256 4a36c8fc41b9a1d4d5f4e61f7b459e4394db9037955b2124ef40003f9a582393
MD5 942c9a1e008bdabc0b0c9e313762967e
BLAKE2b-256 ec8e982110280f30f47ad0d42693709329b1da142b2759818234597fc31f92f2

See more details on using hashes here.

Supported by

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