Use CryptoJS to encrypt / sign payload

Viewed 66

I have the following code that generates a signature using the node crypto lib:

const crypto = require('crypto');
...
const signature = crypto.sign('sha256', Buffer.from(message), privateKey);

Is there a way to generate the same signature using the node crypto-js lib? I am using a Postman pre-request script which provides a node env with access to the crypto-js lib but not the crypto lib.

cryptojs doc

crypto doc

0 Answers
Related