security

package
v0.0.0-...-f85af87 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const SALT_LENGTH = 16
View Source
const SCRYPT_N = 32768

Variables

This section is empty.

Functions

func DeriveKey

func DeriveKey(password string, salt []byte, keyLength, scrypt_N int) []byte

func DeriveKeyWithoutSalt

func DeriveKeyWithoutSalt(password string, keyLength, scrypt_N int) []byte

func GeneratePassword

func GeneratePassword(length int, useComplex bool) (string, error)

func HashMD5

func HashMD5(data []byte) string

func HashSHA1

func HashSHA1(data []byte) string

func HashSHA256

func HashSHA256(data []byte) string

func HashSHA3

func HashSHA3(data []byte) string

Keccak algorithm

func HashSHA512

func HashSHA512(data []byte) string

func HmacSHA256

func HmacSHA256(data, key []byte) []byte

func HmacSHA256_hex

func HmacSHA256_hex(data, key []byte) string

func HmacSHA256_verify

func HmacSHA256_verify(data, key, expectedHMAC []byte) bool

func HmacSHA256_verify_hex

func HmacSHA256_verify_hex(data, key []byte, hex_hmac string) bool

func HmacSHA3

func HmacSHA3(data, key []byte) []byte

func HmacSHA3_hex

func HmacSHA3_hex(data, key []byte) string

func HmacSHA3_verify

func HmacSHA3_verify(data, key, expectedHMAC []byte) bool

func HmacSHA3_verify_hex

func HmacSHA3_verify_hex(data, key []byte, hex_hmac string) bool

func HmacSHA512

func HmacSHA512(data, key []byte) []byte

func HmacSHA512_hex

func HmacSHA512_hex(data, key []byte) string

func HmacSHA512_verify

func HmacSHA512_verify(data, key, expectedHMAC []byte) bool

func HmacSHA512_verify_hex

func HmacSHA512_verify_hex(data, key []byte, hex_hmac string) bool

func Pbkdf2Key

func Pbkdf2Key(password string, salt []byte, keyLength, iterations int) []byte

PBKDF2 (Password-Based Key Derivation Function 2)

func RandomBytes

func RandomBytes(len int) ([]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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