Skip to contentSkip to conversation

md5sum or libraries

DISCUSSION Benjamin Jeeves 2 participants 2 messages Jan 2, 2005

lore
Share & tools
lore
#0 lore raw

Hi all

I'm new to C programming and was hoping to write a program that would scan a number of folders and if any files in them it would do a md5sum on them. I can not seen to find any thing on a libraries or a function that would do the md5sum of the file.

e.g. in php there is a function call md5_file().

This there something like that in C?

I have written the code to scan the folders but can not find anything on md5sum or md5_file for C?

Thank you

Benjamin Jeeves

#1 lore raw

On Sun, 2005-01-02 18:22:55 +0000, Benjamin Jeeves <[email protected]> wrote in message <[email protected]>:

Quoted 2 lines

I have written the code to scan the folders but can not find anything on md5sum or md5_file for C?

libgcrypt does implement a number of cryptographic hash functions, md5 is fur sure one of those. However, you've got to do the file-reading yourself (though, that shouldn't be much of a problem :)

But keep in mind that md5 is nowadays considered broken. So if you just want to check some random files, it may serve you very well, but if you need to to some contract-checking or things like that, you should consider other hash functions.

MfG, JBG

Signature · 4 lines
Jan-Benedict Glaw       [email protected]    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));