I have 55000 records in a table where the keyval (varchar) column contains 15 character long strings encrypted with AES_ENCRYPT. I tried a LIKE query on this column and was surprised to see that it answers very quickly. How is that possible? My guess is that it uses the column index somehow but doesn't that mean that the index is insecure?
select aes_decrypt(keyval,'secret') from `table` WHERE aes_decrypt(keyval,'secret') like '%abc%'
Showing rows 0 - 2 ( 3 total, Query took 0.0644 sec)
...
AES is fast. Look at http://www.cryptopp.com/benchmarks.html - on old hardware, AES can process 100Mb/sec.
So 55k rows x 15 bytes per row = 825Kb, which should take no time at all.
So there is nothing to worry about.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With