aes

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AesCbc128KeyLen key len: 16
	AesCbc128KeyLen = 16
	// AesCbc192KeyLen key len: 24
	AesCbc192KeyLen = 24
	// AesCbc256KeyLen key len: 32
	AesCbc256KeyLen = 32
	// IvLen iv len: 16
	IvLen = 16
)

Variables

This section is empty.

Functions

func AesCbcDecrypt

func AesCbcDecrypt(key, iv, src []byte) ([]byte, error)

AesCbcDecrypt the ase cbc decrypt method

func AesCbcDecryptBase64

func AesCbcDecryptBase64(key, iv []byte, msg string) ([]byte, error)

AesCbcDecryptBase64 decrypt base64 msg

func AesCbcDecryptHex

func AesCbcDecryptHex(key, iv []byte, msg string) ([]byte, error)

AesCbcDecryptHex decrypt hex msg

func AesCbcEncrypt

func AesCbcEncrypt(key, iv, src []byte) ([]byte, error)

AesCbcEncrypt the aes cbc encrypt method

func AesCbcEncryptBase64

func AesCbcEncryptBase64(key, iv, src []byte) (string, error)

AesCbcEncryptBase64 return base64 result

func AesCbcEncryptHex

func AesCbcEncryptHex(key, iv, src []byte) (string, error)

AesCbcEncryptHex return hex result

Types

type AesCbc

type AesCbc struct {
	// contains filtered or unexported fields
}

AesCbc the base aes cbc structure

func NewAesCbc

func NewAesCbc(key, iv []byte) (*AesCbc, error)

NewAesCbc new aes cbc cipher aescbc support key len 16 24 32 match aescbc-128 aescbc-192 aescbc-256 iv len must be 16

func (*AesCbc) Decrypt

func (a *AesCbc) Decrypt(src []byte) ([]byte, error)

Decrypt the aes cbc decrypt method

func (*AesCbc) Encrypt

func (a *AesCbc) Encrypt(src []byte) ([]byte, error)

Encrypt the aes cbc encrypt method

Jump to

Keyboard shortcuts

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