ciphers.bifid ============= .. py:module:: ciphers.bifid .. autoapi-nested-parse:: The Bifid Cipher uses a Polybius Square to encipher a message in a way that makes it fairly difficult to decipher without knowing the secret. https://www.braingle.com/brainteasers/codes/bifid.php Attributes ---------- .. autoapisummary:: ciphers.bifid.SQUARE Classes ------- .. autoapisummary:: ciphers.bifid.BifidCipher Module Contents --------------- .. py:class:: BifidCipher .. py:method:: decode(message: str) -> str Return the decoded version of message according to the polybius cipher >>> BifidCipher().decode('qtltbdxrxlk') == 'testmessage' True .. py:method:: encode(message: str) -> str Return the encoded version of message according to the polybius cipher >>> BifidCipher().encode('testmessage') == 'qtltbdxrxlk' True >>> BifidCipher().encode('Test Message') == 'qtltbdxrxlk' True >>> BifidCipher().encode('test j') == BifidCipher().encode('test i') True .. py:method:: letter_to_numbers(letter: str) -> numpy.ndarray Return the pair of numbers that represents the given letter in the polybius square >>> np.array_equal(BifidCipher().letter_to_numbers('a'), [1,1]) True >>> np.array_equal(BifidCipher().letter_to_numbers('u'), [4,5]) True .. py:method:: numbers_to_letter(index1: int, index2: int) -> str Return the letter corresponding to the position [index1, index2] in the polybius square >>> BifidCipher().numbers_to_letter(4, 5) == "u" True >>> BifidCipher().numbers_to_letter(1, 1) == "a" True .. py:attribute:: SQUARE .. py:data:: SQUARE :value: [['a', 'b', 'c', 'd', 'e'], ['f', 'g', 'h', 'i', 'k'], ['l', 'm', 'n', 'o', 'p'], ['q', 'r',...