codegrpc

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CodecLibs    *yakdoc.ScriptLib
	CodecLibsDoc []*ypb.CodecMethod // 记录函数的数据,参数类型等,用于前端生成样式
)
View Source
var (
	OUTPUT_RAW    = "raw"
	OUTPUT_HEX    = "hex"
	OUTPUT_BASE64 = "base64"
)

Functions

This section is empty.

Types

type CodecExecFlow

type CodecExecFlow struct {
	Text []byte
	Flow []*ypb.CodecWork
}

func NewCodecExecFlow

func NewCodecExecFlow(text []byte, flow []*ypb.CodecWork) *CodecExecFlow

func (*CodecExecFlow) AESDecrypt

func (flow *CodecExecFlow) AESDecrypt(key string, keyType string, IV string, ivType string, mode string, input outputType) error

Tag = "解密" CodecName = "AES对称解密" Desc = """高级加密标准(AES)是美国联邦信息处理标准(FIPS)。它是在一个历时5年的过程中,从15个竞争设计中选出的。 Key:根据密钥的大小,将使用以下算法: 16字节 = AES-128 24字节 = AES-192 32字节 = AES-256""" Params = [ { Name = "key", Type = "inputSelect", Required = true,Label = "Key", Connector ={ Name = "keyType", Type = "select", DefaultValue = "hex", Options = ["hex", "raw", "base64"], Required = true ,Label = "key格式"} }, { Name = "IV", Type = "inputSelect", Required = false ,Label = "IV", Connector ={ Name = "ivType", Type = "select", DefaultValue = "hex", Options = ["hex", "raw", "base64"], Required = true ,Label = "IV格式"} }, { Name = "mode", Type = "select", DefaultValue = "CBC",Options = ["CBC", "ECB", "GCM"], Required = true, Label = "Mode"}, { Name = "input", Type = "select", DefaultValue = "hex", Options = ["hex", "raw", "base64"], Required = true,Label = "输入格式"} ]

func (*CodecExecFlow) AESEncrypt

func (flow *CodecExecFlow) AESEncrypt(key string, keyType string, IV string, ivType string, mode string, output outputType) error

Tag = "加密" CodecName = "AES对称加密" Desc ="""高级加密标准(AES)是美国联邦信息处理标准(FIPS)。它是在一个历时5年的过程中,从15个竞争设计中选出的。 Key:根据密钥的大小,将使用以下算法: 16字节 = AES-128 24字节 = AES-192 32字节 = AES-256 你可以使用其中一个KDF操作生成基于密码的密钥。""" Params = [ { Name = "key", Type = "inputSelect", Required = true,Label = "Key", Connector ={ Name = "keyType", Type = "select", DefaultValue = "hex", Options = ["hex", "raw", "base64"], Required = true ,Label = "key格式"} }, { Name = "IV", Type = "inputSelect", Required = false ,Label = "IV", Connector ={ Name = "ivType", Type = "select", DefaultValue = "hex", Options = ["hex", "raw", "base64"], Required = true ,Label = "IV格式"} }, { Name = "mode", Type = "select", DefaultValue = "CBC",Options = ["CBC", "ECB", "GCM"], Required = true, Label = "Mode"}, { Name = "output", Type = "select", DefaultValue = "hex", Options = ["hex", "raw", "base64"], Required = true ,Label = "输出格式"} ]

func (*CodecExecFlow) Base64Decode

func (flow *CodecExecFlow) Base64Decode(Alphabet string) error

Tag = "解码" CodecName = "base64解码" Desc = """Base64是一种基于64个可打印字符来表示二进制数据的表示方法。常用于在通常处理文本数据的场合,表示、传输、存储一些二进制数据,包括MIME的电子邮件及XML的一些复杂数据。 eg: eWFr -> yak""" Params = [ { Name = "Alphabet", Type = "select",DefaultValue = "standard",Options = ["standard", "urlsafe"], Required = true,Lable = "Alphabet" } ]

func (*CodecExecFlow) Base64Encode

func (flow *CodecExecFlow) Base64Encode(Alphabet string) error

