<?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/"
		>
<channel>
	<title>Comments on: Encrypt message using Python</title>
	<atom:link href="http://techyoyo.com/2009/08/encrypt-message-python-programming-language/feed/" rel="self" type="application/rss+xml" />
	<link>http://techyoyo.com/2009/08/encrypt-message-python-programming-language/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=encrypt-message-python-programming-language</link>
	<description>Tech for the Cool</description>
	<lastBuildDate>Thu, 28 Jul 2011 19:01:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: None</title>
		<link>http://techyoyo.com/2009/08/encrypt-message-python-programming-language/comment-page-1/#comment-5416</link>
		<dc:creator>None</dc:creator>
		<pubDate>Mon, 08 Nov 2010 14:01:40 +0000</pubDate>
		<guid isPermaLink="false">http://techyoyo.com/?p=85#comment-5416</guid>
		<description>shift = lambda txt,sft=1:&#039;&#039;.join([[ch,chr((ord(ch) - ord([&#039;A&#039;,&#039;a&#039;][ch.islower()]) + sft)%26+ord([&#039;A&#039;,&#039;a&#039;][ch.islower()]))][ch.isalpha()] for ch in txt])</description>
		<content:encoded><![CDATA[<p>shift = lambda txt,sft=1:&#8221;.join([[ch,chr((ord(ch) - ord(['A','a'][ch.islower()]) + sft)%26+ord(['A','a'][ch.islower()]))][ch.isalpha()] for ch in txt])</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Hvidberg</title>
		<link>http://techyoyo.com/2009/08/encrypt-message-python-programming-language/comment-page-1/#comment-249</link>
		<dc:creator>Martin Hvidberg</dc:creator>
		<pubDate>Sun, 17 Jan 2010 15:32:54 +0000</pubDate>
		<guid isPermaLink="false">http://techyoyo.com/?p=85#comment-249</guid>
		<description># This version handles upper- lowercase individually, and therefore correct

from string import maketrans, translate, ascii_lowercase as al, ascii_uppercase as au

def caesar(text, offset):
    strCClow = translate(text, maketrans(al, al[offset:] + al[:offset]))
    strCCupr = translate(strCClow, maketrans(au, au[offset:] + au[:offset]))
    return strCCupr</description>
		<content:encoded><![CDATA[<p># This version handles upper- lowercase individually, and therefore correct</p>
<p>from string import maketrans, translate, ascii_lowercase as al, ascii_uppercase as au</p>
<p>def caesar(text, offset):<br />
    strCClow = translate(text, maketrans(al, al[offset:] + al[:offset]))<br />
    strCCupr = translate(strCClow, maketrans(au, au[offset:] + au[:offset]))<br />
    return strCCupr</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fire</title>
		<link>http://techyoyo.com/2009/08/encrypt-message-python-programming-language/comment-page-1/#comment-63</link>
		<dc:creator>fire</dc:creator>
		<pubDate>Fri, 28 Aug 2009 19:46:23 +0000</pubDate>
		<guid isPermaLink="false">http://techyoyo.com/?p=85#comment-63</guid>
		<description>you can get this a little bit easier: ;]

from string import maketrans, translate, ascii_letters as al

def caesar(text, offset):
    return translate(text, maketrans(al, al[offset:] + al[:offset]))

print caesar(caesar(&#039;foobar&#039;, 2), -2) == &#039;foobar&#039;

hth</description>
		<content:encoded><![CDATA[<p>you can get this a little bit easier: ;]</p>
<p>from string import maketrans, translate, ascii_letters as al</p>
<p>def caesar(text, offset):<br />
    return translate(text, maketrans(al, al[offset:] + al[:offset]))</p>
<p>print caesar(caesar(&#8216;foobar&#8217;, 2), -2) == &#8216;foobar&#8217;</p>
<p>hth</p>
]]></content:encoded>
	</item>
</channel>
</rss>

