All Projects → DinoTools → python-ssdeep

DinoTools / python-ssdeep

Licence: LGPL-3.0 license
Python wrapper for ssdeep fuzzy hashing library

Programming Languages

c
50402 projects - #5 most used programming language
C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language
Roff
2310 projects
M4
1887 projects
Makefile
30231 projects
shell
77523 projects

Labels

Projects that are alternatives of or similar to python-ssdeep

ssdc
ssdeep cluster analysis for malware files
Stars: ✭ 24 (-82.22%)
Mutual labels:  ssdeep
MeltingPot
A tool to cluster similar executables (PEs, DEXs, and etc), extract common signature, and generate Yara patterns for malware detection.
Stars: ✭ 23 (-82.96%)
Mutual labels:  ssdeep

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].