The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the...

21
The One-Time Pad (Vernamโ€™s Cipher) โ€ข In 1917, Vernam patented a cipher now called the one-time pad that obtains perfect secrecy. โ€ข There was no proof of this fact at the time. โ€ข 25 years later, Shannon introduced the notion of perfect secrecy and demonstrated that the one-time pad achieves this level of security.

Transcript of The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the...

Page 1: The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the message space ๐‘€, key space ๐พ, and ciphertext space are all equal to 0,1โ„“.

The One-Time Pad (Vernamโ€™s Cipher)

โ€ข In 1917, Vernam patented a cipher now called the one-time pad that obtains perfect secrecy.

โ€ข There was no proof of this fact at the time.

โ€ข 25 years later, Shannon introduced the notion of perfect secrecy and demonstrated that the one-time pad achieves this level of security.

Page 2: The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the message space ๐‘€, key space ๐พ, and ciphertext space are all equal to 0,1โ„“.

The One-Time Pad Scheme

1. Fix an integer โ„“ > 0. Then the message space ๐‘€, key space ๐พ, and ciphertext space ๐ถ are all equal to 0,1 โ„“.

2. The key-generation algorithm ๐บ๐‘’๐‘› works by choosing a string from ๐พ = 0,1 โ„“ according to the uniform distribution.

3. Encryption ๐ธ๐‘›๐‘ works as follows: given a key ๐‘˜ โˆˆ 0,1 โ„“, and a message ๐‘š โˆˆ 0,1 โ„“,output ๐‘ โ‰” ๐‘˜ โŠ•๐‘š.

4. Decryption ๐ท๐‘’๐‘ works as follows: given a key ๐‘˜ โˆˆ 0,1 โ„“, and a ciphertext ๐‘ โˆˆ 0,1 โ„“, output ๐‘š โ‰” ๐‘˜โŠ• ๐‘.

Page 3: The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the message space ๐‘€, key space ๐พ, and ciphertext space are all equal to 0,1โ„“.

Security of OTP

Theorem: The one-time pad encryption scheme is perfectly secure.

Page 4: The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the message space ๐‘€, key space ๐พ, and ciphertext space are all equal to 0,1โ„“.

Proof

Proof: Fix some distribution over ๐‘€ and fix an arbitrary ๐‘š โˆˆ ๐‘€ and ๐‘ โˆˆ ๐ถ. For one-time pad: Pr ๐ถ = ๐‘| ๐‘€ = ๐‘š = Pr ๐‘€โŠ•๐พ = ๐‘ | ๐‘€ = ๐‘š

= Pr ๐‘šโŠ•๐พ = ๐‘ = Pr ๐พ = ๐‘šโŠ• ๐‘ = 1

2โ„“

Since this holds for all distributions and all ๐‘š, we have that for every probability distribution over ๐‘€, every ๐‘š0, ๐‘š1 โˆˆ ๐‘€ and every ๐‘ โˆˆ ๐ถ

Pr ๐ถ = ๐‘ ๐‘€ = ๐‘š0] = 1

2โ„“= Pr ๐ถ = ๐‘|๐‘€ = ๐‘š1

Page 5: The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the message space ๐‘€, key space ๐พ, and ciphertext space are all equal to 0,1โ„“.

Drawbacks of OTP

โ€ข Key length is the same as the message length.

โ€“ For every bit communicated over a public channel, a bit must be shared privately.

โ€“ We will see this is not just a problem with the OTP scheme, but an inherent problem in perfectly secret encryption schemes.

โ€ข Key can only be used once.

โ€“ You will see in the homework that this is also an inherent problem.

Page 6: The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the message space ๐‘€, key space ๐พ, and ciphertext space are all equal to 0,1โ„“.

Some Examples

โ€ข Is the following scheme perfectly secret?

โ€ข Message space ๐‘ด = {0,1, โ€ฆ , ๐‘› โˆ’ 1}. Key space ๐‘ฒ = {0,1, โ€ฆ , ๐‘› โˆ’ 1}.

โ€ข Gen() chooses a key ๐‘˜ at random from ๐‘ฒ.

โ€ข Enc๐‘˜ ๐‘š returns ๐‘š + ๐‘˜.

โ€ข ๐ท๐‘’๐‘๐‘˜ ๐‘ returns ๐‘ โˆ’ ๐‘˜.

Page 7: The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the message space ๐‘€, key space ๐พ, and ciphertext space are all equal to 0,1โ„“.

Some Examples

โ€ข Is the following scheme perfectly secret?

