-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodegroup.html
258 lines (221 loc) · 9.31 KB
/
codegroup.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>CODEGROUP: Five-Letter Codegroup Filter</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="http://www.fourmilab.ch/documents/styles/standard_screen.css" type="text/css" />
<meta name="author" content="John Walker" />
<meta name="description" content="CODEGROUP: Five-Letter Codegroup Filter" />
<meta name="keywords" content="codegroup, five, letter, filter, cryptography, espionage" />
<style type="text/css">
dl.sample dt {
font-weight: bold;
margin-bottom: 0px;
margin-top: 1ex;
}
dl.sample dd {
font-family: monospace;
font-size: smaller;
margin-top: 0px;
white-space: pre;
}
</style>
</head>
<body class="standard">
<center>
<h1><img src="codegroup.jpg" alt="CODEGROUP" width="636" height="237" /></h1>
<h2>
Five-Letter Codegroup Filter
</h2>
</center>
<hr />
<p />
<p class="j">
This page describes a program, <b>codegroup</b>, which
encodes and decodes arbitrary binary data in five-letter
code groups, just like spies use.
</p>
<h3>NAME</h3>
<b>codegroup</b> – encode / decode binary file as five letter
codegroups
<h3>SYNOPSIS</h3>
<b>codegroup</b> <b>-d</b>|<b>-e</b> [ <b>-u</b> ] [ <em>infile</em> [ <em>outfile</em> ] ]
<h3>DESCRIPTION</h3>
<p class="j">
For decades, spies have written their encoded messages in
groups of five letters.
</p>
<p class="j">
<b>codegroup</b> encodes any file into this form,
allowing it to be transmitted through any medium, and
decodes files containing codegroups into the original input.
Encoded files contain a 16-bit cyclical redundancy check
(CRC) and file size to verify, when decoded, that the
message is complete and correct. Files being decoded may
contain other information before and after the codegroups,
allowing in-the-clear annotations to be included.
</p>
<p class="j">
<b>codegroup</b> makes no attempt, on its own, to prevent
your message from being read. Cryptographic security should
be delegated to a package intended for that purpose, such as
<b>pgp</b>. <b>codegroup</b> can then be applied to the
encrypted binary output, transforming it into easily
transmitted text. Text created by <b>codegroup</b> uses
only upper case ASCII letters and spaces. Unlike files
encoded with <b>uuencode</b> or <b>pgp</b>'s “ASCII armour”
facility, the output of codegroup can be easily (albeit
tediously) read over the telephone, broadcast by shortwave
radio to agents in the field, or sent by telegram, telex, or
Morse code.
</p>
<p class="j">
To illustrate the difference, here are the first few lines
of a binary file encoded by:
</p>
<dl class="sample">
<dt><a href="http://www.fourmilab.ch/webtools/base64/">base64</a>:</dt>
<dd>H4sICFJ9MzYAA2EudGFyAOxba3faSNKer+lf0SezO3YmgLnY2I6TyQIGgwOGBTtOYjuJEMJo
DJJGF1+ys//9rarulpqLHRi/mdk9G84JIKGuqq579eNkNn745q9sNru9tcXhs5gtFPAzm83l
xad88WyxmNssbhe3sps8m8ttZ/M/8K1vL9oPP0RBaPggypU1vrad+59zosj0HqAj9xF//pe8
WsaVNbTH1rfkAfoobm7ea//cZn4rtv/mNtq/kM9t/cCz31Io9foftz9nnW77oMdfcdMdWJe+
</dd>
<dt>uuencode:</dt>
<dd>begin 644 data.bin
M'XL("&7._R VUO;V /9U+FN2XSF3G6H5OA1(?HOB<=/<7__X7TN<PJ[L&
M=?-&1;I+) B8 0;P?_Z'?WY_-=7Q"T_JSZ_6)X9?&"$OU9[N'A[A%^L^6=
M?^M[OOV+:9=UM9J^] MAS_ ;X0O]U];(Z?<WWE9_[/]ZMMOO[CG'^2MM
M_G(+,US/LWKZE1#C^YO?D_;O#G[7][2R^+0>XJ^&PI/[?7-7U]KU=]SSWQ?
</dd>
<dt>pgp:</dt>
<dd>-----BEGIN PGP MESSAGE-----
Version: 2.6.2i
hIwCCb8iTku3pBUBA/9oSDlfk/On9bwjmTnB98Eejr6agkPSi3n6hd8JkAtJd33f
kzFq18Jo0xzRUWZ7Di6Jq/FXpeI1yztVDqispbcYOP0aDv4JZOSF1kRsmJ9xK9Bo
Cv4a967IXPkkRsjIAkx0B39dYxCzf8kHUn4THmyV/b2qLUZ0cc+mr8hxFfFpuYSM
</dd>
<dt>codegroup:</dt>
<dd>ZZZZZ YBPIL AIAIG FMOPP CPAAA DGNGP GPGPA ADNJN ELJKO ELIMO
GEOHF KIFGP IFBCB PKCPI YJMHE PHBHP PPOBH NCOHD AKLLL AGHFP
DEGEF LKELC EAIJI ABAGP AHPPO IHHPH OHPDF YNFPB ALEPO KMPKP
NGCHI GFPBI CBDML PFGHL LIHPC BOOBB HOLDO FJNHP OLHLL OPNIL
</dd>
</dl>
<p class="j">
Only <b>codegroup</b> conforms to the telegraphic convention of
all upper case letters, and passes the “telephone
test” of being readable without any modifiers such as
“capital” and “lower-case”. Avoiding
punctuation marks and lower case letters makes the output of
<b>codegroup</b> much easier to transmit over a voice or
traditional telegraphic link.
</p>
<h3>OPTIONS</h3>
<dl>
<dt><b>-d</b></dt> <dd>Decodes the input, previously created by
<b>codegroup</b>, to recover the original input file,
and verifies it to detect truncation or
corruption of the contents.
</dd>
<dt><b>-e</b></dt> <dd>Encodes the input into codegroups.
</dd>
<dt><b>-u</b></dt> <dd>Print how-to-call information.
</dd>
</dl>
<h3>APPLICATION NOTES</h3>
<p class="j">
Encoding a binary file as ASCII characters inevitably
increases its size. When used in conjunction with existing
compression and encryption tools, the resulting growth in
file size is usually acceptable. For example, a random
extract of electronic mail 32768 bytes in length was chosen
as a test sample. Compression with <b>gzip</b> compacted the file
to 15062 bytes. It was then encrypted for transmission to a
single recipient with <b>pgp</b>, which resulted in a 15233 byte
file. (Even though <b>pgp</b> has its own compression, smaller
files usually result from initial compression with <b>gzip</b>. In
this case, <b>pgp</b> alone would have produced a file of 15420
bytes.)
</p>
<p class="j">
<b>codegroup</b> transforms the encrypted file into a 37296
byte text file. Thus, due to compression, the code groups
for the encrypted file are only a little larger than the
original cleartext.
</p>
<p class="j">
Restricting the character set to upper case letters and including
spaces between groups results in substantially larger output
files than those produced by <b>uuencode</b> and <b>pgp</b>.
Files encoded with codegroup are about 2.5 times the size of the
input file, while <b>uuencode</b> and <b>pgp</b> expand the file
only about 35%. <b>codegroup</b> is thus preferable only for
applications where its limited character set is an advantage.
</p>
<h3>FILES</h3>
<p class="j">
If no <em>infile</em> is specified or <em>infile</em> is a single
“<tt>-</tt>”, <b>codegroup</b> reads from standard
input; if no <em>outfile</em> is given, or <em>outfile</em> is a
single “<tt>-</tt>”, output is sent to standard
output. Input and output are processed strictly serially;
consequently <b>codegroup</b> may be used in pipelines.
</p>
<h3>BUGS</h3>
<p class="j">
When a CRC error is detected, no indication is given of the
location in the file where the error(s) occurred. When
sending large files, you may want to break them into pieces
with the <b><a href="http://www.fourmilab.ch/splits/">splits</a></b> utility so, in
case of error, only the erroneous pieces need to be re-sent.
</p>
<p class="j">
It might be nice to embed the original file name and modes
in the encoded output, but this opens the door to all kinds
of system-dependent problems. You can always include this
information as text before the first codegroup, or
send an archive created with <b>tar</b> or <b>zip</b>.
</p>
<h2>
<a href="codegroup.zip"><img src="http://www.fourmilab.ch/images/icons/file.png"
alt="" align="middle" width="40"
height="40" border="0" /></a> <a href="codegroup.zip">Download codegroup.zip</a>
(Zipped archive)</h2>
<p class="j">
The program is provided as <a href="codegroup.zip">codegroup.zip</a>, a
<a href="http://www.info-zip.org/pub/infozip/" target="_blank">Zipped</a> archive containing an
ready-to-run WIN32 command-line executable program, <code>codegrp.exe</code>
(compiled using Microsoft Visual C++ 5.0),
and in source code form along with a
<code>Makefile</code> to build the program under Unix.
</p>
<h3>SEE ALSO</h3>
<b><a href="http://www.fourmilab.ch/webtools/base64/">base64</a></b>(1),
<b>gzip</b>(1), <b>pgp</b>(1),
<b><a href="http://www.fourmilab.ch/splits/">splits</a></b>(1), <b>tar</b>(1),
<b>uuencode</b>(1), <b>zip</b>(1)
<h3>EXIT STATUS</h3>
<p class="j">
<b>codegroup</b> returns status 0 if processing was
completed without errors, 1 if errors were detected in
decoding a file which indicate the output is incorrect or
incomplete, and 2 if processing could not be performed at
all due, for example, to a nonexistent input file or no
codegroups found in the input.
</p>
<h3>COPYING</h3>
<p class="copying">
This software is in the public domain. Permission to use, copy,
modify, and distribute this software and its documentation for
any purpose and without fee is hereby granted, without any
conditions or restrictions. This software is provided “as is”
without express or implied warranty.
</p>
<hr />
<address>
<a href="http://www.fourmilab.ch/">by John Walker</a><br />
September 7th, 2008
</address>
</body>
</html>