secrets

package
v3.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: AGPL-3.0 Imports: 9 Imported by: 35

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBase64

func DecodeBase64(b []byte) ([]byte, error)

DecodeBase64 is a convenience function to decode using StdEncoding.

func DecryptAES

func DecryptAES(text []byte) ([]byte, error)

DecryptAES decrypts an AES encoded []byte, using a hard-wired key value, suitable for use when reading an authentication token.

func EncodeBase64

func EncodeBase64(b []byte) []byte

EncodeBase64 is a convenience function to encode using StdEncoding.

func GeneratePassword

func GeneratePassword(password string, salt string) string

GeneratePassword returns a hashed password.

func GenerateRandom

func GenerateRandom(size int) string

GenerateRandom returns a string of the specified length using crypo/rand

func GenerateRandomPassword

func GenerateRandomPassword() string

GenerateRandomPassword provides a string suitable for use as a password.

func GenerateSalt

func GenerateSalt() string

GenerateSalt provides a string suitable for use as a salt value.

func MakeAES

func MakeAES(secret string) ([]byte, error)

MakeAES creates an AES encryption of of a given string, using a hard-wired key value, suitable for use as an authentication token.

func MatchPassword

func MatchPassword(hashedPassword string, password string, salt string) bool

MatchPassword copares a hashed password with a clear one.

func RandSalt added in v1.51.0

func RandSalt() string

RandSalt generates 16 character value for use in JWT token as salt.

Types

This section is empty.

Jump to

Keyboard shortcuts

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