Merge pull request #2743 from xexyl/enigma

This commit is contained in:
Landon Curt Noll authored and GitHub committed 2024-11-02 07:31:35 -07:00
commit b4da848429
10 files changed
+23 -22

No files matched your search

+1 -1
View File
@@ -46,7 +46,7 @@
"entry_text" : "original source code" "entry_text" : "original source code"
}, },
{ {
"file_path" : "enigma.html", "file_path" : "enigma.txt",
"inventory_order" : 100, "inventory_order" : 100,
"OK_to_edit" : true, "OK_to_edit" : true,
"display_as" : "text", "display_as" : "text",
+1
View File
@@ -6,6 +6,7 @@ chocolate-cake.key
config config
decrypted.html decrypted.html
decrypted-source.html decrypted-source.html
enigma.html
encrypt.sh encrypt.sh
indent indent
indent.c indent.c
+1 -1
View File
@@ -115,7 +115,7 @@ PROG= prog
OBJ= ${PROG}.o OBJ= ${PROG}.o
DATA= enigma.1 input.txt obfuscation.key \ DATA= enigma.1 input.txt obfuscation.key \
obfuscation.md obfuscation.txt recode.1 recode.md \ obfuscation.md obfuscation.txt recode.1 recode.md \
try.this.txt enigma.html try.this.txt enigma.txt
TARGET= ${PROG} recode TARGET= ${PROG} recode
# #
ALT_OBJ= ${PROG}.alt.o ALT_OBJ= ${PROG}.alt.o
+2 -2
View File
@@ -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) - 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! - NOTE: see [recode.html][] (or [recode.html](recode.html) for details about how to decrypt this!
* [testing-procedure][] * [testing-procedure][]
- How the author tested the code and why it was necessary to do it in the way it was - How the author tested the code and why it was necessary to do it in the way it was
[recode.html]: recode.html [recode.html]: recode.html
[enigma.html]: enigma.html [enigma.txt]: enigma.txt
[testing-procedure]: testing-procedure.html [testing-procedure]: testing-procedure.html
File renamed without changes.
+2 -2
View File
@@ -515,7 +515,7 @@ out! Can you figure out why this works this way?</p>
<ul> <ul>
<li>Some useful information about <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/recode.c">recode.c</a></li> <li>Some useful information about <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/recode.c">recode.c</a></li>
</ul></li> </ul></li>
<li><a href="enigma.html">enigma.html</a> <li><a href="enigma.txt">enigma.txt</a>
<ul> <ul>
<li>NOTE: see <a href="recode.html">recode.html</a> (or <a href="recode.html">recode.html</a> for details about how to decrypt this!</li> <li>NOTE: see <a href="recode.html">recode.html</a> (or <a href="recode.html">recode.html</a> for details about how to decrypt this!</li>
</ul></li> </ul></li>
@@ -1145,7 +1145,7 @@ email but I’m more likely to respond to mastodon messages.</p>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/Makefile">Makefile</a> - entry Makefile</li> <li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/prog.alt.c">prog.alt.c</a> - alternate source code</li> <li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/prog.alt.c">prog.alt.c</a> - alternate source code</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/prog.orig.c">prog.orig.c</a> - original source code</li> <li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/prog.orig.c">prog.orig.c</a> - original source code</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/enigma.html">enigma.html</a> - secret message in a html file to decrypt</li> <li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2020/ferguson2/enigma.txt">enigma.txt</a> - secret message in a html file to decrypt</li>
<li><a href="input.txt">input.txt</a> - sample input</li> <li><a href="input.txt">input.txt</a> - sample input</li>
<li><a href="obfuscation.html">obfuscation.html</a> - about the obfuscation of this entry</li> <li><a href="obfuscation.html">obfuscation.html</a> - about the obfuscation of this entry</li>
<li><a href="obfuscation.txt">obfuscation.txt</a> - about the obfuscation of this entry - encrypted with entry</li> <li><a href="obfuscation.txt">obfuscation.txt</a> - about the obfuscation of this entry - encrypted with entry</li>
+3 -3
View File
@@ -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 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!</p> explore this entry if you have to use the Enigma machine to read the message!</p>
<p>So this is what I offer: if you take one of the settings below and run the <p>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 <a href="enigma.txt">enigma.txt</a> you will
unlock a html file with something special in it. I recommend you decrypt it to unlock a html file with something special in it. I recommend you decrypt it to
<code>decrypted.html</code> and open it in a web browser.</p> <code>decrypted.html</code> and open it in a web browser.</p>
<p>The correct settings is listed below but <em>you</em> must determine which one is the <p>The correct settings is listed below but <em>you</em> must determine which one is the
@@ -919,8 +919,8 @@ think that I would give too much away? :)</p>
the key you wish to select is</p> the key you wish to select is</p>
<pre><code> 0EZ4PC1CC0PGTAQSOXWNMDRYKFUZEI</code></pre> <pre><code> 0EZ4PC1CC0PGTAQSOXWNMDRYKFUZEI</code></pre>
<p>you can do:</p> <p>you can do:</p>
<pre><code> ./recode -R0EZ4PC1CC0PGTAQSOXWNMDRYKFUZEI -fenigma.html | ./prog - 2&gt;/dev/null &gt; enigma.deciphered.html</code></pre> <pre><code> ./recode -R0EZ4PC1CC0PGTAQSOXWNMDRYKFUZEI -fenigma.txt | ./prog - 2&gt;/dev/null &gt; enigma.html</code></pre>
<p>Then open <code>enigma.deciphered.html</code> in your browser. A command is provided in <p>Then open <code>enigma.html</code> in your browser. A command is provided in
<a href="testing-procedure.html">testing-procedure.html</a> that does this too but it <a href="testing-procedure.html">testing-procedure.html</a> that does this too but it
shows how you can use a file as input for the key instead as well as how I shows how you can use a file as input for the key instead as well as how I
tested the code.</p> tested the code.</p>
+3 -3
View File
@@ -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! 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 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 unlock a html file with something special in it. I recommend you decrypt it to
`decrypted.html` and open it in a web browser. `decrypted.html` and open it in a web browser.
@@ -649,10 +649,10 @@ the key you wish to select is
you can do: you can do:
``` <!---sh--> ``` <!---sh-->
./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 [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 shows how you can use a file as input for the key instead as well as how I
tested the code. tested the code.
+5 -5
View File
@@ -464,8 +464,8 @@ to try and find the right key.</p>
fi fi
# a simpler way to check that it works: # a simpler way to check that it works:
./recode -Renigma.dat -fenigma.deciphered.html | ./prog - 2&gt;/dev/null &gt; enigma.html ./recode -Renigma.dat -fenigma.html | ./prog - 2&gt;/dev/null &gt; enigma.txt
./recode -Renigma.dat -fenigma.html | ./prog - 2&gt;/dev/null | diff -s - enigma.deciphered.html ./recode -Renigma.dat -fenigma.txt | ./prog - 2&gt;/dev/null | diff -s - enigma.html
./recode -Robfuscation.key -fobfuscation.txt | ./prog - 2&gt;/dev/null &gt; out ./recode -Robfuscation.key -fobfuscation.txt | ./prog - 2&gt;/dev/null &gt; out
diff out obfuscation.md || echo &quot;Obfuscation test 0.5 failed&quot; diff out obfuscation.md || echo &quot;Obfuscation test 0.5 failed&quot;
@@ -499,7 +499,7 @@ document in the website. Still that should give you the idea.</p>
<h3 id="historical-note">Historical note:</h3> <h3 id="historical-note">Historical note:</h3>
<p>At the time of development the server was CentOS but as Red Hat decided to axe <p>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 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 which expects output so below when I say if I got any output there was a problem
this is no longer true.</p> this is no longer true.</p>
<h2 id="back-to-the-testing">Back to the testing:</h2> <h2 id="back-to-the-testing">Back to the testing:</h2>
@@ -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 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 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.).</p> it’s just text I/O it an terminal emulator shouldn’t matter either.).</p>
<h2 id="command-that-might-be-used-to-decipher-the-enigma.html-file">Command that might be used to decipher the <code>enigma.html</code> file:</h2> <h2 id="command-that-might-be-used-to-decipher-the-enigma.txt-file">Command that might be used to decipher the <code>enigma.txt</code> file:</h2>
<p>The following command can be used to decipher the file except that you must <p>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 provide the key file (or the key as a string) with the correct key (see
<a href="recode.html">recode.html</a> for a list of keys to try) in order to get correct <a href="recode.html">recode.html</a> for a list of keys to try) in order to get correct
output:</p> output:</p>
<pre><code> ./recode -Renigma.dat -fenigma.html | ./prog - 2&gt;/dev/null &gt; enigma.deciphered.html</code></pre> <pre><code> ./recode -Renigma.dat -fenigma.txt | ./prog - 2&gt;/dev/null &gt; enigma.html</code></pre>
<p>Enjoy! <p>Enjoy!
<!-- AFTER: last line of markdown file: 2020/ferguson2/testing-procedure.md --></p> <!-- AFTER: last line of markdown file: 2020/ferguson2/testing-procedure.md --></p>
+5 -5
View File
@@ -45,8 +45,8 @@ to try and find the right key.
fi fi
# a simpler way to check that it works: # 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 > enigma.txt
./recode -Renigma.dat -fenigma.html | ./prog - 2>/dev/null | diff -s - enigma.deciphered.html ./recode -Renigma.dat -fenigma.txt | ./prog - 2>/dev/null | diff -s - enigma.html
./recode -Robfuscation.key -fobfuscation.txt | ./prog - 2>/dev/null > out ./recode -Robfuscation.key -fobfuscation.txt | ./prog - 2>/dev/null > out
diff out obfuscation.md || echo "Obfuscation test 0.5 failed" 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 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 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 which expects output so below when I say if I got any output there was a problem
this is no longer true. 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 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.). 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 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 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: output:
``` <!---sh--> ``` <!---sh-->
./recode -Renigma.dat -fenigma.html | ./prog - 2>/dev/null > enigma.deciphered.html ./recode -Renigma.dat -fenigma.txt | ./prog - 2>/dev/null > enigma.html
``` ```
Enjoy! Enjoy!