cryptoutils

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: ISC Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AES256IVSize int = aes.BlockSize
)

Variables

View Source
var Zero = AES256Key{}

Functions

func DecryptAES256

func DecryptAES256(inputData []byte, key AES256Key) ([]byte, error)

func EncryptAES256

func EncryptAES256(inputData []byte, key AES256Key) ([]byte, error)

func PadPKCS5

func PadPKCS5(data []byte, blockSize int) []byte

func RandomBytes

func RandomBytes(n int) []byte

func UnpadPKCS5

func UnpadPKCS5(data []byte, blockSize int) ([]byte, error)

Types

type AES256Key

type AES256Key [32]byte

func (AES256Key) Bytes

func (key AES256Key) Bytes() []byte

func (*AES256Key) FromBase64

func (key *AES256Key) FromBase64(s string) error

func (*AES256Key) FromHex

func (key *AES256Key) FromHex(s string) error

func (AES256Key) Hex

func (key AES256Key) Hex() string

func (AES256Key) IsZero

func (key AES256Key) IsZero() bool

func (AES256Key) MarshalJSON

func (key AES256Key) MarshalJSON() ([]byte, error)

func (*AES256Key) UnmarshalJSON

func (pkey *AES256Key) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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