Fingerpriinting techniques

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I have to check a datablock of 10-16 bytes length, if the block has changed.
Does anyone know a "fingerprinting" technique, so that I can calculate a checksum to find out, if there's an difference due of changing of the block without knowing the prevoius contents....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not sure exactly what you mean, but how about exclusive ORing the data at the beginning of the world and storing the XOR result with the data block.

If you now XOR the data and the original checksum, then the result will be zero.

You now regularly repeat the exercise.

When you get a non-zero result, then you know the data has changed.

(It's not foolproof; you could miss changes. You could get more reliable results by using a CRC technique instead.)

A.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are several ways...

- you could compute a checksum by either adding all the bytes mod 256 or xor'ing them together; this is subject to missed detections, since, for example, with xor, two changes in different bytes in the block at the same bit location would produce the same xor checksum

- you could compute a CRC, which is a high-power polinomial specialy designed to detect most changes, especially ones in consecutive bits.

- you could compute a secure hash using one of the cryptographic algorithms; these are quite foolproof, but complex

In most cases, though, you will need to access each byte of the buffer anyway, a simple byte-by-byte comparison will be as fast or faster than anything else and is certainly 100% reliable.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sergey

I assume thath he is trying to save the RAM overhead of holding the data twice, rather than the computational overhead.

Andy

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks folks!

Yes, there's no way to save the data twice. (becaue of RAM)

And XORing (was my first Idea, too) is not reliable enough.
CRC takes too much time.
Cryptographic hash methods (like MD5) are not required, and they take to much calculating power.

At the moment I am not at work, but there I have the link to a comparasion of hash functions.

There's an algorithm called SDBM (or similar), which is fast and quite reliable. I'm thinking about using that.

Again, thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Heres the link:

http://www.fantasy-coders.de/pro...

(sorry, it's German)