aes

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package aes 封装AES的基础操作,完成数据的aes加解密

Index

Constants

View Source
const (
	// Zero default
	Zero aesPaddingType = iota
	PKCS7
	ISO10126
	ISO9797M1
	ISO9797M2
	ANSIX923
	// NoOrZero 足位不追加0;不足位追加0
	NoOrZero
	// No 不追加,保留原始数据,如果数据不足报异常
	No
)
View Source
const (
	// CBC default
	CBC aesEncryptModel = iota
	CTR
	OFB
	CFB
	ECB
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	Key          string
	IV           string
	PaddingType  aesPaddingType
	EncryptModel aesEncryptModel
}

type Crypto

type Crypto interface {
	// Encrypt 加密数据
	Encrypt(origStr string) (string, error)

	// Decrypt 解密数据
	Decrypt(decryptedData string) (string, error)

	// PaddingType 设置padding方式
	PaddingType(tp aesPaddingType)

	// EncryptModel 设置加密模式
	EncryptModel(model aesEncryptModel)
}

Crypto Aes加解密相关接口

func New

func New(c Conf) Crypto

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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