Documentation ¶
Overview ¶
scrypth64 derives password hashes and verifies passwords against them according to the scrypt-h64 specification. It includes a number of ready to use parameter sets. The modular crypt format is used, and its de-facto standard as well as historic precedents are followed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Mcf ¶
type Mcf string
Mcf is a custom string type to indicate that the underlying string is subject to specific formatting rules
func Digest ¶
Digest calculates a new scrypt digest and returns it as a scrypt-h64 MCF formatted string. If params is nil, DefaultParams are used. Returns an empty string if err != nil.
func FromString ¶
FromString takes a string, validates it and returns it as a custom typed Mcf string.
type Parameter ¶
type Parameter struct { Iterations uint16 // log2 of the iteration count BlockSizeFactor uint8 // scrypt r parameter Parallelism uint8 // scrypt p parameter Length uint16 // output length in bytes, dkLen parameter SaltLength uint16 // salt length in bytes }
Parameter contains all required parameters for scrypth64
func DefaultParams ¶
func DefaultParams() *Parameter
DefaultParams returns a prefilled *Parameter with default values. The defaults represent a 64MiByte memory consumption by scrypt per calculation and are intended for 2016 high performance datacenter equipment, not mobile gadgets. Uses a 512bit salt and 384bit digest.
func HighParams ¶
func HighParams() *Parameter
HighParams returns a prefilled *Parameter with the recommended high security parameters from the scrypt paper. These represent 1GiByte of used memory per scrypt calculation.
func PaperParams ¶
func PaperParams() *Parameter
PaperParams returns a prefilled *Parameter with the recommended values from the scrypt paper. These represent 16MiByte of used memory per scrypt calculation. Additional values are chosen with popular values.