How does CRC/Checksum work?

Namecheap AuctionsNamecheap Auctions
Spacemail by SpaceshipSpacemail by Spaceship
SpaceshipSpaceship
Watch

bonjourvn

Account Closed
Impact
0
Say you are developing a program that transmits files or messages. You want to verify the transmission with Checksum. How would you do it? How does CRC/Checksum even work? Is it accurate for verifying files?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
A checksum is very simple. You just sum all the data. For example, for a byte checksum you add the first byte, the second bye, the third byte ... the last byte. The result is truncated to fit into a byte. Checksums are easy to calculate, but not very effective for detecting corruption.

A CRC relies on a polynomial with special properties. A bit complicated to explain in detail here, but basically it uses bit shift and conditional exclusive OR operations to produce the CRC value. This results in an effective error detection mechanism. CRCs are not secure though. It is possible to someone to tamper with a file in such a way that is results in the same CRC.

A secure hash such as MD5 would provide better protection against intentional tampering. But you would have to send the hash over a secure channel. One way of doing this would be to use a private key to encrypt the hash, then decode with the corresponding public key the other end.
 
0
•••
CRC is just a hash. If the file encountered an error during transmission, it will almost certainly have the CRC value change. There are a LOT of programs that will compute various hashes of files for you, including some hex editors.

The CRC is not a security thing, just helps insure the file wasn't corrupted during download.
 
Last edited:
0
•••
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

New in Parking: updated way to act on many domains or inquiries at once
Your domain list and inquiry list now have a bar above and below the list. Check the items you want, then choose an action in the bar...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back