SlideShare una empresa de Scribd logo
1 de 38
Descargar para leer sin conexión
Password (in)security
How to generate and store passwords
          in a secure way

        by Enrico “cerin0” Zimuel
About me
                                                                 1998
 Enrico “cerin0” Zimuel
 Developer since Texas Instruments TI99/4A
 Research programmer, Informatics institute of UvA (Amsterdam)
 Core team of the open source project Zend Framework
 Co-author of the books “Segreti, Spie Codici Cifrati”, “Come si fa a
usare la firma digitale”, “PHP Best Practices”
 Founder of the PHP User Group Torino
 http://www.zimuel.it
Password



   A password is a secret word or
string of characters that is used for
           authentication.
User perspective:

  How to choose a “secure” password?


   Developer perspective:
How to store a password in a secure way?
Password security



Basically every security system
    is based on password.
When security fails...
linkedin.com


    Hack: 6th June 2012
More than 6 million passwords
     was compromised
      SHA1 password
eharmony.com


     Hack: 6th June 2012
More than 1.5 million passwords
      was compromised
       SHA1 password
last.fm


  Hack: 7th June 2012
? million passwords was
      compromised
     MD5 password
yahoo.com



        Hack: 12th June 2012
 443K passwords was compromised
SQL injection, password in plaintext!
How to choose a “robust”
    user's password
Some best practices:

●
  No personal information
●
  A long pass phrase is better than a shorter
random jumble of characters
●
  At least 10 characters long
●
  Don't use the same password for everything
●
  Change your password from time to time
http://howsecureismypassword.net/
Developers



Force the user to generate
    robust password
Developers


How to store a password in a
       secure way?
Old school (deprecated)



 Use hash algorithms like
      MD5 or SHA1
New school (deprecated?)



 Use hash algorithm + salt
    (a random string).
Using hash + salt



Prevent dictionary attacks? YES
Prevent brute force attacks? NO
Brute forcing attacks


CPU power is growing (multi-core)
GPU are rendering password security
useless
Use a Cloud system (n-CPU)
Brute forcing with a GPU




             Source: www.nvidia.com
GPU and CUDA


CUDA™ is a parallel computing
platform and programming model
invented by NVIDIA
Extreme GPU Bruteforcer
    using NVIDIA GTS250 ~ $100

Algorithm           Speed              8 chars      9 chars     10 chars
md5($pass)          426 million p/s    6 days       1 year      62 years
md5($pass.$salt)    170 million p/s    14 days      2 ½ years   156 years
sha1($pass)         85 million p/s     29 days      5 years     313 years
sha1($pass.$salt)   80 million p/s     31 days      5 years     332 years


       Password of 62 characters (a-z, A-Z, 0-9)


              Source: http://www.insidepro.com/eng/egb.shtml
IGHASHGPU
              ATI HD 5970 ~ $700

Algorithm      Speed                 8 chars      9 chars   10 chars
md5($pass)     5600 million p/s      10 hours     27 days   4 ½ years
sha1($pass)    2300 million p/s      26 hours     68 days   11 ½ years




       Password of 62 characters (a-z, A-Z, 0-9)


               Source: http://www.golubev.com/hashgpu.htm
Whitepixel
4 Dual HD 5970
~ $2800



Algorithm     Speed                 8 chars      9 chars  10 chars
md5($pass)    33 billion p/s        1 ½ hour     4 ½ days 294 days




       Password of 62 characters (a-z, A-Z, 0-9)
                Source: http://blog.zorinaq.com/?e=42
Secure algorithms for
         password storing


●Hash + salt + stretching (i.e. PBKDF2)
● bcrypt
● scrypt
Hash + salt + stretching


●   Stretching = iterate (hash + salt) n-times

key = ““
for 1 to n­times do
  key = hash(key + password + salt)
How to estimate the
           number of iterations?
●The number of iterations depends on the CPU
speed, should take around 1 sec to be considered
secure

●   For instance, this PHP code:
   <?php
   $key='';
   for ($i=0;$i<NUM_ITERATIONS;$i++) {
    $key= hash('sha512',$key.$salt.$password);
   }

runs in 900 ms with NUM_ITERATIONS= 40'000 using
an Intel Core 2 at 2.1Ghz
PBKDF2

● PBKDF2 (Password-Based Key Derivation Function 2)
is a key derivation function that is part of RSA
Laboratories' Public-Key Cryptography Standards
(PKCS) series, specifically PKCS #5 v2.0
● PBKDF2 applies a pseudorandom function, such as a
cryptographic hash, cipher, or HMAC to the input password
or passphrase along with a salt value and repeats the
process many times to produce a derived key, which can
then be used as a cryptographic key in subsequent
operations
PBKDF2 in PHP
PBKDF2 in PHP (Zend Framework 2.0)
function calc($hash, $password, $salt, $iterations, $length) {
    $num = ceil($length / Hmac::getOutputSize($hash, 
                                             Hmac::OUTPUT_BINARY));
    $result = '';
    for ($block = 1; $block <= $num; $block++) {
       $hmac = Hmac::compute($password, $hash, $salt . pack('N', 
                  $block), Hmac::OUTPUT_BINARY);
       $mix = $hmac;
       for ($i = 1; $i < $iterations; $i++) {
           $hmac = Hmac::compute($password, $hash, $hmac, 
                                 Hmac::OUTPUT_BINARY);
           $mix ^= $hmac;
       }
       $result .= $mix;
    }
    return substr($result, 0, $length);
}
bcrypt

●   http://bcrypt.sourceforge.net/

●   bcrypt uses Blowfish cipher + iterations to generate
secure hash values

● bcrypt is secure against brute force or dictionary
attacks because is slow, very slow (that means attacks
need huge amount of time to be completed)
bcrypt parameters
●The algorithm needs a salt value and a work factor
parameter (cost), which allows you to determine
how expensive the bcrypt function will be

●The cost value depends on the CPU speed, check
on your system! I suggest to set at least 1 second.
bcrypt in PHP
●
    bcrypt is implemented in PHP with the crypt()
    function:
 $salt = substr(str_replace('+', '.',
                base64_encode($salt)), 0, 22);
 $hash = crypt($password,'$2a$'.$cost.'$'.$salt);

●
    For instance, $password= 'thisIsTheSecretPassword' and
    $salt= 'hsjYeg/bxn()%3jdhsGHq0'
     
    aHNqWWVnL2J4bigpJTNqZGhzR0hxMA==$a9c810e9c722af719adabcf50d
    b8a0b4cd0d14e07eddbb43e5f47bde620a3c13

    Green= salt, Red= encrypted password
scrypt
●
    http://www.tarsnap.com/scrypt.html

●
    scrypt is a sequential memory hard algorithm:
     ●
       memory-hard functions require high memory
     ●
       cannot be parallelized efficiently

●
    scrypt uses PBKDF2, HMAC-SHA256, Salsa 20/8 core
scrypt security
“From a test executed on modern (2009) hardware,
if 5 seconds are spent computing a derived key, the
cost of a hardware brute-force attack against scrypt
is roughly 4000 times greater than the cost of a
similar attack against bcrypt (to find the same
password), and 20000 times greater than a similar
attack against Pbkdf2."
                                    Colin Percival
                      (the author of scrypt algorithm)
Conclusion
●
    As user:

Use only “robust” password (e.g. long pass phrase is
better than a shorter random jumble of characters)
Don't use the same password for different services

●
    As developer:

Don't use hash or hash+salt to store a password!
Use hash+salt+stretching (PBKDF2), bcrypt or scrypt
to store your passwords
References
●
    Colin Percival, Stronger Key Derivation via Sequential
    Memory-Hard Functions, presented at BSDCan'09, May 2009
●
    Morris, Robert, Thompson, Ken, Password Security: A Case
    History, Bell Laboratories, 2011
●
    Coda Hale, How to safely store a password, 2010
    http://codahale.com/how-to-safely-store-a-password/
