crypto

package
v0.0.0-...-512269d Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BlockSize TEA BlockSize 单位byte
	BlockSize = 8

	// KeySize TEA 算法 Key的byte长度.
	KeySize = 16
)

Variables

This section is empty.

Functions

func Base64Decode

func Base64Decode(data string) ([]byte, string)

func Base64Encode

func Base64Encode(data []byte) string

func EncryptAesBase64

func EncryptAesBase64(d string) (string, error)

EncryptAesBase64 先做AES加密,再做base64加密

func HexAesEncrypt

func HexAesEncrypt(key, input string) (string, error)

func HexMd5Sign

func HexMd5Sign(p, t, k interface{}) string

func HexMd5String

func HexMd5String(str string) string

func Md5

func Md5(str string) string

func NewCipher

func NewCipher(key []byte) (cipher.Block, error)

NewCipher 加密算法构造器,使用标准rounds, key 长度必须是 16 byte

func NewCipherWithRounds

func NewCipherWithRounds(key []byte, rounds int) (cipher.Block, error)

NewCipherWithRounds 加密算法构造器,key 长度必须是 16 byte

func PKCS5Padding

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

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

func PasswordMD5

func PasswordMD5(passwd, salt string) string

* * PasswordMD5 密码加密 * @Description: create Account password MD5 * @param passwd 密码 * @return: string

func ToMd5

func ToMd5(data []byte) string

func UrlBase64Encode

func UrlBase64Encode(src []byte) string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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