Master Password

by Lyndir

© 2011

— 1 —

Find the site that you need a password for by entering its name into the search field.

While searching, the names of previously used sites will be listed.
Tap one of these results to go straight to its password.

— 2 —

The site's password is now displayed.
Tap it to copy the password. Once copied, you can switch to another application and paste it into a password field.

To change the password for this site, tap the edit icon .

Below the password you can set the password type. Some types create a password for you, others let you choose your own.

If the site complains when you try to set or update the password, try changing the password type.

To create a new password for this site, you can increment the password counter . This is useful, for example, after you've had to share the password with somebody else.

— F.A.Q. —

What is this thing?
How do I use it?

Begin by entering the name of the thing you want a password for. Naming is entirely up to you, but remember to be consistent.
Good names could be:
apple.com, john@doe.com, office safe, bike lock, etc.

Every name has a different password, so the following names may be difficult to recall:
pw for amazon, pin for my cell, etc.

Tap the resulting password to copy it for pasting in a different application or read it to type it in or use it manually elsewhere.

The thought behind this application is to secure your online (and offline) life by changing all of your passwords to passwords generated by this app.

That's crazy talk.
Why would I do that?

The theory of password authentication is simple: To log in to a site, you share a secret word with the site that only you and the site know. Since nobody else knows your secret password, nobody else can log into your account.

It sounds good in theory. In practice, it's an absolute hell. These days, people have hundreds of accounts on sites all over the Internet. Does that mean we're all remembering hundreds of secret passwords? No, of course not. That would be impossible. If you're like most people, you remember one or two passwords, and use those for all your sites everywhere.

So, what?, you might say.
Here's the problem: When you share a secret password with a site, and then share the same secret password with another site, both sites can now use the password you gave them to log into your account on the other site. Nothing is stopping them from trying to log into your GMail, Hotmail or Twitter accounts using the same password that you used to register an account on their site. Even if you only give your password to sites you trust, all it takes is for one of those sites to get hacked and lose their passwords database. Those hackers now have all it takes to impersonate you. This is, in fact, so common, that it's one of the main reasons people's accounts are getting hacked nowadays.

Some of you already try to remember unique-ish passwords for different sites. This causes problems too: with so many passwords to remember, you easily forget passwords for sites you haven't used in a while. Or you make up a simplification algorithm such as tacking your birth year onto the site name. This is really not any more secure than using the same password for every site. And then there's those sites with password policies: suddenly your long password isn't good enough, because it begins with a number, or because (god forbid) it's too long. You now find yourself forced to create a strange variant of your password that you'll have forgotten before the day is out.

This app solves the problem by letting you remember only a single password without requiring you to share the password with anyone else. Instead, the app creates secure passwords for use with whatever site or purpose you might need a password for.

I can't change all my passwords.
Some of them were assigned to me.

That's why this application allows you to change the password type to Personal or Device Private. These types let you enter a password for a site, and the app will encrypt and save it so you it's there for future reference.

These types of stored passwords don't have all the advantages that their generated counterparts have (they can be lost if you lose your device and don't back it up), but when you can't change a site's password to one generated by the app, this is as good as it gets.

So, what if I lose my device?
I'm locked out of everything?

Absolutely not! In fact, generated passwords aren't even stored on your device. No, not in the cloud either. They're not stored anywhere! What that basically means is, if you grab the iPhone of a colleague or friend and open this app on it with your own master password, it'll give you all your generated passwords (don't worry, it's perfectly safe). So, if you lose your iPhone or forget it, just open the app on your iPad, or borrow a friend's phone, and you're back in business. No backups or restores needed.

This also means that, unlike all those apps that store your passwords or send them off to be stored on the Internet, this app makes your passwords much safer from theft. If your device is stolen, the thieves can't get at your passwords. There's also no cloud service that can be mis-managed or hacked.

Great, but that still means I need my phone to get my passwords.

