0

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 System.Security.Cryptography.RSACryptoServiceProvider.Decrypt(Byte[] rgb, Boolean fOAEP) at MyWS.MyMethod(String param1, String EncryptedData, String& errMsg) --- End of inner exception stack trace ---
Apeksha
  • 485
  • 6
  • 23
  • Include the stack trace. There's a missing parameter, and seeing where the exception originates will likely identify it. – erickson Sep 27 '11 at 17:51
  • Thanks erickson. The stacktrace is added - I am not sure how helpful it is, though. – Apeksha Sep 27 '11 at 18:48
  • Yes, that helps. Documentation says that the missing argument is the cipher text itself. Probably need to see the code for `MyWS.MyMethod()` to see how that might be null. – erickson Sep 27 '11 at 18:52

1 Answers1

0

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

Well.

Apeksha
  • 485
  • 6
  • 23