<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>students@work &#187; base64</title>
	<atom:link href="http://www.stupent.at/tag/base64/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stupent.at</link>
	<description>Antworten auf die die Menschheit gewartet hat!  -- Heisenberg war hier ... oder auch nicht!</description>
	<lastBuildDate>Tue, 17 Aug 2010 13:51:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Base64 En-/Decoding using OpenSSL in C</title>
		<link>http://www.stupent.at/2009/07/03/base64-en-decoding-using-openssl-in-c/</link>
		<comments>http://www.stupent.at/2009/07/03/base64-en-decoding-using-openssl-in-c/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 21:39:14 +0000</pubDate>
		<dc:creator>Cici</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[UNI]]></category>
		<category><![CDATA[base64]]></category>
		<category><![CDATA[bio]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[openssl]]></category>

		<guid isPermaLink="false">http://www.stupent.at/?p=195</guid>
		<description><![CDATA[Recently i had to implement Base64 en &#38; decoding using openssl&#8217;s bio library, which by the way is just great, but a little &#8220;under-documented!&#8221;
If you ever wondered, why the standard example of decoding base64 data always returns 0 when using it with your test data? Well there is some nice undocumented feature: Strings that do [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.stupent.at%2F2009%2F07%2F03%2Fbase64-en-decoding-using-openssl-in-c%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.stupent.at%2F2009%2F07%2F03%2Fbase64-en-decoding-using-openssl-in-c%2F" height="61" width="51" /></a></div><p>Recently i had to implement Base64 en &amp; decoding using openssl&#8217;s bio library, which by the way is just great, but a little &#8220;under-documented!&#8221;</p>
<p>If you ever wondered, why the standard example of decoding base64 data always returns 0 when using it with your test data? Well there is some nice undocumented feature: Strings that do not end with a newline &#8216;\n&#8217; are not processed! So you have two possibilities: adding a newline to the string or use the following flag:</p>
<p>BIO_set_flags(BIO* to your bio_f_base64, BIO_FLAGS_BASE64_NO_NL);</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-3396611173469301";
google_ad_width = 234;
google_ad_height = 60;
google_ad_format = "234x60_as";
google_ad_type = "text_image";
//2007-04-05: Swabidu
google_ad_channel = "2349987622";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Edit: 21/Dec/08:</p>
<p>After handin of the courses homework i can now give some details about how to do it:</p>
<p>Using a chain of BIO filters is the most flexible way to handle proper base64 en-/decoding:</p>
<p><code><br />
//write base64 coded data to stdout<br />
BIO* b64 = BIO_new(BIO_f_base64());<br />
BIO* bio_out = BIO_new_fp(stdout, BIO_NOCLOSE);<br />
bio_out = BIO_push(b64, bio_out); //attach output bio to base64 bio<br />
BIO_write(bio_out,"data",sizeof("data"));<br />
BIO_flush(bio_out); //flush the buffer<br />
BIO_free_all(bio_out); //cleanup!<br />
</code></p>
<p>For more information see the super perfect documentation: http://www.openssl.org/docs/crypto/BIO_f_base64.html</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stupent.at/2009/07/03/base64-en-decoding-using-openssl-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
