argon2id

package module
v0.0.0-...-9af0d81 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2020 License: MIT Imports: 8 Imported by: 0

README

argon2id

GoDoc

Optionally, install the CLI. (Plain go install is not supported.)

git@gitlab.com:variadico/argon2id.git
make install

Documentation

Overview

Package argon2id lightly wraps crypto/argon2 to make it a little easier to work with.

Index

Constants

This section is empty.

Variables

View Source
var DefaultParams = Params{
	Time:      1,
	Memory:    64 * 1024,
	Threads:   4,
	KeyLength: 32,
}

DefaultParams are draft RFC recommended params.

View Source
var ErrPasswordMismatch = errors.New("argon2id: password mismatch")

ErrPasswordMismatch is returned by Verify is the hash and password don't match.

Functions

func Hash

func Hash(password string, p Params) (string, error)

Hash takes a password and returns an encoded string hash. The hash contains the algorithm parameters, the salt, and the password hash.

func Verify

func Verify(hash, password string) error

Verify checks an encoded hash against a password. Returns true if the password matches the hash.

Types

type Params

type Params struct {
	Time      uint32
	Memory    uint32
	Threads   uint8
	KeyLength uint32
}

Params are the parameters to argon2id.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL