5 ms·
Anatomy of a hack: even your 'complicated' password is easy to crack
- jacques_chester 13y agoFirst published in Ars Technica: http://arstechnica.com/security/2013/05/how-crackers-make-minced-meat-out-of-your-passwords/ http://arstechnica.com/security/2013/05/how-crackers-make-mi... and discussed here: https://news.ycombinator.com/item?id=5777719 https://news.ycombinator.com/item?id=5777719 The main point to remember was that the story is to expose the tactics and thinking process of attackers, not to be a perfect representation of true life. They deliberately relaxed some constraints (giving attackers unsalted MD5s, for example) but gave a fixed deadline to impose pressure.
- tptacek 13y agoThey used GPU crackers, not rainbow tables. Salting would not have made a difference.
- DuskStar 13y agoActually, salting makes a HUGE difference, even without rainbow tables. Salting does nothing to the difficulty of cracking any individual password, but it makes you crack each person's password INDIVIDUALLY. So you have to crack 123456 + %randomString1%, 123456 + %randomString2%, etc instead of cracking 123456 once for all of the entries on the list. So if it's a list of 1,000,000 password hashes + salt, that will be ~1,000,000 times harder to crack all of them than a simple unsalted list.
- tptacek 13y agoYou don't understand how GPU crackers work, or, for that matter, how Alec Muffet's "Crack" works, from the early 1990s, the original password cracker that everyone used to use to work on Unix password files. Suffice it to say: no, salting does not make a huge difference.
- DuskStar 13y agoOk, I may be confused. I thought that with an unsalted list, you could try a password (generated by your algorithm of choice, whether that be dictionary based or brute force) and compare it to the entire list of hashes, because Alice's "123456" would hash to the same thing as Bob's "123456". But if the list was salted, Alice and Bob would have different stored hashes - and so you would not be able to parallelise cracking across users. Yes, if you only want to crack Alice's password, the salt will not slow you down. But if your goal is to crack a million, wouldn't the salt slow you down? If I'm missing something, I would really like to know. Always good to learn something new!
- cmurphycode 13y agoYour theory of salting-per-user is correct. Rainbow tables are useful if the time it takes to compute is big enough that storing a large list is useful. The GPU crackers are so fast nowadays that that isn't the case. If you can try 500M per second, that's about 10 GB of SHA1 generated! Imagine storing a day's worth of work in a rainbow table :) It's better to use a proper password hash, which will be slow, and will likely have per-user salting built in, anyway.
- mechanical_fish 13y agoRead the Ars Technica article. The hole in your logic is: there is no point in guarding against the case where, if two users share the same password, cracking one will crack the other, because the only time that two users share a password is when that password is really weak. What are the odds that two users share the same password? If passwords were totally random and 24 characters long the answer would be "pretty low". And the odds of cracking one of these passwords by brute force would also be pretty low. If only we lived in that world. In the real world the odds of two users sharing a password are frighteningly high, but that's because most passwords are awful: they are things like "pizzapizza" or even "password". The cracking programs can crack one of these in a millisecond, because they are equipped with lists of thousands of real-world weak passwords harvested from real websites. And then, if another user shares this awful weak password, that user will also get cracked, a few milliseconds later. There is no point in "parallelising cracking across users" because it's so easy to just guess all the weak passwords for every user. Another way to think about it: A salt could only help in cases where (a) two users share the same password, but (b) that password doesn't appear in the list of several million other real-world passwords that is built into the password cracker. And that just isn't worth worrying about.
- samd 13y agoIn case anyone hasn't already seen it: http://codahale.com/how-to-safely-store-a-password/ http://codahale.com/how-to-safely-store-a-password/ tl;dr Use bcrypt.
- cperciva 13y agoIn case anyone hasn't already seen it: http://www.tarsnap.com/scrypt/scrypt.pdf http://www.tarsnap.com/scrypt/scrypt.pdf tl;dr Use scrypt.
- tptacek 13y agoUse scrypt if you can. But don't get too hung up on this. All the modern KDFs are fine; use PBKDF2, bcrypt, scrypt, whatever you have available. Just stop "salting hashes". Attackers laugh at salted hashes.
- pfraze 13y agoI'm sorry if I'm misunderstanding, but are you saying that application developers should not use salts at all?
- jacques_chester 13y agoHe's saying that rolling your own with functions designed to run as fast as possible, with or without salt, is not going to give you much security. What you want is functions that run slowly, thus increasing attack cost.
- deleted 13y ago[deleted]
- kintamanimatt 13y agoMaybe the real takeaway from this article is that password strength meters should do a better job, not only assessing raw password complexity, but also comparing the proposed password to lists of common passwords, etc.
- annnnd 13y agoOr that password strength meters can't do a good job.
- aspensmonster 13y agoMoral of the story? Just use a password manager for your accounts if your biggest threat vector is someone getting a hold of hashes on a compromised server. You can make them as long and random as you like. And unless a major breakthrough in crypto occurs the attacker can waste eons trying to break it. Of course, securing the key to the password manager becomes that much more important. But if compromised hashes are your biggest concern, Ars rightly notes that password managers are by and large the best solution.
- jervisfm 13y agoYes, I agree that using a password manager that auto-generates random password is the way to go for protecting against the attack of a compromised hashed password database table. Here is the thing I'm wondering though: in the case when brute force attacks is not practical, is using human generated password/passphrases really that bad when compared against randomly generated password? Most decent and important sites would throttle the number login attempts one can try before at least throwing up a captcha or outright blocking. This implies, to me at least, that in such a scenario using something like 12 character human generated password would give about the same effective security as a longer randomly generated one (e.g. 24 character random password). Yes, the randomly generated password is objectively better from a theoretical standpoint but I am thinking the effective difference in reality is negligible in the case when a brute force attack is infeasible (due to throttling of attempts). Thoughts?
- jarrett 13y ago> Most decent and important sites would throttle the number login attempts one can try before at least throwing up a captcha or outright blocking. The types of attacks discussed in the article are not feasible when the only way to try a guess is to send an HTTP request. Look at how many guesses per second those GPUs are doing. You won't get anywhere near that sending HTTP requests. Passwords are far, far more likely to be cracked if the database of hashed passwords is compromised. That's what you should really be worried about, and it's the main reason to use strong passwords. Also be sure not to reuse passwords, even strong ones. A strong password can still be compromised, because there are many types of attacks that have nothing to do with cracking hashes.
- ppierald 13y agoThe threats to passwords are generally two-fold: 1) SQLi leaking the contents of your database to the public. 2) Malicious insiders with access. Blocking SQLi should be every web developer's first priority, not debating the efficacy of password hash algorithms, salting, and so forth. Preventing malicious insiders is more complicated and requires other defenses besides the underlying choice of password algorithm. scrypt, bcrypt, pbdkf are all fine in preventing the ill effects of #1 as it pertains to passwords, but prevent #1 at all costs nonetheless. Not only are your password hashes at risk, but your entire serving infrastructure and everything you consider sacred behind your firewall. Game over.
- mattholtom 13y agoLastPass has a secure password generator that lets you specify character set, length, etc. It has extensions for all major browsers, support for two factor auth, form fillers, one time passwords, great iOS and Android apps. http://www.lastpass.com http://www.lastpass.com Big fan here. Just thought I'd throw in a little discussion from the user side of things, as I see some great points about being a responsible maker.
- cupcake-unicorn 13y agoI wouldn't assume most readers of HN would be using these kinds of passwords for anything important, no? I've been using SuperGenPass with one of the XKCD 4 random word style passwords for years and it works great. I don't store it anywhere, just type it in to the bookmarklet.
- deleted 13y ago[deleted]
- kbuck 13y agoIf you use the printable representation of the hash, the dictionary of characters that the hash uses is only digits 0-9 and a-f. While they likely still won't guess this, it's better to use 40 characters of the printable output of /dev/urandom directly, e.g.: dd if=/dev/urandom bs=512 count=1 | strings -n1 | tr -d '\n' Edit: the original question, before it was deleted, was whether using a hash of data from /dev/urandom would result in a good password.
- deleted 13y ago[deleted]
- Pxtl 13y ago> "On the corporate side, its so different," radix said. "When I'm doing a password audit for a firm to make sure password policies are properly enforced, it's madness. You could go three days finding absolutely nothing." I don't see how this could be true. Most of the harder ones that were exposed would pass corporate requirements - typical corp thing is like 12 digits and all 4 character classes, and the article included a few of those.
- annnnd 13y ago+1: I thought the same thing... Maybe the problem would be finding the entry to a "rabbit hole" (as he puts it). If there are no weak passwords it might be more difficult to find the patterns in use... but then again, the patterns from other corporations would still help.