โ€ข Message space ๐‘ด = {0,1, โ€ฆ , ๐‘› โˆ’ 1}. Key space ๐‘ฒ = {0,1, โ€ฆ , ๐‘› โˆ’ 1}.

โ€ข Gen() chooses a key ๐‘˜ at random from ๐‘ฒ.

โ€ข Enc๐‘˜ ๐‘š returns ๐‘š + ๐‘˜ ๐‘š๐‘œ๐‘‘ ๐‘›.

โ€ข ๐ท๐‘’๐‘๐‘˜ ๐‘ returns ๐‘ โˆ’ ๐‘˜ ๐‘š๐‘œ๐‘‘ ๐‘›.

Page 8: The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the message space ๐‘€, key space ๐พ, and ciphertext space are all equal to 0,1โ„“.

Limitations of Perfect Secrecy

Theorem: Let (๐บ๐‘’๐‘›, ๐ธ๐‘›๐‘, ๐ท๐‘’๐‘) be a perfectly-secret encryption scheme over a message space ๐‘ด, and let ๐‘ฒ be the key space as determined by ๐บ๐‘’๐‘›. Then ๐‘ฒ โ‰ฅ |๐‘ด|.

Page 9: The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the message space ๐‘€, key space ๐พ, and ciphertext space are all equal to 0,1โ„“.

Proof

Proof (by contradiction): We show that if ๐‘ฒ < |๐‘ด| then the scheme cannot be perfectly

secret.

โ€ข Assume ๐‘ฒ < ๐‘ด . Consider the uniform distribution over ๐‘ด and let ๐‘ โˆˆ ๐‘ช.

โ€ข Let ๐‘ด(๐‘) be the set of all possible messages which are possible decryptions of ๐‘.

๐‘ด ๐‘ โ‰” ๐‘š ๐‘š = ๐ท๐‘’๐‘๐‘˜ ๐‘ ๐‘“๐‘œ๐‘Ÿ ๐‘ ๐‘œ๐‘š๐‘’ ๐‘˜ โˆˆ ๐‘ฒ}

Page 10: The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the message space ๐‘€, key space ๐พ, and ciphertext space are all equal to 0,1โ„“.

Proof

๐‘ด ๐‘ โ‰” { ๐‘š | ๐‘š = ๐ท๐‘’๐‘๐‘˜ ๐‘ ๐‘“๐‘œ๐‘Ÿ ๐‘ ๐‘œ๐‘š๐‘’ ๐‘˜ โˆˆ ๐‘ฒ}

โ€ข ๐‘ด ๐‘ โ‰ค |๐‘ฒ|. Why?

โ€ข Since we assumed ๐‘ฒ < |๐‘ด|, this means that there is some ๐‘šโ€ฒ โˆˆ ๐‘ด such that ๐‘šโ€ฒ โˆ‰ ๐‘ด ๐‘ .

โ€ข But then Pr ๐‘€ = ๐‘šโ€ฒ| ๐ถ = ๐‘ = 0 โ‰  Pr[๐‘€ = ๐‘šโ€ฒ]

And so the scheme is not perfectly secret.

Page 11: The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the message space ๐‘€, key space ๐พ, and ciphertext space are all equal to 0,1โ„“.

Shannonโ€™s Theorem

Let (๐บ๐‘’๐‘›, ๐ธ๐‘›๐‘, ๐ท๐‘’๐‘) be an encryption scheme with message space ๐‘ด, for which ๐‘ด = ๐‘ฒ =|๐‘ช|. The scheme is perfectly secret if and only if:

1. Every key ๐‘˜ โˆˆ ๐‘ฒ is chosen with equal probability 1/|๐‘ฒ| by algorithm ๐บ๐‘’๐‘›.

2. For every ๐‘š โˆˆ ๐‘ด and every ๐‘ โˆˆ ๐‘ช, there exists a unique key ๐‘˜ โˆˆ ๐‘ฒ such that ๐ธ๐‘›๐‘๐‘˜(๐‘š) outputs ๐‘.

**Theorem only applies when ๐‘ด = ๐‘ฒ = |๐‘ช|.

Page 12: The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the message space ๐‘€, key space ๐พ, and ciphertext space are all equal to 0,1โ„“.

Some Examples

โ€ข Is the following scheme perfectly secret?

โ€ข Message space ๐‘ด = {0,1, โ€ฆ , ๐‘› โˆ’ 1}. Key space ๐‘ฒ = {0,1, โ€ฆ , ๐‘› โˆ’ 1}.

โ€ข Gen() chooses a key ๐‘˜ at random from ๐‘ฒ.