●
    J. Kelsey, B. Schneier, C. Hall, and D. Wagner, Secure
    Applications of Low-Entropy Keys, nformation Security
    Workshop (ISW'97), 1997
●
    Marc Bevand, Whitepixel breaks 28.6 billion password/sec
    http://blog.zorinaq.com/?e=42
●
    Andrew Zonenberg, Distributed Hash Cracker: A Cross-
    Platform GPU-Accelerated Password Recovery System, 2009
Thanks!

  Contacts:
enrico@zimuel.it
   @ezimuel

Más contenido relacionado

La actualidad más candente

14 tips to increase cybersecurity awareness
14 tips to increase cybersecurity awareness14 tips to increase cybersecurity awareness
14 tips to increase cybersecurity awarenessMichel Bitter
 
Cyber Security Vulnerabilities
Cyber Security VulnerabilitiesCyber Security Vulnerabilities
Cyber Security VulnerabilitiesSiemplify
 
Cyber security and demonstration of security tools
Cyber security and demonstration of security toolsCyber security and demonstration of security tools
Cyber security and demonstration of security toolsVicky Fernandes
 
Cyber security system presentation
Cyber security system presentationCyber security system presentation
Cyber security system presentationA.S. Sabuj
 
Best Practices for Password Creation
Best Practices for Password CreationBest Practices for Password Creation
Best Practices for Password CreationnFront Security
 
Cyber security
Cyber securityCyber security
Cyber securitySabir Raja
 
Social engineering attacks
Social engineering attacksSocial engineering attacks
Social engineering attacksRamiro Cid
 
System hacking
System hackingSystem hacking
System hackingCAS
 
Cybersecurity Awareness Training
Cybersecurity Awareness TrainingCybersecurity Awareness Training
Cybersecurity Awareness TrainingDave Monahan
 
Application Security - Your Success Depends on it
Application Security - Your Success Depends on itApplication Security - Your Success Depends on it
Application Security - Your Success Depends on itWSO2
 
Cybersecurity Awareness Training for Employees.pptx
Cybersecurity Awareness Training for Employees.pptxCybersecurity Awareness Training for Employees.pptx
Cybersecurity Awareness Training for Employees.pptxMustafa Amiri
 
Cyber Security A Challenges For Mankind
Cyber Security A Challenges For MankindCyber Security A Challenges For Mankind
Cyber Security A Challenges For MankindSaurabh Kheni
 

La actualidad más candente (20)

14 tips to increase cybersecurity awareness
14 tips to increase cybersecurity awareness14 tips to increase cybersecurity awareness
14 tips to increase cybersecurity awareness
 
Cyber Security Vulnerabilities
Cyber Security VulnerabilitiesCyber Security Vulnerabilities
Cyber Security Vulnerabilities
 
Cyber security and demonstration of security tools
Cyber security and demonstration of security toolsCyber security and demonstration of security tools
Cyber security and demonstration of security tools
 
Cyber security system presentation
Cyber security system presentationCyber security system presentation
Cyber security system presentation
 
Cybersecurity Awareness
Cybersecurity AwarenessCybersecurity Awareness
Cybersecurity Awareness
 
Best Practices for Password Creation
Best Practices for Password CreationBest Practices for Password Creation
Best Practices for Password Creation
 
Cyber security
Cyber securityCyber security
Cyber security
 
Password craking techniques
Password craking techniques Password craking techniques
Password craking techniques
 
Social engineering attacks
Social engineering attacksSocial engineering attacks
Social engineering attacks
 
System hacking
System hackingSystem hacking
System hacking
 
Cybersecurity Awareness Training
Cybersecurity Awareness TrainingCybersecurity Awareness Training
Cybersecurity Awareness Training
 
Hacking
HackingHacking
Hacking
 
Application Security - Your Success Depends on it
Application Security - Your Success Depends on itApplication Security - Your Success Depends on it
Application Security - Your Success Depends on it
 
Password Cracking
Password CrackingPassword Cracking
Password Cracking
 
Cybersecurity Awareness Training for Employees.pptx
Cybersecurity Awareness Training for Employees.pptxCybersecurity Awareness Training for Employees.pptx
Cybersecurity Awareness Training for Employees.pptx
 
CYBER SECURITY
CYBER SECURITYCYBER SECURITY
CYBER SECURITY
 
Cyber security
Cyber securityCyber security
Cyber security
 
Malware and security
Malware and securityMalware and security
Malware and security
 
Cyber Security A Challenges For Mankind
Cyber Security A Challenges For MankindCyber Security A Challenges For Mankind
Cyber Security A Challenges For Mankind
 
Cyber security
Cyber securityCyber security
Cyber security
 

Destacado

Presentatie: "Strategische Informatiebeveiliging"
Presentatie: "Strategische Informatiebeveiliging"Presentatie: "Strategische Informatiebeveiliging"
Presentatie: "Strategische Informatiebeveiliging"cpi_news
 
Presentaties seminar sleutel tot succes
Presentaties   seminar sleutel tot succesPresentaties   seminar sleutel tot succes
Presentaties seminar sleutel tot succesJoan Tuls
 
Leveranciersbijeenkomst informatievoorziening sociaaldomein
Leveranciersbijeenkomst informatievoorziening sociaaldomeinLeveranciersbijeenkomst informatievoorziening sociaaldomein
Leveranciersbijeenkomst informatievoorziening sociaaldomeinKING
 
Leveranciersbijeenkomst programma van eisen
Leveranciersbijeenkomst programma van eisenLeveranciersbijeenkomst programma van eisen
Leveranciersbijeenkomst programma van eisenKING
 
Workinprogress - Informatieveiligheid voor uw gemeente
Workinprogress - Informatieveiligheid voor uw gemeenteWorkinprogress - Informatieveiligheid voor uw gemeente
Workinprogress - Informatieveiligheid voor uw gemeenteKING
 
Persoonlijke Leeromgevingen
Persoonlijke LeeromgevingenPersoonlijke Leeromgevingen
Persoonlijke Leeromgevingenopenwebschool
 
CLP workshop 2 - Controleren van leveranciers
CLP workshop 2 - Controleren van leveranciersCLP workshop 2 - Controleren van leveranciers
CLP workshop 2 - Controleren van leveranciersEcomatters
 
Workin progress2015 gemeentebrede_informatiebeveiliging
Workin progress2015 gemeentebrede_informatiebeveiligingWorkin progress2015 gemeentebrede_informatiebeveiliging
Workin progress2015 gemeentebrede_informatiebeveiligingKING
 

Destacado (10)

Presentatie: "Strategische Informatiebeveiliging"
Presentatie: "Strategische Informatiebeveiliging"Presentatie: "Strategische Informatiebeveiliging"
Presentatie: "Strategische Informatiebeveiliging"
 
Presentaties seminar sleutel tot succes
Presentaties   seminar sleutel tot succesPresentaties   seminar sleutel tot succes
Presentaties seminar sleutel tot succes
 
Leveranciersbijeenkomst informatievoorziening sociaaldomein
Leveranciersbijeenkomst informatievoorziening sociaaldomeinLeveranciersbijeenkomst informatievoorziening sociaaldomein
Leveranciersbijeenkomst informatievoorziening sociaaldomein
 
LRQA Congres 2014: 15 mei 15:45 - 16:10 Praktijkcase: informatiebeveiliging i...
LRQA Congres 2014: 15 mei 15:45 - 16:10 Praktijkcase: informatiebeveiliging i...LRQA Congres 2014: 15 mei 15:45 - 16:10 Praktijkcase: informatiebeveiliging i...
LRQA Congres 2014: 15 mei 15:45 - 16:10 Praktijkcase: informatiebeveiliging i...
 
Photography
PhotographyPhotography
Photography
 
Leveranciersbijeenkomst programma van eisen
Leveranciersbijeenkomst programma van eisenLeveranciersbijeenkomst programma van eisen
Leveranciersbijeenkomst programma van eisen
 
Workinprogress - Informatieveiligheid voor uw gemeente
Workinprogress - Informatieveiligheid voor uw gemeenteWorkinprogress - Informatieveiligheid voor uw gemeente
Workinprogress - Informatieveiligheid voor uw gemeente
 
Persoonlijke Leeromgevingen
Persoonlijke LeeromgevingenPersoonlijke Leeromgevingen
Persoonlijke Leeromgevingen
 
CLP workshop 2 - Controleren van leveranciers
CLP workshop 2 - Controleren van leveranciersCLP workshop 2 - Controleren van leveranciers
CLP workshop 2 - Controleren van leveranciers
 
Workin progress2015 gemeentebrede_informatiebeveiliging
Workin progress2015 gemeentebrede_informatiebeveiligingWorkin progress2015 gemeentebrede_informatiebeveiliging
Workin progress2015 gemeentebrede_informatiebeveiliging
 

Similar a Password (in)security

Cryptography with Zend Framework
Cryptography with Zend FrameworkCryptography with Zend Framework
Cryptography with Zend FrameworkEnrico Zimuel
 
Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)Svetlin Nakov
 
