crypto

package
v0.0.0-...-04cfb28 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesCBCDecrypt

func AesCBCDecrypt(key, iv, crypted []byte) ([]byte, error)

func AesCBCEncrypt

func AesCBCEncrypt(key, iv, origData []byte) ([]byte, error)

func Base64Decode

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

func Base64Encode

func Base64Encode(data []byte) string

func Bcrypt

func Bcrypt(password string, cost int) (string, error)

func BcryptCheck

func BcryptCheck(password, hash string) bool

func HmacSha1

func HmacSha1(message, secret string) string

func HmacSha256

func HmacSha256(message, secret string) string

func MD5Encrypt

func MD5Encrypt(s string) string

func PKCS5Padding

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

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

func PKCS7Padding

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

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) []byte

func RsaDecrypt

func RsaDecrypt(privateKey []byte, ciphertext []byte) ([]byte, error)

func RsaEncrypt

func RsaEncrypt(publicKey []byte, origData []byte) ([]byte, error)

func RsaVerify

func RsaVerify(publicKey []byte, data []byte, sign string) error

func Sha1

func Sha1(message string) string

func Sha256

func Sha256(message string) string

func TripleDesB64Decrypt

func TripleDesB64Decrypt(encrypt, key string) (result string, err error)

func TripleDesB64Encrypt

func TripleDesB64Encrypt(data, key string) (result string, err error)

func TripleDesDecrypt

func TripleDesDecrypt(crypted, key []byte) ([]byte, error)

func TripleDesEncrypt

func TripleDesEncrypt(origData, key []byte) ([]byte, error)

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