func GenerateRandomBytes(len uint32) []byte {
	result := make([]byte, len)
	if _, err := io.ReadFull(rand.Reader, result); err != nil {
		panic(err)
	}
	return result
}
GenerateRandomBytes generates a random sequence of bytes.
package encryption
import (
	"crypto/aes"
	"crypto/cipher"
	"crypto/hmac"
	"crypto/rand"
	"crypto/sha512"
	"errors"
	"io"
	"math/big"
	"github.com/golang/crypto/argon2"
)
const (
	TIME uint32 = 8
	MEMORY uint32 = 32 * 1024
	SALTLEN uint32 = 32
	KEYLEN uint32 = 32  
)
type PasswordStrength int
const (
	WEAK PasswordStrength = iota + 1
	ALPHANUMERIC
	NORMAL
	STRONG
	STRONGEST
)
var defaultPasswordCharRange []uint8
func init() {
	defaultPasswordCharRange = GetPasswordCharRange(STRONG)
}
func Encrypt(key, message []byte) ([]byte, error) {
	block, err := aes.NewCipher(key)
	if err != nil {
		return nil, err
	}
	ciphertext := make([]byte, aes.BlockSize+len(message))
	iv := ciphertext[:aes.BlockSize]
	if _, err := io.ReadFull(rand.Reader, iv); err != nil {
		return nil, err
	}
	cfb := cipher.NewCFBEncrypter(block, iv)
	cfb.XORKeyStream(ciphertext[aes.BlockSize:], message)
	return ciphertext, nil
}
func Decrypt(key, message []byte) ([]byte, error) {
	block, err := aes.NewCipher(key)
	if err != nil {
		return nil, err
	}
	if len(message) < aes.BlockSize {
		return nil, errors.New("Invalid ciphertext")
	}
	iv := message[:aes.BlockSize]
	message = message[aes.BlockSize:]
	cfb := cipher.NewCFBDecrypter(block, iv)
	cfb.XORKeyStream(message, message)
	return message, nil
}
func Hmac(key, message []byte) []byte {
	mac := hmac.New(sha512.New, key)
	mac.Write(message)
	return mac.Sum(nil)
}
func VerifyHmac(mac1, mac2 []byte) bool {
	return hmac.Equal(mac1, mac2)
}
func GenerateSalt() []byte {
	return GenerateRandomBytes(SALTLEN)
}