community: Index | Files

package secrets

import ""


Package Files

aes.go base64.go password.go salt.go

func DecodeBase64 Uses

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

DecodeBase64 is a convenience function to decode using StdEncoding.

func DecryptAES Uses

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 Uses

func EncodeBase64(b []byte) []byte

EncodeBase64 is a convenience function to encode using StdEncoding.

func GeneratePassword Uses

func GeneratePassword(password string, salt string) string

GeneratePassword returns a hashed password.

func GenerateRandom Uses

func GenerateRandom(size int) string

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

func GenerateRandomPassword Uses

func GenerateRandomPassword() string

GenerateRandomPassword provides a string suitable for use as a password.

func GenerateSalt Uses

func GenerateSalt() string

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

func MakeAES Uses

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 Uses

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

MatchPassword copares a hashed password with a clear one.

func RandSalt Uses

func RandSalt() string

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

Package secrets imports 9 packages (graph) and is imported by 19 packages. Updated 2017-11-18. Refresh now. Tools for package owners.