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
Solved

Invalid character in a Base-64 string?

Posted on 2009-05-10
3
498 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 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