Source-linked AI summary
Shannon Entropy based Randomness Measurement and Test for Image Encryption
Yue Wu, Joseph P. Noonan, Sos Agaian
TL;DR
Global Shannon entropy does not assess local-block randomness and cannot directly determine whether an encrypted image is sufficiently random-like. The paper introduces a block-entropy measurement with true-random reference statistics and a significance-level hypothesis test. Simulations show that its block entropy agrees with human assessments of scrambled-image randomness and is more reliable than global entropy testing.
Problem
Existing image-encryption quality measures do not adequately assess local-block randomness or determine whether a ciphertext is sufficiently random-like.
Method
The method averages entropies from randomly selected non-overlapped image blocks, derives true-random expectation and variance, and applies an α-level hypothesis test.
Results
Block entropy scores match human visual assessments of scrambled-image randomness, while conventional FIPS 140-2 testing does not reliably identify whether images are ideally encrypted.
Takeaways & Limitations
The block entropy test provides more reliable randomness measures for local image blocks than the global entropy test.
Takeaways & Limitations
The normal approximation used by the test is limited when the number of sampled blocks K is insufficiently large.
Abstract
from arXiv · showhide
The quality of image encryption is commonly measured by the Shannon entropy over the ciphertext image. However, this measurement does not consider to the randomness of local image blocks and is inappropriate for scrambling based image encryption methods. In this paper, a new information entropy-based randomness measurement for image encryption is introduced which, for the first time, answers the question of whether a given ciphertext image is sufficiently random-like. It measures the randomness over the ciphertext in a fairer way by calculating the averaged entropy of a series of small image blocks within the entire test image. In order to fulfill both quantitative and qualitative measurement, the expectation and the variance of this averaged block entropy for a true-random image are strictly derived and corresponding numerical reference tables are also provided. Moreover, a hypothesis test at significance-level is given to help accept or reject the hypothesis that the test image is ideally encrypted/random-like. Simulation results show that the proposed test is able to give both effectively quantitative and qualitative results for image encryption. The same idea can also be applied to measure other digital data, like audio and video.
1. Introduction
Existing randomness tests are poorly suited to two-dimensional, redundant image data and often indicate only relative entropy, not whether ciphertext is sufficiently random-like. The paper proposes a block-based Shannon entropy test with true-random references and hypothesis testing to provide quantitative and qualitative assessments.
- Image ciphertext should be random-like because weak, non-random-like ciphertext can enable frequency, ciphertext-only, and known-ciphertext attacks.
- Conventional binary-sequence randomness tests are inappropriate for images because images are two-dimensional, contain neighboring-pixel redundancy, and are bulk data.
- Prevailing image-encryption tests commonly provide quantitative values without answering whether a ciphertext is sufficiently random-like.For example, entropy scores of 7.9911 and 7.9912 show a relative difference but not statistical sufficiency.
- The method derives true-random reference statistics and supplies an α-level hypothesis test for both quantitative and qualitative randomness decisions.The true-random model assumes independently and identically uniformly distributed pixel intensities; CLT and BET address the sample-mean approximation.
- The proposed measurement averages Shannon entropies from K randomly selected non-overlapped local image blocks instead of using only global image information.It is designed for image data and is intended to apply to permutation and substitution ciphers.
- Computer simulations validate the effectiveness of the block entropy test on commercial image ciphers and image-encryption algorithms.
2. Background
The background defines Shannon entropy as a distribution-based randomness measure and explains the CLT/BET foundations used to construct the paper’s statistical test. For images, entropy reaches its theoretical maximum under uniformly distributed pixel intensities.
- Shannon Entropy and Properties: Shannon entropy quantifies the expected information in a random variable from the probabilities of its possible values.For image X, P_l equals the count of pixels at intensity l divided by the total number of pixels.
- Shannon Entropy and Properties: Image entropy is computed from the distribution of pixel-intensity probabilities and is equivalent to histogram analysis.
- Shannon Entropy and Properties: Entropy is maximized when every intensity scale is equally likely, with an ideally encrypted image reaching log2 L.
- Central Limit Theorem and Berry-Esseen Theorem: The Central Limit Theorem states that a sample mean approaches a normal distribution with mean µ and variance σ2/n as sample size increases.This remains true even when the underlying probability density function is not normal.
- Central Limit Theorem and Berry-Esseen Theorem: The standardized statistic Z_n is used in hypothesis tests, where its limiting distribution is N(0, 1) and the resulting procedure is called the Z-test.
- Central Limit Theorem and Berry-Esseen Theorem: The Berry-Esseen Theorem bounds the difference between the sample-mean distribution and the standard normal distribution for finite sample sizes.Its convergence-rate bound depends on the specified constant and the distribution’s finite mean, variance, and associated third-moment quantity.
3. Information Entropy based Randomness Test for Image Encryption
The paper defines ideal encryption through true-random-like pixel statistics and tests local randomness by averaging Shannon entropy across sampled image blocks. It derives reference statistics and a hypothesis test to evaluate whether ciphertext is ideally encrypted/random-like.
- 3.1. Ideally Encrypted Image: An ideally encrypted image is treated as statistically indistinguishable from a true random image, without claiming it is literally random.The model requires independently and identically distributed pixels with a discrete uniform distribution over intensity scales.
- 3.1. Ideally Encrypted Image: True-random images should have high Shannon entropy not only globally but also within image blocks.The paper identifies low-entropy local blocks as evidence that an image is not ideally encrypted/random-like, even when global entropy is high.
- 3.1. Ideally Encrypted Image: A ciphertext can have entropy 7.99373, close to the 8-bit upper bound, yet global entropy remains insufficient to establish ideal encryption.The example shows that a weakly encrypted region can leave ciphertext distributions largely unchanged while leaking recognizable information.
- 3.2. Block Entropy Test for Image Encryption: The block entropy test samples K non-overlapping M-by-N regions, computes each block's Shannon entropy, and averages the K values as H_K.Random coverage supports measuring local randomness across the image, while the compact statistic keeps computational cost low.
- 3.2.1. Theoretical Mean and Variance of H∗: For ideal-cipher blocks, the theoretical mean and variance of entropy are determined by block size MN and the number of intensity scales L.The derivation uses binomial pixel-count statistics and obtains the entropy moments for individual blocks and their sample mean.
- 3.2.2. Numerical Mean and Variance of H∗: As MN increases, expected block entropy approaches its upper bound while entropy variance approaches zero; however, large blocks can conceal low entropy at smaller scales.The Pattern image reaches the entropy upper bound at 256-by-256 while remaining much lower than the other images for smaller blocks.
- 3.2.2. Numerical Mean and Variance of H∗: The block entropy comparison demonstrates why global entropy is inappropriate for image-randomness and encryption-quality testing.The proposed test is also applicable to image shuffling, including permutation-based methods.
4. Simulation Results
The simulations apply the block entropy test to image shuffling and encrypted images, showing that local-block entropy tracks visual randomness more effectively than global entropy or binary-sequence tests. Across 28 test images, image ciphers generally outperform binary-data block ciphers, while Sudoku consistently produces random-like ciphertext.
- Measure the Quality of Image Shuffling: The block entropy test measures encrypted-image randomness quantitatively and qualitatively, including for image-shuffling algorithms.The test calculates averaged randomness over local image blocks and is intended to correspond with human visual inspection.
- Measure the Quality of Image Shuffling: Global Shannon entropy is ill-posed for shuffling-based encryption because shuffling preserves global image statistics.Conventional binary-sequence randomness tests likewise do not directly resolve whether shuffled images are sufficiently random-like.
- Measure the Quality of Image Shuffling: Higher block entropy scores indicate greater local-block randomness and better shuffling quality, matching human visual inspections more robustly than conventional binary-sequence tests.The Tufts-logo example uses the block entropy test to distinguish randomness tendencies that are difficult to infer from binary-test statistics alone.
- Test the Randomness of Image Encryption: Binary-data block ciphers have much lower mean H100 and larger standard deviations than image ciphers, supporting their inappropriateness for image data.The tested binary-data ciphers are Blowfish, AES, and Twofish; the image-oriented methods include 3DCat and Sudoku.
5. Conclusion
The block entropy test measures local image-block randomness and compares the sample mean with theoretical reference values for quantitative and qualitative conclusions. Simulations report meaningful results for scrambled images and distinguish the performance of image ciphers from binary-data block ciphers.
- Method: The block entropy test averages information entropies over K non-overlapped image blocks and compares HK with reference theoretical values.This design targets local randomness within the test image rather than only global entropy.
- Method: Theoretical expectations and variances of HK are derived from an ideally encrypted or true-random image model.The model assumes each pixel intensity follows a discrete uniform distribution over [0, L −1].
- Method: An α-level hypothesis test checks whether HK is below the critical value Hc, while an upper bound for Type I error γ is provided.The quantitative result compares HK with the theoretical mean, and the qualitative result uses Hc.
- Results: Block entropy scores for scrambled test images matched randomness extents judged by human visual inspection, unlike conventional FIPS 140-2 tests.The reported comparison supports quantitative assessment of scrambled-image randomness.
- Results: For five image ciphers, binary-data block ciphers produced H100 far below the theoretical mean μH*100 for many test images.Their qualitative results were also reported as very poor, whereas image ciphers such as ’3Dcat’ and ’Sudoku’ performed better.
- Results: The ’Sudoku’ image cipher was the only tested cipher that always generated random-like ciphertext images.The simulations support the block entropy test as an effective measure of image randomness.