Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Token Error: cryptography.fernet.InvalidToken #2

Open
TianaCo opened this issue Nov 6, 2018 · 2 comments
Open

Invalid Token Error: cryptography.fernet.InvalidToken #2

TianaCo opened this issue Nov 6, 2018 · 2 comments

Comments

@TianaCo
Copy link

TianaCo commented Nov 6, 2018

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

@Mintpcc
Copy link

Mintpcc commented Dec 21, 2018

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.

@willylulu
Copy link
Owner

Thank you for your help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants