Live data from Hacker News

Don't Store Passwords, Generate Them When Needed

16s.us

21–30 of 64 posts

Re: Don't Store Passwords, Generate Them When Needed

#21
So, basically we've just recreated http://supergenpass.com/ which has been around for at least a decade. And I'm sure the idea is older than that.

What happens when the generated password doesn't meet the strength requirements for the site (too long/too short, not enough/too many numbers, not enough "special characters")? Or when I'm required to change my password periodically?

Re: Don't Store Passwords, Generate Them When Needed

#22
post #20

Here is what I do: require 'digest/sha1' puts "doubly troubly" thing = gets.chomp base = Digest::SHA1.hexdigest(Digest::SHA1.hexdigest(thing)) puts base puts base[0..3] + "^!!^E" + base[4..-1] puts base[0..3] + "^!!^E" + base[4..6] puts base[0..3] + "^!!^E" For any site I input the domain (so "zach.tumblr.com" + my_salt would be inputed) then I copy one of the four outputs based on what security level I think the sit…

You might as well switch that to a proper HMAC. Check out HMAC::SHA1.digest

Indeed. I rolled my own UI for doing this with HMAC because everything else seemed to be implemented with cargo-cult voodoo (I just read the SuperGenPass FAQ again to check... MD5 10 times? WTF? If 1 is not enough why are you using it? No personal offense meant to whoever wrote SuperGenPass, but it's not what I wanted. As for the parent comment... I don't know what to say).

Shameless self-promotion link, if interested: https://chrome.google.com/extensions/detail/mjafhhefmkfchamf...

Re: Don't Store Passwords, Generate Them When Needed

#23
post #13

Earlier quoted context omitted.

I'd have to think more about this particular tool, but I remember seeing some calculations that passphrases have greater total entropy than random passwords, even if it takes more characters to get the same amount of entropy. Generally speaking, I go with the mnemonics, myself, rather than something like this.

There are about 50,000 commonly used words in English. That means that each word has an entropy of about 15.6 bits. (Probably less since some words are far more common than others.) Using a typical 4 word phrase gets you about 62 bits of entropy. In contrast a password can select from a set of about 72 characters. i.e. 6.1 bits per letter. Using an 10 character password gets you about 61 bits of entropy. So they seem…

Could you help me understand your reasoning/calculation?

I'd like to verify it with my expectations for a passphrase:

- not-so-common (non-)words (think meme, Shakespeare style English, abbreviations/artifical words -> Jedi, Klingon, whatever) - I'd like to understand how to valuate punctuation: You don't just need to guess the passphrase, you might need to pepper it with commas, quotes, dots, question/exclamation marks at the right spots

Re: Don't Store Passwords, Generate Them When Needed

#24
post #21

So, basically we've just recreated http://supergenpass.com/ which has been around for at least a decade. And I'm sure the idea is older than that. What happens when the generated password doesn't meet the strength requirements for the site (too long/too short, not enough/too many numbers, not enough "special characters")? Or when I'm required to change my password periodically?

The way I was going to handle that when I designed my own password generator to replace my encrypted text file of passwords was to store a version number of each site. The version number would be part of the input to the hash. Changing the password for a site then would just require changing the version number.

Requirements and restrictions on the password content could be handled similarly, by storing password formatting information for each site.

I never got around to implementing my system, because I got a fantastic deal on 1Password (via MacHeist) and my system became completely pointless.

Re: Don't Store Passwords, Generate Them When Needed

#25
I've been using HMAC-SHA1 as a basis for my passwords for awhile. I call my algorithm "Passy". It works like this (pseudocode'ish).

    # generate our HMAC
    hash = generate HMAC-SHA1 (facebook.com, passphrase) (String)
    hash += SHA1(hash) # just need the extra length
    
    # transform hash into a Passy
    passy_chars = "ABCDEFGHabcdefgh23456789#$%*+=@?"
    passy = ""
    foreach octet in hash (starting with MSB)
      passy += passy_chars[octet % 32]

    # figure out the length of this passy
    for i in 16 to passy.length
      if passy.substr(0,i) is "good", return passy.substr(0,i)
        where good means includes at least one from each of [A-H], [a-h], [2-9], and [#$%*+=@?]
I've implemented this in CoffeeScript, and have a minified version up here: http://dl.dropbox.com/u/11596/passy-tiny.html

I have evolved this algorithm over the past decade. My requirements:

  1. minimum of 80 bits of entropy (16*32=80)
  2. must include at least one symbol, one uppercase, one lowercase, and one digit
  3. base it on cryptographically secure hash algorithms
  4. avoids confusing similar symbols O and 0, l and 1 and !, etc.
I realize that requirement #2 does nothing to increase entropy. It's simply there to satisfy (idiotic!) password requirements.

With any of these systems, your generates passwords are still only as good as a) the strength of your passphrase, and b) the secrecy of your passphrase. As well as the obvious (physical security, keyboard sniffers, etc.)

