security

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Decode

func Base64Decode(s string) (string, *errors.Error)

Base64Decode base64 decodes a string and returns it.

func Base64Encode

func Base64Encode(s string) string

Base64Encode base64 encodes a string and returns it.

func DecryptPassword

func DecryptPassword(data, passphrase string) (string, *errors.Error)

DecryptPassword decrypted the data provided. If a passphrase was used to encrypt the password then the same passphrase needs to be passes to decrypt the password correctly.

func EncryptPassword

func EncryptPassword(data, passphrase string) (string, *errors.Error)

EncryptPassword encrypts the data provided. The encryption can also be further secured using a passphrase.

func GetRandomPassword

func GetRandomPassword() string

GetRandomPassword generates a random string of upper + lower case alphabets and digits which is 23 bits long and returns the string

func VerifyPassword

func VerifyPassword(password string) *errors.Error

VerifyPassword checks if the password is strong. The function checks if the password string is at least 8 character long, has an uppercase character, a lower case character, a number and a special character. If one of this condition fails the function returns an invalid password error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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