Strong cryptography in PHP
Strong cryptography in PHPStrong cryptography in PHP
Strong cryptography in PHPEnrico Zimuel
 
Passwords good badugly181212-2
Passwords good badugly181212-2Passwords good badugly181212-2
Passwords good badugly181212-2Iftach Ian Amit
 
Password Storage and Attacking in PHP
Password Storage and Attacking in PHPPassword Storage and Attacking in PHP
Password Storage and Attacking in PHPAnthony Ferrara
 
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey GordeychikCODE BLUE
 
Techniques for password hashing and cracking
Techniques for password hashing and crackingTechniques for password hashing and cracking
Techniques for password hashing and crackingNipun Joshi
 
Eight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programsEight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programsAleksandr Yampolskiy
 
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)Svetlin Nakov
 
Using Cryptography Properly in Applications
Using Cryptography Properly in ApplicationsUsing Cryptography Properly in Applications
Using Cryptography Properly in ApplicationsGreat Wide Open
 
Password Storage And Attacking In PHP - PHP Argentina
Password Storage And Attacking In PHP - PHP ArgentinaPassword Storage And Attacking In PHP - PHP Argentina
Password Storage And Attacking In PHP - PHP ArgentinaAnthony Ferrara
 
How to Use Cryptography Properly: The Common Mistakes People Make When Using ...
How to Use Cryptography Properly: The Common Mistakes People Make When Using ...How to Use Cryptography Properly: The Common Mistakes People Make When Using ...
How to Use Cryptography Properly: The Common Mistakes People Make When Using ...POSSCON
 
Improving password-based authentication
Improving password-based authenticationImproving password-based authentication
Improving password-based authenticationFrank Denis
 
How-to crack 43kk passwords while drinking your juice/smoozie in the Hood
How-to crack 43kk passwords  while drinking your  juice/smoozie in the HoodHow-to crack 43kk passwords  while drinking your  juice/smoozie in the Hood
How-to crack 43kk passwords while drinking your juice/smoozie in the HoodYurii Bilyk
 
How does cryptography work? by Jeroen Ooms
How does cryptography work?  by Jeroen OomsHow does cryptography work?  by Jeroen Ooms
How does cryptography work? by Jeroen OomsAjay Ohri
 
Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2Jim Manico
 
Reutov, yunusov, nagibin random numbers take ii
Reutov, yunusov, nagibin   random numbers take iiReutov, yunusov, nagibin   random numbers take ii
Reutov, yunusov, nagibin random numbers take iiDefconRussia
 

Similar a Password (in)security (20)

Cryptography with Zend Framework
Cryptography with Zend FrameworkCryptography with Zend Framework
Cryptography with Zend Framework
 
Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)
 
Django cryptography
Django cryptographyDjango cryptography
Django cryptography
 
Cryptography in PHP: Some Use Cases
Cryptography in PHP: Some Use CasesCryptography in PHP: Some Use Cases
Cryptography in PHP: Some Use Cases
 
Strong cryptography in PHP
Strong cryptography in PHPStrong cryptography in PHP
Strong cryptography in PHP
 
Passwords good badugly181212-2
Passwords good badugly181212-2Passwords good badugly181212-2
Passwords good badugly181212-2
 
Password Storage and Attacking in PHP
Password Storage and Attacking in PHPPassword Storage and Attacking in PHP
Password Storage and Attacking in PHP
 
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
 
Techniques for password hashing and cracking
Techniques for password hashing and crackingTechniques for password hashing and cracking
Techniques for password hashing and cracking
 
Eight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programsEight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programs
 
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)
 
Using Cryptography Properly in Applications
Using Cryptography Properly in ApplicationsUsing Cryptography Properly in Applications
Using Cryptography Properly in Applications
 
Password Storage And Attacking In PHP - PHP Argentina
Password Storage And Attacking In PHP - PHP ArgentinaPassword Storage And Attacking In PHP - PHP Argentina
Password Storage And Attacking In PHP - PHP Argentina
 
Api Design
Api DesignApi Design
Api Design
 
How to Use Cryptography Properly: The Common Mistakes People Make When Using ...
How to Use Cryptography Properly: The Common Mistakes People Make When Using ...How to Use Cryptography Properly: The Common Mistakes People Make When Using ...
How to Use Cryptography Properly: The Common Mistakes People Make When Using ...
 
Improving password-based authentication
Improving password-based authenticationImproving password-based authentication
Improving password-based authentication
 
How-to crack 43kk passwords while drinking your juice/smoozie in the Hood
How-to crack 43kk passwords  while drinking your  juice/smoozie in the HoodHow-to crack 43kk passwords  while drinking your  juice/smoozie in the Hood
How-to crack 43kk passwords while drinking your juice/smoozie in the Hood
 
How does cryptography work? by Jeroen Ooms
How does cryptography work?  by Jeroen OomsHow does cryptography work?  by Jeroen Ooms
How does cryptography work? by Jeroen Ooms
 
Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2
 
Reutov, yunusov, nagibin random numbers take ii
Reutov, yunusov, nagibin   random numbers take iiReutov, yunusov, nagibin   random numbers take ii
Reutov, yunusov, nagibin random numbers take ii
 

Más de Enrico Zimuel

Integrare Zend Framework in Wordpress
Integrare Zend Framework in WordpressIntegrare Zend Framework in Wordpress
Integrare Zend Framework in WordpressEnrico Zimuel
 
Quick start on Zend Framework 2
Quick start on Zend Framework 2Quick start on Zend Framework 2
Quick start on Zend Framework 2Enrico Zimuel
 
Introduzione alla Posta Elettronica Certificata (PEC): le regole tecniche
Introduzione alla Posta Elettronica Certificata (PEC): le regole tecnicheIntroduzione alla Posta Elettronica Certificata (PEC): le regole tecniche
Introduzione alla Posta Elettronica Certificata (PEC): le regole tecnicheEnrico Zimuel
 
A quick start on Zend Framework 2
A quick start on Zend Framework 2A quick start on Zend Framework 2
A quick start on Zend Framework 2Enrico Zimuel
 
Zend Framework 2 quick start
Zend Framework 2 quick startZend Framework 2 quick start
Zend Framework 2 quick startEnrico Zimuel
 
Cryptography in PHP: use cases
Cryptography in PHP: use casesCryptography in PHP: use cases
Cryptography in PHP: use casesEnrico Zimuel
 
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)Enrico Zimuel
 
Manage cloud infrastructures using Zend Framework 2 (and ZF1)
Manage cloud infrastructures using Zend Framework 2 (and ZF1)Manage cloud infrastructures using Zend Framework 2 (and ZF1)
Manage cloud infrastructures using Zend Framework 2 (and ZF1)Enrico Zimuel
 
Framework software e Zend Framework
Framework software e Zend FrameworkFramework software e Zend Framework
Framework software e Zend FrameworkEnrico Zimuel
 
How to scale PHP applications
How to scale PHP applicationsHow to scale PHP applications
How to scale PHP applicationsEnrico Zimuel
 
Velocizzare Joomla! con Zend Server Community Edition
Velocizzare Joomla! con Zend Server Community EditionVelocizzare Joomla! con Zend Server Community Edition
Velocizzare Joomla! con Zend Server Community EditionEnrico Zimuel
 
Zend_Cache: how to improve the performance of PHP applications
Zend_Cache: how to improve the performance of PHP applicationsZend_Cache: how to improve the performance of PHP applications
Zend_Cache: how to improve the performance of PHP applicationsEnrico Zimuel
 
XCheck a benchmark checker for XML query processors
XCheck a benchmark checker for XML query processorsXCheck a benchmark checker for XML query processors
XCheck a benchmark checker for XML query processorsEnrico Zimuel
 
Introduzione alle tabelle hash
Introduzione alle tabelle hashIntroduzione alle tabelle hash
Introduzione alle tabelle hashEnrico Zimuel
 
Crittografia quantistica: fantascienza o realtà?
Crittografia quantistica: fantascienza o realtà?Crittografia quantistica: fantascienza o realtà?
Crittografia quantistica: fantascienza o realtà?Enrico Zimuel
 
Introduzione alla crittografia
Introduzione alla crittografiaIntroduzione alla crittografia
Introduzione alla crittografiaEnrico Zimuel
 
Crittografia è sinonimo di sicurezza?
Crittografia è sinonimo di sicurezza?Crittografia è sinonimo di sicurezza?
Crittografia è sinonimo di sicurezza?Enrico Zimuel
 
Sviluppo di applicazioni sicure
Sviluppo di applicazioni sicureSviluppo di applicazioni sicure
Sviluppo di applicazioni sicureEnrico Zimuel
 

Más de Enrico Zimuel (20)

Integrare Zend Framework in Wordpress
Integrare Zend Framework in WordpressIntegrare Zend Framework in Wordpress
Integrare Zend Framework in Wordpress
 
Quick start on Zend Framework 2
Quick start on Zend Framework 2Quick start on Zend Framework 2
Quick start on Zend Framework 2
 
Introduzione alla Posta Elettronica Certificata (PEC): le regole tecniche
Introduzione alla Posta Elettronica Certificata (PEC): le regole tecnicheIntroduzione alla Posta Elettronica Certificata (PEC): le regole tecniche
Introduzione alla Posta Elettronica Certificata (PEC): le regole tecniche
 
A quick start on Zend Framework 2
A quick start on Zend Framework 2A quick start on Zend Framework 2
A quick start on Zend Framework 2
 
