1. Substitution Key
The randomly generated substitution key is as follows:
A -> E, B -> T, C -> W, D -> S, E -> H, F -> C, G -> K, H -> I, I -> V, J -> Z, K -> R, L -> N, M -> J, N -> D, O -> U, P -> M, Q -> X, R -> G, S -> O, T -> Y, U -> Q, V -> P, W -> F, X -> B, Y -> L, Z -> A
2. Original and Encrypted Messages
Original Message: HELLO WORLD
Encrypted Message: IHNNU FUGNS
3. Permutation Step
Reversing the encrypted message gives the final result:
Final Encrypted Message: SNGUF UNNHI
4. Frequency Distribution Changes
Frequency Distribution (Original and Encrypted):
- Original Frequencies: H: 0.1, E: 0.1, L: 0.3, O: 0.2, W: 0.1, R: 0.1, D: 0.1
- Encrypted Frequencies: I: 0.1, H: 0.1, N: 0.3, U: 0.2, F: 0.1, G: 0.1, S: 0.1
- Reversed Frequencies: S: 0.1, N: 0.3, G: 0.1, U: 0.2, F: 0.1, H: 0.1, I: 0.1
The frequency distribution remains unchanged throughout encryption and permutation. Positional context is altered, but the statistical profile of the message remains identical.
5. Entropy Considerations
Entropy Values:
- Original Entropy: 2.646 bits
- Encrypted Entropy: 2.646 bits
- Reversed Entropy: 2.646 bits
Since neither substitution nor permutation changes the underlying statistical distribution, the entropy remains constant, reflecting the same degree of uncertainty in all cases.
6. Contrast with RSA
Unlike substitution ciphers, RSA encryption does not preserve the statistical structure of the plaintext. It disrupts patterns entirely by transforming plaintext into a random-looking ciphertext through mathematical operations. This significantly increases security and prevents frequency analysis attacks. RSA relies on computational complexity and robust key management to ensure security.
7. Final Thoughts
Entropy is a critical factor in cryptography, as higher entropy indicates greater randomness and security. Substitution ciphers, even with permutation, fail to increase entropy and remain vulnerable to frequency analysis. Modern cryptographic systems, such as RSA and AES, focus on maximizing entropy and computational complexity to protect against attacks.