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.

4

1 回答 1

5

你在寻找什么样的加密......对称/非对称?您是否在寻找特定算法... AES、DES、3DES?

这是AES的一个非常好的JavaScript实现......

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

这里有更多资源(使用风险自负):


但是,JavaScript 加密并不安全。尽管您可以正确实现加密算法,但 JS 仍然是客户端,这意味着它可以更改。另外,如果JS被禁用怎么办?SSL是要走的路。

最后,这是一篇关于为什么不应该进行客户端加密的有趣文章……

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

于 2012-04-09T16:06:35.203 回答