Пример #1
0
 def test_AES(self):
     cipher = AESCipher()
     string = "The quick brown fox jumps over the lazy dog."
     ct = cipher.encrypt(string)
     self.assertNotEqual(ct, string)
     pt = cipher.decrypt(ct)
     self.assertEqual(pt, string)
Пример #2
0
 def test_AES(self):
     cipher = AESCipher()
     string = "The quick brown fox jumps over the lazy dog."
     ct = cipher.encrypt(string)
     self.assertNotEqual(ct, string)
     pt = cipher.decrypt(ct)
     self.assertEqual(pt, string)
Пример #3
0
 def test_AES_error(self):
     cipher = AESCipher()
     string = "The quick brown fox jumps over the lazy dog."
     ct = cipher.encrypt(string)[:10] + "randomgarbage"
     self.assertRaises(TypeError, cipher.decrypt, ct)
Пример #4
0
 def test_AES_error(self):
     cipher = AESCipher()
     string = "The quick brown fox jumps over the lazy dog."
     ct = cipher.encrypt(string)[:10] + "randomgarbage"
     self.assertRaises(TypeError, cipher.decrypt, ct)