If you get this error when you are trying to decode a base64 encoded string do the following to fix the length problem:
int m = str64.Length % 4;
if ( m > 0 )
str64 += new string( '=', 4 - m );
Enter your email address to subscribe to this blog and receive notifications of new posts by email.