Tag = "编码" CodecName = "base64编码" Desc = """Base64是一种基于64个可打印字符来表示二进制数据的表示方法。常用于在通常处理文本数据的场合,表示、传输、存储一些二进制数据,包括MIME的电子邮件及XML的一些复杂数据。 eg: yak -> eWFr""" Params = [ { Name = "Alphabet", Type = "select",DefaultValue = "standard", Options = ["standard", "urlsafe"], Required = true,Label = "Alphabet"} ]

func (*CodecExecFlow) CodecPlugin

func (flow *CodecExecFlow) CodecPlugin(pluginName string) error

Tag = "Yak脚本" CodecName = "本地Codec插件" Desc = """本地Codec插件""" Params = [ { Name = "pluginName", Type = "search", Required = true , Label = "插件名"}, ]

func (*CodecExecFlow) CustomCodecPlugin

func (flow *CodecExecFlow) CustomCodecPlugin(pluginContent string) error

Tag = "Yak脚本" CodecName = "临时Codec插件" Desc = """自定义临时Codec插件""" Params = [ { Name = "pluginContent", Type = "monaco", Required = true , Label = "插件内容"}, ]

func (*CodecExecFlow) DESDecrypt

func (flow *CodecExecFlow) DESDecrypt(key string, keyType string, IV string, ivType string, mode string, input outputType) error

Tag = "解密" CodecName = "DES对称解密" Desc = """DES(Data Encryption Standard)是一种对称密钥加密算法,使用固定有效长度为56位的密钥对数据进行64位的分组加密。尽管曾广泛使用,但由于密钥太短,现已被认为不够安全。""" Params = [ { Name = "key", Type = "inputSelect", Required = true,Label = "Key", Connector ={ Name = "keyType", Type = "select", DefaultValue = "hex", Options = ["hex", "raw", "base64"], Required = true ,Label = "key格式"} }, { Name = "IV", Type = "inputSelect", Required = false ,Label = "IV", Connector ={ Name = "ivType", Type = "select", DefaultValue = "hex", Options = ["hex", "raw", "base64"], Required = true ,Label = "IV格式"} }, { Name = "mode", Type = "select",DefaultValue = "CBC", Options = ["CBC", "ECB"], Required = true , Label = "Mode"}, { Name = "input", Type = "select", DefaultValue = "hex", Options = ["hex", "raw", "base64"], Required = true ,Label = "输入格式"} ]

func (*CodecExecFlow) DESEncrypt

func (flow *CodecExecFlow) DESEncrypt(key string, keyType string, IV string, ivType string, mode string, output outputType) error

Tag = "加密" CodecName = "DES对称加密" Desc = """DES(Data Encryption Standard)是一种对称密钥加密算法,使用固定有效长度为56位的密钥对数据进行64位的分组加密。尽管曾广泛使用,但由于密钥太短,现已被认为不够安全。""" Params = [ { Name = "key", Type = "inputSelect", Required = true,Label = "Key", Connector ={ Name = "keyType", Type = "select", DefaultValue = "hex", Options = ["hex", "raw", "base64"], Required = true ,Label = "key格式"} }, { Name = "IV", Type = "inputSelect", Required = false ,Label = "IV", Connector ={ Name = "ivType", Type = "select", DefaultValue = "hex", Options = ["hex", "raw", "base64"], Required = true ,Label = "IV格式"} }, { Name = "mode", Type = "select",DefaultValue = "CBC", Options = ["CBC", "ECB"], Required = true , Label = "Mode"}, { Name = "output", Type = "select", DefaultValue = "hex", Options = ["hex", "raw","base64"], Required = true,Label = "输出格式"} ]

func (*CodecExecFlow) Find added in v1.3.2

func (flow *CodecExecFlow) Find(find string, findType string, Global, Multiline, IgnoreCase bool) error

Tag = "其他" CodecName = "Find" Desc = """替换字符串处理本文""" Params = [ { Name = "find", Type = "input", Required = true , Label = "Find"}, { Name = "findType", Type = "select",DefaultValue = "regexp",Options = ["regexp","raw"], Required = true , Label = "查找方式"}, { Name = "Global", Type = "checkbox", Required = true , Label = "全部匹配"}, { Name = "IgnoreCase", Type = "checkbox", Required = true , Label = "忽略大小写"}, { Name = "Multiline", Type = "checkbox", Required = true , Label = "多行匹配"}, ]

