Passwords Posted by: John in Untagged  on
Passwords are our digital fingerprints. Shouldn't they be as secure as we want them? Apparently some websites don't think so.


How are our passwords stored?
Most websites store users passwords as an md5 (message digest 5) hash. Essentially, your plain text password is passed through a function that hashes your password. That hash is stored in the websites database. Since md5 is a one way hashing algorithm (there is no way to convert the md5 hash in the database back to your plain text password), password validation is done by comparing an md5 input and the md5 stored in the database. If the two match, you have successfully logged in.

In PHP, a basic authentication system might look similar to the following:

 
  1. $input = md5($_GET['password']);
  2. $username = clean($_GET['username']);
  3. $result = mysql_query(“SELECT `password` FROM `my_table` WHERE `user` = {$username});
  4. $row = mysql_fetch_assoc($result);
  5. if($input == $row['password']) {
  6.     echo “Valid password!;
  7. }


Even though this method has been the main stream method of storing passwords for years, the md5 hash has not been reversed. However, crackers have created whats called “rainbow tables.”

What are rainbow tables?
Rainbow tables are essentially a large database that contains plain text passwords and its corresponding md5 hash. If a cracker performs an SQL injection on your website and is able to discover your websites user table (containing their password hashes), a lot of these hashes will be stored in the rainbow table thus allowing the intruder to gain access to users accounts.

As a result of rainbow tables, most easy passwords are more insecure now than ever before. Gone are the days of crackers sitting at their PC's attempting to guess your password by trying your wifes first name. As a result, I have come up with an eleven character password containing uppercase and lowercase characters along with numbers and special characters. Ten of the characters are of my Windows XP cd key; since I had to reinstall Windows so many times, I memorized my CD key " at least Windows is good for something, a password!

If you are like me, you are probably registered with several forums and other websites. Of which, you use the same password and attempt to use the same username. However, it seems 95% of the time, some user has already registered your username and you are forced to append some number to the end " thus forcing you to remember several usernames. At least you only have one password to remember " right? No! I have recently come across three websites that rejected my password because it was either too long or contained a special character. In leet speak WTF??!!one1. My secure password, my digital fingerprint, is rejected? I cannot fathom why.
Trackback(0)
feed6 Comments
James
August 18, 2008
99.236.71.191
Votes: +0

Well written, great job. smilies/smiley.gif I have no idea why some websites don't allow very secure passwords. I always thought they didn't allow special characters and punctuation as a security precaution.

I use a password generator to create my passwords, and change them quite often. I haven't changed them in awhile though. smilies/sad.gif

report abuse
vote down
vote up
TkTech
August 18, 2008
69.156.76.41
Votes: +0

I remember you asking me about rainbow tables smilies/cheesy.gif
Most of the sites out there that offer pre-made tables have brute force rainbow tables, not just common words. The only thing you can do is try to prevent someone from gaining access to the table and to write smart rules to prevent large amounts of queries from a single source. For example try logging in to many times with an invalid password on the forum. Eventually it'll reject your attempts to login for 15 minutes.

report abuse
vote down
vote up
Phil
August 18, 2008
67.54.207.103
Votes: +0

I was shocked to discover these rainbow tables last year, and 2 major sites that I have backend access to use the typical method, and have sql injection vulnerabilities (which the other admins continue to overlook).

I now keep a written password book with all of my secure passwords. My passwords are generated through a password generator, and I've memorized many of them, but I am constantly being forced into making more passwords for sites that I don't quite trust.

Great article!

report abuse
vote down
vote up
Jordan
August 19, 2008
63.211.21.46
Votes: +0

I use several variations of several passwords that I use depending on the site. For instance, if I am registering on a site to download something and I don't expect to ever return I'll use a fairly easy to crack password (7 chars, two special characters). However, if I am using something like paypal my password is a bit more complex (11-13 characters with 4-5 special chars and numbers/characters). Most sites I need to login to have different passwords. TotalPenguin and CodeCall don't even have the same password for me.

I've never heard of Rainbox Tables. That was a great read and well written! Nice work.

report abuse
vote down
vote up
TkTech
August 26, 2008
69.156.76.41
Votes: +0

Rainbow tables!
And although the term is relatively new, the concept has been around since time began. By the way Jordan, giving me the details you just did, you realize you sliced the time for me to compute your password by almost a million exponential units?
smilies/smiley.gif

report abuse
vote down
vote up
Jordan
August 26, 2008
63.211.21.46
Votes: +0

Yea, I realized that after I hit Add Comment. I haven't made my way back into the DB to change it since there is no edit button here.

report abuse
vote down
vote up

Write comment
 
 
quote
bold
italicize
underline
strike
url
image
quote
quote
smile
wink
laugh
grin
angry
sad
shocked
cool
tongue
kiss
cry
smaller | bigger
 

security image
Write the displayed characters


busy