<?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"
	>

<channel>
	<title>DanJ - My Bits</title>
	<atom:link href="http://djulius.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://djulius.com/blog</link>
	<description>It's about making computers do what you want, and not what you say.</description>
	<pubDate>Mon, 28 Sep 2009 21:30:59 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>InnerText or InnerXML - Somewhat confusing</title>
		<link>http://djulius.com/blog/?p=37</link>
		<comments>http://djulius.com/blog/?p=37#comments</comments>
		<pubDate>Mon, 28 Sep 2009 21:30:59 +0000</pubDate>
		<dc:creator>danj</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[.Net]]></category>

		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://djulius.com/blog/?p=37</guid>
		<description><![CDATA[It has been a long time since my last. I hope to do better.
Lately I&#8217;ve been working on a feature for our system which requires our server to keep some of  data encrypted. When accessed by a client, the server returns an XML formatted result where some of the nodes are encrypted. Below is an example:

&#60;books&#62;
&#60;book&#62;
&#38;lt;EncryptedNode [...]]]></description>
			<content:encoded><![CDATA[<p>It has been a long time since my last. I hope to do better.</p>
<p>Lately I&#8217;ve been working on a feature for our system which requires our server to keep some of  data encrypted. When accessed by a client, the server returns an XML formatted result where some of the nodes are encrypted. Below is an example:<br />
<code><br />
&lt;books&gt;<br />
&lt;book&gt;<br />
&amp;lt;EncryptedNode IV="abcdefg"&gt;AES-256-CBC|8c9cba4110124ceabe672d9ce345a3b8|6NxJchrB/fmN8ab0m4EPnJ3XS2ek0z4dqVmKtZf6LGA=&amp;lt;/EncryptedNode&gt;<br />
&lt;/book&gt;<br />
&lt;/books&gt;<br />
</code><br />
On the client side, I wrote a method which retrieves the XML from the server and replaces the encrypted nodes with their decrypted values. The example above results in the following decrypted XML:<br />
<code><br />
&lt;books&gt;<br />
&lt;book&gt;<br />
&lt;title&gt;title1&lt;/title&gt;<br />
&lt;/book&gt;<br />
&lt;/books&gt;<br />
</code><br />
So far so good. My confusion was with the implementation details. To replace the encrypted node I overwrote the InnerText property of the parent node as shown below (I know this isn&#8217;t an optimized method for DOM manipulation, but it seems to be the simplest one).<br />
<code><br />
String encryptedText = node.InnerText; // encryptedText = "AES-256-CBC|..."<br />
String decryptedText = DecryptText(myKey, encryptedText); // decrypedText = "&amp;lt;title&gt;title1&amp;lt;/title&gt;"<br />
node.ParentNode.InnerText = decryptedText;<br />
</code><br />
Although this looked right at first, it did not result in what I expected. Instead of adding a child node named &#8216;title&#8217; to the node named &#8216;book&#8217;, what I really did was change the inner text of the &#8216;book&#8217; node  to &#8220;&amp;lt;title&amp;gt;title1&amp;lt;/title&amp;gt;&#8221;. Replacing <code>node.ParentNode.InnerText </code>with<code> node.ParentNode.InnerXml</code> solved my problem.</p>
<p>The MSDN documentation is a bit confusing regarding the differences between these two properties (in my example value is null).</p>
<pre>XmlNode.InnerText: Gets or sets the concatenated values of the node and all its child nodes.
XmlNode.InnerXml: Gets or sets the markup representing only the child nodes of this node</pre>
<p>Running some tests I came to the conclusion that InnerText escapes all characters, while InnerXml does not. Goes without saying that you need to make sure to use the right one. Also, note that if using InnerXml the string must be valid XML as the characters will not be formatted.</p>
<p>I hope this helps someone.</p>
]]></content:encoded>
			<wfw:commentRss>http://djulius.com/blog/?feed=rss2&amp;p=37</wfw:commentRss>
		</item>
		<item>
		<title>WEP Hacking with the IPW2200</title>
		<link>http://djulius.com/blog/?p=33</link>
		<comments>http://djulius.com/blog/?p=33#comments</comments>
		<pubDate>Mon, 30 Mar 2009 22:27:04 +0000</pubDate>
		<dc:creator>danj</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[wep]]></category>

		<guid isPermaLink="false">http://djulius.com/blog/?p=33</guid>
		<description><![CDATA[This is for all those out there trying to figure out why rtap0 is stuck on channel 0 while the AP channel is using some other channel.
The secret is to set the channel when bringing up the interface: modprobe ipw2200 rtap_iface=1 channel=x
It worked for me
]]></description>
			<content:encoded><![CDATA[<p>This is for all those out there trying to figure out why rtap0 is stuck on channel 0 while the AP channel is using some other channel.</p>
<p>The secret is to set the channel when bringing up the interface: modprobe ipw2200 rtap_iface=1 channel=x</p>
<p>It worked for me</p>
]]></content:encoded>
			<wfw:commentRss>http://djulius.com/blog/?feed=rss2&amp;p=33</wfw:commentRss>
		</item>
		<item>
		<title>DHCP and DNS from JEOS on KVM</title>
		<link>http://djulius.com/blog/?p=27</link>
		<comments>http://djulius.com/blog/?p=27#comments</comments>
		<pubDate>Sat, 21 Mar 2009 20:55:37 +0000</pubDate>
		<dc:creator>danj</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://djulius.com/blog/?p=27</guid>
		<description><![CDATA[Finally, I think I got it working.
All you need to do is follow these instructions (carefully)
http://lani78.wordpress.com/2008/08/09/setting-up-a-dns-for-the-local-network/
http://lani78.wordpress.com/2008/08/10/setting-up-a-dhcp-server-on-ubuntu-hardy-heron/
http://lani78.wordpress.com/2008/08/12/dhcp-server-update-dns-records/
I had some linux clients that weren&#8217;t updating the DNS records. Turns out they were not sending their hostname. A fix is found here: http://ubuntuforums.org/archive/index.php/t-549612.html
Still one of my servers kept &#8220;loosing&#8221; it&#8217;s dns record. Turns out the nagios check-dhcp was [...]]]></description>
			<content:encoded><![CDATA[<p>Finally, I think I got it working.</p>
<p>All you need to do is follow these instructions (carefully)</p>
<p>http://lani78.wordpress.com/2008/08/09/setting-up-a-dns-for-the-local-network/</p>
<p>http://lani78.wordpress.com/2008/08/10/setting-up-a-dhcp-server-on-ubuntu-hardy-heron/</p>
<p>http://lani78.wordpress.com/2008/08/12/dhcp-server-update-dns-records/</p>
<p>I had some linux clients that weren&#8217;t updating the DNS records. Turns out they were not sending their hostname. A fix is found here: http://ubuntuforums.org/archive/index.php/t-549612.html</p>
<p>Still one of my servers kept &#8220;loosing&#8221; it&#8217;s dns record. Turns out the nagios check-dhcp was causing the problem, so I just disabled this test.</p>
]]></content:encoded>
			<wfw:commentRss>http://djulius.com/blog/?feed=rss2&amp;p=27</wfw:commentRss>
		</item>
		<item>
		<title>SVN issues with sshfs</title>
		<link>http://djulius.com/blog/?p=25</link>
		<comments>http://djulius.com/blog/?p=25#comments</comments>
		<pubDate>Thu, 23 Oct 2008 06:51:06 +0000</pubDate>
		<dc:creator>danj</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[svn sshfs]]></category>

		<guid isPermaLink="false">http://djulius.com/blog/?p=25</guid>
		<description><![CDATA[Not sure how to resolve this

On Linux I have a mounted folder (sshfs src tgt). SVN has lots of trouble with this and I found that using a rename workaround resolves this issue.

sshfs -o workaround=rename 192.168.3.10:/var/dev_linux /home/buildmaster/dev/

Still I&#8217;m unable to run make install from these folders. Running as the local user I don&#8217;t have write [...]]]></description>
			<content:encoded><![CDATA[<p>Not sure how to resolve this</p>
<ul>
<li>On Linux I have a mounted folder (sshfs src tgt). SVN has lots of trouble with this and I found that using a rename workaround resolves this issue.</li>
</ul>
<p>sshfs -o workaround=rename 192.168.3.10:/var/dev_linux /home/buildmaster/dev/</p>
<ul>
<li>Still I&#8217;m unable to run make install from these folders. Running as the local user I don&#8217;t have write permissions to /usr/local/lib. Running as root (sudo) I don&#8217;t have to the files on the mounted folder&#8230;</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://djulius.com/blog/?feed=rss2&amp;p=25</wfw:commentRss>
		</item>
		<item>
		<title>.Net security</title>
		<link>http://djulius.com/blog/?p=21</link>
		<comments>http://djulius.com/blog/?p=21#comments</comments>
		<pubDate>Thu, 23 Oct 2008 06:48:34 +0000</pubDate>
		<dc:creator>danj</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://djulius.com/blog/?p=21</guid>
		<description><![CDATA[Finally managed to resolve some nagging issues:
.Net application wont run from my network mapped drive Z:\ - The problem has to do with the location not being trusted. I found a post here that explains how to use CasPol.exe in order to define the network drive as a trusted location.
The next issue was to find [...]]]></description>
			<content:encoded><![CDATA[<p>Finally managed to resolve some nagging issues:</p>
<p>.Net application wont run from my network mapped drive Z:\ - The problem has to do with the location not being trusted. I found a post <a title="here" href="http://www.sellsbrothers.com/news/showTopic.aspx?ixTopic=1519">here</a> that explains how to use CasPol.exe in order to define the network drive as a trusted location.</p>
<p>The next issue was to find CasPol.exe. I&#8217;m using .Net version 3.5, which is an extension to Version 2.0. Thus CasPol.exe is located in the version 2.0 directory.</p>
<p>The command line I used is as follows:</p>
<pre>caspol -q -machine -addgroup 1 -url file://z:/* FullTrust -name "Z Drive"</pre>
]]></content:encoded>
			<wfw:commentRss>http://djulius.com/blog/?feed=rss2&amp;p=21</wfw:commentRss>
		</item>
		<item>
		<title>KDE with WPA - Why doesn&#8217;t it just work?</title>
		<link>http://djulius.com/blog/?p=18</link>
		<comments>http://djulius.com/blog/?p=18#comments</comments>
		<pubDate>Mon, 13 Oct 2008 18:51:04 +0000</pubDate>
		<dc:creator>danj</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[WPA WEP Wifi]]></category>

		<guid isPermaLink="false">http://djulius.com/blog/?p=18</guid>
		<description><![CDATA[It&#8217;s been at least 12 months since I stopped using WEP on my home network and switched to WPA. I knew for a while that WEP was hackable, but I had no idea how easy it was using aircrack.
A while ago I changed KNetworkManager on my laptop from automatic to manual configuration. Don&#8217;t ask why. [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been at least 12 months since I stopped using WEP on my home network and switched to WPA. I knew for a while that WEP was hackable, but I had no idea how easy it was using <a title="aircrack-ng" href="http://www.aircrack-ng.org/doku.php" target="_blank">aircrack</a>.</p>
<p>A while ago I changed KNetworkManager on my laptop from automatic to manual configuration. Don&#8217;t ask why. Since then I&#8217;ve been having trouble connecting to my network when running Linux. Windows worked flawlessly. Occasionally I&#8217;d even have to leech a neighbors network (please accept my apologies) just to read some email.</p>
<p>Today I decided to tackle this by going back to &#8220;Automatic&#8221; configuration and letting KNetworkManager handle the rest. After all, the Ubuntu pages do specifically say that KNetworkManager can handle WPA automatically (<a title="WPA-HowTo" href="https://help.ubuntu.com/community/WifiDocs/WPAHowTo">https://help.ubuntu.com/community/WifiDocs/WPAHowTo</a>). Apparently  going back to the auto-pilot is not so simple. After trying every menu item and searching every dialog I finally went to Google to find this post: <a title="How to switch back to automatic mode?" href="https://answers.launchpad.net/ubuntu/+source/knetworkmanager/+question/8140">How to switch back to automatic mode?</a></p>
<p>Turns out that you can&#8217;t. Even removing the app and reinstalling doesn&#8217;t help. There are some workarounds provided and one of them even worked. Nevertheless, I don&#8217;t understand how such a feature could be missing!?</p>
]]></content:encoded>
			<wfw:commentRss>http://djulius.com/blog/?feed=rss2&amp;p=18</wfw:commentRss>
		</item>
		<item>
		<title>Python, EC2, S3 - How very nice</title>
		<link>http://djulius.com/blog/?p=14</link>
		<comments>http://djulius.com/blog/?p=14#comments</comments>
		<pubDate>Sun, 12 Oct 2008 22:40:03 +0000</pubDate>
		<dc:creator>danj</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[EC2]]></category>

		<category><![CDATA[Python]]></category>

		<category><![CDATA[S3]]></category>

		<guid isPermaLink="false">http://djulius.com/blog/?p=14</guid>
		<description><![CDATA[Last week I started learning Python. After playing around with Perl, and PHP I must say that I really like Python.
I have decided to rewrite my backup scripts that use Amazon&#8217;s S3 and EC2 services using Python. The previous version was written as a BASH script, with PHP scripts to handle S3 traffic, and Java [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I started learning Python. After playing around with Perl, and PHP I must say that I really like Python.</p>
<p>I have decided to rewrite my backup scripts that use Amazon&#8217;s <a title="S3" href="http://aws.amazon.com/s3/" target="_blank">S3</a> and <a title="EC2" href="http://aws.amazon.com/ec2/">EC2</a> services using Python. The previous version was written as a BASH script, with PHP scripts to handle S3 traffic, and Java apps to handle the EC2 instances &#8212; As you can imagine, it was a mess.</p>
<p>In Python I&#8217;m using the <a title="boto" href="http://code.google.com/p/boto/" target="_blank">boto</a> library to interface with the Amazon services. For compression I&#8217;m using <a title="7z" href="http://www.7-zip.org/">7z</a> and to do the actual file transfer I&#8217;m using rsync.</p>
<p>Stay tuned for more details next post.</p>
<p>Dan</p>
]]></content:encoded>
			<wfw:commentRss>http://djulius.com/blog/?feed=rss2&amp;p=14</wfw:commentRss>
		</item>
		<item>
		<title>2m and 40s - That&#8217;s all it took to hack my password</title>
		<link>http://djulius.com/blog/?p=12</link>
		<comments>http://djulius.com/blog/?p=12#comments</comments>
		<pubDate>Sun, 31 Aug 2008 23:08:06 +0000</pubDate>
		<dc:creator>danj</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[cracking]]></category>

		<guid isPermaLink="false">http://djulius.com/blog/?p=12</guid>
		<description><![CDATA[Everybody knows WEP is not secure. Everybody knows that dictionary passwords are a piece of cake. But Windows XP!? I was surprised. I figured it wouldn&#8217;t be too hard, but 3m, that&#8217;s all!?
My password is not a dictionary word (it&#8217;s not any kind of word at all), it has CAPITAL letters, small letters, and digits. [...]]]></description>
			<content:encoded><![CDATA[<p>Everybody knows WEP is not secure. Everybody knows that dictionary passwords are a piece of cake. But Windows XP!? I was surprised. I figured it wouldn&#8217;t be too hard, but 3m, that&#8217;s all!?<br />
My password is not a dictionary word (it&#8217;s not any kind of word at all), it has CAPITAL letters, small letters, and digits. It&#8217;s 11 characters long. I didn&#8217;t think it would be so easy to hack.</p>
<p>Yesterday a friend of mine was telling me about <a href="http://en.wikipedia.org/wiki/Rainbow_table">Rainbow attacks</a>. After reading a bit about the theory I figured it was worth a try. Following the links from Wikipedia I downloaded <a href="http://downloads.sourceforge.net/ophcrack/ophcrack-xp-livecd-2.0.1.iso">Ophcrack Live CD</a> for cracking windows XP passwords. The download took a while because the tables are pretty big, but once I had the .iso the rest was pretty fast.</p>
<p>I booted from the CD, and after less than 3m I saw my password next to my Windows XP username, I didn&#8217;t even have to touch the any key.</p>
<p>I&#8217;m not yet sure what I&#8217;ll do next.</p>
<p>Dan</p>
]]></content:encoded>
			<wfw:commentRss>http://djulius.com/blog/?feed=rss2&amp;p=12</wfw:commentRss>
		</item>
		<item>
		<title>Today was a good day</title>
		<link>http://djulius.com/blog/?p=1</link>
		<comments>http://djulius.com/blog/?p=1#comments</comments>
		<pubDate>Thu, 28 Aug 2008 20:56:00 +0000</pubDate>
		<dc:creator>danj</dc:creator>
		
		<category><![CDATA[ffmpeg]]></category>

		<guid isPermaLink="false">http://djulius.com/blog//?p=1</guid>
		<description><![CDATA[Hello World!
I&#8217;m Dan. This is my blog. It&#8217;s about programming, software, computers, and whatever.
Today I&#8217;ve managed to build a current version of ffmpeg on Windows. To celebrate, I&#8217;ve decided to start this blog, and share my achievement. If anyone would like a copy, or is interested in the details, let me know.
Danj
]]></description>
			<content:encoded><![CDATA[<p>Hello World!</p>
<p>I&#8217;m Dan. This is my blog. It&#8217;s about programming, software, computers, and whatever.</p>
<p>Today I&#8217;ve managed to build a current version of <a href="http://http://ffmpeg.mplayerhq.hu/">ffmpeg</a> on Windows. To celebrate, I&#8217;ve decided to start this blog, and share my achievement. If anyone would like a copy, or is interested in the details, let me know.</p>
<p>Danj</p>
]]></content:encoded>
			<wfw:commentRss>http://djulius.com/blog/?feed=rss2&amp;p=1</wfw:commentRss>
		</item>
	</channel>
</rss>
