sel-0.0.1.0: Cryptography for the casual user
Copyright(C) Seth Paul Hubbard 2023
LicenseBSD-3-Clause
MaintainerThe Haskell Cryptography Group
StabilityStable
PortabilityGHC only
Safe HaskellSafe-Inferred
LanguageHaskell2010

Sel.Scrypt

Description

 
Synopsis

Introduction

This API is used for hashing and verifying passwords using the Scrypt algorithm. This module is provided for interoperability with other applications. If you do not need to use Scrypt specifically, use Sel.Hashing.Password.

data ScryptHash Source #

A hashed password from the Scrypt algorithm.

Since: 0.0.1.0

Instances

Instances details
Show ScryptHash Source #

Since: 0.0.1.0

Instance details

Defined in Sel.Scrypt

Eq ScryptHash Source #

Since: 0.0.1.0

Instance details

Defined in Sel.Scrypt

Ord ScryptHash Source #

Since: 0.0.1.0

Instance details

Defined in Sel.Scrypt

Display ScryptHash Source #

Since: 0.0.1.0

Instance details

Defined in Sel.Scrypt

Password Hashing and Verifying.

scryptHashPassword :: StrictByteString -> IO ScryptHash Source #

Hash the password with the Scrypt algorithm and a set of pre-defined parameters.

The hash is encoded in a human-readable format that includes:

  • The result of a memory-hard, CPU-intensive hash function applied to the password;
  • The automatically generated salt used for the previous computation;
  • The other parameters required to verify the password, including the algorithm identifier, its version, opslimit, and memlimit.

Example output: "$7$C6........dLONLMz8YfO.EKvzwOeqWVVLmXg62MC.hL1m1sYtO/$X9eNjVxdD4jHAhOVid3OLzNkpv6ADJSAXygOxXqGHg7NUL"

Since: 0.0.1.0

scryptVerifyPassword :: StrictByteString -> ScryptHash -> IO Bool Source #

Verify a hashed password against a password verification string. This returns True if successful.

Since: 0.0.1.0

Conversion

scryptHashToText :: ScryptHash -> Text Source #

Convert a ScryptHash to a hexadecimal-encoded Text.

Since: 0.0.1.0

asciiTextToScryptHash :: Text -> ScryptHash Source #

Convert an ASCII-encoded password hash to a ScryptHash

This function does not perform ASCII validation.

Since: 0.0.1.0

asciiByteStringToScryptHash :: StrictByteString -> ScryptHash Source #

Convert an ASCII-encoded password hash to a ScryptHash

This function does not perform ASCII validation.

Since: 0.0.1.0