des

package
v0.0.0-...-5c98b36 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: MulanPSL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package des 简化DES加密步骤,隐藏加密细节

Package des 简化DES加密步骤,隐藏加密细节 为什么没有 ZeroPadding 填充,因为它没办法区分真实数据与填充数据,所以只适合以\0结尾的字符串加解密。

Index

Constants

This section is empty.

Variables

View Source
var IV = []byte(`BHIcN*G>`)

IV CBC初始化向量,对数据执行加密转换

Functions

func DecryptCBC

func DecryptCBC(cipherText []byte, key []byte) ([]byte, error)

EncryptCBC 解密,使用CBC模式

func DecryptCBCTriple

func DecryptCBCTriple(cipherText []byte, key []byte) ([]byte, error)

DecryptCBCTriple 解密,使用三重数据加密算法(3DES),CBC模式 key的长度必须是 16 或 24 bytes

func DecryptECB

func DecryptECB(cipherText []byte, key []byte) ([]byte, error)

DecryptECB 解密,使用ECB模式

func DecryptECBTriple

func DecryptECBTriple(cipherText []byte, key []byte) ([]byte, error)

EncryptECBTriple 解密,使用三重数据加密算法(3DES),ECB模式 key的长度必须是 16 或 24 bytes

func EncryptCBC

func EncryptCBC(plainText []byte, key []byte) ([]byte, error)

EncryptCBC 加密,使用CBC模式

func EncryptCBCTriple

func EncryptCBCTriple(plainText []byte, key []byte) ([]byte, error)

EncryptCBCTriple 加密,使用三重数据加密算法(3DES),CBC模式 key的长度必须是 16 或 24 bytes

func EncryptECB

func EncryptECB(plainText []byte, key []byte) ([]byte, error)

EncryptECB 加密,使用ECB模式

func EncryptECBTriple

func EncryptECBTriple(plainText []byte, key []byte) ([]byte, error)

EncryptECBTriple 加密,使用三重数据加密算法(3DES),ECB模式 key的长度必须是 16 或 24 bytes

Types

This section is empty.

Jump to

Keyboard shortcuts

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