Securing Password Storage Increasing Resistance to Brute Force Attacks



Similar documents
What users should know about Full Disk Encryption based on LUKS

Dashlane Security Whitepaper

Cryptography and Network Security

How encryption works to provide confidentiality. How hashing works to provide integrity. How digital signatures work to provide authenticity and

SENSE Security overview 2014

PLATFORM ENCRYPTlON ARCHlTECTURE. How to protect sensitive data without locking up business functionality.

Message Authentication

The State of Modern Password Cracking

Cryptographic Hash Functions Message Authentication Digital Signatures

JVA-122. Secure Java Web Development

Overview of Cryptographic Tools for Data Security. Murat Kantarcioglu

SecureDoc Disk Encryption Cryptographic Engine

Message Authentication Codes

Common Pitfalls in Cryptography for Software Developers. OWASP AppSec Israel July The OWASP Foundation

Project: Simulated Encrypted File System (SEFS)

Ensuring the security of your mobile business intelligence

How To Encrypt Data With Encryption

ipad in Business Security

Speeding up GPU-based password cracking

Chapter 11 Security+ Guide to Network Security Fundamentals, Third Edition Basic Cryptography

Python Cryptography & Security. José Manuel

Client Server Registration Protocol

Hash Functions. Integrity checks

FIPS Non Proprietary Security Policy: Kingston Technology DataTraveler DT4000 Series USB Flash Drive

Computer Networks. Network Security and Ethics. Week 14. College of Information Science and Engineering Ritsumeikan University

Public Key Cryptography Overview

Our Key Security Features Are:

Hash Function JH and the NIST SHA3 Hash Competition

Enterprise Application Security Workshop Series

Authentication requirement Authentication function MAC Hash function Security of

Sichere Software- Entwicklung für Java Entwickler

Computer Security: Principles and Practice

FileCloud Security FAQ

Security Protocols/Standards

Analyzing the Security Schemes of Various Cloud Storage Services

MatriXay WEB Application Vulnerability Scanner V Overview. (DAS- WEBScan ) The best WEB application assessment tool

Passwords the server side

WHITE PAPER AUGUST Preventing Security Breaches by Eliminating the Need to Transmit and Store Passwords

Password Manager with 3-Step Authentication System

Deploying iphone and ipad Security Overview

HASH CODE BASED SECURITY IN CLOUD COMPUTING

Cryptography and Network Security Chapter 11

Password Cracking in the Cloud

WHITE PAPER. FortiWeb and the OWASP Top 10 Mitigating the most dangerous application security threats

Internet Banking Two-Factor Authentication using Smartphones

Authenticating Humans

Security. Contents. S Wireless Personal, Local, Metropolitan, and Wide Area Networks 1

FIPS Non-Proprietary Security Policy. IBM Internet Security Systems SiteProtector Cryptographic Module (Version 1.0)

Secure Password Managers and Military-Grade Encryption on Smartphones: Oh, Really?

ERserver. iseries. Securing applications with SSL

Message Authentication Codes. Lecture Outline

Kenna Platform Security. A technical overview of the comprehensive security measures Kenna uses to protect your data

Complying with PCI Data Security

Cryptography Lecture 8. Digital signatures, hash functions

Authenticate and authorize API with Apigility. by Enrico Zimuel Software Engineer Apigility and ZF2 Team

What is Web Security? Motivation

Pulse Secure, LLC. January 9, 2015

CSC Network Security. User Authentication Basics. Authentication and Identity. What is identity? Authentication: verify a user s identity

CS 348: Computer Networks. - Security; 30 th - 31 st Oct Instructor: Sridhar Iyer IIT Bombay

Secure Password Managers and Military-Grade Encryption on Smartphones: Oh, Really? Andrey Belenko and Dmitry Sklyarov Elcomsoft Co. Ltd.

High Security Online Backup. A Cyphertite White Paper February, Cloud-Based Backup Storage Threat Models

