I tried to put this in a comment, but I think it is important enough to respond.
The circuit proposed by the OP is not necessarily a violation of CWE-257. The proposal does not allow the system administrator (say) to recover old passwords.
The suggestion is to use the new password as the encryption key for all old passwords. If you can live with a โnew password checkโ residing on the client and not on the server, then this is no less secure than encrypting everything else with a password.
Thus, the "change password" gadget will be the client code. The server will send an encrypted list of earlier passwords that the client can decrypt with the current user password, and then re-encrypt with the new user password. The server does not have enough information to determine any of the passwords, whether old or new. Only the client has this information, but in any case it matters ... The difference is that the attacker who learned your current password could also know your old passwords. Since learning your current password is already a disaster, it does not affect me, as it is much worse.
True, this does not protect against an โattackโ of an employee who writes his own utility for changing a password in order to circumvent password restrictions, since verification is not performed on the server side. But this is in no way a violation of the CWE-257, in my opinion.
This is actually a reasonable idea.
source share