Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 25 21:06:10 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.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham 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 mAQ56ANa019766 for ; Tue, 25 Nov 2008 21:06:10 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAQ54wLe016825 for ; Tue, 25 Nov 2008 21:04:58 -0800 Message-Id: <200811260504.mAQ54wLe016825@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: random password Date: Tue, 25 Nov 2008 21:04:58 -0800 From: Bill Cheng Someone wrote: > Continuing from your answer below: > have a nonce index, so I first check the nonce index and then verify the > sha1 and filename (using the indexes). In this case my code prints out "File > with these details not found" Again, you don't need a nonce index. You can just use the SHA1 index to locate a file number. Then you open the metadata file for each file having the same SHA1 value and check the FileName and Nonce. For every FileName and Nonce that match the commandline, you check if a password exists. If you cannot not find a file with the specified SHA1, FileName, *and* Nonce, you can print out an error message like you mentioned above. > Or should an error message be printed only when the sha1 and filename do not > match? You mean the Nonce matched but SHA1 and FileName do not match? Then it's the same situation since *all* 3 things must match. -- Bill Cheng // bill.cheng@usc.edu > test case: A > > (+2 points) > > delete FileName=chess.jpg > > SHA1=f7917fe4976d2c24f225bc4b6c2334e554b91c28 > > Nonce=8ae005585be9c44ef1910d25dd6f8da58c432ab5 > > should prompt the user to see if it's okay > to > > use a random password, type "yes" > > nothing should get deleted, > > type "status files 1 00.out", look at > "00.out", > > there should still be two files > > > > say now if i enter some non-existant filename, > > > > SERVANT XXXXX> delete FileName=abcd.xyz SHA1=3a5f........ > > should it prompt for random password? > > No. If you do not have a file that matches the FileName, > you cannot even verify that the SHA1 you have entered is > correct. So, don't need to prompt. Although you should > print an error message because it may be just a typo. > -- > Bill Cheng // bill.cheng@usc.edu