Key & Data Storage on Mobile Devices

CrashPlan Security SECURITY CONTEXT TECHNOLOGY

Symmetric and Public-key Crypto Due April , 11:59PM

90% of data breaches are caused by software vulnerabilities.

AN IMPLEMENTATION OF HYBRID ENCRYPTION-DECRYPTION (RSA WITH AES AND SHA256) FOR USE IN DATA EXCHANGE BETWEEN CLIENT APPLICATIONS AND WEB SERVICES

Enhancing Organizational Security Through the Use of Virtual Smart Cards

Using Foundstone CookieDigger to Analyze Web Session Management

Network Security. Security. Security Services. Crytographic algorithms. privacy authenticity Message integrity. Public key (RSA) Message digest (MD5)

Optimizing computation of Hash-Algorithms as an attacker. Version

Final Exam. IT 4823 Information Security Administration. Rescheduling Final Exams. Kerberos. Idea. Ticket

Network Security. Modes of Operation. Steven M. Bellovin February 3,

Network Security. Gaurav Naik Gus Anderson. College of Engineering. Drexel University, Philadelphia, PA. Drexel University. College of Engineering

VoIP Security. Seminar: Cryptography and Security Michael Muncan

Promoting Application Security within Federal Government. AppSec DC November 13, The OWASP Foundation

FIPS Security Policy LogRhythm Log Manager

Secure Remote Password (SRP) Authentication

Cloud Security:Threats & Mitgations

Network Security Part II: Standards

Thick Client Application Security

DRAFT Standard Statement Encryption

Network Security (2) CPSC 441 Department of Computer Science University of Calgary

WebSphere DataPower Release FIPS and NIST SP a support.

Security Policy. Security Policy.

Transport Level Security

Chapter 7 Transport-Level Security

Security Technical. Overview. BlackBerry Enterprise Service 10. BlackBerry Device Service Solution Version: 10.2

SSL Protect your users, start with yourself

Application Security. Petr Křemen.

Content Teaching Academy at James Madison University

Cryptography and Network Security Chapter 12

True Key by Intel Security

SECURITY IN SMARTPHONES AND TABLETS

(C) Global Journal of Engineering Science and Research Management

Transcription:

Securing Password Storage Increasing Resistance to Brute Force Attacks -john (Steven) Internal CTO @m1splacedsoul v0.4 Chandu Ketkar Technical Manager @cketkar Scott Matsumoto Principal Consultant @smatsumoto ***Comments from presentation discussion in boxes like this throughout***

History /etc/password etc/password root:0:0:ec90xwptkco hjackman:100:100:kmezyulaqq2 bgoldthwa:101:101:po2gweiepz2 jsteven:102:500:ec90xwptkco Circa 1973 one-way password encryption chmod a+r /etc/passwd DES took 1 sec per password msoul:103:500:ntb4s.iqhwk nminaj:104:500:a2n/98vtt2c 2

bringing us to 2012 00000fac2ec84586f9f5221a05c0e9acc3d2e670 0000022c7caab3ac515777b611af73afc3d2ee50 deb46f052152cfed79e3b96f51e52b82c3d2ee8e 00000dc7cc04ea056cc8162a4cbd65aec3d2f0eb 00000a2c4f4b579fc778e4910518a48ec3d2f111 What do you see here? How do we know what it is? How could we figure this out? b3344eaec4585720ca23b338e58449e4c3d2f628 674db9e37ace89b77401fa2bfe456144c3d2f708 37b5b1edf4f84a85d79d04d75fd8f8a1c3d2fbde 00000e56fae33ab04c81e727bf24bedbc3d2fc5a 0000058918701830b2cca174758f7af4c3d30432 000002e09ee4e5a8fcdae7e3082c9d8ec3d304a5 d178cbe8d2a38a1575d3feed73d3f033c3d304d8 00000273b52ee943ab763d2bb3d83f5dc3d30904 In the news LinkedIn IEEE Yahoo SHA1('password )= 1e4c9b93f3f0682250b6cf8331b7ee68fd8 3

Golden Rules #1 Don t be on the front page of InfoWeek #2 Have a great story when you re on the front page of InfoWeek Your passwords WILL be extracted from your system

The Threat Model TM => Requirements = Threats your going to address

Threat Actors Threat Actor [T1] External Hacker Attack Vector AV0 - Observe client operations AV1 - Inject DB, bulk credentials lift AV2 - Brute force PW w/ AuthN API AV3 - AppSec attack (XSS, CSRF) AV4 - Register 2 users, compare [T2] MiM AV1 - Interposition, Proxy AV2 - Interposition, Proxy, SSL AV3 - Timing attacks [T3] Internal/Admin AV1 - Bulk credential export AV2 - [T1] style attack AV3 - Direct action w/ DB

Stored Passwords Requirements Threat Actor [T1] External Hacker Attack Vector AV0 - Observe client operations AV1 - Inject DB, bulk credentials lift AV2 - Brute force PW w/ AuthN API AV3 - AppSec attack (XSS, CSRF) AV4 - Register 2 users, compare [T2] MiM AV1 - Interposition, Proxy [T3] Internal/Admin AV2 - Interposition, Proxy, SSL AV3 - Timing attacks AV1 - Bulk credential export AV2 - [T1] style attack AV3 - Direct action w/ DB Attack Vectors should be broken out by 1) acquisition of PW DB and 2) reversing the DB.

The Threat s Tool box Reverse it... 1. Dictionary attack 2. Brute-force attack 3. Rainbow Table attack 4. Length-extension attack 5. Padding Oracle attack 6. Chosen plaintext attack 7. Crypt-analytic attack 8. Side-channel attack Thwarting these attacks is the focus of this presentation

Plaintext Encrypted Hashed (using SHA) Salt and Hash Adaptive Hashes PBKDF bcrypt scrypt Current Industry Practices

Hash Properties Uniqueness Determinism Collision resistance Non-reversibility Non-predictability Diffusion Lightning fast

SHA-1 SHA-2 Use a Better Hash? SHA-224/256 SHA-384/SHA-512 SHA-3 What property of hashes do these effect?

Can We Successfully Attack a Hash? Depends on the threat-actor... Script-kiddie Some guy Well-equipped Attacker Nation-state Is the algorithm supported by your script-kiddie tool?

Search Space Table Sizes Lookup Table (Brute Force) Rainbow Table (NTLM hashes) 307,000 word dic@onary 16 MB 461 MB (a- z A- Z 0-9) 4 338 MB 8.0 GB (a- z A- Z 0-9) 5 21 GB 8.0 GB (a- z A- Z 0-9) 6 1.3 TB 8.0 GB (a- z A- Z 0-9) 7 87 TB 8.0 GB (a- z A- Z 0-9) 8 5,560 TB 134.6GB (a- z A- Z 0-9) 9 357,000 TB No table (a- z A- Z 0-9) 10 22,900,149 TB No table

Rainbow Tables: Fast but Inherent Limitations Passwords with lengths and complexity in the white area aren t cracked by the Rainbow Table Source: ophcrack Tables are crafted for specific complexity and length

What Does the Salt Do? salt% %digest%=%hash(salt% %plaintext); De-duplicates digest texts Adds entropy to input space* increases brute force time requires a unique table per user

Can salted hashes be Attacked? Depends on the threat-actor... Script-kiddie Some guy Well-equipped Attacker Nation-state Attacking a table of salted hashes means building a Rainbow Table per user We need a Wellequipped Attacker to build one table per users right?

Per User Table Building Brute Force Time for SHA-1 hashed, mixed-case-a alphanumeric password AQacking a single hash (32 M/sec) NVS 4200M GPU (Dell Laptop) 8 Characters 9 Characters 80 days 13 years AQacking a single hash (85 M/sec) $169 Nvidia GTS 250 30 days 5 years AQacking a single hash (2.3 B/sec) $325 ATI Radeon HD 5970 1 day 68 days

We Can Attack a Salted Hash? A salted-(sha)hash can be broken with a modest investment in hardware Our threat actor didn t need to be as well-equipped as we thought Script-kiddie Some guy Well-equipped Attacker Nation-state

Algorithms designed specifically to remove the lightningfast property of hashes Thus: protecting passwords from Brute Force and Rainbow Table attacks Adaptive Hashes increase the amount of time each hash takes through iteration Adaptive Hashes

PW-Based Key Derivation (PBKDF) pbkdf2(salt, pw, c){ hmac= hmac-sha-1 key=pw d=salt for (int i=0, i < c,i++){ d = hmac(key, d) } Loop c times over a HMAC-SHA-1* HMAC: key is the password; text is the salt How many 0s are needed for c } return d NIST: 1000 ios4: 10000 *** Pseudo-code ignores some detail for clarity s sake As stated, this is sufficiently simplified as to be misleading. See http://tools.ietf.org/html/ rfc2898#section-5.2 for detail.

bcrypt bcrypt(salt, pw, c){ d = OrpheanBeholderScryDoubt keystate = EksBlowfishSetup(c, salt, pw) } for (int i=0, i < 64,i++){ d = blowfish(kystate, d) } return c salt d 2 cost iterations slows down each hash operation Is 2 12 enough these days? Resists GPU parallelization, but not FPGA pw_hash contains the salt

scrypt scrypt(salt, pw, N, p, dklen){ b[p] for (int i=0, i < p, i++){ b[i] = PBKDF2(pw,salt,1,p MFLen) } for (int I = 0, i < p, i++){ b[i] = MF(b[i], N) } dk = PBKDF2(pw, b,1, dklen) } **MF involves (HMAC-SHA-256, r) Designed to defeat FPGA attacks Configurable N = memory footprint CPU time P = defense against parallelism ***Follow-on discussions revealed that positives of this approach were not communicated. Update with explicit benefits/limitations material. 22

Defender VS Attacker Defender CPU on App Server 4-16 processors / server 2-64 Application Servers 20M Users, 2M active / hr Knows scheme, key onus > > > > > < Attacker Custom hardware GPU or FPGA 160+ GPUs / card, FPGA configurable Scales with capabilities / crack value May need only one (1) credential set Unlimited time Must discern scheme, steal key material @tqbf points out this slide is misleading citing cost to verify vs. brute force the db. Both verify, so that s a not the issue. Point taken however: this slide is qualitative and misleading. Next version of this presentation must replace this slide with a quantitative effort comparison of Apples vs. Apples (e.g. costoflogin vs. costofsinglereverse) Cost for defender is greater than the cost for the attacker if Adaptive Hash is the only conrol.

Adaptive Hashes At Best Strengthen a Single Control Point We Can Do Better with Defense In Depth Requiring a Key Gains Defense In Depth

