My current project is to encrpt some data before store into database and decrypt it after retrieve from database.
Encryption method is AES. Using PHP mcrypt module to handle encryption. Library version fits mcrypt's requirement.
My problem is how to deal with iv value, if use random value as feed encrypt and decrypt work well only this iv value is tracked.
I don't like to keep the random number in database or file, only encrypted data should keep within the database.
When I use constant string as iv seed, encryption worked fine at most of time, but encounted couple or error from output of decryption, for example, word encrypted 'album' will decrypted as 'albpm'.
Anybody has recommendation on this?