(27-06-2025, 11:08 AM)quimqu wrote: You are not allowed to view links. Register or Login to view.I attach the function to cipher:
def homophonic_cipher_3c(words):
letter_map = {c: [c + str(i) for i in range(3)] for c in 'abcdefghijklmnopqrstuvwxyz'}
out = []
for word in words:
new_word = ''.join(random.choice(letter_map.get(c, [c])) for c in word)
out.append(new_word)
return out
It's a simple homophonic cipher. First creates a letter map for each alphabetical character (so, each letter will have three different letters to choose randomly during the cipher).
In the cipher, I use alphabetical characters. Imagine that I use voynichese characters instead. I would use only the CUVA symbols. But beware, in order to decipher, it is tricky, as one CUVA symbol might be deciphered also into 3 natural language charaters. So there must be another hidden rule to decipher.
I'm not sure this works as a homophonic cipher, it looks like this is just adding a random number from (0, 1, 2) after each character. Since you perform a string join, you will convert:
"manuscript" to something like "m0a2n0u1s0c1r0i1p2t0"
If you do simple character ngrams later, this can create all kinds of weird results.

