-
Notifications
You must be signed in to change notification settings - Fork 29
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: TTL #17
Comments
I have same problem. p.s. I hope since then no one else has encountered such an error. But still, I'll leave this entry here. Suddenly, this help someone :D |
From looking at Fernet. The ttl parameter is basically an expiration in seconds of the encrypted data. You can select this when you decode, ttl is not baked into the encrypted data. When the data is encrypted, a timestamp is saved with your encrypted data. When your decrypting you can optionally pass in ttl if you want to reject tokens that are ttl seconds old. Basically with a ttl decrypt will fail if your current time is greater than the original timestamp + ttl. It also checks if the timestamp on the encrypted message is basically in the future, which is invalid. Max clock skew is a grace period in case your computer's clock is slightly out of sync with the clock on computer that encrypted. So if fails if current time + clock_skew < timestamp, meaning it looks like it was encrypted in the future which means the clocks are out of sync. Here is the Python implementation's code for checking ttl: |
Hi,
First, thanks for your work releasing this lib.
I have a problem when decoding, it work for a few minutes (not exactly sure how much) but then after a while I got an TTL error. I am decoding a password multiple time so it may be the cause?
Here is my code :
(at first I didn't set the ttl but I did it to test)
Here is the console log of the token after I created it :
And here is the error on the decode:
Can you tell me more about the ttl? What is it's purpose? The duration of the validity for the Token just created? The duration for a password to be decoded? (which is why I tried to add the TTL manually, same TTL as the one I choose for this password).
Cheer
The text was updated successfully, but these errors were encountered: