Format and link fix 2012/grothe/README.md

I should point out that I'm unclear on one thing. It seems vague or
cryptic but this might very well be because I've not yet tried the entry
- it is about the usage of the program. I will try it after I finish the
remaining README.md files. Hopefully it'll be clearer at this point.
This commit is contained in:
Cody Boone Ferguson committed 2023-05-04 10:19:28 -07:00
1 parent ec1dd1c85d
commit 3753579f6b
1 file changed
+56 -39
+56 -39
View File
@@ -1,13 +1,11 @@
# Most conspiratorial # Most conspiratorial
Aaron Grothe Aaron Grothe
2205 South 51st Street US
Omaha, NE 68106 <ajgrothe@yahoo.com>
US
<ajgrothe@yahoo.com>
David Madore David Madore
<http://www.madore.org/~david/> <http://www.madore.org/~david/>
## To build: ## To build:
@@ -17,13 +15,14 @@ make
## To run: ## To run:
To create a shared secret shared among M people with N+1 needed to reconstruct: To create a shared secret shared among `M` people with `N+1` needed to reconstruct:
```sh ```sh
./grothe -secret 1-/dev/urandom 2-/dev/urandom ... N-/dev/urandom 1+shared1 2+shared2 ... M+sharedM ./grothe -secret 1-/dev/urandom 2-/dev/urandom ... \
N-/dev/urandom 1+shared1 2+shared2 ... M+sharedM
``` ```
To reconstruct the original (an arbitrary combination of N+1 or To reconstruct the original (an arbitrary combination of `N+1` or
more shared files with their proper numbers): more shared files with their proper numbers):
```sh ```sh
@@ -42,28 +41,27 @@ more shared files with their proper numbers):
## Judges' remarks: ## Judges' remarks:
Also known as Best abuse of the judging process. Also known as 'Best abuse of the judging process'.
The IOCCC 2012 submission page didn't enforce the 2048 meaningful The IOCCC 2012 submission page didn't enforce the 2048 meaningful character
character limit. This entry, as submitted, weighed in at 2222 chars limit. This entry, as submitted, weighed in at 2222 chars but lucky for it, it
but was, luckily for it, extremely easy to bring down below the was extremely easy to bring down below the limit. There were a number of
limit. There were a number of strings that when concatenated allowed strings that when concatenated allowed the program to slide under the limit.
the program to slide under the limit.
It was clear to the judges that the extra size was an entry It was clear to the judges that the extra size was an entry beautification step.
beautification step. Had it not, this entry would have been Had it not been, this entry would have been rejected in round 0.
rejected in round 0.
The judges also took some liberty obfuscating this entry a litte more. The judges also took some liberty obfuscating this entry a little more.
How does this entry work? The only place multiplication is used is How does this entry work? The only place multiplication is used is
to perform the atoi conversion. to perform the `atoi()` conversion.
## Author's remarks: ## Author's remarks:
**Description** ### Description
This program implements a version of Shamir's Secret Sharing. Shamir's Secret This program implements a version of [Shamir's Secret
Sharing](http://en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing). Shamir's Secret
Sharing allows you to encrypt a file into N parts where it will take M parts to Sharing allows you to encrypt a file into N parts where it will take M parts to
recreate the original file. E.g. you can split the secret recipe for Crystal Pepsi recreate the original file. E.g. you can split the secret recipe for Crystal Pepsi
into 3 parts and require two of them be available to extract the original recipe. into 3 parts and require two of them be available to extract the original recipe.
@@ -72,18 +70,19 @@ Actually surprisingly useful for an IOCCC entry :-)
### Usage ### Usage
To share a secret To share a secret.
E.g. E.g.
file to be shared - cookie\_recipe.txt File to be shared - [cookie_recipe.txt](cookie_recipe.txt).
number of pieces - 2 + file to be shared number of pieces - 2 + file to be shared
total number of pieces created by program 4 total number of pieces created by program 4
pieces needed to reassemble recipe 3 or greater pieces needed to reassemble recipe 3 or greater
### Example usage ### Example usage
To share secret into 4 pieces of which at least 3 will be needed to get back the recipe: To split a secret into 4 pieces of which at least 3 will be needed to get it (in
this case a recipe) back:
```sh ```sh
./grothe \ ./grothe \
@@ -92,7 +91,7 @@ To share secret into 4 pieces of which at least 3 will be needed to get back the
1+cookie_piece1.dat 2+cookie_piece2.dat 3+cookie_piece3.dat 4+cookie_piece4.dat 1+cookie_piece1.dat 2+cookie_piece2.dat 3+cookie_piece3.dat 4+cookie_piece4.dat
``` ```
To put recipe back together using 1, 2 and 4th piece: To put recipe back together using the first, second and fourth pieces:
```sh ```sh
./grothe \ ./grothe \
@@ -102,25 +101,43 @@ To put recipe back together using 1, 2 and 4th piece:
### Limitations ### Limitations
* program is limited to 256 input and output files and will slow down dramatically when you get past 20-50 inputs and outputs The program is limited to 256 input and output files and will slow down
dramatically when you get past 20-50 inputs and outputs.
### Obfuscations ### Obfuscations
* nothing is done consistently throughout the program E.g i+=1, i=i+1, i++ and ++i are all used in the program. The mark of true code buggery. - "A foolish consistency is the hobgoblin of little minds" - Ralph Waldo Emerson * nothing is done consistently throughout the program E.g `i+=1`, `i=i+1`, `i++`
* uses the most powerful obfuscation of all "Math". "Any sufficiently advanced cryptography is indistinguasble from magic" - Apologies to Arthur C. Clarke and `++i` are all used in the program. The mark of true code buggery: "A
* shadows variables by using brackets in main program to create local copies of variables that are the same as global scope variables. -Wshadow should probably be a part of -Wall in gcc foolish consistency is the hobgoblin of little minds." - [Ralph Waldo
* uses array\_index[array\_name] instead of array\_name[array\_index] in several places. Still don't know why C continues to allow this Emerson](https://en.wikipedia.org/wiki/Ralph_Waldo_Emerson)
( error strings are encoded with offsets that are also used to select them in the case statement. All strings are located in one function for easy localization
* liberal use of octal numbers, hexadecimal numbers and regular decimal numbers throughout program * uses the most powerful obfuscation of all "Math". "Any sufficiently advanced
cryptography is indistinguishable from magic." - Apologies to [Arthur C.
Clarke](https://en.wikipedia.org/wiki/Arthur_C._Clarke)
* shadows variables by using brackets in main program to create local copies of
variables that are the same as global scope variables. `-Wshadow` should
probably be a part of `-Wall` in gcc.
* uses `array_index[array_name]` instead of `array_name[array_index]` in several
places. Still don't know why C continues to allow this (error strings are
encoded with offsets that are also used to select them in the case statement.
All strings are located in one function for easy localization).
* liberal use of octal numbers, hexadecimal numbers and regular decimal numbers
throughout program.
* variables and function names are semi-random and upper and lower case characters are used * variables and function names are semi-random and upper and lower case characters are used
* use of #defines from stdio.h, stdlib.h for values \_STDIO\_H and EXIT\_SUCCESS used to represent 1 and 0 respectively in the program * use of `#define`s from `stdio.h`, `stdlib.h` for values `_STDIO_H` and
* arrays only need to be 256x256 most are set to greater values than they need to be so trying to figure it out can be a bit tough `EXIT_SUCCESS` used to represent 1 and 0 respectively in the program.
* arrays only need to be 256x256 but most are set to greater values than they
need to be so trying to figure it out can be a bit tough.
### References ### References
* Shamir's Secret Sharing - <a href="http://en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing">http://en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing</a> * David Madore's implementation of Shamir's Secret Sharing - <http://www.madore.org/~david/programs/programs-1.36.html>
* David Madore's implementation of Shamir's Secret Sharing - <a href="http://www.madore.org/~david/programs/programs-1.36.html">http://www.madore.org/~david/programs/programs-1.36.html</a> * Steve's Recipe Database - source for the $25k Cookie Recipe - <https://www.mealsteps.com>
* Steve's Recipe Database - source for the $25k Cookie Recipe - <a href="http://recipes.stevex.net/">http://recipes.stevex.net/</a>
## Copyright and CC BY-SA 4.0 License: ## Copyright and CC BY-SA 4.0 License: