What EXACTLY is a "checksum?"
What is a CheckSum?
- Rook Zimbabwe
- Addict

- Posts: 4322
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
What is a CheckSum?
OK ignorance here... I have applied them foryears... but I still dont know:
What EXACTLY is a "checksum?"
What EXACTLY is a "checksum?"
- Kaeru Gaman
- Addict

- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
Re: What is a CheckSum?
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.
there is no "this is a checksum" formula, because there are a bunch of different algorithms to calculate a checksum.
oh... and have a nice day.
- netmaestro
- PureBasic Bullfrog

- Posts: 8453
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: What is a CheckSum?
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.
BERESHEIT
Re: What is a CheckSum?
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."
)
(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."
Last edited by SFSxOI on Sat Oct 31, 2009 12:59 am, edited 1 time in total.
The advantage of a 64 bit operating system over a 32 bit operating system comes down to only being twice the headache.
Re: What is a CheckSum?
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.
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.
pb 5.11
Re: What is a CheckSum?
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).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.
- Kaeru Gaman
- Addict

- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
Re: What is a CheckSum?
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.
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.
oh... and have a nice day.
- Rook Zimbabwe
- Addict

- Posts: 4322
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
Re: What is a CheckSum?
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?
OK my idea goes out the window, but maybe with a modification?
- DoubleDutch
- Addict

- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Re: What is a CheckSum?
Ahh, Antic & Analog magazine! Those were the days.
Compute! and Byte were good too.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
Re: What is a CheckSum?
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.
Yes, i remember that. The program that does the checksum calculation was called "check summer". ^^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.
- Rook Zimbabwe
- Addict

- Posts: 4322
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
Re: What is a CheckSum?
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?
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?
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.
I may look like a mule, but I'm not a complete ass.
Re: What is a CheckSum?
No. Because the checksum don't contain all informations about the file. It's just a hash.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?
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?
> 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?
> 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?
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
- Rook Zimbabwe
- Addict

- Posts: 4322
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
Re: What is a CheckSum?
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!)
Also (as an aside and off topic a bit: http://www.wolf5k.com/ (5k JAVA wolfenstein!)

