Index: openacs-4/packages/acs-tcl/tcl/security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/security-procs.tcl,v diff -u -r1.126.2.55 -r1.126.2.56 --- openacs-4/packages/acs-tcl/tcl/security-procs.tcl 1 Oct 2021 07:30:07 -0000 1.126.2.55 +++ openacs-4/packages/acs-tcl/tcl/security-procs.tcl 3 Oct 2021 18:13:38 -0000 1.126.2.56 @@ -681,7 +681,7 @@ hash length. We use 15K iterations for PBKDF2 as recommended in RFC 7677. - @return hex encoded password hash + @return hex encoded password hash (64 bytes) } { return [::ns_crypto::pbkdf2_hmac \ -digest sha256 \ @@ -690,6 +690,19 @@ -salt $salt] } } + + if {[::acs::icanuse "ns_crypto::scrypt"]} { + ad_proc -private scrypt-16384-8-1 {password salt} { + + Compute a "password hash" using the scrypt password based + key derivation function (RFC 7914) + + @return hex encoded password hash (128 bytes) + } { + return [::ns_crypto::scrypt -secret $password -salt $salt -n 16384 -r 8 -p 1] + } + } + } ad_proc -public ad_check_password {