<?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>BrainBlog</title>
	<atom:link href="http://blogs.nopcode.org/brainstorm/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.nopcode.org/brainstorm</link>
	<description>braindumping myself</description>
	<lastBuildDate>Sun, 22 Aug 2010 19:19:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Android L2TP/IPSec VPN mini-howto</title>
		<link>http://blogs.nopcode.org/brainstorm/2010/08/22/android-l2tpipsec-vpn-mini-howto/</link>
		<comments>http://blogs.nopcode.org/brainstorm/2010/08/22/android-l2tpipsec-vpn-mini-howto/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 19:11:09 +0000</pubDate>
		<dc:creator>brainstorm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[gadgets]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ipsec]]></category>
		<category><![CDATA[l2tp]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://blogs.nopcode.org/brainstorm/?p=358</guid>
		<description><![CDATA[I would have preferred that my Android 1.6 device supported OpenVPN out of the box. Unfortunately, this is only available for rooted devices and a bit of suffering. Instead, I went for configuring IPsec inside L2TP VPN server. All of it stuffed into an old and low-end Soekris net4511 board running Voyage Linux. First, I [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.techbabu.com/wp-content/uploads/2009/10/ipsec.png'/></p>
<p>I would have preferred that my Android 1.6 device supported <a href="http://openvpn.net/">OpenVPN</a> out of the box. Unfortunately, this is only available for <a href="http://www.androidzoom.com/android_applications/communication/openvpn-installer_epia.html">rooted</a> devices and a bit of suffering. Instead, I went for configuring <a href="http://en.wikipedia.org/wiki/Ipsec">IPsec</a> inside <a href="http://en.wikipedia.org/wiki/L2tp">L2TP</a> VPN server. All of it stuffed into an old and low-end <a href="http://www.soekris.com/net4511.htm">Soekris net4511</a> board running <a href="http://linux.voyage.hk/">Voyage Linux</a>.</p>
<p>First, I will just redirect you to the well-documented, lengthy but primary resource:</p>
<p><a href="http://www.jacco2.dds.nl/networking/openswan-l2tp.html">Using a Linux L2TP/IPsec VPN server</a></p>
<p>On the client side, this post is quite complete:</p>
<p><a href="http://blog.brightpointuk.co.uk/adding-vpn-connections-android-16-donut">Adding VPN connections to Android 1.6 (Donut)</a></p>
<p>If you&#8217;re feeling impatient and brave, perhaps you&#8217;ll succeed with the configuration files that follow (they worked for me)&#8230; since those are highly dependant on your network setup, YMMV, a lot.</p>
<p>Before jumping right into the meat and to avoid confusion, let&#8217;s see what is the game all these evil daemons are going to play:</p>
<ol>
<li>A client (my android phone), connects to the server on port 4500.</li>
<li>IPsec server (OpenSWAN) responds and asks for the PSK.</li>
<li>If the previous &#8220;gatekeeper&#8221; is ok with you, control is handed over L2TP, the other &#8220;tunnel keeper&#8221; who will ask for another password.</li>
<li>If L2TP is satisfied with your answer, PPPD, the ancient UNIX beast will be waken up and ask for&#8230; your user and password !</li>
<li>Congrats ! You&#8217;re survived the gates, now you&#8217;re on your home network from your smartphone, ain&#8217;t it cool ?</li>
</ol>
<p><span id="more-358"></span></p>
<h1>Prerequisites</h1>
<p>I&#8217;m using <a href="http://www.openswan.org/">Openswan</a> for IPsec here since the debian packaging system states its preferences clearly:</p>
<pre>
freeswan - IPSEC utilities **transition** package to Openswan
openswan - IPSEC utilities for Openswan
</pre>
<p>On the L2TP part, I went for xl2tpd but is <strong>IMPORTANT</strong> that you use version <strong>1.2.7</strong> at least. Version 1.2.0 present on Debian Lenny did not work for me !</p>
<h1>IPsec</h1>
<p>Here is the configuration for &#8220;/etc/ipsec.conf&#8221;, where I use a group shared <acronym title='Pre Shared Key'>PSK</acronym>:</p>
<p><code><br />
nat_traversal=yes<br />
nhelpers=0<br />
conn L2TP-PSK<br />
authby=secret<br />
# Do NOT enable PFS, my android 1.6 did not work with it<br />
pfs=no<br />
rekey=no<br />
keyingtries=3<br />
left=%defaultroute<br />
leftprotoport=17/%any<br />
right=%any<br />
rightprotoport=17/%any<br />
auto=add<br />
#Disable Opportunistic Encryption<br />
include /etc/ipsec.d/examples/no_oe.conf<br />
</code></p>
<p>The secret (PSK) for the IPSec tunnel lays in the &#8220;/etc/ipsec.secrets&#8221; file, in a simple format:</p>
<p><code><br />
192.168.24.100 %any: PSK "your_PSK_here"<br />
10.1.20.1 %any: PSK "your_PSK_here"<br />
</code></p>
<p>If you don&#8217;t put the gateway IP&#8217;s you expect to use, IPsec logs will complain this way on &#8220;/var/log/auth.log&#8221; or in &#8220;/var/log/secure&#8221;:</p>
<blockquote><p>
packet from 10.1.20.29:500: initial Main Mode message received on 10.1.20.1:500 but no connection has been authorized
</p></blockquote>
<h1>L2TP</h1>
<p>First, do make sure that the module &#8220;pppol2tp&#8221; is loaded and present on &#8220;/etc/modules&#8221;, for it to survive reboots.</p>
<p>Now, the L2TP configuration (xl2tp.conf):</p>
<p><code><br />
[lns default]<br />
ip range = 10.1.20.31-10.1.20.50<br />
; hidden bit = no<br />
local ip = 10.1.20.30<br />
require chap = yes<br />
refuse pap = yes<br />
require authentication = yes<br />
name = yourhost<br />
ppp debug = yes<br />
pppoptfile = /etc/ppp/options<br />
length bit = yes<br />
</code></p>
<p>Don&#8217;t forget to put the L2TP secrets (/etc/xl2tpd/l2tp-secrets):</p>
<p><code><br />
# host (us)     username    password<br />
voyage	    anonymous      another_password<br />
</code></p>
<p>I ran into another issue with &#8220;/var/run/xl2tpd/l2tp-control&#8221;, you&#8217;ll see in the logs clearly, but just make sure you &#8220;mkdir -p /var/run/xl2tpd&#8221;.</p>
<p>I find it quite funny that we&#8217;ve to pass through <strong>two</strong> &#8220;gatekeepers&#8221; who ask for passwords: IPsec PSK and now, L2TP password. We&#8217;ve another old beast to get through, and it&#8217;s name is: PPP !</p>
<h1>PPP</h1>
<p>I just used the daemon already installed on most distributions by default, the &#8220;ppp&#8221; package.</p>
<p>Nothing fancy to see here, just the &#8220;chap-secrets&#8221; file:</p>
<p><code><br />
# Secrets for authentication using CHAP<br />
# client	server	secret			IP addresses<br />
user1		*	"yet_another_pass"		10.1.20.32<br />
user2		*	"and_another!!!"	        	10.1.20.33<br />
</code></p>
<h1>Future improvements</h1>
<p>First of all, PSK may be convenient for testing purposes, but I would recommed moving to <acronym title='Public Key Infrastructure'>PKI</acronym> just after verifying that this setup works as expected.</p>
<p>The IP addresses where set manually for each client, but I&#8217;m sure you can scan through the original document and figure out a nicer DHCP/DNS interaction with your clients.</p>
<p>The default configuration/routing will redirect all your requests towards the tunnel, but perhaps you&#8217;re more interested on <a href="http://http://www.jacco2.dds.nl/networking/linux-l2tp.html#Split_tunnelling">splitting the tunnel</a>.</p>
<p>Good luck !</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.nopcode.org/brainstorm/2010/08/22/android-l2tpipsec-vpn-mini-howto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Swedish vs Spanish digital certificate hacks</title>
		<link>http://blogs.nopcode.org/brainstorm/2010/06/21/swedish-vs-spanish-digital-certificate-hacks/</link>
		<comments>http://blogs.nopcode.org/brainstorm/2010/06/21/swedish-vs-spanish-digital-certificate-hacks/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 22:12:38 +0000</pubDate>
		<dc:creator>brainstorm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://blogs.nopcode.org/brainstorm/?p=350</guid>
		<description><![CDATA[In one single day I had to deal with two nasty tricks to get the following e-administration to work properly: My swedish e-legitimation BankID software token. My spanish digital certificate renewal request. The first one failed to authenticate (silently!) because the (propietary) software, BankID, refused to work properly on 64-bit Ubuntu. Adding a wrapper solved [...]]]></description>
			<content:encoded><![CDATA[<p>In one single day I had to deal with two nasty tricks to get the following <a href="http://en.wikipedia.org/wiki/E-Administration">e-administration</a> to work properly:</p>
<ol>
<li>My swedish <a href="http://www.e-legitimation.se/">e-legitimation</a> <a href="http://www.bankid.com/">BankID</a> software token.</li>
<li>My spanish <a href="http://www.cert.fnmt.es/">digital certificate</a> renewal request.</li>
</ol>
<p>The first one failed to authenticate (silently!) because the (<a href="http://en.wikipedia.org/wiki/Proprietary_software">propietary</a>) software, BankID, refused to work properly on <a href="https://bugs.launchpad.net/ubuntu-website/+bug/585940">64-bit Ubuntu</a>. Adding a <a href="http://www.linuxwiki.se/index.php/BankID#64-bit"> wrapper</a> solved the issue:</p>
<p><code><br />
sudo apt-get install nspluginwrapper<br />
sudo nspluginwrapper -i /usr/local/lib/personal/libplugins.so<br />
</code></p>
<p>On the other hand, the spanish counterpart, complained like this:</p>
<pre>
"Su certificado no ha permitido generar una firma válida"
</pre>
<p>Pasting the error on google sufficed to find the <a href="http://www.aeat.es/wps/portal/DetalleContenido?url=Ayuda/Certificado+electr%C3%B3nico/Incidencias+m%C3%A1s+frecuentes+en+el+uso+de+certificado+electr%C3%B3nico/Al+firmar+con+el+certificado+en+Mozilla+Firefox+me+aparece+un+error%3A+%22Su+certificado+no+ha+permitido+generar+una+firma+v%C3%A1lida%22&#038;content=aef807c322186110VgnVCM1000004ef01e0aRCRD&#038;channel=254c2a7ebe686110VgnVCM1000004ef01e0a____&#038;ver=L&#038;site=56d8237c0bc1ff00VgnVCM100000d7005a80____&#038;idioma=es_ES&#038;menu=0&#038;img=3">solution</a> as well.</p>
<p>Now I wonder how our mums can cope with these big user annoyances :-S</p>
<p>Hopefully not everything is a lost cause here&#8230; openness and common sense in security seem to start making their way on Spain regarding <a href="http://www.dnielectronico.es/">DNIe</a>: <a href="http://www.kriptopolis.org/disponibles-fuentes-pkcs11">PKCS11 sources</a> have been recently released !.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.nopcode.org/brainstorm/2010/06/21/swedish-vs-spanish-digital-certificate-hacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MaildirCrypt</title>
		<link>http://blogs.nopcode.org/brainstorm/2010/04/28/maildircrypt/</link>
		<comments>http://blogs.nopcode.org/brainstorm/2010/04/28/maildircrypt/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 22:52:44 +0000</pubDate>
		<dc:creator>brainstorm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://blogs.nopcode.org/brainstorm/?p=333</guid>
		<description><![CDATA[Just had a conversation with one good friend, rambling on the possibility of having a server-side crypted Maildir INBOX. It seems that dovecot has a nice server-side mail compression plugin&#8230; how come there are no implementations of a session-based cyphering of mail storage based on this same principle ? The use case is quite simple [...]]]></description>
			<content:encoded><![CDATA[<p>Just had a conversation with one good <a href="http://kung-foo.dhs.org/killabyte/">friend</a>, rambling on the possibility of having a server-side crypted Maildir INBOX.</p>
<p>It seems that <a href="http://dovecot.org/">dovecot</a> has a nice server-side mail <a href="http://wiki.dovecot.org/Plugins/Zlib">compression plugin</a>&#8230; how come there are no implementations of a session-based cyphering of mail storage based on this same principle ?</p>
<p>The use case is quite simple to imagine:</p>
<p><del datetime="2010-04-28T19:50:58+00:00">
<ol>
<li><del datetime="2010-04-28T19:57:29+00:00">Mails keep coming to the <acronym title='Mail Delivery Agent'>MDA</acronym>, on plain text, as usual.</del></li>
<li><del datetime="2010-04-28T19:58:34+00:00">User logs into the IMAP server with her credentials.</del></li>
<li><del datetime="2010-04-28T19:58:34+00:00">A keypair stored on user&#8217;s maildir, for instance, is unlocked using the login password.</del></li>
<li><del datetime="2010-04-28T19:58:34+00:00">New mails are cyphered and all subsequent read/write operations are performed through this (de)cyphering mechanism.</del></li>
<li><del datetime="2010-04-28T19:58:34+00:00">User logs out and the key is forgotten, shrinking the window of opportunity on possible sneakers or forensic forces.</del></li>
</ol>
<p></del></p>
<p>EDIT: Of course, keeping just the public key on the server is way smarter in this case:</p>
<ol>
<li>The user&#8217;s GnuPG <strong>public</strong> key is stored on her maildir.</li>
<li>All incoming emails are cyphered as they arrive with the previous public key.</li>
<li>The user logs in and sees all her mailbox cyphered, ready to be decyphered with his private key residing on her mail client.</li>
<li>Forensic analysis/spying on emails gets just a little bit harder <img src='http://blogs.nopcode.org/brainstorm/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</li>
</ol>
<p>He argued that just a quick UNIX pipework (using <a href="http://cr.yp.to/qmail.html">qmail</a>) should be sufficient, but I rather preferred to keep the <acronym title='Mail Transport Agent'>MTA</acronym> out of the equation. The reason is that the MTA just &#8220;sinks&#8221; mail to the mailbox, while the MDA usually has both read and write access to emails, so to me it makes more sense to keep this &#8220;plugin&#8221; on the MDA side&#8230;</p>
<p>Is the idea clear at this point ? Is this already invented and passed under my radar ? Anyone has suggestions on top of that ?</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.nopcode.org/brainstorm/2010/04/28/maildircrypt/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Translate it now !</title>
		<link>http://blogs.nopcode.org/brainstorm/2010/03/28/translate-it-now/</link>
		<comments>http://blogs.nopcode.org/brainstorm/2010/03/28/translate-it-now/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 14:50:17 +0000</pubDate>
		<dc:creator>brainstorm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[software inet]]></category>

		<guid isPermaLink="false">http://blogs.nopcode.org/brainstorm/?p=324</guid>
		<description><![CDATA[Since I do think that spoken languages are just pipes and I use them interchangeably, I&#8217;ve recently added a translate tool on the right column to ease readers access contents on my blog. But sometimes you find yourself reading on some foreign bit of info, like a swedish newspaper&#8230; sure, one can easily perform a [...]]]></description>
			<content:encoded><![CDATA[<p>Since I do think that spoken <a href="http://www.advogato.org/person/fxn/diary/501.html">languages are just pipes</a> and I use them interchangeably, I&#8217;ve recently added a translate tool on the right column to ease readers access contents on my blog.</p>
<p>But sometimes you find yourself reading on some foreign bit of info, like a <a href="http://www.dn.se/">swedish</a> <a href="http://www.svd.se/">newspaper</a>&#8230; sure, one can easily perform a full translation by just going to google translate, but supposing you&#8217;re learning how to use a new <acronym title='spoken languange'>pipe</acronym>, how can you translate that word and integrate it into your vocabulary without losing the focus on the piece of text you were reading on the first place ?</p>
<p>Firefox with <a href="https://addons.mozilla.org/sv-SE/firefox/addon/748">greasemonkey</a> together with <a href="http://userscripts.org/scripts/show/36898">Google Translator Tooltip</a>, saves the day for me, I hope it&#8217;s useful to you as well <img src='http://blogs.nopcode.org/brainstorm/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><strong>Hint:</strong> configure it as &#8220;detect language&#8221; and you have an anti-babel device in just one double click.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.nopcode.org/brainstorm/2010/03/28/translate-it-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BioEngineering: iGEM and BioBricks</title>
		<link>http://blogs.nopcode.org/brainstorm/2010/03/19/bioengineering-igem-and-biobricks/</link>
		<comments>http://blogs.nopcode.org/brainstorm/2010/03/19/bioengineering-igem-and-biobricks/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 23:42:46 +0000</pubDate>
		<dc:creator>brainstorm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bio]]></category>
		<category><![CDATA[diy]]></category>
		<category><![CDATA[KTH]]></category>

		<guid isPermaLink="false">http://blogs.nopcode.org/brainstorm/?p=303</guid>
		<description><![CDATA[Summarizing from their official page, iGEM is about: Using standard biological parts to build biological systems and operate them in living cells. I&#8217;ve been tracking them since before joining KTH&#8217;s Computational Biology Masters degree. Having a quick look at past editions is both surprising and enlightening to see what they archieve year after year. Perhaps [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://igem.org/"><img src="http://blogs.nopcode.org/brainstorm/wp-content/uploads/2010/03/iGEM_basic_Logo-150x150.png" alt="igem_logo" title="iGEM_basic_Logo" width="150" height="150" class="alignright size-thumbnail wp-image-307" align=right /></a></p>
<p>Summarizing from their <a href="http://2010.igem.org/About">official page</a>, <acronym title='international Genetic Engineered Machines'>iGEM</acronym> is about:</p>
<blockquote><p>
Using <a href="http://partsregistry.org/Main_Page">standard biological parts</a> to build biological systems and operate them in living cells.
</p></blockquote>
<p>I&#8217;ve been tracking them since before joining <a href="http://www.csc.kth.se/utbildning/program/compsysbio/program">KTH&#8217;s Computational Biology Masters degree</a>. Having a quick look at <a href="http://ung.igem.org/Team_Wikis?year=2008">past</a> <a href="http://ung.igem.org/Team_Wikis?year=2009">editions</a> is both surprising and enlightening to see what they archieve year after year.</p>
<p>Perhaps the most rewarding sensation is being able to incrementally be aware of what they are talking about on their projects as I progress on my studies. Indeed, before joining the Masters I could barely understand the general idea, and got absolutely lost in the biological details. Now I can follow it after stepping on some stones that the master provided me.</p>
<p>Last year, together with Hassan, we based our final <a href="http://www.kth.se/student/kurser/kurs/DD2435?l=en_UK">Biomodelling</a> <a href='http://blogs.nopcode.org/brainstorm/wp-content/uploads/2010/03/slides.pdf'>presentation</a> on one project that matched the models we were studying on the course: <a href="http://en.wikipedia.org/wiki/Reaction%E2%80%93diffusion_system">Reaction diffusion systems</a>.</p>
<p>Just a few weeks ago, while learning again how to stand up on a snowboard table on <a href="http://www.rommealpin.se/">Romme</a>, I had the great opportunity to talk with one of last year&#8217;s <a href="http://2009.igem.org/Team:Uppsala-Sweden/Team">Uppsala Team</a> advisor, Daniel, who not only enjoyed the experience, but together with his team, managed to <a href="http://2009.igem.org/files/poster/Uppsala-Sweden.pdf">contribute</a> back some <a href="http://en.wikipedia.org/wiki/BioBrick">biobrick</a>.</p>
<p>Today I would even like to try (dare?) and join one of those groups, just for the fun of learning how this amazing world actually works and to struggle with a real world problem.</p>
<p>And you ? What are you <a href="http://2010.igem.org/Requirements">doing this summer</a> ?</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.nopcode.org/brainstorm/2010/03/19/bioengineering-igem-and-biobricks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
