Que ona Peter, fijate que ya lo solucione con esto:
Código:
public String encryptsRC4(String plaintxt, String Password)
{
int temp = 0;
int a = 0;
int i = 0;
int j = 0;
int k;
int cipherby = 0;
String cipher = "";
try
{
RC4Initialize(Password);
for (a = 0; a < plaintxt.Length; a++)
{
i = (i + 1) % 256;
j = (j + sbox[i]) % 256;
temp = sbox[i];
sbox[i] = sbox[j];
sbox[j] = temp;
k = sbox[(sbox[i] + sbox[j]) % 256];
cipherby = ((int)(plaintxt[a])) ^ k;
cipher += (char)cipherby;
}
return cipher;
}
catch (Exception ex)
{ throw ex; }
}
Pero ahora quiero convertir a hexadecimal el resultado, he encontrado esto:
Código:
while (Data.Length > 0)
{
sValue= Data.Substring(0, 1).ToString()
sValue= Strings.Asc(sValue)
sValue = Conversion.Hex(sValue)
Data = Data.Substring(1, Data.Length - 1);
sHex = sHex + sValue;
}
Pero no logro solucionar:
Strings.Asc(sValue)
Conversion.Hex(sValue)
me da error.