Documentation ¶
Index ¶
- func DecodeBase64(b []byte) ([]byte, error)
- func DecryptAES(text []byte) ([]byte, error)
- func EncodeBase64(b []byte) []byte
- func GeneratePassword(password string, salt string) string
- func GenerateRandom(size int) string
- func GenerateRandomPassword() string
- func GenerateSalt() string
- func MakeAES(secret string) ([]byte, error)
- func MatchPassword(hashedPassword string, password string, salt string) bool
- func RandSalt() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeBase64 ¶
DecodeBase64 is a convenience function to decode using StdEncoding.
func DecryptAES ¶
DecryptAES decrypts an AES encoded []byte, using a hard-wired key value, suitable for use when reading an authentication token.
func EncodeBase64 ¶
EncodeBase64 is a convenience function to encode using StdEncoding.
func GeneratePassword ¶
GeneratePassword returns a hashed password.
func GenerateRandom ¶
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 ¶
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 ¶
MatchPassword copares a hashed password with a clear one.
Types ¶
This section is empty.