1

I'd like to encrypt email address in a data extension with SHA256 within marketing cloud. This will be used as a unique identifier.

  1. When the email goes into a data extension, have the email address in one column but in another column, have the SHA256 encryption generated.
  2. Once it's there, update all subscribers attribute with this encryption.
  3. Keep this constant for every subscriber that goes into the data extension.

I'm trying to get some ideas on where to start. Would ssjs be my best option or sql?

  • Are you saying you want to use the SHA256 encryption version of the email address as the contact / subscriber key? – Travis Naughton Jun 1 '18 at 0:38
  • Hi @TravisNaughton I still want subscriber key to be unique to the platform but I want an additional unique identifier for each subscriber. This way, if we encrypt outside of sfmc the encryption will be the same. Currently, I'm working with ssjs + ampscript (my sfmc instance doesn't seem to allow this though) or seeing if I can use hashbytes as well. – tmy144 Jun 1 '18 at 12:46
1

Little late on the answer but I've been working on this recently and someone might find this information useful.

If you are looking to do an encryption on data once it is inside Marketing Cloud the 2 main ways to do this would be with SQL activity or script activity.

SSJS only support MD5 hashes so this is fairly limiting. AMPscript does have more support for SHA256 but as you noted in the question you cannot use SSJS + AMPscript in an Automation Studio activity.

With SQL activity you can use the HASHBYTES function, making sure you cast and convert the values in the right way. This could be run on a schedule.

CONVERT(NVARCHAR(MAX), 
HASHBYTES('SHA2_256', CAST('hellowworld' as varchar(350))),
2) as EncryptedValue

To update the All Subscribers attributes typically an export, transfer and import activity to the All Subscribers list via csv is common practice.

  • Thanks Travis! I appreciate you answering but I was able to figure this out. – tmy144 Oct 31 '18 at 15:28
  • meant to finish my comment -- I wasn't able to use hashbytes but I was able to figure this out. 1) ampscript via a content block 2) populate ssjs 3) set the automation to run. – tmy144 Oct 31 '18 at 15:34
  • Ah nice! I always forget about that option. – Travis Naughton Oct 31 '18 at 22:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.