decryptString not working in URL's parameter decryptions whereas working fine when directly done | Community
Skip to main content
Level 4
January 6, 2023
Solved

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

  • January 6, 2023
  • 1 reply
  • 1993 views

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

 

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

 

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

 

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:

 

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!

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by _Manoj_Kumar_

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.

 

 

1 reply

_Manoj_Kumar_
Community Advisor
_Manoj_Kumar_Community AdvisorAccepted solution
Community Advisor
January 9, 2023

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
Level 4
January 11, 2023

Thank you @_manoj_kumar_  for suggestion, it worked!

sameerk13731914
October 25, 2023

@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')