gocrypto

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

aes.go

des.go

md5.go

padding.go

rsa.go

sha1.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesCBCDecrypt

func AesCBCDecrypt(ciphertext []byte, paddingType ...string) (plaintext []byte,
	err error)

func AesCBCEncrypt

func AesCBCEncrypt(plaintext []byte, paddingType ...string) (ciphertext []byte,
	err error)

func AesCFBDecrypt

func AesCFBDecrypt(ciphertext []byte, paddingType ...string) (plaintext []byte,
	err error)

func AesCFBEncrypt

func AesCFBEncrypt(plaintext []byte, paddingType ...string) (ciphertext []byte,
	err error)

func AesECBDecrypt

func AesECBDecrypt(ciphertext []byte, paddingType ...string) (plaintext []byte, err error)

func AesECBEncrypt

func AesECBEncrypt(plaintext []byte, paddingType ...string) (ciphertext []byte, err error)

func DesCBCDecrypt

func DesCBCDecrypt(ciphertext []byte, paddingType ...string) (plaintext []byte,
	err error)

func DesCBCEncrypt

func DesCBCEncrypt(plaintext []byte, paddingType ...string) (ciphertext []byte,
	err error)

func DesCFBDecrypt

func DesCFBDecrypt(ciphertext []byte, paddingType ...string) (plaintext []byte,
	err error)

func DesCFBEncrypt

func DesCFBEncrypt(plaintext []byte, paddingType ...string) (ciphertext []byte,
	err error)

func GenRsaKey

func GenRsaKey(bits int, pemFile ...string) error

func Hmac

func Hmac(s string, key string) string

func Md5

func Md5(key string) string

func NewECBDecrypter

func NewECBDecrypter(b cipher.Block) cipher.BlockMode

NewECBDecrypter returns a BlockMode which decrypts in electronic code book mode, using the given Block.

func NewECBEncrypter

func NewECBEncrypter(b cipher.Block) cipher.BlockMode

NewECBEncrypter returns a BlockMode which encrypts in electronic code book mode, using the given Block.

func PKCS5Padding

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

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

func RSADecrypt

func RSADecrypt(data []byte, privatePem ...string) ([]byte, error)

func RSAEncrypt

func RSAEncrypt(data []byte, publicPem ...string) ([]byte, error)

func SetAesKey

func SetAesKey(key string) (err error)

func SetDesKey

func SetDesKey(key string) error

func Sha1

func Sha1(key string) string

func Sha256

func Sha256(key string) string

func Sha512

func Sha512(key string) string

func TripleDesCBCDecrypt

func TripleDesCBCDecrypt(ciphertext []byte, paddingType ...string) (plaintext []byte,
	err error)

3DES解密

func TripleDesCBCEncrypt

func TripleDesCBCEncrypt(plaintext []byte, paddingType ...string) (ciphertext []byte,
	err error)

3DES加密

func TripleDesCFBDecrypt

func TripleDesCFBDecrypt(ciphertext []byte, paddingType ...string) (plaintext []byte,
	err error)

3DES解密

func TripleDesCFBEncrypt

func TripleDesCFBEncrypt(plaintext []byte, paddingType ...string) (ciphertext []byte,
	err error)

3DES加密

func ZeroPadding

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

func ZeroUnPadding

func ZeroUnPadding(origData []byte) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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