title: Is it possible to write a program to break a random substitution cipher in python?
body: <p>In short I want to write a program that can accept any substitution cipher and decrypt it into all every possible solution. So if you gave it a random string of letters it would be able to take that and return every possible variation of the layout of that string, in the sense that if two letters are the same in the &quot;encrypted&quot; string they'll &quot;decrypt&quot; to the same letters in all of the results. However, it HAS to work for nonlinear substitutions, e.g. a -&gt; h, b -&gt; f, c -&gt; z, think of it like if you were to write a sentence and then choose random symbols to represent the letters, there's no way of knowing what the symbols represent but because there would be duplicates of them you can work it out based on their positioning. Does that sorta make sense? Is this something that is possible?</p>