<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Alice, Bob and Mallory</title>
    <link>http://alicebobandmallory.com/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>security and obscurity</description>
    <item>
      <title>Swedish hackers</title>
      <description>&lt;p&gt;The incident I wrote of in &lt;a href="http://alicebobandmallory.com/articles/2007/02/04/hello-this-is-special-agent-brian"&gt;Hello this is special agent Brian&lt;/a&gt; were covered in a Swedish radio documentary a little more than a month ago.
It's all in Swedish. You can find out more &lt;a href="http://www.sr.se/cgi-bin/p3/programsidor/artikel.asp?ProgramID=2519&amp;amp;Artikel=2447808"&gt;here&lt;/a&gt; and you can download the documentary from &lt;a href="http://www.sr.se/laddahem/podradio/SR_p3_dokumentar_081116080008.mp3"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I also would like to add that we did not press charges like the police officers says 37 minutes into the documentary. Not because we thought it wasn't a big deal but we knew that a couple of big players already had so we thought we could spend our time better.&lt;/p&gt;</description>
      <pubDate>Wed, 31 Dec 2008 00:29:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:75c0eb80-02fc-4f10-92bf-d0ee90a49986</guid>
      <author>Jonas Elfström</author>
      <link>http://alicebobandmallory.com/articles/2008/12/31/swedish-hackers</link>
      <category>Security</category>
    </item>
    <item>
      <title>Death from lack of content</title>
      <description>&lt;p&gt;I'm sorry to admit that this blog has died from lack of content and I have absolutely no guarantees to give you that it will ever come alive again.&lt;/p&gt;

&lt;p&gt;At least I'm still alive and last night I &lt;a href="http://www.plea.se/me/Leif.html"&gt;had some fun&lt;/a&gt; with C, &lt;a href="http://www.codeblocks.org/"&gt;Code::Blocks&lt;/a&gt; and &lt;a href="http://www.libsdl.org/"&gt;SDL&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Sat, 15 Nov 2008 02:21:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:ef2bb361-e7c7-4c25-ad94-4da019368c1f</guid>
      <author>Jonas Elfström</author>
      <link>http://alicebobandmallory.com/articles/2008/11/15/death-from-lack-of-content</link>
      <category>Blogging</category>
    </item>
    <item>
      <title>Unit testing strains</title>
      <description>&lt;p&gt;I've felt it and I've heard it from colleagues several times. Writing unit tests can be hard work. Especially adding unit test to an existing code base is, at best, cumbersome. Also it's one of those things with delayed gratification. Sometimes it's not even you that will benefit from them being there because the biggest win can be long down the road, when changes to the system has to be made. &lt;/p&gt;

&lt;p&gt;Tests may seem to be isolated and it's even considered a good thing to keep them that way. Even so the tests of your application has a correlation to what the system aims to do on a bigger scale.  This one of the things &lt;a href="http://en.wikipedia.org/wiki/Behavior_driven_development"&gt;BDD&lt;/a&gt;  focuses on. I think that one of the biggest advantages is that you in one process writes a specification and tests that ensures that the spec. is met. Testing becomes a natural part of the development process. This way it clearly shows that BDD and  &lt;a href="http://en.wikipedia.org/wiki/Test-driven_development"&gt;TDD&lt;/a&gt; are design processes and that it's certainly not all about adding unit tests.&lt;/p&gt;

&lt;p&gt;Find out more about BDD on: &lt;a href="BehaviourDrivenDevelopment"&gt;http://behaviour-driven.org&lt;/a&gt;&lt;br/&gt;
&lt;em&gt;It must be stressed that BDD is a rephrasing of existing good practice, it is not a radically new departure. Its aim is to bring together existing, well-established techniques under a common banner and with a consistent and unambiguous terminology.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;For Ruby &lt;a href="http://rspec.info/"&gt;RSpec&lt;/a&gt; has almost become the de facto standard for BDD. The concepts Story, Scenario, and Test feels natural and the syntax is short and easy to read.&lt;/p&gt;

