security

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComparePasswordAndHash added in v1.1.0

func ComparePasswordAndHash(password, encodedHash string) (match bool, err error)

ComparePasswordAndHash Compares the input password and the previously generated hash and checks if plain password matches the encrypted password

func DecryptAES added in v1.1.0

func DecryptAES(encryptedinput string, secret string) string

DecryptAES decrypts a encrypted aes string data to plain text

func EncryptToAES added in v1.1.0

func EncryptToAES(input string, secret string) string

EncryptToAES encrypts the given plain text data to encrypted string

func GenerateFromPassword added in v1.1.0

func GenerateFromPassword(password string) (encodedHash string, err error)

GenerateFromPassword generates a argon2 hash on the input password

func GenerateRandomSecret added in v1.1.0

func GenerateRandomSecret() string

GenerateRandomSecret generates a random 32 byte secret to use for encryption

func RandomString added in v1.2.0

func RandomString(len int) string

RandomString Generates a random string of A-Z chars with len = l

Types

This section is empty.

Jump to

Keyboard shortcuts

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