Author: Ammi | Posted on: 8/22/2008 8:27:10 AM | Views : 776

Hi,

I am encrypting and decrypting query string. If i pass a long query string it gives error  'Invalid length for a Base-64 char array.'  while decrypting . The encryption works fine. If i pass a short string the decryption works fine. Is there any solution fot this?

  my code for decrypting is:

 public string Decrypt(string stringToDecrypt)
        {

            byte[] toDecrypt = System.Convert.FromBase64String(stringToDecrypt);
            byte[] encryptionKey = System.Text.ASCIIEncoding.ASCII.GetBytes(key);
            byte[] iVector = System.Text.ASCIIEncoding.ASCII.GetBytes(initVector);

            MemoryStream memoryS ...

Go to the complete details ...