Day 18
Concepts Plaintext: the original message Ciphertext: the transformed message Encryption: transformation of plaintext into ciphertext Decryption: transformation of plaintext into ciphertext Key: some critical information used for encryption and decryption, only known to the sender and/or receiver
Caesar Cipher Each letter of the alphabet is rotated 3 places. –A -> D –B -> E –C -> F –X -> A –Y -> B The key here is 3 The algorithm is to swap each letter with the letter KEY letters away.
Bkzovmqflk Oribp! ABCDEFGHIJKLMNOPQRSTUVWXYZ XYZABCDEFGHIJKLMNOPQRSTUVW
Standard English Frequency
Special Rules All Q’s in the English language are followed by U. T’s often are followed by h’s Etc.
Breaking a Caesar Cipher Figure out the frequency of each letter. Compare it to standard English Figure out the mapping Translate.
Polyalphabetic substitution You can use multiple different Caesar Ciphers on the same text. –First letter has a key of 5 –Second letter has key of 7 –Third letter has key of 11 –Forth letter has key of 4 –Fifth letter has key of 5 again.
Substitutions The letters can be a random mapping: –A -> X –B -> C –C -> P Slightly more difficult than Caesar but still has the same problems.
Enigma World War 2 saw the creation of a machine to perform substitutions one after another based on 3 wheels. –Each wheel had a substitution –After each letter, the wheels rotated. –The wheel choice, and starting position was determined ahead of time by a code book and the day.
Transposition Cipher Instead of changing letters, just rearrange them. –Doesn’t suffer from same problems as substitutions. –Quite difficult to decode on large column counts. –Can be based on a key: Computer ->
Transpose and Substitute Nothing says you can’t do both. DES (Govt. standard for encryption until Oct 2000 – replaced by AES (keys up to 256bits – blocks 128bit) –56 bit key Broken into smaller bits for encryption –64 bit blocks of data. –16 rounds of substitutions and transformations –Both sides must know the key ahead of time. Involves Permutation Series of substitutions Swapping of ½ bits More substitutions Another permutation
Key difficulty How do you get the key to the other side? –If you can do that securely, why don’t you just send the data? What if they key gets compromised? –You need to exchange new keys
Public Key Cryptography Different keys used to encrypt and decrypt the traffic. –Very complex polynomial factoring used to create 2 keys. –The same key cannot be used to encrypt AND decrypt. You MUST use the other key. –Given one key it is impossible (as far as we know) to calculate the other key.
Encrypting with public key I generate a public and private key pair. I publish the public key to anyone who wants it If someone wants to send me data that only I can read, they encrypt it with my public key. –Only my private key will decrypt it.
SSL Symmetric key is faster to use, but has the problem of how to exchange keys. SSL uses public key to exchange a symmetric key, then DES or AES is used to encrypt traffic. SSL understands how to decide on best algorithm both sides understand.