Encryption | algorithm VB version RC4 algorithm
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)
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