I am encrypting some information stored in a column of a MySQL database. The column can contain repeated values, let's say the table has 7 rows and the column to be encrypted has the following values:
"a", "b", "a", "c", "b", "b", "c"
I would like to know if is insecure to encrypt just one time each different value (each one with a random IV stored along with the ciphertext) and to reuse the same ciphertext for the same plaintext.
Let's say that the encryption of "a" with a random IV (IV1) gives "z", the encryption of "b" with another random IV (IV2) gives "x" and the encryption of "c" with another random IV (IV3) gives "k". Would it be insecure to have all the "a"s encrypted as "z", all the "b"s encrypted as "x" and all the "c"s encrypted as "k"?
"z", "x", "z", "k", "x", "x", "k"
I often read that it is a weakness to have the same ciphertext for the same plaintext, but I was wondering if this weakness is no longer present if you use a random IV each time to encrypt the data.
Thanks for your help.