Zend Framework 2 quick start
Zend Framework 2 quick startZend Framework 2 quick start
Zend Framework 2 quick start
 
PHP goes mobile
PHP goes mobilePHP goes mobile
PHP goes mobile
 
Zend Framework 2
Zend Framework 2Zend Framework 2
Zend Framework 2
 
Cryptography in PHP: use cases
Cryptography in PHP: use casesCryptography in PHP: use cases
Cryptography in PHP: use cases
 
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
 
Manage cloud infrastructures using Zend Framework 2 (and ZF1)
Manage cloud infrastructures using Zend Framework 2 (and ZF1)Manage cloud infrastructures using Zend Framework 2 (and ZF1)
Manage cloud infrastructures using Zend Framework 2 (and ZF1)
 
Framework software e Zend Framework
Framework software e Zend FrameworkFramework software e Zend Framework
Framework software e Zend Framework
 
How to scale PHP applications
How to scale PHP applicationsHow to scale PHP applications
How to scale PHP applications
 
Velocizzare Joomla! con Zend Server Community Edition
Velocizzare Joomla! con Zend Server Community EditionVelocizzare Joomla! con Zend Server Community Edition
Velocizzare Joomla! con Zend Server Community Edition
 
Zend_Cache: how to improve the performance of PHP applications
Zend_Cache: how to improve the performance of PHP applicationsZend_Cache: how to improve the performance of PHP applications
Zend_Cache: how to improve the performance of PHP applications
 
XCheck a benchmark checker for XML query processors
XCheck a benchmark checker for XML query processorsXCheck a benchmark checker for XML query processors
XCheck a benchmark checker for XML query processors
 
Introduzione alle tabelle hash
Introduzione alle tabelle hashIntroduzione alle tabelle hash
Introduzione alle tabelle hash
 
Crittografia quantistica: fantascienza o realtà?
Crittografia quantistica: fantascienza o realtà?Crittografia quantistica: fantascienza o realtà?
Crittografia quantistica: fantascienza o realtà?
 
Introduzione alla crittografia
Introduzione alla crittografiaIntroduzione alla crittografia
Introduzione alla crittografia
 
Crittografia è sinonimo di sicurezza?
Crittografia è sinonimo di sicurezza?Crittografia è sinonimo di sicurezza?
Crittografia è sinonimo di sicurezza?
 
Sviluppo di applicazioni sicure
Sviluppo di applicazioni sicureSviluppo di applicazioni sicure
Sviluppo di applicazioni sicure
 

Último

LC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfLC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfpastor83
 
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...anilsa9823
 
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改atducpo
 
《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...
《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...
《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...ur8mqw8e
 
Reinventing Corporate Philanthropy_ Strategies for Meaningful Impact by Leko ...
Reinventing Corporate Philanthropy_ Strategies for Meaningful Impact by Leko ...Reinventing Corporate Philanthropy_ Strategies for Meaningful Impact by Leko ...
Reinventing Corporate Philanthropy_ Strategies for Meaningful Impact by Leko ...Leko Durda
 
文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改
文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改
文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改atducpo
 
Call Girls Anjuna beach Mariott Resort ₰8588052666
Call Girls Anjuna beach Mariott Resort ₰8588052666Call Girls Anjuna beach Mariott Resort ₰8588052666
Call Girls Anjuna beach Mariott Resort ₰8588052666nishakur201
 
Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝soniya singh
 
call girls in candolim beach 9870370636] NORTH GOA ..
call girls in candolim beach 9870370636] NORTH GOA ..call girls in candolim beach 9870370636] NORTH GOA ..
call girls in candolim beach 9870370636] NORTH GOA ..nishakur201
 
Independent Escorts in Lucknow (Adult Only) 👩🏽‍❤️‍💋‍👩🏼 8923113531 ♛ Escort S...
Independent Escorts in Lucknow  (Adult Only) 👩🏽‍❤️‍💋‍👩🏼 8923113531 ♛ Escort S...Independent Escorts in Lucknow  (Adult Only) 👩🏽‍❤️‍💋‍👩🏼 8923113531 ♛ Escort S...
Independent Escorts in Lucknow (Adult Only) 👩🏽‍❤️‍💋‍👩🏼 8923113531 ♛ Escort S...gurkirankumar98700
 
Lilac Illustrated Social Psychology Presentation.pptx
Lilac Illustrated Social Psychology Presentation.pptxLilac Illustrated Social Psychology Presentation.pptx
Lilac Illustrated Social Psychology Presentation.pptxABMWeaklings
 
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female serviceanilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual serviceanilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual serviceanilsa9823
 
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...PsychicRuben LoveSpells
 
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdfBreath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdfJess Walker
 
REFLECTIONS Newsletter Jan-Jul 2024.pdf.pdf
REFLECTIONS Newsletter Jan-Jul 2024.pdf.pdfREFLECTIONS Newsletter Jan-Jul 2024.pdf.pdf
REFLECTIONS Newsletter Jan-Jul 2024.pdf.pdfssusere8ea60
 
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girlsPooja Nehwal
 
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot And
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot AndCall Girls In Andheri East Call US Pooja📞 9892124323 Book Hot And
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot AndPooja Nehwal
 

Último (20)

LC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfLC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdf
 
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
 
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
 
