I have table with: 1) Encrypted_ID varchar (256) 2) Initialization Vector(iv)varchar(256).
I would like to decrypt the column value using the key
I am using:
MySql Workbench worked for me. In my Case, encrypted value was encoded in base 64. So I had to decode base 64 value and IV Using "From_base64" function.
SET block_encryption_mode = 'aes-256-cbc';
set @k = 'Key';
set @iv = From_base64('InitializationVector');
set @v = from_base64('EncryptedValue');
select CAST(AES_DECRYPT(@v, @k, @iv) AS CHAR);
Please make sure the encryption type, base 64 encoding, Hex/Unhex of the values/Iv are correct before you start working on the decryption. Review MYSql functions https://dev.mysql.com/doc/refman/8.0/en/string-functions.html
Hope this helps for someone.