Differential Protocol Analysis & API Level Attacks Mike Bond Computer Security Group Security and Protection of Information30 th Apr ‘03.

Slides:



Advertisements
Similar presentations
Securing Critical Unattended Systems with Identity Based Cryptography A Case Study Johannes Blömer, Peter Günther University of Paderborn Volker Krummel.
Advertisements

ECE454/CS594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2011.
CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (3) Information Security.
1 Security in Wireless Protocols Bluetooth, , ZigBee.
Spring 2000CS 4611 Security Outline Encryption Algorithms Authentication Protocols Message Integrity Protocols Key Distribution Firewalls.
1 Lecture 17: SSL/TLS history, architecture basic handshake session initiation/resumption key computation negotiating cipher suites application: SET.
Satan’s Computer - Revisited Ross Anderson 17th June 2004.
Hardware Cryptographic Coprocessor Peter R. Wihl Security in Software.
White-Box Cryptography
Digital Signatures and Hash Functions. Digital Signatures.
Grid Security Infrastructure Tutorial Von Welch Distributed Systems Laboratory U. Of Chicago and Argonne National Laboratory.
1 Digital Signatures & Authentication Protocols. 2 Digital Signatures have looked at message authentication –but does not address issues of lack of trust.
Chapter 10  ATM 1 Automatic Teller Machines. Chapter 10  ATM 2 Automatic Teller Machines  “…one of the most influential technological innovations of.
Mar 19, 2002Mårten Trolin1 This lecture On the assignment Certificates and key management SSL/TLS –Introduction –Phases –Commands.
 Key exchange o Kerberos o Digital certificates  Certificate authority structure o PGP, hierarchical model  Recovery from exposed keys o Revocation.
Session 5 Hash functions and digital signatures. Contents Hash functions – Definition – Requirements – Construction – Security – Applications 2/44.
CS555Spring 2012/Topic 161 Cryptography CS 555 Topic 16: Key Management and The Need for Public Key Cryptography.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 29 Cryptography and Network.
Introduction to PKI Seminar What is PKI? Robert Brentrup July 13, 2004.
Apr 30, 2002Mårten Trolin1 Previous lecture – passwords Passwords for authentication –Storing hashed passwords –Use of salt Passwords for key generation.
Dr Alejandra Flores-Mosri Message Authentication Internet Management & Security 06 Learning outcomes At the end of this session, you should be able to:
Introduction to Signcryption November 22, /11/2004 Signcryption Public Key (PK) Cryptography Discovering Public Key (PK) cryptography has made.
McGraw-Hill©The McGraw-Hill Companies, Inc., Security PART VII.
How cryptography is used to secure web services Josh Benaloh Cryptographer Microsoft Research.
Topic 11: Key Distribution and Agreement 1 Information Security CS 526 Topic 11: Key Distribution & Agreement, Secure Communication.
1 PIN Security Management and Concerns Susan Langford Sr. Cryptographer CACR Information Security Workshop.
Chapter 8.  Cryptography is the science of keeping information secure in terms of confidentiality and integrity.  Cryptography is also referred to as.
Alexander Potapov.  Authentication definition  Protocol architectures  Cryptographic properties  Freshness  Types of attack on protocols  Two-way.
Computer Science Public Key Management Lecture 5.
Public Key Model 8. Cryptography part 2.
Cryptography and Network Security Chapter 11 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
1 Introduction to Security and Cryptology Enterprise Systems DT211 Denis Manley.
Computer Security Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
Programming Satan’s Computer
Smart Cards By Simon Siu and Russell Doyle Overview Size of a credit card Small embedded computer chip – Memory cards – Processor cards – Electronic.
Lecture 19 Page 1 CS 111 Online Symmetric Cryptosystems C = E(K,P) P = D(K,C) E() and D() are not necessarily the same operations.
IT 221: Introduction to Information Security Principles Lecture 6:Digital Signatures and Authentication Protocols For Educational Purposes Only Revised:
The Cryptographic Sensor FTO Libor Dostálek, Václav Novák.
Cryptography, Authentication and Digital Signatures
LOGO Hardware side of Cryptography Anestis Bechtsoudis Patra 2010.
A Survey of Authentication Protocol Literature: Version 1.0 Written by John Clark and Jeremy Jacob Presented by Brian Sierawski.
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
Chapter 31 Cryptography And Network Security Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Computer Security: Principles and Practice First Edition by William Stallings and Lawrie Brown Lecture slides by Lawrie Brown Chapter 2 – Cryptographic.
Fall 2010/Lecture 321 CS 426 (Fall 2010) Key Distribution & Agreement.
API-Level Attacks on Embedded Systems By Mike Bond and Ross Anderson “… by presenting valid commands to the security processor, but in an unexpected sequence,
Encryption Questions answered in this lecture: How does encryption provide privacy? How does encryption provide authentication? What is public key encryption?
Chapter 7 – Confidentiality Using Symmetric Encryption.
Lecture 16: Security CDK4: Chapter 7 CDK5: Chapter 11 TvS: Chapter 9.
Lecture 2: Introduction to Cryptography
Software Security Seminar - 1 Chapter 10. Using Algorithms 조미성 Applied Cryptography.
NEW DIRECTIONS IN CRYPTOGRAPHY Made Harta Dwijaksara, Yi Jae Park.
Encryption. Introduction The incredible growth of the Internet has excited businesses and consumers alike with its promise of changing the way we live.
A A E E D D C C B B # Symmetric Keys = n*(n-1)/2 F F
Security fundamentals Topic 5 Using a Public Key Infrastructure.
Decimalisation Table Attacks for PIN cracking “ It takes an average of 15 guesses to determine a four digit PIN using this technique, instead of the 5000.
Lecture 11 Overview. Digital Signature Properties CS 450/650 Lecture 11: Digital Signatures 2 Unforgeable: Only the signer can produce his/her signature.
Lecture 9 Overview. Digital Signature Properties CS 450/650 Lecture 9: Digital Signatures 2 Unforgeable: Only the signer can produce his/her signature.
Pertemuan #8 Key Management Kuliah Pengaman Jaringan.
The Federal Information Processing Standards (FIPS) Encryption Suite Sean Smith COSC
Computer Security By Rubel Biswas. Introduction History Terms & Definitions Symmetric and Asymmetric Attacks on Cryptosystems Outline.
@Yuan Xue Case Study (Mid-term question) Bob sells BatLab Software License Alice buys BatLab Credit card information Number of.
Cryptographic Hash Function. A hash function H accepts a variable-length block of data as input and produces a fixed-size hash value h = H(M). The principal.
A Low Cost Hardware Birthday Attack on DES Mike Bond, Richard Clayton University of Cambridge Computer Laboratory 5 th June 2001.
Hardware Cryptographic Coprocessor
CDK4: Chapter 7 CDK5: Chapter 11 TvS: Chapter 9
CDK: Chapter 7 TvS: Chapter 9
Secret-Key Encryption
Presentation transcript:

Differential Protocol Analysis & API Level Attacks Mike Bond Computer Security Group Security and Protection of Information30 th Apr ‘03

Summary Security APIs Hardware Security Modules Introduction to Banking Security Conventional Protocol Attacks API-Level Attacks Differential Protocol Analysis Solution: Formal Methods & Evaluation ? Conclusions

What is a Security API ? A command set that uses cryptography to control processing of and access to sensitive data, according to a certain policy Host PC or Mainframe Security Processor PCI Card or Separate Module Security API VDU I/O Devs Network

Example Security API Commands U->C : { A } KM, { B } KM C->U : { A+B } KM U->C : GUESS, { ANS } KM C->U : YES (if GUESS=ANS else NO) U->C : { X } K1, { K1 } KM, { K2 } KM C->U : { X } K2

Research into API Attacks Some work in early 90’s using prolog style search to find attacks, but few documented atttacks Work started in 2000 at University of Cambridge with analysis of hardware security modules used in banks to protect PINs for ATMs New work found many more attacks, and produced first significant catalogue of API failures Scope has been broadened to include security modules used by certification authorities and also general purpose crypto libraries (eg MSCAPI, PKCS#11) Latest work revisiting financial APIs examining PIN generation and verification procedures…

Hardware Security Modules An instantiation of a security API Often physically tamper-resistant (epoxy potting, temperature & xray sensors) May have hardware crypto acceleration (not so important with speed of modern PC) May have special ‘trusted’ peripherals (key switches, smartcard readers, key pads) (referred to as HSMs subsequently)

Hardware Security Modules

Who Needs Security Modules ? Those who need to enforce access policies to sensitive information Examples: Granting signing permission at a Certification Authority Enforcing split control policies on nuclear weapons & arming codes Those who need to protect mission critical sensitive data Example: Protecting PIN generation keys at banks Those who need to protect data in hostile environments Examples: Protecting Token Vending Machines (Electricity, Lottery etc…) Protecting communications keys in battlefield radios Those with high crypto throughput requirements Example: SSL acceleration for webservers

Financial HSMs & API Attacks Attacks discovered at Cambridge –VSM Type System attack –XOR to Null key attack –Meet in the Middle attack Newly discovered attacks: –Decimalisation table attack –PAN modification attack Prerequisites: –Financial security 101 –Conventional Protocol Attacks review

Why Financial Security? Concrete and simple security policy for APIs “Only the customer should know her PIN.” “Keys protecting PINs may only be manipulated when authorised by two different employees.” API manuals are often publicly available –IBM put 4758 CCA manual on its website –Diversity: many manufacturers have APIs performing same broad functionality – good for comparison ATM security was the “killer-app” that brought cryptography into the commercial mainstream – so long history of financial API development

Introduction to ATM Security The crucial secret is the customer PIN. The customer should be the only person that knows the value of this PIN PINs need to be protected from malicious insiders and outsiders PINs must be protected when generated, in storage, when issued to customers, when travelling via the international ATM network, and when being verified To this end, banks use Hardware Security Modules (HSMs) to perform cryptography and implement a policy which prevents both insiders and outsiders from gaining unauthorised access to PINS.

Security Modules in Banks Issuing Bank Regional HQ HSM ATM Acquiring Bank Issuing Bank ATM Network HSM HSM with keypad HSM

Start with your bank account number (PAN) Encrypt with PIN Derivation Key (aka PMK – Pin Master Key) 22BD 4677 F1FF 34AC Chop off the (B->1) End 2213(D->3) How are PINs Generated ? decimalise

What’s a Decimalisation Table ? Remember encrypted result was in hexadecimal? Encryption produces output that looks uniformly distributed, so 0-F are all equally likely Decimalisation Table used to map 0-F back to 0-9 digit in ABCDEF digit out e.g. 22BD -> 2213 Because some numbers have several hexadecimal digits mapped to them, they are more likely to occur in issued PINs than others

Example Distribution : HSBC (Sample size: 45 people)

Conventional Protocol Attacks The starting point for the study of API attacks The protocol world has attacks similar to each of those found on APIs Each example demonstrates a different aspect of protocol attack: –Needham Schroder Public Key attacker knows how to encrypt/decrypt –TMN Protocol attacker knows algebra of RSA –Bleichenbacher PKCS#1 Attack attacker knows protocol data structures & understands RSA crypto

Protocol Attacks Manipulation Attacks Mathematical Attacks Needham Schroeder Public Key TMN Attack Bleichenbacher Attack

Needham-Schroeder Public Key Protocol A -> B : { N A, A} KB B -> A : { N A, N B } KA A -> B : { N B } KB A -> B : { N A, A} KB B -> D : { N A, A} KD D -> B : { N A, N D } KA B -> A : { N A, N D } KA A -> B : { N D } KB B -> D : { N D } KD attackers abilities: Construct messages, Encrypt & decrypt

TMN Protocol A->S: R A 3 mod N B->S: R B 3 mod N S->A: R A xor R B C->S: R A 3 * X 3 mod N D->S: R D 3 mod N S->A: R A *X xor R D Explanation: Cubing modulo N represents RSA encryption under public key of server S Explanation: Server will not accept same random number twice, so C cannot simply replay R A 3

Bleichenbacher PKCS#1 Attack A->S: K e mod N S->A: {data} K C->S: K e * X e mod N S->A: {data} K*X or S->A: decryption error S->A: format error Explanation: Alice sends key K encrypted using RSA with PKCS#1 v1.5 padding Explanation: Server tries to decrypt message from Charlie, and leaks information as to whether the decrypted message satisfied PKCS#1 format requirement

API Attacks & Protocol Attacks API Attacks already found in each category –Manipulation (VSM Type System) –Mathematical (XOR to null key) –Cryptographic (MIM attack) (both manipulative and mathematical) Differences between API and Protocol Attacks: –API is a ‘dumb adversary’ –APIs are more complex – contain many protocols –APIs (usually) have only two principals, HSM and User

XOR to Null Key Attack Top-level crypto keys exchanged between banks in several parts carried by separate couriers, which are recombined using the exclusive-OR function A single operator could feed in the same part twice, which cancels out to produce an ‘all zeroes’ test key. PINs could be extracted in the clear using this key U->C : {KP1} KM, {KP2} KM C->U : {KP1 xor KP2} KM U->C : {KP1} KM, {KP1} KM C->U : {KP1 xor KP1} KM ( = {0} KM ) (Anderson 2000)

VSM Type System Attack Encrypting communication keys for transfer to an ATMs used exactly the same process as calculating a customer PIN Customer PINs could be generated by re-labelling an account number as a communications key, and using the same encryption process (Bond 2000)

The Visa Security Module

VSM Type Diagram

VSM Type System Attack

Type System Attack (Protocol Notation) U->C : C->U : { } TC U->C : { } TC, { PMK } TMK C->U : { } PMK { } PMK = 22BD 4677 F1FF 34AC So customer PIN is 22BD i.e. 2213

Car Park Analogy A thief walks into a car park and tries to steal a car... How many keys must he try?

Car Park Analogy 1900

Car Park Analogy 2000

The Meet in the Middle Attack Common sense statistics Attack multiple keys in parallel Need the same plaintext under each key Encrypt this plaintext to get a ‘test vector’ Typical case: A 2 56 search for one key becomes a 2 40 search for 2 16 keys Poor implementations of 3DES key storage allow 3DES key halves to be attacked individually

MIM Attack on DES Security Modules 40 bits16 bits Generate 2 16 keys Encrypt test vectors U->C : { KEY1 } KM C->U : { } KEY1 Do 2 40 search Cryptoprocessor’s EffortSearch Machine’s Effort 56 bit key space

Protocol Attacks Manipulation Attacks Differential Attacks Mathematical Attacks Needham Schroeder Public Key TMN Attack Bleichenbacher Attack Decimalisation Table Attack PAN Modification Attack

Decimalisation Table Attack Remember PINs derived from account numbers Hexadecimal raw PIN is converted to decimal using decimalisation table Most APIs allow the decimalisation table to be specified with each PIN verification command A normal verification command eliminates one of 10,000 combinations of PIN for the attacker. If the table is altered, whether or not the alteration affects correct verification leaks much more information about the PIN examples… (Bond/Clulow 2002)

Decimalisation Table Attack (1) PIN_Verify Yes/No (eliminates 1 combination) ABCDEF Trial PIN 0000 PAN Encrypted PMK 48CCA975F4B2C8A5 1. Encrypt PAN Raw PIN = 22BD 2. Decimalise Natural PIN = Verify 0000 != 2213

Decimalisation Table Attack (2) PIN_Verify Yes/No (eliminates all PINs containing digit 7) ABCDEF Trial PIN 0000 PAN Encrypted PMK 48CCA975F4B2C8A5 1. Encrypt PAN Raw PIN = 22BD 2. Decimalise Natural PIN = Verify 0000 = 0000

Decimalisation Table Attack (3) PIN_Verify Yes/No (shows PIN contains digit 2) ABCDEF Trial PIN 0000 PAN Encrypted PMK 48CCA975F4B2C8A5 1. Encrypt PAN Raw PIN = 22BD 2. Decimalise Natural PIN = Verify 0000 != 1100

Decimalisation Table Attack (4) PIN_Verify Yes/No (no information) ABCDEF Encrypted Trial PIN {2213} KM PAN Encrypted PMK 48CCA975F4B2C8A5 1. Encrypt PAN Raw PIN = 22BD 2. Decimalise Natural PIN = Verify 2213 = 2213

Decimalisation Table Attack (5) PIN_Verify Yes/No (eliminates PINs containing digit 7) ABCDEF Encrypted Trial PIN {2213} KM PAN Encrypted PMK 48CCA975F4B2C8A5 1. Encrypt PAN Raw PIN = 22BD 2. Decimalise Natural PIN = Verify 2213 = 2213

PAN Modification Attack (1) Encrypted PINs transferred from ATM to issuing bank via ATM network using point to point encryption At each node PIN block must be decrypted with incoming key, and re-encrypted with outgoing key Common ISO standard “binds” PIN to particular customer by exclusive-ORing PAN with PIN before encryption Attack: specifying incorrect PAN may make deduced PIN contain hexadecimal digit ‘A’-’F’, which causes formatting error. Conditions under which formatting error arises leaks information about PIN. (Clulow 2002)

PIN Block Formats FFFFFFFFFF xor = 0412A6FC9CBADDC6 Primary Account Number (PAN) IS0-0 IS0-2 padding PIN PIN length FFFFFFFFFF Format ID

PAN Modification Attack (2) PIN_Translate {PIN Block} AWK (or FORMAT ERROR) Format Info PAN{IWK} KM {AWK} KM {PIN Block} IWK

PAN Modification Attack (3) FFFFFFFFFF xor = 0412B6FC9CBADDC AB BA CD DC EF FE 889ABCDEF01 998BADCFE10 AAB89EFCD23 BBA98FEDC32 CCDEF89AB45 DDCFE98BA54 EEFCDAB8967 FFEDCBA9876 PIN PAN 0412B6FC9CBADDC6 xor = FFFFFFFFFF 0412B6FC9CBADDC6 xor = 0412C4FFFFFFFFFF construction of PIN block correct PAN removed modified PAN Removed – PIN contains ‘C’ – error

Differential Protocol Analysis Phrase coined by Anderson & Bond in “Protocol Analysis, Composability and Computation” in Feb 2003 Differential Protocol Analysis refers to attacks which use multiple runs of a protocol to gradually discover a secret key protected by the protocol Input differentials (pairs of inputs) are carefully chosen such that a difference in output will be observed dependent upon some secret key material Before this work, such attacks were rare – dumb adversaries were thought unlikely

Dectab Attack during PIN Generation PIN_Generate FD29DA DC ABCDEF PAN Encrypted PMK 48CCA975F4B2C8A5 1. Encrypt PAN Raw PIN = 22BD 2. Decimalise Natural PIN = Store as ISO PIN Block FFFFFFFFFF

“DPA” - Decimalisation Table PANDectabPMKOutput E92F67BFEADF91D9 FD29DA DC E92F67BFEADF91D9 FD29DA DC 08F8E3983E3BDF E92F67BFEADF91D9 FD29DA DC 3BDF08F8E3E E92F67BFEADF91D9 FD29DA DC 726F0FD293E26F E92F67BFEADF91D9 FD29DA DC E92F67BFEADF91D9 FD29DA DC E92F67BFEADF91D9 FD29DA DC E92F67BFEADF91D9 FD29DA DC

“DPA” – PAN Modification PANIWKAWKOutput D7604EBA10AC7F3 E92F67BFEADF91D9 FD29DA DC D7604EBA10AC7F3 E92F67BFEADF91D9 FD29DA DC 08F8E3983E3BDF D7604EBA10AC7F3 E92F67BFEADF91D9 FD29DA DC 3BDF08F8E3E D7604EBA10AC7F3 E92F67BFEADF91D9 FD29DA DC D7604EBA10AC7F3 E92F67BFEADF91D9 FD29DA DC D7604EBA10AC7F3 E92F67BFEADF91D9 FD29DA DC 726F0FD293E26F D7604EBA10AC7F3 E92F67BFEADF91D9 FD29DA DC A D7604EBA10AC7F3 E92F67BFEADF91D9 FD29DA DC

Protecting against API Attacks: Formal Methods and Evaluation? New protocol attacks show formal methods now cover just one of many aspects of protocol attacks Automated information-theoretic reasoning about protocols and APIs could be an interesting new direction for research and evaluation tools, but is years away API attacks are already having an effect on the real world – especially in financial security, yet evaluation standards e.g. FIPS 140 series are not keeping up API attacks have defeated many different modules certified FIPS Level 4 – why? Because the evaluation does not cover the whole system, just a few components. Be careful when buying entire systems to establish what has been evaluated, and what has not.

Conclusions Protocol Analysis is far from dead API security complements and extends the study of security protocols “Differential Protocol Analysis” attacks were previously novelties, but may become important against ‘dumb adversaries’ as Security APIs become more common API analysis used to only be relevant to a few specialist applications such as banking security and certification authorities; TCPA and Palladium APIs when deployed will bring targets into everybody’s homes Formal methods tools have a long way to go to provide assurance for using systems Independent evaluation can protect against these attacks, but it must cover the whole system.

More Info Academic Papers “Decimalisation Table Attacks for PIN Cracking” Bond, Zielinski, Mar 2003 “API-Level Attacks on Embedded Systems” Bond, Anderson, Oct 2001 “The Design and Analysis of Cryptographic APIs for Security Devices ” Clulow, Jan 2003 My Webpage