in the example code, when i encrpyt a char string and decrpt that same string, the execution works fine. But when I use the same SimpleDes class and the same encrption text, but instead manually save that excrpted text to a text file, (eg: config.ini) and then read back that excrypted string, then the exception error fires. Here are the steps i take.. 1.
encrypt a plain text string. 2. manually copy the encrypted text to a file called config.ini. 3. Using code, retrieve the excrptyed string. 4. using code, try converting the encrpted string back to the plain text string that was used in step 1. Note that the code I used for SimpleDesc class module, is verbatime from MSDN. I suspect that the issue is related to encoding and I am not familair enough with encoding and encrption logic and find it hard to understand at this time. From other blogs in researching this error, one thing noted to check was to this exception is to use .ToBase64String conversion method. That method is used in my example code for both encrpt and decrpt. I would appreciate any thoughts on what to consider could be the cause of the error. For running a test, pls note in the code module, Main(), i started both testing logic in there, by using val1 and va2. The Val2 satement is one i switched on back and forth for my testing method. Thanks