Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript encryption library (client side encrypt | server side decrypt) [closed]

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.

like image 544
royu Avatar asked Aug 14 '26 14:08

royu


1 Answers

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):

  • http://crypto.stanford.edu/sjcl/
  • http://www.farfarfar.com/scripts/encrypt/
  • http://code.google.com/p/jscryptolib/
  • https://github.com/drench/blowfish.js/blob/master/blowfish.js

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/

like image 160
Hristo Avatar answered Aug 16 '26 06:08

Hristo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!