Enterprise Security API (ESAPI) 2.0 Crypto Changes

Slides:



Advertisements
Similar presentations
Kerberos 1 Public domain image of Heracles and Cerberus. From an Attic bilingual amphora, 530–520 BC. From Italy (?).
Advertisements

MAC Raushan. DES simple fiestel network 3131 PlainText Blocks 2*4=8bits 31 f f =0011 xor 0011=0000 = 0 f(r,k)=(2*r+k^2)%8 f(1,5)=(2*1+5^2)%8=3 xor 3 3.
“Advanced Encryption Standard” & “Modes of Operation”
CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (3) Information Security.
Side Channel Attacks on CBC Encrypted Messages in the PKCS#7 Format
SSL CS772 Fall Secure Socket layer Design Goals: SSLv2) SSL should work well with the main web protocols such as HTTP. Confidentiality is the top.
WEP 1 WEP WEP 2 WEP  WEP == Wired Equivalent Privacy  The stated goal of WEP is to make wireless LAN as secure as a wired LAN  According to Tanenbaum:
Implementation of a Two-way Authentication Protocol Using Shared Key with Hash CS265 Sec. 2 David Wang.
Cryptography and Authentication Lab ECE4112 Group4 Joel Davis Scott Allen Quinn.
Andy’s Basic Crypto Course (ABC) Part 1 - Introduction.
Cryptography1 CPSC 3730 Cryptography Chapter 6 Triple DES, Block Cipher Modes of Operation.
Lesson Title: Introduction to Cryptography Dale R. Thompson Computer Science and Computer Engineering Dept. University of Arkansas
Chapter 5 Cryptography Protecting principals communication in systems.
BY MUKTADIUR RAHMAN MAY 06, 2010 INTERODUCTION TO CRYPTOGRAPHY.
Wired Equivalent Privacy (WEP)
Modes of Operation CS 795. Electronic Code Book (ECB) Each block of the message is encrypted with the same secret key Problems: If two identical blocks.
Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m.
How cryptography is used to secure web services Josh Benaloh Cryptographer Microsoft Research.
Computer Networking Lecture 21: Security and Cryptography Thanks to various folks from , semester’s past and others.
Dr Alejandra Flores-Mosri Security Internet Management & Security 06 Learning outcomes At the end of this session, you should be able to: –Describe the.
Lecture 23 Symmetric Encryption
Encryption Methods By: Michael A. Scott
Chapter 8.  Cryptography is the science of keeping information secure in terms of confidentiality and integrity.  Cryptography is also referred to as.
CS255 Programming Project 1. Programming Project 1 Due: Friday Feb 8 th (11:59pm)‏ – Can use extension days Can work in pairs – One solution per pair.
Lecture 3: Cryptographic Tools modified from slides of Lawrie Brown.
CRYPTOGRAPHY PROGRAMMING ON ANDROID Jinsheng Xu Associate Professor North Carolina A&T State University.
Modes of Operation. Topics  Overview of Modes of Operation  EBC, CBC, CFB, OFB, CTR  Notes and Remarks on each modes.
Cryptography and Network Security Chapter 6. Multiple Encryption & DES  clear a replacement for DES was needed theoretical attacks that can break it.
How cryptography is used to secure web services Josh Benaloh Cryptographer Microsoft Research.
Information Security Lab. Dept. of Computer Engineering 182/203 PART I Symmetric Ciphers CHAPTER 7 Confidentiality Using Symmetric Encryption 7.1 Placement.
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
The Misuse of RC4 in Microsoft Office A paper by: Hongjun Wu Institute for Infocomm Research, Singapore ECE 578 Matthew Fleming.
Module 3 – Cryptography Cryptography basics Ciphers Symmetric Key Algorithms Public Key Algorithms Message Digests Digital Signatures.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Class 5 Channels and Preview CIS 755: Advanced Computer Security Spring 2014 Eugene Vasserman
SEC835 Runtime authentication Secure session management Secure use of cryptomaterials.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Chapter 9: Algorithms Types and Modes Dulal C. Kar Based on Schneier.
Lecture 4 Page 1 CS 236 Stream and Block Ciphers Stream ciphers convert one symbol of plaintext immediately into one symbol of ciphertext Block ciphers.
1.1 Chapter 8 Encipherment Using Modern Symmetric-Key Ciphers Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Dr. Reuven Aviv, Nov 2008 Conventional Encryption 1 Conventional Encryption & Message Confidentiality Acknowledgements for slides Henric Johnson Blekinge.
Modes of Usage Dan Fleck CS 469: Security Engineering These slides are modified with permission from Bill Young (Univ of Texas) 11 Coming up: Modes of.
Modes of Operation INSTRUCTOR: DANIA ALOMAR. Modes of Operation A block cipher can be used in various methods for data encryption and decryption; these.
The OWASP Foundation Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
IP Security.  In CERTs 2001 annual report it listed 52,000 security incidents  the most serious involving:  IP spoofing intruders creating packets.
1 AERO Algorithm Overview October 2013 San Antonio, Texas USA Howard Weiss NASA/JPL/PARSONS* Identity crisis: Formerly SPARTA Formerly Cobham Formerly.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Lecture 2: Introduction to Cryptography
Lecture 23 Symmetric Encryption
Privacy and Integrity: “ Two Essences of Network Security” Presenter Prosanta Gope Advisor Tzonelih Hwang Quantum Information and Network Security Lab,
MT311 Java Application Development and Programming Languages Li Tak Sing ( 李德成 )
Cryptography and Network Security (CS435) Part Thirteen (IP Security)
Lecture 4 Page 1 CS 236 Stream and Block Ciphers Stream ciphers convert one symbol of plaintext immediately into one symbol of ciphertext Block ciphers.
CSCI 530 Lab Passwords. Overview Authentication Passwords Hashing Breaking Passwords Dictionary Hybrid Brute-Force Rainbow Tables Detection.
 Encryption provides confidentiality  Information is unreadable to anyone without knowledge of the key  Hashing provides integrity  Verify the integrity.
