MD5 Help

Hey everyone... I have a code which is in C which computes the MD5 hash of data from an input file. I am trying to convert it to Java.

I have these questions:

1) The C verion makes use of the API's: MD5Init, MD5update and MD5Final. These functions are avialable in MD5.c However, the Java MessageDigest class does not have these method calls right ? Instead it has: getAlgorithm, update, digest and reset. So is this going to produce the same Message Digest, as the C code will ?

2) The C program reads the input file into buffers of size 4KB and then computes the hash for this buffer. The buffer is an array of 'unsigned char'. So in Java I will have to read the file into an array of bytes of size 4096 ?

Thanks in advance for your help !!!

[784 byte] By [the_learnera] at [2007-11-27 1:56:04]
# 1
hey I just chcked, the C and java code produced the same hash. So question 1 is answered !!
the_learnera at 2007-7-12 1:29:56 > top of Java-index,Security,Cryptography...
# 2
The buffer size shouldn't matter. Try it!
ejpa at 2007-7-12 1:29:56 > top of Java-index,Security,Cryptography...