News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

File Checksum - md5 - sha1 etc...

Started by frktons, January 24, 2013, 01:00:23 AM

Previous topic - Next topic

frktons

Sometime, when I download big files from the net, there is a
small file associated with the big one, a md5 or sha1 or similar
that is used to check the integrity of the downloaded file.

There is also a windows command line: fciv.exe from MS that permits
to generate the md5 or sha1 hash to check the original hash code.

Not to speak about little nice GUI win programs that do the same thing.

Because I don't know how these algos work, could somebody tell
me how are these code generated? what does the hash algo does?
Checksum recall the sum of the value of the single bytes, but is it
that operation that is performed or what else?

Thanks

Frank
There are only two days a year when you can't do anything: one is called yesterday, the other is called tomorrow, so today is the right day to love, believe, do and, above all, live.

Dalai Lama

qWord

MREAL macros - when you need floating point arithmetic while assembling!

frktons

Quote from: qWord on January 24, 2013, 01:05:43 AM
Cryptographic hash function
According to this link, we are talking about cryptographic hash functions, not at all
what the name checksum recall.
Moreover the md5/sha1 hash functions are considered not suitable for security problem
and so we move to sha2 hash functions (up to sha512).
Aside from security problems, if I only want to check if a file was copied correctly from
a usb-pen, external HD, CD or whatever, shouldn't be enough to know the size and the
md5/sha1 code?
There are only two days a year when you can't do anything: one is called yesterday, the other is called tomorrow, so today is the right day to love, believe, do and, above all, live.

Dalai Lama

anta40

Quote from: frktons on January 24, 2013, 01:29:13 AM
Aside from security problems, if I only want to check if a file was copied correctly from
a usb-pen, external HD, CD or whatever, shouldn't be enough to know the size and the
md5/sha1 code?

It's already well known that it's possible to create 2 different files which have the same MD5 value
http://www.mathstat.dal.ca/~selinger/md5collision/

Probably it's better to use sha-1 or its successors (sha-2, sha-3).

Personally, I have no problems with md5 so far.

hfheatherfox07

#4
EDIT:
See next Posts
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

hfheatherfox07

Ok....
I found a Console MD5 File Checksum Routine here:
http://www.masmforum.com/board/index.php?PHPSESSID=786dd40408172108b65a5a36b09c88c0&topic=14170;prev_next=next

Does not seem to work well though....
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

hfheatherfox07

@ frktons

There you Go!

A MD5 File Checksum  Bare Bone Tool
Tool one opens .exe & .dll first than all extensions
Tool two opens all extentions

I have made this a brae Bones examples as to give you the pleasure of making your own Tool (would be nice to see) Just set the result on to edit Box!
May be something like this ? http://forum.xda-developers.com/showthread.php?t=1939007 

***NOTE:***
I tested the results of the bare Bones and they are accurate!  :biggrin:

Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

hfheatherfox07

By the way here is that oldie:

drizz's Crypto library for MASM

It has a few more types of hashes
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

frktons

Quote from: hfheatherfox07 on January 24, 2013, 10:00:25 AM
By the way here is that oldie:

drizz's Crypto library for MASM

It has a few more types of hashes

Thanks, a lot to digest, it'll require time to understand code, but the tools
could be useful soon.  :t
There are only two days a year when you can't do anything: one is called yesterday, the other is called tomorrow, so today is the right day to love, believe, do and, above all, live.

Dalai Lama