trevorswann / CipherTool

Command line cipher tool for encoding and decoding text with different types of ciphers.
MIT License
1 stars 0 forks source link

Homophonic Substitution Cipher #3

Open trevorswann opened 3 years ago

trevorswann commented 3 years ago

Add in functionality for homophonic cipher. Each letter of the alphabet is replaced by any number of other letters

trevorswann commented 3 years ago

Likely done by prompting the user to enter as many pairs of letters ('XY') as they want, where the first letter in the pair corresponds to a potential letter in the plaintext, and the second letter in the pair is what that letter would map to in the cipher. This gets tricky as we can have many Xs map to the same Y, but each X by itself can only map to a single Y. Though this would make decoding tricky, as there could be multiple options for plaintext X if you were decoding from cipher text Y, but we'll cross that bridge when we come to it. Would increase execution time quite a bit, but I suppose we could try every combination and compare against a dictionary to find the most likely plaintext solution, but that is HEAVILY dependent on the size of the cipher text and the number of Ys that map to multiple Xs.