Solved

Invalid character in a Base-64 string?

Posted on 2009-05-10
3
510 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

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!
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

635 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