I am trying to encrypt my sensitive data like user email address to the database using aws kms cmk. I am using aws SDK in java.
I have encrypted the field and stored in data base.
I can also decrypt the data.
But the main problem comes when I have to query the data... As I am getting back the aws sdkbytes and I am converting it to base 68 and storing it.
Why does aws always return the different SDK bytes for the same data after encryption? I can't search simply through the data. I have to bring all the list and decrypt the data and then match the data. It is taking a lot of time.
Please suggest me the good way to encrypt the data using aws cmk keys.
Thanks Ankit