Whatever message this page gives is out now! Go check it out!

VerifySCryptHash

Last update:
May 18, 2026

Description

This function accepts a plain text and hashed value and compares the text with the hashed value.

Syntax

VerifySCryptHash(plaintext, hashedString, options)

History

ColdFusion (2021 release): Added this function.

Parameters

Parameter
Description
plaintext
(Required) The input string on which the hash function must be run.
hashedString
(Required) The hashed output from the GenerateSCryptHash function.
options
(Optional) A struct with the following values:
  • keyLength - key length for the algorithm (as defined in scrypt this is dkLen). The default is currently 32.

Example

<cfscript> 
    stringToEncrypt="Sample string" 
    options = StructNew()  
    options.cpucost = 1024  
    options.memorycost = 64  
    options.keylength = 16  
    options.saltlength = 8 
    sCrypted=GenerateSCryptHash(stringToEncrypt,options)  
    // struct 
    decryptOptions = structNew() 
    decryptOptions.keylength=16 
    backToString = VerifySCryptHash(stringToEncrypt, sCrypted, decryptOptions) 
    writeDump(backToString)  
</cfscript>

Output

YES

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page