I want to generate a link that will be given to a user. On this link, as a parameter, I will add a token that will be valid only for a few days. So after that time, the server will check the token, see that it's not valid anymore, and disallow the download.
What I would like to do is create a token that doesn't require any server side state, i.e. that doesn't require me to create a table with the token/expiration date association.
I'm wondering is there any clever algorithm that would allow me to do that? Basically a token that cannot be decrypted after a given time (assuming that the decryption algorithm on the server is using the real, current, time).