48
Courtesy of Professors Chris Clifton & Matt Bishop INFSCI 2935: Introduction of Computer Security 1 Nov 4, 2003 Nov 4, 2003 Introduction to Introduction to Computer Security Computer Security Lecture 8 Lecture 8 Key Management Key Management

Nov 4, 2003

  • Upload
    mala

  • View
    41

  • Download
    4

Embed Size (px)

DESCRIPTION

Nov 4, 2003. Introduction to Computer Security Lecture 8 Key Management. Issues. Authentication and distribution of keys Session key Key exchange protocols Mechanisms to bind an identity to a key Generation, maintenance and revoking of keys. Notation. X  Y : { Z || W } k X , Y - PowerPoint PPT Presentation

Citation preview

Page 1: Nov 4, 2003

Courtesy of Professors Chris Clifton & Matt Bishop

INFSCI 2935: Introduction of Computer Security

1

Nov 4, 2003Nov 4, 2003

Introduction to Introduction to Computer SecurityComputer Security

Lecture 8Lecture 8Key ManagementKey Management

Page 2: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 2

IssuesIssues

Authentication and distribution of keysAuthentication and distribution of keys Session key Key exchange protocols

Mechanisms to bind an identity to a keyMechanisms to bind an identity to a keyGeneration, maintenance and revoking of Generation, maintenance and revoking of

keyskeys

Page 3: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 3

NotationNotation

XX YY : { : { ZZ || || WW } } kkXX,,YY

X sends Y the message produced by concatenating Z and W enciphered by key kX,Y, which is shared by users X and Y

AA TT : { : { ZZ } } kkAA || { || { WW } } kkAA,,TT

A sends T a message consisting of the concatenation of Z enciphered using kA, A’s key, and W enciphered using kA,T, the key shared by A and T

rr11, , rr22 nonces (nonrepeating random numbers) nonces (nonrepeating random numbers)

Page 4: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 4

Session, Interchange KeysSession, Interchange Keys

Alice wants to send a message Alice wants to send a message mm to Bob to Bob Assume public key encryption Alice generates a random cryptographic key ks and uses

it to encipher m To be used for this message only Called a session key

She enciphers ks with Bob’s public key kB

kB enciphers all session keys Alice uses to communicate with Bob

Called an interchange key Alice sends { m } ks { ks } kB

Page 5: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 5

BenefitsBenefits

Limits amount of traffic enciphered with single Limits amount of traffic enciphered with single keykey Standard practice, to decrease the amount of traffic an

attacker can obtain Makes replay attack less effectiveMakes replay attack less effective Prevents some attacksPrevents some attacks

Example: Alice will send Bob message that is either “BUY” or “SELL”.

Eve computes possible ciphertexts {“BUY”} kB and {“SELL”} kB.

Eve intercepts enciphered message, compares, and gets plaintext at once

Page 6: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 6

Key Exchange AlgorithmsKey Exchange Algorithms

Goal: Alice, Bob use a shared key to Goal: Alice, Bob use a shared key to communicate secretelycommunicate secretely

CriteriaCriteria Key cannot be sent in clear

Attacker can listen in Key can be sent enciphered, or derived from exchanged

data plus data not known to an eavesdropper Alice, Bob may trust third party All cryptosystems, protocols publicly known

Only secret data is the keys, ancillary information known only to Alice and Bob needed to derive keys

Anything transmitted is assumed known to attacker

Page 7: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 7

Classical Key ExchangeClassical Key Exchange

How do Alice, Bob begin? How do Alice, Bob begin? Alice can’t send it to Bob in the clear!

Assume trusted third party, CathyAssume trusted third party, Cathy Alice and Cathy share secret key kA

Bob and Cathy share secret key kB

Use this to exchange shared key Use this to exchange shared key kkss

Page 8: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 8

Simple Key Exchange ProtocolSimple Key Exchange Protocol

Alice Cathy{ request for session key to Bob } kA

Alice Cathy{ ks }kA , { ks }kB

Alice Bob{ ks } kB

Alice Bob{m}ks

Eve

Page 9: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 9

ProblemsProblems

How does Bob know he is talking to Alice?How does Bob know he is talking to Alice? Replay attack: Eve records message from Alice

to Bob, later replays it; Bob may think he’s talking to Alice, but he isn’t

Session key reuse: Eve replays message from Alice to Bob, so Bob re-uses session key

