Invalid length for a Base-64 char array.

Topics: Cryptography Application Block
Sep 17, 2007 at 5:13 PM
I am encoding a simple 9 digits and constantly getting this error when decoding. It worked fine for a while.

Error:
Invalid length for a Base-64 char array.

Code:
Line 29: public static string DecryptString( string val )
Line 30: {
Line 31: return Cryptographer.DecryptSymmetric( "RijndaelManaged", val );
Line 32: }

The value:
123456789

Can someone please help? I've been Googling, but not coming up with anything.

Thank you for your time!
Oct 20, 2007 at 3:17 PM
i have the same error: Invalid length for a Base-64 char array, on Decrypt, i use Cryptography entreprise library
Did you get the response ? all work fine on my computer but when deploy on server i get that error " Invalid length for a Base-64 char array "

thanks to response asap.
Oct 22, 2007 at 7:43 PM
Edited Oct 22, 2007 at 7:43 PM
Hi,

Did you copy the key to the server where you deployed your app? If you don't, this kind of errors will happen.

Look for the "Distributing Keys" section of the "Deploying the Cryptography Application Block" topic (ms-help://ms.EntLib.2007May/EnterpriseLibrary/html/03-180-Deploying_the_Cryptography_Application_Block.htm).

Hope this helps,
Fernando