Is it possible to do this with Ampscript? Is it possible to achieve this with SSJS?
I understand there is an apex function that can do this, but I am not sure it is possible to use apex with marketing cloud.
I've decided to use SSJS. I have the following:
<script runat=server> Platform.Load("Core", "1"); var _msg = Variable.GetValue("@message"); var _secret = Variable.GetValue("@secret"); var _hashed = CryptoJS.HmacSHA1(_msg, _secret); Variable.SetValue("@hashed", _hashed); </script>
However I get an error,
Exception of type 'Jint.Native.JsException' was thrown.
It breaks at the
var _hashed... line, where
CryptoJS is called. I've included the appropriate script sources for this functionality and have tested it on front end JS. However, I cannot seem to get it working on SSJS. Any help would be much appreciated.