Solved

Invalid character in a Base-64 string?

Posted on 2009-05-10
3
483 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now