IT Security Basic - CH.2.0 Cryptography
Cryptography
Elements of crypto-system
- Affordable on making the algorithm public
- Easy to change the Key, but difficult on designing a new secure algorithm
- The security level must depends on anything that can easily be changed I.E. "KEY"
Encryption = plaintext -> Ciphertext
Decryption = Ciphertext -> plaintext
Brute-force attack = Enumerate over all the possible keys
Types of attacks
- Ciphertext only, only use ciphertext to guess the key
- Known plaintext, use pairs of
to guess the key - Chosen plaintext, input something and observe the output => guess what is the seret
Three laws of security
- Absolutely secure systems do not exist
- To halve your vulnerability, you have to double your expenditure
- Cryptography is typically bypassed, not penetrated
What is a good ciphers
- Confusion - The relationship between key and ciphertext as complex as possible
- Diffusion - spreads the influence of a single plaintext bit over many ciphertext bits
- Avalanche Effect - Minor change to the plaintext or the key cause significant changes to the ciphertext
Classic Cipher
- Caesar Cipher - Use a list to store the key E.g. [A=k, B=H, C=U....] * Use Frequency Analysis to crack
- Rail-Fence - Re-arrange the order of the words

Secret-key [symmetric key] system
- Use the same key on both encryption & decryption
- Block Cipher, Process the message block by block, * Key can be reused
- Stream Cipher, Process the message bit by bit, * Never reuse the key

DES: The Data Encryption Standard
- The same hardware can be used for both encryption and decryption
- The most widely used encryption standard in the world
- In common use for over 20 years

- How secure is DES?
- Key length reference
3DES
- Increase the effective key-length of DES by doing multiple DES
- 3DES = do DES rounds for 3 times
- Why not 2 times? "Meet-in-the-middle attack", can reduce >50% of effect of DES
AES
- Expected to replace DES & 3DES as the standard encryption world wide
- Fex complex rounds verse many simple rounds
- 4 transformations - substitutes Bytes, shift row, Mix column, Add round key
AES URLS
What can we do if there is some lost during ciphertext transmission?
- Use Cipher Block Chaining mode (CBC)
- Use the last encrypted block as "Message Authentication Code" (MAC)
The receiver, who knows the key in advance, can then encrypt the plaintext upon its arrival using CBC mode. If the message has been tampered with during transmission, the MAC won't match !
Some other verification mode
- CBC
- CFB - Cipher feedback mode
- OFB - output feedback mode
- CTR - Counter mode
Key distribution
- Since Key can be cracked at a given time, so it have to change frequently
- Get new key from KDC - Key Distribution Center
Two types of Encryption
- Link Encryption - Secure the whole path between transmission
- End-to-End encryption - Data is encrypted and then transmit as a whole

