Alaska Software Inc. - RC4 Encryption library or ActiveX control
Username: Password:
AuthorTopic: RC4 Encryption library or ActiveX control
Stephen BryanRC4 Encryption library or ActiveX control
on Fri, 10 Jun 2011 16:13:09 -0400
I have a need to send an HTTP post to a website that requires the data 
string to be RC4 encrypted.

Does anyone know of a routine, library, or ActiveX control that will do RC4 
encryption? I found a routine written in PHP but haven't successfully gotten 
it to work after an attempt at porting to Xbase++.

I've attached the PHP code if anyone would like to try their hand at porting 
it to Xbase++.

Stephen


RC4.zip
Andreas Gehrs-Pahl
Re: RC4 Encryption library or ActiveX control
on Sat, 11 Jun 2011 17:49:46 -0400
Stephen,

>I have a need to send an HTTP post to a website that requires the data 
>string to be RC4 encrypted.

Try the attached routine. It seems to be working, but you should make 
sure that your PHP routine works the same way and that the website uses
the same algorithm. The example code uses a random numeric key, but what
you probably need to use is a hash (such as Sha256 o MD5) of a key phrase 
instead. Those are usually displayed as a (long) hexadecimal string. You
might have to first convert that password into a number or you might have
to convert a hexadecimal string into a number.

In addition, the PHP routine doesn't use any Salt value, so it might not 
create the exact results that the website expects, if it incorporates a
Salt value.

This should get you at least started, though.

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas.GP@Charter.net
       Andreas.Gehrs-Pahl@EJusticeSolutions.com
       Andreas@DDPSoftware.com
web:   http://www.Aerospace-History.net

files.zip
Stephen BryanRe: RC4 Encryption library or ActiveX control
on Sun, 12 Jun 2011 08:37:47 -0400
Hi Andreas,

>This should get you at least started, though.

Thank you for the reply. The routine you uploaded encrypts and decrypts fine 
but the result is different than what the PHP script I'm sending to wants. I 
changed it to use a key phrase but something else must be different. The 
code I uploaded is the algorithm the website uses. I'll play with it and see 
If I can get them working the same.

Thanks again,

Stephen