argon2id

package
v0.0.0-...-10b34cd Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package argon2id provides a convience wrapper around Go's golang.org/x/crypto/argon2 implementation, making it simpler to securely hash and verify passwords using Argon2.

It enforces use of the Argon2id algorithm variant and cryptographically-secure random salts.

Index

Constants

This section is empty.

Variables

View Source
var (
	StringVersion = strconv.Itoa(argon2.Version)

	// ErrInvalidHash in returned by ComparePasswordAndHash if the provided
	// hash isn't in the expected format.
	ErrInvalidHash = errors.New("argon2id: hash is not in the correct format")

	// ErrIncompatibleVariant is returned by ComparePasswordAndHash if the
	// provided hash was created using a unsupported variant of Argon2.
	// Currently only argon2id is supported by this package.
	ErrIncompatibleVariant = errors.New("argon2id: incompatible variant of argon2")

	// ErrIncompatibleVersion is returned by ComparePasswordAndHash if the
	// provided hash was created using a different version of Argon2.
	ErrIncompatibleVersion = errors.New("argon2id: incompatible version of argon2")
)

Functions

func CompareHashes

func CompareHashes(hash1, hash2 string) (bool, error)

func DecodeHash

func DecodeHash(hash string) (key []byte, err error)

func ValidHash

func ValidHash(hash string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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