Skip to content

Ciphers using a 5x5 keysquare can't encipher messages containing 'j' #8

Description

@jina312

If I use a cipher that requires a 5x5 keysquare with 'j' omitted, I can't encipher a message that includes the letter 'j'.

Test case:

>>> from pycipher import ADFGX
>>> ADFGX('phqgmeaylnofdxkrcvszwbuti','HELLO').decipher('bluejay')    
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/.../lib/python3.6/site-packages/pycipher/adfgx.py", line 52, in decipher
    step1 = PolybiusSquare(self.key,size=5,chars='ADFGX').decipher(step2)
  File "/Users/.../lib/python3.6/site-packages/pycipher/polybius.py", line 65, in decipher
    ret += self.decipher_pair(string[i:i+2])
  File "/Users/.../lib/python3.6/site-packages/pycipher/polybius.py", line 32, in decipher_pair
    row = self.chars.index(pair[0])
ValueError: substring not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions