encryptlib

package module
v0.0.0-...-5d25ce1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: MulanPSL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Aes cryptoType = iota
	Des
	TriDes
)
View Source
const (
	ECB mode = iota
	CBC
	CFB
	OFB
	CTR
)
View Source
const (
	No padding = iota
	Zero
	Pkcs5
	Pkcs7
	ISO10126
	ISO97971
	AnsiX923
)
View Source
const (
	Base64 transcode = iota
	Hex
)

Variables

This section is empty.

Functions

func AesCBCPkcs7Decrypt

func AesCBCPkcs7Decrypt(src, key, iv []byte) ([]byte, error)

func AesCBCPkcs7Encrypt

func AesCBCPkcs7Encrypt(data, key, iv []byte) ([]byte, error)

func AesCFBPkcs7Decrypt

func AesCFBPkcs7Decrypt(src, key, iv []byte) ([]byte, error)

func AesCFBPkcs7Encrypt

func AesCFBPkcs7Encrypt(data, key, iv []byte) ([]byte, error)

func AesCTRPkcs7Decrypt

func AesCTRPkcs7Decrypt(src, key, iv []byte) ([]byte, error)

func AesCTRPkcs7Encrypt

func AesCTRPkcs7Encrypt(data, key, iv []byte) ([]byte, error)

func AesECBPkcs7Decrypt

func AesECBPkcs7Decrypt(src, key []byte) ([]byte, error)

ECB 模式解密 src密文,key加密时的密钥

func AesECBPkcs7Encrypt

func AesECBPkcs7Encrypt(data, key []byte) ([]byte, error)

Ecb加密模式 data要加密的数据,key要加密的密钥

func AesOFBPkcs7Decrypt

func AesOFBPkcs7Decrypt(src, key, iv []byte) ([]byte, error)

func AesOFBPkcs7Encrypt

func AesOFBPkcs7Encrypt(data, key, iv []byte) ([]byte, error)

func AnsiX923Padding

func AnsiX923Padding(plaintext []byte, blockSize int) []byte

ANSIX923 padding

func AnsiX923UnPadding

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

func Base64Decode

func Base64Decode(s string) ([]byte, error)

func Base64Encode

func Base64Encode(src []byte) string

func Decrypt

func Decrypt(multiple cryptoType, cipherText, key, iv []byte, mode mode, padding padding) ([]byte, error)

func DesCBCPkcs7Encrypt

func DesCBCPkcs7Encrypt(data, key, iv []byte) ([]byte, error)

func DesCFBPkcs7Decrypt

func DesCFBPkcs7Decrypt(src, key, iv []byte) ([]byte, error)

func DesCFBPkcs7Encrypt

func DesCFBPkcs7Encrypt(data, key, iv []byte) ([]byte, error)

func DesCTRPkcs7Decrypt

func DesCTRPkcs7Decrypt(src, key, iv []byte) ([]byte, error)

func DesCTRPkcs7Encrypt

func DesCTRPkcs7Encrypt(data, key, iv []byte) ([]byte, error)

func DesECBPkcs7Decrypt

func DesECBPkcs7Decrypt(src, key []byte) ([]byte, error)

ECB 模式解密 src密文,key加密时的密钥

func DesECBPkcs7Encrypt

func DesECBPkcs7Encrypt(data, key []byte) ([]byte, error)

Ecb加密模式 data要加密的数据,key要加密的密钥

func DesOFBPkcs7Decrypt

func DesOFBPkcs7Decrypt(src, key, iv []byte) ([]byte, error)

func DesOFBPkcs7Encrypt

func DesOFBPkcs7Encrypt(data, key, iv []byte) ([]byte, error)

func DescCBCPkcs7Decrypt

func DescCBCPkcs7Decrypt(src, key, iv []byte) ([]byte, error)

func EasyDecrypt

func EasyDecrypt(easyType, cipherText, key, iv string) (string, error)

func EasyEncrypt

func EasyEncrypt(easyType, plainText, key, iv string) (string, error)

easyType:cryptoType/mode/padding/transcode

func EncodeURIComponent

func EncodeURIComponent(str string) string

func Encrypt

func Encrypt(multiple cryptoType, plainText, key, iv []byte, mode mode, padding padding) ([]byte, error)

func HexDecode

func HexDecode(s string) ([]byte, error)

func HexEncode

func HexEncode(src []byte) string

func ISO10126Padding

func ISO10126Padding(plaintext []byte, blockSize int) []byte

ISO10126 implements ISO 10126 byte padding. This has been withdrawn in 2007.

func ISO10126UnPadding

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

func ISO97971Padding

func ISO97971Padding(plaintext []byte, blockSize int) []byte

ISO97971 Padding Method 2

func ISO97971UnPadding

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

func Pkcs5Padding

func Pkcs5Padding(text []byte) []byte

Pkcs5

func Pkcs5UnPadding

func Pkcs5UnPadding(src []byte) []byte

func Pkcs7Padding

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

Pkcs7

func Pkcs7UnPadding

func Pkcs7UnPadding(src []byte) []byte

func TripleDesCBCPkcs7Decrypt

func TripleDesCBCPkcs7Decrypt(src, key, iv []byte) ([]byte, error)

func TripleDesCBCPkcs7Encrypt

func TripleDesCBCPkcs7Encrypt(data, key, iv []byte) ([]byte, error)

func TripleDesCFBPkcs7Decrypt

func TripleDesCFBPkcs7Decrypt(src, key, iv []byte) ([]byte, error)

func TripleDesCFBPkcs7Encrypt

func TripleDesCFBPkcs7Encrypt(data, key, iv []byte) ([]byte, error)

func TripleDesCTRPkcs7Decrypt

func TripleDesCTRPkcs7Decrypt(src, key, iv []byte) ([]byte, error)

func TripleDesCTRPkcs7Encrypt

func TripleDesCTRPkcs7Encrypt(data, key, iv []byte) ([]byte, error)

func TripleDesECBPkcs7Decrypt

func TripleDesECBPkcs7Decrypt(src, key []byte) ([]byte, error)

ECB 模式解密 src密文,key加密时的密钥

func TripleDesECBPkcs7Encrypt

func TripleDesECBPkcs7Encrypt(data, key []byte) ([]byte, error)

Ecb加密模式 data要加密的数据,key要加密的密钥

func TripleDesOFBPkcs7Decrypt

func TripleDesOFBPkcs7Decrypt(src, key, iv []byte) ([]byte, error)

func TripleDesOFBPkcs7Encrypt

func TripleDesOFBPkcs7Encrypt(data, key, iv []byte) ([]byte, error)

func ZeroPadding

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

Zero

func ZeroUnPadding

func ZeroUnPadding(src []byte) []byte

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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