Can't get encryption_aescbcDecrypt to work

Avatar

Avatar
Validate 1
Level 1
viragp64924055
Level 1

Like

1 like

Total Posts

10 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
viragp64924055
Level 1

Like

1 like

Total Posts

10 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
viragp64924055
Level 1

28-05-2020

I used the following encrypt function in the Additional Data section of a Query and got a result:

Expression1:

encryption_aescbcEncrypt(@cusCustomerId, '\x5206adc1a5b9b65f', '\xd726544e976ecd02')

Result1:

0823046d09baa5f002e51a709b3462c6

Encryption Result.png

 

I used the following function to decrypt in the Additional Data section of a Query and the result is empty:

Expression2:

encryption_aescbcDecrypt('x0823046d09baa5f002e51a709b3462c6', '\x5206adc1a5b9b65f', '\xd726544e976ecd02')

Result2:

empty

Decryption Result.png

 

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:

 

Decrypt Function Description.png

 

What am I doing wrong?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back 10
Employee
craigthonis
Employee

Likes

179 likes

Total Posts

273 posts

Correct reply

160 solutions
Top badges earned
Give Back 10
Give Back 5
Give Back 3
Give Back
Boost 50
View profile

Avatar
Give Back 10
Employee
craigthonis
Employee

Likes

179 likes

Total Posts

273 posts

Correct reply

160 solutions
Top badges earned
Give Back 10
Give Back 5
Give Back 3
Give Back
Boost 50
View profile
craigthonis
Employee

05-06-2020

Hi Virag, 

 

I might suggest checking the formatting used in:

https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-standard/aes-cbc-encryption-not-work...

 

It looks like you might need additional backslashes.

 

Regards,

Craig

Answers (2)

Answers (2)

Avatar

Avatar
Validate 10
Level 2
rahulg1930481
Level 2

Likes

7 likes

Total Posts

46 posts

Correct reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 10
Level 2
rahulg1930481
Level 2

Likes

7 likes

Total Posts

46 posts

Correct reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile
rahulg1930481
Level 2

09-06-2020

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.

Avatar

Avatar
Boost 250
Employee
ramon_bisswanger
Employee

Likes

271 likes

Total Posts

397 posts

Correct reply

199 solutions
Top badges earned
Boost 250
Affirm 100
Give Back 25
View profile

Avatar
Boost 250
Employee
ramon_bisswanger
Employee

Likes

271 likes

Total Posts

397 posts

Correct reply

199 solutions
Top badges earned
Boost 250
Affirm 100
Give Back 25
View profile
ramon_bisswanger
Employee

29-05-2020

Just remove the "x" from the first parameter in the decrypt call and it shall work.

i.e.  encryption_aescbcDecrypt('0823046d09baa5f002e51a709b3462c6', '\x5206adc1a5b9b65f', '\xd726544e976ecd02')