Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)