Cryptography Hyunsung Kim, PhD University of Malawi, Chancellor College Kyungil University February, 2016.
@Yuan Xue Case Study (Mid-term question) Bob sells BatLab Software License Alice buys BatLab Credit card information Number of.
@Yuan Xue 285: Network Security CS 285 Network Security Message Authentication Code Data integrity + Source authentication.
Symmetric-Key Cryptography CS 161: Computer Security Prof. Raluca Ada Popa Sept 13, 2016.
Outline Desirable characteristics of ciphers Stream and block ciphers
Block Cipher Modes CS 465 Make a chart for the mode comparisons
Cryptography Lecture 10.
Block vs Stream Ciphers
Padding Oracle Attacks
Cryptography Lecture 9.
Counter Mode, Output Feedback Mode
Review of Cryptography: Symmetric and Asymmetric Crypto Advanced Network Security Peter Reiher August, 2014.
Secret-Key Encryption
Presentation transcript:

Enterprise Security API (ESAPI) 2.0 Crypto Changes Kevin W. Wall ESAPI Project co-owner kevin.w.wall@gmail.com September 21, 2011 1 1

Obligatory CV 20+ years developer experience, 12 yrs security experience 17 yrs at (now Alcatel-Lucent) Bell Labs; left as DMTS 3.5 yrs as independent contractor (C++ & Java) 12 years application & information security experience Currently: Staff Security Engineer at CenturyLink (formerly Qwest) OWASP ESAPI for Java Project co-owner Cryptography developer (since 2.0rc2) OWASP ESAPI for C++ Meddlesome troublemaker Blog: http://off-the-wall-security.blogspot.com/ 2 2

Why the ESAPI 2.0 Crypto Changes? ESAPI 1.4 implementation Default algorithm was PBEWithMD5AndDES PBE → Keys vulnerable to dictionary attacks Weak algorithms (DES and MD5) Uses CBC cipher mode and PKCS5 padding Restricted to single encryption key Default setting for MasterSecret & MasterSalt No message authenticity for ciphertext 3 3

Why the ESAPI 2.0 Crypto Changes? ESAPI 2.0rc1 / 2.0rc2 implementations Default algorithm was 256-bit AES Better, but... Uses ECB mode and no way to use another mode Still restricted to single encryption key Still default setting for MasterSecret & MasterSalt Still no message authenticity 4 4

