100 likes | 174 Views
Introduction to Cryptography 1. TE/CS 536 Network Security Spring 2006 – Lectures 3&4. Definitions. Process data into unintelligible form Reversible, without data loss Usually one-to-one (not compression) Plaintext encryption ciphertext decryption plaintext
E N D
Introduction to Cryptography 1 TE/CS 536 Network Security Spring 2006 – Lectures 3&4
Definitions • Process data into unintelligible form • Reversible, without data loss • Usually one-to-one (not compression) • Plaintext encryption ciphertext decryption plaintext • Encryption: algorithm + key • Decryption: encryption in reverse
Simple example • Plain: p let me go • Cipher: c OHW PH JR • Encryption Algorithm (Find the key!) c = E(p) = (p + 3) mod (26) • Decryption algorithm p = D(c) = (C – 3) mod (26) • Cryptanalysis Q: How many tries will find us the key?
Cryptography • Operations • Substitution : map (replace) elements • Transposition : permute elements • Keys • Symmetric (single-key, secret key) • Asymmetric (two-key, public key) • Modes • Block ciphers, stream ciphers
Substitution ciphers - 1 • Caesar cipher: substitution cipher: • A D, B E • Monoalphabetic cipher: • generalization, arbitrary mapping of one letter to another (find the key!) • 26!, approximately 4 1026 • statistical analysis of letter frequencies • Polygram block cipher • Replace one block of plain text with another block of cipher text: SOME -> XFPL, SO ->JN
Substitution ciphers - 2 • Vernam cipher (very long but repeating key) • Convert text into binary • Encrypt: ci = pi ki • Decrypt pi = ci ki • One-time pad (random, non-repeating key) • Exhaustive search will produce many legitimate plaintexts • Finding the desired plaintext without knowing the key in impossible – code is unbreakable
Transposition techniques • Rail fence • l e t m e g o q u i c k l y Ciphertext = lqeutimcekgloy • Column permutations • Key 2 4 1 3 • Plain l e t m e g o q u i c k • Cipher ? • Cryptanalysis ?
Computational Difficulty • Algorithm needs to be efficient. • Otherwise only short keys can be used. • Most schemes can be broken: depends on money. • e.g. Try all possible keys. • Longer key is often more secure: • Encryption O(N+1). • Brute-force cryptanalysis: O(2N+1), twice as hard with each additional bit. • Cryptanalysis tools: • Special-purpose hardware. • Parallel machines. • Internet coarse-grain parallelism.
Cryptanalysis: Breaking an Encryption Scheme • Ciphertext only: • Exhaustive search until “recognizable plaintext” • Need enough ciphertext, e.g. to do stat analysis • Known plaintext: • Secret may be revealed (by spy, time), thus <ciphertext, plaintext> pair is obtained • Great for monoalphabetic ciphers • Chosen plaintext: • Choose text, get encrypted, e.g. by telegraph company • Useful if limited set of messages
Brute Force Attacks • Number of encryptions/sec: 1 million to 1 billion – try all possible keys • 56-bit key broken in 1 week with 120,000 processors ($6.7m) • 56-bit key broken in 1 month with 28,000 processors ($1.6m) • 64-bit key broken in 1 week with 3.1 107 processors ($1.7b) • 128-bit key broken in 1 week with 5.6 1026 processors