《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...
《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...
《塔夫斯大学毕业证成绩单购买》做Tufts文凭毕业证成绩单/伪造美国假文凭假毕业证书图片Q微信741003700《塔夫斯大学毕业证购买》《Tufts毕业文...
 
Reinventing Corporate Philanthropy_ Strategies for Meaningful Impact by Leko ...
Reinventing Corporate Philanthropy_ Strategies for Meaningful Impact by Leko ...Reinventing Corporate Philanthropy_ Strategies for Meaningful Impact by Leko ...
Reinventing Corporate Philanthropy_ Strategies for Meaningful Impact by Leko ...
 
文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改
文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改
文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改
 
Call Girls Anjuna beach Mariott Resort ₰8588052666
Call Girls Anjuna beach Mariott Resort ₰8588052666Call Girls Anjuna beach Mariott Resort ₰8588052666
Call Girls Anjuna beach Mariott Resort ₰8588052666
 
Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Kalyan Vihar Delhi 💯 Call Us 🔝8264348440🔝
 
call girls in candolim beach 9870370636] NORTH GOA ..
call girls in candolim beach 9870370636] NORTH GOA ..call girls in candolim beach 9870370636] NORTH GOA ..
call girls in candolim beach 9870370636] NORTH GOA ..
 
Independent Escorts in Lucknow (Adult Only) 👩🏽‍❤️‍💋‍👩🏼 8923113531 ♛ Escort S...
Independent Escorts in Lucknow  (Adult Only) 👩🏽‍❤️‍💋‍👩🏼 8923113531 ♛ Escort S...Independent Escorts in Lucknow  (Adult Only) 👩🏽‍❤️‍💋‍👩🏼 8923113531 ♛ Escort S...
Independent Escorts in Lucknow (Adult Only) 👩🏽‍❤️‍💋‍👩🏼 8923113531 ♛ Escort S...
 
Lilac Illustrated Social Psychology Presentation.pptx
Lilac Illustrated Social Psychology Presentation.pptxLilac Illustrated Social Psychology Presentation.pptx
Lilac Illustrated Social Psychology Presentation.pptx
 
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
 
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
 
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
 
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
 
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdfBreath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
 
REFLECTIONS Newsletter Jan-Jul 2024.pdf.pdf
REFLECTIONS Newsletter Jan-Jul 2024.pdf.pdfREFLECTIONS Newsletter Jan-Jul 2024.pdf.pdf
REFLECTIONS Newsletter Jan-Jul 2024.pdf.pdf
 
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
 
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot And
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot AndCall Girls In Andheri East Call US Pooja📞 9892124323 Book Hot And
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot And
 

