vatza
asked on
RC4 encryption in VBScript
I am encrypting a string in a website with RC4 algorithm. I am then sending the encrypted value as cookie to another website where I am trying to decrypt it with the same code. But I am not able to decrypt and get the original value.
I am not knowing whether I am missing any encoding/decoding as am new to VBScript. Please help
I am not knowing whether I am missing any encoding/decoding as am new to VBScript. Please help
ASKER
Thanks. I am using the same script for RC4 encryption and decryption from 4guysfromrolla.com.
I am having an aspx page where I am encrypting a text and setting it as a cookie. I am retrieving the cookie at a classic asp page where I have the same script to decypt it.
The key, of course, remains the same.
I am not sure whether that will make a difference.
I am having an aspx page where I am encrypting a text and setting it as a cookie. I am retrieving the cookie at a classic asp page where I have the same script to decypt it.
The key, of course, remains the same.
I am not sure whether that will make a difference.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Another test is to see if you can both encrypt and decrypt from an ASP.NET page to see if that code even works in ASP.NET.
Here is one where you should be able to use for both encrypt and decrypt by calling the function. Is page 2 using classic asp? If not, I wonder if it is possible you are encrypting in vbscript to a cookie, then decrypting it in php for example. It may not be the same algorithm and give slightly different results.
Open in new window