Skip to main content

Bintropy Tweet

Detect packers on PE/ELF/Mach-O files using entropy.

PyPi Python Versions Build Status Security DOI License

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 section
  • 2: 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:

You may also like these:

Back to top

Metadata

Release files for bintropy 1.5.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bintropy 1.5.9
File Size Uploaded Provenance Actions
bintropy-1.5.9.tar.gz 205.3 kB With provenance Details for bintropy-1.5.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bintropy 1.5.9
File Interpreter ABI Platform Actions
bintropy-1.5.9-py3-none-any.whl Python 3 none any Details for bintropy-1.5.9-py3-none-any.whl

Total release size: 245.1 kB

Release files / bintropy-1.5.9.tar.gz

Download URL bintropy-1.5.9.tar.gz
Size 205.3 kB
Tags Source
SHA-256 checksum
How to use checksums
796146af75c52177da76cd892b5f9b137b7b300baf5b98ed8fde4ad01a964fe8
BLAKE2b-256 checksum
How to use checksums
d52e839626cebef1d15cbf1b79cab66180af792b445bf53a077d7e19cc3457b9
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 log

Release files / bintropy-1.5.9-py3-none-any.whl

Download URL bintropy-1.5.9-py3-none-any.whl
Size 39.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75950298849207c4c3ad0805a62b7d2195d9b49ef0f9c011d404d90328dac02d
BLAKE2b-256 checksum
How to use checksums
cb9ce9da8228a33d176afca2ee687439bfd7326f84a39134aa11aee861245bd8
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 log

Security for bintropy 1.5.9

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.

Select from 2 files

Attestation for bintropy-1.5.9.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 log

A 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.

Release history Release notifications | RSS feed

This release

1.5.9 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page