util

package
v0.0.0-...-1272ae6 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

AES CBC PKCS5Padding加/解密

使用 hex.Encode

查看测试文件: aes_cbc_test.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESDecrypt

func AESDecrypt(decodeStr string, key string) (string, error)

AESDecrypt 解码

func AESEncrypt

func AESEncrypt(plainText string, key string) string

AESEncrypt AES CBC encrypt

func Decrypt

func Decrypt(data []byte, key []byte) []byte

Decrypt the data with key. data is the bytes to be decrypted. key is the decrypted key. It is the same as the encrypt key.

func Encrypt

func Encrypt(data []byte, key []byte) []byte

Encrypt the data with key. data is the bytes to be encrypted. key is the encrypt key. It is the same as the decrypt key.

func Get

func Get(key string) string

Get 获取值

func GetUUID

func GetUUID() (string, error)

GetUUID UUID MD5

func PKCS5Padding

func PKCS5Padding(cipherText []byte, blockSize int, after int) []byte

PKCS5Padding PKCS5Padding

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

PKCS5UnPadding PKCS5UnPadding

func Set

func Set(key, val string)

Set 设置值

Types

type XXTea

type XXTea struct {
	Key string
}

func NewXXTea

func NewXXTea(key string) *XXTea

NewXXTea

func (*XXTea) DecryptString

func (m *XXTea) DecryptString(str string) (string, error)

DecryptString DecryptString key通过NewXXtea传递

func (*XXTea) EncryptString

func (m *XXTea) EncryptString(str string) string

EncryptString EncryptString key通过NewXXtea传递

Directories

Path Synopsis
http client 使用github.com/imroc/req库 返回string,如果需要到struct,需要自己反序列化
http client 使用github.com/imroc/req库 返回string,如果需要到struct,需要自己反序列化

Jump to

Keyboard shortcuts

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