kdf

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package kdf computes key derivation and stretching algorithms like bcrypt and argon2

Index

Constants

This section is empty.

Variables

View Source
var DefaultParams = Params{
	Time:   3,
	Memory: 32 * 1024,
	Iter:   10000,
	Hmac:   sha256.New,
	Scrypt: gsk.DefaultParams,
	Cost:   10,
}
View Source
var KeyLen = 32
View Source
var SaltLen = 32

Functions

func Argon2i

func Argon2i(reader io.Reader, params Params, format string) (string, error)

Argon2i returns Argon2i hash of content in reader formats: raw, unix

func Argon2id

func Argon2id(reader io.Reader, params Params, format string) (string, error)

Argon2id returns Argon2id hash of content in reader formats: raw, unix

func Bcrypt

func Bcrypt(reader io.Reader, params Params, format string) (string, error)

Bcrypt returns Bcrypt hash of content in reader formats: unix

func Crypt added in v1.6.0

func Crypt(reader io.Reader, params Params, format string) (string, error)

Crypt returns crypt-sha512 hash of content in reader formats: unix

func PBKDF2

func PBKDF2(reader io.Reader, params Params, format string) (string, error)

PBKDF2 returns PBKDF2 hash of content in reader formats: raw, unix

func Scrypt

func Scrypt(reader io.Reader, params Params, format string) (string, error)

Scrypt returns Scrypt hash of content in reader formats: raw, tarsnap

Types

type Params

type Params struct {
	Time   uint32
	Memory uint32
	Iter   uint32
	Hmac   func() hash.Hash
	Scrypt gsk.Params
	Cost   int
}

Jump to

Keyboard shortcuts

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