encrypt

package
v0.0.0-...-35fa672 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: MIT Imports: 17 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesCbcDecrypt

func AesCbcDecrypt(cipherText, key, ivAes []byte) ([]byte, error)

decrypt

func AesCbcEncrypt

func AesCbcEncrypt(plainText, key, ivAes []byte) ([]byte, error)

encrypt the key length must be 16,24,32

func AesCtrDecrypt

func AesCtrDecrypt(cipherText, key, ivAes []byte) ([]byte, error)

func AesCtrEncrypt

func AesCtrEncrypt(plainText, key, ivAes []byte) ([]byte, error)

func DesCbcDecrypt

func DesCbcDecrypt(cipherText, key, ivDes []byte) ([]byte, error)

func DesCbcEncrypt

func DesCbcEncrypt(plainText, key, ivDes []byte) ([]byte, error)

func GetRsaKey

func GetRsaKey(privateKeyPrefix, privateFileName string,
	publicFileName, publicKeyPrefix string) error

func HashInt

func HashInt(s string) int64

func HmacSha1

func HmacSha1(key, val string) []byte

func HmacSha512

func HmacSha512(key, val string) []byte

func Md5

func Md5(b []byte) []byte

func Md5Hex

func Md5Hex(b []byte) string

func PKCS5Padding

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

func PKCS5UnPadding

func PKCS5UnPadding(plainText []byte) ([]byte, error)

func RsaDecrypt

func RsaDecrypt(cryptText, key []byte) ([]byte, error)

func RsaEncrypt

func RsaEncrypt(plainText, key []byte) (cryptText []byte, err error)

func RsaSign

func RsaSign(msg, Key []byte) (cryptText []byte, err error)

func RsaVerifySign

func RsaVerifySign(msg []byte, sign []byte, Key []byte) bool

func Sha1

func Sha1(b []byte) []byte

func Sha1Hex

func Sha1Hex(b []byte) string

func Sha256

func Sha256(data []byte) []byte

func Sha256Hex

func Sha256Hex(data []byte) string

func Sha512

func Sha512(data []byte) []byte

func Sha512Hex

func Sha512Hex(data []byte) string

func TripleDesDecrypt

func TripleDesDecrypt(cipherText, key, ivDes []byte) ([]byte, error)

func TripleDesEncrypt

func TripleDesEncrypt(plainText, key, ivDes []byte) ([]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