Format fixes in 1990/jaw/README.md

I did not check for typos and I believe I only fixed one. I will look
for typos at a later time.
This commit is contained in:
Cody Boone Ferguson committed 2023-04-09 05:10:17 -07:00
1 parent 8ba53b5eb4
commit a3bb267ec0
1 file changed
+94 -90
+94 -90
View File
@@ -1,28 +1,29 @@
# Best Entropy-reducer # Best Entropy-reducer
James A. Woods James A. Woods
Research Institute for Advanced Computer Science Research Institute for Advanced Computer Science
MS 230-5 MS 230-5
NASA Ames Research Center NASA Ames Research Center
Moffett Field, CA 94131 Moffett Field, CA 94131
USA USA
Karl F. Fox Karl F. Fox
Morning Star Technologies, Inc. Morning Star Technologies, Inc.
1760 Zollinger Road 1760 Zollinger Road
Columbus, OH 43221 Columbus, OH 43221
USA USA
Paul Eggert Paul Eggert
Twin Sun Inc. Twin Sun Inc.
360 N. Sepulveda Blvd. #2055 360 N. Sepulveda Blvd. #2055
El Segundo, CA 90245 El Segundo, CA 90245
USA USA
## To build: ## To build:
make all ```sh
make all
```
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed the script to [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed the script to
work properly in modern environments (to do with PATH not having '.' in it). He work properly in modern environments (to do with PATH not having '.' in it). He
@@ -40,14 +41,15 @@ Endoh](/winners.html#Yusuke_Endoh). Thank you Yusuke for your implementation of
To test the official C entry, one might try: To test the official C entry, one might try:
echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw ```sh
echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw
```
which should apply the identity transformation to a minimal which should apply the identity transformation to a minimal holoalphabetic
holoalphabetic sentence. sentence.
NOTE: Cody notes the above will not work under macOS. The `sh shark.sh jaw.* Cody noted the above will not work under macOS. The commands in the judges'
README.md > receive` and following commands below do work with macOS after the comments do work in macOS after the fixes he made.
fixes he made.
## Judges' comments: ## Judges' comments:
@@ -55,19 +57,21 @@ fixes he made.
The program, in its base form, implements two useful utilities: The program, in its base form, implements two useful utilities:
atob - ascii to binary conversion
zcat - decompression filter
Included with this entry is a shell script (with comments edited down - `atob` - ascii to binary conversion
to reduce it to 1530 bytes) which implements the complete - `zcat` - decompression filter
shark utility. The script, shark.sh, contains a 'jaw.c' embedded
within it! Included with this entry is a shell script (with comments edited down to reduce
it to 1530 bytes) which implements the complete shark utility. The script,
shark.sh, contains a 'jaw.c' embedded within it!
The sender must have `compress` and `btoa`. To send, try: The sender must have `compress` and `btoa`. To send, try:
sh shark.sh jaw.* README.md > receive ```sh
sh shark.sh jaw.* README.md > receive
```
The resulting file, 'receive', unpacks the input files The resulting file, `receive`, unpacks the input files
even if the receiver lacks `uncompress` and `btoa`: even if the receiver lacks `uncompress` and `btoa`:
mkdir -p test mkdir -p test
@@ -78,7 +82,7 @@ even if the receiver lacks `uncompress` and `btoa`:
## Authors' comments: ## Authors' comments:
ABSTRACT ### ABSTRACT
Minimal, Universal File Bundling Minimal, Universal File Bundling
(or, Functional Obfuscation in a Self-Decoding Unix Shell Archive) (or, Functional Obfuscation in a Self-Decoding Unix Shell Archive)
@@ -92,63 +96,63 @@ even if the receiver lacks `uncompress` and `btoa`:
[anon., circa 1988, pre-Morris worm era] [anon., circa 1988, pre-Morris worm era]
Myriad formats have been proposed for network-mailable Myriad formats have been proposed for network-mailable data. A major difficulty
data. A major difficulty undermining the popularity of most undermining the popularity of most file/message bundlers is that the sender
file/message bundlers is that the sender assumes prior assumes prior installation of the computational dual of such bundling software
installation of the computational dual of such bundling by the receiver. Command shell archives alleviate this problem somewhat, but
software by the receiver. Command shell archives alleviate still require standardization for the function of data compression and
this problem somewhat, but still require standardization for mail-transparency encoding. On Unix, these coding format quandaries are over-
the function of data compression and mail-transparency come by planting a novel Trojan Horse in the archive header to perform
encoding. On Unix, these coding format quandaries are over- negotiation-less decoding.
come by planting a novel Trojan Horse in the archive header
to perform negotiation-less decoding.
Specifically, we outline the development of an extraordinarily compact Specifically, we outline the development of an extraordinarily compact portable
portable (un)bundler to (dis)assemble data-compressed, (un)bundler to (dis)assemble data-compressed, binary-to-ASCII-converted,
binary-to-ASCII-converted, length-split, and checksummed directory structures length-split, and checksummed directory structures using standard Unix tools.
using standard Unix tools. Miniature versions of counterparts to a Lempel-Ziv Miniature versions of counterparts to a Lempel-Ziv coder ('compress' or
coder ('compress' or 'squeeze') and an efficient bit packet- izer ('btoa') are 'squeeze') and an efficient bit packetizer ('btoa') are compiled on-the-fly at
compiled on-the-fly at mail destination sites where they may not already mail destination sites where they may not already exist. These are written in
exist. These are written in purposefully obfuscated-C to accompany purposefully obfuscated-C to accompany similarly-shrunk shell command glue. This
similarly-shrunk shell command glue. This resulting shell archiver is dubbed resulting shell archiver is dubbed `shark`.
'shark'.
'Shark' procedure overhead consumes as few as three dozen shell lines (or `shark` procedure overhead consumes as few as three dozen shell lines (or
~1100 bytes), commensurate with the size of many Internet mail headers; it `~1100` bytes), commensurate with the size of many Internet mail headers; it
amortizes favorably with message size. 'Shark' is portable across Unix amortizes favorably with message size. 'Shark' is portable across Unix
variants, while the underlying technique is inherently generalizable to other variants, while the underlying technique is inherently generalizable to other
encoding schemes. encoding schemes.
In the function-theoretic sense of minimal In the function-theoretic sense of minimal Chaitin/Kolmogorov complexity, and
Chaitin/Kolmogorov complexity, and within a modified Shannon within a modified Shannon model of communication, the 'shark' effort aims to
model of communication, the 'shark' effort aims to construct construct a "shortest program" for source decoding in the Turing-universal Unix
a "shortest program" for source decoding in the Turing- environment.
universal Unix environment.
---------------------------------------------- ----------------------------------------------
Oh, the shark has pretty teeth, dear-- > Oh, the shark has pretty teeth, dear--
And he shows them pearly white > And he shows them pearly white
Just a jackknife has Macheath, dear-- > Just a jackknife has Macheath, dear--
And he keeps it out of sight. > And he keeps it out of sight.
[Bertolt Brecht, Threepenny Opera] > [Bertolt Brecht, Threepenny Opera]
---------------------------------------------- ----------------------------------------------
### Portability:
We have ported this program to a wide variety of systems. Among We have ported this program to a wide variety of systems. Among
these are: these are:
SunOS 4.1 / Sun Sparcstation 1 (using both 'cc' and 'gcc 1.37.1') - SunOS 4.1 / Sun Sparcstation 1 (using both 'cc' and 'gcc 1.37.1')
SunOS 4.0.3 / Sun 3 - SunOS 4.0.3 / Sun 3
BSD 4.3 / VAX 8650 - BSD 4.3 / VAX 8650
SEIUX / Sumitomo Electric Ustation/S - SEIUX / Sumitomo Electric Ustation/S
Sony NEWS-OS 3.3 / Sony NEWS (fairly vanilla 4.3BSD) - Sony NEWS-OS 3.3 / Sony NEWS (fairly vanilla 4.3BSD)
System V.? / Hitachi 2050 - System V.? / Hitachi 2050
System V.? / NEC EWS 4800 - System V.? / NEC EWS 4800
UNIOS-B / Omron Luna - UNIOS-B / Omron Luna
Dynix / Sequent Balance ('cc' for Natl. Semi. base + 'gcc 1.36') - Dynix / Sequent Balance ('cc' for Natl. Semi. base + 'gcc 1.36')
Unicos / Cray 2 - Unicos / Cray 2
### Obfuscation:
We (the authors) feel this program is obfuscated for the We (the authors) feel this program is obfuscated for the
following reasons: following reasons:
@@ -172,32 +176,32 @@ preserved at amazing cost for sheer perversity.
5. Many, many micro obfuscations below, honed over three years time, in shell as 5. Many, many micro obfuscations below, honed over three years time, in shell as
well as C. Ask about the 'tar' pit escape, the argv[0] flip, Paul's &4294967295 well as C. Ask about the 'tar' pit escape, the argv[0] flip, Paul's &4294967295
portability hack, the "void where prohibited by flaw" fix, the scanf() portability hack, the "void where prohibited by flaw" fix, the scanf()
spacesaver, shift shenanigans, signal madness, exit()ing stage left, and space-saver, shift shenanigans, signal madness, `exit()`ing stage left, and
source-to-source transformations galore. source-to-source transformations galore.
For extra credit: ### For extra credit:
Construct 'sharkmail', to auto-split sharkives into mailable Construct 'sharkmail', to auto-split sharkives into mailable
segments and mail them. Here's a simple one, which could be segments and mail them. Here's a simple one, which could be
extended to enable auto-reassembly with one shell cmd at the extended to enable auto-reassembly with one shell cmd at the
far end. far end.
------------------------ cut here for sharkmail ----------------------- ```sh
#!/bin/sh #!/bin/sh
m=$1; shift m=$1; shift
shark $* | split -800 - /tmp/shark$$ shark $* | split -800 - /tmp/shark$$
n=`ls /tmp/shark$$* | wc -l | sed 's/ *//'` n=`ls /tmp/shark$$* | wc -l | sed 's/ *//'`
p=0 p=0
for f in `ls /tmp/shark$$*` for f in `ls /tmp/shark$$*`
do do
p=`expr $p + 1` p=`expr $p + 1`
mail -s "bundle ($p of $n) from '`whoami`'" $m < $f mail -s "bundle ($p of $n) from '`whoami`'" $m < $f
done done
rm /tmp/shark$$* rm /tmp/shark$$*
------------------------ end of sharkmail ----------------------------- ```
Shark history: ### Shark history:
May 1987: Karl Fox introduces 1023-byte zcat.c to USENET. May 1987: Karl Fox introduces 1023-byte zcat.c to USENET.
It's too late for the 4th IOCCC. It's too late for the 4th IOCCC.