crypt

package
v0.0.0-...-b1f09d4 Latest Latest
Warning

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

Go to latest
Published: May 22, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesDecrypt

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

AES-128。key长度:16, 24, 32 bytes 对应 AES-128, AES-192, AES-256

func AesEncrypt

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

AES-128。key长度:16, 24, 32 bytes 对应 AES-128, AES-192, AES-256 返回的是 []byte 要做一步转换成string base64.StdEncoding.EncodeToString(result)

func HamSha1

func HamSha1(data string, key []byte) string

func Md5

func Md5(msg string) string

func PKCS5Padding

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

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

func Sha1

func Sha1(msg string) string

func Sha256

func Sha256(msg string) string

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