Encryption and Authentication Scenarios in Distributed Systems
From the most innocent way of permutation and substitution to the most delicated ones, cryptography always trys to balance effectiveness and efficiency. Is the crypto strategy strong enough to keep my message safe? Is it also quick enough to only invisibly slow down the business? Good crypto strategies are always tailored to context and requirements.
1. Alice and Bob want to talk secretly
Alice and Bob want to send messages to each other and in cipher text. They need an easy way to talk secretly without the content being leaked.
Cryptography with symmetric key, aka Private-key Cryptography, was widely used in human history, including the Enigma machine in World War II, for tasks like this.
Alice and Bob, and only they two, hold the symmetric key for their communication. They use the shared key to encrypt and decrypt each message.
- People cannot read the text directly, because it is encrypted and in cipher text.
- People cannot easily break the cipher, because the algorithm is designed to be computationally impossible to figure out the true key, and only the true key can decrypt cipher text.
- People cannot use another key to encrypt and pretent they were Alice or Bob, because the fraud message will be decoded to some gibberish.
Who are using Private-key Cryptography?
TEA (Tiny Encryption Algorithm)
DES (Data Encryption Standard)
- use 56-bit/64-bit key with rounds
- have Initialization Vector
- use same key and same steps in encryption and decryption
3DES (Triple DES)
- use two keys to encrypt text for three times
Plain text
=Key1=> Encryption
=Key2=> Decryption
=Key1=> Encryption
==> Cipher text
- have known-plaintext attack
AES (Advanced Encryption Standard)
- 128-bit, 192-bit, and 156-bit keys with rounds
- have Initialization Vector
- use different key and steps in encryption and decryption
Plain text
==> Substitute bytes with S-Box (i.e. substitution)
==> Shift rows (i.e. permutation)
==> Mix columns (i.e. substitution)
==> Add round key (XOR with part of the expand key; will be different each time)
==> Cipher text
Decryption will use Inverse S-Box and Inverse expand key.