Solved

Invalid character in a Base-64 string?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
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 is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 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

16 Experts available now in Live!

Get 1:1 Help Now