<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Straddling Checkerboard</title>
	<atom:link href="http://programmingpraxis.com/2010/01/29/straddling-checkerboard/feed/" rel="self" type="application/rss+xml" />
	<link>http://programmingpraxis.com/2010/01/29/straddling-checkerboard/</link>
	<description>A collection of etudes, updated weekly, for the education and enjoyment of the savvy programmer</description>
	<lastBuildDate>Mon, 28 May 2012 03:30:45 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Ed</title>
		<link>http://programmingpraxis.com/2010/01/29/straddling-checkerboard/#comment-3726</link>
		<dc:creator><![CDATA[Ed]]></dc:creator>
		<pubDate>Thu, 06 Oct 2011 18:07:17 +0000</pubDate>
		<guid isPermaLink="false">http://programmingpraxis.com/?p=1801#comment-3726</guid>
		<description><![CDATA[The bug is actually worse than stated; often there is an intermediate transposition involved and an extra character may throw that transposition off and distort the shape of the cipher. My solution is to replace the spaces with punctuation for the reverse substitution, so that disallowed digits in the final position can be substituted. For instance, 
  0 1 2 3 4 5 6 7 8 9
  S H @ 8 A #1 R P $
2 E 5 N * Y O U W B 2
5 C 3 D 4 F 6 G 7 I 9
9 J 0 K L M Q T V X Z
(apologies-- reply block is not monospaced)

This punctuation (@#%) is not used in the plain text, but if the final digit of the substituted (and possibly transposed) ciphertext is an unpaired 2, 5 or 9, it is reverse substituted with the @, #, or $. This gets rid of the &quot;phantom digit&quot; in the intermediate stage.]]></description>
		<content:encoded><![CDATA[<p>The bug is actually worse than stated; often there is an intermediate transposition involved and an extra character may throw that transposition off and distort the shape of the cipher. My solution is to replace the spaces with punctuation for the reverse substitution, so that disallowed digits in the final position can be substituted. For instance,<br />
  0 1 2 3 4 5 6 7 8 9<br />
  S H @ 8 A #1 R P $<br />
2 E 5 N * Y O U W B 2<br />
5 C 3 D 4 F 6 G 7 I 9<br />
9 J 0 K L M Q T V X Z<br />
(apologies&#8211; reply block is not monospaced)</p>
<p>This punctuation (@#%) is not used in the plain text, but if the final digit of the substituted (and possibly transposed) ciphertext is an unpaired 2, 5 or 9, it is reverse substituted with the @, #, or $. This gets rid of the &#8220;phantom digit&#8221; in the intermediate stage.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Moe W</title>
		<link>http://programmingpraxis.com/2010/01/29/straddling-checkerboard/#comment-2520</link>
		<dc:creator><![CDATA[Moe W]]></dc:creator>
		<pubDate>Thu, 24 Feb 2011 17:26:55 +0000</pubDate>
		<guid isPermaLink="false">http://programmingpraxis.com/?p=1801#comment-2520</guid>
		<description><![CDATA[Mike is there a simpler Python version or code to use for that cipher?]]></description>
		<content:encoded><![CDATA[<p>Mike is there a simpler Python version or code to use for that cipher?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://programmingpraxis.com/2010/01/29/straddling-checkerboard/#comment-1152</link>
		<dc:creator><![CDATA[Mike]]></dc:creator>
		<pubDate>Tue, 13 Apr 2010 05:44:54 +0000</pubDate>
		<guid isPermaLink="false">http://programmingpraxis.com/?p=1801#comment-1152</guid>
		<description><![CDATA[Python version.

[sourcecode lang=&quot;python&quot;]
from itertools import cycle, izip

def digits(n, base=10):
    seq = []
    while n:
        n,r = divmod(n,base)
        seq.append(r)
    seq.reverse()
    return seq


class Checkerboard:
    def __init__(self, passphrase, d1, d2, d3, pin):
        &#039;&#039;&#039;the key for the checkerboard cypher includes a word or phrase
        (passphrase), three different digits (d1, d2, and d3), and a
        multiple digit number (pin).
        &#039;&#039;&#039;
        
        self.rows = [d1, d2, d3]
        self.pin  = digits( pin )
        self.unpin = [ 10 - d for d in self.pin ]

        board = []
        for n,ltr in enumerate( passphrase + &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot; ):
            if ltr in board: continue

            if &#039;A&#039; &lt;= ltr &lt;= &#039;J&#039;:
                board.append(ltr)
                board.append(&#039;1234567890&#039;[ord(ltr)-ord(&#039;A&#039;)])

            elif &#039;0&#039; &lt;= ltr &lt;= &#039;9&#039;:
                board.append(&#039;JABCDEFGHI&#039;[int(ltr)])
                board.append(ltr)

            else:
                board.append(ltr)
        else:
            for n in self.rows:
                board[n:n] = &#039;_&#039;


        self.emap = {}
        self.dmap = {}

        for n,ltr in enumerate( board ):
            if n &lt; 10:
                self.emap[ ltr ] = (n,)
                self.dmap[n] = ltr
            else:
                k = ( self.rows[ n / 10 - 1 ], n % 10 )
                self.emap[ ltr ] = k
                self.dmap[k] = ltr

    def _encode(self, chars):
        return [d for ltr in chars for d in self.emap[ltr]]

    def _process(self, digits, key):
        return [(d + m)%10 for d,m in izip(digits, cycle(key))]

    def _decode(self, digits):
        out = []
        r = 0
        for c in digits:
            if r:
                out.append( self.dmap[(r,c)] )
                r = 0

            elif c in self.rows:
                r = c

            else:
                out.append( self.dmap[ c ] )

        return out
    
    def encrypt(self, message):
        buf = self._encode(message)
        buf = self._process(buf, self.pin)
        buf = self._decode(buf)
        
        return &#039;&#039;.join(buf)
    
    def decrypt(self, message):
        buf = self._encode(message)
        buf = self._process(buf, self.unpin)
        buf = self._decode(buf)
        
        return &#039;&#039;.join(buf)
[/sourcecode]

Sample usage and output:

[sourcecode language=&quot;lang=&quot;python&quot;]
cb = Checkerboard(&quot;SHARPEN YOUR SAW&quot;, 2,5,9, 2641)

cyphertext = cb.encrypt(&quot;PROGRAMMING PRAXIS&quot;)
print &quot;cyphertext =&quot;, cyphertext

plaintext = cb.decrypt(cyphertext)
print &quot;plaintext =&quot;, plaintext

cyphertext = S811R53S87A18RUAS8PSSH5
plaintext = PROGRAMMING PRAXIS

[/sourcecode]]]></description>
		<content:encoded><![CDATA[<p>Python version.</p>
<pre class="brush: python;">
from itertools import cycle, izip

def digits(n, base=10):
    seq = []
    while n:
        n,r = divmod(n,base)
        seq.append(r)
    seq.reverse()
    return seq


class Checkerboard:
    def __init__(self, passphrase, d1, d2, d3, pin):
        '''the key for the checkerboard cypher includes a word or phrase
        (passphrase), three different digits (d1, d2, and d3), and a
        multiple digit number (pin).
        '''
        
        self.rows = [d1, d2, d3]
        self.pin  = digits( pin )
        self.unpin = [ 10 - d for d in self.pin ]

        board = []
        for n,ltr in enumerate( passphrase + &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot; ):
            if ltr in board: continue

            if 'A' &lt;= ltr &lt;= 'J':
                board.append(ltr)
                board.append('1234567890'[ord(ltr)-ord('A')])

            elif '0' &lt;= ltr &lt;= '9':
                board.append('JABCDEFGHI'[int(ltr)])
                board.append(ltr)

            else:
                board.append(ltr)
        else:
            for n in self.rows:
                board[n:n] = '_'


        self.emap = {}
        self.dmap = {}

        for n,ltr in enumerate( board ):
            if n &lt; 10:
                self.emap[ ltr ] = (n,)
                self.dmap[n] = ltr
            else:
                k = ( self.rows[ n / 10 - 1 ], n % 10 )
                self.emap[ ltr ] = k
                self.dmap[k] = ltr

    def _encode(self, chars):
        return [d for ltr in chars for d in self.emap[ltr]]

    def _process(self, digits, key):
        return [(d + m)%10 for d,m in izip(digits, cycle(key))]

    def _decode(self, digits):
        out = []
        r = 0
        for c in digits:
            if r:
                out.append( self.dmap[(r,c)] )
                r = 0

            elif c in self.rows:
                r = c

            else:
                out.append( self.dmap[ c ] )

        return out
    
    def encrypt(self, message):
        buf = self._encode(message)
        buf = self._process(buf, self.pin)
        buf = self._decode(buf)
        
        return ''.join(buf)
    
    def decrypt(self, message):
        buf = self._encode(message)
        buf = self._process(buf, self.unpin)
        buf = self._decode(buf)
        
        return ''.join(buf)
</pre>
<p>Sample usage and output:</p>
<p>cb = Checkerboard(&quot;SHARPEN YOUR SAW&quot;, 2,5,9, 2641)</p>
<p>cyphertext = cb.encrypt(&quot;PROGRAMMING PRAXIS&quot;)<br />
print &quot;cyphertext =&quot;, cyphertext</p>
<p>plaintext = cb.decrypt(cyphertext)<br />
print &quot;plaintext =&quot;, plaintext</p>
<p>cyphertext = S811R53S87A18RUAS8PSSH5<br />
plaintext = PROGRAMMING PRAXIS</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: programmingpraxis</title>
		<link>http://programmingpraxis.com/2010/01/29/straddling-checkerboard/#comment-1003</link>
		<dc:creator><![CDATA[programmingpraxis]]></dc:creator>
		<pubDate>Fri, 12 Feb 2010 00:10:40 +0000</pubDate>
		<guid isPermaLink="false">http://programmingpraxis.com/?p=1801#comment-1003</guid>
		<description><![CDATA[The normal solution when using the straddling checkerboard by hand is to add an extra digit, forming a null character.  Perhaps you would like to propose a fix for the suggested solution?]]></description>
		<content:encoded><![CDATA[<p>The normal solution when using the straddling checkerboard by hand is to add an extra digit, forming a null character.  Perhaps you would like to propose a fix for the suggested solution?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: novatech</title>
		<link>http://programmingpraxis.com/2010/01/29/straddling-checkerboard/#comment-1002</link>
		<dc:creator><![CDATA[novatech]]></dc:creator>
		<pubDate>Thu, 11 Feb 2010 23:44:42 +0000</pubDate>
		<guid isPermaLink="false">http://programmingpraxis.com/?p=1801#comment-1002</guid>
		<description><![CDATA[while i try to improve my coding i&#039;ve notice few bug with this type of straddling checkerboard
it&#039;s when the end of digit list is 2, 5 or 9. assuming we check the last value as single digit, compare it against board will give us &#039;_&#039; or space in this case. reverse it back wont be valid due to 3 position of spaces..

for example 
&quot;encrypt this text&quot;
will be
466376136437493731214937463912
match this number to checker board we get
4 6 6 3 7 6 1 3 6 4 3 7 4 93 7 3 1 21 4 93 7 4 6 3 91 2 (we not check next value is nil)
A 1 1 8 R 1 H 8 1 A 8 R A L  R 8 H 5  A L  R A 1 8 0  _

another example is
&quot;a a&quot;
&quot;i can get a&quot;
:)]]></description>
		<content:encoded><![CDATA[<p>while i try to improve my coding i&#8217;ve notice few bug with this type of straddling checkerboard<br />
it&#8217;s when the end of digit list is 2, 5 or 9. assuming we check the last value as single digit, compare it against board will give us &#8216;_&#8217; or space in this case. reverse it back wont be valid due to 3 position of spaces..</p>
<p>for example<br />
&#8220;encrypt this text&#8221;<br />
will be<br />
466376136437493731214937463912<br />
match this number to checker board we get<br />
4 6 6 3 7 6 1 3 6 4 3 7 4 93 7 3 1 21 4 93 7 4 6 3 91 2 (we not check next value is nil)<br />
A 1 1 8 R 1 H 8 1 A 8 R A L  R 8 H 5  A L  R A 1 8 0  _</p>
<p>another example is<br />
&#8220;a a&#8221;<br />
&#8220;i can get a&#8221;<br />
:)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: novatech</title>
		<link>http://programmingpraxis.com/2010/01/29/straddling-checkerboard/#comment-975</link>
		<dc:creator><![CDATA[novatech]]></dc:creator>
		<pubDate>Sun, 31 Jan 2010 11:28:45 +0000</pubDate>
		<guid isPermaLink="false">http://programmingpraxis.com/?p=1801#comment-975</guid>
		<description><![CDATA[my ruby attemp
[sourcecode lang=&quot;ruby&quot;]
class Straddling 
def initialize( key, n1, n2, n3 )
   key = key+&quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;
   key = key.upcase.split(//).uniq
   @key = key;@n1 = n1;@n2 = n2;@n3 = n3
end

def create
   @board = Array.new(4)
   k = 0;prev = &quot;&quot;
   for a in 0..40 do
       if (a == @n1 &#124;&#124; a == @n2 &#124;&#124; a == @n3)
     	 @board[a] = &quot; &quot;
       else
         if (&quot;A&quot;..&quot;J&quot;) === prev

          @board[a] = prev == &quot;J&quot;? 0:((prev)[0]-16).chr
         else
          @board[a] = @key[k] == &quot; &quot; ? &quot;*&quot; : @key[k]
          k+=1
         end
         prev = @board[a]
       end
    end
   return @board.to_s
end


def tp(key,text)
@key = key.split(//)
@text = text.gsub(&#039; &#039;,&#039;*&#039;).upcase.split(//)
end

def keygen
@keygen = Array.new
@checker_board = @board.to_s.split(//)
for a in 0..@text.length-1 do
	found = @checker_board.index(@text[a])
	if (0..9) === found
        @keygen.push(found)
	elsif (10..19) === found
        @keygen.push(@n1,found%10)
	elsif (20..29) === found
        @keygen.push(@n2,found%10)
	else
        @keygen.push(@n3,found%10)
	end
end
end

def e(key,text)
self.tp(key,text)
self.keygen
print &quot;#{@keygen.to_s}\n&quot;
@t = Array.new
@keygen.each do &#124;value&#124; 
@t.push((@key[0].to_i+value.to_i)%10)
@key &lt;&lt; @key.shift
end
print &quot;#{@t.to_s}\n&quot;
print &quot;Encrypt=#{self.show}\n&quot;
end

def d(key,text)
self.tp(key,text)
self.keygen
@t = Array.new
@keygen.each do &#124;value&#124; 
@t.push((value+10-(@key[0]).to_i)%10)
@key &lt;&lt; @key.shift
end
print &quot;Decrypt=#{self.show.gsub(&#039;*&#039;,&#039; &#039;)}\n&quot;
end


def show
a = 0
result = &quot;&quot;
while a &lt; @t.length
unless @t[a] == @n1 &#124;&#124; @t[a] == @n2 &#124;&#124; @t[a] == @n3
result = result + @checker_board[@t[a]]
else
result = result + @checker_board[(@t[a] == @n1 ? 1 : @t[a] == @n2? 2:3)*10+@t[a+1]]
a+=1
end
a+=1
end
return result
end


end
board = Straddling.new(&quot;sharpen your saw&quot;,2,5,9)
puts(board.create)
board.e(&quot;2641&quot;,&quot;programming praxis&quot;)
board.d(&quot;2641&quot;,&quot;S811R53S87A18RUAS8PSSH5&quot;)
puts(&quot;\n\n&quot;)
board = Straddling.new(&quot;my secret keys&quot;,2,5,9)
puts(board.create)
board.e(&quot;241&quot;,&quot;ruby programming rocks&quot;)
board.d(&quot;241&quot;,&quot;SF5E5*5MIREESEACY45YIS5****MESE&quot;)
[/sourcecode]]]></description>
		<content:encoded><![CDATA[<p>my ruby attemp</p>
<pre class="brush: ruby;">
class Straddling 
def initialize( key, n1, n2, n3 )
   key = key+&quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;
   key = key.upcase.split(//).uniq
   @key = key;@n1 = n1;@n2 = n2;@n3 = n3
end

def create
   @board = Array.new(4)
   k = 0;prev = &quot;&quot;
   for a in 0..40 do
       if (a == @n1 || a == @n2 || a == @n3)
     	 @board[a] = &quot; &quot;
       else
         if (&quot;A&quot;..&quot;J&quot;) === prev

          @board[a] = prev == &quot;J&quot;? 0:((prev)[0]-16).chr
         else
          @board[a] = @key[k] == &quot; &quot; ? &quot;*&quot; : @key[k]
          k+=1
         end
         prev = @board[a]
       end
    end
   return @board.to_s
end


def tp(key,text)
@key = key.split(//)
@text = text.gsub(' ','*').upcase.split(//)
end

def keygen
@keygen = Array.new
@checker_board = @board.to_s.split(//)
for a in 0..@text.length-1 do
	found = @checker_board.index(@text[a])
	if (0..9) === found
        @keygen.push(found)
	elsif (10..19) === found
        @keygen.push(@n1,found%10)
	elsif (20..29) === found
        @keygen.push(@n2,found%10)
	else
        @keygen.push(@n3,found%10)
	end
end
end

def e(key,text)
self.tp(key,text)
self.keygen
print &quot;#{@keygen.to_s}\n&quot;
@t = Array.new
@keygen.each do |value| 
@t.push((@key[0].to_i+value.to_i)%10)
@key &lt;&lt; @key.shift
end
print &quot;#{@t.to_s}\n&quot;
print &quot;Encrypt=#{self.show}\n&quot;
end

def d(key,text)
self.tp(key,text)
self.keygen
@t = Array.new
@keygen.each do |value| 
@t.push((value+10-(@key[0]).to_i)%10)
@key &lt;&lt; @key.shift
end
print &quot;Decrypt=#{self.show.gsub('*',' ')}\n&quot;
end


def show
a = 0
result = &quot;&quot;
while a &lt; @t.length
unless @t[a] == @n1 || @t[a] == @n2 || @t[a] == @n3
result = result + @checker_board[@t[a]]
else
result = result + @checker_board[(@t[a] == @n1 ? 1 : @t[a] == @n2? 2:3)*10+@t[a+1]]
a+=1
end
a+=1
end
return result
end


end
board = Straddling.new(&quot;sharpen your saw&quot;,2,5,9)
puts(board.create)
board.e(&quot;2641&quot;,&quot;programming praxis&quot;)
board.d(&quot;2641&quot;,&quot;S811R53S87A18RUAS8PSSH5&quot;)
puts(&quot;\n\n&quot;)
board = Straddling.new(&quot;my secret keys&quot;,2,5,9)
puts(board.create)
board.e(&quot;241&quot;,&quot;ruby programming rocks&quot;)
board.d(&quot;241&quot;,&quot;SF5E5*5MIREESEACY45YIS5****MESE&quot;)
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Remco Niemeijer</title>
		<link>http://programmingpraxis.com/2010/01/29/straddling-checkerboard/#comment-966</link>
		<dc:creator><![CDATA[Remco Niemeijer]]></dc:creator>
		<pubDate>Fri, 29 Jan 2010 15:56:35 +0000</pubDate>
		<guid isPermaLink="false">http://programmingpraxis.com/?p=1801#comment-966</guid>
		<description><![CDATA[My Haskell solution (see http://bonsaicode.wordpress.com/2010/01/29/programming-praxis-straddling-checkerboard/ for a version with comments):

[sourcecode lang=&quot;css&quot;]
import Data.Char
import Data.List

alphabet :: String
alphabet = [&#039;A&#039;..&#039;Z&#039;] ++ &quot; &quot;

clean :: String -&gt; String
clean = filter (`elem` alphabet ++ [&#039;0&#039;..&#039;9&#039;]) . map toUpper

board :: String -&gt; [Int] -&gt; String
board key = spaces (replace =&lt;&lt; nub (clean key ++ alphabet))
    where spaces    = foldl (\a x -&gt; take x a ++ &quot;_&quot; ++ drop x a)
          replace c = c : (maybe &quot;&quot; id . lookup c $ zip alphabet
                              (map show [1..9] ++ &quot;0&quot; : repeat &quot;&quot;))

run :: (Int -&gt; Int -&gt; Int) -&gt; String -&gt; [Int] -&gt; Int -&gt; String -&gt; String
run op text ss add key = f $ show =&lt;&lt;
    zipWith (\a b -&gt; mod (op (read [a]) b) 10)
            (toIndex =&lt;&lt; clean text)
            (cycle . map digitToInt $ show add) where
    f []       = []
    f (a:xs)   = if elem (digitToInt a) ss
                 then fromIndex ([a], take 1 xs) ++ f (tail xs)
                 else fromIndex (&quot;&quot; , [a]      ) ++ f xs
    fromIndex  = maybe &quot;&quot; return . look id
    toIndex    = maybe &quot;&quot; (uncurry (++)) . look flip
    look dir k = lookup k . dir zip indices $ board key ss
    indices    = [(y, show x) &#124; y &lt;- &quot;&quot; : map show ss, x &lt;- [0..9]]

encipher :: String -&gt; Int -&gt; Int -&gt; Int -&gt; Int -&gt; String -&gt; String
encipher xs s1 s2 s3 = run (+) xs [s1, s2, s3]

decipher :: String -&gt; Int -&gt; Int -&gt; Int -&gt; Int -&gt; String -&gt; String
decipher xs s1 s2 s3 = run (-) xs [s1, s2, s3]
[/sourcecode]]]></description>
		<content:encoded><![CDATA[<p>My Haskell solution (see <a href="http://bonsaicode.wordpress.com/2010/01/29/programming-praxis-straddling-checkerboard/" rel="nofollow">http://bonsaicode.wordpress.com/2010/01/29/programming-praxis-straddling-checkerboard/</a> for a version with comments):</p>
<pre class="brush: css;">
import Data.Char
import Data.List

alphabet :: String
alphabet = ['A'..'Z'] ++ &quot; &quot;

clean :: String -&gt; String
clean = filter (`elem` alphabet ++ ['0'..'9']) . map toUpper

board :: String -&gt; [Int] -&gt; String
board key = spaces (replace =&lt;&lt; nub (clean key ++ alphabet))
    where spaces    = foldl (\a x -&gt; take x a ++ &quot;_&quot; ++ drop x a)
          replace c = c : (maybe &quot;&quot; id . lookup c $ zip alphabet
                              (map show [1..9] ++ &quot;0&quot; : repeat &quot;&quot;))

run :: (Int -&gt; Int -&gt; Int) -&gt; String -&gt; [Int] -&gt; Int -&gt; String -&gt; String
run op text ss add key = f $ show =&lt;&lt;
    zipWith (\a b -&gt; mod (op (read [a]) b) 10)
            (toIndex =&lt;&lt; clean text)
            (cycle . map digitToInt $ show add) where
    f []       = []
    f (a:xs)   = if elem (digitToInt a) ss
                 then fromIndex ([a], take 1 xs) ++ f (tail xs)
                 else fromIndex (&quot;&quot; , [a]      ) ++ f xs
    fromIndex  = maybe &quot;&quot; return . look id
    toIndex    = maybe &quot;&quot; (uncurry (++)) . look flip
    look dir k = lookup k . dir zip indices $ board key ss
    indices    = [(y, show x) | y &lt;- &quot;&quot; : map show ss, x &lt;- [0..9]]

encipher :: String -&gt; Int -&gt; Int -&gt; Int -&gt; Int -&gt; String -&gt; String
encipher xs s1 s2 s3 = run (+) xs [s1, s2, s3]

decipher :: String -&gt; Int -&gt; Int -&gt; Int -&gt; Int -&gt; String -&gt; String
decipher xs s1 s2 s3 = run (-) xs [s1, s2, s3]
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Programming Praxis &#8211; Straddling Checkerboard &#171; Bonsai Code</title>
		<link>http://programmingpraxis.com/2010/01/29/straddling-checkerboard/#comment-965</link>
		<dc:creator><![CDATA[Programming Praxis &#8211; Straddling Checkerboard &#171; Bonsai Code]]></dc:creator>
		<pubDate>Fri, 29 Jan 2010 15:56:24 +0000</pubDate>
		<guid isPermaLink="false">http://programmingpraxis.com/?p=1801#comment-965</guid>
		<description><![CDATA[[...] Praxis &#8211; Straddling&#160;Checkerboard By Remco Niemeijer  In today&#8217;s Programming Praxis problem we have to implement the straddling checkerboard cipher. Let&#8217;s get [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Praxis &#8211; Straddling&nbsp;Checkerboard By Remco Niemeijer  In today&#8217;s Programming Praxis problem we have to implement the straddling checkerboard cipher. Let&#8217;s get [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

