I’m designing a table that will be used to store information on which customers will be charged.
The problem is the database could be on the customers servers.
I was thinking of adding a second table containing a hash of the first, so that the software using the database can update the database and the hash, but the customers can’t edit (without us knowing) the table containing the chargeable information (on the basis that they can’t generate the correct hash).
Is this a good way of stopping customers tampering with a table they have access to?
How would I create a hash of all the data within the table (possibly more than one table)?
Specifically I would need to hash the data within the table instead of an object such as a dataset (i.e. I don’t want all the hashes to change if we change componants).
I was considering writing the data to a text file and creating a hash of the file, but that would be painfully slow as the table could contain upto 500,000 records and the hash would need to be generated on every update!
The implementation for this can be in either delphi or c#.
Why not just hash on a per record basis, rather than per table?
You could concatenate some of the fields together, pad to say 64 characters (using a specific character or string of characters) then restrict to 64 characters and calculate the hash – write this into another table:
job done – easy enough to calculate on the fly and easy enough to check.
Plus a random string of characters would be hard to find if they simply browsed your executable (assuming delphi here)