Offline licenses and clock tampering #25
-
Hi Zeke, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is covered here: https://keygen.sh/docs/api/security/#security-clock-tampering. The gist of it is: you can't really prevent this attack vector, because what the offline device says is the time, frankly, is the time. However, you can make clock tampering harder to pull off. But the more defenses you add, the more complexity you add as well. For example, you could assert the following for a License File (or signed key):
Of course, the bad actor could set their system clock to a time between Outside of these assertions, there are more complex options, like writing an inconspicuous config or log file to disk and then periodically checking the file's created (and modified) timestamps to loosely keep track of the clock. You would update the modified at value each time the file is checked, giving you a last "good" time. Then, if a timestamp for the file is ever in the future more than some threshold (note: timezone changes during travel, and daylight savings time), then it may be safe to assume that the clock has been tampered with. You could also do the same thing by writing a timestamp to a secure system registry, for example, instead of a file. |
Beta Was this translation helpful? Give feedback.
This is covered here: https://keygen.sh/docs/api/security/#security-clock-tampering. The gist of it is: you can't really prevent this attack vector, because what the offline device says is the time, frankly, is the time. However, you can make clock tampering harder to pull off. But the more defenses you add, the more complexity you add as well.
For example, you could assert the following for a License File (or signed key):
issued
date is not greater than the current UTC system time, indicating the user has set their system clock to the past, also known as clock tampering.expiry
date is not less than the current UTC system time, indicating an expired license file.Of course, t…