‘==============RC4: ==========================
‘============================================
Public Sub main()
Dim key As String
For i = 1 To 16
Randomize
key = key & Chr(Rnd * 255)
Next i
MsgBox RC4(RC4("Welcome To Plindge Studio!", key), key)
End Sub
Public Function RC4(inp As String, key As String) As String
Dim S(0 To 255) As Byte, K(0 To 255) As Byte, i As Long
Dim j As Long, temp As Byte, Y As Byte, t As Long, x As Long
Dim Outp As String
For i = 0 To 255
S(i) = i
Next
j = 1
For i = 0 To 255
If j > Len(key) Then j = 1
K(i) = Asc(Mid(key, j, 1))
j = j + 1
Next i
j = 0
For i = 0 To 255
j = (j + S(i) + K(i)) Mod 256
temp = S(i)
S(i) = S(j)
S(j) = temp
Next i
i = 0
j = 0
For x = 1 To Len(inp)
i = (i + 1) Mod 256
j = (j + S(i)) Mod 256
temp = S(i)
S(i) = S(j)
S(j) = temp
t = (S(i) + (S(j) Mod 256)) Mod 256
Y = S(t)
Outp = Outp & Chr(Asc(Mid(inp, x, 1)) Xor Y)
Next
RC4 = Outp
End Function
’===============================================
’================MD5-============================
Function MD5F(ByVal tempstr As String, ByVal w As String, ByVal x As String, ByVal Y As String, _
ByVal z As String, ByVal Xin As String, ByVal qdata As String, ByVal rots As Integer)
MD5F = BigMod32Add(RotLeft(BigMod32Add(BigMod32Add(w, tempstr), BigMod32Add(Xin, qdata)), rots), x)
End Function
Sub MD5F1(w As String, ByVal x As String, ByVal Y As String, ByVal z As String, ByVal Xin As String, ByVal qdata As String, ByVal rots As Integer)
Dim tempstr As String
tempstr = BigXOR(z, BigAND(x, BigXOR(Y, z)))
w = MD5F(tempstr, w, x, Y, z, Xin, qdata, rots)
End Sub
Sub MD5F2(w As String, ByVal x As String, ByVal Y As String, ByVal z As String, ByVal Xin As String, ByVal qdata As String, ByVal rots As Integer)
Dim tempstr As String
tempstr = BigXOR(Y, BigAND(z, BigXOR(x, Y)))
w = MD5F(tempstr, w, x, Y, z, Xin, qdata, rots)
End Sub
Sub MD5F3(w As String, ByVal x As String, ByVal Y As String, ByVal z As String, ByVal Xin As String, ByVal qdata As String, ByVal rots As Integer)
Dim tempstr As String
tempstr = BigXOR(x, BigXOR(Y, z))
w = MD5F(tempstr, w, x, Y, z, Xin, qdata, rots)
End Sub
Sub MD5F4(w As String, ByVal x As String, ByVal Y As String, ByVal z As String, ByVal Xin As String, ByVal qdata As String, ByVal rots As Integer)
Dim tempstr As String
tempstr = BigXOR(Y, BigOR(x, BigNOT(z)))
w = MD5F(tempstr, w, x, Y, z, Xin, qdata, rots)
End Sub
Function MD5_Calc(ByVal hashthis As String) As String
ReDim buf(0 To 3) As String
ReDim Xin(0 To 15) As String
Dim tempnum As Integer, tempnum2 As Integer, loopit As Integer, loopouter As Integer, loopinner As Integer
Dim a As String, b As String, c As String, d As String
' Add padding
tempnum = 8 * Len(hashthis)
hashthis = hashthis + Chr$(128) 'Add binary 10000000
tempnum2 = 56 - Len(hashthis) Mod 64
&nbs

7278

被折叠的 条评论
为什么被折叠?



