Cross-platform entropy calculation script with filtering and custom-block size options.
- numpy
- Python 2 (not tested on 3)
- Windows/Linux
##Installation ###Linux
pip install numpy
wget https://raw.githubusercontent.com/yarox24/binent/master/binent.py
chmod +x binent.py
###Windows Check out pre-packaged executables: https://github.com/yarox24/binent/releases
- calculation of files of any size require 64-bit version of Python
Calculate/interpret entropy of single file:
binent.py unk.zip
Calculate entropy of single file with custom defined block-size = 10M(B):
binent.py -c 10M large.iso")
Calculate entropy of files inside directory (non-recursive):
binent.py mp3_dir
Calculate entropy for files in directory and sub-directories (recursive):
binent.py -r starting_directory
Find files with high entropy:
binent.py -e -r -l 7.99 starting_directory
For more usages check options
positional arguments:
sources file1 file2 non_empty_dir/ [...]
optional arguments:
-h, --help show this help message and exit
-c CHUNK, --chunk CHUNK
Fixed block-size (e.g. 256, 15K, 20M, 30G) Default: whole file
-r, --recursive Recursive traversal
-l LOW_LIMIT, --low_limit LOW_LIMIT
Show only entries with entropy >= limit (Default: 1.0)
-u UPPER_LIMIT, --upper_limit UPPER_LIMIT
Show only entries with entropy <= limit (Default: 8.0)
-e, --suppress_errors
Don't show any exceptions/errors and also empty files