# Strength of passwords with patterns

One of the lesser used techniques for strong passwords is to use patterns or even straight up repetition, so it can be very long while still being memorable.

For example:

Thue-Morse `01101001100101101001` becomes `0110-3223-5445-6776-9889 increment parity 20`

Fibonacci `1,1,2,3,5,8,13,21,34,55` becomes `0 0 1 2 4 7 12 20 33 54 one less than fibonacci`

Pi digits `3.1415926535` becomes `after 3. is 14159 then 26535`

Long prefix `11111119 and 19999999 are primes`

Repetition `aall leetttteerrss aarree ddoouubbleedd eexxcceepptt l`

Keyboard layout `!@@###\$\$\$\$%%%%%^^^^^^&&&&&&&********(((((((((`

Not the best examples but you get the idea. So an actual password might look like this:

`primes 235 LuA: LualuA LualualuA LualualualualuA`

Looks easy for humans, but the guessing algorithm surely doesn't know the connection between `primes`, `235` and the repetition of `lua`.

There's a lot of patterns to work off of and a lot of possible mappings/mutations. Mappings can be layered as well. Words can then be inserted, and short prefixes and suffixes added. If the search space still wasn't large enough you could concatenate two of these to square the number of possible passwords. Is it practically unguessable or do these patterns weaken the passwords enough for specialized algorithms to be able to guess them easily?

Their length and usage of non-words should make them immune to any existing password guessing methods as well, so at least they have that benefit.

Extra: how much guessing entropy is actually in one of these passwords? There's not really any data to work off of but we could use Fermi estimation to get somewhat close.

• It's unclear if you're asking a question, or trying to propose a scheme and get people to go "good idea!". Like, what's the actual question here? Commented Sep 10, 2017 at 17:59
• Try a fractal one. Commented Sep 11, 2017 at 9:38
• "but the guessing algorithm surely doesn't know the connection..." Shhh! You just told it! But in all seriousness, read Kerckhoffs' Principle!
– NH.
Commented Nov 14, 2017 at 17:25

As far as I can tell, the question is:

They are practically unguessable, right?

The answer is a very strong it depends on the kind of attack you're worried about. Also, in the best case, what you're doing is equally as strong as using a password manager's randomly generated passwords, but almost certainly more effort, right?

Generally speaking, if your method becomes weaker once it is known, you're doing it wrong.

Let's break this down a little farther. There are two types of password brute-force attacks you need to worry about:

## Drive-by attacks

Aka "opportunistic". Here the attacker is looking for low-hanging fruit: they are attacking all users of the system in parallel, either looking for a single entry-point into the system (in which case any user will do), or they are looking to compromise as many accounts as they can with minimal effort.

They are unlikely to try any sort of "algorithmically-generated" lists, because they can get what they want simply by trying the 100,000 most common passwords based on this year's breaches. As long as your password is not on one of those "Top X Most Common Passwords" lists, you're pretty much immune already; you really don't need to go the extra effort.

## Targeted attacks

Here you, and you specifically, have been selected as a target. Maybe there is data on your account that is of value to their employer, maybe you work for your company's IT help desk and sending a phishing email from your account is more likely to succeed. Whatever the reason, you specifically are being studied.

They will find your social media posts. They will find your post on this site. They will pull up all passwords of yours from previous breaches to study how you invent your passwords. They will write software to generate guess-lists based on everything they know about you. If they know that you like to use mathematical constants, or quotes from Tolkien, or wtv, they will build the appropriate guess lists.

Against a targeted attack, @RoyceWilliams' answer referencing Kerckhoffs's principle is relevant: your scheme needs to be secure even if the attacker knows what the scheme is. You may be clever enough to invent something that passes this test, but I'd bet that whatever you invent will be more effort than just using a password manager with 32-char random passwords. So do that.

These two attack models are meant to be a framework for thinking about the threat landscape, not an exhaustive list of things attackers will do. As @Ben points out in comments, there is a sliding scale in between these two that has some characteristics of Drive-by, and some characteristics of Targeted. Where you put your comfort level is your choice; although if you're considering this at all then, for the minimal extra effort, you might as well go all the way to the top and use a password manager.

