mrshw


Namemrshw JSON
Version 0.1.0b4 PyPI version JSON
download
home_pageNone
SummaryPython bindings for MRSH: a fast, modular similarity digest tool for malware analysis
upload_time2025-08-05 11:27:24
maintainerNone
docs_urlNone
authorw4term3loon
requires_python>=3.7
licenseNone
keywords similarity hashing malware detection sdhash tlsh binary analysis ctypes python bindings
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # mrshw

Thin, ctypes-based Python bindings for the [mrsh CLI tool](https://github.com/w4term3loon/mrsh). 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.

> [!IMPORTANT]
> For a more complete api ducumentation please refer to [docs/api.md](./docs/api.md)

---

## Installation

Install from PyPI:

```bash
pip install mrshw
```

Or directly from GitHub (tagged release `v0.1.0b4`):

```bash
pip install git+https://github.com/w4term3loon/mrsh.git@v0.1.0b4
```

---

## Quickstart

```python
import mrshw as mrsh

# 1. Single-fingerprint API
fp = mrsh.fp("path/to/file.bin")
print(str(fp))            # raw metadata + hex-encoded Bloom filters
print(fp.meta())          # Metadata(name, filesize, filter_count)

# 2. Quick hash helper
print(mrsh.hash("path/to/file.bin"))

# 3. Fingerprint-list API
fpl = mrsh.fpl()
fpl += "a.bin"
fpl += ("b.bin", "label_b")
fpl += open('c.bin', 'rb').read()
print(str(fpl))           # one line per fingerprint

# 4. Compare two fingerprints
cmp = mrsh.compare(fp, mrsh.fp("other.bin"))
print(cmp.hash1, cmp.hash2, cmp.score)

# 5. Compare all in a list
results = fpl.compare_all(threshold=10)
for comp in results:
    print(comp.hash1, comp.hash2, comp.score)
```

---

## License

* **Wrapper code:** MIT License. See the [LICENSE file](https://github.com/w4term3loon/mrsh/blob/master/bindings/LICENSE) for full terms.
* **Underlying C library:** Apache License 2.0. See its [repository license](https://github.com/w4term3loon/mrsh/blob/master/LICENSE.md).


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mrshw",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "similarity hashing, malware detection, sdhash, tlsh, binary analysis, ctypes, python bindings",
    "author": "w4term3loon",
    "author_email": "ifkovics.barnabas@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/8c/fe/8280fc55e9d5be8255bef30c6e44f5a2e76cd628f7a898d6eea490ed1a8b/mrshw-0.1.0b4.tar.gz",
    "platform": null,
    "description": "# mrshw\n\nThin, ctypes-based Python bindings for the [mrsh CLI tool](https://github.com/w4term3loon/mrsh). Implements the Bloom-filter\u2013based 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\u2013based fingerprinting directly from Python with minimal overhead.\n\n> [!IMPORTANT]\n> For a more complete api ducumentation please refer to [docs/api.md](./docs/api.md)\n\n---\n\n## Installation\n\nInstall from PyPI:\n\n```bash\npip install mrshw\n```\n\nOr directly from GitHub (tagged release `v0.1.0b4`):\n\n```bash\npip install git+https://github.com/w4term3loon/mrsh.git@v0.1.0b4\n```\n\n---\n\n## Quickstart\n\n```python\nimport mrshw as mrsh\n\n# 1. Single-fingerprint API\nfp = mrsh.fp(\"path/to/file.bin\")\nprint(str(fp))            # raw metadata + hex-encoded Bloom filters\nprint(fp.meta())          # Metadata(name, filesize, filter_count)\n\n# 2. Quick hash helper\nprint(mrsh.hash(\"path/to/file.bin\"))\n\n# 3. Fingerprint-list API\nfpl = mrsh.fpl()\nfpl += \"a.bin\"\nfpl += (\"b.bin\", \"label_b\")\nfpl += open('c.bin', 'rb').read()\nprint(str(fpl))           # one line per fingerprint\n\n# 4. Compare two fingerprints\ncmp = mrsh.compare(fp, mrsh.fp(\"other.bin\"))\nprint(cmp.hash1, cmp.hash2, cmp.score)\n\n# 5. Compare all in a list\nresults = fpl.compare_all(threshold=10)\nfor comp in results:\n    print(comp.hash1, comp.hash2, comp.score)\n```\n\n---\n\n## License\n\n* **Wrapper code:** MIT License. See the [LICENSE file](https://github.com/w4term3loon/mrsh/blob/master/bindings/LICENSE) for full terms.\n* **Underlying C library:** Apache License 2.0. See its [repository license](https://github.com/w4term3loon/mrsh/blob/master/LICENSE.md).\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python bindings for MRSH: a fast, modular similarity digest tool for malware analysis",
    "version": "0.1.0b4",
    "project_urls": {
        "Bug Tracker": "https://github.com/w4term3loon/mrsh/issues",
        "Documentation": "https://github.com/w4term3loon/mrsh",
        "Source": "https://github.com/w4term3loon/mrsh"
    },
    "split_keywords": [
        "similarity hashing",
        " malware detection",
        " sdhash",
        " tlsh",
        " binary analysis",
        " ctypes",
        " python bindings"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5d9f885395f62440d06a1ecdef09c1cd57e1da0dc4651b9663423496a024db11",
                "md5": "2f3b8e29591d3f27210952804dce0762",
                "sha256": "6820e727c7f88b9e3c0259f6dfc1200656fe883ea28cbed8233466d0e2b58ce8"
            },
            "downloads": -1,
            "filename": "mrshw-0.1.0b4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2f3b8e29591d3f27210952804dce0762",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 17829,
            "upload_time": "2025-08-05T11:27:23",
            "upload_time_iso_8601": "2025-08-05T11:27:23.526768Z",
            "url": "https://files.pythonhosted.org/packages/5d/9f/885395f62440d06a1ecdef09c1cd57e1da0dc4651b9663423496a024db11/mrshw-0.1.0b4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8cfe8280fc55e9d5be8255bef30c6e44f5a2e76cd628f7a898d6eea490ed1a8b",
                "md5": "88ae39d91d2c4a4f9471c29ce4db1072",
                "sha256": "13866a8d65f1c536de785d238683be713cfdaa3f167942d3e38bbcf565c01538"
            },
            "downloads": -1,
            "filename": "mrshw-0.1.0b4.tar.gz",
            "has_sig": false,
            "md5_digest": "88ae39d91d2c4a4f9471c29ce4db1072",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 19492,
            "upload_time": "2025-08-05T11:27:24",
            "upload_time_iso_8601": "2025-08-05T11:27:24.579139Z",
            "url": "https://files.pythonhosted.org/packages/8c/fe/8280fc55e9d5be8255bef30c6e44f5a2e76cd628f7a898d6eea490ed1a8b/mrshw-0.1.0b4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-05 11:27:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "w4term3loon",
    "github_project": "mrsh",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "mrshw"
}
        
Elapsed time: 1.18735s