25 lines
961 B
Plaintext
25 lines
961 B
Plaintext
<cfparam name="passwd" default=""/>
|
|
<cfset tStart=GetTickCount()/>
|
|
<cfoutput>
|
|
<form action="" method="post">
|
|
<input type="password" name="passwd"/>
|
|
<input type="submit"/>
|
|
<br/>
|
|
<cfset h=GenerateArgon2Hash(passwd, 'argon2id', 1, 16000, 2)/>
|
|
<cfset hdef=GenerateArgon2Hash(passwd)/>
|
|
<cfoutput>#h#</cfoutput><br/>
|
|
<cfoutput>#hdef#</cfoutput><br/>
|
|
<!---input variant parallelizmFactor memoryCost iterations--->
|
|
<!--- in Lucee 6 optional arguments are not supported --->
|
|
<!---https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#argon2id--->
|
|
<br/>
|
|
Argon2CheckHash(passwd, h, 'argon2id'):#Argon2CheckHash(passwd, h, 'argon2id')#<br/>
|
|
Argon2CheckHash(passwd, h):#Argon2CheckHash(passwd, h)#<br/>
|
|
|
|
Argon2CheckHash(passwd, hdef, 'argon2id'):#Argon2CheckHash(passwd, hdef, 'argon2id')#<br/>
|
|
Argon2CheckHash(passwd, hdef):#Argon2CheckHash(passwd, hdef)#<br/>
|
|
</form>
|
|
#(GetTickCount()-tStart)# ms
|
|
</cfoutput>
|
|
|