Bintropy 
Detect packers on PE/ELF/Mach-O files using entropy.
This tool is an implementation in Python of Bintropy, an analysis tool presented in this paper in the scope of packing detection based on entropy. It implements both modes of operation and an additional one, respectively on the entire binary, per section or per segment. It uses the entropy values mentioned in the paper for deciding whether the binary contains compressed/encrypted bytes.
It relies on lief for abstracting either PE, ELF or Mach-O executables. This tool thus supports these three formats.
$ pip install bintropy
$ bintropy --help
Modes of operation
Use the -m/--mode option.
0: full binary (default)1: per section2: per segment
Note that mode 2 will logically give results very similar to mode 0.
$ bintropy binary
<<< boolean >>>
$ bintropy binary --do-not-decide
<<< highest block entropy, average block entropy >>>
$ bintropy binary --mode [1|2]
<<< boolean >>>
$ bintropy binary -m [1|2] --do-not-decide
<<< highest block entropy, average block entropy >>>
Benchmarking
Use the -b/--benchmark option to get one more value, the processing time in seconds.
$ bintropy binary -b
<<< boolean, processing time >>>
$ bintropy binary -b --do-not-decide
<<< highest block entropy, average block entropy, processing time >>>
Overriding default entropy values
The reference paper uses 6.677 for the average block entropy and 7.199 for the highest block entropy (obtained by analyzing a dataset of PE files and using the first mode of operation). These values can be overriden with the dedicated options.
$ bintropy binary --threshold-average-entropy 5.678 --threshold-highest-entropy 6.789
[...]
Plotting
This tool features plot generation for drawing binary's sections and the entropy within.
$ bintropy binary --plot
<<< boolean >>>
Example of generated figures:
Related Projects
You may also like these:
- Awesome Executable Packing: A curated list of awesome resources related to executable packing.
- Dataset of packed ELF files: Dataset of ELF samples packed with many different packers.
- Dataset of packed PE files: Dataset of PE samples packed with many different packers (fork of this repository).
- Docker Packing Box: Docker image gathering packers and tools for making datasets of packed executables.
- DSFF: Library implementing the DataSet File Format (DSFF).
- PEiD: Python implementation of the well-known Packed Executable iDentifier (PEiD).
- PyPackerDetect: Packing detection tool for PE files (fork of this repository).
- REMINDer: Packing detector using a simple heuristic (inspired from this paper).
Metadata
Release files for bintropy 1.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bintropy-1.6.0.tar.gz | 252.2 kB | With provenance | Details for bintropy-1.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bintropy-1.6.0-py3-none-any.whl | Python 3 | none | any | Details for bintropy-1.6.0-py3-none-any.whl |
Total release size: 292.5 kB
Release files / bintropy-1.6.0.tar.gz
| Download URL | bintropy-1.6.0.tar.gz |
|---|---|
| Size | 252.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
864d0141cdf0aaa07880287261bb09e35341ef49077aab7767666e99271d580c
|
|
BLAKE2b-256 checksum How to use checksums |
b38a3a61174782eaeed8b079d334708f8ba1cf271690f72a84cfbae54e9397f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logRelease files / bintropy-1.6.0-py3-none-any.whl
| Download URL | bintropy-1.6.0-py3-none-any.whl |
|---|---|
| Size | 40.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4ede2d6c25b39f0a9e381a9feca7dcfed4f49d1e9230e1422df4137d0ecd2652
|
|
BLAKE2b-256 checksum How to use checksums |
01467a88b3d65f124ea601484303e35b4f8c4a4b6bd108a88715126499080abc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logSecurity for bintropy 1.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for bintropy-1.6.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.