Tags: crypto
Rating:
TLDR
* With SymPy, compute the symbolic expressions of Encrypt and Decrypt in the (non-commutative) permutation group (or do it by hand, depending on your patience level).
* Use properties of permutations to manipulate the expressions and obtain a pair (x',x), where x' is the conjugate permutation of x with the key.
* Considering the property that conjugate permutations have the same cycle type, recover the key by trying all possibilities for each cycle, and using the second plaintext-ciphertext pair for testing.