• But what password do we use to protect the password manager? Commented Sep 11, 2017 at 22:57
• @PaŭloEbermann a completely random password. It doesn't matter how hard it is, if you use it every day, you'll remember it. Commented Sep 12, 2017 at 1:34
• @user60561 Dangerous though, cause if you go on vacation for 3 weeks then go "was it "4Bjl.." or "4BjL?" and then you're royally F'd cause you're locked out of everything. Commented Sep 12, 2017 at 1:39
• "if your method becomes weaker once it is known, you're doing it wrong." THIS! Commented Sep 12, 2017 at 10:15
• @MikeOunsworth : Which is why I have chosen a diceware password. It is completely random, but consists of a number of words, and is hence quite easy to remember. The equivalent question becomes more "is it 'cow cell nail' or 'horse battery staple'?" Commented Sep 12, 2017 at 13:17

Such methods do make passwords slightly more resistant to manual inspection. Unfortunately, your opponents are not limited to manual inspection. All of the methods that you describe are subject to automation - and therefore easily replicated by password cracking enthusiasts.

Generally speaking, if your method becomes weaker once it is known, you're doing it wrong. Instead of trying to outsmart manual inspection, you should be using a method that resists attack even when the precise details of the method are known.

Further, some of the techniques that you're describing would be difficult to do in your head, and would require that the user store the password somewhere else anyway. If you're already going to do that, you might as well simply:

• For memorized passwords, use a randomly generated passphrase with a sufficient number of words and length of wordlist to resist brute force. Aaron Toponce has a list comparing various password/passphrase generators that illustrates the qualities that you should consider when selecting one. Adjust the number of words and length of dictionary for your use case.

Finally, to your question about guessing entropy, I would encourage you to not be distracted by that question. There are only a few real-world "bits" of information in there - "here is the base string I used" plus "here is the thing that I did to transform it." The effective "entropy" of such methods may be acceptable in the short term, but will drop dramatically once the method is discovered. (In other words, defer discussion of entropy until you've settled on a method that is not weakened by disclosure).

Long passwords with low entropy are good against one thing: brute force attacks. Current brute-force attacks are limited to about 10 characters, so if you're considering using `zxcvbn` as your password, using `zZxXcCvVbBnN` instead would be a big improvement.

However, if you're about to use a proper password (like `correct horse battery staple`), you can be pretty sure it won't get brute-forced. In this case, using low-entropy padding will only make it harder to type. The attacker will have to get some sort if insight to crack your password in the first place, and if we assume the attacker may get insights about your password, it's only reasonable to assume your padding scheme may be part of those insights.

Here's a short post criticizing the approach you propose. To summarize it in one sentence,

Any public recommendation of a low entropy scheme, at any level of detail, is self-defeating. The more it's adopted, the faster it weakens relative to entropy.

• Saying that brute-force attacks are limited to about 10 characters may be an oversimplification, when masks and hybrid attacks can so easily leverage brute force as a subset of the attack. Commented Sep 12, 2017 at 17:38
• @RoyceWilliams I don't quite understand. I say something about brute-force attacks, and you say it's not true for hybrid attacks. Well duh! Hybrid attacks are specifically designed to deal with clever padding around the actual high-entropy password, so padding won't fool these attacks. Commented Sep 12, 2017 at 19:42
• ... which is precisely why "using zZxXcCvVbBnN instead would be a big improvement" is incorrect. Commented Sep 12, 2017 at 20:49
• @RoyceWilliams Why? Is it because brute force attacks are not used anymore? Commented Nov 16, 2017 at 9:01
• Not exactly; rather, because A) masks are simply a method for prioritizing what subset of brute force attack should happen first, and B) calling "zZxXcCvVbBnN" a "big improvement" implies significant resistance to real-world attacks, not just resistance to brute force. But I agree, of course, with your broader point about low-entropy schemes. Commented Nov 16, 2017 at 16:16