<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Algorithm on billpg industries™</title><link>https://owl.billpg.com/tags/algorithm/</link><description>Recent content in Algorithm on billpg industries™</description><generator>Hugo</generator><language>en-us</language><copyright>© William Godfrey.</copyright><lastBuildDate>Tue, 28 Mar 2023 16:49:34 +0000</lastBuildDate><atom:link href="https://owl.billpg.com/tags/algorithm/index.xml" rel="self" type="application/rss+xml"/><item><title>Why do we repeatedly hash passwords in a loop?</title><link>https://owl.billpg.com/why-do-we-repeatedly-hash-passwords-in-a-loop/</link><pubDate>Tue, 28 Mar 2023 16:49:34 +0000</pubDate><guid>https://owl.billpg.com/why-do-we-repeatedly-hash-passwords-in-a-loop/</guid><description>&lt;p&gt;If you&amp;rsquo;re building a website that allows the pubic to log-in, you need to store your passwords so you can check your users are who they say they are when logging-in. This is my introduction to the current state of the art for storing your users&amp;rsquo; passwords in your database.&lt;/p&gt;
&lt;h2 id="make-it-someone-elses-problem"&gt;Make It Someone Else&amp;rsquo;s Problem&lt;/h2&gt;
&lt;p&gt;I&amp;rsquo;ll say this right up front, the best way is to get someone else to do it. Use an outsourced service or install a component that deals with the whole thing. You&amp;rsquo;ll have passed responsibility to someone who&amp;rsquo;s very speciality is already knowing everything I&amp;rsquo;ve written here, as well as all the nuances I&amp;rsquo;ve skipped over.&lt;/p&gt;</description></item><item><title>Vinegar - refined Vigenère - can you break my cipher?</title><link>https://owl.billpg.com/vinegar-refined-vigenere-can-you-break-my-cipher/</link><pubDate>Sat, 12 Feb 2011 16:32:00 +0000</pubDate><guid>https://owl.billpg.com/vinegar-refined-vigenere-can-you-break-my-cipher/</guid><description>&lt;div style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;
&lt;img src="https://owl.billpg.com/images/s200_4753829490_07cd82e76d_b.jpg" data-border="0" width="176" height="200" /&gt;
&lt;/div&gt;
&lt;p&gt;I&amp;rsquo;m idly interested in cryptography, the art of scrambling a message so that it can be transmitted securely, and only someone with the magic key can understand the message.&lt;/p&gt;
&lt;p&gt;When I was young, I designed a cryptographic algorithm. I thought I was so clever, but just because *I* couldn&amp;rsquo;t break it, that doesn&amp;rsquo;t make it secure.&lt;/p&gt;
&lt;p&gt;In this article, I present my naive cryptographic algorithm. It&amp;rsquo;s very flawed, so please don&amp;rsquo;t use it for anything important. Can you find the flaw?&lt;/p&gt;</description></item><item><title>'First Past the Post' isn't.</title><link>https://owl.billpg.com/first-past-the-post-isnt/</link><pubDate>Mon, 10 Jan 2011 22:03:00 +0000</pubDate><guid>https://owl.billpg.com/first-past-the-post-isnt/</guid><description>&lt;div style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: center;"&gt;
&lt;img src="https://owl.billpg.com/images/s200_VoteGoat.jpg" data-border="0" width="150" height="200" /&gt;
&lt;/div&gt;
&lt;p&gt;I’m a bit of a nerd for vote counting systems. So I discovered with delight that in the UK, there will soon be a referendum on changing the way votes are counted. As I write this, most of the UK (and the USA) uses a method we call “First past the post”.&lt;/p&gt;
&lt;p&gt;It’s called “First past the post”, but it isn’t. The name is about as ridiculous as calling North Korea;  “The Democratic People&amp;rsquo;s Republic of Korea”. The country is on the Korean peninsula, so at least that name is a little bit honest.&lt;/p&gt;</description></item><item><title>Computers are fast!</title><link>https://owl.billpg.com/computers-are-fast/</link><pubDate>Sun, 29 Nov 2009 18:15:00 +0000</pubDate><guid>https://owl.billpg.com/computers-are-fast/</guid><description>&lt;div style="clear: both; text-align: center;"&gt;
&lt;img src="https://owl.billpg.com/images/killer-sudoku-mid-right.PNG" data-border="0" /&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Killer Sudoku&lt;/strong&gt; is a popular variant on the perennial Sudoku game found in British newspapers. The same rules about the numbers 1 to 9 appearing only once in row, column and 3x3 box still apply, but unlike Sudoku, the puzzle doesn&amp;rsquo;t come with any numbers filled in. Instead, cells are groups with dotted lines and the total of all those cells are written in. Here&amp;rsquo;s part of a puzzle. The two cells grouped by a 10 could be 1+9, 2+8, 3+7 or 4+6. (It can&amp;rsquo;t be 5+5 because that would mean two 5s in same box.) Not a lot to work on, but also look at the three cells grouped by a 23 in the same 3x3 box; The only possible fit is 6+8+9. This means the only possible fit for the 10 group is 3+7, as all the possibilities would clash with the 6,8 or 9 required to make the 23. I could go on. If you want to complete the puzzle, its the &lt;a href="http://www.guardian.co.uk/theguardian"&gt;Guardian&lt;/a&gt;&amp;rsquo;s &lt;a href="http://www.guardian.co.uk/lifeandstyle/2009/nov/28/sudoku-166-killer"&gt;puzzle number 166&lt;/a&gt;. The point of this article isn&amp;rsquo;t to solve the puzzle, but something I observed along the way. Am I sure there&amp;rsquo;s no other way to split 23 into three parts, 1 to 9, without duplicates? I confess, mental arithmetic is not my forte. Part of the puzzle solving process for me is going through each dotted group and building a crib sheet on all the possible ways to make the total, so I can cross them off later. This isn&amp;rsquo;t a part of the puzzle I particularly enjoy, so I decided to automate it. (Is that cheating? I don&amp;rsquo;t think so in my circumstances, but that&amp;rsquo;s another topic of conversation.) So I sat down and designed an algorithm&amp;hellip;&lt;/p&gt;</description></item></channel></rss>