Professional Documents
Culture Documents
Lecture 1
Lecture 1
Alice Bob
data, control
channel
messages
Trudy
Classify Security Attacks as
• Passive attacks - eavesdropping on, or monitoring
of, transmissions to:
– obtain message contents, or
– monitor traffic flows
• Active attacks – modification of data stream to:
– modify messages in transit
– denial of service
Classification of Cryptography
• Number of keys used
– Hash functions: no key
– Secret key cryptography: one key
– Public key cryptography: two keys - public, private
• Type of encryption operations used
– substitution / transposition / product
• Way in which plaintext is processed
– block / stream
Ciphers
• Symmetric cipher: same key used for
encryption and decryption
– Block cipher: encrypts a block of plaintext at a
time (typically 64 or 128 bits)
– Stream cipher: encrypts data one bit or one byte
at a time
• Asymmetric cipher: different keys used for
encryption and decryption
7
Symmetric Cipher Model
Symmetric Encryption
• Mathematically:
C = EK(P ) or C = E(K, P)
P= DK(C ) or P = D(K, C )
• P = plaintext
• C = ciphertext
• K = secret key
• E = encryption algorithm
• D = decryption algorithm
Classical Substitution Ciphers
• where letters of plaintext are replaced by
other letters or by numbers or symbols
• or if plaintext is viewed as a sequence of bits,
then substitution involves replacing plaintext
bit patterns with ciphertext bit patterns
Caesar Cipher
• earliest known substitution cipher
• by Julius Caesar
• mathematically give each letter a number
a bc de f g hi jk l m no p q rst u v w x y z
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
p = DK(c) = (c – k) mod 26
Caesar Cipher
example:
C = E(p) = (p + k) mod (26) = (p + 3) mod (26)
Plain: a b c d e f g h i j k l m no pq r s t u v w x y z
Cipher: D E F G H I J K L M N O P QR STU V W X Y Z A
B C
Plain: a b c d e f g h i j k l m n o p qr s t u v w x y z
Plaintext: ifwewishtoreplaceletters
Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA
13
Monoalphabetic Cipher Security
14
Kerckhoffs's Principle
Full name:
Jean-Guillaume-Hubert-Victor-
François-Alexandre-Auguste
Kerckhoffs von Nieuwenhof
slide 15
Cryptanalysis
• Objective: to recover the plaintext of a ciphertext
or, more typically, to recover the secret key.
• Kerkhoff’s principle: the adversary knows all
details about a cryptosystem except the
secret key.
• Two general approaches:
– brute-force attack
– non-brute-force attack (cryptanalytic attack)
16
Cryptanalysis of Caesar Cipher
• only have 25 possible ciphers
– A maps to A,B,..Z
• could simply try each in turn
• a brute force search
• given ciphertext, just try all shifts of letters
• do need to recognize when have plaintext
English Letter Frequencies
Playfair Cipher
• not even the large number of keys in a
monoalphabetic cipher provides security
• one approach to improving security was to
encrypt multiple letters
• the Playfair Cipher is an example
• invented by Charles Wheatstone in 1854, but
named after his friend Baron Playfair
Playfair Key Matrix