util

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Argon2IDPasswordHash

func Argon2IDPasswordHash(plain string, conf Argon2idConfig) (string, error)

func Argon2IDPasswordVerify

func Argon2IDPasswordVerify(hash, plain string) error

func BytesToString

func BytesToString(in []byte) string

func MarshalED25519PrivateKey

func MarshalED25519PrivateKey(key ed25519.PrivateKey) []byte

MarshalED25519PrivateKey writes ed25519 private keys into the new OpenSSH private key format. I have no idea why this isn't implemented anywhere yet, you can do seemingly everything except write it to disk in the OpenSSH private key format. taken from https://github.com/mikesmitty/edkey/blob/master/edkey.go

func MercuryInRetrograde

func MercuryInRetrograde() (bool, error)

Types

type Argon2idConfig

type Argon2idConfig struct {
	Memory      uint32 // KiB - main "knob" to turn for more expensive hashes
	Iterations  uint32 // if memory cant go higher, iterations should, to compensate
	Parallelism uint8  // used to spread the load across multiple CPU threads (if used, iterations should be increased)

	SaltLen uint32 // bytes
	KeyLen  uint32 // bytes
}

Argon2idConfig provides an easier structure for Argon2id password hashing.

The main gist (not 100% accurate, but close enough) is: complexity = memory * iterations / parallelism.

func DefaultArgon2idConf

func DefaultArgon2idConf() Argon2idConfig

DefaultArgon2idConf provides standard sane parameters chosen to not overload the parser service.

Jump to

Keyboard shortcuts

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