def test_cesar_decipher(self):
        expected = "SZYFR CEZARA JEST PRZYKŁADEM SZYFRU PRZESUWAJĄCEGO"
        encrypted = "TŻŹHŚ DFŻBŚB LFTV RŚŻŹŁNBĘFŃ TŻŹHŚW RŚŻFTWYBLCDFIP"
        key = 2

        result = Cipher.cesar(encrypted, -key)
        self.assertEquals(expected, result)
Exemple #2
0
def zad_3():
    encrypted = "ZAŁNKAIPKAEAOWDNRYDWKLIMAZOOU"

    for i in range(2, len(encrypted)):  # 4
        result = Cipher.railFence_decipher(encrypted, i)
        # print(i)
        # print(result)

    result2 = Cipher.railFence_decipher(encrypted, 4)
    print("pkt 2")
    print(result2)

    result3 = Cipher.railFence_encipher(result2, 2)
    print("pkt 3")
    print(result3)

    result4 = Cipher.cesar(result2)
    print("pkt 4")
    print(result4)
Exemple #3
0
def zad_2():
    message = "LICZBA WYSOCE ZŁOŻONA"

    result1 = Cipher.railFence_encipher(message, 3)
    print("1")
    print(result1)

    result2 = Cipher.matrix_cipher(message, 3)
    print("2")
    print(result2)

    result3 = Cipher.column_encipher(message, "NWD")
    print("3")
    print(result3)

    result4 = Cipher.vigenere_encipher(message, "NWW", len("NWW"))
    print("4")
    print(result4)

    result5 = Cipher.cesar(message)
    print("5")
    print(result5)