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?


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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.