Solved

Invalid character in a Base-64 string?

Posted on 2009-05-10
3
502 Views
Last Modified: 2012-05-06
I'm trying to discover the incorrect character(s) that keeps throwin errors.

Q. Is a base-64 string supposed to contain what appears to be line breaks?

I'm posting the Visual Studio 2005 debugger 'cipherText' Value below.

"RyhSOEoiEp7biH8zcgzRCn+59loLxO91SwHHSf5z4bHUSNZxOfU3esZ4sSB8LHH++PPqdNIyk/Pa/kl+rCSNQu/z4qrn/SOIiy/
2INodWmEH8Nnv1r+09SWXDnUdkicTxDzMpOYbQG0K9uQTOAEkVP2sB7YYkQKPWugxGn7VTG7yfgabbjMazx+33GNzSFEPeWoYGNkx6glMWqVBCQMFzgaKPPqZrFWMp7sdt7dFlIKzLjheNFkQw6BTQDw4NkoPHP+6sDTXJ8kxy/zEltpwxg3jTfhMss/
QLFM2WxEKeRzCWyvZYCfQHrWjAcbo0TZZdQCvN26M7FgblynMHNshiCDtFqp+uj/8otUbmXdkb6/
JaLr+gzhdxbr9kz2mljUY93Z5KC0VgwRNYNxviZdEOVBiyK6X8x2SzUsfONORI+3sKVstTIDzosxBW0k3zEFaDUv0wdwHBAPxJ7uEQF442Q==RyhSOEoiEp7biH8zcgzRCn+59loLxO91SwHHSf5z4bHUSNZxOfU3esZ4sSB8LHH++PPqdNIyk/Pa/kl+rCSNQu/z4qrn/SOIiy/
2INodWmEH8Nnv1r+09SWXDnUdkicTxDzMpOYbQG0K9uQTOAEkVP2sB7YYkQKPWugxGn7VTG7yfgabbjMazx+33GNzSFEPeWoYGNkx6glMWqVBCQMFzgaKPPqZrFWMp7sdt7dFlIKzLjheNFkQw6BTQDw4NkoPHP+6sDTXJ8kxy/zEltpwxg3jTfhMss/QLFM2WxEKeRzCWyvZYCfQHrWjAcbo0TZZdQCvN26M7FgblynMHNshiCDtFqp+uj/8otUbmXdkb6/
JaLr+gzhdxbr9kz2mljUY93Z5KC0VgwRNYNxviZdEOVBiyK6X8x2SzUsfONORI+3sKVstTIDzosxBW0k3zEFaDUv0wdwHBAPxJ7uEQF442Q==RyhSOEoiEp7biH8zcgzRCn+59loLxO91SwHHSf5z4bHUSNZxOfU3esZ4sSB8LHH++PPqdNIyk/Pa/kl+"
0
Comment
Question by:pointeman
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
jhshukla earned 250 total points
ID: 24349904
Have a look at: http://en.wikipedia.org/wiki/Base64#Privacy-Enhanced_Mail_.28PEM.29

'=' is supposed to be used for padding at the end. If you read the above link, you find that base64(str1 + str2) != base64(str1) + base64(str2). once you hit an = sign, you have to take care of unpadding and then restart decoding.
0
 

Author Comment

by:pointeman
ID: 24353641
I'm using a C# Sockets server/client setup. The errors seem to have reduce by increasing the send/recieve buffers from 1024 -> 2048. It's possible the messages are too long and cut-off?  Still testing....
0
 

Author Comment

by:pointeman
ID: 24386415
Yep, increasing the size of the the buffer from 1024 - 2048 solved the problem. Thanks for pointing out the == missing breaks...
Thank You...
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question