Exemplo n.º 1
0
def test_decode_msg_random_key():
    #     'abcdefghijklmnopqrstuvwxyz'
    key = '!)"(£*%&><@abcdefghijklmno'
    coder = Coder(key)
    plaintext = 'calendario'
    ciphertext = '"!a£c(!g>d'
    assert coder.decrypt(ciphertext) == plaintext
Exemplo n.º 2
0
def test_key_is_alphabet_decode_msg():
    key = 'abcdefghijklmnopqrstuvwxyz'
    coder = Coder(key)
    ciphertext = 'test'
    plaintext = 'test'
    assert coder.decrypt(ciphertext) == plaintext
Exemplo n.º 3
0
def test_decode_msg_a_equals_at():
    key = '@bcdefghijklmnopqrstuvwxyz'
    coder = Coder(key)
    plaintext = 'banana'
    ciphertext = 'b@n@n@'
    assert coder.decrypt(ciphertext) == plaintext
Exemplo n.º 4
0
def test_decode_msg_a_equals_b():
    key = 'bacdefghijklmnopqrstuvwxyz'
    coder = Coder(key)
    ciphertext = 'abnbnb'
    plaintext = 'banana'
    assert coder.decrypt(ciphertext) == plaintext