I am trying to compare various encryption algorithms in terms of encryption duration, decryption duration, information entropy, NPCR, UACI, and correlation coefficients.
I used a Lena 256x256 grayscale PNG image as the test image, and ran my Python code on macOS X with an i7 CPU and 8 GiB RAM. I found and used implementations of DES, AES, Simon, Speck, TEA, and XTEA from PyPI, and KATAN and LEA implementations from GitHub.
Import statements indicating libraries:
from tea_encrypt import EncryptStr, DecryptStr
from speck import SpeckCipher
from simon import SimonCipher
from xtea import *
from Crypto.Cipher import AES
from Crypto.Cipher import DES
Resulting in:
Alg. | En. durr. | De. durr. | Ent. | NPCR | UACI | H.CC | V.CC | D.CC |
---|---|---|---|---|---|---|---|---|
des | 1.0261 | 0.9338 | 7.9973 | 0.0122 | 0.0031 | -0.0004 | 0.0099 | -0.0064 |
aes | 0.5620 | 0.4911 | 7.9973 | 0.0244 | 0.0101 | 0.0187 | 0.0042 | -0.0043 |
katan | 2152.3804 | 2248.2334 | 7.9977 | 0.0122 | 0.0026 | 0.0002 | 0.0156 | -0.0033 |
speck | 153.3481 | 175.8376 | 7.9967 | 0.0244 | 0.0088 | -0.0111 | -0.0019 | -0.0210 |
simon | 316.7725 | 317.3580 | 7.9973 | 0.0244 | 0.0082 | 0.0111 | 0.0009 | -0.0210 |
teaX | 477.2510 | 398.1741 | 7.9969 | 0.015 | 0.0000 | -0.0056 | 0.0124 | -0.0117 |
tea | 43.7451 | 45.8320 | 7.9954 | 99.2567 | 33.3407 | -0.0050 | -0.0121 | -0.0129 |
lea | 6761.5435 | 6721.6113 | 7.9970 | 99.6323 | 33.4440 | 0.0047 | 0.0147 | -0.0080 |
Legend:
- Encryption and decryption duration displayed in milliseconds
- NPCR: (Number of) Pixel Changing Rate
- AUCI: Unified Average Changing Intensity
How could AES and DES be the fastest algorithms compared to other lightweight algorithms? I was expecting them to be the slowest ones. For 256x256 byte data, AES encryption duration is around 0.5 milliseconds – is this normal?
Apart from TEA and LEA, why are NPCR and UACI values near zero? For a successful algorithm, NPCR must be over 99, and UACI must be around 33.33. If an algorithm does not satisfy these criteria, they are considered fragile.