コード例 #1
0
ファイル: tests.py プロジェクト: crcollins/chemtools-webapp
 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
ファイル: tests.py プロジェクト: crcollins/chemtools-webapp
 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
ファイル: tests.py プロジェクト: crcollins/chemtools-webapp
 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
ファイル: tests.py プロジェクト: crcollins/chemtools-webapp
 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)