csl759: cryptography and computer security - computer science

38
Ragesh Jaiswal CSE, IIT Delhi CSL759: Cryptography and Computer Security

Upload: others

Post on 11-Feb-2022

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CSL759: Cryptography and Computer Security - Computer Science

Ragesh Jaiswal

CSE, IIT Delhi

CSL759: Cryptography and Computer

Security

Page 2: CSL759: Cryptography and Computer Security - Computer Science

Administrative information Course webpage:

www.cse.iitd.ac.in/~rjaiswal/2013/csl759

Evaluation components:

Minor 1 and 2 exams: 15% each

Homework (2 - 3): 20%

Project: 20%

Major exam: 20%

Reference material:

Mihir Bellareโ€™s slides and notes (available on the web).

Introduction to Modern Cryptography (Katz and Lindell).

Foundations of Cryptography (Oded Goldreich).

Other notes/slides/practice material on the web.

Page 3: CSL759: Cryptography and Computer Security - Computer Science

Administrative information

Pre-requisites:

Basic probability theory

Algorithms

Comfortable in reading/writing rigorous mathematical proofs

Lecture Timing:

To be decided.

Page 4: CSL759: Cryptography and Computer Security - Computer Science

Introduction

Page 5: CSL759: Cryptography and Computer Security - Computer Science

Introduction

Throughout most of history:

Cryptography = art of secret writing

Secure communication

๐‘ฒ ๐‘ฒKey exchange protocol

๐‘€

๐ถ = ๐ธ๐พ(๐‘€)

๐‘€ = ๐ท๐พ(๐ถ)

Page 6: CSL759: Cryptography and Computer Security - Computer Science

Introduction

Early history ( - early 70s):

Synonymous with secret communication.

Restricted to Military and Nobility.

More of art than rigorous science.

Design protocol Protocol broken

Page 7: CSL759: Cryptography and Computer Security - Computer Science

Introduction

Early history ( - early 70s):

Synonymous with secret communication.

Restricted to Military and Nobility.

More of art than rigorous science.

Modern Cryptography:

Digital signatures, e-cash, secure computation, e-voting โ€ฆ

Touches most aspects of modern lifestyle.

Rigorous science:

Reason about security of protocols.

Design protocol Protocol broken

Page 8: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Theme of this course

Theme: Reason about security of protocols (Provable

security)

Fix security goals and formalize the notion of security.

Construct a protocol.

Show that a successful attack as per the security notion results

in a successful attack on an underlying problem that is believed

to be hard to solve.

What you should hope to learn in the course:

Learn basic cryptographic primitives and their interesting

properties.

Reasoning about security of protocols.

Numerous applications/examples.

Page 9: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Provable security

Factoring AES MD5Discrete log

Protocol

Construction

Protocol

Page 10: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Provable security

Factoring AES MD5Discrete log

Protocol

Construction

Protocol

We would like to argue:

โ€ข If the basic primitive/problem is secure/hard, then the constructed protocol is โ€œsecureโ€

Page 11: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Provable security

Factoring AES MD5Discrete log

Protocol

Construction

Protocol

โ€ข :If there is an adversary that successfully attacks the protocol, then there is another

adversary that successfully attacks/solves at least one of the basic primitives/problems.

Page 12: CSL759: Cryptography and Computer Security - Computer Science

Introduction

Secure communication

Page 13: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Secure communication: Alice wants to talk to Bob without

Eve (who has access to the channel) knowing the

communication.

Simple idea (Ceaser Cipher): Substitute each letter with the

letter that is the ๐›ผth letter after the letter in the sequence

AB...Z

Example (๐›ผ = 2): SEND TROOPS

Page 14: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Secure communication: Alice wants to talk to Bob without

Eve (who has access to the channel) knowing the

communication.

Simple idea (Ceaser Cipher): Substitute each letter with the

letter that is the ๐›ผth letter after the letter in the sequence

AB...Z

Example (๐›ผ = 2): SEND TROOPS UGPF VTQQRU

Page 15: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Secure communication: Alice wants to talk to Bob without

