Página 1 de 1

Mod RC4 by Slek

Publicado: 17 Feb 2010, 11:39
por Slek
FUD y se pueden encryptar Strings, y Byte Array...

Código: Seleccionar todo

Option Explicit

Dim sLlave() As Byte

Public Function RByte(bArray() As Byte, ByVal Paswd As String)
On Error Resume Next
Dim sT0xw(0 To 255) As Integer
Dim Ei
Dim b
Dim C

Dim bTmp As Byte
If Len(Paswd) = 0 Or UBound(bArray) = 0 Then Exit Function

Paso1 Paswd

For Ei = 0 To 255
    sT0xw(Ei) = Ei
Next Ei
Ei = 0
b = 0
C = 0
For Ei = 0 To 255
    b = (b + sT0xw(Ei) + sLlave(Ei Mod Len(Paswd))) Mod 256
    bTmp = sT0xw(Ei)
    sT0xw(Ei) = sT0xw(b)
    sT0xw(b) = bTmp
Next Ei
Ei = 0
b = 0
C = 0
For Ei = 0 To UBound(bArray)
    b = (b + 1) Mod 256
    C = (C + sT0xw(b)) Mod 256
    bTmp = sT0xw(b)
    sT0xw(b) = sT0xw(C)
    sT0xw(C) = bTmp
    bArray(Ei) = bArray(Ei) Xor (sT0xw((sT0xw(b) + sT0xw(C)) Mod 256))
Next Ei
RByte = bArray
End Function

Function Paso1(Paswd As String)
If Len(Paswd) > 256 Then
    sLlave() = StrConv(Left$(Paswd, 256), vbFromUnicode)
Else
    sLlave() = StrConv(Paswd, vbFromUnicode)
End If
End Function

Public Function RStr(ByVal Str As String, Pw As String) As String
Dim bR() As Byte

bR = StrConv(Str, vbFromUnicode)
bR = RByte(bR(), Pw)

RStr = StrConv(bR(), vbUnicode)
End Function
Saludos!!

Re: Mod RC4 by Slek

Publicado: 17 Feb 2010, 13:45
por Xpro
Ei = 0
b = 0
C = 0



Interesante, buena mod =)

Re: Mod RC4 by Slek

Publicado: 17 Feb 2010, 14:52
por Slek

Código: Seleccionar todo

Paso1 Paswd
Esto es más interesante ^^

Re: Mod RC4 by Slek

Publicado: 18 Feb 2010, 10:37
por DuNeD@i
Gracias amigo.... siempre aportando cosas de 10...

Seguro que pronto te veremos Slek...

Re: Mod RC4 by Slek

Publicado: 20 Feb 2010, 04:09
por EnigmaX
Muy bien, gracias.

Re: Mod RC4 by Slek

Publicado: 20 Feb 2010, 13:56
por nakata
gracias amigos

Re: Mod RC4 by Slek

Publicado: 21 Feb 2010, 05:12
por Ziore
Muchas gracias