L02 Short
L02 Short
Instructor: Omkant Pandey Lecture 2: Shannon and Perfect SecrecySpring 2017 (CSE 594) 1 / 32
Last Class
Instructor: Omkant Pandey Lecture 2: Shannon and Perfect SecrecySpring 2017 (CSE 594) 2 / 32
Symmetric Ciphers
A symmetric cipher consists of:
– A method for generating random keys k, denoted by KG
– Encryption algorithm: Enc
– Decryption algorithm: Dec
Enc encrypts messages using a secret key:
– Encpk, mq Ñ c
– Enc may use randomness
– c is called the ciphertext
Dec should decrypt correctly:
@k, @m : Decpk, Encpk, mqq “ m.
The set of all messages m is called message space M;
c is called the ciphertext and set of all ciphertexts ciphertext space
C;
The set of all keys k is called the key space K.
messages m are also known as plaintexts.
Instructor: Omkant Pandey Lecture 2: Shannon and Perfect SecrecySpring 2017 (CSE 594) 3 / 32
Security of a Cipher
Instructor: Omkant Pandey Lecture 2: Shannon and Perfect SecrecySpring 2017 (CSE 594) 4 / 32
First attempt: hide the key
Instructor: Omkant Pandey Lecture 2: Shannon and Perfect SecrecySpring 2017 (CSE 594) 5 / 32
Second approach: hide the message
Instructor: Omkant Pandey Lecture 2: Shannon and Perfect SecrecySpring 2017 (CSE 594) 6 / 32
Third approach: hide everything that is not already
known!
Instructor: Omkant Pandey Lecture 2: Shannon and Perfect SecrecySpring 2017 (CSE 594) 7 / 32
Shannon’s Treatment
Instructor: Omkant Pandey Lecture 2: Shannon and Perfect SecrecySpring 2017 (CSE 594) 8 / 32
Shannon’s Treatment (continued)
Instructor: Omkant Pandey Lecture 2: Shannon and Perfect SecrecySpring 2017 (CSE 594) 9 / 32
Shannon Secrecy
Perfect secrecy:
C1 and C2 must be identical for every pair of m1 , m2 .
ñ Ciphertexts are independent of the plaintext(s)!
“ ‰ “ ‰
Pr k Ð KG : Encpm1 , kq “ c “ Pr k Ð KG : Encpm2 , kq “ c
Show:
Prk rEnck pm1 q “ cs
“1
Prk,m rEnck pmq “ cs
Proof:
ÿ
Pr rEnck pmq “ cs “ Prrm “ m2 s PrrEnck pm2 q “ cs
k,m m k
m2 PM
ÿ
“ Prrm “ m2 s PrrEnck pm1 q “ cs
m k
m2 PM
ÿ
“ PrrEnck pm1 q “ cs ¨ Prrm “ m2 s
k m
m2 PM
loooooooooomoooooooooon
The One Time Pad (OTP) scheme is also known as the Vernam
Cipher.
The Caesar Cipher is just OTP for 1-alphabet messages!
Mathematically:
– XOR is the same as addition modulo 2:
a ` b mod 2.
– Caesar Cipher for 1-alphabet is addition modulo 26.
– You can work modulo any number n
As the name suggests, one key can be used only once.
The key must be:
sampled uniformly every time, and
be as long as the message.
Some Remarks:
Message length is n “ lg |M| and key length is ` “ lg |K|.
It follows that ` ě n, i.e., keys must be as long as the messages.
Proof:
Assume the contrary: i.e., |K| ă |M|
Fix any message m0 , and any key k0 . Let
c0 “ Encpm0 , k0 q.
ùñ P rk rEncpm0 , kq “ c0 s ą 0. (1)
What happens if we decrypt c0 with each key one by one?
We get a set of messages, which we denote by:
S “ tDecpc0 , kq : k P Ku.
Note that |S| ď |K| and |K| ă |M|.
ùñ |S| ă |M|.
Instructor: Omkant Pandey Lecture 2: Shannon and Perfect Secrecy
Spring 2017 (CSE 594) 28 / 32
Proof continued..
@k P K : Encpm1 , kq ‰ c0 .
ùñ PrrEncpm1 , kq “ c0 s “ 0. (2)
k
PrrEncpm0 , kq “ c0 s ‰ PrrEncpm1 , kq “ c0 s.
k k