TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 04-26-2008, 07:44 PM   #21 (permalink)
The Wanderer
 
Join Date: Feb 2008
Posts: 15
Thanks: 2
Mathew is on a distinguished road
Default

I generate the dynamic hash from something that changes its value all the time. microtime() will do the trick here.

Also, you never unhash a password already hashed, what you want to do is hash the input password with the same algorithm and see if the passwords match each other.

Yes, I store the dynamic hash value in a field with in the users table row.
Mathew is offline  
Reply With Quote
Old 04-26-2008, 08:07 PM   #22 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

Yeah, I wrote that really quick on my way out the door to school. I worded myself wrong regarding "unhashing". So technically if a hacker gets your users table, they have part of the salt too, but chances are they don't even realize it, as I'm willing to bet you don't name it "password_salt".
-m
delayedinsanity is offline  
Reply With Quote
Old 04-26-2008, 08:15 PM   #23 (permalink)
The Wanderer
 
Join Date: Feb 2008
Posts: 15
Thanks: 2
Mathew is on a distinguished road
Default

If they got the users table along with the static hash, it would be virtually impossible for them to brute force the passwords anyway.

Since I am using microtime as a dynamic salt, if they wanted to try and brute force the passwords they would have to try each possible value that microtime can produce.

delayedinsanity : It would not matter what the column was named. If they were smart enough to hack into the database I do not think a renamed hash column would confuse them.
Mathew is offline  
Reply With Quote
Old 04-26-2008, 08:20 PM   #24 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

Well why couldn't it? If you used a regular unix timestamp or even mysql's datetime, which you could then translate into the timestamp, as your dynamic hash and had it stored in a field which was called say, "registered_on", how do they know you're using that as a salt? It just looks like you're recording the timestamp of when they signed up.

Security isn't just locking the door, sometimes it's making the door hard to find.
-m
delayedinsanity is offline  
Reply With Quote
Old 04-27-2008, 10:26 PM   #25 (permalink)
The Addict
 
sarmenhb's Avatar
 
Join Date: Jan 2008
Location: los angeles
Posts: 309
Thanks: 44
sarmenhb is on a distinguished road
Default

as for the formula that they use i doupt anyone knows that because its a secret, well unless you work for them.

its probably sha1 or something stronger but i dont think there are people out there trying to crack md5 or sha1 encryptions unless they have a real good reason.

so unless your trying to run something that stores a users account information that has to deal with money or very very personal information like social security etc.. then i wouldnt worry about making your database too security proof.

unless you get people from ha.ckers.org web application security lab trying to penetrate your web app and tell everyone about it

then i wouldnt worry so much.
__________________
no signature set
sarmenhb is offline  
Reply With Quote
Old 04-28-2008, 03:36 PM   #26 (permalink)
The Wanderer
 
blayne4k's Avatar
 
Join Date: Apr 2008
Location: Trapped in my own little world.
Posts: 14
Thanks: 0
blayne4k is on a distinguished road
Default

Quote:
Originally Posted by Mathew View Post
For my projects I use a combination of 2 salts (1 Static, 1 Dynamic). When a user registers to my website the backend will generate a random salt key for each user. Even if 2 different users register to my website with the same password, the resulting hash will be different.

So if the database was ever hacked or stolen, they would be missing the static salt key, thus it would prove to be impossible for them to bruteforce any of the passwords.

However I'll touch wood, just incase.
they could still brute force it, but they would need the salt in order to get it, they would see $password.$salt they could just start taking things off and see what happens. Even tho im sure nobody is stupid enough to just take the database without looking at the files. There is always something important there.
blayne4k is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 11:18 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design