News for hackers. Stuff that matters.
Re:Show HN: Evilpass – A slightly evil password strength che... by dheera on Saturday February 18, 2017 @02:16PM (#13676176)
Almost all of my passwords are:

    password = base64.b64encode(pbkdf2(master_password + '/' + domain, b'', 100000+n, keylen=16))[0:16].decode() + '$1Aa'
where master_password is not written or stored anywhere, domain is the domain name of the service in question, and n is the nth password generated for the service in question (since some services force you to change passwords every N months).

'$1Aa' is to appease stupid websites that require a symbol, number, uppercase, and lowercase letter.

Truncation to 16 characters is to appease stupid websites that limit passwords to 20 characters.

I also use the same thing for the answers to all "security" questions online, where I just plug in the security question as domain. (They're basically de-security questions, since, you know, a lot of people in this world know what my favorite color is and what streets I used to live on).

I should probably use HMAC but whatever.

The only passwords I have that are not part of this system are my computer's root password, e-mail password, and bank account passwords; for those I just memorized random strings).

This system gives me the following advantages:

* Peace of mind that I don't have to trust a 3rd party, closed-source password manager

* No need to cloud-sync anything across machines. No need to access the internet.

* I can calculate my passwords without a database, so if I have to randomly reformat my machine while travelling I can still compute my passwords and login to everything I need to.

Re:Show HN: Evilpass – A slightly evil password strength che... by nickysielicki on Saturday February 18, 2017 @02:51PM (#13676361)
> Truncation to 16 characters is to appease stupid websites that limit passwords to 20 characters.

This is something that drives me up the wall. I understand that you have to impose some kind of limit on password length to avoid abuse, but there's virtually no reason to cap it at anything less than 32 characters. I think a cap of 128 characters is completely reasonable and likely to appease even the most paranoid of users-- it all hashes to the same size anyway.

Another thing that irritates me is when registration forms enforce max password length via javascript or maxLength, without describing the max length in writing somewhere on the page. If I generate a password and I paste it into that field, I have no way of knowing if it has been truncated or not. I can't count how many times I've registered for a website and then had to immediately recover the password because of this. The time that stands out most to me is when this happened with my bank! Come on!

Pro-tip to any web developers out there: providing some kind of visual cue that the password I've entered is at the maximum length of the field (and that it was possibly truncated) is a good solution to an edge case that I feel is rarely considered.

Re:Show HN: Evilpass – A slightly evil password strength che... by keitmo on Saturday February 18, 2017 @04:43PM (#13676868)
I had something similar happen on a financial site years ago. The logon page silently truncated passwords to N characters, while the password reset page silently truncated to N+1 characters. My default randomly generated password length was, of course greater than N+1.
Re:Show HN: Evilpass – A slightly evil password strength che... by pvdebbe on Sunday February 19, 2017 @03:21AM (#13678711)
Paypal does it.
Re:Show HN: Evilpass – A slightly evil password strength che... by Godel_unicode on Sunday February 19, 2017 @12:10AM (#13678286)
That type of truncation virtually always happens in JavaScript in my experience, leading to my favorite greasemonkey script; showing what happened to the text in a masked edit field in a pop-up window on form action.
Re:Show HN: Evilpass – A slightly evil password strength che... by savanaly on Saturday February 18, 2017 @08:43PM (#13677756)
I tried to do something like this but ran into two problems:

1. it's not always clear what the domain is. Sometimes a company has more than one portal to enter a login. Now I have to remember which one I was using when I created the account. I can try to use the company name but that's ambiguous as well because sometimes the portal's or product's name is different from the company's name and now I have to remember what the "domain" is.

2. Different services have mutually contradictory requirements for passwords. You mentioned you add '$1Aa' to appease some websites, but I have encountered ones that have a no symbols rule, or some that have minimum length 12 while others that have maximum length 10.

I believe the most reasonable solution is to use a password manager.

Re:Show HN: Evilpass – A slightly evil password strength che... by dheera on Saturday February 18, 2017 @09:34PM (#13677885)
One option would be to host a public text file (on Github, even) that describes various services, their password requirements, domain aliases, and have the script tack on the approriate strings based on the public text file. Others could even use the same script and submit pull requests describing new services they encounter.

My main objective is to eliminate personal databases.

Re:Show HN: Evilpass – A slightly evil password strength che... by Kliment on Sunday February 19, 2017 @06:23AM (#13679200)
Okay, so say I submit a pull request for a phishing domain pretending to be an alias of something, and months/years later trick you into visiting it. Seems risky to me.
Re:Show HN: Evilpass – A slightly evil password strength che... by dheera on Sunday February 19, 2017 @12:03PM (#13680621)
This would only be risky if I got phished into visiting your phishy domain AND was stupid enough to consciously want to enter a password into it, in which case the risks are the same as if I used a human-memorized password.

My password "manager" doesn't automatically fill in passwords until I consciously ask it to.

But some amount of human oversight over those pull requests would be in order.

Re:Show HN: Evilpass – A slightly evil password strength che... by bytesandbots on Saturday February 18, 2017 @02:37PM (#13676286)
I wanted to do something similar with a slightly different formula but got into major issues. I couldn't log in from any other computer without opening a terminal and typing code for two minutes. I couldn't use it from a mobile on the go. key logger was even more dangerous since now the attacker could learn all my passwords instead instead of just one.
Re:Show HN: Evilpass – A slightly evil password strength che... by dheera on Saturday February 18, 2017 @02:43PM (#13676321)
I don't run the computation on devices I don't own, in case my master password gets leaked by a keylogger. If I have to login to a non-sensitive site on someone else's machine, I compute the password on my phone and the type it in manually.
Re:Show HN: Evilpass – A slightly evil password strength che... by bytesandbots on Saturday February 18, 2017 @02:47PM (#13676348)
Sounds ok. Thanks
Re:Show HN: Evilpass – A slightly evil password strength che... by bytesandbots on Saturday February 18, 2017 @02:45PM (#13676334)
To add to that

4. You will need a clipboard everytime to copy paste which is not very safe

Suggestion: Add a salt parameter to make it less deterministic, keep these salt in a personal database

Re:Show HN: Evilpass – A slightly evil password strength che... by dheera on Saturday February 18, 2017 @02:55PM (#13676377)
The clipboard is indeed unsafe. I don't use the clipboard. On my Linux machines I use xte (apt-get install xautomation) to have my script enter the password after a delay of 3 seconds which is enough for me to switch windows and click on the password field where it needs to be entered.

On phones I just type it in after looking at it, or compute on my computer and punch into my phone. I can memorize a 20-character string for a short time. In the future I might make a device to plug in via OTG cable, emulating a USB keyboard, to enter the password into phone apps. Another option for phones is key injection using /dev/uinput which is accessible if you run Cyanogenmod.

Re:Show HN: Evilpass – A slightly evil password strength che... by Cyph0n on Saturday February 18, 2017 @03:06PM (#13676423)
> I can memorize a 20-character string for a short time.

Now I see why such a system works for you. Very few people can do that in case you didn't know.

Re:Show HN: Evilpass – A slightly evil password strength che... by dfox on Saturday February 18, 2017 @07:45PM (#13677548)
There is probably some room for optimizing this by changing the used character set or using some rules for producing "pronounceable" strings.
Re:Show HN: Evilpass – A slightly evil password strength che... by Spivak on Sunday February 19, 2017 @03:33PM (#13681817)
There is already a tool that can do this for you: pwgen. It's probably in your repositories but you can also get it here.

https://sourceforge.net/projects/pwgen/

Re:Show HN: Evilpass – A slightly evil password strength che... by dfox on Monday February 20, 2017 @03:44PM (#13690737)
What I meant is that it would be interesting to plug such tool as an final encoding step of some variant of KDF(master, domain)
Re:Show HN: Evilpass – A slightly evil password strength che... by dheera on Saturday February 18, 2017 @09:37PM (#13677893)
We could use entropy from the PBKDF2 output to select English words from the OED.

https://xkcd.com/936/

Re:Show HN: Evilpass – A slightly evil password strength che... by andreareina on Saturday February 18, 2017 @11:33PM (#13678209)
Re:Show HN: Evilpass – A slightly evil password strength che... by hellofunk on Saturday February 18, 2017 @02:57PM (#13676383)
I did something similar to this for a long time, but had constant headaches because URLs and domain names often change for services as companies consolidate, etc. Drove me nuts, I had to remember the old domain name. Now I just use 1Password (which may or may not be the best choice in password managers).
Re:Show HN: Evilpass – A slightly evil password strength che... by robk on Saturday February 18, 2017 @04:55PM (#13676919)
This exactly! So annoying when this happens. UK government loves doing this especially for various business logins.
Re:Show HN: Evilpass – A slightly evil password strength che... by cm2187 on Saturday February 18, 2017 @05:50PM (#13677138)
That's basically the idea behind SQRL but with public/private key cryptography instead of a password.

By the way what do you do when you have more than one account or when the website wants you to reset your password (because they leaked it again...)?

Re:Show HN: Evilpass – A slightly evil password strength che... by popey456963 on Saturday February 18, 2017 @05:57PM (#13677165)
I assume he just increments 'n' by one, or perhaps some other arbitrary figure like 100.
Re:Show HN: Evilpass – A slightly evil password strength che... by hayksaakian on Saturday February 18, 2017 @02:37PM (#13676283)
This sounds really cool, now why wouldn't the general population do it this way, even assuming it was packaged in a convenient open source app?
Re:Show HN: Evilpass – A slightly evil password strength che... by FabHK on Saturday February 18, 2017 @03:05PM (#13676420)
There are apps that do this, the magical password generator that doesn't need to sync anything.

However, this well known method has many flaws:

* very hard to satisfy all site-specific password requirements (need symbols, no symbols, at least 8 characters, at most 8 characters, etc. etc.)

You can work around this by storing site-specific requirements, but then you need to sync again, basically.

* very hard to version: if LinkedIn screws up again and you need to reset your LinkedIn password, but don't want to replace all your other passwords by changing the master password, what do you do? You can version by including a version number or so pre-hash, or increase the number of rounds (as the GP suggests) but then you need to sync the version number (or remember it or try), so you're back to square 1.

* Also, might want to use Scrypt or Argon2 or so instead.

There are other problems. See related HN discussions for these frequently suggested storage-less "password managers":

https://news.ycombinator.com/item?id=12889807

https://news.ycombinator.com/item?id=11557662

Re:Show HN: Evilpass – A slightly evil password strength che... by nmat on Saturday February 18, 2017 @02:29PM (#13676238)
How do you login to sites on your phone?
Re:Show HN: Evilpass – A slightly evil password strength che... by dheera on Saturday February 18, 2017 @02:41PM (#13676307)
A Python script on my Android phone computes the above. I might write a native app later. I'm also thinking of making something at my desk that emulates a USB keyboard that I plug into my phone with an OTG cable to enter the computed password automatically.

For less-sensitive sites (i.e. things that aren't going to screw me over if my account is hacked), I just save the computed password into the Chrome password manager. The computed password can't be feasibly used to get my master password anyway.

For many sites it's possible to stay logged in with a session cookie without saving the password.

Re:Show HN: Evilpass – A slightly evil password strength che... by Spivak on Sunday February 19, 2017 @03:31PM (#13681809)
This seems like a lot of effort to have a worse experience than a typical password manager.

What does this give you that, say, KeePass doesn't?