kdf

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: MIT Imports: 18 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 added in v1.7.0

func ARGON2I(reader io.Reader, params Params, format string) ([]byte, error)

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

func ARGON2ID added in v1.7.0

func ARGON2ID(reader io.Reader, params Params, format string) ([]byte, error)

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

func BCRYPT added in v1.7.0

func BCRYPT(reader io.Reader, params Params, format string) ([]byte, error)

BCRYPT returns BCRYPT hash of content in reader formats: unix

func CRYPT added in v1.7.0

func CRYPT(reader io.Reader, params Params, format string) ([]byte, error)

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

func HKDF added in v1.7.0

func HKDF(reader io.Reader, params Params, format string) ([]byte, error)

HKDF returns an extended key using provided parameters. formats: raw, hex

func PBKDF2

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

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

func SCRYPT added in v1.7.0

func SCRYPT(reader io.Reader, params Params, format string) ([]byte, 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
	Info   string
	Salt   string
	Cost   int
}

Jump to

Keyboard shortcuts

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