Image
 
linkedin_logo.png rss_logo.jpg
twitter_logo.png youtube_logo.jpg
Latest Additions
 
EH-Net Login
Welcome Guest.






Lost Password?
No account yet? Register
Who's Online
We have 31 guests and 3 members online
 
Advertisement

You are here: Home arrow Ethical Hacking Discussions and Related Certificationsarrow Programmingarrow Web Application Password Security
EH-Net
May 22, 2013, 11:56:11 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Go back to The Ethical Hacker Network Online Magazine Home Page
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Web Application Password Security  (Read 9439 times)
0 Members and 1 Guest are viewing this topic.
Knb15
Jr. Member
**
Offline Offline

Posts: 50


View Profile
« on: January 25, 2011, 07:42:31 PM »

Hey guys,

I have developed a web application for work, used PHP for the server side and just HTML/CSS client side.

My question revolves around the fact that i store the user passwords on a MySQL db. These passwords are hashed before being inserted into the db, so that the db contains the hashes, not the actual passwords.

I stumbled upon a blog about "secure hashes in PHP using salt" (http://pbeblog.wordpress.com/2008/02/12/secure-hashes-in-php-using-salt/). At first i was interested because i happen to work for a group of individuals who are not computer savvy. They have trouble remembering the simplest of passwords.

The idea of the blogger is to add a salt to the simple password a user may choose, and that salt will make the easy password a stronger password if a strong salt is used. (not a new idea)

I agree that it is better to save hashes of the password to the database and not the actual password.

However, from how i looked at it, i can't see how using a salt can help strengthen a password in order to help prevent brute forcing or dictionary attacks.

For instance, USER1's password is "dummy", password is hashed using MD5 with a salt of "!@#$" and stored in the DB.

Now to access the account, USER1 supplies the username and types his password, "dummy". The php application applies the salt and hashes it, then checks DB for match, which it does, so USER1 is logged in.

My point is, the salt here doesn't help to make a sloppy password stronger if the same salt is applied to any password supplied. If i eventually guess that the password is dummy and supply it, it doesn't matter that i don't know what the salt is.

My question is, is that the only way the salt can be used? To help secure the password in the DB? Or is there another use to it that does help make a password stronger?

If it did help i suppose other applications wouldn't have such stringent password complexity requirements. They would just accept any weak password and apply a strong salt to it. Doesn't seem right unless it can be used in a way i am not aware of.

Appreciate any input.

Thanks!

Knb
Logged
H1t M0nk3y
Hero Member
*****
Offline Offline

Posts: 864



View Profile
« Reply #1 on: January 26, 2011, 02:12:56 PM »

Knb15,

Two things:

1) Salts are very effective against rainbow tables. Since these tables pre-hash a lot of possible passwords before hand, they would find "dummy" is seconds. But if you add a good salt, they simply won't work (well, the vast majority of the time).

2) They make passwords longer (if the salt is unknown to the attacker). For example, if an attacker gets your database dump from, let say, SQL Injection and he doesn't access to your PHP source code, it will be much harder for him to break "!@#$dummy" than just "dummy". But if he gets access to your source code and find the salt, he still has to go for a brute force attack and can't use rainbow tables.

Hope this answered your question.
Logged

OSCP, GPEN, GWAPT, GSEC, CEH, CISSP
Knb15
Jr. Member
**
Offline Offline

Posts: 50


View Profile
« Reply #2 on: January 27, 2011, 02:50:58 PM »

Yes it did. Thank you H1t Monk3y!
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.565 seconds with 23 queries.
 
Exclusive Deal

sansfire13_245x90_cw90.jpg
SANSFIRE 2013
June 15 - 22

5% Off w/ Code: EHN_5

SANS Deals 4 EH-Netters
5% OFF Any SANS Course in Any Format!
Coupon Code: EHN_5 Including SANS Rocky Mountain 2013 & SANS Boston 2013
Polls
Compared to this year, 2013 will be:
 
Recent Forum Topics
EH-Net News Feeds
Latest Additions
 
         
Free Business and Tech Magazines and eBooks

© 2013 The Ethical Hacker Network
Joomla! is Free Software released under the GNU/GPL License.