SlideShare a Scribd company logo
ROOTS, 27. April 2012

André N. Klingsheim
@klingsen
   Some motivation
   Authentication/identities defined
   Where authentication fits in
   Authentication factors
   Passwords
   Two-factor authentication
   Keeping your shields up
   Fun and demos
   Verizon Data Breach Investigations Report*
     Based on 855 incidents (that resulted in)
     174 million compromized records
     Leads to some interesting statistics
      ▪ Curiosity: One organized criminal group in Eastern
        Europe worked on average three days per week
     Go read it when you get home!



    * http://www.verizonbusiness.com/dbir/
Source: Verizon Data Breach Investigations Report, p. 26
Source: Verizon Data Breach Investigations Report, p. 32
   TL;DR: How sure are you that it’s the correct
    user who’s logging in?
     You’re never 100% sure!
   Authentication is the process of establishing
    an understood level of trust in whether the
    user is who she claims to be
   An identifier such as a name, national identity
    number, or a customer number, points to an
    identity
   The identity of an individual is the set of
    information associated with that individual in
    a particular computer system
Someone claims to be «klings»!




Authentication tries to establish whether that someone is this guy! 
1.       You don’t know who the user is
2.       The user authenticates (now you’re pretty
         sure who the user is)
3.       The user gets a security token in return
         You associate the user’s identity with this token
         Think session cookies (and username written to
          session)
4.       Now you «remember» the outcome of the
         authentication
   You’re done with authentication, and then
    have to rely on session security
   So, authentication helps you figure out
    whether an unkown person/computer can
    safely be assosciated with a digital identity
   Session security deals with remembering who
    the users is in a secure manner
Getting authentication right
   Your trust in that you’re talking to the right
    person is at its peak in the authentication
    instant
   Session security takes over, remember this is
    «cached» trust
   Re-authentication
     Rebuilds your trust in that it’s still the correct
      person acting as the logged in user
