In my database i have a column that stores cryptojs encrypted values in this type of form:
U2FsdGVkX1/BpEUjr5y+hivlNpUep+HZQG4Tw8bmTvQ=
When i decrypt this with cryptojs it's all good.
let decryptedValue = cryptoJS.AES.decrypt(
encryptedField,
secretKey
);
But decrypting it with mysql returns null.
I've tried converting to the encrypted string into binary then decrypting it with mysql's aes_decrypt() but it returns null.
SELECT convert(AES_DECRYPT(binary(encrypted_field),'secret_key') using utf8) as decrypt
The encrypted values are numbers and i need to decrypt them in order to do some calculations in mysql with them.
I don't know if there is something wrong with the way i'm decrypting it or do cryptojs and mysql have different ways of encrypting and decrypting using AES.
Thank you in advance.