I need to store a frequently-changing set of encrypted data in a database. This can be encrypted and decrypted with an internal key. The data is based upon other metrics within the system, mostly the number of times various things have happened.
Encryption in this case only provides security by obscurity, in that if a person figures out where this data is stored and has database access then they can simply 'roll back' this encrypted blob to an earlier version, thus reverting its contents to a past state.
An HMAC of the data wouldn't help, as an adversary could simply roll back the HMAC along with the message it represents.
Is there a way that I can, at least, detect cryptographically that this data has been rolled back?
My feeling is that I'll need to make some element of the stored data refer to the current state of the system, or make it time-based.