In the context of image encryption, high distortion between the original image ($I$) and its encrypted version ($I'$) is desired in image encryption. Therefore:
✅ High MSE (e.g., $> 6000$)
✅ High MAE (e.g., $> 100$)
✅ Low PSNR (e.g., $< 10–15 dB$ )
These values suggest that the encrypted image is statistically and visually very different from the original — which is exactly what you want for strong/good encryption.
References Supporting These Ranges:
Al-Husainy (2009) – "PSNR below 10 dB and high MSE (≥ 6000) are desirable for secure encryption."
Khan et al. (2014) – "Low PSNR (< 10–15 dB) and high MSE indicate effective image encryption."
Patidar et al. (2009) – Used MSE ≈ 8000–10000 and PSNR < 10 dB in encrypted images.
Are there any commonly accepted or theoretically justified ranges for these metrics (MSE, MAE, PSNR) when evaluating image encryption algorithms?
There are no strict standards (at least I'm aware of it), but these ranges are commonly reported in the literature as signs of good encryption.
...For instance, would a PSNR below 10 dB or an MSE above 7000 be considered appropriate or even desirable in encryption quality evaluation?
# Example: Ideal for encryption (grayscale, 8-bit)
MSE = 7000 # high → good
MAE = 120 # high → good
PSNR = 9.6 # low → good
Note: These metrics are not sufficient alone to assess encryption security. They should be complemented with statistical tests (entropy, histogram analysis, correlation) and cryptographic analyses (key sensitivity, brute-force resistance).
However, I experimented with this over a similar task in the below image and calculated the metrics using a Pythonic solution:
from PIL import Image
import numpy as np
import cv2
Load the image
image_path = "/content/task2.PNG"
Convert to grayscale for simplicity
original_img = Image.open(image_path).convert("L")
original_array = np.array(original_img)
Simple pixel manipulation for "encryption": invert pixel values
encrypted_array = 255 - original_array # basic encryption by inversion
Save the encrypted image
encrypted_image_path = "/content/encrypted_task2.png"
encrypted_img.save(encrypted_image_path)
Display the encrypted image
encrypted_img.show()
encrypted_image_path
Edit:
Clarifying the Use of "Encryption"
@Steffen Ullrich is right — the example using pixel inversion.
The pixel inversion example (255 - I) — not secure and off-topic.
encrypted_array = 255 - original_array # basic inversion
...is not true encryption, but rather a simple deterministic transformation used here for demonstration purposes only.
It uses no key, so it's not secure.
It's reversible without any secret.
️ It may produce high distortion, but does not offer any confidentiality.
What Proper Image Encryption Involves
Real image encryption should involve:
A secret key
Nonlinear operations (e.g., substitution-diffusion)
Possibly chaotic maps or cryptographic primitives (e.g., AES)
Resistance to attacks (statistical, differential, brute-force)
✅ Revised Example (Optional)
If you want to demonstrate real encryption-like behavior with a key, even a basic XOR with a pseudorandom key is a better toy example:
np.random.seed(42) # for reproducibility
key = np.random.randint(0, 256, size=original_array.shape, dtype=np.uint8)
encrypted_array = np.bitwise_xor(original_array, key)
This:
TL;DR:
Pixel inversion is not only encryption — it was used to highlight the behavior of distortion metrics. For actual encryption evaluation, use key-dependent, secure transformations. Some authors demonstrate these metrics using example images, but it’s essential to use key-based transformations for any realistic evaluation.
outputs:
 |
 |
| Fig. 1: Original input image ($I$). |
Fig. 2: After pixel manipulation [encrypted image ($I'$)]. |
But in encryption, it's the opposite: we want the encrypted image to be totally scrambled, looking nothing like the original — so we maximize errors.
– Mario Apr 17 '25 at 13:58