Exemplo n.º 1
0
 def test_better_encrypt_decrypt(self):
     self.assertEqual(
         b'valuable value',
         better_aes_decrypt(
             'super secret',
             better_aes_encrypt('super secret', b'valuable value')))
Exemplo n.º 2
0
 def unpack(cls, password, encrypted):
     decrypted = better_aes_decrypt(password, encrypted)
     decompressed = zlib.decompress(decrypted)
     return json.loads(decompressed)
Exemplo n.º 3
0
 def test_better_decrypt_error(self):
     with self.assertRaises(InvalidPasswordError):
         better_aes_decrypt(
             'super secret but wrong',
             better_aes_encrypt('super secret', b'valuable value'))