1

One problem with passwords is that if they can be broken as follows:

  1. pick a random password
  2. hash it
  3. compare that hash to other known hashes

This way, you have broken the password. Then if you can access the hash of a password, you can reverse-engineer it to find out the password.

However, isn't this easily fixed by tying the password to the user name?

Say my username is my e-mail: plutoplanet@hotmail.com and my password is password123.

All the company needs to do under the hood is make my actual password include my username in a randomized way, that is, my actual password is papLusswtOordpLanEt123@hotmail.com. Basically, what I did there was just take password123 and throw in letters from my username at random places.

Now this is the password that I hash and store in my database. Now if anybody ever finds out what password led to this hash, they will know it is papLusswtOordpLanEt123@hotmail.com, but that is NOT my password, and they don't know how to extract my password from it, since the mixing of passwords and username was random.

4
  • 3
    "... include my username in a randomized way,..." - this way must be reproducible when checking the password. So it somehow needs to be stored along with the password (like the salt) or must be a more global setting. In any way - this way is not actually secret and can be known to the attacker too when reconstructing the password. – Steffen Ullrich Jan 23 at 10:35
  • Uh, if the password database is leaked, then the usernames are also leaked. It would be trivial to extract the password from the now-known string of the username ... Your process only sort of works because it would be possible to try all the permutations of the strings to sort out what's username and what's password, and on top of that, you are assuming that the username is also secret. – schroeder Jan 23 at 14:08
  • A word of advice: An easy fix for a problem many have tried finding a solution for often has already been considered. – MechMK1 Jan 23 at 17:55
  • How does your approach protect against users reusing the same username across websites? – Limit Jan 24 at 4:29
6

One problem with passwords is that if they can be broken as follows: pick a random password; hash it; compare that hash to other known hashes. This way, you have broken the code.

It was long ago that type of password mechanisms were used. Today we use random salt per password, and additionally, a server-based pepper. Then the user's password is hashed using a password hashing algorithm that is designed computationally intensive and memory-hard; like Scrypt and PBKDF2. The aim is to cripple the attacker by eliminating the massive parallelization of the GPU/ASIC and reducing the time to search like 100K iterations. No more parallelization, no more fast search, and no more Rainbow tables. Today's modern standard is the Argon2 that is the winner of the 2015 password hashing competition.

However, isn't this easily fixed by tying the password to the user name?

That doesn't differ since the method is assumed to be known to the attacker; a real attacker also assumed the target's personal information, too. That is why you should not include anything that is personal in your passwords.

Besides you need to store this random information, too, that will increase the complexity of the self-written code.

The real problem with the passwords is the user's side or call human side. One can be taught to use dicewire based passwords that are easy to remember and have strong strength. The XKCD 936 is the famous cartoon for this.

Besides, a strong piece of advice is using password managers like open-sourced KeePass, which can store all of your passwords securely, even you don't need to generate them. Even Firefox has a password manager mechanism.

2
  • 1
    If I recall correctly, early salts (I am thinking around 1980 BSD systems) did use parts of the username as the salt. The problem, of course, is that if someone used the same username and password on multiple computers using the same scheme, then the "hashes" would be identical. I do not know when random salts were introduced. – Jeffrey Goldberg Jan 24 at 7:13
  • @JeffreyGoldberg thanks for the information. We came from a long way. It is still amazing that some companies keep the passwords in plain format, as Facebook did. – kelalaka Jan 24 at 9:49
0

Then if you can access the hash of a password, you can reverse-engineer it to find out the password.

No. If proper algorithm like Argon2 or Lyra2 with proper parameters are used, you cannot reverse password. Thus any further transformation of password or user name are not needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.