gcrypto

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: MIT Imports: 10 Imported by: 0

README

gcrypto

godoc tests sec coverage go-report license

Thin wrapper around Go's standard crypto library.

API
  • GenerateRandomKey: Generates a random byte array key (NOTE: don't use this for human readable keys).
  • HMACSHA256: Generates an HMAC SHA256 of given body with provided key.
  • SHA256: Generates SHA256 of given body.
  • MD5: Generates MD5 of given body.
  • AES256Encrypt: Apply AES-256 encryption on the given body with the provided key.
  • AES256Decrypt: Apply AES-256 decryption on the given data with the provided key.
Testing

make test

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AES256Decrypt added in v1.1.0

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

AES256Decrypt will run AES-256 decryption on the provided data.

func AES256Encrypt added in v1.1.0

func AES256Encrypt(message []byte, key []byte) ([]byte, error)

AES256Encrypt will run AES-256 excryption on the provided message.

func GenerateRandomKey added in v1.1.0

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

GenerateRandomKey will generate a new random key.

func HMACSHA256

func HMACSHA256(secret string, message string) (string, error)

HMACSHA256 returns a SHA-256 of the given message signed by the secret.

func MD5

func MD5(message string) (string, error)

MD5 returns the MD5 checksum of a given message.

func SHA256

func SHA256(message string) (string, error)

SHA256 returns a SHA-256 of the given message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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