# MD5 implementation

Scott A. Boltz (Scott_Boltz@itd.sterling.com)
Fri, 30 Oct 1998 16:17:36 -0500

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: David Brownell: "Re: MD5 implementation"
- Previous message: Pascal Ledru: "ClassLoader & Security"
- Next in thread: David Brownell: "Re: MD5 implementation"

I having trouble getting a correct message digest for a file. Here is
my source:

byte[] temp = new byte[32];
int amountread;
byte[] buffer = new byte[1024];
md.reset();
try
{
FileInputStream fis = new FileInputStream( filename );
while( ( amountread = fis.read( buffer ) ) != -1 )
{
md.update( buffer );
}
temp = md.digest();
System.out.println( " " + temp );
System.out.println( " " + md.getDigestLength() );
fis.close();

My output consists of an eleven digit number. The message digest
between runs also changes. Any help would be much appreciated.

Scott

- Next message: David Brownell: "Re: MD5 implementation"
- Previous message: Pascal Ledru: "ClassLoader & Security"
- Next in thread: David Brownell: "Re: MD5 implementation"