'sCode 待解密字串 'sKey 密钥字串 Public Sub DES_Decode(ByRef sCode() As Byte, ByVal sKey As String, ByRef bReturn() As Byte) Attribute DES_Decode.VB_Description = "解密 sCode:密文16进制串 sKey:密钥文本,前8位有效 bReturn:明文16进制串"
Dim LenTimes As Integer '明文
Dim tempKey() As Byte '存放密钥 Dim BinKey(63) As Byte '64位二进制原始密钥 Dim KeyPC_1(55) As Byte '存放56位密钥
Dim tempCode(7) As Byte '存放8位原始密文 Dim tempReturn(7) As Byte '存放8位明文 Dim BinCode(63) As Byte '存放64位明文 Dim CodeIP(63) As Byte '存放IP置换结果 Dim CodeE(47) As Byte 'E膨胀结果 Dim CodeP(31) As Byte 'P变换结果 Dim RetS(47) As Byte 'S盒运算32位结果 Dim S(7) As Byte 'S盒运算8个结果 Dim CodeS1(5) As Byte: Dim CodeS2(5) As Byte: Dim CodeS3(5) As Byte: Dim CodeS4(5) As Byte