Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elceef/ppdeep
Pure-Python library for computing fuzzy hashes (ssdeep)
https://github.com/elceef/ppdeep
fuzzy-hashes library python ssdeep
Last synced: 2 months ago
JSON representation
Pure-Python library for computing fuzzy hashes (ssdeep)
- Host: GitHub
- URL: https://github.com/elceef/ppdeep
- Owner: elceef
- Created: 2020-05-03T10:20:23.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-04-21T08:22:25.000Z (almost 4 years ago)
- Last Synced: 2024-11-06T00:55:11.731Z (3 months ago)
- Topics: fuzzy-hashes, library, python, ssdeep
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 35
- Watchers: 3
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ppdeep
======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. Andrew Tridgell.
Usage
-----To compute a fuzzy hash, simply use `hash()` function:
```
>>> 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):```
>>> ppdeep.compare(h1, h2)
29
```Function `hash_from_file()` accepts a filename as argument and calculates the
hash of the contents of the file:```
>>> ppdeep.hash_from_file('.bash_history')
'1536:EXM36dG36x3KW732vOAcg3EP1qKlKozcK0z5G+lEPTssl/7eO7HOBF:tKlKozcWT0'
```Installation
------------```
$ pip install ppdeep
```If you want to use the latest version of the code, you can install it from Git:
```
$ git clone https://github.com/elceef/ppdeep.git
$ cd ppdeep
$ pip install .
```