Python bindings for MRSHv2: modular similarity digest tool for malware analysis, forensics and much more
Project description
mrshw
Thin, ctypes-based Python bindings for the mrsh CLI tool. Implements the Bloom-filter–based similarity hashing algorithm originally proposed by Frank Breitinger and Harald Baier in their paper Similarity Preserving Hashing: Eligible Properties and a new Algorithm MRSH-v2 (da/sec Biometrics and Internet Security Research Group, Hochschule Darmstadt). Use Bloom-filter–based fingerprinting directly from Python with minimal overhead.
Installation
Install from PyPI:
pip install mrshw
Or directly from GitHub (tagged release v1.0.0):
pip install git+https://github.com/w4term3loon/mrsh.git@v1.0.0
Quick start
import mrsh
# Target
file = "file.bin"
# Generate hash
hash_path = mrsh.hash(file) # labeled: 'file.bin'
hash_binary = mrsh.hash(open(file, 'rb').read())
# Arbitrary binary data hash
hash_labeled_binary = mrsh.hash((b"cafebabe", data_name))
# Calculate similarity score
similarity_score = mrsh.diff(hash_path, hash_binary)
assert(similarity_score == 100)
# Create and compare hashes with metadata
fp1 = mrsh.Fingerprint("file1.bin")
fp2 = mrsh.Fingerprint("file2.bin")
similarity = fp1.compare(fp2)
# Batch operations
fpl = mrsh.FingerprintList()
fpl.add("file1.bin")
fpl.add("file2.bin")
results = fpl.compare_all(threshold=50)
License
- Wrapper code: MIT License. See the LICENSE file for full terms.
- Underlying C library: Apache License 2.0. See its repository license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mrshw-1.0.0.tar.gz.
File metadata
- Download URL: mrshw-1.0.0.tar.gz
- Upload date:
- Size: 24.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9386053bb01c669fa0cb089f754342245ff6622d16f856a725a6b03116f7541d
|
|
| MD5 |
c9ac855fbeb7052ac2d435015f6ea3e0
|
|
| BLAKE2b-256 |
ccec90464f92ffe8a8f4a4cadd5df7f08eacc06451e195dcad23c69a3551fd73
|
File details
Details for the file mrshw-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mrshw-1.0.0-py3-none-any.whl
- Upload date:
- Size: 23.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea34d8571a74eee8cc6663368bf5cad99d7ac5389244b8c67aa86f637a2497f9
|
|
| MD5 |
1fee7eb4fc205b8042e0504f19b46697
|
|
| BLAKE2b-256 |
60477a2cad7163f7681878613c1f4e6715e9f245dcdfa652e51a7771f61476a5
|