Message is pretty explicit!
Quote:
System.Security.Cryptography.CryptographicException was caught
HResult=-2146233296
Message=Decrypting a value requires that a key be set on the algorithm object.
What you don't understand here ?
Decrypting a value requires that a key be set on the algorithm object
Tells you that you need to provide a decryption key.
You should learn to use the debugger as soon as possible. Rather than guessing what your code is doing, It is time to see your code executing and ensuring that it does what you expect.
The debugger allow you to follow the execution line by line, inspect variables and you will see that there is a point where it stop doing what you expect.
Debugger - Wikipedia, the free encyclopedia[
^]
Mastering Debugging in Visual Studio 2010 - A Beginner's Guide[
^]
The debugger is here to show you what your code is doing and your task is to compare with what it should do.