Burglar security table

I am developing a table that will be used to store information about which customers will be charged.
The problem is that the database may reside on client servers.
I was thinking of adding a second table containing the hash of the first, so that the software using the database can update the database and the hash, but clients cannot edit (without our knowledge) a table containing paid information (for which they cannot generate the correct hash).

Is this a good way to stop customers faking a table that they have access to?
How to create a hash of all data in a table (possibly more than one table)?

In particular, I would need the hash data in the table instead of an object such as a dataset (i.e. I don't want all the hashes to change if we change the components).

I was considering writing data to a text file and creating a file hash, but that would be painfully slow since the table could contain up to 500,000 records and the hash had to be generated with every update!

The implementation for this can be both in delphi and in C #.

+3
source share
6 answers

Why not just a write-based hash, not a table hash?

, 64 ( ), 64 - :

recordid  tableid  hash

- .

, ( , delphi)

0

, , . -, , . GUID , , . , , , , , . , .

:

Hash([Table Data] + [Secret Value]) = [stored hash]

, , , .

, , . , 10 , , , , . , , , . . , , . , .

, :

  • - , , . .
  • , , , .
  • , , . , .
  • . , -, . - . , , -. .

, , , (.. .) , , . , , . , .

+10

, (, , - , , , ),

  • , Hash(concat(M,N), seed) == Hash(N,Hash(M,seed))

  • SQL ,

#.

0

, , - . " " . , barf stop. . , , .

, , - , . .

0

, . , ( ). , , , "", , .

0

Source: https://habr.com/ru/post/1734922/


All Articles