用vb实现DES加解密算法(三)--解密(3) Dim C12(27) As Byte: Dim D12(27) As Byte: Dim C13(27) As Byte: Dim D13(27) As Byte: Dim C14(27) As Byte: Dim D14(27) As Byte: Dim C15(27) As Byte: Dim D15(27) As Byte: Dim C16(27) As Byte: Dim D16(27) As Byte:
Dim C_D(55) As Byte 'Cn,Dn合并后的存放处
Dim K1(47) As Byte: Dim K2(47) As Byte: Dim K3(47) As Byte: Dim K4(47) As Byte: Dim K5(47) As Byte: Dim K6(47) As Byte: Dim K7(47) As Byte: Dim K8(47) As Byte: Dim K9(47) As Byte: Dim K10(47) As Byte: Dim K11(47) As Byte: Dim K12(47) As Byte: Dim K13(47) As Byte: Dim K14(47) As Byte: Dim K15(47) As Byte: Dim K16(47) As Byte:
Dim i As Integer Dim j As Integer '取密钥的前8字节 tempKey = StrConv(sKey, vbFromUnicode) ReDim Preserve tempKey(7)
For i = 0 To 7 BinKey(i * 8 + 0) = (tempKey(i) And &H80) \ &H80 BinKey(i * 8 + 1) = (tempKey(i) And &H40) \ &H40 BinKey(i * 8 + 2) = (tempKey(i) And &H20) \ &H20 BinKey(i * 8 + 3) = (tempKey(i) And &H10) \ &H10 BinKey(i * 8 + 4) = (tempKey(i) And &H8) \ &H8 BinKey(i * 8 + 5) = (tempKey(i) And &H4) \ &H4 BinKey(i * 8 + 6) = (tempKey(i) And &H2) \ &H2 BinKey(i * 8 + 7) = (tempKey(i) And &H1) \ &H1 Next