crypto

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESGCMDecrypt

func AESGCMDecrypt(data, key []byte) ([]byte, error)

AESGCMDecrypt decrypts data encrypted by AESGCMEncrypt Return errors if the data can not be decrypted or can not pass integrity verification

func AESGCMEncrypt

func AESGCMEncrypt(data, key []byte) ([]byte, error)

AESGCMEncrypt encrypts data by AES in GCM mode with random nonce header `data` can be bytes in any length `key` should be a slice with length 16 / 24 / 32 Result = (Nonce [12] byte + EncryptedData [] byte + Tag [16] byte)

func HmacSha2Sum256

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

HmacSha2Sum256 calculates HMAC-SHA2-256 signature

func HmacSha3Sum256

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

HmacSha3Sum256 calculates HMAC-SHA3-256 signature

func RandomBytes

func RandomBytes(data []byte) error

func Sha2Sum256

func Sha2Sum256(data []byte) []byte

Sha2Sum256 calculates Sha2-256 hash

func Sha3Sum256

func Sha3Sum256(data []byte) []byte

Sha3Sum256 calculates Sha3-256 hash

Types

This section is empty.

Jump to

Keyboard shortcuts

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