6 ms·
Almost all of my passwords are: password = base64.b64encode(pbkdf2(master_password + '/' + domain, b'', 100000+n, keylen=16))[0:16].decode() + '$1Aa' wher
by dheera 10y ago
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.
- nmat 10y agoHow do you login to sites on your phone?
- dheera 10y agoA 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.
- Spivak 10y agoThis 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?
- hayksaakian 10y agoThis 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?
- FabHK 10y agoThere 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=12889807 https://news.ycombinator.com/item?id=11557662 https://news.ycombinator.com/item?id=11557662
- bytesandbots 10y agoI 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.
- dheera 10y agoI 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.
- bytesandbots 10y agoSounds ok. Thanks
- bytesandbots 10y agoTo 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
- dheera 10y agoThe 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.
- 10y ago
- nickysielicki 10y ago> 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.
- keitmo 10y agoI 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.
- pvdebbe 10y agoPaypal does it.
- Godel_unicode 10y agoThat 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.
- hellofunk 10y agoI 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).
- robk 10y agoThis exactly! So annoying when this happens. UK government loves doing this especially for various business logins.
- cm2187 10y agoThat'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...)?
- popey456963 10y agoI assume he just increments 'n' by one, or perhaps some other arbitrary figure like 100.
- savanaly 10y agoI 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.
- dheera 10y agoOne 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.
- Kliment 10y agoOkay, 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.
- dheera 10y agoThis 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.