func (*CodecExecFlow) Fuzz

func (flow *CodecExecFlow) Fuzz() error

Tag = "其他" CodecName = "fuzztag渲染" Desc = """渲染fuzztag"""

func (*CodecExecFlow) HexDecode

func (flow *CodecExecFlow) HexDecode() error

Tag = "解码" CodecName = "十六进制解码" Desc = """十六进制编码是一种数字表示法,使用0到9和A到F共16个字符来表示数值。在计算机科学中,它广泛用于简化二进制数据的表示,因为每4位二进制数(比特)可以用单个十六进制数精确表示。"""

func (*CodecExecFlow) HexEncode

func (flow *CodecExecFlow) HexEncode() error

Tag = "编码" CodecName = "十六进制编码" Desc = """十六进制编码是一种数字表示法,使用0到9和A到F共16个字符来表示数值。在计算机科学中,它广泛用于简化二进制数据的表示,因为每4位二进制数(比特)可以用单个十六进制数精确表示。"""

func (*CodecExecFlow) HtmlDecode

func (flow *CodecExecFlow) HtmlDecode() error

Tag = "解码" CodecName = "HTML解码" Desc = """HTML编码是一种将特殊字符转换为HTML实体的编码方式。"""

func (*CodecExecFlow) HtmlEncode

func (flow *CodecExecFlow) HtmlEncode(entityRef string, fullEncode bool) error

Tag = "编码" CodecName = "HTML编码" Desc = """HTML编码是一种将特殊字符转换为HTML实体的编码方式。""" Params = [ { Name = "entityRef", Type = "select",DefaultValue = "named", Options = ["dec", "hex", "named"], Required = true ,Label = "实体编码格式"}, { Name = "fullEncode", Type = "checkbox", Required = true , Label = "全部编码"} ]

func (*CodecExecFlow) JavaSerialize

func (flow *CodecExecFlow) JavaSerialize(output string) error

Tag = "Java" CodecName = "序列化" Desc = """Java序列化是一种将Java对象转换为字节流的机制,以便可以在网络上传输或将其保存到文件中。 """ Params = [ { Name = "output", Type = "select",DefaultValue = "raw", Options = ["raw", "hex", "base64"], Required = true , Label = "输出格式"} ]

func (*CodecExecFlow) JavaUnserialize

func (flow *CodecExecFlow) JavaUnserialize(input string, output string) error

Tag = "Java" CodecName = "反序列化" Desc = """Java反序列化是一种将字节流转换为Java对象的机制,以便可以在网络上传输或将其保存到文件中。 Yak中提供了两种反序列化方式: dumper 和 object-stream ,其中object-stream是Yak独有的一种伪代码表达形式,更直观易读""" Params = [ { Name = "input", Type = "select",DefaultValue = "raw", Options = ["raw", "hex", "base64"], Required = true , Label = "输入格式"}, { Name = "output", Type = "select",DefaultValue = "dumper", Options = ["dumper", "object-stream"], Required = true , Label = "输出格式"} ]

func (*CodecExecFlow) JsonFormat

func (flow *CodecExecFlow) JsonFormat(mode string) error

Tag = "数据美化" CodecName = "Json处理" Desc = """JSON(JavaScript Object Notation)是一种轻量级数据交换格式,易于人阅读和编写,同时也易于机器解析和生成。它基于JavaScript语言标准,但独立于语言,被广泛应用于网络应用程序中数据的传输。""" Params = [ { Name = "mode", Type = "select",DefaultValue = "两格缩进", Options = ["四格缩进", "两格缩进","压缩"], Required = true ,Label = "处理方式"} ]

func (*CodecExecFlow) JwtParse

func (flow *CodecExecFlow) JwtParse() error

Tag = "其他" CodecName = "JWT解析" Desc = """JWT(JSON Web Token)是一种开放标准(RFC 7519),用于在网络应用间安全地传输声明信息,通常用于身份验证和信息交换。"""

func (*CodecExecFlow) JwtSign

func (flow *CodecExecFlow) JwtSign(algorithm string, key []byte, isBase64 bool) error

