3

I am looking for a javascript library with I can encrypt client side and decrypt server side using C#.

Does such a library exist? Are there examples howto encrypt client side and howto decrypt in C# server side?


edit - extra explanation

On a site with low treshold the requirement is http. Some data (litte) will be send to the server. Idea is that the user give some data (also a key - will not be sent), data will be encrypt and send to the server (key is also known on server side). Data is not real sensitive, preference is not to send it as plain text ...

I tried http://code.google.com/p/crypto-js/ AES. But I can't figure out how that data is encypted (client side, utf 8 or ..., etc.). If I encrypt some data client side (with same iv and private key etc) and do the same in C# I get different strings.

royu
  • 377
  • 2
  • 5
  • 15

1 Answers1

5

What kind of encryption are you looking for... symmetric/asymmetric? Are you looking for a specific algorithm... AES, DES, 3DES?

Here's a really good JavaScript implementation of AES...

http://point-at-infinity.org/jsaes/

Here's some more resources (use at your own risk):


However, JavaScript encryption is not secure. Though you may implement an encryption algorithm correctly, JS is still client-side which means it can be changed. Also, what if JS is disabled? SSL is the way to go.

Finally, here's an interesting article on why you should not do client-side encryption...

http://www.matasano.com/articles/javascript-cryptography/

Hristo
  • 45,559
  • 65
  • 163
  • 230