aes

package
v0.0.0-...-1ec2636 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

aes加密和解密相关函数,经过封装,更好用一些

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesDecrypt

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

aes解密,key必须是16字节的整数倍

func AesDecrypt128_MD5

func AesDecrypt128_MD5(crypted []byte, key string) ([]byte, error)

128位aes解密, key会被md5。

func AesDecrypt256_SHA256

func AesDecrypt256_SHA256(crypted []byte, key string) ([]byte, error)

256位aes解密, key会用sha256进行哈希,所以key的长度没有限制,但最好要超过256位。

func AesDecrypt256_SHA256_BYTE

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

256位aes解密, key会用sha256进行哈希,所以key的长度没有限制,但最好要超过256位。

func AesEncrypt

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

aes加密,CBC模式,PKCS5Padding,key的长度可以为16、24或32字节 初始化向量与key相同

func AesEncrypt128_MD5

func AesEncrypt128_MD5(origData []byte, key string) ([]byte, error)

128位aes加密, key会被md5,所以长度没有限制,但最好要超过128位。

func AesEncrypt256_SHA256

func AesEncrypt256_SHA256(origData []byte, key string) ([]byte, error)

256位aes加密, key会用sha256进行哈希,所以key的长度没有限制,但最好要超过256位。

func AesEncrypt256_SHA256_BYTE

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

256位aes加密, key会用sha256进行哈希,所以key的长度没有限制,但最好要超过256位。

Types

This section is empty.

Jump to

Keyboard shortcuts

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