Eve (who has access to the channel) knowing the

communication.

Simple idea (Ceaser Cipher): Substitute each letter with the letter that is the ๐›ผth letter after the letter in the sequence AB...Z

Security was based on the fact that the encryption algorithm was a secret (Security through obscurity)

Page 16: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Secure communication: Alice wants to talk to Bob without

Eve (who has access to the channel) knowing the

communication.

Simple idea (Ceaser Cipher): Substitute each letter with the letter that is the ๐›ผth letter after the letter in the sequence AB...Z

Security was based on the fact that the encryption algorithm was a secret (Security through obscurity)

- Should be avoided at all cost!

- Algorithm should be public

and security should come

from secret keys.

Page 17: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Secure communication: Alice wants to talk to Bob without

Eve (who has access to the channel) knowing the

communication.

Simple idea (Ceaser Cipher): Substitute each letter with the letter that is the ๐›ผth letter after the letter in the sequence AB...Z

Suppose we make the algorithm public and use the secret key as ๐›ผ. Can you break this protocol?

Page 18: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Secure communication: Alice wants to talk to Bob without

Eve (who has access to the channel) knowing the

communication.

Simple idea (Substitution Cipher): Let ๐œ‹ be a permutation of the English letters. Substitute each letter ๐›ผ with the letter ๐œ‹ ๐›ผ . ๐œ‹ acts as the secret key.

Example: Let ๐œ‹ ๐ด = ๐‘ˆ, ๐œ‹ ๐ต = ๐‘‡, ๐œ‹ ๐ถ = ๐‘ƒ,โ€ฆthen encryption of CAB is PUT.

Page 19: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Secure communication: Alice wants to talk to Bob without

Eve (who has access to the channel) knowing the

communication.

Simple idea (Substitution Cipher): Let ๐œ‹ be a permutation of the English letters. Substitute each letter ๐›ผ with the letter ๐œ‹ ๐›ผ . ๐œ‹ acts as the secret key.

Question: How much space you need to use to store the secret key?

Page 20: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Secure communication: Alice wants to talk to Bob without

Eve (who has access to the channel) knowing the

communication.

Simple idea (Substitution Cipher): Let ๐œ‹ be a permutation of the English letters. Substitute each letter ๐›ผ with the letter ๐œ‹ ๐›ผ . ๐œ‹ acts as the secret key.

Consider a brute-force attack where you try to guess the secret key. Is such an attack feasible?

Page 21: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Secure communication: Alice wants to talk to Bob without

Eve (who has access to the channel) knowing the

communication.

Simple idea (Substitution Cipher): Let ๐œ‹ be a permutation of

the English letters. Substitute each letter ๐›ผ with the letter

๐œ‹ ๐›ผ .

Can you break this scheme?

Page 22: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Secure communication: Alice wants to talk to Bob without

Eve (who has access to the channel) knowing the

communication.

Simple idea (Substitution Cipher): Let ๐œ‹ be a permutation of

the English letters. Substitute each letter ๐›ผ with the letter

๐œ‹ ๐›ผ .

Attack idea: Eโ€™s occur more frequently than Xโ€™s

Page 23: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Frequency of letters in typical

English sentences.

Page 24: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Secure communication: Alice wants to talk to Bob without

Eve (who has access to the channel) knowing the

communication.

Simple idea (Vignere Cipher): Let ๐พ be a short string. For any given message ๐‘€, add repeated copies of ๐พ to ๐‘€.๐พ acts as the secret key.

Example: Let ๐พ = AB and ๐‘€ = ๐ด๐‘‡๐‘‡๐ด๐ถ๐พ. Then the cipher text is ๐ด๐‘‡๐‘‡๐ด๐ถ๐พ + ๐ด๐ต๐ด๐ต๐ด๐ต = ๐ต๐‘‰๐‘ˆ๐ถ๐ท๐‘€.

Page 25: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Secure communication: Alice wants to talk to Bob without

Eve (who has access to the channel) knowing the

communication.

