hash

package
v0.0.0-...-1dbdc72 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(passwd []byte, device string, opts ...Option) ([]byte, error)

Hash is a compatibility layer with sedutil.

Instead of sending a raw password to hardware it hashes it with pbkdf2 using device's serial as a salt.

The original sedutil uses SHA1 hashing whereas some forks already switched to SHA512 in order to enhance security.

Types

type Option

type Option func(s *settings)

Option is a Hash configuration option.

func WithIterations

func WithIterations(iter int) Option

WithIterations sets the iterations count.

func WithKeyLength

func WithKeyLength(length int) Option

WithKeyLength sets the generated key length in bytes.

func WithSHA512

func WithSHA512(enabled bool) Option

WithSHA512 uses SHA512 hashing function instead of the default SHA1.

func WithSalt

func WithSalt(salt []byte) Option

Jump to

Keyboard shortcuts

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