Password (in)security

  • 1. Password (in)security How to generate and store passwords in a secure way by Enrico “cerin0” Zimuel
  • 2. About me 1998 Enrico “cerin0” Zimuel Developer since Texas Instruments TI99/4A Research programmer, Informatics institute of UvA (Amsterdam) Core team of the open source project Zend Framework Co-author of the books “Segreti, Spie Codici Cifrati”, “Come si fa a usare la firma digitale”, “PHP Best Practices” Founder of the PHP User Group Torino http://www.zimuel.it
  • 3. Password A password is a secret word or string of characters that is used for authentication.
  • 4. User perspective: How to choose a “secure” password? Developer perspective: How to store a password in a secure way?
  • 5. Password security Basically every security system is based on password.
  • 7. linkedin.com Hack: 6th June 2012 More than 6 million passwords was compromised SHA1 password
  • 8. eharmony.com Hack: 6th June 2012 More than 1.5 million passwords was compromised SHA1 password
  • 9. last.fm Hack: 7th June 2012 ? million passwords was compromised MD5 password
  • 10. yahoo.com Hack: 12th June 2012 443K passwords was compromised SQL injection, password in plaintext!
  • 11. How to choose a “robust” user's password
  • 12.
  • 13. Some best practices: ● No personal information ● A long pass phrase is better than a shorter random jumble of characters ● At least 10 characters long ● Don't use the same password for everything ● Change your password from time to time
  • 15. Developers Force the user to generate robust password
  • 16. Developers How to store a password in a secure way?
  • 17. Old school (deprecated) Use hash algorithms like MD5 or SHA1
  • 18. New school (deprecated?) Use hash algorithm + salt (a random string).
  • 19. Using hash + salt Prevent dictionary attacks? YES Prevent brute force attacks? NO
  • 20. Brute forcing attacks CPU power is growing (multi-core) GPU are rendering password security useless Use a Cloud system (n-CPU)
  • 21. Brute forcing with a GPU Source: www.nvidia.com
  • 22. GPU and CUDA CUDA™ is a parallel computing platform and programming model invented by NVIDIA
  • 23. Extreme GPU Bruteforcer using NVIDIA GTS250 ~ $100 Algorithm Speed 8 chars 9 chars 10 chars md5($pass) 426 million p/s 6 days 1 year 62 years md5($pass.$salt) 170 million p/s 14 days 2 ½ years 156 years sha1($pass) 85 million p/s 29 days 5 years 313 years sha1($pass.$salt) 80 million p/s 31 days 5 years 332 years Password of 62 characters (a-z, A-Z, 0-9) Source: http://www.insidepro.com/eng/egb.shtml
  • 24. IGHASHGPU ATI HD 5970 ~ $700 Algorithm Speed 8 chars 9 chars 10 chars md5($pass) 5600 million p/s 10 hours 27 days 4 ½ years sha1($pass) 2300 million p/s 26 hours 68 days 11 ½ years Password of 62 characters (a-z, A-Z, 0-9) Source: http://www.golubev.com/hashgpu.htm
  • 25. Whitepixel 4 Dual HD 5970 ~ $2800 Algorithm Speed 8 chars 9 chars 10 chars md5($pass) 33 billion p/s 1 ½ hour 4 ½ days 294 days Password of 62 characters (a-z, A-Z, 0-9) Source: http://blog.zorinaq.com/?e=42
  • 26. Secure algorithms for password storing ●Hash + salt + stretching (i.e. PBKDF2) ● bcrypt ● scrypt
  • 27. Hash + salt + stretching ● Stretching = iterate (hash + salt) n-times key = ““ for 1 to n­times do   key = hash(key + password + salt)
  • 28. How to estimate the number of iterations? ●The number of iterations depends on the CPU speed, should take around 1 sec to be considered secure ● For instance, this PHP code: <?php $key=''; for ($i=0;$i<NUM_ITERATIONS;$i++) {     $key= hash('sha512',$key.$salt.$password); } runs in 900 ms with NUM_ITERATIONS= 40'000 using an Intel Core 2 at 2.1Ghz
  • 29. PBKDF2 ● PBKDF2 (Password-Based Key Derivation Function 2) is a key derivation function that is part of RSA Laboratories' Public-Key Cryptography Standards (PKCS) series, specifically PKCS #5 v2.0 ● PBKDF2 applies a pseudorandom function, such as a cryptographic hash, cipher, or HMAC to the input password or passphrase along with a salt value and repeats the process many times to produce a derived key, which can then be used as a cryptographic key in subsequent operations
  • 30. PBKDF2 in PHP PBKDF2 in PHP (Zend Framework 2.0) function calc($hash, $password, $salt, $iterations, $length) { $num = ceil($length / Hmac::getOutputSize($hash,  Hmac::OUTPUT_BINARY)); $result = ''; for ($block = 1; $block <= $num; $block++) { $hmac = Hmac::compute($password, $hash, $salt . pack('N',  $block), Hmac::OUTPUT_BINARY);     $mix = $hmac;     for ($i = 1; $i < $iterations; $i++) {     $hmac = Hmac::compute($password, $hash, $hmac,    Hmac::OUTPUT_BINARY);     $mix ^= $hmac;     }     $result .= $mix; } return substr($result, 0, $length); }
  • 31. bcrypt ● http://bcrypt.sourceforge.net/ ● bcrypt uses Blowfish cipher + iterations to generate secure hash values ● bcrypt is secure against brute force or dictionary attacks because is slow, very slow (that means attacks need huge amount of time to be completed)
  • 32. bcrypt parameters ●The algorithm needs a salt value and a work factor parameter (cost), which allows you to determine how expensive the bcrypt function will be ●The cost value depends on the CPU speed, check on your system! I suggest to set at least 1 second.
  • 33. bcrypt in PHP ● bcrypt is implemented in PHP with the crypt() function: $salt = substr(str_replace('+', '.',                 base64_encode($salt)), 0, 22);  $hash = crypt($password,'$2a$'.$cost.'$'.$salt); ● For instance, $password= 'thisIsTheSecretPassword' and $salt= 'hsjYeg/bxn()%3jdhsGHq0'   aHNqWWVnL2J4bigpJTNqZGhzR0hxMA==$a9c810e9c722af719adabcf50d b8a0b4cd0d14e07eddbb43e5f47bde620a3c13 Green= salt, Red= encrypted password
  • 34. scrypt ● http://www.tarsnap.com/scrypt.html ● scrypt is a sequential memory hard algorithm: ● memory-hard functions require high memory ● cannot be parallelized efficiently ● scrypt uses PBKDF2, HMAC-SHA256, Salsa 20/8 core
  • 35. scrypt security “From a test executed on modern (2009) hardware, if 5 seconds are spent computing a derived key, the cost of a hardware brute-force attack against scrypt is roughly 4000 times greater than the cost of a similar attack against bcrypt (to find the same password), and 20000 times greater than a similar attack against Pbkdf2." Colin Percival (the author of scrypt algorithm)
  • 36. Conclusion ● As user: Use only “robust” password (e.g. long pass phrase is better than a shorter random jumble of characters) Don't use the same password for different services ● As developer: Don't use hash or hash+salt to store a password! Use hash+salt+stretching (PBKDF2), bcrypt or scrypt to store your passwords
  • 37. References ● Colin Percival, Stronger Key Derivation via Sequential Memory-Hard Functions, presented at BSDCan'09, May 2009 ● Morris, Robert, Thompson, Ken, Password Security: A Case History, Bell Laboratories, 2011 ● Coda Hale, How to safely store a password, 2010 http://codahale.com/how-to-safely-store-a-password/ ● J. Kelsey, B. Schneier, C. Hall, and D. Wagner, Secure Applications of Low-Entropy Keys, nformation Security Workshop (ISW'97), 1997 ● Marc Bevand, Whitepixel breaks 28.6 billion password/sec http://blog.zorinaq.com/?e=42 ● Andrew Zonenberg, Distributed Hash Cracker: A Cross- Platform GPU-Accelerated Password Recovery System, 2009