Tag = "其他" CodecName = "JWT签名" Desc = """JWT(JSON Web Token)是一种开放标准(RFC 7519),用于在网络应用间安全地传输声明信息,通常用于身份验证和信息交换。""" Params = [ { Name = "algorithm", Type = "select",DefaultValue = "HS256",Options = ["ES384","ES256","ES512","HS256","HS384","HS512","PS256","PS384","PS512","RS256","RS384","RS512","None"], Required = true , Label = "签名算法"}, { Name = "key", Type = "input", Required = true , Label = "JWT密钥"}, { Name = "isBase64", Type = "checkbox", Required = true , Label = "base64编码"}, ]

func (*CodecExecFlow) MD5

func (flow *CodecExecFlow) MD5() error

Tag = "Hash" CodecName = "MD5" Desc = """MD5是一种广泛使用的加密哈希函数,它接受任意长度的输入并输出固定长度(128位)的哈希值。常用于验证数据完整性,但不适用于安全加密,因为存在碰撞漏洞。"""

func (*CodecExecFlow) MakePacket

func (flow *CodecExecFlow) MakePacket(mode string) error

Tag = "其他" CodecName = "生成数据包" Desc = """生成HTTP数据包,支持使用cURL和URL""" Params = [ { Name = "mode", Type = "select",DefaultValue = "URL", Options = ["cURL", "URL"], Required = true ,Label = "输入格式"} ]

func (*CodecExecFlow) Packet2cURL

func (flow *CodecExecFlow) Packet2cURL(https bool) error

Tag = "其他" CodecName = "数据包生成cURL命令" Desc = """通过数据包生成cURL命令,以导出数据包""" Params = [ { Name = "https", Type = "checkbox", Required = true , Label = "https"} ]

func (*CodecExecFlow) RSADecrypt added in v1.3.2

func (flow *CodecExecFlow) RSADecrypt(priKey string, decryptSchema string, algorithm string) error

Tag = "解密" CodecName = "RSA解密" Desc = """RSA加密算法是一种非对称加密算法,在公开密钥加密和电子商业中被广泛使用。RSA是被研究得最广泛的公钥算法,从提出后经历了各种攻击的考验,逐渐为人们接受,普遍认为是目前最优秀的公钥方案之一。""" Params = [ { Name = "priKey", Type = "text", Required = true,Label = "pem私钥"}, { Name = "decryptSchema", Type = "select",DefaultValue = "RSA-OAEP", Options = ["RSA-OAEP", "PKCS1v15"], Required = true, Label = "填充方式"}, { Name = "algorithm", Type = "select",DefaultValue = "SHA-256", Options = ["SHA-1", "SHA-256","SHA-384","SHA-512","MD5"], Required = true ,Label = "hash算法"} ]

func (*CodecExecFlow) RSAEncrypt added in v1.3.2

func (flow *CodecExecFlow) RSAEncrypt(pubKey string, encryptSchema string, algorithm string) error

Tag = "加密" CodecName = "RSA加密" Desc = """RSA加密算法是一种非对称加密算法,在公开密钥加密和电子商业中被广泛使用。RSA是被研究得最广泛的公钥算法,从提出后经历了各种攻击的考验,逐渐为人们接受,普遍认为是目前最优秀的公钥方案之一。""" Params = [ { Name = "pubKey", Type = "text", Required = true,Label = "pem公钥"}, { Name = "encryptSchema", Type = "select",DefaultValue = "RSA-OAEP", Options = ["RSA-OAEP", "PKCS1v15"], Required = true, Label = "填充方式"}, { Name = "algorithm", Type = "select",DefaultValue = "SHA-256", Options = ["SHA-1", "SHA-256","SHA-384","SHA-512","MD5"], Required = true ,Label = "hash算法"} ]

func (*CodecExecFlow) Replace added in v1.3.2

func (flow *CodecExecFlow) Replace(find string, replace string, findType string, Global, Multiline, IgnoreCase bool) error

