aes

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeanAESDecrypt

func BeanAESDecrypt(key, encryptedText string) (string, error)

This function will decrypt an AES encrypted text in base64. The `key` a.k.a passphrase is also encoded using base64.

func BeanAESEncrypt

func BeanAESEncrypt(key, plainText string) (string, error)

This function will encrypt a text using AES in base64. The `key` a.k.a passphrase is also encoded using base64.

func ComputeHmacSha256

func ComputeHmacSha256(message string, secret string) string

func Pkcs7Pad

func Pkcs7Pad(data []byte, blocklen int) ([]byte, error)

Pkcs7Pad right-pads the given byte slice with 1 to n bytes, where n is the block size. The size of the result is x times n, where x is at least 1.

func Pkcs7Unpad

func Pkcs7Unpad(data []byte, blocklen int) ([]byte, error)

Pkcs7Unpad validates and unpads data from the given bytes slice. The returned value will be 1 to n bytes smaller depending on the amount of padding, where n is the block size.

Types

This section is empty.

Jump to

Keyboard shortcuts

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