# Testing procedure Because of the significant amount of possible combinations of settings and the fact that based on each setting if the text does not have the same sequence - even one letter off - then you cannot get the same output - I had to come up with a way to test the entry. Here's the problem with just the default settings: the same number of characters, the same starting, but the moment a letter differs the rest of the message will change even if the rest of the message is the same: $ echo A man and his dog walked in the park...|./prog G spy ige lqk eav ptccpu di clm erkh... $ echo A dog and his man walked in the park...|./prog G luq ige lqk jou ptccpu di clm erkh... $ echo A man and his dog and its dog walked in the park...|./prog G spy ige lqk eav mbt bwz iwb jsojus pe hnt imny... As can be seen as soon as a letter is different in the sequence it changes the result. So what could be done? First of all I had to make sure that the invocations I gave could be properly duplicated. To do this I had key files that I could use via recode and also I did input some manually. This includes the cake recipe key file but I will not include the file but only the invocation I used as such. This is the general format of the test script: STR="$(echo ABC | ./prog|tail -n1)" if [ "${STR}" != "GYM" ]; then echo "Failed 'ABC' test" exit 1 fi STR="$(echo "${STR}" | ./prog|tail -n1)" if [ "${STR}" != "ABC" ]; then echo "Failed 'GYM' test" exit 1 fi ./recode -Rchocolate-cake.key -fchocolate-cake.md | ./prog - 2>/dev/null > out diff out cake.md || echo "Cake test 0.5 failed" ./recode -Rchocolate-cake.key -fcake.md | ./prog - 2>/dev/null > out2 diff out2 chocolate-cake.md || echo "Cake test 1.0 failed" ( echo -n ; cat chocolate-cake.md ) | ./prog - 2>/dev/null > out diff out cake.md || echo "Cake test 1.5 failed" ( echo -n ; cat cake.md ) | ./prog - 2>/dev/null > out2 diff out2 chocolate-cake.md || echo "Cake test 2.0 failed" ./recode -Robfuscation.key -fobfuscation.txt | ./prog - 2>/dev/null > out diff out obfuscation.md || echo "Obfuscation test 0.5 failed" ./recode -Robfuscation.key -fout | ./prog - 2>/dev/null > out2 diff out2 obfuscation.txt || echo "Obfuscation test 1.0 failed" ./prog < prog.c > out ./prog < out > out2 diff out2 prog.c || echo "Self obfuscation test 1.0 failed" mkdir -p tests || exit 1 cd tests || exit 1 let n=0 while [ "${n}" -lt 100 ]; do for f in ../input.txt ../prog.c ../README.md ../recode.md ../recode.1 ../enigma.1; do ../recode -r -oconfig -f"${f}" | ../prog - 2>/dev/null > out ../recode -Rconfig -fout | ../prog - 2>/dev/null > out2 diff out2 "${f}" || echo "Failed randomised test for file: ${f}" done let n=n+1 done rm -f out out2 cd .. rm -f out out2 If I get any output I know there's a problem. I did not get any output and since this tested the default settings, two customised settings as well as 100 randomised runs for each of the files listed in the script I believe this works well. Tests run under Fedora, CentOS and macOS with the same results. I believe this entry can be used with EBCDIC as it appears that the characters used are in contiguous sequence but I do not know for certain. Neither do I know about big endian: I don't believe it matters but I have no way to test this either. If there are any discrepancies in the recode.md or any other thing I pasted it's probably because of the way I changed the display (or else the random option in recode!). If there are any inconsistencies in input/output one also has to be certain that input was put in correctly (as I discussed earlier). The results of the script 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.).