I want to encrypt and decrypt some wordpress posts. Only the content field i care about.
Is it safe to use the same key and iv for the process?
Information Security Stack Exchange is a question and answer site for information security professionals. It only takes a minute to sign up.Sign up to join this community
No. To which degree it is unsafe, depends on many factors. The reason that you choose to use an algorithm that provides you with the facility to use both an IV and a key should be a clue that they should not, in fact, be the same. The entire purpose of an IV is, in fact, to allow you to safely reuse a single key, by changing the IV.
However, another nice property of an IV is that it need not be a secret. Only the key must remain secret. This is why IVs are often sent in the clear along with a ciphertext. So, depending on the constraints of your system, hopefully you can find a way to use a unique IV which will help you to maintain the expected security properties of the algorithm and mode you choose.