A recursive permutation generator connected to two encryption systems built with OOP. Demonstrates class inheritance and composing components across files.
get_insertions(letter, permutations)— inserts a letter at every position in every string in a listget_permutations(sequence)— base case returns a single-character string; recursive case inserts the first character into all permutations of the remaining characters
Message— base class withbuild_shift_dict()(creates a shift mapping for all 26 letters, preserving case) andapply_shift()(applies the cipher)PlaintextMessage(Message)— stores shift value, builds encryption dict, generates encrypted textCiphertextMessage(Message)—decrypt_message()tries all 26 shifts and returns the one producing the most valid English words. Successfully decrypts an encrypted story file
SubMessage—build_transpose_dict()maps vowels according to a given permutation while consonants remain unchanged;apply_transpose()applies the mappingEncryptedSubMessage(SubMessage)—decrypt_message()tries all 120 vowel permutations (5! = 120, generated byget_permutationsfrom Part A) and returns the decryption yielding the most valid English words