Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 10 22:03:14 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,WEIRD_PORT autolearn=no version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m8B53Egx030116 for ; Wed, 10 Sep 2008 22:03:14 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m8B52q94028844 for ; Wed, 10 Sep 2008 22:02:52 -0700 Message-Id: <200809110502.m8B52q94028844@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Error in MD5 Output Date: Wed, 10 Sep 2008 22:02:52 -0700 From: Bill Cheng Someone wrote: > I compute the md5 on both the server and client side for debugging purposes > and they were the same, but they differ from the output of "openssl md5 > filename". I looked in the debugger and the output I am printing does seem > to be correct. The filesizes and bytes transferred are correct as well. > Furthermore it worked fine on cygwin. I did notice that the filesizes are > different on cygwin than they are on nunki. As I've mentioned in my message on "Thu 04 Sep 09:11", your bug is in your print routine! If you look at the first byte of your output, you will see that instead of print "02", you printed "2". You need to print a leading "0" if the byte is less than 0x10. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: Bill Cheng [mailto:william@bourbon.usc.edu] Sent: Wednesday, September 10, 2008 7:55 AM To: cs551@merlot.usc.edu Subject: Re: Error in MD5 Output Someone wrote: > Hi,I having some prob with the o/p of MD5. > I compared it with the o/p generated by the openssl/md5 > > My o/p is../ > nunki.usc.edu(12): ./client get -m nunki.usc.edu:15272 /etc/passwd > 26a948ab7bd6d3ab622ac9d6e1fe26 > > O/P of OpenSSL / MD5 is > > nunki.usc.edu(13): ~csci551b/bin/filemd5 /etc/passwd > 026a948ab7bd6d3ab622ac9d6e1f0e26 > > It seems, all 0 (zeros) are ignored from my o/p. (at two places) > Any idea why this happens? Please see my message on "Thu 04 Sep 09:11". -- Bill Cheng // bill.cheng@usc.edu