How does Linux know if a new password is a "wrapped" version of an old password? (or, the process of creating a new password) know "certain" parts of one's password?
Let's say I have the password abcEFGH123321
and I set a new password to be: acbdEFGH123321
(added a d
).
it displays:
new password is a wrapped version of the/an old password
My guess
..is that the whatever application handling the setting & reading new & old account / sudo passwords maybe hashes X amount of the first bits of the entered password,
For example;
Say the password abcd
is set,
via passwd
(e.g) and, you change it (the password)
abcd
to abdc
(swapping the last 2 characters).
Does it maybe take the old password: abcd
and hash the first 3 characters of it?
H₁ -> H('a') -> stores it
H₂ -> H('b') -> stores it
and so on, for - x times. (in this case, maybe x is a hard-coded constant , 3 for example)
If it stores this:
Where does it?
Where does it store the "parts"? Note I am not asking in general - if it knows this - But rather how it does it. An explanation answer- with references would be great!
abcEFGH123321 --> abcdEFGH123321
through trial hashing (ie try something and hash it to see if that matches the stored hash), by deleting each single letter and trying it. But if it's doing that, would it also need to try CAPS'ing each letter? l33t subs? Adding / removing random punctuation at the end? That would quickly add up to a lot of computation...