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)
def test_rail_fence_decipher_h4(self): expected = "KRYPTOGRAFIA" encrypted = "KGRORAYTAIPF" result = Cipher.railFence_decipher(encrypted, h=4) self.assertEquals(expected, result)
def test_rail_fence_decipher_h3(self): expected = "SZYFR PŁOTKOWY ZNANY BYŁ JUŻ W STAROŻYTNOŚCI" encrypted = "SROWN TŻOZF ŁTOYZAYBŁJŻWSAOYNŚIYPK NYU RTC" result = Cipher.railFence_decipher(encrypted, h=3) self.assertEquals(expected, result)