Tag = "其他" CodecName = "Replace" Desc = """替换字符串处理本文""" Params = [ { Name = "find", Type = "input", Required = true , Label = "Find"}, { Name = "replace", Type = "input", Required = false , Label = "Replace"}, { Name = "findType", Type = "select",DefaultValue = "regexp",Options = ["regexp","raw"], Required = true , Label = "查找方式"}, { Name = "Global", Type = "checkbox", Required = true , Label = "全部匹配"}, { Name = "IgnoreCase", Type = "checkbox", Required = true , Label = "忽略大小写"}, { Name = "Multiline", Type = "checkbox", Required = true , Label = "多行匹配"}, ]

func (*CodecExecFlow) SHA1

func (flow *CodecExecFlow) SHA1() error

Tag = "Hash" CodecName = "SHA-1" Desc = """SHA-1(安全哈希算法1)是一种加密哈希函数,输出160位哈希值,用于确保数据完整性。虽然曾广泛应用于安全领域,但由于潜在的安全漏洞,现在不再推荐用于敏感数据保护。"""

func (*CodecExecFlow) SHA2

func (flow *CodecExecFlow) SHA2(size string) error

Tag = "Hash" CodecName = "SHA-2" Desc = """SHA-2是安全哈希算法家族的一部分,包括多个版本(如SHA-256和SHA-512),输出哈希值长度不同,用于数据完整性验证和数字签名,相较于SHA-1提供更强的安全性。""" Params = [ { Name = "size", Type = "select",DefaultValue = "SHA-512", Options = ["SHA-224", "SHA-256","SHA-384","SHA-512"], Required = true ,Label = "哈希版本"} ]

func (*CodecExecFlow) SM3

func (flow *CodecExecFlow) SM3() error

Tag = "Hash" CodecName = "SM3" Desc = """SM3是一种密码哈希函数,由中国国家密码管理局发布,输出长度为256位。它用于确保数据的完整性和一致性,与MD5和SHA-1相比,SM3设计更安全,主要应用于中国的商用密码系统中。"""

func (*CodecExecFlow) SM4Decrypt

func (flow *CodecExecFlow) SM4Decrypt(key string, keyType string, IV string, ivType string, mode string, input outputType) error

Tag = "解密" CodecName = "SM4对称解密" Desc = """SM4是一个128位的块密码,目前被确定为中国的国家标准(GB/T 32907-2016)。支持多种块密码模式。""" Params = [ { Name = "key", Type = "inputSelect", Required = true,Label = "Key", Connector ={ Name = "keyType", Type = "select", DefaultValue = "hex", Options = ["hex", "raw", "base64"], Required = true ,Label = "key格式"} }, { Name = "IV", Type = "inputSelect", Required = false ,Label = "IV", Connector ={ Name = "ivType", Type = "select", DefaultValue = "hex", Options = ["hex", "raw", "base64"], Required = true ,Label = "IV格式"} }, { Name = "mode", Type = "select",DefaultValue = "CBC", Options = ["CBC", "ECB", "GCM", "CFB", "OFB"], Required = true, Label = "Mode"}, { Name = "input", Type = "select", DefaultValue = "hex", Options = ["hex", "raw", "base64"], Required = true ,Label = "输入格式"} ]

func (*CodecExecFlow) SM4Encrypt

func (flow *CodecExecFlow) SM4Encrypt(key string, keyType string, IV string, ivType string, mode string, output outputType) error

Tag = "加密" CodecName = "SM4对称加密" Desc = """SM4是一个128位的块密码,目前被确定为中国的国家标准(GB/T 32907-2016)。支持多种块密码模式。""" Params = [ { Name = "key", Type = "inputSelect", Required = true,Label = "Key", Connector ={ Name = "keyType", Type = "select", DefaultValue = "hex", Options = ["hex", "raw", "base64"], Required = true ,Label = "key格式"} }, { Name = "IV", Type = "inputSelect", Required = false ,Label = "IV", Connector ={ Name = "ivType", Type = "select", DefaultValue = "hex", Options = ["hex", "raw", "base64"], Required = true ,Label = "IV格式"} }, { Name = "mode", Type = "select", DefaultValue = "CBC",Options = ["CBC", "ECB", "GCM", "CFB", "OFB"], Required = true, Label = "Mode"}, { Name = "output", Type = "select", DefaultValue = "hex", Options = ["hex", "raw","base64"], Required = true,Label = "输出格式"} ]

