Documentation
¶
Index ¶
- Variables
- func Base64Decode(s string) ([]byte, error)
- func Base64Encode(data []byte) string
- func DecryptAES(s string, key []byte) ([]byte, error)
- func DecryptFileAES(inputPath, outputPath string, key []byte) error
- func EncryptAES(plaintext, key []byte) (string, error)
- func EncryptFileAES(inputPath, outputPath string, key []byte) error
- func GenerateAES256Key() ([]byte, error)
- func GenerateHMAC(message, key []byte, algorithm HashAlgorithm) (string, error)
- func GenerateKey(size int) ([]byte, error)
- func GeneratePassword(length int, hasSpecial, hasUppercase bool) (string, error)
- func Hash(input string, algorithm HashAlgorithm) (string, error)
- func HashFile(inputPath string, algorithm HashAlgorithm) (string, error)
- func HashPassword(password string) (string, error)
- func VerifyHMAC(message, key []byte, expected string, algorithm HashAlgorithm) (bool, error)
- func VerifyPassword(password, hash string) (bool, error)
- type HashAlgorithm
- type MatchResult
- type PasswordAnalysis
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultParams = &argon2id.Params{
Memory: 64 * 1024,
Iterations: 3,
Parallelism: 4,
SaltLength: 16,
KeyLength: 32,
}
Functions ¶
func Base64Decode ¶
func Base64Encode ¶
func DecryptFileAES ¶
func EncryptAES ¶
func EncryptFileAES ¶
func GenerateAES256Key ¶
func GenerateHMAC ¶
func GenerateHMAC(message, key []byte, algorithm HashAlgorithm) (string, error)
func GenerateKey ¶
func GeneratePassword ¶
func HashPassword ¶
func VerifyHMAC ¶
func VerifyHMAC(message, key []byte, expected string, algorithm HashAlgorithm) (bool, error)
func VerifyPassword ¶
Types ¶
type HashAlgorithm ¶
type HashAlgorithm string
const ( HashSHA1 HashAlgorithm = "sha1" HashMD5 HashAlgorithm = "md5" HashSHA3_256 HashAlgorithm = "sha3-256" HashSHA3_512 HashAlgorithm = "sha3-512" HashSHA256 HashAlgorithm = "sha256" HashSHA512 HashAlgorithm = "sha512" )
type MatchResult ¶
type PasswordAnalysis ¶
type PasswordAnalysis struct {
Entropy float64 `json:"entropy"`
CrackTime string `json:"crack_time"`
MatchSequence []MatchResult `json:"match_sequence"`
}
func AnalyzePassword ¶
func AnalyzePassword(password string) PasswordAnalysis
Click to show internal directories.
Click to hide internal directories.