Code Monkey home page Code Monkey logo

binent's Introduction

binent

Cross-platform entropy calculation script with filtering and custom-block size options.

Requirements

  • numpy
  • Python 2 (not tested on 3)
  • Windows/Linux

Demo

demo/demo.gif

##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

Limitations

  • calculation of files of any size require 64-bit version of Python

Usage

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

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

binent's People

Contributors

yarox24 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

derduffy otilrac

binent's Issues

false positive

I wrote the following script that generate a file the gives false positive results:

`

import struct

 with open('not_encrypted.s','wb') as s:
      for i in range(1000):

          for j in range(256):

               s.write(struct.pack('B', j))

`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.