<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	     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:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>encryption &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/encryption/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Tue, 03 Mar 2026 11:28:41 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>encryption &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[It is 1939 and you want to use public-key cryptography]]></title>
		<link>https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/</link>
					<comments>https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Sun, 13 Jul 2025 11:34:08 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[encryption]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=61738</guid>

					<description><![CDATA[Imagine, just for a moment, that a mathematical breakthrough had occurred on the eve of the second World War. Perhaps Turing or Rejewski or Driscoll realised that prime number theory held the key to unbreakable encryption. This blog post attempts to answer the question &#34;could public-key cryptography have been used in 1939?&#34;  Let&#039;s briefly step back into history.  The Enigma machine represented…]]></description>
										<content:encoded><![CDATA[<p>Imagine, just for a moment, that a mathematical breakthrough had occurred on the eve of the second World War. Perhaps Turing or Rejewski or Driscoll realised that prime number theory held the key to unbreakable encryption. This blog post attempts to answer the question "could public-key cryptography have been used in 1939?"</p>

<p>Let's briefly step back into history.</p>

<p>The Enigma machine represented the most powerful form of convenient cryptography available in the early 20th century.  There were only two practical ways to crack its encryption.</p>

<ol>
<li>Capture a codebook with the encryption keys printed in it<sup id="fnref:u571"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fn:u571" class="footnote-ref" title="As seen in the historically &quot;accurate&quot; film &quot;U571&quot;." role="doc-noteref">0</a></sup>.</li>
<li>Literally invent the computer<sup id="fnref:game"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fn:game" class="footnote-ref" title="As seen in the historically &quot;accurate&quot; film &quot;The Imitation Game&quot;." role="doc-noteref">1</a></sup>.</li>
</ol>

<p>The basis of Enigma is <em>conceptually</em> simple. You want to write a character. You follow a complex sequence of instructions and get the resulting encrypted character. You want to write the next character, so you follow the same instructions for the first which then <em>changes the sequence of instructions</em> for the next character. And so on. Every character you type changes the algorithm for the next character.  Fiendish!</p>

<p>You <em>could</em> encrypt an Enigma message by hand. But it would be tiresome, error-prone, and take ages. So a machine was invented to do the hard work. A series of cogs and wheels and wires and lights.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2025/07/Enigma_crittografia_-_Museo_scienza_e_tecnologia_Milano.jpg" alt="The Enigma machine. A typewriter with a complex mechanical set of rotors and electrical wiring. Photo by Museo Nazionale Scienza e Tecnologia Leonardo da Vinci. CC BY-SA." width="960" height="1047" class="aligncenter size-full wp-image-61757">

<p>One of the weaknesses of Enigma is that it used <em>symmetric</em> encryption. The password used to scramble the message was the same as the one used to descramble it.  Each day the codes changed, so they were printed in a handy codebook which was distributed to each operator.  If someone captured the codebook, they could decrypt all sent and received messages.</p>

<p>Decades after the war, <em>asymmetric</em> cryptography was invented<sup id="fnref:history"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fn:history" class="footnote-ref" title="As seen in the historically &quot;accurate&quot; film By either the Brits or the Americans depending on whose history you think is accurate." role="doc-noteref">2</a></sup>.  The magic of asymmetric encryption is that it allows you to have one password to scramble the message and a <em>totally different</em> one to unscramble it.  This completely obliterates the risk of your codebooks being discovered; you can have a "public key" for encryption.  Anyone with that key can encrypt a message, but not decrypt it.  You have a private key for decryption which you guard with your life.</p>

<p>Asymmetric encryption powers the modern world. It is made possible by high-speed computer chips which can precisely perform mind-boggling calculations in microseconds.</p>

<p>Let us slip into an <em>alternate</em> timeline. The mathematics behind asymmetric encryption are conceptually simple - even if they are exceedingly difficult to execute without a computer.  If the mathematicians of the day had made the necessary intellectual breakthroughs, could public-key encryption have worked in WW2?</p>

<p>I'm going to work through the following problem to prove that it was <em>just about</em> possible<sup id="fnref:ed"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fn:ed" class="footnote-ref" title="With huge thanks to my gang of unpaid editors, including Colin and Liz. Any mistakes, errors, and typos are my responsibility." role="doc-noteref">3</a></sup>.</p>

<ol start="0">
<li>Could a public / private keypair have been calculated in the 1930s?</li>
<li>Is it possible to use paper-and-pencil to encrypt a message using a very short public key?</li>
<li>Would it have been possible to build a machine to encrypt using longer public keys?</li>
<li>What key length would have prevented the private key being cracked by brute-force?</li>
</ol>

<p>Let's take a look at the last question first.</p>

<p></p><nav role="doc-toc"><menu><li><h2 id="table-of-contents"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#table-of-contents">Table of Contents</a></h2><menu><li><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#why-brute-force">Why brute force?</a></li><li><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#generating-a-keypair">Generating a Keypair</a><menu><li><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#what-is-a-keypair">What is a keypair?</a></li><li><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#calculating-a-keypair">Calculating a keypair</a></li></menu></li><li><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#lets-encrypt">Let's Encrypt!</a></li><li><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#lets-decrypt">Let's Decrypt!</a></li><li><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#the-land-of-big-numbers">The Land of Big Numbers</a><menu><li><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#manual-decryption">Manual decryption</a></li></menu></li><li><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#the-benefits-of-symmetric-encryption">The Benefits of Symmetric Encryption</a><menu><li><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#a-brief-look-into-key-exchange">A brief look into key exchange</a></li></menu></li><li><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#would-a-machine-have-helped">Would a machine have helped?</a></li><li><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#so-it-is-possible">So it is possible?</a></li></menu></li></menu></nav><p></p>

<h2 id="why-brute-force"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#why-brute-force">Why brute force?</a></h2>

<p>The original machines used to crack Enigma used brute-force; trying every possible combination until they discovered the right one. That's not <em>strictly</em> true - a large part of cryptanalysis was understanding the statistics behind the encryption algorithm, the likely content of messages, and common phrases that they contained.</p>

<p>Modern encryption algorithms are resistant to most of those statistical attacks. So the only feasible method of cracking a private key is by trying each combination sequentially.</p>

<p>Let's suppose there's a very short private key - for example just 4 bits long. There are 2<sup>4</sup> possible combinations; 16 in total. It seems reasonable to suppose that, if the message can be easily decrypted by the intended recipient, it could easily be cracked by someone able to try 16 different key combinations.</p>

<p>For every bit of length added to the key, the number of combinations doubles. 2<sup>4</sup>=16. 2<sup>5</sup>=32. 2<sup>6</sup>=64.  Once you get the 2<sup>32</sup>, you're at 4 <em>billion</em> combinations<sup id="fnref:bits"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fn:bits" class="footnote-ref" title="By contrast, the Enigma had about 67 bits of complexity, resulting in approximately 158 quintillion combinations. Hence the need for cryptanalysis rather than just brute force!" role="doc-noteref">4</a></sup>. Trying one combination per second would take over 120 years to complete.</p>

<p>Of course, manually using a 32 bit key might be too complex for the technology of the day. So a shorter key might be easier to use while still retaining sufficient strength.  How difficult is it to manually encipher and decipher messages with short keys?</p>

<p>Let's go back to question 0.</p>

<h2 id="generating-a-keypair"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#generating-a-keypair">Generating a Keypair</a></h2>

<p>How do we generate an asymmetric keypair? Remember, no computers allowed<sup id="fnref:computers"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fn:computers" class="footnote-ref" title="Well, OK, you could have a staff of several women who were called computers." role="doc-noteref">5</a></sup>!</p>

<h3 id="what-is-a-keypair"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#what-is-a-keypair">What is a keypair?</a></h3>

<p>Briefly and incorrectly put, keys are based on prime factors.</p>

<p>Multiply these two prime numbers: 29 and 113.</p>

<p>You can easily do that on paper or on a pocket calculator. It is trivial.  But suppose I asked you to reverse the equation? Find out which two prime numbers are multiplied to give the number 40,133.  That's much harder. For larger numbers, it is <a href="https://en.wikipedia.org/wiki/Integer_factorization">even harder than you think</a>.</p>

<h3 id="calculating-a-keypair"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#calculating-a-keypair">Calculating a keypair</a></h3>

<p>Mathematically, it is relatively simple. You need to know the following concepts:</p>

<ul>
<li>What is a prime number? (A number divisible by nothing other than itself and 1. For example, 13.)</li>
<li>What is a coprime? (Another number with no common factors to the first<sup id="fnref:coprime"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fn:coprime" class="footnote-ref" title="Confusingly, a co-prime doesn't have to be a prime number." role="doc-noteref">6</a></sup>. For example, the number 13 has a coprime of 9.)</li>
<li>What is a modular inverse? (When the Prime is multiplied by Coprime, then divided by the modular inverse, the remainder is 1.)</li>
</ul>

<p>You can <a href="https://www.teach.cs.toronto.edu/~csc110y/fall/notes/08-cryptography/05-rsa-cryptosystem-implementation.html">follow along with this Python example</a>, but the steps are simple enough to do by hand using sufficiently small numbers.</p>

<p><a href="https://www.baeldung.com/cs/prime-numbers-cryptography">Here's the algorithm</a>:</p>

<ul>
<li>Pick two prime numbers, 𝒑 and 𝒒</li>
<li>Multiply them to get 𝒏</li>
<li>Calculate  (𝒑-1) × (𝒒-1) to get ϕ(𝒏)</li>
<li>Pick a coprime of ϕ(𝒏) to get 𝒆

<ul>
<li>Any coprime can be randomly selected, although <a href="https://eprint.iacr.org/2020/1059.pdf">there are some choices which are bad</a>.</li>
</ul></li>
<li>Calculate 𝒅 where 𝒅 × 𝒆 = 1 (mod ϕ(𝒏))</li>
<li>The private key consists of 𝒏 and 𝒅</li>
<li>The public key consists of 𝒏 and 𝒆</li>
</ul>

<p>Let's do that with two small prime numbers 17 and 61. They are sufficiently small to be calculated by hand<sup id="fnref:small"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fn:small" class="footnote-ref" title="By the end of the 19th century, all prime numbers up to 1 billion had been discovered - that's around 50 million different primes. Far fewer combinations than the Enigma, but still a formidable…" role="doc-noteref">7</a></sup>.</p>

<ul>
<li>𝒏 = 17 × 61 = 1037</li>
<li>ϕ(𝒏) = 16 × 60 = 960</li>
<li>𝒆 = 77 (Chosen randomly)</li>
<li>𝒅 = 773 (Calculated using the Extended Euclidean Algorithm, which was <a href="https://rjlipton.com/2016/08/28/descending-proofs-into-algorithms/">first described in 1740</a>)</li>
</ul>

<p>Here's how calculating 𝒅 works. This isn't intended to be a complete explanation of how the algorithm works, but it is sufficient to show that generating keypairs would have been well within the grasp of mathematicians of the 1930s. Feel free to <a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#lets-encrypt">skip to the next section</a>.</p>

<table>
<thead>
<tr>
  <th align="center">Step</th>
  <th align="center">ri−2</th>
  <th align="center">ri−1</th>
  <th align="center">qi=⌊(ri−2)÷(ri−1)⌋</th>
  <th align="center">ri=(ri−2_−qi×(ri−1)</th>
  <th align="center">xi=(xi−2)−qi×(xi−1)</th>
  <th align="center">yi=(yi−2)−qi×(yi−1)</th>
</tr>
</thead>
<tbody>
<tr>
  <td align="center">0</td>
  <td align="center">960</td>
  <td align="center"></td>
  <td align="center"></td>
  <td align="center"></td>
  <td align="center">1</td>
  <td align="center">0</td>
</tr>
<tr>
  <td align="center">1</td>
  <td align="center">77</td>
  <td align="center"></td>
  <td align="center"></td>
  <td align="center"></td>
  <td align="center">0</td>
  <td align="center">1</td>
</tr>
<tr>
  <td align="center">2</td>
  <td align="center">960</td>
  <td align="center">77</td>
  <td align="center">960÷77=12</td>
  <td align="center">960−12×77=960−924=36</td>
  <td align="center">1−12×0=1</td>
  <td align="center">0−12×1=−12</td>
</tr>
<tr>
  <td align="center">3</td>
  <td align="center">77</td>
  <td align="center">36</td>
  <td align="center">77÷36=2</td>
  <td align="center">77−2×36=77−72=5</td>
  <td align="center">0−2×1=−2</td>
  <td align="center">1−2×(−12)=1+24=25</td>
</tr>
<tr>
  <td align="center">4</td>
  <td align="center">36</td>
  <td align="center">5</td>
  <td align="center">36÷5=7</td>
  <td align="center">36−7×5=36−35=1</td>
  <td align="center">1−7×(−2)=1+14=15</td>
  <td align="center">−12−7×25=−12−175=−187</td>
</tr>
<tr>
  <td align="center">5</td>
  <td align="center">5</td>
  <td align="center">1</td>
  <td align="center">5÷1=5</td>
  <td align="center">5−5×1=0</td>
  <td align="center">−2−5×15=−2−75=−77</td>
  <td align="center">25−5×(−187)=25+935=960</td>
</tr>
</tbody>
</table>

<p>From Step 4, we have: 1 = 15 × 960 + (−187) × 77</p>

<p>We are interested in the coefficient of 77, which is −187. This means −187 × 77 ≡ 1 (mod 960)</p>

<p>We need a positive value for d, we add ϕ(𝒏) to −187.</p>

<p>𝒅 = −187 + 960 = 773</p>

<h2 id="lets-encrypt"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#lets-encrypt">Let's Encrypt!</a></h2>

<p>We have a plaintext message (𝒎), we calculate the encrypted version (𝒄) with the formula 𝒄&nbsp;=&nbsp;𝒎<sup>𝒆</sup>&nbsp;%&nbsp;𝒏</p>

<p>Let's suppose our message starts "HELLO".  We'll give every letter a number. Our message starts with H - the eighth number of the alphabet.</p>

<p>8<sup>77</sup> % 1037  = 638</p>

<p>You can do that today on any pocket calculator. But could a competent mathematician calculate that by hand?</p>

<p>Exponentials get very large very quickly. There are some shortcuts, like <a href="https://crypto.stanford.edu/pbc/notes/numbertheory/exp.html">Modular Exponentiation</a>, but it is a fairly manual process. Doable, but not pleasant.</p>

<p>With enough time, you could manually encrypt a message like HELLO from <code>8 5 12 12 15</code> to <code>638 768 388 388 835</code>.</p>

<h2 id="lets-decrypt"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#lets-decrypt">Let's Decrypt!</a></h2>

<p>We have an encrypted version (𝒄), we calculate the plaintext message (𝒎) using the formula 𝒎&nbsp;=&nbsp;𝒄<sup>𝒅</sup>&nbsp;%&nbsp;𝒏</p>

<p>638<sup>773</sup> % 1037 = 8</p>

<p>Again, piece of cake today, but an almost insurmountable a manual grind for a pencil and paper computer.</p>

<h2 id="the-land-of-big-numbers"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#the-land-of-big-numbers">The Land of Big Numbers</a></h2>

<p>In the toy example above, we turned <code>8 5 12 12 15</code> into <code>638 768 388 388 835</code>. That's a <em>very bad</em> way of encrypting text. Working on individual letters allows for fairly trivial attacks in the form of frequency analysis.  You might not know what prime numbers were used, but you know what the most common letter in English is and which letters often come in pairs.</p>

<p>Let's pretend that a binary code like ASCII had been invented by the 1930s, giving each letter its own number<sup id="fnref:baudot"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fn:baudot" class="footnote-ref" title="This isn't too much of a stretch. The Baudot code was invented in the late 1800s. It is the binary code from which ASCII descends." role="doc-noteref">8</a></sup>. So the text translates to <code>1001000 1000101 1001100 1001100 1001111</code>  7 bits is sufficient to store 128 characters, which is good enough for text, numbers, and punctuation.</p>

<p>Smooshing those bits together gives <code>10010001000101100110010011001001111</code>, which is 19,473,311,311 in decimal.</p>

<p>But here we hit a snag! And rather an important one. Our message 𝒎 <em>must</em> be less than the key 𝒏 otherwise the maths doesn't work.  So each "chunk" that is encrypted must be less than, in this case, 1037.  In binary, 1037 is an 11 bit number - <code>10000001101</code> so let's chop the long binary string into groups of ten bit numbers<sup id="fnref:ten"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fn:ten" class="footnote-ref" title="In this example, we might still be subject to some frequency analysis issues. There are common ways to start a message which could be pre-computed." role="doc-noteref">9</a></sup>.</p>

<p><code>1001000100 0101100110 0100110010 01111</code> which, in decimal is <code>580 358 306 15</code>.</p>

<p>How easy is it to calculate 580<sup>77</sup> % 1037?</p>

<p>Well, 580<sup>77</sup> is this 213 digit number:</p>

<pre><code class="language-_">608072697981095702436950488113933187346914897948969284857902654293722732546509642998889930612690327222151182305275310987597838669368524800000000000000000000000000000000000000000000000000000000000000000000000000000
</code></pre>

<p>Erk!</p>

<p>But, using Modular Exponents as mentioned above, it is just about doable to calculate it modulo 1037, to give the answer of 287.</p>

<h3 id="manual-decryption"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#manual-decryption">Manual decryption</a></h3>

<p>The reverse starts with 287<sup>773</sup> - which is a 1,900 digit monster:</p>

<pre><code class="language-_">8764076814703289747574882682976372218202744117677541506077211396661935894880088329104690573410169261407987339892509470735016770231680618285939631509696980819464283401576517028048058993738338212389624747625283501942530083096110122657663164247353946331224458655354563571410933387843518380823303070498533169970946532897148031815166130665099650412982697122333628263892989475993249398481489331587762699843745762158170438822856768199827373555952739238985122598013870248178442111493156638843557234189706340583484083198539928533412908164601212156510176835050241254357263891198022046581958723118373933025616238122851775785374806117735760339884871872459839891658484324244684568308566814363900160248669794871064158507228968139134265889106231940693454825286506694141354013548608249280312471711991110620182847512187270642477617113287609180070026599666866308043914633111575444534093596344978016090107810671208184558268833063049379828413374691670084694302906835473338305746126263384285289946318656379558672414106052389234651640556324925755102419977400705380530065200979454412655589210213499344464257545650144053951331232875248144510526902329651434948453811412299881757959472385612984529276884875992403776906120156323972516615974836750108651889727547635267691073017967972912857552981641062535868781437285961802657794299581952590634427029261618023579258415033039194531248890027241354305598494848058858007937053616885726584609180601099791624229397351704959975692231801353195625613188074479028803108341519961929058549691769420863241680253570449204941176209229012471375228095132443055306202854239923235089133210534407289759826457721708012298751583195590595588629155245907825766955419953439709562536473174022072079161000252263007473231270835574140865544015688184196904473193955950050289022786886850214941882872222159427413174019940977015728353647777297220099220515546638682392602897440872932518693189627668062600415788447
</code></pre>

<p>There is no sensible way for a human to calculate that without mechanical or algorithmic assistance.</p>

<p>So our 1939 cryptographers are ready to pack up and go home, right?</p>

<p>Wrong! Remember, the plaintext message 𝒎 = 𝒄<sup>𝒅</sup> % 𝒏</p>

<p>For this operation, that's 287<sup>773</sup> % 1037</p>

<p>Let's turn 𝒅 into binary - decimal <code>773</code> is <code>1100000101</code> - we can now use the <a href="https://en.wikipedia.org/wiki/Exponentiation_by_squaring">"square-and-multiply" algorithm</a> to calculate the plaintext.</p>

<p>Again, you don't need to read this table and can <a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#the-benefits-of-symmetric-encryption">skip to the next section</a> - this is just to show that the calculations are possible (if somewhat convoluted).</p>

<table>
<thead>
<tr>
  <th align="center">Exponent Bit</th>
  <th align="center">base<sup>2</sup> % modulus</th>
  <th align="center">If bit is 1, result = (result * base) % modulus</th>
  <th align="right">Current base</th>
  <th align="right">Current result</th>
</tr>
</thead>
<tbody>
<tr>
  <td align="center">1</td>
  <td align="center"></td>
  <td align="center">result = (1 * 287) % 1037 = 287</td>
  <td align="right">287</td>
  <td align="right">287</td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">base = 287<sup>2</sup> % 1037</td>
  <td align="center"></td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">287<sup>2</sup> = 82369</td>
  <td align="center"></td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">82369÷1037=79, remainder 486</td>
  <td align="center"></td>
  <td align="right">486</td>
  <td align="right">287</td>
</tr>
<tr>
  <td align="center">0</td>
  <td align="center"></td>
  <td align="center">(No change to result)</td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">base = 486<sup>2</sup> % 1037</td>
  <td align="center"></td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">486<sup>2</sup>=236196</td>
  <td align="center"></td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">236196÷1037=227, remainder 177</td>
  <td align="center"></td>
  <td align="right">177</td>
  <td align="right">287</td>
</tr>
<tr>
  <td align="center">1</td>
  <td align="center"></td>
  <td align="center">result = (287 * 177) % 1037</td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">287×177=50799</td>
  <td align="center"></td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">50799÷1037=49, remainder 36</td>
  <td align="center">36</td>
  <td align="right"></td>
  <td align="right">36</td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">base = 177<sup>2</sup> % 1037</td>
  <td align="center"></td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">177<sup>2</sup>=31329</td>
  <td align="center"></td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">31329÷1037=30, remainder 219</td>
  <td align="center"></td>
  <td align="right">219</td>
  <td align="right">36</td>
</tr>
<tr>
  <td align="center">0</td>
  <td align="center"></td>
  <td align="center">(No change to result)</td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">base = 219<sup>2</sup> % 1037</td>
  <td align="center"></td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">219<sup>2</sup>=47961</td>
  <td align="center"></td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">47961÷1037=46, remainder 239</td>
  <td align="center"></td>
  <td align="right">239</td>
  <td align="right">36</td>
</tr>
<tr>
  <td align="center">0</td>
  <td align="center"></td>
  <td align="center">(No change to result)</td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">base = 239<sup>2</sup> % 1037</td>
  <td align="center"></td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">239<sup>2</sup>=57121</td>
  <td align="center"></td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">57121÷1037=55, remainder 036</td>
  <td align="center"></td>
  <td align="right">36</td>
  <td align="right">36</td>
</tr>
<tr>
  <td align="center">0</td>
  <td align="center"></td>
  <td align="center">(No change to result)</td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">base = 36<sup>2</sup> % 1037</td>
  <td align="center"></td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">36<sup>2</sup>=1296</td>
  <td align="center"></td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">1296÷1037=1, remainder 259</td>
  <td align="center"></td>
  <td align="right">259</td>
  <td align="right">36</td>
</tr>
<tr>
  <td align="center">0</td>
  <td align="center"></td>
  <td align="center">(No change to result)</td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">base = 259<sup>2</sup> % 1037</td>
  <td align="center"></td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">259<sup>2</sup>=67081</td>
  <td align="center"></td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">67081÷1037=64, remainder 789</td>
  <td align="center"></td>
  <td align="right">789</td>
  <td align="right">36</td>
</tr>
<tr>
  <td align="center">0</td>
  <td align="center"></td>
  <td align="center">(No change to result)</td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">base = 789<sup>2</sup> % 1037</td>
  <td align="center"></td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">789<sup>2</sup>=622521</td>
  <td align="center"></td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">622521÷1037=600, remainder 321</td>
  <td align="center"></td>
  <td align="right">321</td>
  <td align="right">36</td>
</tr>
<tr>
  <td align="center">1</td>
  <td align="center"></td>
  <td align="center">result = (36 * 321) % 1037</td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">36×321=11556</td>
  <td align="center"></td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">11556÷1037=11, remainder 119</td>
  <td align="center">119</td>
  <td align="right"></td>
  <td align="right">119</td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">base = 321<sup>2</sup> % 1037</td>
  <td align="center"></td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">321<sup>2</sup>=103041</td>
  <td align="center"></td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">103041÷1037=99, remainder 450</td>
  <td align="center"></td>
  <td align="right">450</td>
  <td align="right">119</td>
</tr>
<tr>
  <td align="center">1</td>
  <td align="center"></td>
  <td align="center">result = (119 * 450) % 1037</td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">119×450=53550</td>
  <td align="center"></td>
  <td align="right"></td>
  <td align="right"></td>
</tr>
<tr>
  <td align="center"></td>
  <td align="center">53550÷1037=51, remainder 580</td>
  <td align="center">580</td>
  <td align="right"></td>
  <td align="right">580</td>
</tr>
</tbody>
</table>

<p>Yeeeesh! Tedious, but absolutely doable by hand. As long as you don't make mistakes and don't fall asleep.</p>

<p>Could this be made easier? Perhaps - but let's consider whether this effort would be worth it.</p>

<h2 id="the-benefits-of-symmetric-encryption"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#the-benefits-of-symmetric-encryption">The Benefits of Symmetric Encryption</a></h2>

<p>As discussed earlier, Enigma's password let you encrypt and decrypt using the same password. That means if the password leaks, you have lost the secrecy of both your outgoing <em>and</em> incoming messages.</p>

<p>The key advantage of symmetric encryption is that it is <em>much</em> easier to use. You set today's secret, then you can send and receive with ease. You do not need to manage two separate codes.</p>

<p>Let's imagine that there is a theoretical machine which can mechanically or electronically code and decode messages. You have the public key for sending messages back to base - but what about if you want to <em>receive</em> a message?</p>

<p>You will need a private key. A key which has to be protected in exactly the same way as Enigma's codebooks.  If your private key is captured, all the messages previously sent to you can be decrypted.</p>

<p>OK, perhaps the solution is to give every machine its own unique keypair?  Well, to quote the sages, <a href="https://regex.info/blog/2006-09-15/247">now you have two problems</a>.</p>

<p>First is the complexity of managing all the public keys. You have to remember which one to use when sending information.</p>

<p>Secondly, it means that you cannot broadcast a <em>general</em> message to all recipients. If HQ wants to send a message, they need to encrypt it separately for each receiver and also broadcast it separately. That also means the receivers have to know which message is intended for them<sup id="fnref:listening"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fn:listening" class="footnote-ref" title="Yes, there are ways round this. You could start each message with a plaintext callsign, or broadcast on different frequencies, or some other differentiator. The point is that it adds complexity." role="doc-noteref">10</a></sup>.  Similarly, if a single user wants to send an encrypted message to all nearby units, they need to know who they are and separately encrypt messages to them<sup id="fnref:separate"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fn:separate" class="footnote-ref" title="Again, there are ways round this. But they mostly involve generating even more shared keys. At which point, you're almost back to symmetric encryption!" role="doc-noteref">11</a></sup>.</p>

<p>Simplicity is the main factor in making usable security <a href="https://shkspr.mobi/blog/2014/01/the-hardest-problem-in-encryption-usability/">as I've written about before</a>. Regardless of whether a machine could have done the calculations, key management is a tough problem.</p>

<h3 id="a-brief-look-into-key-exchange"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#a-brief-look-into-key-exchange">A brief look into key exchange</a></h3>

<p><a href="https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange">Diffie-Hellman key exchange</a> is a cryptographic technique which allows two or more parties to use an insecure channel to exchange enough information to create a unique public/private keypair for themselves. As with all the other maths talked about, it is conceptually simple - but rather difficult to do by hand.</p>

<p>Given the limitations of the speed of 1930s technology, it might be easier just to broadcast in plaintext "Hello! I'm station 123 and my public key is ..."  That would be a simple way of distributing your keys but has two disadvantages:</p>

<ul>
<li>The enemy can flood you with encrypted messages. You have no way to verify that they come from a legitimate source.</li>
<li>There's no way to verify who the public key is from.</li>
</ul>

<p>I'm not going to get into cryptographic signature verification because this blog post is already too long!</p>

<h2 id="would-a-machine-have-helped"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#would-a-machine-have-helped">Would a machine have helped?</a></h2>

<p>This, alas, is approaching the limits of my ignorance. I know it is possible to <a href="https://www.cs.princeton.edu/~chazelle/courses/BIB/BabbageEngine.html">build a Difference Engine out of Lego</a>.  Similarly, in the late 1930s it was possible to build a <a href="https://en.wikipedia.org/wiki/Curta">mechanical calculator</a> which was small, lightweight, and accurate.</p>

<p>There were <a href="https://arstechnica.com/information-technology/2020/05/gears-of-war-when-mechanical-analog-computers-ruled-the-waves/">massive analogue computers on battleships</a>, able to solve "20-plus variable calculus problems in real-time". At around 1,400Kg these weren't as portable as the typewriter sized Enigma - but do go some way to showing it <em>might</em> have been possible to design a mechanical computer for these equations.</p>

<h2 id="so-it-is-possible"><a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#so-it-is-possible">So it <em>is</em> possible?</a></h2>

<p>The mathematics behind public key cryptography are simple and, in my estimation, could easily have been understood by people nearly a century ago.</p>

<p>The various algorithms for simplifying the necessary calculations were neither obscure nor difficult to implement.</p>

<p>With smaller keys, it is possible to hand-calculate encryption and decryption</p>

<p>But, could it work in practice? If you had suitably trained battlefield mathematicians, it would be <em>just about</em> feasible to encrypt a message for transmission and decrypt something you've received.  You wouldn't want to do it while under fire or for any long messages or while using large prime numbers. But, <em>technically</em> it is possible to hand-calculate the encryption and decryption of public key cryptography!</p>

<p>Let's look through the steps again.</p>

<ul>
<li>Generate a public / private keypair.

<ul>
<li>Yes! Tedious for larger primes, but well within the abilities of skilled mathematicians.</li>
</ul></li>
<li>Converting a plaintext message to binary.

<ul>
<li>Yes! Baudot codes were well known, as were things like Morse code.</li>
</ul></li>
<li>Splitting a binary message into smaller chunks.

<ul>
<li>Yes! A trivial exercise on paper, but might be difficult mechanically.</li>
</ul></li>
<li>Encrypting a chunk.

<ul>
<li>Possible but difficult - especially with larger keys.</li>
</ul></li>
<li>Decrypting a chunk.

<ul>
<li>Possible but difficult - especially with larger keys.</li>
</ul></li>
<li>Creating a machine to do the difficult work.

<ul>
<li>A very cautious maybe. Large battlefield mechanical-computers existed and were precise. Given the effort that went on in Bletchley Park, I don't doubt <em>something</em> could have been created.</li>
<li>However, given the complexity of the calculations, I don't think a portable machine would have been possible.</li>
</ul></li>
<li>Key management.

<ul>
<li>A nightmare, as always.</li>
</ul></li>
</ul>

<p>Aside from the conceptual leaps required and the lack of computational power, the major problem with successfully deploying public key cryptography in 1939 is… usability!</p>

<p>The usability of security systems is often hidden from us. Managing a complex key infrastructure is a problem which <em>still</em> plagues the security industry. Despite decades of advances, we still regularly read stories about <a href="https://blog.stackademic.com/breaking-rsa-encryption-on-hardware-devices-with-side-channel-power-analysis-leaking-the-private-201374858545">"secure" microchips getting hacked for their keys</a> - I imagine it would be trivial to extract them from a mechanical computer.</p>

<p>Could public-key cryptography have been used in 1939? Possibly, but the complexity of mechanical computation would have made it impractical.</p>

<p>If you happen across a time machine with access to the mid-20th century, please pop back and let me know if I am right.</p>

<div id="footnotes" role="doc-endnotes">
<hr aria-label="Footnotes">
<ol start="0">

<li id="fn:u571">
<p>As seen in the historically "accurate" film "<a href="https://www.imdb.com/title/tt0141926/">U571</a>".&nbsp;<a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fnref:u571" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

<li id="fn:game">
<p>As seen in the historically "accurate" film "<a href="https://www.imdb.com/title/tt2084970">The Imitation Game</a>".&nbsp;<a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fnref:game" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

<li id="fn:history">
<p><del>As seen in the historically "accurate" film</del> By either the Brits or the Americans <a href="https://en.wikipedia.org/wiki/Public_key_infrastructure#History">depending on whose history you think is accurate</a>.&nbsp;<a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fnref:history" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

<li id="fn:ed">
<p>With huge thanks to my gang of unpaid editors, including <a href="https://solipsys.co.uk/">Colin</a> and Liz. Any mistakes, errors, and typos are my responsibility.&nbsp;<a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fnref:ed" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

<li id="fn:bits">
<p>By contrast, <a href="https://en.wikipedia.org/wiki/Enigma_machine#Mathematical_analysis">the Enigma had about 67 bits of complexity</a>, resulting in approximately 158 quintillion combinations. Hence the need for cryptanalysis rather than just brute force!&nbsp;<a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fnref:bits" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

<li id="fn:computers">
<p>Well, OK, you could have a staff of several <a href="https://www.sciencemuseum.org.uk/objects-and-stories/women-computing">women who were called computers</a>.&nbsp;<a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fnref:computers" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

<li id="fn:coprime">
<p>Confusingly, a co-prime doesn't have to be a prime number.&nbsp;<a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fnref:coprime" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

<li id="fn:small">
<p>By the end of the 19th century, <a href="https://arxiv.org/pdf/1810.05244">all prime numbers up to 1 billion</a> had been discovered - that's around 50 million different primes. Far fewer combinations than the Enigma, but still a formidable challenge to try and randomly guess which two had been used.&nbsp;<a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fnref:small" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

<li id="fn:baudot">
<p>This isn't too much of a stretch. The <a href="https://en.wikipedia.org/wiki/Baudot_code">Baudot code</a> was invented in the late 1800s. It is the binary code from which ASCII descends.&nbsp;<a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fnref:baudot" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

<li id="fn:ten">
<p>In this example, we might still be subject to <em>some</em> frequency analysis issues. There are common ways to start a message which could be pre-computed.&nbsp;<a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fnref:ten" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

<li id="fn:listening">
<p>Yes, there are ways round this. You could start each message with a plaintext callsign, or broadcast on different frequencies, or some other differentiator. The point is that it adds complexity.&nbsp;<a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fnref:listening" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

<li id="fn:separate">
<p>Again, there are ways round this. But they mostly involve generating even more shared keys. At which point, you're almost back to symmetric encryption!&nbsp;<a href="https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/#fnref:separate" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

</ol>
</div>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=61738&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2025/07/it-is-1939-and-you-want-to-use-public-key-cryptography/feed/</wfw:commentRss>
			<slash:comments>10</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[HTTP Signature Infinite Loop?]]></title>
		<link>https://shkspr.mobi/blog/2024/02/http-signature-infinite-loop/</link>
					<comments>https://shkspr.mobi/blog/2024/02/http-signature-infinite-loop/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Mon, 26 Feb 2024 12:34:28 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[ActivityPub]]></category>
		<category><![CDATA[CyberSecurity]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[fediverse]]></category>
		<category><![CDATA[http]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=49728</guid>

					<description><![CDATA[I&#039;m trying to get my head round HTTP Signatures as they&#039;re used extensively in the Fediverse.  Conceptually, they&#039;re relatively straightforward.  You send me a normal HTTP request. For example, you want to POST something to https://example.com/data  You send me these headers:  POST /data Host: example.com Date: Sat, 24 Feb 2024 14:43:48 GMT Accept-Encoding: gzip Digest:…]]></description>
										<content:encoded><![CDATA[<p>I'm trying to get my head round <a href="https://www.rfc-editor.org/rfc/rfc9421.html">HTTP Signatures</a> as they're used extensively in the Fediverse.</p>

<p>Conceptually, they're relatively straightforward.</p>

<p>You send me a normal HTTP request. For example, you want to POST something to <code>https://example.com/data</code></p>

<p>You send me these headers:</p>

<pre><code class="language-_">POST /data
Host: example.com
Date: Sat, 24 Feb 2024 14:43:48 GMT
Accept-Encoding: gzip
Digest: SHA-256=aaC57TDzM0Wq+50We2TkCsdMDvdqON92edg7KI+Hk8M=
Content-Type: application/activity+json
Signature: keyId="https://your_website.biz/publicKey",algorithm="rsa-sha256",headers="(request-target) host date digest content-type",signature="JGQ53kEoIiMWRp9By9jajVGCOCu4n7XBeiA1uY5xLcnAxL2Y1GIgU/...=="
Connection: Keep-Alive
Content-Length: 751
</code></pre>

<p>In order to verify the contents of the message, I need to do three things:</p>

<ol>
<li>Check the SHA-256 hash of the message matches the content of the "Digest" header.</li>
<li>Check the timestamp is somewhat fresh.</li>
<li>Check the signature matches.</li>
</ol>

<p>The first is simple: <code>base64_encode( hash( "sha256", $request_body, true ) )</code>.</p>

<p>The second is a matter of opinion. I might be happy to receive messages from the distant past or far in the future. For the sake of a little clock drift, let's allow 60 seconds either way.</p>

<p>The third gets <em>complicated</em>.</p>

<p>First, I need to get the public key published at <code>keyId="https://your_website.biz/publicKey"</code>.</p>

<p>Next, I need to know which algorithm is being used to sign the headers: <code>algorithm="rsa-sha256"</code></p>

<p>Then, I need to know which headers - and in what order - are being signed: <code>headers="(request-target) host date digest content-type"</code></p>

<p>So I create a string using the received details which matches those headers in that specific order:</p>

<pre><code class="language-_">(request-target) POST /data
Host: example.com
Date: Sat, 24 Feb 2024 14:43:48 GMT
Digest: SHA-256=aaC57TDzM0Wq+50We2TkCsdMDvdqON92edg7KI+Hk8M=
Content-Type: application/activity+json
</code></pre>

<p>I can verify if the signature - <code>signature="JGQ53kEoIiMWRp9By9jajVGCOCu4n7XBeiA1uY5xLcnAxL2Y1GIgU/...=="</code> matches by:</p>

<pre><code class="language-php">openssl_verify(
    $headersString, 
    $signature, 
    $publicKey, 
    $algorithm
);
</code></pre>

<p>If that's <code>TRUE</code> then all is well.</p>

<p>But can you spot the implicit problem?</p>

<p><em>How</em> do I get your server's public key?</p>

<p>I just GET <code>https://your_website.biz/publicKey</code> - but if your server uses something like <a href="https://docs.joinmastodon.org/admin/config/#authorized_fetch">Authorised Fetch</a> then I have to sign my request to you.</p>

<p>Which means your server will need to validate my signature by obtaining my public key. Which it will get by signing a request and sending it to me. Which, before I return my public key, I will need to validate your signature by obtaining your public key. Which I will get by signing a request... and so on.</p>

<p>This <a href="https://www.w3.org/wiki/SocialCG/ActivityPub/Authentication_Authorization#Instance_actors">deadlock loop</a> is documented. The usual way around it is either for the <em>sending</em> server to <a href="https://socialhub.activitypub.rocks/t/authorized-fetch-and-the-instance-actor/3868">use an instance-specific signature</a> which can be retrieved by an unsigned request, or to allow any unsigned request to access a user's public key.</p>

<p>I get why things happen this way - I just wish it were easier to implement!</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=49728&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2024/02/http-signature-infinite-loop/feed/</wfw:commentRss>
			<slash:comments>10</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[How to password protect a static HTML page with no JS]]></title>
		<link>https://shkspr.mobi/blog/2023/02/how-to-password-protect-a-static-html-page-with-no-js/</link>
					<comments>https://shkspr.mobi/blog/2023/02/how-to-password-protect-a-static-html-page-with-no-js/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Mon, 20 Feb 2023 12:34:34 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[HTML5]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=44999</guid>

					<description><![CDATA[I recently saw Robin Moisson&#039;s method of password protecting a statically served HTML page. It&#039;s quite neat! But it does rely on JavaScript. That got me wondering if there was a way to encrypt a static page only using CSS?  And... I think I&#039;ve done it!  I&#039;ll warn you now, this is a deeply stupid way to solve the problem.  Here&#039;s a screencast of the demo in action: …]]></description>
										<content:encoded><![CDATA[<p>I recently saw <a href="https://github.com/robinmoisson/staticrypt">Robin Moisson's method of password protecting a statically served HTML page</a>. It's quite neat! But it does rely on JavaScript. That got me wondering if there was a way to encrypt a static page only using CSS?</p>

<p>And... I think I've done it!</p>

<p>I'll warn you now, this is a <em>deeply</em> stupid way to solve the problem.</p>

<p>Here's a screencast of <a href="https://edent.codeberg.page/stupid-css-encryption/">the demo</a> in action:</p>

<p></p><div style="width: 620px;" class="wp-video"><video class="wp-video-shortcode" id="video-44999-2" width="620" height="291" preload="metadata" controls="controls"><source type="video/mp4" src="https://shkspr.mobi/blog/wp-content/uploads/2023/02/fucking-stupid-css-encryption-lol.mp4?_=2"><a href="https://shkspr.mobi/blog/wp-content/uploads/2023/02/fucking-stupid-css-encryption-lol.mp4">https://shkspr.mobi/blog/wp-content/uploads/2023/02/fucking-stupid-css-encryption-lol.mp4</a></video></div><p></p>

<p>Type the password and the page decrypts!!!!!</p>

<p>This abuses some interesting CSS features.</p>

<p>First, you can display the <code>&lt;style&gt;</code> element on the page.</p>

<pre><code class="language-html">&lt;style&gt;
   style {
      display: block;
   }
&lt;/style&gt;
</code></pre>

<p>Secondly, you can make the CSS editable by the user with <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contenteditable"><code>contenteditable</code></a></p>

<pre><code class="language-html">&lt;style contenteditable="true"&gt;...&lt;/style&gt;
</code></pre>

<p>As soon as a user types into the CSS, it is applied to the page. No need for JS.</p>

<p>So if a user types in a password...?</p>

<p>Let's step back a bit. How can we encrypt text using CSS?  I know... WEBFONTS!</p>

<p>A WOFF2 webfont is a Brotli compressed file. If I've <a href="https://www.rfc-editor.org/rfc/rfc7932#section-11.3">read the spec correctly</a> (LOL!) removing a chunk of a small file should render the file too damaged to read.</p>

<p>It's possible to convert the WOFF2 into Base64 and use it in the CSS:</p>

<pre><code class="language-css">@font-face {
   font-family:'encrypt_sans';
   src:url('data:application/font-woff2;charset=utf-8;base64,d09GMg...') format('woff2');
}
</code></pre>

<p>Cut a chunk out of the middle of that font, and use that missing piece as the password.  Foolproof!</p>

<p>But - I hear you say - how to encrypt text using a font?  Well, that's easy!</p>

<p>That cleverclogs <a href="https://eligrey.com/blog/rot13-dejavu-fonts/">Eli Grey has a font which encrypts text</a>.  It's magical. Well, OK, it's ROT13.  Obviously, <em>any</em> substitution cipher can probably be broken using frequency analysis.</p>

<p>Of course, it is possible to use font ligatures to obfuscate the text even more. See <a href="https://pixelambacht.nl/2015/sans-bullshit-sans/">Bullshit Sans as an example</a></p>

<p>So, there you have it. A way to <em>sort of</em> encrypt a statically served HTML file without using JavaScript.</p>

<h2 id="demo-and-source"><a href="https://shkspr.mobi/blog/2023/02/how-to-password-protect-a-static-html-page-with-no-js/#demo-and-source">Demo and Source</a></h2>

<ul>
<li><a href="https://edent.codeberg.page/stupid-css-encryption/">Demo</a></li>
<li><a href="https://codeberg.org/edent/stupid-css-encryption/">Source</a></li>
</ul>

<h2 id="possible-improvements"><a href="https://shkspr.mobi/blog/2023/02/how-to-password-protect-a-static-html-page-with-no-js/#possible-improvements">Possible Improvements</a></h2>

<p>This was a demo hastily put together while hungover one weekend. There's <em>lots</em> of room for improvement.</p>

<p>The UI abuses CSS to hide some of the boilerplate involved. It could be made to look nicer.</p>

<p>There's no way to generate an "encrypted" font. Ideally someone (not me!) would take a plaintext and generate a scrambled and ligatured font to automagically do this.</p>

<p>It is inaccessible to screen readers. The font doesn't change the underlying text.</p>

<p>Brotli compressed WOFF2 files <em>might</em> be recoverable even after substantial damage.</p>

<p>This is really <em>really</em> stupid.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=44999&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2023/02/how-to-password-protect-a-static-html-page-with-no-js/feed/</wfw:commentRss>
			<slash:comments>9</slash:comments>
		
		<enclosure url="https://shkspr.mobi/blog/wp-content/uploads/2023/02/fucking-stupid-css-encryption-lol.mp4" length="437761" type="video/mp4" />

			</item>
		<item>
		<title><![CDATA[Questions to ask before launching a crypto-payments feature]]></title>
		<link>https://shkspr.mobi/blog/2021/04/questions-to-ask-yourself-before-launching-a-crypto-payments-feature/</link>
					<comments>https://shkspr.mobi/blog/2021/04/questions-to-ask-yourself-before-launching-a-crypto-payments-feature/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Thu, 08 Apr 2021 11:23:39 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[fraud]]></category>
		<category><![CDATA[money]]></category>
		<category><![CDATA[scam]]></category>
		<category><![CDATA[signal]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=38641</guid>

					<description><![CDATA[Messaging app Signal is launching a payment service in the UK. This will allow users to send each other money cryptocurrency. Many people have written about why this is a daft idea.  But they&#039;ve mostly talked about why cryptocoins corrupt everything they touch.  I want to talk about why this is a shitty idea from a product perspective.  It all comes down to user needs. What pain point are you…]]></description>
										<content:encoded><![CDATA[<p>Messaging app Signal is launching a payment service in the UK. This will allow users to send each other <del>money</del> cryptocurrency. <a href="https://news.ycombinator.com/item?id=26713827">Many people</a> have <a href="https://www.schneier.com/blog/archives/2021/04/wtf-signal-adds-cryptocurrency-support.html">written about</a> why this is <a href="https://twitter.com/jonty/status/1379870667018006530">a</a> <a href="https://www.stephendiehl.com/blog/signal.html">daft</a> <a href="https://twitter.com/RealSexyCyborg/status/1380029032423583744">idea</a>.  But they've mostly talked about why cryptocoins corrupt everything they touch.  I want to talk about why this is a shitty idea from a <em>product</em> perspective.</p>

<p>It all comes down to <strong>user needs</strong>. What pain point are you removing?  Uber made taxis mildly less irritating, for example. But the UK already has a fairly mature mobile money market, so what does Signal add?  <a href="https://news.ycombinator.com/item?id=26714541">Here are a few obvious questions I asked them</a>:</p>

<ul>
<li>The UK already has <a href="https://www.fasterpayments.org.uk/">faster payments</a> in all major banks. I can send and receive money <em>instantly</em> from app or Web. Will Signal be as fast as that?</li>
<li>The UK has a problem with <a href="https://www.which.co.uk/consumer-rights/advice/what-to-do-if-you-re-the-victim-of-a-bank-transfer-app-scam-aED6A0l529rc">authorised push payment fraud</a>. Banks can recover funds which have been sent as a result of phishing / fraud. How can someone reverse a payment on Signal if it was fraudulent?</li>
<li>The UK also has <a href="https://www.moneysavingexpert.com/news/2020/06/confirmation-of-payee/">receiver verification</a>. If I try to send to an account and it doesn't match the name I'm sending to, my bank will warn me. How does Signal stop impersonation?</li>
<li>There's no cost to sending payments on most mainstream banks. How much does Signal charge?</li>
<li>Most banks let the user <a href="https://www.reddit.com/r/UKPersonalFinance/comments/le2rgo/i_know_this_is_not_completely_related_to_personal/">block receiving payments from specific accounts</a>. Can Signal stop harassers sending unwanted money?</li>
</ul>

<p>Those were the questions I immediately thought of with my "product" hat on. I'm sure you can think of more.</p>

<p>The responses were... not well thought through. I'll respond to each one.</p>

<blockquote><p>A: MobileCoin is as fast (or faster in some cases) than a bank payment in the UK with greater privacy. As far as settling back to Fiat, if that's what you're asking about, the velocity of that depends on on-ramp and off-ramp integrations which will come over time (but it looks like there's no reason MobileCoin can't help developers deliver payments at the same speed as banks).</p></blockquote>

<p>I've yet to see a settled crypto transaction which is as fast as a UK bank transfer. We'll come back to "privacy" later. In terms of getting real money out of the system, the answer seems to be "variable" - which doesn't sound like a great customer experience.</p>

<blockquote><p>Payments on MobileCoin cannot be reversed at the protocol level. If you want escrow and reversibility, you should use a wallet or payment service that supports those primitives. We believe that developers will build such services on top of the foundation of the MobileCoin protocol.</p></blockquote>

<p>So, no. If you get scammed, tough. Neither a bank, nor a regulator, nor a court can reverse a dodgy transaction. Where's the user need for that?</p>

<blockquote><p>Signal relies on phone numbers for identities. Other apps that integrate MobileCoin may have a higher threshold for identification.</p></blockquote>

<p>So, again, if someone pretends to be your mate and cons you out of money, there's no independent verification. I bet users just love sending money and not knowing who it is going to.</p>

<blockquote><p>Fees are set by the foundation (which has a stated goal of keeping transaction fees to around $.04 when the network isn't congested). Currently fees are higher as they need to be adjusted by a foundation vote.</p></blockquote>

<p>That's pretty high! People in the UK literally use their banking apps to message each other - <a href="https://shkspr.mobi/blog/2020/05/to-get-my-attention-pay-me/">sending penny payments to get someone's attention</a>.  What is the user getting for this proposed transaction fee?</p>

<blockquote><p>Signal doesn't allow people you haven't keypaired with to send you funds. If you have accepted a message request from someone, they can send you money.</p></blockquote>

<p>If you can't block people - even after accepting them - that's a vector for harassment, or worse.  Your psycho-ex can bombard you with micropayments. Your dodgy mate can offload his illegitimate gains into your account. It sounds like a nightmare.</p>

<p>So, I ask again, what is the use-case for this feature?  It isn't faster, it costs more, it is in a volatile cryptocurrency, it has no fraud protection, and it facilitates abuse.</p>

<p>The one thing it has going for it is that it is "anonymous".</p>

<p>Except, of course, it isn't anonymous in any real sense. You need the user's phone number - which means law enforcement can track their activity. 
While the ledger may be anonymous, if you send a unique amount of money, and it gets received instantly, it's going to be pretty easy to work out who is at either end of the transaction.</p>

<p>Perhaps there is a huge untapped desire to send expensive pseudonymous payments. Perhaps people want to pay for stuff using a speculative instrument. Perhaps everything I thought I knew about people is wrong.</p>

<p>Or, perhaps this is another pump-and-dump cryptoscam?</p>

<p><a href="https://coinmarketcap.com/currencies/mobilecoin/"><img src="https://shkspr.mobi/blog/wp-content/uploads/2021/04/Screenshot_2021-04-08-MobileCoin-price-today-MOB-live-marketcap-chart-and-info-CoinMarketCap1.png" alt="Price of the MobileCoin rapidly rising." width="1160" height="855" class="aligncenter size-full wp-image-38647"></a></p>

<p>I wonder who was "investing" in those coins <em>before</em> the big announcement?  Nothing to see here...</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=38641&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2021/04/questions-to-ask-yourself-before-launching-a-crypto-payments-feature/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[PGP Sign Your Twitter Messages]]></title>
		<link>https://shkspr.mobi/blog/2020/05/pgp-sign-your-twitter-messages/</link>
					<comments>https://shkspr.mobi/blog/2020/05/pgp-sign-your-twitter-messages/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Thu, 14 May 2020 11:01:25 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[pgp]]></category>
		<category><![CDATA[twitter]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=35060</guid>

					<description><![CDATA[I&#039;m not sure if I&#039;m the first person to do this - but I&#039;m going to claim credit anyway!  Terence Eden is on Mastodon@edentHello! This Tweet has been signed with my PGP Key. pic.x.com/ed4rcldlvw❤️ 35💬 7🔁 008:03 - Thu 14 May 2020  You can verify by pasting the alt text into keybase.io/verify - or by using your favourite command line tool.  Back in 2017, I wondered if Twitter&#039;s alt text could be (ab)…]]></description>
										<content:encoded><![CDATA[<p>I'm not sure if I'm the first person to do this - but I'm going to claim credit anyway!</p>

<blockquote class="social-embed" id="social-embed-1260843046553387009" lang="en" itemscope="" itemtype="https://schema.org/SocialMediaPosting"><header class="social-embed-header" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><a href="https://twitter.com/edent" class="social-embed-user" itemprop="url"><img class="social-embed-avatar social-embed-avatar-circle" src="data:image/webp;base64,UklGRkgBAABXRUJQVlA4IDwBAACQCACdASowADAAPrVQn0ynJCKiJyto4BaJaQAIIsx4Au9dhDqVA1i1RoRTO7nbdyy03nM5FhvV62goUj37tuxqpfpPeTBZvrJ78w0qAAD+/hVyFHvYXIrMCjny0z7wqsB9/QE08xls/AQdXJFX0adG9lISsm6kV96J5FINBFXzHwfzMCr4N6r3z5/Aa/wfEoVGX3H976she3jyS8RqJv7Jw7bOxoTSPlu4gNbfXYZ9TnbdQ0MNnMObyaRQLIu556jIj03zfJrVgqRM8GPwRoWb1M9AfzFe6Mtg13uEIqrTHmiuBpH+bTVB5EEQ3uby0C//XOAPJOFv4QV8RZDPQd517Khyba8Jlr97j2kIBJD9K3mbOHSHiQDasj6Y3forATbIg4QZHxWnCeqqMkVYfUAivuL0L/68mMnagAAA" alt="" itemprop="image"><div class="social-embed-user-names"><p class="social-embed-user-names-name" itemprop="name">Terence Eden is on Mastodon</p>@edent</div></a><img class="social-embed-logo" alt="Twitter" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0Aaria-label%3D%22Twitter%22%20role%3D%22img%22%0AviewBox%3D%220%200%20512%20512%22%3E%3Cpath%0Ad%3D%22m0%200H512V512H0%22%0Afill%3D%22%23fff%22%2F%3E%3Cpath%20fill%3D%22%231d9bf0%22%20d%3D%22m458%20140q-23%2010-45%2012%2025-15%2034-43-24%2014-50%2019a79%2079%200%2000-135%2072q-101-7-163-83a80%2080%200%200024%20106q-17%200-36-10s-3%2062%2064%2079q-19%205-36%201s15%2053%2074%2055q-50%2040-117%2033a224%20224%200%2000346-200q23-16%2040-41%22%2F%3E%3C%2Fsvg%3E"></header><section class="social-embed-text" itemprop="articleBody">Hello! This Tweet has been signed with my PGP Key. <a href="https://x.com/edent/status/1260843046553387009/photo/1">pic.x.com/ed4rcldlvw</a><div class="social-embed-media-grid"><a href="https://pbs.twimg.com/media/EX9qBYDWkAYXoRI.png" class="social-embed-media-link"><img class="social-embed-media" alt="-----BEGIN PGP MESSAGE-----owEBiQJ2/ZANAwAKAQANBfZAVXxiAaxCYgloZWxsby50eHRevPpiSGVsbG8hIFRoaXMgVHdlZXQgaGFzIGJlZW4gc2lnbmVkIHdpdGggbXkgUEdQIEtleS4KiQIzBAABCgAdFiEElXlidvK3tmz3lFI+AA0F9kBVfGIFAl68+mIACgkQAA0F9kBVfGKU+xAAvNwYDOtyC+FClbyVvJdh8Hyq7SmVBkHWijdHpyiPqvY0jAvnMkRunjwfSrG2FCmfh42FP9oT0JQMfNyXxmSKSjLzOIHwltag/QyR/hOfVfqUJW04Qwld/MdJgaAaj8bbuuwMHX1WyQJ7K+Kb6fWLKqGoJK7p5e02uuHa46ITSaybH4b1kcjGSOQkLWXOcI7kfXcD3doevjc+6tTly4+EuLxJlNBzbfrH9JaFkn2x9ScPT29t+WollLD8tDhErExgrRvimkQP+UPEk2/HWA1Z+My5miVFoDbCILMUUnL+UVWGPBeWEurht/rM6uBEDoE7MlRQPbhnbu5oqjZfFUi+AmkFDPLuel5nS2W8FCgIo24pI4CzGp4rYLBkz2HRtbzc8sBWiVoO4WeqZv06o1AgVxK0iKzvPiWvUKgmCJSpjwCX7J7Ww0zRF7Nje2fkzY8VPDrc69anDPXxa6Vxq3PESMem6QCSzev90okh8/7h6R+uWMmx7GhXhc9V6Js9klV3gvxV2IiJ1p8b4YmT3i8A9UbvqF7GVNZ+Xwe23QWtCm32Lu3HSRckBVSOTuiAIotCpClB9KXdGhDNsgjXfOUnyMzhQw4wxyRmAzdK8VVCpXUxW+OSkPM8FHTYt+2BRPGnTRkzCO/9n5WXzR0cHsjORIJCVQexgw5zYP2Rh91PQII==a0hq-----END PGP MESSAGE-----" src="data:image/webp;base64,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"></a></div></section><hr class="social-embed-hr"><footer class="social-embed-footer"><a href="https://twitter.com/edent/status/1260843046553387009"><span aria-label="35 likes" class="social-embed-meta">❤️ 35</span><span aria-label="7 replies" class="social-embed-meta">💬 7</span><span aria-label="0 reposts" class="social-embed-meta">🔁 0</span><time datetime="2020-05-14T08:03:02.000Z" itemprop="datePublished">08:03 - Thu 14 May 2020</time></a></footer></blockquote>

<p>You can verify by pasting the alt text into <a href="https://keybase.io/verify">keybase.io/verify</a> - or by using your favourite command line tool.</p>

<p>Back in 2017, <a href="https://twitter.com/edent/status/912949159090688002">I wondered if Twitter's alt text could be (ab)used to store message metadata</a> like a PGP signature. Sadly, the <a href="https://blog.twitter.com/developer/en_us/a/2016/alt-text-support-for-twitter-cards-and-the-rest-api.html">limit was 420 characters</a> per image.</p>

<p>At some point in the last few months, <a href="https://developer.twitter.com/en/docs/media/upload-media/api-reference/post-media-metadata-create">Twitter quietly upped the alt text limit to 1,000 characters per image</a>.</p>

<p><a href="https://developer.twitter.com/en/docs/media/upload-media/api-reference/post-media-metadata-create"><img src="https://shkspr.mobi/blog/wp-content/uploads/2020/05/Screenshot_2020-05-14-POST-media-metadata-create.png" alt="Twitter's documentation showing the new character limit." width="715" height="310" class="aligncenter size-full wp-image-35062"></a></p>

<p>So, if you <code>pgp --sign</code> some text, you can paste the result into the alt text field on Twitter. If I had time, I'd create a Twitter client to do this for you automagically.</p>

<p>I pointed out in 2015 that <a href="https://shkspr.mobi/blog/2015/09/pgp-encrypt-twitter-dms-with-keybase/">Twitter Direct Messages were long enough for PGP encrypted messages</a>.</p>

<p>Nowadays, Tweets can contain 280 characters in their body + 4,000 characters of image metadata - that should be more than long enough for a PGP encrypted Tweet.</p>

<p>Of course, due to the "<a href="https://shkspr.mobi/blog/2015/11/a-polite-way-to-say-ridiculously-complicated/">baroque</a>" nature of PGP, there's a fair chance I've messed this up some how!</p>

<p>(NB - alt text is really important for visually impaired users. Please don't needlessly clutter their timeline with garbage.)</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=35060&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2020/05/pgp-sign-your-twitter-messages/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[PGP Encrypt Twitter DMs with Keybase]]></title>
		<link>https://shkspr.mobi/blog/2015/09/pgp-encrypt-twitter-dms-with-keybase/</link>
					<comments>https://shkspr.mobi/blog/2015/09/pgp-encrypt-twitter-dms-with-keybase/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Fri, 04 Sep 2015 10:51:25 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[pgp]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[twitter]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=21363</guid>

					<description><![CDATA[This is a quick tutorial on how to encrypt your Twitter messages using PGP with the help of Keybase.io.  I read an article yesterday which seemed to imply that Twitter was mangling PGP encrypted messages (albeit unintentionally).  There is a minor bug in Twitter&#039;s web interface - but PGP seems to work perfectly in apps. So, I want to demonstrate how it can be done successfully.  I&#039;ve written this …]]></description>
										<content:encoded><![CDATA[<p>This is a quick tutorial on how to encrypt your Twitter messages using PGP with the help of <a href="https://Keybase.io">Keybase.io</a>.</p>

<p>I <a href="https://www.vice.com/en/article/how-to-encrypt-your-twitter-dms/">read an article yesterday which seemed to imply that Twitter was mangling PGP encrypted messages</a> (albeit <a href="https://web.archive.org/web/20200924204727/https://twitter.com/runasand/status/632225743880237056">unintentionally</a>).</p>

<p>There is a minor bug in Twitter's <strong>web</strong> interface - but PGP seems to work perfectly in apps. So, I want to demonstrate how it can be done successfully.</p>

<p>I've written this article with a non-technical audience in mind - feel free to point out any areas where I can make my explanations more simple.</p>

<h2 id="get-my-public-key"><a href="https://shkspr.mobi/blog/2015/09/pgp-encrypt-twitter-dms-with-keybase/#get-my-public-key">Get My Public Key</a></h2>

<p>Suppose you want to send me a message - but you are worried about the contents being seen by someone else.  If you encrypt the message to me, only I will be able to read it.  In order to encrypt, you need to know my <em>Public Key</em>.  This is a digital lock which only I can open.</p>

<p>The website <a href="https://Keybase.io">Keybase.io</a> contains a list of people's public keys.  You can visit <a href="https://Keybase.io/edent">Keybase.io/edent</a> to see mine.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2015/09/edent-keybase-fs8.png" alt="edent keybase-fs8" width="874" height="770" class="aligncenter size-full wp-image-21365">

<h2 id="encrypt-the-message"><a href="https://shkspr.mobi/blog/2015/09/pgp-encrypt-twitter-dms-with-keybase/#encrypt-the-message">Encrypt The Message</a></h2>

<p>Keybase gives you the option of encrypting a message to me.  Just type what you want to send and hit the "Encrypt" button.
<img src="https://shkspr.mobi/blog/wp-content/uploads/2015/09/edent-encrypt-keybase-fs8.png" alt="edent encrypt keybase-fs8" width="874" height="707" class="aligncenter size-full wp-image-21367"></p>

<p>Hey presto!  A big blob of text which can only be decrypted by me.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2015/09/edent-keybase-encrypted-text-fs8.png" alt="edent keybase encrypted text-fs8" width="874" height="770" class="aligncenter size-full wp-image-21366">

<h2 id="send-the-message"><a href="https://shkspr.mobi/blog/2015/09/pgp-encrypt-twitter-dms-with-keybase/#send-the-message">Send The Message</a></h2>

<p>It's as simple as copying the entire block of encrypted text and pasting it into a Twitter Direct Message.
<img src="https://shkspr.mobi/blog/wp-content/uploads/2015/09/edent-Twitter-pgp-fs8.png" alt="edent Twitter pgp-fs8" width="874" height="770" class="aligncenter size-full wp-image-21364"></p>

<p>Ok! Stop! There is a <em>minor</em> problem here.  In order for PGP encrypted messages to work, it is important that they are not altered in <strong>any</strong> way.  A rogue space, or missed character, will render the message completed undecipherable.</p>

<p>Some Twitter clients will "helpfully" remove line breaks.  A proper PGP message should look like this:</p>

<pre>-----BEGIN PGP MESSAGE-----
Version: Keybase OpenPGP v2.0.43
Comment: https://keybase.io/crypto

wcFMAz8xGBvPCGIHAQ//aaPuyglRhwo0hzeVuyDC8pgIGyS7f5oyp99wMRsIh8G0
i6kuo9+dPVNJ+gGLC2B5eMuoYE0Bjv/2YfBkxaJ6HTacniUEgD9x7OxNnQY2PCyi
</pre>

<p>Not like this:</p>

<pre>-----BEGIN PGP MESSAGE----- Version: Keybase OpenPGP v2.0.43 Comment: https://keybase.io/crypto  wcFMAz8xGBvPCGIHAQ//aaPuyglRhwo0hzeVuyDC8pgIGyS7f5oyp99wMRsIh8G0 i6kuo9+dPVNJ+gGLC2B5eMuoYE0Bjv/2YfBkxaJ6HTacniUEgD9x7OxNnQY2PCyi</pre>

<p>The Twitter website preserve newlines when you send a message - make sure that your app also does so.</p>

<h2 id="a-word-about-message-length"><a href="https://shkspr.mobi/blog/2015/09/pgp-encrypt-twitter-dms-with-keybase/#a-word-about-message-length">A Word About Message Length</a></h2>

<p>Twitter touts DMs as being "unlimited" - in reality, there's a limit of 10,000 characters.  PGP is a relatively efficient way of encrypting text so, depending on your message, you can fit around 9,000 plain text characters into a 10,000 character encrypted message.</p>

<p>In addition, <a href="https://support.twitter.com/articles/15364#">you may only send up to 1,000 Direct Messages per day</a>.</p>

<p>So, no DMing Harry Potter length novels!</p>

<h2 id="decrypting"><a href="https://shkspr.mobi/blog/2015/09/pgp-encrypt-twitter-dms-with-keybase/#decrypting">Decrypting</a></h2>

<p>Ok, this is where it gets a bit more technical.</p>

<p>It should be fairly easy to decrypt a message that you have been sent - but it will depend on your Twitter client.</p>

<p>When copying from a browser, it is possible that newlines will not be preserved - this may cause your decryption app to think that the message is corrupted.</p>

<p>This <em>is</em> a bug with Twitter's web and mobile-web sites.  I've reported it to them.  I think they should be encoding \n as <code>&lt;br/&gt;</code> to facilitate copying and pasting.
<img src="https://shkspr.mobi/blog/wp-content/uploads/2015/09/Twitter-PGP-no-linebreaks-fs8.png" alt="Twitter PGP no linebreaks-fs8" width="665" height="537" class="aligncenter size-full wp-image-21371"></p>

<p>I've found that copying from apps (on Android) preserves all the line breaks and keeps the formatting intact.</p>

<p><img src="https://shkspr.mobi/blog/wp-content/uploads/2015/09/OpenKeyChain-fs8.png" alt="OpenKeyChain-fs8" width="480" height="773" class="alignleft size-full wp-image-21374">On Android, I use <a href="https://www.openkeychain.org/">OpenKeyChain</a>.  I copy the message from my Twitter client and OpenKeyChain can decrypt directly from my phone's clipboard.</p>

<p>You can also use Keybase to host your private key and decrypt messages in the browser. <a href="https://github.com/keybase/keybase-issues/issues/160">This is at your own risk</a>.</p>

<p>That's really all there is to it.  I've successfully exchanged encrypted messages with several people.  The only problems have occurred when trying to copy the message from the Twitter web interface - when using apps everything has been fine.</p>

<p>Obviously, this isn't a fully automated solution (yet!) it would be great if Keybase allowed users to send encrypted DMs directly from its site - or if apps could start offering this natively.</p>

<p><a href="https://web.archive.org/web/20200915130113/https://gist.github.com/colinmahns/e3c38c5eae6c4bf6441d">Colin Mahns has written an excellent tutorial</a> for how to integrate OTR (a different encryption protocol) into messaging apps which can work with Twitter.</p>

<p>But, for now, if you want to encrypt a message to me, you can successfully do so using nothing other than a web-browser and a Twitter account.</p>

<p>Have fun!</p>

<hr style="clear:both;">

<p><ins datetime="2015-11-25T12:08:29+00:00">Update!</ins>
It's possible to send encrypted DMs directly from a website or the command line.</p>

<p>Using <a href="https://dev.twitter.com/web/intents">Twitter Web Intents</a> it's possible to send a Direct Message.  If your message starts <code>D edent</code> it will be converted into a DM to me.</p>

<p>So, if we URL Encode the message we want to send:</p>

<pre>https://twitter.com/intent/tweet?text=D%20edent%20testing</pre>

<p>We can pre-populate the compose window with the DM.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2015/09/Long-DM-PGP-fs8.png" alt="Long DM PGP-fs8" width="840" height="362" class="aligncenter size-full wp-image-22039">

<p>It <em>looks</em> like the message is too long - but the "Tweet" button works and it will be sent to the user:</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2015/09/Long-DM-PGP-Inbox-fs8.png" alt="Long DM PGP Inbox-fs8" width="789" height="231" class="aligncenter size-full wp-image-22038">

<p>Hopefully Twitter will one day make it slightly easier - but for now, at least it works!</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=21363&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2015/09/pgp-encrypt-twitter-dms-with-keybase/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[The Usability of Anti-Apartheid Encryption]]></title>
		<link>https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/</link>
					<comments>https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Tue, 03 Mar 2015 11:47:28 +0000</pubDate>
				<category><![CDATA[politics]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[encryption]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=20688</guid>

					<description><![CDATA[(An adaptation of my earlier blog post on the same topic.)  This is a case study focusing on the usability of  encryption systems as used by political dissidents in Apartheid era South Africa.  Background - South Africa  Between 1948 and 1994, the nation of South Africa was ruled by an ethnically white minority. They set in place a system of government – known as Apartheid - which suppressed, b…]]></description>
										<content:encoded><![CDATA[<p>(An adaptation of <a href="https://shkspr.mobi/blog/2014/01/the-hardest-problem-in-encryption-usability/">my earlier blog post on the same topic</a><a class="sdendnoteanc" name="sdendnote1anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote1sym"><sup>1</sup></a>.)</p>

<p>This is a case study focusing on the usability of  encryption systems as used by political dissidents in Apartheid era South Africa.</p>

<h2 id="background-south-africa"><a href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#background-south-africa">Background - South Africa</a></h2>

<p>Between 1948 and 1994, the nation of South Africa was ruled by an ethnically white minority. They set in place a system of government – known as Apartheid - which suppressed, brutalised and discriminated against other races.</p>

<p>The African National Congress (ANC) was <a href="http://www.anc.org.za/show.php?id=206">formed in the early 20th Century</a><a class="sdendnoteanc" name="sdendnote2anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote2sym"><sup>2</sup></a> with the explicit aim of bringing "all Africans together as one people to defend their rights and freedoms."
In 1960, it was outlawed by the ruling National Party<a class="sdendnoteanc" name="sdendnote3anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote3sym"><sup>3</sup></a> and was subsequently branded a terrorist organisation by many nations<a class="sdendnoteanc" name="sdendnote4anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote4sym"><sup>4</sup></a>.</p>

<p>Activists working for and on behalf of the ANC were placed under intense scrutiny by the National Party and its allies. In order to safeguard their communications, the ANC needed to develop, deploy and successfully use digital encryption.</p>

<p>The primary source of this information comes from the ANC's monthly journal "Mayibuye". In 1995 they published a series of articles on their encryption efforts, collated in a single article: "<a href="http://www.anc.org.za/show.php?id=4693">Talking To Vula</a>"<a class="sdendnoteanc" name="sdendnote5anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote5sym"><sup>5</sup></a></p>

<h2 id="lines-of-communication"><a href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#lines-of-communication">Lines of Communication</a></h2>

<p>With the ANC's leadership under extreme surveillance by a technologically superior aggressor, communications between the leadership and members were subject to interception and disruption.</p>

<blockquote><p>Poor communications had determined the shape of our struggle. It was because our fighters and cadres could not communicate with their leaders and between themselves that the underground never developed and People's War never became a reality.
"Talking To Vula"</p></blockquote>

<p>The ANC's typical method of encrypting communications in the late 1970s was by the manual use of One Time Pads (OTPs).</p>

<p>While OTPs represent a theoretically uncrackable encryption, they have two fundamental flaws :</p>

<ul>
<li> It is difficult to distribute an OTP; it wasn't until the late 1970s that key-exchange over a public channel was solved using the <a href="http://www-ee.stanford.edu/~hellman/publications/24.pdf">Diffie-Hellman Key Exchange</a><a class="sdendnoteanc" name="sdendnote6anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote6sym"><sup>6</sup></a>.</li>
<li> OTPs often suffer from unrecoverable errors introduced by flaws common in manual transcriptions<a class="sdendnoteanc" name="sdendnote7anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote7sym"><sup>7</sup></a>.</li>
</ul>

<p>Activists had to manually encipher messages - a tedious and error prone process - and then manually transcribe and decipher the messages they received.</p>

<p>The lack of digital communications required that messages be physically distributed. This increased the latency of communication to the speed of international postal services.</p>

<blockquote><p>It was always the same pattern: comrades would go back home feeling enthusiastic and begin by sending a series of messages. They soon came to realise that it was a futile activity as it took so much effort to say so very little and the responses, as few and far between as they were, contained little encouragement and advice.
</p><p>"Talking To Vula"</p></blockquote>

<p>These activists were fighting to free their country from the yoke of a repressive and racist government. Yet they found the long-winded process of protecting their communications <strong>just too hard</strong>.</p>

<p>Security <em>is</em> usability.</p>

<h2 id="operation-vula"><a href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#operation-vula">Operation Vula</a></h2>

<p>The growth of the Personal Computer industry in the 1980s made digital computing increasingly affordable. The ANC's technical committee began to research digital encryption and communication over the telephone network using modems. This was known as "Operation Vula"<a class="sdendnoteanc" name="sdendnote8anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote8sym"><sup>8</sup></a>.</p>

<p>Modern cryptographic science frowns on the sort of self-created encryption algorithms used by Operation Vula; such algorithms often contain subtle weaknesses of which their creators are unaware<a class="sdendnoteanc" name="sdendnote9anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote9sym"><sup>9</sup></a> <a class="sdendnoteanc" name="sdendnote10anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote10sym"><sup>10</sup></a>.  However, developing bespoke encryption systems was a common occurrence in the 1980s – mostly due to the United States Government forbidding the export of encryption software<a class="sdendnoteanc" name="sdendnote11anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote11sym"><sup>11</sup></a>. This meant that strong, audited encryption was not widely available to the public.</p>

<p>The introduction of computer-based encrypting revolutionised the revolutionaries so that with little effort it was suddenly possible to communicate over vast distances with (apparently) total security. Messages could be long and complex, and the latency of response times were reduced.</p>

<p>This home-made encryption flourished for several years before <a href="https://www.nelsonmandela.org/omalley/index.php/site/q/03lv03445/04lv03996/05lv04002/06lv04003.htm">it came crashing down</a><a class="sdendnoteanc" name="sdendnote12anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote12sym"><sup>12</sup></a>.</p>

<p>It failed not because of <em>technolog</em><em>ical</em> weakness - but because of <em>human</em> weakness.</p>

<h2 id="usability"><a href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#usability">Usability</a></h2>

<p>Maintaining secrecy is <strong>hard</strong>. Attaching computers to modems and loading secret codes is still a lot easier than the mind-numbing process of hand powered encryption; but it is an extra burden.</p>

<p>Individuals were careless. They knew that organising against the government could result in torture or death. Despite that, it was hard to act with 100% vigilance.</p>

<blockquote><p>The details of Vula that the regime released to the press revealed that indeed a number of important documents had fallen into their hands. It became clearer by the day that the comrades in Durban had violated all the rules of security that we had so assiduously tried to impress upon them. Data files of confidential information were kept "in clear" on disk and keywords and key books must have been easily obtainable. The minutes of an entire underground conference were quoted by police as evidence of the plot to overthrow the government.
</p><p>"Talking To Vula"</p></blockquote>

<p>These communications were not between "hacktivists" doing it for "teh lulz", lovers exchanging sexts or business people protecting their Intellectual Property. It was between freedom fighters working against a sadistic and murderous government. Failing to maintain security would not just end with their families being tortured - it could mean the disruption of an entire political movement.</p>

<p>And yet that threat still <em>was not enough</em> to keep people acting in a security-conscious manner.
"Talking to Vula" concludes with the lessons the ANC learned from running their encryption programme:</p>

<blockquote><p>Without first-class communications you cannot carry out a successful underground operation.
"Talking To Vula"</p></blockquote>

<p>"First class" does not just refer to the technology powering the system, but also the <strong>usability of the security</strong>.</p>

<h2 id="barriers"><a href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#barriers">Barriers</a></h2>

<p>We know that commonly used encryption programs often have fundamental flaws (such as the recent POODLE<a class="sdendnoteanc" name="sdendnote13anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote13sym"><sup>13</sup></a> and HeartBleed<a class="sdendnoteanc" name="sdendnote14anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote14sym"><sup>14</sup></a> vulnerabilities),  that state-based agencies have deliberately weakened encryption standards<a class="sdendnoteanc" name="sdendnote15anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote15sym"><sup>15</sup></a> and that there are theoretical attacks on cryptography using quantum computing<em><a class="sdendnoteanc" name="sdendnote16anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote16sym"><sup>16</sup></a></em>.</p>

<p>Let us assume for now that via some combination of Vernam ciphers<a class="sdendnoteanc" name="sdendnote17anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote17sym"><sup>17</sup></a> and Perfect Forward Secrecy<a class="sdendnoteanc" name="sdendnote18anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote18sym"><sup>18</sup></a> it is possible to create an encryption scheme which, if used correctly, can withstand sustained attack from determined adversaries.
 The correct use of encryption relies on, at a minimum, the following behaviours :</p>

<ul> <li> Users understanding why encryption is necessary. </li>
 <li> A provably secure way for users to generate encryption keys. </li>
 <li> Securely storing the encryption keys. </li>
 <li> Exchanging keys. </li>
 <li> Validating that the keys are trusted by the recipient. </li>
 <li> Correct enciphering of messages. </li>
 <li> Correct deciphering of messages.</li>
 <li> Validating the provenance of messages. </li>
 <li> Securely storing or destroying messages. </li>
 <li> Updating behaviours and technologies in the light of emergent threats. </li>
 </ul>

<p>If <em>any</em> of these behaviours are weak, the <em>entire</em> encryption scheme becomes vulnerable.</p>

<h2 id="the-challenge"><a href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#the-challenge">The Challenge</a></h2>

<p>Is it possible to create a system that simultaneously satisfies the conditions of desirability (the understanding of its necessity) and usability (the inability to use incorrectly)?</p>

<p>Modern systems like GPG and Keybase.io have improved on the usability of older encryption systems – but they still require the user to act in an almost perfect manner.</p>

<p>A recent high profile case illustrates that, despite the improvement of these systems, intelligent and committed users still make basic mistakes :</p>

<blockquote>
    <p><a href="http://www.telegraph.co.uk/news/uknews/crime/10276460/David-Miranda-was-carrying-password-for-secret-files-on-piece-of-paper.html">David Miranda was carrying password for secret files on piece of paper</a>
    </p><p>A journalist’s partner who was detained carrying thousands of British intelligence documents through Heathrow airport was also holding the password to an encrypted file written on a piece of paper, the government has disclosed.

</p><p>Daily Telegraph. 2013-08-30</p></blockquote>

<p>This careless attitude was present 23 years earlier, during Vula :</p>

<blockquote><p>[Ghebuza's] assistant was in the habit of moving around with Ghebuza's program and "key" disks as well as his data files. This was against all the rules though we had always suspected that some of the comrades were less than meticulous about observing them.

</p><p>"Talking To Vula"</p></blockquote>

<p>Users will seemingly do almost anything to bypass security in the name of convenience<a class="sdendnoteanc" name="sdendnote19anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote19sym"><sup>19</sup></a> <a class="sdendnoteanc" name="sdendnote20anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote20sym"><sup>20</sup></a>.  From writing down passwords<a class="sdendnoteanc" name="sdendnote21anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote21sym"><sup>21</sup></a> <a class="sdendnoteanc" name="sdendnote22anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote22sym"><sup>22</sup></a> to pointing a webcam at a VPN token<a class="sdendnoteanc" name="sdendnote23anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote23sym"><sup>23</sup></a>, these behaviours completely negate any of the protection provided.</p>

<p>Users are left with, at best, <strong>a placebo security measure</strong>.</p>

<p>A comprehensive encryption programme has to account for the fallibility of human nature.</p>

<h2 id="ubiquity-transparency"><a href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#ubiquity-transparency">Ubiquity &amp; Transparency</a></h2>

<p>Usability of encryption relies on two essential factors: Ubiquity and Transparency.</p>

<p>Until the release of the <a href="http://codebutler.com/firesheep/">Fire</a><a href="http://codebutler.com/firesheep/">s</a><a href="http://codebutler.com/firesheep/">heep software</a><a class="sdendnoteanc" name="sdendnote24anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote24sym"><sup>24</sup></a> it was assumed that websites only had to protect the login portion of their services with HTTPS.  Firesheep showed how every interaction with the site could leak login information to an observer.</p>

<p>The only way to guarantee the security of users was to ensure that <em>every single</em> interaction with the site was secured.  Ubiquitous security became a necessity.</p>

<p>Similarly, it used to be common that in order to securely access a site like Facebook or Twitter, a user had to remember to enter the URL with the "http<strong>s</strong>://" protocol, or they had to manually set an option to enable security.</p>

<p>By having the website <em>insist</em> on using HTTPS and enforcing it for all users at all times, they removed the need for the user to have to constantly check their security settings.  This mode of operation means that encryption technology does not get in the way of the user's normal use of the site.  Users do not have to undertake manual actions to enable encryption.</p>

<p>An excellent example of this can be found in <a href="https://shkspr.mobi/blog/2014/08/secure-the-police/">my research into British Police websites</a><a class="sdendnoteanc" name="sdendnote25anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote25sym"><sup>25</sup></a>.  Several forces run online crime reporting tools, enabling victims to send in details electronically.</p>

<p>Despite the obvious legal and moral need to protect such sensitive information, I discovered that 18 of the forces did not provide any website security. Six of the sites had encryption available but did <strong>not</strong> force visitors to use it.  This meant that users of the site would have to manually manipulate the URL to select a secure method of communication.</p>

<h2 id="conclusions"><a href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#conclusions">Conclusions</a></h2>

<p>Even minor transgressions in the correct use of security can offer an adversary the opportunity to penetrate a user's defences. Users have to continually protect themselves against an unending onslaught of criminals and state-backed hostiles.</p>

<blockquote><p>"Remember we only have to be lucky once. You will have to be lucky always."
</p><p>Anonymous IRA Spokesman<a class="sdendnoteanc" name="sdendnote26anc" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote26sym"><sup>26</sup></a> referring to the 1984 Brighton hotel bombing.</p></blockquote>

<p>In order to make encryption practical and to extend the benefits of secure communication to as many people as possible, we have to find ways of making users as "lucky" as possible.</p>

<p>The challenge for future security systems is to protect users from their own fallibility whilst being as unobtrusive as possible.</p>

<hr>

<div id="sdendnote1"><a class="sdendnotesym" name="sdendnote1sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote1anc">1</a>Eden, T "<a href="https://shkspr.mobi/blog/2014/01/the-hardest-problem-in-encryption-usability/"><em>The Hardest Problem In Encryption? Usability.</em></a>" (2014) Retrieved 30 December 2014.
</div>

<div id="sdendnote2"><a class="sdendnotesym" name="sdendnote2sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote2anc">2</a> <a href="http://www.anc.org.za/show.php?id=206">A brief history of the ANC</a> Retrieved 30 December 2014.
</div>

<div id="sdendnote3"><a class="sdendnotesym" name="sdendnote3sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote3anc">3</a> <a href="http://en.wikisource.org/wiki/Unlawful_Organizations_Act,_1960">The Unlawful Organizations Act</a> (No. 34 of 1960) enacted by the Parliament of South Africa.
</div>

<div id="sdendnote4"><a class="sdendnotesym" name="sdendnote4sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote4anc">4</a> <a href="http://worldnews.nbcnews.com/_news/2014/10/06/26287260-us-government-considered-nelson-mandela-a-terrorist-until-2008">US government considered Nelson Mandela a terrorist until 2008 – NBC News</a> – 7 December 2013.
</div>

<div id="sdendnote5"><a class="sdendnotesym" name="sdendnote5sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote5anc">5</a> Jenkin, T "<a href="http://www.anc.org.za/show.php?id=4693">The Story of the Secret Underground Communications Network of Operation Vula</a>&lt;"
</div>

<div id="sdendnote6"><a class="sdendnotesym" name="sdendnote6sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote6anc">6</a> Diffie, W. &amp; Hellman, M. "<a href="http://www-ee.stanford.edu/~hellman/publications/24.pdf"><em>New Directions in Cryptography</em></a>" IEEE Transactions On Information Theory, Vol. It-22, No. 6, November 1976 .
</div>

<div id="sdendnote7"><a class="sdendnotesym" name="sdendnote7sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote7anc">7</a> Wahi, Monika M. et al. "<a href="http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2409998/">Reducing Errors from the Electronic Transcription of Data Collected on Paper Forms: A Research Data Case Study.</a>" Journal of the American Medical Informatics Association : JAMIA 15.3 (2008): 386–389. PMC. Web. 14 Dec. 2014.
</div>

<div id="sdendnote8"><a class="sdendnotesym" name="sdendnote8sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote8anc">8</a> <a href="https://www.nelsonmandela.org/omalley/index.php/site/q/03lv03445/04lv03996/05lv04012/06lv04014.htm">"Documentary On Operation Vula" BBC Interviews: December 2002</a> Retrieved 30 December 2014.
</div>

<div id="sdendnote9"><a class="sdendnotesym" name="sdendnote9sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote9anc">9</a> <a href="https://www.schneier.com/blog/archives/2011/04/schneiers_law.html">"Schneier's Law" - Bruce Schneier</a> (2011) Retrieved 30 December 2014.
</div>

<div id="sdendnote10"><a class="sdendnotesym" name="sdendnote10sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote10anc">10</a> Zimmermann, P "<a href="ftp://ftp.pgpi.org/pub/pgp/7.0/docs/english/IntroToCrypto.pdf">Introduction to Cryptography</a>" Page 54
</div>

<div id="sdendnote11"><a class="sdendnotesym" name="sdendnote11sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote11anc">11</a> Roberts, E. <a href="http://cs.stanford.edu/people/eroberts/cs181/projects/export-controls/pastlaws.html">"Reevaluating Us Technology Export Controls" - Stanford University (1999)</a> Retrieved 30 December 2014.
</div>

<div id="sdendnote12"><a class="sdendnotesym" name="sdendnote12sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote12anc">12</a>  <a href="https://www.nelsonmandela.org/omalley/index.php/site/q/03lv03445/04lv03996/05lv04002/06lv04003.htm">US State Department cables on Vula unravelling</a> Retrieved 30 December 2014.
</div>

<div id="sdendnote13"><a class="sdendnotesym" name="sdendnote13sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote13anc">13</a> <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-3566">CVE-2014-3566</a> Retrieved 30 December 2014.
</div>

<div id="sdendnote14"><a class="sdendnotesym" name="sdendnote14sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote14anc">14</a> <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-0160">CVE-2014-0160</a> Retrieved 30 December 2014.
</div>

<div id="sdendnote15"><a class="sdendnotesym" name="sdendnote15sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote15anc">15</a> Hales, TC <em><a href="http://www.ams.org/notices/201402/rnoti-p190.pdf">The NSA Back Door to NIST</a> </em>Notices of the AMS Volume 61, Number 2. (2014)
</div>

<div id="sdendnote16"><a class="sdendnotesym" name="sdendnote16sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote16anc">16</a> Shor, PW <a href="http://arxiv.org/abs/quant-ph/9508027">"<em>Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer" </em></a>SIAM Journal on Computing (1997) 26:5, 1484-1509
</div>

<div id="sdendnote17"><a class="sdendnotesym" name="sdendnote17sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote17anc">17</a> Kahn, D (1996). <a href="http://www.amazon.co.uk/gp/product/B006W45D6Y/ref=as_li_tl?ie=UTF8&amp;camp=1634&amp;creative=19450&amp;creativeASIN=B006W45D6Y&amp;linkCode=as2&amp;tag=shkspr-21&amp;linkId=ARO36V7EF3VL3VTS"><em>The Codebreakers</em></a>. Macmillan. pp. 397–8. ISBN 0-684-83130-9
</div>

<div id="sdendnote18"><a class="sdendnotesym" name="sdendnote18sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote18anc">18</a> David P. Jablon. 1996. "<a href="http://doi.acm.org/10.1145/242896.242897">Strong password-only authenticated key exchange.</a>" SIGCOMM Comput. Commun. Rev. 26, 5 (October 1996), 5-26. DOI=10.1145/242896.242897
</div>

<div id="sdendnote19"><a class="sdendnotesym" name="sdendnote19sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote19anc">19</a> Gait, Jason. "<a href="http://dl.acm.org/citation.cfm?id=775403&amp;dl=ACM&amp;coll=DL&amp;CFID=482995037&amp;CFTOKEN=94524980">Easy entry: the password encryption problem.</a>" ACM SIGOPS Operating Systems Review 12.3 (1978): 54-60.
</div>

<div id="sdendnote20"><a class="sdendnotesym" name="sdendnote20sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote20anc">20</a> Adams, Anne, and Martina Angela Sasse. <a href="http://dl.acm.org/citation.cfm?id=322806">"Users are not the enemy."</a> Communications of the ACM 42.12 (1999): 40-46.
</div>

<div id="sdendnote21"><a class="sdendnotesym" name="sdendnote21sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote21anc">21</a> Zviran, Moshe, and William J. Haga. <a href="http://www.jstor.org/discover/10.2307/40398409?sid=21105989295713&amp;uid=3738032&amp;uid=2129&amp;uid=70&amp;uid=2&amp;uid=4">"Password security: an empirical study."</a> Journal of Management Information Systems (1999): 161-185.
</div>

<div id="sdendnote22"><a class="sdendnotesym" name="sdendnote22sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote22anc">22</a> Nielsen , J. <a href="http://www.nngroup.com/articles/security-and-human-factors/">"Security &amp; Human Factors"</a> Retrieved 20 December 2014 (2000)
</div>

<div id="sdendnote23"><a class="sdendnotesym" name="sdendnote23sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote23anc">23</a> <a href="https://web.archive.org/web/20041116161829/http://fob.webhop.net/">FobCam</a> Retrieved December 30, 2014.
</div>

<div id="sdendnote24"><a class="sdendnotesym" name="sdendnote24sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote24anc">24</a> Butler, E. <a href="http://codebutler.com/firesheep/?c=1">"Firesheep – codebutler"</a>  Retrieved December 30, 2014.
</div>

<div id="sdendnote25"><a class="sdendnotesym" name="sdendnote25sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote25anc">25</a> Eden, T <a href="https://shkspr.mobi/blog/2014/08/secure-the-police/">"<em>Secure The Police</em>"</a> Retrieved December 30, 2014
</div>

<div id="sdendnote26"><a class="sdendnotesym" name="sdendnote26sym" href="https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/#sdendnote26anc">26</a> Taylor, Peter (2001). <a href="http://www.amazon.co.uk/gp/product/074755806X/ref=as_li_tl?ie=UTF8&amp;camp=1634&amp;creative=19450&amp;creativeASIN=074755806X&amp;linkCode=as2&amp;tag=shkspr-21&amp;linkId=ORFLHI6JR632SBSW">"<em>Brits: The War Against the IRA</em>."</a> Bloomsbury Publishing. p. 265. ISBN 0-7475-5806-X
</div>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=20688&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2015/03/the-usability-of-anti-apartheid-encryption/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Spycatcher's Relevance in 2014]]></title>
		<link>https://shkspr.mobi/blog/2014/08/spycatchers-relevance-in-2014/</link>
					<comments>https://shkspr.mobi/blog/2014/08/spycatchers-relevance-in-2014/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Thu, 28 Aug 2014 10:35:50 +0000</pubDate>
				<category><![CDATA[politics]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[spying]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=10775</guid>

					<description><![CDATA[In 1987 MI5&#039;s former Assistant Director, Peter Wright, released his autobiography.  Spycatcher: The Candid Autobiography of a Senior Intelligence Officer.    It was immediately banned by the British Government.  Although the Internet wasn&#039;t around to facilitate its distribution, it was trivial to obtain copies imported from Australia.  As a boy, I remember seeing the publicity about it on the…]]></description>
										<content:encoded><![CDATA[<p>In 1987 MI5's former Assistant Director, Peter Wright, released his autobiography.  <a href="https://en.wikipedia.org/wiki/Spycatcher">Spycatcher: The Candid Autobiography of a Senior Intelligence Officer</a>.</p>

<p><a href="http://www.amazon.co.uk/gp/product/0670820555/ref=as_li_tl?ie=UTF8&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0670820555&amp;linkCode=as2&amp;tag=shkspr-21"><img src="https://shkspr.mobi/blog/wp-content/uploads/2014/08/Spycatcher-Cover.jpg" alt="Spycatcher Cover" width="340" height="500" class="aligncenter size-full wp-image-10776"></a></p>

<p>It was immediately banned by the British Government.  Although the Internet wasn't around to facilitate its distribution, it was trivial to obtain copies imported from Australia.  As a boy, I remember seeing the publicity about it on the news and being <em>very</em> upset that my parents had a copy!</p>

<p>In light of the recent revelations by <a href="http://www.theguardian.com/world/edward-snowden">Edward Snowden</a> and <a href="https://wikileaks.org/">Julian Assange</a>, I would have thought that the book would be enjoying somewhat of a reassurance.</p>

<p>It is not.</p>

<p>The physical book is long out of print and is <a href="http://www.amazon.co.uk/gp/product/0670820555/ref=as_li_tl?ie=UTF8&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0670820555&amp;linkCode=as2&amp;tag=shkspr-21">available second hand on Amazon.</a></p>

<p>There's a scanned and OCR'd <a href="https://openlibrary.org/works/OL4627777W/Spycatcher">copy of the eBook available on OpenLibrary</a>.  If you are to venture to the "deep web" (i.e. the 2nd page of Google results) you'll find plenty of ersatz eBook copies floating around.</p>

<p>So, what does a book about the security state in the 1950s, 60, and 70s have to do with the world today?</p>

<p>Here are some choice quotes which I found interesting.</p>

<h2 id="metadata-and-warrants"><a href="https://shkspr.mobi/blog/2014/08/spycatchers-relevance-in-2014/#metadata-and-warrants">Metadata and Warrants</a></h2>

<blockquote><p>Each major [post] sorting office and [telephone] exchange in the country had a Special Investigations Unit Room, under the control of [Major Albert] <a href="http://books.google.co.uk/books?id=njWH7cW3aLAC&amp;lpg=PT505&amp;ots=j95B_dLon2&amp;dq=albert%20%20Denman%2C%20mi5&amp;pg=PT505#v=onepage&amp;q=albert%20%20Denman,%20mi5&amp;f=false">Denman</a>, to place taps and intercept mail.
</p><p>...
</p><p>In fact, Denman was very particular about warrants. He was prepared to install a tap or intercept an address without a warrant only on the strict understanding that one was obtained as soon as possible. MI5 were, however, allowed to request a form of letter check without a warrant. We could record everything on an envelope, such as its origin and destination and the date it was sent, as long as we did not actually open it. Denman, like everyone in the Post Office who knew of the activity, was terrified in case the Post Office role in telephone and mail intercepts was discovered.
</p><p><cite>Spycatcher - page 45-46</cite></p></blockquote>

<p>Here we have a excellent argument about why <a href="http://www.wired.com/2013/06/phew-it-was-just-metadata-not-think-again/">metadata</a> is important.  Traffic analysis about which parties are communicating and can be used to build up a detailed picture of a target - even without a warrant and probable cause.</p>

<p>We also see that the security service has always been lax about the need to obtain warrants <em>before</em> intercepting communications.</p>

<p>Finally - I wonder if ISPs today are similarly terrified about their role in <a href="https://en.wikipedia.org/wiki/PRISM_%28surveillance_program%29">PRISM</a>?  With seemingly every major ISP, social network, and telecoms company now in the hands of the intelligence services, it seems the more things change the more they stay the same...</p>

<h2 id="listening-in"><a href="https://shkspr.mobi/blog/2014/08/spycatchers-relevance-in-2014/#listening-in">Listening In</a></h2>

<blockquote><p>I had spent a lot of time researching ways in which innocuous objects, like ashtrays or ornaments, could be modified to respond to sound waves when radiated with microwaves of a certain frequency. If a system could be perfected, it promised enormous advantages. The object itself would carry no transmitter or receiver, so detection would be virtually impossible. By 1956 we had successfully developed prototypes, and decided to attempt an operation against the Russian Embassy in London.
</p><p><cite>Spycatcher - page 67</cite>
</p></blockquote>

<p>While we sit here and worry whether our phones can be used to eavesdrop on us, or wonder if <a href="http://www.theguardian.com/technology/2014/aug/05/mit-crisp-packet-eavesdrop-audio-sound">an empty crisp packet can do the same</a> - the reality is that for over 60 years MI5 has had the ability to listen in to our conversations at will.</p>

<h2 id="storing-data"><a href="https://shkspr.mobi/blog/2014/08/spycatchers-relevance-in-2014/#storing-data">Storing Data</a></h2>

<blockquote><p>In 1959, a new discovery was made which resuscitated <a href="https://en.wikipedia.org/wiki/Venona_project">VENONA</a> again. GCHQ discovered that the Swedish Signals Intelligence Service had taken and stored a considerable amount of new wartime traffic, including some <a href="https://en.wikipedia.org/wiki/Main_Intelligence_Directorate_%28Russia%29">GRU</a> radio messages sent to and from London during the early years of the war. GCHQ persuaded the Swedes to relinquish their neutrality, and pass the material over for analysis.
</p><p><cite>Spycatcher - page 186</cite>
</p></blockquote>

<p>While it is natural that wartime signals should be stored, I think it's interesting that going back over ancient data with new knowledge has been a staple of spying for years.  While we may think our PGP encryption is secure now - any future attacks will render its protection useless.</p>

<p>Of course, storing data is somewhat pointless when the sheer volume of it means it overwhelms the capacity to analyse it.</p>

<blockquote><p>A joint MI6/CIA team had tunneled under the Russian sector of Berlin in February 1955, and placed taps on the central communications of the Soviet Military Command.
</p><p>The actual electrical taps were done by Post Office personnel. <strong>Both the CIA and MI6 were reeling under the sheer volume of material being gathered from the Tunnel</strong>.
</p><p>So much raw intelligence was flowing out from the East that it was literally swamping the resources available to transcribe and analyze it. MI6 had a special transcription center set up in Earl's Court, but they were still transcribing material seven years later when they discovered that <a href="http://www.independent.co.uk/news/world/europe/the-spy-who-stayed-out-in-the-cold-george-blake-at-90-8290141.html">George Blake</a> had betrayed the Tunnel to the Russians from the outset.
</p><p><cite>Spycatcher - page 47</cite></p></blockquote>

<p>And, even if cracked and analysed - someone has to actually make use of the material!</p>

<blockquote><p>I was shown into a room in Northumberland Avenue which contained all the <a href="https://web.archive.org/web/20120927180654/https://www.cia.gov/library/center-for-the-study-of-intelligence/kent-csi/vol5no1/html/v05i1a02p_0001.htm">Dragon</a> material, stacked up in dozens and dozens of dusty volumes. Incredibly, neither MI5 nor MI6 had bothered to process any of this material for its own use.
</p><p><cite>Spycatcher - page 116</cite></p></blockquote>

<h2 id="with-friends-like-these"><a href="https://shkspr.mobi/blog/2014/08/spycatchers-relevance-in-2014/#with-friends-like-these">With Friends Like These...</a></h2>

<p>The Germans are appalled to discover <del>gambling</del> spying taking place against them.  <a href="https://www.cbsnews.com/news/wh-us-not-monitoring-german-chancellor-angela-merkels-phone/">Merkel is <em>furious!</em></a></p>

<blockquote><p>For nearly three years, between 1960 and 1963, MI5 and GCHQ read the French high grade cipher coming in and out of the French Embassy in London. Every move made by the French during our abortive attempt to enter the Common Market was monitored. The intelligence was avidly devoured by the Foreign Office, and verbatim copies of De Gaulle's cables were regularly passed to the Foreign Secretary in his red box.
</p><p><cite>Spycatcher - page 111</cite></p></blockquote>

<p>Yeah. We spied on friend and foe alike - and they spied on us.</p>

<h2 id="analysis"><a href="https://shkspr.mobi/blog/2014/08/spycatchers-relevance-in-2014/#analysis">Analysis</a></h2>

<blockquote><p>I made a series of analyses of Soviet strength in 1945, based on the VENONA material. Although we broke only a small fraction of the traffic, GCHQ were able to statistically assess the total number of spies active in Britain at between 150 and 300. (The statistical analysis was conducted using methodology devised by one of the top cryptographers, <a href="https://en.wikipedia.org/wiki/I._J._Good">I.J. Good</a>.)
</p><p><cite>Spycatcher - page 344</cite>
</p></blockquote>

<p>Again, we see that decryption isn't necessarily needed in order to analyse data.  Encrypting your email isn't enough - traffic analysis can give an excellent idea of how many people you are in communication with and the volumes of material you are exchanging.</p>

<h2 id="and-in-the-end"><a href="https://shkspr.mobi/blog/2014/08/spycatchers-relevance-in-2014/#and-in-the-end">And, in the end</a></h2>

<p>There's no doubt that Spycatcher is still a highly significant book.  What may have seemed somewhat dry and irrelevant when first published, has now become frighteningly prophetic.  It is vital that the book is republished and that all students of security - computer or otherwise - read it and learn its lessons.</p>

<p>For anyone with an interest in the development of the security state - and the evolution of computerised espionage, Spycatcher is a must.</p>

<p>Much as today, it was <a href="http://www.theguardian.com/fromthearchive/story/0,12269,1326319,00.html">The Guardian newspaper who were on the forefront of helping to reveal those who seek to spy on us</a>.</p>

<p>I'll leave the last words to the judgement of the Law Lords who decided whether Spycatcher should be banned.</p>

<blockquote><p>'In a free society,' Lord Geoff said, 'there is a continuing public interest that the workings of government should be open to scrutiny and criticism.'
</p><p>Lord Keith of Kinkeld said the Government's claim that anyone receiving confidential information from a Crown servant in any circumstances is bound by an obligation of confidence was 'untenable and impracticable, in addition to being unsupported by any authority'.
</p><p>Lord Griffiths, chairman of the Security Commission, said: 'The balance in this case comes down firmly in favour of the public interest in freedom of speech and a free press.' But he said that a member or former member of the security services could publicly disclose his concerns only as a last resort.
</p><p><cite><a href="http://www.bailii.org/uk/cases/UKHL/1988/6.html">Attorney General v Guardian Newspapers Ltd (No 2) [1988] UKHL 6 (13 October 1988) </a></cite></p></blockquote>

<p>You can buy <a href="http://www.amazon.co.uk/gp/product/0670820555/ref=as_li_tl?ie=UTF8&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0670820555&amp;linkCode=as2&amp;tag=shkspr-21">used copies of Spycatcher on Amazon.</a></p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=10776&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2014/08/spycatchers-relevance-in-2014/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[The Hardest Problem In Encryption? Usability.]]></title>
		<link>https://shkspr.mobi/blog/2014/01/the-hardest-problem-in-encryption-usability/</link>
					<comments>https://shkspr.mobi/blog/2014/01/the-hardest-problem-in-encryption-usability/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Thu, 09 Jan 2014 12:30:37 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[anc]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[politics]]></category>
		<category><![CDATA[security]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=9470</guid>

					<description><![CDATA[I have been reading a wonderful account of how The ANC in South Africa developed and used encryption to avoid persecution by the Apartheid regime.  The article is a good 15,000 words and will take you some time to read.  It is a fascinating account of how an ersatz encryption technology was developed by enthusiastic amateurs using acoustic couplers, DTMF, tape recorders, and early mobile phones.  …]]></description>
										<content:encoded><![CDATA[<p>I have been reading a wonderful account of how <a href="https://web.archive.org/web/20140102125103/http://www.anc.org.za/show.php?id=4693">The ANC in South Africa developed and used encryption</a> to avoid persecution by the Apartheid regime.</p>

<p>The article is a good 15,000 words and will take you some time to read.  It is a fascinating account of how an ersatz encryption technology was developed by enthusiastic amateurs using acoustic couplers, DTMF, tape recorders, and early mobile phones.</p>

<p>I'm going to ignore the <em>technical</em> aspects - which are wonderful to read - and talk about the <em>human</em> aspect.</p>

<p>Security <strong>is</strong> usability.</p>

<p>The story starts with the problems faced by the ANC before they adopted computerised encryption. Activists had to manually encipher messages - a tedious and error prone process - and then manually transcribe and decipher the messages they received.</p>

<p>A huge effort for very little gain. Add the article puts it:</p>

<blockquote><p>It was always the same pattern: comrades would go back home feeling enthusiastic and begin by sending a series of messages. They soon came to realise that it was a futile activity as it took so much effort to say so very little and the responses, as few and far between as they were, contained little encouragement and advice.</p></blockquote>

<p>To be clear, these political activists were fighting to free their country from the yoke of a repressive and racist government. They were some of the most committed people imaginable, fighting for the most noble of causes - as were their leaders - yet they found the long winded process of protecting their communications <strong>just too hard</strong>.</p>

<p>The article goes on to describe how the introduction of computer based encrypting revolutionised the revolution. With very little effort, it was suddenly possible to communicate over vast distances with total security. Messages could be long and complex. Replies could take hours rather than days or weeks.</p>

<p>The political opposition flourished in such an environment. It also, no doubt, provided a much needed psychological boost to those involved in the struggle. Lifting the weight of fear by knowing that their seditious conversations were impenetrable to the enemy.</p>

<p>This home made encryption flourished for several years before it came crashing down.</p>

<p>It failed not because the <em>technology</em> was weak - but because <em>people</em> are weak.</p>

<p>Maintaining secrecy is hard. Attaching computers to modems and loading secret disks is still a lot easier than the mind numbing process of hand powered encryption - but it is an extra burden.</p>

<p>Individuals were careless. Despite knowing that the government was violently racist and that organising against it could result in your torture or death, it is hard to be 100% vigilant.</p>

<blockquote><p>The details of Vula that the regime released to the press revealed that indeed a number of important documents had fallen into their hands. It became clearer by the day that the comrades in Durban had violated all the rules of security that we had so assiduously tried to impress upon them. Data files of confidential information were kept `in clear` on disk and keywords and key books must have been easily obtainable. The minutes of an entire underground conference were quoted by police as evidence of the plot to overthrow the government.</p></blockquote>

<p>Remember, these communications weren't between file-sharers doing it for "teh lulz" or business people protecting their IP.  It was between freedom fighters working against a sadistic and murderous government.  Failing to maintain security wouldn't just end with your family being tortured - it could mean the disruption of an entire political movement.  That's pretty serious motivation.</p>

<p>And yet that threat <em>still</em> wasn't enough to keep people acting in a security conscious manner.</p>

<p>The piece concludes with the lessons the ANC learned from running their encryption programme:</p>

<blockquote><p>Without first-class communications you cannot carry out a successful underground operation.</p></blockquote>

<p>First class doesn't just mean usability of the system - but also the usability of the security.  We can create "perfect" encryption (NSA backdoors not withstanding) - but can we make a system easy enough the people <em>want</em> to use it correctly and don't want to abuse it by, say, writing down passwords?</p>

<p>I've tried setting up PGP more times than I care to remember.  Each time the process has been a frightening and confusing mess.  Using it has required using plugins, remembering arcane commands, and trusting that I've not somehow screwed up.</p>

<p>Just like a hotel room safe that's too complicated to easily understand, the current usability of encryption software encourages us to hide our valuables in the sock drawer and hope the housekeeping staff don't go snooping.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=9470&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2014/01/the-hardest-problem-in-encryption-usability/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Why You Can't Trust Government Provided Cryptography]]></title>
		<link>https://shkspr.mobi/blog/2013/11/why-you-cant-trust-government-provided-cryptography/</link>
					<comments>https://shkspr.mobi/blog/2013/11/why-you-cant-trust-government-provided-cryptography/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Sun, 24 Nov 2013 09:00:00 +0000</pubDate>
				<category><![CDATA[politics]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[NaBloPoMo]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=8472</guid>

					<description><![CDATA[You should visit Bletchley Park.  Seriously.  It&#039;s the most amazing museum - dedicated to the wartime effort to crack Enigma; the Nazi cryptographic machines.  The tour guides of Bletchley Park are full of fascinating stories.  They can tell you how all the primitive computers work, about the history of each building, they know all the curious little facts which make visiting the park an absolute …]]></description>
										<content:encoded><![CDATA[<p>You should <a href="http://www.bletchleypark.org.uk/">visit Bletchley Park</a>.  Seriously.  It's the most amazing museum - dedicated to the wartime effort to crack Enigma; the Nazi cryptographic machines.</p>

<p>The tour guides of Bletchley Park are full of fascinating stories.  They can tell you how all the primitive computers work, about the history of each building, they know all the curious little facts which make visiting the park an absolute joy.</p>

<p>There's one story in particular that I never tire of hearing.</p>

<blockquote><p>By 1945, Turing's computers were able to decrypt Enigma transmission within 48 hours - it was thoroughly broken.  After the war, the British had captured thousands of working Enigma machines.  What on Earth could they do with them?  The answer was simple.  Sell them to our Allies as "The Uncrackable Enigma!"</p></blockquote>

<p>And, indeed, they did.  The <a href="https://en.wikipedia.org/wiki/Enigma_machine#CITEREFBauer2000">British Government sold cryptographic devices to their allies</a> even though the British knew that the cryptography was fatally compromised.</p>

<p>I presume that for the next few years, the British Government were able to spy on the world.  Listening in on all the high level discussions they could.</p>

<p>In 2007, the security expert Bruce Schneier asked "<a href="http://www.schneier.com/essay-198.html">Did NSA Put a Secret Backdoor in New Encryption Standard?</a>"</p>

<p>Cryptography experts were worried that the American National Security Agency were promoting a new encryption standard which was <em>potentially</em> crackable by the US Government.</p>

<p>The US Government had taken a leaf out of the UK's book, so it seemed, and had encouraged the world to use insecure cryptography.</p>

<p>This has been going on for <em>decades</em>.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=8472&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2013/11/why-you-cant-trust-government-provided-cryptography/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[You Never Call, You Never Write...]]></title>
		<link>https://shkspr.mobi/blog/2009/10/ofcom-bbc-drm/</link>
					<comments>https://shkspr.mobi/blog/2009/10/ofcom-bbc-drm/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Fri, 30 Oct 2009 11:27:24 +0000</pubDate>
				<category><![CDATA[politics]]></category>
		<category><![CDATA[BBC]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[drm]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[ofcom]]></category>
		<category><![CDATA[shakespeare]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=897</guid>

					<description><![CDATA[As Shakespeare said...  &#34;[Blog posts are] a tale told by an idiot, full of sound and fury, signifying nothing.&#34;  Today Ofcom published the responses it had for its consultation on plans for the BBC to encrypt its HD broadcasts.  The blogosphere went nuts! DRM? Not on our watch.  Boing Boing mobilised its army of commentators, the BBC published two blog posts which quickly filled up with comments, …]]></description>
										<content:encoded><![CDATA[<h2 id="as-shakespeare-said"><a href="https://shkspr.mobi/blog/2009/10/ofcom-bbc-drm/#as-shakespeare-said">As Shakespeare said...</a></h2>

<p>"[Blog posts are] <a href="https://web.archive.org/web/20121110131648/https://shkspr.mobi/plays.php?play=content/tragedies/Macbeth&amp;start=3454&amp;length=12">a tale told by an idiot, full of sound and fury, signifying nothing.</a>"</p>

<p>Today <a href="https://web.archive.org/web/20100201044328/http://www.ofcom.org.uk:80/tv/ifi/tvlicensing/enquiry/responses/">Ofcom published the responses</a> it had for its consultation on plans for the <a href="https://web.archive.org/web/20090907032644/http://www.tom-watson.co.uk/2009/09/personal-video-recorders-ofcom-consultation-indicates-that-the-bbc-want-to-make-yours-obsolete/">BBC to encrypt its HD broadcasts</a>.</p>

<p>The blogosphere went nuts! DRM? Not on our watch.&nbsp; <a href="http://boingboing.net/2009/09/30/bbc-wants-to-encrypt.html">Boing Boing</a> mobilised its army of commentators, the <a href="http://www.bbc.co.uk/blogs/bbcinternet/2009/10/freeview_hd_copy_protection_a.html">BBC published two blog posts</a> which <a href="http://www.bbc.co.uk/blogs/bbcinternet/2009/09/freeview_hd_copy_protection_up.html">quickly filled up with comments</a>, Facebook statuses were updated and all these links were retweeted until our fingers were worn to their nubs.</p>

<p>No doubt Ofcom has collapsed under the weight of public opinion. How can the BBC possibly hope to get away with their fiendish plans with such a backlash?</p>

<h2 id="90-people"><a href="https://shkspr.mobi/blog/2009/10/ofcom-bbc-drm/#90-people">90 People</a></h2>

<p>Ninety.&nbsp; Less than one hundred.&nbsp; Smaller than the viewing figures for BBC Three.&nbsp; That's how many people could be arsed to type a few dozen words to Ofcom, spell check them, then hit send.</p>

<p>More people signed a <a href="https://web.archive.org/web/20100125094634/http://petitions.number10.gov.uk:80/YorkshireSign/?">petition asking for a Yorkshire sign to be erected on the M1</a> than responded to this consultation.&nbsp; Now, maybe my finger is off the pulse, but I haven't seen major blogs crying foul over Yorkshire's lack of signage.</p>

<h2 id="on-the-plus-side"><a href="https://shkspr.mobi/blog/2009/10/ofcom-bbc-drm/#on-the-plus-side">On The Plus Side</a></h2>

<p>You can <a href="https://web.archive.org/web/20240404041415/https://www.ofcom.org.uk/__data/assets/pdf_file/0021/45642/eden_mr_t.pdf">read my response on their site</a>.&nbsp; Like all the others I've read, it's <em>against</em> the proposals.&nbsp; I haven't read every response, but the twenty or so that I downloaded were all against the plans.</p>

<p>I know that there's typically low turn out to consultations of this kind.&nbsp; Organisations know that for every person who bothered to complain, there's more waiting in the wings quietly seething.</p>

<p>But only 90 people?&nbsp; I realise that the power of retweeting helped free Iran from a stolen election, but sometimes you actually have to <strong>do something</strong>.&nbsp; You don't even need to get off your computer.&nbsp; Find an email address, write a few sentences and let those in charge know how you feel.</p>

<p>This will help get you started.</p>

<ul>
    <li><a href="http://www.direct.gov.uk/en/Governmentcitizensandrights/UKgovernment/PublicConsultations/DG_170463">List of government consultation websites</a></li>
    <li><a href="http://local.direct.gov.uk/LDGRedirect/index.jsp?LGSL=867&amp;LGIL=8">Public Consultations in your area</a></li>
    <li><a href="https://www.ofcom.org.uk/consultations-and-statements">Ofcom Consultations</a></li>
</ul>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=897&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2009/10/ofcom-bbc-drm/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
