我如何在javascript中进行DES加密并在CS(C#)中解密 [英] how i do the DES encryption in javascript and decrypt in CS (C#)

查看:148
本文介绍了我如何在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


这篇关于我如何在javascript中进行DES加密并在CS(C#)中解密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