gdes

package
v1.6.7 Latest Latest
Warning

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

Go to latest
Published: May 3, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package gdes provides useful API for DES encryption/decryption algorithms.

Index

Constants

View Source
const (
	NOPADDING = iota
	PKCS5PADDING
)

Variables

This section is empty.

Functions

func DesCBCDecrypt

func DesCBCDecrypt(key []byte, cipherText []byte, iv []byte, padding int) ([]byte, error)

CBC模式DES解密

func DesCBCEncrypt

func DesCBCEncrypt(key []byte, clearText []byte, iv []byte, padding int) ([]byte, error)

CBC模式DES加密

func DesECBDecrypt

func DesECBDecrypt(key []byte, cipherText []byte, padding int) ([]byte, error)

ECB模式DES解密

func DesECBEncrypt

func DesECBEncrypt(key []byte, clearText []byte, padding int) ([]byte, error)

ECB模式DES加密

func PKCS5Padding

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

PKCS5补位

func PKCS5Unpadding

func PKCS5Unpadding(text []byte) []byte

去除PKCS5补位

func Padding

func Padding(text []byte, padding int) ([]byte, error)

补位方法

func TripleDesCBCDecrypt

func TripleDesCBCDecrypt(key []byte, cipherText []byte, iv []byte, padding int) ([]byte, error)

CBC模式3DES解密

func TripleDesCBCEncrypt

func TripleDesCBCEncrypt(key []byte, clearText []byte, iv []byte, padding int) ([]byte, error)

CBC模式3DES加密

func TripleDesECBDecrypt

func TripleDesECBDecrypt(key []byte, cipherText []byte, padding int) ([]byte, error)

ECB模式3DES解密,密钥长度可以是16或24位长

func TripleDesECBEncrypt

func TripleDesECBEncrypt(key []byte, clearText []byte, padding int) ([]byte, error)

ECB模式3DES加密,密钥长度可以是16或24位长

func UnPadding

func UnPadding(text []byte, padding int) ([]byte, error)

去除补位方法

Types

This section is empty.

Jump to

Keyboard shortcuts

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