Operation |
Inverse |
Entropy Preservation |
Nonlocality |
Analysis for fixed K |
Addition C=P+K; |
Subtraction P=C-K; |
Perfect (even with wraparound). |
Poor--except for carries, totally bit-local. |
Trivial: compare plaintext and ciphertext
histograms. |
Multiplication C=P*K; |
Division P=C/K; |
Depends on high bits: throwing away high bits
loses entropy; modulo a large relatively prime value can
preserve it. |
Good, especially with wraparound. |
Trivial--every ciphertext value differs by a
multiple of the key. |
Bit rotation C=(P>>K) | (P<<(bits-K)); |
Rotate other way |
Perfect |
Terrible--bits are in 1:1 correspondence. |
Trivial: compare plaintext and ciphertext
*bit* histograms. |
Bitwise XOR C=P^K; |
Bitwise XOR again P=C^K; |
Perfect |
Terrible (bitwise) |
Trivial if K is reused. |
Bitwise AND C=P&K; |
Does not exist |
Not good--zeros in either input will cancel
out any entropy in the other input. |
Terrible (bitwise) |
Not invertible. |
Bitwise OR C=P|K; |
Does not exist |
Not good--ones in either input cancel entropy
in other input. |
Terrible (bitwise) |
Not invertible. |
Either-or C=(P1&K) | (P2&~K); |
Does not exist |
Actually good, although either P1 or P2 is
thrown away. |
Terrible (bitwise) |
Not invertible. |
Substitution table ("S box") C=T[P,K]; |
Inverse table C=I[P,K]; |
Perfect (it's typically a permutation). | Good with a well-designed table. |
For a reasonably big well-designed table, analysis can be hard. |