celeba-hq-modified icon indicating copy to clipboard operation
celeba-hq-modified copied to clipboard

Invalid Token Error: cryptography.fernet.InvalidToken

Open TianaCo opened this issue 5 years ago • 2 comments

Traceback (most recent call last): File "h5tool.py", line 706, in execute_cmdline(sys.argv) File "h5tool.py", line 701, in execute_cmdline func(**vars(args)) File "h5tool.py", line 607, in create_celeba_hq aidx, aimg64, aimg128, aimg256, aimg512, aimg1024 = process_func(x) File "h5tool.py", line 582, in process_func delta = np.frombuffer(bz2.decompress(cryptography.fernet.Fernet(key).decrypt(delta_bytes)), dtype=np.uint8).reshape(3, 1024, 1024) File "/home/ubuntu/miniconda3/envs/CelebAHQ2/lib/python2.7/site-packages/cryptography/fernet.py", line 75, in decrypt return self._decrypt_data(data, timestamp, ttl) File "/home/ubuntu/miniconda3/envs/CelebAHQ2/lib/python2.7/site-packages/cryptography/fernet.py", line 119, in _decrypt_data self._verify_signature(data) File "/home/ubuntu/miniconda3/envs/CelebAHQ2/lib/python2.7/site-packages/cryptography/fernet.py", line 108, in _verify_signature raise InvalidToken cryptography.fernet.InvalidToken

TianaCo avatar Nov 06 '18 19:11 TianaCo

Traceback (most recent call last): File "h5tool.py", line 706, in execute_cmdline(sys.argv) File "h5tool.py", line 701, in execute_cmdline func(**vars(args)) File "h5tool.py", line 607, in create_celeba_hq aidx, aimg64, aimg128, aimg256, aimg512, aimg1024 = process_func(x) File "h5tool.py", line 582, in process_func delta = np.frombuffer(bz2.decompress(cryptography.fernet.Fernet(key).decrypt(delta_bytes)), dtype=np.uint8).reshape(3, 1024, 1024) File "/home/ubuntu/miniconda3/envs/CelebAHQ2/lib/python2.7/site-packages/cryptography/fernet.py", line 75, in decrypt return self._decrypt_data(data, timestamp, ttl) File "/home/ubuntu/miniconda3/envs/CelebAHQ2/lib/python2.7/site-packages/cryptography/fernet.py", line 119, in _decrypt_data self._verify_signature(data) File "/home/ubuntu/miniconda3/envs/CelebAHQ2/lib/python2.7/site-packages/cryptography/fernet.py", line 108, in _verify_signature raise InvalidToken cryptography.fernet.InvalidToken

you can add a line like this: "salt = bytes(origis_file, 'ascii')" before salt used.

Mintpcc avatar Dec 21 '18 17:12 Mintpcc

Thank you for your help :)

willylulu avatar Dec 22 '18 18:12 willylulu