Protocols must provide authentication and Protocols must provide authentication and defense against replaydefense against replay

Page 10: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 10

Needham-SchroederNeedham-Schroeder

Alice CathyAlice || Bob || r1

Alice Cathy{ Alice || Bob || r1 || ks , { Alice || ks } kB } kA

Alice Bob{ Alice || ks } kB

Alice Bob{ r2 } ks

Alice Bob{ r2 – 1 } ks

Page 11: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 11

Argument: Alice talking to BobArgument: Alice talking to Bob

Second messageSecond message Enciphered using key only she, Cathy know

So Cathy enciphered it Response to first message

As r1 in it matches r1 in first message

Third messageThird message Alice knows only Bob can read it

As only Bob can derive session key from message Any messages enciphered with that key are from Bob

Page 12: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 12

Argument: Bob talking to AliceArgument: Bob talking to Alice

Third messageThird message Enciphered using key only he, Cathy know

So Cathy enciphered it Names Alice, session key

Cathy provided session key, says Alice is other party

Fourth messageFourth message Uses session key to determine if it is replay from Eve

If not, Alice will respond correctly in fifth message If so, Eve can’t decipher r2 and so can’t respond, or

responds incorrectly

Page 13: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 13

Problem withProblem withNeedham-Schroeder Needham-Schroeder

Assumption: all keys are secretAssumption: all keys are secret Question: suppose Eve can obtain session key. Question: suppose Eve can obtain session key.

How does that affect protocol?How does that affect protocol? In what follows, Eve knows ks

Eve Bob{ Alice || ks } kB [Replay]

Eve Bob{ r3 } ks [Eve intercepts]

Eve Bob{ r3 – 1 } ks

Page 14: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 14

Solution: Denning-Sacco Solution: Denning-Sacco ModificationModification

In protocol above, Eve impersonates AliceIn protocol above, Eve impersonates Alice Problem: replay in third stepProblem: replay in third step

First in previous slide Solution: use time stamp Solution: use time stamp TT to detect replay to detect replay

Needs synchronized clocks Weakness: if clocks not synchronized, may Weakness: if clocks not synchronized, may

either reject valid messages or accept replayseither reject valid messages or accept replays Parties with either slow or fast clocks vulnerable to

replay Resetting clock does not eliminate vulnerability

Page 15: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 15

Needham-Schroeder with Needham-Schroeder with Denning-Sacco ModificationDenning-Sacco Modification

Alice CathyAlice || Bob || r1

Alice Cathy{ Alice || Bob || r1 || ks || { Alice || T || ks } kB } kA

Alice Bob{ Alice || T || ks } kB

Alice Bob{ r2 } ks

Alice Bob{ r2 – 1 } ks

Page 16: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 16

Otway-Rees ProtocolOtway-Rees Protocol

Corrects problemCorrects problem That is, Eve replaying the third message in the

protocol

Does not use timestampsDoes not use timestamps Not vulnerable to the problems that Denning-

Sacco modification has

Uses integer Uses integer nn to associate all messages to associate all messages with a particular exchangewith a particular exchange

Page 17: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 17

The ProtocolThe Protocol

Alice Bobn || Alice || Bob || { r1 || n || Alice || Bob } kA

Cathy Bobn || Alice || Bob || { r1 || n || Alice || Bob } kA ||

{ r2 || n || Alice || Bob } kB

Cathy Bobn || { r1 || ks } kA || { r2 || ks } kB

Alice Bobn || { r1 || ks } kA

Page 18: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 18

Argument: Alice talking to BobArgument: Alice talking to Bob

Fourth messageFourth message If n matches first message, Alice knows it is

part of this protocol exchange Cathy generated ks because only she, Alice

know kA

Enciphered part belongs to exchange as r1 matches r1 in encrypted part of first message

Page 19: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 19

Argument: Bob talking to AliceArgument: Bob talking to Alice

Third messageThird message If n matches second message, Bob knows it is

part of this protocol exchange Cathy generated ks because only she, Bob

know kB

Enciphered part belongs to exchange as r2 matches r2 in encrypted part of second message

Page 20: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 20

Replay AttackReplay Attack

Eve acquires old Eve acquires old kkss, message in third step, message in third step n || { r1 || ks } kA || { r2 || ks } kB

Eve forwards appropriate part to AliceEve forwards appropriate part to Alice Alice has no ongoing key exchange with Bob: n

