This function compares a plaintext entry to the hashed string.
NOTE 1:Hashing is one-way, so you can't "decrypt" a hashed value. You have to hash the value you want to check and then compare that to the saved hash.
verifySCryptHash(plaintext,hashedstring);
→ returns boolean
{"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 to check against a hashed value.
secretMsg="$e0801$21aGCy86deU=$Yp2UaxwONLNgp0kUaBwuXAqsnFaAjOAUislNejW6Bjs=";
checkMe="My voice is my passport. Verify me."
writeOutput(verifySCryptHash(checkMe,secretMsg);
Expected Result: YES
This is an example of using the function to check against a hashed value when the options were previously set.
secretMsg="$c0401$Eg7sS/HsxhHTWA==$sejraZ7kZZ82adEz8uHHUz51Hk36YkkJ4KZk3w==";
checkMe="Setec Astronomy"
writeOutput(verifySCryptHash(checkMe,secretMsg);
Expected Result: YES
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.