SlideShare a Scribd company logo
Safe Passwords – In theory & practiceAkash MahajanWeb Security Consultant
@makash on Twitter
http://akashm.com@makash | akashm.com - That Web Application Security Guy
Something to think aboutIn Dec 2009 a hacker released 32 million passwords of the users of rockyou.comIt is a social gaming company.Those passwords were the 1st instance of such a huge number of passwords being available for analysis@makash | akashm.com |  That Web Application Security Guy
Something to think aboutA password analysis from rockyou.com revealedAll passwords were being stored in clear text!30% of the passwords were less than 6 characters60% of the passwords were a limited set of alphanumeric The most common password “123456”@makash | akashm.com |  That Web Application Security Guy
Something to think aboutOnly 0.2% of all the passwords were what would be considered strong. These passwords were longer than 8 charactersContained a mixture of special characters, numbers and both upper and lower case.23,000 passwords were set to “rockyou”But even for the 0.2% people with strong passwords it didn’t matter, the passwords were still being stored in clear text.Source: Imperva Consumer Passsword Practices report@makash | akashm.com |  That Web Application Security Guy
Protecting User InformationUser data protection has many different levels. This changes for financial data, medical data etc. At the minimum if we assume the worst wherein either the server is hacked or the database is copied the first level of protection will be encryption. Based on the type of encryption and the strength of the keys the original data can be recovered. @makash | akashm.com |  That Web Application Security Guy
Protecting User InformationIf our base goal is to protect the user login information stored in the database ( and not travelling over the wire/network ) then we need to use 1 way encryption ( also called hashing ) with a salt  ( a randomly generated seed value ). saltedhash(password) = hash(hash(password).salt)@makash | akashm.com |  That Web Application Security Guy
Different ways to store passwords in web appsPasswords in clear text.Simplest indicator, forgot password email will give you the password!Password is hashedNo way to get the original password back easily, forgot password will send a unique linkPassword is hashed with a static saltPassword is hashed with a dynamic salt@makash | akashm.com |  That Web Application Security Guy
@makash | akashm.com |  That Web Application Security GuyWhat is hashing?When we talk about hashing I mean “Cryptographic hash function” onlyFrom WikipediaA cryptographic hash function is a procedure that takes an arbitrary block of data and returns a fixed-size bit string, the (cryptographic) hash value, such that an accidental or intentional change to the data will change the hash value. The data to be encoded is often called the "message," and the hash value is sometimes called the message digest or simply digest.
@makash | akashm.com |  That Web Application Security GuyWhat is hashing?Ideally each digest/hash created by the hashing function is completely unique. The hashing is defined as 1 way encryption. Once you hash a message there is no way to get the original back from the digest/hash.Till today MD5 is popular for most basic web applications not storing sensitive data. But SHA-1 and SHA-256 are preferred if you are going to implement your application now.
Crypto Hash FunctionsThe most common ones being used for storing passwords areMD5 – 32 bit SHA-1  - 160 bit SHA-256 – 256 bitIf this all looks so secure and hi-fi why do we need to do anything else with passwords?@makash | akashm.com |  That Web Application Security Guy
What are Rainbow TablesA rainbow table is a precomputed table for reversing cryptographic hash functions, usually for cracking password hashes. Tables are usually used in recovering the plaintext password, up to a certain length consisting of a limited set of characters. It is a form of time-memory tradeoff, using less CPU at the cost of more storage. The basic defence is to employ a salt to make this attack infeasible.@makash | akashm.com |  That Web Application Security Guy
Project Rainbow CrackIt is easier than it soundsImage http://project-rainbowcrack.comTables can be downloaded from the same website. @makash | akashm.com |  That Web Application Security Guy
What is a salt?A salt consists of random bits consisting one of the inputs to a one-way function. The other input is usually a password or passphrase. The output of the one-way function can be stored rather than the password, and still be used for authenticating users. @makash | akashm.com |  That Web Application Security Guy
What is a salt?The benefit provided by using a salted password is rendering a simple dictionary attack against the stored values rather impractical provided the salt is large enough.Without salts, an attacker who is cracking many passwords at the same time only needs to hash each password guess once, and compare it to all the hashes. @makash | akashm.com |  That Web Application Security Guy
Clear text password attacksUsers reuse passwords, stolen passwords will be used to login to other websites. The attacker needs to just steal the database of the web application somehow. Once that is done the passwords and email user names will yield many more accounts. @makash | akashm.com |  That Web Application Security Guy
Hashed password; no salt attacksPasswords are stolen. The attacker has all the hashed passwords stored locally. All they need to do is run it against rainbow tables they have to get the original passwords. Considering the basic passwords people choose this will yield many account credentials to them. @makash | akashm.com |  That Web Application Security Guy
Hashed password; static salt attacksAttacker steals database.They will need to steal the static salt present in the source code of the application. Once they have that then they can run their rainbow tables to get the original passwords.@makash | akashm.com |  That Web Application Security Guy
Hashed password; static salt attacksBased on the length of the salt the storage of rainbow tables can become very hugeFor a salt with 12 bits 4096 possible salt values. Therefore 4096 rainbow tables at least. @makash | akashm.com |  That Web Application Security Guy

