Server Error in '/' Application.

The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.

Source Error:


Line 46:         public string Decrypt(string text)
Line 47:         {
Line 48:             byte[] input = Convert.FromBase64String(text.Replace(" ", "+"));
Line 49: 
Line 50:             byte[] output = Transform(input, m_des.CreateDecryptor(m_key, m_iv));

Source File: c:\new.nasir.ir\App_Code\Security\cTripleDES.cs    Line: 48

Stack Trace:


[FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. ]
   System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength) +12917483
   System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength) +130
   System.Convert.FromBase64String(String s) +42
   BASA.Security.cTripleDES.Decrypt(String text) in c:\new.nasir.ir\App_Code\Security\cTripleDES.cs:48
   BASA.Security.Authenticating.DecryptDES(String plainText) in c:\new.nasir.ir\App_Code\Security\Authenticating.cs:123
   StoreView.Page_Load(Object sender, EventArgs e) in c:\new.nasir.ir\StoreView.aspx.cs:67
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
   System.Web.UI.Control.OnLoad(EventArgs e) +95
   System.Web.UI.Control.LoadRecursive() +59
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +678


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.4081.0