Getting authentication right
   Something you know («Pa$$W0rd1»)
   Something you have
   Something you are




    * Fingerprint shared by Wilfredor under CC BY-SA 3.0 lisence
   In practice a static, shared secret
     Password
     Security questions
      ▪ Mother’s maiden name
      ▪ Where did you go to school
      ▪ And so on...
     PINs (debit/credit cards)
   Code generators
     Sequence based
     Time-based
   Your mobile phone
     SMS
     Google Authenticator
   You’re debit/credit card (physical/VVC2)
   Cards with printed PIN-codes
   Biometrics
     Fingerprint
     Retina scan
     Etc..
   Not widely deployed on the web...
   Something you know: a password or PIN
   Why?
     Very cheap (no devices)
      ▪ Do note that password resets can cost you…
     In some cases available off-the-shelf (e.g.
      ASP.NET has the SqlMembershipProvider)
   Scales well
   Users are well accustomed to
    passwords/PINs!
   Som critical aspects of a password based
    authentication procedure
     How passwords are stored
     How users sign up
     How passwords are validated
     How passwords are reset
     Application security
     The security of all other password based IT-
     systems in the world
   The easiest way to store a password is, well,
    to store the password in a database in
    cleartext
     DBA’s can easily steal the passwords.
     A breach of the database will immediately reveal
     all passwords (think Sony)
   So, encryption or hashing to the rescue!
   PS! Forgot password -> mail with old
    password -> most likely cleartext passwords
   Encrypted passwords mean only one thing
   They must be decrypted to be verified
   Encryption key + database -> all passwords
   There is most likely a sysadmin with access to
    both the key, and the db
   Password encryption is not recommended!
   A hash function is a deterministic one way
    function with a fixed output length
   Commonly used: MD5, Sha-1, Sha-256
   MD5(‘Password’) =>           3GR+tl5nEeFVN1IYISs5ZA==
       Look it up on Google 



   It’s easy to compute the hash value of an
    input. It should be impossible to calculate the
    input based on a hash value (hence one way)
   Two users with the same password, will have
    the same hash values in the db
   You can compute the hash value for common
    passwords, and store the values
   If you get hold of password hashes – just look
    them up against known values!
   The precomputation step is the essence of
    Rainbow tables
     Let’s you crack common passwords in no time
   We need salts!
 Salts add a bit of uniqueness to the input to the
  hash function
 Salts can be stored besides the password hash in
  the db
   Salt: 3GR+tl5nEeFVN1IYISs5ZA==
   Hash = Sha-256(salt+password)

   Hampers rainbow table attacks
   Does not hamper dictionary attacks/brute force
    attacks
   If you get your hands on a list of salted
    password hashes you can
     Run a dictionary attack (calculate password
      hashes for a wordlist, and compare the hashes)
     Run a brute force attack (calculate hashes for all
      possible passwords aaaaaa, aaaaab, aaaaac so on)
   If it’s not your list of password hashes, do
    consider the legal aspects
   Are very efficient against common hashes
    such as MD5/Sha-family
     Millions of hashes checked per second (single cpu)
   Due to the fact that hash functions were
    designed to be fast (not to store passwords)
   We need to add a workload!
   PBKDF2
     Password based key derivation function
     Runs X iterations of an HMAC (based on SHA-1) to
      generate a key
     Computational penalty for password crackers
   Bcrypt
     Also adds computational load => time penalty
   Scrypt
     Based on a memory trade-off, to hamper special
     purpose hardware w/limited memory
   You’ve stored your passwords securely
     The password crackers now hate you


   Then some other site gets hacked and all
    their passwords are leaked
     Who cares, you’re secure right?
   Your users used the same password on your
    site...
   Users tend to reuse their passwords across
    websites
   Other sites get hacked for various reasons
   Leads to the compromise of accounts on your
    site!
   But that’s not fair!
     No it isn’t. The world is not fair, in case you
      haven’t noticed.
 Something you have
 Is NOT shared
  between sites
 Solves the «other sites
  were hacked» problem
   Time-based
     Code typically generated based on a secret key,
      and the current time
     Requires reliable clocks on both server and the
      code generating device
   Sequence based
     Pseudo random number generator, seeded with a
      secret key
     Code generator and server generate same
      sequence of codes
   Go with time-based if you can
     Limited TTL for your codes
     Limited number of valid codes at any given time
   Sequence based generators
     Let’s you compute many codes that will be valid
      until used
     E.g. take someone’s token, generate 5 codes,
      they’ll be valid until the victim tries to use a code
   Very important that security cannot be
    degraded in your system
     Fallback from two-factor to single factor
      authentication
     Disabling of security mechanisms without
      requiring authentication
   E.g. to change the password, you need to
    enter the correct current password
   More complicated for two-factor
    authentication
     If you can reset one factor with the other, it’s not
      really two-factor
     Forgot password -> set new password, confirm
      with one time code
     Lost mobile phone -> log in with password to
      change mobile number for one time codes
   Beware such dependencies in your system!
   “Forgotten password”
     Secret questions (are not)
     E-mail
     Snail mail
     SMS
   Require re-authentication for all critical
    updates
   Such as change of
     Password
     Phone number
     E-mail address
     Disabling of security mechanisms
   And not with just one factor!
   If you have an optional security mechanism
    (e.g. one time codes)
     You must require the user to use the security
      mechanism in order to turn it off
     Else it’s useless!
   So changing the «security level» must be
    done according to the current level of security
   Tutorial/demo! 
   Scenario: Someone is logged in to their
    Google account
     Two-factor authentication enabled
     You have figured out their password but don’t
     have access to their OTPs
   Can you find any way to gain access to their
    acount, without OTPs, from another
    computer?
   Thank you for listening!
   Find me on the web:
     www.dotnetnoob.com
     @klingsen

More Related Content

