def test_bifid(): raises(ValueError, lambda: encipher_bifid("abc", "b", "abcde")) assert encipher_bifid("abc", "b", "abcd") == "bdb" raises(ValueError, lambda: decipher_bifid("bdb", "b", "abcde")) assert encipher_bifid("bdb", "b", "abcd") == "abc" raises(ValueError, lambda: bifid_square("abcde")) assert bifid5_square("B") == bifid5_square("BACDEFGHIKLMNOPQRSTUVWXYZ") assert bifid6_square("B0") == bifid6_square("B0ACDEFGHIJKLMNOPQRSTUVWXYZ123456789")
def test_bifid(): raises(ValueError, lambda: encipher_bifid('abc', 'b', 'abcde')) assert encipher_bifid('abc', 'b', 'abcd') == 'bdb' raises(ValueError, lambda: decipher_bifid('bdb', 'b', 'abcde')) assert encipher_bifid('bdb', 'b', 'abcd') == 'abc' raises(ValueError, lambda: bifid_square('abcde')) assert bifid5_square("B") == \ bifid5_square('BACDEFGHIKLMNOPQRSTUVWXYZ') assert bifid6_square('B0') == \ bifid6_square('B0ACDEFGHIJKLMNOPQRSTUVWXYZ123456789')
def test_bifid5_square(): A = alphabet_of_cipher() A.remove("J") f = lambda i, j: symbols(A[5*i + j]) M = Matrix(5, 5, f) assert bifid5_square("") == M
def test_bifid5_square(): A = bifid5 f = lambda i, j: symbols(A[5*i + j]) M = Matrix(5, 5, f) assert bifid5_square("") == M
def test_bifid5_square(): A = bifid5 f = lambda i, j: symbols(A[5 * i + j]) M = Matrix(5, 5, f) assert bifid5_square("") == M
def test_bifid5_square(): A = alphabet_of_cipher() A.remove("J") f = lambda i, j: symbols(A[5 * i + j]) M = Matrix(5, 5, f) assert bifid5_square("") == M