Re: Don't Store Passwords, Generate Them When Needed

#26
post #13

Earlier quoted context omitted.

There are about 50,000 commonly used words in English. That means that each word has an entropy of about 15.6 bits. (Probably less since some words are far more common than others.) Using a typical 4 word phrase gets you about 62 bits of entropy. In contrast a password can select from a set of about 72 characters. i.e. 6.1 bits per letter. Using an 10 character password gets you about 61 bits of entropy. So they seem…

Could you help me understand your reasoning/calculation? I'd like to verify it with my expectations for a passphrase: - not-so-common (non-)words (think meme, Shakespeare style English, abbreviations/artifical words -> Jedi, Klingon, whatever) - I'd like to understand how to valuate punctuation: You don't just need to guess the passphrase, you might need to pepper it with commas, quotes, dots, question/exclamation ma…

Punctuation adds to the entropy of course. Although if there are only 5 of so symbols it doesn't add a lot, and if the punctuation is placed grammatically correctly it hardly adds anything.

It's not a problem to include non-english words in your dictionary. But made up words are basically passwords, and are no longer phrases.

If you choose a sequence of words that are more likely to go together that reduces the entropy.

Basically you are trying to see how random your phrase is, and the "stranger" it is, the more random.

Re: Don't Store Passwords, Generate Them When Needed

#27
I've tried a technique like this, it works wonders if you are near a computer and can copy/paste. As soon as you have some flash login box where you can't paste or you try to log in from your iPhone it becomes extremely painful.

Better to use the age old technique found in "Unix System Administration" by Evi Nemeth: Choose a well known phrase or poem or song lyrics. Then pick a letter from each word, and interpolate some weird chars. E.g.

Yellow Submarine In the town where I was born, Lived a man who sailed to sea...

First letter of each word: IttwIwbLamwsts then interpolate stuff, e.g. "IttwIwb$beatles1968$Lamwsts"

Still a pain in the ass to type, but not nearly as painful as a SHA1 or base64 string.

Re: Don't Store Passwords, Generate Them When Needed

#28
"And by the way, if after reading this you still wish to use a traditional password manager, I suggest that you put your passwords into a plain text file and encrypt it with GPG or use Password Safe."

Having recently had some significant trouble with a lost online banking password, I've been thinking about keeping all my passwords in an encrypted file stored in various places (I don't like the idea of using a password manager, because it's difficult to move it across platforms). Is this sensible from a security POV? Which is the best encryption to use and is there a standard *nix tool for it?

Re: Don't Store Passwords, Generate Them When Needed

#29
post #13

Earlier quoted context omitted.

I'd have to think more about this particular tool, but I remember seeing some calculations that passphrases have greater total entropy than random passwords, even if it takes more characters to get the same amount of entropy. Generally speaking, I go with the mnemonics, myself, rather than something like this.

There are about 50,000 commonly used words in English. That means that each word has an entropy of about 15.6 bits. (Probably less since some words are far more common than others.) Using a typical 4 word phrase gets you about 62 bits of entropy. In contrast a password can select from a set of about 72 characters. i.e. 6.1 bits per letter. Using an 10 character password gets you about 61 bits of entropy. So they seem…

So they seem reasonably comparable... It would be nice to redo the calculation while accounting for how common each word is, and also that special characters are used less often in passwords.

I know this was a rough estimate, but I think it is way, way off. Passphrases are not usually generated by random choice of English words but are instead a particular, meaningful English sentence.

This means not only are you dealing with word distribution nonuniformity but word history correlations. Without doing any math in particular, let's pick a typical 4 word phrase (literally, I'm opening the book in front of me and looking for a 4 word sentence.)

   "This will be natural"
In all honestly, this is closer to a combination of a subject (with a great deal less entropy since familiar subjects are common) a tense, and an adjective. I think you'd be lucky if there were 2^18 sentences of similar complexity, let alone 2^62.

In comparison, four random words drawn from an English dictionary.

   "idiocy rammer stars cookshop"
Passphrases of this class might have closer to 62 bits of entropy.

So what does this mean? In all likelihood, if passphrases become more common, we'll see language model based cracking routines which generate billions of sensible English sentences to crack these passwords.

Length is no protection ("abcedfghijklmnopqrstuvwxyz1234567890"). Anything with genuinely high entropy is by definition difficult to remember.

Re: Don't Store Passwords, Generate Them When Needed

#30
post #28

"And by the way, if after reading this you still wish to use a traditional password manager, I suggest that you put your passwords into a plain text file and encrypt it with GPG or use Password Safe." Having recently had some significant trouble with a lost online banking password, I've been thinking about keeping all my passwords in an encrypted file stored in various places (I don't like the idea of using a passwor…

PGP (http://en.wikipedia.org/wiki/Pretty_Good_Privacy) which GPG uses is the standard *nix tool for encryption.

Depending on your needs, you could also have a look at TrueCrypt (http://www.truecrypt.org/)

Post reply on HN