security

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordConfirm added in v1.5.1

func CheckPasswordConfirm(password, confirm []byte) bool

CheckPasswordConfirm checks two byte array if the content is the same.

func GenerateOTPCode

func GenerateOTPCode(token string, when time.Time, length uint) (string, int64, error)

GenerateOTPCode generates a 6 digit TOTP from the secret Token.

func UnsecureSHA1

func UnsecureSHA1(text string) []byte

UnsecureSHA1 is not secure, but makes a fixed length password. With v2, I'm planning to move away from it, but that would break all existing vaults, so I have to be careful and make sure a proper migration script/function exists.

Types

type OTPError

type OTPError struct {
	Message string
}

OTPError is an error describing an error during generation.

func (OTPError) Error

func (e OTPError) Error() string

Jump to

Keyboard shortcuts

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