Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Jul 11 00:41:03 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k6B7f3W5015431 for ; Tue, 11 Jul 2006 00:41:03 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k6B7aq4S006120 for ; Tue, 11 Jul 2006 00:36:52 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id k6B7aqKh006119 for cs530@merlot.usc.edu; Tue, 11 Jul 2006 00:36:52 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k6B7aq2P006116 for ; Tue, 11 Jul 2006 00:36:52 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id k6B7aqDa006115 for cs530; Tue, 11 Jul 2006 00:36:52 -0700 Date: Tue, 11 Jul 2006 00:36:52 -0700 From: william@bourbon.usc.edu Message-Id: <200607110736.k6B7aqDa006115@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: testing cs 530 Return-Path: william@bourbon.usc.edu Delivery-Date: Wed May 10 15:54:01 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k4AMs1ki017821; Wed, 10 May 2006 15:54:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k4AMrXaF015654; Wed, 10 May 2006 15:53:33 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k4AMrX2G015653; Wed, 10 May 2006 15:53:33 -0700 Date: Wed, 10 May 2006 15:53:33 -0700 From: william@bourbon.usc.edu Message-Id: <200605102253.k4AMrX2G015653@bourbon.usc.edu> To: cs530@merlot.usc.edu, csac@merlot.usc.edu Subject: Please make backups of HW assignments... Hi, The current HW assignments will be deleted at the beginning of next week. There may be a chance that in a future semester, you would like to update your resume or get ready for an interview, and you would want to recall exactly what were the HW assignments of this semester. Please make a backup copy of the *specs* now! (If you ask me to put them back on the web again in the future, they may not be available.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu May 4 23:37:22 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k456bMNC001591; Thu, 4 May 2006 23:37:22 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k456bFvD009913; Thu, 4 May 2006 23:37:15 -0700 Message-Id: <200605050637.k456bFvD009913@bourbon.usc.edu> To: cs530@merlot.usc.edu, cs551@merlot.usc.edu, csac@merlot.usc.edu Subject: Fwd: JPL Summer Job (US citizenship required) Date: Thu, 04 May 2006 23:37:15 -0700 From: william@bourbon.usc.edu Hi, I got the following summer job announcement from JPL (in Pasadena, CA). Please look through the requirements before applying. Both jobs require US citizenship. -- Bill Cheng // bill.cheng@usc.edu ----- Begin forwarded message: > From: "Scott Darden" > Date: May 4, 2006 3:15:57 PM PDT > To: ortega@sipi.usc.edu > Cc: "Clay Okino" , > "Winston Kwong" > Subject: JPL Summer Job > > JPL is looking for summer interns for the following job descriptions. > > Job Description #1: Video over space links > > There is interest in investigating off the shelf video techniques for > use in a space environment. In particular, of video teleconference > applications. > > Requirements: U.S. Citizenship, graduate student with a background in > video codex, VTC protocols (such as H.323), C or C++, Visual > Studio. Knowledge of computer and or communication networks is > desired but not required. > > Job Description #2: VOIP over space links > > There is interest in investigating off the shelf voice over IP > techniques for use in a space environment. > > Requirements: U.S. Citizenship, graduate student with a background in > audio codex (such as CELP and MELP), C or C++, Visual Studio. > Knowledge of session initiation protocol (SIP), real time protocol > (RTP), real time control protocol (RTCP). > > Please send resumes to Scott Darden at darden@aria.jpl.nasa.gov. > > Scott Return-Path: william@bourbon.usc.edu Delivery-Date: Wed May 3 15:45:00 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k43Mj0wU025542 for ; Wed, 3 May 2006 15:45:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k43MiveP000794 for ; Wed, 3 May 2006 15:44:57 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k43Mivkl000793 for cs530@merlot; Wed, 3 May 2006 15:44:57 -0700 Date: Wed, 3 May 2006 15:44:57 -0700 From: william@bourbon.usc.edu Message-Id: <200605032244.k43Mivkl000793@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: plagiarism in term paper Hi, I'm grading the term papers and found a few cases where plagiarism was evident. As I have mentioned in class, if you want to use a sentense or a paragraph from one of your references, you must *quote* it clearly; otherwise, you have committed plagiarism. To quote someone's writing, you should do something like: In [3], the author(s) wrote: ( this and that ) .... What's quoted must standout and explicit credit given to the cited document. I can understand if you accidentically wrote something identical to what's in one of your references. But if your term paper contains a lot of identical sentenses or paragraphs from another paper and did not quote them properly, I have no choice but give you a score of zero for your term paper. Plagiarized assignments cannot be accepted at USC. Please see: http://www.usc.edu/student-affairs/SJACS/nonacademicreview.html -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue May 2 15:08:50 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k42M8oqE001808 for ; Tue, 2 May 2006 15:08:50 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k42M8pQV026057 for ; Tue, 2 May 2006 15:08:51 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k42M8pei026056 for cs530@merlot; Tue, 2 May 2006 15:08:51 -0700 Date: Tue, 2 May 2006 15:08:51 -0700 From: william@bourbon.usc.edu Message-Id: <200605022208.k42M8pei026056@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: CS 530 HW4 grade... Hi, In the e-mail you received a couple of hours ago, it said: Your CS 530 HW4 score is ## (out of 100). HW4 is worth 150 points. The score you received was *based* on a maximum of 100 points. When I calculate the final class grade, I will multiple the score you received by 1.5. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Apr 26 15:08:15 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3QM8FmO031057 for ; Wed, 26 Apr 2006 15:08:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3QM2UFF001778 for ; Wed, 26 Apr 2006 15:02:30 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k3QM2UXo001777 for cs530@merlot; Wed, 26 Apr 2006 15:02:30 -0700 Date: Wed, 26 Apr 2006 15:02:30 -0700 From: william@bourbon.usc.edu Message-Id: <200604262202.k3QM2UXo001777@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Advertisement for CS 599 - Applied Cryptography, Fall 2006 Hi, [ I forgot to advertise the Applied Cryptography class for Fall 2006 (offered as CS 599). ] If you enjoyed the cryptography lectures in CS 530 and would like to learn more about applied crytography, I would encourage you to take the CS 599 Applied Cryptography class in Fall of 2006 (most likely, it will only be offered in the Fall semesters). The difficulty level of the applied crypto class is comparable to CS 530. The workload is about the same. No term paper, but more programming assignments. It can be taken concurrently with CS 530. If you enjoyed the cryptography lectures in CS 530 and like more rigorous treatment of cryptography, I would strongly encourage you to take CS 556 in Spring of 2007 offered by Prof. Huang. I cannot comment on the difficulty level and workload since I do not teach it. The applied crypto class has slightly more math than CS 530 but a lot less than CS 556. We do not do mathematical proofs in the applied crypto class. Theorems are stated as "facts" and I will try to give some intuitions behind these "facts" if appropriate. You are welcome to check out the course material for this semester at: http://merlot.usc.edu/csac-s06/ To access the lectures, the user ID and password are the same as for CS 530. Sorry, no access to HWs though. There is only one change for the future semesters for the applied crypto class. The Applied Cryptography book by Schneier will be optional. The lectures are mostly based on the online book, Handbook of Applied Cryptography, by Menezes, van Oorschot, and Vanstone. It's a very clear and well organized book to learn from. Hope to see a lot of you in Fall 2006! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Apr 26 07:56:34 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3QEuYkc013626 for ; Wed, 26 Apr 2006 07:56:34 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3QEoots032759 for ; Wed, 26 Apr 2006 07:50:50 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k3QEooO0032758 for cs530@merlot; Wed, 26 Apr 2006 07:50:50 -0700 Date: Wed, 26 Apr 2006 07:50:50 -0700 From: william@bourbon.usc.edu Message-Id: <200604261450.k3QEooO0032758@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: reminder about final exam at 10am... Hi, Just a quick reminder that the final exam is at 10am (as I've mentioned a few times already in class). Please don't be late. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Apr 25 14:11:20 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3PLBKKI001438 for ; Tue, 25 Apr 2006 14:11:20 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3PL5dfd027628 for ; Tue, 25 Apr 2006 14:05:39 -0700 Message-Id: <200604252105.k3PL5dfd027628@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: LKH question Date: Tue, 25 Apr 2006 14:05:39 -0700 From: william@bourbon.usc.edu Someone wrote: > I have a very simple question about LKH (I could not find the > answer in a paper): > When U3 joins the group, it needs a new individual key K'3. How > does it get it, so that other nodes don't know it? It's probably in the LKH paper... I assume it's done using secured unicast channel. When a node joins the network, it has to talk to the group controller using something like SSL to do some setup (the group controller can authenticate the joining node at this point). Anyone can join a multicast group and get encrypted messages. encrypted messages if it has not perform the setup step with the group controller. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Apr 23 16:31:17 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3NNVHJO025265; Sun, 23 Apr 2006 16:31:17 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3NNPhLv005276; Sun, 23 Apr 2006 16:25:43 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k3NNPhSj005275; Sun, 23 Apr 2006 16:25:43 -0700 Date: Sun, 23 Apr 2006 16:25:43 -0700 From: william@bourbon.usc.edu Message-Id: <200604232325.k3NNPhSj005275@bourbon.usc.edu> To: cs530@merlot.usc.edu, csac@merlot.usc.edu Subject: Monday off hour moved... Hi, Tomorrow (Monday, 4/24/2006), I will be holding office hour in SAL 226. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Apr 23 16:23:31 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3NNNV0c024952 for ; Sun, 23 Apr 2006 16:23:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3NNHvDB005228 for ; Sun, 23 Apr 2006 16:17:57 -0700 Message-Id: <200604232317.k3NNHvDB005228@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: exam 2 topics... Date: Sun, 23 Apr 2006 16:17:57 -0700 From: william@bourbon.usc.edu Hi, I've decided to remove Privacy from the list of topics covered by exam 2. (I will still talk about Privacy tomorrow.) Sorry about the short notice. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Thu, 20 Apr 2006 13:21:05 -0700 From: william@bourbon.usc.edu To: cs530@merlot.usc.edu Subject: exam 2 topics... Hi, I've made a list of topics covered since exam 1 in the News section of the class web page. Please note that exam 2 will cover everything since the beginning of the semester. If a specific problem appeared in exam 1, it will not appear in exam 2. Please also note that there will be on final exam for this class. Exam 2 will start at 10am in OHE 122 on Wed 4/26/2006. I have not made up the exam yet. I'm guessing it will be a 100-minute exam. So, it will *probably* end at 11:40am (although the class web page says 11:50am). I will change the web page soon to say that it will end at 11:40am. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Apr 22 21:37:51 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3N4bpG4024163 for ; Sat, 22 Apr 2006 21:37:51 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3N4WKxp011839 for ; Sat, 22 Apr 2006 21:32:20 -0700 Message-Id: <200604230432.k3N4WKxp011839@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: LKH Date: Sat, 22 Apr 2006 21:32:20 -0700 From: william@bourbon.usc.edu Someone wrote: > For LKH, what happens when a node joins with the tree being already full? > > example, 2 nodes, root=K12 > before join: > (K12) > / \ > (K1) (K2) > | | > [U1] [U2] > > after U3 joins, Is this correct? > (K14) > / \ > (K12) (K34) > / \ / > (K1) (K2) (K3) > | | | > [U1] [U2] [U3] > > new root=K14 (or K13?) > > also what is the number of messages that are sent. > from equation: 2Log2(3) = 2 * (1.xxx) ~ 2.xxx > {K14} K34, {K14} K12, {K34} K3 .. so 3? > > and last question, if U3 decides to leave, does the tree > go back to being as if U3 had never joined with K'12 as > the root? or does K'34 stay as the root? The survey paper did not talk about details like this since it is only trying to make comparisons between various approaches. For this, you should check out the LHK paper (I have not done so). But you are asking a good question! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Apr 21 21:11:29 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3M4BTTW032256 for ; Fri, 21 Apr 2006 21:11:29 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3M4613V006950 for ; Fri, 21 Apr 2006 21:06:01 -0700 Message-Id: <200604220406.k3M4613V006950@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Exam topic Date: Fri, 21 Apr 2006 21:06:01 -0700 From: william@bourbon.usc.edu Someone wrote: > Is distributed LKH will be part of the final exam Yes. > (it is not mentioned in the exam topics on the website). The web page says: (please note that not all topics covered are listed) I could not list *all* topics that are covered. (Might as well junk link to the lectures page if that would be the case!) For exam 2, everything that was covered this semester will be covered by exam 2. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Apr 21 14:57:55 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3LLvtoO017933 for ; Fri, 21 Apr 2006 14:57:55 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3LLqR9P005235 for ; Fri, 21 Apr 2006 14:52:28 -0700 Message-Id: <200604212152.k3LLqR9P005235@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: GKMP quesiton Date: Fri, 21 Apr 2006 14:52:27 -0700 From: william@bourbon.usc.edu Someone wrote: > When a new member joins the group, KDC sends a new GKP directly > to this member. GKPnew = GTEKnew + GKEKnew. > Now you need to rekey the old members of the group. This can be > done by sending {GKPnew}GKEKcurrent. In the example, it is shown > as {GTEKnew}GKEKcurrent. If this case how the old members will > get the new GTEK? Looks like a typo to me. The paper seems to have the same typo. You are correc that it should be {GKPnew}GKEKcurrent. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Apr 21 08:08:28 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3LF8Ssh002430 for ; Fri, 21 Apr 2006 08:08:28 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3LF329S002573 for ; Fri, 21 Apr 2006 08:03:02 -0700 Message-Id: <200604211503.k3LF329S002573@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: read me for term paper.. Date: Fri, 21 Apr 2006 08:03:02 -0700 From: william@bourbon.usc.edu Someone wrote: > A quick question about submission: > In the termpaper submission, Do we need to submit a readme file? You just need to submit the paper. The spec says: Please note that the only allowed file formats are ASCII text, PDF, Postscript, and HTML. Please name your submission as either termpaper.txt, termpaper.pdf, termpaper.ps, or termpaper.html, respectively. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Apr 20 21:15:03 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3L4F3FQ006517 for ; Thu, 20 Apr 2006 21:15:03 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3L49csI028858 for ; Thu, 20 Apr 2006 21:09:38 -0700 Message-Id: <200604210409.k3L49csI028858@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: referring a section in term paper.. Date: Thu, 20 Apr 2006 21:09:38 -0700 From: william@bourbon.usc.edu Someone wrote: > I have a doubt regards the term paper. > I specified the references as: > 1. ----- > 2. ---- > 3. ---- It's usually better to do: [1] [2] [3] > How do i refer to a section say 4.2 of paper 1 in the term paper? > Iam doing this as [section 4.2, 1]. Is this correct? In general, you don't need to refer to a specific section (unless you really want to). If you really want to mention section 4.2, you should say: In section 4.2 of [1], ... Now you can see why it's better to do [1], [2], [3], as oppose to do 1., 2., and 3. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Apr 20 21:12:20 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3L4CJaP006433 for ; Thu, 20 Apr 2006 21:12:19 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3L46t37028818 for ; Thu, 20 Apr 2006 21:06:55 -0700 Message-Id: <200604210406.k3L46t37028818@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: exam 2 topics... Date: Thu, 20 Apr 2006 21:06:55 -0700 From: william@bourbon.usc.edu Someone wrote: > In the exam topic you've one entry called "Homeworks". > Could you please elaborate on this more? I'm not sure what to say here. Basically anything about the homeworks. For example, why do we use (void*) as the SmartcardState in HW4. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Thursday, April 20, 2006 1:26 pm Subject: exam 2 topics... To: cs530@merlot.usc.edu > Hi, > > I've made a list of topics covered since exam 1 in the News > section of the class web page. Please note that exam 2 will > cover everything since the beginning of the semester. If a > specific problem appeared in exam 1, it will not appear in > exam 2. > > Please also note that there will be on final exam for this > class. Exam 2 will start at 10am in OHE 122 on Wed 4/26/2006. > I have not made up the exam yet. I'm guessing it will be a > 100-minute exam. So, it will *probably* end at 11:40am > (although the class web page says 11:50am). I will change > the web page soon to say that it will end at 11:40am. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Apr 20 21:03:34 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3L43Yxq006040 for ; Thu, 20 Apr 2006 21:03:34 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3L3wAHN028762 for ; Thu, 20 Apr 2006 20:58:10 -0700 Message-Id: <200604210358.k3L3wAHN028762@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Term Paper Question Date: Thu, 20 Apr 2006 20:58:10 -0700 From: william@bourbon.usc.edu Someone wrote; > I have a quick question regarding the Term paper. Do I have to > write anything below the title of the paper mentioning anybody's > name. I mean something like my name and the instructor's name. Usually, the author's name goes under the title. You should *not* put the name of anyone who is not an author. So, please do not put my name under it or anything like "CS 530 term paper". -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Apr 20 13:26:29 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3KKQTAm021089 for ; Thu, 20 Apr 2006 13:26:29 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3KKL5pB026410 for ; Thu, 20 Apr 2006 13:21:05 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k3KKL5kB026409 for cs530@merlot; Thu, 20 Apr 2006 13:21:05 -0700 Date: Thu, 20 Apr 2006 13:21:05 -0700 From: william@bourbon.usc.edu Message-Id: <200604202021.k3KKL5kB026409@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: exam 2 topics... Hi, I've made a list of topics covered since exam 1 in the News section of the class web page. Please note that exam 2 will cover everything since the beginning of the semester. If a specific problem appeared in exam 1, it will not appear in exam 2. Please also note that there will be on final exam for this class. Exam 2 will start at 10am in OHE 122 on Wed 4/26/2006. I have not made up the exam yet. I'm guessing it will be a 100-minute exam. So, it will *probably* end at 11:40am (although the class web page says 11:50am). I will change the web page soon to say that it will end at 11:40am. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Apr 19 10:15:20 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3JHFK9e022932 for ; Wed, 19 Apr 2006 10:15:20 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3JHA1TZ020023 for ; Wed, 19 Apr 2006 10:10:01 -0700 Message-Id: <200604191710.k3JHA1TZ020023@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Regarding Term Paper Date: Wed, 19 Apr 2006 10:10:01 -0700 From: william@bourbon.usc.edu Someone wrote: > I had submitted 5 references of the proposed authors while > submitting the proposal and all five were accepted. You probably have misinterpret the acceptance. Your proposal was accepted based on the fact that it has met the 3-reference requirements. So, at least 3 out of your 5 references were "qualifying references". > But now while > writing the paper I am finding that I am going to require only 3 > references.So can I delete 2 references? If you are not sure about the 3 you want to keep, please send them to me to make sure. If you are sure that they are "qualifying references", then you don't need approval. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Apr 20 07:43:18 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3KEhIMA007492 for ; Thu, 20 Apr 2006 07:43:18 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3KEbttF024675 for ; Thu, 20 Apr 2006 07:37:55 -0700 Message-Id: <200604201437.k3KEbttF024675@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: References question Date: Thu, 20 Apr 2006 07:37:55 -0700 From: william@bourbon.usc.edu Someone wrote: > If apart from the papers, I use a few websites for getting some > information for the topic, should those websites be mentioned in the > references? You should. > I have seen some papers that include one or two websites > in their references. Are we allowed to do this? Yes. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Apr 18 13:10:33 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3IKAXAU007059 for ; Tue, 18 Apr 2006 13:10:33 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3IK5H0T013923 for ; Tue, 18 Apr 2006 13:05:17 -0700 Message-Id: <200604182005.k3IK5H0T013923@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: term paper proposal vs actual term paper Date: Tue, 18 Apr 2006 13:05:17 -0700 From: william@bourbon.usc.edu Someone wrote: > I have the following problem: while I am now putting my paper together I > realize that the title I suggested in my proposal does not match the scope > of the paper very well. Can I change the title or I should stick strictly to > the original proposal? I am not talking about radical change. Also I am > thinking of adding a couple more references now. You can change anything you want with the final term paper! The proposal was mainly there so that the TA could help you out with focusing the paper and checking the references. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Apr 17 19:42:31 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3I2gVKm031155 for ; Mon, 17 Apr 2006 19:42:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3I2bIvZ009111 for ; Mon, 17 Apr 2006 19:37:18 -0700 Message-Id: <200604180237.k3I2bIvZ009111@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Term Paper Inquiry Date: Mon, 17 Apr 2006 19:37:18 -0700 From: william@bourbon.usc.edu Someone wrote: > When references are added to the paper can it cross the 5 page > limit by a single page or so. I mean is it fine if the contents > are well within 5 pages but some of the references flow into the > sixth page. Hmm... I think I have mentioned in class that references can flow into the 6th page, although the spec says that everything (except for appendices) must fit in 5 pages. Since the two are in conflict, let's allow the references to flow into the 6th page. I'll modify the spec tonight. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Apr 15 16:59:17 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3FNxH9I007049 for ; Sat, 15 Apr 2006 16:59:17 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3FNsBbG028524 for ; Sat, 15 Apr 2006 16:54:11 -0700 Message-Id: <200604152354.k3FNsBbG028524@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: please make sure you use *full* citation... Date: Sat, 15 Apr 2006 16:54:11 -0700 From: william@bourbon.usc.edu Someone wrote: > Do we have to take care of the order in which references are > listed, for e.g. alphabetically by last name of first author, or > alphabetically by the paper's title, etc. Or can we simply list > them in any order and include the corresponding reference number > while quoting the reference in the text of the paper? Although it is not a requirement, alphabetically by the last name of the first author is the correct way of doing it. I have never seen anyone listing references alphabetically by the paper's title. I've seen people listing references according to order of appearance in the paper, but that's also not a good way. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Apr 15 10:45:03 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3FHj3Wb025089 for ; Sat, 15 Apr 2006 10:45:03 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3FHdw0G026736 for ; Sat, 15 Apr 2006 10:39:58 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k3FHdwdC026735 for cs530@merlot; Sat, 15 Apr 2006 10:39:58 -0700 Date: Sat, 15 Apr 2006 10:39:58 -0700 From: william@bourbon.usc.edu Message-Id: <200604151739.k3FHdwdC026735@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: please make sure you use *full* citation... Hi, Some of your proposals did not use *full* citation. Points will be deducted if you do not use full citation in the term paper. By full citation, you must include the following information: Authors You must include the names of authors in the order they appear in the paper. You must *not* use something like "first author, et al". You can replace first name and middle name by initials, but you must not ommit them if they appeared in the paper. Paper Title You must include the full title of the paper. If the title has multiple parts, you must include all parts. Where Published You must name the journal, conference, workshop, or symposium where the paper was published. For a conference, workshop, or symposium paper, you should say, "In proceedings of ...". For a journal paper or a book, you should say, "In ...". If it's a tech report, you should provide the tech report number and the department name and the university/research institution name. Location If it's a conference, workshop, or symposium paper, you should include the location where the conference, workshop, or symposium was held, if available. Publisher If it's a book, you must include the name of the publisher. Year You must include the year. If you have month information, you should include it. For *other* types of publications (such as web publications or white papers of organizations/companies), you should try your best to provide the above information. If some are not applicable or available, you may skip them. If some additional information is crucial for locating the document, please add them. Citation is a serious business! Please do it right! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Apr 12 21:40:00 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3D4e0X0009570 for ; Wed, 12 Apr 2006 21:40:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3D4Z4qu009533 for ; Wed, 12 Apr 2006 21:35:04 -0700 Message-Id: <200604130435.k3D4Z4qu009533@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Term paper format Date: Wed, 12 Apr 2006 21:35:04 -0700 From: william@bourbon.usc.edu Someone wrote: > Is there any particular format we need to follow for the term > paper? For example, term paper starts with an abstract section > followed by Introduction, details and conclusion. The idea is to look at the papers you have read and choose the format that appeals to you. For a 5 page paper, an abstract is not really necessary. If you would like to include one, please make it only one not-so-long paragraph. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Apr 8 19:54:58 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k392swbs011083 for ; Sat, 8 Apr 2006 19:54:58 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k392oHDJ022308 for ; Sat, 8 Apr 2006 19:50:17 -0700 Message-Id: <200604090250.k392oHDJ022308@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: doubt in edit Date: Sat, 08 Apr 2006 19:50:17 -0700 From: william@bourbon.usc.edu Someone wrote: > I was running G section of grading guidelines. > Have a doubt if ~csci530/public/hw4/f10.edit == encoded > version of ~csci530/public/hw4/f10 with > "yesnomaybe" passphrase If the plaintext files are *exactly* the same. If you are getting something different, make sure you check that the plaintext files are identical. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Apr 8 17:27:11 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k390RBwQ005427 for ; Sat, 8 Apr 2006 17:27:11 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k390MUlj021569 for ; Sat, 8 Apr 2006 17:22:30 -0700 Message-Id: <200604090022.k390MUlj021569@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: compatability test Date: Sat, 08 Apr 2006 17:22:30 -0700 From: william@bourbon.usc.edu Someone wrote: > My code is working fine for plus points. while testing for > Compatibility test > I am getting seg faults for following command and it also shows > difference between two files. > ----------------------------------------------------------------------- > /bin/rm -f fout > ./hw4 verify -so=./libhw4sc.so >! f4.enc > /bin/rm -f fout For the above, the guidelines say "just pound on the keyboard and hit at random times and see if the program behaves properly by not crashing". I guess you can just go into the debugger and see where your program crashes and fix the bug! > /hw4 sign -so=./libhw4sc.so $srcdir/f0 >! f0.sign > diff $srcdir/f0.sign f0.sign > > Please guide me If you program failed the compatibility test, you should go into the debugger and see if you are passing information correctly. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Apr 8 17:08:52 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3908qml004740 for ; Sat, 8 Apr 2006 17:08:52 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3904BgR021365 for ; Sat, 8 Apr 2006 17:04:11 -0700 Message-Id: <200604090004.k3904BgR021365@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Webpages not available on Reading List references Date: Sat, 08 Apr 2006 17:04:11 -0700 From: william@bourbon.usc.edu Someone wrote: > I was looking at links under the "Privacy" section on the > http://merlot.usc.edu/cs530-s06/papers.html webpage, and all the > links in the Supplementary Readings point to the IEEE website > which shows that those references are no longer available. Could > you please provide any information on where to get the text for > these references from, or should we just search it online and get > them. Looks like IEEE has either deleted these pages or moved them somewhere else. May be you can do some google search and find out where they have moved to. Or you can find the issue of IEEE Spectrum in the library and read the hardcopy. Sorry about the inconvenience. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Apr 8 17:00:18 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k3900HoQ004435 for ; Sat, 8 Apr 2006 17:00:17 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k38NtbhX021312 for ; Sat, 8 Apr 2006 16:55:37 -0700 Message-Id: <200604082355.k38NtbhX021312@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: RSA_public_decrypt() Date: Sat, 08 Apr 2006 16:55:37 -0700 From: william@bourbon.usc.edu Someone wrote: > I'm having trouble with this function. When I call it when > RSA_PKCS1_PADDING, I get the following error: > > error:0407006A:rsa routines:RSA_padding_check_PKCS1_type_1:block > type is not 01 > > I can't find descriptions of this error anywhere, but I'm > assuming it means that the data is not signed using that padding. No necessarily. It could also be the case that the parameters you are pssing to RSA_public_decrypt() is not exactly right (which I suspect to be the case). > When I used RSA_NO_PADDING, I got results, albeit incorrect ones. Please always use RSA_PKCS1_PADDING! > Can you point me in the right direction to debug this error? I > can't step into RSA_public_decrypt in the debugger, so everything > just fails when I get there. My guess is that the parameters you are pssing to RSA_public_decrypt() is not setup right exactly. You need to experiment to see what you need exactly. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Apr 8 16:22:14 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k38NMEwv002974 for ; Sat, 8 Apr 2006 16:22:14 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k38NHXt1021161 for ; Sat, 8 Apr 2006 16:17:33 -0700 Message-Id: <200604082317.k38NHXt1021161@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: hw4 problem linking Date: Sat, 08 Apr 2006 16:17:33 -0700 From: william@bourbon.usc.edu Someone wrote: > I am having following error: ld.so.1: hw4: fatal: relocation > error: file ./libhw4sc.so: symbol RSA_private_encrypt: referenced > symbol not found. > > A function from HW4.c is calling smartcard in which I have used > RSA_private_encrypt. > > What to do? My guess is that if your hw4 calls RSA_public_decrypt(), then it should be fine. And you need to call RSA_public_decrypt() for the verify command. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Apr 8 15:43:54 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k38Mhses001430 for ; Sat, 8 Apr 2006 15:43:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k38MdDkj021016 for ; Sat, 8 Apr 2006 15:39:13 -0700 Message-Id: <200604082239.k38MdDkj021016@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: another hw4 question Date: Sat, 08 Apr 2006 15:39:13 -0700 From: william@bourbon.usc.edu Someone wrote: > I have a little question: > Let's say that directory $HOME/tmp exists, but its permissions > are set so that my program cannot access it. In this case I > cannot create files there, but I cannot create a new tmp > directory either, since one already exists. I assume that > this might not be an issue with this homework, but decided to > ask anyway. Right. If you use mkstemp(), it will try to create the file in $HOME/tmp. If it fails, then you should abort with an error message. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Friday, April 07, 2006 9:21 PM Subject: Re: CSCI530 - HW4 - Temp file deletion > Someone wrote: > > > When editing the temp file, emacs creates its own temp file which > > has the same name as the original temp file plus a "~" at the > > end. Are we responsible for deleting this file as well? > > No. > > > Or is the > > fact that potentially there's an unencrypted file left in the > > user's tmp directory their own fault? > > Right! We cannot (and should not) control what happens when > an external editor is used. Clearly, if your editor of choice > automatically sends the content of what it's editing to > hackerworld.com, there's nothing we can do! > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Apr 7 22:03:07 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k38537Sh024219 for ; Fri, 7 Apr 2006 22:03:07 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k384wScL014993 for ; Fri, 7 Apr 2006 21:58:28 -0700 Message-Id: <200604080458.k384wScL014993@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: CSCI 530 - HW4 - Additional Test Data Files Date: Fri, 07 Apr 2006 21:58:28 -0700 From: william@bourbon.usc.edu Someone wrote: > I tried running the script under "Additional Test Data Files" but I get this > output: > > diff: /home/scf-22/csci530/public/hw4/f0.enc: No such file or directory > diff: /home/scf-22/csci530/public/hw4/f1.enc: No such file or directory > diff: /home/scf-22/csci530/public/hw4/f2.enc: No such file or directory > diff: /home/scf-22/csci530/public/hw4/f3.enc: No such file or directory > diff: /home/scf-22/csci530/public/hw4/f4.enc: No such file or directory > diff: /home/scf-22/csci530/public/hw4/f5.enc: No such file or directory > diff: /home/scf-22/csci530/public/hw4/f6.enc: No such file or directory > diff: /home/scf-22/csci530/public/hw4/f7.enc: No such file or directory > diff: /home/scf-22/csci530/public/hw4/f8.enc: No such file or directory > diff: /home/scf-22/csci530/public/hw4/f9.enc: No such file or directory > > Seems these files are missing. Oops! Since we have the grading guidelines now, the *old* stuff about "Additional Test Data Files" should be ignored! Sorry about this. (With the grading guidelines, instead of using "f?.enc", we have "f?.1.enc" and "f?.2.enc".) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Apr 7 21:26:02 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k384Q2Nc022759 for ; Fri, 7 Apr 2006 21:26:02 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k384LOaB014827 for ; Fri, 7 Apr 2006 21:21:24 -0700 Message-Id: <200604080421.k384LOaB014827@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: CSCI530 - HW4 - Temp file deletion Date: Fri, 07 Apr 2006 21:21:24 -0700 From: william@bourbon.usc.edu Someone wrote: > When editing the temp file, emacs creates its own temp file which > has the same name as the original temp file plus a "~" at the > end. Are we responsible for deleting this file as well? No. > Or is the > fact that potentially there's an unencrypted file left in the > user's tmp directory their own fault? Right! We cannot (and should not) control what happens when an external editor is used. Clearly, if your editor of choice automatically sends the content of what it's editing to hackerworld.com, there's nothing we can do! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Apr 7 15:19:12 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k37MJCrK007799 for ; Fri, 7 Apr 2006 15:19:12 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k37MEZpS013346 for ; Fri, 7 Apr 2006 15:14:35 -0700 Message-Id: <200604072214.k37MEZpS013346@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Hw4 question Date: Fri, 07 Apr 2006 15:14:35 -0700 From: william@bourbon.usc.edu Someone wrote: > Do we "must" use mkstemp function to create a temporary file? Or > is it OK if we hard-code the temporary file name for the home > work? In this way we can delete the temporay file if the file > already exists, in case the user pressed a Ctrl^C during the last > operation. One should *never* hardcode temporary file names! The main reason is that there is always a possibility that more than one instance of your code could be running. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Apr 7 12:46:12 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k37JkCbW001932 for ; Fri, 7 Apr 2006 12:46:12 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k37Jfaw8012304 for ; Fri, 7 Apr 2006 12:41:36 -0700 Message-Id: <200604071941.k37Jfaw8012304@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Inquiry regarding Term Paper Date: Fri, 07 Apr 2006 12:41:36 -0700 From: william@bourbon.usc.edu Someone wrote: > I have a question regarding the Term paper. Should our paper > reference 3 papers written by 3 different approved authors or is > it fine if our paper reference 3 papers written by the same or > may be two different apporved authors. There are no constaints here. Just have to add up to 3 or more. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Apr 7 10:09:01 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k37H91dn028361 for ; Fri, 7 Apr 2006 10:09:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k37H4OeT011225 for ; Fri, 7 Apr 2006 10:04:24 -0700 Message-Id: <200604071704.k37H4OeT011225@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: cs530 HW4 query Date: Fri, 07 Apr 2006 10:04:24 -0700 From: william@bourbon.usc.edu Someone wrote: > I have changed the smartcard.c but retained the comments at the > begining of the file. Is that fine? Do I have to mention it > somewhere that I took the original sample smartcard.c and then > modified it. You don't have to mention anything that's already part of the spec, and the original code in smartcard.c can be considered to be part of the spec. > Do we have to submit secret.c along with the other files? As you can see from the grading guidelines, the first thing we do is to rename the secret.c in your submission. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Apr 7 06:43:03 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k37Dh39u020433 for ; Fri, 7 Apr 2006 06:43:03 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k37DcR7u010377 for ; Fri, 7 Apr 2006 06:38:27 -0700 Message-Id: <200604071338.k37DcR7u010377@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: HW4 Submission deadline Date: Fri, 07 Apr 2006 06:38:27 -0700 From: william@bourbon.usc.edu Someone wrote: > Just to be safe, I wanted to clarify the due date. The 'Homework' > webpage mentions an extension to April 8th but the HW4 page still > says April 7th. I'm assuming it is the 8th. Kindly correct me in > case I'm wrong. You are correct. Sorry about the bug on the HW4 spec page. It's fixed now. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Apr 7 06:39:15 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k37DdF9G020212 for ; Fri, 7 Apr 2006 06:39:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k37DYdtJ010343 for ; Fri, 7 Apr 2006 06:34:39 -0700 Message-Id: <200604071334.k37DYdtJ010343@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: cs 530 hw 4 RSA struct question Date: Fri, 07 Apr 2006 06:34:39 -0700 From: william@bourbon.usc.edu Someone wrote: > In some of the functions such as RSA_private_encrypt we need to > pass in a struct of type RSA to the function. I am having some > trouble generating this struct and was wondering if we need to > build it by hand as I am trying to do or if there is a function > that we can use to create it from the stored values in the > secret.c file? It was intended that for this HW that you need to look through the opensl documentations and do some searches on the web to find out how to get this to work! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Apr 6 13:40:25 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k36KeP21010784 for ; Thu, 6 Apr 2006 13:40:25 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k36KZqbW005648 for ; Thu, 6 Apr 2006 13:35:52 -0700 Message-Id: <200604062035.k36KZqbW005648@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: doubts about edit option Date: Thu, 06 Apr 2006 13:35:52 -0700 From: william@bourbon.usc.edu Someone wrote: > I still have some questions: > What if the user after editing the file uses not just "save" but "save as" > and changes the name of the file? How can I know where the file is saved? Or > we don't have to worry about this for this homework? Everything should still work, your should not modify the original ciphertext file because the SHA1 value has not changed. Except now there is a plaintext file in ~/tmp after you have deleted the temporary file you have created. It's an operator error and not your program's fault! -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Wednesday, April 05, 2006 10:32 PM To: cs530@merlot.usc.edu Subject: Re: doubts about edit option Someone wrote: > I am sorry but I am stuck with this last command, since I am not > quite familiar with envoking system commands from c++ code. I > downloaded your example, and everything seems clear there. I have > also added code to decrypt the file and then display it in the > editor. However I have no clue how my program can communicate > with an editor, for instance how I can get the contents of the > file before the user exits the editor. > > The only way I could come up with is this: > - the user enters "hw4 edit -so=./libhw4sc.so somefile.txt" (the > file is encrypted) > - I decrypt it and save as somefile.txt.tmp. > - using system(), I open somefile.txt.tmp in the editor (vi) > - after a call to system() (which returns after the user exits > the editor, right?) I encrypt the file and save it to > somefile.txt > > By some reason this does not seem like the right solution to > me... Maybe because I do decryption and encryption "offline", and > not on the fly: the unencrypted data is actually stored on disk, > and what I do is just open one file, do crypto and save results > to another file. I am not sure this is what you wanted us to do. > Could you please help me out with this? You are pretty close! Let's say that you ran "hw4 edit -so=./libhw4sc.so somefile.txt" and "somefile.txt" exists and is an encrypted file. What you must do is to call mkstemp() and create a file in ~/tmp. Let's say the file you obtained from calling mkstemp() is "~/tmp/ABCDEF". You must then decrypt "somefile.txt" into "~/tmp/ABCDEF". Now "~/tmp/ABCDEF" contains only ASCII text. You calculate SHA1 hash of this file and store it in memory. Then you call system() to edit this file. When system() returns (the editor quits), you calculate SHA1 hash of "~/tmp/ABCDEF" again. If it has not changed, you simple delete "~/tmp/ABCDEF". If it has changed, you encrypt "~/tmp/ABCDEF" into "somefile.txt" and delete "~/tmp/ABCDEF". By the way, you should never call rmdir() on "~/tmp", even if your program has created this directory. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Wednesday, April 05, 2006 12:19 PM Subject: Re: Question about edit option in hw4 > Someone wrote: > > > I had talked to you after class today regarding the contents of a > > plaintext file obtained from 3DES encryption using the "enc" > > option in hw4 and that of a new file created with the "edit" > > option, having the same contents as of the plaintext file i > > encrypt using 3DES. > > > > I have the plain text file "yesterday.txt" which i encrypt using > > the "enc" option and passphrase "yesnomaybe" and whose output i > > redirect to a file "yesterday.enc". I get a file with the HW4____ > > header and the 3DES encrypted contents with its SHA1 stored in > > the end. > > > > Then i open a new file "yest" using hw4 edit -so=./libhw4sc.so > > yest command. Once the editor opens (i'm using vi editor) I type > > :r yesterday.txt and then i save it and exit (:wq). It asks me > > for a passphrase. Again i enter "yesnomaybe" and it stores this > > file in the 3DES encrypted format. > > > > My question is that when i do a diff on "yest" and > > "yesterday.enc", it says "Binary files differ" so when i comapre > > the hexdumps of these files, I get almost the entire contents > > different, except for the header information. I'm calling the > > same function inside my edit() function to encrypt a new file, > > as the one i use for the triple DES encryption when the "enc" > > option is used. Could you tell me what is wrong with this. > > Ah! You are using ":r" in "vi" to read the file. When you > do that, you should notice that you have a blank line at the > top of the file! In "vi", you should do "dd" to remove the > first line, then the file should be identical to the one > you've created using the "enc" command. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Apr 5 22:36:35 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k365aZLq007464 for ; Wed, 5 Apr 2006 22:36:35 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k365W45J001388 for ; Wed, 5 Apr 2006 22:32:04 -0700 Message-Id: <200604060532.k365W45J001388@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: doubts about edit option Date: Wed, 05 Apr 2006 22:32:04 -0700 From: william@bourbon.usc.edu Someone wrote: > I am sorry but I am stuck with this last command, since I am not > quite familiar with envoking system commands from c++ code. I > downloaded your example, and everything seems clear there. I have > also added code to decrypt the file and then display it in the > editor. However I have no clue how my program can communicate > with an editor, for instance how I can get the contents of the > file before the user exits the editor. > > The only way I could come up with is this: > - the user enters "hw4 edit -so=./libhw4sc.so somefile.txt" (the > file is encrypted) > - I decrypt it and save as somefile.txt.tmp. > - using system(), I open somefile.txt.tmp in the editor (vi) > - after a call to system() (which returns after the user exits > the editor, right?) I encrypt the file and save it to > somefile.txt > > By some reason this does not seem like the right solution to > me... Maybe because I do decryption and encryption "offline", and > not on the fly: the unencrypted data is actually stored on disk, > and what I do is just open one file, do crypto and save results > to another file. I am not sure this is what you wanted us to do. > Could you please help me out with this? You are pretty close! Let's say that you ran "hw4 edit -so=./libhw4sc.so somefile.txt" and "somefile.txt" exists and is an encrypted file. What you must do is to call mkstemp() and create a file in ~/tmp. Let's say the file you obtained from calling mkstemp() is "~/tmp/ABCDEF". You must then decrypt "somefile.txt" into "~/tmp/ABCDEF". Now "~/tmp/ABCDEF" contains only ASCII text. You calculate SHA1 hash of this file and store it in memory. Then you call system() to edit this file. When system() returns (the editor quits), you calculate SHA1 hash of "~/tmp/ABCDEF" again. If it has not changed, you simple delete "~/tmp/ABCDEF". If it has changed, you encrypt "~/tmp/ABCDEF" into "somefile.txt" and delete "~/tmp/ABCDEF". By the way, you should never call rmdir() on "~/tmp", even if your program has created this directory. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Wednesday, April 05, 2006 12:19 PM Subject: Re: Question about edit option in hw4 > Someone wrote: > > > I had talked to you after class today regarding the contents of a > > plaintext file obtained from 3DES encryption using the "enc" > > option in hw4 and that of a new file created with the "edit" > > option, having the same contents as of the plaintext file i > > encrypt using 3DES. > > > > I have the plain text file "yesterday.txt" which i encrypt using > > the "enc" option and passphrase "yesnomaybe" and whose output i > > redirect to a file "yesterday.enc". I get a file with the HW4____ > > header and the 3DES encrypted contents with its SHA1 stored in > > the end. > > > > Then i open a new file "yest" using hw4 edit -so=./libhw4sc.so > > yest command. Once the editor opens (i'm using vi editor) I type > > :r yesterday.txt and then i save it and exit (:wq). It asks me > > for a passphrase. Again i enter "yesnomaybe" and it stores this > > file in the 3DES encrypted format. > > > > My question is that when i do a diff on "yest" and > > "yesterday.enc", it says "Binary files differ" so when i comapre > > the hexdumps of these files, I get almost the entire contents > > different, except for the header information. I'm calling the > > same function inside my edit() function to encrypt a new file, > > as the one i use for the triple DES encryption when the "enc" > > option is used. Could you tell me what is wrong with this. > > Ah! You are using ":r" in "vi" to read the file. When you > do that, you should notice that you have a blank line at the > top of the file! In "vi", you should do "dd" to remove the > first line, then the file should be identical to the one > you've created using the "enc" command. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Apr 5 12:24:12 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k35JOCjR016292 for ; Wed, 5 Apr 2006 12:24:12 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k35JJgkP030041 for ; Wed, 5 Apr 2006 12:19:42 -0700 Message-Id: <200604051919.k35JJgkP030041@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Question about edit option in hw4 Date: Wed, 05 Apr 2006 12:19:42 -0700 From: william@bourbon.usc.edu Someone wrote: > I had talked to you after class today regarding the contents of a > plaintext file obtained from 3DES encryption using the "enc" > option in hw4 and that of a new file created with the "edit" > option, having the same contents as of the plaintext file i > encrypt using 3DES. > > I have the plain text file "yesterday.txt" which i encrypt using > the "enc" option and passphrase "yesnomaybe" and whose output i > redirect to a file "yesterday.enc". I get a file with the HW4____ > header and the 3DES encrypted contents with its SHA1 stored in > the end. > > Then i open a new file "yest" using hw4 edit -so=./libhw4sc.so > yest command. Once the editor opens (i'm using vi editor) I type > :r yesterday.txt and then i save it and exit (:wq). It asks me > for a passphrase. Again i enter "yesnomaybe" and it stores this > file in the 3DES encrypted format. > > My question is that when i do a diff on "yest" and > "yesterday.enc", it says "Binary files differ" so when i comapre > the hexdumps of these files, I get almost the entire contents > different, except for the header information. I'm calling the > same function inside my edit() function to encrypt a new file, > as the one i use for the triple DES encryption when the "enc" > option is used. Could you tell me what is wrong with this. Ah! You are using ":r" in "vi" to read the file. When you do that, you should notice that you have a blank line at the top of the file! In "vi", you should do "dd" to remove the first line, then the file should be identical to the one you've created using the "enc" command. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Apr 4 23:34:45 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k356YjZu018817 for ; Tue, 4 Apr 2006 23:34:45 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k356UI98026381 for ; Tue, 4 Apr 2006 23:30:18 -0700 Message-Id: <200604050630.k356UI98026381@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: hw4 sig.txt Date: Tue, 04 Apr 2006 23:30:18 -0700 From: william@bourbon.usc.edu Someone wrote: > I just wanted to clarify what I should be doing in the sign function. > > -Get SHA1(file) > -Encrypt hash using private key in smartcard > -output ciphertext to stdout. > So I guess my question is how come sig.txt has 128 hexstring? > Should it not be 20bytes(same size as SHA1(file) size)? When you encrypt a 20-byte value with a 1024-bit RSA private key, you get m^d mod n, which is a 1024 bit value. 1024 bit = 128 bytes and 128 bytes in hexstring representation is 256 characters. Adding a '\n' at the end of the hexstring, sig.txt is therefore 257 bytes in size. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Apr 4 23:14:02 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k356E2Kk017979 for ; Tue, 4 Apr 2006 23:14:02 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k3569Y7K026278 for ; Tue, 4 Apr 2006 23:09:34 -0700 Message-Id: <200604050609.k3569Y7K026278@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: [CS530] Date: Tue, 04 Apr 2006 23:09:34 -0700 From: william@bourbon.usc.edu Someone wrote: > I have another simple question to ask regarding c programming. > > For SC_3des_key_gen function, I pass in an empty 8 bytes iv, > key1, key2, and key3 to the function. When I check the "sizeof", > iv, key1, key2, and key3, it's somehow not 8 bytes, but 4 bytes. Although the function prototype of SC_3des_key_gen() says that iv, key1, key2, key3 are of type "unsigned char SOEMTHING[8]", they are basically passed as "unsigned char *", i.e., pointer to unsigned char (arrays and pointers are basically the same in C/C++). This can cause confusion, as you have observed. If you declare something "char buf[80]" and do sizeof(buf), you get 80. But if you pass buf as a parameter in a function and inside the function, you do sizeof(buf), you get 4! I'm not exactly sure if this is a compiler dependent behavior, but as you have observed, it may not be what you expect. > This is why I get segmentation fault when I pass those keys into > DES_set_odd_parity(&key1) because those are not 8 bytes long. I'm not sure how this is related to DES_set_odd_parity() since DES_set_odd_parity() requires (DES_cblock*) to be passed in. I assume your key1 here is of type DES_cblock and not unsigned char key1[8]. > I think I should pass in those 8 bytes into SC_3des_key_gen > function in a special way since those arrays have to be updated > when those are returned, but I forgot how I did this before... Do > you have any hints? For now, let's just assume that this is one of those behavior that depends on compiler implementation. A simple way to fix this is to *not* use sizeof(iv) inside your implementation of SC_3des_key_gen() but use 8 instead! This may sound unsatisfactory, but it seems reasonable to me! If someone know exactly why sizeof(iv) is 4 inside SC_3des_key_gen() on a 32-bit machine, please let me know (pointing me to a C/C++ spec web page would be great). -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Apr 4 22:56:28 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k355uRvf017297 for ; Tue, 4 Apr 2006 22:56:27 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k355q09e026160 for ; Tue, 4 Apr 2006 22:52:00 -0700 Message-Id: <200604050552.k355q09e026160@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: CSCI 530 - Minor error in HW4 spec? Date: Tue, 04 Apr 2006 22:52:00 -0700 From: william@bourbon.usc.edu Someone wrote: > This is not critical, but I thought I'd mention it anyway. > > Under "Examples for enc and dec": > "hw4 dec -so=./libhw4sc.so usctommy.enc > usctommy.gif.new" > should probably be > "hw4 dec -so=./libhw4sc.so usctommy.gif.enc > usctommy.gif.new" Yep! Thanks for pointing this out. It has been fixed. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Apr 3 11:09:41 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k33I9f6n029769 for ; Mon, 3 Apr 2006 11:09:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k33I5JWV015441 for ; Mon, 3 Apr 2006 11:05:19 -0700 Message-Id: <200604031805.k33I5JWV015441@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: some clarifications about verify Date: Mon, 03 Apr 2006 11:05:19 -0700 From: william@bourbon.usc.edu Someone wrote: > There are a couple of clarification questions I have about verify > function. > > The spec says we are supposed to output "the first 20 bytes of > the result". I am a little confused here: since we know that it > is an SHA1 hash that was supposed to be signed, the valid result > should always be 20 bytes (if there are more bytes, this is an > error). Or I should not make any assumptions about the size of > original message? If this is the case, then how do I know how big > of a buffer I should allocate (I mean not for this homework, but > in general)? It's a very good question. Actually, I do know the exact answer! Here is the problem... In verify, you are suppose to call RSA_public_decrypt(). From class, c is m^d mod n. If n is 1024 bytes long, how many bytes is m? Somehow, when we call RSA_public_decrypt(), it knows that m is 20 bytes long! My guess is that in OpenSSL, c (the output of RSA_private_encrypt()) actually stores the size of m, but I cannot find any documentation that says this. (If someone finds it, please let me know.) Since RSA_public_decrypt() should output 20 bytes of data, you are right that the spec is saying something weird (although it is technically correct the way it is). In general, you should allocate a buffer whose size is the return value of RSA_size(), which is basically the number of bytes in n. This implies that you must create an (RSA*) object before you call RSA_size(). > Another doubt comes from an email one of the students sent: the > student suggested that we can check the file size to validate > input, and that it should be 257bytes. Shouldn't it be 256? Does > 257 include the newline? Should we ignore newlines when we do > such checks, or the newlines in the middle of the signature (or > anywhere else) should be considered errors? Since the output of the sign command is ASCII, you should follow the UNIX convention to append an '\n' at the end. Just looking at the Miscellaneous section of the spec now, I see that I forgot to include it. I have just added the following: [BC: Added 4/3/2006] Please follow the UNIX convention that, when your output is an ASCII file (such as the output of the sign and verify commands), append '\n' in the last line of the output if it's not a blank line. (This way, you don't get the commandline prompt appearing at the wrong place on the screen.) Sorry that it was left out. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Apr 3 09:13:12 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k33GDBTM025296 for ; Mon, 3 Apr 2006 09:13:11 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k33G8oB2014242 for ; Mon, 3 Apr 2006 09:08:50 -0700 Message-Id: <200604031608.k33G8oB2014242@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: good chance of canceling class on Monday, 4/3/2006 Date: Mon, 03 Apr 2006 09:08:50 -0700 From: william@bourbon.usc.edu Hi, I'm quite sick today and won't be coming to campus. Sorry I have to cancel class today. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Sun, 2 Apr 2006 21:54:49 -0700 From: william@bourbon.usc.edu To: cs530@merlot.usc.edu Subject: good chance of canceling class on Monday, 4/3/2006 Hi, I got up this morning with a cold and now it's getting worse and worse. Looks like there will be a very good chance that I will have to cancel class tomorrow, Monday, 4/3/2006. I'll send out another e-mail tomorrow morning to let you know if there will be class. So, please check your e-mail tomorrow morning before class. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Apr 2 21:59:10 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k334xA9Z029574 for ; Sun, 2 Apr 2006 21:59:10 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k334sndD011864 for ; Sun, 2 Apr 2006 21:54:49 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k334snYF011863 for cs530@merlot; Sun, 2 Apr 2006 21:54:49 -0700 Date: Sun, 2 Apr 2006 21:54:49 -0700 From: william@bourbon.usc.edu Message-Id: <200604030454.k334snYF011863@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: good chance of canceling class on Monday, 4/3/2006 Hi, I got up this morning with a cold and now it's getting worse and worse. Looks like there will be a very good chance that I will have to cancel class tomorrow, Monday, 4/3/2006. I'll send out another e-mail tomorrow morning to let you know if there will be class. So, please check your e-mail tomorrow morning before class. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Apr 2 21:53:41 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k334rfco029344 for ; Sun, 2 Apr 2006 21:53:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k334nLJI011751 for ; Sun, 2 Apr 2006 21:49:21 -0700 Message-Id: <200604030449.k334nLJI011751@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: question about SmartcardState - follow up Date: Sun, 02 Apr 2006 21:49:21 -0700 From: william@bourbon.usc.edu Someone wrote: > So, do I understand correctly, that in my smartcard application > SmartcardState is always the same type (from function to function)? Which > type it is - up to me, and it may be different from what other smartcard > use. Right? If by "my smartcard application" you meant "hw4", it would be correct. But your "hw4" may only know that SmartcardState is of type (void*) and must not typecast it to anything else. Your "hw4" must work with other smartcards that are implemented according to our spec. If by "my smartcard application" you meant "libhw4sc.so", it would also be correct. SmartcardState is just a memory address that you return when SC_init() returns and you have the right to expect that on subsequent calls to any other smartcard function, the same memory address is returned. (There should be no need for any global variable in your smartcard.) -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Sunday, April 02, 2006 3:34 PM Subject: Re: question about SmartcardState - follow up > Someone wrote: > > > It is me again. I am not sure that I formulated my question > > clearly. Here is what confuses me: > > > > Lets conside the sample code you've given us. SC_Init() writes > > something into a char buffer and then returns this buffer as a > > SmartcardState. Then SC_get_signature_size() takes this > > SmartcardState and reads chars from the buffer. This makes sense. > > However SmartcardState can be anything, not only a char array. If > > one function puts something in a SmartcardState, and the other > > function uses it, it should better be of the same type. > > The *only* function that can/should put something into SmartcardState > is SC_init(). In your smartcard, if you change SmartcardState when > some other function is called, then you are expecting the application > to behave in a certain way and that would be a bad assumption! > > > This > > means that an application that uses SC interface (hw4) should > > either maintain a particular order of function calls, or should > > know what exactly each function puts into/reads from a > > SmartcardState. In either case SmartcardState is opaque. > > The application must not assume anything about the smartcard. > The smartcard should not assume anything about the application > except that it will follow the protocol for SmartcardState! > So, your application and your smartcard must follow these > assumptions. Otherwise, you will not have interoperability. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Apr 2 15:39:00 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k32Md00S015290 for ; Sun, 2 Apr 2006 15:39:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k32MYfhZ010738 for ; Sun, 2 Apr 2006 15:34:41 -0700 Message-Id: <200604022234.k32MYfhZ010738@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: question about SmartcardState - follow up Date: Sun, 02 Apr 2006 15:34:41 -0700 From: william@bourbon.usc.edu Someone wrote: > It is me again. I am not sure that I formulated my question > clearly. Here is what confuses me: > > Lets conside the sample code you've given us. SC_Init() writes > something into a char buffer and then returns this buffer as a > SmartcardState. Then SC_get_signature_size() takes this > SmartcardState and reads chars from the buffer. This makes sense. > However SmartcardState can be anything, not only a char array. If > one function puts something in a SmartcardState, and the other > function uses it, it should better be of the same type. The *only* function that can/should put something into SmartcardState is SC_init(). In your smartcard, if you change SmartcardState when some other function is called, then you are expecting the application to behave in a certain way and that would be a bad assumption! > This > means that an application that uses SC interface (hw4) should > either maintain a particular order of function calls, or should > know what exactly each function puts into/reads from a > SmartcardState. In either case SmartcardState is opaque. The application must not assume anything about the smartcard. The smartcard should not assume anything about the application except that it will follow the protocol for SmartcardState! So, your application and your smartcard must follow these assumptions. Otherwise, you will not have interoperability. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Apr 2 15:33:42 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k32MXfPB015059 for ; Sun, 2 Apr 2006 15:33:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k32MTM2g010711 for ; Sun, 2 Apr 2006 15:29:22 -0700 Message-Id: <200604022229.k32MTM2g010711@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: question about SmartcardState Date: Sun, 02 Apr 2006 15:29:22 -0700 From: william@bourbon.usc.edu Someone wrote: > I am sorry I am somewhat confused about the usage of > SmartcardState. I have included it into the signatures of all the > smartcard functions (as the spec suggests), but I don't really > know how I am supposed to use it. I mean I can come up with some > information I can possibly store in it, but it would be good to > know how you intended us to use it. The spec says: "you should > treat SmartcardState as an opaque object". It seems to me that > SmartcardState is used to save 'something' in between function > calls, while what that something would be - is absolutely > arbitrary. So I have some worries about compatibility. Could you > give a hint about what a SmartcardState can be? "compatibility" is the operative word here. The basic idea is that when you implement your smartcard, you have the right to expect the application that will use your smartcard be compliant to our protocol. This means that whatever you return to the caller when SC_init() returns, the called is expected to pass it back to you when it subsequently call any of the smartcard functions. With that in mind, you can return anything you want as the SmartcardState. For example, you can return NULL. Another example is that you can create a C++ object and return it as SmartcardState. In this case, when the application calls other smartcard functions, you can *safely* typecast whatever they pass back to you and typecast it back to the C++ pointer that you were using. As far as the application goes, it should have no knowledge what's in the SmartcardState and should *never* typecast it to anything. The application should only keep it around so that it can pass it back to the smartcard when it subsequently call other smartcard functions. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Apr 1 12:25:17 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k31KPHrp029668 for ; Sat, 1 Apr 2006 12:25:17 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k31KL2Yt017305 for ; Sat, 1 Apr 2006 12:21:02 -0800 Message-Id: <200604012021.k31KL2Yt017305@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: HW 4 question Date: Sat, 01 Apr 2006 12:21:02 -0800 From: william@bourbon.usc.edu Someone wrote: > I have some questions regarding the edit option. > > 1. If the file already exists, user need to be prompted for > password to decrypt the file. If the user changes the file, do > we need to ask for the password again (and verification) or just > use the password entered by the user for decryption? You should use the same passphrase. > 2. If the file does not exist, user will not be asked for the > password before opening the file in the editor. After user edits > the file (and filesize > 0), user will be asked for the password > and verification for encryption. Is this assumption is correct? Yes. Although I wouldn't check the filesize. If the file does not exist before, you can create a temporary file with file size of zero. You can then compute the hash of this file. When the editor quits, you can check the hash and see if it has changed. This way, I think you have a slightly less specialized code. (Checking the file size if the file does not exist before is fine too.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Mar 30 10:21:22 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k2UILMCd003655 for ; Thu, 30 Mar 2006 10:21:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k2UIHEjW004356 for ; Thu, 30 Mar 2006 10:17:14 -0800 Message-Id: <200603301817.k2UIHEjW004356@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Grading guidelines issues (Sorry about the previous mail) Date: Thu, 30 Mar 2006 10:17:14 -0800 From: william@bourbon.usc.edu Someone wrote: > I am really sorry for what I wrote in the previous mail, totally > misunderstood what you were trying to say. > > I read the comments under the hc() functions in the sample code > and came to know what you were trying to say. > > And guess which symbol from libhw4sc.so wasn't getting resolved > SHA1(). I had deleted the hc() function without reading the > comments to make my code look neat. Pasted the code back and > everything is fine now. No segmentation faults. > > Now I remember you talking about resolving symbols in lecture!! Hmm... I didn't expect this to be the problem! Everyone should be using SHA1_Init(), SHA1_Update(), and SHA1_Final() in "hw4" and that *should* work with "libhw9sc.so". There is no need to call SHA1() in "hw4". I took a look at the code in "libhw9sc.so" and it's calling SHA1() directly and that was the cause of the problem you mentioned before. I've just replaced "libhw9sc.so" so that it uses SHA1_Init(), SHA1_Update(), and SHA1_Final() instead. Please remove the hc() function in your code and try again. If it doesn't work, please let me know. And thanks for catching it! Because of this mistake, I have extended the deadline for HW4 by one day. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- william@bourbon.usc.edu wrote: Someone wrote: > I tried using the new "libhw9sc.so" file uploaded on > ~csci530/public/hw4, and its still giving me segmentattion > faults. > > I used it with the sample code given to us in > ~csci530/public/hw4/sample, and with it also it gives > segmentation faults. The sample code is just a sample, it is not suppose to work with anything other than the given example. (Although this does make it easier to debug the problem you are referring to.) The reason for the seg fault is that the code in hw4.c is not checking the return code of dlopen(). In this particular case, if you go into the debugger, you will notice that dlopen() returns NULL and therefore, the code follows gets a seg fault. So, the question is why dlopen() returns NULL. > You could probably try replacing the libhw4sc.so in > ~csci530/public/hw4/sample with libhw9sc.so and try running hw4, > to check that if I am not doing anything wrong in between. If I > am doing so then please correct me. > > And yes stripping the .so files reduces the size drastically. My > .so file is now only 6448 bytes. Have you completed your hw4? If not, please complete your hw4 and try this again. If you have, what are you calling to generate RB1 and RB2? Here is where I think the problem is... "~csci530/public/hw4/libhw9sc.so" uses something you are suppose to call in "hw4" for generating secrets, i.e., RAND_bytes(). If you are not calling that function or RAND_pseudo_bytes(), "libhw9sc.so" cannot be loaded because it cannot resolve all the references. So, if you really want the sample code to load "libhw9sc.so", you need to add #include near the top of "hw4.c" and add RAND_pseudo_bytes(sha1_buf, sizeof(sha1_buf)); inside the ha() function. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Mar 30 01:42:15 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k2U9gFCN015484 for ; Thu, 30 Mar 2006 01:42:15 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k2U9c8DB001666 for ; Thu, 30 Mar 2006 01:38:08 -0800 Message-Id: <200603300938.k2U9c8DB001666@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Grading guidelines issues Date: Thu, 30 Mar 2006 01:38:08 -0800 From: william@bourbon.usc.edu Someone wrote: > I tried using the new "libhw9sc.so" file uploaded on > ~csci530/public/hw4, and its still giving me segmentattion > faults. > > I used it with the sample code given to us in > ~csci530/public/hw4/sample, and with it also it gives > segmentation faults. The sample code is just a sample, it is not suppose to work with anything other than the given example. (Although this does make it easier to debug the problem you are referring to.) The reason for the seg fault is that the code in hw4.c is not checking the return code of dlopen(). In this particular case, if you go into the debugger, you will notice that dlopen() returns NULL and therefore, the code follows gets a seg fault. So, the question is why dlopen() returns NULL. > You could probably try replacing the libhw4sc.so in > ~csci530/public/hw4/sample with libhw9sc.so and try running hw4, > to check that if I am not doing anything wrong in between. If I > am doing so then please correct me. > > And yes stripping the .so files reduces the size drastically. My > .so file is now only 6448 bytes. Have you completed your hw4? If not, please complete your hw4 and try this again. If you have, what are you calling to generate RB1 and RB2? Here is where I think the problem is... "~csci530/public/hw4/libhw9sc.so" uses something you are suppose to call in "hw4" for generating secrets, i.e., RAND_bytes(). If you are not calling that function or RAND_pseudo_bytes(), "libhw9sc.so" cannot be loaded because it cannot resolve all the references. So, if you really want the sample code to load "libhw9sc.so", you need to add #include near the top of "hw4.c" and add RAND_pseudo_bytes(sha1_buf, sizeof(sha1_buf)); inside the ha() function. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Mar 29 23:46:54 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k2U7ksu9010881 for ; Wed, 29 Mar 2006 23:46:54 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k2U7gmdm000953 for ; Wed, 29 Mar 2006 23:42:48 -0800 Message-Id: <200603300742.k2U7gmdm000953@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Grading guidelines issues Date: Wed, 29 Mar 2006 23:42:48 -0800 From: william@bourbon.usc.edu Someone wrote: > I am running the minus points in the grading guidelines and I > have some problems in them. > > ./hw4 verify -so=./libhw4sc.so /bin/ls > (/bin/ls is not generated by the sign command) > > For this my program produces junk 20 bytes output. The spec says > "print the first 20 byte of the result to output" so I do it. How > can I identify that a file has ben created by sign command. The > only thing I can think of is file size ie. 257 bytes or check if > the file has only hexstring characters. Help me .. You should check both. It's a good "security practice" to "validate input data" before you start processing them! > ./hw4 dec -so=./libhw4sc.so /bin/ls > (/bin/ls is not generated by the enc command) > ./hw4 edit -so=./libhw4sc.so /usr/bin/arch > (/bin/ls is not generated by the edit command) > > For the above commands the input files should be 3DES encrypted. > So my program produces output "INVALID 3DES ENCRYPTED INPUT > FILE". I hope thats fine. Any reasonable error message will do. But please, don't print everything in uppercase letters! > **** The most IMPORTANT thing that has been bothering me the most > is the compatibility test. I get segmentattion faults in all test > cases.**** > > Heres some observations that I made : > 1. I looked at the size of "libhw9sc.so" in the ....public/hw4 > folder and it is > 15156 bytes. The size of mine "libhw4sc.so" file is 80308 bytes. > The size of "libhw4sc.so" of the sample code which you gave to > us is 76548 bytes. The size of the .so file does not mean much. Different implementation may result in different file sizes. If you use C++ with templates, you may end up with a huge .so file! > 2. I do "nm libhw9sc.so" in the ....public/hw4 folder and I get > NOTHING. This is because the symbol table and debugging info in libhw9sc.so has been stripped. You can run "strip libhw4sc.so" on your .so file and you should see nothing if you do "nm" on it afterwards. > I use this "libhw9sc.so" with the executable of the > sample code which you gave us, and there also I get segmentation > fault even though it is a very simple program. I use MINE > "libhw4sc.so" and the program works and give output "sig size is > 128". > > 3. "nm" of the .so files generated by my program and the sample > code gives me the symbols. Hmm... Looks like some ISD libraries have changed. Sorry about this. I've put a new "libhw9sc.so" (also with the symbol table stripped) there. Please try it again and see if you are still getting segmentation faults. Again, sorry! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Mar 28 16:46:33 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k2T0kXf3002602 for ; Tue, 28 Mar 2006 16:46:33 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k2T0gVjB025767 for ; Tue, 28 Mar 2006 16:42:31 -0800 Message-Id: <200603290042.k2T0gVjB025767@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: cannot open libraries Date: Tue, 28 Mar 2006 16:42:31 -0800 From: william@bourbon.usc.edu Someone wrote: > while giving the command > make hw4 > I am receiving the following errors > "hw4.c", line 4: cannot find include file: > "hw4.c", line 5: cannot find include file: "scintrf.h" > > I havent made any changes to the program or the make file > as yet and have tested the make file and its running, I have > also made the recommended changes to the .cshrc file, and > now I am clueless as to why it is unable to import these libraries. Could you provide more information? Please do: script /tmp/YOURNAME.script make hw4 exit and send me /tmp/YORUNAME.script. If you don't see the correct -I... in your make command, that would explain why "#include " is failing. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Mar 24 10:28:03 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k2OIS3Pa032444 for ; Fri, 24 Mar 2006 10:28:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k2OIOGrG009193 for ; Fri, 24 Mar 2006 10:24:16 -0800 Message-Id: <200603241824.k2OIOGrG009193@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: dlopen fails in hw4 Date: Fri, 24 Mar 2006 10:24:16 -0800 From: william@bourbon.usc.edu Someone wrote: > I wrote some simple code where the SHA1 of a file is sent to the > samrtcard inteface for the "sign" option at command line. > > My code compiles perfectly and i'm using the Makefile you have > provided in the sample code. But when i run the command "hw4 sign > -so=./libhw4sc.so usctommy.gif" , it throws me an error at the > point i'm trying to use dlopen. > when i replaced the code with the following line, hard-coding the > dlopen parameter for sopath, i still get an error, i.e. the > handle value is NULL -- > > handle = dlopen("./libhw4sc.so", RTLD_NOW|RTLD_GLOBAL); > if( handle==NULL ) > { > fprintf( stderr, "\nERROR!!! Opening Shared Object Failed\n > Exiting...\n"); > return 1; > } > > So when i run the command "hw4 sign -so=./libhw4sc.so > usctommy.gif" , it stops execution after printing the above error > message because it cannot assign value to the handle parameter, > its value is NULL. I cant iunderstand the reason for the same. > Kindly help. The error is saying that it has a problem opening "./libhw4sc.so" or resolving references in your "./libhw4sc.so". My guess is that it's probably related to resolving references. Is your "hw4" linked to the crypto library (linked using -lcrypto -lsocket)? If not, you should create a dummy call to SHA1() in your "hw4" and link to the crypto library. This way, when you try to resolve references in your "./libhw4sc.so", it will find SHA1() in your "hw4". If this doesn't help, please let me know. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Mar 22 23:21:56 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k2N7LurW016592 for ; Wed, 22 Mar 2006 23:21:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k2N7IE9t000512 for ; Wed, 22 Mar 2006 23:18:14 -0800 Message-Id: <200603230718.k2N7IE9t000512@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: secret.c file Date: Wed, 22 Mar 2006 23:18:14 -0800 From: william@bourbon.usc.edu Someone wrote: > The secret.c file located at ~csci530/public/hw4 directory has > #include . This causes compiler error as the > compiler tries to find out the definition of size_t (which is > defined under stdio.h). If I include stdio.h, this error goes > away. Do we need to include sha.h in this file? Since the arrays > are already filled, they really donot need size indexes. For > example, we can have: > > static unsigned char HW4_random_bits_1[ ] = { > 0x77,0xfc,0xc3,0x54,0xd0,0xf1,0x3b,0x6c, > 0x65,0x1a,0xa3,0xf2,0x9f,0xe9,0x59,0xa9, > 0x87,0xb0,0x6f,0x6a > }; > > and not have > > static unsigned char HW4_random_bits_1[SHA_DIGEST_LENGTH] = { > 0x77,0xfc,0xc3,0x54,0xd0,0xf1,0x3b,0x6c, > 0x65,0x1a,0xa3,0xf2,0x9f,0xe9,0x59,0xa9, > 0x87,0xb0,0x6f,0x6a > }; > > Is it possible for you to remove the reference to SHA from > secret.c file? Please advice. I'm not sure how that would help. I assume you are trying to compile "secret.c" into "secret.o". But please note that all these arrays are declared as *static*. So, if you compile "secret.c" into "secret.o", you have no access to these arrays! What was intended is that you should do something like the sample "smartcard.c": #include #include "secret.c" This way, you "smartcard.c" will have access to all the arrays in "secret.c" and you can include any header files before you include "secret.c". -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Mar 21 12:40:37 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k2LKebaP032280 for ; Tue, 21 Mar 2006 12:40:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k2LKb0e6024667 for ; Tue, 21 Mar 2006 12:37:00 -0800 Message-Id: <200603212037.k2LKb0e6024667@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: query in key genration.. Date: Tue, 21 Mar 2006 12:37:00 -0800 From: william@bourbon.usc.edu Someone wrote: > I have a quick question on the secret key generation: > Are we supposed to do odd parity on each of the 3 keys and the > IV? Yes. > Looking at the data given under the spec for edit, the keys > dont look like they have had and odd parity done on them. That's correct. The keys displayed are the ones before setting the parity bits. > Also we are supposed to test for weak keys, Yes. > if there is a weak key, we > report it to the user and should we continue or stop the program? You should prompt for another passphrase or stop the program and ask the user to rerun it with another passphrase. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Mar 21 07:32:02 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k2LFW25C020688 for ; Tue, 21 Mar 2006 07:32:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k2LFSR1U022935 for ; Tue, 21 Mar 2006 07:28:27 -0800 Message-Id: <200603211528.k2LFSR1U022935@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: make command giving socket & connect referrencing errors Date: Tue, 21 Mar 2006 07:28:27 -0800 From: william@bourbon.usc.edu Someone wrote: > I had started coding on the hw4 and had written just the first > part of generating the RSA keys using RSA_generate_key() > function. Right now, i have a main.c, genRSA.h and genRSA.c > files. > when i compile, i get the following error - > > aludra.usc.edu(108): make > gcc hw4.o genRSA.o -o hw4 -L/home/scf-22/csci551b/openssl/lib -lcrypto > Undefined first referenced > symbol in file > socket /home/scf-22/csci551b/openssl/lib/libcrypto.a(rand_egd.o) > connect /home/scf-22/csci551b/openssl/lib/libcrypto.a(rand_egd.o) > ld: fatal: Symbol referencing errors. No output written to hw4 > collect2: ld returned 1 exit status > *** Error code 1 > make: Fatal error: Command failed for target `hw4' > > But the wierd part is that i have not included these libraries > anywhere in my code. I have attached a script of what commands i > fire, also including the contents of my makefile. I tried > searching a lot online for this problem, but couldn't solve the > same. Kindly help me if possible, as i'm really stuck due to > this. Please see my message with timestamp "Sat 18 Feb 07:49". -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Mar 21 00:07:48 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k2L87mAc003286 for ; Tue, 21 Mar 2006 00:07:48 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k2L84Euh021335 for ; Tue, 21 Mar 2006 00:04:14 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k2L84E6o021334 for cs530@merlot; Tue, 21 Mar 2006 00:04:14 -0800 Date: Tue, 21 Mar 2006 00:04:14 -0800 From: william@bourbon.usc.edu Message-Id: <200603210804.k2L84E6o021334@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: grading guidelines for the term paper Hi, I've just added a section in the term paper spec regarding the grading guidelines. Please take a look if you have a chance. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Mar 20 22:00:11 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k2L60BQ2030909 for ; Mon, 20 Mar 2006 22:00:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k2L5ub21020860 for ; Mon, 20 Mar 2006 21:56:37 -0800 Message-Id: <200603210556.k2L5ub21020860@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: query in key genration.. Date: Mon, 20 Mar 2006 21:56:37 -0800 From: william@bourbon.usc.edu Someone wrote: > The spec[in encrypted file format section] said that using > "yesnomaybe" as passphrase the three keys and IV should be: > IV = 1e045d9fcfbd9628 > KEY1 = 0c5214256989fb61 > KEY2 = fe339cea53aebed0 > KEY3 = 460f672fd212cfa2 > > This means that Y = Sha1(SHA1("yesnomaybe") + RB1) = > 1e045d9fcfbd96280c5214256989fb61fe339cea > Is this interpretation correct? That's incorrect. KEY2 is part of Z (which is SHA1(Y+RB2)). I'm not sure why you take it as part of Y. > I tried calculating sha1 of Y using openssl . > For this, I saved Y value [ SHA1("yesnomaybe") + RB1 ] in > a file and calculated its sha1 using: > "openssl sha1 filename" command > I got "dbeb86f5769607ac57c1beeccaae8deb2d64b9f6" output. > > where SHA1("yesnomaybe") = fec42bbb66560a9d32a14207fb6d3de3e93bbdbe > RB1 = 77fcc354d0f13b6c651aa3f29fe959a987b06f6a > and the file contained > "fec42bbb66560a9d32a14207fb6d3de3e93bbdbe77fcc354d0f13b6c651aa3f29fe959a987b06f6a" > data. The file should contain the binary version of what you have! Your file contains a long hexstring (which is an ASCII file). You need to convert every 2 character into one byte of binary data. > Iam confused in des key generation. If my understanding of > generating IV and keys is correct then the sha1 output by > openssl should match with the value in spec. Can you please > clear this. I just checked the example in the spec for IV, KEY1, KEY2, and KEY3 and they seem to be correct. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Mar 19 23:58:04 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k2K7w4WA011776; Sun, 19 Mar 2006 23:58:04 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k2K7sV33012050; Sun, 19 Mar 2006 23:54:31 -0800 Message-Id: <200603200754.k2K7sV33012050@bourbon.usc.edu> To: cs530@merlot.usc.edu, csac@merlot.usc.edu Cc: YuLam.Wong@ey.com Subject: FWD: ISACA Spring Conference Date: Sun, 19 Mar 2006 23:54:31 -0800 From: william@bourbon.usc.edu Dear Students, I got the following e-mail from Yu-Lam Wong of Ernst & Young (one of the major accounting firms in the US). They are looking for *student volunteers* for the up-coming ISACA Spring Conference (http://www.isacala.org/conference/) from 4/2/2006 through 4/5/2006. If you are interested in volunteering or need more information regarding the volunteer work, please send an e-mail to . -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Sun, 19 Mar 2006 21:31:22 -0800 From: YuLam.Wong@ey.com To: chengw@usc.edu Subject: ISACA Spring Conference Mr. Cheng, I apologize for the late notice but a few USC students have provided me your contact information with regards to the topic of IT security. I am part of the Academic Relationship with ISACA (IT Audit & Security organization). ISACA is planning to hold an annual spring conference and it would be great to involve the participation of USC students. I have already reached out to a few on-campus organizations, however, your involvement would possibly spark the interests of more students focused in IT. I have provided an explanation of the overall event below: We were hoping you or anyone you know from the IS major, could help us find at least two student volunteers at this years ISACA Spring Conference April 2 - 5. The volunteers should plan to attend and assist each day of the conference. We really need to know who can volunteer by this Friday, March 24. I know this is late notice but this is a fantastic opportunity to meet professionals in the field and experience the marquee event of the ISACA LA Chapter. Here is a website for more information about the event for students who are interested: (http://www.isacala.org/conference/). Volunteer Shifts: Sunday: 7:30 ? 5:00 Monday: 6:30 ? 5:30 Tuesday: 8:00 ? 5:30 Wednesday: 8:00 ? 4:30 ..and possibly dinner afterwards (if the students are up for it). We would prefer students who can work the entire shift. Thank you for your help and time and I hope all is well with this semester =). Please contact me if you have any questions. Sincerely, Yu-Lam Wong Ernst & Young, LLP Los Angeles, California Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Mar 15 23:53:55 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k2G7rtaP021235 for ; Wed, 15 Mar 2006 23:53:55 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k2G7ocuQ001690 for ; Wed, 15 Mar 2006 23:50:39 -0800 Message-Id: <200603160750.k2G7ocuQ001690@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: HW4 questions Date: Wed, 15 Mar 2006 23:50:38 -0800 From: william@bourbon.usc.edu Someone wrote: > A few questions as I go about implementing HW4. > > 1. In SC_get_signature_size() can I just return > HW4_rsa_public_modulus_size OR I have to create the RSA key from > secret.c and then do RSA_size(). Since we have fixed the size for this HW, either way will be fine. In general, doing the 2nd way would be "more correct". > 2. As far as I could find out the 2 160-bit random bit patterns > are not generated by RSA_generate_key() if I am correct. Correct. > I generated them using RAND_set_rand_engine() and > RAND_pseudo_bytes(). Hope thats fine. If not please correct me. I'm not exactly sure what RAND_set_rand_engine() does. I would just use RAND_bytes(). > 3. "Initializing OpenSSL Pseudo-random Number Generator" added in > the spec has to be done only once right and not that every time I > log in. Correct. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Mar 11 22:42:19 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k2C6gJQ9004734 for ; Sat, 11 Mar 2006 22:42:19 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k2C6dGrC017523 for ; Sat, 11 Mar 2006 22:39:16 -0800 Message-Id: <200603120639.k2C6dGrC017523@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: HW3 : random number Date: Sat, 11 Mar 2006 22:39:16 -0800 From: william@bourbon.usc.edu Someone wrote: > The openssl webpage for RSA_generate_key > (http://www.openssl.org/docs/crypto/RSA_generate_key.html) has > the following requirement: > > "The pseudo-random number generator must be seeded prior to > calling RSA_generate_key().". > > Do we need to do this? It's probably a good idea. > If yes, then do we have to ask password > from the user for the seed and use methods like RAND_seed, > RAND_add etc.? As far as grading goes, the grading account will have the generator initialized. So, there is no need to do this. In your account, you can initialize your generator by running the following csh/tcsh script (if you are running bash, just do "tcsh" first and then enter the following commands): set fname="/tmp/$$" echo $fname /bin/rm -f $fname date > $fname ps auxw >> $fname last | head -20 >> $fname ~csci551b/openssl/bin/openssl rand -rand $fname 1024 > /dev/null /bin/rm -f $fname /bin/ls -l ~/.rnd You need to do the above only once. The last command should show that you have a file ~/.rnd that is 1024 bytes in size. I have added all this information to the spec in a new section. > Also, for generating random number for secret.c, do we have to > ask password from the user for the seed and use methods like > RAND_seed, RAND_add etc.? No. Once you have done the initialization above, you can just call something like RSA_generate_key() and RAND_bytes(). -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Mar 11 15:47:53 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k2BNlr7V021247 for ; Sat, 11 Mar 2006 15:47:53 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k2BNiqgB015627 for ; Sat, 11 Mar 2006 15:44:52 -0800 Message-Id: <200603112344.k2BNiqgB015627@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Hw4 question Date: Sat, 11 Mar 2006 15:44:52 -0800 From: william@bourbon.usc.edu Someone wrote: > When you generate the secret, you may want to inform the user > about the progress. Is it OK to direct this output (information) > to stderr, since we are using hw4 secret > secret.c? You must output the progress information to stderr. I've just updated the spec to make this explicit. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Mar 10 20:47:17 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k2B4lHik007195 for ; Fri, 10 Mar 2006 20:47:17 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k2B4iIRS009664 for ; Fri, 10 Mar 2006 20:44:18 -0800 Message-Id: <200603110444.k2B4iIRS009664@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: hw4 verify Date: Fri, 10 Mar 2006 20:44:18 -0800 From: william@bourbon.usc.edu Someone wrote: > The spec indicates that the "hw4 verify" option has an optional filename. > Shouldn't the optional arguments be the path and the filename together? > Right now, it appears that the path is always required, whether there is a > filename supplied or not. I'm not understanding what you are asking... The spec says: hw4 verify -so=sopath [file] All the examples in the spec uses a simple filename. I'm not sure what you are calling "path" exactly. Usually, "path" includes the filename. For example, "/etc/passwd" specifies a full pathname to a file where "/etc" is the directory and "passwd" is the filename within the directory. Could you clarify your question? Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Mar 10 19:19:53 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k2B3JrQD003857 for ; Fri, 10 Mar 2006 19:19:53 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k2B3GtPK009273 for ; Fri, 10 Mar 2006 19:16:55 -0800 Message-Id: <200603110316.k2B3GtPK009273@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Regarding HW4 Date: Fri, 10 Mar 2006 19:16:55 -0800 From: william@bourbon.usc.edu Someone wrote: > I copied your files in a sample directory,but when I use > " make hw4" ,I get the following errors. > > nunki.usc.edu(50): make hw4 > cc -o hw4 hw4.c > "hw4.c", line 5: cannot find include file: > "scintrf.h", line 10: undefined symbol: SHA_DIGEST_LENGTH > "scintrf.h", line 12: undefined symbol: SHA_DIGEST_LENGTH > "scintrf.h", line 32: undefined symbol: SHA_DIGEST_LENGTH > "scintrf.h", line 37: undefined symbol: SHA_DIGEST_LENGTH > "hw4.c", line 21: undefined symbol: SHA_DIGEST_LENGTH > "hw4.c", line 24: warning: implicit function declaration: SHA1 > cc: acomp failed for hw4.c > *** Error code 2 > make: Fatal error: Command failed for target `hw4' > nunki.usc.edu(51): > > I request you to please help me in this. What's in your Makefile? -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Mar 5 21:39:59 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k265dxXJ025401 for ; Sun, 5 Mar 2006 21:39:59 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k265bIkF009059 for ; Sun, 5 Mar 2006 21:37:18 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k265bImh009058 for cs530@merlot; Sun, 5 Mar 2006 21:37:18 -0800 Date: Sun, 5 Mar 2006 21:37:18 -0800 From: william@bourbon.usc.edu Message-Id: <200603060537.k265bImh009058@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: office hour canceled tomorrow 3/6/2006 Hi, I will not be available for office hour tomorrow. If you need to talk to me, please send me e-mail to make an appointment. Thanks and sorry about the short notice. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Mar 5 20:27:37 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k264RbFs022720 for ; Sun, 5 Mar 2006 20:27:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k264OvxQ008548 for ; Sun, 5 Mar 2006 20:24:57 -0800 Message-Id: <200603060424.k264OvxQ008548@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Merkel signature quesiton Date: Sun, 05 Mar 2006 20:24:57 -0800 From: william@bourbon.usc.edu Someone wrote: > I have some questions about Merkel's signature scheme. > For example, if one want to use SHA-1 as the hash function, one > would compute the indices for all the SHA-1 values. Is these > incdices are public? Yes. > If yes, what are the private keys (random > numbers)? Little bit confused here. The private keys are the random numbers {n_i's} where the i's correspond to the indices. > So, if you want to send a message, you'll compute the SHA1 of > that message and go through the table and pick up the right > indices. > > How'll the others verify your signature (indices)? Do they have > the mapping function available to them? Yes. It's public information. So they should compute the same set of indices. > Also, How to read the Merkel Graph? Why you have 150 left and > right keys and the indices table has only 75? The example given was for the case with 160-bit H(m). For 160-bit H(m), we need J=150 and the output of the mapping function is a set of J/2=75 indices. In the tree structure, each node has 3 parts (left,middle,right) and each part contains 150 public keys. (The notation is a bit confusing here because the public keys are the hashes of the private keys and they are also denoted as H(). So, you need to distinguish the H(m) in the paragraph above and the public keys.) The left (and the right) part are used to sign a node below. By signing, we need to go through the procedure on slides 2 and 3 of lecture 9 and include 75 corresponding private keys in the signature block. So, the node below the left part has a signature block attached and it is not shown in the picture in slide 4 of lecture 9. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Mar 5 18:50:48 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k262omg7019143 for ; Sun, 5 Mar 2006 18:50:48 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k262m8hv007919 for ; Sun, 5 Mar 2006 18:48:08 -0800 Message-Id: <200603060248.k262m8hv007919@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: confused: irreversible functions Date: Sun, 05 Mar 2006 18:48:08 -0800 From: william@bourbon.usc.edu Someone wrote: > Sorry, I guess my brain gets overloaded as the exam approaches. > In DES, s-boxes produce 32 bits output from 48 bits input, and in > this sense you said it is impossible to reverse them. I have a > very silly question (and I think I had the same question before, > but then I thought I understood it, and now I am confused again): > > Q: If at some point we have "lost" some data in an irreversible > function, how come we can then restore it? > > In the lecture you said that the whole trick is in fiestel > networks, where we feed the data in an f-function in the same > direction, and thus don't need to reverse it. But I still don't > get, how the "lost" bits can be recovered. > > Or the data aren't really lost, because 32 bits from Ri both go > to f-function, and are copied to Li+1... Is this an answer? The data aren't really "lost". The most important thing about the Fiestel structure/network is that you don't need a reversable f function because encryption and decryption runs the f function in the same direction. So, if you need to "recover" some data, you just need to feed it through the DES Fiestel structure with the subkeys reversed. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Sunday, March 5, 2006 12:58 pm Subject: Re: IV question To: cs530@merlot.usc.edu > Someone wrote: > > > Using CBC (or other methods that need IV), IV is transmitted to > > the receiver in plain text. Is it possible for a man-in-the > > middle to get the IV and get useful information about the first > > block? > > Doesn't have to be man-in-the-middle. Just an eavedropper will > do. > > > For example, if the first few blocks of the transmission is > > always constant ( such as bank statement header), how varying IV > > every time helps security? The cryptoanalyst has the plaintext > > (because the header is known), he/she got the IV and he/she also > > has the ciphertext. Could you please explain? > > In the case you described, the attacker would get several > known plaintext-ciphertext pairs because the IV is available > and the first few plaintext blocks are known. Certainly, > this is not as good compared to the case where known plaintext > is not available easily. But it's not a serious problem in > practice because the best known-plaintext attack for DES need > to have on the order of 2^40 (I cannot remember the number > off the top of my head, but it's a very large number) > plaintext-ciphertext pairs for the attack to be effective. > > To reduce the number of plaintext-ciphertext pairs available > to the attacker, the IV can be encrypted (e.g., encrypt it > with the same DES key and use 0 as the IV). > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Mar 5 13:06:46 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k25L6kHU006290 for ; Sun, 5 Mar 2006 13:06:46 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k25L47h5006157 for ; Sun, 5 Mar 2006 13:04:07 -0800 Message-Id: <200603052104.k25L47h5006157@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: modular arithmetic Date: Sun, 05 Mar 2006 13:04:07 -0800 From: william@bourbon.usc.edu Someone wrote: > Can I assume that when performing modular arithmetic on the exam, I can use > any representative of the equivalence classes for a given modulus and not > just the residues? This is just a question of what you consider acceptable > in terms of your grading scheme. It is, of course, mathematically correct > to say that both > > 95 is congruent to 40 mod 55 > > and > > 95 is congruent to -15 mod 55. > > but 40 is a residue mod 55 whereas -15 is not. In your numerical example > for RSA, the reduction was always done down to a residue (i.e., remainder) > whereas sometimes the arithmetic can be more easily performed if one uses a > different equivalence class representative (typically a negative). > > For example, suppose you want to compute 53^4 mod 55. The easiest way to > perform this arithmetic is to note that 53 is congruent to -2 mod 55. > Therefore, 53^4 is congruent to 16 mod 55. Of course, this is true because > congruence equivalence classes with respect to a modulus n are defined by > saying "a is congurent to b mod n if and only if (a - b) is divisible by > n". > > As another example, on the slides, you have (13)(4)(36) mod 55 is congruent > to 1872 mod 55 which is correct, but is more easily rendered as (-3)(-19) > mod 55 = 2 mod 55 (i.e., no need to multiply it all out in typical fashion). > > I just want to check whether there was some implicit constraint or > expectation on the arithmetic being performed (I don't want to get points > taken off for conflicting expectations). > > p.s. -- probably no need to distribute this classwide since I doubt anyone > else cares . . . but who knows? :) Well, you asked a very good question! I'm sure many students in class would care about this! I did not mention this in class because it didn't even occur to me that there is a better way to go (what you described wouldn't matter to a computer)! Thanks for bring it up. The answer to your question is the following. If you are asked to give the result of A mod P, you can do anything you want in the calculation. The only requirement is that you show your work and give the final answer in a value >= 0 and < P (since the question asked for A mod P and did not ask for a value that is congruent to A mod P). So, what you have described above is a very good way to reduce mistakes! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Mar 5 12:58:09 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k25Kw98o005975 for ; Sun, 5 Mar 2006 12:58:09 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k25KtTmg006104 for ; Sun, 5 Mar 2006 12:55:29 -0800 Message-Id: <200603052055.k25KtTmg006104@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: IV question Date: Sun, 05 Mar 2006 12:55:29 -0800 From: william@bourbon.usc.edu Someone wrote: > Using CBC (or other methods that need IV), IV is transmitted to > the receiver in plain text. Is it possible for a man-in-the > middle to get the IV and get useful information about the first > block? Doesn't have to be man-in-the-middle. Just an eavedropper will do. > For example, if the first few blocks of the transmission is > always constant ( such as bank statement header), how varying IV > every time helps security? The cryptoanalyst has the plaintext > (because the header is known), he/she got the IV and he/she also > has the ciphertext. Could you please explain? In the case you described, the attacker would get several known plaintext-ciphertext pairs because the IV is available and the first few plaintext blocks are known. Certainly, this is not as good compared to the case where known plaintext is not available easily. But it's not a serious problem in practice because the best known-plaintext attack for DES need to have on the order of 2^40 (I cannot remember the number off the top of my head, but it's a very large number) plaintext-ciphertext pairs for the attack to be effective. To reduce the number of plaintext-ciphertext pairs available to the attacker, the IV can be encrypted (e.g., encrypt it with the same DES key and use 0 as the IV). -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Mar 4 20:50:02 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k254o2ro012511 for ; Sat, 4 Mar 2006 20:50:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k254lOBq014149 for ; Sat, 4 Mar 2006 20:47:24 -0800 Message-Id: <200603050447.k254lOBq014149@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Diffie Hellman question Date: Sat, 04 Mar 2006 20:47:24 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm confused about the operation of the Diffie Hellman algorithm. It appears > that all that a person A must do to communicate with B is to raise the > public key of B to his own private key modulo p to obtain the secret key s. Yes. s = X^y mod p = Y^x mod p = g^{xy} mod p > Now if an intruder say C does the same thing i.e takes the private key of B > & raises it to his randomly chosen private key modulo p to get s & then > sends messages to B using s, how does B figure out that the messages are > coming from C (the intruder) & not A? The way you've described, C also needs to send C's public key (which is simply g raised to the power of its private key and then modulo p) to B. If B knows A's public key (e.g., B has talked to A before), then B will notice that what it got is not A's public key. If B does not know A's public key, then you are correct. This is the main problem with Diffie-Hellman and what you have here is half of the attack described on slide 9 of lecture 9. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Mar 4 15:12:17 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k24NCHps032305 for ; Sat, 4 Mar 2006 15:12:17 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k24N9ex0012770 for ; Sat, 4 Mar 2006 15:09:40 -0800 Message-Id: <200603042309.k24N9ex0012770@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: DES keysize question. Date: Sat, 04 Mar 2006 15:09:40 -0800 From: william@bourbon.usc.edu Someone wrote: > Lecture 4 has a slide on DES key size > (http://merlot.usc.edu/cs530-s06/lectures/lecture4/slides.pdf). > > It states for a 64-bit block the permutation space is 2^64!. I'm > a bit confused here, so I took a simple example. > > Lets say your block size is possible. You have 4 possibilities > (2! not 2 ^2!). So, for the 64-bit block, the permutation space > is 64!? > > Could you please advice? Let's use your example, there are 4 possibilities, namely 00, 01, 10, and 11. (These are the possible input symbols.) Encryption can be considered a permutation on all the possible inputs symbols. For exampl, one encyprtion transformation is to do the following mapping: 00 -> 01 01 -> 10 10 -> 11 11 -> 00 How many different mapping are possible? (This includes the trivial mapping that maps any input to itself.) The answer is the number of permutations on 4 symbols, which is 4!=(2^2)!=24. Therefore, for 64 bits, the number of permutations on 2^64 input symbols is (2^64)!. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Mar 3 13:37:02 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k23Lb2i7006108 for ; Fri, 3 Mar 2006 13:37:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k23LYUge005005 for ; Fri, 3 Mar 2006 13:34:30 -0800 Message-Id: <200603032134.k23LYUge005005@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Public Key Cert question Date: Fri, 03 Mar 2006 13:34:30 -0800 From: william@bourbon.usc.edu Someone wrote: | --- william@bourbon.usc.edu wrote: | > Someone wrote: | > | > > In the lecture you said the entity in a cert is identified by IP address. | > > I tried finding it in the certs in IE for example, and all I can find is | > > the domain name. | > | > I misspoken. What I meant to say was the domain name (or host name). | > When a company decides to use a different ISP, it may get new IP | > addresses, but it can keep the original domain/host names. So, it | > makes sense that it's the domain/host name that's in a certificate. | | Ok, thanks. | | > > So, if only the domain name is in the cert, isn't this system vulnerable | > > to DNS poisoning attacks, which I seem to remember are fairly easy to do? | > | > I'm not sure what you mean... Let's say you want to go to | > paypal.com, but your poisoned DNS tells you to go to xyz.com. | > Xyz.com cannot have a certificate that says "paypal.com" on | > it. Could you be more specific about the case you are | > referring to? | | What I mean is to poison the DNS with a different IP for paypal.com for | example. This IP will point to the attacker's website. The attacker's website | will also have the real paypal.com's cert. If the user now goes to paypal.com, | he will really go to the attacker's website but the cert will confirm wrongly | to the user that this website is really paypal.com. This works because the | domain names match and the cert doesn't contain the IP. Ah... I forgot to mention something... The reason your web browser downloads the certificate via HTTPS/SSL is to get the public key of paypal.com so that it can encrypt something with paypal.com's public key. The attacker does not have the private key of paypal.com, so it cannot complete the HTTPS/SSL transaction! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Mar 3 12:32:58 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k23KWw4x003681 for ; Fri, 3 Mar 2006 12:32:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k23KUQFY004657 for ; Fri, 3 Mar 2006 12:30:26 -0800 Message-Id: <200603032030.k23KUQFY004657@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Public Key Cert question Date: Fri, 03 Mar 2006 12:30:25 -0800 From: william@bourbon.usc.edu Someone wrote: > In the lecture you said the entity in a cert is identified by IP address. > I tried finding it in the certs in IE for example, and all I can find is the > domain name. I misspoken. What I meant to say was the domain name (or host name). When a company decides to use a different ISP, it may get new IP addresses, but it can keep the original domain/host names. So, it makes sense that it's the domain/host name that's in a certificate. > I also remember seeing warning popups saying the domain name in > the cert doesn't match, do you want to continue anyway? > > So, if only the domain name is in the cert, isn't this system vulnerable > to DNS poisoning attacks, which I seem to remember are fairly easy to do? I'm not sure what you mean... Let's say you want to go to paypal.com, but your poisoned DNS tells you to go to xyz.com. Xyz.com cannot have a certificate that says "paypal.com" on it. Could you be more specific about the case you are referring to? -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Mar 3 00:06:59 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k2386xGt032655 for ; Fri, 3 Mar 2006 00:06:59 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k2384TuF000822 for ; Fri, 3 Mar 2006 00:04:29 -0800 Message-Id: <200603030804.k2384TuF000822@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: German Enigma machine news Date: Fri, 03 Mar 2006 00:04:29 -0800 From: william@bourbon.usc.edu Someone wrote: > An article from today on a successful large scale distributed > attack on a > previously uncracked German cipher (enciphered using the Enigma > machine back > during WW II) . . . two more remain unsolved. > > http://news.bbc.co.uk/1/hi/technology/4763854.stm I interpret the end of the article to mean that the uncracked German ciphertexts were left uncracked so that amateur cryptologists can have some fun. I suspect that these ciphertexts do not present big challenges to the professional cryptologists given that they are outputs of a polyalphabetic substitution ciphers. (Also, sounds like some museum has a Enigma machine! This would mean that the letter sequences on the rotors are known. So, I would guess that it should not be too difficult to crack a particular ciphertext today.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Mar 2 23:42:53 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k237gq4U031741 for ; Thu, 2 Mar 2006 23:42:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k237eMNC000751 for ; Thu, 2 Mar 2006 23:40:22 -0800 Message-Id: <200603030740.k237eMNC000751@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Kerberos quesiton Date: Thu, 02 Mar 2006 23:40:22 -0800 From: william@bourbon.usc.edu Someone wrote: > The main reason for splitting the KDC to AS and TGS was to avoid > the long term exposure of client's long term key (Kc). What about > server's long term key (Ks)? > > For example, > 1) an attacker repetedly asks the TGS to tak to the server S. > 2) TGS replies with {Ka,s}Ks. > > Is it possible for an attacker to mount an attack based on this > information? In the case you described, the attacker must first get a TGT from AS. This means that the attacker has authenticated itself with AS and the KDC (AS+TGS) knows who the attacker is. If the attack repeatedly asked the TGS for tickets to talk to server S, its suspecious activity will be discovered very soon. So, it basically cannot ask for tickets to talk to server S for more than once a day. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Mar 2 13:49:38 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k22Lnc4f009158 for ; Thu, 2 Mar 2006 13:49:38 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k22Ll9Od029884 for ; Thu, 2 Mar 2006 13:47:09 -0800 Message-Id: <200603022147.k22Ll9Od029884@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Permission restrictions on files Date: Thu, 02 Mar 2006 13:47:09 -0800 From: william@bourbon.usc.edu Someone wrote: > I've been fine-tuning my hw2 (encoding and decoding in des) for > hw4 and i can't seem to access some of the files in the folder: > ~csci530/public/hw2....such as f1, f3, and some others...could > you change the permissions on these files please? The grading is grading hw2 and using these files, so it's probably not a good idea to change them. The original set of test data are in: ~csci530/public/hw2/original Please use these instead. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Mar 2 13:17:39 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k22LHd1T007949 for ; Thu, 2 Mar 2006 13:17:39 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k22LFA67029638 for ; Thu, 2 Mar 2006 13:15:10 -0800 Message-Id: <200603022115.k22LFA67029638@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: One time signature question Date: Thu, 02 Mar 2006 13:15:10 -0800 From: william@bourbon.usc.edu Someone wrote: > In Merkle's one time signature method, you take the hash of the > message and run it through a mapping function to produce number > of indices which are your private key. > > Lets say your message is "HELLO" and the corresponding hash is H. > Say, you got Indices denoted by I. > If you want to send the same message "HELLO" at a later point in > time, will you able to generate different indices (because the > Hash of hello will be H)? It will generate exactly the same indices. > If not, does that mean your message need to be unique? No. It can be exactly the same message. Remember, it's called "one-time signature"! Every message must be signed with a different set of signatures (with a different set of public keys). > Also, Is one-time signatures are subjected to any attacks (such > as man-in-the middle)? I'm not sure exactly what you meant. If we are using Merkle's one-time signature in the above case for signing messages such as "HELLO", then the answer would be yes because of the weakness in the hash function we chose. Given that MD5 and SHA1 are "broken", there is a possibility that the message that comes with the signature may not be the original message. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Mar 1 13:21:16 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k21LLGqx017643 for ; Wed, 1 Mar 2006 13:21:16 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k21LIpJX022692 for ; Wed, 1 Mar 2006 13:18:51 -0800 Message-Id: <200603012118.k21LIpJX022692@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: El Gamal: New Question Date: Wed, 01 Mar 2006 13:18:51 -0800 From: william@bourbon.usc.edu Someone wrote: > El Gamal description given in lecture 7 (page 9) closely > resembles with Diffe-Hellman description. Yes. In the middle of page 7 of lecture 7, it says: (e.g., m Y^x mod p) What it was trying to say is you can think of El Gamal (which uses m Y^x mod p) as something that is based on Diffe-Hellman. > This is what I understand about Diffie-Hellman. > 1. It is mainly used for key exchange. > 2. If you want to encrypt the message and send to your friend, > calculate the shared secret k, and use some other encryption > algorithms such as DES (use k as your passphrase). That would work. But you can also use m Y^x mod p as an alternative. > This is what I got confused about ElGamal > > 1. El Gamal is a pulbic key cryptosystem with x as secret and g, > p and y are non-secret. > 2. Say, I'm the one who generated the secret key x and only > myself have the knowledge about x. > 3. If some one else want to send me a message encrypted, they > have to use my public key (g,x,y) to encypt it. Your public key is (g,p,y). > 4. How can someone create a cipher text, since c = m . g ^ xy mod > p. How can any one other than myself get hold of x? It's because there is a typo on this slide! Thanks for catching it! The 2nd round bullet on this page should be: X = g^x mod p Therefore, your public key is (g,p,X) and not (g,p,y). The public and private keys of the party you are trying to communicate with are Y and y, respectively. Sorry about the bug! I've fixed the web page. It has changed in a few places. > Or, is it ONLY possible to use ElGamal for digital signature? Page 9 of lecture 7 is about encryption and decryption with El Gamal. So, it's not just for digital signatures. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Mar 1 12:55:00 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k21Kt02w016543 for ; Wed, 1 Mar 2006 12:55:00 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k21KqZNb022553 for ; Wed, 1 Mar 2006 12:52:35 -0800 Message-Id: <200603012052.k21KqZNb022553@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: El Gamal example Date: Wed, 01 Mar 2006 12:52:35 -0800 From: william@bourbon.usc.edu Someone wrote: > I was confused by the message you sent to the class (bottom of > this email message - starting with phrase "Good catch! I will > deleted the example when I'm on campus tomorrow. "). > > It appears that you're referring to some error in the example. I > followed the RSA example and did not see any error. If you think > there is an error in class notes example, I would like to know > what the error was and how you corrected it. If there was no > error, please let me know. The original error was on page 9 of lecture 7. There *was* an example at the end of the 2nd round bullet that said: 7 = 13^27 mod 55 55 is not prime, so it was a bad example. It was removed around 2/2/2006. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Wednesday, March 1, 2006 11:59 am Subject: Re: El Gamal example To: cs530@merlot.usc.edu > Someone wrote: > > > Looks like this (below) is an example of RSA (lecture 7, pg. > 5). > > > > p = 5 > > q = 11 > > n = 55 > > > > Is this is problem? > > I'm not sure what you are asking... Are you asking that > since n=55 is not a prime number, does it still work? If > that's what you are asking, then the answer is that it works. > By definition, n=pq in RSA, so the modulus n will never be a > prime number! (In contrast, in El Gamal, the modulus must > be a prime number. Different cryptosystem has different > requirements.) > > If you are asking why or how can this work, then you should > take my applied cryptography class (offered as CS 599 in Fall > 2006 and Spring 2007) or CS 556 (the advanced cryptography > class). > -- > Bill Cheng // bill.cheng@usc.edu > > > > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Wednesday, February 1, 2006 11:30 pm > Subject: Re: El Gamal example > To: cs530@merlot.usc.edu > > > Someone wrote: > > > > > Minor note: on your slide for El Gamal, your parenthetical > > public key > > > example is 7 = 13^27 mod 55 . . . but 55 is not prime. > > > > Good catch! I will deleted the example when I'm on campus > > tomorrow. (Bad cut and paste on my part.) Thanks for > > catching it! > > -- > > Bill Cheng // bill.cheng@usc.edu > > Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Mar 1 11:59:31 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k21JxVL0014323 for ; Wed, 1 Mar 2006 11:59:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k21Jv6qF021970 for ; Wed, 1 Mar 2006 11:57:06 -0800 Message-Id: <200603011957.k21Jv6qF021970@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: El Gamal example Date: Wed, 01 Mar 2006 11:57:06 -0800 From: william@bourbon.usc.edu Someone wrote: > Looks like this (below) is an example of RSA (lecture 7, pg. 5). > > p = 5 > q = 11 > n = 55 > > Is this is problem? I'm not sure what you are asking... Are you asking that since n=55 is not a prime number, does it still work? If that's what you are asking, then the answer is that it works. By definition, n=pq in RSA, so the modulus n will never be a prime number! (In contrast, in El Gamal, the modulus must be a prime number. Different cryptosystem has different requirements.) If you are asking why or how can this work, then you should take my applied cryptography class (offered as CS 599 in Fall 2006 and Spring 2007) or CS 556 (the advanced cryptography class). -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Wednesday, February 1, 2006 11:30 pm Subject: Re: El Gamal example To: cs530@merlot.usc.edu > Someone wrote: > > > Minor note: on your slide for El Gamal, your parenthetical > public key > > example is 7 = 13^27 mod 55 . . . but 55 is not prime. > > Good catch! I will deleted the example when I'm on campus > tomorrow. (Bad cut and paste on my part.) Thanks for > catching it! > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Feb 28 10:20:39 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1SIKdat017732 for ; Tue, 28 Feb 2006 10:20:39 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1SIIIgA012003 for ; Tue, 28 Feb 2006 10:18:18 -0800 Message-Id: <200602281818.k1SIIIgA012003@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: hw4 question Date: Tue, 28 Feb 2006 10:18:18 -0800 From: william@bourbon.usc.edu Someone wrote: > Just before I went to work, I copied the files at the > > http://merlot.usc.edu/cs530-s06/homeworks/hw4/ > > website and performed the steps > > Please do the following to build both hw4 and libhw4sc.so: > > make hw4 > make smartcard > > However, I hit some compilation errors. I'll take some time when I get back > home to look into them in more depth, but I was wondering if there was a > problem with my configuration or with the files. > > smartcard.c:50: error: parse error before "SC_init" > smartcard.c:60: error: parse error before ')' token > smartcard.c:61: error: initializer element is not constant > smartcard.c:61: error: (near initialization for > `HW4_rsa_public_modulus[114]') > smartcard.c:61: error: `sha1_buf' undeclared here (not in a function) > smartcard.c:61: error: initializer element is not constant > smartcard.c:61: error: (near initialization for > `HW4_rsa_public_modulus[115]') > smartcard.c:61: error: parse error before ')' token > > I didn't see anything obviously wrong in the code, but I didn't have much > time to investigate. Please send a transcript of your compiling session to me. Please do: script /tmp/YOURNAME.script which gcc make hw4 make smartcard exit Then e-mail /tmp/YOURNAME.script to me. The "which gcc" above would tell me which gcc you are running. By default, it should be /usr/usc/bin/gcc (gcc 3.3.2). If you are running gcc 2.95.2, you should switch to the new one! By the way, I've copied the "working (but incomplete) sample" source files into ~csci530/public/hw4/sample so you don't have to copy them from the web. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Feb 27 13:39:51 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1RLdpIW002170 for ; Mon, 27 Feb 2006 13:39:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1RLbX5B005556 for ; Mon, 27 Feb 2006 13:37:33 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k1RLbXvv005555 for cs530@merlot; Mon, 27 Feb 2006 13:37:33 -0800 Date: Mon, 27 Feb 2006 13:37:33 -0800 From: william@bourbon.usc.edu Message-Id: <200602272137.k1RLbXvv005555@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: midterm exam The midterm exam will be held next Monday (3/6) in OHE 122 from 10:30am to 11:50pm. The midterm exam will be closed book, closed notes, and closed everything (and no "cheat sheet"). Also, no calculators, cell phones, or any electronic gadgets are allowed. Please bring a photo ID. Your ID will be collected at the beginning of the exam and will be returned to you when you turn in your exam. There will be assigned seating. The midterm exam will cover everything from the beginning of the semester till what was covered at the end of lecture today. Please see the News section of the class web page for a quick summary of the topics covered. (Please note that not all topics covered are listed.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Feb 24 23:08:58 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1P78wdj027489 for ; Fri, 24 Feb 2006 23:08:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1P76Uqj004036 for ; Fri, 24 Feb 2006 23:06:30 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k1P76Tn3004035 for cs530@merlot; Fri, 24 Feb 2006 23:06:30 -0800 Date: Fri, 24 Feb 2006 23:06:30 -0800 From: william@bourbon.usc.edu Message-Id: <200602250706.k1P76Tn3004035@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: modifications for HW2 Hi, Since there will be a power outage at 2am tomorrow morning, the class web server will be down. Also, the machine that I read e-mail on will be done. I'm not sure exactly when power will come back and these machine will be running again. Therefore, I'm extending the deadline for modifications from 24 hours to 48 hours after midnight tonight. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Feb 24 22:50:27 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1P6oRXo026700 for ; Fri, 24 Feb 2006 22:50:27 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1P6lxsM003983 for ; Fri, 24 Feb 2006 22:47:59 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k1P6lx2T003982 for cs530@merlot; Fri, 24 Feb 2006 22:47:59 -0800 Date: Fri, 24 Feb 2006 22:47:59 -0800 From: william@bourbon.usc.edu Message-Id: <200602250647.k1P6lx2T003982@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: reminder about HW2... Hi, If you haven't submit anything, please try to submit something soon just in case you cannot get things to work exactly the way you want near the deadline. Please remember that you can submit multiple times, and by default we will grade the last on-time submission. When it gets close to the deadline, you may make mistakes and miss the deadline. The penalty for missing the deadline is *very severe* and non-negotiable. Please submit on-time! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Feb 24 22:24:35 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1P6OZGT025683 for ; Fri, 24 Feb 2006 22:24:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1P6M76i003688 for ; Fri, 24 Feb 2006 22:22:07 -0800 Message-Id: <200602250622.k1P6M76i003688@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: HW2 DES decrypting Date: Fri, 24 Feb 2006 22:22:07 -0800 From: william@bourbon.usc.edu Someone wrote: > just a last minute quick doubt - > In case of DES decryption, as mentioned by you in the attached > reply, we have to output an error if the SHA1 of the decrypted > file doesn't match with the one stored in the header. But in such > a case, do we print the contents of the decrypted file at all?? Yes, to stdout. The error message goes to stderr. > what i mean is that in case the SHA1 does not match, do we just > print an error message that the "SHA1 do not match" and exit, or > do we print this message also along with the decrypted file? If > the SHA1 doesn't match, this means the file is not the same, so i > think it should not be displayed. But just in case it HAS to be > displayed also, this implies we have to store the results in a > temp file or storage and then compute the SHA1 of this temp > file/storage and compare with the header. You should do this on the fly. Output the decrypted data to stdout but print the error message to stderr. > Kindly clarify this, as I currently DO NOT display any output, > except for an error message in case the SHA1 hashes do not match. I don't understand why you would want not to output. If the file is 200MB long, you might not even have that much space in temporary storage (since it's shared). If the grading guidelines didn't say anything about checking this, there would be no need to fix it. But in general, you should not buffer things that's not necessary. -- Bill Cheng // bill.cheng@usc.edu > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Sunday, February 19, 2006 2:18 pm > Subject: Re: HW2 DES decrypting > To: cs530@merlot.usc.edu > > > Someone wrote: > > > > > For HW2 the DES section, with the decrypting, are we > supposed to > > > verify the stored hash with what we just decrypted? I dont > > > belive the hw writeup says anything about that, but i might > be > > > overlooking it. Thanks. > > > > If you don't verify the stored hash, then there would be no > > point to store the hash in the file! > > > > If the hash does not match, you should output an error message > > to stderr. > > -- > > Bill Cheng // bill.cheng@usc.edu > > > > Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Feb 24 22:19:38 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1P6JbPm025446 for ; Fri, 24 Feb 2006 22:19:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1P6H9xT003657 for ; Fri, 24 Feb 2006 22:17:09 -0800 Message-Id: <200602250617.k1P6H9xT003657@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Regarding HW2 DES Encryption Date: Fri, 24 Feb 2006 22:17:09 -0800 From: william@bourbon.usc.edu Someone wrote: > I know its last minute but I couldnt help ask for a > clarification. I think I've implemented everything according to > the spec but have one doubt. As I understand, for the DES > Encryption and Decryption, we should output the > encrypted/decrypted data to stdout which may or may not be > redirected to files. Is this correct? Or should we ouput directly > to files? Kindly clarify. The spec clearly stated: [BC: Added 2/6/2006] Output of your program should go to stdout and error messages should go to stderr. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Feb 24 15:45:41 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1ONjeMU010127 for ; Fri, 24 Feb 2006 15:45:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1ONhDsZ002297 for ; Fri, 24 Feb 2006 15:43:13 -0800 Message-Id: <200602242343.k1ONhDsZ002297@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Segmentation fault Date: Fri, 24 Feb 2006 15:43:13 -0800 From: william@bourbon.usc.edu Someone wrote: > My DES encryption and decryption code is working correctly if I write > a separate main() for each of them , but when I compile and run > everything together I am getting Segmentation fault. > > Could you please tell me what could possibly be going wrong.. When you run your code under the debugger and you get a seg fault, if you do a "where", does it show good information? -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Feb 24 11:20:10 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1OJKApc032094 for ; Fri, 24 Feb 2006 11:20:10 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1OJHhOQ000665 for ; Fri, 24 Feb 2006 11:17:43 -0800 Message-Id: <200602241917.k1OJHhOQ000665@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Segmentation fault (cont.) Date: Fri, 24 Feb 2006 11:17:43 -0800 From: william@bourbon.usc.edu Hi, I'm forwarding an e-mail from a student regarding DDD. DDD is available on nunki in: /usr/usc/ddd/default I assume that if your shell is csh/tcsh, all you have to do is to run: source /usr/usc/ddd/default/setup.csh and if your shell is bash, all you have to do is to run: source /usr/usc/ddd/default/setup.sh to be able to use it. I've never use DDD before, so please do not send questions about DDD to me. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Fri, 24 Feb 2006 11:12:12 -0800 (PST) To: william@bourbon.usc.edu Subject: Re: Segmentation fault (cont.) Hi, You could forward this to students who find it difficult to use gdb. Personally I find it difficult to use gdb so I have installed DDD which is the graphical interface of GDB I suppose and life is much easier. They can ask for help from CS 402 students who used DDD for their projects. Just a few changes to be done to .cshrc william@bourbon.usc.edu wrote: Someone wrote: > I have lots of empathy towards the person who wrote this email, so that's > why I decided to comment on it. Since we don't have a forum, I cannot > contact the person directly. I apologize for spamming you with emails like > this, but if you consider it reasonable, you could forward it to that > person. > > Everything you wrote here > http://merlot.usc.edu/cs530-s06/homeworks.html#segfault > is very-very true, the crucial point being memory corruption typically > occurs NOT in the place where the program seg faults. > > My 50 cents to it: > In addition to buffer overruns and memory de-allocation, there is another > thing one should look for: return statements from the functions. > C compilers let you write the value returning function without a return > statement, and don't warn you about such a silly (and grave!) mistake. Hmm... If you do "gcc/g++ -Wall ...", it should warn you about this. I'm almost 100% sure about this! (If you use "cc", then it probably won't tell you about this.) The grading guidelines says that if you use gcc/g++, you must compile with "-Wall" and have no compiler warning (or points will be taken off). I hope no one in class is using "cc" just to avoid dealing with compiler warnings! The compiler is really trying to help you out and not trying to make your life miserable! > I had such a bug > once and it was much harder to find, then the others, because: > - printing out values of variables does not reveal the problem > - the logic "everything's fine without this piece of code, so the > problem must be here" does not work > - I was looking at memory de-allocation code, pointers and arrays, and > just ignored those return statements when debugging > > Sorry if this seems obvious to everyone, and lucky are those who never > make such mistakes. > > P.S.: GDB is re-e-eally helpful! In my opinion, the functionality GDB provides is pretty much what you will see in the real world. The "professional" tools may have a nice graphical user interface, but the basic functionality is pretty much the same as GDB. So, please do use it! It may be a little pain to learn at the beginning, but after you get a little better with it, you will not be able to program without a debugger! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Feb 24 10:30:29 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1OIUTRY030206 for ; Fri, 24 Feb 2006 10:30:29 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1OIS2Vv000371 for ; Fri, 24 Feb 2006 10:28:02 -0800 Message-Id: <200602241828.k1OIS2Vv000371@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Segmentation fault (cont.) Date: Fri, 24 Feb 2006 10:28:02 -0800 From: william@bourbon.usc.edu Someone wrote: > I have lots of empathy towards the person who wrote this email, so that's > why I decided to comment on it. Since we don't have a forum, I cannot > contact the person directly. I apologize for spamming you with emails like > this, but if you consider it reasonable, you could forward it to that > person. > > Everything you wrote here > http://merlot.usc.edu/cs530-s06/homeworks.html#segfault > is very-very true, the crucial point being memory corruption typically > occurs NOT in the place where the program seg faults. > > My 50 cents to it: > In addition to buffer overruns and memory de-allocation, there is another > thing one should look for: return statements from the functions. C compilers > let you write the value returning function without a return statement, and > don't warn you about such a silly (and grave!) mistake. Hmm... If you do "gcc/g++ -Wall ...", it should warn you about this. I'm almost 100% sure about this! (If you use "cc", then it probably won't tell you about this.) The grading guidelines says that if you use gcc/g++, you must compile with "-Wall" and have no compiler warning (or points will be taken off). I hope no one in class is using "cc" just to avoid dealing with compiler warnings! The compiler is really trying to help you out and not trying to make your life miserable! > I had such a bug > once and it was much harder to find, then the others, because: > - printing out values of variables does not reveal the problem > - the logic "everything's fine without this piece of code, so the problem > must be here" does not work > - I was looking at memory de-allocation code, pointers and arrays, and > just ignored those return statements when debugging > > Sorry if this seems obvious to everyone, and lucky are those who never make > such mistakes. > > P.S.: GDB is re-e-eally helpful! In my opinion, the functionality GDB provides is pretty much what you will see in the real world. The "professional" tools may have a nice graphical user interface, but the basic functionality is pretty much the same as GDB. So, please do use it! It may be a little pain to learn at the beginning, but after you get a little better with it, you will not be able to program without a debugger! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Feb 24 09:53:43 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1OHrhfR028715 for ; Fri, 24 Feb 2006 09:53:43 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1OHpGQb032631 for ; Fri, 24 Feb 2006 09:51:16 -0800 Message-Id: <200602241751.k1OHpGQb032631@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Segmentation fault (cont.) Date: Fri, 24 Feb 2006 09:51:16 -0800 From: william@bourbon.usc.edu Someone wrote: > Sorry for the inconvenience, but I forgot to tell that the > fgetc( ) works perfectly with some files. But for the one > that you have provided: "yesterday.txt", its giving > segmentation fault. Unfortunately, the only way to get out of this is by debugging and re-examining all your code! The good news is that this is a small programming assignment and it's single-threaded (deterministic)! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Feb 24 09:50:10 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1OHoALj028631 for ; Fri, 24 Feb 2006 09:50:10 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1OHlhD9032562 for ; Fri, 24 Feb 2006 09:47:43 -0800 Message-Id: <200602241747.k1OHlhD9032562@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: regarding Segmentation fault Date: Fri, 24 Feb 2006 09:47:43 -0800 From: william@bourbon.usc.edu Someone wrote: > I am having segmentation fault on fgetc( ). > When I comment it out, everything works fine. So what do I do? I > have checked every possible thing. I have tried it 5-6 hours > continuously. Please see: http://merlot.usc.edu/cs530-s06/homeworks.html#segfault Sorry that there is no magical solution to this. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Feb 23 16:11:30 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1O0BUMF020552 for ; Thu, 23 Feb 2006 16:11:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1O096ji027633 for ; Thu, 23 Feb 2006 16:09:06 -0800 Message-Id: <200602240009.k1O096ji027633@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: weak keys in DES decryption Date: Thu, 23 Feb 2006 16:09:06 -0800 From: william@bourbon.usc.edu Someone wrote: > Do I understand correctly, that for DES decryption we don't have to check if > the key generated from user's pass-phrase is weak or semi-weak? Correct. > Technically, if it is, then the pass-phrase is most surely wrong (since we > checked for weak keys when encrypting). However, we should not probably make > assumptions about how the data was encrypted. In this case if the user > enters a weak key for decryption, we should just use it. Correct. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Feb 23 10:11:01 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1NIB1oJ006812 for ; Thu, 23 Feb 2006 10:11:01 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1NI8c2r025702 for ; Thu, 23 Feb 2006 10:08:38 -0800 Message-Id: <200602231808.k1NI8c2r025702@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: compiling but NOT linking Date: Thu, 23 Feb 2006 10:08:38 -0800 From: william@bourbon.usc.edu Someone wrote: > I have trouble linking openssl libraries .. I have tried many > variations but its not working .. > > The command for compiling is working : > gcc -c -I/home/scf-22/csci551b/openssl/include hw2.c encBase64.c > > but when I try to link this file it gives symbol referencing error .. > gcc -I/home/scf-22/csci551b/openssl/include > -L/home/scf-22/csci551b/openssl/lib -lcrypto -lsocket encBase64.o -o tim > > Undefined first referenced > symbol in file > BIO_f_base64 /var/tmp//ccGYx3jZ.o > BIO_write /var/tmp//ccGYx3jZ.o > BIO_new_fp /var/tmp//ccGYx3jZ.o > BIO_new /var/tmp//ccGYx3jZ.o > BIO_free_all /var/tmp//ccGYx3jZ.o > BIO_ctrl /var/tmp//ccGYx3jZ.o > BIO_push /var/tmp//ccGYx3jZ.o > ld: fatal: Symbol referencing errors. No output written to tim > collect2: ld returned 1 exit status > > Can u plz guide me here .. Is it due to some access priviliges > OR something else ? I'm not sure exactly what the problem is. I'm guessing that you should put all the .o files before -lcrypto. So, please try: gcc encBase64.o -o tim -L/home/scf-22/csci551b/openssl/lib -lcrypto -lsocket and see if this works. By the way, you *must* name your executable hw2 (or you will fail all the tests in the grading guidelines). -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Feb 22 16:36:05 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1N0a5uv030545 for ; Wed, 22 Feb 2006 16:36:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1N0Xi5H021754 for ; Wed, 22 Feb 2006 16:33:44 -0800 Message-Id: <200602230033.k1N0Xi5H021754@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Openssl SHA1 and MD5 Date: Wed, 22 Feb 2006 16:33:44 -0800 From: william@bourbon.usc.edu Someone wrote: > For the MD5 and Sha1 functions: it says to compare your result > against the following at a command prompt > openssl md5 file > openssl sha1 file > > which both return > > md5(filename)= somehexstring & > sha1(filename)= somehexstring respectively. > > Is our program supposed to also return the "md5(filename)= " part > as well or just the "somehexstring" part? > I was thinking just the hexstring... > Is that right? Please follow the spec and just output the hexstring. (You can also check with the "solutions" in the grading guidelines.) When I said "compare your result", what I meant was to check the value (and not the formatting). -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Feb 22 09:56:40 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1MHueXY015385 for ; Wed, 22 Feb 2006 09:56:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1MHsL0E019553 for ; Wed, 22 Feb 2006 09:54:21 -0800 Message-Id: <200602221754.k1MHsL0E019553@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: [CS530] Regarding Openssl SHA-1 Date: Wed, 22 Feb 2006 09:54:21 -0800 From: william@bourbon.usc.edu Someone wrote: > The homework webpage says SHA-1 of "yesnomaybe" on the webpage > (fec42bbb66560a9d32a14207fb6d3de3e93bbdbe) is different from > openssl sha1 returned value, > de075999100fd281bd1e7bef7c02708a2509b7ef. If you put "yesnomaybe" in a file and you do a hexdump of the file, you will notice that there's a "\n" appended to "yesnomaybe"! That's why the sha1 value is different from just "yesnomaybe". If you want to create a file that just has "yesnomaybe" in it and not "\n". Do: echo -n "yesnomaybe" > YOURFILE openssl sha1 YOURFILE > However, SHA-1 of "Hello World" from the webpage is same as > openssl sha1 returned value. > Am I missing anything here? > Thank you very much in advance. That file has a "\n" at the end also. Remember, treat the file as binary when you compute SHA1 hash! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Feb 20 15:53:44 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1KNrio8015543 for ; Mon, 20 Feb 2006 15:53:44 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1KNpUgU006767 for ; Mon, 20 Feb 2006 15:51:30 -0800 Message-Id: <200602202351.k1KNpUgU006767@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: HW2 DES decrypting Date: Mon, 20 Feb 2006 15:51:30 -0800 From: william@bourbon.usc.edu Someone wrote: > I would like to clarify something related to DES decryption. > If we have to compute the SHA-1 of the result file, we have to > store the entire result in memory and output the result after > decryption is complete. Is this acceptable? If not could you > please clarify the requirements (or a hint)? The "entire result" is only 20 bytes in size! As you decrypt, you can compute the SHA-1 hash on the fly. So, you can do this in 20 bytes of data (many a few more bytes here and there.) -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Sunday, February 19, 2006 2:18 pm Subject: Re: HW2 DES decrypting To: cs530@merlot.usc.edu > Someone wrote: > > > For HW2 the DES section, with the decrypting, are we supposed to > > verify the stored hash with what we just decrypted? I dont > > belive the hw writeup says anything about that, but i might be > > overlooking it. Thanks. > > If you don't verify the stored hash, then there would be no > point to store the hash in the file! > > If the hash does not match, you should output an error message > to stderr. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Feb 19 14:18:16 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1JMIGsh013668 for ; Sun, 19 Feb 2006 14:18:16 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1JMG6i7022499 for ; Sun, 19 Feb 2006 14:16:06 -0800 Message-Id: <200602192216.k1JMG6i7022499@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: HW2 DES decrypting Date: Sun, 19 Feb 2006 14:16:06 -0800 From: william@bourbon.usc.edu Someone wrote: > For HW2 the DES section, with the decrypting, are we supposed to > verify the stored hash with what we just decrypted? I dont > belive the hw writeup says anything about that, but i might be > overlooking it. Thanks. If you don't verify the stored hash, then there would be no point to store the hash in the file! If the hash does not match, you should output an error message to stderr. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Feb 19 14:15:37 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1JMFb6u013512 for ; Sun, 19 Feb 2006 14:15:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1JMDRtv022477 for ; Sun, 19 Feb 2006 14:13:27 -0800 Message-Id: <200602192213.k1JMDRtv022477@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Hw2 question Date: Sun, 19 Feb 2006 14:13:27 -0800 From: william@bourbon.usc.edu Someone wrote: > When you ask the user for DES encryption passphrase and user > makes error (for example, passwords does not match or password > exceeds the buffer limit etc.), do we have to prompt again for > the password to be re-entered, or exit the application? Either way is fine. > If we > allow user to reenter the password, do we have to support a > qustion like "do you want to re-enter *y/n)"? That would be fine too. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Feb 19 14:14:11 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1JMEBR8013503 for ; Sun, 19 Feb 2006 14:14:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1JMC1YR022455 for ; Sun, 19 Feb 2006 14:12:01 -0800 Message-Id: <200602192212.k1JMC1YR022455@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: fstat() Date: Sun, 19 Feb 2006 14:12:01 -0800 From: william@bourbon.usc.edu Someone wrote: > I am trying to use the fstat() function to find the size of an open > file, but unable to do so. The example i am following is found online > but is not working in my program. May be you should look for other examples. Please remember that this is a graduate class and I expect everyone to be able to figure out how to figure things out like this! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Feb 19 00:30:01 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1J8U1Gd025317 for ; Sun, 19 Feb 2006 00:30:01 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1J8Rqe1030387 for ; Sun, 19 Feb 2006 00:27:52 -0800 Message-Id: <200602190827.k1J8Rqe1030387@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: power outage early Monday morning 2/20 Date: Sun, 19 Feb 2006 00:27:52 -0800 From: william@bourbon.usc.edu Someone wrote: > Just for clarification, this outage only affects the class > webpage server right? As far as I know, but I cannot be completely sure. The only notice I've seen is for SAL. > nunki, aludra, etc will still be up and running right? If these machines will go down, they won't notify me! So, I have no idea if they will be up or not. You should check with ISD if you want to be sure. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Wednesday, February 15, 2006 10:07 am Subject: power outage early Monday morning 2/20 To: cs530@merlot.usc.edu > Hi, > > If you plan to work on HW2 on Monday 2/20, please be aware > that there is a power outage scheduled for SAL from 2am to > 4am. I may not be able to turn the class web server back > on until later on Monday or even Tuesday. So, please make > a copy of the HW2 spec. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Feb 19 00:28:01 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1J8S1Hg025184 for ; Sun, 19 Feb 2006 00:28:01 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1J8PrBw030365 for ; Sun, 19 Feb 2006 00:25:53 -0800 Message-Id: <200602190825.k1J8PrBw030365@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Grading guidelines Inquiry Date: Sun, 19 Feb 2006 00:25:53 -0800 From: william@bourbon.usc.edu Someone wrote: > 1) In the last script that includes the following line, I think > the file does not exist. it should be either f0.des.1 or > f0.des.2 > ./hw2 dec-des $srcdir/f0.des >! fout > > 2) In the grading guidelines in one place it is written : > > Extra passphrase for verification for DES decryption : -1 point > > but in the last script for checking DES decoding it is written: > > ./hw2 dec-des $srcdir/f0.des >! fout > [ type in a long random passphrase, at least 80 chars, > don't enter the same passphrase - verification failure ] > > I got confused and want to know if we have to prompt the user to > enter the passphrase again for verification. if so then what is > meant by the line : Extra passphrase for verification for DES > decryption : -1 point Thanks for catching this. I have removed the part about: don't enter the same passphrase - verification failure So, for decryption, you should not ask the user to verify the passphrase. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Feb 18 07:51:21 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1IFpLeV020254 for ; Sat, 18 Feb 2006 07:51:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1IFnFmf025818 for ; Sat, 18 Feb 2006 07:49:15 -0800 Message-Id: <200602181549.k1IFnFmf025818@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: ld: symbol referencing errors Date: Sat, 18 Feb 2006 07:49:15 -0800 From: william@bourbon.usc.edu Someone wrote: > I am trying to use the des functions from des.h but am getting symbol > referencing errors. I have added LDFLAGS=-L/home/scf-22/csci551b/openssl/lib > -lcrypto to my makefile. I donot get any errors when using the md5 or base64 > from openssl but seeing this problem only for des. > In a stripped down version of my code i have only tried declaring the des > variables and this works just fine: > > #include > > void des_encode(FILE *f) > { > > DES_cblock cblk_key; > DES_key_schedule ksched; > } > > But, I get errors whenever I try to call any of the des functions like > des_random_key etc . > > This is the output of make: > > encdes.c: In function `des_encode': > encdes.c:10: warning: unused variable `ksched' > gcc main.o encbase64.o decbase64.o md5.o sha1.o encdes.o -o hw2 > -L/home/scf-22/csci551b/openssl/lib -lcrypto > Undefined first referenced > symbol in file > socket > /home/scf-22/csci551b/openssl/lib/libcrypto.a(rand_egd.o) > connect > /home/scf-22/csci551b/openssl/lib/libcrypto.a(rand_egd.o) > ld: fatal: Symbol referencing errors. No output written to hw2 > collect2: ld returned 1 exit status > *** Error code 1 > make: Fatal error: Command failed for target `hw2' > > Can you please tell me where I am going wrong? Please replace "-lcrypto" with "-lcrypto -lsocket". I've just added this to the openssl page on the class web server. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Feb 17 17:02:47 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1I12lAS018824 for ; Fri, 17 Feb 2006 17:02:47 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1I10ixM022671 for ; Fri, 17 Feb 2006 17:00:44 -0800 Message-Id: <200602180100.k1I10ixM022671@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: string function Date: Fri, 17 Feb 2006 17:00:44 -0800 From: william@bourbon.usc.edu Someone wrote: > Is there a function in c where it takes a string and takes > leading and trailing whitespaces off and returns the text? > > e.g. x = " hi "; > y=function(x); > y has "hi" > > i kind of remember there being something like this in java or > perl, but can't seem to find one for c. > Or would we have to just cycle through the string to check if it > is empty. I'm sure you can write it yourself! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Feb 16 10:45:52 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1GIjqMn006785 for ; Thu, 16 Feb 2006 10:45:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1GIhrDv007809 for ; Thu, 16 Feb 2006 10:43:53 -0800 Message-Id: <200602161843.k1GIhrDv007809@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Fwd: Errors for HW2 Date: Thu, 16 Feb 2006 10:43:53 -0800 From: william@bourbon.usc.edu Yes, of course. One should always put standard libraries in front of specialized libraries. It's like prerequisites. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Wed, 15 Feb 2006 14:09:25 -0800 From: ... To: william@bourbon.usc.edu Subject: Re: Fwd: Errors for HW2 I had a same problem before. please put after n.... other libs. Do not put .in the first line of your code. ----- Original Message ----- From: william@bourbon.usc.edu Date: Wednesday, February 15, 2006 2:04 pm Subject: Re: Fwd: Errors for HW2 To: cs530@merlot.usc.edu > Someone wrote: > > > I have been trying to compile my programs on SHA and MD5 and the > > following errors are being generated I cannot look into these > > errors cause they exist in the library files, could u tell me as > > to where I dcould be going wrong. > > > > > > /home/scf-22/csci551b/openssl/include/openssl/md5.h:108: error: > > parse error before "size_t" > > /home/scf-22/csci551b/openssl/include/openssl/md5.h:110: error: > > parse error before "size_t" > > > > /home/scf-22/csci551b/openssl/include/openssl/sha.h:109: error: > > parse error before "size_t" > > /home/scf-22/csci551b/openssl/include/openssl/sha.h:111: error: > > parse error before "size_t" > > /home/scf-22/csci551b/openssl/include/openssl/sha.h:116: error: > > parse error before "size_t" > > /home/scf-22/csci551b/openssl/include/openssl/sha.h:118: error: > > parse error before "size_t" > > /home/scf-22/csci551b/openssl/include/openssl/sha.h:138: error: > > parse error before "size_t" > > /home/scf-22/csci551b/openssl/include/openssl/sha.h:140: error: > > parse error before "size_t" > > /home/scf-22/csci551b/openssl/include/openssl/sha.h:142: error: > > parse error before "size_t" > > /home/scf-22/csci551b/openssl/include/openssl/sha.h:144: error: > > parse error before "size_t" > > /home/scf-22/csci551b/openssl/include/openssl/sha.h:185: error: > > parse error before "size_t" > > /home/scf-22/csci551b/openssl/include/openssl/sha.h:187: error: > > parse error before "size_t" > > /home/scf-22/csci551b/openssl/include/openssl/sha.h:189: error: > > parse error before "size_t" > > /home/scf-22/csci551b/openssl/include/openssl/sha.h:191: error: > > parse error before "size_t" > > Please see my message with timestamp "Sat 11 Feb 17:45". > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Feb 15 19:56:46 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1G3uk82001562 for ; Wed, 15 Feb 2006 19:56:46 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1G3smdT004604 for ; Wed, 15 Feb 2006 19:54:49 -0800 Message-Id: <200602160354.k1G3smdT004604@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Regarding HW2 Date: Wed, 15 Feb 2006 19:54:48 -0800 From: william@bourbon.usc.edu Someone wrote: > following is the ouput generated by my base64 > WWVzdGVyZGF5LApBbGwgbXkgdHJvdWJsZXMgc2VlbWVkIHNvIGZhciBhd2F5Ck5v > dyBpdCBsb29rcyBhcyB0aG91Z2gKVGhleSdyZSBoZXJlIHRvIHN0YXkKT2gsIEkg > YmVsaWV2ZQpJbiB5ZXN0ZXJkYXkuCgpTdWRkZW5seSwKSSdtIG5vdCBoYWxmIHRo > ZSBtYW4gSSB1c2VkIHRvIGJlClRoZXJlJ3MgYSBzaGFkb3cgaGFuZ2luZyBvdmVy > IG1lLgpPaCwgeWVzdGVyZGF5CkNhbWUgc3VkZGVubHkuCgpXaHkgc2hlIGhhZCB0 > byBnbywgSSBkb250IGtub3cKU2hlIHdvdWxkbid0IHNheS4KSSBzYWlkIHNvbWV0 > aGluZyB3cm9uZywgbm93IEkgbG9uZwpGb3IgeWVzdGVyZGF5CgpZZXN0ZXJkYXks > CkxvdmUgd2FzIHN1Y2ggYW4gZWFzeSBnYW1lIHRvIHBsYXkKTm93IEkgbmVlZCBh > IHBsYWNlIHRvIGhpZGUgYXdheQpPaCwgSSBiZWxpdmUKSW4geWVzdGVyZGF5LiAK > Ci0tCgpieSBKb2huIExlbm5vbiBhbmQgUGF1bCBNY0NhcnRuZXkK/w== > > It matches exactly with one produced by openssl except that > the last few characters are additions" /w==" > How should I remove them. Umm... I'm' not sure what else to say except going into the debugger and see why your code didn't stop! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Feb 15 16:35:07 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1G0Z7TQ026235 for ; Wed, 15 Feb 2006 16:35:07 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1G0XAAE003924 for ; Wed, 15 Feb 2006 16:33:10 -0800 Message-Id: <200602160033.k1G0XAAE003924@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: A world without passwords! In-reply-to: <200602160026.k1G0QpXG003898@bourbon.usc.edu> References: <200602160026.k1G0QpXG003898@bourbon.usc.edu> Comments: In-reply-to william@bourbon.usc.edu message dated "Wed, 15 Feb 2006 16:26:51 -0800." Date: Wed, 15 Feb 2006 16:33:10 -0800 From: william@bourbon.usc.edu Hi, Well, I jumped the gun on this... After reading it carefully, this is not about Palladium. It's more related to SmartCards which we talked about in class today. Sorry about it! I will talk about what Palladium is next week. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Wed, 15 Feb 2006 16:26:51 -0800 From: william@bourbon.usc.edu To: cs530@merlot.usc.edu Subject: A world without passwords! Hi, Please take a look at: http://news.com.com/2102-7355_3-6039177.html What Bill Gates is talking about is basically MS Palladium mentioned on slide 8 of Key Management (Part 2) in the tentative slides section of the lectures page on: http://merlot.usc.edu/cs530-s06/lectures.html Our page number will change soon because I'm planning to add slides for visual cryptography. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Feb 15 16:28:48 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1G0SmKd025997 for ; Wed, 15 Feb 2006 16:28:48 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1G0Qppn003899 for ; Wed, 15 Feb 2006 16:26:51 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k1G0QpXG003898 for cs530@merlot; Wed, 15 Feb 2006 16:26:51 -0800 Date: Wed, 15 Feb 2006 16:26:51 -0800 From: william@bourbon.usc.edu Message-Id: <200602160026.k1G0QpXG003898@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: A world without passwords! Hi, Please take a look at: http://news.com.com/2102-7355_3-6039177.html What Bill Gates is talking about is basically MS Palladium mentioned on slide 8 of Key Management (Part 2) in the tentative slides section of the lectures page on: http://merlot.usc.edu/cs530-s06/lectures.html Our page number will change soon because I'm planning to add slides for visual cryptography. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Feb 15 14:04:33 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1FM4XsS020610 for ; Wed, 15 Feb 2006 14:04:33 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1FM2apk002333 for ; Wed, 15 Feb 2006 14:02:36 -0800 Message-Id: <200602152202.k1FM2apk002333@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Fwd: Errors for HW2 Date: Wed, 15 Feb 2006 14:02:36 -0800 From: william@bourbon.usc.edu Someone wrote: > I have been trying to compile my programs on SHA and MD5 and the > following errors are being generated I cannot look into these > errors cause they exist in the library files, could u tell me as > to where I dcould be going wrong. > > > /home/scf-22/csci551b/openssl/include/openssl/md5.h:108: error: > parse error before "size_t" > /home/scf-22/csci551b/openssl/include/openssl/md5.h:110: error: > parse error before "size_t" > > /home/scf-22/csci551b/openssl/include/openssl/sha.h:109: error: > parse error before "size_t" > /home/scf-22/csci551b/openssl/include/openssl/sha.h:111: error: > parse error before "size_t" > /home/scf-22/csci551b/openssl/include/openssl/sha.h:116: error: > parse error before "size_t" > /home/scf-22/csci551b/openssl/include/openssl/sha.h:118: error: > parse error before "size_t" > /home/scf-22/csci551b/openssl/include/openssl/sha.h:138: error: > parse error before "size_t" > /home/scf-22/csci551b/openssl/include/openssl/sha.h:140: error: > parse error before "size_t" > /home/scf-22/csci551b/openssl/include/openssl/sha.h:142: error: > parse error before "size_t" > /home/scf-22/csci551b/openssl/include/openssl/sha.h:144: error: > parse error before "size_t" > /home/scf-22/csci551b/openssl/include/openssl/sha.h:185: error: > parse error before "size_t" > /home/scf-22/csci551b/openssl/include/openssl/sha.h:187: error: > parse error before "size_t" > /home/scf-22/csci551b/openssl/include/openssl/sha.h:189: error: > parse error before "size_t" > /home/scf-22/csci551b/openssl/include/openssl/sha.h:191: error: > parse error before "size_t" Please see my message with timestamp "Sat 11 Feb 17:45". -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Feb 15 10:07:31 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1FI7VJV011580 for ; Wed, 15 Feb 2006 10:07:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1FI5a9j001067 for ; Wed, 15 Feb 2006 10:05:36 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k1FI5aom001066 for cs530@merlot; Wed, 15 Feb 2006 10:05:36 -0800 Date: Wed, 15 Feb 2006 10:05:36 -0800 From: william@bourbon.usc.edu Message-Id: <200602151805.k1FI5aom001066@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: power outage early Monday morning 2/20 Hi, If you plan to work on HW2 on Monday 2/20, please be aware that there is a power outage scheduled for SAL from 2am to 4am. I may not be able to turn the class web server back on until later on Monday or even Tuesday. So, please make a copy of the HW2 spec. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Feb 13 17:57:49 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1E1vnvh016415 for ; Mon, 13 Feb 2006 17:57:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1E1txOt023465 for ; Mon, 13 Feb 2006 17:55:59 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k1E1txDZ023464 for cs530@merlot; Mon, 13 Feb 2006 17:55:59 -0800 Date: Mon, 13 Feb 2006 17:55:59 -0800 From: william@bourbon.usc.edu Message-Id: <200602140155.k1E1txDZ023464@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: source code for BIO_debug_callback() Hi, At the bottom of the BIO_set_callback() documentation on the web, it says: EXAMPLE The BIO_debug_callback() function is a good example, its source is in crypto/bio/bio_cb.c I've just put the source code of bio_cb.c in: ~csci551b/openssl/src/openssl-0.9.8a/crypto/bio -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Feb 12 20:28:07 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1D4S7w6031888 for ; Sun, 12 Feb 2006 20:28:07 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1D4QKbk017877 for ; Sun, 12 Feb 2006 20:26:20 -0800 Message-Id: <200602130426.k1D4QKbk017877@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: In case you find this of interest . . . as it's about stuff we've recently covered Date: Sun, 12 Feb 2006 20:26:20 -0800 From: william@bourbon.usc.edu Hi, Just want to briefly comment on the techniques mentioned in the URL mentioned in the e-mail. I think the lesson here is that any document format where one can hide random data can be susceptible to this type of attack. So, when you design a security system and digital signature is used, make sure you only sign messages with simple structure where every field can be validated. (And if you have to sign things like e-mail messages, make sure you only sign ASCII text or base64-encoded text.) -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Sun, 12 Feb 2006 10:42:45 -0800 From: Mark Yasuda To: "william@bourbon.usc.edu" Subject: In case you find this of interest . . . as it's about stuff we've recently covered http://www.cits.rub.de/MD5Collisions/ Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Feb 12 19:22:00 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1D3M00K029356 for ; Sun, 12 Feb 2006 19:22:00 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1D3KDho017740 for ; Sun, 12 Feb 2006 19:20:13 -0800 Message-Id: <200602130320.k1D3KDho017740@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: hw2 Date: Sun, 12 Feb 2006 19:20:13 -0800 From: william@bourbon.usc.edu Someone wrote: > I added the statement needed to the environment variable as > asked. But when i do "source .cshrc" it gives me the message > "MANPATH: Undefined variable". Due to which i cant use the > "man" command. > > Can you help me please. Please see my message with timestamp "Thu 9 Feb 17:05" in the message archive. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Feb 12 17:30:31 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1D1UVh1024829 for ; Sun, 12 Feb 2006 17:30:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1D1SjgE017172 for ; Sun, 12 Feb 2006 17:28:45 -0800 Message-Id: <200602130128.k1D1SjgE017172@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: hw2 Date: Sun, 12 Feb 2006 17:28:45 -0800 From: william@bourbon.usc.edu Oops! Sorry! The message went to the wrong mailinglist. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Sun, 12 Feb 2006 17:27:56 -0800 From: william@bourbon.usc.edu To: cs530@bourbon.usc.edu Subject: Re: hw2 Someone wrote: > n = > m = > k = > > n000 = > n001 = > n010 = > > This print statement above shows -at the output that you > considered the block size "m= three bits." It's just an example. The text below it says exactly what it should be: the i's in the ni's should enumerate through all 2^m possible values in increasing order. > The same way the block size of "m=2 bits" will satisfy > the " >= " test for finding "M". > > 1)so do we have to consider M=2 also?? I'm sorry, but I'm not understanding what you meant. May be we need to talk about this face to face during office hour or before/after class. > 2) the second question is > > The symbol " |_ " n / m "_|". > > What is the meaning of "|_". Is it a limit??? It's the floor() function. If you use integer division, then it should just be the quotient. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Feb 12 17:29:43 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1D1Thok024736 for ; Sun, 12 Feb 2006 17:29:43 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1D1RuvG017150 for ; Sun, 12 Feb 2006 17:27:56 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k1D1Ru1N017149 for cs530@merlot.usc.edu; Sun, 12 Feb 2006 17:27:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1D1Rub5017146 for ; Sun, 12 Feb 2006 17:27:56 -0800 Message-Id: <200602130127.k1D1Rub5017146@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hw2 Date: Sun, 12 Feb 2006 17:27:56 -0800 From: william@bourbon.usc.edu Someone wrote: > n = > m = > k = > > n000 = > n001 = > n010 = > > This print statement above shows -at the output that you > considered the block size "m= three bits." It's just an example. The text below it says exactly what it should be: the i's in the ni's should enumerate through all 2^m possible values in increasing order. > The same way the block size of "m=2 bits" will satisfy > the " >= " test for finding "M". > > 1)so do we have to consider M=2 also?? I'm sorry, but I'm not understanding what you meant. May be we need to talk about this face to face during office hour or before/after class. > 2) the second question is > > The symbol " |_ " n / m "_|". > > What is the meaning of "|_". Is it a limit??? It's the floor() function. If you use integer division, then it should just be the quotient. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Feb 12 17:22:50 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1D1Mo31024508 for ; Sun, 12 Feb 2006 17:22:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1D1L4Bx017043 for ; Sun, 12 Feb 2006 17:21:04 -0800 Message-Id: <200602130121.k1D1L4Bx017043@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Regarding HW2 Date: Sun, 12 Feb 2006 17:21:04 -0800 From: william@bourbon.usc.edu Someone wrote: > I have a query that What is the output required in DES > Encryption, whether the encrypted output or the hexdump output of > encrypted file. You should output in the required format. (I'm not sure why you should want to produce a hexdump output of the encrypted file.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Feb 11 17:47:20 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1C1lKK0012779 for ; Sat, 11 Feb 2006 17:47:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1C1jbP1018254 for ; Sat, 11 Feb 2006 17:45:37 -0800 Message-Id: <200602120145.k1C1jbP1018254@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: getting errors Date: Sat, 11 Feb 2006 17:45:37 -0800 From: william@bourbon.usc.edu Someone wrote: > I am having problems when I compile the program for md5 using openssl. > I get the following error: > ---------------------------------------- > In file included from md5.c:1: > /home/scf-22/csci551b/openssl/include/openssl/md5.h:108: error: type specifier > omitted for parameter `size_t' > /home/scf-22/csci551b/openssl/include/openssl/md5.h:108: error: parse error > before `)' token > /home/scf-22/csci551b/openssl/include/openssl/md5.h:110: error: type specifier > omitted for parameter `size_t' > /home/scf-22/csci551b/openssl/include/openssl/md5.h:110: error: parse error > before `,' token > so,I am not able to understand the problem. You probably need to include the standard C/C++ header files before you include . I don't know exactly where size_t is defined. So, I would probably do something like: #include #include #include ... If this doesn't work, you probably need to search around a bit. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Feb 10 12:08:29 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1AK8T5j010158 for ; Fri, 10 Feb 2006 12:08:29 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1AK6pwS024191 for ; Fri, 10 Feb 2006 12:06:51 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k1AK6p9L024190 for cs530@merlot; Fri, 10 Feb 2006 12:06:51 -0800 Date: Fri, 10 Feb 2006 12:06:51 -0800 From: william@bourbon.usc.edu Message-Id: <200602102006.k1AK6p9L024190@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: error on slide 6 of lecture 7 Hi, There was an error on slide 6 of lecture 7. It used to say: 1 < g < p-1 and for i = 1,2,3,...,p-1, g^i generates all values... It should say: 1 <= g <= p-2 and for i = 0,1,2,3,...,p-2, g^i generates all values... where g^i denotes g raised to the ith power. It has been fixed on the web. Sorry about the mistake. Here's an example: p = 13 g = 6 (note: g^12 mod 13 = 1) for (i=0; i < 12; i++) i and 6^i mod 13 are tabulated below: i mod 12 | 0 1 2 3 4 5 6 7 8 9 10 11 ------------+------------------------------------ 6^i mod 13 | 1 6 10 8 9 2 12 7 3 5 4 11 -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Feb 9 17:07:17 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1A17HHb031178 for ; Thu, 9 Feb 2006 17:07:17 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1A15g0q019979 for ; Thu, 9 Feb 2006 17:05:42 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k1A15gYM019978 for cs530@merlot; Thu, 9 Feb 2006 17:05:42 -0800 Date: Thu, 9 Feb 2006 17:05:42 -0800 From: william@bourbon.usc.edu Message-Id: <200602100105.k1A15gYM019978@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: setup environment for OpenSSL during login... Hi, For those of you whose login shell is csh/tcsh, looks like setting environment variables in ~/.cshrc can cause *big problem*! Please put those lines related to path, LD_LIBRARY_PATH, and MANPATH in ~/.login instead. If you have put them in your ~/.cshrc and now you can not edit any files, please do the following from the commandline: unsetenv LD_LIBRARY_PATH Then you should be able to edit your ~/.cshrc file. Please also see: http://merlot.usc.edu/cs530-s06/openssl.html#login -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Feb 9 10:11:41 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k19IBfq7015018 for ; Thu, 9 Feb 2006 10:11:41 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k19IA67Z020115 for ; Thu, 9 Feb 2006 10:10:06 -0800 Message-Id: <200602091810.k19IA67Z020115@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: HW2: Question Date: Thu, 09 Feb 2006 10:10:06 -0800 From: william@bourbon.usc.edu Someone wrote: > You mentioned in your class notes about using an openssl function > named BIO_set_callback for base64 decoding. Is it OK if I don't > use this function? Instead, I'll make sure that the input data > conforms to the base64 spec (just like what I did for HW1) before > calling the openssl routine to do the conversion? Well, the spec says: For base64 decoding, you may want to use BIO_set_callback()... So, it's not a requirement to use BIO_set_callback(). -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Feb 7 14:45:24 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k17MjOHk009587 for ; Tue, 7 Feb 2006 14:45:24 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k17MhuvI005420 for ; Tue, 7 Feb 2006 14:43:56 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k17MhuoX005419 for cs530@merlot; Tue, 7 Feb 2006 14:43:56 -0800 Date: Tue, 7 Feb 2006 14:43:56 -0800 From: william@bourbon.usc.edu Message-Id: <200602072243.k17MhuoX005419@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: changes to lecture slides... Hi, I wasn't too happy with the way the slides were ordered yesterday. I've changed the lecture slides, so what's on the web now is not in the same order as what I did during yesterday's lecture. Another thing I fixed is the example used on slide 6 of lecture 8 on the web. Someone in class asked the question that since the digital signature is often attached to the message, the example used for "no one-wayness" also works for the case where there is "no weak collision-resistance". After thinking about it for a while, I think the student is correct. So, I had to modify the example. Consider the case where the document that needs to be signed is m, the digital signature, denoted by DS(m), is H(m) encrypted with the private key of the signer. The message transmitted is actually E(m)+DS(m) where E(m) is m encrypted under a secret key. The idea here is that in order to verify the signature, the verifier must obtain the secret key from the signer. In this case, the attacker does not have m. If there is no one-wayness in the hash function, the attacker can find m' where H(m')=H(m), he can replace E(m) by E(m') under a secret key of his choosing. Now the original signer can no longer provide the necessary information to the signer but the attacker can! (I know, I know, this example is bit contrived. But it does serve the purpose to distinguish "no one-wayness" and "no weak collision-resistance" in the context of digital signatures.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Feb 6 14:03:53 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k16M3rRn016783 for ; Mon, 6 Feb 2006 14:03:53 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k16M2Tmk028073 for ; Mon, 6 Feb 2006 14:02:29 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k16M2TaG028072 for cs530@merlot; Mon, 6 Feb 2006 14:02:29 -0800 Date: Mon, 6 Feb 2006 14:02:29 -0800 From: william@bourbon.usc.edu Message-Id: <200602062202.k16M2TaG028072@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: notebook (not laptop) lost and found Hi, I've announced in class that I've picked up an 8-inch by 6-inch note book from USC Lost & Found. On the first page, it has information about CS 530 in it. If this is your notebook, please send me an e-mail to arrange for a pick up. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Feb 5 18:28:17 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k162SHhr004091 for ; Sun, 5 Feb 2006 18:28:17 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k162QubR022675 for ; Sun, 5 Feb 2006 18:26:56 -0800 Message-Id: <200602060226.k162QubR022675@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: unable to compile md5 using openssl Date: Sun, 05 Feb 2006 18:26:56 -0800 From: william@bourbon.usc.edu Someone wrote: > I am having problems when I compile the program for md5 using > openssl. I get the following error > > ---------------------------------------------------------------------------- > Undefined first referenced > symbol in file > MD5 /var/tmp//cceyIBlQ.o > ld: fatal: Symbol referencing errors. No output written to a.out > collect2: ld returned 1 exit status > > ---------------------------------------------------------------------------- > I have configured the nunki account for openssl as given on > the class website. I get the foll. when I check for version > > bash-2.05b$ openssl version > OpenSSL 0.9.8a 11 Oct 2005 > > I included the #include file > > and am adding the command > '"-I/home/scf-22/csci551b/openssl/include" while compiling eg. > > g++ md5.cpp -I/home/scf-22/csci551b/openssl/include > > But even then it seems that the compiler cannot find the > function MD5. Can u hint me as to what is the problem. The -I is for compiling and -L is for linking. Since you are not doing separate compilation above (I understand, it's just for testing), you need both. So, you need to do: g++ md5.cpp -I/home/scf-22/csci551b/openssl/include \ -L/home/scf-22/csci551b/openssl/lib -lcrypto If you are using separation compilation, you only need "-L/home/scf-22/csci551b/openssl/lib -lcrypto" when you link all your modules together. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Feb 4 22:35:37 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k156Zbvp001944 for ; Sat, 4 Feb 2006 22:35:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k156YJeb026742 for ; Sat, 4 Feb 2006 22:34:19 -0800 Message-Id: <200602050634.k156YJeb026742@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: problems using openssl libraries for HW2 Date: Sat, 04 Feb 2006 22:34:19 -0800 From: william@bourbon.usc.edu Someone wrote: > I am having a problem using the openssl libraries. I have > followed the instructions one the site and im still having > problems. What information should I send you to help figure out > what is happening. You can create a transcript and e-mail it to me (with additional explanation if you think it would help me to understand the problem). To create a transcript, do: script /tmp/YOURLOGIN.script [ run your commands ] exit Then e-mail /tmp/YOURLOGIN.script to me. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Feb 3 16:18:58 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k140IwxV030057 for ; Fri, 3 Feb 2006 16:18:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k140Hipx019661 for ; Fri, 3 Feb 2006 16:17:44 -0800 Message-Id: <200602040017.k140Hipx019661@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: MD5_CTX doubt. Date: Fri, 03 Feb 2006 16:17:44 -0800 From: william@bourbon.usc.edu Someone wrote: > The file md5.h includes the following structure in it. > > typedef struct MD5state_st > { > MD5_LONG A,B,C,D; > MD5_LONG Nl,Nh; > MD5_LONG data[MD5_LBLOCK]; > unsigned int num; > } MD5_CTX; > > and for using the MD5 functions, one needs the MD5_CTX defined. > But i am unable to understand the members of this structure. > I tried to find the explanation online, but it seems there are > several variants for the file md5.h and correspondingly several > variants for the declaration of the above structure. Could you > help me in this. You should think of MD5_CTX as an opaque data structure. This means that you should never peak inside of it. This way, when the implementation of MD5_CTX changes, your code will still work. > Specifically, how do we call MD5_Init() function > exactly, in case the file size is > 4096 bytes and we have to > break the file into chunks. That's part of the exercise. It should be very easy to find some working example code. When dealing with files, you need the file size for the DES part of HW2. But if you just want to compute the MD5 checksum of a file, you should not take file size into considerations and just use MD5_Init() and related functions. Do not call MD5() directly unless you are sure that you don't need a large buffer ever. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Feb 2 21:40:48 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k135emKv016333 for ; Thu, 2 Feb 2006 21:40:48 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k135dbMR011815 for ; Thu, 2 Feb 2006 21:39:37 -0800 Message-Id: <200602030539.k135dbMR011815@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: problems using openssl libraries for HW2 Date: Thu, 02 Feb 2006 21:39:37 -0800 From: william@bourbon.usc.edu Someone wrote: > I tried What you said to do > regarding the setting of the path but it is still not working. > Also I ran the command "openssl version" and it is showing me > the expected message. This means that it has been properly > configured. When you did: gcc -Wall -g -I/home/scf-22/csci551b/openssl/include base64.c I assume that you are only trying to compile the "module". Therefore, you need the "-c" flag. Otherwise, it meant that you are trying to create "a.out". In order to create the executable, it needs the libraries. THerefore, you need the "-L... -lcrypto". -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Thursday, February 2, 2006 12:00 am Subject: Re: problems using openssl libraries for HW2 To: cs530@merlot.usc.edu > Someone wrote: > > > I was just trying my hand using the BIO_f_base64() function > > by copy-pasting the example given in man pages. my base64.c > > file looks like: > > > > #include > > #include > > #include > > > > int main() > > { > > BIO *bio, *b64; > > char message[] = "Hello World \n"; > > > > b64 = BIO_new(BIO_f_base64()); > > bio = BIO_new_fp(stdout, BIO_NOCLOSE); > > bio = BIO_push(b64, bio); > > BIO_write(bio, message, strlen(message)); > > BIO_flush(bio); > > > > BIO_free_all(bio); > > return 0; > > } > > > > but when i compile it after setting my environment for using > > openssl libraries ( i.e. using the > > -I/home/scf-22/csci551b/openssl/include and the > > -L/home/scf-22/csci551b/openssl/lib -lcrypto options), i get > > the following error - > > > > aludra.usc.edu: make hw2 > > gcc -Wall -g -I/home/scf-22/csci551b/openssl/include base64.c > > Undefined first referenced > > symbol in file > > BIO_f_base64 /var/tmp//ccwh6AhL.o > > BIO_write /var/tmp//ccwh6AhL.o > > BIO_new_fp /var/tmp//ccwh6AhL.o > > BIO_new /var/tmp//ccwh6AhL.o > > BIO_free_all /var/tmp//ccwh6AhL.o > > BIO_ctrl /var/tmp//ccwh6AhL.o > > BIO_push /var/tmp//ccwh6AhL.o > > ld: fatal: Symbol referencing errors. No output written to a.out > > collect2: ld returned 1 exit status > > *** Error code 1 > > make: Fatal error: Command failed for target `base64.o' > > > > Do i need to add any more libraries or do i need to set any > > other environment variables to make this work?? i tried > > searching online, but i dint find any documentation. I am > > kind of confused how to handle this. Please Help. > > I think you forgot to set LD_LIBRARY_PATH properly. Please see: > > http://merlot.usc.edu/cs530-s06/openssl.html#ldlibpath > > Please set *everything* according to the above URL. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Feb 2 16:05:35 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k1305YSs003836 for ; Thu, 2 Feb 2006 16:05:34 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1304O5j010558 for ; Thu, 2 Feb 2006 16:04:24 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k1304O8D010557 for cs530@merlot.usc.edu; Thu, 2 Feb 2006 16:04:24 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k1304OpX010554 for ; Thu, 2 Feb 2006 16:04:24 -0800 Message-Id: <200602030004.k1304OpX010554@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: El Gamal example Date: Thu, 02 Feb 2006 16:04:24 -0800 From: william@bourbon.usc.edu Someone wrote: | On Wed, 1 Feb 2006 william@bourbon.usc.edu wrote: | | > Someone wrote: | > | > > Minor note: on your slide for El Gamal, your parenthetical public key | > > example is 7 = 13^27 mod 55 . . . but 55 is not prime. | | but 55 is relatively prime to 7, 13, and 27. The requirement for El Gamal (and Diffe-Hellman) is that p must be prime. For RSA, the e you choose must be relatively prime to (p-1)(q-1). Please note that all these requirements are *very specific*. You may not use the requirement from one system and use it in another system. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Feb 1 23:59:48 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k127xmII031025 for ; Wed, 1 Feb 2006 23:59:48 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k127weEp005532 for ; Wed, 1 Feb 2006 23:58:40 -0800 Message-Id: <200602020758.k127weEp005532@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: problems using openssl libraries for HW2 Date: Wed, 01 Feb 2006 23:58:40 -0800 From: william@bourbon.usc.edu Someone wrote: > I was just trying my hand using the BIO_f_base64() function > by copy-pasting the example given in man pages. my base64.c > file looks like: > > #include > #include > #include > > int main() > { > BIO *bio, *b64; > char message[] = "Hello World \n"; > > b64 = BIO_new(BIO_f_base64()); > bio = BIO_new_fp(stdout, BIO_NOCLOSE); > bio = BIO_push(b64, bio); > BIO_write(bio, message, strlen(message)); > BIO_flush(bio); > > BIO_free_all(bio); > return 0; > } > > but when i compile it after setting my environment for using > openssl libraries ( i.e. using the > -I/home/scf-22/csci551b/openssl/include and the > -L/home/scf-22/csci551b/openssl/lib -lcrypto options), i get > the following error - > > aludra.usc.edu: make hw2 > gcc -Wall -g -I/home/scf-22/csci551b/openssl/include base64.c > Undefined first referenced > symbol in file > BIO_f_base64 /var/tmp//ccwh6AhL.o > BIO_write /var/tmp//ccwh6AhL.o > BIO_new_fp /var/tmp//ccwh6AhL.o > BIO_new /var/tmp//ccwh6AhL.o > BIO_free_all /var/tmp//ccwh6AhL.o > BIO_ctrl /var/tmp//ccwh6AhL.o > BIO_push /var/tmp//ccwh6AhL.o > ld: fatal: Symbol referencing errors. No output written to a.out > collect2: ld returned 1 exit status > *** Error code 1 > make: Fatal error: Command failed for target `base64.o' > > Do i need to add any more libraries or do i need to set any > other environment variables to make this work?? i tried > searching online, but i dint find any documentation. I am > kind of confused how to handle this. Please Help. I think you forgot to set LD_LIBRARY_PATH properly. Please see: http://merlot.usc.edu/cs530-s06/openssl.html#ldlibpath Please set *everything* according to the above URL. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Feb 1 23:30:41 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k127UfQ9029824 for ; Wed, 1 Feb 2006 23:30:41 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k127TXx8005207 for ; Wed, 1 Feb 2006 23:29:33 -0800 Message-Id: <200602020729.k127TXx8005207@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: El Gamal example Date: Wed, 01 Feb 2006 23:29:33 -0800 From: william@bourbon.usc.edu Someone wrote: > Minor note: on your slide for El Gamal, your parenthetical public key > example is 7 = 13^27 mod 55 . . . but 55 is not prime. Good catch! I will deleted the example when I'm on campus tomorrow. (Bad cut and paste on my part.) Thanks for catching it! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Jan 31 23:28:09 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k117S9kT003967 for ; Tue, 31 Jan 2006 23:28:09 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k117R4WX031813 for ; Tue, 31 Jan 2006 23:27:04 -0800 Message-Id: <200602010727.k117R4WX031813@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Galois Date: Tue, 31 Jan 2006 23:27:04 -0800 From: william@bourbon.usc.edu Hi, I'm forwarding an e-mail message from a student. I apologize for mis-pronouncing "Galois". -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Tue, 31 Jan 2006 17:35:42 -0800 From: Mark Yasuda To: "william@bourbon.usc.edu" Subject: Galois Dr. Cheng, In case you were interested, the pronunciation of Galois is "gal-wa". His short life story is one of the more compelling and tragic ones in the history of mathematics. He died before his 21st birthday, but still laid the foundations of modern algebra -- group theory and Galois theory -- through remarkable insights achieved without guidance other than the published works of his mathematical predecessors (Lagrange in particular). http://en.wikipedia.org/wiki/Evariste_Galois http://www-groups.dcs.st-and.ac.uk/~history/Mathematicians/Galois.html - Mark Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Jan 30 07:39:20 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0UFdKMZ004332 for ; Mon, 30 Jan 2006 07:39:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0UFcLV0016536 for ; Mon, 30 Jan 2006 07:38:21 -0800 Message-Id: <200601301538.k0UFcLV0016536@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: CS530 public code question Date: Mon, 30 Jan 2006 07:38:21 -0800 From: william@bourbon.usc.edu Someone wrote: > I must say I'm somewhat surprised by this. The HW spec says: > > "The purpose of this assignment is to get you up to speed with > manipulating bits in memory and files." > > How is someone going to get up to speed with manipulating bits in > memory if they just copy the Base 64 code from somewhere else, > even if they modify it a little bit to fit the assignment? Modifying a bit does take some understanding. Also, there are code for base64 encoding/decoding and hexdumping all over the net. Some works and some don't. To find out which one works closest to the spec also takes some work. Another thing is that if someone just copy the code and not look carefully and didn't really get up to speed, he/she will pay in other programming assignments. > Also, apart from violating the licensing restrictions placed on > the code by the author, isn't using someone else's work and > removing the copyright notice a violation of the academic > integrity policy of USC, i.e. plagiarism? It would be. But not in this case because the student mentioned the source URL in the README file. So, since the student did not claim that the b64.c code was his/her own, it's not plagiarism. It's a simple mistake because the student was not familiar with source code licensing. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Sunday, January 29, 2006 3:53 pm Subject: Re: CS530 public code question To: cs530@merlot.usc.edu > Someone wrote: > > > Your last email about using public code brought up a > question. You > > specifically prohibited us from linking with libraries that > would do the > > encoding/decoding for us but your last email makes it seem > like it would > > have been ok to just copy the code for encoding/decoding into > our homework > > from a public source as long as we credited that source correctly. > > Linking with libraries is very different from copying code. > When you link to a library, it's very likely that you do not > know what's going on in the library. When you copy code, > you may change the code to make it work according to our HW > spec. > > > Will the > > student who used the http://base64.sourceforge.net/b64.c code > get full > > credit for his/her work even though all they did was copy code? > > During the first lecture, I've made it very explicit that > copying publicly available code is perfectly allowed for HWs, > as long as you site exactly where you got the code. Therefore, > this student will get full credit. I assume that he/she has > made some modifications in order to make sure the code passes > the grading guidelines. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Jan 29 16:15:43 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0U0FhsK001040 for ; Sun, 29 Jan 2006 16:15:43 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0U0Elmg012028 for ; Sun, 29 Jan 2006 16:14:47 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k0U0El1l012027 for cs530@merlot; Sun, 29 Jan 2006 16:14:47 -0800 Date: Sun, 29 Jan 2006 16:14:47 -0800 From: william@bourbon.usc.edu Message-Id: <200601300014.k0U0El1l012027@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: HW2 spec is out Hi, I will briefly talk about HW2 at the beginning of Monday's lecture. Please read the spec and bring questions to the lecture. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Jan 29 15:53:15 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0TNrFTF032515 for ; Sun, 29 Jan 2006 15:53:15 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0TNqJTE011773 for ; Sun, 29 Jan 2006 15:52:19 -0800 Message-Id: <200601292352.k0TNqJTE011773@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: CS530 public code question Date: Sun, 29 Jan 2006 15:52:19 -0800 From: william@bourbon.usc.edu Someone wrote: > Your last email about using public code brought up a question. You > specifically prohibited us from linking with libraries that would do the > encoding/decoding for us but your last email makes it seem like it would > have been ok to just copy the code for encoding/decoding into our homework > from a public source as long as we credited that source correctly. Linking with libraries is very different from copying code. When you link to a library, it's very likely that you do not know what's going on in the library. When you copy code, you may change the code to make it work according to our HW spec. > Will the > student who used the http://base64.sourceforge.net/b64.c code get full > credit for his/her work even though all they did was copy code? During the first lecture, I've made it very explicit that copying publicly available code is perfectly allowed for HWs, as long as you site exactly where you got the code. Therefore, this student will get full credit. I assume that he/she has made some modifications in order to make sure the code passes the grading guidelines. -- Bill Cheng // bill.cheng@usc.edu On 1/29/06, william@bourbon.usc.edu wrote: > > Hi, > > I've mentioned at the beginning of the semester that you are > allowed to use public code. But you are suppose to read what > you are using and follow any licensing restrictions imposed > by the code. Someone in class used the following code in > his/her HW1 submission: > > http://base64.sourceforge.net/b64.c > > In this file, it clearly stated (in comments): > > LICENCE: Copyright (c) 2001 Bob Trower, Trantor Standard Systems Inc. > > Permission is hereby granted, free of charge, to any person > obtaining a copy of this software and associated > documentation files (the "Software"), to deal in the > Software without restriction, including without limitation > the rights to use, copy, modify, merge, publish, distribute, > sublicense, and/or sell copies of the Software, and to > permit persons to whom the Software is furnished to do so, > subject to the following conditions: > > The above copyright notice and this permission notice shall > be included in all copies or substantial portions of the > Software. > ... > > The student deleted all the comments at the top of this file > which included the LICENSE clause above. No where in his/her > code mentioned "Copyright (c) 2001 Bob Trower, Trantor > Standard Systems Inc." > > This is a clear violation of the licensing terms of the code! > Please make sure you understand the licensing agreement before > you use any public code! If you plan to violate the licensing > agreement, then please do *not* use the code. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Jan 29 15:33:44 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0TNXiRf031759 for ; Sun, 29 Jan 2006 15:33:44 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0TNWmkU011705 for ; Sun, 29 Jan 2006 15:32:48 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k0TNWmKn011704 for cs530@merlot; Sun, 29 Jan 2006 15:32:48 -0800 Date: Sun, 29 Jan 2006 15:32:48 -0800 From: william@bourbon.usc.edu Message-Id: <200601292332.k0TNWmKn011704@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: HW1... avoiding copyright violation Hi, I've mentioned at the beginning of the semester that you are allowed to use public code. But you are suppose to read what you are using and follow any licensing restrictions imposed by the code. Someone in class used the following code in his/her HW1 submission: http://base64.sourceforge.net/b64.c In this file, it clearly stated (in comments): LICENCE: Copyright (c) 2001 Bob Trower, Trantor Standard Systems Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. ... The student deleted all the comments at the top of this file which included the LICENSE clause above. No where in his/her code mentioned "Copyright (c) 2001 Bob Trower, Trantor Standard Systems Inc." This is a clear violation of the licensing terms of the code! Please make sure you understand the licensing agreement before you use any public code! If you plan to violate the licensing agreement, then please do *not* use the code. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sat Jan 28 20:52:14 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0T4qEX0030950 for ; Sat, 28 Jan 2006 20:52:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0T4pKFl013962 for ; Sat, 28 Jan 2006 20:51:20 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k0T4pKRn013961 for cs530@merlot.usc.edu; Sat, 28 Jan 2006 20:51:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0T4pKOn013958 for ; Sat, 28 Jan 2006 20:51:20 -0800 Message-Id: <200601290451.k0T4pKOn013958@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Unexpected result of "diff" command - part 2 Date: Sat, 28 Jan 2006 20:51:20 -0800 From: william@bourbon.usc.edu Someone wrote: > as of now, i have done the following testing - > I encoded my hw1's executable file using my base64 encoder, then > i decoded it back to hw1.dat using my base64 decoder, then i > deleted the original hw1 executable, n renamed hw1.dat as hw1, > and then i run my program, n still it runs perfectly.. even > though the diff command still says that "The Binary Files are > different", but i dont know why it is not saying where the > difference is. I hope you can figure out some thing from all > this. Again, diff doesn't lie. If your hexdump is working perfectly, just hexdump both files and do a diff on the output files. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Jan 28 20:01:45 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0T41ju2029008 for ; Sat, 28 Jan 2006 20:01:45 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0T40qJP013822 for ; Sat, 28 Jan 2006 20:00:52 -0800 Message-Id: <200601290400.k0T40qJP013822@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: f100.b64 Date: Sat, 28 Jan 2006 20:00:52 -0800 From: william@bourbon.usc.edu Someone wrote: > Can we say that base64 encoded files should have 64 char's per > line [except for the last line in the file]? As I have explained during lectures, f100.b64 is a perfectly valid input file for base64 decoding. You should think of the input file as one long line by deleting all the linebreaks. > If yes, then for f100.b64 file should we generate error message? -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Jan 28 19:59:46 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0T3xkrr028913 for ; Sat, 28 Jan 2006 19:59:46 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0T3wrKe013792 for ; Sat, 28 Jan 2006 19:58:53 -0800 Message-Id: <200601290358.k0T3wrKe013792@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Unexpected result of "diff" command. Date: Sat, 28 Jan 2006 19:58:53 -0800 From: william@bourbon.usc.edu Someone wrote: > When i decode some of the base64 encoded file, for e.g f3.b64, > and i do a diff of the sample "f3" file with the "f3.dat" that i > obtain, it says "the binary files ../../f3 and f3.dat are > different"... but when i opened these files, i checked each of > the 43 lines present manually, n i could not see even a single > different character.. no new line feeds, no training spaces, no > difference anywhere. and i spent about an hour carefully > inspecting both the files. but still diff command says the binary > files are different, it doesn't show the lines which are actually > different. I cant understand why this prob is there, i even > searched for this online, but did not find a solution. If you > could help me understand what the problem is, I would be glad. If your hexdump is working perfectly, you should do a hexdump of both files and then do a diff of the output files. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Jan 27 19:11:08 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0S3B8i9000937 for ; Fri, 27 Jan 2006 19:11:08 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0S3AJtJ006039 for ; Fri, 27 Jan 2006 19:10:19 -0800 Message-Id: <200601280310.k0S3AJtJ006039@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: should: command not found Date: Fri, 27 Jan 2006 19:10:19 -0800 From: william@bourbon.usc.edu Someone wrote: > I get this output for the decode tests that should output error > messages. > When i run the script with the 3 tests in a row, i properly > output my error message, however after each error message i get > the error message "should: command not found" on the next line. > There is no extra output or anything, but i just don't know where > this error message is coming from.... Will this be minus points? > and do u know how to get rid of this? I have no idea how you ran your scripts. Please debug! Please! You are all graduate students. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Jan 27 16:29:43 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0S0Th6I026780 for ; Fri, 27 Jan 2006 16:29:43 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0S0SsYO005480 for ; Fri, 27 Jan 2006 16:28:54 -0800 Message-Id: <200601280028.k0S0SsYO005480@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: one more time about readme file Date: Fri, 27 Jan 2006 16:28:54 -0800 From: william@bourbon.usc.edu Someone wrote: > Sorry to disturb you at the last moment, but I just don't want to loose > points on something as annoying as a readme file :). > > I have implemented and tested the program, so that it can be compiled and > run exactly as specified. I will still summarize the commands and options in > a readme file. It is unnecessary to repeat anything from the spec. The assumption is that you have implemented your HW according to the spec. If you deviate from the spec, you can mention that in your README file. Although it may not help, but it may save time and frustration for the grader. > Now a question is, how much more information should I include there in > addition to compilation and running instructions? > > - Do I need to write anything about how base-64 works or what is a hexdump? Nope! They are part of the spec already. > - Do I have to describe exactly how I shift bits here and there, and why I > use these and those particular values for a logical AND? Nope! > - Do I need to explain why I use the buffer of this particular size, etc.? Nope! > - I put comments in the code about what each function does (briefly) and > listed all the steps as well. Should I repeat this in the readme file? Nope! > Keep my fingers crossed and hope the answers are "no" :). > Could you please advise me on how many details there should be in the readme > file as far as "design decisions" and "implementation details" are > concerned? If there isn't much design decisions made, just mention that things are fairly straight forward. If you include any public code, please do mention them. If everything is implemented correctly according to the spec and you have tried everything in the grading guidelines, you should state that in your README file. If something in the grading guidelines didn't work out, you should mention them. If some requirements are satisfied (such as buffer size), please mention them. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Jan 27 15:18:35 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0RNIZGU023751 for ; Fri, 27 Jan 2006 15:18:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0RNHk6T005225 for ; Fri, 27 Jan 2006 15:17:46 -0800 Message-Id: <200601272317.k0RNHk6T005225@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Quick question about bsubmit Date: Fri, 27 Jan 2006 15:17:46 -0800 From: william@bourbon.usc.edu Someone wrote: > Is bsubmit supposed to delete the file you submit from your directory? No! > I submitted my file and the next thing I noticed was my hw1.tar.gz file > was gone. I'm hoping that's correct and I don't have to submit again, > let me know. I have no clue what your hw1.tar.gz disappeared. You should do a "ls -lrt" and see what's in your directory. You can also submit again. (If you are submitting the same thing twice, it wouldn't matter.) If this happens again, please let me know. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Jan 27 15:15:30 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0RNFUnV023586 for ; Fri, 27 Jan 2006 15:15:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0RNEfAA005200 for ; Fri, 27 Jan 2006 15:14:41 -0800 Message-Id: <200601272314.k0RNEfAA005200@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Doubt - CS530 HW1 Date: Fri, 27 Jan 2006 15:14:41 -0800 From: william@bourbon.usc.edu Someone wrote: > In Hexdump if i give an input file which is completely empty, i.e. there > is only an EOF character. Should i print 16 dashes '--' on one line. Again, EOF is not a character. I'm not sure why you should print 16 dashes. If that was the right way to go, then for a 16 byte long file, you will also print 16 dashes after the first line. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Jan 27 15:13:27 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0RNDR9C023502 for ; Fri, 27 Jan 2006 15:13:27 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0RNCcjD005166 for ; Fri, 27 Jan 2006 15:12:38 -0800 Message-Id: <200601272312.k0RNCcjD005166@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Grading Guidelines - CS530 HW1 Date: Fri, 27 Jan 2006 15:12:38 -0800 From: william@bourbon.usc.edu Someone wrote: > In the grading guidelines while running the script for hexdump according > to the script i should not be getting any output due to the diff > command. Am I right? Yes. If diff produces no output, that means the two files are identical. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Jan 27 11:28:45 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0RJSj4g014747 for ; Fri, 27 Jan 2006 11:28:45 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0RJRuIG003187 for ; Fri, 27 Jan 2006 11:27:56 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k0RJRu8d003186 for cs530@merlot; Fri, 27 Jan 2006 11:27:56 -0800 Date: Fri, 27 Jan 2006 11:27:56 -0800 From: william@bourbon.usc.edu Message-Id: <200601271927.k0RJRu8d003186@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: reminder about HW1... Hi, Please try to submit something soon just in case you cannot get things to work exactly the way you want near the deadline. Please remember that you can submit multiple times, and by default we will grade the last on-time submission. When it gets close to the deadline, you may make mistakes and miss the deadline. The penalty for missing the deadline is *very severe* and non-negotiable. Please submit on-time! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Jan 27 10:49:56 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0RInut5013194 for ; Fri, 27 Jan 2006 10:49:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0RIn8X6002462 for ; Fri, 27 Jan 2006 10:49:08 -0800 Message-Id: <200601271849.k0RIn8X6002462@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Schedule page: suggestion Date: Fri, 27 Jan 2006 10:49:08 -0800 From: william@bourbon.usc.edu Someone wrote: > It would be a great help if we have one web page that will have > the table which includes the following: > > date lecture-topic Reading from Book Reading from Paper > -------------------------------------------------------------------------- > 01/23/2006 cryptography Bishop, Chapters 9 and 11 > > This will help us to know what to read (from book and paper) > before coming to lecture (in my case before watching the lecture > remotely). This class doesn't follow the textbook and the papers exactly (or even mostly). So, I wouldn't want to give the wrong impression that I do. The main purpose of the textbook is to give general background information on topics that are not covered and to give detailed information on topics that are covered partially and suggests further readings. I would like to avoid getting complaints such as "I've spent a lot of time reading the textbook and you only talked about some of it." Also, I may change some of the topics covered. Please check out the tentative slides and look up related topics in the textbook. Sorry that this may not be exactly what you would like, but I think this is the best way for all. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Jan 27 09:56:54 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0RHusoN011192 for ; Fri, 27 Jan 2006 09:56:54 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0RHu5No002040 for ; Fri, 27 Jan 2006 09:56:05 -0800 Message-Id: <200601271756.k0RHu5No002040@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Few questions regarding HW1 Date: Fri, 27 Jan 2006 09:56:05 -0800 From: william@bourbon.usc.edu Someone wrote: > I have few questions.... > > 1. For seperate compilation I have broken my code into 4 C files. > There are no header files. Is that fine? It is fine as far as grading is concerned (you will not lose any points). But you really need to learn how to do it. By the time you get your next job (or your next summer internship), you should know how to do it; otherwise, it's pretty embarassing. > 2. For linking the *.o files I have used "gcc" instead of "ld" > since it was giving me errors. Is that fine? Of course! As far as grading goes, it doesn't really matter how you get your code to compile as long as it compiles. > 3. What all dat is supposed to be removed by "make clean". I > remove *.dat, *.b64, *.hex, *.o and executable hw1. Basically all > that remains after make clean are C source file, Makefile and > Readme. Is that fine? The requirement says: all binary files created during compilation (.o files and executable files) must be removed Since you do not generate any .dat, .b64, and .hex files *during compilation*, "make clean" should not delete them. Please do *not* include any .dat, .b64, and .hex files in your submission. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Jan 26 23:28:44 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0R7SiHh016745 for ; Thu, 26 Jan 2006 23:28:44 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0R7RvMl026556 for ; Thu, 26 Jan 2006 23:27:57 -0800 Message-Id: <200601270727.k0R7RvMl026556@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Regarding HW1 Date: Thu, 26 Jan 2006 23:27:57 -0800 From: william@bourbon.usc.edu Someone wrote: > I am reading the file in binary mode but it does not read ÿ , > because of which the output does not match. > So I request you to please guide me in this. I've been offering to help ever since the first week of class. You should have come to see me during office hours may be a week or two ago! Now it's a bit late for questions like this. My guess is that you are doing exactly what the spec says not to do: String I/O functions such as fgets(), scanf(), and printf() are really meant for inputing/outputing strings. Do *not* use them to input/output binary data! You definitely need to find out how to do it properly because HW2 and HW3 all depends on you to read binary data correctly (and I do not give out "solution" to programming assignments). -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Jan 26 23:21:40 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0R7LeNO016406 for ; Thu, 26 Jan 2006 23:21:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0R7KsG4026467 for ; Thu, 26 Jan 2006 23:20:54 -0800 Message-Id: <200601270720.k0R7KsG4026467@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: C++ compilation Date: Thu, 26 Jan 2006 23:20:54 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm using c++ standard library classes such as std::string and > std::map for storing data. I'm able to compile and link using g++ > on nunki without any issues. I'm wondering if your default setup > (the one you will use for grading) will point to g++ (PATH > variable) and std classes (LD_LIBRARY_PATH)? I can also include > the details of PATH and LD_LIBRARY_PATH information on the readme > file, but I'll not be able to test your setup. Please advice. I don't recall ever having a problem compiling with g++ from the grading account. It wouldn't hurt to inclue those information in the README file, especially if you have something non-standard. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Jan 26 19:43:45 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0R3hj9l008156 for ; Thu, 26 Jan 2006 19:43:45 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0R3gx7C025513 for ; Thu, 26 Jan 2006 19:42:59 -0800 Message-Id: <200601270342.k0R3gx7C025513@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Reagarding the Hw1 Date: Thu, 26 Jan 2006 19:42:59 -0800 From: william@bourbon.usc.edu Someone wrote: > I have a difficulty regarding the Base 64 encoding.The problem is > my code works well when the file contains characters such as in > file f6 but in other files ,somewhere the output matches but in > between it deviates from the required answer. f6 is an ASCII file. I'm guessing that you are not reading data files as if they were binary files. You *must* pretend that they are all binary files when doing encoding. If your hexdump is working correctly, you can do a dump of the file you are having trouble with. Start with something small such as f2. The big trick to get your code to work is to: 1) know exactly what you should expect, this comes from knowing exactly what your code is suppose to do, you can work out the solution manually 2) then get into the debugger and make sure you code is doing everything you are expecting *at every step* -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Jan 26 16:23:36 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0R0NaeB000456 for ; Thu, 26 Jan 2006 16:23:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0R0MpQ7024643 for ; Thu, 26 Jan 2006 16:22:51 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k0R0MpSw024642 for cs530@merlot.usc.edu; Thu, 26 Jan 2006 16:22:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0R0Mo63024639 for ; Thu, 26 Jan 2006 16:22:50 -0800 Message-Id: <200601270022.k0R0Mo63024639@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: doubt in base64 enc-dec Date: Thu, 26 Jan 2006 16:22:50 -0800 From: william@bourbon.usc.edu Someone wrote: > I know this is kind of late, as the submission is tomorrow, but i > just figured out this logical mistake in my coding. and now i am > a little confused as to how to actually handle this. here is the > doubt - > > In base64 encoding, if the last group of input characters only > has 2 chars, instead of 3, this => 16bits. > > lets say the bits are - 0 1 0 0 0 0 0 1 0 1 0 0 0 0 1 0 > then the encoder will form 2 groups of 6 bits each => group1 ( 0 > 1 0 0 0 0) & ( 0 1 0 1 0 0) with the last 4 bits remainig ( 0 0 > 1 0) > now my doubt is what do we do about these?? the base64 link says > that we pad zeros to the input, so this means the remaining bits > become ( 0 0 1 0 0 0) and the 4th char which could not be formed > due to lack of bits would be all zeros ( 0 0 0 0 0 0). > So the final 4 sets of 6-bits i get are as follows: > (0 1 0 0 0 0) (0 1 0 1 0 0) (0 0 1 0 0 0) & (0 0 0 0 0 0) > But now, according to the base64 encoding table, the > corresponding values are 16, 20, 8 and 0 So far so good! > which => the output will be T P H A > am i correct in understanding this encoding?? or am i horribly > wrong? I have no idea how you got "T P H A". 16, 20, 8, and 0 should map to "Q U I A". How did you get "T P H A"? > so if what i wrote is supposed to happen, then when do i > put the '=' sign in the output??? i am all confused about this. Well, since there were only 2 real characters and you added a zero character, then you need to tell whoever that will decode the file that there were only 2 real characters in the input. If you don't write it in the output file that there were only 2 real characters in the input and wrote out "QUIA", then the decoder will have no choice but to conclude that the original input was "414200" (in hexstring representation) as oppose to "4142". The way to tell the decoder that there were only 2 real characters in the input is to output "QUI=". This way, the decoder will only keep 2 bytes after decoding. > Similarly, if i'm decoding the base64 file, when i encounter the > last group of 4 bytes, and i get a '=' sign, do i just put a > space in the output? Clearly, "a space" would be incorrect. Please see my comment above. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Jan 26 14:15:29 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0QMFTUA027918 for ; Thu, 26 Jan 2006 14:15:29 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0QMEhxe024078 for ; Thu, 26 Jan 2006 14:14:43 -0800 Message-Id: <200601262214.k0QMEhxe024078@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: how to use the grading scripts Date: Thu, 26 Jan 2006 14:14:43 -0800 From: william@bourbon.usc.edu Someone wrote: > I didn't see it mentioned anywhere in the spec or the grading outline, > so I figured I'd ask. Say you run hw1 with a command like "hw1 hexdump > test.txt wiaoafladj" where text.txt is a valid file and the rest is just > junk, should the program still run on test.txt? Or should that be called > an error? According to the spec, this would be an error. But we are not testing for this error (although it can be easily added to the "Bad commandline" section of the grading guidelines). > Also, single quotes at the UNIX prompt output an error of > "unmatched '." I'm assuming we don't have to handle that, since it's > handled by UNIX, Correct. > but I just wanted to clarify since the grading outline > said the graders are going to smash the keyboard to break our code. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Jan 26 13:33:11 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0QLXBDn026164 for ; Thu, 26 Jan 2006 13:33:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0QLWQcG023792 for ; Thu, 26 Jan 2006 13:32:26 -0800 Message-Id: <200601262132.k0QLWQcG023792@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: how to use the grading scripts Date: Thu, 26 Jan 2006 13:32:26 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm not too familiar with how to use the scripts on the "grading guidelines" > "set srcdir=~csci530/public/hw1 > > # > # for the following commands, each correct answer gets 1 point > # > /bin/rm -f f?.hex > foreach f (0 1 2 3 4 5 6 7 8 9) > echo "===> $srcdir/f$f" > ./hw1 hexdump $srcdir/f$f > f$f.hex > diff $srcdir/f$f.hex f$f.hex > end > " > > Do I type these commands directly into the commandline? or into a file? Either way is fine. You can cut and paste from the commandline. When you put it in a file, you should add the following as the first line of the file: #!/bin/csh You have to make it executable by doing something like "chmod 755 FILE" where FILE is the name of the file. Then you can execute it directly. > Also is the csh/tcsh just the normal shell? > aludra.usc.edu(##): I don't know what the normal shell is. If you type "alias" in the commandline line, if you see something like: cp (cp -i) mv (mv -i) rm (rm -i) then your shell is /bin/csh or /bin/tcsh (you can do "echo $SHELL" to see which one you are actually running). If the output of the "alias" command is empty or looks something like: alias cp='cp -i' alias mv='mv -i' alias rm='rm -i' then you are probably running /bin/bash as your shell. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Jan 25 16:55:49 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0Q0tn80010635 for ; Wed, 25 Jan 2006 16:55:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0Q0t7gK018315 for ; Wed, 25 Jan 2006 16:55:07 -0800 Message-Id: <200601260055.k0Q0t7gK018315@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: [CSCI530] No Match Date: Wed, 25 Jan 2006 16:55:07 -0800 From: william@bourbon.usc.edu Someone wrote: > I spoke to you after class about seeing "No Match" when running > the test scripts. I have all the scripts in one file and I run > them consecutively. It turns out that the "No Match" output is > not displayed if I edit the final script by commenting out the rm > statement: > > (D) Base64 Encode and then Decode using student program: +10 points > set srcdir=~csci530/public/hw1 > > # > # for the following commands, each correct answer gets 1 point > # > #/bin/rm -f f?.dat removed to eliminate "No Match" > foreach f (0 1 2 3 4 5 6 7 8 9) > echo "===> $srcdir/f$f" > ./hw1 enc-base64 $srcdir/f$f | ./hw1 dec-base64 > f$f.dat > diff $srcdir/f$f f$f.dat > end > > I dont know if others were seeing the same "No Match" message. The tests right before group (D) of tests produce *.dat files. So, the /bin/rm there simply get rid of those files. If you have manually removed those files already or didn't run everything in the exact sequence, then the script may not find any *.dat file. Anyway, this should not cause any problem. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Jan 24 15:00:11 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0ON0BMw012580 for ; Tue, 24 Jan 2006 15:00:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0OMxXP3012355 for ; Tue, 24 Jan 2006 14:59:33 -0800 Message-Id: <200601242259.k0OMxXP3012355@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: [CSCI530] +D Date: Tue, 24 Jan 2006 14:59:33 -0800 From: william@bourbon.usc.edu Someone wrote: > I went to your office around 1 pm today, and I guess I missed you. During the first class, I mentioned that SAL 342 is not my office; I share it with other 4 part-time instructors. I do not have a regular office at USC. If you would like to see me outside of my office hours, please make an appointment. > The followings are the questions I wanted to ask during > your office hour: > > Somehow my program reads in +D has "0xFF" character instead > of "0x04", and I have been running my program on nunki.usc.edu > machine. You are probably not doing the right thing. d from the terminal does not generate a character. It generates an EOF condition. My guess is that you are not checking the return code of the function you are using to read input. > Moreover, hexdump() for binary file prints the correct hex > values, but it does not print out "." and "~" correctly many > times even though I believe that I have followed the project > description. (ie. If the data byte is <=0x1f or equals to 0x7f, > you should print a period character. If the data byte is >=0x80 > you should print a ~ character. ) > My belief is that this might be happening since my program > doesn't read +D as "0x04" char. > Do you happen to know why this is happening? I think you should first trying what's in the grading guidelines and not read from the keyboard because it may be confusing. Most of the test cases in the grading guidelins pipes an input file to your stdin. Then you won't wondering about d. I'm not sure what you meant by "not print out period and tilde". If you know how to print 'a' or '5', you should be able to use the same code to print '.' and '~'. May be you should visit the TA or myself during our office hours or make an appointment to see one of us. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Jan 24 13:36:30 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0OLaUuI009416 for ; Tue, 24 Jan 2006 13:36:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0OLZqNv012050 for ; Tue, 24 Jan 2006 13:35:52 -0800 Message-Id: <200601242135.k0OLZqNv012050@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: script not giving output.. Date: Tue, 24 Jan 2006 13:35:52 -0800 From: william@bourbon.usc.edu Someone wrote: > I have doubts in hw1. So, i came to sal 342 during the office > hours. But the door was locked. As I've mentioned during the first lecture, I only promise to be in SAL 342 during the first 30 minutes of my office hours. If no one is waiting to see me 30 minutes into the office hour, I leave. If you plan to see me during the 2nd half of the office hour, please make an appointment so I know exactly when you are planning to be there. > My doubt is: Iam not able to run the grading guidelines script. > my program is not generating output. > Iam referring to section A of guidelines: > > set srcdir=~csci530/public/hw1 > /bin/rm -f f?.hex > foreach f (0 1 2 3 4 5 6 7 8 9) > echo "===> $srcdir/f$f" > ./hw1 hexdump $srcdir/f$f > f$f.hex > diff $srcdir/f$f.hex f$f.hex > end > > But Instead, when i copied the f0, f1, f2 ...f9 files from > srcdirectory into my folder & used > "hw1 hexdump f0 > f0.hex" for all the 9 files, i got correct > output that matched with openssl output. > Am i doing anything wrong in running the script. I just copied & > pasted the script at the cmd prompt. Are you using bash as your shell? Please see the top of the grading guidelines file. Item 4 says: The scripts below are for csh/tcsh. If you use bash, please modify them where necessary. Or, you can do "tcsh" and then run the scripts. If this is not the problem, please run a transcript of your session and send me the transcript. To generate a transcript, please use the "script" command. For example, you can do: script /tmp/YOURNAME.script set srcdir=~csci530/public/hw1 /bin/rm -f f?.hex foreach f (0 1 2 3 4 5 6 7 8 9) echo "===> $srcdir/f$f" ./hw1 hexdump $srcdir/f$f > f$f.hex diff $srcdir/f$f.hex f$f.hex end exit Then e-mail /tmp/YOURNAME.script to me so I can look at exactly what you were looking at. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Jan 23 19:24:56 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0O3OulZ032036 for ; Mon, 23 Jan 2006 19:24:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0O3OLCx006625 for ; Mon, 23 Jan 2006 19:24:21 -0800 Message-Id: <200601240324.k0O3OLCx006625@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: one more clarification regarding output Date: Mon, 23 Jan 2006 19:24:21 -0800 From: william@bourbon.usc.edu Someone wrote: > Is it OK, if in addition to main output and/or error messages I output > additional messages to stdlog (for instance, something like "Reading data > from standard input. Please, type Ctrl+D when done", etc.)? > It does not affect my output (since it doesn't go to stdout), so diff does > not show any differences between my output and correct solution. But these > additional messages may confuse the grader. Would you suggest removing them? Well, I would argue that, for a non-interactive program such as hw1, it is an incorrect behavior to generate a message such as "... type Ctrl+D when done" since data can come from a pipe. So, it would be a good idea to remove them. (I'm not familiar with stdlog. If that goes into a file that is not visible to the grader, then it wouldn't be a problem. But if the grading account does not have the right setup and the data will not go into a log file, then it would be a problem.) -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Monday, January 23, 2006 2:24 PM Subject: Re: Shell script > Someone wrote: > > > I am running the following shell script but I am getting > > the error :- Syntax error at line 3: '(' unexpected. I could > > not understand the reason. Could you suggest anything that I am > > writing wrongly. > > > > set srcdir=~csci530/public/hw1 > > /bin/rm -f f?.hex > > foreach f (0 1 2 3 4 5 6 7 8 9) > > echo "===> $srcdir/f$f" > > ./hw1 hexdump $srcdir/f$f > f$f.hex > > diff $srcdir/f$f.hex f$f.hex > > end > > Is bash your shell? If that's the case, please try "csh" or > "tcsh" first and then run these commands under csh/tcsh. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Jan 23 14:24:38 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0NMObQl020525 for ; Mon, 23 Jan 2006 14:24:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0NMO3tf004161 for ; Mon, 23 Jan 2006 14:24:03 -0800 Message-Id: <200601232224.k0NMO3tf004161@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Shell script Date: Mon, 23 Jan 2006 14:24:03 -0800 From: william@bourbon.usc.edu Someone wrote: > I am running the following shell script but I am getting > the error :- Syntax error at line 3: '(' unexpected. I could > not understand the reason. Could you suggest anything that I am > writing wrongly. > > set srcdir=~csci530/public/hw1 > /bin/rm -f f?.hex > foreach f (0 1 2 3 4 5 6 7 8 9) > echo "===> $srcdir/f$f" > ./hw1 hexdump $srcdir/f$f > f$f.hex > diff $srcdir/f$f.hex f$f.hex > end Is bash your shell? If that's the case, please try "csh" or "tcsh" first and then run these commands under csh/tcsh. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Jan 23 12:11:00 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0NKB0ZJ015136 for ; Mon, 23 Jan 2006 12:11:00 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0NKAPLm014095 for ; Mon, 23 Jan 2006 12:10:25 -0800 Message-Id: <200601232010.k0NKAPLm014095@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: HW1 question Date: Mon, 23 Jan 2006 12:10:25 -0800 From: william@bourbon.usc.edu Someone wrote: > I would like to ask couple of questions regarding HW1. > > 1. If the user enters ./hw1 hexdump on the commandline (shell) > what should happen? Should the program wait for user to signal > end of input? If you are reading input from the commandline, the user can enter d to signal the end of input. Please note that this does not generate a d or 0x04 character, but only set the end-of-input condition. Reading input from the commandline can be confusing when you are output characters to stdout or stderr. Most of the tests in the grading guidelines where an input file is not specified uses a pipe to send data through stdin. This is the normal mode of operation. Your code should do pretty much the same thing whether the input comes from stdin or a file! > 2. Is the programmer is allowed to come up with good error > messages? For example, if the user enters ./hw1 hexmap > , the program displays a error message and a usage: > message? Yes! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Jan 23 09:57:36 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0NHvaSO009381 for ; Mon, 23 Jan 2006 09:57:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0NHv1uK013126 for ; Mon, 23 Jan 2006 09:57:01 -0800 Message-Id: <200601231757.k0NHv1uK013126@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Hw1 inquiry Date: Mon, 23 Jan 2006 09:57:01 -0800 From: william@bourbon.usc.edu Someone wrote: | > Everything sounds good so far. I kept thinking that I might | > have missed something or there is some misunderstanding. If | > you see exactly where the misunderstanding is, please let me | > know. Thanks! | | Well, all misunderstanding was whether to output partially correct data, or | not to output at all. The spec was not specific enough about that, but now | it seems clear. Thank you. | | Now, regarding lost characters and alignment problems, I still have doubts. | My program reads file in lines of 64 characters. Let's say the last line of | encoded data contains 13 characters. | Should I decode 12 of them and THEN report an error? Hmm... I'm not sure exactly how you are reading your input file. Normally, I would think that you don't know that it's the end of input until you try to read *beyond* the last line. So, when you read 13 characters in a line, you should process the first 12. Then you have one left over and you would try the read the next 3 (or next line) and finds that there is no more data to read. Then you would report an error. (The file f100.b64 is an example where many input lines are short.) | Or I can stop right at the beginning of this line, report an error and | output nothing of this line? This second option is what my program does so | far, and it contradicts your quote: | > Every time you read 4 bytes of good input data, you should output 3 bytes | > of output data. | | Should I change my program? (It is just a question of buffer size) Well, there is no need to change your program if your program gets all 50 points according to the grading guidelines. | And one more question - about unusual case. Let's say the last characters of | input are: "aZ=". There are only 3, so one was lost, but we could assume | that it was a padding a try to decode "aZ". Should our program do such | recovery, or not? Since this is a security class, it would be better not to do recovery! -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Sunday, January 22, 2006 8:36 PM Subject: Re: Hw1 inquiry > > Someone wrote: > > > The "Grading Guidelines for HW1" state: > > > > ./hw1 dec-base64 $srcdir/f200.b64 > > > > and > > > > ./hw1 dec-base64 $srcdir/f201.b64 > > > > should not generate anything but error messages. This contradicts > statement > > 1 in your email. > > Could you elaborate this a bit? The first 4 characters in > f200.b64 and f201.b64 are not all valid base64 characters > (unless I missed something). > > > Granted, the spec should overrule the grading guidelines, > > Actually, they should be consistent with respect to each > other. If they are inconsistent, please let me know as early > as possible. > > > but the spec did not give guidance with respect to error output when > the > > error originates with the data file content. Furthermore, the grading > > guidelines for the above commands refer to "error messages" (plural), > so I > > felt it was okay (even desirable) to print multiple error messages > [your > > phrasing of statement 3 makes it sound optional, so I assume I won't > have to > > change this]. > > The spec specifies what's correct and cannot specify all > possible error conditions. As good programmers, you should > generate good error messages. (I use the word "messages" > here as in the grading guidelines. But it does not have to > be plural. I try not to always do things like "message(s)".) > > > I spent a fair amount of time recoding my program to meet the grading > > guidelines document (my original code did output without lookahead > through > > the read-in buffer). I would rather not have to recode yet again to > meet > > what I feel are rules that lie outside the specifications. But, of > course, > > I will defer to your decision. Is your statement 1 now part of the > spec? > > As I've mentioned before, we will grade by following the > grading guidelines. Therefore, the grading guidelines is > what you should go by. I also mentioned that if you see bugs > in the grading guidelines, you should let me know ASAP! If > the grading guidelines turns out to be buggy, we may have to > go along with the spec. > > As this point, I still don't see the inconsistency between > the grading guidelines and the spec. Please let me know what > the inconsistency is. > -- > Bill Cheng // bill.cheng@usc.edu > > > > > On 1/22/06, william@bourbon.usc.edu wrote: > > > > Someone wrote: > > > > > In base64 decoding if the input is not a properly encoded file > > > then should we generate nothing at all , or should we generate > > > just anything that can be decoded (actually garbage) or should we > > > generate only error messages saying that input is malformed. > > > > I would like to make the following points regarding this: > > > > 1) You should always generate output as soon as you have valid > > input. Therefore, you must not parse through the whole > > input file first to check for error and then only generate > > output if input has no error. > > > > 2) Data output should always go to stdout and error messages > > should always go to stderr. > > > > 3) You can stop generating output as soon as you detect the > > first error and output error message in stderr. > > > > > What do we have to write in the read me file. > > > > If your "make" procedure is slightly different from the > > standard one you should write this up near the top of the > > README file. The main reason is that some people might > > use gmake or imake and that's fine. > > > > If you use any public source code, you should summarize > > it in your README file. > > > > If you have made some design choices, you should also > > document it in your README file. > > > > Anything else you would like the grader to be aware of. > > > > If you do anything that deviates from the spec, explaining > > why you did it in your README file will not help your grade > > since you must follow the spec. > > -- > > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Jan 22 21:24:34 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0N5OYAG012811 for ; Sun, 22 Jan 2006 21:24:34 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0N5O11Y010854 for ; Sun, 22 Jan 2006 21:24:01 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k0N5O1X4010853 for cs530@merlot.usc.edu; Sun, 22 Jan 2006 21:24:01 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0N5O1rf010850 for ; Sun, 22 Jan 2006 21:24:01 -0800 Message-Id: <200601230524.k0N5O1rf010850@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Hw1 inquiry Date: Sun, 22 Jan 2006 21:24:01 -0800 From: william@bourbon.usc.edu Someone wrote: > At some point, this discussion between you and someone of my classmates > confused me completely. > > 1) Let's say we had a valid base64 encoded data file. Then, say, we lost one > last character from it, so it is no longer valid, but the error is at the > very end. > Right now my program will output decoded data from such an input file up to > the last line, where it discovers that the line size is not a multiple of 4, > and reports an error. It will not decode anything from the last line. I think everything is still consistent (again, unless I've missed something). Every time you read 4 bytes of good input data, you should output 3 bytes of output data. So, what you said above sounds correct to me. > 2) If an invalid character is in the middle of the file, I am also not quite > sure at what point we should stop outputting decoded data. Since we are > reading characters in batches of 4, my program won't decode any characters > in such a batch (and terminate) if at least one of 4 is corrupt. Sounds right to me. > I am sorry, but I cannot figure out by myself if such behavior is in > accordance with the spec and/or the grading guidelines. Could you be so kind > to clarify this? Everything sounds good so far. I kept thinking that I might have missed something or there is some misunderstanding. If you see exactly where the misunderstanding is, please let me know. Thanks! -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Sunday, January 22, 2006 8:36 PM Subject: Re: Hw1 inquiry > Someone wrote: > > > The "Grading Guidelines for HW1" state: > > > > ./hw1 dec-base64 $srcdir/f200.b64 > > > > and > > > > ./hw1 dec-base64 $srcdir/f201.b64 > > > > should not generate anything but error messages. This contradicts > statement > > 1 in your email. > > Could you elaborate this a bit? The first 4 characters in > f200.b64 and f201.b64 are not all valid base64 characters > (unless I missed something). > > > Granted, the spec should overrule the grading guidelines, > > Actually, they should be consistent with respect to each > other. If they are inconsistent, please let me know as early > as possible. > > > but the spec did not give guidance with respect to error output when > the > > error originates with the data file content. Furthermore, the grading > > guidelines for the above commands refer to "error messages" (plural), > so I > > felt it was okay (even desirable) to print multiple error messages > [your > > phrasing of statement 3 makes it sound optional, so I assume I won't > have to > > change this]. > > The spec specifies what's correct and cannot specify all > possible error conditions. As good programmers, you should > generate good error messages. (I use the word "messages" > here as in the grading guidelines. But it does not have to > be plural. I try not to always do things like "message(s)".) > > > I spent a fair amount of time recoding my program to meet the grading > > guidelines document (my original code did output without lookahead > through > > the read-in buffer). I would rather not have to recode yet again to > meet > > what I feel are rules that lie outside the specifications. But, of > course, > > I will defer to your decision. Is your statement 1 now part of the > spec? > > As I've mentioned before, we will grade by following the > grading guidelines. Therefore, the grading guidelines is > what you should go by. I also mentioned that if you see bugs > in the grading guidelines, you should let me know ASAP! If > the grading guidelines turns out to be buggy, we may have to > go along with the spec. > > As this point, I still don't see the inconsistency between > the grading guidelines and the spec. Please let me know what > the inconsistency is. > -- > Bill Cheng // bill.cheng@usc.edu > > > > > On 1/22/06, william@bourbon.usc.edu wrote: > > > > Someone wrote: > > > > > In base64 decoding if the input is not a properly encoded file > > > then should we generate nothing at all , or should we generate > > > just anything that can be decoded (actually garbage) or should we > > > generate only error messages saying that input is malformed. > > > > I would like to make the following points regarding this: > > > > 1) You should always generate output as soon as you have valid > > input. Therefore, you must not parse through the whole > > input file first to check for error and then only generate > > output if input has no error. > > > > 2) Data output should always go to stdout and error messages > > should always go to stderr. > > > > 3) You can stop generating output as soon as you detect the > > first error and output error message in stderr. > > > > > What do we have to write in the read me file. > > > > If your "make" procedure is slightly different from the > > standard one you should write this up near the top of the > > README file. The main reason is that some people might > > use gmake or imake and that's fine. > > > > If you use any public source code, you should summarize > > it in your README file. > > > > If you have made some design choices, you should also > > document it in your README file. > > > > Anything else you would like the grader to be aware of. > > > > If you do anything that deviates from the spec, explaining > > why you did it in your README file will not help your grade > > since you must follow the spec. > > -- > > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Jan 22 20:52:45 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0N4qinM011602 for ; Sun, 22 Jan 2006 20:52:45 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0N4qCtM010625 for ; Sun, 22 Jan 2006 20:52:12 -0800 Message-Id: <200601230452.k0N4qCtM010625@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Hw1 inquiry Date: Sun, 22 Jan 2006 20:52:12 -0800 From: william@bourbon.usc.edu Someone wrote: > You're right. Originally, I was dumping errors to the screen as well as > processed bytes because I didn't exit the program with the first error. If > I had exited the program after the first error, then nothing would have been > dumped to the screen. With my updated program, I continue reading through > the file after encountering errors but only dump the errors. There is really no need to process the rest of the buffer when you encounter the first error. It is a better security practice to stop processing as soon as you see the first error! (If this is a compiler project, then it would be different; more error messages the better.) > However, if there were valid characters in the first part of the file but > bad characters later, my current program will just dump error messages > whereas the original incarnation of my program would have dumped both. > > Sorry for the confusion. No problem at all! -- Bill Cheng // bill.cheng@usc.edu On 1/22/06, william@bourbon.usc.edu wrote: > > Someone wrote: > > > The "Grading Guidelines for HW1" state: > > > > ./hw1 dec-base64 $srcdir/f200.b64 > > > > and > > > > ./hw1 dec-base64 $srcdir/f201.b64 > > > > should not generate anything but error messages. This contradicts > statement > > 1 in your email. > > Could you elaborate this a bit? The first 4 characters in > f200.b64 and f201.b64 are not all valid base64 characters > (unless I missed something). > > > Granted, the spec should overrule the grading guidelines, > > Actually, they should be consistent with respect to each > other. If they are inconsistent, please let me know as early > as possible. > > > but the spec did not give guidance with respect to error output when > the > > error originates with the data file content. Furthermore, the grading > > guidelines for the above commands refer to "error messages" (plural), > so I > > felt it was okay (even desirable) to print multiple error messages > [your > > phrasing of statement 3 makes it sound optional, so I assume I won't > have to > > change this]. > > The spec specifies what's correct and cannot specify all > possible error conditions. As good programmers, you should > generate good error messages. (I use the word "messages" > here as in the grading guidelines. But it does not have to > be plural. I try not to always do things like "message(s)".) > > > I spent a fair amount of time recoding my program to meet the grading > > guidelines document (my original code did output without lookahead > through > > the read-in buffer). I would rather not have to recode yet again to > meet > > what I feel are rules that lie outside the specifications. But, of > course, > > I will defer to your decision. Is your statement 1 now part of the > spec? > > As I've mentioned before, we will grade by following the > grading guidelines. Therefore, the grading guidelines is > what you should go by. I also mentioned that if you see bugs > in the grading guidelines, you should let me know ASAP! If > the grading guidelines turns out to be buggy, we may have to > go along with the spec. > > As this point, I still don't see the inconsistency between > the grading guidelines and the spec. Please let me know what > the inconsistency is. > -- > Bill Cheng // bill.cheng@usc.edu > > > > > On 1/22/06, william@bourbon.usc.edu wrote: > > > > Someone wrote: > > > > > In base64 decoding if the input is not a properly encoded file > > > then should we generate nothing at all , or should we generate > > > just anything that can be decoded (actually garbage) or should we > > > generate only error messages saying that input is malformed. > > > > I would like to make the following points regarding this: > > > > 1) You should always generate output as soon as you have valid > > input. Therefore, you must not parse through the whole > > input file first to check for error and then only generate > > output if input has no error. > > > > 2) Data output should always go to stdout and error messages > > should always go to stderr. > > > > 3) You can stop generating output as soon as you detect the > > first error and output error message in stderr. > > > > > What do we have to write in the read me file. > > > > If your "make" procedure is slightly different from the > > standard one you should write this up near the top of the > > README file. The main reason is that some people might > > use gmake or imake and that's fine. > > > > If you use any public source code, you should summarize > > it in your README file. > > > > If you have made some design choices, you should also > > document it in your README file. > > > > Anything else you would like the grader to be aware of. > > > > If you do anything that deviates from the spec, explaining > > why you did it in your README file will not help your grade > > since you must follow the spec. > > -- > > Bill Cheng // bill.cheng@usc.edu http://merlot.usc.edu/william/usc/> Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Jan 22 20:49:18 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0N4nIX2011434 for ; Sun, 22 Jan 2006 20:49:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0N4mjnw010581 for ; Sun, 22 Jan 2006 20:48:45 -0800 Message-Id: <200601230448.k0N4mjnw010581@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Fwd: Hw1 inquiry Date: Sun, 22 Jan 2006 20:48:45 -0800 From: william@bourbon.usc.edu Someone wrote: > One more thing I forgot to add. The specification *does* say we should > compare our results against > > openssl enc -d -base64 -in file That's mainly for good data. The end of the next paragraph right after the above reference says: Pleaes output reasonable and useful error messages if the command is malformed or file does not exist or inaccessible. (You should do better than openssl.) > and when I run > > openssl enc -d -base64 -in ~csci530/public/hw1/f200.b64 > > openssl enc -d -base64 -in ~csci530/public/hw1/f201.b64 > > there is no output presented. That is, openssl does not dump part of the > file. Instead, it detects an error and stops processing without performing > a partial dump. My code dumps error messages but no bytes from a buffer > containing errors. Since the first 4 bytes of both these files are bad, there is no need to produce any output (unless I'm missing something). Openssl does not produce an error message and that's bad. We should do better. > Incidentally, I don't do a look-ahead parsing of the file or even the buffer > that was read in to first determine if errors are present. What I do is > store the decoded bytes in a container as I process them and only dump the > contents of the container after I've finished processing the buffer without > encountering any errors. If I do encounter an error, I clear the container > and print an error message to the stdout I guess I still need something more concrete in order to comment on this. -- Bill Cheng // bill.cheng@usc.edu On 1/22/06, william@bourbon.usc.edu < william@bourbon.usc.edu> wrote: > > Someone wrote: > > > In base64 decoding if the input is not a properly encoded file > > then should we generate nothing at all , or should we generate > > just anything that can be decoded (actually garbage) or should we > > generate only error messages saying that input is malformed. > > I would like to make the following points regarding this: > > 1) You should always generate output as soon as you have valid > input. Therefore, you must not parse through the whole > input file first to check for error and then only generate > output if input has no error. > > 2) Data output should always go to stdout and error messages > should always go to stderr. > > 3) You can stop generating output as soon as you detect the > first error and output error message in stderr. > > > What do we have to write in the read me file. > > If your "make" procedure is slightly different from the > standard one you should write this up near the top of the > README file. The main reason is that some people might > use gmake or imake and that's fine. > > If you use any public source code, you should summarize > it in your README file. > > If you have made some design choices, you should also > document it in your README file. > > Anything else you would like the grader to be aware of. > > If you do anything that deviates from the spec, explaining > why you did it in your README file will not help your grade > since you must follow the spec. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Jan 22 20:36:34 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0N4aY2H010930 for ; Sun, 22 Jan 2006 20:36:34 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0N4a2Vn010500 for ; Sun, 22 Jan 2006 20:36:02 -0800 Message-Id: <200601230436.k0N4a2Vn010500@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Hw1 inquiry Date: Sun, 22 Jan 2006 20:36:02 -0800 From: william@bourbon.usc.edu Someone wrote: > The "Grading Guidelines for HW1" state: > > ./hw1 dec-base64 $srcdir/f200.b64 > > and > > ./hw1 dec-base64 $srcdir/f201.b64 > > should not generate anything but error messages. This contradicts statement > 1 in your email. Could you elaborate this a bit? The first 4 characters in f200.b64 and f201.b64 are not all valid base64 characters (unless I missed something). > Granted, the spec should overrule the grading guidelines, Actually, they should be consistent with respect to each other. If they are inconsistent, please let me know as early as possible. > but the spec did not give guidance with respect to error output when the > error originates with the data file content. Furthermore, the grading > guidelines for the above commands refer to "error messages" (plural), so I > felt it was okay (even desirable) to print multiple error messages [your > phrasing of statement 3 makes it sound optional, so I assume I won't have to > change this]. The spec specifies what's correct and cannot specify all possible error conditions. As good programmers, you should generate good error messages. (I use the word "messages" here as in the grading guidelines. But it does not have to be plural. I try not to always do things like "message(s)".) > I spent a fair amount of time recoding my program to meet the grading > guidelines document (my original code did output without lookahead through > the read-in buffer). I would rather not have to recode yet again to meet > what I feel are rules that lie outside the specifications. But, of course, > I will defer to your decision. Is your statement 1 now part of the spec? As I've mentioned before, we will grade by following the grading guidelines. Therefore, the grading guidelines is what you should go by. I also mentioned that if you see bugs in the grading guidelines, you should let me know ASAP! If the grading guidelines turns out to be buggy, we may have to go along with the spec. As this point, I still don't see the inconsistency between the grading guidelines and the spec. Please let me know what the inconsistency is. -- Bill Cheng // bill.cheng@usc.edu On 1/22/06, william@bourbon.usc.edu wrote: > > Someone wrote: > > > In base64 decoding if the input is not a properly encoded file > > then should we generate nothing at all , or should we generate > > just anything that can be decoded (actually garbage) or should we > > generate only error messages saying that input is malformed. > > I would like to make the following points regarding this: > > 1) You should always generate output as soon as you have valid > input. Therefore, you must not parse through the whole > input file first to check for error and then only generate > output if input has no error. > > 2) Data output should always go to stdout and error messages > should always go to stderr. > > 3) You can stop generating output as soon as you detect the > first error and output error message in stderr. > > > What do we have to write in the read me file. > > If your "make" procedure is slightly different from the > standard one you should write this up near the top of the > README file. The main reason is that some people might > use gmake or imake and that's fine. > > If you use any public source code, you should summarize > it in your README file. > > If you have made some design choices, you should also > document it in your README file. > > Anything else you would like the grader to be aware of. > > If you do anything that deviates from the spec, explaining > why you did it in your README file will not help your grade > since you must follow the spec. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Jan 22 18:59:42 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0N2xgh9007258 for ; Sun, 22 Jan 2006 18:59:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0N2xA7G010194 for ; Sun, 22 Jan 2006 18:59:10 -0800 Message-Id: <200601230259.k0N2xA7G010194@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Hw1 inquiry Date: Sun, 22 Jan 2006 18:59:10 -0800 From: william@bourbon.usc.edu Someone wrote: > In base64 decoding if the input is not a properly encoded file > then should we generate nothing at all , or should we generate > just anything that can be decoded (actually garbage) or should we > generate only error messages saying that input is malformed. I would like to make the following points regarding this: 1) You should always generate output as soon as you have valid input. Therefore, you must not parse through the whole input file first to check for error and then only generate output if input has no error. 2) Data output should always go to stdout and error messages should always go to stderr. 3) You can stop generating output as soon as you detect the first error and output error message in stderr. > What do we have to write in the read me file. If your "make" procedure is slightly different from the standard one you should write this up near the top of the README file. The main reason is that some people might use gmake or imake and that's fine. If you use any public source code, you should summarize it in your README file. If you have made some design choices, you should also document it in your README file. Anything else you would like the grader to be aware of. If you do anything that deviates from the spec, explaining why you did it in your README file will not help your grade since you must follow the spec. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Jan 22 08:50:11 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0MGoBcS012291 for ; Sun, 22 Jan 2006 08:50:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0MGneNQ003023 for ; Sun, 22 Jan 2006 08:49:40 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k0MGneAm003022 for cs530@merlot; Sun, 22 Jan 2006 08:49:40 -0800 Date: Sun, 22 Jan 2006 08:49:40 -0800 From: william@bourbon.usc.edu Message-Id: <200601221649.k0MGneAm003022@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: ISD's C/C++ web page... Hi, The ISD C/C++ programming page is at: http://www.usc.edu/isd/doc/programming/c.html I've just added a link to point to it in the Additional Resources section of the class description web page at: http://merlot.usc.edu/csac-s06/description.html#resources -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Jan 21 12:39:36 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0LKdaRw008932 for ; Sat, 21 Jan 2006 12:39:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0LKd8gL010844 for ; Sat, 21 Jan 2006 12:39:08 -0800 Message-Id: <200601212039.k0LKd8gL010844@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Hw1 : linking bugs Date: Sat, 21 Jan 2006 12:39:08 -0800 From: william@bourbon.usc.edu Someone wrote: > I have broken the homework into 4 files main.c, hex.c, > encode.c and decode.c I can all of them at the same time and > get the executable hw1 and it runs fine > > gcc main.c hex.c encode.c decode.c -o hw1 > > or I can create the *.o file one by one and then compile the > *.o files to get the executable which also runs fine > > gcc -c main.c > gcc -c hex.c > gcc -c encode.c > gcc -c decode.c > gcc main.o hex.o encode.o decode.o -o hw1 > > However if I use "ld" I get symbol referencing errors. I am > not able to figure out the errors. I even googled them a lot!! > > gcc -c main.c > gcc -c hex.c > gcc -c encode.c > gcc -c decode.c > ld main.o hex.o encode.o decode.o -o hw1 > > gives error > > Undefined first referenced > symbol in file > exit main.o (symbol belongs to implicit dependency /lib/libc.so.1) > __iob main.o (symbol belongs to implicit dependency /lib/libc.so.1) > fread hex.o (symbol belongs to implicit dependency /lib/libc.so.1) > fdopen main.o (symbol belongs to implicit dependency /lib/libc.so.1) > fileno main.o (symbol belongs to implicit dependency /lib/libc.so.1) > strcmp main.o (symbol belongs to implicit dependency /lib/libc.so.1) > ld: fatal: Symbol referencing errors. No output written to hw1 I think these symbols are defined in /lib/libc.a. So, you need "-lc" when you link. > When I tried the following comand I did not get any error > during linking but the executable gave me a segmentation fault Then you should get into the debugger and see where it gives you a segmentation fault and why. > ld main.o hex.o encode.o decode.o -o hw1 -lm -lc > > Please help. I guess according to your specs we have to use > ld in makefile. The spec does not say that you have to use "ld". I think if you replace "ld" with "gcc" it would also work. If you are having trouble with all this, please come to see me during my office hours or visit the TA during his office hours. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Jan 18 20:32:09 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0J4W9Ze012829 for ; Wed, 18 Jan 2006 20:32:09 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0J4VoVN031547 for ; Wed, 18 Jan 2006 20:31:50 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k0J4VoVr031546 for cs530@merlot.usc.edu; Wed, 18 Jan 2006 20:31:50 -0800 Date: Wed, 18 Jan 2006 20:31:50 -0800 From: william@bourbon.usc.edu Message-Id: <200601190431.k0J4VoVr031546@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: office hour canceled tomorrow 1/19/2006 Hi, I won't be able to come to campus tomorrow. Therefore, I'm canceling tomorrow's office hour. If you have questions regarding HW1, please send me e-mail. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Jan 18 00:10:42 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0I8AgmC017225 for ; Wed, 18 Jan 2006 00:10:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0I8APAx023300 for ; Wed, 18 Jan 2006 00:10:25 -0800 Message-Id: <200601180810.k0I8APAx023300@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Hw1 inquiry Date: Wed, 18 Jan 2006 00:10:25 -0800 From: william@bourbon.usc.edu Someone wrote: > In case when we take the input from stdin, what should be the > output? Will it be a file ( is so , then by what name? ) > or do we have to display the output on the console. The output always go to stdout. (And error messages go to stderr.) Please note that according to the spec, there is no way to specify a output file name. You must implement according to the spec. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Jan 18 00:08:02 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0I882PJ017132 for ; Wed, 18 Jan 2006 00:08:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0I87j31023267 for ; Wed, 18 Jan 2006 00:07:45 -0800 Message-Id: <200601180807.k0I87j31023267@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Hw1 question Date: Wed, 18 Jan 2006 00:07:45 -0800 From: william@bourbon.usc.edu Someone wrote: > Im working on testing my assignment according to the submission > guidelines and im wondering about some things: > > Below is a snippet from the diff and i dont see any differences > > ===> /home/scf-22/csci530/public/hw1/f0 > 339c339 > < 001520: 00 00 00 01 00 00 00 00 -- -- -- -- -- -- -- -- ........ > --- > > 001520: 00 00 00 01 00 00 00 00 -- -- -- -- -- -- -- -- ........ > ===> /home/scf-22/csci530/public/hw1/f1 > 641c641 > < 002800: 00 00 00 00 00 00 00 01 00 00 00 00 -- -- -- -- ............ > --- > > 002800: 00 00 00 00 00 00 00 01 00 00 00 00 -- -- -- -- ............ > > I did however look at the files sizes which mine were smaller by > 1 byte, so i am guessing that there is a whitespace character at > the end of the correct file. However this is not the case for > all of the files, infact under the hexdump for the first test it > only happens with f0,f1,f2,f4, and f6. And the same thing is > happening in the second hexdump test with files f0,f1,f2 and f4. > My question is, where is the whitespace coming from? In the hexdump subsection of the commandline syntax and program output section of the spec, it says: In addition, non-existant bytes (at the end of the file) should by displayed as -- and use space characters in the right column. So, looks like you got the "--" correct but did not fill in the space characters in the right column. > My second question is on the seperate compilation in the Minus > Points section. It says if the executible is compiled with a > single line deduct all 10 points. Currently i have a Makefile > that has a target all which executes "g++ hw1.c -o hw1". is this > correct or incorrect to do, and if it is incorrect, what is > correct? You have a single source file "hw1.c" that gets directly compiled and linked into the executable "hw1". So, that's not doing separate compilation and you will lose all 10 points. One way to do separate compilation is to break up your "hw1.c" into, for example, "hexdump.h", "hexdump.c", "base64.h", "base64.c", and "hw1.c". So, "hw1.c" will have #include "hexdump.h" and #include "base64.h" so that it can use functions implemented in "hexdump.c" and "base64.c". Then you would compile "hexdump.c", "base64.c", and "hw1.c" into "hexdump.o", "base64.o", and "hw1.o" separately. Then you would have one last rule to link "hexdump.o", "base64.o", and "hw1.o" together to produce your executable "hw1". Please see the link on separate compilation or search the web to figure out exactly what you must do in the Makefile to get all this working. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Jan 17 23:39:32 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0I7dWAa015967 for ; Tue, 17 Jan 2006 23:39:32 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0I7dGN3023089 for ; Tue, 17 Jan 2006 23:39:16 -0800 Message-Id: <200601180739.k0I7dGN3023089@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: CS 530 Question Date: Tue, 17 Jan 2006 23:39:16 -0800 From: william@bourbon.usc.edu Someone wrote: > On the web page it says that the midterm will be on Wed, > 3/6/2006. However March 6th is a monday. Will the exam > be on monday the 6th or wednesday the 8th? Oops! It should be Mon, 3/6/2006. I've fixed the class web page. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Jan 16 16:58:08 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0H0w8GB009557 for ; Mon, 16 Jan 2006 16:58:08 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0H0vv53015955 for ; Mon, 16 Jan 2006 16:57:57 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k0H0vv7Y015954 for cs530@merlot.usc.edu; Mon, 16 Jan 2006 16:57:57 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0H0vuYx015951 for ; Mon, 16 Jan 2006 16:57:56 -0800 Message-Id: <200601170057.k0H0vuYx015951@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Homework submission question Date: Mon, 16 Jan 2006 16:57:56 -0800 From: william@bourbon.usc.edu Someone wrote: > I submitted my homework on Sunday around noon (the program works on the > "yesterday" file, but I will do more thorough testing this week), but I did > not receive an email response following the submission. Well, you are not suppose to! > I submitted using the commands: > > ~csci551b/bin/bsubmit config -set email=...@nunki.usc.edu > ~csci551b/bin/bsubmit upload -event merlot.usc.edu_9996_1128715191_11 -file > hw1.tar.gz > > Was this supposed to yield an automated email response? Or is the email > response manually performed? Or is the email setting just for > identification purposes? The bsubmit output did indicate that the > submission was made successfully. The normal bsubmit output should look like: http://merlot.usc.edu/cs530-s06/bsubmit.html#normal If you don't see any error messages, your submission was successful. You can look at the files mentioned in the output of bsubmit if you are curious. Since you can submit many times, you are not notified every time you make a submission. After the deadline, I will go to the server to "collect" submissions from everyone. By default, I will only collect the last on-time submission for each student. This is the time you will get an e-mail saying that your subbmission with a certain timestamp was collected. (All other submissions are left on the server.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sat Jan 14 18:14:25 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0F2EP7r010999 for ; Sat, 14 Jan 2006 18:14:25 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0F2EKov015657 for ; Sat, 14 Jan 2006 18:14:20 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k0F2EKgn015656 for cs530@merlot.usc.edu; Sat, 14 Jan 2006 18:14:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0F2EKVU015653 for ; Sat, 14 Jan 2006 18:14:20 -0800 Message-Id: <200601150214.k0F2EKVU015653@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Input for homework 1 Date: Sat, 14 Jan 2006 18:14:20 -0800 From: william@bourbon.usc.edu Someone wrote: > Yes in C++ there is an equivalent eof() for file input streams, > but what I am wondering about is: > > a) is our submission going to be tested with file input and with > input from the STDIN for instance typed into the keyboard or > piped in such as $ cat base64enc.test > hw1 base64-enc I don't remember what's exactly in the grading guidelines. Whatever that's there is what we will do (except we will use different *files* as I've mentioned during lectures). > and b) if input can come from STDIN how do we know when it is the > end of the input? I assume you are asking about getting data from the keyboard (and not piped in from another process). In this case, you can type a d which signals the EOF condition but does *not* create a d character (0x04). Therefore, this is identical to the case when you are reading from a file. Your code should do exactly the same thing if the input comes from a file or from stdin. If your code is doing something different depending on where input comes from, you are probably doing something wrong! (The main difference between stdin and a file is that things like rewind() and ungetc() might not work on something like stdin. So you should not use functions like these.) -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Saturday, January 14, 2006 11:35 am Subject: Re: Input for homework 1 To: cs530@bourbon.usc.edu > Someone wrote: > > > For homework 1 we are supposed to accept input from a file as > > well as from STDIN. If its coming from STDIN what character or > > sequence of characters should we use to denote the end of input? > > End of input is not a character or a sequence of character. > It's a condition that you can test for. Some people might > think that EOF is a character that has a value of 0x04 (or > d), but that's wrong. Clearly this cannot work if > you are dealing with a binary file that may contain 0x04 > in the middle of it. > > If you are using C and you are reading from a stream (of type > (FILE*)), you can use feof() to test for this condition or > you can use fread() and see if it returns 0. If you are > reading from a file descriptor (of type (int)), you can use > read() and test if it returns 0. There are also other > equivalent ways to detect end of input. > > To convert from a stream a file descriptor, you can use fileno(). > To convert from a file descriptor to a stream, you can use > fdopen(). > > What are the functions in C++? I cannot recall! Personally, > I do not use iostreams in C++. Since C is a proper subset of > C++, I always use I/O stuff in C to read inputs in C++. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sat Jan 14 11:34:55 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0EJYtT3028279 for ; Sat, 14 Jan 2006 11:34:55 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0EJYpvo013302 for ; Sat, 14 Jan 2006 11:34:51 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k0EJYpp8013301 for cs530@merlot.usc.edu; Sat, 14 Jan 2006 11:34:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0EJYp4l013298 for ; Sat, 14 Jan 2006 11:34:51 -0800 Message-Id: <200601141934.k0EJYp4l013298@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Input for homework 1 Date: Sat, 14 Jan 2006 11:34:51 -0800 From: william@bourbon.usc.edu Someone wrote: > For homework 1 we are supposed to accept input from a file as > well as from STDIN. If its coming from STDIN what character or > sequence of characters should we use to denote the end of input? End of input is not a character or a sequence of character. It's a condition that you can test for. Some people might think that EOF is a character that has a value of 0x04 (or d), but that's wrong. Clearly this cannot work if you are dealing with a binary file that may contain 0x04 in the middle of it. If you are using C and you are reading from a stream (of type (FILE*)), you can use feof() to test for this condition or you can use fread() and see if it returns 0. If you are reading from a file descriptor (of type (int)), you can use read() and test if it returns 0. There are also other equivalent ways to detect end of input. To convert from a stream a file descriptor, you can use fileno(). To convert from a file descriptor to a stream, you can use fdopen(). What are the functions in C++? I cannot recall! Personally, I do not use iostreams in C++. Since C is a proper subset of C++, I always use I/O stuff in C to read inputs in C++. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Jan 12 15:22:59 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k0CNMxTu022355 for ; Thu, 12 Jan 2006 15:22:59 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k0CNN2GO032007 for ; Thu, 12 Jan 2006 15:23:02 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k0CNN28O032006 for cs530@merlot; Thu, 12 Jan 2006 15:23:02 -0800 Date: Thu, 12 Jan 2006 15:23:02 -0800 From: william@bourbon.usc.edu Message-Id: <200601122323.k0CNN28O032006@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: lab section ... Hi, Please make sure that you attend the Lab Section meeting this Friday from 3:30pm to 4:20pm in OHE 132 (on DEN). Yash Gandhi , the Lab TA will explain what it will take to get all the 10% of the class grade assigned to the Lab. For remote students, Yash will also explain how to get an account on the virtual Lab so that the Lab can be done remotely. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Jan 3 23:21:39 2006 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.1/8.13.1) with ESMTP id k047LdZt010817 for ; Tue, 3 Jan 2006 23:21:39 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.1/8.13.1) with ESMTP id k047Ijk5021483 for ; Tue, 3 Jan 2006 23:18:45 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.1/8.13.1/Submit) id k047Ijwv021482 for cs530@merlot.usc.edu; Tue, 3 Jan 2006 23:18:45 -0800 Date: Tue, 3 Jan 2006 23:18:45 -0800 From: william@bourbon.usc.edu Message-Id: <200601040718.k047Ijwv021482@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: getting on the class mailing list... Hi, You are *required* to register with the class mailing list. If you have not done so, please go to the following page: http://merlot.usc.edu/cs530-s06/mailinglist.html and register. Thanks! -- Bill Cheng // bill.cheng@usc.edu