"Of course, after I encrypted my password, I could decrypt it." - fundamentally wrong !. The right encryption function (i.e., the hash function) must not have the inverse function. Very simple identification algorithm:
1. User enters password
2. Get the hash from the password using the encryption function (entered_hash = f (password))
3. Compare embedded_hash with right_hash_store
NEVER store passwords, only hashes!
I think that if you want your encryption function to have feedback, it should consist of a function with the opposite, so AND and OR are not like that, but ROT and XOR. So, all you need is gluing ROT / XOR (for the XOR mask, you can use the encrypted value of the previous squeaky step, in which case it should also be saved)
Val k source share