úÎ!HE˜     (c) Dennis Gosnell, 2019BSD-style (see LICENSE file)cdep.illabout@gmail.com experimentalPOSIXNoneMD­passwordTThe result of a checking a password against a hashed version. This is returned by .passwordXThe password check was successful. The plain-text password matches the hashed password.passwordXThe password check failed. The plain-text password does not match the hashed password.passwordA hashed password.zThis represents a password that has been put through a hashing function. The hashed password can be stored in a database. passwordA plain-text password./This represents a plain-text password that has NOT been hashed.You should be careful with  ?. Make sure not to write it to logs or store it in a database.You can construct a   by using the  c function or as literal strings together with the OverloadedStrings pragma (or manually, by using  on a C). Alternatively, you could also use some of the instances in the password-instances library. password Construct a  password?This is an unsafe function that shows a password in plain-text.(unsafeShowPasswordText $ mkPass "foobar""foobar"+You should generally not use this function. password This is like   but produces a  instead of a .password Convert an  Crypto.Scrypt. to our   type.passToScryptPass "foobar"Pass {getPass = "foobar"}password Convert an  Crypto.Scrypt.  to our  type.This is the opposite of !.2let salt = Salt "abcdefghijklmnopqrstuvwxyz012345"let pass = Scrypt.Pass "foobar"7let encryptedPass = encryptPass defaultParams salt pass encryptedPass±EncryptedPass {getEncryptedPass = "14|8|1|YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXowMTIzNDU=|nENDaqWBmPKapAqQ3//H0iBImweGjoTqn5SvBS8Mc9FPFbzq6w65maYPZaO+SPamVZRXQjARQ8Y+5rhuDhjIhw=="}+scryptEncryptedPassToPassHash encryptedPass¦PassHash {unPassHash = "14|8|1|YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXowMTIzNDU=|nENDaqWBmPKapAqQ3//H0iBImweGjoTqn5SvBS8Mc9FPFbzq6w65maYPZaO+SPamVZRXQjARQ8Y+5rhuDhjIhw=="}RscryptEncryptedPassToPassHash (passHashToScryptEncryptedPass passHash) == passHash!password Convert out  type to  Crypto.Scrypt. .This is the opposite of .2let salt = Salt "abcdefghijklmnopqrstuvwxyz012345"let pass = Scrypt.Pass "foobar"7let encryptedPass = encryptPass defaultParams salt pass encryptedPass±EncryptedPass {getEncryptedPass = "14|8|1|YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXowMTIzNDU=|nENDaqWBmPKapAqQ3//H0iBImweGjoTqn5SvBS8Mc9FPFbzq6w65maYPZaO+SPamVZRXQjARQ8Y+5rhuDhjIhw=="}+scryptEncryptedPassToPassHash encryptedPass¦PassHash {unPassHash = "14|8|1|YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXowMTIzNDU=|nENDaqWBmPKapAqQ3//H0iBImweGjoTqn5SvBS8Mc9FPFbzq6w65maYPZaO+SPamVZRXQjARQ8Y+5rhuDhjIhw=="}PpassHashToScryptEncryptedPass (scryptEncryptedPassToPassHash encPass) == encPass password Just like , but generate a new  everytime with a call to .hashPass $ mkPass "foobar"(PassHash {unPassHash = "14|8|1|...|..."}passwordHash a password with the given .The resulting 5 has the parameters used to hash it, as well as the  appended to it, separated by |. The input  and resulting  are both byte-64 encoded.2let salt = Salt "abcdefghijklmnopqrstuvwxyz012345"'hashPassWithSalt salt (mkPass "foobar")¦PassHash {unPassHash = "14|8|1|YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXowMTIzNDU=|nENDaqWBmPKapAqQ3//H0iBImweGjoTqn5SvBS8Mc9FPFbzq6w65maYPZaO+SPamVZRXQjARQ8Y+5rhuDhjIhw=="}(Note that we use an explicit d in the example above. This is so that the example is reproducible, but in general you should use  .   generates a new  everytime it is called.)>This function uses the hash function from the scrypt package: ".passwordCheck a   against a .Returns  on success.2let salt = Salt "abcdefghijklmnopqrstuvwxyz012345"let pass = mkPass "foobar")let passHash = hashPassWithSalt salt passcheckPass pass passHashPassCheckSuccessReturns  If an incorrect   or  is used.)let badpass = mkPass "incorrect-password"checkPass badpass passHash PassCheckFail:This should always fail if an incorrect password is given.~\(Blind badpass) -> let correctPassHash = hashPassWithSalt salt "foobar" in checkPass badpass correctPassHash == PassCheckFailpasswordGenerate a random 32-byte salt.password CAREFUL: #-ing a   will always print "**PASSWORD**"show $ mkPass "hello""**PASSWORD**"    SafeEs$%&'()*+,       !"#$% &'()*+,-./01234'password-1.0.0.0-7rYP9nM2fVzKNktDbHL3ZJ Data.PasswordPaths_password#scrypt-0.5.0-3wjprYbIlw64S4yzGzfh3b Crypto.ScryptgetSaltSalt PassCheckPassCheckSuccess PassCheckFailPassHash unPassHashPassmkPassunsafeShowPasswordunsafeShowPasswordTexthashPasshashPassWithSalt checkPassnewSalt $fShowPass$fIsStringPass $fEqPassHash $fOrdPassHash$fReadPassHash$fShowPassHash $fEqPassCheck$fReadPassCheck$fShowPassCheckbase Data.String fromStringGHC.BaseString text-1.2.3.1Data.Text.InternalTextpassToScryptPassscryptEncryptedPassToPassHash EncryptedPasspassHashToScryptEncryptedPass encryptPassGHC.ShowShowversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName