From 75ac0752edfa4bf79d3222ea35cedccd6f281944 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sat, 2 Dec 2023 10:08:55 -0800 Subject: [PATCH] Add 2012/grothe/try.sh + format/typo checks And since the try.sh scrambles and descrambles a cookie recipe I will offer this funny story from decades ago that my mum tells every so often: my uncle, who lived with my parents, and my father were at home and they made 12 dozen cookies. They called my mum at her work and told her: we made twelve dozen cookies and we saved you one! My mum thought they meant she saved them one dozen cookies, already suggesting they had eaten too many. But no. They left her one cookie! The reason is they couldn't get the milk and cookies balanced so the only obvious thing to do was to eat 143 cookies. Obviously. They were quite sick and nobody was sympathetic to their ridiculous stunt. So let that be a lesson to anyone who decides they want to eat 143 cookies: just eat 142 and you'll be just fine, weight gain notwithstanding! :-) (Okay maybe keep it at 24 .. unless they're chocolate in which case you might want to eat three, four, five, however many dozen you can fit in your stomach.) Only the last paragraph is not sincere. The first really did happen. --- 2012/grothe/README.md | 42 ++++++++++++++------------ 2012/grothe/cookie_piece1.dat | Bin 1002 -> 1002 bytes 2012/grothe/cookie_piece2.dat | Bin 1002 -> 1002 bytes 2012/grothe/cookie_piece3.dat | Bin 1002 -> 1002 bytes 2012/grothe/cookie_piece4.dat | Bin 1002 -> 1002 bytes 2012/grothe/cookie_recipe_restore.txt | Bin 1002 -> 1002 bytes 2012/grothe/grothe.c | 2 +- 2012/grothe/try.sh | 33 ++++++++++++++++++++ thanks-for-fixes.md | 9 +++++- 9 files changed, 65 insertions(+), 21 deletions(-) create mode 100755 2012/grothe/try.sh diff --git a/2012/grothe/README.md b/2012/grothe/README.md index 622221068..6fd9ac298 100644 --- a/2012/grothe/README.md +++ b/2012/grothe/README.md @@ -48,7 +48,7 @@ Had it not been, this entry would have been rejected in round 0. The judges also took some liberty obfuscating this entry a little more. How does this entry work? The only place multiplication is used is -to perform the `atoi()` conversion. +to perform the `atoi(3)` conversion. ## Author's remarks: @@ -57,27 +57,27 @@ to perform the `atoi()` conversion. 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 into 3 parts and require two of them be available to extract the original recipe. Actually surprisingly useful for an IOCCC entry :-) + ### Usage -To share a secret. +To share a secret. For example: -E.g. +- File to share: [cookie_recipe.txt](cookie_recipe.txt). +- Number of pieces: 2 + file to be shared +- Total number of pieces created by program: 4 +- Pieces needed to reassemble recipe: 3 or greater -File to be shared - [cookie_recipe.txt](cookie_recipe.txt). -number of pieces - 2 + file to be shared -total number of pieces created by program 4 -pieces needed to reassemble recipe 3 or greater ### Example usage To split a secret into 4 pieces of which at least 3 will be needed to get it (in -this case a recipe) back: +this case the cookie recipe) back: ```sh ./grothe \ @@ -86,7 +86,7 @@ this case a recipe) back: 1+cookie_piece1.dat 2+cookie_piece2.dat 3+cookie_piece3.dat 4+cookie_piece4.dat ``` -To put recipe back together using the first, second and fourth pieces: +To put the recipe back together using the first, second and fourth pieces: ```sh ./grothe \ @@ -94,6 +94,7 @@ To put recipe back together using the first, second and fourth pieces: +cookie_recipe_restore.txt ``` + ### Limitations The program is limited to 256 input and output files and will slow down @@ -101,34 +102,37 @@ dramatically when you get past 20-50 inputs and outputs. ### Obfuscations -* nothing is done consistently throughout the program E.g `i+=1`, `i=i+1`, `i++` +* 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](https://en.wikipedia.org/wiki/Ralph_Waldo_Emerson) -* uses the most powerful obfuscation of all "Math". "Any sufficiently advanced +* 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 +* 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 +* 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. +* Liberal use of octal numbers, hexadecimal numbers and regular decimal numbers +throughout the program. -* variables and function names are semi-random and upper and lower case characters are used -* use of `#define`s from `stdio.h`, `stdlib.h` for values `_STDIO_H` and +* Variables and function names are semi-random and upper and lower case +characters are used. + +* Use of `#define`s from `stdio.h`, `stdlib.h` for values `_STDIO_H` and `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 +* 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 * David Madore's implementation of Shamir's Secret Sharing - diff --git a/2012/grothe/cookie_piece1.dat b/2012/grothe/cookie_piece1.dat index d7a702f6cb41490ffee6048a0eedc1028f7210e7..dd3742e1c0f7a9de693c8a7b8d04a6cacfdb6590 100644 GIT binary patch literal 1002 zcmVV=E0aLUmljJdJ-vDpo24|4J=ME)(_(NUpAuOQ};2P{7zCGZO z{sbsu$Jm&n=7jk#N?ZpR<5=XIt4&F*tT{iMD!87^_vWc>FG7c78ohs znB7s#JRiys8nlR>hh$dAQ%cIGnitY*Vw+i^a7wt)rdYC!3^r>sY;(aI+^Qxf_p^up z3r2gWuu-~VJ1)3hK3i|5)b04Mb}~s8;+%TGjWiXRr0YNJw|fntpD_JyIPYbK9*)ch zUZ`607RVP+UI3!Q;E4|e>(OVia_5OSoiyJ4l(4#(M=m@e&kKxPw%Uc$WKX_t%rggw z!OqPcYbW`cNF~KyQ;^U(6saodv~W}ov&Pd1FL8Km28`H+iBd?DfUM5@hmQL5_Ep{T$oAu<=N7gKZiwbdywk+(> zXGX(tGM^zH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vCOOdOiGH=glu|1jqR-JM+}(D*)b&%c<3GG+b*n7_+Qnbi#mh2 z@56?jhPJkpNW8A@d%JJgR6ht%Gpst0AS`q9)7cIwU{|~Sm zKkE-;tmo^ztj!nb|9*TQKO>Ho_h8}PW&(i}Zk&a-zxo?#x7X{Qigdf0W>1+o7VI>m Yk1WLH$?us_NI8D-Bezo#U+M8YBF@zX@&Et; diff --git a/2012/grothe/cookie_recipe_restore.txt b/2012/grothe/cookie_recipe_restore.txt index 6445cfad21c799a8403c5f953a9bb23abd36c080..4a2a786b133e81a0e7b918b3a4c2fd0423ca67f3 100644 GIT binary patch literal 1002 zcmZ`&O>f&U3_VxB;vEL8Ej+hL*KNpcNmpz@(-uuPU`N_!Y$38`NOIEl*N?K2U^^_x z!Q#gwANly)Xb<@pkm%8U1xVM7J*mQR1M{sWkS8|3zP-C$aiORA^OB+UQZ3UHZJSet+ zyN74kb&PKX^JxT+ZR-w?Lt%7@8{3lZa;0vaZLtcx<@f#&c|(CBLo^}uvx|#V)8{^h zz2qH-3#FcQFg!a_T8u=z`mNbiGfXB^tk`XZwTDtay4rE2xeIg_evI|M)wMsq?Hd-2Ev=!z z@}>KOYpnQ-I&I7$dlIw1e0X@ncXqzvSLw)QsGa0iM?~RvYh-zQ!&M|JCHh{3(+%N( ze?1Pth;+pMK%r$aI9E!YoX`KY&ah8vna@6rzK|{xn!`Z!wg=wB&tlSNcFN* zA(^~PI~Sx_qKxy*P>MKT$C$`JI-jgD!a*7@$e7edZ>VI1oyF<&Oq^vSN~fM&i1$W^ zi;=l=5QZWKj`svFEuVfmL#qWnrUYDlzDC8OJRYkpCDf0~++Rz&s{KVtcPK>iWVT%8 F>JJrkHWvT@ literal 1002 zcmVac|mCK2wX0JO^o@w-_1!{H!%{nzAk^$0&KXsAudRwR)U;fv$?gy}i>bd?fFP!R!o-qR#B1)4il@=4#4e1UG+d2P} zqguTl1(pX8DcbrX;#A{m90-2qRqigKcnT`1Ez#JeWCOMaem!vX3@631W2B75P7YUD z;a6~U8JkmW(=%N#MAguc@5)M+Qs4Dvs^6|ylKOCu3c_-=l6ZBGmjC(C!#T<}3Ql~J zNtB3Y)c1(!NYCuCE0Yjf#7+u}h53m_UF%t7+dM%vi0hoVo?69cv4Y|XSn!&E79rG0 z`8dhzf+5Jc9xk9CGxL)6sr488qOj37NC2$)by73FZJ_+cm9C|jyBXbkE!n>1@ zba5W2i4|m+SL=Z+QSWi+z;&P1KN^|WkdQl)$Q;M>h^+k>wOY+>3r#!Zst$iOPWOFr zQYE3nJ+f%5VwGVS>aQ$wtbto|m0X{1*Kdx37f(tNr^5@O^0}$WN#{-GGSHc!Nib=9 zp(9`jAJ<2b82>aB?6|*7rsCf9xm;unBZOQ?$t3zjR32ID3TH~}5Goo+r==9(Bc0s8 zq-`U?+oQ7ubKd79`j!M0V2!p~Dr|;S%28psn5?U5Xt3ma;Y&k3oD=q7{-dgfbjF%# z3KggQk|ZwBT6A3+vCOOdOiGH=glu|1jqR-JM+}(D*)b&%c<3GG+b*n7_+Qnbi#mh2 z@56?jhPJkpNW8A@d%JJgR6ht%Gpst0AS`q9)7cIwU{|~Sm zKkE-;tmo^ztj!nb|9*TQKO>Ho_h8}PW&(i}Zk&a-zxo?#x7X{Qigdf0W>1+o7VI>m Yk1WLH$?us_NI8D-Bezo#U+M8YBF@zX@&Et; diff --git a/2012/grothe/grothe.c b/2012/grothe/grothe.c index 1d2c651fc..2083aeac3 100644 --- a/2012/grothe/grothe.c +++ b/2012/grothe/grothe.c @@ -15,7 +15,7 @@ n;}}void X(int v,int u){char*y=0;v-=1;switch(v){case(0x2):y ="HckngfVqQrgpKprwv" "Hkng"; BC(4):y="JempihXsStirMrtyxJmpi"; BC(0):y="PointValueTooLarge"; BC 0x1:y= "EvqmjdbufJoqvuQpjou";BC(6):y="TuOtv{zLorky";BC(3):y="WrrPdq|RxwsxwSrlqwv";BC(5) :y="GfiFwlzrjsyX~syf}"; BC(07):y="UvV|{w|{Mpslz";}if(u)exit(0); f(y,v);exit(1);} -int main(int t,const char*T[]){for(i=00;i<0x100;++i)for(j=0;j<=i;++j)if(1==y(i,j +int main(int t, char *T[]){ for (i=00;i<0x100;++i) for (j=0;j<=i;++j)if(1==y(i,j ))W[i]=j,W[j]=i;for(k=0x1;k=toupper('0'))&&(T[k][l] <=tolower('9'));l++){p=p*10+(T[k][l]-'0');if(p>=256)X(1,0);}if(T[k][l]=='-'){for (m=0;m/dev/null || exit 1 + +read -r -n 1 -p "Press any key to break recipe into crumbs: " +echo 1>&2 +echo "$ ./grothe -cookie_recipe.txt 1-/dev/urandom 2-/dev/urandom \\ + 1+cookie_piece1.dat 2+cookie_piece2.dat 3+cookie_piece3.dat 4+cookie_piece4.dat" +echo 1>&2 + +read -r -n 1 -p "Press any key to restore cookie recipe: " +echo 1>&2 +echo "$ ./grothe 1-cookie_piece1.dat 2-cookie_piece2.dat 4-cookie_piece4.dat +cookie_recipe_restore.txt" 1>&2 +echo 1>&2 + +read -r -n 1 -p "Press any key to show that the two files are the same: " +echo 1>&2 +diff -s cookie_recipe.txt cookie_recipe_restore.txt +echo 1>&2 + +read -r -n 1 -p "Press any key to see the recipe file, restored: " +echo 1>&2 +cat cookie_recipe_restore.txt diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index b85db13be..208b49543 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -3372,7 +3372,14 @@ Cody also fixed a typo in the ruby script ## [2012/grothe](2012/grothe/grothe.c) ([README.md](2012/grothe/README.md)) -[Cody](#cody) restored the original code from the archive. +[Cody](#cody) added the [try.sh](2012/grothe/try.sh) script. + +Cody also changed `argv` to be not `const char **` but `char **`, mostly out of an +abundance of caution in case clang, which already imposes restrictions on the +types of args to `main()` including to do with `char **`, decides to further +restrict them. + +Cody also restored the original code from the archive. ## [2012/hamano](2012/hamano/hamano.c) ([README.md](2012/hamano/README.md]))