<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Cryptography on System Overlord</title><link>https://systemoverlord.com/tags/cryptography.html</link><description>Recent content in Cryptography on System Overlord</description><generator>Hugo</generator><language>en-us</language><managingEditor>david@systemoverlord.com (David Tomaschik)</managingEditor><webMaster>david@systemoverlord.com (David Tomaschik)</webMaster><lastBuildDate>Sun, 10 Apr 2016 00:00:00 +0000</lastBuildDate><atom:link href="https://systemoverlord.com/tags/cryptography/index.xml" rel="self" type="application/rss+xml"/><item><title>Ham Fisted Legislators</title><link>https://systemoverlord.com/2016/04/10/ham-fisted-legislators.html</link><pubDate>Sun, 10 Apr 2016 00:00:00 +0000</pubDate><author>david@systemoverlord.com (David Tomaschik)</author><guid>https://systemoverlord.com/2016/04/10/ham-fisted-legislators.html</guid><description>&lt;p&gt;There&amp;rsquo;s fortunately been a lot of media coverage of a typically ham-fisted
attempt to legislate technology:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.wired.com/2016/04/senates-draft-encryption-bill-privacy-nightmare/"&gt;The Senate’s Draft Encryption Bill Is ‘Ludicrous, Dangerous, Technically Illiterate’ | WIRED&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://fortune.com/2016/04/09/senate-encryption-leak-backlash/"&gt;Leak of Senate Encryption Bill Prompts Swift Backlash - Fortune&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.reuters.com/article/us-apple-encryption-legislation-idUSKCN0X52CG"&gt;Leak of Senate encryption bill prompts swift backlash | Reuters&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://reason.com/blog/2016/04/08/senates-attempt-at-encryption-bill-would"&gt;Senate’s Attempt at Encryption Bill Would Destroy the Very Idea of Cybersecurity - Hit &amp;amp; Run : Reason.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.usatoday.com/story/news/politics/2016/04/08/proposed-senate-bill-would-require-tech-companies-break-encryption/82798862/"&gt;www.usatoday.com/story/news/politics/2016/04/08/proposed-senate-bill-would-require-tech-companies-break-encryption/82798862/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For once, it&amp;rsquo;s not just been technology blogs: Fortune, Reuters, and USA Today
are among those covering the legislative failure.&lt;/p&gt;</description></item><item><title>Parameter Injection in jCryption</title><link>https://systemoverlord.com/2014/06/18/parameter-injection-in-jcryption/</link><pubDate>Wed, 18 Jun 2014 01:00:00 +0000</pubDate><author>david@systemoverlord.com (David Tomaschik)</author><guid>https://systemoverlord.com/2014/06/18/parameter-injection-in-jcryption/</guid><description>&lt;p&gt;jCryption is an open-source plugin for jQuery that is used for performing encryption on the client side that can be decrypted server side. It works by retrieving an RSA key from the server, then encrypting an AES key under the RSA key, and sending both the encrypted AES key and the RSA key to the server. This is not dissimilar to how OpenPGP encrypts data for transmission. (Though, of course, implementation details are vastly different.)&lt;/p&gt;</description></item><item><title>On the TrueCrypt Saga</title><link>https://systemoverlord.com/2014/05/30/on-the-truecrypt-saga/</link><pubDate>Fri, 30 May 2014 00:52:47 +0000</pubDate><author>david@systemoverlord.com (David Tomaschik)</author><guid>https://systemoverlord.com/2014/05/30/on-the-truecrypt-saga/</guid><description>&lt;p&gt;If you&amp;rsquo;re anywhere near the security community, you&amp;rsquo;ve probably already heard about the (supposed) &lt;a href="http://truecrypt.sourceforge.net/"&gt;end of TrueCrypt&lt;/a&gt; that inspired a &lt;a href="http://www.reddit.com/r/netsec/comments/26pz9b/truecrypt_development_has_ended_052814/"&gt;massive hunt for an explanation on Reddit&lt;/a&gt;. I&amp;rsquo;m going to drop my thoughts here, but these are all just speculation, so take them for what they&amp;rsquo;re worth (which is not much).&lt;/p&gt;
&lt;h4 id="the-facts-as-we-know-them"&gt;The Facts as We Know Them&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;TrueCrypt 7.2 dropped support for creating volumes.&lt;/strong&gt; The code was massively changed, stripping out all volume creation options.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The website was updated with terrible instructions.&lt;/strong&gt; The directions for alternatives generally point to proprietary options (BitLocker, File Vault, or, to paraphrase, &amp;ldquo;whatever you can find on Linux.&amp;rdquo;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The new version is signed with the same key&lt;/strong&gt; as previous versions. This implies whoever did the update is in possession of the key used for signing previous releases.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sourceforge doesn&amp;rsquo;t think the account was compromised&lt;/strong&gt; as posted &lt;a href="https://news.ycombinator.com/item?id=7813121"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id="popular-theories"&gt;Popular Theories&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;The author was forced to backdoor TC and chose this instead.&lt;/strong&gt; This seems to be the most popular theory, and given the Snowden revelations, it&amp;rsquo;s easy to see why. Assuming the adversary in question is the US Government, this seems awfully heavy-handed, and I&amp;rsquo;m not sure under which legal authority they would attempt to compel this participation. NSLs compel the production of business records, but don&amp;rsquo;t seem to allow them to force a backdooring. CALEA is for communications tools, TrueCrypt is used for storage at rest. Even those who refer to LavaBit are referring to warrants. First LavaBit was ordered to turn over messages, then encryption keys, but I&amp;rsquo;m not aware they were ever ordered to backdoor their software. It also seems odd that government agencies would choose to go after disk encryption, seems like communications encryption would be the bigger source of intelligence. There are those who have claimed &amp;ldquo;the government can force you to do anything&amp;rdquo;, which I suppose is true, but if we&amp;rsquo;re at the stage of &amp;ldquo;backdoor your code or we treat you as a terrorist&amp;rdquo; then the game&amp;rsquo;s already over, we&amp;rsquo;re off in &lt;a href="https://en.wikipedia.org/wiki/Stasi"&gt;Stasi&lt;/a&gt; territory, and I&amp;rsquo;m not sure that&amp;rsquo;s a world I could live in. I &lt;strong&gt;hope&lt;/strong&gt; this is not the story.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The author tired of developing it&lt;/strong&gt; and just gave up. This is a kind of odd approach, one would think they&amp;rsquo;d look for someone to hand the project to. I&amp;rsquo;m also not sure why someone who&amp;rsquo;d devoted years to developing secure encryption software would suddenly offer up terrible alternatives or otherwise deviate so strangely.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A developer was compromised.&lt;/strong&gt; While this might give access to the PGP key, I&amp;rsquo;d have thought by now we&amp;rsquo;d have some sort of communication somewhere to claim this has happened. Unless the developer is completely out of the loop as well. Why would someone use the compromise to offer up terrible alternatives as opposed to releasing backdoored binaries quietly?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Off their meds.&lt;/strong&gt; A couple of people have suggested that some sort of psychiatric problem is involved here. Actually seems a little reasonable, given the erratically written directions for alternatives, the sudden change in course, everything. Of course, there&amp;rsquo;s no evidence to support this, so it&amp;rsquo;s really just speculation.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;em&gt;I&amp;rsquo;ve turned off commenting as I think Reddit or Hacker News is a better place for such discussion, I just had a lot of thoughts I wanted to get out.&lt;/em&gt;&lt;/p&gt;</description></item><item><title>DEF CON 22 CTF Quals: Hackertool</title><link>https://systemoverlord.com/2014/05/19/def-con-22-ctf-quals-hackertool/</link><pubDate>Mon, 19 May 2014 03:32:11 +0000</pubDate><author>david@systemoverlord.com (David Tomaschik)</author><guid>https://systemoverlord.com/2014/05/19/def-con-22-ctf-quals-hackertool/</guid><description>&lt;p&gt;Hackertool was one of the &lt;code&gt;Baby&amp;rsquo;s First&lt;/code&gt; challenges in DEF CON CTF Quals this year, and provided you with a .torrent file, and asked you to download the file and MD5 it. Seems easy enough, so I knew there must be more to it. The torrent file itself was a whopping 4 MB in size, very large for a torrent file. Looking at it, we see it contains just one file, named &lt;code&gt;every_ip_address.txt&lt;/code&gt;, and the file is ~61GB in size. Hrrm, there must be an easier way than torrenting 61GB, especially at &amp;lt;1k/s.&lt;/p&gt;</description></item><item><title>Reading List for 5/9/2014</title><link>https://systemoverlord.com/2014/05/09/reading-list-for-592014/</link><pubDate>Fri, 09 May 2014 07:00:00 +0000</pubDate><author>david@systemoverlord.com (David Tomaschik)</author><guid>https://systemoverlord.com/2014/05/09/reading-list-for-592014/</guid><description>&lt;p&gt;###On XTS Mode for Disk Encryption
Thomas Ptacek writes &lt;a href="http://sockpuppet.org/blog/2014/04/30/you-dont-want-xts/"&gt;You Don&amp;rsquo;t Want XTS&lt;/a&gt;, and suggests that though XTS works well enough in practice, it is far from ideal for Full Disk Encryption, and should not be used at all for other encryption operations (i.e., anything that doesn&amp;rsquo;t resemble FDE). XTS is useful only in that it makes &amp;ldquo;random access&amp;rdquo; encryption more secure, as you need for a disk. For encryption of whole blocks of data at rest, you probably want CBC mode, and for anything on the wire, AES-GCM is the new hotness.&lt;/p&gt;</description></item><item><title>PlaidCTF 2014: mtpox</title><link>https://systemoverlord.com/2014/04/14/plaidctf-mtpox/</link><pubDate>Mon, 14 Apr 2014 05:13:12 +0000</pubDate><author>david@systemoverlord.com (David Tomaschik)</author><guid>https://systemoverlord.com/2014/04/14/plaidctf-mtpox/</guid><description>&lt;p&gt;&lt;strong&gt;150 Point Web Challenge&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The Plague has traveled back in time to create a cryptocurrency before Satoshi does in an attempt to quickly gain the resources required for his empire. As you step out of your time machine, you learn his exchange has stopped trades, due to some sort of bug. However, if you could break into the database and show a different story of where the coins went, we might be able to stop The Plague.&lt;/p&gt;</description></item><item><title>Weekly Reading List for 2/1/14</title><link>https://systemoverlord.com/2014/02/01/weekly-reading-list-for-2114/</link><pubDate>Sat, 01 Feb 2014 08:00:00 +0000</pubDate><author>david@systemoverlord.com (David Tomaschik)</author><guid>https://systemoverlord.com/2014/02/01/weekly-reading-list-for-2114/</guid><description>&lt;h4 id="previews-for-bsides-sf-2014"&gt;Previews for BSides SF 2014&lt;/h4&gt;
&lt;p&gt;A couple of new articles have been posted with previews of this year&amp;rsquo;s BSides San Francisco. Akamai has a &lt;a href="https://blogs.akamai.com/2014/01/a-preview-of-bsidessf.html"&gt;preview of several talks&lt;/a&gt; and Tripwire previews a &lt;a href="http://www.tripwire.com/state-of-security/vulnerability-management/bsidessf-preview-day-life-security-researcher/"&gt;day in the life of an information security researcher&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id="application-whitelist-bypass"&gt;Application Whitelist Bypass&lt;/h4&gt;
&lt;p&gt;@infosecsmith2 guest posts over at Room362 about using &lt;a href="http://www.room362.com/blog/2014/01/16/application-whitelist-bypass-using-ieexec-dot-exe/"&gt;IEexec.exe to bypass application whitelisting&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id="custom-wordlists"&gt;Custom Wordlists&lt;/h4&gt;
&lt;p&gt;Chief Monkey over at IT Security Toolbox &lt;a href="http://it.toolbox.com/blogs/securitymonkey/from-the-toolkit-create-your-own-wordlists-from-anything-58748"&gt;reports on a tool called SmeegeScrape&lt;/a&gt; that allows you to build a wordlist from the contents of a system. He reports on it in the context of a forensics task, but it seems like it would be a great option for penetration testing as well.&lt;/p&gt;</description></item><item><title>Ghost in the Shellcode 2014: Radioactive</title><link>https://systemoverlord.com/2014/01/19/ghost-in-the-shellcode-2014-radioactive/</link><pubDate>Sun, 19 Jan 2014 20:21:46 +0000</pubDate><author>david@systemoverlord.com (David Tomaschik)</author><guid>https://systemoverlord.com/2014/01/19/ghost-in-the-shellcode-2014-radioactive/</guid><description>&lt;p&gt;Radioactive was a crypto challenge that executed arbitrary python code, if you could apply a correct cryptographic tag. Source was provided, and the handler is below:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#!python
class RadioactiveHandler(SocketServer.BaseRequestHandler):
 def handle(self):
 key = open(&amp;quot;secret&amp;quot;, &amp;quot;rb&amp;quot;).read()
 cipher = AES.new(key, AES.MODE_ECB)

 self.request.send(&amp;quot;Waiting for command:\n&amp;quot;)
 tag, command = self.request.recv(1024).strip().split(':')
 command = binascii.a2b_base64(command)
 pad = &amp;quot;\x00&amp;quot; * (16 - (len(command) % 16))
 command += pad

 blocks = [command[x:x+16] for x in xrange(0, len(command), 16)]
 cts = [str_to_bytes(cipher.encrypt(block)) for block in blocks]
 for block in cts:
 print ''.join(chr(x) for x in block).encode('hex')

 command = command[:-len(pad)]

 t = reduce(lambda x, y: [xx^yy for xx, yy in zip(x, y)], cts)
 t = ''.join([chr(x) for x in t]).encode('hex')

 match = True
 print tag, t
 for i, j in zip(tag, t):
 if i != j:
 match = False

 del key
 del cipher

 if not match:
 self.request.send(&amp;quot;Checks failed!\n&amp;quot;)
 eval(compile(command, &amp;quot;script&amp;quot;, &amp;quot;exec&amp;quot;))

 return
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So, it looks for a tag:command pair, where the tag is hex-encoded and the command is base64 encode. The command must be valid python, passed through compile and eval, so you&amp;rsquo;ll need to send a response back to yourself via self.request.send.&lt;/p&gt;</description></item><item><title>PlaidCTF Compression</title><link>https://systemoverlord.com/2013/04/30/plaidctf-compression/</link><pubDate>Tue, 30 Apr 2013 05:26:20 +0000</pubDate><author>david@systemoverlord.com (David Tomaschik)</author><guid>https://systemoverlord.com/2013/04/30/plaidctf-compression/</guid><description>&lt;p&gt;PlaidCTF 2013 had a level called "Compression". Here's the provided code for
this level:&lt;/p&gt;
&lt;div class="geshifilter"&gt;&lt;div class="python geshifilter-python" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;&lt;span style="color: #808080; font-style: italic;"&gt;#!/usr/bin/python&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;os&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;struct&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;SocketServer&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;zlib&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;from&lt;/span&gt; Crypto.&lt;span style="color: black;"&gt;Cipher&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; AES
&lt;span style="color: #ff7700;font-weight:bold;"&gt;from&lt;/span&gt; Crypto.&lt;span style="color: black;"&gt;Util&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; Counter
 
&lt;span style="color: #808080; font-style: italic;"&gt;# Not the real keys!&lt;/span&gt;
ENCRYPT_KEY &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; &lt;span style="color: #483d8b;"&gt;'0000000000000000000000000000000000000000000000000000000000000000'&lt;/span&gt;.&lt;span style="color: black;"&gt;decode&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'hex'&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;# Determine this key.&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;# Character set: lowercase letters and underscore&lt;/span&gt;
PROBLEM_KEY &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; &lt;span style="color: #483d8b;"&gt;'XXXXXXXXXXXXXXXXXXXX'&lt;/span&gt;
 
&lt;span style="color: #ff7700;font-weight:bold;"&gt;def&lt;/span&gt; encrypt&lt;span style="color: black;"&gt;(&lt;/span&gt;data&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; ctr&lt;span style="color: black;"&gt;)&lt;/span&gt;:
    aes &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; AES.&lt;span style="color: #dc143c;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;ENCRYPT_KEY&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; AES.&lt;span style="color: black;"&gt;MODE_CTR&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; counter&lt;span style="color: #66cc66;"&gt;=&lt;/span&gt;ctr&lt;span style="color: black;"&gt;)&lt;/span&gt;
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;return&lt;/span&gt; aes.&lt;span style="color: black;"&gt;encrypt&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #dc143c;"&gt;zlib&lt;/span&gt;.&lt;span style="color: black;"&gt;compress&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;data&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;
 
&lt;span style="color: #ff7700;font-weight:bold;"&gt;class&lt;/span&gt; ProblemHandler&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #dc143c;"&gt;SocketServer&lt;/span&gt;.&lt;span style="color: black;"&gt;StreamRequestHandler&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;:
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;def&lt;/span&gt; handle&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #008000;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;:
        nonce &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;os&lt;/span&gt;.&lt;span style="color: black;"&gt;urandom&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500;"&gt;8&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;
        &lt;span style="color: #008000;"&gt;self&lt;/span&gt;.&lt;span style="color: black;"&gt;wfile&lt;/span&gt;.&lt;span style="color: black;"&gt;write&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;nonce&lt;span style="color: black;"&gt;)&lt;/span&gt;
        ctr &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; Counter.&lt;span style="color: #dc143c;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500;"&gt;64&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; prefix&lt;span style="color: #66cc66;"&gt;=&lt;/span&gt;nonce&lt;span style="color: black;"&gt;)&lt;/span&gt;
        &lt;span style="color: #ff7700;font-weight:bold;"&gt;while&lt;/span&gt; &lt;span style="color: #008000;"&gt;True&lt;/span&gt;:
            data &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; &lt;span style="color: #008000;"&gt;self&lt;/span&gt;.&lt;span style="color: black;"&gt;rfile&lt;/span&gt;.&lt;span style="color: black;"&gt;read&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500;"&gt;4&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;
            &lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;not&lt;/span&gt; data:
                &lt;span style="color: #ff7700;font-weight:bold;"&gt;break&lt;/span&gt;
 
            &lt;span style="color: #ff7700;font-weight:bold;"&gt;try&lt;/span&gt;:
                length &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;struct&lt;/span&gt;.&lt;span style="color: black;"&gt;unpack&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'I'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; data&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;[&lt;/span&gt;&lt;span style="color: #ff4500;"&gt;0&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt;
                &lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; length &lt;span style="color: #66cc66;"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500;"&gt;1&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style="color: #ff4500;"&gt;20&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;:
                    &lt;span style="color: #ff7700;font-weight:bold;"&gt;break&lt;/span&gt;
                data &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; &lt;span style="color: #008000;"&gt;self&lt;/span&gt;.&lt;span style="color: black;"&gt;rfile&lt;/span&gt;.&lt;span style="color: black;"&gt;read&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;length&lt;span style="color: black;"&gt;)&lt;/span&gt;
                data +&lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; PROBLEM_KEY
                ciphertext &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; encrypt&lt;span style="color: black;"&gt;(&lt;/span&gt;data&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; ctr&lt;span style="color: black;"&gt;)&lt;/span&gt;
                &lt;span style="color: #008000;"&gt;self&lt;/span&gt;.&lt;span style="color: black;"&gt;wfile&lt;/span&gt;.&lt;span style="color: black;"&gt;write&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #dc143c;"&gt;struct&lt;/span&gt;.&lt;span style="color: black;"&gt;pack&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'I'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; &lt;span style="color: #008000;"&gt;len&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;ciphertext&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;
                &lt;span style="color: #008000;"&gt;self&lt;/span&gt;.&lt;span style="color: black;"&gt;wfile&lt;/span&gt;.&lt;span style="color: black;"&gt;write&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;ciphertext&lt;span style="color: black;"&gt;)&lt;/span&gt;
            &lt;span style="color: #ff7700;font-weight:bold;"&gt;except&lt;/span&gt;:
                &lt;span style="color: #ff7700;font-weight:bold;"&gt;break&lt;/span&gt;
 
