Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!
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.

 

 


     Manoj
     Find me on LinkedIn

View solution in original post

4 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.

 

 


     Manoj
     Find me on LinkedIn

Avatar

Level 1

@Poonam_Dogra @Manoj_Kumar_ Could you please let me know what steps you have followed to fix the issue. I also see the same issue (null) in both case .. 1) Directly using decryptString(EncryptedData) 2) decryptString(EncryptedData,'key')

Avatar

Level 4

Hi @sameerk13731914 ,

Most probably , please check the key that you are using to decrypt is correct? For me , at that time, the key option that @Manoj_Kumar_  suggested worked fine.