des

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CBCDecrypt

func CBCDecrypt(secretData, key []byte) ([]byte, error)

DES-CBC 解密数据

func CBCEncrypt

func CBCEncrypt(originData, key []byte) ([]byte, error)

DES-CBC 加密数据

func CBCTripleDecrypt

func CBCTripleDecrypt(secretData, key []byte) ([]byte, error)

3DES-CBC 解密数据

func CBCTripleEncrypt

func CBCTripleEncrypt(originData, key []byte) ([]byte, error)

3DES-CBC 加密数据

func ECBDecrypt

func ECBDecrypt(secretData, key, iv []byte) ([]byte, error)

DES-ECB 解密数据

func ECBEncrypt

func ECBEncrypt(originData, key, iv []byte) ([]byte, error)

DES-ECB 加密数据

func ECBTripleDecrypt

func ECBTripleDecrypt(secretData, key, iv []byte) ([]byte, error)

3DES-ECB 解密数据

func ECBTripleEncrypt

func ECBTripleEncrypt(originData, key, iv []byte) ([]byte, error)

3DES-ECB 加密数据

func PKCS5Padding

func PKCS5Padding(ciphertext []byte, blockSize int) []byte

PKCS5Padding 加密填充模式(添加补全码) 加密时,如果加密bytes的length不是blockSize的整数倍,需要在最后面添加填充byte

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

PKCS5UnPadding 解密填充模式(去除补全码) 解密时,需要在最后面去掉加密时添加的填充byte

func PKCS7Padding

func PKCS7Padding(ciphertext []byte, blockSize int) []byte

PKCS7Padding 加密填充模式(添加补全码) 加密时,如果加密bytes的length不是blockSize的整数倍,需要在最后面添加填充byte

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) (bs []byte)

PKCS7UnPadding 解密填充模式(去除补全码) 解密时,需要在最后面去掉加密时添加的填充byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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