encrypt

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// 默认长度
	DefaultAesBlockSize = 16
)

Functions

This section is empty.

Types

type AesTool

type AesTool struct {
	//128 192  256位的其中一个 长度 对应分别是 16 24  32字节长度
	Key       []byte
	BlockSize int
}

AES ECB模式的加密解密

func NewAesTool

func NewAesTool(key []byte, blockSize int) *AesTool

func (*AesTool) Decrypt added in v0.0.4

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

Decrypt 从base64编码中返回

func (*AesTool) Encrypt added in v0.0.4

func (a *AesTool) Encrypt(plaintext []byte) ([]byte, error)

EncryptBase64 加密并返回base64编码

Jump to

Keyboard shortcuts

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