kdf

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 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

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

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

func ARGON2ID

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

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

func BCRYPT

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

BCRYPT returns BCRYPT hash of content in reader formats: unix

func CRYPT

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

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

func HKDF

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

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