I used the following encrypt function in the Additional Data section of a Query and got a result:
encryption_aescbcEncrypt(@cusCustomerId, '\x5206adc1a5b9b65f', '\xd726544e976ecd02')
I used the following function to decrypt in the Additional Data section of a Query and the result is empty:
encryption_aescbcDecrypt('x0823046d09baa5f002e51a709b3462c6', '\x5206adc1a5b9b65f', '\xd726544e976ecd02')
I used the same KEY and INITIALIZATION VECTOR for both functions.
I'm quite certain that I am doing it exactly as stated in the documentation:
What am I doing wrong?
I might suggest checking the formatting used in:
It looks like you might need additional backslashes.
I also faced the same issue, after debugging I found that when the length of encrypted string is more than the length of field in which you are storing, then some character will get truncated. This in turn causes the decrypt function to return a blank value. Try encrypting the string in any online tool and compare it with string stored in campaign, if some characters are truncated in campaign try increasing the length of that field in campaign.
Just remove the "x" from the first parameter in the decrypt call and it shall work.
i.e. encryption_aescbcDecrypt('0823046d09baa5f002e51a709b3462c6', '\x5206adc1a5b9b65f', '\xd726544e976ecd02')