DEV Community

Discussion on: How to Process Passwords as a Software Developer

Collapse
 
nylen profile image
James Nylen • Edited

What about simple variations of the username, like myusername with password myusername46? I know for a fact that attackers are looking for this common pattern.

I think enforcing a minimum Levenshtein distance between the username/email and the password would be a reasonable measure, but I haven't seen this done before. I'd probably also consider sorting the characters first to catch reversals and other permutations. Do you see any problems with this?

Other simpler techniques such as a substring match would not be such a good idea because a long password that contains a short username should be fine.

Collapse
 
nathilia_pierce profile image
Nathilia Pierce

Great question! That's an extremely good idea, although I haven't seen this done either. I'm sure someone's already implemented Levenshtein distance calculators in various programming languages.

Something definitely to look into. It's no worse than checking if the password is known, as long as the required Levenshtein distance is balanced, but not sure what that would be.