Skip to main content

The python-wrapper for ssdeep

Project description

https://img.shields.io/github/license/drobotun/virustotalapi3?style=flat https://readthedocs.org/projects/pyssdeep/badge/?version=latest https://api.travis-ci.org/drobotun/pyssdeep.svg?branch=master&status=unknown https://codecov.io/gh/drobotun/pyssdeep/branch/master/graph/badge.svg?token=VHQQRO279Z

This package is a Python wrapper for ssdeep by Jesse Kornblum, which is a library for computing Context Triggered Piecewise Hashes (CTPH).

Installation

$ pip install pyssdeep

Usage

Get a fuzzy hash value for a string:

import pyssdeep

try:
    result = pyssdeep.get_hash_buffer(
        'The string for which you want to calculate a fuzzy hash'
    )
escept pyssdeep.FuzzyHashError as err:
    print(err)
except TypeError as err:
    print(err)
print('The fuzzy hash value is {}'.format(result))

Get a fuzzy hash value for a file:

import pyssdeep

try:
    result = pyssdeep.get_hash_file('e:/file.txt')
escept pyssdeep.FuzzyHashError as err:
    print(err)
except IOError as err:
    print(err)
print('The fuzzy hash value is {}'.format(result))

Get a fuzzy hash value for a file (using the pep 452 API):

import pyssdeep

buffer_size = 1024
fuzzy_hash_obj = pyssdeep.new()
with open('e:/file.txt', 'rb') as file:
    buffer = file.read(buffer_size)
    while len(buffer) > 0:
        fuzzy_hash_obj.update(buffer)
        buffer = file.read(buffer_size)
result = fuzzy_hash_obj.digest()

License

MIT Copyright (c) 2020 Evgeny Drobotun

Release hystory

1.0.0 (20.10.2020)

  • First release of ‘pyssdeep’

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

pyssdeep-1.0.0.tar.gz (181.9 kB view details)

Uploaded Source

Built Distribution

pyssdeep-1.0.0-py3-none-any.whl (187.2 kB view details)

Uploaded Python 3

File details

Details for the file pyssdeep-1.0.0.tar.gz.

File metadata

  • Download URL: pyssdeep-1.0.0.tar.gz
  • Upload date:
  • Size: 181.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.8

File hashes

Hashes for pyssdeep-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6e6d21538aafc2bae47588a093009fd9572495a4b3001892fa4770692123ad1c
MD5 46015a39d4684043cb7ae62f63bfbf50
BLAKE2b-256 129e2d9a39fa9071dd764c00bbd31acc51d5fc5b9d4b0eec3596c791a801ade8

See more details on using hashes here.

File details

Details for the file pyssdeep-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyssdeep-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 187.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.8

File hashes

Hashes for pyssdeep-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b97f844ef84de66780cecd0a1ff189202c3ce84f6bd3cad7a275fc640c4efb2
MD5 8f019adb83f45227828629d7fb24b775
BLAKE2b-256 1ba6af1c739fa604382b28168f820fd97ca9929f17bbac0feef45b0e8e7b3ccd

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