It is a salted password-hashing cryptographic function that takes an input and hashes it into a fixed size output.
NOTE: This function is less secure than BCrypt.
generateSCryptHash(plaintext,options);
→ returns string
{"memorycost":8,"CpuCost":16348,"Parallel":1,"KeyLength":32,"saltLength":8}
N
) that must be a power of 2 and greater than 1. Default is currently 16,348 or 2^14.P
). Default is currently 1.dkLen
). Default is currently 32.This is an example of using the function with no options.
secretMsg=generateSCryptHash("My voice is my passport. Verify me.");
writeOutput(secretMsg)
Expected Result: $e0801$BEJ9Ob8ZvoY=$LpQ79jMomeePrvBjcWRl3SrVf69962Ztn4WV/Sse4jg=
This is an example of using the function with options specified.
secretMsg=generateBCryptHash("My voice is my passport. Verify me.",{"memorycost":4,"CpuCost":4096,"Parallel":1,"KeyLength":28,"saltLength":10});
writeOutput(secretMsg)
Expected Result: $c0401$6TTkF3GRLGrHAw==$NGPASIOKsgNLDOZPyTvn9rrSW3F+IkHLlPWevQ==
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.