Share this post

Link to post

Share on other sites

Valik 470

As far as I know, the version I posted for you the other day is correct. I don't see any appreciable difference in your version which would make it any more "right" than what I've posted. Some of the others were broken, yes, but nobody has ever shown mine to be broken.

In short, before you say all the others are wrong, please prove they are wrong, mine in particular.

Share this post

Link to post

Share on other sites

a6m1n0 0

My apologies if I gave you the impression your code was wrong or broken, but I never stated that the your RC4 UDF or the others available here were 'wrong' or 'broken'. I stated they were incompatible with the implementations that I use in other programming languages.

I am no expert in cryptography just a user of the methods. However, the scope of my current project require using AutoIt to interface with my existing code base, some of which was acquired from the links in my first post.

Otherwise your RC4 implementation as well as the others offered here seem to work fine within AutoIt3 itself.

EDIT: I planned to post a 'thank you' directly after posting this with a thorough explanation but was called away from my computer before I had a chance. So, Thank you for digging up your old code and posting it -- if I weren't in need of interfacing with RC4 implementations I already have then it would have been fine I am certain.

Share this post

Link to post

Share on other sites

a6m1n0 0

Well I'll be damned. When you're wrong you are just wrong, and wrong I was, lol. I ran a test (attached) and it seems that I didn't do enough testing.

But I have a good excuse. My first attempt using RC4 in AutoIt was _StingEncrypt. My second attempt was using RazerM's _StringEncryptRC4/_StringDecryptRC4 BUT I did not realize that the HEX conversion was called from within that UDF, and I was using it like _StringToHexEx(_StringEncryptRC4($mytext,$mypass)) and hence the assumed incompatibility. My third attempt was using Valik's script, and to be honest I can't remember what I was doing with it, but whatever it was it was not producing compatible results -- by this time it was early morning and I was to tired to worry about it deciding that I just needed to port it from something I knew worked.

So, I stand corrected and apologies all around -- your script Valik, as well as your script RazerM, both work fine. I can at least say I learned a great deal about porting ASP VBScript to AutoIt3. The only bonus my UDF seems to have is that it is defined as one function instead of two, otherwise it produces the same results.