const crypto=require('crypto');
const value = "stringtohash";
const hash = crypto.createHash('sha256').update(value).digest('hex');
const salt = "somlargevaluerepresentingthesalt";
const pbkHash = crypto.pbkdf2Sync(value, salt, 100000, 32, 'sha256').toString('hex');
Solved! Go to Solution.
The JS policy supports a crypto class, which, contrary to its name, does hashing. Read about it here.
There is no PBKDF2 available in the Apigee Javascript policy.
What are you really trying to do? I know what a PBKDF2 does. I want to know why you are planning to use Apigee to invoke PBKDF2. Can you give me some broader context, and maybe we can explore options.