Ideally we'd all use password managers, but I'm aware 99% of peoole don't. Even with one, it's frankly a pain in the butt to be nagged about changing it. "Man, my passwords are 20 random characters. I don't need yo reset ot unless you've had a breach."
You're not supposed to have the old password. If you had the old password you could just compare it to the new password.
The only way you can do it is to take the new password and make a hash for every possible single-character variation and compare them all to the old hash
Sorry, that's what I meant as well :) Came out upside down when I wrote. We used to figure out shitty ISP router passwords this way by having a table of common passwords and their hashes.
Used to have monthly changes for a Microsoft account. When trying to change, it said "You used this password 6 months ago, please use another", besides the "passwords needs to be at least this different" message. Clearly they are storing them, not sure if they're stored cleartext or they're decrypting them on the fly somehow
You should not be able to decrypt a password, passwords aren't encrypted but hashed, they would be insecure would they be encrypted.
Hashing differs from encryption in that it is irreversible, because two or more strings might result in the same hash if the hashing function is applied to them (hashing is not injective).
But since your password will always yield the same hash you can compare the two hashes and if they are equal you are considered authenticated.
If you try to log in with a different password (or even the hash of the correct password) then it will produce a different hash resulting in a failed authentication attempt
The way crackers get a password if they have the hash is by guessing pw candidates and using the hash function on them, if its the same as the hash they have they found the/a valid password. The guessing can be quite involved and with enough time and data about a victim often 12-13 digit passwords with special characters and all can be cracked - If the victim used a somewhat mnemonic pw that is.
Generated pws from a password safe are much safer (but usually also longer).
In your case I suspect MS was storing a history of hashes which is not advisable as it gives potential crackers more to work with, but its way less bad then storing plain text or encrypting passwords
A job I quit about 6mos ago required monthly changes. It was awful. And, yes, it absolutely led to me just incrementing a number at the end. I knew it was time to quit when I was about to hit double digit numbers.
But also, holding a shitty toxic job for 10mos took a mental health toll.
But also, I don't know, in some cases that might be good advice. Since 2020 I've changed jobs every 6-10mos and I'm making triple what I made in 2019, so that's nice.
I college we had to change our password every semester. Guess who added the semester number onto the end of their password. Hint: everyone.
Same as a government job that required monthly password changes. Well, at least those people had more security than the post-it note on the monitor people
NavyExchange!(ddmm of password change) for as long as I worked there, it was really only to use a register though, I had nothing compromising behind the password lock.
And despite security recommendations, too many IT depts still force password resets every 90 days...
It could be for contractual or for insurance reasons. We have some contracts with government agencies that require it, and our cyberinsurance also does. Even though NIST has been recommending for years to do long passphrase + MFA and no reset unless you suspect compromise.
So yeah, the reason behind this might not be just plain incompetence.