Forensics tools

Byte frequency & chi-square

Count how often each byte value appears and compare the distribution to uniform random. A chi-square test, not a verdict.

Runs on your device. The file is never uploaded.

Byte frequency & chi-square counts all 256 byte values in a file and measures how far that spread sits from uniform. The report lists the 16 commonest values with counts and percentages, and weighs the statistic against 293, the rough 0.05 critical value. No p-value is computed, and a flat spread fits compressed, encrypted and random bytes alike.

Input

Questions

What does the chi-square number tell me?

How far the file's byte distribution sits from a uniform one. Each of the 256 byte values is counted, the expected count is the file length divided by 256, and the statistic is the sum of (observed minus expected) squared over expected, with 255 degrees of freedom. Small means the bytes are spread evenly. Large means some values dominate, which is what text, code and structured formats look like.

Where does the cut-off of 293 come from?

It is the well-known rough 0.05 critical value for 255 degrees of freedom, used as a rule of thumb. Below it the report says the file is close to a uniform distribution, consistent with random, compressed or encrypted bytes. Above it, the file is far from uniform, consistent with structured, text or low-entropy data. No p-value is computed, so treat 293 as a signpost rather than a threshold to quote in a finding.

Does a uniform result mean the file is encrypted?

No. Compressed archives, media streams, random padding and encrypted blobs all flatten the byte distribution, and this statistic cannot separate them. It also says nothing about which algorithm was used or whether a key exists. Use it to decide that a region deserves attention, then identify it with Detect file type or Scan for embedded files.

What is the top byte values table?

The 16 most common byte values, sorted by count, each with its hex value, its count and its share of the file as a percentage. The header line also reports how many of the 256 possible values appear at all. A file where 0x00 or 0x20 dominates is padded or textual; a file where all 256 values appear at close to 0.39 percent each is flat.

Why do I only get "empty file"?

The file has zero bytes. There is nothing to count and no distribution to compare against, so the tool reports the file name and "empty file" rather than dividing by zero and printing a statistic that means nothing. If you expected content, the file was truncated, emptied or never written; compare its size against a known good copy.

Which tool should I run next?

Entropy analysis, if you want the same question answered per region rather than for the whole file. Chi-square here is one number for the entire input, so a small encrypted blob inside a large text file barely moves it. Entropy analysis breaks the file into blocks and reports each one, which is how you find the boundary.

Related Forensics tools