Page 1 of 2
What is a CheckSum?
Posted: Mon Oct 26, 2009 6:49 pm
by Rook Zimbabwe
OK ignorance here... I have applied them foryears... but I still dont know:
What EXACTLY is a "checksum?"

Re: What is a CheckSum?
Posted: Mon Oct 26, 2009 6:51 pm
by Kaeru Gaman
a CHECKSUM is a result calculated out of of a row of values to check if all the values are correct.
there is no "this is a checksum" formula, because there are a bunch of different algorithms to calculate a checksum.
Re: What is a CheckSum?
Posted: Mon Oct 26, 2009 6:52 pm
by netmaestro
It's a hash done on a file and sent with it, so when it arrives at its destination over a network the receiver can rerun the hash and check the result. If it's the same, no corruption happened and the file is complete. Usually crc32 is used for this.
Re: What is a CheckSum?
Posted: Mon Oct 26, 2009 7:03 pm
by SFSxOI
Isn't that also the MD5 hash thats used to verify a file integrity?
(silly, everyone knows what a checksum is - when someone asks you if several items are all working you say "i'll checksum and find out."

)
Re: What is a CheckSum?
Posted: Mon Oct 26, 2009 7:36 pm
by gnasen
A very important fact for a good checksum is, that small changes in the source result in great changes in the hash.
For example is the sum of all byte-valus a checksum, but if you increase one byte and decrease another one, the hash does not change.
However there is no guarantee that two different sources have different checksums, but the possibility that it could happen should be very small.
Re: What is a CheckSum?
Posted: Mon Oct 26, 2009 8:49 pm
by Demivec
gnasen wrote:A very important fact for a good checksum is, that small changes in the source result in great changes in the hash.
For example is the sum of all byte-valus a checksum, but if you increase one byte and decrease another one, the hash does not change.
However there is no guarantee that two different sources have different checksums, but the possibility that it could happen should be very small.
Another case of a small change that should result in a large difference for a checksum is the number of bytes. This allows a checksum to create a difference between one collection of zeroes and another collection of zeroes if the item count is different (10 zero's versus 11 zero's).
Re: What is a CheckSum?
Posted: Mon Oct 26, 2009 8:55 pm
by Kaeru Gaman
I remember an input helper from the old C64 days...
they had large ASM Listings in the Magazine "64er", endless rows of bytesize numbers.
yes, we were lucid enough to hack in such listings back in those days...
they put 16 numbers in one line, followed by a checksum.
the checksum was built by adding the next value and then leftshift the sum and so on.
the leftshift made sure that the checksum was different when two values were exchanged.
Re: What is a CheckSum?
Posted: Mon Oct 26, 2009 11:00 pm
by Rook Zimbabwe
They did something like that in ANTIC as well... Ah, me old Atari 800XL (Still have it in a box in the garage!)
OK my idea goes out the window, but maybe with a modification?
Re: What is a CheckSum?
Posted: Mon Oct 26, 2009 11:36 pm
by DoubleDutch
Ahh, Antic & Analog magazine! Those were the days.

Compute! and Byte were good too.
Re: What is a CheckSum?
Posted: Tue Oct 27, 2009 12:03 am
by Thorium
Additional info: A checksum don't have do be a real sum. The name implys that it's a value obtained by adding numbers together. But thats not the reality. It was back in the day that a checksum was realy a number added together from other numbers. Today a checksum can be obtained with any kind of operations, there is no rule. It's likly a division and shifting.
Kaeru Gaman wrote:I remember an input helper from the old C64 days...
they had large ASM Listings in the Magazine "64er", endless rows of bytesize numbers.
yes, we were lucid enough to hack in such listings back in those days...
they put 16 numbers in one line, followed by a checksum.
the checksum was built by adding the next value and then leftshift the sum and so on.
the leftshift made sure that the checksum was different when two values were exchanged.
Yes, i remember that. The program that does the checksum calculation was called "check summer". ^^
Re: What is a CheckSum?
Posted: Thu Oct 29, 2009 7:21 pm
by Rook Zimbabwe
So let me put it this way...
If you knew the formula for the checksum... could you take JUST that checksum generated and apply said formula in reverse to regenerate the file that created the checksum?
Re: What is a CheckSum?
Posted: Thu Oct 29, 2009 7:24 pm
by srod
Most, if not all, checksum calculations do not generate absolutely unique values and so no it will not, in general, be possible to 'invert' such a calculation.
Re: What is a CheckSum?
Posted: Thu Oct 29, 2009 7:26 pm
by Thorium
Rook Zimbabwe wrote:So let me put it this way...
If you knew the formula for the checksum... could you take JUST that checksum generated and apply said formula in reverse to regenerate the file that created the checksum?
No. Because the checksum don't contain all informations about the file. It's just a hash.
There was as guy who tried to do that and called his program Hash Zip, of course it's not stable and will never be. A hash is allways lossy.
Re: What is a CheckSum?
Posted: Thu Oct 29, 2009 8:34 pm
by PB
> I remember an input helper from the old C64 days...
> they had large ASM Listings in the Magazine "64er"
Another great C64 magazine was Compute!'s Gazette, which had an app called The Automatic Proofreader:
http://www.jbrain.com/pub/cbm/mags/cg/A ... ader2A.jpg
It did checksums of each BASIC line that you typed in, so that you didn't make typos.
> If you knew the formula for the checksum... could you take JUST that checksum generated and apply said
> formula in reverse to regenerate the file that created the checksum?
Of course not. A checksum is very small (eg. an MD5 checksum is only 35 characters). How would you turn those 35 characters back into a 100 KB exe?

Re: What is a CheckSum?
Posted: Sat Oct 31, 2009 3:54 am
by Rook Zimbabwe
Well a couple of years ago a group did an allegedy unique version fo DOOM using some obscure formula... I can't find any ifo on it anymore... perhaps it was a sham!
Also (as an aside and off topic a bit:
http://www.wolf5k.com/ (5k JAVA wolfenstein!)