cbc

package
v0.0.0-...-7a729f8 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: MIT Imports: 8 Imported by: 6

Documentation

Index

Constants

View Source
const (
	//OFFSET 补齐字符的ascii码值与个数的偏移量
	OFFSET               = 0
	BLOCK_SIZE           = 16
	IV_TYPE_KEY          = 1
	IV_TYPE_RAND         = 2
	ENCRYPT_TYPE_COMMON  = 1
	ENCRYPT_TYPE_PRIVATE = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EncryptCBC

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

EncryptCBC ... AES CBC模式的加密算法

func New

func New(key string) *EncryptCBC

New ...

func NewPri

func NewPri(key string) *EncryptCBC

NewPriv , 隐私整改,和Server统一的加密算法

func (*EncryptCBC) Decrypt

func (e *EncryptCBC) Decrypt(ciphertext string) (plaintext string, err error)

Decrypt 解密方法

func (*EncryptCBC) DecryptBytes

func (e *EncryptCBC) DecryptBytes(cipherBytes []byte) (plainBytes []byte, err error)

Decrypt 解密方法

func (*EncryptCBC) Encrypt

func (e *EncryptCBC) Encrypt(plaintext string) (ciphertext string, err error)

Encrypt 加密方法

func (*EncryptCBC) EncryptBytes

func (e *EncryptCBC) EncryptBytes(plainBytes []byte) (cipherBytes []byte, err error)

EncryptBytes 加密方法

func (*EncryptCBC) PKCS5Padding

func (e *EncryptCBC) PKCS5Padding(ciphertext []byte, blockSize int) []byte

PKCS5Padding ...

func (*EncryptCBC) PKCS5UnPadding

func (e *EncryptCBC) PKCS5UnPadding(origData []byte) []byte

PKCS5UnPadding ...

Jump to

Keyboard shortcuts

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