Server Error in '/sec9' Application.

Invalid length for a Base-64 char array.

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: Invalid length for a Base-64 char array.

Source Error:


Line 71:     Public Shared Function Decrypt(ByVal encrString As String) As String
Line 72:         If encrString IsNot Nothing Then
Line 73:             Dim b As Byte() = Convert.FromBase64String(encrString)
Line 74:             Dim decryptedConnectionString As String = System.Text.ASCIIEncoding.ASCII.GetString(b)
Line 75:             Return decryptedConnectionString

Source File: D:\Websites\ShardaInternationalGurgaon\Sec9\App_Code\GalleryEncrypt.vb    Line: 73

Stack Trace:


[FormatException: Invalid length for a Base-64 char array.]
   System.Convert.FromBase64String(String s) +0
   GalleryEncrypt.Decrypt(String encrString) in D:\Websites\ShardaInternationalGurgaon\Sec9\App_Code\GalleryEncrypt.vb:73
   VideoGallery_watchvideos.Page_Load(Object sender, EventArgs e) in D:\Websites\ShardaInternationalGurgaon\Sec9\VideoGallery\watchvideos.aspx.vb:54
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.9061; ASP.NET Version:2.0.50727.9062