From e6e5e282fb95da3a0a6073210901909001a0dbda Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sat, 2 Nov 2024 07:24:35 -0700 Subject: [PATCH] Important fixes in 2020/ferguson2 A typo in markdown meant that a link was not formed. Renamed enigma.html to enigma.txt. Although it was to be set to viewed as text the problem is that as a html file running a linter on it will cause errors (obviously). The .entry.json and all files that referred to the file enigma.html (not in remote web servers, obviously, but just this website) now refer to enigma.txt, except that enigma.html was now added to .gitignore and the recode.md (in the example command) redirects to enigma.html as that should be a html file, assuming they have the right key (of the selection I gave). These problems were not discovered due to trying to get the html files in a good state (ironically) and knowing that I had written a lot. I believe now that the files should be okay. Although I did use sgit I did it carefully and I still ran make quick-readme2index and make gen_other_html. --- 2020/ferguson2/.entry.json | 2 +- 2020/ferguson2/.gitignore | 1 + 2020/ferguson2/Makefile | 2 +- 2020/ferguson2/README.md | 4 ++-- 2020/ferguson2/{enigma.html => enigma.txt} | 0 2020/ferguson2/index.html | 4 ++-- 2020/ferguson2/recode.html | 6 +++--- 2020/ferguson2/recode.md | 6 +++--- 2020/ferguson2/testing-procedure.html | 10 +++++----- 2020/ferguson2/testing-procedure.md | 10 +++++----- 10 files changed, 23 insertions(+), 22 deletions(-) rename 2020/ferguson2/{enigma.html => enigma.txt} (100%) diff --git a/2020/ferguson2/.entry.json b/2020/ferguson2/.entry.json index cd063be66..7e0e6b0a3 100644 --- a/2020/ferguson2/.entry.json +++ b/2020/ferguson2/.entry.json @@ -46,7 +46,7 @@ "entry_text" : "original source code" }, { - "file_path" : "enigma.html", + "file_path" : "enigma.txt", "inventory_order" : 100, "OK_to_edit" : true, "display_as" : "text", diff --git a/2020/ferguson2/.gitignore b/2020/ferguson2/.gitignore index 4049d86cb..078b3b839 100644 --- a/2020/ferguson2/.gitignore +++ b/2020/ferguson2/.gitignore @@ -6,6 +6,7 @@ chocolate-cake.key config decrypted.html decrypted-source.html +enigma.html encrypt.sh indent indent.c diff --git a/2020/ferguson2/Makefile b/2020/ferguson2/Makefile index 032d572ee..b113acfef 100644 --- a/2020/ferguson2/Makefile +++ b/2020/ferguson2/Makefile @@ -115,7 +115,7 @@ PROG= prog OBJ= ${PROG}.o DATA= enigma.1 input.txt obfuscation.key \ obfuscation.md obfuscation.txt recode.1 recode.md \ - try.this.txt enigma.html + try.this.txt enigma.txt TARGET= ${PROG} recode # ALT_OBJ= ${PROG}.alt.o diff --git a/2020/ferguson2/README.md b/2020/ferguson2/README.md index 57d8229b0..f993abcf0 100644 --- a/2020/ferguson2/README.md +++ b/2020/ferguson2/README.md @@ -119,14 +119,14 @@ There is a good deal of useful documentation that is provided with this entry: - Some useful information about [recode.c](%%REPO_URL%%/2020/ferguson2/recode.c) -* [enigma.html][] +* [enigma.txt][] - NOTE: see [recode.html][] (or [recode.html](recode.html) for details about how to decrypt this! * [testing-procedure][] - How the author tested the code and why it was necessary to do it in the way it was [recode.html]: recode.html -[enigma.html]: enigma.html +[enigma.txt]: enigma.txt [testing-procedure]: testing-procedure.html diff --git a/2020/ferguson2/enigma.html b/2020/ferguson2/enigma.txt similarity index 100% rename from 2020/ferguson2/enigma.html rename to 2020/ferguson2/enigma.txt diff --git a/2020/ferguson2/index.html b/2020/ferguson2/index.html index 208b562e0..91efcf841 100644 --- a/2020/ferguson2/index.html +++ b/2020/ferguson2/index.html @@ -515,7 +515,7 @@ out! Can you figure out why this works this way?

-
  • enigma.html +
  • enigma.txt
  • @@ -1145,7 +1145,7 @@ email but I’m more likely to respond to mastodon messages.

  • Makefile - entry Makefile
  • prog.alt.c - alternate source code
  • prog.orig.c - original source code
  • -
  • enigma.html - secret message in a html file to decrypt
  • +
  • enigma.txt - secret message in a html file to decrypt
  • input.txt - sample input
  • obfuscation.html - about the obfuscation of this entry
  • obfuscation.txt - about the obfuscation of this entry - encrypted with entry
  • diff --git a/2020/ferguson2/recode.html b/2020/ferguson2/recode.html index 68760f100..3b943f697 100644 --- a/2020/ferguson2/recode.html +++ b/2020/ferguson2/recode.html @@ -876,7 +876,7 @@ shouldn’t this entry include something that is fun too? But if that’s the ca why on Earth should it be unscrambled? It would be more fun and a great way to explore this entry if you have to use the Enigma machine to read the message!

    So this is what I offer: if you take one of the settings below and run the -Enigma machine simulator on the file [enigma.html][enigma.html] you will +Enigma machine simulator on the file enigma.txt you will unlock a html file with something special in it. I recommend you decrypt it to decrypted.html and open it in a web browser.

    The correct settings is listed below but you must determine which one is the @@ -919,8 +919,8 @@ think that I would give too much away? :)

    the key you wish to select is

        0EZ4PC1CC0PGTAQSOXWNMDRYKFUZEI

    you can do:

    -
        ./recode -R0EZ4PC1CC0PGTAQSOXWNMDRYKFUZEI -fenigma.html | ./prog - 2>/dev/null > enigma.deciphered.html
    -

    Then open enigma.deciphered.html in your browser. A command is provided in +

        ./recode -R0EZ4PC1CC0PGTAQSOXWNMDRYKFUZEI -fenigma.txt | ./prog - 2>/dev/null > enigma.html
    +

    Then open enigma.html in your browser. A command is provided in testing-procedure.html that does this too but it shows how you can use a file as input for the key instead as well as how I tested the code.

    diff --git a/2020/ferguson2/recode.md b/2020/ferguson2/recode.md index 86a998f08..b6117a0bc 100644 --- a/2020/ferguson2/recode.md +++ b/2020/ferguson2/recode.md @@ -588,7 +588,7 @@ why on Earth should it be unscrambled? It would be more fun and a great way to explore this entry if you have to use the Enigma machine to read the message! So this is what I offer: if you take one of the settings below and run the -Enigma machine simulator on the file [enigma.html][enigma.html] you will +Enigma machine simulator on the file [enigma.txt](enigma.txt) you will unlock a html file with something special in it. I recommend you decrypt it to `decrypted.html` and open it in a web browser. @@ -649,10 +649,10 @@ the key you wish to select is you can do: ``` - ./recode -R0EZ4PC1CC0PGTAQSOXWNMDRYKFUZEI -fenigma.html | ./prog - 2>/dev/null > enigma.deciphered.html + ./recode -R0EZ4PC1CC0PGTAQSOXWNMDRYKFUZEI -fenigma.txt | ./prog - 2>/dev/null > enigma.html ``` -Then open `enigma.deciphered.html` in your browser. A command is provided in +Then open `enigma.html` in your browser. A command is provided in [testing-procedure.html](testing-procedure.html) that does this too but it shows how you can use a file as input for the key instead as well as how I tested the code. diff --git a/2020/ferguson2/testing-procedure.html b/2020/ferguson2/testing-procedure.html index 6c92cc09f..eceffea94 100644 --- a/2020/ferguson2/testing-procedure.html +++ b/2020/ferguson2/testing-procedure.html @@ -464,8 +464,8 @@ to try and find the right key.

    fi # a simpler way to check that it works: - ./recode -Renigma.dat -fenigma.deciphered.html | ./prog - 2>/dev/null > enigma.html - ./recode -Renigma.dat -fenigma.html | ./prog - 2>/dev/null | diff -s - enigma.deciphered.html + ./recode -Renigma.dat -fenigma.html | ./prog - 2>/dev/null > enigma.txt + ./recode -Renigma.dat -fenigma.txt | ./prog - 2>/dev/null | diff -s - enigma.html ./recode -Robfuscation.key -fobfuscation.txt | ./prog - 2>/dev/null > out diff out obfuscation.md || echo "Obfuscation test 0.5 failed" @@ -499,7 +499,7 @@ document in the website. Still that should give you the idea.

    Historical note:

    At the time of development the server was CentOS but as Red Hat decided to axe it it is now Rocky Linux. The above script was only tested in macOS but it -should work fine in linux too. Also, the enigma.html part was added in June 2024 +should work fine in linux too. Also, the enigma.txt part was added in June 2024 which expects output so below when I say if I got any output there was a problem this is no longer true.

    Back to the testing:

    @@ -520,12 +520,12 @@ are the same under Fedora, CentOS and macOS but I have put the main testing platform as macOS because these days I mostly use my laptop (I tend to ssh into the other two boxes more and as for the CentOS it’s only console anyway. Since it’s just text I/O it an terminal emulator shouldn’t matter either.).

    -

    Command that might be used to decipher the enigma.html file:

    +

    Command that might be used to decipher the enigma.txt file:

    The following command can be used to decipher the file except that you must provide the key file (or the key as a string) with the correct key (see recode.html for a list of keys to try) in order to get correct output:

    -
            ./recode -Renigma.dat -fenigma.html | ./prog - 2>/dev/null > enigma.deciphered.html
    +
            ./recode -Renigma.dat -fenigma.txt | ./prog - 2>/dev/null > enigma.html

    Enjoy!

    diff --git a/2020/ferguson2/testing-procedure.md b/2020/ferguson2/testing-procedure.md index 844d5ec83..850cdcdad 100644 --- a/2020/ferguson2/testing-procedure.md +++ b/2020/ferguson2/testing-procedure.md @@ -45,8 +45,8 @@ to try and find the right key. fi # a simpler way to check that it works: - ./recode -Renigma.dat -fenigma.deciphered.html | ./prog - 2>/dev/null > enigma.html - ./recode -Renigma.dat -fenigma.html | ./prog - 2>/dev/null | diff -s - enigma.deciphered.html + ./recode -Renigma.dat -fenigma.html | ./prog - 2>/dev/null > enigma.txt + ./recode -Renigma.dat -fenigma.txt | ./prog - 2>/dev/null | diff -s - enigma.html ./recode -Robfuscation.key -fobfuscation.txt | ./prog - 2>/dev/null > out diff out obfuscation.md || echo "Obfuscation test 0.5 failed" @@ -84,7 +84,7 @@ document in the website. Still that should give you the idea. At the time of development the server was CentOS but as Red Hat decided to axe it it is now Rocky Linux. The above script was only tested in macOS but it -should work fine in linux too. Also, the enigma.html part was added in June 2024 +should work fine in linux too. Also, the enigma.txt part was added in June 2024 which expects output so below when I say if I got any output there was a problem this is no longer true. @@ -112,7 +112,7 @@ platform as macOS because these days I mostly use my laptop (I tend to ssh into the other two boxes more and as for the CentOS it's only console anyway. Since it's just text I/O it an terminal emulator shouldn't matter either.). -## Command that might be used to decipher the `enigma.html` file: +## Command that might be used to decipher the `enigma.txt` file: The following command can be used to decipher the file except that you must provide the key file (or the key as a string) with the correct key (see @@ -120,7 +120,7 @@ provide the key file (or the key as a string) with the correct key (see output: ``` - ./recode -Renigma.dat -fenigma.html | ./prog - 2>/dev/null > enigma.deciphered.html + ./recode -Renigma.dat -fenigma.txt | ./prog - 2>/dev/null > enigma.html ``` Enjoy!