func (*CodecExecFlow) TripleDESDecrypt

func (flow *CodecExecFlow) TripleDESDecrypt(key string, keyType string, IV string, ivType string, mode string, input outputType) error

Tag = "解密" CodecName = "TripleDES对称解密" Desc = """TripleDES(3DES)是DES的改进版,通过连续三次应用DES算法(可以使用三个不同的密钥)来增加加密的强度,提供了更高的安全性。""" Params = [ { Name = "key", Type = "inputSelect", Required = true,Label = "Key", Connector ={ Name = "keyType", Type = "select", DefaultValue = "hex", Options = ["hex", "raw", "base64"], Required = true ,Label = "key格式"} }, { Name = "IV", Type = "inputSelect", Required = false ,Label = "IV", Connector ={ Name = "ivType", Type = "select", DefaultValue = "hex", Options = ["hex", "raw", "base64"], Required = true ,Label = "IV格式"} }, { Name = "mode", Type = "select",DefaultValue = "CBC", Options = ["CBC", "ECB"], Required = true , Label = "Mode"}, { Name = "input", Type = "select",DefaultValue = "hex", Options = ["hex", "raw", "base64"], Required = true ,Label = "输入格式"} ]

func (*CodecExecFlow) TripleDESEncrypt

func (flow *CodecExecFlow) TripleDESEncrypt(key string, keyType string, IV string, ivType string, mode string, output outputType) error

Tag = "加密" CodecName = "TripleDES对称加密" Desc = """TripleDES(3DES)是DES的改进版,通过连续三次应用DES算法(可以使用三个不同的密钥)来增加加密的强度,提供了更高的安全性。""" Params = [ { Name = "key", Type = "inputSelect", Required = true,Label = "Key", Connector ={ Name = "keyType", Type = "select", DefaultValue = "hex", Options = ["hex", "raw", "base64"], Required = true ,Label = "key格式"} }, { Name = "IV", Type = "inputSelect", Required = false ,Label = "IV", Connector ={ Name = "ivType", Type = "select", DefaultValue = "hex", Options = ["hex", "raw", "base64"], Required = true ,Label = "IV格式"} }, { Name = "mode", Type = "select",DefaultValue = "CBC", Options = ["CBC", "ECB"], Required = true, Label = "Mode"}, { Name = "output", Type = "select",DefaultValue = "hex", Options = ["hex", "raw","base64"], Required = true ,Label = "输出格式"} ]

func (*CodecExecFlow) URLDecode

func (flow *CodecExecFlow) URLDecode() error

Tag = "解码" CodecName = "URL解码" Desc = """URL编码,又称百分号编码,是一种互联网标准,用于将非ASCII字符、保留字符或任何可能在URL中产生歧义的字符转换为一个百分号后跟两位十六进制数的形式,以确保网络传输的无歧义性和安全性。"""

func (*CodecExecFlow) URLEncode

func (flow *CodecExecFlow) URLEncode(fullEncode bool) error

Tag = "编码" CodecName = "URL编码" Desc = """URL编码,又称百分号编码,是一种互联网标准,用于将非ASCII字符、保留字符或任何可能在URL中产生歧义的字符转换为一个百分号后跟两位十六进制数的形式,以确保网络传输的无歧义性和安全性。""" Params = [ { Name = "fullEncode", Type = "checkbox", Required = true , Label = "全部编码"} ]

func (*CodecExecFlow) UnicodeDecode

func (flow *CodecExecFlow) UnicodeDecode() error

Tag = "解码" CodecName = "Unicode 中文解码" Desc = """Unicode 编解码是将世界各种文字符号映射到唯一码点,并通过编码方案(如UTF-8、UTF-16)转为字节序列的过程,以支持全球文本的统一表示和处理。"""

func (*CodecExecFlow) UnicodeEncode

func (flow *CodecExecFlow) UnicodeEncode() error

Tag = "编码" CodecName = "Unicode 编码" Desc = """Unicode 编解码是将世界各种文字符号映射到唯一码点,并通过编码方案(如UTF-8、UTF-16)转为字节序列的过程,以支持全球文本的统一表示和处理。"""

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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