Exemple #1
0
 def pack(self, password):
     new_data = json.dumps(self.to_dict())
     new_data_compressed = zlib.compress(new_data.encode())
     return better_aes_encrypt(password, new_data_compressed)
Exemple #2
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')))
Exemple #3
0
 def pack(self, password):
     assert not self.is_locked, "Cannot pack a wallet with locked/encrypted accounts."
     new_data = json.dumps(self.to_dict())
     new_data_compressed = zlib.compress(new_data.encode())
     return better_aes_encrypt(password, new_data_compressed)
Exemple #4
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'))