I use ActiveRecord method serializewith a class of my own, AESCoder. This will use aes-256-cbc with a random initialization vector every time. This initialization vector is added to the field when I store it in the database and, of course, is retrieved before deserialization.
Now this scheme does not allow me to use any crawlers in these attributes. I have to select all the lines I needed to be automatically decrypted, and execute ruby selectin the list of elements. This, of course, is a huge performance bottleneck that I cannot afford for this application.
One solution would be to not use random IV, but then aes-256-cbc would no longer be safer.
Did I forget something?
source
share