Tux Encrypted w/ ECB Mode Encrypted w/ other than ECB What's Wrong with ECB Mode? Original Tux Image Tux Encrypted w/ ECB Mode Encrypted w/ other than ECB 5 5

Why Do We Need Message Authenticity? Ensures IV + ciphertext is authentic (not tampered with) So what? Umm... Padding Oracle Attack 6 6

Aside: Padding Oracle Attack What is it? First described in 2002 in context of IPSec by Serge Vaudenay Attack on CBC mode of operation where “oracle” leaks info whether or not padding of ciphertext is correct. Oracle typically is either different error messages being returned or timing side-channel attack. So what's the harm? Allows adversary to decrypt (and encrypt) data without knowledge of the secret key. Is efficient: Works without a large “work factor” Reference: Brian Holyfield’s NYC OWASP presentation: http://blog.gdssecurity.com/storage/presentations/Padding_ Oracle_OWASP_NYC.pdf 7 7

Major Changes in ESAPI 2.0 Crypto Deprecated, then removed, unsafe methods Added support for CipherText objects Added support for PlainText objects Added support for multiple secret keys Added support for message authenticity Added support for multiple cipher modes (but using multiple ones w/in app still a kludge [potential race condition]) Changed to use strong default accessible to all Allows AES/CBC/PKCS5Padding with 128-bit key and random IV Authenticity generally provided by HMAC-SHA1 8 8

Advanced Crypto Example So, for any of you using Google+, does this look familiar? https://plus.google.com/_/notifications/ngemlink?path=%2F%3F gpinv%3DgU47oPXLOt8%3Apox7sn5mwqF It's an invitation to join Google+ that you email to your friends. Presumably, this is a cryptographic token (although it could just be an object reference into some database). Question: What if you wanted to implement something similar, but say for a coupon service that you could email to one of your friends for some specific merchandise and you didn't want to have to store it in a database? You could do it with an appropriate cryptographic token. 9 9

How much code would that take you? Advanced Crypto Example (cont'd) What information would you need in this cryptographic token? How about: 1) The currently authenticated user's user account name 2) The target user account name of your friend 3) A merchandise ID 4) The coupon value 5) The coupon expiration date Of course, you want it to be secure in the following sense: a) protection of all identities involved (confidentiality) b) unforgeable c) secure from tampering d) immune to replay attacks How much code would that take you? 10 10

Advanced Crypto Example (cont'd) With ESAPI, it's something like this: // Creating the token… CryptoToken ctok = new CryptoToken(); ctok.setUserAccountName( ESAPI.authenticator().getCurrentUser() ); ctok.setAttribute("targetUserAcct", targetUserName); ctok.setAttribute("merchandiseID", merchandiseId); ctok.setAttribute("couponPrice", price); byte[] nonce = ESAPI.randomizer().randomBytes(16); ctok.setAttribute("nonce", Hex.toHex(nonce, false) ); // Store nonce somewhere to prevent replays. ctok.setExpiration( 30 * 24 * 60 *60 ); // 30 days (in secs) return ctok.getToken(); // Return encrypted token This example uses the default crypto key, Encryptor.MasterKey, in your ESAPI.properties file, but trivial to use an alternate SecretKey. 11 11

Advanced Crypto Example (cont'd) // Consuming the token… CryptoToken ctok = new CryptoToken(tokenString); Date expDate = ctok.getExpirationDate(); // Check if expDate > current date and do something ... String hexNonce = ctok.getAttribute("nonce"); // Check if nonce replayed; error if yes. Rm from table... String targetUserName = ctok.getAttribute("targetUserAcct"); String MerchandiseId = ctok.getAttribute("merchandiseID"); String price = ctok.getAttribute("couponPrice"); // Logic to remove available coupons from originating user String userAcctName = ctok.getUserAccountName(); ... All very straightforward. All the crypto is under the hood. There are methods to get user account name, arbitrary attributes (by name), and the expiration time. 12 12

Ask now, or email me at: <kevin.w.wall@gmail.com> Q&A Ask now, or email me at: <kevin.w.wall@gmail.com> 13 13