symmetric

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aes

type Aes struct {
	Err     error
	Encrypt *AesEncrypt
	Decrypt *AesDecrypt
	// contains filtered or unexported fields
}

Aes Aes密钥对象

var AesApp Aes

func NewAes

func NewAes(sail string) *Aes

NewAes 实例化:Aes密钥

func (*Aes) GetDecrypt

func (my *Aes) GetDecrypt() *AesDecrypt

GetDecrypt 获取解密密钥

func (*Aes) GetEncrypt

func (my *Aes) GetEncrypt() *AesEncrypt

GetEncrypt 获取加密密钥

func (*Aes) New

func (*Aes) New(sail string) *Aes

func (*Aes) NewDecrypt

func (my *Aes) NewDecrypt(openKey string) *Aes

NewDecrypt 实例化:Aes解密密钥对象

func (*Aes) NewEncrypt

func (my *Aes) NewEncrypt() *Aes

NewEncrypt 实例化:Aes加密密钥对象

type AesDecrypt

type AesDecrypt struct {
	Err error
	// contains filtered or unexported fields
}

AesDecrypt Aes解密密钥对象

func NewAesDecrypt

func NewAesDecrypt(sailStr, openKey string) *AesDecrypt

NewAesDecrypt 实例化:Aes解密密钥对象

func (*AesDecrypt) GetAesKey

func (r *AesDecrypt) GetAesKey() []byte

GetAesKey 获取加盐后的密钥

func (*AesDecrypt) GetOpenKey

func (r *AesDecrypt) GetOpenKey() string

GetOpenKey 获取公开密码

func (*AesDecrypt) SetAesKey

func (r *AesDecrypt) SetAesKey(aesKey []byte) *AesDecrypt

SetAesKey 设置加盐后的密钥

type AesEncrypt

type AesEncrypt struct {
	Err error
	// contains filtered or unexported fields
}

AesEncrypt Aes加密密钥对象

func NewAesEncrypt

func NewAesEncrypt(sail string) *AesEncrypt

NewAesEncrypt 实例化:Aes加密密钥对象

func (*AesEncrypt) GetAesKey

func (r *AesEncrypt) GetAesKey() []byte

GetAesKey 获取加盐后的密钥

func (*AesEncrypt) GetOpenKey

func (r *AesEncrypt) GetOpenKey() string

GetOpenKey 获取公开密码

func (*AesEncrypt) SetAesKey

func (r *AesEncrypt) SetAesKey(aesKey []byte) *AesEncrypt

SetAesKey 设置加盐后的密钥

type Cbc

type Cbc struct{}
var CbcApp Cbc

func (Cbc) Decrypt

func (Cbc) Decrypt(cipherText, key, iv []byte, ivs ...[]byte) ([]byte, error)

func (Cbc) Demo

func (Cbc) Demo()

func (Cbc) Encrypt

func (Cbc) Encrypt(plainText, key, iv []byte, ivs ...[]byte) ([]byte, error)

type Ecb

type Ecb struct{}
var EcbApp Ecb

func (Ecb) Decrypt

func (Ecb) Decrypt(key, cipherText []byte) ([]byte, error)

Decrypt decrypts cipherText using AES in ECB mode

func (Ecb) Encrypt

func (Ecb) Encrypt(key, plaintext []byte) ([]byte, error)

Encrypt encrypts plaintext using AES in ECB mode

Jump to

Keyboard shortcuts

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