Adobe Campaign: HMAC-SHA1 encryption algorithm mechanism in javascript

Sumit_Saha

18-08-2016

Hi All,

I would require encryption of a field using HMAC-SHA1 encryption algorithm. It will take few parameters like key, cipherMode, data and generate a hex encrypted value in return. I need to encrypt a field value using HMAC-SHA1 mechanism inside JavaScript code.

Can you please help me with the process?

Happy Campaigning

Sumit

Accepted Solutions (0)

Answers (3)

Answers (3)

yassinen4240628

27-09-2019

Hello,

Hope this will help you.

hmacStr

Calculates the MD5, SHA-1 or SHA-256 hash of a string of characters. The string is automatically encoded in UTF-8 before the calculation.

hmacStr (string [, key ] [, algo ])

Parameters

string

The string in which the hash is to be calculated.

key

Key, in the form of a string of characters. It is automatically converted into UTF-8. If the key is missing, the server will use a key that depends on the instance and is only valid on this instance.

algo

Type of hash to use. Possible values are "MD5", "SHA1" or "SHA256". Case is ignored, values can therefore be entered in lower case or upper case. The value "SHA1" is selected by default, if no parameter is specified.

You can find more info in here : ColdFusion Help | Encrypt

saikatk2447661

16-09-2018

var message=new MemoryBuffer();

message.fromString("saikat");

var key=new MemoryBuffer();

key.fromString("password");

logInfo(message.hmac(key,"SHA1"))

sivaramakumar_P

14-03-2017

Hi Sumit,

Did you get any process for the above requested requirement. to encrypt and external teams to decrypt the values.

Thanks,

Sivaramakumar