scrypt

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeriveKey

func DeriveKey(o []DeriveOptionsBuilder) ([]byte, error)

Types

type DeriveOptionsBuilder

type DeriveOptionsBuilder func(*DeriveOpts)

DeriveOptionsBuilder creates the options to derive a key from scrypt.

func DefaultDeriveOptions

func DefaultDeriveOptions() DeriveOptionsBuilder

func FromEncryptedKey

func FromEncryptedKey(length, n, p, r int, salt []byte) DeriveOptionsBuilder

func RandomSalt

func RandomSalt() (DeriveOptionsBuilder, error)

func WithPassphrase

func WithPassphrase(passphrase string) DeriveOptionsBuilder

WithPassphrase adds passphrase to the dervive options

type DeriveOpts

type DeriveOpts struct {
	Len        int    `json:"len"`
	N          int    `json:"n"`
	P          int    `json:"p"`
	R          int    `json:"r"`
	Salt       []byte `json:"salt"`
	Passphrase string `json:"-"`
}

func CreateOptions

func CreateOptions(o []DeriveOptionsBuilder) *DeriveOpts

func (DeriveOpts) KDF

func (d DeriveOpts) KDF() string

Jump to

Keyboard shortcuts

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