Question: I am looking for way to encrypt string in C# and to decrypt it using JavaScript. JavaScript in this case is a scripting language for internal system, so I should not worry about people accessing private key/password which will be required for decryption. 

Searching online for solution it seems that AES encryption should do the trick. I’ve looked into [slowAES and RijndaelManaged solution](https://stackoverflow.com/questions/1149611/getting-slowaes-and-rijndaelmanaged-class-in-net-to-play-together), but had no luck getting it to work. 

I’ve used C# code which Cheeso provided and received identical cipher text. But when I’ve attempted to use slowAES to encrypt same piece of data I’ve received completely different cipher. 

```
var testString = new Array("w", "a", "t", "s", "o", "n", "?");
var test = slowAES.encrypt(testString, slowAES.modeOfOperation.CBC, "12345678901234567890123456789012", slowAES.aes.keySize.SIZE_256, new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
alert(test.cipher);

```

Can someone point me into right direction? I don’t care on the method, as long as I can achieve results. My goal is to take URL for example:

www.test.com/clientid=123

use .NET (C#) to encrypt it to look like

www.test.com/clientid=asdf;lkjsxd;flkjq934857u9duhfgkjhgalsdkjfh

and then use JavaScript to convert it back to

www.test.com/clientid=123

Thanks,
ITRushn

Answer: 
Encryption/decryption operations occur on binary data. Therefore, you must preserve that binary data between C# and javascript. Encoding the output as a base64 or hexadecimal string is probably the best way to do that.
I’ve managed to solve my issue using RC4 encryption. You can get more information about implementation on my [blog](http://vkuzin.com/2009/10/15/passing-encrypted-data-between-c-and-javascript/).