Hello All,
I cannot find function in JSAPI that encrypts string with key all the functions for this are deprecated
decryptPassword() how that works you do not provide any key to it.
Do we have more information around this topic?
I need to decrypt encrypted query parameters by AEM
Marcel
Solved! Go to Solution.
Views
Replies
Total Likes
Hey,
Indeed, says deprecated but works normally (build 9359).
The test I've made:
Instance 1:
var firstName = 'John'
var lastName = 'Doe'
var language = 'NL'
var email = 'john.doe@gmail.com';
var key = 'abcdefghijklmnopqrstuvwx12345678'; // key with 32 bytes
logInfo('email= '+cryptString(email, key);
logInfo('firstName= '+cryptString(firstName, key);
logInfo('lastName= '+cryptString(lastName, key);
Result:
lastName= @kwVuNfze15Wy1FYoXboEvQ==
irstName= @HT2m15epsQxgzTPoWnDzgw==
email= @vVyMeUIZPeQkNJ5rVvMJV8ooQvxuHXmZQRNHa9612qM=
Instance 2:
var key = 'abcdefghijklmnopqrstuvwx12345678'; // key with 32 bytes
var firstName = "@HT2m15epsQxgzTPoWnDzgw=="
var lastName = "@kwVuNfze15Wy1FYoXboEvQ=="
var email = "@vVyMeUIZPeQkNJ5rVvMJV8ooQvxuHXmZQRNHa9612qM="
logInfo("email: " + decryptString(email, key));
logInfo("firstName: " + decryptString(firstName, key));
logInfo("lastName: " + decryptString(lastName, key));
result:
firstName: John
lastName: Doe
cemail: john.doe@gmail.com
I used 2 instances to eliminate any possibility of the function using the instance ID as key.
Hello @Marcel_Szimonisz
You can use the CryptoJS library to encrypt and decrypt the data.
The sample code is shared by @CedricRey on this thread.
Views
Replies
Total Likes
Hello @_Manoj_Kumar_ ,
crypto js is it compatible with the adobe's JSSP ? so basically I need to find external library to crypt decrypt strings that is compatible with Adobe JSSP
Views
Replies
Total Likes
Hello @Marcel_Szimonisz
Yes, that seems to be the only way, because decrpyString is not deprecated.
Also, decryptPassword is used to decrypt the password for external accounts.
So, if you are looking to encrypt and decrypt anything other than passwords then you will have to rely on an external library.
Views
Replies
Total Likes
Unless I'm wrong the JSAPI function cryptStrig is still available
https://experienceleague.adobe.com/developer/campaign-api/api/f-cryptString.html?hl=encrypt
and @_Manoj_Kumar_ shared a sample from Cedric that uses the cryptString...
Saying that, any reason why you would want to encrypt a string already crypted?
I always find encrypting / decrypting very hard to nail down between system due to the sensitivity of the underlying libraries used by each system, ACC uses JavaScrupt and you might need to decrypt using Java or .Net or php or JavaScript, you will spend hours to nail down and align the encryption with the decryption..
try cryptString mentioned above.
Thanks
Denis
Views
Replies
Total Likes
Hello @Denis_Bozonnet ,
How do I decrypt such encrypted link in JSSP. I was trying to find new version for
https://experienceleague.adobe.com/developer/campaign-api/api/f-decryptString.html
Thanks a lot for your help
Marcel
Views
Replies
Total Likes
Hello @Denis_Bozonnet,
I wanted to encrypt query parameters on AEM side and then descrypt on Adobe Campaign side on landing lage.
Marcel
Views
Replies
Total Likes
Were you able to resolve this query with the help of the given solutions or do you still need more help here? Do let us know. In case the given solutions were helpful, then kindly choose the one that helped you the most as the 'Correct Reply'.
Thanks!
Views
Replies
Total Likes
Hello @jorgeferreira ,
but how do i decrypt crypted string
Marcel
Views
Replies
Total Likes
Hey,
Indeed, says deprecated but works normally (build 9359).
The test I've made:
Instance 1:
var firstName = 'John'
var lastName = 'Doe'
var language = 'NL'
var email = 'john.doe@gmail.com';
var key = 'abcdefghijklmnopqrstuvwx12345678'; // key with 32 bytes
logInfo('email= '+cryptString(email, key);
logInfo('firstName= '+cryptString(firstName, key);
logInfo('lastName= '+cryptString(lastName, key);
Result:
lastName= @kwVuNfze15Wy1FYoXboEvQ==
irstName= @HT2m15epsQxgzTPoWnDzgw==
email= @vVyMeUIZPeQkNJ5rVvMJV8ooQvxuHXmZQRNHa9612qM=
Instance 2:
var key = 'abcdefghijklmnopqrstuvwx12345678'; // key with 32 bytes
var firstName = "@HT2m15epsQxgzTPoWnDzgw=="
var lastName = "@kwVuNfze15Wy1FYoXboEvQ=="
var email = "@vVyMeUIZPeQkNJ5rVvMJV8ooQvxuHXmZQRNHa9612qM="
logInfo("email: " + decryptString(email, key));
logInfo("firstName: " + decryptString(firstName, key));
logInfo("lastName: " + decryptString(lastName, key));
result:
firstName: John
lastName: Doe
cemail: john.doe@gmail.com
I used 2 instances to eliminate any possibility of the function using the instance ID as key.
Hello Marcel,
I have been through some rough terrains with cryptString and decryptString as well.
For your specific question, I assume decryptPassword only works for external accounts because the key is the instanceID.
If you check the doc on cryptString, one of the remarks is:
Views
Likes
Replies