gdes

package
Version: v2.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: MIT Imports: 5 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 DecryptCBC

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

DecryptCBC decrypts `cipherText` using CBC mode.

func DecryptCBCTriple

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

DecryptCBCTriple decrypts `cipherText` using TripleDES and CBC mode.

func DecryptECB

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

DecryptECB decrypts `cipherText` using ECB mode.

func DecryptECBTriple

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

DecryptECBTriple decrypts `cipherText` using TripleDES and ECB mode. The length of the `key` should be either 16 or 24 bytes.

func EncryptCBC

func EncryptCBC(plainText []byte, key []byte, iv []byte, padding int) ([]byte, error)

EncryptCBC encrypts `plainText` using CBC mode.

func EncryptCBCTriple

func EncryptCBCTriple(plainText []byte, key []byte, iv []byte, padding int) ([]byte, error)

EncryptCBCTriple encrypts `plainText` using TripleDES and CBC mode.

func EncryptECB

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

EncryptECB encrypts `plainText` using ECB mode.

func EncryptECBTriple

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

EncryptECBTriple encrypts `plainText` using TripleDES and ECB mode. The length of the `key` should be either 16 or 24 bytes.

func Padding

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

func PaddingPKCS5

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

func UnPadding

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

func UnPaddingPKCS5

func UnPaddingPKCS5(text []byte) []byte

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

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