文件名称:VB ASP MD5 SHA HMAC AES GZIP BASE64 微信公众号EncodingAESKey 十全大补DLL
文件大小:272KB
文件格式:ZIP
更新时间:2019-02-05 03:41:12
MD5 SHA GZIP BASE64 AES
CNBJX-原创函数,首发CSND 3.1 Base64 ------------------------------------------------------------------------------- Base64Decode(Str) Base64DecodeRaw(Str) as byte() Base64Encode(Str) FileBase64(file) 3.2 Hex ------------------------------------------------------------------------------- HexDecode(Str) HexDecodeRaw(Str) as byte() HexEncode(Str) File2Hex(file) 3.3 hash String ------------------------------------------------------------------------------- stringOrByte : 可以是字条串或字节数组 ChatSet : 可选,指定编码 MD2(stringOrByte, [ChatSet As String]) As String MD4(stringOrByte, [ChatSet As String]) As String MD5(stringOrByte, [ChatSet As String]) As String SHA1(stringOrByte, [ChatSet As String]) SHA256(stringOrByte, [ChatSet As String]) As String SHA384(stringOrByte, [ChatSet As String]) As String SHA512(stringOrByte, [ChatSet As String]) As String 3.4 hash Byte ------------------------------------------------------------------------------- abytData : 字节数组 asp里请加()号 如: bytes="" md5_byte((bytes),0,0) 可选参数 iStart iEnd 默认为0,取整个 bytes的hash值 ---------------------------------------------------- [可选] iStart: 起始位置 [可选] iEnd:结束位置 分块取值有几种情况 1: iStart = 0 , iEnd = 1024 * 1024 * 1 '读取前面1M 2: iStart = -1024 * 1024 * 1 , iEnd = 0 '读取后面1M 3: iStart = 10, iEnd = iStart + 10 '读取第10个字节后的10个字节 (10-20) 4: iStart = -20,iEnd = -10 '读取尾部 (-20 -> -10 的字节) ---------------------------------------------------- MD2_Byte(abytData As Array(Byte), [iStart As Double = 0], [iEnd As Double = 0]) As String MD4_Byte(abytData As Array(Byte), [iStart As Double = 0], [iEnd As Double = 0]) As String MD5_Byte(abytData As Array(Byte), [iStart As Double = 0], [iEnd As Double = 0]) As String SHA1_Byte(abytData As Array(Byte), [iStart As Double = 0], [iEnd As Double = 0]) As String SHA256_Byte(abytData As Array(Byte), [iStart As Double = 0], [iEnd As Double = 0]) As String SHA384_Byte(abytData As Array(Byte), [iStart As Double = 0], [iEnd As Double = 0]) As String SHA512_Byte(abytData As Array(Byte), [iStart As Double = 0], [iEnd As Double = 0]) As String 3.5 hash file ------------------------------------------------------------------------------- MD2_file(fileName As String, [iStart As Double = 0], [iEnd As Double = 0]) As String MD4_file(fileName As String, [iStart As Double = 0], [iEnd As Double = 0]) As String MD5_file(fileName As String, [iStart As Double = 0], [iEnd As Double = 0]) As String SHA1_file(fileName As String, [iStart As Double = 0], [iEnd As Double = 0]) As String SHA256_file(fileName As String, [iStart As Double = 0], [iEnd As Double = 0]) As String SHA384_file(fileName As String, [iStart As Double = 0], [iEnd As Double = 0]) As String SHA512_file(fileName As String, [iStart As Double = 0], [iEnd As Double = 0]) As String 3.6 hash hmac ------------------------------------------------------------------------------- 依赖系统mscorlib.dll,就是说系统必须安装NET Framework 组件 默认输出16进制值,可指定 output: hex base64 raw ---------------------------------------------------- MD5_HMAC(skey As String, data, [output As String = "hex"]) SHA1_HMAC(skey As String, data, [output As String = "hex"]) SHA256_HMAC(skey As String, data, [output As String = "hex"]) SHA384_HMAC(skey As String, data, [output As String = "hex"]) SHA512_HMAC(skey As String, data, [output As String = "hex"]) 3.6 hash 完整调用 ------------------------------------------------------------------------------- algo : md2 md4 md5 sha1 sha256 sha384 sha512 hmac 计算时不支持 md2 md4 ---------------------------------------------------- Hash(algo, stringOrByte, [ChatSet As String]) Hash_Byte(algo, abytData As Array(Byte), [iStart As Double = 0], [iEnd As Double = 0]) As String Hash_file(algo, fileName, [iStart As Double = 0], [iEnd As Double = 0]) As String Hash_HMAC(algo As String, skey As String, data, [output As String = "hex"]) 3.7 字节和字符串相互转换 ------------------------------------------------------------------------------- Byte2String(dataByte, [ChatSet As String]) As String String2Byte(dataStr As String, [ChatSet As String]) As Array(Byte) getFileBytes(fileName) As Array(Byte) 3.8 文件拆分和合并 ------------------------------------------------------------------------------- 拆分 SourceFile: 源文件 DestinationFile : 目录路径文件 如: d:\test.tmp 生成 test.tmp.001 -> test.tmp.010 有*号 d:\test.*.tmp 生成 test.001.tmp -> test.010.tmp ChunkSize : 拆分字节大小 1024 * 1024 * 10 10M BufferSize: 每次读写的字节数 默认: 256K 1024*256 函数返回: Array(True||False, fileCount, arrayfileName) FileSplit(SourceFile As String, DestinationFile As String, ChunkSize As Double, [BufferSize As Long = 262144]) 合并 mergeSaveFile : 要保存的结果文件 splitFile: 拆分的文件 d:\test.tmp 取 test.tmp.001 -> d:\test.*.tmp 取 test.001.tmp -> Chunks: 文件个数,为0时,自动判断 函数返回: True || False FileMerge(mergeSaveFile As String, splitFile As String, [Chunks As Long = 0], [BufferSize As Long = 262144]) 3.9 Gzip解压和压缩 ------------------------------------------------------------------------------- GunZip(ByteArray As Array(Byte), [ChatSet As String = "UTF-8"]) As String GZip(stringOrByte, [ChatSet As String = "UTF-8"]) As Array(Byte) 3.10 AES函数 (依赖系统mscorlib.dll,就是说系统必须安装NET Framework 组件) ------------------------------------------------------------------------------- A. AES/CBC/PKCS7 encrypt(data, privateKey) 加密 AES/CBC/PKCS7 128位模式 decrypt(data, privateKey) 解密 AES/CBC/PKCS7 128位模式 解密 B. AES/CBC/ZERO encrypt_cbc_zero_128(data, privateKey) decrypt_cbc_zero_128(data, privateKey) C. 完整 cipher : CBC CFB CTS ECB OFB [默认:CBC] paddingmode : ANSIX923 ISO10126 NONE PKCS7 ZEROS [默认:PKCS7] 注: privateKey iv 程序做了自动修正 根据:KeySize BlockSize 长度,自动截取或补chr(0) mcrypt_encrypt(cipher, privateKey, data, paddingmode, iv, [KeySize As Long = 128], [BlockSize As Long = 128]) mcrypt_decrypt(cipher, privateKey, data, paddingmode, iv, [KeySize As Long = 128], [BlockSize As Long = 128], [output As String = "raw"]) 3.11 微信公众号消息加解密 ------------------------------------------------------------------------------- 注: wxDecrypt 解密时,如from_appid <> appid , 返回 "" 值 wxEncrypt(msgtext As String, encodingAesKey As String, appId As String) As String wxDecrypt(msgtext As String, encodingAesKey As String, appId As String) As String wxSignature(Token As String, timestamp As String, nonce As String, msg_encrypt As String) As String
【文件预览】:
yxcms_com.dll
yxcms_com_asp.dll
安装.bat
函数列表.gif
函数列表.txt
卸载asp.bat
安装asp.bat
vbsedit.jpg
demo
----weixi()
--------asp()
--------js()
----demo.vbs(3KB)
卸载.bat
2个DLL区别.txt
作者唠叨下.txt
gzip.dll