From 85f35ecbe5f27ee9fe60ce856fde95d3f1ed916b Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 25 Mar 2024 06:05:35 -0700 Subject: [PATCH 1/3] Fix 2004/sds/try.sh for README.md changes Commit cbc022d864bdc069f0c98fedb4031ab1eb95019b which edited 2004/sds/README.md broke the functionality of one of the features of the code so the previous revision of README.md was copied to README_sds.md and the script now uses that file. This does mean the manifest is out of date and that will have to be fixed another time but now the script works okay. Without this one of the files to be compiled does not compile at all and it seems better this way than to tamper with the code especially given what the entry does and because it would take more time to fix anyway. --- 2004/sds/README.md | 15 ++--- 2004/sds/README_sds.md | 127 +++++++++++++++++++++++++++++++++++++++++ 2004/sds/try.sh | 12 ++-- thanks-for-help.html | 3 + thanks-for-help.md | 4 ++ 5 files changed, 145 insertions(+), 16 deletions(-) create mode 100644 2004/sds/README_sds.md diff --git a/2004/sds/README.md b/2004/sds/README.md index ea21a54c3..8eaf1fc7c 100644 --- a/2004/sds/README.md +++ b/2004/sds/README.md @@ -117,16 +117,11 @@ reasonable compiler. In particular, they are known to compile under GNU C. - +For more information, see: https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/2004/sds/README_sds.md b/2004/sds/README_sds.md new file mode 100644 index 000000000..8eaf1fc7c --- /dev/null +++ b/2004/sds/README_sds.md @@ -0,0 +1,127 @@ +## To build: + +```sh +make +``` + + +### Bugs and (Mis)features: + +The current status of this entry is: + +``` +STATUS: INABIAF - please **DO NOT** fix +``` + +For more detailed information see [2004 sds bugs](../../bugs.html#2004_sds). + + +## To use: + +```sh +./sds +``` + + +## Try: + +```sh +./try.sh +``` + + +## Judges' remarks: + +Why not use the program to hide another program in the program? It +must have seemed reasonable at the time. + +The ability to hide a message in plain text is quite charming, really. +We must admit to a bit of uncertainty about where you'd find such +messages, or how useful they'd be. Or, of course, whether all those +horribly badly formatted emails spammers send might contain secret +messages. Annoyingly, it's a little too obvious that SOMETHING has +been done to a message for us to hide one in the remarks. :) + + +## Author's remarks: + +[Steganography](https://en.wikipedia.org/wiki/Steganography) is the term for the +family of techniques used for hiding information within other information. +Today, it has many real world uses, particularly for digital watermarking. + +This program uses a steganographic technique to hide information in any text +file. The specific technique used is aimed at writers of obfuscated programs +for the IOCCC, as the hidden information is encoded in the whitespace in the +source file. As we know, there are up to an additional 2048 characters of +whitespace available to entrants to the IOCCC, so it turns out that this is an +ideal place to hide things. + +The program as provided is the steganographic decoder. Rather than +provide a separate encoding program, you should not be surprised to +learn that I opted to steganographically hide the encoder inside the +decoder. + +Try it out. Compile the program, then type + +```sh +./sds < sds.c +``` + +You should see the encoder program displayed. Now save it, like: + +```sh +./sds < sds.c > encoder.c +``` + +Then compile `encoder.c`. You now have the complete system ready. + +The encoder expects to get a filename as an argument. This filename +is the name of the file containing the information to be hidden. It +expects the file in which to hide the information to be on the +standard input, and will output the results on the standard output. + +You can use it like this (assuming you have a file called remarks): + +```sh +echo 'Hello, World!' > message +./encoder message < remarks > remarks_msg +``` + +Then to decode: + +```sh +./sds < remarks_msg +Hello, World! +``` + +C programs are mostly unaffected by adding steganographic content, +but it is possible in certain circumstances for whitespace to be +changed inside strings where it should be left alone. Plain text +files are good candidates for hiding information in, but the added +spacing may render the text somewhat difficult to read. + + +### Obfuscation + +This program is obfuscated in a number of ways: + +* The code is all but impossible to read due to the spacing. +* The algorithm is well hidden in the code due to copious red-herrings. +* The long expressions cause indentation tools to give poor results. +* And good old fashioned ternary operators are the icing on the cake. + +### Compiling the program + +The program (and the encoder program) should compile on any +reasonable compiler. In particular, they are known to compile under +GNU C. + + +## Copyright and CC BY-SA 4.0 License: + +This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved. +You are free to share and adapt this file under the terms of this license: + + Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) + +For more information, see: https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/2004/sds/try.sh b/2004/sds/try.sh index dc8d4c408..7c08f2383 100755 --- a/2004/sds/try.sh +++ b/2004/sds/try.sh @@ -30,10 +30,10 @@ echo 1>&2 make encoder 2>/dev/null echo 1>&2 -echo "$ ./encoder README.md &2 +echo "$ ./encoder README_sds.md &2 read -r -n 1 -p "Press any key to continue (space = next page, q = quit): " echo 1>&2 -./encoder README.md /dev/null: " echo 1>&2 @@ -55,15 +55,15 @@ echo 1>&2 echo 'Hello, World!' > message echo 1>&2 -echo "$ ./encoder message < README.md | tee remarks.md" 1>&2 +echo "$ ./encoder message < README_sds.md | tee remarks.md" 1>&2 read -r -n 1 -p "Press any key to continue (space = next page, q = quit): " echo 1>&2 -./encoder message < README.md | tee remarks.md | less -rEXFK +./encoder message < README_sds.md | tee remarks.md | less -rEXFK echo 1>&2 -read -r -n 1 -p "Press any key to run: diff remarks.md README.md (space = next page, q = quit): " +read -r -n 1 -p "Press any key to run: diff remarks.md README_sds.md (space = next page, q = quit): " echo 1>&2 -diff remarks.md README.md | less -rEXFK +diff remarks.md README_sds.md | less -rEXFK echo "Did you notice how similar they are?" 1>&2 echo 1>&2 diff --git a/thanks-for-help.html b/thanks-for-help.html index d6a4d8c8a..00f699d87 100644 --- a/thanks-for-help.html +++ b/thanks-for-help.html @@ -2185,6 +2185,9 @@ fast in modern systems, especially the scrolling text of