&lt;span style="color: #ff7700;font-weight:bold;"&gt;class&lt;/span&gt; ReusableTCPServer&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #dc143c;"&gt;SocketServer&lt;/span&gt;.&lt;span style="color: black;"&gt;ForkingMixIn&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;SocketServer&lt;/span&gt;.&lt;span style="color: black;"&gt;TCPServer&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;:
    allow_reuse_address &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; &lt;span style="color: #008000;"&gt;True&lt;/span&gt;
 
&lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; __name__ &lt;span style="color: #66cc66;"&gt;==&lt;/span&gt; &lt;span style="color: #483d8b;"&gt;'__main__'&lt;/span&gt;:
    HOST &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; &lt;span style="color: #483d8b;"&gt;'0.0.0.0'&lt;/span&gt;
    PORT &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500;"&gt;4433&lt;/span&gt;
    &lt;span style="color: #dc143c;"&gt;SocketServer&lt;/span&gt;.&lt;span style="color: black;"&gt;TCPServer&lt;/span&gt;.&lt;span style="color: black;"&gt;allow_reuse_address&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; &lt;span style="color: #008000;"&gt;True&lt;/span&gt;
    server &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; ReusableTCPServer&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;HOST&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; PORT&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; ProblemHandler&lt;span style="color: black;"&gt;)&lt;/span&gt;
    server.&lt;span style="color: black;"&gt;serve_forever&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; So there's a few interesting things of note here:
&lt;/p&gt;</description></item></channel></rss>