Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ssdeep

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ssdeep

Python wrapper for the ssdeep library

  • 3.4
  • PyPI
  • Socket score

Maintainers
2

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.

.. image:: https://img.shields.io/pypi/v/ssdeep.svg :target: https://pypi.python.org/pypi/ssdeep/ :alt: Latest Version

.. image:: https://img.shields.io/pypi/l/ssdeep.svg :target: https://pypi.python.org/pypi/ssdeep/ :alt: License

.. image:: https://img.shields.io/pypi/pyversions/ssdeep.svg :target: https://pypi.python.org/pypi/ssdeep/ :alt: Python Versions

.. image:: https://readthedocs.org/projects/python-ssdeep/badge/ :target: https://python-ssdeep.readthedocs.io/en/latest/ :alt: Latest Docs

.. image:: https://travis-ci.org/DinoTools/python-ssdeep.svg?branch=master :target: https://travis-ci.org/DinoTools/python-ssdeep

.. image:: https://ci.dinotools.org/buildStatus/icon?job=python-ssdeep-master :target: https://ci.dinotools.org/job/python-ssdeep-master/ :alt: Build state

How to use it

To compute a fuzzy hash, use hash function:

.. code-block:: pycon

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

.. code-block:: pycon

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

.. code-block:: console

$ 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.

.. code-block:: console

$ 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.

.. code-block:: console

$ 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.

.. _ssdeep by Jesse Kornblum: https://ssdeep-project.github.io/ssdeep/ .. _ssdeep version 2.14.1: https://github.com/ssdeep-project/ssdeep/releases/tag/release-2.14.1 .. _python-ssdeep documentation: https://python-ssdeep.readthedocs.io

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc