We need to be able to retrieve password. Hashing is one-way, we can't do that.
So we ended up using AES.
We want to know if the following schema is safe or not. I am only familiar with modulo PK encryption scheme, but I can't figure out the safeness here:
- p = encrypt(password, newIV, newSecret)
- s = encrypt(newSecret, newIV, password)
We basically encryp the newSecret with user password. So whenever retrieval is needed, user must supply the password and we then decrypt it and pass it to the user.
Is there any
undo modulo thing like we would find in RSA-kind encryption/decryption scheme?