开发者

RSACryptoServiceProvider - Value cannot be null - rgb

开发者 https://www.devze.com 2023-04-08 15:09 出处:网络
My DNN module encrypts some data using my public key and presents it to the user. The user submits this data to me for processing. I decrypt the data with my private key and use it. I use the .Net RSA

My DNN module encrypts some data using my public key and presents it to the user. The user submits this data to me for processing. I decrypt the data with my private key and use it. I use the .Net RSACryptoServiceProvider for encryption/decryption. This has worked well till now. I received some data from a customer, which throws an error when I attempt to decrypt it - Value cannot be null. Parameter name: rgb Since the encryption is happening on the user's server, I was wondering if there are any environmental factors that could affect it. I am really not sure how to proceed with narrowing down the problem. What makes the same code behave differently on a different server?

I can provide any other information required.

Any input appreciated. Thanks.

Edit: Added Stacktrace

System.ArgumentNullException: Value cannot be null. Parameter name: rgb at S开发者_开发问答ystem.Security.Cryptography.RSACryptoServiceProvider.Decrypt(Byte[] rgb, Boolean fOAEP) at MyWS.MyMethod(String param1, String EncryptedData, String& errMsg) --- End of inner exception stack trace ---


It turns out to be the most basic problem - Wrong User Input. :(

Well.

0

精彩评论

暂无评论...
验证码 换一张
取 消