matches nothing, so is rejected Alice has ongoing key exchange with Bob: n does not

match, so is again rejected If replay is for the current key exchange, and Eve sent the

relevant part before Bob did, Eve could simply listen to traffic; no replay involved

Page 21: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 21

Public Key Key ExchangePublic Key Key Exchange

Here interchange keys knownHere interchange keys known eA, eB Alice and Bob’s public keys known to all

dA, dB Alice and Bob’s private keys known only to owner

Simple protocolSimple protocol ks is desired session key

Alice Bob{ ks } eB

Page 22: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 22

Problem and SolutionProblem and Solution

Vulnerable to forgery or replayVulnerable to forgery or replay Because eB known to anyone, Bob has no assurance

that Alice sent message

Simple fix uses Alice’s private keySimple fix uses Alice’s private key ks is desired session key

Alice Bob{ { ks } dA } eB

Page 23: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 23

NotesNotes

Can include message enciphered with Can include message enciphered with kkss

Assumes Bob has Alice’s public key, and Assumes Bob has Alice’s public key, and vice vice versaversa If not, each must get it from public server If keys not bound to identity of owner, attacker Eve

can launch a man-in-the-middle attack (next slide; Cathy is public server providing public keys)

Page 24: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 24

Man-in-the-Middle AttackMan-in-the-Middle Attack

Alice Cathysend me Bob’s public key

Eve Cathysend me Bob’s public key

Eve CathyeB

AliceeE Eve

Alice Bob{ ks } eE

Eve Bob{ ks } eB

Eve intercepts request

Eve intercepts message

Page 25: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 25

Key GenerationKey Generation

Goal: generate difficult to guess keysGoal: generate difficult to guess keys Problem statement: given a set of Problem statement: given a set of KK potential potential

keys, choose one randomlykeys, choose one randomly Equivalent to selecting a random number between 0

and K–1 inclusive

Why is this hard: generating random numbersWhy is this hard: generating random numbers Actually, numbers are usually pseudo-random, that is,

generated by an algorithm

Page 26: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 26

What is “Random”?What is “Random”?

Sequence of cryptographically random Sequence of cryptographically random numbersnumbers: a sequence of numbers : a sequence of numbers nn11, , nn22, , … such that for any integer … such that for any integer kk > 0, an > 0, an observer cannot predict observer cannot predict nnkk even if all of even if all of nn11, , …, …, nnkk–1–1 are known are known Best: physical source of randomness

Electromagnetic phenomenaCharacteristics of computing environment such

as disk latencyAmbient background noise

Page 27: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 27

What is “Pseudorandom”?What is “Pseudorandom”?

Sequence of cryptographically pseudorandom Sequence of cryptographically pseudorandom numbersnumbers: sequence of numbers intended to : sequence of numbers intended to simulate a sequence of cryptographically simulate a sequence of cryptographically random numbers but generated by an algorithmrandom numbers but generated by an algorithm Very difficult to do this well

Linear congruential generators [nk = (ank–1 + b) mod n] broken (a, b and n are relatively prime)

Polynomial congruential generators [nk = (ajnk–1j + … +

a1nk–1 a0) mod n] broken too Here, “broken” means next number in sequence can be

determined

Page 28: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 28

Best Pseudorandom NumbersBest Pseudorandom Numbers

Strong mixing functionStrong mixing function: function of 2 or : function of 2 or more inputs with each bit of output more inputs with each bit of output depending on some nonlinear function of depending on some nonlinear function of all input bitsall input bits Examples: DES, MD5, SHA-1 Use on UNIX-based systems:

(date; ps gaux) | md5

where “ps gaux” lists all information about all processes on system

Page 29: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 29

Digital SignatureDigital Signature

Construct that authenticates origin, contents of Construct that authenticates origin, contents of message in a manner provable to a disinterested message in a manner provable to a disinterested third party (“judge”)third party (“judge”)

Sender cannot deny having sent message Sender cannot deny having sent message (service is “nonrepudiation”)(service is “nonrepudiation”) Limited to technical proofs

Inability to deny one’s cryptographic key was used to sign One could claim the cryptographic key was stolen or

compromised Legal proofs, etc., probably required;

Page 30: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 30

Common ErrorCommon Error

Classical: Alice, Bob share key Classical: Alice, Bob share key kk Alice sends m || { m }k to Bob

This is a digital signatureThis is a digital signature

WRONGWRONGThis is not aThis is not a digital signaturedigital signature