โ€ข Enc๐‘˜ ๐‘š returns ๐‘š + ๐‘˜.

โ€ข ๐ท๐‘’๐‘๐‘˜ ๐‘ returns ๐‘ โˆ’ ๐‘˜.

Page 13: The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the message space ๐‘€, key space ๐พ, and ciphertext space are all equal to 0,1โ„“.

Some Examples

โ€ข Is the following scheme perfectly secret?

โ€ข Message space ๐‘ด = {0,1, โ€ฆ , ๐‘› โˆ’ 1}. Key space ๐‘ฒ = {0,1, โ€ฆ , ๐‘› โˆ’ 1}.

โ€ข Gen() chooses a key ๐‘˜ at random from ๐‘ฒ.

โ€ข Enc๐‘˜ ๐‘š returns ๐‘š + ๐‘˜ ๐‘š๐‘œ๐‘‘ ๐‘›.

โ€ข ๐ท๐‘’๐‘๐‘˜ ๐‘ returns ๐‘ โˆ’ ๐‘˜ ๐‘š๐‘œ๐‘‘ ๐‘›.

Page 14: The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the message space ๐‘€, key space ๐พ, and ciphertext space are all equal to 0,1โ„“.

The Computational Approach to Security

โ€œAn encryption scheme is secure if no adversary learns meaningful information about the plaintext after seeing the ciphertextโ€

How do you formalize learns meaningful information?

Page 15: The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the message space ๐‘€, key space ๐พ, and ciphertext space are all equal to 0,1โ„“.

The Computational Approach to Security

โ€ข Meaningful Information about plaintext m: โ€“ ๐‘“(๐‘š) for an efficiently computable function ๐‘“

โ€ข Learn Meaningful Information from the ciphertext: โ€“ An efficient algorithm that can output ๐‘“(๐‘š) after

seeing ๐‘ but could not output ๐‘“ ๐‘š before seeing ๐‘.

โ€ข Learn Meaningful Information: โ€“ The change in probability that an efficient algorithm

can output ๐‘“(๐‘š) after seeing ๐‘ and can output ๐‘“ ๐‘š before seeing ๐‘ is significant.

Page 16: The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the message space ๐‘€, key space ๐พ, and ciphertext space are all equal to 0,1โ„“.

Note:

โ€ข The intuitive definition from the previous slide is known as โ€œsemantic security.โ€

โ€ข We will first see a different, simpler definition known as indistinguishability.

โ€ข Later we will see that the two definitions are provably equivalent.

Page 17: The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the message space ๐‘€, key space ๐พ, and ciphertext space are all equal to 0,1โ„“.

The Computational Approach

Two main relaxations:

1. Security is only guaranteed against efficient adversaries that run for some feasible amount of time.

2. Adversaries can potentially succeed with some very small probability.

Page 18: The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the message space ๐‘€, key space ๐พ, and ciphertext space are all equal to 0,1โ„“.

Security Parameter

โ€ข Integer valued security parameter denoted by n that parameterizes both the cryptographic schemes as well as all involved parties.

โ€ข When honest parties initialize a scheme, they choose some value n for the security parameter.

โ€ข Can think of security parameter as corresponding to the length of the key.

โ€ข Security parameter is assumed to be known to any adversary attacking the scheme.

โ€ข View run time of the adversary and its success probability as functions of the security parameter.

Page 19: The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the message space ๐‘€, key space ๐พ, and ciphertext space are all equal to 0,1โ„“.

Polynomial Time

โ€ข Efficient adversaries = Polynomial time adversaries

โ€“ There is some polynomial ๐‘ such that the adversary runs for time at most ๐‘(๐‘›) when the security parameter is ๐‘›.

โ€“ Honest parties also run in polynomial time.

โ€“ The adversary may be much more powerful than the honest parties.

Page 20: The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the message space ๐‘€, key space ๐พ, and ciphertext space are all equal to 0,1โ„“.

Negligible

โ€ข Small probability of success = negligible probability

โ€“ A function ๐‘“ is negligible if for every polynomial ๐‘ and all sufficiently large values of ๐‘› it holds that

๐‘“ ๐‘› < 1

๐‘(๐‘›).

โ€“ Intuition, ๐‘“ ๐‘› < ๐‘›โˆ’๐‘ for every constant ๐‘, as ๐‘› goes to infinity.

Page 21: The One-Time Pad (Vernamโ€™s Cipher)danadach/Intro_Crypto...ย ยท 1. Fix an integer โ„“>0. Then the message space ๐‘€, key space ๐พ, and ciphertext space are all equal to 0,1โ„“.

Negligible