主页 > 知识库 > vbs base64 解密脚本代码

vbs base64 解密脚本代码

热门标签:检查注册表项 服务器配置 铁路电话系统 银行业务 网站文章发布 美图手机 呼叫中心市场需求 智能手机

复制代码 代码如下:

Function fDecode(sStringToDecode)
'This function will decode a Base64 encoded string and returns the decoded string.
'This becomes usefull when attempting to hide passwords from prying eyes.
Const CharList = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
Dim iDataLength, sOutputString, iGroupInitialCharacter
sStringToDecode = Replace(Replace(Replace(sStringToDecode, vbCrLf, ""), vbTab, ""), " ", "")
iDataLength = Len(sStringToDecode)
If iDataLength Mod 4 > 0 Then
fDecode = "Bad string passed to fDecode() function."
Exit Function
End If
For iGroupInitialCharacter = 1 To iDataLength Step 4
Dim iDataByteCount, iCharacterCounter, sCharacter, iData, iGroup, sPreliminaryOutString
iDataByteCount = 3
iGroup = 0
For iCharacterCounter = 0 To 3
sCharacter = Mid(sStringToDecode, iGroupInitialCharacter + iCharacterCounter, 1)
If sCharacter = "=" Then
iDataByteCount = iDataByteCount - 1
iData = 0
Else
iData = InStr(1, CharList, sCharacter, 0) - 1
If iData = -1 Then
fDecode = "Bad string passed to fDecode() function."
Exit Function
End If
End If
iGroup = 64 * iGroup + iData
Next
iGroup = Hex(iGroup)
iGroup = String(6 - Len(iGroup), "0") iGroup
sPreliminaryOutString = Chr(CByte("H" Mid(iGroup, 1, 2))) Chr(CByte("H" Mid(iGroup, 3, 2))) Chr(CByte("H" Mid(iGroup, 5, 2)))
sOutputString = sOutputString Left(sPreliminaryOutString, iDataByteCount)
Next
fDecode = sOutputString
End Function

base64 测试代码:
复制代码 代码如下:

Function fDecode(sStringToDecode)
'This function will decode a Base64 encoded string and returns the decoded string.
'This becomes usefull when attempting to hide passwords from prying eyes.
Const CharList = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
Dim iDataLength, sOutputString, iGroupInitialCharacter
sStringToDecode = Replace(Replace(Replace(sStringToDecode, vbCrLf, ""), vbTab, ""), " ", "")
iDataLength = Len(sStringToDecode)
If iDataLength Mod 4 > 0 Then
fDecode = "Bad string passed to fDecode() function."
Exit Function
End If
For iGroupInitialCharacter = 1 To iDataLength Step 4
Dim iDataByteCount, iCharacterCounter, sCharacter, iData, iGroup, sPreliminaryOutString
iDataByteCount = 3
iGroup = 0
For iCharacterCounter = 0 To 3
sCharacter = Mid(sStringToDecode, iGroupInitialCharacter + iCharacterCounter, 1)
If sCharacter = "=" Then
iDataByteCount = iDataByteCount - 1
iData = 0
Else
iData = InStr(1, CharList, sCharacter, 0) - 1
If iData = -1 Then
fDecode = "Bad string passed to fDecode() function."
Exit Function
End If
End If
iGroup = 64 * iGroup + iData
Next
iGroup = Hex(iGroup)
iGroup = String(6 - Len(iGroup), "0") iGroup
sPreliminaryOutString = Chr(CByte("H" Mid(iGroup, 1, 2))) Chr(CByte("H" Mid(iGroup, 3, 2))) Chr(CByte("H" Mid(iGroup, 5, 2)))
sOutputString = sOutputString Left(sPreliminaryOutString, iDataByteCount)
Next
fDecode = sOutputString
End Function
msgbox fDecode("d3d3LmpiNTEubmV0")

需要测试加密的代码的朋友可以访问 https://www.jb51.net/tools/base64.htm

您可能感兴趣的文章:
  • Base64在线编码解码实现代码 演示与下载
  • asp base64加解密函数代码
  • vbs版的解密base64加密的脚本
  • 关于加密解密 Base64 and URL and Hex Encoding and Decoding
  • 关于base64加密/解密
  • JavaScript Base64编码和解码,实现URL参数传递。
  • Javascript base64编码实现代码

标签:长治 河南 上海 红河 沈阳 乐山 沧州 新疆

巨人网络通讯声明:本文标题《vbs base64 解密脚本代码》,本文关键词  ;如发现本文内容存在版权问题,烦请提供相关信息告之我们,我们将及时沟通与处理。本站内容系统采集于网络,涉及言论、版权与本站无关。
  • 相关文章
  • 收缩
    • 微信客服
    • 微信二维码
    • 电话咨询

    • 400-1100-266