Giter Club home page Giter Club logo

pyssdeep's Introduction

The python-wrapper for ssdeep

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

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

pyssdeep's People

Contributors

drobotun avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.