If you really want to save space, don't store any passwords. Just require the same string to be entered three times in a row. If the user re-types the exact same value after being told it's wrong twice, the must be confident enough in it to be a legit user - nobody is going to enter the same value 3 times if they're trying to guess a password.
My favorite is when it tells me my password is wrong, I clicked the reset password link, try to reset it to what it just told me was the wrong password, and it tells me I can't use that, because it's the same as my current password.
Since we're trying to save storage space we don't want to store the number of attempts, so maybe just let them in if they try to reset the password, who would do that if they don't control the associated e-mail?
If I mess up my bank's PW twice, I'm doing password recovery. Because if I mess it up again, I'm likely to need to wait something like a whole weekend to talk to a human to unlock it.
and yeah. turned out eventually it was a bad keyboard was messing up my entry
Why stop there when one can use semantic vectors instead of hashes, only store cluster averages and then do similarity matching instead of equivalence checks. Will bring storage way down and have the added benefit of not requiring you to know which exact version of your default password was used, as long as you get the gist of it!
Yeah, if you are not using salts. Otherwise every hash should be different, even if the password is the same. (Excluding the unlikely occasion of the same hash for different texts).
I'm so glad modern hashing algorithms include a random salt within the hash. People used to do it so wrong. You're supposed to create a salt per password, not use a single global one.
The joke is that these password are not salted, and each unique password will be given an ID. Then, under the user table you will store the ID reference to the password, instead of the password. This means that if 2 users use the same password they will have the same ID and only be stored once, saving space.
If you have users using password “letmein” (eventually hashed, but not salted), instead of a Password column you can have a PasswordId column referencing by foreign key the record in the Passwords table that contains said password. Since most users choose the same password, you end up with less space used by the foreign key column.
It doesn’t make sense on different levels, but that’s the gist of it.
It's not the storage of salted passwords that's the problem, it's the shared state via reference.
How do you handle password changes? You also reduce the footprint for attack. 200k uniquely salted passwords are much harder to crack than 500 shared passwords with the same salt.
If we're being fair, though, if someone is reading your rows like this you've already been compromised and leaking email/pw combos is low on your list of problems.
As a DBA who works with devs a lot, I gave up trying to keep them from doing things. They just kick their requests up the corporate ladder until they get their way. Then a few months later it blows up and I get blamed for it.
stop trying to prevent it and make it cost something instead. when devs want something dumb, write down the actual risk in the ticket, not just "this is bad" but what breaks and how. if they escalate and get it approved anyway, whoever approves it signs off on the risk with their name on it, plus who owns support when it blows up and when it gets reviewed again. if its a real architecture thing pull in your EAs and get an ADR for it
tbh the paper alone wont save you if your company loves blaming people. what actually helps is sorting out ownership before it goes live. dev team pushed it through? then they get paged at 3am when it falls over, not you. funny how many "super urgent" requests dissapear once someone has to put their name on it and carry the on call for it
It could, an int FK is 4 bytes, and the table of passwords would be 4 bytes PK + 16 bytes for the unsalted hashed password
So, about 50% larger if everyone's password is unique, and 75% smaller if everyone's password is the same. Breakeven point is at the ratio of 3 unique passwords per 5 people.
sounds computationally expensive. besides, why even store a password? just derive it by hashing the email address with the account creation timestamp and ask the user to save it
Good idea, that way you can actually control the storage growth! Got some VC funds? Just change a single number in your algorithm and you get more password hash space!
This is actually a thing, without even bothering with the password.
I use a few services where passwords have been replaced with being emailed a log in button on each sign in attempt, clicking the button in the mail opens a new tab of the site with you logged in.
It’s like sign in with google, but universal across all email providers and domains
There should be no duplicates. You're supposed to salt the passwords before hashing them to avoid making it visible that two users have the same password to anyone accessing the DB (even to someone with legit access to the DB)
There should be few or no identical strings in this case because you should be storing big_strong_and_government_approved_hash(pw ++ u.name ++ app.name) or something like that, and not just pw
Retired DBA Mgr here. I’ve had security audits where an auditor sat next to me, told me what db tools to use, what tables to select and screen cap, paste the caps into an email to them and sent it, all in their presence.
This overly normalized password management method will never pass a true security audit.
Wouldn't most auditors gloss over such thing anyway, the one that would be checking are underpaid and overworked, while their supervisor are overpaid and busy with ... something else.
Not at all. Auditors were an outside accounting firm, the auditor who was with me was a lackey collecting info for the final audit report. With Sarbanes Oxley security rules DBAs could not know passwords, so this would be flagged as a violation and the Board of Directors would order this gap to be closed immediately (remediation) since it easily enables collusion and fraud.
A SQL database isn't going to scale. I suggest creating a new Password Service microservice backed by DynamoDB that allows the User Service to upset and retrieve passwords by ID.
My company just barely fixed the fact that we were required to have a password be exactly 8 characters long and they weren't even case sensitive for one of our internal tools. Idk how something ends up like that
the password policy requires 20 ascii char minimum and no more that 32, with at least one lowercase char, one uppercase char, one number, and one special char ( except the ones from an undocumented list).
Just save passwords as files using email address as file name. Then you don't even need to reference it in the DB. Screw it, might as well let the front-end access the password files directly so it can compare them itself without hassling the back-end. Front-end just tells back-end that the passwords match, and its authenticated.
It stores each password as a high-resolution bitmap image of the password, printed in an obscure novelty font to avoid being easily reversible, in full 256-bit color depth.
5.0k
u/Away_Advisor3460 Sep 27 '26 •
Pff, amateur hour.
If you really want to save space, don't store any passwords. Just require the same string to be entered three times in a row. If the user re-types the exact same value after being told it's wrong twice, the must be confident enough in it to be a legit user - nobody is going to enter the same value 3 times if they're trying to guess a password.
2.1k
u/as-if-spike Sep 27 '26
373
u/Chiccitynotess Sep 27 '26 •
On the bright side, your database deduplication metrics look fantastic right before the data breach lawsuit
1.1k
u/braytag Sep 27 '26
If you have 100GB of password, you have other problems.....
203
u/Flat_Initial_1823 Sep 27 '26
Why use big table when default password do trick
188
u/Lamborghinigamer Sep 27 '26
That also means that they don't use salting or even worse store everything in plain text 😨
43
u/reubenbubu Sep 27 '26 •
Allowing password reuse is a security concern that can be avoided with an easy validation step:
The password you provided is already in use by user /u/NoMedicine3572. Please choose a different password.
42
u/zirky Sep 27 '26
security though “wait they can’t be serious, this is a joke, right?”
33
u/TgirlTiffanyRPs Sep 27 '26
Can someone explain the joke? Why wouldn’t you store (hashed/salted) passwords in one table ?
30
u/FalconFiveZeroNine Sep 27 '26 •
As a DBA who works with devs a lot, I gave up trying to keep them from doing things. They just kick their requests up the corporate ladder until they get their way. Then a few months later it blows up and I get blamed for it.
28
u/bilus Sep 27 '26
Doesn’t math
12
u/AggieCMD Sep 27 '26
Forgot your password? Click here to reset everybody's password.
12
u/andlewis Sep 27 '26
Someone isn’t salting or peppering their hashes.
10
u/LogicBalm Sep 27 '26
Gotta enforce security policy though. Unique passwords and extensive password history.
"invalid password, that password is already in use by user witty_kitty69"
9
u/DJDoena Sep 27 '26
All my passwords hash down to "Q"
8
u/Jazoboz Sep 27 '26
WTF is a salt?? I like my passwords raw!
8
u/I_HAVE_THAT_FETISH Sep 27 '26
Just take the password and run it through an algorithm to calculate a salt that hashes it to a pre-determined string!
6
u/heesell Sep 27 '26
Just send a password to the user their email with each login. No DB storage needed
10
u/Stummi Sep 27 '26 edited Sep 27 '26
I am not a DB engineer, but wouldn't a good database engine deduplicate multiple identical strings in a table by itself?
E: I know, its not working if you account for per-user salts, please don't take this too serious
4
u/Available_Canary_517 Sep 27 '26
Even if password are same , the generated hash is different with a salt so it is useless because you introduced a extra join without any improvement
4
u/zx48 Sep 27 '26
You can also save another 50% by only storing and validating every other character in the password.
4
u/irn00b Sep 27 '26
And bro - just store the passwords in browser cache. We went from 3gb to 0gb.
Just ask Claude to do it - ez.
4
u/Future-World1780 Sep 27 '26
Just don't store passwords at all and simply let the user pass the login at the third attempt.
4
u/-Redstoneboi- Sep 27 '26
this is like 2 steps away from just being a straight up wordlist
4
u/ora00001 Sep 29 '26
100 GB to 3GB is not a result of password reuse. That's something else terrible going on.
3
u/wolfjazz93 Sep 27 '26
What if I increase my FK by one? 😆
3
u/Glum_Cheesecake9859 Sep 27 '26
Even better.
if (password == 1234) {loginUser();}this will save 90% of DB hits.
3
u/CoolCat1337One Sep 27 '26
he is talking about password hashes, right?
3
u/henryeaterofpies Sep 27 '26
I think this gave me an aneurysm and I am not a dba, security or sys admin
3
u/djulioo Sep 27 '26
3
u/contentatlast Sep 27 '26
100gb of passwords? How many passwords are you storing lmao
3
u/mittfh Sep 27 '26
Bonus points if the passwords are stored in plaintext...
...on the same machine as the external Web server...
... Which, naturally, uses http (not s)...
... And the Admin/Root password is in one of the "Top 100 passwords exposed by data breaches" lists ("Password123" and friends). 😈
4
u/CLOWNFLOGGER Sep 27 '26
I just write mine under the brim of my Yankees hat, like every other responsible Gen X dude.
4
u/CDavis10717 Sep 27 '26
Retired DBA Mgr here. I’ve had security audits where an auditor sat next to me, told me what db tools to use, what tables to select and screen cap, paste the caps into an email to them and sent it, all in their presence.
This overly normalized password management method will never pass a true security audit.
2
u/ICantBelieveItsNotEC Sep 27 '26
A SQL database isn't going to scale. I suggest creating a new Password Service microservice backed by DynamoDB that allows the User Service to upset and retrieve passwords by ID.
2
u/the_millenial_falcon Sep 27 '26
How to make hash collisions work for you.
2
u/jaavaaguru Sep 27 '26
Signed,
Bobby Tables
2
u/Randy191919 Sep 27 '26
How many users do you need to have have 100GB of passwords?
2
u/cosmicomical23 Sep 27 '26
As long as they are encrypted
2
u/BungalowsAreScams Sep 27 '26
My company just barely fixed the fact that we were required to have a password be exactly 8 characters long and they weren't even case sensitive for one of our internal tools. Idk how something ends up like that
2
u/Effective-Giraffe655 Sep 27 '26
"You can't use this password. This password is used by user Joe"/s
2
u/PrometheusMMIV Sep 27 '26
You have over 97 GB of passwords? Even at 12 characters, that's over 8 billion users. And that's just the repeated ones.
2
u/North_Affect_8167 Sep 27 '26
Make a selection of 3 allowed passwords and forget about the whole database thing, the most users should use 2-factor auth anyway.
2
u/OhioGoblin43 Sep 27 '26
Great idea. I'll use their username as the primary key since they're unique.
2
u/Prata2pcs Sep 28 '26
Rainbow tables with purpose
1
u/_Its_Me_Dio_ 11d ago
its easier to ise hdp to secure its 100 percent effective if we all just act like decent people and dont use others usernames no password needed
1
u/DreadedTuesday Sep 27 '26
"Data De-Duplication"
1
u/norwegian Sep 27 '26
They probably means hashes, bc storing passwords is a lawsuit waiting to happen.
1
u/bradland Sep 27 '26
I mean, your DBA is thrilled. Your ITSec team, however...
1
u/PlusIndication8386 Sep 27 '26
Noobs... Use trie data structure for better efficiency
1
u/01BADSEED Sep 27 '26
What the...what?
1
u/Iwillgetasoda Sep 27 '26
pro tip: dont believe everyone calling themselves a developer
1
u/za72 Sep 27 '26
wow that's a pro tip
1
u/justsomeph0t0n Sep 27 '26
if my wordpass123 account ever gets hacked, i may be in trouble.
but until then, i salute this righteous move towards informational brevity
1
u/XlikeX666 Sep 27 '26
... in windows there is "character map"
GL
1
u/ILLinndication Sep 27 '26
You guys have users? But seriously, who has that many users?
1
u/C0sm1cB3ar Sep 27 '26
Things that never happened
1
u/ozh Sep 27 '26
So that's why services like Claude don't let you log in with a user/password... Offload the work to your email provider. Smart.
1
u/wilkied Sep 27 '26
100GB in passwords????
1
u/Thetashorty Sep 27 '26
Now just one shared account for the whole world, all problems solved!
1
u/dvhh Sep 27 '26
I meant, did you see the password rotation policy ?
1
u/FirstTimeGamingTV Sep 28 '26
Isn’t the real joke here people actually implementing their own auth instead of using a trusted 3rd party
1
u/rruusu Sep 28 '26
Please tell me this person doesn’t work on some password manager software. But how else would they be storing such a number of shared passwords.
1
u/tzaeru Sep 28 '26
Obv password hashes should be salted so this wouldn't work anyway, but, just for the fun of it..
100GB of passwords hashed to 256 bits is 3 billion passwords.
That's a lot of passwords.
1
u/Weak_Shoulder_6780 Sep 28 '26
Let no one who knows what hes doing see this
1
u/RatSumo Sep 28 '26
My nose started bleeding after I read this.
1
u/CaffeinatedTech Oct 02 '26
Just save passwords as files using email address as file name. Then you don't even need to reference it in the DB. Screw it, might as well let the front-end access the password files directly so it can compare them itself without hassling the back-end. Front-end just tells back-end that the passwords match, and its authenticated.
1
u/MPD-Psycho Oct 03 '26
🤣🤣🤣
1
u/Open-Philosopher-777 Oct 07 '26
And don't hash them, that'll save you storage
1
u/BellianIII Oct 12 '26
Taste a bit fishy. I am missing some salt on this database.
1
u/GuaranteeVegetable89 Oct 13 '26
Funny of you to assume I store passwords in a database. I use local storage.
1
u/Altruistic-Tax-5291 Oct 16 '26
AWS sales hate him 😄
1
u/TrackLabs Sep 27 '26
Brother how huge is your password manager to reach 3 GB???? LET ALONE 100!?
7
u/seanprefect Sep 27 '26
Security architect here, I’m dead now, my heart and head exploded I’m writing this via spiritual medium