Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

The 4th edition of the Campaign Community Lens newsletter is out now!
SOLVED

decryptString not working in URL's parameter decryptions whereas working fine when directly done

Avatar

Level 4

Hi All,

Kindly let me know how to decrypt an encrypted parameter passed in URL and then it should be decrypted in jssp or webapp. Tried using decryptPassword as well but no luck.

Requirement- Sending encrypted email string in url to webapp or jssp and decrypt it in the corresponding jssp or webapp.

Failed Scenario 1- Sending email in url parameter from delivery as below:

em=<%= cryptString(targetData.email)%>

 

Fetching the parameter as below-

<h1>emailUrl: <%=request.getParameter("em")%></h1>
<h1>emailUrldecrypted: <%=decryptString(request.getParameter("em"))%></h1>

 

Output:-- "emailUrldecrypted" coming empty

Poonam_Dogra_0-1673039286511.png

 

Failed Scenario 2: Tried using escapeUrl :

em=<%= escapeUrl(cryptString(targetData.email))%>

Fetching the parameters as below-

<h1>emailUrl: <%=request.getParameter("em")%></h1>
<h1>emailUrldecrypted: <%=decryptString(request.getParameter("em"))%></h1>

Output:-- "emailUrldecrypted" coming empty

 

Poonam_Dogra_1-1673040094323.png

Failed Scenario 3: Tried using decryptPassword:

Fetching the parameters as below-

<h1>emailUrldecrypted: <%=decryptString(request.getParameter("em"))%></h1>
<h1>emailUrldecryptedPass: <%=decryptPassword(request.getParameter("em"))%></h1>

 

Output: Empty

 

Poonam_Dogra_3-1673040622128.png

Successful Scenario 4: Directly checking the email encryption without sending the email in the url:

<h1>email: <%=decryptString(cryptString ('poonam.dogra@abc.com'))%></h1>

Output:

Poonam_Dogra_2-1673040261554.png

 

I am positive that this might already be achieved by the fellow members, any insights on how to proceed will be extremely helpful.

Thanks in advance!

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @Poonam_Dogra 

 

Check the value of XtkKey and XtkSecretKey options under Administration >  Platform > Options.

 

I believe these values are different on the servers in your case which is why the first 3 scenarios are failing for you because encryption and decryption are happening on other servers.

 

While in scenario 4 encryption and description are happening on the same server.

 

If you don't want to change the options, you can pass the secret key yourself.

Check point no. 3 in the remarks section of this page: cryptString (adobe.com)

 

Let me know if that helps.

 

 

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hello @Poonam_Dogra 

 

Check the value of XtkKey and XtkSecretKey options under Administration >  Platform > Options.

 

I believe these values are different on the servers in your case which is why the first 3 scenarios are failing for you because encryption and decryption are happening on other servers.

 

While in scenario 4 encryption and description are happening on the same server.

 

If you don't want to change the options, you can pass the secret key yourself.

Check point no. 3 in the remarks section of this page: cryptString (adobe.com)

 

Let me know if that helps.