cryption

package
v0.0.0-...-d436db8 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesDecrypt

func AesDecrypt(ciphertext, aesKey []byte) ([]byte, error)

AES解密,经济系统使用了ECB而非CBC的方式

func AesEncrypt

func AesEncrypt(origData, aesKey []byte) ([]byte, error)

AES加密,经济系统使用了ECB而非CBC的方式

func Base64Decode

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

func Base64Encode

func Base64Encode(src []byte) string

func DecodeToken

func DecodeToken(token, product, privateKey string) string

平均耗时300us

func DesDecrypt

func DesDecrypt(ciphertext, desKey, iv []byte) ([]byte, error)

func DesEncrypt

func DesEncrypt(origData, desKey, iv []byte) ([]byte, error)

func EncodeToken

func EncodeToken(timestamp int64, product, privateKey string) string

平均耗时200us

func Md5

func Md5(text 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(ciphertext []byte) []byte

func Rc4Decrypt

func Rc4Decrypt(ciphertext []byte, key []byte) ([]byte, error)

func Rc4Encrypt

func Rc4Encrypt(originData []byte, key []byte) ([]byte, error)

func RsaDecrypt

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

func RsaEncrypt

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

func Urldecode

func Urldecode(text string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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