Detect tampering of data I have the following problem:
There are $n$ users and each users fills in three data points per day, this are three integers between say $-10$ and $10$. I have access to the database and hence I am able to modify this data. However, I want to "sign" the data.

How can this be done in such a way that I am unable to change the data without that this can be detected? The users login, so I do have the md5 hash of their password, could I use this in any way to sign the data?

It should also not be possible preferably that I delete everything, change a couple of values and generate the "checks" again.

The threat: Let me make an analogy to what can be the threat (my case is more abstract). Say that people with a schizophrenia would give every day a number about "how psychotic" they are. On the basis of long-term data there could be made conclusions about "how severe" the case is. The users might claim that there has been messed with the data to make their case look more severe (say because of conflict of interest with pharmaceutical companies).
Yes.  Use append-only logs, or a cryptographic timestamping service.  These approaches are generally designed to solve the problem you mentioned, namely: detecting tampering with data or post-dating of old data.

See the following resources on this site and our sister site, Security.SE:


Techniques for ensuring verifiability of event log files
WORM media types
How are timestamps verified?
On-line cryptographically signed date/time?
Signature and Timestamp for Long Term Document Archival Question
Geographic equivilent of RFC 3161 (X.509 PKI Time-stamp Protocol)


They should cover this topic in great detail.  Enjoy!