&lt;p&gt;In languages like Java or C# the tests often becomes much more cluttered and some of that clutter is the extra code that comes with static typing. I believe that dynamically typed and overall dynamic languages like Ruby or Python could find a nice little niche here. They could become &lt;a href="http://en.wikipedia.org/wiki/Domain-specific_programming_language"&gt;DSL's&lt;/a&gt; for testing.&lt;/p&gt;

&lt;p&gt;RSpec is on it's way for .NET/C# via &lt;a href="http://en.wikipedia.org/wiki/IronRuby"&gt;IronRuby&lt;/a&gt; and for Java via &lt;a href="http://jruby.codehaus.org/"&gt;JRuby&lt;/a&gt; but don't hold your breath because they are still in alpha and beta.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.NET / C#&lt;/strong&gt;&lt;br/&gt;
&lt;a href="http://rubydoes.net/2008/02/21/testing-net-with-ironrubys-mini_rspecrb/"&gt;Testing .NET with IronRuby...&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://bgeek.net/2008/02/14/nspecify-rspec-well-closer-anyway/"&gt;NSpecify =&gt; RSpec… well closer anyway&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Java&lt;/strong&gt;&lt;br/&gt;
&lt;a href="http://pivots.pivotallabs.com/users/pzabelin/blog/articles/375-functional-tests-for-java-project-rspec-jruby"&gt;Java Functional Testing with JRuby and RSpec&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://jtestr.codehaus.org/"&gt;JtestR&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ruby&lt;/strong&gt;&lt;br/&gt;
&lt;a href="http://socialface.com/slapp/"&gt;Slapp&lt;/a&gt; - A simple chat wall Merb tutorial. With nice exampes of using RSpec.&lt;br/&gt;
&lt;a href="http://www.ibm.com/developerworks/web/library/wa-rspec/"&gt;Behavior-driven testing with RSpec&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ASP.NET MVC&lt;/strong&gt;&lt;br/&gt;
&lt;a href="http://blogs.msdn.com/webdevtools/archive/2008/03/06/asp-net-mvc-test-framework-integration-demo.aspx"&gt;ASP.NET MVC Test Framework Integration Walkthrough&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://www.asp.net/learn/3.5-extensions-videos/video-271.aspx"&gt;MVC Preview - Testing&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://www.hanselman.com/blog/ASPNETMVCSessionAtMix08TDDAndMvcMockHelpers.aspx"&gt;ASP.NET MVC Session at Mix08, TDD and MvcMockHelpers&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 05 May 2008 21:17:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:89da439e-a963-4880-9501-16902abf9b31</guid>
      <author>Jonas Elfström</author>
      <link>http://alicebobandmallory.com/articles/2008/05/05/unit-testing-strains</link>
      <category>Ruby</category>
      <category>C#</category>
      <category>Java</category>
    </item>
    <item>
      <title>Drive encryption matters</title>
      <description>&lt;p&gt;In a recent release &lt;a href="http://www.truecrypt.org/"&gt;TrueCrypt&lt;/a&gt; now supports &lt;a href="http://www.truecrypt.org/docs/?s=system-encryption"&gt;drive/partition&lt;/a&gt; encryption.&lt;/p&gt;

&lt;p&gt;One reason to encrypt on disk instead of file level is that operating systems and applications sometimes accidently stores passwords on your hard drive. This can happen in a number of ways and one common mistake applications make is to not prevent to be put on disk by the OS. Modern systems have a &lt;a href="http://en.wikipedia.org/wiki/Paging"&gt;page/swap file&lt;/a&gt;. If a program gets paged out while holding your clear text password in pageable memory your password will be written to disk. The problem is that there are &lt;a href="http://www.schneier.com/essay-148.html"&gt;password recovery tools&lt;/a&gt; that can scan your page file for passwords.&lt;/p&gt;

&lt;p&gt;You can configure Windows (and surely most other operating systems) to &lt;a href="http://support.microsoft.com/kb/314834"&gt;clear the page file&lt;/a&gt; on shutdown which will give you better protection (and slower shutdowns). Be aware that if you simply turn off the power the page file will be intact.&lt;/p&gt;</description>
      <pubDate>Tue, 12 Feb 2008 00:26:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:fc149744-6fac-475d-8a37-f548b4db2403</guid>
      <author>Jonas Elfström</author>
      <link>http://alicebobandmallory.com/articles/2008/02/12/drive-encryption-matters</link>
      <category>Security</category>
    </item>
    <item>
      <title>Scary tools</title>
      <description>&lt;p&gt;I recently attended a session held by &lt;a href="http://truesecurity.se/blogs/murray/"&gt;Marcus Murray&lt;/a&gt;. It seems it was kind of a compressed version of the &lt;a href="http://truesecurity.se/blogs/murray/archive/2007/06/05/session-notes-sec-310-why-i-can-hack-your-network-in-a-day-teched-us-2007-part-1.aspx#comments"&gt;session&lt;/a&gt; he held at TechEd earlier this year. Murray is witty, charismatic and has a broad and deep understanding of IT-security issues. He cracks jokes and practices a little social engineering to keep the audience attentive.
If you and your IT-staff wants to be briefed (and scared) with the latest in IT-security I could easily recommend Murray.&lt;/p&gt;

&lt;p&gt;He demonstrated a couple of tools that both impressed and scared me. First he demonstrated how to set up a mail based attack using the commercial &lt;a href="http://www.coresecurity.com/?module=ContentMod&amp;amp;action=item&amp;amp;id=32"&gt;Core IMPACT&lt;/a&gt;. It's a very impressive tool and mail based attacks are only one out of many attacks this software has the ability to execute. Before seeing this I could never have guessed there are tools this advanced and this easy to use. The lists of exploits it can test, in an all automated fashion, were long and seemed to be up to date.&lt;/p&gt;

&lt;p&gt;Murray also demonstrated &lt;a href="http://www.grc.com/nat/arp.htm"&gt;ARP poisoning&lt;/a&gt; and hijacking of a RDP session by using the free &lt;a href="http://www.oxid.it/index.html"&gt;Cain &amp;amp; Abel &lt;/a&gt; tool. You could feel the discomfort in the air as it dawned on the audience how easy this is to set up.&lt;/p&gt;</description>
      <pubDate>Wed, 12 Dec 2007 17:15:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:a8894523-e498-4a14-9ea2-45acb0672dbf</guid>
      <author>Jonas Elfström</author>
      <link>http://alicebobandmallory.com/articles/2007/12/12/scary-tools</link>
      <category>Security</category>
    </item>
    <item>
      <title>Man in the browser</title>
      <description>&lt;p&gt;There's some buzz about a new trojan technique called &lt;a href="http://www.f-secure.com/f-secure/pressroom/news/fs_news_20071122_1_eng.html"&gt;"Man in the browser"&lt;/a&gt;.  The trojan plugs itself into the users browser and then it intercepts the HTML. This have all sorts of implications, for instance the SSL certificate will seem to be valid. &lt;/p&gt;

&lt;p&gt;Even if your virus protection does not detect the "Man in the browser" there are still ways to be quite safe. If your bank uses a security token which you not only logs in with but also use to sign your transactions, the attack will most likely fail. One problem is that it is up to you, the user, to actually verify that you are signing the expected amount to the expected accounts. To get protection against someone who has complete control over your computer the security protocol must "communicate" with the security token both ways. &lt;/p&gt;

&lt;p&gt;It is not enough to only let the user enter the total value of the transactions because the tokens answer to such a simple value could be reused (during a short period of time) also the attack could be crafted to create the correct amount but to other accounts. By asking the user to also sign every new account the attacker will not be able to hide a transaction to his account.&lt;/p&gt;

&lt;p&gt;The challenge is to make the security protocol clear and &lt;a href="/articles/2007/03/27/secure-and-simple-security-tokens-needed"&gt;simple&lt;/a&gt; enough so that the user can understand what he would expect the bank to respond and expect from him.&lt;/p&gt;

