encrypt

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"

Alphabet .

Variables

This section is empty.

Functions

func AesCBCDecrypt

func AesCBCDecrypt(src, key, iv []byte, padding PaddingMode) ([]byte, error)

AesCBCDecrypt

func AesCBCEncrypt

func AesCBCEncrypt(src, key, iv []byte, padding PaddingMode) ([]byte, error)

AesCBCEncrypt

func AesECBDecrypt

func AesECBDecrypt(src, key []byte, padding PaddingMode) ([]byte, error)

AesECBDecrypt

func AesECBEncrypt

func AesECBEncrypt(src, key []byte, padding PaddingMode) ([]byte, error)

AesECBEncrypt

func CBCDecrypt

func CBCDecrypt(block cipher.Block, src, iv []byte, padding PaddingMode) ([]byte, error)

CBCDecrypt

func CBCEncrypt

func CBCEncrypt(block cipher.Block, src, iv []byte, padding PaddingMode) ([]byte, error)

CBCEncrypt

func Decode58

func Decode58(b string) []byte

Decode58 decodes a modified base58 string to a byte slice

func DecodeAlphabet

func DecodeAlphabet(b, alphabet string) []byte

DecodeAlphabet decodes a modified base58 string to a byte slice

func DesCBCDecrypt

func DesCBCDecrypt(src, key, iv []byte, padding PaddingMode) ([]byte, error)

DesCBCDecrypt

func DesCBCEncrypt

func DesCBCEncrypt(src, key, iv []byte, padding PaddingMode) ([]byte, error)

DesCBCEncrypt

func DesECBDecrypt

func DesECBDecrypt(src, key []byte, padding PaddingMode) ([]byte, error)

DesECBDecrypt

func DesECBEncrypt

func DesECBEncrypt(src, key []byte, padding PaddingMode) ([]byte, error)

DesECBEncrypt

func ECBDecrypt

func ECBDecrypt(block cipher.Block, src []byte, padding PaddingMode) ([]byte, error)

ECBDecrypt

func ECBEncrypt

func ECBEncrypt(block cipher.Block, src []byte, padding PaddingMode) ([]byte, error)

ECBEncrypt

func Encode58

func Encode58(b []byte) string

Encode58 encodes a byte slice to a modified base58 string

func EncodeAlphabet

func EncodeAlphabet(b []byte, alphabet string) string

EncodeAlphabet encodes a byte slice to a modified base58 string, using alphabet

func PKCS5Padding

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

func PKCS5Unpadding

func PKCS5Unpadding(src []byte) []byte

func PKCS7Padding

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

func PKCS7UnPadding

func PKCS7UnPadding(src []byte) []byte

func Padding

func Padding(paddingMode PaddingMode, src []byte, blockSize int) []byte

func TripleDesCBCDecrypt added in v0.2.1

func TripleDesCBCDecrypt(src, key, iv []byte, padding PaddingMode) ([]byte, error)

TripleDesCBCDecrypt 3DES-CBC

func TripleDesCBCEncrypt added in v0.2.1

func TripleDesCBCEncrypt(src, key, iv []byte, padding PaddingMode) ([]byte, error)

TripleDesCBCDecrypt 3DES-CBC

func TripleDesECBDecrypt added in v0.2.1

func TripleDesECBDecrypt(src, key []byte, padding PaddingMode) ([]byte, error)

TripleDesECBDecrypt 3DES-ECB

func TripleDesECBEncrypt added in v0.2.1

func TripleDesECBEncrypt(src, key []byte, padding PaddingMode) ([]byte, error)

TripleDesECBEncrypt 3DES-ECB

func UnPadding

func UnPadding(paddingMode PaddingMode, src []byte) []byte

func ZerosPadding

func ZerosPadding(src []byte, blockSize int) []byte

func ZerosUnPadding

func ZerosUnPadding(src []byte) []byte

Types

type PaddingMode

type PaddingMode string
const (
	// PADDING_PKCS5
	PADDING_PKCS5 PaddingMode = "PKCS5"

	//PADDING_PKCS7
	PADDING_PKCS7 PaddingMode = "PKCS7"

	//PADDING_ZEROS
	PADDING_ZEROS PaddingMode = "ZEROS"
)

Jump to

Keyboard shortcuts

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