security

package
v0.0.0-...-45a6ba4 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordConfirm

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