aes

package
v0.22.13 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "aes"
)

Variables

This section is empty.

Functions

func Create

func Create(id, name string, conf *Config, workers map[eosc.RequireId]eosc.IWorker) (eosc.IWorker, error)

func NewFactory

func NewFactory() eosc.IExtenderDriverFactory

func Register

func Register(register eosc.IExtenderDriverRegister)

Types

type AESCipher

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

AESCipher 封装AES加密解密功能

func NewAESCipher

func NewAESCipher(key string, salt string, keyLength int) (*AESCipher, error)

NewAESCipher 初始化AES加密器 key: 输入的密钥(任意长度) keyLength: 目标密钥长度(16=AES-128, 24=AES-192, 32=AES-256)

func (*AESCipher) DecryptCBC

func (c *AESCipher) DecryptCBC(ciphertext string) (string, error)

DecryptCBC CBC模式解密

func (*AESCipher) DecryptCFB

func (c *AESCipher) DecryptCFB(ciphertext string) (string, error)

DecryptCFB CFB模式解密

func (*AESCipher) DecryptCTR

func (c *AESCipher) DecryptCTR(ciphertext string) (string, error)

DecryptCTR CTR模式解密

func (*AESCipher) DecryptECB

func (c *AESCipher) DecryptECB(ciphertext string) (string, error)

DecryptECB ECB模式解密

func (*AESCipher) DecryptOFB

func (c *AESCipher) DecryptOFB(ciphertext string) (string, error)

DecryptOFB OFB模式解密

func (*AESCipher) EncryptCBC

func (c *AESCipher) EncryptCBC(plaintext string) (string, error)

EncryptCBC CBC模式加密

func (*AESCipher) EncryptCFB

func (c *AESCipher) EncryptCFB(plaintext string) (string, error)

EncryptCFB CFB模式加密

func (*AESCipher) EncryptCTR

func (c *AESCipher) EncryptCTR(plaintext string) (string, error)

EncryptCTR CTR模式加密

func (*AESCipher) EncryptECB

func (c *AESCipher) EncryptECB(plaintext string) (string, error)

EncryptECB ECB模式加密

func (*AESCipher) EncryptOFB

func (c *AESCipher) EncryptOFB(plaintext string) (string, error)

EncryptOFB OFB模式加密

type Config

type Config struct {
	Key       string `json:"key"`
	Salt      string `json:"salt"`
	Mode      string `json:"mode" enum:"ECB, CBC, CTR, OFB, CFB"`
	Algorithm string `json:"algorithm" enum:"AES-128, AES-192, AES-256"`
}

Jump to

Keyboard shortcuts

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