&lt;p&gt;It's the usual three: have a firewall, an updated virus protection and a secure bank with a &lt;a href="http://en.wikipedia.org/wiki/Security_token#Digital_signatures"&gt;digital security token&lt;/a&gt; were you sign your transactions and maybe you can sleep a little better.&lt;/p&gt;</description>
      <pubDate>Mon, 26 Nov 2007 21:40:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:4a0b5d22-29f0-418a-b9df-1fe703ad3fdb</guid>
      <author>Jonas Elfström</author>
      <link>http://alicebobandmallory.com/articles/2007/11/26/man-in-the-browser</link>
      <category>Security</category>
    </item>
    <item>
      <title>Blowfish in the URL</title>
      <description>&lt;p&gt;Sometimes you do not want to show the database id for a row in the URL. The reason could be that you do not want someone to be able to scan through all the data.&lt;/p&gt;

&lt;p&gt;One solution is to use &lt;a href="http://en.wikipedia.org/wiki/Globally_Unique_Identifier"&gt;GUID's&lt;/a&gt; but they have drawbacks and one of them is that they add a considerable length to the URL. The shortest URL-safe representation of a GUID I've seen is &lt;a href="http://tools.assembla.com/breakout/wiki/FreeSoftware"&gt;22 characters&lt;/a&gt; but usually they are 36 characters.&lt;/p&gt;

&lt;p&gt;Depending on how your id's are implemented a much shorter way could be to simply to encrypt them.&lt;/p&gt;

&lt;p&gt;Here's a &lt;a href="http://www.ruby-lang.org/"&gt;Ruby&lt;/a&gt;-example that Blowfish encrypts, Base64 encodes and URL-encodes an integer value. You can get crypt as a gem:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gem install crypt&lt;/code&gt;&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="ident"&gt;require&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;rubygems&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;
&lt;span class="ident"&gt;require&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;crypt/blowfish&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;
&lt;span class="ident"&gt;require&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;Base64&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;
&lt;span class="ident"&gt;blowfish&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="constant"&gt;Crypt&lt;/span&gt;&lt;span class="punct"&gt;::&lt;/span&gt;&lt;span class="constant"&gt;Blowfish&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;new&lt;/span&gt;&lt;span class="punct"&gt;(&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;A key up to 56 bytes long&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;)&lt;/span&gt;
&lt;span class="ident"&gt;plainId&lt;/span&gt;&lt;span class="punct"&gt;=&lt;/span&gt;&lt;span class="number"&gt;123456&lt;/span&gt;
&lt;span class="ident"&gt;encryptedBlock&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="ident"&gt;blowfish&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;encrypt_block&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;plainId&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;to_s&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;ljust&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="number"&gt;8&lt;/span&gt;&lt;span class="punct"&gt;))&lt;/span&gt;
&lt;span class="ident"&gt;idForURL&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="constant"&gt;URI&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;escape&lt;/span&gt;&lt;span class="punct"&gt;((&lt;/span&gt;&lt;span class="constant"&gt;Base64&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;encode64&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;encryptedBlock&lt;/span&gt;&lt;span class="punct"&gt;).&lt;/span&gt;&lt;span class="ident"&gt;strip&lt;/span&gt;&lt;span class="punct"&gt;))&lt;/span&gt;

&lt;span class="ident"&gt;decryptedId&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="ident"&gt;blowfish&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;decrypt_block&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="constant"&gt;Base64&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;decode64&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="constant"&gt;URI&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;unescape&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;idForURL&lt;/span&gt;&lt;span class="punct"&gt;))).&lt;/span&gt;&lt;span class="ident"&gt;strip&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;to_i&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The .ljust(8) is because &lt;a href="http://www.schneier.com/blowfish.html"&gt;Blowfish&lt;/a&gt; is a 64-bit block &lt;a href="http://en.wikipedia.org/wiki/Blowfish_(cipher)"&gt;cipher&lt;/a&gt; and the &lt;a href="http://crypt.rubyforge.org/"&gt;Ruby-implementation&lt;/a&gt; does not pad the data itself.&lt;/p&gt;

