pig-monkey.com - censorshiphttps://pig-monkey.com/2012-11-18T00:00:00-08:00Resilient Communications with Continuous Wave Radio2012-11-18T00:00:00-08:002012-11-18T00:00:00-08:00Pig Monkeytag:pig-monkey.com,2012-11-18:/2012/11/resilient-communications-continuous-wave-radio/<p><a href="http://www.fourmilab.ch/codegroup/">Codegroup</a> is a program written by <a href="http://en.wikipedia.org/wiki/John_Walker_(programmer)">John Walker</a> that encodes and decodes any file into groups of five letters. For example, take an image, run it through codegroup, and this is what you get:</p> <div class="highlight"><pre><span></span><code>$ cat avatar.jpg <span class="p">|</span> codegroup <span class="p">|</span> head -n <span class="m">4</span> ZZZZZ YPPNI PPOAA ABAEK EGEJE GAAAB ABAAA AABAA ABAAA …</code></pre></div><p><a href="http://www.fourmilab.ch/codegroup/">Codegroup</a> is a program written by <a href="http://en.wikipedia.org/wiki/John_Walker_(programmer)">John Walker</a> that encodes and decodes any file into groups of five letters. For example, take an image, run it through codegroup, and this is what you get:</p> <div class="highlight"><pre><span></span><code>$ cat avatar.jpg <span class="p">|</span> codegroup <span class="p">|</span> head -n <span class="m">4</span> ZZZZZ YPPNI PPOAA ABAEK EGEJE GAAAB ABAAA AABAA ABAAA APPPO AADLE DFCEF EBFEE PFCDK YCAGH GECNG KHAGF GHCAH GDBCO DACAC IHFHD GJGOG HCAEJ EKEHC AEKFA EFEHC AHGDG YDCCJ CMCAH BHFGB GMGJH EHJCA DNCAD JDAAK PPNLA AEDAA ADACA CADAC ACADA DADAD </code></pre></div> <p>The resulting code groups lend themselves to being transmitted via low-tech, resilient means, such as continuous wave radio. The ability to do this with any file is a simple but amazingly powerful concept.</p> <p>I discovered codegroup around the same time that I was <a href="/2011/09/learning-morse-code/">learning Morse code</a>. I decided to take advantage of codegroup and put what I was learning into practice. This led to the development of <a href="https://github.com/pigmonkey/ham/blob/master/morse.py">morse.py</a>.</p> <p>With codegroup, I end up with a series of ASCII characters. I wanted to be able to feed those characters into a program which would convert them to Morse. The program should display the dits and dahs, but more importantly: it should beep them out.</p> <p><code>morse.py</code> is a simple script which does just that. It accepts ASCII input and encodes it to <a href="https://en.wikipedia.org/wiki/Morse_code#International_Morse_Code">International Morse Code</a>. The Morse is printed to the screen, in case you want to key it out yourself. Johnathan Nightingale&rsquo;s <a href="http://www.johnath.com/beep/">beep.c</a> is used to play the beeps with the terminal bell. The length of dits, dahs, and the pauses in between are configurable, but the defaults conform to International Morse. The input can be a file, but if no file is specified the script simply reads from standard input, which allows it to be piped together with codegroup.</p> <div class="highlight"><pre><span></span><code>$ morse.py --help usage: morse.py <span class="o">[</span>-h<span class="o">]</span> <span class="o">[</span>-b BEEP<span class="o">]</span> <span class="o">[</span>-s SPEED<span class="o">]</span> <span class="o">[</span>-f FILE<span class="o">]</span> <span class="o">[</span>-q<span class="o">]</span> Convert an ASCII file to International Morse Code and play it with system beeps. optional arguments: -h, --help show this <span class="nb">help</span> message and <span class="nb">exit</span> -b BEEP, --beep BEEP The location of the program that plays the beeps. This script is intended to be used with Johnathan Nightingale<span class="err">&#39;</span>s beep: http://www.johnath.com/beep/ -s SPEED, --speed SPEED Reduce the pauses between message characters by the given amount. -f FILE, --file FILE The location of the ASCII file to convert. -q, --quiet Do not print the dots and dashes. </code></pre></div> <p>What is the application? Suppose your government has shut down your internet access. You want to send a map to an acquaintance. With these tools, you can encode the map with codegroup, pass the result to morse.py, hold your radio up to your speakers and key the mic. That&rsquo;s it. Censorship bypassed.</p> <div class="highlight"><pre><span></span><code>$ cat map.pdf <span class="p">|</span> codegroup <span class="p">|</span> morse.py -b ~/src/beep/beep </code></pre></div> <p>On the receiving end, the Morse needs to be translated back to ASCII characters, which can then be decoded with codegroup. It&rsquo;s a slow process, but resilient. To speed things up, the file being transmitted can be compressed before being passed to codegroup. (And if privacy is a concern, the file can also be encrypted, but that would be <a href="http://www.gpo.gov/fdsys/pkg/CFR-2000-title47-vol5/xml/CFR-2000-title47-vol5-sec97-113.xml">illegal</a> unless you are doing so to <a href="http://www.gpo.gov/fdsys/pkg/CFR-2011-title47-vol5/xml/CFR-2011-title47-vol5-sec97-403.xml">protect life or property</a>.)</p>Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway.2012-11-12T00:00:00-08:002012-11-18T00:00:00-08:00Pig Monkeytag:pig-monkey.com,2012-11-12:/2012/11/never-underestimate-bandwidth-station-wagon-full-tapes-hurtling-down-highway/<p>Terence Eden <a href="http://shkspr.mobi/blog/2012/11/smuggling-usb-sticks/">points out</a> that censorship becomes more difficult as flash memory devices become smaller and gain greater capacity. Case in point: Director <a href="https://en.wikipedia.org/wiki/Jafar_Panahi">Jafar Panahi</a> smuggled <a href="http://uk.imdb.com/title/tt1667905/">This Is Not a Film</a> out of Iran <a href="http://manila-bulletin.net/blog/2011/11/05/film-smuggled-in-usb-up-for-screening-at-13th-cinemanila/">on a flash-drive hidden in a cake</a>. For me, the practicality of the <a href="https://en.wikipedia.org/wiki/Sneakernet">sneakernet</a> became revitalized …</p><p>Terence Eden <a href="http://shkspr.mobi/blog/2012/11/smuggling-usb-sticks/">points out</a> that censorship becomes more difficult as flash memory devices become smaller and gain greater capacity. Case in point: Director <a href="https://en.wikipedia.org/wiki/Jafar_Panahi">Jafar Panahi</a> smuggled <a href="http://uk.imdb.com/title/tt1667905/">This Is Not a Film</a> out of Iran <a href="http://manila-bulletin.net/blog/2011/11/05/film-smuggled-in-usb-up-for-screening-at-13th-cinemanila/">on a flash-drive hidden in a cake</a>. For me, the practicality of the <a href="https://en.wikipedia.org/wiki/Sneakernet">sneakernet</a> became revitalized after I began using <a href="http://git-annex.branchable.com/">git-annex</a> earlier this year.</p>