Simple idea (Vignere Cipher): Let ๐พ be a short string. For

any given message ๐‘€, add repeated copies of ๐พ to ๐‘€. ๐พ acts

as the secret key.

Can you break this scheme?

Page 26: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Secure communication: Alice wants to talk to Bob without

Eve (who has access to the channel) knowing the

communication.

Simple idea (One Time Pad(OTP)):Let the message ๐‘€ be an ๐‘› binary string. Let ๐พ be an ๐‘› bit binary string that is used as a secret key.Add ๐‘€ and ๐พ modulo 2 to get the ciphertext.

Example: ๐‘€ = 1101, ๐พ = 0101, then ๐ถ = ๐‘€ + ๐พ (๐‘š๐‘œ๐‘‘ 2) = ๐‘€โŠ•๐พ = 1000

Page 27: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Secure communication: Alice wants to talk to Bob without

Eve (who has access to the channel) knowing the

communication.

Simple idea (One Time Pad(OTP)):Let the message ๐‘€ be an

๐‘› binary string. Let ๐พ be an ๐‘› bit binary string that is used as

a secret key.Add ๐‘€ and ๐พ modulo 2 to get the Ciphertext.

Can you break this scheme?

Page 28: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Secure communication: Alice wants to talk to Bob without

Eve (who has access to the channel) knowing the

communication.

Perfect Secrecy (Information Theoretic Security):

Let the message space be 0,1 ๐‘›.

For any two message ๐‘€0, ๐‘€1, and Ciphertext ๐ถPr ๐ธ๐พ ๐‘€0 = ๐ถ = Pr ๐ธ๐พ ๐‘€1 = ๐ถ

where the probability is over uniformly random ๐พ in the

Keyspace.

Given the ciphertext, all messages are equally likely to be the

secret message

Page 29: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Perfect Secrecy (Information Theoretic Security):

Let the message space be 0,1 ๐‘›.

For any two message ๐‘€0, ๐‘€1, and Ciphertext ๐ถPr ๐ธ๐พ ๐‘€0 = ๐ถ = Pr ๐ธ๐พ ๐‘€1 = ๐ถ

where the probability is over uniformly random ๐พ in the

Keyspace.

One Time Pad (OTP):

The Keyspace is 0, 1 ๐‘›.

๐ธ๐พ ๐‘€ = ๐พโŠ•๐‘€

๐ท๐พ ๐ถ = ๐พโŠ• ๐ถ

For any messages ๐‘€0, ๐‘€1 and ciphertext ๐ถ:

Pr ๐ธ๐พ ๐‘€0 = ๐ถ = Pr ๐ธ๐พ ๐‘€1 = ๐ถ = ? ?

Page 30: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Perfect Secrecy (Information Theoretic Security):

Let the message space be 0,1 ๐‘›.

For any two message ๐‘€0, ๐‘€1, and Ciphertext ๐ถPr ๐ธ๐พ ๐‘€0 = ๐ถ = Pr ๐ธ๐พ ๐‘€1 = ๐ถ

where the probability is over uniformly random ๐พ in the

Keyspace.

One Time Pad (OTP):

The Keyspace is 0, 1 ๐‘›.

๐ธ๐พ ๐‘€ = ๐พโŠ•๐‘€

๐ท๐พ ๐ถ = ๐พโŠ• ๐ถ

For any messages ๐‘€0, ๐‘€1 and ciphertext ๐ถ:

Pr ๐ธ๐พ ๐‘€0 = ๐ถ = Pr ๐ธ๐พ ๐‘€1 = ๐ถ = 1/2๐‘›

Page 31: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Perfect Secrecy (Information Theoretic Security):

Let the message space be 0,1 ๐‘›.

For any two message ๐‘€0, ๐‘€1, and Ciphertext ๐ถPr ๐ธ๐พ ๐‘€0 = ๐ถ = Pr ๐ธ๐พ ๐‘€1 = ๐ถ

where the probability is over uniformly random ๐พ in the

Keyspace.

One Time Pad (OTP):

The Keyspace is 0, 1 ๐‘›.

๐ธ๐พ ๐‘€ = ๐พโŠ•๐‘€

๐ท๐พ ๐ถ = ๐พโŠ• ๐ถ

For any messages ๐‘€0, ๐‘€1 and ciphertext ๐ถ:

Pr ๐ธ๐พ ๐‘€0 = ๐ถ = Pr ๐ธ๐พ ๐‘€1 = ๐ถ = 1/2๐‘›

Disadvantage: Key is as long as the message.

Page 32: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Perfect Secrecy (Information Theoretic Security):

Let the message space be 0,1 ๐‘›.

For any two message ๐‘€0, ๐‘€1, and Ciphertext ๐ถPr ๐ธ๐พ ๐‘€0 = ๐ถ = Pr ๐ธ๐พ ๐‘€1 = ๐ถ

where the probability is over uniformly random ๐พ in the Keyspace.

One Time Pad (OTP):

The Keyspace is 0, 1 ๐‘›.

๐ธ๐พ ๐‘€ = ๐พโŠ•๐‘€

๐ท๐พ ๐ถ = ๐พโŠ• ๐ถ

For any messages ๐‘€0, ๐‘€1 and ciphertext ๐ถ:Pr ๐ธ๐พ ๐‘€0 = ๐ถ = Pr ๐ธ๐พ ๐‘€1 = ๐ถ = 1/2๐‘›

Disadvantage: Key is as long as the message.

Fact: If ๐‘€ > |๐พ|, then no scheme is perfectly secure.

Page 33: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Perfect Secrecy (Information Theoretic Security):

Let the message space be 0,1 ๐‘›.

For any two message ๐‘€0, ๐‘€1, and Ciphertext ๐ถPr ๐ธ๐พ ๐‘€0 = ๐ถ = Pr ๐ธ๐พ ๐‘€1 = ๐ถ

where the probability is over uniformly random ๐พ in the

Keyspace.

Fact: If ๐‘€ > |๐พ|, then no scheme is perfectly secure.

How do we get around this problem?

Page 34: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Secure communication

Perfect Secrecy (Information Theoretic Security):

Let the message space be 0,1 ๐‘›.

For any two message ๐‘€0, ๐‘€1, and Ciphertext ๐ถPr ๐ธ๐พ ๐‘€0 = ๐ถ = Pr ๐ธ๐พ ๐‘€1 = ๐ถ

where the probability is over uniformly random ๐พ in the

Keyspace.

Fact: If ๐‘€ > |๐พ|, then no scheme is perfectly secure.

How do we get around this problem?

Relax our notion of security: Instead of saying โ€œit is impossible

to break the schemeโ€, we would like to say โ€œit is computationally

infeasible to break the schemeโ€.

Page 35: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Pseudorandom generator

Suppose there was a generator that stretches random bits.

001101011 00101001001010010100101011

Idea:

Choose a short key ๐พ randomly.

Obtain ๐พโ€™ = ๐บ(๐พ).

Use ๐พโ€™ as key for the one time pad.

Issue: ?

๐บ

Page 36: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Pseudorandom generator

Suppose there was a generator that stretches random bits.

001101011 00101001001010010100101011

Idea:

Choose a short key ๐พ randomly.

Obtain ๐พโ€™ = ๐บ(๐พ). Use ๐พโ€™ as key for the one time pad.

Issue:

Such a generator is not possible!

Any such generator produces a longer string but the string is not random.

๐บ

Page 37: CSL759: Cryptography and Computer Security - Computer Science

Introduction: Pseudorandom generator

Suppose there was a generator that stretches random bits.

001101011 00101001001010010100101011

Idea:

Choose a short key ๐พ randomly.

Obtain ๐พโ€™ = ๐บ(๐พ). Use ๐พโ€™ as key for the one time pad.

Issue:

Such a generator is not possible!

Any such generator produces a longer string but the string is not random.

What if we can argue that the output of the generator is computationally indistinguishable from truly random string.

๐บ

Page 38: CSL759: Cryptography and Computer Security - Computer Science

End