<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Crypto Crap in Python</title>
	<atom:link href="http://www.jillesvangurp.com/2008/01/25/crypto-crap-in-python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jillesvangurp.com/2008/01/25/crypto-crap-in-python/</link>
	<description>Yet another blog</description>
	<pubDate>Thu, 20 Nov 2008 18:02:26 +0000</pubDate>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>By: Jilles</title>
		<link>http://www.jillesvangurp.com/2008/01/25/crypto-crap-in-python/#comment-19801</link>
		<dc:creator>Jilles</dc:creator>
		<pubDate>Sat, 26 Jan 2008 09:26:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jillesvangurp.com/2008/01/25/crypto-crap-in-python/#comment-19801</guid>
		<description>Well Suraj, there's more to life than base64. The problem is that a RSA public key contains several data items that you need to parse once you decode the base64. No rocket science of course but non of the third party python crypto libraries I've tried come with those batteries included (pretty mind boggling since you will need to do this). Each and every one of those will have you dive into the RSA spec and figure out all by yourself what the internals of base64 encoded RSA public keys look like.

And Greg, I'm aware of those modules. It would be pretty sad if there wasn't any dom and sax included indeed but there's a bit more to XML processing these days than working with those low level APIs. Personally I hate having to deal with DOM since it is such a clumsy API. If you're used to working with xml in other languages, python feels a little primitive.  Regarding the various hash functions, those are useful of course but not enough for what I needed.

Regarding http libraries, I'm not impressed with the included batteries. Take proxy handling for example. Simple problem: how to configure python such that it will use a http proxy but not for localhost. Neither urlib or urlib2 seem to get this right. It's all or nothing. Of course you can modify your dozens of calls to these module to include some logic to use or not use a proxy depending on the hostname. Just one little example.

Maybe I'm spoiled, or maybe the included batteries are not that great.</description>
		<content:encoded><![CDATA[<p>Well Suraj, there&#8217;s more to life than base64. The problem is that a RSA public key contains several data items that you need to parse once you decode the base64. No rocket science of course but non of the third party python crypto libraries I&#8217;ve tried come with those batteries included (pretty mind boggling since you will need to do this). Each and every one of those will have you dive into the RSA spec and figure out all by yourself what the internals of base64 encoded RSA public keys look like.</p>
<p>And Greg, I&#8217;m aware of those modules. It would be pretty sad if there wasn&#8217;t any dom and sax included indeed but there&#8217;s a bit more to XML processing these days than working with those low level APIs. Personally I hate having to deal with DOM since it is such a clumsy API. If you&#8217;re used to working with xml in other languages, python feels a little primitive.  Regarding the various hash functions, those are useful of course but not enough for what I needed.</p>
<p>Regarding http libraries, I&#8217;m not impressed with the included batteries. Take proxy handling for example. Simple problem: how to configure python such that it will use a http proxy but not for localhost. Neither urlib or urlib2 seem to get this right. It&#8217;s all or nothing. Of course you can modify your dozens of calls to these module to include some logic to use or not use a proxy depending on the hostname. Just one little example.</p>
<p>Maybe I&#8217;m spoiled, or maybe the included batteries are not that great.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Jorgensen</title>
		<link>http://www.jillesvangurp.com/2008/01/25/crypto-crap-in-python/#comment-19800</link>
		<dc:creator>Greg Jorgensen</dc:creator>
		<pubDate>Fri, 25 Jan 2008 21:00:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jillesvangurp.com/2008/01/25/crypto-crap-in-python/#comment-19800</guid>
		<description>Spend some time looking at the Python library documentation at:

http://docs.python.org/lib/lib.html

The book "Python Essential Reference" by David Beazley is also very useful.

Some of the "batteries included" modules you might be looking for:

xml.dom
xml.dom.minidom
xml.sax
md5
sha
hmac
base64

Python has so much HTTP stuff I won't list it all but with just the included libraries you get enough HTTP client stuff to rewrite cURL and enough server stuff to write a simple HTTP server in a few lines of code. You also get full socket libraries in case you want to do something more low-level.

Read the docs before going off like this!</description>
		<content:encoded><![CDATA[<p>Spend some time looking at the Python library documentation at:</p>
<p><a href="http://docs.python.org/lib/lib.html" onclick="javascript:pageTracker._trackPageview('/http://docs.python.org/lib/lib.html');" rel="nofollow">http://docs.python.org/lib/lib.html</a></p>
<p>The book &#8220;Python Essential Reference&#8221; by David Beazley is also very useful.</p>
<p>Some of the &#8220;batteries included&#8221; modules you might be looking for:</p>
<p>xml.dom<br />
xml.dom.minidom<br />
xml.sax<br />
md5<br />
sha<br />
hmac<br />
base64</p>
<p>Python has so much HTTP stuff I won&#8217;t list it all but with just the included libraries you get enough HTTP client stuff to rewrite cURL and enough server stuff to write a simple HTTP server in a few lines of code. You also get full socket libraries in case you want to do something more low-level.</p>
<p>Read the docs before going off like this!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Suraj Barkale</title>
		<link>http://www.jillesvangurp.com/2008/01/25/crypto-crap-in-python/#comment-19799</link>
		<dc:creator>Suraj Barkale</dc:creator>
		<pubDate>Fri, 25 Jan 2008 19:36:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jillesvangurp.com/2008/01/25/crypto-crap-in-python/#comment-19799</guid>
		<description># WTF are you smoking pal?
# This is from the standard library
&#62;&#62;&#62; import base64
&#62;&#62;&#62; encoded = base64.b64encode('data to be encoded')
&#62;&#62;&#62; encoded
'ZGF0YSB0byBiZSBlbmNvZGVk'
&#62;&#62;&#62; data = base64.b64decode(encoded)
&#62;&#62;&#62; data
'data to be encoded'</description>
		<content:encoded><![CDATA[<p># WTF are you smoking pal?<br />
# This is from the standard library<br />
&gt;&gt;&gt; import base64<br />
&gt;&gt;&gt; encoded = base64.b64encode(&#8217;data to be encoded&#8217;)<br />
&gt;&gt;&gt; encoded<br />
&#8216;ZGF0YSB0byBiZSBlbmNvZGVk&#8217;<br />
&gt;&gt;&gt; data = base64.b64decode(encoded)<br />
&gt;&gt;&gt; data<br />
&#8216;data to be encoded&#8217;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