Correct. However, remember that usually you'll only need to use this app once for each site. After you log into a site once using the password generated by this app, your browser will probably ask you to remember the password for the future. Agree to that, and you won't need to bring up your phone again the next time you log in to the account.

There is also a Mac version of Master Password available from the App Store. It allows you to generate any of your passwords without even needing to take out your phone.

I'm paranoid.
How do I maximize my security?

For starters, make sure you've changed the passwords of all your sites you have accounts for to those generated by this app and make sure that you use this app when registering a new account somewhere, to determine the password to use for the account.

It's also important that you've chosen a long master password. Short master passwords, especially 4-digit PIN codes, are trivial to guess by attackers. Using a 10-character master password provides sufficient entropy to protect against any modern-day attempt at brute-forcing, assuming the password is not based on easily determined facts (names, birth dates, etc.). A better idea yet is to use a pass phrase, ideally an absurd sentence. These are usually much easier to remember and much harder to guess by attackers. If you're really paranoid, install a keyboard of a non-latin script (russian, chinese, ...) and create a master password using these characters or even a mix between scripts.
Just don't forget it! :-)

Using the action icon on the top right, select Settings to find some advanced settings for the application. Here, you can disable Remember my password. Doing so will force the application to ask for your master password each time you open it. That way, when you show your phone to somebody else after unlocking it, they can't go through your passwords.

I forgot my master password. What are my options?

Due to the nature of this app's algorithms and the decisions that were made to protect against brute-force attacks, it is simply infeasible to recover your master password. If you really can't remember it, your passwords are gone.

Where you go from here is, you log in with a new master password, and for each of your accounts, you go through the password recovery procedure (which will usually involve sending a message to your email account) and reset the passwords of these accounts to passwords generated by your newly chosen master password.
Just don't forget it again! :-)

So how does this thing work internally?

The way Master Password works internally is fully disclosed. The source code for this application is also available from GitHub. I invite anyone with a technical background to go through these resources to make certain of the trustworthyness of Master Password.

This part will likely make sense to you only if you're well versed in computer security jargon. If you're the kind of person who likes to know how the clock ticks before deciding that it can be trusted to keep ticking, read on.

The user chooses a single master password, preferably sufficiently long to harden against brute-force attacks. The application then creates a scrypt key derivative from the user's password. This process takes quite a bit of processing time and memory. It makes brute-forcing the master password far more difficult, to practically infeasible, even for otherwise vulnerable password strings.

When the user requests a password be generated for a site, the application composes a byte buffer consisting of the site's name (UTF-8 encoded), the key derived from the master password, and a password counter, delimited in that order by a NUL byte. The bytes are hashed using the SHA-1 algorithm. The bytes resulting from this hashing operation are called the seed in the next steps.

Next, we need the password type that the user has chosen to use for the site. Password types determine the cipher that will be used to encrypt seed into a readable password. For instance, the standard password type Long Password activates one of three pre-set ciphers: CvcvCvcvnoCvcv, CvcvnoCvcvCvcv or CvcvCvcvCvcvno. Which of those will be used, depends on the first of the seed bytes. Take the byte value modulo the amount of pre-set ciphers (in this case, three), and the result tells you which of the three ciphers to use.

Now that we know what cipher to use for building our final password, all that's left is to iterate the cipher, and produce a character of password output for each step. When you iterate the cipher, every character in the cipher represents a set of possible output characters. For instance, a C character in the cipher indicates that we need to choose a capital consonant character. An o character in the cipher indicates that we need to choose an other (symbol) character. Exactly which character to choose in that set for the password output depends on the next byte from seed bytes. Like before, take the next unused seed byte's byte value modulo the amount of characters in the set of possible output characters for the cipher iteration and use the result to choose the output character. Repeat until you've iterated the whole cipher.

The result is a password whose format is dictated by the password type's ciphers and whose exact value is filled in by feeding the algorithm some bytes from a hash operation on the user's givens.

This stuff is gold.
I want one branded for our company.

Contact me directly for enterprise inquiries. I can provide branded clients and enterprise distribution if your company is interested in deploying this solution internally.