passwd

package
v0.12.6 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDerivedKey

func CreateDerivedKey(password string) (_ string, err error)

CreateDerivedKey creates an encoded derived key with a random hash for the password.

func IsDerivedKey added in v0.2.0

func IsDerivedKey(s string) bool

func ParseDerivedKey

func ParseDerivedKey(encoded string) (dk, salt []byte, time, memory uint32, threads uint8, err error)

ParseDerivedKey returns the parts of the encoded derived key string.

func VerifyDerivedKey

func VerifyDerivedKey(dk, password string) (_ bool, err error)

VerifyDerivedKey checks that the submitted password matches the derived key.

Types

type PasswordStrength added in v0.2.0

type PasswordStrength uint8
const (
	Weak PasswordStrength = iota
	Poor
	Fair
	Moderate
	Strong
	Excellent
)

func Strength added in v0.2.0

func Strength(password string) PasswordStrength

Strength is currently a very simple password strength algorithm that simply checks the length and contents of a password to ensure that reasonable passwords are added to Quarterdeck. In the future this algorithm can be strengthened with zxcvbn algorithms. TODO: implement dictionary word, spatial closeness, and l33t strength algorithms. See: https://nulab.com/learn/software-development/password-strength/

Jump to

Keyboard shortcuts

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