Why? Third party cannot determine whether Alice or Bob generated message

Page 31: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 31

Classical Digital SignaturesClassical Digital Signatures

Require trusted third partyRequire trusted third party Alice, Bob each share keys with trusted party Cathy

To resolve dispute, judge gets { To resolve dispute, judge gets { mm } }kkAliceAlice, { , { mm } }kkBobBob, and , and has Cathy decipher them; if messages matched, contract has Cathy decipher them; if messages matched, contract was signedwas signed

Alice Bob

Bob Cathy

Cathy Bob

{ m }kAlice

{ m }kAlice

{ m }kBob

Page 32: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 32

Public Key Digital SignaturesPublic Key Digital Signatures

Alice’s keys are Alice’s keys are ddAliceAlice, , eeAliceAlice

Alice sends BobAlice sends Bobm || { m }dAlice

In case of dispute, judge computesIn case of dispute, judge computes{ { m }dAlice }eAlice

and if it is and if it is mm, Alice signed message, Alice signed message She’s the only one who knows dAlice!

Page 33: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 33

RSA Digital SignaturesRSA Digital Signatures

Use private key to encipher messageUse private key to encipher message Protocol for use is critical

Key points:Key points: Never sign random documents, and when

signing, always sign hash and never document Mathematical properties can be turned against signer

Sign message first, then encipher Changing public keys causes forgery

Page 34: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 34

Attack #1Attack #1

Example: Alice, Bob communicatingExample: Alice, Bob communicating nA = 95, eA = 59, dA = 11 nB = 77, eB = 53, dB = 17

26 contracts, numbered 00 to 2526 contracts, numbered 00 to 25 Alice has Bob sign 05 and 17:

c = mdB mod nB = 0517 mod 77 = 3 c = mdB mod nB = 1717 mod 77 = 19

Alice computes 0517 mod 77 = 08; corresponding signature is 0319 mod 77 = 57; claims Bob signed 08

Note: [(a mod n) × (b mod n)] mod n = (a × b) mod n Judge computes ceB mod nB = 5753 mod 77 = 08

Signature validated; Bob is toast!

Page 35: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 35

Attack #2: Bob’s RevengeAttack #2: Bob’s Revenge

Bob, Alice agree to sign contract 06Bob, Alice agree to sign contract 06 Alice enciphers, then signs:Alice enciphers, then signs:

Enciper: c = meB mod nB = (0653 mod 77)11

Sign: cdA mod nA = (0653 mod 77)11 mod 95 = 63 Bob now changes his public keyBob now changes his public key

Bob wants to claim that Alice singed N (13) Computes r such that 13r mod 77 = 6; say, r = 59 Computes r.eB mod (nB) = 5953 mod 60 = 7 Replace public key eB with 7, private key dB = 43

Bob claims contract was 13. Judge computes:Bob claims contract was 13. Judge computes: (6359 mod 95)43 mod 77 = 13 Verified; now Alice is toast

Solution: sign first and then encipher!!Solution: sign first and then encipher!!

Page 36: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 36

El Gamal Digital SignatureEl Gamal Digital Signature

Relies on discrete log problemRelies on discrete log problem Choose Choose pp prime, prime, gg, , dd < < pp; ; Compute Compute yy = = ggdd mod mod pp Public key: (Public key: (yy, , gg, , pp); private key: ); private key: dd To sign contract To sign contract mm::

Choose k relatively prime to p–1, and not yet used Compute a = gk mod p Find b such that m = (da + kb) mod p–1 Signature is (a, b)

To validate, check thatTo validate, check that yaab mod p = gm mod p

Page 37: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 37

ExampleExample

Alice chooses Alice chooses pp = 29, = 29, gg = 3, = 3, dd = 6 = 6y = 36 mod 29 = 4

Alice wants to send Bob signed contract 23Alice wants to send Bob signed contract 23 Chooses k = 5 (relatively prime to 28) This gives a = gk mod p = 35 mod 29 = 11 Then solving 23 = (611 + 5b) mod 28 gives b = 25 Alice sends message 23 and signature (11, 25)

Bob verifies signature: Bob verifies signature: ggmm mod mod pp = 3 = 32323 mod 29 = mod 29 = 8 and 8 and yyaaaabb mod mod pp = 4 = 4111111112525 mod 29 = 8 mod 29 = 8 They match, so Alice signed

Page 38: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 38

AttackAttack