More Related Content

What's hot (12)

PPS
Information Gathering With Google
Zero Science Lab
 
PDF
The life of breached data and the attack lifecycle
Jarrod Overson
 
PDF
Google Dorks: Analysis, Creation, and new Defenses
Flavio Toffalini
 
PDF
Automated security analysis of aws clouds v1.0
CSA Argentina
 
PPTX
Cloud security best practices in AWS by: Ankit Giri
OWASP Delhi
 
PPTX
Breaking out of crypto authentication
Mohammed Adam
 
PPTX
VodQA3_PenetrationTesting_AmitDhakkad
vodQA
 
PPTX
Why API Security Is More Complicated Than You Think (and Why It’s Your #1 Pri...
ProgrammableWeb
 
PPTX
Php security
Akash Mahajan
 
PPTX
Web site hacking;what does it mean
MetaKave
 
PDF
Attacking Web Applications
Sasha Goldshtein
 
PDF
Enterprise Password Worst Practices
Imperva
 
Information Gathering With Google
Zero Science Lab
 
The life of breached data and the attack lifecycle
Jarrod Overson
 
Google Dorks: Analysis, Creation, and new Defenses
Flavio Toffalini
 
Automated security analysis of aws clouds v1.0
CSA Argentina
 
Cloud security best practices in AWS by: Ankit Giri
OWASP Delhi
 
Breaking out of crypto authentication
Mohammed Adam
 
VodQA3_PenetrationTesting_AmitDhakkad
vodQA
 
Why API Security Is More Complicated Than You Think (and Why It’s Your #1 Pri...
ProgrammableWeb
 
Php security
Akash Mahajan
 
Web site hacking;what does it mean
MetaKave
 
Attacking Web Applications
Sasha Goldshtein
 
Enterprise Password Worst Practices
Imperva
 

Similar to Secure passwords-theory-and-practice (20)

PPTX
Password Storage Sucks!
nerdybeardo
 
PDF
Passwords good badugly181212-2
Iftach Ian Amit
 
PPTX
Securing Passwords
Mandeep Singh
 
PPTX
Hashing Considerations In Web Applications
Islam Heggo
 
ODP
User Credential handling in Web Applications done right
tladesignz
 
ODP
Passwords
Kevin OBrien
 
PDF
A Survey of Password Attacks and Safe Hashing Algorithms
IRJET Journal
 
ODP
An Introduction to Hashing and Salting
Rahul Singh
 
ODP
Disclosing password hashing policies
Michal Špaček
 
ODP
Password Attack
Aliaqa Hosainy
 
PPTX
FYP1 Presentation
faeezfez
 
PPTX
How to Use Cryptography Properly: Common Mistakes People Make When Using Cry...
All Things Open
 
PDF
Password hashing, salting, bycrpt
Ahmad karawash
 
ODP
All Your Password Are Belong To Us
Charles Southerland
 
PDF
Hacknbeers sqli and cryptography
Miguel Ibarra
 
PPTX
Techniques for password hashing and cracking
Nipun Joshi
 
PDF
Protecting Your Clients' Privacy
Aijaz Ansari
 
PDF
Cracking Salted Hashes
n|u - The Open Security Community
 
PDF
Implementation of rainbow tables to crack md5 codes
Khadidja BOUKREDIMI
 
PPTX
Password Cracking
Rahul Sharma
 
Password Storage Sucks!
nerdybeardo
 
Passwords good badugly181212-2
Iftach Ian Amit
 
Securing Passwords
Mandeep Singh
 
Hashing Considerations In Web Applications
Islam Heggo
 
User Credential handling in Web Applications done right
tladesignz
 
Passwords
Kevin OBrien
 
A Survey of Password Attacks and Safe Hashing Algorithms
IRJET Journal
 
An Introduction to Hashing and Salting
Rahul Singh
 
Disclosing password hashing policies
Michal Špaček
 
Password Attack
Aliaqa Hosainy
 
FYP1 Presentation
faeezfez
 
How to Use Cryptography Properly: Common Mistakes People Make When Using Cry...
All Things Open
 
Password hashing, salting, bycrpt
Ahmad karawash
 
All Your Password Are Belong To Us
Charles Southerland
 
Hacknbeers sqli and cryptography
Miguel Ibarra
 
Techniques for password hashing and cracking
Nipun Joshi
 
Protecting Your Clients' Privacy
Aijaz Ansari
 
Cracking Salted Hashes
n|u - The Open Security Community
 
Implementation of rainbow tables to crack md5 codes
Khadidja BOUKREDIMI
 
Password Cracking
Rahul Sharma
 
Ad

More from Akash Mahajan (16)

PDF
On Writing Well - A talk given at WinjaBlogs Session
Akash Mahajan
 
PDF
App sec in the time of docker containers
Akash Mahajan
 
PPTX
Venom vulnerability Overview and a basic demo
Akash Mahajan
 
PPTX
Security in the cloud Workshop HSTC 2014
Akash Mahajan
 
ODP
INCOMPLETE - OUTLINE for RootConf 2014 - The little-servcie-which-wasn't-there
Akash Mahajan
 
PPTX
The real incident of stealing a droid app+data
Akash Mahajan
 
PPTX
Believe It Or Not SSL Attacks
Akash Mahajan
 
PPTX
I haz your mouse clicks and key strokes
Akash Mahajan
 
PPTX
Hackers versus Developers and Secure Web Programming
Akash Mahajan
 
PPTX
Secure HTTP Headers c0c0n 2011 Akash Mahajan
Akash Mahajan
 
PDF
Top 10 web application security risks akash mahajan
Akash Mahajan
 
PDF
Web application security
Akash Mahajan
 
PPTX
Web application security
Akash Mahajan
 
PPTX
Web application security
Akash Mahajan
 
PPTX
Secure Programming In Php
Akash Mahajan
 
PPT
Startups Security
Akash Mahajan
 
On Writing Well - A talk given at WinjaBlogs Session
Akash Mahajan
 
App sec in the time of docker containers
Akash Mahajan
 
Venom vulnerability Overview and a basic demo
Akash Mahajan
 
Security in the cloud Workshop HSTC 2014
Akash Mahajan
 
INCOMPLETE - OUTLINE for RootConf 2014 - The little-servcie-which-wasn't-there
Akash Mahajan
 
The real incident of stealing a droid app+data
Akash Mahajan
 
Believe It Or Not SSL Attacks
Akash Mahajan
 
I haz your mouse clicks and key strokes
Akash Mahajan
 
Hackers versus Developers and Secure Web Programming
Akash Mahajan
 
Secure HTTP Headers c0c0n 2011 Akash Mahajan
Akash Mahajan
 
Top 10 web application security risks akash mahajan
Akash Mahajan
 
Web application security
Akash Mahajan
 
Web application security
Akash Mahajan
 
Web application security
Akash Mahajan
 
Secure Programming In Php
Akash Mahajan
 
Startups Security
Akash Mahajan
 
Ad

Recently uploaded (20)

PDF
Build with AI and GDG Cloud Bydgoszcz- ADK .pdf
jaroslawgajewski1
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
PDF
Market Insight : ETH Dominance Returns
CIFDAQ
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
PDF
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PPTX
Agile Chennai 18-19 July 2025 | Workshop - Enhancing Agile Collaboration with...
AgileNetwork
 
Build with AI and GDG Cloud Bydgoszcz- ADK .pdf
jaroslawgajewski1
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
Market Insight : ETH Dominance Returns
CIFDAQ
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
The Future of Artificial Intelligence (AI)
Mukul
 
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Agile Chennai 18-19 July 2025 | Workshop - Enhancing Agile Collaboration with...
AgileNetwork
 

Secure passwords-theory-and-practice

  • 1. Safe Passwords – In theory & practiceAkash MahajanWeb Security Consultant
  • 4. Something to think aboutIn Dec 2009 a hacker released 32 million passwords of the users of rockyou.comIt is a social gaming company.Those passwords were the 1st instance of such a huge number of passwords being available for analysis@makash | akashm.com | That Web Application Security Guy
  • 5. Something to think aboutA password analysis from rockyou.com revealedAll passwords were being stored in clear text!30% of the passwords were less than 6 characters60% of the passwords were a limited set of alphanumeric The most common password “123456”@makash | akashm.com | That Web Application Security Guy
  • 6. Something to think aboutOnly 0.2% of all the passwords were what would be considered strong. These passwords were longer than 8 charactersContained a mixture of special characters, numbers and both upper and lower case.23,000 passwords were set to “rockyou”But even for the 0.2% people with strong passwords it didn’t matter, the passwords were still being stored in clear text.Source: Imperva Consumer Passsword Practices report@makash | akashm.com | That Web Application Security Guy
  • 7. Protecting User InformationUser data protection has many different levels. This changes for financial data, medical data etc. At the minimum if we assume the worst wherein either the server is hacked or the database is copied the first level of protection will be encryption. Based on the type of encryption and the strength of the keys the original data can be recovered. @makash | akashm.com | That Web Application Security Guy
  • 8. Protecting User InformationIf our base goal is to protect the user login information stored in the database ( and not travelling over the wire/network ) then we need to use 1 way encryption ( also called hashing ) with a salt  ( a randomly generated seed value ). saltedhash(password) = hash(hash(password).salt)@makash | akashm.com | That Web Application Security Guy
  • 9. Different ways to store passwords in web appsPasswords in clear text.Simplest indicator, forgot password email will give you the password!Password is hashedNo way to get the original password back easily, forgot password will send a unique linkPassword is hashed with a static saltPassword is hashed with a dynamic salt@makash | akashm.com | That Web Application Security Guy
  • 10. @makash | akashm.com | That Web Application Security GuyWhat is hashing?When we talk about hashing I mean “Cryptographic hash function” onlyFrom WikipediaA cryptographic hash function is a procedure that takes an arbitrary block of data and returns a fixed-size bit string, the (cryptographic) hash value, such that an accidental or intentional change to the data will change the hash value. The data to be encoded is often called the "message," and the hash value is sometimes called the message digest or simply digest.
  • 11. @makash | akashm.com | That Web Application Security GuyWhat is hashing?Ideally each digest/hash created by the hashing function is completely unique. The hashing is defined as 1 way encryption. Once you hash a message there is no way to get the original back from the digest/hash.Till today MD5 is popular for most basic web applications not storing sensitive data. But SHA-1 and SHA-256 are preferred if you are going to implement your application now.
  • 12. Crypto Hash FunctionsThe most common ones being used for storing passwords areMD5 – 32 bit SHA-1 - 160 bit SHA-256 – 256 bitIf this all looks so secure and hi-fi why do we need to do anything else with passwords?@makash | akashm.com | That Web Application Security Guy
  • 13. What are Rainbow TablesA rainbow table is a precomputed table for reversing cryptographic hash functions, usually for cracking password hashes. Tables are usually used in recovering the plaintext password, up to a certain length consisting of a limited set of characters. It is a form of time-memory tradeoff, using less CPU at the cost of more storage. The basic defence is to employ a salt to make this attack infeasible.@makash | akashm.com | That Web Application Security Guy
  • 14. Project Rainbow CrackIt is easier than it soundsImage http://project-rainbowcrack.comTables can be downloaded from the same website. @makash | akashm.com | That Web Application Security Guy
  • 15. What is a salt?A salt consists of random bits consisting one of the inputs to a one-way function. The other input is usually a password or passphrase. The output of the one-way function can be stored rather than the password, and still be used for authenticating users. @makash | akashm.com | That Web Application Security Guy
  • 16. What is a salt?The benefit provided by using a salted password is rendering a simple dictionary attack against the stored values rather impractical provided the salt is large enough.Without salts, an attacker who is cracking many passwords at the same time only needs to hash each password guess once, and compare it to all the hashes. @makash | akashm.com | That Web Application Security Guy
  • 17. Clear text password attacksUsers reuse passwords, stolen passwords will be used to login to other websites. The attacker needs to just steal the database of the web application somehow. Once that is done the passwords and email user names will yield many more accounts. @makash | akashm.com | That Web Application Security Guy
  • 18. Hashed password; no salt attacksPasswords are stolen. The attacker has all the hashed passwords stored locally. All they need to do is run it against rainbow tables they have to get the original passwords. Considering the basic passwords people choose this will yield many account credentials to them. @makash | akashm.com | That Web Application Security Guy
  • 19. Hashed password; static salt attacksAttacker steals database.They will need to steal the static salt present in the source code of the application. Once they have that then they can run their rainbow tables to get the original passwords.@makash | akashm.com | That Web Application Security Guy
  • 20. Hashed password; static salt attacksBased on the length of the salt the storage of rainbow tables can become very hugeFor a salt with 12 bits 4096 possible salt values. Therefore 4096 rainbow tables at least. @makash | akashm.com | That Web Application Security Guy
  • 21. Hashed password; dynamic salt attacksPasswords are stolen. The attacker has all the hashed passwords stored locally. Now to check against each and every hashed password they need to generate a dynamic salt for each user entry.Even if two users have the same password after hashing with dynamic salt the hash created will look completely different. @makash | akashm.com | That Web Application Security Guy
  • 22. Questions?Any questionsAbout meAkash Mahajan ( google me )That Web Application Security GuyWeb Security Consultant@makash on Twitter || http://akashm.com@makash | akashm.com - That Web Application Security Guy