Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Encrypt and Decrypt Parameters
Pujan
Below is the code I am using to encrypt and decrypt the parameter. I am decrypting the parameters in before factory, but I am not able to set the Parameter value to report parameter. How can I set it.<br />
Or is there any other way to do the encryption and decryption ?<br />
<br />
Encryption (I pass the encryptedparameters in url.)<br />
StringEncrypter e = new StringEncrypter(StringEncrypter.DES_ENCRYPTION_SCHEME);<br />
String encryptedParams = e.encrypt(params.toString());<br />
<br />
Decryption<br />
if (StringUtils.isNotEmpty(urlParam)) {<br />
StringEncrypter encryptor = new StringEncrypter(StringEncrypter.DES_ENCRYPTION_SCHEME);<br />
String decryptedParams = encryptor.decrypt(urlParam);<br />
String[] params = decryptedParams.split("&");<br />
for (int i = 0; i < params.length; i++) {<br />
String keyValue = params
;<br />
if (StringUtils.isNotEmpty(keyValue)) {<br />
String[] tokens = keyValue.split("=");<br />
paramMap.put(tokens[0], tokens[1]);<br />
}<br />
}<br />
}
Find more posts tagged with
Comments
mwilliams
So, the decryption works, you're just not able to set the values back to the parameters? Is this the issue you're having?
Pujan
No the decryption doesnt work. Its giving error.
mwilliams
Remove all the variable "typing". You don't need those in javascript. That'll probably solve the issue.