I would like to store AES encrypted data in a DB field.
Is it safe to store the AES IV (unique for each row) prepended to the cipher text? e.g.
IV_CipherText
Both would be encoded in Base64.
The Key used will be not be stored in the database.
I would like to store AES encrypted data in a DB field.
Is it safe to store the AES IV (unique for each row) prepended to the cipher text? e.g.
IV_CipherText
Both would be encoded in Base64.
The Key used will be not be stored in the database.
It is safe. The purpose of initialization vector is to insert some randomness into resulting cipher (so the same message won't result into same ciphers). It just must be unpredictable.
It can be publicly stored in the database. Often it is appended to the first bytes of the message. As said, it exists to avoid statistical attacks.
© 2022 - 2024 — McMap. All rights reserved.