Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Using Ordered Markov Chains and User Information to Speed Up Password Cracking (fsecurify.com)
154 points by Faizann20 on Feb 25, 2017 | hide | past | favorite | 59 comments


Another way is to use probabilistic graphical models. The paper "Personalized password guessing: A new security threat" addressed this threat several years ago.

https://experts.illinois.edu/en/publications/personalized-pa...


Seems like randomly generated passwords kept in a password manager are the way to go then, too much risk in letting our personal details bias password choices.


But single point of failure and also clipboard attacks! :(


Correct me if I'm wrong but if you install a malicious application, aren't you screwed anyway, password in clipboard or not?


On desktop yes. But on mobile, where every app is sandboxed to some degree, not necessarily. Keepass2Android prevents clipboard attacks by installing a keyboard that autotypes your password, never letting it get to the clipboard.


Interesting approach. But keyboards are quite personal (some people choose their keyboard), and there's quite a lot of technology in keyboards (gestures to text, learning dictionaries, et cetera), so I'm wondering about the quality and user-friendliness of the approach.


You only use the keyboard to enter the password, not in general. When you open the database and select an entry, it offers to switch to the password keyboard for you, then when you are done you switch back.


Single point of failure is mitigated by proper backups. Clipboard attacks are mitigated by your password manager clearing your clipboard after paste (either by event or by time).


It's still a single point of failure if the password manager is compromised.


What password management solution doesn't have this aspect?


Random pass phrases written in uv marker on the underside of your desk, in a notebook (bonus: you can burn it once memorized) scrambled and/or hidden among decoy passphrases. Make the phrase long enough (high enough entropy) that you have enough time to memorize it and use it before it should be rotated.

Whether you like this implementation or not, the solution is to choose better passwords.


If your house burns down, you lose your passwords.

If somemone (burglar / law enforcement / intelligence agencies) breaks in, they have your passwords.

If you are memorizing a lot of passwords (I have 500+ in my password database) you are surely going to forget rarely used ones.

If passwords are written down, they can be demanded from you by a warrant/court order. If they are memorized, they cannot.


Cracking a piece of paper can't be automated. A human being has to break in and find and steal it. Most of us are high value enough for a script kiddie to want to steal our credit card numbers, few of use are valuable enough for someone to break into our home just to look for a password.

If your passphrase is an innocuous phrase, like "red dogs like spicy food", how will they you know you have a password to demand? How do they know you have a piece of paper instead of having it memorized?


They can court order you to produce all relevant documents. They don't have to know that the document exists to order you to do it. You could lie to the court that the document doesn't exist, but I wouldn't recommend that.


Well if you're willing to compromise on security by trusting a password manager / encrypted volume (plus user opsec) to store your passwords, there are other compromises one can make to facilitate easier memorization. Security by obscurity is a worthless feature when designing a cryptographic system, but it is an invaluable tool for your own personal opsec. Reuse some passwords for services with a lesser threat model, with slight changes. Is it sub-optimal? Sure, but so is trusting a black box program with your passwords, probably running on your everyday (read: unsecure) computer. As your parent noted, you can't automate low tech cryptanalysis, and you're really not that important.


Like you point out, my everyday desktop is already not very secure. I use most of my high value accounts fairly frequently. So most of my accounts would be compromised regardless of what password scheme I use. Installing an open source password manager doesn't lower my security by much.

Previously I tried to memorize passwords. I ended up forgetting a lot. It was frustrating trying to remember what my password was, or even whether I had an account on the site or not. The user experience of being able to ctrl+f through all the accounts that I have in my database is very refreshing.

I have a quite high value video game account, and 6 people have specifically targeted me. They've attempted various things, such as trying to exploit password reuse, and utilizing previous website database breaches that I was in.


See, for your video game accounts imo writing down your password is just a no brainer. Unless you're protecting your account from family members or roommates, nobody is going to steal a piece of paper. And what government agency cares about your video game passwords? If they want to get into your blizzard account they'll just ask blizzard for access.


I have had family members play pranks on me, so that is one attack I'm trying to avoid. But even ignoring that there are problems. Do I keep the paper at my desk? If so, what do I do if I want to log in on my phone when I'm not at home? And like I said, there's the risk of the house burning down. My house is kind of a mess, and I have lost pieces of paper before. I could keep it in my wallet, but what if I lose my wallet? I guess I could keep multiple pieces of paper, but that just increases the chance that I would lose one. And I then I have to worry about keeping the papers in sync. And it's not just the video game account, they also attack the email associated with the video game account, so I have to put that there too. And then the recovery email for that email. Maybe I need to put my cell provider password there too, because people hijack mobile phone numbers some times for sms account hijacking. This just leads to a paperwork overhead problem that would be better for a computer to solve. Digging through my wallet or digging around my desk trying to find a piece of paper, and then typing a password character by character from the paper sounds really annoying.

I don't see what benefit the paper would have. Whether it's paper or a password manager, if my computer is compromised they'll get my accounts with a keylogger.


An attack that requires installing a keylogger and communicating the results over a period of time is less robust than an attack that searches your system for passwords at rest. How often do you lose your wallet? Hopefully less often than you change your passwords...


Either way they have to communicate online, and either way there is some data on my disk (cookies). Storing my 500+ password on paper is just not practical, and just storing a small fraction doesn't help much because those would be the most frequently used ones.

I've never lost my wallet, but my brother lost his a couple months ago. I never really change my passwords except when I was switching from my old crap password to unique strong passwords in my database. The problem with losing my wallet would be that I would lost access to all my accounts if that was the only copy of the paper. It would be an availability problem.


Specifically that’s true for US law. Under UK law memorised passwords can be demanded with prison sentences for failing to produce them. It also doesn’t count at the Us border.


That's messed up. In this case, store password DB in deniable TrueCrypt (or similar) volume on an airgapped machine, secured with a memorized passphrase. That way, they can't prove there's something to decrypt, and you haven't memorized any passwords they know about. But it sounds like merely failing to produce a password is a crime in general, which seems unfair to those who have lost / forgotten their password.


Not sure if serious, but pragmatically speaking, you would be better off with a locked down laptop that never touches a network with offline Keepass that was installed through a USB.


Use your favorite password manager and create your passwords using https://www.eff.org/dice


Clipboard attacks are definitely concerning but with 2FA you can mitigate it being a single point of failure to some extent.


What do you mean by "clipboard attack"?


For sites/apps that can't fetch the password themselves, people usually copy paste the password. This could allow other sites/apps that have access to the clipboard to see the password.


Why would you ever let a site or an unstrusted application access your clipboard?


I think you're more protected in the browser. On iOS any app can access the clipboard without having to ask for any permission.

The encryption scheme on iOS is nice, but for how much of a game they talk about privacy Apple had the opportunity to do so much more for security around identity/auth and they did approximately nothing.


Because you usually don't have control over that. On lots of system, any application that can display an UI can access the current clipboard's contents.


Taking a step back from the problem, users do usually have some amount of control over what is running on a system.

I mean, I understand that computers managed by typical users will be a shitshow, but much of the problem in that situation is that they don't really care.


Is there any way to globally disable clipboard access in my browser? Jeez, this sounds horrifying!


I believe the browser is one of the few applications that already take this into account, fortunately. Clipboard access from Javascript is secure, for example.


Another good reason to use iCloud Keychain rather than one of the 3rd party ones.



Nice idea! Can anyone point the data. May be we can try RNN to generate the passwords.


Markov chains can do amazing things in password cracking: https://arstechnica.com/security/2013/05/how-crackers-make-m...

But an RNN isn't necessarily going to help as much as you think. An RNN has two problems compared to a Markov chain:

1. Markov chains memorize strings very very easily, accurately, and scalably; it's easy to memorize phrases, words, suffixes, and prefixes from the existing corpuses of billions of passwords. That's all a Markov chain does, memorize & count. On the other hand, an RNN will struggle to do so because there's no 'place' for it to put all of that, everything has to be encoded into the fixed set of neural net weights, otherwise, it just doesn't know about it; and the more you ask it to learn, the more the competing demands fight each other. RNNs augmented with external memories might help fix this but are still cutting edge research.

2. Markov chains are also very fast, far faster than an RNN. Multiple orders of magnitude difference are possible, unless you use a RNN so small as to be irrelevant (since then it can't memorize anything). For cracking hashes, a small gain in plausibility of guesses is not worth being able to make hundreds or thousands times fewer guesses (unless perhaps the hash are something proper like bcrypt/scrypt where it takes seconds to check, in which case the guessing phase takes up a much smaller fraction of runtime and better guesses may be worthwhile).


Actually RNNs/LSTMs are surprisingly good at memorizing in addition to generalization. Have a look at the famous blog post "The Unreasonable Effectiveness of Recurrent Neural Networks" [1] for instance and notice how many words it's able to generate from characters. However, your second point is valid.

[1] http://karpathy.github.io/2015/05/21/rnn-effectiveness/


That's not 'surprisingly' good, that's effective only on a small corpus. You can see for yourself that if you try to feed it multiple corpuses with many vocabulary words or proper names, which a Markov chain wouldn't break a sweat on memorizing them all, the RNN has limited memorization ability and what tends to happen is that the less common ones get overwritten in favor of the general grammar of English and the vocabulary of the largest corpus: https://www.gwern.net/RNN%20metadata


If I understand you correctly you are comparing Markov Chains on words to a RNN over characters. That's not fair.

This paper shows a large LSTM outperform n-gram models:

"In this paper we have shown that RNN LMs can be trained on large amounts of data, and outperform competing models including carefully tuned N-grams. [...] Unlike previous work, we do not require to interpolate both the RNN LM and the N-gram, and the gains of doing so are rather marginal."

https://arxiv.org/abs/1602.02410


> If I understand you correctly you are comparing Markov Chains on words to a RNN over characters. That's not fair.

No. Words have nothing to do with it. (An RNN over words would be useless for password guessing.)

Anyway, your link doesn't demonstrate what you think it demonstrates. It's not on a password corpus but a much smaller natural language one, there is no attempt to equate runtime or model size, and the log-likelihood is an irrelevant measure of performance to passwords/s.


If words have nothing to do with it then I am not sure how your link shows that Markov Chains are better at memorizing, because a Markov Chain over characters would do a much worse job at generating coherent text.

But I actually acknowledged your second point, so I never said that RNNs are useful for password guessing, unless maybe you have a very expensive hash function. However, they are good at memorizing sequences and log-likelihood is not an irrelevant measure of performance on passwords. It measures ability of the model to generalize to unseen data. In this case that means generating realistic passwords that are not in the training data. That is important because otherwise you might as well just use a dictionary attack.


> If words have nothing to do with it then I am not sure how your link shows that Markov Chains are better at memorizing, because a Markov Chain over characters would do a much worse job at generating coherent text.

Over n-grams, it would not, as some of the responses to Karpathy's post noted, by posting Markov chain text which is of high quality. The char-RNN shows its greatest ability in matching syntax and recusive structures and in modeling the subtler aspects of English grammar, syntax, and semantics... which are all useless in password guessing. (For example, I could only tell the difference between the Markov chain and char-RNN C source, because the char-RNN understood the nesting of syntax, but not between the Shakespeare.)

> However, they are good at memorizing sequences and log-likelihood is not an irrelevant measure of performance on passwords. It measures ability of the model to generalize to unseen data.

No, it measures a particular loss function proportional to the mean log probability. In password guessing, the loss function is zero-one: you care only about guessing a single exactly right password. You get zero points for generating a realistic password which is one character off. Being able to model the distribution of 'e's slightly better is irrelevant compared to being able to memorize common birthday suffixes and guess a few more passwords per second. Having a better log likelihood on a natural English language corpus is measuring the wrong thing on the wrong data.

> you might as well just use a dictionary attack.

Exactly. This is how the best password crackers work: mix-and-match memorized literals, prefixes, and suffixes extracted from dumps of billions of passwords. A Markov chain is a souped-up dictionary attack demonstrating 'The unreasonable effectiveness of big data'.


Nice explanation. Thanks

Its more from a theoretical point of view. I want to try similar (conditioned on user info) to https://github.com/thoppe/5baa61e4c9b93f3f0682250b6cf8331b7e...


Yes, we definitely can. The reason I didn't do this was because I did not have enough cpu/gpu power. The results will be better if RNN is applied.


i have a gpu. may be i can help. let me know or point me where the whole data is available. thanks


The link is given.



thanks


Can we make a characteristic scoring metric to help order password cracking attempts? Is there a standard distribution of characters in passwords that can be analyzed?


Every password guessing optimization is about finding logically linked character distributions in passwords.


I still think wordlists are the easiest generic way of brute forcing passwords en-masse since most people still don't use password generators or aren't as uniuque as they think they are.

Sorting wordlists by some kind of metric should improve performance.


Apologies guys. The link will be up within a few minutes.


The website is up. It is just a bit slow. I have added an alternative link as well. You can go there.


Site is down (again?).


Oh no, it isn't. It just takes quite a while to load.


It is now: blank response with status code 500.


Always baffling to me. HN front page is not that much traffic. Maybe 1 req/s on avg for a few hrs with bursts up to 3 req/s.


Why are you getting downvoted?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: