security

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Aes128Decrypt

func Aes128Decrypt(crypted, key []byte, IV []byte) ([]byte, error)

func Aes128Encrypt

func Aes128Encrypt(origData, key []byte, IV []byte) ([]byte, error)

func AesDecrypt

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

AES解密

func AesEncrypt

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

AES加密

func CheckSign

func CheckSign(secret string, param interface{}, excludeField ...string) bool

检查签名

func GetNumCaptcha

func GetNumCaptcha() (*captcha.Image, string)

获取数字验证码图片

func Md5

func Md5(enstr string) string

Md5加密

func PKCS5Padding

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

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

func PKCS7Padding

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

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) []byte

func RsaDecrypt

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

解密

func RsaDecryptToText

func RsaDecryptToText(base64Str string) string

解密base64字符串为原始文本

func RsaEncrypt

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

加密

func RsaEncryptToBase64String

func RsaEncryptToBase64String(text string) string

加密为base64字符串

func Sign

func Sign(secret string, param interface{}, excludeField ...string) string

签名

func Validate

func Validate(passcode string, secret string) bool

验证

Types

type BindInfo

type BindInfo struct {
	Url     string
	QrCode  string
	BindKey string
}

func GenerateBindInfo

func GenerateBindInfo(account string, issuer string) *BindInfo

产生开启谷歌验证的信息

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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