encryption

package
v0.0.0-...-3ead46a Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESDecrypt

func AESDecrypt(EncryptKey string, contentText string) ([]byte, error)

AESDecrypt AES 解密

func AESEncrypt

func AESEncrypt(text []byte, key []byte) []byte

AESEncrypt 对传入参数进行AES加密

func BytesToString

func BytesToString(array []byte) string

BytesToString 将[]byte经过解密转换为string

func CalAA

func CalAA(trace [][]int64, e []int64, n string) string

CalAA 与TT是相同算法

func CalE

func CalE(t []int64) string

func CalF

func CalF(t [][]int64) string

func CalT

func CalT(t [][]int64) [][]int64

func CalUserResponse

func CalUserResponse(c int64, challenge string) string

func CreateSecretKey

func CreateSecretKey() []byte

CreateSecretKey 创建随机16位16进制随机字符串

func Decode

func Decode(content string, EncryptKey string) []byte

Decode 入口函数

func FunN

func FunN(t int64) string

func GetCaptchaType

func GetCaptchaType(g *Geetest) (string, string, string)

GetCaptchaType 流程的第二步,获取验证码类型

func GetEP

func GetEP(gt, challenge string) map[string]interface{}

func GetFullBG

func GetFullBG(g *Geetest) (string, string, string)

GetFullBG 流程的第三步,极验三代获取背景图片,返回信息为 函数状态,验证码类型,错误详情

func GetRequestW

func GetRequestW(gt, challenge, aa, passtime string, c int64) string

GetRequestW 获取网络请求的w

func GetSC

func GetSC(g *Geetest) int64

GetSC 流程的第一步,获取s,c,二代极验获取全图

func Hash

func Hash(str string) string

Hash 对传入字符串进行md5加密

func RSAEncrypt

func RSAEncrypt(text []byte) string

RSAEncrypt 将传入参数进行RSA加密

func RandInt64

func RandInt64(min, max int64) int64

RandInt64 返回输入区间的随机数

func SHA256

func SHA256(data []byte) []byte

SHA256 sha256 编码

func Slide

func Slide(g *Geetest)

Types

type Encrypt

type Encrypt struct {
}

type Geetest

type Geetest struct {
	GT        string
	Challenge string
	S         string
	C         []int64
	FullBG    string
	BG        string
	SecKey    string
}

Geetest 未来会精简这个结构体

func (Geetest) CalW

func (g Geetest) CalW(text string, flag bool) string

CalW 计算validate前需要提交的W参数

Jump to

Keyboard shortcuts

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