Confusion and diffusion facts for kids
In cryptography, which is the art of secret writing, confusion and diffusion are two super important ideas that help make secret codes (called ciphers) really strong and hard to break. They were first described by a smart scientist named Claude Shannon in 1949.
Contents
What are Confusion and Diffusion?
Imagine you're sending a secret message. You want to make sure that if someone tries to guess your secret key or figure out your message, it's incredibly difficult. That's where confusion and diffusion come in!
What is Confusion?
Confusion means making the connection between your secret key and the scrambled message (called the ciphertext) as complicated as possible. Think of it like this: if you change just one tiny part of your secret key, the entire scrambled message should look completely different and random. This makes it very hard for someone to work backward from the scrambled message to guess your key.
- It hides the relationship between the key and the ciphertext.
- It makes it hard to guess the key by looking at the scrambled message.
- A good example is using a substitution box (S-box) in a cipher. This box replaces parts of your message with other parts in a very complex way.
What is Diffusion?
Diffusion is about spreading out the influence of your original message (the plaintext) across the entire scrambled message. If you change just one letter or bit in your original message, many parts of the scrambled message should change.
- It spreads out the patterns from the original message.
- If you change one tiny bit of the original message, many bits in the scrambled message should change.
- This is often measured by something called the Strict Avalanche Criterion. This means if you flip one input bit, each output bit should have a 50% chance of flipping too.
- A common way to achieve diffusion is through permutation boxes (P-boxes), which rearrange or swap the order of parts of the message.
How Ciphers Use Them
Modern secret codes often use both confusion and diffusion together to be very secure. They do this by repeating steps that cause confusion and steps that cause diffusion.
- Substitution (like replacing letters with other letters) is mainly used for confusion.
- Transposition (like rearranging the order of letters) is mainly used for diffusion.
Many strong ciphers, like the AES, use a mix of these techniques. They might have several "rounds" where they first apply confusion, then diffusion, then confusion again, and so on. This makes the scrambled message incredibly complex and secure. These are sometimes called Product ciphers.
Related pages
Further Reading
- Claude E. Shannon, "Communication Theory of Secrecy Systems", Bell System Technical Journal, vol.28-4, page 656–715, 1949. Read the original paper
See also
In Spanish: Confusión y difusión para niños