CMSC 414 Computer and Network Security Lecture 9 Jonathan Katz.

Slides:



Advertisements
Similar presentations
CMSC 414 Computer (and Network) Security Lecture 22 Jonathan Katz.
Advertisements

Securing Critical Unattended Systems with Identity Based Cryptography A Case Study Johannes Blömer, Peter Günther University of Paderborn Volker Krummel.
Sri Lanka Institute of Information Technology
Digital Signatures Good properties of hand-written signatures: 1. Signature is authentic. 2. Signature is unforgeable. 3. Signature is not reusable (it.
1 Introduction CSE 5351: Introduction to cryptography Reading assignment: Chapter 1 of Katz & Lindell.
Information Security Principles & Applications Topic 4: Message Authentication 虞慧群
CS426Fall 2010/Lecture 81 Computer Security CS 426 Lecture 8 User Authentication.
CMSC 414 Computer and Network Security Lecture 10 Jonathan Katz.
Feb 18, 2003Mårten Trolin1 Previous lecture Block ciphers Modes of operations First assignment Hash functions.
CMSC 414 Computer and Network Security Lecture 4 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
CMSC 414 Computer (and Network) Security Lecture 9 Jonathan Katz.
CMSC 414 Computer (and Network) Security Lecture 15 Jonathan Katz.
CNS2010handout 10 :: digital signatures1 computer and network security matt barrie.
CMSC 414 Computer (and Network) Security Lecture 2 Jonathan Katz.
CMSC 456 Introduction to Cryptography
CMSC 414 Computer and Network Security Lecture 7 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 15 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 21 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 5 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 9 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 2 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 16 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 22 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 19 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 8 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 18 Jonathan Katz.
How cryptography is used to secure web services Josh Benaloh Cryptographer Microsoft Research.
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 23 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 17 Jonathan Katz.
CMSC 414 Computer (and Network) Security Lecture 24 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 7 Jonathan Katz.
Fall 2010/Lecture 311 CS 426 (Fall 2010) Public Key Encryption and Digital Signatures.
CMSC 414 Computer and Network Security Lecture 2 Jonathan Katz.
CSE 597E Fall 2001 PennState University1 Digital Signature Schemes Presented By: Munaiza Matin.
CMSC 414 Computer and Network Security Lecture 11 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 13 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 3 Jonathan Katz.
Lecture 8 Digital Signatures. This lecture considers techniques designed to provide the digital counterpart to a handwritten signature. A digital signature.
Digital Signatures Slides by Kent Seamons and Tim van der Horst Last Updated: Oct 7, 2013.
Lecture slides prepared for “Computer Security: Principles and Practice”, 2/e, by William Stallings and Lawrie Brown, Chapter 21 “Public-Key Cryptography.
Digital Signatures Good properties of hand-written signatures: 1. Signature is authentic. 2. Signature is unforgeable. 3. Signature is not reusable (it.
Lecture 3.2: Public Key Cryptography II CS 436/636/736 Spring 2014 Nitesh Saxena.
Cryptography Lecture 8 Stefan Dziembowski
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
Message Authentication  message authentication is concerned with: protecting the integrity of a message protecting the integrity of a message validating.
CMSC 414 Computer and Network Security Lecture 2 Jonathan Katz.
How cryptography is used to secure web services Josh Benaloh Cryptographer Microsoft Research.
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
Lecture 3.4: Public Key Cryptography IV CS 436/636/736 Spring 2013 Nitesh Saxena.
EE515/IS523 Think Like an Adversary Lecture 4 Crypto in a Nutshell Yongdae Kim.
Cryptography Lecture 9 Stefan Dziembowski
Chapter 21 Public-Key Cryptography and Message Authentication.
CMSC 414 Computer and Network Security Lecture 5 Jonathan Katz.
Middleware for Secure Environments Presented by Kemal Altıntaş Hümeyra Topcu-Altıntaş Osman Şen.
A Quick Tour of Cryptographic Primitives Anupam Datta CMU Fall A: Foundations of Security and Privacy.
Lecture 2: Introduction to Cryptography
Cryptography and Network Security Chapter 12 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Cryptography 1 Crypto Cryptography 2 Crypto  Cryptology  The art and science of making and breaking “secret codes”  Cryptography  making “secret.
Computer Science and Engineering Computer System Security CSE 5339/7339 Lecture 11 September 23, 2004.
Dos and Don’ts of Client Authentication on the Web Kevin Fu, Emil Sit, Kendra Smith, Nick Feamster Presented: Jesus F. Morales.
IT 221: Introduction to Information Security Principles Lecture 5: Message Authentications, Hash Functions and Hash/Mac Algorithms For Educational Purposes.
CMSC 414 Computer and Network Security Lecture 2 Jonathan Katz.
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.
Fourth Edition by William Stallings Lecture slides by Lawrie Brown
Cryptographic Hash Function
Asymmetric Cryptography
Chapter -7 CRYPTOGRAPHIC HASH FUNCTIONS
Presentation transcript:

CMSC 414 Computer and Network Security Lecture 9 Jonathan Katz

HW2  Read “Why Cryptosystems Fail”

Hashed RSA  Public key (N, e); private key (N, d)  To sign message m, compute  = H(m) d mod N  To verify signature  on a message m, check whether  e = H(m) mod N  Why does this prevent the previous attacks?  Note: has the added advantage of handling long messages “for free”

Security of hashed RSA  Hashed RSA signatures can be proven secure based on the hardness of the RSA problem, if the hash is modeled as a random function –Proof in CMSC456  Variants of hashed RSA have been standardized, and are used in practice

DSA/DSS signatures  Another popular signature scheme, based on the hardness of the discrete logarithm problem –Introduced by NIST in 1992 –US government standard  I will not cover the details, but you should know that it exists

Hash-and-sign  Say we have a secure signature scheme for “short” messages (e.g., hashed RSA, DSS, …) –How to extend it for longer messages?  Hash and sign –Hash message to short “digest”; sign the digest  Used extensively in practice HSign M H(M) sk 

Crypto review, recommendations  Secrecy vs. integrity  Different definitions of secrecy  Private-key setting –CPA-secure encryption: CBC mode, CTR mode –Secure MAC: CBC-MAC, HMAC –Authenticated encryption: e.g., CPA-secure encryption + MAC over the ciphertext  Public-key setting –CPA-secure encryption: El Gamal, Padded RSA –Non-malleable encryption: RSA-OAEP –Signatures: Hashed RSA, DSS

Crypto pitfalls and recommendations

Crypto pitfalls?  Crypto deceptively simple –Why does it so often fail?  Important to distinguish various issues: 1.Bad cryptography, bad implementations, bad design, etc. 2.Even good cryptography can often be ‘circumvented’ by adversaries operating ‘outside the model’ 3.Even the best cryptography only shifts the weakest point of failure to elsewhere in your system 4.Systems are complex  Avoid the first; be aware of 2-4

Systems are complex  Crypto alone cannot solve all security problems –Key management; social engineering; insider attacks –Need to develop an appropriate threat model for the system as a whole  Defense in depth –Need for review, detection, and recovery –Security as a process, not a product

Cryptography is not a “magic bullet”  Crypto is difficult to get right –Must be implemented correctly –Must be integrated from the beginning, not added on “after the fact” –Need expertise; “a little knowledge can be a dangerous thing…” –Can’t be secured by Q/A, only (at best) through penetration testing and dedicated review of the code by security experts

General recommendations  Use only standardized algorithms and protocols –No security through obscurity!  Use primitives for their intended purpose  Don’t implement your own crypto –If your system cannot use “off-the-shelf” crypto components, re- think your system –If you really need something new, have it designed and/or evaluated by an expert  Don’t use the same key for multiple purposes –E.g., encryption/MAC, or RSA encryption/signatures  Use good random-number generation

Crypto libraries  Use existing, high-level crypto libraries –cryptlib –NaCl –Keyczar –These provide an appropriate interface to crypto algorithms  Avoid low-level libraries (like JCE) – too much possibility of mis-use  Avoid writing your own low-level crypto

Random-number generation  Do not use “standard” PRNGs; use cryptographic PRNGs instead  E.g., srand/rand in C: –srand(seed) sets state=seed (where |seed| = 32 bits) –rand(): state = f(state), where f is some linear function return state –Generating a 128-bit key using 4 calls to rand() results in a key with only 32 bits of entropy!  Related issues led to exploit in Netscape v1.1

More on PRNGs  Crypto PRNGs have different requirements –Indistinguishable from random by any efficient algorithm –Constantly re-seeded with new entropy to ensure forward security –Should be impossible to guess or perturb internal state E.g., if entropy comes from file timestamps  “Cold boot” issues –Server just rebooted and needs randomness….is there enough entropy after being up just a few seconds?

Implementation flaws  (These are crypto-specific; and do not include general issues such as preventing buffer overflows, etc. that we will cover later)  Must implement crypto exactly as specified!  if (0 == strncmp(userHash, myHash, 20)) allow; –strncmp compares up to the first null character –What if my userHash starts with a 0 byte??

Implementation flaws  Must implement crypto exactly as specified!  PKCS#1 pads data as follows: FF … FF 00 H(m)  Bad implementation of signature verification? –Exponentiate, strip off padding, and compare to H(m)  Makes forgery easier!  Every bit of padding must be checked

Delimiting tokens  E.g., Amazon Web Services v1 –Split query at & and = ; concatenate and apply MAC –The following are then equivalent: …?GoodKey1=GoodValue1BadKey2BadValue2 …?GoodKey1=GoodValue1&BadKey2=BadValue2  Wordpress cookie flaw –token: HMAC(username.expirytime) –Create account for username=‘admin0’ and go…  Using timestamps to prevent replay –Is MAC(withdraw $101,1/23/09) = MAC(withdraw $10,11/23/09)?

Case studies

“Why Cryptosystems Fail”  Limited disclosure of crypto failures…  Insider attacks –By bank clerks, maintenance engineers, … –Poor prevention/detection/auditing mechanisms –Poor key management –Insecure delivery of ATM cards/PINs  Reduced entropy of PINs  Use of “home-brewed” encryption schemes

System goals and assumptions  A user should need both their ATM card and their PIN in order to withdraw money –“Two-factor authentication”  Assumptions: –PIN must be short –ATM card cannot perform cryptographic operations

Threat model  Attacker can –Read discarded receipts… –Eavesdrop on channel from ATM to bank –Inject messages on channel from ATM to bank –Impersonate the ATM to a user

Desired security  If an attacker does not have a user’s ATM card, should be infeasible to withdraw money from that user’s account (even if the PIN is known)  If an attacker has a user’s ATM card, but not their PIN, the best it can do is guess the PIN repeatedly –1/10000 chance each time –Prevent unlimited guessing

One system ATM Account # PIN Bank #, PIN If F K (#) = PIN: return “ok” ok This is similar, but not identical, to how ATMs work today

Attacks  Eavesdrop on PIN and account # ; manufacture rogue ATM card  Replay “ok” message! –Solution: use authentication with replay protection  Impersonate an ATM to a customer –Can this be prevented without implementing crypto on the ATM card? (How could the bank authenticate directly to the user?)

Another system ATM Account # c=Enc K (PIN) PIN Bank #, c, PIN If D K (c) = PIN: debit account #, return “ok” ok No binding between account # and PIN!

Another system ATM Account # PIN Bank # If F K (#) = PIN: “authenticated” balance withdraw amt If amt ≤ balance, dispense cash Do you see an attack? encrypted