I thought I'd draw attention to this in case anybody likes playingsecret agent. The function key takes any ASCII file and generates
a key. The function encrypt encrypts any ASCII file f and outputs
the encrypted f.txt. The function decrypt decrypts any ASCII file g
and outputs the decrypted file g.txt.
The AI def of this kind of encoding is
A homophonic substitution cipher is an encryption method that assigns multiple distinct ciphertext symbols or numbers to a single plaintext letter, based on how often that letter appears in a language.
This is not quite right wrt the stlib program here. The multiple association
is to the locations of the letter in the text which in a large text runs into thousands.
So the letter e for instance has 62,366 possible encryptions using the key I chose;
each selected by a random number generator.
ChatGPT remarks
Very hard to crack from ciphertext alone, assuming the exact key file stays unknown and the random choices are sound. The large number of possible positions for each common byte defeats the obvious frequency attack.
Mark