Скачать презентацию TECS Week 2005 Security Analysis of Network Protocols Скачать презентацию TECS Week 2005 Security Analysis of Network Protocols

dd86c681005b325baf9843ee83d28d3a.ppt

  • Количество слайдов: 29

TECS Week 2005 Security Analysis of Network Protocols John Mitchell Stanford Reference: http: //www. TECS Week 2005 Security Analysis of Network Protocols John Mitchell Stanford Reference: http: //www. stanford. edu/class/cs 259/

Computer Security u Cryptography • Encryption, signatures, cryptographic hash, … u Security mechanisms • Computer Security u Cryptography • Encryption, signatures, cryptographic hash, … u Security mechanisms • Access control policy • Network protocols u Implementation • Cryptographic library • Code implementing mechanisms – Reference monitor and TCB – Protocol • Runs under OS, uses program library, network protocol stack Analyze protocols, assuming crypto, implementation, OS correct

Cryptographic Protocols u. Two or more parties u. Communication over insecure network u. Cryptography Cryptographic Protocols u. Two or more parties u. Communication over insecure network u. Cryptography used to achieve goal • Exchange secret keys • Verify identity (authentication) JR Rao: Public-key encryption, symmetric-key encryption, CBC, hash, signature, key generation, random-number generators

Correctness vs Security u. Program or System Correctness • Program satisfies specification – For Correctness vs Security u. Program or System Correctness • Program satisfies specification – For reasonable input, get reasonable output u. Program or System Security • Program properties preserved in face of attack – For unreasonable input, output not completely disastrous u. Main differences • Active interference from adversary • Refinement techniques may fail – More functionality can be worse

Security Analysis u. Model system u. Model adversary u. Identify security properties u. See Security Analysis u. Model system u. Model adversary u. Identify security properties u. See if properties are preserved under attack u. Result • No “absolute security” • Security means: under given assumptions about system, no attack of a certain form will destroy specified properties.

Important Modeling Decisions u. How powerful is the adversary? • • Simple replay of Important Modeling Decisions u. How powerful is the adversary? • • Simple replay of previous messages Block messages; Decompose, reassemble and resend Statistical analysis, partial info from network traffic Timing attacks u. How much detail in underlying data types? • Plaintext, ciphertext and keys – atomic data or bit sequences • Encryption and hash functions – “perfect” cryptography – algebraic properties: encr(x*y) = encr(x) * encr(y) for RSA encrypt(k, msg) = msg k mod N

High Hand proofs Poly-time calculus Multiset rewriting with Spi-calculus Athena Paulson NRL Strand spaces High Hand proofs Poly-time calculus Multiset rewriting with Spi-calculus Athena Paulson NRL Strand spaces BAN logic Low Modeling detail Protocol analysis spectrum Protocol logic Low Model checking FDR Protocol complexity High Mur

Four “Stanford” approaches SRI, U Penn, U Texas, Kiel, INRIA, … u Finite-state analysis Four “Stanford” approaches SRI, U Penn, U Texas, Kiel, INRIA, … u Finite-state analysis • Case studies: find errors, debug specifications u Symbolic execution model: Multiset rewriting • Identify basic assumptions • Study optimizations, prove correctness • Complexity results u Process calculus with probability and complexity • More realistic intruder model • Interaction between protocol and cryptography • Equational specification and reasoning methods u Protocol logic • Axiomatic system for modular proofs of protocol properties

Some other projects and tools u. Exhaustive finite-state analysis • FDR, based on CSP Some other projects and tools u. Exhaustive finite-state analysis • FDR, based on CSP [Lowe, Roscoe, Schneider, …] u. Search using symbolic representation of states • Meadows: NRL Analyzer, Millen: Interrogator u. Prove protocol correct • Paulson’s “Inductive method”, others in HOL, PVS, … • MITRE -- Strand spaces • Process calculus approach: Abadi-Gordon spi-calculus, applied pi-calculus, … • Type-checking method: Gordon and Jeffreys, … Many more – this is just a small sample

Example: Needham-Schroeder u. Famous simple example • Protocol published and known for 10 years Example: Needham-Schroeder u. Famous simple example • Protocol published and known for 10 years • Gavin Lowe discovered unintended property while preparing formal analysis using FDR system u. Background: Public-key cryptography • Every agent A has – Public encryption key Ka – Private decryption key Ka-1 • Main properties – Everyone can encrypt message to A – Only A can decrypt these messages

Needham-Schroeder Key Exchange { A, Nonce. A } Kb A { Nonce. A, Nonce. Needham-Schroeder Key Exchange { A, Nonce. A } Kb A { Nonce. A, Nonce. B } Ka { Nonce. B} Kb Result: A and B share two private numbers not known to any observer without Ka-1, Kb -1 B

Anomaly in Needham-Schroeder [Lowe] { A, NA } Ke A E { NA, NB Anomaly in Needham-Schroeder [Lowe] { A, NA } Ke A E { NA, NB } Ka { NB } Ke Evil agent E tricks honest A into revealing private key NB from B Evil E can then fool B { NA, NB } { A, NA } Ka B Kb

Explicit Intruder Method Informal Protocol Description Formal Protocol Find error Intruder Model Analysis Tool Explicit Intruder Method Informal Protocol Description Formal Protocol Find error Intruder Model Analysis Tool

Run of protocol Initiate A Respond B Attacker C D Correct if no security Run of protocol Initiate A Respond B Attacker C D Correct if no security violation in any run

Automated Finite-State Analysis u Define finite-state system • Bound on number of steps • Automated Finite-State Analysis u Define finite-state system • Bound on number of steps • Finite number of participants • Nondeterministic adversary with finite options u Pose correctness condition • Can be simple: authentication and secrecy • Can be complex: contract signing u Exhaustive search using “verification” tool • Error in finite approximation Error in protocol • No error in finite approximation ? ? ?

Finite-state methods u. Two sources of infinite behavior • Many instances of participants, multiple Finite-state methods u. Two sources of infinite behavior • Many instances of participants, multiple runs • Message space or data space may be infinite u. Finite approximation • Assume finite participants – Example: 2 clients, 2 servers • Assume finite message space – Represent random numbers by r 1, r 2, r 3, … – Do not allow unbounded encrypt(encrypt(…)))

 Murj [Dill et al. ] u. Describe finite-state system • State variables with Murj [Dill et al. ] u. Describe finite-state system • State variables with initial values • Transition rules • Communication by shared variables u. Scalable: choose system size parameters u. Automatic exhaustive state enumeration • Space limit: hash table to avoid repeating states u. Research and industrial protocol verification

Applying Murj to security protocols u. Formulate protocol u. Add adversary • Control over Applying Murj to security protocols u. Formulate protocol u. Add adversary • Control over “network” (shared variables) • Possible actions – Intercept any message – Remember parts of messages – Generate new messages, using observed data and initial knowledge (e. g. public keys)

Needham-Schroeder in Murj (1) const Num. Initiators: 1; Num. Responders: 1; Num. Intruders: 1; Needham-Schroeder in Murj (1) const Num. Initiators: 1; Num. Responders: 1; Num. Intruders: 1; Network. Size: 1; Max. Knowledge: 10; type Initiator. Id: Responder. Id: Intruder. Id: Agent. Id: ------ number of initiators number of responders number of intruders max. outstanding msgs in network number msgs intruder can remember scalarset (Num. Initiators); scalarset (Num. Responders); scalarset (Num. Intruders); union {Initiator. Id, Responder. Id, Intruder. Id};

Needham-Schroeder in Murj (2) Message. Type : enum { M_Nonce. Address, M_Nonce, M_Nonce }; Needham-Schroeder in Murj (2) Message. Type : enum { M_Nonce. Address, M_Nonce, M_Nonce }; Message : record source: Agent. Id; dest: Agent. Id; key: Agent. Id; m. Type: Message. Type; nonce 1: Agent. Id; nonce 2: Agent. Id; end; -- types of messages -- {Na, A}Kb nonce and addr -- {Na, Nb}Ka two nonces -- {Nb}Kb one nonce ------- source of message intended destination of msg key used for encryption type of message nonce 1 nonce 2 OR sender id OR empty

Needham-Schroeder in Murj (3) -- intruder i sends recorded message ruleset i: Intruder. Id Needham-Schroeder in Murj (3) -- intruder i sends recorded message ruleset i: Intruder. Id do -- arbitrary choice of choose j: int[i]. messages do -- recorded message ruleset k: Agent. Id do -- destination rule "intruder sends recorded message" !ismember(k, Intruder. Id) & -- not to intruders multisetcount (l: net, true) < Network. Size ==> var out. M: Message; begin out. M : = int[i]. messages[j]; out. M. source : = i; out. M. dest : = k; multisetadd (out. M, net); end;

Adversary Model u. Formalize “knowledge” • initial data • observed message fields • results Adversary Model u. Formalize “knowledge” • initial data • observed message fields • results of simple computations u. Optimization • only generate messages that others read • time-consuming to hand simplify u. Possibility: automatic generation

Run of Needham-Schroeder u. Find error after 1. 7 seconds exploration u. Output: trace Run of Needham-Schroeder u. Find error after 1. 7 seconds exploration u. Output: trace leading to error state u. Murj times after correcting error:

Limitations u. System size with current methods • 2 -6 participants Kerberos: 2 clients, Limitations u. System size with current methods • 2 -6 participants Kerberos: 2 clients, 2 servers, 1 KDC, 1 TGS • 3 -6 steps in protocol • May need to optimize adversary u. Adversary model • Cannot model randomized attack • Do not model adversary running time

Security Protocols in Mur u. Standard “benchmark” protocols • Needham-Schroeder, TMN, … • Kerberos Security Protocols in Mur u. Standard “benchmark” protocols • Needham-Schroeder, TMN, … • Kerberos u. Study of Secure Sockets Layer (SSL) • Versions 2. 0 and 3. 0 of handshake protocol • Include protocol resumption u. Tool optimization u. Additional protocols • Contract-signing • Wireless networking … ADD YOUR PROJECT HERE …

State Reduction on N-S Protocol State Reduction on N-S Protocol

Plan for this course u. Protocols • Authentication, key establishment, assembling protocols together (TLS Plan for this course u. Protocols • Authentication, key establishment, assembling protocols together (TLS ? ), fairness exchange, … u. Tools • Finite-state and probabilistic model checking, constraint-solving, process calculus, temporal logic, proof systems, game theory, polynomial time … u. Projects (You do this later on your own!) • Choose a protocol or other security mechanism • Choose a tool or method and carry out analysis • Hard part: formulating security requirements

Reference Material (CS 259 web site) u Protocols • Clarke-Jacob survey • Use Google; Reference Material (CS 259 web site) u Protocols • Clarke-Jacob survey • Use Google; learn to read an RFC u Tools • Murphi – Finite-state tool developed by David Dill’s group at Stanford • PRISM – Probabilistic model checker, University of Birmingham • MOCHA – Alur and Henzinger; now consortium • Constraint solver using prolog – Shmatikov and Millen • Isabelle – Theorem prover developed by Larry Paulson in Cambridge, UK – A number of case studies available on line