求教VB6.0关于BASE64加密算法错误问题

来源:百度知道 编辑:UC知道 时间:2024/06/23 22:52:34
'是在网上别人写的一段代码改的,加密部分正确,比如我输入emixo加密后是ZW1peG8= 但是在用B64U函数解密ZW1peG8=就不行了
解密下来是:浥硩o 求高手解答~~详细点~~

原加密解密函数地址:
(你发表的内容太长,超过3000字请缩减后提问)http://hi.baidu.com/emixo/modify/blog/f7c394d116a0b73c9b5027d3

Option Explicit

Private Const BASE64CHR As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
Private psBase64Chr(0 To 63) As String

'从一个经过Base64的字符串中解码到源字符串
Public Function DecodeBase64String(str2Decode As String) As String
DecodeBase64String = StrConv(DecodeBase64Byte(str2Decode), vbUnicode)
End Function

'从一个经过Base64的字符串中解码到源字节数组
Public Function DecodeBase64Byte(str2Decode As String) As Byte()

Dim lPtr As Long
Dim iValue As Integer
Dim iLen As Integer
Dim iCtr As Integer
Dim Bits(1 To 4) As Byte
Dim strDecode As String
Dim str As String
Dim Output() As Byte

Dim iIndex As Long

Dim lFrom As Long
Dim lTo As Long

InitBase

'//除去回车<