Esempio n. 1
0
 def test_aes_homomorphic(self):
     """Make sure AES is homomorphic."""
     payload = u'\u66f4\u7a33\u5b9a\u7684\u4ea4\u6613\u5e73\u53f0'
     password = u'secret'
     enc = pw_encode(payload, password)
     dec = pw_decode(enc, password)
     self.assertEqual(dec, payload)
Esempio n. 2
0
 def test_aes_homomorphic(self):
     """Make sure AES is homomorphic."""
     payload = u'\u66f4\u7a33\u5b9a\u7684\u4ea4\u6613\u5e73\u53f0'
     password = u'secret'
     enc = pw_encode(payload, password)
     dec = pw_decode(enc, password)
     self.assertEqual(dec, payload)
Esempio n. 3
0
 def test_aes_deencode_without_password(self):
     """When not passed a password, pw_decode is noop on the payload."""
     payload = u'\u66f4\u7a33\u5b9a\u7684\u4ea4\u6613\u5e73\u53f0'
     enc = pw_decode(payload, None)
     self.assertEqual(payload, enc)
Esempio n. 4
0
 def test_aes_deencode_without_password(self):
     """When not passed a password, pw_decode is noop on the payload."""
     payload = u'\u66f4\u7a33\u5b9a\u7684\u4ea4\u6613\u5e73\u53f0'
     enc = pw_decode(payload, None)
     self.assertEqual(payload, enc)