Cody also added the try.sh script.

2004/sds (index.html)

Cody added the try.sh script.

+

Also, after the README.md file had copyright changes, it broke the script so +Cody made a copy of the older README.md file into README_sds.md and added that +to the repo for the script instead.

2004/vik2 (index.html)

Cody fixed this to compile in Linux. Although it compiled cleanly in macOS (and BSD?) the code failed to compile at all in Linux due to:

diff --git a/thanks-for-help.md b/thanks-for-help.md index 44c8bbdb6..acc983046 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -3166,6 +3166,10 @@ Cody also added the [try.sh](2004/schnitzi/try.sh) script. [Cody](#cody) added the [try.sh](2004/sds/try.sh) script. +Also, after the README.md file had copyright changes, it broke the script so +Cody made a copy of the older README.md file into `README_sds.md` and added that +to the repo for the script instead. + ## [2004/vik2](2004/vik2/vik2.c) ([index.html](2004/vik2/index.html)) From 5893f1f1285743d67593c47f2685f6730e22f1cb Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 25 Mar 2024 09:00:50 -0700 Subject: [PATCH 2/3] Rename 2004/sds/README_sds.md to .txt --- 2004/sds/{README_sds.md => README_sds.txt} | 0 2004/sds/try.sh | 12 ++++++------ thanks-for-help.html | 2 +- thanks-for-help.md | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) rename 2004/sds/{README_sds.md => README_sds.txt} (100%) diff --git a/2004/sds/README_sds.md b/2004/sds/README_sds.txt similarity index 100% rename from 2004/sds/README_sds.md rename to 2004/sds/README_sds.txt diff --git a/2004/sds/try.sh b/2004/sds/try.sh index 7c08f2383..059bff36d 100755 --- a/2004/sds/try.sh +++ b/2004/sds/try.sh @@ -30,10 +30,10 @@ echo 1>&2 make encoder 2>/dev/null echo 1>&2 -echo "$ ./encoder README_sds.md &2 +echo "$ ./encoder README_sds.txt &2 read -r -n 1 -p "Press any key to continue (space = next page, q = quit): " echo 1>&2 -./encoder README_sds.md /dev/null: " echo 1>&2 @@ -55,15 +55,15 @@ echo 1>&2 echo 'Hello, World!' > message echo 1>&2 -echo "$ ./encoder message < README_sds.md | tee remarks.md" 1>&2 +echo "$ ./encoder message < README_sds.txt | tee remarks.md" 1>&2 read -r -n 1 -p "Press any key to continue (space = next page, q = quit): " echo 1>&2 -./encoder message < README_sds.md | tee remarks.md | less -rEXFK +./encoder message < README_sds.txt | tee remarks.md | less -rEXFK echo 1>&2 -read -r -n 1 -p "Press any key to run: diff remarks.md README_sds.md (space = next page, q = quit): " +read -r -n 1 -p "Press any key to run: diff remarks.md README_sds.txt (space = next page, q = quit): " echo 1>&2 -diff remarks.md README_sds.md | less -rEXFK +diff remarks.md README_sds.txt | less -rEXFK echo "Did you notice how similar they are?" 1>&2 echo 1>&2 diff --git a/thanks-for-help.html b/thanks-for-help.html index 00f699d87..2f36dda7b 100644 --- a/thanks-for-help.html +++ b/thanks-for-help.html @@ -2186,7 +2186,7 @@ fast in modern systems, especially the scrolling text of

2004/sds (index.html)

Cody added the try.sh script.

Also, after the README.md file had copyright changes, it broke the script so -Cody made a copy of the older README.md file into README_sds.md and added that +Cody made a copy of the older README.md file into README_sds.txt and added that to the repo for the script instead.

2004/vik2 (index.html)

Cody fixed this to compile in Linux. Although it compiled cleanly in macOS (and diff --git a/thanks-for-help.md b/thanks-for-help.md index acc983046..2a8457eaf 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -3167,7 +3167,7 @@ Cody also added the [try.sh](2004/schnitzi/try.sh) script. [Cody](#cody) added the [try.sh](2004/sds/try.sh) script. Also, after the README.md file had copyright changes, it broke the script so -Cody made a copy of the older README.md file into `README_sds.md` and added that +Cody made a copy of the older README.md file into `README_sds.txt` and added that to the repo for the script instead. From 1fae4f5877acbb5de018e810b0fef0e5083dc912 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 25 Mar 2024 09:17:06 -0700 Subject: [PATCH 3/3] Fix README.md for 2004/sds This was accidentally undone when fixing the try.sh script. --- 2004/sds/README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/2004/sds/README.md b/2004/sds/README.md index 8eaf1fc7c..ea21a54c3 100644 --- a/2004/sds/README.md +++ b/2004/sds/README.md @@ -117,11 +117,16 @@ reasonable compiler. In particular, they are known to compile under GNU C. -## Copyright and CC BY-SA 4.0 License: +