&lt;p&gt;The id in the URL in this case would be &lt;code&gt;c2PSXWgky40=&lt;/code&gt;. Its 12 characters long (11 if you skip the equal sign) and that's 10 or 24 characters shorter than a GUID. Also there is zero percent chance of a collusion and if you want to you can even decrypt it.&lt;/p&gt;

&lt;p&gt;This is not a super safe implementation but if you start your id's at a random and not too low number you are making it a bit harder for someone to crack the 56-bit key. Actually a truly random and at least 64-bit big number would be a better choice as it would have no connection to the true id at all. You would have to check for uniqueness before storing those in the database though.&lt;/p&gt;</description>
      <pubDate>Thu, 15 Nov 2007 22:38:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:9071a4d1-aaf0-4f17-a796-4ecd65976d64</guid>
      <author>Jonas Elfström</author>
      <link>http://alicebobandmallory.com/articles/2007/11/15/blowfish-in-the-url</link>
      <category>Security</category>
      <category>Ruby</category>
    </item>
    <item>
      <title>Sierpinski's shoes</title>
      <description>&lt;p&gt;There were no cross-platform windowing toolkits for Ruby so &lt;a href="http://en.wikipedia.org/wiki/Why_the_lucky_stiff"&gt;_why&lt;/a&gt; made one and he calls it &lt;a href="http://code.whytheluckystiff.net/shoes/"&gt;Shoes&lt;/a&gt;. Not even close to 1.0, it's already yummy in a chunky kind of way and since it came from _why I simply had to try it out. Something simple.&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="constant"&gt;Shoes&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;app&lt;/span&gt; &lt;span class="symbol"&gt;:width&lt;/span&gt; &lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="number"&gt;1024&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt; &lt;span class="symbol"&gt;:height&lt;/span&gt; &lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="number"&gt;768&lt;/span&gt; &lt;span class="keyword"&gt;do&lt;/span&gt;  
  &lt;span class="ident"&gt;corners&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="punct"&gt;[&lt;/span&gt; &lt;span class="punct"&gt;{&lt;/span&gt;&lt;span class="symbol"&gt;:x&lt;/span&gt; &lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="number"&gt;256&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt; &lt;span class="symbol"&gt;:y&lt;/span&gt; &lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="number"&gt;10&lt;/span&gt;&lt;span class="punct"&gt;},&lt;/span&gt; &lt;span class="punct"&gt;{&lt;/span&gt;&lt;span class="symbol"&gt;:x&lt;/span&gt; &lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="number"&gt;12&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt; &lt;span class="symbol"&gt;:y&lt;/span&gt; &lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="number"&gt;378&lt;/span&gt;&lt;span class="punct"&gt;},&lt;/span&gt; &lt;span class="punct"&gt;{&lt;/span&gt;&lt;span class="symbol"&gt;:x&lt;/span&gt; &lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="number"&gt;506&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt; &lt;span class="symbol"&gt;:y&lt;/span&gt; &lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="number"&gt;378&lt;/span&gt;&lt;span class="punct"&gt;}&lt;/span&gt; &lt;span class="punct"&gt;]&lt;/span&gt;
  &lt;span class="ident"&gt;xpos&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt;&lt;span class="ident"&gt;ypos&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt;&lt;span class="ident"&gt;c&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="number"&gt;256&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt;&lt;span class="number"&gt;10&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt;&lt;span class="number"&gt;0&lt;/span&gt;
  &lt;span class="ident"&gt;srand&lt;/span&gt;
  &lt;span class="number"&gt;2111&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;times&lt;/span&gt; &lt;span class="keyword"&gt;do&lt;/span&gt;
      &lt;span class="ident"&gt;c&lt;/span&gt;&lt;span class="punct"&gt;=&lt;/span&gt;&lt;span class="ident"&gt;rand&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="number"&gt;3&lt;/span&gt;&lt;span class="punct"&gt;)&lt;/span&gt;
      &lt;span class="ident"&gt;xpos&lt;/span&gt; &lt;span class="punct"&gt;+=&lt;/span&gt; &lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;corners&lt;/span&gt;&lt;span class="punct"&gt;[&lt;/span&gt;&lt;span class="ident"&gt;c&lt;/span&gt;&lt;span class="punct"&gt;][&lt;/span&gt;&lt;span class="symbol"&gt;:x&lt;/span&gt;&lt;span class="punct"&gt;]-&lt;/span&gt;&lt;span class="ident"&gt;xpos&lt;/span&gt;&lt;span class="punct"&gt;)&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="number"&gt;1&lt;/span&gt;
      &lt;span class="ident"&gt;ypos&lt;/span&gt; &lt;span class="punct"&gt;+=&lt;/span&gt; &lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;corners&lt;/span&gt;&lt;span class="punct"&gt;[&lt;/span&gt;&lt;span class="ident"&gt;c&lt;/span&gt;&lt;span class="punct"&gt;][&lt;/span&gt;&lt;span class="symbol"&gt;:y&lt;/span&gt;&lt;span class="punct"&gt;]-&lt;/span&gt;&lt;span class="ident"&gt;ypos&lt;/span&gt;&lt;span class="punct"&gt;)&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="number"&gt;1&lt;/span&gt;
      &lt;span class="ident"&gt;star&lt;/span&gt; &lt;span class="ident"&gt;xpos&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt; &lt;span class="ident"&gt;ypos&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt; &lt;span class="number"&gt;5&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt; &lt;span class="number"&gt;10&lt;/span&gt;
  &lt;span class="keyword"&gt;end&lt;/span&gt;
