ShadowTiger wrote:BTW my suggestion was NOT to store the salt in the database, but rather to calculate the salt using an algorithm. This would force the hacker to try every possible salt.
steelcity_ballin wrote:One MD5s biggest problems is the fact that two completely different passwords can potentially generate the same exact hash. To account for this, you salt the password with some other fields further lessening the likelihood. Some salts can be a combination of fields for the same user such as the Id in the database, really any field(s). So when the user enters their password "Phoenix123", perhaps search the database for their username and password, salting the password as MD5(MyUserName+Phoenix123) and find the match, for example.
steelcity_ballin wrote:The real trick is to make the operation too expensive to be feasible via brute force. I read an article the other day that stated that you can easily buy/rent cloud computer power in the thousands of CPUs for pretty cheap. Consider the Gawker incident recently; they were not able to, in their own time table, to break any password over 8 characters because it was too expensive. They did manage to get a ridiculous number of accounts that were
A) not salted
B) hashed with DES (old, out dated, inappropriate)
C) weak passwords [less than 8 characters]
AMM wrote:ShadowTiger wrote:BTW my suggestion was NOT to store the salt in the database, but rather to calculate the salt using an algorithm. This would force the hacker to try every possible salt.
But you can't assume your algorithm is going to be secure. If they have access to your database, then they may well have access to your algorithms.
Or just run strings on the binary...ShadowTiger wrote:game server exe written in C++, which somewhere in the code has the password for the database hard coded into it. The thief would not have access to the source code, but could decompile the executable perhaps.
Digest::SHA1.hexdigest(password + salt)
irb(main):001:0> require 'digest'
irb(main):002:0> password = "s3cr3tpa4xw0rd"
irb(main):003:0> salt = password.object_id.to_s + rand.to_s
irb(main):004:0> #the object_id used in the tutorial is the temporary object that this data will be mapped to through its ORM, not the way it's shown here.
irb(main):005:0* hash = Digest::SHA1.hexdigest(password + salt)
irb(main):006:0> new_password = "hunter2"
irb(main):008:0> hash == Digest::SHA1.hexdigest(new_password + salt)
irb(main):009:0> new_password = "s3cr3tpa4xw0rd"
irb(main):010:0> hash == Digest::SHA1.hexdigest(new_password + salt)
ShadowTiger wrote:I am smart. I know that MD5s can be brute forced. I know that even if I salt my passwords, those salts can be reversed because apparently a large percentage of my passwords are going to be very weak. It is not too much more work to run a rainbow table or a brute force hash on the password "password" and find out what salt i am using. If my salts are dynamic then they can use multiple results for "password" and figure out my algorithm.
Users browsing this forum: No registered users and 3 guests