Sentence start |
Low entropy ending |
Higher entropy ending |
Hey, what's |
going on? |
on fire?! |
Want to |
get lunch? |
TiVo
Le Voyage dans la Lune? |
How are | you doing today? | my face spiders? |
Probability |
-log2 |
bits of entropy |
Why? |
1 |
0 |
0 |
It always happens, so there's no uncertainty. |
0.5 |
1 |
0.5 |
Happens half the time. |
0.1 |
3.3 |
0.33 |
-log is bigger, but probability shrinks
faster. |
0.01 |
6.6 |
0.066 |
as above, but worse. |
0 |
inf |
0 |
Never happens, so doesn't contribute any
entropy. |
Raw | Gzip -9 | Bzip2 | 7zip | Comments |
|
Binary zeros | 1048576 | 1057 | 45 | 327 | All zeros has the lowest possible entropy:
0 bits. |
Wikipedia XML | 1048576 | 359184 | 287769 | 294871 | Good compression rate, typical for
text. Inferred entropy is about 2.5 bits of entropy
per byte of the file (30%). |
H.P. Lovecraft Text | 1048576 | 402926 | 309576 | 328106 | Similar. |
gdb ELF64 | 1048576 | 406290 | 386042 | 332042 | Nominally a binary file, but has ASCII
strings, and x64 machine code and tables with lots of zeros. |
Random ASCII hex |
1048576 | 607628 |
544118 |
553549 |
Nominally ASCII, but very
unpredictable. Expected value is 4 bits of entropy per
byte of the file (50%). |
Base64 random data |
1048576 | 796856 |
795415 |
806685 |
Expected value is 6 bits of entropy per
byte of the file (75%). |
Tarball | 1048576 | 1039974 | 1050758 | 1046726 | Already gzip'd, so most entropy already
gone. |
Zipfile | 1048576 | 1041544 | 1050592 | 1047977 | Similar. |
JPEG | 1048576 | 1047418 | 1044382 | 1055571 | After the DCT phase, JPEG uses a huffman
encoding already. |
Random binary
data |
1048576 | 1048761 | 1053340 | 1063068 | Purely random binary data is almost
perfectly incompressible--very nearly 1 bit of entropy per
bit of the file (100% entropy). |
Cipher |
Key Entropy |
Cryptanalysis? |
Rot-13 |
0 bits (no key) |
Trivial |
Rot-K |
< 5 bits (k) |
Easy--brute force, known plaintext, letter
frequency statistics, ... |
DES |
<= 56 bits |
Medium--brute force is currently
feasible |
AES-128 |
<= 128 bits |
Very Hard |
OTP |
1 bit per message bit |
Not possible (all plaintexts equally likely) |
Name |
Encryption |
Decryption |
To crack? |
Rot-13 |
out[i]='A'+((in[i]-'A'+13)%26); |
(same) |
Run decryption. |
Rot-K |
out[i]='A'+((in[i]-'A'+K)%26); | K = 26-K; |
K=(out[i]-in[i]+26)%26; // for any i |
XOR-fixed |
out[i]=in[i]^K; |
(same) |
K=out[i]^in[i]; // for any i |
XOR-cycle |
out[i]=in[i]^K[i%K.size()]; |
(same) |
K[i]=out[i]^in[i]; // for each i |
Bits-1 |
out[i]=ror(in[i],K); |
rol |
Try the 8 possible K's. |
Bits-2 |
x=ror(in[i],K); out[i]=x^L; |
x=out[i]^L; in[i]=rol(x,K); |
Try the 8 possible K's. L=ror(in[i],K)^out[i]; |
Bits-3 |
x=ror(in[i],K); y=x^L; out[i]=ror(y,M); |
y=rol(out[i],M); x=y^L; in[i]=rol(x,K); |
Try the 8*8 possible M's and K's. L=ror(in[i],K)^rol(out[i],M); |