Substitution Cipher Analysis

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):

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:

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.