The Threat Model Revisited @tqbf points out that if developers store keys in the DB, as they may be prone to do, compartmentalization falls apart. Keyed transforms do differ from split digest texts because they resist attacks differently digests DB stolen (see slide #3 w/ leading 00000 s) Add a control that requires a key stored on the App Server Threats can exfiltrate the password table, but now needs to also get the key

hmac properties extends hash (inherits hash properties) Adds key Resists padding / length extension attacks

COMPAT/FIPS Solution <versionscheme> <saltuser> <digest> := HMAC(<keysite>, <mixed construct>) <mixed construct> := <versionscheme> <saltuser> <pwuser> HMAC := hmac- sha256 keysite := PSMKeyTool(SHA256()):32B; saltuser := SHA1PRNG():32B FIPS186-2():32B; pwuser := <governed by password fitness> Optional: <mixed construct> GUID user := <versionscheme> <saltuser> : <GUID user > <pwuser> := NOT username or available to untrusted zones

hmac Solution Properties Attack Resistance 1.1 Resist chosen plain text attacks Yes, Scheme complexity based on (saltuser & pwuser) + keysite 1.2 Resist brute force attacks Yes, Key site = 2 256, salt user = 2 256 1.3 Resist D.o.S. of entropy/randomness exhaustion Yes, 32B on password generation or rotation 1.4 Prevent bulk exfiltration of credentials Implementation detail: <various> 1.5 Prevent identical <protected>(pw) creation Yes, provided by salt 1.6 Prevent <protected>(pw) w/ credentials Yes, provided by Key site 1.7 Prevent exfiltration of ancillary secrets Implementation detail: store Key site on application server 1.8 Prevent side-channel or timing attacks Implementation detail: use MessageDigest.equals() 1.9 Prevent extension, similar Yes, hmac() construction (i_pad, o_pad) 1.10 Prevent multiple encryption problems N/A (hmac() construction) 1.11 Prevent common key problems N/A (hmac() construction) 1.12 Prevent key material leakage through primitives Yes, hmac() construction (i_pad, o_pad) Two people pointed out (I wholly agree) the timing attack vector does not apply to proposed approaches. We listed it to record closing an issue brought up by an external reviewer.

hmac Limitations 1. Properly protecting key material challenges developers 2. Must enforce design to prevent T3 1. compartmentalization and 2. separation of privilege (app server & db) 3. No support of rotation or password update 4. Versioning adds complexity 29

Reversible Solution <version scheme > <cipher text > := ENC(<wrapper key site >, <protected pw>) <protected pw> := <version scheme > <salt user > <round 1> <round 1> := ONEWAY(<key site >, <mixed construct>) <mixed construct> := <version scheme > <salt user > <pw user > ENC := AES- 256 ONEWAY := hmac- sha- 512 scrypt <key site > := PSMKeyTool(<salt site >, <pw site >, <c>, DkL) <wrapper key site > := PSMKeyTool(<salt wrapper >, <pw wrapper >, <c>, DkL) Version scheme := integer (4B) PSMKeyTool := PBKDF2(<salt site >, c=10000000, DkL=32B):32B; salt user,site,wrapper := SHA1PRNG():32B; pw user := <governed by password fitness> Slide as presented. However, internal (unpublished) documentation reflects using an adaptive (rather than a keyed) scheme on <mixed construct> to produce <round 1> result. This slide needs wholesale re-work.

Reversible Solution Properties Inherits compat solution properties Symmetric scheme supports Versioning Encryption policies (key rotation, etc.) Stolen PW DB useless Stolen PW DB + AES key still requires reversing one-way function Versioning / rotation features (requirements) designed to address incident response and maintenance under attack. Without having explained this portion of the workflow/design, this looks unnecessary.

Conclusions Without considering specific threats, the solutions misses key properties Understanding operations drives a whole set of hidden requirements Many solutions resist attack equivalently Adaptive hashes impose on defenders, affecting scale Leveraging design principles balances solution Defense in depth Separation of Privilege Compartmentalization

Thank You for Your Time Questions

Select Source Material Trade material Password Storage Cheat Sheet Cryptographic Storage Cheat Sheet PKCS #5: RSA Password-Based Cryptography Standard Guide to Cryptography Kevin Wall s Signs of broken auth (& related posts) John Steven s Securing password digests IETF RFC2898 Applicable Regulation, Audit, or Special Guidance COBIT DS 5.18 - Cryptographic key management Export Administration Regulations ( EAR ) 15 C.F.R. NIST SP-800-90A Future work: Recommendations for key derivation NIST SP-800-132 Authenticated encryption of sensitive material: NIST SP-800-38F (Draft) Other work Spring Security, Resin jascrypt Apache: HTDigest, HTTP Digest Specification, Shiro 34