- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
02-22-2019 08:16 AM
Hello,
We have a need to store a hashed email value in our data layer when a user decides to login to our site. What I am trying to do is to create a jquery click extension that fires when a user clicks the "Log In" button. Within this extension I am setting the email address in a data value. I am trying to utilize the Cryptoextension to hash this value before storing. However, the crypto extension only runs on new page loads and I want it to be able to run on the Log In button click while i still have access to the email value. Is it possible to call the crypto extenson within the jquery click handler? Or is there a better way to go about doing this? My other thought was to do this all via a custom javascript extension but I would really like to avoid having to write the SHA256 hashing mechanism when its already available via the crypto extension.
Any help would be great.
Thanks!
Zach Benchley
Solved! Go to Solution.
02-27-2019 06:32 PM - edited 02-27-2019 06:33 PM
Hi @zbenchley
If you need a custom solution, you can use the Crypto Extension to choose an encryption method to inject into utag without encrypting anything in particular. Do this by leaving the variables empty
The Hashing Method encryption code will be added as a new method in the utag.ut object. In this case, as utag.ut.sha256
Then in your Javascript Extension can then use the following to do the encryption on a variable:
b['variable_name'] = utag.ut.sha256.SHA256(b['variable_name']).toString()
Hope that helps!
02-28-2019 07:13 AM
Copyright All Rights Reserved © 2008-2023