crypto

package
v0.0.0-...-5870b03 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AesCrypt

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

AesCrypt aes加解密

func NewAesCrypt

func NewAesCrypt(key string) *AesCrypt

NewAesCrypt 默认是cbc模式

func (*AesCrypt) Baes642Decrypt

func (aesCrypt *AesCrypt) Baes642Decrypt(ciphertext string) (string, error)

Baes642Decrypt 解密base64格式的密文

func (*AesCrypt) Decrypt

func (aesCrypt *AesCrypt) Decrypt(ciphertext []byte) ([]byte, error)

Decrypt 解密

func (*AesCrypt) Encrypt

func (aesCrypt *AesCrypt) Encrypt(plantText []byte) ([]byte, error)

Encrypt 加密

func (*AesCrypt) Encrypt2Base64

func (aesCrypt *AesCrypt) Encrypt2Base64(plantText string) (string, error)

Encrypt2Base64 加密结果转为base64

func (*AesCrypt) PKCS7Padding

func (aesCrypt *AesCrypt) PKCS7Padding(ciphertext []byte, blockSize int) []byte

PKCS7Padding ..

func (*AesCrypt) PKCS7UnPadding

func (aesCrypt *AesCrypt) PKCS7UnPadding(plantText []byte, blockSize int) []byte

PKCS7UnPadding ..

func (*AesCrypt) SetEcbModel

func (aesCrypt *AesCrypt) SetEcbModel()

SetEcbModel ..

Jump to

Keyboard shortcuts

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