views:

138

answers:

3

i am receiving packets from a terminal device and then upon receiving packets on host side, i use crc32 algo to generate mac for packet data so that i can check is there any corruption of data during transfer of packet from terminal to host.Is crc32 reliable for this purpose or is there some better algorithm?

+1  A: 

CRC32 is used by protocols such as Ethernet and HDLC. I would say that is very much suitable for error detection.

kgiannakakis
+1  A: 

crc32 is simple, reliable, and fast. In fact TCP only uses a 16 digit check sum.

brianegge
+1  A: 

CRC32's usefulness depends on the size of the data being checked and what you're protecting against. For small packets and detecting transmission failures, it's probably just fine.

If you are protecting against an active attacker, perhaps you want a secure hash function or to use a cipher.

There is a lot of literature on this kind of stuff; it really depends on what you are trying to achieve. However: If your basic problem is detecting comms errors on short packets, CRC32 is probably just fine.

janm