PPSX
Brute force attack
PPTX
Brute force-attack presentation
DOCX
Password Cracking
PPTX
Brute force-attack presentation
PPTX
Improving Password Based Security
PPTX
Password based cryptography
PPTX
Password Cracking
PPTX
Password cracking and brute force
Brute force attack
Brute force-attack presentation
Password Cracking
Brute force-attack presentation
Improving Password Based Security
Password based cryptography
Password Cracking
Password cracking and brute force

What's hot (20)

PPTX
Brute force attack
ODP
Password Attack
PDF
Securing Database Passwords Using a Combination of hashing and Salting Techni...
PPTX
Password Cracking
PPTX
Password craking techniques
PDF
PPTX
3D Password M Sc BHU Sem 1
PDF
Why is password protection a fallacy a point of view
DOCX
Password hacking
PDF
Password Strength Policy Query
PDF
J0704055058
PPTX
Encryption by fastech
PPTX
Welcome to the world of hacking
PPTX
password cracking and Key logger
PPTX
Greater Wheeling AITP Web Security
PPTX
3D PASSWORD
PPTX
3d authentication system
PPTX
Password Attack
PPT
PDF
An Enhanced Security System for Web Authentication
Brute force attack
Password Attack
Securing Database Passwords Using a Combination of hashing and Salting Techni...
Password Cracking
Password craking techniques
3D Password M Sc BHU Sem 1
Why is password protection a fallacy a point of view
Password hacking
Password Strength Policy Query
J0704055058
Encryption by fastech
Welcome to the world of hacking
password cracking and Key logger
Greater Wheeling AITP Web Security
3D PASSWORD
3d authentication system
Password Attack
An Enhanced Security System for Web Authentication
Ad

Similar to Getting authentication right (20)

PPTX
Authentication and session v4
PPT
Top Ten Tips For Tenacious Defense In Asp.Net
PDF
How encryption works
PDF
Why is password protection a fallacy a point of view
PPTX
Password cracking and brute force tools
PPT
Unit-4 Cybercrimes-II Mobile and Wireless Devices.ppt
DOCX
CHAPTER 7 Authentication and Authorization On
PPTX
Introduction to Web Application Security Principles
PDF
Password and Account Management Strategies - April 2019
PPTX
Ethical hacking for Business or Management.pptx
DOCX
Chapter 6Authenticating PeopleChapter 6 OverviewThe th
PPTX
Gamifying Ethical hacking for education.pptx
PPT
Information Security
PPSX
Technology Training - Security, Passwords & More
PPTX
11 Commandments of Cyber Security for the Home
PPT
Password Management
PDF
C0210014017
PDF
1208 wp-two-factor-and-swivel-whitepaper
PPT
It security in healthcare
PPT
14_526_topic07uuuuuuuuuuuuuuuuuuuuuu.ppt
Authentication and session v4
Top Ten Tips For Tenacious Defense In Asp.Net
How encryption works
Why is password protection a fallacy a point of view
Password cracking and brute force tools
Unit-4 Cybercrimes-II Mobile and Wireless Devices.ppt
CHAPTER 7 Authentication and Authorization On
Introduction to Web Application Security Principles
Password and Account Management Strategies - April 2019
Ethical hacking for Business or Management.pptx
Chapter 6Authenticating PeopleChapter 6 OverviewThe th
Gamifying Ethical hacking for education.pptx
Information Security
Technology Training - Security, Passwords & More
11 Commandments of Cyber Security for the Home
Password Management
C0210014017
1208 wp-two-factor-and-swivel-whitepaper
It security in healthcare
14_526_topic07uuuuuuuuuuuuuuuuuuuuuu.ppt
Ad

Recently uploaded (20)

PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
sap open course for s4hana steps from ECC to s4
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Encapsulation theory and applications.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Approach and Philosophy of On baking technology
Network Security Unit 5.pdf for BCA BBA.
NewMind AI Weekly Chronicles - August'25 Week I
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
sap open course for s4hana steps from ECC to s4
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Per capita expenditure prediction using model stacking based on satellite ima...
“AI and Expert System Decision Support & Business Intelligence Systems”
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Spectral efficient network and resource selection model in 5G networks
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Encapsulation_ Review paper, used for researhc scholars
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Encapsulation theory and applications.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
MIND Revenue Release Quarter 2 2025 Press Release
Digital-Transformation-Roadmap-for-Companies.pptx
Understanding_Digital_Forensics_Presentation.pptx
Approach and Philosophy of On baking technology

Getting authentication right

  • 1. ROOTS, 27. April 2012 André N. Klingsheim @klingsen
  • 2. Some motivation  Authentication/identities defined  Where authentication fits in  Authentication factors  Passwords  Two-factor authentication  Keeping your shields up  Fun and demos
  • 3. Verizon Data Breach Investigations Report*  Based on 855 incidents (that resulted in)  174 million compromized records  Leads to some interesting statistics ▪ Curiosity: One organized criminal group in Eastern Europe worked on average three days per week  Go read it when you get home! * http://www.verizonbusiness.com/dbir/
  • 4. Source: Verizon Data Breach Investigations Report, p. 26
  • 5. Source: Verizon Data Breach Investigations Report, p. 32
  • 6. TL;DR: How sure are you that it’s the correct user who’s logging in?  You’re never 100% sure!  Authentication is the process of establishing an understood level of trust in whether the user is who she claims to be
  • 7. An identifier such as a name, national identity number, or a customer number, points to an identity  The identity of an individual is the set of information associated with that individual in a particular computer system
  • 8. Someone claims to be «klings»! Authentication tries to establish whether that someone is this guy! 
  • 9. 1. You don’t know who the user is 2. The user authenticates (now you’re pretty sure who the user is) 3. The user gets a security token in return  You associate the user’s identity with this token  Think session cookies (and username written to session) 4. Now you «remember» the outcome of the authentication
  • 10. You’re done with authentication, and then have to rely on session security  So, authentication helps you figure out whether an unkown person/computer can safely be assosciated with a digital identity  Session security deals with remembering who the users is in a secure manner
  • 12. Your trust in that you’re talking to the right person is at its peak in the authentication instant  Session security takes over, remember this is «cached» trust  Re-authentication  Rebuilds your trust in that it’s still the correct person acting as the logged in user
  • 14. Something you know («Pa$$W0rd1»)  Something you have  Something you are * Fingerprint shared by Wilfredor under CC BY-SA 3.0 lisence
  • 15. In practice a static, shared secret  Password  Security questions ▪ Mother’s maiden name ▪ Where did you go to school ▪ And so on...  PINs (debit/credit cards)
  • 16. Code generators  Sequence based  Time-based  Your mobile phone  SMS  Google Authenticator  You’re debit/credit card (physical/VVC2)  Cards with printed PIN-codes
  • 17. Biometrics  Fingerprint  Retina scan  Etc..  Not widely deployed on the web...
  • 18. Something you know: a password or PIN  Why?  Very cheap (no devices) ▪ Do note that password resets can cost you…  In some cases available off-the-shelf (e.g. ASP.NET has the SqlMembershipProvider)  Scales well  Users are well accustomed to passwords/PINs!
  • 19. Som critical aspects of a password based authentication procedure  How passwords are stored  How users sign up  How passwords are validated  How passwords are reset  Application security  The security of all other password based IT- systems in the world
  • 20. The easiest way to store a password is, well, to store the password in a database in cleartext  DBA’s can easily steal the passwords.  A breach of the database will immediately reveal all passwords (think Sony)  So, encryption or hashing to the rescue!  PS! Forgot password -> mail with old password -> most likely cleartext passwords
  • 21. Encrypted passwords mean only one thing  They must be decrypted to be verified  Encryption key + database -> all passwords  There is most likely a sysadmin with access to both the key, and the db  Password encryption is not recommended!
  • 22. A hash function is a deterministic one way function with a fixed output length  Commonly used: MD5, Sha-1, Sha-256  MD5(‘Password’) => 3GR+tl5nEeFVN1IYISs5ZA==  Look it up on Google   It’s easy to compute the hash value of an input. It should be impossible to calculate the input based on a hash value (hence one way)
  • 23. Two users with the same password, will have the same hash values in the db  You can compute the hash value for common passwords, and store the values  If you get hold of password hashes – just look them up against known values!  The precomputation step is the essence of Rainbow tables  Let’s you crack common passwords in no time  We need salts!
  • 24.  Salts add a bit of uniqueness to the input to the hash function  Salts can be stored besides the password hash in the db  Salt: 3GR+tl5nEeFVN1IYISs5ZA==  Hash = Sha-256(salt+password)  Hampers rainbow table attacks  Does not hamper dictionary attacks/brute force attacks
  • 25. If you get your hands on a list of salted password hashes you can  Run a dictionary attack (calculate password hashes for a wordlist, and compare the hashes)  Run a brute force attack (calculate hashes for all possible passwords aaaaaa, aaaaab, aaaaac so on)  If it’s not your list of password hashes, do consider the legal aspects
  • 26. Are very efficient against common hashes such as MD5/Sha-family  Millions of hashes checked per second (single cpu)  Due to the fact that hash functions were designed to be fast (not to store passwords)  We need to add a workload!
  • 27. PBKDF2  Password based key derivation function  Runs X iterations of an HMAC (based on SHA-1) to generate a key  Computational penalty for password crackers  Bcrypt  Also adds computational load => time penalty  Scrypt  Based on a memory trade-off, to hamper special purpose hardware w/limited memory
  • 28. You’ve stored your passwords securely  The password crackers now hate you  Then some other site gets hacked and all their passwords are leaked  Who cares, you’re secure right?  Your users used the same password on your site...
  • 29. Users tend to reuse their passwords across websites  Other sites get hacked for various reasons  Leads to the compromise of accounts on your site!  But that’s not fair!  No it isn’t. The world is not fair, in case you haven’t noticed.
  • 30.  Something you have  Is NOT shared between sites  Solves the «other sites were hacked» problem
  • 31. Time-based  Code typically generated based on a secret key, and the current time  Requires reliable clocks on both server and the code generating device  Sequence based  Pseudo random number generator, seeded with a secret key  Code generator and server generate same sequence of codes
  • 32. Go with time-based if you can  Limited TTL for your codes  Limited number of valid codes at any given time  Sequence based generators  Let’s you compute many codes that will be valid until used  E.g. take someone’s token, generate 5 codes, they’ll be valid until the victim tries to use a code
  • 33. Very important that security cannot be degraded in your system  Fallback from two-factor to single factor authentication  Disabling of security mechanisms without requiring authentication  E.g. to change the password, you need to enter the correct current password
  • 34. More complicated for two-factor authentication  If you can reset one factor with the other, it’s not really two-factor  Forgot password -> set new password, confirm with one time code  Lost mobile phone -> log in with password to change mobile number for one time codes  Beware such dependencies in your system!
  • 35. “Forgotten password”  Secret questions (are not)  E-mail  Snail mail  SMS
  • 36. Require re-authentication for all critical updates  Such as change of  Password  Phone number  E-mail address  Disabling of security mechanisms  And not with just one factor!
  • 37. If you have an optional security mechanism (e.g. one time codes)  You must require the user to use the security mechanism in order to turn it off  Else it’s useless!  So changing the «security level» must be done according to the current level of security
  • 38. Tutorial/demo!   Scenario: Someone is logged in to their Google account  Two-factor authentication enabled  You have figured out their password but don’t have access to their OTPs  Can you find any way to gain access to their acount, without OTPs, from another computer?
  • 39. Thank you for listening!  Find me on the web:  www.dotnetnoob.com  @klingsen