&lt;span class="keyword"&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The &lt;a href="/sierpinskis_shoes.png"&gt;result&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Wed, 14 Nov 2007 23:50:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:2c9a77e9-a013-4c99-8562-90d8c1a6b265</guid>
      <author>Jonas Elfström</author>
      <link>http://alicebobandmallory.com/articles/2007/11/14/sierpinskis-shoes</link>
      <category>Ruby</category>
      <category>Math</category>
    </item>
    <item>
      <title>Hash functions</title>
      <description>&lt;p&gt;Recently I happened to see the &lt;a href="http://www.isthe.com/chongo/tech/comp/fnv/"&gt;FNV hash&lt;/a&gt; being mentioned. I had never heard of it before so I googled it and found the authors &lt;a href="http://www.isthe.com/chongo/tech/comp/fnv/"&gt;page&lt;/a&gt; but also a true gem. If you want a crash course in hash functions then I can recommend Mulvey's &lt;a href="http://bretm.home.comcast.net/hash/"&gt;site&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Mon, 01 Oct 2007 21:07:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:55e0d2e8-96eb-41e7-9a1f-e5d3c835915f</guid>
      <author>Jonas Elfström</author>
      <link>http://alicebobandmallory.com/articles/2007/10/01/hash-functions</link>
      <category>Security</category>
    </item>
    <item>
      <title>Smart card with LCD</title>
      <description>&lt;p&gt;&lt;a href="http://www.swecard.se/"&gt;This company&lt;/a&gt; is presenting a smart card with built in display. I do not know the underlying protocol for making debit/credit card payments by smart card instead of using the magnetic stripe but if the protocol is sophisticated enough this could help blocking some of the known attacks of those. As &lt;a href="http://www.chipandspin.co.uk/"&gt;Chip and SPIN&lt;/a&gt; points out the smart cards has some issues. One of them is that if the terminal is compromised you as a customer have no way to know that you are actually confirming the transaction you think you are while entering your pin code. If your smart card shows the amount, you could at least not be deceived into emptying your account.&lt;/p&gt;</description>
      <pubDate>Tue, 31 Jul 2007 23:10:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:76986b7d-292e-4665-a9d6-748461fa455b</guid>
      <author>Jonas Elfström</author>
      <link>http://alicebobandmallory.com/articles/2007/07/31/smart-card-with-lcd</link>
      <category>Security</category>
    </item>
  </channel>
</rss>
