
The individual methods are simple and easy to understand.
#Polyalphabetic cipher code#
I am trying to write the simplest to understand code possible, each function has documentation and examples and I tried to use the best style possible.

Return(encrypt(text,key,reverse_operation=True)) 'the quick brown fox jumps over the lazy dog' > decrypt("zcy vcohg jltst aic rarla iaax obj tgeu lil","gvufigfwiufw") 'lorem ipsum dolor sit amet, consectetur adipiscing elit' > decript('wokmz masnu qswok avx lmxb, psysxkgieuk iqmailkvrr eeqg',"latine") Index_of_key = cycle_increment_index(index_of_key,key)ĭecrypts the text previously encrypted with a polyalphabetic cipher. If char in CHARACTERS_THAT_MUST_REMAIN_THE_SAME: 'zcy vcohg jltst aic rarla iaax obj tgeu lil' > encrypt("the quick brown fox jumps over the lazy dog","gvufigfwiufw") 'wokmz masnu qswok avx lmxb, psysxkgieuk iqmailkvrr eeqg' > encrypt("lorem ipsum dolor sit amet, consectetur adipiscing elit","latine") Uses the alphabetic value of letters to convert a wordĭef encrypt(text,key,reverse_operation=False):Įncrypts the text with a polyalphabetic cipher. > "".join()Ĭurrent_letter_value = ALPHABET.find(letter)

If the alphabet ends go back to the start. Shifts a letter in the alphabet by the value, """ĬHARACTERS_THAT_MUST_REMAIN_THE_SAME = string.digits + string.punctuation + string.whitespace """ This programme implements a polyalphabetic cipher. I am trying to write the simplest to undestand code possible, each function has documentation and examples and I tried to use the best style possible.