Eve learns Eve learns kk, corresponding message , corresponding message mm, , and signature (and signature (aa, , bb)) Extended Euclidean Algorithm gives d, the

private key

Example from above: Eve learned Alice Example from above: Eve learned Alice signed last message with signed last message with kk = 5 = 5

m = (da + kb) mod p–1 = 23

=(11d + 525) mod 28

So Alice’s private key is d = 6

Page 39: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 39

KerberosKerberos

Authentication systemAuthentication system Based on Needham-Schroeder with Denning-Sacco

modification Central server plays role of trusted third party (“Cathy”)

Ticket (credential)Ticket (credential) Issuer vouches for identity of requester of service

AuthenticatorAuthenticator Identifies sender

Alice mustAlice must1. Authenticate herself to the system2. Obtain ticket to use server S

Page 40: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 40

OverviewOverview

User User uu authenticates to Kerberos server authenticates to Kerberos server Obtains ticket Tu,TGS for ticket granting service (TGS)

Tu,TGS = TGS || { u || u’s address || valid time || ku,TGS } kTGS

User User uu wants to use service wants to use service ss:: User sends authenticator Au, ticket Tu,TGS to TGS

asking for ticket for service TGS sends ticket Tu,s to user

User sends Au, Tu,s to server as request to use s

Details followDetails follow

Page 41: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 41

TicketTicket

Credential saying issuer has identified ticket Credential saying issuer has identified ticket requesterrequester

Example ticket issued to user Example ticket issued to user uu for service for service ssTu,s = s || { u || u’s address || valid time || ku,s } ks

where: ku,s is session key for user and service Valid time is interval for which the ticket is valid u’s address may be IP address or something else

Note: more fields, but not relevant here

Page 42: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 42

AuthenticatorAuthenticator

Credential containing identity of sender of ticketCredential containing identity of sender of ticket Used to confirm sender is entity to which ticket was

issued Example: authenticator user Example: authenticator user uu generates for generates for

service service ssAu,s = { u || generation time || kt } ku,s

where: kt is alternate session key Generation time is when authenticator generated

Note: more fields, not relevant here

Page 43: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 43

ProtocolProtocol

user ASuser || TGS

user AS{ ku,TGS } ku || Tu,TGS

user TGSservice || Au,TGS || Tu,TGS

user TGSuser || { ku,s } ku,TGS || Tu,s

user serviceAu,s || Tu,s

user service{ t + 1 } ku,s

Page 44: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 44

AnalysisAnalysis

First two steps get user ticket to use TGSFirst two steps get user ticket to use TGS User u can obtain session key only if u knows

key shared with CathyNext four steps show how Next four steps show how uu gets and uses gets and uses

ticket for service ticket for service ss Service s validates request by checking sender

(using Au,s) is same as entity ticket issued to Step 6 optional; used when u requests

confirmation

Page 45: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 45

ProblemsProblems

Relies on synchronized clocksRelies on synchronized clocks If not synchronized and old tickets,

authenticators not cached, replay is possible

Tickets have some fixed fieldsTickets have some fixed fields Dictionary attacks possible Kerberos 4 session keys weak (had much less

than 56 bits of randomness); researchers at Purdue found them from tickets in minutes

Page 46: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 46

ProjectProject

ImplementationImplementation Reasonable sophistication Up to 3 people

Survey type paperSurvey type paper Comparative/tradeoff studies Current trends, challenges, possible approaches One person! Number of references should be adequate (depends on

area) No introductory stuff!

New idea/research ??New idea/research ?? Others: Case studies??Others: Case studies??

Page 47: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 47

Project Topics Project Topics (not limited to these only!)(not limited to these only!)

XML security Implementation of Access Control and Authentication Cryptographic protocols Database security Ad hoc network security Cyber Security Privacy Web service security / Java security Intrusion detection Auditing Systems Security and ethics/Usability/Economics Smartcards and standards for smartcards E-commerce security (secure transaction) Multimedia security Security in wireless/mobile environments Case studies from a specific domain

Page 48: Nov 4, 2003

INFSCI 2935: Introduction to Computer Security 48

Project ScheduleProject Schedule

Proposal (by Nov 18)Proposal (by Nov 18) Up to 2 pages (identify a group) State the goals State the significance

Final project reportFinal project report By the last day of the semester Article format, or conference format

Each person should state his contribution Implementation projects should demonstrate to TA

and/or me