我如何在javascript中进行DES加密并在CS(C#)中解密

问题描述:

有人可以帮我解决这个问题吗?
我在javascript中编码了用户名,并且需要在cs
中解密

Can someone help me to solve this problem?
I encode the username in javascript and i need to decrypt in cs
the library using in cs " using System.Security.Cryptography; " doesn''t give the same result of decrypt the plaintext.

使用 DESCryptoServiceProvider.CreateDecryptor,并确保传递相同的内容传递给Javascript实现时的key和IV.然后检查是否已将返回的DES对象的模式"和填充"属性设置为相同.作者声称JS实现与其他库兼容,因此您只需要使用相同的选项设置两个方面即可.
Use DESCryptoServiceProvider.CreateDecryptor, and make sure you pass the same key and IV as you pass to the Javascript implementation. Then check that you''ve set the properties of the returned DES object for Mode and Padding to the same. The author claims that the JS implementation is compatible with other libraries so you should just need to set the two sides up with the same options.


如何将加密的字符串从Javascript发送到CS ,请提供一些代码.

您从JS使用哪种加密算法.

问候
鲁西
How are you sending your encrypted string from Javascript to CS, please provide us a little code.

What kind of Encryption Algo are you using from JS.

Regards
Rushi