T H E S C I E N C E , M A T H E M A T I C S , A N D A R T O F P R I V A C YB A S I C S T U F F 1
CRYPTOGRAPHY
THE BIG QUESTION
• Who is the world’s largest employer of mathematicians (and a significant number of computer scientists)
•Click for the Answer•Need More Encouragement?
THE CENTRAL PROBLEM
• Secure communication over an insecure medium• Alternatively: “Cryptography is about
communication in the presence of an adversary” (Goldwasser & Bellaire)
• Two aspects:• Designing and building cryptosystems—the emphasis in
CPSC 453• Breaking cryptosystems
SOME CRYPTO BASICS
• Key cryptograpic problem• Terms • Three simple ciphers• Kerchoff’s Principle• Four classic ttacks• Five cryptographic problems and protocols
KEY CRYPTOGRAPHIC PROBLEM
Sending a private message over a public network
Alice Wants To Send Message
Bob Wants to Receive Message
Eve Wants to Listen To The Message
CRYPTOGRAPHIC SOLUTION
msgEncrypted
msgEncrypted
msgDecrypted
msg
Eve listens (but can’t understand)
BASIC TERMS
• Plaintext or P: the message to be hidden• Ciphertext or C: the hidden message• Encrypt: the process of turning plaintext into
ciphertext• Decrypt: the process of turning ciphertext back into
plain text• Cryptosystem: the combined system for encryption
and decryption• Cipher: sometimes used interchangeably with
cryptosystem• Key: a piece of information used in the
encryption/decryption process
TWO MAJOR CLASSES OF CRYPTOSYSTEMS
• Symmetric Key Systems: Same key is used for encryption and decryption
• Public Key Systems: Encryption key is public, Decryption key is private
TRANSPOSITION CIPHERS
• Rearrange the letters of the message, generating an anagram• Scytale: Oldest known military cipher• Rail Fence: Generalization of Scytale
SCYTALE: SPARTA 5TH CENTURY BCE
Ingredients: Two blocks of wood Carve n flat surfaces of the same size
Encrypt: 1. Wind a strip of leather around the scytale2. Write out the message horizontally3. Unwind the strip4. Send it on its way
Decrypt: 1. Wind the strip of leather around a scytale of same size as the one that2. Read the message horizontally
RAIL FENCE
Sonnet 29: Like to the lark at break of day arising1. Drop every other letter down a row (rail)
L K T T E A K T R A O D Y I E O H L R A B E K F A
2. Append the bottom row to the top LKTTEAKTRAODYIEOHLRABEKFA3. Can be extended to n rails: 1st letter on 1st rail, 2nd letter on second rail, etc.
4. Problem: Key space (number of rails) is small.
SUETONIUS (C. 69 -- AFTER 122 CE)BIOGRAPHERS OF THE CAESARS
• “If he [Julius Caesar] had anything confidential to say, he wrote it in cipher, that is, by so changing the order of the letters of the alphabet, that not a word could be made out. If anyone wishes to decipher these, and get at their meaning, he must substitute the fourth letter of the alphabet, namely D, for A, and so with the others.”
SHIFT (OR SUBSTITUTION) CIPHERS
• Each alphabetic character is substituted for another in a regular fashion• The Caesar cipher is a shift/substitution cipher
FORMALIZING AND GENERALIZINGTHE CAESAR CIPHER
To encrypt a character:1. Determine its position in the range [0..25]2. Add a shift to that value (Caesar added 3)3. Mod the result by 26enc(ch) = (pos(ch) + shift) % 26
To decrypt a character:• Determine its position in the range [0..25]• Subtract a shift amount in the range [0..25]• Add 26• Mod the result by 26dec(ch) = ((pos(ch) – shift) + 26) % 26
KERCHOFF’S PRINCIPLE: THE KEY IS THE KEY
• Scytale: key is the number (and size) of the surfaces carved into the cylinder• Rail Fence: Key is the number of rails• Shift Cipher: key is the number of positions
shifted• Kerchoff’s Principle: Assume that every aspect of
the cryptosystem is known except the key