Something I don't get about passwords stored in databases. And hacking them.

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Locut0s

Lifer
Nov 28, 2001
22,281
43
91
Encryption/Decryption has a ton of overhead - so encrypting "everything" isn't always the best idea. I've worked on authentication databases getting thousands of queries per second. The standard is a seeded hash. But it's only meant to temporarily slow an attacker down.

Wow I had no idea such databases would see that kind of load.
 

manlymatt83

Lifer
Oct 14, 2005
10,053
44
91
Wow I had no idea such databases would see that kind of load.

It isn't just about logging in and logging out. Many of these databases tend to be relational databases for things like websites - and not only does access get checked on login/logout, but ALSO on page loads. Imagine if you were a member of an internet forum and got banned. That ban would likely take effect immediately, right? Not on your next login attempt So there are queries going to these databases for things like "Does this user still have this access?". Sure, there are messaging busses and a slew of other ways to get around constant SQL queries, but that tends to be how things are designed.

For most UNIX systems, they'll tend to use some kind of LDAP for authentication back-end. Not only are there queries on every login, but likely queries on almost every command the person types.. to look up a user ID of another user, etc. etc. Meta data of sorts.

So yeah, I've seen relational databases that *just* power authentication for big products handling 5000-6000 queries per second (which is actually tiny for a relational database). And then there's the LDAP servers which get slammed even more than that with "searches".
 

Locut0s

Lifer
Nov 28, 2001
22,281
43
91
It isn't just about logging in and logging out. Many of these databases tend to be relational databases for things like websites - and not only does access get checked on login/logout, but ALSO on page loads. Imagine if you were a member of an internet forum and got banned. That ban would likely take effect immediately, right? Not on your next login attempt So there are queries going to these databases for things like "Does this user still have this access?". Sure, there are messaging busses and a slew of other ways to get around constant SQL queries, but that tends to be how things are designed.

For most UNIX systems, they'll tend to use some kind of LDAP for authentication back-end. Not only are there queries on every login, but likely queries on almost every command the person types.. to look up a user ID of another user, etc. etc. Meta data of sorts.

So yeah, I've seen relational databases that *just* power authentication for big products handling 5000-6000 queries per second (which is actually tiny for a relational database). And then there's the LDAP servers which get slammed even more than that with "searches".

Interesting, thanks for the info
 

L1FE

Senior member
Dec 23, 2003
545
0
71
The warning from Valve was probably more for liability/PR purposes as opposed to any imminent threat on someone cracking the entire set of passwords retrieved from the database. That being said, so many people use simple/dictionary passwords that they're bound to get into one or two accounts just by knowing the user names and trying something like "password."

As for encrypting/decrypting everything - that shit is expensive. Depending on the algorithm and how many rounds it is applied on the password, encryption can take a long time. For instance, bcrypt with 10 rounds = less than a second, but brcypt with 15 rounds takes a good two minutes. Sure, 15 rounds is much more secure, but is it really worth it? Especially if half your dumbass users use "password" or their username as the password.

Just a note on how often a database is queried for credentials - most scalable websites use a good caching/session handling mechanism to handle user requests. It's impractical and expensive to go back to the database on every request for a secure site. Instead, when user data changes, sessions or cache is invalidated so that on the next request the user is re-queried...
 

Modelworks

Lifer
Feb 22, 2007
16,240
7
76
Two different protections were in place. Account and email information was using normal AES type stuff . Financial information was AES + salt , with a unique salt for each account.
The chances of anyone using the credit card information is next to zero, but they had to warn users anyway. The account information is much much more likely to be compromised because it is simple AES cracking which a gpu can do very quickly.

The biggest threat is people that use the same password for lots of sites. STOP DOING THAT! .

Worst case:
You use the same password with multiple sites. They get your password, download your email, find emails to banks, ebay, paypal and more which they can now login to thanks to using the same password across the internet.

I can't stress this enough, don't use that same password on more than 1 place. I know so many people, probably 4 out of 5 that use the same password everywhere.

I wish them luck brute forcing my steam password, it is 384 bits long.
 
Last edited:

Demo24

Diamond Member
Aug 5, 2004
8,357
9
81
Can someone explain to me what 'salted' is?


I'm also guilty of the 1 password for many sites, got too many accounts my password list would be a mile long :'(. Although all my important stuff is on separate passwords, like bank and email so I'll probably be fine.
 

L1FE

Senior member
Dec 23, 2003
545
0
71
Can someone explain to me what 'salted' is?


I'm also guilty of the 1 password for many sites, got too many accounts my password list would be a mile long :'(. Although all my important stuff is on separate passwords, like bank and email so I'll probably be fine.

Basically, the "salt" is added to your password prior to hashing to add another layer of security. For instance, say your password is "password" and using a standard hashing algorithm, the token stored in your database is "1234567." If someone got a hold of your database and had a rainbow table (pre-computed lookup table) for your algo, they'd easily be able to lookup the dictionary word "password" and match it up with "1234567."

With a salt (the more complex, the better), however, "password" + salt might be hashed to "7364521," which would not be a valid hit in the rainbow table. This makes brute force/rainbow hacking much more difficult.

Hope that makes sense...
 

Demo24

Diamond Member
Aug 5, 2004
8,357
9
81
Basically, the "salt" is added to your password prior to hashing to add another layer of security. For instance, say your password is "password" and using a standard hashing algorithm, the token stored in your database is "1234567." If someone got a hold of your database and had a rainbow table (pre-computed lookup table) for your algo, they'd easily be able to lookup the dictionary word "password" and match it up with "1234567."

With a salt (the more complex, the better), however, "password" + salt might be hashed to "7364521," which would not be a valid hit in the rainbow table. This makes brute force/rainbow hacking much more difficult.

Hope that makes sense...


Yup, thanks! :thumbsup:
 

Jeff7

Lifer
Jan 4, 2001
41,599
19
81
Can someone explain to me what 'salted' is?


I'm also guilty of the 1 password for many sites, got too many accounts my password list would be a mile long :'(. Although all my important stuff is on separate passwords, like bank and email so I'll probably be fine.
And of course, adding to this problem are the sites that require you to register to do damn near anything, or the ones that won't let you go through the checkout unless you register "for future convenience."
 

Nintendesert

Diamond Member
Mar 28, 2010
7,761
5
0
I figure a good idea would be to use something like KeePass and remember that one password and creating individual ones for each site and simply storing them inside keepass.

It's so very tempting to use the same one for each login.

Also when a site has the option for using your mobile device to get access to the account you should use it. It's a one time password and pretty secure. Nobody is going to get your cell and then try to access your bank or gmail etc.
 

Locut0s

Lifer
Nov 28, 2001
22,281
43
91
Two different protections were in place. Account and email information was using normal AES type stuff . Financial information was AES + salt , with a unique salt for each account.
The chances of anyone using the credit card information is next to zero, but they had to warn users anyway. The account information is much much more likely to be compromised because it is simple AES cracking which a gpu can do very quickly.

The biggest threat is people that use the same password for lots of sites. STOP DOING THAT! .

Worst case:
You use the same password with multiple sites. They get your password, download your email, find emails to banks, ebay, paypal and more which they can now login to thanks to using the same password across the internet.

I can't stress this enough, don't use that same password on more than 1 place. I know so many people, probably 4 out of 5 that use the same password everywhere.

I wish them luck brute forcing my steam password, it is 384 bits long.

I'm guilty of using the same password. But I use 2 or 3 different passwords instead of just one. I use one for important stuff and another for unimportant stuff. This way if they get my password for forums and the like they still won't be able to log into my band account or anything. What I should be doing and what others should do, is use a mnemonic to create a password for each site. Because you use a mnemonic devise you can recreate the password every time you need it. Here is an example somewhat like something I came across on a blog:

1: Create a small hard to guess very secure string. Something like: 1gH&! Keep this as secret as you possibly can!!

2: Take the web site url and interchange the first and last letters. So microsoft becomes ticrosofm

3: Add your string to the end of this

4: Now you have a pretty secure unique password for every site: ticrosofm1gH&! in the case of some Microsoft account.

It's not perfect but it's a huge step above using the same password for every site.
 

Locut0s

Lifer
Nov 28, 2001
22,281
43
91
I figure a good idea would be to use something like KeePass and remember that one password and creating individual ones for each site and simply storing them inside keepass.

It's so very tempting to use the same one for each login.

Also when a site has the option for using your mobile device to get access to the account you should use it. It's a one time password and pretty secure. Nobody is going to get your cell and then try to access your bank or gmail etc.

I use keypass and store more than just passwords in it. Anything that I or others are likely to forget goes in there. I don't actually use amazingly secure passwords. Like I said I use about 3 different ones, one level for important stuff, another for unimportant stuff. The problem with Keypass is you don't have it with you if you need to remember your pass away from your computer.
 

Demo24

Diamond Member
Aug 5, 2004
8,357
9
81
I figure a good idea would be to use something like KeePass and remember that one password and creating individual ones for each site and simply storing them inside keepass.

It's so very tempting to use the same one for each login.

Also when a site has the option for using your mobile device to get access to the account you should use it. It's a one time password and pretty secure. Nobody is going to get your cell and then try to access your bank or gmail etc.


The one problem I could see with this is if you try to login to a site somewhere else you either won't know the password or may not remember it. This is why I take a base password and make variations on it of varying degrees of safety for various sites.
 

nickbits

Diamond Member
Mar 10, 2008
4,122
1
81
I was recently working on a web site and the client demanded that the passwords be reversible, so storing just a hash wasn't possible.
I imagine a lot of sites that have poor security are not because of lazy/dumb developers but because the site owners who have no idea what they are doing want them that way.
 

Nintendesert

Diamond Member
Mar 28, 2010
7,761
5
0
The one problem I could see with this is if you try to login to a site somewhere else you either won't know the password or may not remember it. This is why I take a base password and make variations on it of varying degrees of safety for various sites.



Yeah, that could be a problem. I liked to keep my encrypted file on something like dropbox or now the Amazon cloud so I can access it anywhere.
 

Mark R

Diamond Member
Oct 9, 1999
8,513
14
81
Can someone explain to me what 'salted' is?

Salting is the name given to mixing something with a password, prior to "hashing".

There is a weakness with storing hashes of passwords, which is that it is now becoming practical to build dictionaries, which you can use to match a has with it's password.

Let's take a naive approach of just storing the hash of a user's password. Let's assume user Alice sets a password of "password" and that the site uses an MD5 hash. "password" gets hashed to "5f4dcc3b5aa765d61d8327deb882cf99". The hash "5f4..." gets stored in the database.

A hacker then manages to steal the database, and they find the hashed password "5f4...". The hash value "5f4..." cannot be used to back-calculate the password. However, it is practical for an attacker with a powerful computer(s) to build a dictionary of "common" passwords over a period of weeks, months or years. Then following a hack, they can simply look the hashes up in their dictionary and see if they get any hits.

Without a hash, is that the same dictionary will work to attack any database that uses the same algorithm. This makes building dictionaries (especially sophisticated dictionaries, like "rainbow tables") an extremely economical job for hackers. They only have to build the dictionary once, and can use it over and over again.

A better security method is to "salt" the passwords. At a basic level, the site admin could think up a random string, e.g. "AHigherSecurity". In this case, the database would store the password by adding the salt. i.e. "AHigherSecuritypassword", then calculating the MD5 and storing that. (79fea0e5e53d267f8897540ebf74453f)

In this case, a hacker may be thwarted because the hash "79f..." is for a long and complex password, and is unlikely to be in an attacker's pre-calculated dictionary.

This works fine, but there is still a weakness. If the attacker finds out the salt, and the database has a lot of passwords of high value, then they could simply set out and build themselves a new dictionary with the salt taken into account. However, in this case, the attacker would have to build a new dictionary for each and every site that they attack. A pre-made dictionary won't work. They have to build it after the attack.

The preferred way to get around this is to use a different salt for each password. You then store the salt along with the hash. In this case, an attacker would be wasting their time with dictionaries, as each dictionary could only be used for 1 password. The only option is brute force and ignorance (which would require a disproportionate amount of computer resources). It doesn't matter if a hacker finds out what the salt is because all the salt is for is to stop the salt/password combo from appearing in a dictionary.

Some security experts recommend double salting. This means using a salt for each password, and a 2nd salt which is the same for all users. The individual user salts are stored in the database, but the application salt is stored in the app code itself, which means that the hacker would need to get hold of both the database and the application code in order to try extracting passwords. The double salting also makes the passwords even longer and more complex making brute force attacks even less practical.
 
Last edited:

Locut0s

Lifer
Nov 28, 2001
22,281
43
91
Salting is the name given to mixing something with a password, prior to "hashing".

There is a weakness with storing hashes of passwords, which is that it is now becoming practical to build dictionaries, which you can use to match a has with it's password.

Let's take a naive approach of just storing the hash of a user's password. Let's assume user Alice sets a password of "password" and that the site uses an MD5 hash. "password" gets hashed to "5f4dcc3b5aa765d61d8327deb882cf99". The hash "5f4..." gets stored in the database.

A hacker then manages to steal the database, and they find the hashed password "5f4...". The hash value "5f4..." cannot be used to back-calculate the password. However, it is practical for an attacker with a powerful computer(s) to build a dictionary of "common" passwords over a period of weeks, months or years. Then following a hack, they can simply look the hashes up in their dictionary and see if they get any hits.

Without a hash, is that the same dictionary will work to attack any database that uses the same algorithm. This makes building dictionaries (especially sophisticated dictionaries, like "rainbow tables") an extremely economical job for hackers. They only have to build the dictionary once, and can use it over and over again.

A better security method is to "salt" the passwords. At a basic level, the site admin could think up a random string, e.g. "AHigherSecurity". In this case, the database would store the password by adding the salt. i.e. "AHigherSecuritypassword", then calculating the MD5 and storing that. (79fea0e5e53d267f8897540ebf74453f)

In this case, a hacker may be thwarted because the hash "79f..." is for a long and complex password, and is unlikely to be in an attacker's pre-calculated dictionary.

This works fine, but there is still a weakness. If the attacker finds out the salt, and the database has a lot of passwords of high value, then they could simply set out and build themselves a new dictionary with the salt taken into account. However, in this case, the attacker would have to build a new dictionary for each and every site that they attack. A pre-made dictionary won't work. They have to build it after the attack.

The preferred way to get around this is to use a different salt for each password. You then store the salt along with the hash. In this case, an attacker would be wasting their time with dictionaries, as each dictionary could only be used for 1 password. The only option is brute force and ignorance (which would require a disproportionate amount of computer resources). It doesn't matter if a hacker finds out what the salt is because all the salt is for is to stop the salt/password combo from appearing in a dictionary.

Some security experts recommend double salting. This means using a salt for each password, and a 2nd salt which is the same for all users. The individual user salts are stored in the database, but the application salt is stored in the app code itself, which means that the hacker would need to get hold of both the database and the application code in order to try extracting passwords. The double salting also makes the passwords even longer and more complex making brute force attacks even less practical.

It's sad that this is necessary largely because the use of completely insecure passwords is so predictable. Rainbow tables wouldn't be of much use I imagine if people used even moderately secure passwords.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |