Return-Path: william@bourbon.usc.edu Delivery-Date: Thu May 12 07:31:18 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j4CEVIja025330 for ; Thu, 12 May 2005 07:31:18 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j4CEXgio017007 for ; Thu, 12 May 2005 07:33:42 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j4CEXf2W017005 for cs530@merlot; Thu, 12 May 2005 07:33:41 -0700 Date: Thu, 12 May 2005 07:33:41 -0700 From: william@bourbon.usc.edu Message-Id: <200505121433.j4CEXf2W017005@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: final exam total... Hi, There is a minor error in the e-mail I sent out about your final exam scores. It should say "(out of 90)" and not "(out of 100)". Your exam score is correct. Sorry about the error! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu May 5 22:45:13 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j465jDja010635 for ; Thu, 5 May 2005 22:45:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j465lqio032614 for ; Thu, 5 May 2005 22:47:52 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j465lqLG032606 for cs530@merlot.usc.edu; Thu, 5 May 2005 22:47:52 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j465lqio032602 for ; Thu, 5 May 2005 22:47:52 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j465lql1032598 for ; Thu, 5 May 2005 22:47:52 -0700 Message-Id: <200505060547.j465lql1032598@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Term paper Date: Thu, 05 May 2005 22:47:52 -0700 From: william@bourbon.usc.edu Someone wrote: > When are we going to receive the results of the term > paper? with the final results? The term paper will be graded after the final exam has been graded. I will not send out any e-mail messages until I've graded everyone's term paper. When everything is graded and letter grade has been assigned, you will get the usual e-mail. But this time, you will receive 3 e-mail messages close to one another. The first e-mail message will be your class letter grade. The next e-mail message will be your term paper score. The 3rd e-mail message will be your final exam score. My guess is that this will happen next Tuesday or Wednesday. Before that, I will not send out any e-mail messages regarding grades. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue May 3 23:00:48 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j4460mja009098 for ; Tue, 3 May 2005 23:00:48 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j445xnio023019 for ; Tue, 3 May 2005 22:59:49 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j445xnOa023017 for cs530@merlot.usc.edu; Tue, 3 May 2005 22:59:49 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j445xnio023014 for ; Tue, 3 May 2005 22:59:49 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j445xnTT023005 for ; Tue, 3 May 2005 22:59:49 -0700 Message-Id: <200505040559.j445xnTT023005@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: final stuff Date: Tue, 03 May 2005 22:59:49 -0700 From: william@bourbon.usc.edu Someone wrote: > Couple quick questions: > > In talking about policy models, the definitions of discretionary and > mandatory are clear, but I wanted to double check what Bell-LaPadula is. Is > that simply the version of mandatory policy that uses > "Unclassified/Secret/etc." and has the "Write Up, Read Down" rule? Yes. That's part of Bell-LaPadula. > For CISL, will we actually be expected to know how to write some of the > expressions, No. > or will knowing that there are Roles, Verbs, etc. be enough? Yes. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue May 3 16:21:49 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j43NLnja023083 for ; Tue, 3 May 2005 16:21:49 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j43NKqio002282 for ; Tue, 3 May 2005 16:20:52 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j43NKquq002279 for cs530@merlot.usc.edu; Tue, 3 May 2005 16:20:52 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j43NKpio002276 for ; Tue, 3 May 2005 16:20:51 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j43NKp5u002265 for ; Tue, 3 May 2005 16:20:51 -0700 Message-Id: <200505032320.j43NKp5u002265@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: abt guest lectures Date: Tue, 03 May 2005 16:20:51 -0700 From: william@bourbon.usc.edu Someone wrote: > you have mentioned this in the class that the portion covered in > the two guest lecture , apart from the security lab one will be > covered in the final exam. > After going through the slides of those teo lectures, it seems > that they have covered a lot of the research work that they have > done. Do yo expect us to know all that in details or just an > overview of the mentioned topic would be sufficient for the > exams. My message with timestamp "Tue 03 May 08:45" should also answer the above question. > I know this is not good on my part to ask this, but i am having a > tough time understanding the slides of those two lectures. You should read the supplementary papers if you want to understand them thoroughly. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue May 3 11:07:49 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j43I7nja006786 for ; Tue, 3 May 2005 11:07:49 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j43I6qio016292 for ; Tue, 3 May 2005 11:06:52 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j43I6quP016290 for cs530@merlot.usc.edu; Tue, 3 May 2005 11:06:52 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j43I6qio016287 for ; Tue, 3 May 2005 11:06:52 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j43I6qVn016283 for ; Tue, 3 May 2005 11:06:52 -0700 Message-Id: <200505031806.j43I6qVn016283@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: some questions Date: Tue, 03 May 2005 11:06:52 -0700 From: william@bourbon.usc.edu Someone wrote: > I can understand that midterm course is in the final, but can you > give us any hint how much will it cover? like 40% or 35% ? Something like 40% to 60%. > And i have other question regarding substituional cipher and > transposition. How is one is better than the other? I know its > kinda very fundamental question, but more i think of it the more > confused i am getting. Transposition/permutation has not much power! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue May 3 10:03:39 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j43H3dja003777 for ; Tue, 3 May 2005 10:03:39 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j43H2gio024781 for ; Tue, 3 May 2005 10:02:42 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j43H2g5Q024779 for cs530@merlot.usc.edu; Tue, 3 May 2005 10:02:42 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j43H2gio024776 for ; Tue, 3 May 2005 10:02:42 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j43H2g2t024772 for ; Tue, 3 May 2005 10:02:42 -0700 Message-Id: <200505031702.j43H2g2t024772@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: question about OTF in group key Date: Tue, 03 May 2005 10:02:42 -0700 From: william@bourbon.usc.edu Someone wrote: > When U4 leaves the group, what messages are generated in OTF? > I guess that U3 knows K3, g(K4), g(K34), g(K14) so that he > can generate K34, K14, K18 before U4 leaves. > However, when U4 is leaving, U3 can't generate K'34 without g(K'4). > So does the system let U3 know K'34 without blinding? I think the OFT (One-way Function Tree) you are talking about is not distributed. So, the centralized key server is generating and delivering keys. So, there's very little difference between joining and leaving in terms of the amount of work that needs to be done by the centralized key server. You should probably check the paper again to be sure. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue May 3 08:46:34 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j43FkYja032734 for ; Tue, 3 May 2005 08:46:34 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j43Fjbio031921 for ; Tue, 3 May 2005 08:45:37 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j43FjbQI031919 for cs530@merlot.usc.edu; Tue, 3 May 2005 08:45:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j43Fjbio031913 for ; Tue, 3 May 2005 08:45:37 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j43Fjbvg031906 for ; Tue, 3 May 2005 08:45:37 -0700 Message-Id: <200505031545.j43Fjbvg031906@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: about papers Date: Tue, 03 May 2005 08:45:37 -0700 From: william@bourbon.usc.edu Someone wrote: > There are many papers related with lectures but you did not mention about > some of them. > > When I read these papers, that are not mentioned during lectures, I don't > know how deeply I sholud understand them. > > For example, the paper, 'Spam on the internet', has many solutions for > preventing spam e-mail. > Should I know the each solution and its benefit thoroughly? If you are asking with regards to the final exam, please recall that the final exam will be similar to the midterm exam. Most of the questions I ask will be on "concepts", rather than specifics. (Sometimes, I do ask questions about "concept of specifics".) If you are asking about reading papers in general, you should understand ask much as you need or want! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun May 1 22:53:47 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j425rlja003902 for ; Sun, 1 May 2005 22:53:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j425qsio026176 for ; Sun, 1 May 2005 22:52:54 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j425qsQP026174 for cs530@merlot.usc.edu; Sun, 1 May 2005 22:52:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j425qsio026171 for ; Sun, 1 May 2005 22:52:54 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j425qrKh026167 for ; Sun, 1 May 2005 22:52:54 -0700 Message-Id: <200505020552.j425qrKh026167@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: final location Date: Sun, 01 May 2005 22:52:53 -0700 From: william@bourbon.usc.edu Someone wrote: > is there a class tomorrow? would you hold office hours? > i just have a couple of questions about agent based authorization. There is no class this week and I won't be holding office hours. If you have questions, please send e-mail to me and I'll try to answer them as soon as I can. (Unfortunately, I will be offline most of the day tomorrow.) By the way, there is no questions on the final exam about agent based authorization! :-) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun May 1 12:32:33 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j41JWXja007846 for ; Sun, 1 May 2005 12:32:33 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j41JVfio029497 for ; Sun, 1 May 2005 12:31:41 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j41JVf9a029495 for cs530@merlot.usc.edu; Sun, 1 May 2005 12:31:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j41JVfio029492 for ; Sun, 1 May 2005 12:31:41 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j41JVfUm029488 for ; Sun, 1 May 2005 12:31:41 -0700 Message-Id: <200505011931.j41JVfUm029488@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: final location Date: Sun, 01 May 2005 12:31:41 -0700 From: william@bourbon.usc.edu Someone wrote: > Am I correct in assuming that the final will be held in the > same classroom? I don't see any announcements on the webpage, > and I'm not sure if you've mentioned it during class. I did mention at the beginning of last class that the final exam will be held in the same classroom. Thanks for reminding me! I'll update the class web page. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Apr 26 23:15:34 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3R6FYja018837 for ; Tue, 26 Apr 2005 23:15:34 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3R6Erio011222 for ; Tue, 26 Apr 2005 23:14:53 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3R6Er8Z011220 for cs530@merlot.usc.edu; Tue, 26 Apr 2005 23:14:53 -0700 Date: Tue, 26 Apr 2005 23:14:53 -0700 From: william@bourbon.usc.edu Message-Id: <200504270614.j3R6Er8Z011220@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: office hour moved, again Hi, I'll be holding tomorrow's office hour again in SAL 226. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Apr 25 23:34:44 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3Q6Yija018136 for ; Mon, 25 Apr 2005 23:34:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3Q6Y6io012754 for ; Mon, 25 Apr 2005 23:34:06 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3Q6Y6Sv012752 for cs530@merlot.usc.edu; Mon, 25 Apr 2005 23:34:06 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3Q6Y6io012749 for ; Mon, 25 Apr 2005 23:34:06 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j3Q6Y6Lc012745 for ; Mon, 25 Apr 2005 23:34:06 -0700 Message-Id: <200504260634.j3Q6Y6Lc012745@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: about final exam Date: Mon, 25 Apr 2005 23:34:06 -0700 From: william@bourbon.usc.edu Someone wrote: > Does the final exam include lectures of TA and Alefiya Hussain? Yes. > Though you said guest lectures of TA and Alefiya Hussain would be included > in final exam, there seems no explicit mention about them in course page. I forgot to list them. Please see the News section of the class web page. I've just added those to the list of topics covered. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Apr 25 23:22:32 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3Q6MWja017530 for ; Mon, 25 Apr 2005 23:22:32 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3Q6Lsio001088 for ; Mon, 25 Apr 2005 23:21:54 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3Q6Lslb001080 for cs530@merlot.usc.edu; Mon, 25 Apr 2005 23:21:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3Q6Lsio001077 for ; Mon, 25 Apr 2005 23:21:54 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j3Q6Lslc001073 for ; Mon, 25 Apr 2005 23:21:54 -0700 Message-Id: <200504260621.j3Q6Lslc001073@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: how does the bistro check the user identity? Date: Mon, 25 Apr 2005 23:21:54 -0700 From: william@bourbon.usc.edu Someone wrote: > When we submit assignments, we set the email address as user's identity and > the admistrator of bistro sends the result of submission to the email > address. > However, if someone try to set other person's e-mail address and submit > garbage data to intrigue against the person, the administrator does not > recognize it and the victim will get lower grade. Even if the admistrator > send the confirmation e-mail to the victim, an attacker may send garbage > data just after the victim's submission so that the victim may not know the > fact becase of short time delay. > Or, an attacker can use DOS attack by sending useless data to the bistro > server. > Doest the bistro system have an authentication method to prevent these > problem? The bsubmit program you use on nunki actually gets your login name from your UID. So, if you run it, it will send your login name. But since you can download the source of bsubmit, you can change the code so that it hardcodes someone else's login name and there is no way to stop you from doing that. In general, user authentication is hard. Anyone can submit your income tax form for you and forge your signature. There is really no way to prevent that from happening. IRS will eventually need to determine which one is real and which one is not. Forgery is illegal for income tax submission. Forgery also has bad consequences when it comes to HW submissions. This is actually in the next couple slides. So, I'll talk about it during the next lecture. As long as servers on the Internet is open, there is really no good solution to DOS attacks other than shutting off the attack sources. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Apr 25 13:47:53 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3PKlrja023476 for ; Mon, 25 Apr 2005 13:47:53 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3PKlFio020046 for ; Mon, 25 Apr 2005 13:47:15 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3PKlFtI020044 for cs530@merlot.usc.edu; Mon, 25 Apr 2005 13:47:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3PKlFio020041 for ; Mon, 25 Apr 2005 13:47:15 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j3PKlFQP020031 for ; Mon, 25 Apr 2005 13:47:15 -0700 Message-Id: <200504252047.j3PKlFQP020031@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: question about bistro Date: Mon, 25 Apr 2005 13:47:15 -0700 From: william@bourbon.usc.edu Someone wrote: > i have a question about your bistro lecture. > > what happens if your data is lost on the server X, before it is uploaded > to the destination server? > that is, if someone breaks into the server X, and deletes your data? > how does bistro handle that? There are a couple of things that can be done. 1) During event creation, the event owner (such as IRS) can say that it's important to have reliability and can specify the number of copies that must to uploaded during the commit step. It is also possible (although unlikely) that all bistros are broken into! So, we will have to go with the solution below. 2) A copy of the submission was make on the user's local disk (for our HW submission, bsubmit make a copy somewhere in your ~/.bistro directory). If all copies on the bistros are lost, you can copy your data from your local drive to a floppy and fedex it to the event owner. The event owner can verify that this is the same submission that made the deadline. What if the user had a disk crash and lost all the data on the disk? Well, Bistro cannot solve this problem. This is similiar to the problem that if someone signs something and then claims that his/her private key was stolen. It's up to the courts to decide if this was done intentionally or not. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Apr 25 09:43:43 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3PGhhja012142 for ; Mon, 25 Apr 2005 09:43:43 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3PGh6io027676 for ; Mon, 25 Apr 2005 09:43:06 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3PGh6oK027674 for cs530@merlot; Mon, 25 Apr 2005 09:43:06 -0700 Date: Mon, 25 Apr 2005 09:43:06 -0700 From: william@bourbon.usc.edu Message-Id: <200504251643.j3PGh6oK027674@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: office moved today Hi, I'll be holding office hour in SAL 226 today. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Apr 23 22:39:44 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3O5dija001441 for ; Sat, 23 Apr 2005 22:39:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3O5dBio006958 for ; Sat, 23 Apr 2005 22:39:11 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j3O5dBlX006954 for ; Sat, 23 Apr 2005 22:39:11 -0700 Message-Id: <200504240539.j3O5dBlX006954@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: About final exam Date: Sat, 23 Apr 2005 22:39:11 -0700 From: william@bourbon.usc.edu Someone wrote: > is the syllabus for the final exam going to cover everything > from the beginning or everything after the midterm. The final exam will cover everything from the beginning of the semester. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Apr 22 22:27:39 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3N5Rdja030849 for ; Fri, 22 Apr 2005 22:27:39 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3N5R8io020455 for ; Fri, 22 Apr 2005 22:27:08 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3N5R8td020453 for cs530@merlot; Fri, 22 Apr 2005 22:27:08 -0700 Date: Fri, 22 Apr 2005 22:27:08 -0700 From: william@bourbon.usc.edu Message-Id: <200504230527.j3N5R8td020453@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: documentation score error in HW4 grade report... Hi, A few of the HW4 grades I sent to individual students may have errors in the documentation scores (and documentation scores only). The total scores are all correct! If your documentation score is zero and if you add up all the scores and it's 5 points less than your total, this means that your documentation score is 5 and there was an error in the report. Again, the total is correct. (If the difference is not 5 points, please send e-mail to me.) Sorry about the errors. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Apr 20 21:40:12 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3L4eCja024021 for ; Wed, 20 Apr 2005 21:40:12 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3L4dkio016647 for ; Wed, 20 Apr 2005 21:39:46 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3L4dkgB016645 for cs530@merlot; Wed, 20 Apr 2005 21:39:46 -0700 Date: Wed, 20 Apr 2005 21:39:46 -0700 From: william@bourbon.usc.edu Message-Id: <200504210439.j3L4dkgB016645@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: please do not submit the term paper late! Just a reminder that the same penalty applies for the term paper. So, if you submit after midnight, even if you are one second late, you will lose 25%! I cannot make an exception for anyone. So, if you plan to submit late, submit something now so you have an option to choose an earlier version. As before, by default, we will grade the last ontime submission. Let me say this... Nothing is worth 25% deduction for the term paper! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Apr 20 21:29:51 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3L4Tpja023393 for ; Wed, 20 Apr 2005 21:29:51 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3L4TPio006865 for ; Wed, 20 Apr 2005 21:29:25 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3L4TPlf006863 for cs530@merlot; Wed, 20 Apr 2005 21:29:25 -0700 Date: Wed, 20 Apr 2005 21:29:25 -0700 From: william@bourbon.usc.edu Message-Id: <200504210429.j3L4TPlf006863@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: term paper reminder... Hi, Just want to remind you the following from the term paper spec: 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. Please also use the electronic submission system. E-mail submissions will not be accepted. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Apr 20 21:03:59 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3L43wja022110 for ; Wed, 20 Apr 2005 21:03:58 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3L43Xio014704 for ; Wed, 20 Apr 2005 21:03:33 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3L43XOJ014702 for cs530@merlot.usc.edu; Wed, 20 Apr 2005 21:03:33 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3L43Xio014694 for ; Wed, 20 Apr 2005 21:03:33 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j3L43XZP014689 for ; Wed, 20 Apr 2005 21:03:33 -0700 Message-Id: <200504210403.j3L43XZP014689@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Q? Date: Wed, 20 Apr 2005 21:03:33 -0700 From: william@bourbon.usc.edu Someone wrote: > (1) I know the required references is at least three from the > approved list....but Is the grading by anyhow gone consider the > number of refrences I used as long you satisfy the condition of > the 3 refrences. Becaue I was able to articulate my idea using > thses 3 refrences and I don't find it necessary to include more? I would think you will end up with more than just the 3 required references. But since I haven't read your paper, I cannot tell if more should be included. May be it's fine, but may be it's not. I just don't know. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Apr 20 21:01:59 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3L41xja022000 for ; Wed, 20 Apr 2005 21:01:59 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3L41Xio012784 for ; Wed, 20 Apr 2005 21:01:33 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3L41XqZ012782 for cs530@merlot.usc.edu; Wed, 20 Apr 2005 21:01:33 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3L41Xio012779 for ; Wed, 20 Apr 2005 21:01:33 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j3L41X36012775 for ; Wed, 20 Apr 2005 21:01:33 -0700 Message-Id: <200504210401.j3L41X36012775@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Question Date: Wed, 20 Apr 2005 21:01:33 -0700 From: william@bourbon.usc.edu Someone wrote: > (1) Actually I asked this question before but I would like to be > more accurate in my description of the question....One of the > papers that I have used has a background section. I found this > background section useful in my paper, therefore I summarized it > in my paper. The thing is that the background section in the > refrenced paper is taking about general knowlege (how email > encryption protocols work in general), therefore I didn't include > any citation when I summarized this section because I found the > knowledge is common. My question is that in such a case do I have > to cite or not. May be you will get mad on me because I asked the > question a second time but I really want not to fall into > plagarism. Is what I did OK? I'm not familiar with what encryption e-mail does. So, I don't know if it's fair to say it's general knowledge. But may be it is. It's your call. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Apr 20 00:52:03 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3K7q3ja031022 for ; Wed, 20 Apr 2005 00:52:03 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3K7pdio004438 for ; Wed, 20 Apr 2005 00:51:39 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3K7pdog004432 for cs530@merlot.usc.edu; Wed, 20 Apr 2005 00:51:39 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3K7pdio004427 for ; Wed, 20 Apr 2005 00:51:39 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j3K7pd2Z004423 for ; Wed, 20 Apr 2005 00:51:39 -0700 Message-Id: <200504200751.j3K7pd2Z004423@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: something interesting Date: Wed, 20 Apr 2005 00:51:39 -0700 From: william@bourbon.usc.edu Someone wrote: > Cant help asking for your call regarding this as it is very relevant with > class status quo > > http://www.cnn.com/2005/TECH/science/04/14/mit.prank.reut/ > http://www.pdos.csail.mit.edu/scigen/ I'll try to remember to talk about this tomorrow! If I forget, someone please remind me! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Apr 20 00:17:08 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3K7H8ja029268 for ; Wed, 20 Apr 2005 00:17:08 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3K7Gjio003349 for ; Wed, 20 Apr 2005 00:16:45 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3K7GjKw003347 for cs530@merlot.usc.edu; Wed, 20 Apr 2005 00:16:45 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3K7Gjio003341 for ; Wed, 20 Apr 2005 00:16:45 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j3K7GjJw003333 for ; Wed, 20 Apr 2005 00:16:45 -0700 Message-Id: <200504200716.j3K7GjJw003333@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: event id for bsubmit Date: Wed, 20 Apr 2005 00:16:45 -0700 From: william@bourbon.usc.edu Someone wrote: > is it the event id for bsubmit is still > "merlot.usc.edu_9996_1073236249_30" even there is no hw5? Correct! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Apr 19 23:53:13 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3K6rDja028148 for ; Tue, 19 Apr 2005 23:53:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3K6qnio012794 for ; Tue, 19 Apr 2005 23:52:49 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3K6qnCU012792 for cs530@merlot.usc.edu; Tue, 19 Apr 2005 23:52:49 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3K6qnio012783 for ; Tue, 19 Apr 2005 23:52:49 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j3K6qnRg012779 for ; Tue, 19 Apr 2005 23:52:49 -0700 Message-Id: <200504200652.j3K6qnRg012779@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Citing Date: Tue, 19 Apr 2005 23:52:49 -0700 From: william@bourbon.usc.edu Someone wrote: > (1)If the paper has presented some background information that is > well-known and could be found in other papers and text > references,,,,then do i have to cite such thing if I include it > in my paper... > > For example,,,,Assume the writer takes about email encryption > protocol and how they work as a background information or he gave > some background information about let say PGP do I have to cite > these background information even if it is general and could be > found else where (It is not the author original idea). > > Or not????? In general, it's a judgement call. But for this class, as I've mentioned before, your target audience is someone who has taken CS 530. So, anything that's covered by CS 530 or its prerequites, you don't need to cite. If you talk about PGP that goes beyond what was covered in class (which is not so much), you probably should cite the more advanced materials. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Apr 19 23:40:55 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3K6etja027592 for ; Tue, 19 Apr 2005 23:40:55 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3K6eWio000945 for ; Tue, 19 Apr 2005 23:40:32 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3K6eWsf000943 for cs530@merlot.usc.edu; Tue, 19 Apr 2005 23:40:32 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3K6eWio000940 for ; Tue, 19 Apr 2005 23:40:32 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j3K6eWDP000936 for ; Tue, 19 Apr 2005 23:40:32 -0700 Message-Id: <200504200640.j3K6eWDP000936@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: paper length Date: Tue, 19 Apr 2005 23:40:32 -0700 From: william@bourbon.usc.edu Someone wrote: > Are the abstract and bibliography included in the count > of the 5 pages for the paper? Yes! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Apr 18 17:07:42 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3J07gja007954 for ; Mon, 18 Apr 2005 17:07:42 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3J07Cio004980 for ; Mon, 18 Apr 2005 17:07:12 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3J07Coc004978 for cs530@merlot.usc.edu; Mon, 18 Apr 2005 17:07:12 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3J07Cio004975 for ; Mon, 18 Apr 2005 17:07:12 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j3J07CJZ004971 for ; Mon, 18 Apr 2005 17:07:12 -0700 Message-Id: <200504190007.j3J07CJZ004971@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Citing a reference Date: Mon, 18 Apr 2005 17:07:12 -0700 From: william@bourbon.usc.edu Someone wrote: > I have a general question about citing a reference: In my > initial draft of the paper, I have one major section(about one > page) where I discuss an idea from one single paper...how should > I cite this? Can I put a citation after the entire section, the > paragraph, or after every single sentence? If you are going to review what's said in a reference, you should do it in front (and not put the citation afterwards). For example, it's probably better to say something like (assuming it's reference [3]): In [3], Author1 et al proposed/described/provided... After the first sentense, you can say, "They also..." so it's clear this is all about reference [3]. Please be careful when you write things this way. I'm hoping you don't spend a few paragraphs talking about a reference like this because it would end up like a book report. As I've mentioned several times, a book report (or books reports) will not be right for this term paper. > Furthermore, I have read many papers about my topic. So I have a > good understanding of my topic and related ideas, but all my > knowledge comes from these papers. Even my opinions are > influenced by these papers...so I feel like I need to cite > everything...even general information about my topic. Can you > give some guidelines about what is required to be cited? You cite when you feel the citation deserves citing! So, it's a judgement call. Some of the stuff would be common knowledge, so you don't have to cite. For example, if you mention the term Network Intrusion Detection, it may not require a reference. If you are talking about a specific idea that's clearly originated from a paper, you should probably cite it. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Apr 17 22:51:09 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3I5p9ja022127 for ; Sun, 17 Apr 2005 22:51:09 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3I5ooio010258 for ; Sun, 17 Apr 2005 22:50:51 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3I5ooXO010256 for cs530@merlot; Sun, 17 Apr 2005 22:50:50 -0700 Date: Sun, 17 Apr 2005 22:50:50 -0700 From: william@bourbon.usc.edu Message-Id: <200504180550.j3I5ooXO010256@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: changing your mind about the term paper... Hi, I got a few e-mail message regarding people changing their minds about the term paper. Just want everyone to understand that you can do whatever you want and you don't need approval for not following your proposal! Just make sure you have at least 3 references that satisfy the reference requirement and that you will write a good paper. If you plan to replace a qualified reference with another one, please also don't ask the TA or myself whether a new reference satisfies the requirement. There was plenty of time to do this before the proposal was due. Now you have to figure it out for yourself. Also, the time for the proposal is over, so please don't send me (or the TA) another proposal to approve because you've changed your mind about what to write. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Apr 17 22:42:03 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3I5g3ja021745 for ; Sun, 17 Apr 2005 22:42:03 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3I5fjio001463 for ; Sun, 17 Apr 2005 22:41:45 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3I5fj5d001461 for cs530@merlot.usc.edu; Sun, 17 Apr 2005 22:41:45 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3I5fjio001458 for ; Sun, 17 Apr 2005 22:41:45 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j3I5fjnX001454 for ; Sun, 17 Apr 2005 22:41:45 -0700 Message-Id: <200504180541.j3I5fjnX001454@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Regarding Term Paper Date: Sun, 17 Apr 2005 22:41:45 -0700 From: william@bourbon.usc.edu Someone wrote: > I had a question regarding inclusion of other referance papers. > As i read more papers on my topic i found some relevant matter > from papers outside the list of the four authors. The idea > expressed in the paper adds on to the information i can present > in the paper. > Can I reference a sigficant idea from these papers in addtion to > the 3 references i have included. Sure! > Or is it a must that all the > central ideas expressed must come from the selected papers of the > authors? It is not a must. I just want to mention that you need to scrutinize your references carefully. If you have a strong reference (good materials, published in a good peer-reviewed journal/conference/workshop), use it. If your central idea comes from a weak reference, your paper may be weak. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Apr 17 11:05:22 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3HI5Mja022066 for ; Sun, 17 Apr 2005 11:05:22 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3HI54io015730 for ; Sun, 17 Apr 2005 11:05:04 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j3HI54nx015726 for ; Sun, 17 Apr 2005 11:05:04 -0700 Message-Id: <200504171805.j3HI54nx015726@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: PDF-files Date: Sun, 17 Apr 2005 11:05:04 -0700 From: william@bourbon.usc.edu Someone wrote: > I did'nt find any pdf writer in the lab. Do you have any > idea how can we create pdf files? My favorite free Windows PDF printer is: http://www.deskpdf.com/ You can download the free version. After you print to this PDF printer a few times, it will say that the free trial is over. But it allows you to print to it even after the free trial is over. It generates a very small banner at the bottom of each page to advertise deskpdf.com. This banner would not bother me if it doesn't overlap with the text of your paper. Please give it a try. If it works for you, great! (I use deskPDF to produce the PDF version of my class slides for another class because the slides are in PowerPoint.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Apr 17 07:59:31 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3HExUja013548 for ; Sun, 17 Apr 2005 07:59:30 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3HExEio010087 for ; Sun, 17 Apr 2005 07:59:14 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3HExE2e010085 for cs530@merlot.usc.edu; Sun, 17 Apr 2005 07:59:14 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3HExDio010082 for ; Sun, 17 Apr 2005 07:59:14 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j3HExDdK010078 for ; Sun, 17 Apr 2005 07:59:13 -0700 Message-Id: <200504171459.j3HExDdK010078@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: any penalty in case total page is less than 5 pages? Date: Sun, 17 Apr 2005 07:59:13 -0700 From: william@bourbon.usc.edu Someone wrote: > Is there any penalty in case total page is less than 5 pages, > for example, 4 pages? There is no penalty. But usually, very few people can write short great papers. Not that it's impossible. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sat Apr 16 22:57:52 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3H5vqja010237 for ; Sat, 16 Apr 2005 22:57:52 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3H5vaio005217 for ; Sat, 16 Apr 2005 22:57:36 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3H5vaBT005215 for cs530@merlot.usc.edu; Sat, 16 Apr 2005 22:57:36 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3H5vaio005209 for ; Sat, 16 Apr 2005 22:57:36 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j3H5vaHu005202 for ; Sat, 16 Apr 2005 22:57:36 -0700 Message-Id: <200504170557.j3H5vaHu005202@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: regarding term paper format Date: Sat, 16 Apr 2005 22:57:36 -0700 From: william@bourbon.usc.edu Someone wrote: > it would be helpful if you can post a sample term paper on the > class website, as it would give us a fair idea about the > formatting, citations and the layout of the term paper. Just look at any of the papers published by the 4 authors! (Our paper should fit within 5 pages, but everything else is *the same*!) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Apr 13 13:18:02 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3DKI2ja017859 for ; Wed, 13 Apr 2005 13:18:02 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3DKHtio006606 for ; Wed, 13 Apr 2005 13:17:55 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3DKHtBu006604 for cs530@merlot.usc.edu; Wed, 13 Apr 2005 13:17:55 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3DKHtio006595 for ; Wed, 13 Apr 2005 13:17:55 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3DKHtCU006593 for cs530; Wed, 13 Apr 2005 13:17:55 -0700 Date: Wed, 13 Apr 2005 13:17:55 -0700 From: william@bourbon.usc.edu Message-Id: <200504132017.j3DKHtCU006593@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Term paper propsal Someone wrote: > I have a few questions. One > is I am not sure what is meant by a good paper as this is my > first. So It would be really helpfull if u can tell me if my > proposal is good enough. Second Is my scope too wide or too > narrow. Third is can i include more references if need arises. When you read all your references and all the papers on the class reading list, you should get a sense which papers are "good" and which are "not as good". You should try your best to a write paper which is more similiar to the "good" ones. I'm not sure what you meant by whether your proposal is "good enough". The proposal is there to get feedback from the TA and to provide a list of references to get qualified. We do not try to determine if a proposal is "good" or "bad" because it does not have enough on it to make such a determination. In general, I think the narrower the focus the better the paper can be. You mentioned that you want to talk about 3 topics. A narrower focus would mean to talk about only 1 or 2 specific topics. Finally, having more references in the term paper is fine. But if you are going to remove references from your proposal, make sure you maintain 3 according to the requirements. If you are not sure, please send me e-mail. Please note that if you do not have 3 references that satisfy the requirement, your paper will get a very very low score! (The 5 points per reference rule only applies to the proposal and not the final paper.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Apr 12 17:08:50 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3D08nja032023 for ; Tue, 12 Apr 2005 17:08:49 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3D08iio007048 for ; Tue, 12 Apr 2005 17:08:44 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3D08iMY007046 for cs530@merlot; Tue, 12 Apr 2005 17:08:44 -0700 Date: Tue, 12 Apr 2005 17:08:44 -0700 From: william@bourbon.usc.edu Message-Id: <200504130008.j3D08iMY007046@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: a note about term paper proposal deadline... Hi, The term paper web page says: [BC: Changed 3/13/2005] Although your proposal will not be graded, you will lose 20 points (out of 100) if you do not submit a proposal that meets the reference requirement by the proposal deadline. So, if you submit a proposal with bad references right around the deadline, you will lose up to 20 points (5 points per reference and 5 points for the proposal description). Please send the proposal in early, unless you are 100% sure about your references. As usual, I cannot bend the rules for any student. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Apr 12 15:14:49 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3CMEnja027315 for ; Tue, 12 Apr 2005 15:14:49 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3CMEiio030230 for ; Tue, 12 Apr 2005 15:14:44 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3CMEi34030228 for cs530@merlot.usc.edu; Tue, 12 Apr 2005 15:14:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3CMEiio030225 for ; Tue, 12 Apr 2005 15:14:44 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j3CMEiTo030221 for ; Tue, 12 Apr 2005 15:14:44 -0700 Message-Id: <200504122214.j3CMEiTo030221@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: term paper Date: Tue, 12 Apr 2005 15:14:44 -0700 From: william@bourbon.usc.edu Someone wrote: > 1. Do we have to take three references from the same author > or we can take the three reference from different authors? Please see my message with timestamp "Sun 03 Apr 15:07". > 2. The list of publications you have given for each author, > are those all peer-reviewed ones. Probably not. > If not how do we find out > which ones are peer-reviewed and which ones are not. You take your best guest and submit it for approval. Or you can send e-mail to the TA or myself. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Apr 12 10:18:48 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3CHImja014702 for ; Tue, 12 Apr 2005 10:18:48 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3CHIiio011872 for ; Tue, 12 Apr 2005 10:18:44 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3CHIix0011870 for cs530@merlot.usc.edu; Tue, 12 Apr 2005 10:18:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3CHIiio011864 for ; Tue, 12 Apr 2005 10:18:44 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j3CHIihp011857 for ; Tue, 12 Apr 2005 10:18:44 -0700 Message-Id: <200504121718.j3CHIihp011857@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: term paper Date: Tue, 12 Apr 2005 10:18:43 -0700 From: william@bourbon.usc.edu Someone wrote: > Generally, the papers that we read contain an abstract before the actual > paper begins. > > Do we have to include an abstract with out term paper? > > I ask this because out term paper is an extended abstract itself. So I > just wanted to make sure. It's still good to have an abstract. When someone asks you what your paper is about, you should be able to just read your abstract to him/her. So, the abstract needs to be somewhat self-contained. Normally, for a regular size paper, some people write two paragraphs in the abstract. Since we are writing an extended abstract, the abstract shouldn't be more than one paragraph long. One way to write the abstract is to leave it until the very end. When you are done with the rest of the paper, you can summarize it in a very succinctly in your abstract. You can also write an approximation of the abstract first, so that you can focus on what you want to say. Then fix it at the end. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Apr 12 00:32:44 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3C7Wija022570 for ; Tue, 12 Apr 2005 00:32:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3C7Wfio014037 for ; Tue, 12 Apr 2005 00:32:41 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j3C7WfE8014027 for ; Tue, 12 Apr 2005 00:32:41 -0700 Message-Id: <200504120732.j3C7WfE8014027@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: co-author Date: Tue, 12 Apr 2005 00:32:40 -0700 From: william@bourbon.usc.edu Someone wrote: > According to the class web page, I can use the papers that are > "CO-AUTHORED" by the approved authors. If an author is the > second author of some paper, can I say that the author (second > author) co-authored the paper? I'm asking this because I'm > a little bit confused with the notion of "second author" and "co-author". Co-author means any one of the authors. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Apr 11 23:20:14 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3C6KEja019597 for ; Mon, 11 Apr 2005 23:20:14 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3C6KBio009980 for ; Mon, 11 Apr 2005 23:20:11 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3C6KBQj009972 for cs530@merlot.usc.edu; Mon, 11 Apr 2005 23:20:11 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3C6KBio009969 for ; Mon, 11 Apr 2005 23:20:11 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j3C6KBdX009965 for ; Mon, 11 Apr 2005 23:20:11 -0700 Message-Id: <200504120620.j3C6KBdX009965@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Can you remake slide for lecture 21? Date: Mon, 11 Apr 2005 23:20:11 -0700 From: william@bourbon.usc.edu I just tried this and it didn't look too bad. I've added the grayed versions to the lectures web page. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Mon, 11 Apr 2005 23:03:35 -0700 From: william@bourbon.usc.edu To: cs530@bourbon.usc.edu Subject: Re: Can you remake slide for lecture 21? Someone wrote: > When I tried to print out lecture 21, I found there was background image so > that it took so much ink. > > To save resource and increase readbility, can you remake slide for lecture > 21 without background image? That may take some work... The problem is that the slides are mostly in reversed video. So, if I delete the background image, I may end up with text that's white on white and you won't see anything! I'll give it a try. If it doesn't work well, you probably should just look at them online. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Apr 11 23:03:38 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3C63cja018659 for ; Mon, 11 Apr 2005 23:03:38 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3C63Zio026476 for ; Mon, 11 Apr 2005 23:03:35 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3C63Zus026474 for cs530@merlot.usc.edu; Mon, 11 Apr 2005 23:03:35 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3C63Zio026471 for ; Mon, 11 Apr 2005 23:03:35 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j3C63ZBW026467 for ; Mon, 11 Apr 2005 23:03:35 -0700 Message-Id: <200504120603.j3C63ZBW026467@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Can you remake slide for lecture 21? Date: Mon, 11 Apr 2005 23:03:35 -0700 From: william@bourbon.usc.edu Someone wrote: > When I tried to print out lecture 21, I found there was background image so > that it took so much ink. > > To save resource and increase readbility, can you remake slide for lecture > 21 without background image? That may take some work... The problem is that the slides are mostly in reversed video. So, if I delete the background image, I may end up with text that's white on white and you won't see anything! I'll give it a try. If it doesn't work well, you probably should just look at them online. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Apr 11 14:40:48 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3BLemja030509 for ; Mon, 11 Apr 2005 14:40:48 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3BLejio017687 for ; Mon, 11 Apr 2005 14:40:46 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3BLejoq017685 for cs530@merlot; Mon, 11 Apr 2005 14:40:45 -0700 Date: Mon, 11 Apr 2005 14:40:45 -0700 From: william@bourbon.usc.edu Message-Id: <200504112140.j3BLejoq017685@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: what should be original in the term paper? Someone wrote: > I am a little confused about the line between "presenting an idea > which does not have to be original", and "I've read the following > three papers and here's what they say" as stated in the spec, ... For example, "WEP is not secure" is not an original idea, but can we write a term paper about it? Absolutely! The term paper spec also says "the paper should contain original analysis of the papers you choose to cover..." So, although the main idea of the paper doesn't have to be original, the paper should contain some original analysis of your own. The confusion may have been caused by two different use of the word "original" above. "Original idea" is about ideas and concepts which are at a very high level. It's much more difficult to claim that an idea is original. "Original analysis" is about how something is analyzed. So, it can be interpreted as basically "in your own way/words". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Apr 11 10:32:42 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3BHWgja019804 for ; Mon, 11 Apr 2005 10:32:42 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3BHWfio024266 for ; Mon, 11 Apr 2005 10:32:41 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3BHWfC6024264 for cs530@merlot.usc.edu; Mon, 11 Apr 2005 10:32:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3BHWeio024255 for ; Mon, 11 Apr 2005 10:32:40 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j3BHWev3024251 for ; Mon, 11 Apr 2005 10:32:40 -0700 Message-Id: <200504111732.j3BHWev3024251@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Paper Proposal Queries Date: Mon, 11 Apr 2005 10:32:40 -0700 From: william@bourbon.usc.edu Someone wrote: > Can we get approval for more than one paper proposal and > then write the paper on any one of them. No. You need to think hard and decide which one you want to submit for approval (this is an assignment afterall). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Apr 10 10:07:12 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j3AH7Cja023344 for ; Sun, 10 Apr 2005 10:07:12 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3AH7Cio015881 for ; Sun, 10 Apr 2005 10:07:12 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3AH7CBq015879 for cs530@merlot.usc.edu; Sun, 10 Apr 2005 10:07:12 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j3AH7Cio015876 for ; Sun, 10 Apr 2005 10:07:12 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j3AH7Ckd015874 for cs530; Sun, 10 Apr 2005 10:07:12 -0700 Date: Sun, 10 Apr 2005 10:07:12 -0700 From: william@bourbon.usc.edu Message-Id: <200504101707.j3AH7Ckd015874@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: paper proposal for csci530 Someone wrote: > ..., i have several questions. Will my topic be too > broad? Do i have to go into details of the different protocols > how they work, maybe mathematically or theoritically? In general, the narrower the focus the better. The reason is that it's difficult to write a good broad paper. The purpose of the references is to support what you want to express. So, you don't have to describe all the technical details, but you have to demonstrate that you understand your references well. As I've mentioned before, one good approach is to do the following (if you don't know how to write the term paper). Once you've decided what you want to write, write it, then massage it to fit the requirement and make it into a better paper. This can be time-consuming, so start early! > another general question is that, am I allowed to choose > another topic if later on i decided to write something else? Your proposal will only be approved once. If you change your mind, you will be doing it at your own risk. If you change your references and if the new ones turn out to be invalid (as far as the term paper is concerned), you will lose a lot of points. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Apr 6 18:40:37 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j371ebja007686 for ; Wed, 6 Apr 2005 18:40:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j371ekio003872 for ; Wed, 6 Apr 2005 18:40:46 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j371ekfF003870 for cs530@merlot.usc.edu; Wed, 6 Apr 2005 18:40:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j371ekio003861 for ; Wed, 6 Apr 2005 18:40:46 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j371ekaL003857 for ; Wed, 6 Apr 2005 18:40:46 -0700 Message-Id: <200504070140.j371ekaL003857@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: .ppt file of today's lecture Date: Wed, 06 Apr 2005 18:40:46 -0700 From: william@bourbon.usc.edu Someone wrote: > Can we have the .ppt file of today's lecture? I cannot post the .ppt file. I need to convert it to PDF and then post it. I'll do it as soon as I can. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Apr 5 23:49:30 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j366nUja029787 for ; Tue, 5 Apr 2005 23:49:30 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j366nfio014305 for ; Tue, 5 Apr 2005 23:49:41 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j366nf0O014303 for cs530@merlot.usc.edu; Tue, 5 Apr 2005 23:49:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j366nfio014300 for ; Tue, 5 Apr 2005 23:49:41 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j366nfjB014296 for ; Tue, 5 Apr 2005 23:49:41 -0700 Message-Id: <200504060649.j366nfjB014296@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Perrig's papers Date: Tue, 05 Apr 2005 23:49:41 -0700 From: william@bourbon.usc.edu Someone wrote: > Some papers by Prof. Adrian Perrig for the year 2005 are not > in the DBLP list. These papers appear at IEEE events. > > Is the DBLP list upto date? In case it does not list recent > publications can we use them? I think the DBLP list is *manually* compiled! So, it's very likely that it's incomplete. Also, the DBLP list started out to be a list for publications in the database area. Then its coverage got bigger and bigger. But it doesn't cover everything. Please see my message with timestamp "Sun 03 Apr 15:07". It does not mention anything about DBLP. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Apr 3 15:06:56 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j33M6uja030635 for ; Sun, 3 Apr 2005 15:06:56 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j33M7Dio011464 for ; Sun, 3 Apr 2005 15:07:13 -0700 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j33M7D5w011462 for cs530@merlot.usc.edu; Sun, 3 Apr 2005 15:07:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j33M7Dio011459 for ; Sun, 3 Apr 2005 15:07:13 -0700 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j33M7Dm3011455 for ; Sun, 3 Apr 2005 15:07:13 -0700 Message-Id: <200504032207.j33M7Dm3011455@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: question about paper Date: Sun, 03 Apr 2005 15:07:13 -0700 From: william@bourbon.usc.edu Someone wrote: > i am confused about the paper requirement. u told that we > have to include 3 references of peer reviewed papers from one of > the approved authors from you.Sir can we have three references of > 3 papers from the same author?it means i chose a topic and major > three references are 3 papers from suppose Bruce Schneier.is it > valid or i have to have three different authors too? Let's say you have N references, and you apply the following question to each of them, *separately* and *independently*: Is this reference authored by one of the 4 approved authors and published in a peer-reviewed journal, conference or workshop? If the answer is yes in at least 3 cases, you have satisfied the requirement. To satisfy the proposal requirement, N can be just 3. When you write your paper, hopefully N > 3. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Mar 25 23:37:09 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2Q7b9ja021646 for ; Fri, 25 Mar 2005 23:37:09 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2Q7bmio029592 for ; Fri, 25 Mar 2005 23:37:48 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2Q7blvG029584 for cs530@merlot.usc.edu; Fri, 25 Mar 2005 23:37:47 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2Q7blio029580 for ; Fri, 25 Mar 2005 23:37:47 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2Q7blGi029574 for ; Fri, 25 Mar 2005 23:37:47 -0800 Message-Id: <200503260737.j2Q7blGi029574@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hw4 submission Date: Fri, 25 Mar 2005 23:37:47 -0800 From: william@bourbon.usc.edu Someone wrote: > i submitted the files for hw4 in the evening, but then found a problem > with my code. > so i submitted again (before the deadline). > so this is just to let you know .. please grade the latest submission. You can submit multiple times. There is no restriction on how many times you can submit. By default, we will grade the last on-time submission. If that's the one you want us to grade, please do not send e-mail to us. If you want us to grade something that's not the default, please let us know soon. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Mar 25 23:29:12 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2Q7TCja021208 for ; Fri, 25 Mar 2005 23:29:12 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2Q7Tpio025343 for ; Fri, 25 Mar 2005 23:29:51 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2Q7ToeZ025332 for cs530@merlot; Fri, 25 Mar 2005 23:29:50 -0800 Date: Fri, 25 Mar 2005 23:29:50 -0800 From: william@bourbon.usc.edu Message-Id: <200503260729.j2Q7ToeZ025332@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: friendly reminder... Hi, Just want to mention again that there is severe penalty for turning in your HW4 late. I cannot make any exception. Those of you who have not submitted anything should consider submitting something very soon. You don't want to be fumbling around near the deadline. Right after you submit and if it's a good submission, you might want to try the procedure outlined at: http://merlot.usc.edu/cs530-s05/submit.html#verify to verify your submission just to make sure that you've submitted something that works (do "make hw4; make smartcard" instead of just "make" for HW4). If you missed any file that is required for grading, you will lose a lot of points! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Mar 25 21:12:59 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2Q5Cxja015702 for ; Fri, 25 Mar 2005 21:12:59 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2Q5Dcio018014 for ; Fri, 25 Mar 2005 21:13:38 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2Q5DbFK018007 for cs530@merlot.usc.edu; Fri, 25 Mar 2005 21:13:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2Q5Dbio018001 for ; Fri, 25 Mar 2005 21:13:37 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2Q5DaR8017994 for ; Fri, 25 Mar 2005 21:13:36 -0800 Message-Id: <200503260513.j2Q5DaR8017994@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hw4. DES keys. Date: Fri, 25 Mar 2005 21:13:36 -0800 From: william@bourbon.usc.edu Someone wrote: > I see that all my keys are correct (same as the sample keys when we enc > usctommy.gif) but my final output is different. So I think I am doing > something wrong after I get the keys from the smartcard. I cant understand > what. Here is what I do. > > (pfn_secret_key_gen)(pss, hash, iv, key1, key2, key3); I assume you mean SC_3des_key_gen(). The outputs of this function are the iv, key1, key2, and key3 and they are *binary*!!! > // DES_cblock ivec, k1, k2, k3; > > DES_string_to_key((char*)iv, &ivec); > DES_string_to_key((char*)key1, &k1); > DES_string_to_key((char*)key2, &k2); > DES_string_to_key((char*)key3, &k3); Since iv, key1, key2, and key3 are *binary*, you should not do DES_string_to_key(). Just do memcpy(). You should know that iv, key1, key2, and key3 are *not* ASCII strings because they are 8 bytes long! If they are ASCII strings, each buffer must be at least 9 bytes long because the last byte must be '\0'. I'm surprised that at this stage, a few students are still confused about ASCII vs. binary and none of these students have come to see me during my office hours! Whether a buffer is ASCII or binary does not depend on whether the buffer is declared as unsigned char[] or char[] or void*. A buffer is just a pointer to a memory location. You can put anything in it! I mean *anything*! > DES_set_odd_parity(&k1); > DES_set_odd_parity(&k2); > DES_set_odd_parity(&k3); > > DES_set_key(&k1,&ks1); > DES_set_key(&k2,&ks2); > DES_set_key(&k3,&ks3); > > while{ > . > DES_string_to_key((char*)iv, &ivec); > DES_ede3_cbc_encrypt(in_data,out_data,bytes_read,&ks1,&ks2,&ks3,&ivec,1); > .. > } Do not call DES_string_to_key() or anything. DES_ede3_cbc_encrypt() will modify ivec (by copying the last cipher block into it). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Mar 25 21:03:21 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2Q53Lja015306 for ; Fri, 25 Mar 2005 21:03:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2Q53xio012916 for ; Fri, 25 Mar 2005 21:03:59 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2Q53xBo012910 for cs530@merlot.usc.edu; Fri, 25 Mar 2005 21:03:59 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2Q53wio012904 for ; Fri, 25 Mar 2005 21:03:59 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2Q53w9H012900 for ; Fri, 25 Mar 2005 21:03:58 -0800 Message-Id: <200503260503.j2Q53w9H012900@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: about -so path Date: Fri, 25 Mar 2005 21:03:58 -0800 From: william@bourbon.usc.edu Someone wrote: > I am little bit confuse about -so path condition. As said in > specification, > > "If the -so commandline option is not specified, your program > should open the Smartcard shared library > from $HOME/lib/libhw4sc.so where $HOME denotes the HOME > environment variable. > Otherwise, your program should open sopath as the Smartcard > shared library." > > So when I checked my $HOME ,it doent contain lib directory. So > should we create the lib directory and put the > my libhw4sc.so file in it...or it would be your libhw4sc.so > file... If -so is not used, you should construct the path $HOME/lib/libhw4sc.so and do a dlopen() on that path. If it fails, just report it and quit. You don't need to check if the directory $HOME/lib exists neither do you have to create it if it doesn't exist. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Mar 25 17:11:39 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2Q1Bdja006508 for ; Fri, 25 Mar 2005 17:11:39 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2Q1CIio021238 for ; Fri, 25 Mar 2005 17:12:19 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2Q1CIB6021232 for cs530@merlot.usc.edu; Fri, 25 Mar 2005 17:12:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2Q1CHio021223 for ; Fri, 25 Mar 2005 17:12:17 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2Q1CHJK021219 for ; Fri, 25 Mar 2005 17:12:17 -0800 Message-Id: <200503260112.j2Q1CHJK021219@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: file submission Date: Fri, 25 Mar 2005 17:12:17 -0800 From: william@bourbon.usc.edu Someone wrote: > which files do we need to sumbit > from my guess its > 1)readme > 2)hw4.c > 3)smartcard.c > 4)Makefile > 5) and rest of .h files > Am i right ? Please make sure that you have done what's in: http://merlot.usc.edu/cs530-s05/submit.html#verify (except you should replace the "make" by "make hw4; make smartcard"). We will most likely copy the "secret.c" into your directory, so you don't have to include a "secret.c". But if for some reason, your code would not work with the "secret.c" from the spec, you should supply your own "secret.c" and make a note near the top of your README file. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Mar 25 17:03:40 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2Q13eja006180 for ; Fri, 25 Mar 2005 17:03:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2Q14Jio017385 for ; Fri, 25 Mar 2005 17:04:19 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2Q14In9017379 for cs530@merlot.usc.edu; Fri, 25 Mar 2005 17:04:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2Q14Iio017373 for ; Fri, 25 Mar 2005 17:04:18 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2Q14HCj017369 for ; Fri, 25 Mar 2005 17:04:17 -0800 Message-Id: <200503260104.j2Q14HCj017369@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: encrypting smartcard state Date: Fri, 25 Mar 2005 17:04:17 -0800 From: william@bourbon.usc.edu Someone wrote: > I don't see anything in the spec or in the emails to suggest that > we have to, but will we be marked down if we don't encrypt the > smartcard state before we return it via SC_Init(). After all if > our state contains the private keys the only thing preventing a > user application from getting them is that they don't know what > the format of the state is. Which is basically security through > obscurity. You do not have to do anything with the smarcard state. The smartcard state can be anything. It may not contain the private key. You can implement the smartcard with the smartcard state being NULL. You can also just stuff some garbage in the smartcard state. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Mar 25 12:45:42 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2PKjfja028950 for ; Fri, 25 Mar 2005 12:45:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2PKkLio020049 for ; Fri, 25 Mar 2005 12:46:21 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2PKkKlt020042 for cs530@merlot.usc.edu; Fri, 25 Mar 2005 12:46:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2PKkKio020036 for ; Fri, 25 Mar 2005 12:46:20 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2PKkKIB020029 for ; Fri, 25 Mar 2005 12:46:20 -0800 Message-Id: <200503252046.j2PKkKIB020029@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: private key and pub modulus size Date: Fri, 25 Mar 2005 12:46:20 -0800 From: william@bourbon.usc.edu Someone wrote: > I had a question on the theory part of the hw. > Should the private key and the public modulus always be of > the same size as it is in the given secret.c or can they be > of different sizes? Why or Why not? Since d must be less than n, it's not possible for the size of d to be larger than the size of n. Now, does it make sense to have the size of d to be smaller than the size of n? It doesn't because you want d to be large because there are more primes there. Therefore, d and n are of the same size. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Mar 25 12:26:14 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2PKQEja028258 for ; Fri, 25 Mar 2005 12:26:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2PKQsio012738 for ; Fri, 25 Mar 2005 12:26:55 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2PKQshU012731 for cs530@merlot.usc.edu; Fri, 25 Mar 2005 12:26:54 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2PKQrio012728 for ; Fri, 25 Mar 2005 12:26:53 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2PKQrt4012720 for ; Fri, 25 Mar 2005 12:26:53 -0800 Message-Id: <200503252026.j2PKQrt4012720@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: HW5 Date: Fri, 25 Mar 2005 12:26:53 -0800 From: william@bourbon.usc.edu Someone wrote: > I was just wondering when HW5 would be available. When I > last checked, it was not available yet and the due date is > only a week away. I mentioned during class last time that there will be nothing to turn in for HW5. Sorry that I haven't updated the web page yet. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Mar 25 08:07:25 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2PG7Pja018564 for ; Fri, 25 Mar 2005 08:07:25 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2PG85io015543 for ; Fri, 25 Mar 2005 08:08:05 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2PG85Kd015540 for cs530@merlot.usc.edu; Fri, 25 Mar 2005 08:08:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2PG84io015531 for ; Fri, 25 Mar 2005 08:08:04 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2PG84mC015527 for ; Fri, 25 Mar 2005 08:08:04 -0800 Message-Id: <200503251608.j2PG84mC015527@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: problem with tmpfile() Date: Fri, 25 Mar 2005 08:08:03 -0800 From: william@bourbon.usc.edu Someone wrote: > i am using FILE * tmpfile(void) to open a temporary file. > how do i control the location of the file? the tmpfile() function does > not take any parameters? You cannot control it. I think it will use /tmp which will not conform to our spec. > my application is completely based on streams, so i cannot use mkstemp > since it returns an integral file descriptor. You can use mkstemp(), then use fdopen() to "convert" the file descriptor to (FILE*). When you are done, you should do fclose() first and then do close(). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Mar 25 00:42:01 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2P8g1ja001343 for ; Fri, 25 Mar 2005 00:42:01 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2P8ggio023694 for ; Fri, 25 Mar 2005 00:42:42 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2P8ggOW023685 for cs530@merlot.usc.edu; Fri, 25 Mar 2005 00:42:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2P8gfio023681 for ; Fri, 25 Mar 2005 00:42:41 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2P8gftA023675 for ; Fri, 25 Mar 2005 00:42:41 -0800 Message-Id: <200503250842.j2P8gftA023675@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: public key Date: Fri, 25 Mar 2005 00:42:41 -0800 From: william@bourbon.usc.edu Someone wrote: > I was just wondering if since we are all using the same 'e', we > all have the same public key. The public key is . Every n (which is p times q) is most likely different, so every public key is most likely different. > I was wondering what would be the proper way to > generate a new public/private key pair in Openssl(i.e. we don't > call RSA_generate_key() with a given 'e'). I know this doesn't > have anything to do > with this project, but I've just been wondering. As long as e is relative prime to (p-1)(q-1), there is no problem using the same e (that's why there are only a few typical values for e). So, the way we are doing it is the proper way! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Mar 25 00:34:45 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2P8Yjja001028 for ; Fri, 25 Mar 2005 00:34:45 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2P8ZQio019793 for ; Fri, 25 Mar 2005 00:35:26 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2P8ZPNh019786 for cs530@merlot.usc.edu; Fri, 25 Mar 2005 00:35:26 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2P8ZPio019783 for ; Fri, 25 Mar 2005 00:35:25 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2P8ZPnt019776 for ; Fri, 25 Mar 2005 00:35:25 -0800 Message-Id: <200503250835.j2P8ZPnt019776@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: [cs530] sopath Date: Fri, 25 Mar 2005 00:35:25 -0800 From: william@bourbon.usc.edu Someone wrote: > If I omit "./" from sopath, then I get segmentation fault. > > For example, > If I command like following : > > hw4 -so libhw4sc.so sign file --> segmentation fault. > > I guess it's because of dlopen(). > > handle = dlopen(sopath, RTLD_NOW|RTLD_GLOBAL); > > How to resolve this? My guess is that there is another copy of libhw4sc.so that's being invoked when you do dlopen("libhw4sc.so",...). Look at your LD_LIBRARY_PATH and see if there is a libhw4sc.so somewhere in that path! If there is, delete it. We will run with "-so ./libhw4sc.so" to make sure that the right .so get picked up. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Mar 25 00:24:56 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2P8Ouja000634 for ; Fri, 25 Mar 2005 00:24:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2P8Paio014585 for ; Fri, 25 Mar 2005 00:25:36 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2P8Pa16014577 for cs530@merlot.usc.edu; Fri, 25 Mar 2005 00:25:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2P8PZio014574 for ; Fri, 25 Mar 2005 00:25:35 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2P8PZn2014570 for ; Fri, 25 Mar 2005 00:25:35 -0800 Message-Id: <200503250825.j2P8PZn2014570@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Temporary file in edit Date: Fri, 25 Mar 2005 00:25:35 -0800 From: william@bourbon.usc.edu Someone wrote: > its clear to me that we have to create a temporary filename using > mkstemp() in and save it in $HOME/tmp/ when the user edits an > existing file. > > My question is, when a user edits a file which does not exist, we > have to encrypt the new file and save the encrypted contents in > that file itself. Can we use a temporary file with a fixed name > during this process? No! What if you suspend the first session, gone to lunch, forgot to resume and start another session? > Can we create that temporarty file in the > current directory? or do we have to make all temporary files in > the $HOME/tmp directory using mkstemp(). All in $HOME/tmp with mkstemp() or equivalent. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Mar 24 16:51:00 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2P0p0ja016196 for ; Thu, 24 Mar 2005 16:51:00 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2P0pgio003096 for ; Thu, 24 Mar 2005 16:51:42 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2P0pguR003091 for cs530@merlot.usc.edu; Thu, 24 Mar 2005 16:51:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2P0pfio003088 for ; Thu, 24 Mar 2005 16:51:41 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2P0pfS6003081 for ; Thu, 24 Mar 2005 16:51:41 -0800 Message-Id: <200503250051.j2P0pfS6003081@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Remove tmp file Date: Thu, 24 Mar 2005 16:51:41 -0800 From: william@bourbon.usc.edu Someone wrote: > I had same situation like below. > The problem was solved when I logged off and re-login. > I hope it helps. Great! But I've seen cases where it didn't work. I think it depends on why those files got there in the first place. But it's certainly easy to just logoff and give it a try. If it works, great. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu To: cs530@bourbon.usc.edu Sent: Thursday, March 24, 2005 12:25 PM Subject: Re: Remove tmp file Someone wrote: > I was testing my program. And maybe after some wierd test > cases now when I try deleting the tmp folder in my home > directory I get > > $rm -rf ~/tmp > rm: Unable to remove directory tmp: File exists > $ls -a tmp/ > . .. .nfs1EF6F1 > $ > > I am not able to remove the tmp directory in my home folder. > What can be the reason? > I checked the owner and persmissions thy show > > drwx------ 2 512 Mar 24 11:41 tmp If a directory is not empty, you cannot remove this directory. Unfortunately, due to NFS mounting of your home directories, NFS may create these .nfs* files and may not be cleaned up (sometimes because of program crashes). In this case, I don't think there is anything you can do. Eventually, these NFS created file will be deleted automatically. For now, if you just want to test your code and see if it can create such a directory, create $HOME/tmp1 instead. Just make sure that when you submit your HW4, you have "tmp" as the directory name. And as I've mentioned this before, you do not need to delete the $HOME/tmp directory programmatically. -- Bill Cheng // bill.cheng@usc.edu --Boundary_(ID_qY26h/awifADa/P+az2jkQ) Content-type: text/html; charset=ks_c_5601-1987 Content-transfer-encoding: base64 PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMCBUcmFuc2l0aW9uYWwv L0VOIj4NCjxIVE1MPjxIRUFEPg0KPE1FVEEgaHR0cC1lcXVpdj1Db250ZW50LVR5cGUgY29udGVu dD0idGV4dC9odG1sOyBjaGFyc2V0PWtzX2NfNTYwMS0xOTg3Ij4NCjxNRVRBIGNvbnRlbnQ9Ik1T SFRNTCA2LjAwLjI5MDAuMjYwNCIgbmFtZT1HRU5FUkFUT1I+DQo8U1RZTEU+PC9TVFlMRT4NCjwv SEVBRD4NCjxCT0RZIGJnQ29sb3I9I2Y3ZjdmMT4NCjxESVY+PEZPTlQgc2l6ZT0yPkkgaGFkIHNh bWUgc2l0dWF0aW9uIGxpa2UgYmVsb3cuIDwvRk9OVD48L0RJVj4NCjxESVY+PEZPTlQgc2l6ZT0y PlRoZSBwcm9ibGVtJm5ic3A7d2FzIHNvbHZlZCB3aGVuIEkgbG9nZ2VkIG9mZiBhbmQgDQpyZS1s b2dpbi48L0ZPTlQ+PC9ESVY+DQo8RElWPjxGT05UIHNpemU9Mj5JIGhvcGUgaXQgaGVscHMuPC9G T05UPjwvRElWPg0KPERJVj48Rk9OVCBzaXplPTI+PC9GT05UPiZuYnNwOzwvRElWPg0KPEJMT0NL UVVPVEUgDQpzdHlsZT0iUEFERElORy1SSUdIVDogMHB4OyBQQURESU5HLUxFRlQ6IDVweDsgTUFS R0lOLUxFRlQ6IDVweDsgQk9SREVSLUxFRlQ6ICMwMDAwMDAgMnB4IHNvbGlkOyBNQVJHSU4tUklH SFQ6IDBweCI+DQogIDxESVYgc3R5bGU9IkZPTlQ6IDEwcHQgsby4siI+LS0tLS0gT3JpZ2luYWwg TWVzc2FnZSAtLS0tLSA8L0RJVj4NCiAgPERJViANCiAgc3R5bGU9IkJBQ0tHUk9VTkQ6ICNlNGU0 ZTQ7IEZPTlQ6IDEwcHQgsby4sjsgZm9udC1jb2xvcjogYmxhY2siPjxCPkZyb206PC9CPiA8QSAN CiAgdGl0bGU9d2lsbGlhbUBib3VyYm9uLnVzYy5lZHUgDQogIGhyZWY9Im1haWx0bzp3aWxsaWFt QGJvdXJib24udXNjLmVkdSI+d2lsbGlhbUBib3VyYm9uLnVzYy5lZHU8L0E+IDwvRElWPg0KICA8 RElWIHN0eWxlPSJGT05UOiAxMHB0ILG8uLIiPjxCPlRvOjwvQj4gPEEgdGl0bGU9Y3M1MzBAYm91 cmJvbi51c2MuZWR1IA0KICBocmVmPSJtYWlsdG86Y3M1MzBAYm91cmJvbi51c2MuZWR1Ij5jczUz MEBib3VyYm9uLnVzYy5lZHU8L0E+IDwvRElWPg0KICA8RElWIHN0eWxlPSJGT05UOiAxMHB0ILG8 uLIiPjxCPlNlbnQ6PC9CPiBUaHVyc2RheSwgTWFyY2ggMjQsIDIwMDUgMTI6MjUgDQpQTTwvRElW Pg0KICA8RElWIHN0eWxlPSJGT05UOiAxMHB0ILG8uLIiPjxCPlN1YmplY3Q6PC9CPiBSZTogUmVt b3ZlIHRtcCBmaWxlPC9ESVY+DQogIDxESVY+PEJSPjwvRElWPlNvbWVvbmUgd3JvdGU6PEJSPjxC Uj4mbmJzcDsgJmd0OyBJIHdhcyB0ZXN0aW5nIG15IHByb2dyYW0uIEFuZCANCiAgbWF5YmUgYWZ0 ZXIgc29tZSB3aWVyZCB0ZXN0PEJSPiZuYnNwOyAmZ3Q7IGNhc2VzIG5vdyB3aGVuIEkgdHJ5IGRl bGV0aW5nIHRoZSANCiAgdG1wIGZvbGRlciBpbiBteSBob21lPEJSPiZuYnNwOyAmZ3Q7IGRpcmVj dG9yeSBJIGdldDxCUj4mbmJzcDsgJmd0OyA8QlI+Jm5ic3A7IA0KICAmZ3Q7ICRybSAtcmYgfi90 bXA8QlI+Jm5ic3A7ICZndDsgcm06IFVuYWJsZSB0byByZW1vdmUgZGlyZWN0b3J5IHRtcDogRmls ZSANCiAgZXhpc3RzPEJSPiZuYnNwOyAmZ3Q7ICRscyAtYSB0bXAvJm5ic3A7Jm5ic3A7Jm5ic3A7 Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7IA0KICA8QlI+Jm5ic3A7ICZndDsgLiZuYnNwOyZuYnNw OyZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwOyANCiAgLi4m bmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsgLm5m czFFRjZGMTxCUj4mbmJzcDsgDQogICZndDsgJCA8QlI+Jm5ic3A7ICZndDsgPEJSPiZuYnNwOyAm Z3Q7IEkgYW0gbm90IGFibGUgdG8gcmVtb3ZlIHRoZSB0bXAgDQogIGRpcmVjdG9yeSBpbiBteSBo b21lIGZvbGRlci48QlI+Jm5ic3A7ICZndDsgV2hhdCBjYW4gYmUgdGhlIHJlYXNvbj88QlI+Jm5i c3A7IA0KICAmZ3Q7IEkgY2hlY2tlZCB0aGUgb3duZXIgYW5kIHBlcnNtaXNzaW9ucyB0aHkgc2hv dzxCUj4mbmJzcDsgJmd0OyA8QlI+Jm5ic3A7IA0KICAmZ3Q7IGRyd3gtLS0tLS0mbmJzcDsmbmJz cDsgMiA1MTIgTWFyIDI0IDExOjQxIHRtcDxCUj48QlI+SWYgYSBkaXJlY3RvcnkgaXMgDQogIG5v dCBlbXB0eSwgeW91IGNhbm5vdCByZW1vdmUgdGhpczxCUj5kaXJlY3RvcnkuJm5ic3A7IFVuZm9y dHVuYXRlbHksIGR1ZSB0byANCiAgTkZTIG1vdW50aW5nIG9mPEJSPnlvdXIgaG9tZSBkaXJlY3Rv cmllcywgTkZTIG1heSBjcmVhdGUgdGhlc2UgLm5mcyogDQogIGZpbGVzPEJSPmFuZCBtYXkgbm90 IGJlIGNsZWFuZWQgdXAgKHNvbWV0aW1lcyBiZWNhdXNlIG9mIA0KICBwcm9ncmFtPEJSPmNyYXNo ZXMpLjxCUj48QlI+SW4gdGhpcyBjYXNlLCBJIGRvbid0IHRoaW5rIHRoZXJlIGlzIGFueXRoaW5n IHlvdSANCiAgY2FuPEJSPmRvLiZuYnNwOyBFdmVudHVhbGx5LCB0aGVzZSBORlMgY3JlYXRlZCBm aWxlIHdpbGwgYmUgDQogIGRlbGV0ZWQ8QlI+YXV0b21hdGljYWxseS4mbmJzcDsgRm9yIG5vdywg aWYgeW91IGp1c3Qgd2FudCB0byB0ZXN0IHlvdXI8QlI+Y29kZSANCiAgYW5kIHNlZSBpZiBpdCBj YW4gY3JlYXRlIHN1Y2ggYSBkaXJlY3RvcnksIGNyZWF0ZTxCUj4kSE9NRS90bXAxIGluc3RlYWQu Jm5ic3A7IA0KICBKdXN0IG1ha2Ugc3VyZSB0aGF0IHdoZW4geW91IHN1Ym1pdDxCUj55b3VyIEhX NCwgeW91IGhhdmUgInRtcCIgYXMgdGhlIA0KICBkaXJlY3RvcnkgbmFtZS48QlI+PEJSPkFuZCBh cyBJJ3ZlIG1lbnRpb25lZCB0aGlzIGJlZm9yZSwgeW91IGRvIG5vdCBuZWVkIA0KICB0bzxCUj5k ZWxldGUgdGhlICRIT01FL3RtcCBkaXJlY3RvcnkgcHJvZ3JhbW1hdGljYWxseS48QlI+LS08QlI+ QmlsbCBDaGVuZyAvLyANCiAgPEEgaHJlZj0ibWFpbHRvOmJpbGwuY2hlbmdAdXNjLmVkdSI+Ymls bC5jaGVuZ0B1c2MuZWR1PC9BPiAmbHQ7PEEgDQogIGhyZWY9Imh0dHA6Ly9tZXJsb3QudXNjLmVk dS93aWxsaWFtL3VzYy8iPlVSTDpodHRwOi8vbWVybG90LnVzYy5lZHUvd2lsbGlhbS91c2MvPC9B PiZndDs8QlI+PEJSPjwvQkxPQ0tRVU9URT48L0JPRFk+PC9IVE1MPg0K --Boundary_(ID_qY26h/awifADa/P+az2jkQ)-- Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Mar 24 12:24:43 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2OKOhja006185 for ; Thu, 24 Mar 2005 12:24:43 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2OKPPio029429 for ; Thu, 24 Mar 2005 12:25:25 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2OKPPM5029416 for cs530@merlot.usc.edu; Thu, 24 Mar 2005 12:25:25 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2OKPOio029413 for ; Thu, 24 Mar 2005 12:25:24 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2OKPODN029403 for ; Thu, 24 Mar 2005 12:25:24 -0800 Message-Id: <200503242025.j2OKPODN029403@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Remove tmp file Date: Thu, 24 Mar 2005 12:25:24 -0800 From: william@bourbon.usc.edu Someone wrote: > I was testing my program. And maybe after some wierd test > cases now when I try deleting the tmp folder in my home > directory I get > > $rm -rf ~/tmp > rm: Unable to remove directory tmp: File exists > $ls -a tmp/ > . .. .nfs1EF6F1 > $ > > I am not able to remove the tmp directory in my home folder. > What can be the reason? > I checked the owner and persmissions thy show > > drwx------ 2 512 Mar 24 11:41 tmp If a directory is not empty, you cannot remove this directory. Unfortunately, due to NFS mounting of your home directories, NFS may create these .nfs* files and may not be cleaned up (sometimes because of program crashes). In this case, I don't think there is anything you can do. Eventually, these NFS created file will be deleted automatically. For now, if you just want to test your code and see if it can create such a directory, create $HOME/tmp1 instead. Just make sure that when you submit your HW4, you have "tmp" as the directory name. And as I've mentioned this before, you do not need to delete the $HOME/tmp directory programmatically. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Mar 24 10:40:53 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2OIerja002199 for ; Thu, 24 Mar 2005 10:40:53 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2OIfZio015955 for ; Thu, 24 Mar 2005 10:41:35 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2OIfZfL015952 for cs530@merlot.usc.edu; Thu, 24 Mar 2005 10:41:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2OIfYio015944 for ; Thu, 24 Mar 2005 10:41:34 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2OIfYfY015940 for ; Thu, 24 Mar 2005 10:41:34 -0800 Message-Id: <200503241841.j2OIfYfY015940@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Temporary file Date: Thu, 24 Mar 2005 10:41:34 -0800 From: william@bourbon.usc.edu Someone wrote: > (1) I used tmpnam(),,,,but it get the following filename > "/var/tmp/aaaoYaaO0".. I thint that the path should be $Home/tmp/ > not /var/tmp...???? how could I assure that the path in the > tempfile name is "$Home/tmp/ "???? Do "man tmpnam" and use the right form. > (2)I used tempnam(dir, NULL)...//note different than above ..... > and i gave dir the value "$Home/tmp",,,but still when i got the > resulting filename i got the path "/var/tmp/" ....do you have any > idea how we can select the path that we want to create the file > in...? Put the right information in the first argument when you call tempnam(). If it doesn't work, debug! I hope you are not using $Home and have replaced it with the actual directory name of your home directory. > (3)I thought of changing "/var/tmp" into "$Home/tmp" (simple > string operations)...Is this way acceptable??? I am afraid that > the generated filename will not be uinique since it is generated > relative to "/var/tmp????Please could you infesize on that... The spec says that this file must be in the "tmp" subdirectory of your home directory. Doing it in /var/tmp or /tmp will get points deducted. But if you don't have the time, losing a few points here may be worth it. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Wednesday, March 23, 2005 11:58 pm Subject: Re: Temporary file > Someone wrote: > > > (1) The temporary file ,,,,does it have a specific name or we > > have to use "tmpnam" function??? > > You can use tmpnam() or mkstemp(). > > > (2)If the file doesn't exist,,,when we open the editor ....do we > > open the temporary file,,,and then after saving it we create the > > ecrypted version of the file with the same specific name that is > > provided by the user?? > > Whether the target file (the filename specified by the user) > exists or not, you should *always* create a file in the > temporary directory and make sure its protection is 0600. > > If the target file exists, you decrypt it and write the > clear text file into this temporary file. If the target > file does not exist, you don't need to do anything. > > Then you take the SHA1 hash of this temporary file (so > you can later decide if it has changed). > > You run your editor and give it this temporary file name. > When the editor quits, you compute SHA1 hash again. If > it's the same as before, you don't need to do encryption > to create the target file again. If SHA1 hash has changed, > you do your encryption and write to the target file. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Mar 24 10:35:20 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2OIZKja001946 for ; Thu, 24 Mar 2005 10:35:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2OIa2io013883 for ; Thu, 24 Mar 2005 10:36:02 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2OIa217013874 for cs530@merlot.usc.edu; Thu, 24 Mar 2005 10:36:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2OIa2io013871 for ; Thu, 24 Mar 2005 10:36:02 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2OIa2hx013867 for ; Thu, 24 Mar 2005 10:36:02 -0800 Message-Id: <200503241836.j2OIa2hx013867@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: opendir Date: Thu, 24 Mar 2005 10:36:01 -0800 From: william@bourbon.usc.edu Someone wrote: > (1)When i tried to do opendir to check whether the directory > exists or not.....it returns NULL even if the directory > exists!!!!! I did some testing and I figured out that if the > permission mode is 0700 it returns NULL even if the directory > exists....So how could we check whether a directory exists or not > if "opendir" in our case always returns NULL?? If it doesn't work, don't do it! Call stat() and check if it's a directory. > (2)I tried mkdir() with a directory that already exists....I > found that calling it again in a directory that doesn't exist > will not erase the existing directory...so can we just alway > call mkdir()...without checking whether the directory exists or > not since it doesn't erase the directory if it already > exists....??????????/ Let's hope it works when the grader grades. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Mar 24 10:33:11 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2OIXBja001865 for ; Thu, 24 Mar 2005 10:33:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2OIXsio013073 for ; Thu, 24 Mar 2005 10:33:54 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2OIXrNu013066 for cs530@merlot.usc.edu; Thu, 24 Mar 2005 10:33:53 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2OIXrio013057 for ; Thu, 24 Mar 2005 10:33:53 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2OIXrgi013053 for ; Thu, 24 Mar 2005 10:33:53 -0800 Message-Id: <200503241833.j2OIXrgi013053@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Temporary file Date: Thu, 24 Mar 2005 10:33:53 -0800 From: william@bourbon.usc.edu Someone wrote: > I have asked you before but didnt get it clear then. I wanted to > know why does one need to use the mkstemp() function and create > the file explicitly. > Cant we assume that the user saves the file and exits and > therefore the file is created automatically? So that you use the same code whether the target file exists or not. If the target file exists, you must use mkstemp() to create a temporary file and decrypts the target file into this temporary file. You cannot use a fixed file name in the temporary directory because you may end up editing the same file! -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Wednesday, March 23, 2005 11:58 pm Subject: Re: Temporary file > Someone wrote: > > > (1) The temporary file ,,,,does it have a specific name or we > > have to use "tmpnam" function??? > > You can use tmpnam() or mkstemp(). > > > (2)If the file doesn't exist,,,when we open the editor ....do we > > open the temporary file,,,and then after saving it we create the > > ecrypted version of the file with the same specific name that is > > provided by the user?? > > Whether the target file (the filename specified by the user) > exists or not, you should *always* create a file in the > temporary directory and make sure its protection is 0600. > > If the target file exists, you decrypt it and write the > clear text file into this temporary file. If the target > file does not exist, you don't need to do anything. > > Then you take the SHA1 hash of this temporary file (so > you can later decide if it has changed). > > You run your editor and give it this temporary file name. > When the editor quits, you compute SHA1 hash again. If > it's the same as before, you don't need to do encryption > to create the target file again. If SHA1 hash has changed, > you do your encryption and write to the target file. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Mar 24 10:30:15 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2OIUFja001784 for ; Thu, 24 Mar 2005 10:30:15 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2OIUvio011963 for ; Thu, 24 Mar 2005 10:30:57 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2OIUvYM011953 for cs530@merlot.usc.edu; Thu, 24 Mar 2005 10:30:57 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2OIUuio011948 for ; Thu, 24 Mar 2005 10:30:56 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2OIUucD011941 for ; Thu, 24 Mar 2005 10:30:56 -0800 Message-Id: <200503241830.j2OIUucD011941@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Temporary file Date: Thu, 24 Mar 2005 10:30:56 -0800 From: william@bourbon.usc.edu Someone wrote: > (1) You said that we create a file with 0600 mode ...before > calling the editor?I found that there is a function "fd = > creat(filenaame, mode)" that creates a file with sepecific > mode....The question is do I have to close the file using fclose > after creating it using this function,,,nothing is sain the man > pages regarding that???Is there any better way of creating a file > with specific mode? I'm not familiar with creat(). But if it works for you, go for it. If you use open(), then you can use fchmod() to change the mode. If you use fopen(), you can call fileno() to get the file descriptor number from something of type (FILE*). -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Wednesday, March 23, 2005 11:58 pm Subject: Re: Temporary file > Someone wrote: > > > (1) The temporary file ,,,,does it have a specific name or we > > have to use "tmpnam" function??? > > You can use tmpnam() or mkstemp(). > > > (2)If the file doesn't exist,,,when we open the editor ....do we > > open the temporary file,,,and then after saving it we create the > > ecrypted version of the file with the same specific name that is > > provided by the user?? > > Whether the target file (the filename specified by the user) > exists or not, you should *always* create a file in the > temporary directory and make sure its protection is 0600. > > If the target file exists, you decrypt it and write the > clear text file into this temporary file. If the target > file does not exist, you don't need to do anything. > > Then you take the SHA1 hash of this temporary file (so > you can later decide if it has changed). > > You run your editor and give it this temporary file name. > When the editor quits, you compute SHA1 hash again. If > it's the same as before, you don't need to do encryption > to create the target file again. If SHA1 hash has changed, > you do your encryption and write to the target file. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Mar 24 10:24:23 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2OIONja001540 for ; Thu, 24 Mar 2005 10:24:23 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2OIP5io009707 for ; Thu, 24 Mar 2005 10:25:05 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2OIP5JA009700 for cs530@merlot.usc.edu; Thu, 24 Mar 2005 10:25:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2OIP5io009694 for ; Thu, 24 Mar 2005 10:25:05 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2OIP5NY009690 for ; Thu, 24 Mar 2005 10:25:05 -0800 Message-Id: <200503241825.j2OIP5NY009690@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: HW4-directory Date: Thu, 24 Mar 2005 10:25:04 -0800 From: william@bourbon.usc.edu Someone wrote: > Hopefully this isn't something you would test, but in the edit part of the > homework, if someone passes in a directory name instead of a filename, fopen > will still return true (like it would for a file that exists) and then the > program will seg fault. Is there a good way to ignore directories? Do I > need to check using fopen AND opendir? We won't test it. But if you want to know if it's a directory, you can call stat() and check if the st_mode field has the S_IFDIR bit set. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Wednesday, March 23, 2005 11:17 PM Subject: Re: HW4-directory > Someone wrote: > > > (1) Could you give us any hint in figuring out whether a > > specific directory exists or not???(that is needed in the > > edit part of the hw) > > You can do opendir() and see if it succeeds. > > > (2)Could you give us any hint in how to set the permission of > > the directory??? > > You can do mkdir(..., 0700) when you create the directory. > If the directory already exists, you must not change its > permission. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Mar 23 23:57:35 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2O7vZja009689 for ; Wed, 23 Mar 2005 23:57:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2O7wJio017016 for ; Wed, 23 Mar 2005 23:58:19 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2O7wJ3a017007 for cs530@merlot.usc.edu; Wed, 23 Mar 2005 23:58:19 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2O7wIio017001 for ; Wed, 23 Mar 2005 23:58:18 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2O7wIgO016997 for ; Wed, 23 Mar 2005 23:58:18 -0800 Message-Id: <200503240758.j2O7wIgO016997@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Temporary file Date: Wed, 23 Mar 2005 23:58:18 -0800 From: william@bourbon.usc.edu Someone wrote: > (1) The temporary file ,,,,does it have a specific name or we > have to use "tmpnam" function??? You can use tmpnam() or mkstemp(). > (2)If the file doesn't exist,,,when we open the editor ....do we > open the temporary file,,,and then after saving it we create the > ecrypted version of the file with the same specific name that is > provided by the user?? Whether the target file (the filename specified by the user) exists or not, you should *always* create a file in the temporary directory and make sure its protection is 0600. If the target file exists, you decrypt it and write the clear text file into this temporary file. If the target file does not exist, you don't need to do anything. Then you take the SHA1 hash of this temporary file (so you can later decide if it has changed). You run your editor and give it this temporary file name. When the editor quits, you compute SHA1 hash again. If it's the same as before, you don't need to do encryption to create the target file again. If SHA1 hash has changed, you do your encryption and write to the target file. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Mar 23 23:17:11 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2O7HBja008144 for ; Wed, 23 Mar 2005 23:17:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2O7Hsio027873 for ; Wed, 23 Mar 2005 23:17:55 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2O7Hsg2027867 for cs530@merlot.usc.edu; Wed, 23 Mar 2005 23:17:54 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2O7Hsio027858 for ; Wed, 23 Mar 2005 23:17:54 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2O7HsP6027854 for ; Wed, 23 Mar 2005 23:17:54 -0800 Message-Id: <200503240717.j2O7HsP6027854@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: HW4-directory Date: Wed, 23 Mar 2005 23:17:54 -0800 From: william@bourbon.usc.edu Someone wrote: > (1) Could you give us any hint in figuring out whether a > specific directory exists or not???(that is needed in the > edit part of the hw) You can do opendir() and see if it succeeds. > (2)Could you give us any hint in how to set the permission of > the directory??? You can do mkdir(..., 0700) when you create the directory. If the directory already exists, you must not change its permission. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Mar 23 23:14:56 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2O7Euja008063 for ; Wed, 23 Mar 2005 23:14:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2O7Feio026654 for ; Wed, 23 Mar 2005 23:15:40 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2O7FeLr026649 for cs530@merlot.usc.edu; Wed, 23 Mar 2005 23:15:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2O7Fdio026646 for ; Wed, 23 Mar 2005 23:15:40 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2O7FdXr026642 for ; Wed, 23 Mar 2005 23:15:39 -0800 Message-Id: <200503240715.j2O7FdXr026642@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: HW4-questions Date: Wed, 23 Mar 2005 23:15:39 -0800 From: william@bourbon.usc.edu Someone wrote: > (1) Is there any fucntion that tells me whether if a file exists > or not?this is needed in the "edit" part of the hw...?Actually, I > thought of something is to try use fopen(),,,and if i got a NULL > pointer that means the file doesn't exist otherwise the file > exists...BUT is there a better way...? fopen() should do the trick. If you also call stat(). > (2)For RSA_generate_key() ,,,the openssl doc says "The > pseudo-random number generator must be seeded prior to calling > RSA_generate_key()",,,,but I tried using RSA_generate_key() > several times without seeding the random generator and I got > different results.....My question do we have to seed the random > generator because I am getting different results without seeding > it? You don't need to seed it. I think it's seeded automatically if you haven't seeded it. > (3)You said to use RAND_bytes funciton in generating the random > 20 bytes....The openssl doc says that "An error occurs if the > PRNG has not been seeded with enough randomness to ensure an > unpredictable byte sequence",,,,but I called it several times > without seeding and I got different results without any > error....The question is do we have to seed it or not? You don't need to seed it. I think it's seeded automatically if you haven't seeded it. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Mar 23 22:38:20 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2O6cKja006584 for ; Wed, 23 Mar 2005 22:38:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2O6d4io007065 for ; Wed, 23 Mar 2005 22:39:04 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2O6d3LW007055 for cs530@merlot.usc.edu; Wed, 23 Mar 2005 22:39:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2O6d2io007050 for ; Wed, 23 Mar 2005 22:39:03 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2O6d2bu007040 for ; Wed, 23 Mar 2005 22:39:02 -0800 Message-Id: <200503240639.j2O6d2bu007040@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Verify signature Date: Wed, 23 Mar 2005 22:39:02 -0800 From: william@bourbon.usc.edu Someone wrote: > For the hw4 verify command the spec says that the input will be > in Hex. So that means that we will have to convert it to binary > before passing it into the RSA_public_decrypt(). Can you drop a > hint on how to convert a string from hex to binary. Well, a character in hexstring has a value of either '0' through '9' or 'a' through 'f' (assuming you convert everything to lower case first). If it's between '0' and '9', you need to subtract '0' from it. If it's between 'a' and 'f', you need to substract 'a' from it and then add 10. Then if it's the upper nibble (4 byte quantity), you should shift left 4 times. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Mar 23 22:35:15 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2O6ZFja006434 for ; Wed, 23 Mar 2005 22:35:15 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2O6Zwio005414 for ; Wed, 23 Mar 2005 22:35:58 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2O6Zwpm005409 for cs530@merlot.usc.edu; Wed, 23 Mar 2005 22:35:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2O6Zwio005406 for ; Wed, 23 Mar 2005 22:35:58 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2O6ZwfE005402 for ; Wed, 23 Mar 2005 22:35:58 -0800 Message-Id: <200503240635.j2O6ZwfE005402@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: segementation fault Date: Wed, 23 Mar 2005 22:35:57 -0800 From: william@bourbon.usc.edu Someone wrote: > when i run this i got segmentation error. > RSA_public_decrypt(RSA_size(rsa),fromfile,to,rsa,RSA_PKCS1_PADDING); > > here buffer to is set to RSA_size(rsa) > and fromfile is a char buffer that has the same data as sig.txt file > > now my question is > fromfile contains the hexadecimal data. do we need to convert > it to binary or to big number before passing > it RSA_public_decrypt function? >From reading the spec: http://www.openssl.org/docs/crypto/RSA_private_encrypt.html It doesn't seem that the 2nd argument to RSA_public_decrypt() should be a hexstring. > as from the last reply from you, i think rsa->d isnt the > problem. so i think ans to above question must be solution > to my problem It could very well be. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Mar 23 16:42:05 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2O0g5ja025770 for ; Wed, 23 Mar 2005 16:42:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2O0gnio029261 for ; Wed, 23 Mar 2005 16:42:49 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2O0gn6a029256 for cs530@merlot.usc.edu; Wed, 23 Mar 2005 16:42:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2O0gnio029253 for ; Wed, 23 Mar 2005 16:42:49 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2O0gmBJ029249 for ; Wed, 23 Mar 2005 16:42:48 -0800 Message-Id: <200503240042.j2O0gmBJ029249@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: rsa->d Date: Wed, 23 Mar 2005 16:42:48 -0800 From: william@bourbon.usc.edu Someone wrote: > while verify the signature we dont need rsa->d . so while > creating rsa structre i assiged rsa->d to null vaule. but it > gives me segemention error while i call RSA_public_decrypt() > function my doubt is that its because of rsa->d's value. as i > have checked the rest of the parameters and they looked fine When you do RSA_new(), rsa->d is set to NULL. So I don't see why doing it again would cause segmentation error. Often, when you get segmentation fault, it's not what you just did, it's what you did before. So, it may be hard to tell exactly what's cause the crash. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Mar 23 14:45:01 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2NMj1ja021315 for ; Wed, 23 Mar 2005 14:45:01 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2NMjkio020253 for ; Wed, 23 Mar 2005 14:45:46 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2NMjkpq020244 for cs530@merlot.usc.edu; Wed, 23 Mar 2005 14:45:46 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2NMjjio020241 for ; Wed, 23 Mar 2005 14:45:45 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2NMji1n020231 for ; Wed, 23 Mar 2005 14:45:45 -0800 Message-Id: <200503232245.j2NMji1n020231@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: about \n Date: Wed, 23 Mar 2005 14:45:44 -0800 From: william@bourbon.usc.edu Someone wrote: > I am getting confused with adding \n to our singed data file ( > file that we get after running hw4 [-so sopath] sign file > command) > if i dont do that diff command fails with example file (sig.txt ) > just couse my file is missing \n . and if i add it i needed add > one character while allocating buffer when i am decrypting that > file. I am just wondering what will be the standardize solution You definitely need to output the '\n' when you sign. Otherwise, diff will fail and you will lose points. Given that, when you read the data back, you can just read 256 bytes. I don't understand why you must read the '\n' character! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Mar 23 14:15:35 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2NMFZja018950 for ; Wed, 23 Mar 2005 14:15:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2NMGJio009186 for ; Wed, 23 Mar 2005 14:16:19 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2NMGJ30009184 for cs530@merlot.usc.edu; Wed, 23 Mar 2005 14:16:19 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2NMGJio009175 for ; Wed, 23 Mar 2005 14:16:19 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2NMGIrT009171 for ; Wed, 23 Mar 2005 14:16:18 -0800 Message-Id: <200503232216.j2NMGIrT009171@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: About no. of padding bytes Date: Wed, 23 Mar 2005 14:16:18 -0800 From: william@bourbon.usc.edu Someone wrote: > When I checked ~csci530/public/hw4/f4 and ~csci530/public/hw4/f10 > files for my encryption function , "diff" commands gives me > difference between ur ~csci530/public/hw4/f4.enc and my > f4.enc(same for 'f10.enc'). > > And difference between two files are no. of padding byte (means > only 4th byte of encrypted file) which is 8 in your file and 0 > in my file. I am finding no. of padding bytes by > filesize%8(and remainder would be my no. of padding bytes). It > means I am considering last 8 bits as 1 byte and you are > considering > last 8 bits as 8 bits. So Am I wrong or both things are valid. The spec says: The next byte is the number of bytes in the last 8-byte block of the original file (which must be between 1 and 8, inclusive). So, it cannot be zero! You can simply do: if (this_byte == 0) this_byte = 8; -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Mar 23 12:38:59 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2NKcxja014917 for ; Wed, 23 Mar 2005 12:38:59 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2NKdiio006198 for ; Wed, 23 Mar 2005 12:39:44 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2NKdith006196 for cs530@merlot; Wed, 23 Mar 2005 12:39:44 -0800 Date: Wed, 23 Mar 2005 12:39:44 -0800 From: william@bourbon.usc.edu Message-Id: <200503232039.j2NKdith006196@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: partial credit in midterm exam... Hi, Just want to mention something related to partial credits in the midterm exam... The main reason most people lost points in the midterm was that the *best* answer was not given. If you write down a possible answer which is not the best answer, you most likely only got partial credit for it. Please keep this in mind when you come to discuss your midterm exam. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Mar 23 12:14:30 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2NKEUja013868 for ; Wed, 23 Mar 2005 12:14:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2NKFEio030041 for ; Wed, 23 Mar 2005 12:15:14 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2NKFERI030036 for cs530@merlot.usc.edu; Wed, 23 Mar 2005 12:15:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2NKFDio030033 for ; Wed, 23 Mar 2005 12:15:13 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2NKFDwh030023 for ; Wed, 23 Mar 2005 12:15:13 -0800 Message-Id: <200503232015.j2NKFDwh030023@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Problem with verify Date: Wed, 23 Mar 2005 12:15:13 -0800 From: william@bourbon.usc.edu Someone wrote: > I called the RSA_public_decrypt(128, buffer_final, > rsa_decrypt_value, rsa,RSA_PKCS1_PADDING ); function and which > returns -1 which means error. > here is my value before calling this function > buffer_final:718492d2728fe2e352f3937563c5e4a955a4f3e171e5e1f5b1b0e163ffc016e46f57b623f51177c394750707d459e463b3d4e1f13112757f0968b837e481c138e245369375757946257324749049e15635f18970b0e56f2803e82f71277964ef412f745867e272b87f66c2044001d997f37269e240c765c40f81644465fff2f5 > rsa: > Modulus (1024 bit): > 00:ca:a2:77:bf:a3:fb:b5:69:c3:85:12:8d:e5:4c: > 54:4a:26:29:95:8f:40:9c:24:ee:75:11:0f:60:31: > 6d:2e:e6:69:c9:73:28:e8:73:8f:aa:b1:74:30:a8: > 3c:00:28:58:20:02:a0:11:13:83:1f:b1:cf:ff:ae: > 08:5e:87:75:c9:91:1a:a0:ab:b1:7e:ef:da:d1:34: > d6:51:c0:3a:29:19:f3:a4:c9:81:d6:16:00:5d:75: > 60:b2:8a:a0:fd:f2:22:e4:26:da:dc:60:3a:dc:3d: > 7a:da:9f:af:ce:93:71:b1:91:64:7c:61:4e:43:69: > 93:d7:24:0a:52:f3:18:71:fd > Exponent: 65537 (0x10001) > > and > rsa_decrypt_value is a char buffer of 20 bytes long. I also > checked with longer buffer size but it has same problems > > Can you give me any hint. I completed my project other than > this and worked on this things from tw days to debug this thing Why is the first byte of the modulus 00? You gave 129 bytes of data in your modulus. Is this the problem? Also, we have done RSA encryption and decryption in lectures. What should be the size of the output buffer for *any* RSA public encrypt/decryption function? RSA_public_decrypt() is doing (e^c mod n) where ^ denotes exponentiation. The output buffer must be at least the signature size! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Mar 23 00:06:51 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2N86pja018784 for ; Wed, 23 Mar 2005 00:06:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2N87bio002374 for ; Wed, 23 Mar 2005 00:07:37 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2N87b7o002368 for cs530@merlot.usc.edu; Wed, 23 Mar 2005 00:07:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2N87bio002364 for ; Wed, 23 Mar 2005 00:07:37 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2N87aJi002354 for ; Wed, 23 Mar 2005 00:07:36 -0800 Message-Id: <200503230807.j2N87aJi002354@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Trouble with 3des Date: Wed, 23 Mar 2005 00:07:36 -0800 From: william@bourbon.usc.edu Someone wrote: > I am facing a problem with Triple DES thought you would have an idea. > My triple DES class encryots and decrypts perfectly well for the test case > "yesterday.txt". However when I used with usctommy.gif I face > the following problem. > The file is encrypted well.And decrypted well.The hash value > stored in the encrypted version is perfectly right when read from file. > However when I generate the hash of decrypted data to verify > the hashes,sha1 function throws out a different hash value. > Note: This occurs only for usctommy.gif, for yesterday.txt it > works alright. "yesterday.txt" is ASCII and "usctommy.gif" is binary. Are you sure you are reading your input correctly (not assuming that your data is ASCII)? Please try the data in ~csci530/public/hw4. Do "file ~csci530/public/hw4/f?" to file out which ones binary files. If your code does not work on all binary files, it's probably because you are using file reading functions that only works with ASCII files. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Mar 22 08:32:21 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2MGWLja015787 for ; Tue, 22 Mar 2005 08:32:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2MGX9io024634 for ; Tue, 22 Mar 2005 08:33:09 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2MGX9dI024623 for cs530@merlot.usc.edu; Tue, 22 Mar 2005 08:33:09 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2MGX8io024620 for ; Tue, 22 Mar 2005 08:33:08 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2MGX81I024616 for ; Tue, 22 Mar 2005 08:33:08 -0800 Message-Id: <200503221633.j2MGX81I024616@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: RSA keys Date: Tue, 22 Mar 2005 08:33:08 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm trying to create a RSA object from secret.c, and I need to fill > in the value of private exponent d. > Since RSA secrete key is represented as a single value > (HW4_rsa_pricate_key) in secret.c, how do I calculate d given the > private key and the public modulus n? HW4_rsa_private_key[] is d, it's just in a different number representation. You need to call one of the BN functions to convert HW3_rsa_private_key[] into BIGNUM. Please see: http://www.openssl.org/docs/crypto/bn.html There should be plenty of hints in the class message archive for you to figure this out. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Mar 22 08:27:15 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2MGRFja015539 for ; Tue, 22 Mar 2005 08:27:15 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2MGS3io022099 for ; Tue, 22 Mar 2005 08:28:03 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2MGS2BL022088 for cs530@merlot.usc.edu; Tue, 22 Mar 2005 08:28:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2MGS2io022083 for ; Tue, 22 Mar 2005 08:28:02 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2MGS2IO022071 for ; Tue, 22 Mar 2005 08:28:02 -0800 Message-Id: <200503221628.j2MGS2IO022071@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: About using emacs Date: Tue, 22 Mar 2005 08:28:02 -0800 From: william@bourbon.usc.edu Someone wrote: > i keeping this error "emacs: standard input is not a > tty", when i'm trying to open a file. what could be the > possible reason. I have no idea what it means! What is exactly the command you feed to system()? Please set a breakpoint right before you call system() and printout the command. For example, if you are doing something similar to: http://merlot.usc.edu/cs530-s05/homeworks/hw4/template/open.c do a "print cmd" in gdb right before system() is executed. May be you are invoking emacs incorrectly. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Mar 21 21:57:02 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2M5v2ja024227 for ; Mon, 21 Mar 2005 21:57:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2M5vpio010153 for ; Mon, 21 Mar 2005 21:57:51 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2M5vob3010143 for cs530@merlot.usc.edu; Mon, 21 Mar 2005 21:57:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2M5vnio010138 for ; Mon, 21 Mar 2005 21:57:49 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2M5vnC5010131 for ; Mon, 21 Mar 2005 21:57:49 -0800 Message-Id: <200503220557.j2M5vnC5010131@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: RSA_generate_key() may take time to run... Date: Mon, 21 Mar 2005 21:57:49 -0800 From: william@bourbon.usc.edu Someone wrote: > I was going back to add the callback functionality into my secret.c > generating file, and I'm a little confused as to what you want / how we > use a callback function. Do you just want it to say "Generating 1024 > bit key" and then a pseudo-progress bar made out of "+" like in the > perl script you showed us? Yes. > If so, could you explain how callback > functions work as the man page doesnt provide much insight.... The man page is at: http://www.openssl.org/docs/crypto/RSA_generate_key.html Looks like it has quite a bit of information about the callback functions. Just create a callback function and do some print statements in it to see what happens. Then you can do basically what "CA.pl -newca" does. -- Bill Cheng // bill.cheng@usc.edu On Mar 15, 2005, at 4:31 PM, william@bourbon.usc.edu wrote: > Hi, > > I've just added the following notes to the HW4 spec for the > secret command: > > [BC: Added 3/15/2005] > Please use the callback function to keep the user informed. > Try running the following command from an *empty* directory: > > ~csci551b/openssl/ssl/misc/CA.pl -newca > > and press the key (then you can press a few c > to skip the rest). > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Mar 21 16:56:35 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2M0uZja013090 for ; Mon, 21 Mar 2005 16:56:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2M0vPio010055 for ; Mon, 21 Mar 2005 16:57:25 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2M0vPjr010050 for cs530@merlot.usc.edu; Mon, 21 Mar 2005 16:57:25 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2M0vOio010044 for ; Mon, 21 Mar 2005 16:57:24 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2M0vONK010037 for ; Mon, 21 Mar 2005 16:57:24 -0800 Message-Id: <200503220057.j2M0vONK010037@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hw4 edit questions... Date: Mon, 21 Mar 2005 16:57:24 -0800 From: william@bourbon.usc.edu Someone wrote: > i wonder what is the difference between 0700 and 700. The > message below seems to refer them as different things. > My understanding of 700 is owner have read, write, execute > permission, but not groups and others. Am i on the right > track? Then what about 0700? I was using 0700 just to mean that it's in octal format. When we talk about file permissions on UNIX, that's the default anyway, so it's kind of redundant. So, 0700 and 700 mean the same thing here. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Monday, March 21, 2005 10:50 am Subject: Re: hw4 edit questions... > Someone wrote: > > > I had a couple of questions in the "edit" mode > > > > 1. can the file we are trying to edit be in a "non-existant" > > directory? should we create the recursive directories too? for > > example, > > > > $ ./hw4 edit ./test/test.txt > > < and ./test/ DOES NOT exist> > > No. > > > 2. Are we to assume that we have permissions to edit/create the > > file? for example > > > > $ ./hw4 edit test.txt OR $ ./hw4 edit ./test/test.txt > > < . has read-only permissions !> > > No. If you cannot create a file, you should let the user know. > > > 3. Do we force the $HOME/tmp to have 0700 permissions? That is, > > if it has a+r permissions, should we change it to 700 and after > > editing change back to a+r? (seems a bad idea if other programs > > are also using that dir!) > > No. If it does not exist, you should create it with 0700 > permission. If it exists already, you don't need to do > anything. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Mar 21 13:57:34 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2LLvYja006403 for ; Mon, 21 Mar 2005 13:57:34 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2LLwOio029111 for ; Mon, 21 Mar 2005 13:58:24 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2LLwNjb029106 for cs530@merlot.usc.edu; Mon, 21 Mar 2005 13:58:23 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2LLwMio029103 for ; Mon, 21 Mar 2005 13:58:22 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2LLwMTY029093 for ; Mon, 21 Mar 2005 13:58:22 -0800 Message-Id: <200503212158.j2LLwMTY029093@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Few question Date: Mon, 21 Mar 2005 13:58:22 -0800 From: william@bourbon.usc.edu Someone wrote: > On a sidenote to this email, I've downloaded a copy of the OpenSSL source > from www.openssl.org and in there you can use grep to look through the .c > files in the crypto directory to see what the error codes mean. It was > pretty helpful to me. In general, it's good to look through source code if you really need to find out what happened. It would even be better if you can compile the whole thing in debug mode and step through the code. The downside is that there is steep learning curve. Some of you may find useful to learn this way and some of you may not. Also, you cannot try to learn this when you don't have time (when the deadline is close). > I believe if you do "openssl version" on the command line on Nunki, you can > make sure you get the proper version to download. Yes. /home/scf-22/csci551b/openssl/bin/openssl is: OpenSSL 0.9.7d 17 Mar 2004 Even though a newer version is available, unlike ISD, I will not switch to the new version in the middle of a semester. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: To: Sent: Monday, March 21, 2005 1:01 PM Subject: Re: Few question > Someone wrote: > > > Is there a place where we can read what the openssl error codes > > mean? > > Other than the man pages, I don't know where else. > > > I am using BN_hex2bn to get the BINNUMs for RSA structure > > from secret.c, but I can't get that API to work successfully. I > > do the following > > > > len = BN_hex2bn(&(rsa->e), HW4_rsa_public_exponent); > > > > But I always get len 0 which is some kind of error. > > HW4_rsa_public_exponent[] is not in hexstring format! It's > in binary format. > > The function prototype for BN_hex2bn() says: > > int BN_hex2bn(BIGNUM **a, const char *str); > > It must be the case that str is null terminated! Therefore, > str must not be binary and thus you should know that this is > not the right function to use. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Mar 21 13:00:40 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2LL0eja004099 for ; Mon, 21 Mar 2005 13:00:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2LL1Tio008671 for ; Mon, 21 Mar 2005 13:01:30 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2LL1Toq008664 for cs530@merlot.usc.edu; Mon, 21 Mar 2005 13:01:29 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2LL1Sio008658 for ; Mon, 21 Mar 2005 13:01:29 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2LL1S2W008653 for ; Mon, 21 Mar 2005 13:01:28 -0800 Message-Id: <200503212101.j2LL1S2W008653@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Few question Date: Mon, 21 Mar 2005 13:01:28 -0800 From: william@bourbon.usc.edu Someone wrote: > Is there a place where we can read what the openssl error codes > mean? Other than the man pages, I don't know where else. > I am using BN_hex2bn to get the BINNUMs for RSA structure > from secret.c, but I can't get that API to work successfully. I > do the following > > len = BN_hex2bn(&(rsa->e), HW4_rsa_public_exponent); > > But I always get len 0 which is some kind of error. HW4_rsa_public_exponent[] is not in hexstring format! It's in binary format. The function prototype for BN_hex2bn() says: int BN_hex2bn(BIGNUM **a, const char *str); It must be the case that str is null terminated! Therefore, str must not be binary and thus you should know that this is not the right function to use. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Mar 21 12:56:34 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2LKuXja003923 for ; Mon, 21 Mar 2005 12:56:33 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2LKvNio007235 for ; Mon, 21 Mar 2005 12:57:23 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2LKvNdq007226 for cs530@merlot.usc.edu; Mon, 21 Mar 2005 12:57:23 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2LKvMio007223 for ; Mon, 21 Mar 2005 12:57:22 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2LKvMcx007219 for ; Mon, 21 Mar 2005 12:57:22 -0800 Message-Id: <200503212057.j2LKvMcx007219@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Query about test data Date: Mon, 21 Mar 2005 12:57:22 -0800 From: william@bourbon.usc.edu Someone wrote: > I wanted to verify if the keys you have posted due to running > secret key generation function on "yesnomaybe" > have been passed through DES_odd_parity() or not? I've passed them through DES_set_odd_parity(). > Re framing are they the keys after calling odd parity on them?? I'm not sure what you mean! What's "framing"? -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Mar 21 12:54:03 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2LKs3ja003842 for ; Mon, 21 Mar 2005 12:54:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2LKsrio006257 for ; Mon, 21 Mar 2005 12:54:54 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2LKsrJr006248 for cs530@merlot.usc.edu; Mon, 21 Mar 2005 12:54:53 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2LKsqio006245 for ; Mon, 21 Mar 2005 12:54:52 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2LKsq98006241 for ; Mon, 21 Mar 2005 12:54:52 -0800 Message-Id: <200503212054.j2LKsq98006241@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: return value of SC_get_signature_size Date: Mon, 21 Mar 2005 12:54:52 -0800 From: william@bourbon.usc.edu Someone wrote: > When I implemented SC_get_signature_size(), I used > RSA_size(rsa_object) to calculate signature size. > As you mentioned before, because RSA_size() returns number of > bytes, I think SC_get_signature_size() should return 128 in > byte, not 1024. > > In hw4 spec, the size of sig.txt is 256 characters, that is 128 byte. > > Do I misunderstand? It was a typo in my e-mail (I have no idea why I said 1024). You are correct that SC_get_signature_size() should return 128. This is consistent with the output of the provided sample program. -- Bill Cheng // bill.cheng@usc.edu > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Wednesday, March 16, 2005 11:37 pm > Subject: Re: smartcardstate again > > > Since you did not mention buf_return, I assume that you have > > allocated this buffer with malloc() for the right number of > > bytes (should be 1024 which should be the return valud of > > SC_get_signature_size()). You should also verify that > > RSA_size(rsa_object) is returning 1024. Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Mar 21 12:50:36 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2LKoaja003693 for ; Mon, 21 Mar 2005 12:50:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2LKpQio005012 for ; Mon, 21 Mar 2005 12:51:26 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2LKpPmH004998 for cs530@merlot.usc.edu; Mon, 21 Mar 2005 12:51:25 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2LKpOio004995 for ; Mon, 21 Mar 2005 12:51:24 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2LKpOVX004985 for ; Mon, 21 Mar 2005 12:51:24 -0800 Message-Id: <200503212051.j2LKpOVX004985@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hw4 sign buf_return Date: Mon, 21 Mar 2005 12:51:24 -0800 From: william@bourbon.usc.edu Someone wrote: > Is there any practical way to check in smartcard.c that buf_return has had > enough memory allocated? Unfortunately, none. > We can't assume that the user writing the > interface to the smartcard will use something like memset to zero out the > memory and since the size of the buf_return array should be dynamically > created by the interface programmer after calling SC_get_signature_size. It is fair to assume that the user (an appliaction) of your smartcard has been implemented according to spec. So, your smartcard can assume that the size of the buffer is at least as big as what's returned by SC_get_signature_size(). So, you can go ahead and clear so many bytes of memory in that buffer. > So strlen(buf_return), when used inside smartcard.c could return zero and > sizeof(buf_return) will return 4 (because it just takes the size of the > pointer), whether or not buf_return is big enough. Right. And one should never call strlen(buf_return) if buf_return can contain binary data. If the buffer does not contain '\0', that would be even worse because you will be readin garbage from the stack or the heap! > If RSA_private_encrypt > is called with a buf_return that is too small, it will generate a Bus Error. Yes. And that's a *desired* behavior! > Is there any other practical way to handle this? The only way I can think of is to do the whole thing in Java because you can do type checking at run time. But that would be another restriction you would place on both the smartcard and the application. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Mar 21 10:49:32 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2LInWja031327 for ; Mon, 21 Mar 2005 10:49:32 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2LIoMio026060 for ; Mon, 21 Mar 2005 10:50:22 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2LIoM8Q026055 for cs530@merlot.usc.edu; Mon, 21 Mar 2005 10:50:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2LIoLio026049 for ; Mon, 21 Mar 2005 10:50:21 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2LIoKdk026045 for ; Mon, 21 Mar 2005 10:50:20 -0800 Message-Id: <200503211850.j2LIoKdk026045@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hw4 edit questions... Date: Mon, 21 Mar 2005 10:50:20 -0800 From: william@bourbon.usc.edu Someone wrote: > I had a couple of questions in the "edit" mode > > 1. can the file we are trying to edit be in a "non-existant" > directory? should we create the recursive directories too? for > example, > > $ ./hw4 edit ./test/test.txt > < and ./test/ DOES NOT exist> No. > 2. Are we to assume that we have permissions to edit/create the > file? for example > > $ ./hw4 edit test.txt OR $ ./hw4 edit ./test/test.txt > < . has read-only permissions !> No. If you cannot create a file, you should let the user know. > 3. Do we force the $HOME/tmp to have 0700 permissions? That is, > if it has a+r permissions, should we change it to 700 and after > editing change back to a+r? (seems a bad idea if other programs > are also using that dir!) No. If it does not exist, you should create it with 0700 permission. If it exists already, you don't need to do anything. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Mar 21 10:46:36 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2LIkaja031241 for ; Mon, 21 Mar 2005 10:46:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2LIlQio024991 for ; Mon, 21 Mar 2005 10:47:26 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2LIlQa0024986 for cs530@merlot.usc.edu; Mon, 21 Mar 2005 10:47:26 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2LIlPio024983 for ; Mon, 21 Mar 2005 10:47:25 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2LIlPJR024978 for cs530; Mon, 21 Mar 2005 10:47:25 -0800 Date: Mon, 21 Mar 2005 10:47:25 -0800 From: william@bourbon.usc.edu Message-Id: <200503211847.j2LIlPJR024978@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: office hour moved today... Hi, I need to move the office hour for today (3/21/05) to SAL 226. (I'll leave a note on the door of SAL 342.) Sorry about the short notice. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Mar 20 19:09:59 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2L39xja028565 for ; Sun, 20 Mar 2005 19:09:59 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2L3Aoio022127 for ; Sun, 20 Mar 2005 19:10:51 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2L3AoVr022122 for cs530@merlot.usc.edu; Sun, 20 Mar 2005 19:10:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2L3Anio022116 for ; Sun, 20 Mar 2005 19:10:49 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2L3An9W022109 for ; Sun, 20 Mar 2005 19:10:49 -0800 Message-Id: <200503210310.j2L3An9W022109@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hw4 random questions Date: Sun, 20 Mar 2005 19:10:49 -0800 From: william@bourbon.usc.edu Someone wrote: > A few small questions for you: > > 1. When we submit our assignment, do you want us to submit a > secret.c file? No. But if you do, please use the one from the spec. If you have something else, the first thing we probably will do is to replace it with the one from the spec. So, please make sure that your smartcard will compile with the "secret.c" from the spec. > 2. When the edit command is being used, do you want any > printouts to STDOUT to show what's going on? Or will the grader > just manually check the creation/deletion of files? Please do not print additional messages to stdout, especially if stdout is meant to be redirected into a file. In general, you want to do things according to the spec. You can add support for commandline options such as "-debug" and document that additional information will be printed to stderr if such options are used. > 3. By default, when our Makefile creates libhw4sc.so, do you > want it created in the current directory ( ./ ) or in $HOME/lib? You *must* generate it in the current directory! If the grader wants to copy it to $HOME/lib, she will do it herself. In general, any software you write should not automatically create things in other directories! If you want, you can have a "make install" to copy files into other directories. But "make install" should be optional; i.e., your program should be able to function without having to run it. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Mar 20 17:35:42 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2L1Zgja025103 for ; Sun, 20 Mar 2005 17:35:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2L1aYio003535 for ; Sun, 20 Mar 2005 17:36:34 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2L1aXAe003532 for cs530@merlot.usc.edu; Sun, 20 Mar 2005 17:36:33 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2L1aXio003527 for ; Sun, 20 Mar 2005 17:36:33 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2L1aXDJ003520 for ; Sun, 20 Mar 2005 17:36:33 -0800 Message-Id: <200503210136.j2L1aXDJ003520@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: use of SC_public_query() Date: Sun, 20 Mar 2005 17:36:32 -0800 From: william@bourbon.usc.edu Someone wrote: > I just want to confirm the use of SC_public_query(). > Accoding to hw4 spec, SC_public_query() returns the RSA public > exponent and the RSA public modulus. > I think SC_public_query() can be used for veritfying a signature. > Am I right? > > If so, I wonder why there is not SC_verify(), just as SC_sign(), > but SC_public_query(). > > For SmartcardState, I think that every method can access > variables in secret.c so that maintaining SmartcardState is > useless. > Can you give me more specific idea about SmartcardState? We could easily have SC_verify() in our smartcard, but it was left out because it's an operation that only involves the public key; i.e., no secret required. So, your application can perform this if it has the public key (which is public exponent plus the public modulus). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Mar 20 13:48:06 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2KLm5ja016527 for ; Sun, 20 Mar 2005 13:48:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2KLmwio005941 for ; Sun, 20 Mar 2005 13:48:58 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2KLmvZR005936 for cs530@merlot.usc.edu; Sun, 20 Mar 2005 13:48:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2KLmvio005933 for ; Sun, 20 Mar 2005 13:48:57 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2KLmv1h005923 for ; Sun, 20 Mar 2005 13:48:57 -0800 Message-Id: <200503202148.j2KLmv1h005923@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hw4 edit option Date: Sun, 20 Mar 2005 13:48:57 -0800 From: william@bourbon.usc.edu Someone wrote: > just to confirm, > If the file provided is in wrong format or un-encrypted, do we > open the original file given by the user or try to do decryption > and open some "garbage" or give error message (files may have > corrupted headers, not enough bytes, etc). If the file does not begin with HW4 or if the SHA1 value does not match after you decrypt, I cannot think of a reason why you want to provide your dear user garbage! If you really want to provide garbage to the user when you know for sure it's going to be garbage, you should at least prompt the user if he/she would like to have some garbage. If your user says yes, then he/she deserves garbage. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Sunday, March 20, 2005 12:37 pm Subject: Re: hw4 edit option > Someone wrote: > > > i have 2 questions, > > -if a file provided to edit already exists, but it is not an > > encrypted file, do we just output it is wrong format or any > > other way to do this? > > Yes. Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Mar 20 13:41:04 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2KLf4ja016215 for ; Sun, 20 Mar 2005 13:41:04 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2KLfuio003378 for ; Sun, 20 Mar 2005 13:41:56 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2KLftuG003369 for cs530@merlot.usc.edu; Sun, 20 Mar 2005 13:41:55 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2KLftio003365 for ; Sun, 20 Mar 2005 13:41:55 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2KLftbq003359 for ; Sun, 20 Mar 2005 13:41:55 -0800 Message-Id: <200503202141.j2KLftbq003359@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Problem Date: Sun, 20 Mar 2005 13:41:54 -0800 From: william@bourbon.usc.edu Someone wrote: > I am getting wierd error msg when i tried to run your test > code for hw4 on my nunki account. The error msg is like: > > nunki.usc.edu(83): make hw4 > cc hw4.c -o hw4 > "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 20: undefined symbol: SHA_DIGEST_LENGTH > "hw4.c", line 23: warning: implicit function declaration: SHA1 > cc: acomp failed for hw4.c > make: *** [hw4] Error 2 > > I have already added openssl to my path by using (specified in hw2) > > setenv LD_LIBRARY_PATH /home/scf-22/csci551b/openssl/lib:/usr/lib > set path=(/home/scf-22/csci551b/openssl/bin $path) > rehash > > And one more thing, my hw2 doesnt have any problem with > #include but hw4 does have. > > Could you give me some hint for this problem..? How come your: cc hw4.c -o hw4 does not have a -I in it? Please read: http://merlot.usc.edu/cs530-s05/homeworks/hw2/index.html#compile carefully. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Mar 20 12:37:03 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2KKb3ja013783 for ; Sun, 20 Mar 2005 12:37:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2KKbtio012569 for ; Sun, 20 Mar 2005 12:37:55 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2KKbtSd012564 for cs530@merlot.usc.edu; Sun, 20 Mar 2005 12:37:55 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2KKbsio012561 for ; Sun, 20 Mar 2005 12:37:54 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2KKbstN012557 for ; Sun, 20 Mar 2005 12:37:54 -0800 Message-Id: <200503202037.j2KKbstN012557@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hw4 edit option Date: Sun, 20 Mar 2005 12:37:54 -0800 From: william@bourbon.usc.edu Someone wrote: > i have 2 questions, > -if a file provided to edit already exists, but it is not an > encrypted file, do we just output it is wrong format or any > other way to do this? Yes. > -do we use system calls to do the create directory ( tmp > folder), create files (tmp file), move files(from tmp to > currently working folder)? To create directory, you can call mkdir() or equivalent. To create files in $HOME/tmp, you should use mkstemp() or equivalent. You shouldn't need to move a file. To delete a file in $HOME/tmp, you can use unlink() or equivalent. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sat Mar 19 23:46:46 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2K7kkja006322 for ; Sat, 19 Mar 2005 23:46:46 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2K7leio013530 for ; Sat, 19 Mar 2005 23:47:40 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2K7ldlI013525 for cs530@merlot.usc.edu; Sat, 19 Mar 2005 23:47:39 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2K7ldio013519 for ; Sat, 19 Mar 2005 23:47:39 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2K7ldEM013515 for ; Sat, 19 Mar 2005 23:47:39 -0800 Message-Id: <200503200747.j2K7ldEM013515@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Question Regarding secret key generation Date: Sat, 19 Mar 2005 23:47:39 -0800 From: william@bourbon.usc.edu Someone wrote: > I have a question about the random bits on the smart card. > Wont a different implementation of a smart card have a > different length of random bits? > So we make no assumption about the length of the rb1 and rb2?? The spec says that they must be 160 bits long. (And you are correct that the interface of the smartcard is independent of the length of RB1 and RB2. Although making them longer doesn't really make things much more secure. So why make them longer?) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sat Mar 19 23:42:05 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2K7g5ja006172 for ; Sat, 19 Mar 2005 23:42:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2K7gwio010957 for ; Sat, 19 Mar 2005 23:42:59 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2K7gw4v010950 for cs530@merlot.usc.edu; Sat, 19 Mar 2005 23:42:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2K7gvio010944 for ; Sat, 19 Mar 2005 23:42:58 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2K7gvVH010937 for ; Sat, 19 Mar 2005 23:42:57 -0800 Message-Id: <200503200742.j2K7gvVH010937@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: question Date: Sat, 19 Mar 2005 23:42:57 -0800 From: william@bourbon.usc.edu Someone wrote: > One more question regarding "hw4 secret". I am stuck at it. RSA > structure using RSA_generate_key() function. However, I just can > find a way to extract 1024-bit RSA private key, RSA public > exponent, a 1024-bit RSA public modulus and two set of 160-bit > patterns. Could you help me on this? After you've call RSA_generate_key(), a (RSA*) pointer is returned. Let's say you did something like "rsa = RSA_generate_key(...);", then all you need to do is to print out rsa->d, rsa->e, and rsa->n. These objects are of type (BIGNUM*) and there are plenty of routines to convert an object of that type to something you are familiar with. Please see the BN_bn2*() functions in: http://www.openssl.org/docs/crypto/bn.html As far as the two sets of 160-bit patterns, you should call RAND_bytes() to create them. Please see: http://www.openssl.org/docs/crypto/rand.html -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Saturday, March 19, 2005 11:23 pm Subject: Re: question > Someone wrote: > > > I have a question regarding outputing the content of > > "hw4 secret" to stdout and not to secret.c. > > > > "hw4 secret" will be outputting the following: > > * callback status to keep the user informed > > * and the output meant to be redirected to secret.c file. > > > > If we output to stdout and you do pipe ">" it to secret.c > > then the callback status will also be copied in the piped > > secret.c file. How do we handle this? > > > > I hope I explained it properly. > > Write the status to stderr. > > You must assume that the normal use of "hw4 secret" is to > redirect stdout to "secret.c" or something that have the > required format as "secret.c". It must *not* contain > anything that will produce a compile error if someone > redirects it to "secret.c". > -- > Bill Cheng // bill.cheng@usc.edu > > > > > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Monday, March 7, 2005 2:56 pm > Subject: Re: question > > > Someone wrote: > > > > > i have a question of the sample files you provided. In the spec > > > you provided working but incomplete files, and one of them is > > > secret.h. As we have to create secret.c by our program, my > > > question will be if we have to create this secret.h as well? > > > > No. You don't really need "secret.h". > > > > You must keep "scintrf.h" untouched. > > > > > And other thing is the secret.c file, will you always pipe > (">") > > it to a file? my concern is if I have to create the > file instead > > > of outputing it to stdout. > > > > I'm not sure exactly what you mean. Do not force your output > > to go to a specific file. I can certainly just run > > > > hw4 secret | more > > > > to look at the output of your code. Plesae clarify what you > > meant. Thanks! > > -- > > Bill Cheng // bill.cheng@usc.edu > > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sat Mar 19 23:23:01 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2K7N1ja005418 for ; Sat, 19 Mar 2005 23:23:01 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2K7Ntio000495 for ; Sat, 19 Mar 2005 23:23:55 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2K7NtuN000490 for cs530@merlot.usc.edu; Sat, 19 Mar 2005 23:23:55 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2K7Nsio000486 for ; Sat, 19 Mar 2005 23:23:54 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2K7NsjG000480 for ; Sat, 19 Mar 2005 23:23:54 -0800 Message-Id: <200503200723.j2K7NsjG000480@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: question Date: Sat, 19 Mar 2005 23:23:54 -0800 From: william@bourbon.usc.edu Someone wrote: > I have a question regarding outputing the content of > "hw4 secret" to stdout and not to secret.c. > > "hw4 secret" will be outputting the following: > * callback status to keep the user informed > * and the output meant to be redirected to secret.c file. > > If we output to stdout and you do pipe ">" it to secret.c > then the callback status will also be copied in the piped > secret.c file. How do we handle this? > > I hope I explained it properly. Write the status to stderr. You must assume that the normal use of "hw4 secret" is to redirect stdout to "secret.c" or something that have the required format as "secret.c". It must *not* contain anything that will produce a compile error if someone redirects it to "secret.c". -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Monday, March 7, 2005 2:56 pm Subject: Re: question > Someone wrote: > > > i have a question of the sample files you provided. In the spec > > you provided working but incomplete files, and one of them is > > secret.h. As we have to create secret.c by our program, my > > question will be if we have to create this secret.h as well? > > No. You don't really need "secret.h". > > You must keep "scintrf.h" untouched. > > > And other thing is the secret.c file, will you always pipe (">") > > it to a file? my concern is if I have to create the file instead > > of outputing it to stdout. > > I'm not sure exactly what you mean. Do not force your output > to go to a specific file. I can certainly just run > > hw4 secret | more > > to look at the output of your code. Plesae clarify what you > meant. Thanks! > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sat Mar 19 23:18:34 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2K7IYja005242 for ; Sat, 19 Mar 2005 23:18:34 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2K7JSio030534 for ; Sat, 19 Mar 2005 23:19:28 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2K7JSx7030525 for cs530@merlot.usc.edu; Sat, 19 Mar 2005 23:19:28 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2K7JRio030519 for ; Sat, 19 Mar 2005 23:19:27 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2K7JRIu030509 for ; Sat, 19 Mar 2005 23:19:27 -0800 Message-Id: <200503200719.j2K7JRIu030509@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hw4 edit option Date: Sat, 19 Mar 2005 23:19:27 -0800 From: william@bourbon.usc.edu Someone wrote: > In my edit option if the file already exists then before > decrypting it user is prompted for passphrase similarly if the > user changes the file , he is again prompted for passphrase ( > because this time he might want to encrypt it with same > passphrase ) and if the file is not change then prompting for > passphrase again doent come in picture. Is my understanding > right. > So basically if the file exists and it is changed then the user > will have to enter the passphrase twice ? No. Please see my message with timestamp "Mon 14 Mar 08:05". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sat Mar 19 23:00:08 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2K708ja004586 for ; Sat, 19 Mar 2005 23:00:08 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2K712io020536 for ; Sat, 19 Mar 2005 23:01:02 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2K711qM020530 for cs530@merlot.usc.edu; Sat, 19 Mar 2005 23:01:01 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2K711io020527 for ; Sat, 19 Mar 2005 23:01:01 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2K710F2020520 for ; Sat, 19 Mar 2005 23:01:00 -0800 Message-Id: <200503200701.j2K710F2020520@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hw4 questions regarding sign Date: Sat, 19 Mar 2005 23:01:00 -0800 From: william@bourbon.usc.edu Someone wrote: > do we have to have a new line at the end of the signed file? > i ask this is becuase in the sample files they all have a new > line at the end. I just want to make sure if that is necessary. Yes! For UNIX programs, if you are outputing an ASCII file, it's not good to have the command prompt not showing up at the usual place! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sat Mar 19 22:58:18 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2K6wIja004478 for ; Sat, 19 Mar 2005 22:58:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2K6xCio019532 for ; Sat, 19 Mar 2005 22:59:12 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2K6xB7D019521 for cs530@merlot.usc.edu; Sat, 19 Mar 2005 22:59:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2K6xAio019518 for ; Sat, 19 Mar 2005 22:59:11 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2K6xAkJ019511 for ; Sat, 19 Mar 2005 22:59:10 -0800 Message-Id: <200503200659.j2K6xAkJ019511@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hw4 Edit command question Date: Sat, 19 Mar 2005 22:59:10 -0800 From: william@bourbon.usc.edu Someone wrote: > So when the user runs the edit command, there are 2 different cases: the > file is nonexistent or it already exists. Yes. > In the case the file doesn't exist, should the edit command only create the > file if it has had content put into it? Or should it create the file no > matter what? For instance, "emacs" will open an editor window, but if the > user closes the window without making any changes, the file won't normally > be created. Similar to HW2, because byte 0x03 of the encrypted file is the number of bytes in the last 8-byte block of the original file, it does not make sense of the original file is empty. Therefore, we should not allow such a file to be created. If you just code according to the edit spec: After the editor is closed, if the file content has changed (you can compare the SHA1 values of the before and after images of the file) you must encrypt the file and save the content back into file and delete the temporary file. then you won't create the file! > Also, when editing a previously nonexistent file, should the user still work > on a file in the $HOME/tmp directory and then have the encode result saved > back to the file they named? Or (and this is probably contingent on the > first question), should the file be saved as the entered name and then have > the contents encrypted? The cleartext file *must* be in $HOME/tmp. The encrypted file is (as usual) relative to the current working directory if an absolute path is not specified. > For example, if the file "test.txt" does not exist, and this command is > typed: > > hw4 -so ./libhw4sc.so edit test.txt > > Should the editor open test.txt and then simply overwrite test.txt with its > encrypted information once the user is done? Or should we create test.txt, > but then also create and open a temporary file and then encrypt the contents > of the temporary file back to test.txt when the user finishes? In this case, do not create "test.txt" first. Just create an empty file in $HOME/tmp, calculate SHA1 of this empty file and store it in memory, then let the user open an editor to edit this empty file in $HOME/tmp. When the user is done, calcualte SHA1 again, compare with what you stored in memory, if the same, don't do anything; if different, create encrypted "test.txt". If you do it this way, what would happen if "test.txt" already exists? Well, you first ask the user for the passphrase, write the passphrase (or its SHA1 value) in memory, decrypt "test.txt" and write the content into the file in $HOMT/tmp, the rest is *identical*! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Mar 18 13:30:21 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2ILULja026098 for ; Fri, 18 Mar 2005 13:30:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2ILVIio032028 for ; Fri, 18 Mar 2005 13:31:18 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2ILVIUa032021 for cs530@merlot.usc.edu; Fri, 18 Mar 2005 13:31:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2ILVHio032012 for ; Fri, 18 Mar 2005 13:31:17 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2ILVHcu032008 for ; Fri, 18 Mar 2005 13:31:17 -0800 Message-Id: <200503182131.j2ILVHcu032008@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hw4 questions Date: Fri, 18 Mar 2005 13:31:17 -0800 From: william@bourbon.usc.edu Someone wrote: > For the secret command, it says "the output is a C source file". However, > does this mean that the C source file should be sent to stdout unless the > user explicitly pipes it into a file? Isn't that the same thing? Could you give an example where the above are different? > Because on the example you have the > line "hw4 secret > secret.c", so it seems that just running "hw4 secret" > should dump the output of the programming to stdout. Exactly! The output should go to stdout. > For the verify command, does the input have to have a specific length? > Ideally, since we're using a 128 RSA byte key, the input should be 256 bytes > long (two hex characters for each byte of the signature),right? May we just > reject inputs that are not this length? Or should we decrypt them 256 bytes > at a time? Also, may we reject inputs that are not a hexstring? You can just read the first 256 bytes of the input and make sure it is in hexstring format. If the input is too short, you should output an error message. If the input is in the wrong format, you should also output an error message. If the input is too long, you can just process the first 256 bytes and stop. > For the Smartcard library function "int SC_3des_key_gen()", what are the > return values for the int? The assignment doesn't specify them for this > function, but it does for the rest. Oops! I just added the following to make it similar to other functions: This function returns 0 if successful, otherwise, it should return -1. > In the description of the "edit" command, the spec says create the temp file > in "$HOMT/tmp", is this supposed to be "$HOME/tmp"? Fixed! Thanks for pointing out these mistakes. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Mar 17 21:17:10 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2I5HAja021450 for ; Thu, 17 Mar 2005 21:17:10 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2I5IAio003853 for ; Thu, 17 Mar 2005 21:18:10 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2I5I9na003844 for cs530@merlot.usc.edu; Thu, 17 Mar 2005 21:18:09 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2I5I9io003839 for ; Thu, 17 Mar 2005 21:18:09 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2I5I9HY003834 for ; Thu, 17 Mar 2005 21:18:09 -0800 Message-Id: <200503180518.j2I5I9HY003834@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: rsa generate key Date: Thu, 17 Mar 2005 21:18:08 -0800 From: william@bourbon.usc.edu Someone wrote: > i have fed 1024 to RSA_generate_key, but the RSA_size > returns 128, is there any problem with this? The first argument to RSA_generate_key() is the number of bits. RSA_size() returns number of bytes. So, it sounds right. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Thursday, March 17, 2005 0:13 am Subject: Re: rsa generate key > Someone wrote: > > > just a quick question regarding below message, is the > > signiture size always 1024? or i have to somehow calculate it? > > When you call RSA_generate_key(), you should pass 1024 as the > first argument. You might want to call RSA_size() for sanity > checks. > -- > Bill Cheng // bill.cheng@usc.edu > > > > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Wednesday, March 16, 2005 11:37 pm > Subject: Re: smartcardstate again > > > Someone wrote: > > > > > Sorry to keep bombarding you with questions...in response > to the > > > Big/Little Endian question, the *2bn and bn2* functions > > > specifically say that the data is in the Big Endian format, > so if > > > by chance we had Little Endian, then the keys would be > messed up. > > > Just trying to be thorough. > > > > I don't see any way to control this. I'm assuming that if > > you call all these openssl functions, they will all operate > > in the correct way! > > > > > As far as allocating a new RSA object and using > > > RSA_private_encrypt goes, I keep getting a seg fault that I > > > cannot pinpoint. > > > The function call is: > > > > > > int errorResult = > > > RSA_private_encrypt(SHA_DIGEST_LENGTH,sha1_buf,buf_return, > > > rsa_object,RSA_PKCS1_PADDING); > > > > > > I've checked and sha1_buf is the correct hash, buf_return > is the > > > correct length, and rsa_object is the created RSA object (with > > > the correct n,d, & e...I checked using RSA_print_fp). > Also, I > > > checked the underlying code as far as I could and I know that > > > rsa_object->meth is also not NULL. I still get a seg fault > > > though. > > > > Since you did not mention buf_return, I assume that you have > > allocated this buffer with malloc() for the right number of > > bytes (should be 1024 which should be the return valud of > > SC_get_signature_size()). You should also verify that > > RSA_size(rsa_object) is returning 1024. > > > > > I also get a seg fault from RSA_check_key. > > > > > > From the code for RSA_check_key, it looks like the function > > > attempts to use the "p" and "q" values of the RSA object, > but for > > > now I've left those NULL because I didn't know how to recreate > > > them. > > > > Since you don't have p and q, you probably shouldn't call > > RSA_check_key(). > > -- > > Bill Cheng // bill.cheng@usc.edu > > > > > > > > > > > > ----- Original Message ----- > > From: william@bourbon.usc.edu > > Date: Wednesday, March 16, 2005 8:22 pm > > Subject: Re: rsa generate key > > > > > Someone wrote: > > > > > > > Do you know if RSA_generate_key generates the BIGNUM > values for > > > > keys in Big Endian or Little Endian format? I can't > find it > > > > stated anywhere in the documentation, but in order to > use > > some of > > > > the BIGNUM conversion functions, it's necessary to know. > > > > > > I think the right way to look at it is that BIGNUM is > > > in the BIGNUM format! You should not worry if it's > > > Big or Little Endian. You should call one of the bn2*() > > > functions to convert it to whatever you need. > > > > > > When do you need the information regarding whether it's big > > > or little Endian? > > > -- > > > Bill Cheng // bill.cheng@usc.edu > > > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Mar 17 21:13:08 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2I5D8ja021296 for ; Thu, 17 Mar 2005 21:13:08 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2I5E7io001473 for ; Thu, 17 Mar 2005 21:14:07 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2I5E7K3001468 for cs530@merlot.usc.edu; Thu, 17 Mar 2005 21:14:07 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2I5E6io001462 for ; Thu, 17 Mar 2005 21:14:06 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2I5E6PJ001458 for ; Thu, 17 Mar 2005 21:14:06 -0800 Message-Id: <200503180514.j2I5E6PJ001458@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: compilation error Date: Thu, 17 Mar 2005 21:14:06 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm not entirely sure where things went wrong on this. > Everything was compiling correctly earlier today and all I've > done since is add another .h and .cc file to the mix. Here's the > error I'm getting: > > nunki.usc.edu(12): make > /usr/usc/bin/g++ -I /home/scf-22/csci551b/openssl/include -Wall -c hw4.cc > In file included from /usr/include/sys/feature_tests.h:15, > from /usr/include/iso/locale_iso.h:47, > from /usr/include/locale.h:46, > from /usr/usc/gnu/gcc/3.3.2/include/c++/3.3.2/clocale:49, > from /usr/usc/gnu/gcc/3.3.2/include/c++/3.3.2/sparc-sun-solaris2.8/bits/c++locale.h:41, > from /usr/usc/gnu/gcc/3.3.2/include/c++/3.3.2/iosfwd:46, > from /usr/usc/gnu/gcc/3.3.2/include/c++/3.3.2/ios:44, > from /usr/usc/gnu/gcc/3.3.2/include/c++/3.3.2/ostream:45, > from /usr/usc/gnu/gcc/3.3.2/include/c++/3.3.2/iostream:45, > from Utility.h:15, > from HashOperations.h:10, > from TripleDesOperations.h:10, > from SmartcardUser.h:11, > from hw4.cc:8: > /usr/include/sys/isa_defs.h:158: error: syntax error before string constant > make: *** [hw4.o] Error 1 > > Any clue what might be going wrong? > > The line 158 is "extern C {" It sure doesn't like like a place that should get a compilation error. Unfortunately, I have no idea what's causing this. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Mar 17 07:58:36 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2HFwaja024180 for ; Thu, 17 Mar 2005 07:58:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2HFxaio026780 for ; Thu, 17 Mar 2005 07:59:36 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2HFxZRp026773 for cs530@merlot.usc.edu; Thu, 17 Mar 2005 07:59:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2HFxYio026767 for ; Thu, 17 Mar 2005 07:59:35 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2HFxYbK026759 for ; Thu, 17 Mar 2005 07:59:34 -0800 Message-Id: <200503171559.j2HFxYbK026759@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: addendum to previous email Date: Thu, 17 Mar 2005 07:59:34 -0800 From: william@bourbon.usc.edu Someone wrote: > Thanks for your patience on this...I got it working. I just thought I'd > send you the solution in case anyone has the same problem. Glad you got it to work. > The problem is that I've made a C++ class in HW4 to be part of the interface > to the Smartcard library and so when I declared the buf_return array for > signing, I did buf_return = new unsigned char[signature_size]; ... and > that's when I was seg faulting. But if I change this to buf_return = > (unsigned char*)malloc(signature_size); ... I have no more problems. > That'll teach me to try to mix things :-) You are right that you have to be extra careful when you mix C with C++. But I'm surprised that the object returned by "new unsigned char[signature_size]" it not compatible with "(unsigned char*)malloc(signature_size)"! What else could "new" return in this case? One way to find out is to go into the debugger, after "new" returns, fill your "buf_return" with some pattern, then examine the memory locating, starting at "buf_return" and see where the pattern went. (I would imagine that if this type of objects kept pointers to its methods, these poniters would be sitting at negative address offsets from where "buf_return" points. This way, it should be compatible with C.) By the way, another no-no when mixing with C and C++ is to allocate a buffer with C++'s "new" and free it with C's free(). -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Wednesday, March 16, 2005 11:27 PM To: cs530@bourbon.usc.edu Subject: Re: addendum to previous email Someone wrote: > As a sidenote to the previous email on RSA_private_encrypt, > if p and q are given values, it no longer seg faults. But p and q are not suppose to be available when encrypting with the RSA private key. So, you should make sure that they are NULL. When you encrypt with the private key, you are raising the message (m) to the power of the private exponent (d) as shown on slide 5 of lecture 7. Therefore, all you need are d and n in order to RSA_private_encrypt() to work. (I'm not sure if e is required, but you have e anyways. Remember that p and q are thrown away as soon as d and n are generated. To make sure that you are not storing p and q in your "secret.c", your application are required to run with any libhw4sc.so. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Mar 17 00:12:13 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2H8CDja006483 for ; Thu, 17 Mar 2005 00:12:13 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2H8DEio007257 for ; Thu, 17 Mar 2005 00:13:14 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2H8DEFH007254 for cs530@merlot.usc.edu; Thu, 17 Mar 2005 00:13:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2H8DEio007249 for ; Thu, 17 Mar 2005 00:13:14 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2H8DDU9007245 for ; Thu, 17 Mar 2005 00:13:13 -0800 Message-Id: <200503170813.j2H8DDU9007245@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: rsa generate key Date: Thu, 17 Mar 2005 00:13:13 -0800 From: william@bourbon.usc.edu Someone wrote: > just a quick question regarding below message, is the > signiture size always 1024? or i have to somehow calculate it? When you call RSA_generate_key(), you should pass 1024 as the first argument. You might want to call RSA_size() for sanity checks. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Wednesday, March 16, 2005 11:37 pm Subject: Re: smartcardstate again > Someone wrote: > > > Sorry to keep bombarding you with questions...in response to the > > Big/Little Endian question, the *2bn and bn2* functions > > specifically say that the data is in the Big Endian format, so if > > by chance we had Little Endian, then the keys would be messed up. > > Just trying to be thorough. > > I don't see any way to control this. I'm assuming that if > you call all these openssl functions, they will all operate > in the correct way! > > > As far as allocating a new RSA object and using > > RSA_private_encrypt goes, I keep getting a seg fault that I > > cannot pinpoint. > > The function call is: > > > > int errorResult = > > RSA_private_encrypt(SHA_DIGEST_LENGTH,sha1_buf,buf_return, > > rsa_object,RSA_PKCS1_PADDING); > > > > I've checked and sha1_buf is the correct hash, buf_return is the > > correct length, and rsa_object is the created RSA object (with > > the correct n,d, & e...I checked using RSA_print_fp). Also, I > > checked the underlying code as far as I could and I know that > > rsa_object->meth is also not NULL. I still get a seg fault > > though. > > Since you did not mention buf_return, I assume that you have > allocated this buffer with malloc() for the right number of > bytes (should be 1024 which should be the return valud of > SC_get_signature_size()). You should also verify that > RSA_size(rsa_object) is returning 1024. > > > I also get a seg fault from RSA_check_key. > > > > From the code for RSA_check_key, it looks like the function > > attempts to use the "p" and "q" values of the RSA object, but for > > now I've left those NULL because I didn't know how to recreate > > them. > > Since you don't have p and q, you probably shouldn't call > RSA_check_key(). > -- > Bill Cheng // bill.cheng@usc.edu > > > > > > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Wednesday, March 16, 2005 8:22 pm > Subject: Re: rsa generate key > > > Someone wrote: > > > > > Do you know if RSA_generate_key generates the BIGNUM values for > > > keys in Big Endian or Little Endian format? I can't find it > > > stated anywhere in the documentation, but in order to use > some of > > > the BIGNUM conversion functions, it's necessary to know. > > > > I think the right way to look at it is that BIGNUM is > > in the BIGNUM format! You should not worry if it's > > Big or Little Endian. You should call one of the bn2*() > > functions to convert it to whatever you need. > > > > When do you need the information regarding whether it's big > > or little Endian? > > -- > > Bill Cheng // bill.cheng@usc.edu > > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Mar 16 23:36:50 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2H7aoja005132 for ; Wed, 16 Mar 2005 23:36:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2H7bpio020514 for ; Wed, 16 Mar 2005 23:37:51 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2H7bpAj020509 for cs530@merlot.usc.edu; Wed, 16 Mar 2005 23:37:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2H7boio020506 for ; Wed, 16 Mar 2005 23:37:50 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2H7bofU020502 for ; Wed, 16 Mar 2005 23:37:50 -0800 Message-Id: <200503170737.j2H7bofU020502@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: smartcardstate again Date: Wed, 16 Mar 2005 23:37:50 -0800 From: william@bourbon.usc.edu Someone wrote: > Ok, I'm confused. You've mentioned twice now that we are not > supposed to touch the smartcard state. However don't you mean > that we shouldn't touch it in our application, but can do as > we like with it in our smartcard. Otherwise why bother > passing in to each function. Exactly! Your application (which is the "hw4" executable) should not peek into SmartcardState and only pass it around. Your smartcard (which is the "libhw4sc.so" shared library) can do whatever it wants with SmartcardState because it created SmartcardState. And this way, we can ensure interoperability! -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Wednesday, March 16, 2005 11:27 pm Subject: Re: addendum to previous email > Someone wrote: > > > As a sidenote to the previous email on RSA_private_encrypt, > > if p and q are given values, it no longer seg faults. > > But p and q are not suppose to be available when encrypting > with the RSA private key. So, you should make sure that > they are NULL. > > When you encrypt with the private key, you are raising the > message (m) to the power of the private exponent (d) as > shown on slide 5 of lecture 7. Therefore, all you need are > d and n in order to RSA_private_encrypt() to work. (I'm not > sure if e is required, but you have e anyways. > > Remember that p and q are thrown away as soon as d and n are > generated. To make sure that you are not storing p and q in > your "secret.c", your application are required to run with > any libhw4sc.so. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Mar 16 23:26:24 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2H7QOja004752 for ; Wed, 16 Mar 2005 23:26:24 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2H7RPio014747 for ; Wed, 16 Mar 2005 23:27:25 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2H7RPP9014744 for cs530@merlot.usc.edu; Wed, 16 Mar 2005 23:27:25 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2H7ROio014739 for ; Wed, 16 Mar 2005 23:27:24 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2H7ROu8014732 for ; Wed, 16 Mar 2005 23:27:24 -0800 Message-Id: <200503170727.j2H7ROu8014732@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: addendum to previous email Date: Wed, 16 Mar 2005 23:27:24 -0800 From: william@bourbon.usc.edu Someone wrote: > As a sidenote to the previous email on RSA_private_encrypt, > if p and q are given values, it no longer seg faults. But p and q are not suppose to be available when encrypting with the RSA private key. So, you should make sure that they are NULL. When you encrypt with the private key, you are raising the message (m) to the power of the private exponent (d) as shown on slide 5 of lecture 7. Therefore, all you need are d and n in order to RSA_private_encrypt() to work. (I'm not sure if e is required, but you have e anyways. Remember that p and q are thrown away as soon as d and n are generated. To make sure that you are not storing p and q in your "secret.c", your application are required to run with any libhw4sc.so. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Mar 16 21:49:21 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2H5nLja001058 for ; Wed, 16 Mar 2005 21:49:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2H5oNio026764 for ; Wed, 16 Mar 2005 21:50:23 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2H5oMgw026751 for cs530@merlot.usc.edu; Wed, 16 Mar 2005 21:50:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2H5oLio026747 for ; Wed, 16 Mar 2005 21:50:21 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2H5oLDd026738 for ; Wed, 16 Mar 2005 21:50:21 -0800 Message-Id: <200503170550.j2H5oLDd026738@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: rsa generate key Date: Wed, 16 Mar 2005 21:50:21 -0800 From: william@bourbon.usc.edu Someone wrote: > Sorry to keep bombarding you with questions...in response to the > Big/Little Endian question, the *2bn and bn2* functions > specifically say that the data is in the Big Endian format, so if > by chance we had Little Endian, then the keys would be messed up. > Just trying to be thorough. I don't see any way to control this. I'm assuming that if you call all these openssl functions, they will all operate in the correct way! > As far as allocating a new RSA object and using > RSA_private_encrypt goes, I keep getting a seg fault that I > cannot pinpoint. > The function call is: > > int errorResult = > RSA_private_encrypt(SHA_DIGEST_LENGTH,sha1_buf,buf_return, > rsa_object,RSA_PKCS1_PADDING); > > I've checked and sha1_buf is the correct hash, buf_return is the > correct length, and rsa_object is the created RSA object (with > the correct n,d, & e...I checked using RSA_print_fp). Also, I > checked the underlying code as far as I could and I know that > rsa_object->meth is also not NULL. I still get a seg fault > though. Since you did not mention buf_return, I assume that you have allocated this buffer with malloc() for the right number of bytes (should be 1024 which should be the return valud of SC_get_signature_size()). You should also verify that RSA_size(rsa_object) is returning 1024. > I also get a seg fault from RSA_check_key. > > From the code for RSA_check_key, it looks like the function > attempts to use the "p" and "q" values of the RSA object, but for > now I've left those NULL because I didn't know how to recreate > them. Since you don't have p and q, you probably shouldn't call RSA_check_key(). -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Wednesday, March 16, 2005 8:22 pm Subject: Re: rsa generate key > Someone wrote: > > > Do you know if RSA_generate_key generates the BIGNUM values for > > keys in Big Endian or Little Endian format? I can't find it > > stated anywhere in the documentation, but in order to use some of > > the BIGNUM conversion functions, it's necessary to know. > > I think the right way to look at it is that BIGNUM is > in the BIGNUM format! You should not worry if it's > Big or Little Endian. You should call one of the bn2*() > functions to convert it to whatever you need. > > When do you need the information regarding whether it's big > or little Endian? > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Mar 16 20:28:34 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2H4SYja030567 for ; Wed, 16 Mar 2005 20:28:34 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2H4TZio015427 for ; Wed, 16 Mar 2005 20:29:35 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2H4TZn5015421 for cs530@merlot.usc.edu; Wed, 16 Mar 2005 20:29:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2H4TYio015412 for ; Wed, 16 Mar 2005 20:29:34 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2H4TYua015408 for ; Wed, 16 Mar 2005 20:29:34 -0800 Message-Id: <200503170429.j2H4TYua015408@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: while encrypting using edit Date: Wed, 16 Mar 2005 20:29:34 -0800 From: william@bourbon.usc.edu Someone wrote: > I didn't understand one thing... when person edit the file and > the file does not exist a new file is created and user writes > data on that file and save the file and closes the editor And you should delete the temporary file in ~/tmp at this point. > Now after that we have to ask for passphrase and do the > encryption of the file and store the encrypted file back to the > same file where our original data contain... You should "decrypt" the file and store the "decrypted" file into ~/tmp and chmod it so that its protection is 0600 (so no one else can see the content of it). > Can I use the > temporary file to store the encrypted data then send back it to > original file and delete the temporary file... > Please let me know that is I am thinking in right direction... The temporary file should contain the unencrypted data file. When you encrypt, you should read from this temporary file, call the encryption function, and directly write the output into the user specified filename. You should not create an extra temporary file. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Mar 16 20:21:21 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2H4LLja030282 for ; Wed, 16 Mar 2005 20:21:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2H4MMio011471 for ; Wed, 16 Mar 2005 20:22:22 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2H4MMsZ011464 for cs530@merlot.usc.edu; Wed, 16 Mar 2005 20:22:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2H4MLio011461 for ; Wed, 16 Mar 2005 20:22:21 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2H4ML2t011454 for ; Wed, 16 Mar 2005 20:22:21 -0800 Message-Id: <200503170422.j2H4ML2t011454@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: rsa generate key Date: Wed, 16 Mar 2005 20:22:21 -0800 From: william@bourbon.usc.edu Someone wrote: > Do you know if RSA_generate_key generates the BIGNUM values for > keys in Big Endian or Little Endian format? I can't find it > stated anywhere in the documentation, but in order to use some of > the BIGNUM conversion functions, it's necessary to know. I think the right way to look at it is that BIGNUM is in the BIGNUM format! You should not worry if it's Big or Little Endian. You should call one of the bn2*() functions to convert it to whatever you need. When do you need the information regarding whether it's big or little Endian? -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Mar 16 16:13:20 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2H0DKja021013 for ; Wed, 16 Mar 2005 16:13:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2H0EMio010605 for ; Wed, 16 Mar 2005 16:14:22 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2H0EMVm010597 for cs530@merlot.usc.edu; Wed, 16 Mar 2005 16:14:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2H0ELio010594 for ; Wed, 16 Mar 2005 16:14:21 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2H0ELK7010587 for ; Wed, 16 Mar 2005 16:14:21 -0800 Message-Id: <200503170014.j2H0ELK7010587@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: SmartcardState Date: Wed, 16 Mar 2005 16:14:21 -0800 From: william@bourbon.usc.edu Someone wrote: > From looking at the example you posted, I notice that your > SmartcardState is verified by storing the SHA1 hash of your RSA > private key. This would obviously be very difficult (if not > impossible) for a user to fake. I just might use this code to test some of your applications (hw4). > I can see how in real life this would be ideal, but for this > assignment, do we need to do something that complex? I thought I > recalled you saying in class that the SmartcardState could simply > be something like a string. It can be *anything*. That's why the type is (void*). > Right now I just cast SmartcardState > to an int* and if it's set to VALID_STATE (a #define constant) > then it's good, otherwise it's bad. Is that acceptable? Or > should we be doing something more secure as in your example? You should *not* typecast it to anything. Just keep it as (void*) so you won't accidentially do something with it. The "smartcard.c" example provided is just an demonstration of weird code that can be done in libhw4sc.so. You should simply rewrite it to make it perform the right operations for you. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Mar 16 16:04:23 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2H04Nja020699 for ; Wed, 16 Mar 2005 16:04:23 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2H05Pio006480 for ; Wed, 16 Mar 2005 16:05:25 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2H05PUp006472 for cs530@merlot.usc.edu; Wed, 16 Mar 2005 16:05:25 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2H05Oio006463 for ; Wed, 16 Mar 2005 16:05:24 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2H05Osr006459 for ; Wed, 16 Mar 2005 16:05:24 -0800 Message-Id: <200503170005.j2H05Osr006459@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Smartcard State Date: Wed, 16 Mar 2005 16:05:24 -0800 From: william@bourbon.usc.edu Someone wrote: > Can we modify the SmartcardState that is being returned by the SC_init > function? No. The application (hw4) must not do anything to the SmartcardState, except for passing it around and back into the functions in libhw4sc.so. > Do we need to compare the SmartcardState to the SHA1 hash for the private > key to ensure that the secrets being utilized currently are same? I don't know what you mean. Your application should not know what's in the SmartcardState produced by another libhw4sc.so! For example, if someone else implements libhw4sc.so using smalltalk and his/her SmartcardState is a smalltalk object. The only thing you can do with the SmartcardState is to pass it back to his/her libhw4sc.so. Right? -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Mar 15 16:30:25 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2G0UPja026087 for ; Tue, 15 Mar 2005 16:30:25 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2G0VUio014650 for ; Tue, 15 Mar 2005 16:31:30 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2G0VUvL014648 for cs530@merlot; Tue, 15 Mar 2005 16:31:30 -0800 Date: Tue, 15 Mar 2005 16:31:30 -0800 From: william@bourbon.usc.edu Message-Id: <200503160031.j2G0VUvL014648@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: RSA_generate_key() may take time to run... Hi, I've just added the following notes to the HW4 spec for the secret command: [BC: Added 3/15/2005] Please use the callback function to keep the user informed. Try running the following command from an *empty* directory: ~csci551b/openssl/ssl/misc/CA.pl -newca and press the key (then you can press a few c to skip the rest). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Mar 15 16:16:53 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2G0Grja025492 for ; Tue, 15 Mar 2005 16:16:53 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2G0Hvio008545 for ; Tue, 15 Mar 2005 16:17:57 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2G0HvZQ008540 for cs530@merlot.usc.edu; Tue, 15 Mar 2005 16:17:57 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2G0Huio008537 for ; Tue, 15 Mar 2005 16:17:56 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2G0Hupi008530 for ; Tue, 15 Mar 2005 16:17:56 -0800 Message-Id: <200503160017.j2G0Hupi008530@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: smartcard secret randomness Date: Tue, 15 Mar 2005 16:17:56 -0800 From: william@bourbon.usc.edu Someone wrote: > For using RSA_generate_key(), the man pages recommend seeding the > pseudorandom number generator before using this function. I do > this (albeit with the same value each time...so it's probably not > that much more random) and get a different RSA private key and > public modulus every time I run this function. Should "secret.c" > be different each time like this? I'm assuming the answer is > yes, but I want to make sure. The answer is yes. > On the two strings of 160 random bits on the smartcard, you've > made them the size of a SHA1 hash (for obvious reasons). May we > just choose two particular bit strings and use these exact two > strings each time "secret.c" is generated? Or do you want them > to be truly random and change each time "secret.c" is created? Yes. And you can just call RAND_bytes() in . > I guess the overall question is, every time we run "hw4 secret", > should we get a completely different "secret.c" file? Yes. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Mar 15 08:10:06 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2FGA6ja006300 for ; Tue, 15 Mar 2005 08:10:06 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2FGBBio025053 for ; Tue, 15 Mar 2005 08:11:11 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2FGBBWM025045 for cs530@merlot.usc.edu; Tue, 15 Mar 2005 08:11:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2FGBAio025042 for ; Tue, 15 Mar 2005 08:11:10 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2FGBAmP025038 for ; Tue, 15 Mar 2005 08:11:10 -0800 Message-Id: <200503151611.j2FGBAmP025038@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: [cs530] edit Date: Tue, 15 Mar 2005 08:11:10 -0800 From: william@bourbon.usc.edu Someone wrote: > My EDITOR environment says that the default editor is emacs. > (I don't know how to switch it to VI, yet). If you are running csh/tcsh, do "setenv EDITOR vi" in your ~/.cshrc or ~/.tcshrc file. If you are running bash, do "export EDITOR=vi". > Anyway, if I change some contents of a encrypted file using emacs > in *edit* mode, emacs generates a backup file names tmpXXXXXX~ > (if the temporary file name was tmpXXXXXX). > Therefore, after the application deletes the temp file names > tmpXXXXXX, a backup file tmpXXXXXX~ is still remaining. > Is this ok? When I use VI, there is no problem like that. That's okay (for HW4). > And, a minor typo: > In the Additional Test Data Files section, the command name > should be enc, not encrypt, I think. Thanks. These typos are fixed now (although I did not put the "BC:" tags next to them). -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Monday, March 14, 2005 8:05 am Subject: Re: [cs530] edit > Someone wrote: > > > I have three questions about edit: > > > > 1. Can I just use vi as the editor and mention that in README > > file, not using EDITOR environment? > > In other words, > > snprintf(cmd, sizeof(cmd), "vi %s", gszFileToEdit); > > , not > > snprintf(cmd, sizeof(cmd), "%s %s", (psz==NULL) ? gszDefEditor : > > psz, gszFileToEdit); > > It's a lot nicer to user an environment variable! What if > your user (or the grader) does not know how to use vi? > Also, the EDITOR environment variable is standard on UNIX > machines, so please do use it. > > > 2. When we *edit* an encrypted file, the application asks the > > passphrase for decryption. > > Even though we enter a wrong passphrase or the file was > > corrupted, it just decrypts the file anyway. > > In this case, should we edit the *wrong* file with a warning > > message or > > check sha1 hash and (if different) finish the application before > > hand? > > You should know the passphrase is wrong right away because > the SHA1 value does not match. You just need to make sure > that you handle this in a reasonable fashion. You can either > go into the editor with the bad file (chances are, this would > be a binary file now), or simply tell the user that the SHA1 > has doesn't match and you are quitting your application. Or > you can stay in a loop asking the user to try another > passphrase. > > > 3. When we edit an encrypted file, we may change content. > > After that, the application asks a passphrase again. > > Should that passphrase be same as the one that is used > > previously? or can we change it anytime? > > I'm not sure what you meant bye "can we change it anytime". > I think it's better to use the same passphrase. Otherwise, > you would be prompting the passphrase too many times. And > usually, people would not want to come up with a passphrase > everytime because they will forget which passphrase they used. > > One problem with this scheme is that the same IV and keys will > be used for encrypting the file! We have seen in class that > this is a bad idea! A simple solution would be salting the > passphrase. But to make grading easier, we elect not to take > this approach. So, please do not salt your passphrase since > the file format does not allow it, and everyone must use the > same file format. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Mar 14 08:04:53 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2EG4qja017144 for ; Mon, 14 Mar 2005 08:04:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2EG60io014057 for ; Mon, 14 Mar 2005 08:06:00 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2EG60GH014049 for cs530@merlot.usc.edu; Mon, 14 Mar 2005 08:06:00 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2EG5xio014038 for ; Mon, 14 Mar 2005 08:05:59 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2EG5x7L014033 for ; Mon, 14 Mar 2005 08:05:59 -0800 Message-Id: <200503141605.j2EG5x7L014033@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: [cs530] edit Date: Mon, 14 Mar 2005 08:05:58 -0800 From: william@bourbon.usc.edu Someone wrote: > I have three questions about edit: > > 1. Can I just use vi as the editor and mention that in README > file, not using EDITOR environment? > In other words, > snprintf(cmd, sizeof(cmd), "vi %s", gszFileToEdit); > , not > snprintf(cmd, sizeof(cmd), "%s %s", (psz==NULL) ? gszDefEditor : > psz, gszFileToEdit); It's a lot nicer to user an environment variable! What if your user (or the grader) does not know how to use vi? Also, the EDITOR environment variable is standard on UNIX machines, so please do use it. > 2. When we *edit* an encrypted file, the application asks the > passphrase for decryption. > Even though we enter a wrong passphrase or the file was > corrupted, it just decrypts the file anyway. > In this case, should we edit the *wrong* file with a warning > message or > check sha1 hash and (if different) finish the application before > hand? You should know the passphrase is wrong right away because the SHA1 value does not match. You just need to make sure that you handle this in a reasonable fashion. You can either go into the editor with the bad file (chances are, this would be a binary file now), or simply tell the user that the SHA1 has doesn't match and you are quitting your application. Or you can stay in a loop asking the user to try another passphrase. > 3. When we edit an encrypted file, we may change content. > After that, the application asks a passphrase again. > Should that passphrase be same as the one that is used > previously? or can we change it anytime? I'm not sure what you meant bye "can we change it anytime". I think it's better to use the same passphrase. Otherwise, you would be prompting the passphrase too many times. And usually, people would not want to come up with a passphrase everytime because they will forget which passphrase they used. One problem with this scheme is that the same IV and keys will be used for encrypting the file! We have seen in class that this is a bad idea! A simple solution would be salting the passphrase. But to make grading easier, we elect not to take this approach. So, please do not salt your passphrase since the file format does not allow it, and everyone must use the same file format. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Mar 13 09:46:52 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2DHkqja031479 for ; Sun, 13 Mar 2005 09:46:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2DHm2io031458 for ; Sun, 13 Mar 2005 09:48:02 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2DHm2vf031456 for cs530@merlot; Sun, 13 Mar 2005 09:48:02 -0800 Date: Sun, 13 Mar 2005 09:48:02 -0800 From: william@bourbon.usc.edu Message-Id: <200503131748.j2DHm2vf031456@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: minor change to the term paper proposal requirement... Hi, I just realized that I need to do a minor modification to the term paper proposal requirement. Originally, it said: Although your proposal will not be graded, you will lose 20 points (out of 100) if you do not submit a proposal by the proposal deadline. I'm changing it to: Although your proposal will not be graded, you will lose 20 points (out of 100) if you do not submit a proposal *that meets the reference requirement* by the proposal deadline. So, you must submit a "qualifying proposal" by the 4/13/2005 deadline. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Mar 13 08:31:08 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2DGV8ja028388 for ; Sun, 13 Mar 2005 08:31:08 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2DGWIio024225 for ; Sun, 13 Mar 2005 08:32:18 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2DGWHEP024217 for cs530@merlot.usc.edu; Sun, 13 Mar 2005 08:32:17 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2DGWGio024203 for ; Sun, 13 Mar 2005 08:32:16 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2DGWGfL024199 for ; Sun, 13 Mar 2005 08:32:16 -0800 Message-Id: <200503131632.j2DGWGfL024199@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: [cs530] typo? Date: Sun, 13 Mar 2005 08:32:16 -0800 From: william@bourbon.usc.edu Someone wrote: > I was little bit confused, because of the following: > > When you run: > > hw4 -so ./libhw4sc.so dec usctommy.gif > usctommy.gif.new > > using the same passphrase usctommy.gif and usctommy.gif.new > should be identical. > > Shouldn't it be usctommy.enc (or usctommy.gif.enc), not > usctommy.gif ? > > I check the input file if it is a valid 3DES encrypted file. > So if I command that, the application refuses to process with > error message. I hope it is a typo. Sure enough, it's another typo. Sorry about this. It's fix on the spec now. Thanks for pointing it out! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sat Mar 12 22:14:51 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2D6Epja026717 for ; Sat, 12 Mar 2005 22:14:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2D6G2io006526 for ; Sat, 12 Mar 2005 22:16:02 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2D6G1vF006521 for cs530@merlot.usc.edu; Sat, 12 Mar 2005 22:16:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2D6G1io006512 for ; Sat, 12 Mar 2005 22:16:01 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2D6G096006507 for ; Sat, 12 Mar 2005 22:16:01 -0800 Message-Id: <200503130616.j2D6G096006507@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: compilation error Date: Sat, 12 Mar 2005 22:16:00 -0800 From: william@bourbon.usc.edu Someone wrote: > I think the problem is at the line "smartcard.o: defs.h > scintrf.h secret.h secret.c smartcard.c", i think it should > be "smartcard: defs.h scintrf.h secret.h secret.c smartcard.c". That would not be correct! The target for the make is "all" which is defined as "libhw4sc.so" and "hw4" in the Makefile. Therefore, "make smartcard" would not work... Now I see what's going on. The HW4 spec says the following at the end of the Smartcard Interface section: Please do the following to build both hw4 and libhw4sc.so: make hw4 make smartcard So, you are also correct! But you should not replace "smartcard.o" with "smartcard". You should copy add the following: smartcard: smartcard.o gcc -g -o libhw4sc.so $(SHLIBLDFLAGS) smartcard.o -lc These 2 lines looks just like the 2 lines for libhw4sc.so except the target is different. I've just made this change in the sample Makefile. Please download it again. > I have changed it and it worked. > I said worked becuase no more those linking errors. Does that > mean it is compiling correctly? Yes. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Saturday, March 12, 2005 8:11 pm Subject: Re: compilation error > Someone wrote: > > > I got an error when trying to compile the sample code that is > > posted in the spec. So, i wonder if this is my account problem > > or the code's problem? > > > > Here is the error: > > cc smartcard.o -o smartcard > > Undefined first referenced > > symbol in file > > SHA1 smartcard.o > > main > /usr/spac/sparcompilers/default/SUNWspro/prod/lib/crt1.o > ld: > fatal: Symbol referencing errors. No output written to smartcard > > make: *** [smartcard] Error 1 > > If you type "make" using the provided Makefile, it should run > gcc because it's hard-coded in the Makefile! It's strange that > you ended up running cc instead. Please just do a "make" (and > not "make smartcard". (In the sample, I did not use separate > compilation, but you should use it when appropriate.) > > Also, I just saw a bug in my Makefile. Please download it from > the HW4 spec again. Or you can just replace the first line with: > > OPENSSL_DIR = /home/scf-22/csci551b/openssl > > Sorry about this bug. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sat Mar 12 20:10:30 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2D4AUja022097 for ; Sat, 12 Mar 2005 20:10:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2D4Bgio003780 for ; Sat, 12 Mar 2005 20:11:42 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2D4Bgc8003775 for cs530@merlot.usc.edu; Sat, 12 Mar 2005 20:11:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2D4Bfio003766 for ; Sat, 12 Mar 2005 20:11:41 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2D4BfXc003762 for ; Sat, 12 Mar 2005 20:11:41 -0800 Message-Id: <200503130411.j2D4BfXc003762@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: compilation error Date: Sat, 12 Mar 2005 20:11:41 -0800 From: william@bourbon.usc.edu Someone wrote: > I got an error when trying to compile the sample code that is > posted in the spec. So, i wonder if this is my account problem > or the code's problem? > > Here is the error: > cc smartcard.o -o smartcard > Undefined first referenced > symbol in file > SHA1 smartcard.o > main /usr/spac/sparcompilers/default/SUNWspro/prod/lib/crt1.o > ld: fatal: Symbol referencing errors. No output written to smartcard > make: *** [smartcard] Error 1 If you type "make" using the provided Makefile, it should run gcc because it's hard-coded in the Makefile! It's strange that you ended up running cc instead. Please just do a "make" (and not "make smartcard". (In the sample, I did not use separate compilation, but you should use it when appropriate.) Also, I just saw a bug in my Makefile. Please download it from the HW4 spec again. Or you can just replace the first line with: OPENSSL_DIR = /home/scf-22/csci551b/openssl Sorry about this bug. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sat Mar 12 20:02:47 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2D42lja021731 for ; Sat, 12 Mar 2005 20:02:47 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2D43wio031989 for ; Sat, 12 Mar 2005 20:03:58 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2D43weN031985 for cs530@merlot.usc.edu; Sat, 12 Mar 2005 20:03:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2D43wio031981 for ; Sat, 12 Mar 2005 20:03:58 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2D43wtj031974 for ; Sat, 12 Mar 2005 20:03:58 -0800 Message-Id: <200503130403.j2D43wtj031974@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Quick Question Date: Sat, 12 Mar 2005 20:03:57 -0800 From: william@bourbon.usc.edu Someone wrote: > I am working on HW4 and as I am doing "verify" I have encountered > a roadblock. First of all, I would like to check if I am > approaching this the right way. > > In my hw4.c code when it executes "verify", I call > SC_public_query from the shared library to get the public > exponent and the public modulus to decode the signature. > > My specific problem is how can I pass the public exponent and the > public modulus back to hw4.c? From the specifications, you > have: > > int SC_public_query(SmartcardSate pSS, unsigned char > *public_exponent_return, unsigned char *public_modulus_return); > > From my understanding of C, should there be double pointers i.e. > **public_exponent_return and **public_modulus_return? All the > C/C++ tutorials, guides, and sample code that I have consulted > seem to indicate that the only way to pass a character pointer by > reference in C/C++ is by using double pointers. But of course, > we cannot change this code since it is in scintrf.h. > > Just to help you understand my dilemma, my current code for > SC_public_query is: > > /*------------ SC_public_query --------------------- */ > int SC_public_query(SmartcardState pSS, > unsigned char *public_exponent_return, > unsigned char *public_modulus_return) > { > .... //rsa gets values from secret.c > public_exponent_return = BN_bn2hex(rsa->e); > .... > } > > /*------------ Verify ------------------------ */ > void Verify() > { > .... > unsigned char *pubexp; > int n; > n = (pfn_public_query)(pss,pubexp,pubmod); > .... > } > > So when I run "verify", *pubexp should get the hex string values > of rsa->e...but it will only produce a seg error(or nothing at > all, I have tried a gazillion different ways to do this!) Does > this have something to do with using a shared library? The spec for SC_public_query() says that the buffer in the arguments are suppose to be allocated by the application. The size of these buffers are obtained using SC_public_size_query(). It is usually a bad idea to allocate memmory from a shared library. If that's done, then who should free the memory? Letting the application free the allocated memory is a bad idea. So, this design lets the application allocated memory. The shared library just need to tell the application how many bytes to allocate. This is a common practice. Actually, the idea here is that in SC_public_size_query(), you should do: *p_public_exponent_size_return = HW4_rsa_public_exponent_size; *p_public_modulus_size_return = HW4_rsa_public_modulus_size; you probably want to make sure p_public_exponent_size_return and p_public_modulus_size_return are not pointing to null. Then in SC_public_query(), you just call memcpy(). That's all for these 2 functions! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Mar 12 13:51:29 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2CLpTja007942 for ; Sat, 12 Mar 2005 13:51:29 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2CLqfio031966 for ; Sat, 12 Mar 2005 13:52:41 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2CLqf3r031960 for ; Sat, 12 Mar 2005 13:52:41 -0800 Message-Id: <200503122152.j2CLqf3r031960@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: [cs530] padding with zeros in 3DES Date: Sat, 12 Mar 2005 13:52:41 -0800 From: william@bourbon.usc.edu Hi, I've just updated the web page and the test data files in 1~csci530/public/hw4 on nunki/aludra. If you see more bugs, please send me e-mail. Thanks! By the way, for HW2, I've mentioned that if the last 8 bytes of your output is the only thing different from the "solution" and everything else is identical, you would have only lost a few points. This is no longer true for HW4, especially since I've provided plenty of test data for you to test your code. Please also try to find other students to exchange "secret.c" and "libhw4sc.so" to make sure that your program output is interoperable with others'. Also, please do not output error messages into your data file. The grading will be harsh, so please make sure that every bit of your output is correct. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Sat, 12 Mar 2005 09:35:33 -0800 From: william@bourbon.usc.edu To: cs530@merlot.usc.edu Subject: Re: [cs530] padding with zeros in 3DES Someone wrote: > I encrypted usctommy.gif and found the only last 8 bytes of my > usctommy.gif.enc differs from yours. > (sha1 hash is same.) > The size of usctommy.gif is 1689 bytes. So I have to pad 7 bytes > of zeros. Since I initialized the buffer with zeros, there are > already zeros after 1689th bytes. > Therefore, I encrypted the buffer up to 1696 bytes without any padding. > Is this wrong way? Oops! It's my bug! The hexdump of the last few bytes of usctommy.gif.enc should be: 000680: 42 c9 6c 93 37 a1 b2 23 c5 46 14 12 af cf ec fd B~l~7~~#~F..~~~~ 000690: 21 fc 0d d3 ba 7c 5b 8e f6 e7 72 73 76 c8 14 98 !~.~~|[~~~rsv~.~ 0006a0: ee b8 24 01 11 cd df 2a 03 78 d6 a8 92 cf 43 19 ~~$..~~*.x~~~~C. 0006b0: 88 47 ce 37 9e 85 d1 49 -- -- -- -- -- -- -- -- ~G~7~~~I So, bytes 00069c through 0006a3 (inclusive) were wrong. I have not updated the web page and the test data files in ~csci530/public/hw4 yet. I'll do that around noon today. Sorry about my bug and thanks for pointing it out! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Mar 12 09:34:21 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2CHYLja030812 for ; Sat, 12 Mar 2005 09:34:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2CHZXio002252 for ; Sat, 12 Mar 2005 09:35:33 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2CHZXUY002240 for ; Sat, 12 Mar 2005 09:35:33 -0800 Message-Id: <200503121735.j2CHZXUY002240@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: [cs530] padding with zeros in 3DES Date: Sat, 12 Mar 2005 09:35:33 -0800 From: william@bourbon.usc.edu Someone wrote: > I encrypted usctommy.gif and found the only last 8 bytes of my > usctommy.gif.enc differs from yours. > (sha1 hash is same.) > The size of usctommy.gif is 1689 bytes. So I have to pad 7 bytes > of zeros. Since I initialized the buffer with zeros, there are > already zeros after 1689th bytes. > Therefore, I encrypted the buffer up to 1696 bytes without any padding. > Is this wrong way? Oops! It's my bug! The hexdump of the last few bytes of usctommy.gif.enc should be: 000680: 42 c9 6c 93 37 a1 b2 23 c5 46 14 12 af cf ec fd B~l~7~~#~F..~~~~ 000690: 21 fc 0d d3 ba 7c 5b 8e f6 e7 72 73 76 c8 14 98 !~.~~|[~~~rsv~.~ 0006a0: ee b8 24 01 11 cd df 2a 03 78 d6 a8 92 cf 43 19 ~~$..~~*.x~~~~C. 0006b0: 88 47 ce 37 9e 85 d1 49 -- -- -- -- -- -- -- -- ~G~7~~~I So, bytes 00069c through 0006a3 (inclusive) were wrong. I have not updated the web page and the test data files in ~csci530/public/hw4 yet. I'll do that around noon today. Sorry about my bug and thanks for pointing it out! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Mar 11 23:59:11 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2C7xBja009034 for ; Fri, 11 Mar 2005 23:59:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2C80Oio019423 for ; Sat, 12 Mar 2005 00:00:24 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2C80OAV019418 for cs530@merlot.usc.edu; Sat, 12 Mar 2005 00:00:24 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2C80Nio019412 for ; Sat, 12 Mar 2005 00:00:23 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2C80Nc5019408 for ; Sat, 12 Mar 2005 00:00:23 -0800 Message-Id: <200503120800.j2C80Nc5019408@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: [cs530] DES_odd_parity() Date: Sat, 12 Mar 2005 00:00:23 -0800 From: william@bourbon.usc.edu Someone wrote: > Where do we need to call DES_odd_parity()? in SC_3des_key_gen() > or enc routine? You should call DES_odd_parity in your application and not in SC_3des_key_gen(). > I think that a smartcard gives you good(=not weak) and > complete(=odd parity) keys. Is this right? Ideally, yes; but this does not *have to* be the case. For our smartcard, it just does what it suppose to do, which is: http://merlot.usc.edu/cs530-s05/homeworks/hw4/#keygen This makes it very interoperable. It's the appliaction's job to check if the key is weak and set odd parity for encryption/decryption. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Mar 11 23:50:05 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j2C7o5ja008749 for ; Fri, 11 Mar 2005 23:50:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2C7pIio014511 for ; Fri, 11 Mar 2005 23:51:18 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j2C7pIE8014506 for cs530@merlot.usc.edu; Fri, 11 Mar 2005 23:51:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j2C7pHio014503 for ; Fri, 11 Mar 2005 23:51:18 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j2C7pHKg014499 for ; Fri, 11 Mar 2005 23:51:17 -0800 Message-Id: <200503120751.j2C7pHKg014499@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: [cs530] weak key? Date: Fri, 11 Mar 2005 23:51:17 -0800 From: william@bourbon.usc.edu Someone wrote: > Do we have check if the keys of 3DES are weak? Of course. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Mar 8 17:30:17 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j291UHja026560 for ; Tue, 8 Mar 2005 17:30:17 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j291Vdio008091 for ; Tue, 8 Mar 2005 17:31:39 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j291VdZW008086 for cs530@merlot; Tue, 8 Mar 2005 17:31:39 -0800 Date: Tue, 8 Mar 2005 17:31:39 -0800 From: william@bourbon.usc.edu Message-Id: <200503090131.j291VdZW008086@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: canceling office hour tomorrow (3/9/2005) Hi, I mentioned in class today that tomorrow's office hour is canceled. If you need to talk to me, please send me e-mail for an appointment. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Mar 7 22:28:21 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j286SLja015604 for ; Mon, 7 Mar 2005 22:28:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j286Tjio022414 for ; Mon, 7 Mar 2005 22:29:45 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j286TjoU022406 for cs530@merlot; Mon, 7 Mar 2005 22:29:45 -0800 Date: Mon, 7 Mar 2005 22:29:45 -0800 From: william@bourbon.usc.edu Message-Id: <200503080629.j286TjoU022406@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: information about the SmartcardState ... Hi, At the beginning of today's lecture, I talked about SmartcardState, the return value of SC_init(). I've just added what I said in class to the spec. Please see the blue labels in the Smartcard Interface section of the HW4 spec: http://merlot.usc.edu/cs530-s05/homeworks/hw4/#interface Please also remember that you must not change "scintrf.h" and that we may substitute our "secret.c" right into your "secret.c" and your smartcard library must compile. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Mar 7 14:55:03 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j27Mt3ja031155 for ; Mon, 7 Mar 2005 14:55:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j27MuRio027416 for ; Mon, 7 Mar 2005 14:56:27 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j27MuR6p027414 for cs530@merlot.usc.edu; Mon, 7 Mar 2005 14:56:27 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j27MuQio027405 for ; Mon, 7 Mar 2005 14:56:26 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j27MuQwo027401 for ; Mon, 7 Mar 2005 14:56:26 -0800 Message-Id: <200503072256.j27MuQwo027401@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: question Date: Mon, 07 Mar 2005 14:56:26 -0800 From: william@bourbon.usc.edu Someone wrote: > i have a question of the sample files you provided. In the spec > you provided working but incomplete files, and one of them is > secret.h. As we have to create secret.c by our program, my > question will be if we have to create this secret.h as well? No. You don't really need "secret.h". You must keep "scintrf.h" untouched. > And other thing is the secret.c file, will you always pipe (">") > it to a file? my concern is if I have to create the file instead > of outputing it to stdout. I'm not sure exactly what you mean. Do not force your output to go to a specific file. I can certainly just run hw4 secret | more to look at the output of your code. Plesae clarify what you meant. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Mar 7 14:07:30 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j27M7Uja029373 for ; Mon, 7 Mar 2005 14:07:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j27M8tio011020 for ; Mon, 7 Mar 2005 14:08:55 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j27M8tSi011018 for cs530@merlot; Mon, 7 Mar 2005 14:08:55 -0800 Date: Mon, 7 Mar 2005 14:08:55 -0800 From: william@bourbon.usc.edu Message-Id: <200503072208.j27M8tSi011018@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: regrade policy Hi, The regrade policy is posted at: http://merlot.usc.edu/cs530-s05/description.html#regrade I've also specify what you should do to contact the grader. The grader has told me something shocking! So, please don't do any the following: 1) tell Arti that your code works perfectly in your directory and therefore should get full credit (your code must work in the grading account on nunki, that's the requirement) 2) get other students to tell the grader that they think you are right 3) call the grader on her cell phone 4) ask your brothers/sisters to call the grader 5) go to the grader's home Please be *nice*! Arti is trying her best to do her job. She is also required to follow my grading/regrading instructions. She definitely cannot give any student special treatments. As I've mentioned in class today, if you think your program is doing the right thing, there is no need to get excited. Just go through the regrade request procedure and you will get all the points you deserve, sooner or later. Let's all try to be professional here, please. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Mar 7 10:28:29 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j27ISSja021319 for ; Mon, 7 Mar 2005 10:28:29 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j27IQAio029671 for ; Mon, 7 Mar 2005 10:26:10 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j27IQA5x029663 for cs530@merlot.usc.edu; Mon, 7 Mar 2005 10:26:10 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j27IQ9io029657 for ; Mon, 7 Mar 2005 10:26:09 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j27IQ93m029653 for ; Mon, 7 Mar 2005 10:26:09 -0800 Message-Id: <200503071826.j27IQ93m029653@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: question about hw4 Date: Mon, 07 Mar 2005 10:26:08 -0800 From: william@bourbon.usc.edu Someone wrote: > I do not understand one thing about hw4 > > In method "sc_sign" of smartcard interface, > > extern int SC_sign( > SmartcardState pSS, > unsigned char sha1_buf[SHA_DIGEST_LENGTH], > unsigned char *buf_return); > > you want us to output digital signature of sha1_buf to buf_return. > > But when we use following encryption method: > > int RSA_private_encrypt(int flen, unsigned char *from, unsigned char *to, > RSA *rsa, int padding); > > we need parameter - RSA *rsa. > > Do you mean that we need to create RSA from secret.c? Yes! You need to create the (RSA*) object from the arrays of characters in "secret.c". You need to call RSA_new() to create this object. Then you need to fill its members with the right data. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Mar 6 00:20:34 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j268KYja031295 for ; Sun, 6 Mar 2005 00:20:34 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j268IKio015442 for ; Sun, 6 Mar 2005 00:18:20 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j268IKjV015437 for cs530@merlot; Sun, 6 Mar 2005 00:18:20 -0800 Date: Sun, 6 Mar 2005 00:18:20 -0800 From: william@bourbon.usc.edu Message-Id: <200503060818.j268IKjV015437@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: additional test data files available for HW4 Hi, To make sure you got every bit correct, I've posted some additional test data files for "sign" and "encrypt" commands. Please see: http://merlot.usc.edu/cs530-s05/homeworks/hw4/index.html#testdata -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Mar 4 23:46:27 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j257kRja008588 for ; Fri, 4 Mar 2005 23:46:27 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j257iEio025384 for ; Fri, 4 Mar 2005 23:44:14 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j257iEYX025379 for cs530@merlot.usc.edu; Fri, 4 Mar 2005 23:44:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j257iDio025373 for ; Fri, 4 Mar 2005 23:44:13 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j257iDM8025368 for cs530; Fri, 4 Mar 2005 23:44:13 -0800 Date: Fri, 4 Mar 2005 23:44:13 -0800 From: william@bourbon.usc.edu Message-Id: <200503050744.j257iDM8025368@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: make clean Hi, In the grading guidelines for HW1 and HW2, I did not ask the grader to check if your "make clean" command works. I will make sure that it's in the grading guidelines for HW4. So, please make sure that it works. The spec says: all binary files created during compilation (.o files, .class files, and executable files) must be removed Since the .so file is a created binary file, "make clean" should remove it. You should not delete "secret.c" because it's not a binary file. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Mar 4 23:44:12 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j257iCja008507 for ; Fri, 4 Mar 2005 23:44:12 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j257fxio024157 for ; Fri, 4 Mar 2005 23:41:59 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j257fwmA024150 for cs530@merlot.usc.edu; Fri, 4 Mar 2005 23:41:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j257fwio024141 for ; Fri, 4 Mar 2005 23:41:58 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j257fvLS024137 for ; Fri, 4 Mar 2005 23:41:58 -0800 Message-Id: <200503050741.j257fvLS024137@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: [cs530] hw4 secret Date: Fri, 04 Mar 2005 23:41:57 -0800 From: william@bourbon.usc.edu Someone wrote: > Do we have to make "hw4 secret" create secret.h also? No. You must use the "secret.h" header file provided in the spec! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Mar 3 14:54:12 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j23MsCja031498 for ; Thu, 3 Mar 2005 14:54:12 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j23Mq3io029198 for ; Thu, 3 Mar 2005 14:52:03 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j23Mq2sK029189 for cs530@merlot.usc.edu; Thu, 3 Mar 2005 14:52:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j23Mq2io029186 for ; Thu, 3 Mar 2005 14:52:02 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j23Mq1BC029176 for ; Thu, 3 Mar 2005 14:52:01 -0800 Message-Id: <200503032252.j23Mq1BC029176@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: grader office hour for HW2 Date: Thu, 03 Mar 2005 14:52:01 -0800 From: william@bourbon.usc.edu Someone wrote: > i created a script with following contents > > set srcdir=~csci530/public/hw2 > > # > # for the following commands, each correct answer gets 1 point > # please use "yesterday" as the passphrase for all tests here > # > /bin/rm -f f?.dat f?.des > foreach f (0 1 2 3 4 5 6 7 8 9) > echo "===> $srcdir/f$f" > ./hw2 enc-des $srcdir/f$f > f$f.des > ./hw2 dec-des f$f.des > f$f.dat > diff $srcdir/f$f f$f.dat > end > /bin/rm -f f?.dat f?.des > > when i run it > > hw2$./script > ./script: line 8: syntax error near unexpected token `(' > ./script: line 8: ` foreach f (0 1 2 3 4 5 6 7 8 9)' > hw2 $ > > I am not sure what is wrong..the script looks fine to me ? These are csh scripts. You are probably running bash as your login shell. You can just do "tcsh" to get into csh/tcsh before running these commands. -- Bill Cheng // bill.cheng@usc.edu > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Tuesday, March 1, 2005 0:19 am > Subject: grader office hour for HW2 > > > Hi, > > > > The grader will hold office hours on Friday 3/4/2005 between > > 2pm and 4pm in SAL 329. Please run all the scripts in > > > > ~csci530/public/hw2/grading-guideline > > > > and write down precisely what the complaints are before going > > to see her. Use the "script" command to create transcripts > > if it would help to clarify things. Thanks! > > -- > > Bill Cheng // bill.cheng@usc.edu > > Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Mar 3 08:06:18 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j23G6Ija016233 for ; Thu, 3 Mar 2005 08:06:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j23G49io004150 for ; Thu, 3 Mar 2005 08:04:10 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j23G49Un004147 for cs530@merlot; Thu, 3 Mar 2005 08:04:09 -0800 Date: Thu, 3 Mar 2005 08:04:09 -0800 From: william@bourbon.usc.edu Message-Id: <200503031604.j23G49Un004147@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: term paper page updated... Hi, In addition to Bruce Schneier, I've decided to add Michael Reiter of CMU to the list. Please check the term paper web page for details. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Mar 1 21:29:55 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j225Ttja031719 for ; Tue, 1 Mar 2005 21:29:55 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j225Rpio008862 for ; Tue, 1 Mar 2005 21:27:51 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j225RovT008851 for cs530@merlot.usc.edu; Tue, 1 Mar 2005 21:27:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j225Roio008845 for ; Tue, 1 Mar 2005 21:27:50 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j225RomU008841 for ; Tue, 1 Mar 2005 21:27:50 -0800 Message-Id: <200503020527.j225RomU008841@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: midterm question Date: Tue, 01 Mar 2005 21:27:49 -0800 From: william@bourbon.usc.edu Someone wrote: > I know that the midterm is mostly focused on lectures, but the assigned > readings contain things like algorithms for AES, IDEA, MD2, etc. > > Will we only be expected to know these types of things in the context they > were covered in class? Or since they're part of the assigned readings, are > they fair game? Since the textbook is required and these are required reading, they are fair game for the exam(s). Regarding those algorithms you mentioned, you are not required to know the details, as far as the exams are concerned. You only need to know the basics about them. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Mar 1 17:37:49 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j221bnja023134 for ; Tue, 1 Mar 2005 17:37:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j221Ziio012155 for ; Tue, 1 Mar 2005 17:35:44 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j221ZiJJ012145 for cs530@merlot.usc.edu; Tue, 1 Mar 2005 17:35:44 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j221Ziio012139 for ; Tue, 1 Mar 2005 17:35:44 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j221ZhaW012132 for ; Tue, 1 Mar 2005 17:35:43 -0800 Message-Id: <200503020135.j221ZhaW012132@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Midterm Syllabus query Date: Tue, 01 Mar 2005 17:35:43 -0800 From: william@bourbon.usc.edu Someone wrote: > The midterm syllabus given on CS530 homepage has "SHA-1 Broken" > included in it,though I dont think we have any slides > on the same.Can you please explain. In class, we had a discussion (no slides). You are responsible for what was discussed. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Mar 1 17:16:32 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j221GWja022355 for ; Tue, 1 Mar 2005 17:16:32 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j221ESio000782 for ; Tue, 1 Mar 2005 17:14:28 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j221ERJl000772 for cs530@merlot.usc.edu; Tue, 1 Mar 2005 17:14:27 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j221ERio000768 for ; Tue, 1 Mar 2005 17:14:27 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j221ERjA000761 for ; Tue, 1 Mar 2005 17:14:27 -0800 Message-Id: <200503020114.j221ERjA000761@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: regarding mid-term content Date: Tue, 01 Mar 2005 17:14:26 -0800 From: william@bourbon.usc.edu Someone wrote: > I just want to reconfirm....... does the Mid Term cover > portions on "key management in practice" covered in lecture > 12( Feb 22, 2005)and lecture 13 (Feb 28, 2005)? No. Please see my message with timestamp "Fri 25 Feb 01:11". -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Mar 1 00:21:04 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j218L4ja016155 for ; Tue, 1 Mar 2005 00:21:04 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j218J1io017939 for ; Tue, 1 Mar 2005 00:19:01 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j218J1tm017937 for cs530@merlot; Tue, 1 Mar 2005 00:19:01 -0800 Date: Tue, 1 Mar 2005 00:19:01 -0800 From: william@bourbon.usc.edu Message-Id: <200503010819.j218J1tm017937@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: grader office hour for HW2 Hi, The grader will hold office hours on Friday 3/4/2005 between 2pm and 4pm in SAL 329. Please run all the scripts in ~csci530/public/hw2/grading-guideline and write down precisely what the complaints are before going to see her. Use the "script" command to create transcripts if it would help to clarify things. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 28 14:16:05 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1SMG5ja025785 for ; Mon, 28 Feb 2005 14:16:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1SME4io005930 for ; Mon, 28 Feb 2005 14:14:04 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1SME3xP005922 for cs530@merlot.usc.edu; Mon, 28 Feb 2005 14:14:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1SME2io005913 for ; Mon, 28 Feb 2005 14:14:02 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1SME23D005909 for ; Mon, 28 Feb 2005 14:14:02 -0800 Message-Id: <200502282214.j1SME23D005909@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Midterm time Date: Mon, 28 Feb 2005 14:14:02 -0800 From: william@bourbon.usc.edu Someone wrote: > I assume that the midterm will be held on the regular class > hours (11:00 am to 12:20 pm)? Just wanted to make sure. Correct. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Feb 27 22:55:53 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1S6trja023186 for ; Sun, 27 Feb 2005 22:55:53 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1S6rrio030792 for ; Sun, 27 Feb 2005 22:53:53 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1S6rqnm030779 for cs530@merlot.usc.edu; Sun, 27 Feb 2005 22:53:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1S6rpio030775 for ; Sun, 27 Feb 2005 22:53:52 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1S6rpkR030768 for ; Sun, 27 Feb 2005 22:53:51 -0800 Message-Id: <200502280653.j1S6rpkR030768@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Question about KDC Date: Sun, 27 Feb 2005 22:53:51 -0800 From: william@bourbon.usc.edu Someone wrote: > In lecture about KDC, the solution for problem 6 was proposed. > > After a client receives {Kc,tgs}Kc and {Kc,tgs}Ktgs from the AS, > a client sends request, that is s, {t}Kc,tgs and {Kc,tgs}Ktgs to > the TGS. > > However, accodring to the lecture note, if an attacker is > sniffing the client's packet, he can know 's', because 's' is not > encrypted. So that attacker knows that the client wants to talk to server s, what can it do? > Why don't you encrypt 's' with Kc,tgs? or just typo? Certainly, encrypting 's' with Kc,tga could help. By the way, it should be understood that not every detail and possible options of Kerberos are shown in this set of slides. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Feb 27 16:49:54 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1S0nsja009619 for ; Sun, 27 Feb 2005 16:49:54 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1S0ltio028470 for ; Sun, 27 Feb 2005 16:47:55 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1S0lsjG028461 for cs530@merlot.usc.edu; Sun, 27 Feb 2005 16:47:54 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1S0lsio028455 for ; Sun, 27 Feb 2005 16:47:54 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1S0lsKM028448 for ; Sun, 27 Feb 2005 16:47:54 -0800 Message-Id: <200502280047.j1S0lsKM028448@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: OpenSSL DES usage Date: Sun, 27 Feb 2005 16:47:53 -0800 From: william@bourbon.usc.edu Someone wrote: > I didn't ask if you knew anything about this during hw2 because I didn't > think of it until recently, but I think it also applies to hw #4 since we're > still using DES and OpenSSL. > > In homework #2, we used the function "DES_ncbc_encrypt" which takes in an > input buffer, output buffer, data length, key schedule, and init vector. We > had a buffer size limited to 4096. Say you had a file with 5000 bytes (it > would require two input read with our max buffer size. > > My concern is the init vector. In the first read, you obviously send in the > init vector obtained from the passphrase. In the second read, do you still > send in that same init vector or should it be the last block read from the > previous input read in order to continue CBC properly? Because CBC > obviously requires the last block in line to work properly. > > For clarification: > > Read #1 > > DES_ncbc_encrypt(input, output, length, key_schedule, init vector from > passphrase, DES_ENCODE); > > Read #2 (two choices) > > A. DES_ncbc_encrypt(input, output, length, key_schedule, init vector from > passphrase, DES_ENCODE); > > OR > > B. DES_ncbc_encrypt(input, output, length, key_schedule, last DES_cblock > from previous read, DES_ENCODE); > > I assume choice A was the correct way to go, but I can't find anywhere to > verify which way CBC encrypt works since the OpenSSL > documentation is not complete. Do you have any ideas? If not I'll dig in > the source code and see what I can find. Actually, it's B above. If you read the documentation for DES: http://www.openssl.org/docs/crypto/des.html you will see that in the BUGS section, it says: DES_cbc_encrypt() does not modify ivec; use DES_ncbc_encrypt() instead. So, the 5th argument (ivec) of DES_ncbc_encrypt() carries *state* information for the block cipher. You can also see this from slide 5 of lecture 6. You can cut the chain off at any point and then call DES_ncbc_encrypt(). The last output block becomes the current IV. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Feb 27 16:40:14 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1S0eEja009333 for ; Sun, 27 Feb 2005 16:40:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1S0cFio023555 for ; Sun, 27 Feb 2005 16:38:15 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1S0cFIe023546 for cs530@merlot.usc.edu; Sun, 27 Feb 2005 16:38:15 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1S0cEio023543 for ; Sun, 27 Feb 2005 16:38:14 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1S0cEns023538 for ; Sun, 27 Feb 2005 16:38:14 -0800 Message-Id: <200502280038.j1S0cEns023538@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Term Paper Deadline Date: Sun, 27 Feb 2005 16:38:14 -0800 From: william@bourbon.usc.edu Someone wrote: > Can you tell me when is the term paper proposal due. Please see: http://merlot.usc.edu/cs530-s05/termpaper.html -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Feb 27 16:39:16 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1S0dGja009224 for ; Sun, 27 Feb 2005 16:39:16 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1S0bHio023028 for ; Sun, 27 Feb 2005 16:37:17 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1S0bGEe023019 for cs530@merlot.usc.edu; Sun, 27 Feb 2005 16:37:16 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1S0bFio023013 for ; Sun, 27 Feb 2005 16:37:15 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1S0bF8R023006 for ; Sun, 27 Feb 2005 16:37:15 -0800 Message-Id: <200502280037.j1S0bF8R023006@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Question Date: Sun, 27 Feb 2005 16:37:15 -0800 From: william@bourbon.usc.edu Someone wrote: > (1) In kdc, solution problem 4, slide 17,,,,the client > "authenticator" is it send before each message sent from the > client to the server? It's part of the message. A message has a few parts, concatenated together. > does it have the following format {current time}kc, or together > the current time and the msg are encrpyted in one msg so {t + > msg}kc and that is called the authenticator?????????? The authenticator is just {t'}Kcs where t' is the current time. You wrote Kc and that's incorrect. It doesn't matter if the message is {t'+data}Kcs or {t'}Kcs+{date}Kcs. It's all just one message. You've done DES encryption in HW2, right? You should know what is the difference between {t'+data}Kcs and {t'}Kcs+{date}Kcs. > (2)In kdc, slide 17 solution to prob 4,,,,,,what about if the man > in the middel resends the message that the client has just > sent,,,,then the time will be close enough to the current time > and it will be accepted by the server,,,and this is not solution > to problem 3? If the clock resolution is such that the server cannot tell if this is a reply, then the attack would be successful. Solution to problem 3 is just using challenge/response. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Feb 27 16:20:34 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1S0KXja008571 for ; Sun, 27 Feb 2005 16:20:34 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1S0IYio013757 for ; Sun, 27 Feb 2005 16:18:34 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1S0IYQa013749 for cs530@merlot.usc.edu; Sun, 27 Feb 2005 16:18:34 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1S0IXio013746 for ; Sun, 27 Feb 2005 16:18:33 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1S0IXrT013736 for ; Sun, 27 Feb 2005 16:18:33 -0800 Message-Id: <200502280018.j1S0IXrT013736@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: midterm location Date: Sun, 27 Feb 2005 16:18:33 -0800 From: william@bourbon.usc.edu Someone wrote: > Has the location for the midterm been annouced yet? I don't > see it on the class page. As it turns out, there will be no room change. So, it will be in OHE 132. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Feb 27 16:09:07 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1S097ja008094 for ; Sun, 27 Feb 2005 16:09:07 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1S077io008390 for ; Sun, 27 Feb 2005 16:07:07 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1S077c7008384 for cs530@merlot.usc.edu; Sun, 27 Feb 2005 16:07:07 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1S076io008377 for ; Sun, 27 Feb 2005 16:07:06 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1S076xX008371 for ; Sun, 27 Feb 2005 16:07:06 -0800 Message-Id: <200502280007.j1S076xX008371@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Rijndael Date: Sun, 27 Feb 2005 16:07:06 -0800 From: william@bourbon.usc.edu Someone wrote: > I read the book (Network Security - Private Comm. in a Public World), > and it says that Rijndael has 10/12/14 rounds. > But the lecture slides say that it has 9/11/13 rounds. > > I am not sure which to follow. Can you tell me which one? Actually, both are correct. One of the rounds in the 10/12/14 rounds is kind of a half a round. So, you can say either it has 10/12/14 rounds or 9/11/13 full rounds. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Feb 27 01:00:12 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1R90Cja027856 for ; Sun, 27 Feb 2005 01:00:12 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1R8wFio002158 for ; Sun, 27 Feb 2005 00:58:15 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1R8wFE7002156 for cs530@merlot; Sun, 27 Feb 2005 00:58:15 -0800 Date: Sun, 27 Feb 2005 00:58:15 -0800 From: william@bourbon.usc.edu Message-Id: <200502270858.j1R8wFE7002156@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: HW4 spec updated Hi, I mentioned during last lecture that although I have posted the spec for HW4, there were some known bugs in the spec. I've fixed these bugs. I've also added 2 more commands (enc and dec, similar to HW2). If you have printed out the previous version of the spec, please get the latest version. >From now on, if I make changes, I'll highlight them using a blue color. If you see problems with the spec or have questions, please send me e-mail. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Feb 25 09:55:03 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1PHt3ja004909 for ; Fri, 25 Feb 2005 09:55:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1PHr9io032436 for ; Fri, 25 Feb 2005 09:53:09 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1PHr8Ht032430 for cs530@merlot.usc.edu; Fri, 25 Feb 2005 09:53:08 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1PHr8io032421 for ; Fri, 25 Feb 2005 09:53:08 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1PHr7AL032415 for ; Fri, 25 Feb 2005 09:53:07 -0800 Message-Id: <200502251753.j1PHr7AL032415@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Hw2 grades Date: Fri, 25 Feb 2005 09:53:07 -0800 From: william@bourbon.usc.edu Someone wrote: > Has the grade for Hw2 come out. I just wanted to make sure. Not yet. I'll send out (automated) individual e-mails like before. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Feb 25 01:13:50 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1P9Doja017482 for ; Fri, 25 Feb 2005 01:13:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1P9Bwio024444 for ; Fri, 25 Feb 2005 01:11:58 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1P9BvP9024442 for cs530@merlot; Fri, 25 Feb 2005 01:11:57 -0800 Date: Fri, 25 Feb 2005 01:11:57 -0800 From: william@bourbon.usc.edu Message-Id: <200502250911.j1P9BvP9024442@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: midterm coverage Hi, The midterm will cover up to and including slide 5 of lecture 11 (which is end of Key Management - Part One). I will have a brief review for the midterm during next class. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Feb 25 01:06:09 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1P968ja017236 for ; Fri, 25 Feb 2005 01:06:08 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1P94Gio020397 for ; Fri, 25 Feb 2005 01:04:16 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1P94GDa020393 for cs530@merlot; Fri, 25 Feb 2005 01:04:16 -0800 Date: Fri, 25 Feb 2005 01:04:16 -0800 From: william@bourbon.usc.edu Message-Id: <200502250904.j1P94GDa020393@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: HW3 solution available Hi, Please see: http://merlot.usc.edu/cs530-s05/homeworks/hw3/sol3.pdf Since this message will be in the message archive, please do not ask me where the solution is again. If you see errors, please send an e-mail to both the TA and myself. HW3 will be graded by the TA. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Feb 24 22:55:02 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1P6t2ja011555 for ; Thu, 24 Feb 2005 22:55:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1P6rAio015646 for ; Thu, 24 Feb 2005 22:53:10 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1P6rAOH015642 for cs530@merlot; Thu, 24 Feb 2005 22:53:10 -0800 Date: Thu, 24 Feb 2005 22:53:10 -0800 From: william@bourbon.usc.edu Message-Id: <200502250653.j1P6rAOH015642@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: an error I made in class... Hi, Someone came to see me during my office hour last week and pointed out an error I made in class. I was going to make a posting about it, but I forgot. The problem is with slide 7 of lecture 8. The slide is correct. But during lectures, I kept saying the opposite thing. On the bottom of that page, it says: DS'(m) = n_1 n_3 n_7 ... n_121 n_139 (where the underscore means subscripting). These are the private keys! But I kept saying that the digital signature contains the public keys and that when someone asks for verification, you send them the corresponding private keys. Again, the slide is correct. When you sign, you release the corresponding private keys. This is why you can only use these private keys once (to sign one document). I apologize for making the mistake during lectures. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Feb 23 23:21:34 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1O7LYja022429 for ; Wed, 23 Feb 2005 23:21:34 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1O7Jhio028433 for ; Wed, 23 Feb 2005 23:19:43 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1O7Jhhc028425 for cs530@merlot.usc.edu; Wed, 23 Feb 2005 23:19:43 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1O7Jgio028422 for ; Wed, 23 Feb 2005 23:19:42 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1O7Jg1f028415 for ; Wed, 23 Feb 2005 23:19:42 -0800 Message-Id: <200502240719.j1O7Jg1f028415@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Homework 3 Date: Wed, 23 Feb 2005 23:19:42 -0800 From: william@bourbon.usc.edu Someone wrote: > Can I submit pdf file or only ascii text file. which one is prefer. According to the Submission section of the electronic submissions guidelines page at http://merlot.usc.edu/cs530-s05/submit.html: For homework and term paper assignments, the only acceptable formats are ASCII text, PDF, Postscript, and HTML. All other formats will receive a score of zero. If you are planning to submit PDF, Postscript, or HTML files, please make sure in advance that your machine is capable of generating files in the format you want and that you are familiar with the procedure. So, PDF or ASCII text are just as acceptable. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Feb 23 22:56:50 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1O6uoja021215 for ; Wed, 23 Feb 2005 22:56:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1O6t0io014966 for ; Wed, 23 Feb 2005 22:55:00 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1O6t0eu014960 for cs530@merlot.usc.edu; Wed, 23 Feb 2005 22:55:00 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1O6sxio014951 for ; Wed, 23 Feb 2005 22:54:59 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1O6sxtw014947 for ; Wed, 23 Feb 2005 22:54:59 -0800 Message-Id: <200502240654.j1O6sxtw014947@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: About hw3, question 3.1 Date: Wed, 23 Feb 2005 22:54:59 -0800 From: william@bourbon.usc.edu Someone wrote: > While 12^5 mod 91 is easy, solving 38^29 mod 91 without a calculator would > take a lot of time (29 being a prime). If something like this pops up in the > exam, I don't want to be wasting 15 min doing the math. > > Hope you understand the concern. I do not understand your concenr. This is a grad class, there is no execuse if you cannot even do simple arithmatics by hand. (There are students in class who are not good at programming, should they be allowed not do the the programming HW assignments and get credit for it?) Please see the bottom of slide 6 of lecture 7. 29=16+8+4+1. So, it's not so bad. If you are not good at this, plesae practice. If you don't want to get good at this, please do not complain if such a problem shows up in the midterm. (If such a problem shows up in the midterm and you are still not familiar with the technique on slide 6 of lecture 7, just skip the problem and make sure you get all the other questions right.) -- Bill Cheng // bill.cheng@usc.edu > -----Original Message----- > From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] > Sent: Monday, February 21, 2005 5:02 PM > To: cs530@bourbon.usc.edu > Subject: Re: About hw3, question 3.1 > > Someone wrote: > > > With regards to calculating the > > cipher c = (m ^ e) MOD n > > c = (12 ^ 5) MOD 91 > > would be allowed to use a calculator, if a similar question would be > asked. > > If this question is asked during the exam, you will not > be allowed to use a calculator. So, you should do this > without a calculator (and may be verifying your answer > using a calculator). > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Feb 23 16:16:50 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1O0Goja005381 for ; Wed, 23 Feb 2005 16:16:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1O0F1io026780 for ; Wed, 23 Feb 2005 16:15:01 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1O0F01C026772 for cs530@merlot.usc.edu; Wed, 23 Feb 2005 16:15:01 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1O0F0io026769 for ; Wed, 23 Feb 2005 16:15:00 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1O0F0ZX026765 for ; Wed, 23 Feb 2005 16:15:00 -0800 Message-Id: <200502240015.j1O0F0ZX026765@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: for des weak key Date: Wed, 23 Feb 2005 16:15:00 -0800 From: william@bourbon.usc.edu Someone wrote: > I have question regarding des weak key, what do you mean by > saying "actual examples" of them. because in some literatures > weak keys are shown with parity. now are we supposed to mention > keys example with partiy or not? Either way! Just make sure that the TA will not misunderstand your answer! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Feb 23 12:35:29 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1NKZTja029482 for ; Wed, 23 Feb 2005 12:35:29 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1NKXeio001635 for ; Wed, 23 Feb 2005 12:33:40 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1NKXemL001627 for cs530@merlot; Wed, 23 Feb 2005 12:33:40 -0800 Date: Wed, 23 Feb 2005 12:33:40 -0800 From: william@bourbon.usc.edu Message-Id: <200502232033.j1NKXemL001627@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: canceling office hour today Hi, Due to a personal matter, I need to cancel today's office hour. I mentioned this at the beginning of class today. Sorry about the short notice. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Feb 22 09:29:27 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1MHTRja000348 for ; Tue, 22 Feb 2005 09:29:27 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1MHRfio013135 for ; Tue, 22 Feb 2005 09:27:41 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1MHReHn013129 for cs530@merlot.usc.edu; Tue, 22 Feb 2005 09:27:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1MHReio013120 for ; Tue, 22 Feb 2005 09:27:40 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1MHRedU013116 for ; Tue, 22 Feb 2005 09:27:40 -0800 Message-Id: <200502221727.j1MHRedU013116@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: #2.2 clarification Date: Tue, 22 Feb 2005 09:27:39 -0800 From: william@bourbon.usc.edu Someone wrote: > I want to clarify the last part about question 2.3. You mean 2.2. > Do u mean to ask "Is the complementation property of DES in a > brute force attack a practical concern" Yes. > Or u mean "Are brute force attacks in general a practical concern" No. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 21 23:56:11 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1M7uBja011148 for ; Mon, 21 Feb 2005 23:56:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1M7sQio006204 for ; Mon, 21 Feb 2005 23:54:26 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1M7sQ0M006199 for cs530@merlot.usc.edu; Mon, 21 Feb 2005 23:54:26 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1M7sPio006190 for ; Mon, 21 Feb 2005 23:54:26 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1M7sPC2006186 for ; Mon, 21 Feb 2005 23:54:25 -0800 Message-Id: <200502220754.j1M7sPC2006186@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: #3.2 clarification Date: Mon, 21 Feb 2005 23:54:25 -0800 From: william@bourbon.usc.edu Someone wrote: > wouldnot this lead us to yet another question while answering? > > I mean i can think of two situations when Bob wont able to > decode the message. > while she encrypts this message with her private key when a > "particular condition" holds true and > while she encrypts it with Bob's public key when the same > condition with different variable holds true. > > Then my question is that should I just mention both of them > or just mention the condition generally. I don't know what you have in mind. May be you should mention everything just to make sure. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Monday, February 21, 2005 8:56 pm Subject: Re: #3.2 clarification > Someone wrote: > > > So I just want to make sure I'm interpreting #3.2 correctly: > > > > The assignment says "One may use RSA to sign a message and then > encrypt the > > resulting signature" and "Suppose that Alice wishes to sign and > then encrypt > > a message for Bob". > > > > So does this mean that Alice will sign the message using her > private key and > > then encrypt the entire message (including her signature) using > Bob's public > > key? > > Yes. > > Notice that this is not normally done (and for a good reason)! > > If you want to sign something, you should create (this includes > encrypting) the data first and then sign it. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 21 20:58:42 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1M4wgja004274 for ; Mon, 21 Feb 2005 20:58:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1M4uwio009715 for ; Mon, 21 Feb 2005 20:56:58 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1M4uwKH009707 for cs530@merlot.usc.edu; Mon, 21 Feb 2005 20:56:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1M4uvio009701 for ; Mon, 21 Feb 2005 20:56:57 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1M4uvc2009694 for ; Mon, 21 Feb 2005 20:56:57 -0800 Message-Id: <200502220456.j1M4uvc2009694@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: #3.2 clarification Date: Mon, 21 Feb 2005 20:56:57 -0800 From: william@bourbon.usc.edu Someone wrote: > So I just want to make sure I'm interpreting #3.2 correctly: > > The assignment says "One may use RSA to sign a message and then encrypt the > resulting signature" and "Suppose that Alice wishes to sign and then encrypt > a message for Bob". > > So does this mean that Alice will sign the message using her private key and > then encrypt the entire message (including her signature) using Bob's public > key? Yes. Notice that this is not normally done (and for a good reason)! If you want to sign something, you should create (this includes encrypting) the data first and then sign it. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 21 17:03:25 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1M13Pja027851 for ; Mon, 21 Feb 2005 17:03:25 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1M11fio014285 for ; Mon, 21 Feb 2005 17:01:41 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1M11fZg014282 for cs530@merlot.usc.edu; Mon, 21 Feb 2005 17:01:41 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1M11fio014277 for ; Mon, 21 Feb 2005 17:01:41 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1M11e2U014273 for ; Mon, 21 Feb 2005 17:01:41 -0800 Message-Id: <200502220101.j1M11e2U014273@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: About hw3, question 3.1 Date: Mon, 21 Feb 2005 17:01:40 -0800 From: william@bourbon.usc.edu Someone wrote: > With regards to calculating the > cipher c = (m ^ e) MOD n > c = (12 ^ 5) MOD 91 > would be allowed to use a calculator, if a similar question would be asked. If this question is asked during the exam, you will not be allowed to use a calculator. So, you should do this without a calculator (and may be verifying your answer using a calculator). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 21 17:02:12 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1M12Bja027841 for ; Mon, 21 Feb 2005 17:02:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1M10Rio013667 for ; Mon, 21 Feb 2005 17:00:27 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1M10Qvw013657 for cs530@merlot.usc.edu; Mon, 21 Feb 2005 17:00:26 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1M10Qio013654 for ; Mon, 21 Feb 2005 17:00:26 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1M10QRa013647 for ; Mon, 21 Feb 2005 17:00:26 -0800 Message-Id: <200502220100.j1M10QRa013647@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: citations Date: Mon, 21 Feb 2005 17:00:26 -0800 From: william@bourbon.usc.edu Someone wrote: > A couple quick things: > > I know for hw #3 that we're not supposed to simply quote websites as answers > to our homework questions, but are we allowed to use Google to assist us in > figuring out some of the answers? If so, would you like us to document > these sites (I assume so)? Or will we lose points for using resources other > than the lectures and class books (this is what I'm most concerned about)? > Also, if we get answers out of the class book, do you want those to be > cited? Due to the nature of this assignment, you only need to cite it if you want to quote it exactly (but then you will lose points). Therefore, the best thing is to read them, understand them, and write in your own words. > For problem 3.2, you mention that "one must consider the modulus involved > when designing crypto systems". When you say "the modulus involved", do you > mean n? So is this actually asking the types of things that could happen if > p and q are chosen badly? i.e. if they're Carmichael numbers? Or does "the > modulus involved" just mean all the potential failings of modular > arithmetic? Or am I missing a more obvious approach? The terminology is that n is the "public modulus" (e is the "encryption key" and d is the "decryption key"). is the "public-key" and is the "private-key". The in not about the case where p and q are bad. You need to talk about a case where this can fail often. I can't say that the solution is "obvious". But I think you should be able to find the answer on the web. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 21 14:48:27 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1LMmRja021070 for ; Mon, 21 Feb 2005 14:48:27 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1LMkhio010576 for ; Mon, 21 Feb 2005 14:46:43 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1LMkh3G010568 for cs530@merlot.usc.edu; Mon, 21 Feb 2005 14:46:43 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1LMkgio010563 for ; Mon, 21 Feb 2005 14:46:42 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1LMkgba010557 for ; Mon, 21 Feb 2005 14:46:42 -0800 Message-Id: <200502212246.j1LMkgba010557@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Regarding hash function properties Date: Mon, 21 Feb 2005 14:46:42 -0800 From: william@bourbon.usc.edu Someone wrote: > I agree, > But the problem is your definition for one-way ness contains both > the property > def given in slide for one way ness : Given H(m),hard to find > m' such that h(m')=h(m) > now if m'=m then its prosperity 1 > and if m' !=m then its property 2 No. Please read what you wrote. For (2), you said "given x ...". That makes all the difference! > but real problem is the note followed by the definition in that > which clreay states that given H(m), > hard to find m " which is very precisely what property 1 is. > > these are the following examples i could come up with , correct > me if i am wrong. > m=ABC > m'=XYZ > h(m)= PI > > now for property 1) h(m) = PI given and from it we should not be > able to derive m = ABC > 2) h(m) and m=ABC given , and we should not able to derive > another m'=XYZ so that h(m)=h(m') > 3) only hash function is known, and we should not able to come up > with m and m' such that h(m)=h(m') > > the only difference i am seeing in the property 2) and 3) is,in > property 3) you can reduce the your attack time by birthday > attack paradox . For problem 1.1 of HW3, you were asked to discuss the answer *in the context of digital signatures*. So, please do not just reiterate the definition but give real world examples instead! For example, if Alice wants to sign a document that says that Bob owes her $1M and she uses a secure hash function in digitally signing the document. If this hash function does not have one-wayness or if it does not have collision-resistence, what kind of attack can easily happen? Also, please use the definition defined on slide 2 of lecture 7. Looks like using the definition from a standard cryptograph text may be confusing. I'll talk about this at the beginning of lectures tomorrow. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Monday, February 21, 2005 11:20 am Subject: Re: Regarding hash function properties > Someone wrote: > > > I have been reading your slides of feb 7th. about hash function, > > and bit confused with properties mentioned there. I have taken > > cs556 and I have done some searches for this. > > > > 1)hash function H is said to be one-way if given a hash value h, > > it is computationally infeasible to find some input x such that > > H(x) = h. > > > > 2)Given a message x and hash function h(x), it is computationally > > infeasible to find a message y not equal to x such that H(x) = > > H(y), then H is said to be a weakly collision-free hash function. > > > > 3)A strongly collision-free hash function H is one for which it > > is computationally infeasible to find any two messages x and y > > such that H(x) = H(y). > > > > so property 1) is one-way function > > property 2) is called either weakly collision-free property or > > first-preimage resistance > > property 3) is called either strong collision-free property or > > second-preimage resistance > > > > while your slides suggest that one-way ness of hash function is > > property 2) while it should be property 1) > > > > waiting for your clarification as it opposes the crypto standard > > terms > > I'm not sure why you would say that. The definition we use > for one-wayness is the same as (1). We skip (2) and use (3) > as the definition of collision resistence. > > Please note the main difference between (1) and (2). (1) is > *given the hash value* and (2) is *given x*. > -- > Bill Cheng // bill.cheng@usc.edu > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 21 13:35:27 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1LLZRja017963 for ; Mon, 21 Feb 2005 13:35:27 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1LLXhio003823 for ; Mon, 21 Feb 2005 13:33:43 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1LLXhv5003820 for cs530@merlot.usc.edu; Mon, 21 Feb 2005 13:33:43 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1LLXgio003812 for ; Mon, 21 Feb 2005 13:33:42 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1LLXgcB003808 for ; Mon, 21 Feb 2005 13:33:42 -0800 Message-Id: <200502212133.j1LLXgcB003808@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Questions Date: Mon, 21 Feb 2005 13:33:42 -0800 From: william@bourbon.usc.edu Someone wrote: > Prof,,,I got some questions regarding the material,,,"I listened > to the recorded lectures but i wasn't able to understand" > > Lamport's One Time signature,,, > (1) you said in the class that you can release both x0 and > x1....Assume the > following scenario: > the sender (the owner of the x0 and x1) sends y0 and one man in > the middle changed it into y1 (he knows the public keys) > ,,,so the receiver receives y1 instead of y0,,,after that the > sender releases both x0 and x1....now the > receiver will mistakenly verify that the information is from the > sender > ... So the question where is the non-repudiation property if it > is possible > that one man in the middle can change without being dedected > since the sender > will reveal both x0 and x1...???(I guess if the sender reveals > only x0 or x1 > not both ,,,,then the non-repudiation property will be there > since the man > in the middle change will be easily caught...) The specific form of releasing information you described in vulnerable to man-in-the-middle attach. But in general, if you put on your web site of your prediction, say y0, so that the world can see your prediction, then it would be hard to attack it. Once the world knows that you have made this prediction, you cannot deny that you have made such a prediction. (Of course, you can still say that it's possible that your y0 get switched to y1 when *anyone* tried to view your web page. It is possible, but unlikely.) > In Engima Machine: > (1) You said weakness in key distribution,,,I wasn't able to know > where is the weakness in the distribution,,,since they > used their master key only once per day and they kept generating > key per day??? > (2) in slide 10 (Enigma Machine),,what do you mean by the point > "session keys encrypted in duplicate" I didn't talk too much about the Enigma machine but just mentioned a few things in passing. Regarding (1), as it turned out, there was a way the key was generated and passed which made it possible to *guess* what the keys were. Regarding (2), I think a session key were encrypted and a copy of it was made in the message but I'm not sure about the details of Enigma. > In KDC,,,, > (1) Slide 12 (lecture 9),,you said that KC could be the client > private key,,,Could you explain because I thought (and > it also said in the book)all the communications are based on > secret key cryptography (So Kc is secret key)??? It's possible that I have misspoken. This section is all about secret-key cryptography. So, there is no public-key or private-key in this section. > In KDC Solution to problem 1 > (1)Doesn't the KDC already know to whom it is taking???I mean In > slide 5(lecture 10),,,why C sends the request {c, s} ,,,since KDC > know that the request is comming from C..... Because if IP spoofing, KDC does not know *for sure* who it is talking to. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 21 11:21:49 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1LJLnja012525 for ; Mon, 21 Feb 2005 11:21:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1LJK5io002465 for ; Mon, 21 Feb 2005 11:20:05 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1LJK5v2002462 for cs530@merlot.usc.edu; Mon, 21 Feb 2005 11:20:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1LJK4io002457 for ; Mon, 21 Feb 2005 11:20:04 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1LJK4JM002446 for ; Mon, 21 Feb 2005 11:20:04 -0800 Message-Id: <200502211920.j1LJK4JM002446@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Regarding hash function properties Date: Mon, 21 Feb 2005 11:20:04 -0800 From: william@bourbon.usc.edu Someone wrote: > I have been reading your slides of feb 7th. about hash function, > and bit confused with properties mentioned there. I have taken > cs556 and I have done some searches for this. > > 1)hash function H is said to be one-way if given a hash value h, > it is computationally infeasible to find some input x such that > H(x) = h. > > 2)Given a message x and hash function h(x), it is computationally > infeasible to find a message y not equal to x such that H(x) = > H(y), then H is said to be a weakly collision-free hash function. > > 3)A strongly collision-free hash function H is one for which it > is computationally infeasible to find any two messages x and y > such that H(x) = H(y). > > so property 1) is one-way function > property 2) is called either weakly collision-free property or > first-preimage resistance > property 3) is called either strong collision-free property or > second-preimage resistance > > while your slides suggest that one-way ness of hash function is > property 2) while it should be property 1) > > waiting for your clarification as it opposes the crypto standard > terms I'm not sure why you would say that. The definition we use for one-wayness is the same as (1). We skip (2) and use (3) as the definition of collision resistence. Please note the main difference between (1) and (2). (1) is *given the hash value* and (2) is *given x*. -- Bill Cheng // bill.cheng@usc.edu -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sat Feb 19 21:41:24 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1K5fOja013384 for ; Sat, 19 Feb 2005 21:41:24 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1K5diio017764 for ; Sat, 19 Feb 2005 21:39:44 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1K5di5C017757 for cs530@merlot.usc.edu; Sat, 19 Feb 2005 21:39:44 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1K5diio017748 for ; Sat, 19 Feb 2005 21:39:44 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1K5dh5t017744 for ; Sat, 19 Feb 2005 21:39:44 -0800 Message-Id: <200502200539.j1K5dh5t017744@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: the EOF confusion... Date: Sat, 19 Feb 2005 21:39:43 -0800 From: william@bourbon.usc.edu Someone wrote: > Just wondering that why has the K&R book ( pg. 16 ) put down a program which > talks of end of file as a char to see the end-of-file. > > Main() > { > Int c; > C=getchar(); > While( c!=EOF) { > Putchar(c); > C=getchar(); > } > } I've mentioned that you should do 'man x' if you are not familiar with 'x' or if you want to know about all error conditions. If you do 'man getchar', the RETURN VALUE section says: Upon successful completion, fgetc(), getc(), getc_unlocked(), getchar(), getchar_unlocked(), and getw() return the next byte from the input stream pointed to by stream. If the stream is at end-of-file, the end-of-file indicator for the stream is set and these functions return EOF. If a read error occurs, the error indicator for the stream is set, EOF is returned, and errno is set to indicate the error. If you read the above *carefully*, you will see that EOF is *not* a character but a condition. You should read *all* man pages carefully! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Feb 18 22:46:08 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1J6k8ja026204 for ; Fri, 18 Feb 2005 22:46:08 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1J6iUio019066 for ; Fri, 18 Feb 2005 22:44:31 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1J6iUoW019060 for ; Fri, 18 Feb 2005 22:44:30 -0800 Message-Id: <200502190644.j1J6iUoW019060@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: FWD: ISACA Spring Conference Date: Fri, 18 Feb 2005 22:44:30 -0800 From: william@bourbon.usc.edu Hi, I'm forwarding an announcement regarding a ISACA (IT Audit & Security organization) event which is looking for student volunteers. Volunteers will receive free admissions to the event. Please see the message below for details. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Fri, 18 Feb 2005 20:30:23 -0500 From: "Shar, Stephen" To: "'bill.cheng@usc.edu'" Subject: ISACA Spring Conference Mr. Cheng, A few USC students have provided me your contact information with regards to the topic of IT security. I am part of the IT (IRM) team at KPMG and am actively involved 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: Just to give you a brief overview, the ISACA Los Angeles chapter is the one of the largest IT Audit & Control organization in the world with over 300 members. ISACA holds an annual spring conference inviting professionals from around the world to attend sessions and network with business professionals. The ISACA Spring Conference is an opportunity for students to be involved in a professional association event and make professional Contacts in IT Audit, Control and Security related professions. (Website: www.isacala.org) ISACA is looking for students who can volunteer during the dates of: April 10 through 13. We will ultimately be choosing students from different schools to help with the event. Volunteers will be granted free admission and the network opportunities are tremendous. The members attending this event are employed from most of the big companies and firms within the Los Angeles vicinity. However, members across the nation also participate in this event. We will send more details once we select the students, but the students will generally help prepare for the presentations, assist the presenters, and support the overall venue. More information can be found on the website at: http://www.isacala.org/2005SpringConference/2005SpringConferenceHome.html If you can, please forward this e-mail or announce this opportunity to your students. Anyone interested should contact myself as soon as possible by e-mail at sshar@kpmg.com or (213)533-3385. The deadline to apply for this is March 17. Thanks, Stephen Shar KPMG LLP Risk Advisory Services 355 South Grand Ave, Suite 2000 Los Angeles, CA 90071-1568 c. (626)374-3540 p. (213)533-3385 f. (213)955-8459 sshar@kpmg.com ***************************************************************************** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients any opinions or advice contained in this email are subject to the terms and conditions expressed in the governing KPMG client engagement letter. ***************************************************************************** Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Feb 18 18:52:36 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1J2qaja017560 for ; Fri, 18 Feb 2005 18:52:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1J2oxio022581 for ; Fri, 18 Feb 2005 18:50:59 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1J2oxMc022577 for ; Fri, 18 Feb 2005 18:50:59 -0800 Message-Id: <200502190250.j1J2oxMc022577@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: FW: can you forward this to CSCI 530 TA / Class mailing list and post it on discussion board ? Date: Fri, 18 Feb 2005 18:50:58 -0800 From: william@bourbon.usc.edu Hi, I'm just forwarding an announcement regarding a USC students security group activity. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: bhaskara@usc.edu [mailto:bhaskara@usc.edu] Sent: Friday, February 18, 2005 1:18 PM Subject: can you forward this to CSCI 530 TA / Class mailing list and post it on discussion board ? WHAT: USC-SEC Digital Security Group February Meeting DATE / TIME / PLACE: Tuesday, February 22th. 6:15pm @ GFS-106 TOPIC: What it takes to build a security consulting practice GUEST SPEAKER: Robert E. Lee Robert E. Lee serves as Dyad Security's Chief Technical Officer where he leverages his extensive consulting services background. Robert's primary function for Dyad Security is managing the security testing team, guiding the security software & technology development, and managing the education programs. Due to the nature of the services Dyad offers, Robert also works closely with world wide law enforcement to combat would-be attackers. Prior to joining Dyad Security, Robert served many fortune 1000 companies as a consultant for High Availability, Disaster Recovery, Business Continuity, and Security related projects. Robert is very active in the Information Security community and is a contributor to such projects as The Open Source Security Testing Methodology Manual (OSSTMM), the OPTE project, and the Dyad Security sponsored Unicornscan project. Robert also serves as the Director of Projects & Resources for the Institute for Security and Open Methodologies (ISECOM) and is a frequent speaker at technology conferences. PURPOSE: USC-SEC is a user group formed to advocate and promote digital security awareness and consciousness in an increasingly technologically dependent world. An open forum of lectures, discussions, projects and other presentations will be geared toward giving attendees both in-depth knowledge of security theory centered on the use of computers and digital devices as well as practical skills that can be put to use in real-world scenarios. CONTACT INFORMATION: uscsec@usc.edu || http://www-scf.usc.edu/~uscsec Cheers, Shawn -- Shawn Sherman President, USC-SEC University of Southern California e: sesherma@usc.edu w: http://www-scf.usc.edu/~uscsec Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Feb 17 07:56:56 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1HFuuja003369 for ; Thu, 17 Feb 2005 07:56:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1HFtNio013015 for ; Thu, 17 Feb 2005 07:55:23 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1HFtNX9013013 for cs530@merlot; Thu, 17 Feb 2005 07:55:23 -0800 Date: Thu, 17 Feb 2005 07:55:23 -0800 From: william@bourbon.usc.edu Message-Id: <200502171555.j1HFtNX9013013@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: appointments for today (Thu 2/17/2005)... Hi, Someone asked for an appointment for today and I told him that I won't be on campus until 3pm and I have to go to teach my other class at 3:15pm. My schedule has changed and I will be on campus by 1:30pm (but I will *not* be in SAL 342). If you would like to see me today, please send me e-mail soon to make an appointment. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Feb 15 11:23:44 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1FJNija031213 for ; Tue, 15 Feb 2005 11:23:44 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1FJMFio020203 for ; Tue, 15 Feb 2005 11:22:15 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1FJMFpZ020201 for cs530@merlot.usc.edu; Tue, 15 Feb 2005 11:22:15 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1FJMFio020195 for ; Tue, 15 Feb 2005 11:22:15 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1FJMFwV020188 for ; Tue, 15 Feb 2005 11:22:15 -0800 Message-Id: <200502151922.j1FJMFwV020188@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Bistro confirmation. Date: Tue, 15 Feb 2005 11:22:14 -0800 From: william@bourbon.usc.edu Someone wrote: > After I submitted my first assignment I got an email confirmation from > Bistro but I have not got a confirmation about my second assignment > submission ( but I did get a Verification successful ... message ). Should I > be worried ? You will get a confirmation soon after I *collect* your submissions. I'll do that today. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 14 22:28:31 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1F6SVja000697 for ; Mon, 14 Feb 2005 22:28:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1F6R4io010222 for ; Mon, 14 Feb 2005 22:27:04 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1F6R48Z010218 for cs530@merlot.usc.edu; Mon, 14 Feb 2005 22:27:04 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1F6R3io010212 for ; Mon, 14 Feb 2005 22:27:03 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1F6R3No010208 for ; Mon, 14 Feb 2005 22:27:03 -0800 Message-Id: <200502150627.j1F6R3No010208@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: setting LD_LIBRARY_PATH Date: Mon, 14 Feb 2005 22:27:03 -0800 From: william@bourbon.usc.edu Someone wrote: > I am verifying my submission, and I have aone question. Will you > have the LD_LIBRARY_PATH environment variable set when you MAKE > my project? I have been manually setting it using, > setenv LD_LIBRARY_PATH /home/scf-22/csci551b/openssl/lib:/usr/lib We will follow the spec too! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 14 22:26:57 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1F6Qvja000616 for ; Mon, 14 Feb 2005 22:26:57 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1F6PTio009325 for ; Mon, 14 Feb 2005 22:25:29 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1F6PT1X009320 for cs530@merlot.usc.edu; Mon, 14 Feb 2005 22:25:29 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1F6PSio009314 for ; Mon, 14 Feb 2005 22:25:29 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1F6PStw009304 for ; Mon, 14 Feb 2005 22:25:28 -0800 Message-Id: <200502150625.j1F6PStw009304@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: DES_set_key Date: Mon, 14 Feb 2005 22:25:28 -0800 From: william@bourbon.usc.edu Someone wrote: > I am facing this problem, my odd parity key is stored in > unsigned char des_key[8], part of my class, > when i create it and all everything goes ok.encryption works fine. > even creatin at time of decryption works fine > when i use it for decryption i.e > when i call > DES_set_key(&des_key,sch) it gives a seg fault. > > To the best of my knowledge I have been doing all the steps for > setting up DES but it doesnt seem to work.. Is your sch pointing to an allocated buffer? You have to do the memory allocation yourself. DES_set_key() assumes that sch points to allocated memory. Please also make sure that you follow the list of good programming practice: http://merlot.usc.edu/cs530-s05/lectures/lecture1/slides-18.html The other thing you should have done is to start doing HW2 two weeks ago! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 14 19:33:23 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1F3XMja026234 for ; Mon, 14 Feb 2005 19:33:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1F3Vtio012663 for ; Mon, 14 Feb 2005 19:31:55 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1F3VsL3012652 for cs530@merlot.usc.edu; Mon, 14 Feb 2005 19:31:54 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1F3Vsio012648 for ; Mon, 14 Feb 2005 19:31:54 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1F3VsPk012642 for ; Mon, 14 Feb 2005 19:31:54 -0800 Message-Id: <200502150331.j1F3VsPk012642@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: encryption Date: Mon, 14 Feb 2005 19:31:53 -0800 From: william@bourbon.usc.edu Someone wrote: > When we are taking a pass phrase a user doent enter anything and > just hits enter but the sha1 still creates the hash value and > encryption occurs .. so my question is that if the person dont > enter any passphrase so we have to print error or this is fine A reasonable thing would be to print "please try again" and loop to the point where you ask for passphrase. Or you can just say the password is not accept and dont' encrypt. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 14 16:31:37 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1F0Vbja019305 for ; Mon, 14 Feb 2005 16:31:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1F0UBio026911 for ; Mon, 14 Feb 2005 16:30:11 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1F0UB0B026909 for cs530@merlot.usc.edu; Mon, 14 Feb 2005 16:30:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1F0UAio026906 for ; Mon, 14 Feb 2005 16:30:11 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1F0UAag026896 for ; Mon, 14 Feb 2005 16:30:10 -0800 Message-Id: <200502150030.j1F0UAag026896@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Question-hw2 Date: Mon, 14 Feb 2005 16:30:10 -0800 From: william@bourbon.usc.edu Someone wrote: > no, i am just testing the example in the spec. > if i have a 20 byte buffer, the "Hello World\n" example will > work perfectly. > but I changed to use a 8 byte buffer, so the DES_ncbc_encrypt() > function will be called twice. The first half has good output, > but the 2nd part will be wrong. I'm not sure what the problem is. Debug, debug, debug! -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Monday, February 14, 2005 4:00 pm Subject: Re: Question-hw2 > Someone wrote: > > > I am facing a weird situation here. Hope you will have some > > insights. > > I'm using the DES_ncbc_encrypt() function to encrypt things. > > Becuase of the buffer size problem i will have to call this > > function several times in order to encrypt the whole file. For > > instance, i have a 100 size buffer, and if the file size is 180, > > then this function will be called twice. Here's the situation, > > the first timecalling it is encrypting fine, however the 2nd time > > is totally wrong. I have double checked all the arguments for > > this function and everything is correct. > > The funny thing is if i raise the buffer size to 200, this > > function will run correctly. The only problem is when i have to > > run it more than 1 time. > > Did you try to use the 200-byte buffer to encrypt a 201-byte > input file (or something a lot larger like some of the test > data files for HW1)? > > I would actually use a buffer size of 8 and always call > DES_ncbc_encrypt() with 8 for the length argument for both > encryption and decryption. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 14 16:01:28 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1F01Sja018120 for ; Mon, 14 Feb 2005 16:01:28 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1F001io031495 for ; Mon, 14 Feb 2005 16:00:01 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1F001uu031493 for cs530@merlot.usc.edu; Mon, 14 Feb 2005 16:00:01 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1F001io031490 for ; Mon, 14 Feb 2005 16:00:01 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1F001CF031486 for ; Mon, 14 Feb 2005 16:00:01 -0800 Message-Id: <200502150000.j1F001CF031486@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Question-hw2 Date: Mon, 14 Feb 2005 16:00:01 -0800 From: william@bourbon.usc.edu Someone wrote: > I am facing a weird situation here. Hope you will have some > insights. > I'm using the DES_ncbc_encrypt() function to encrypt things. > Becuase of the buffer size problem i will have to call this > function several times in order to encrypt the whole file. For > instance, i have a 100 size buffer, and if the file size is 180, > then this function will be called twice. Here's the situation, > the first timecalling it is encrypting fine, however the 2nd time > is totally wrong. I have double checked all the arguments for > this function and everything is correct. > The funny thing is if i raise the buffer size to 200, this > function will run correctly. The only problem is when i have to > run it more than 1 time. Did you try to use the 200-byte buffer to encrypt a 201-byte input file (or something a lot larger like some of the test data files for HW1)? I would actually use a buffer size of 8 and always call DES_ncbc_encrypt() with 8 for the length argument for both encryption and decryption. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Feb 14 14:40:48 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1EMemja015154 for ; Mon, 14 Feb 2005 14:40:48 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1EMdLio027565 for ; Mon, 14 Feb 2005 14:39:21 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1EMdLOx027563 for cs530@merlot; Mon, 14 Feb 2005 14:39:21 -0800 Date: Mon, 14 Feb 2005 14:39:21 -0800 From: william@bourbon.usc.edu Message-Id: <200502142239.j1EMdLOx027563@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: HW3 spec is available Hi, HW3 is a lightweight HW (only 25 points). Remember, if you find answers on the web, you should not just copy them. You should understand them, digest them, and write down the answer in your own words. Quoting from answers on the web will receive a low score. Most questions in HW3 should be answered with short answers. Please think about the answers and condense them into short and precise answers if the problem descriptions ask for short answers. If you have questions, please send e-mail to the TA. The TA will be grading HW3. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 14 13:21:32 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1ELLWja011528 for ; Mon, 14 Feb 2005 13:21:32 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1ELK6io030290 for ; Mon, 14 Feb 2005 13:20:06 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1ELK5QA030285 for cs530@merlot.usc.edu; Mon, 14 Feb 2005 13:20:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1ELK5io030279 for ; Mon, 14 Feb 2005 13:20:05 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1ELK5Uv030275 for ; Mon, 14 Feb 2005 13:20:05 -0800 Message-Id: <200502142120.j1ELK5Uv030275@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Question-hw2 Date: Mon, 14 Feb 2005 13:20:05 -0800 From: william@bourbon.usc.edu Someone wrote: | > > (3)Something strange occured with openssl,,,if i give it a file | > > that consists of the following data "abcd" only with out \n(I | > > created the file programmatically)....it doesn't do base64 | > > decoding???(And i think it is a correct input)???so do consider | > > such a thing an error....(one line without \n) | > | > Hmm... interesting. Well, openssl is probably not without bugs. | > | For this what I think that when we encode the file it always | has /n in the end so while decoding if it deoes not find any | /n it thinks that file is not valid so it doesnot process the | file. I am not sure about this but this what I think...Is I | am thinking right?? You are probably right. Usually, the last line of an base64 encoded file should end with a '\n'. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 14 13:16:30 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1ELGUja011349 for ; Mon, 14 Feb 2005 13:16:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1ELF4io028389 for ; Mon, 14 Feb 2005 13:15:04 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1ELF4ir028387 for cs530@merlot.usc.edu; Mon, 14 Feb 2005 13:15:04 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1ELF4io028384 for ; Mon, 14 Feb 2005 13:15:04 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1ELF4wd028376 for ; Mon, 14 Feb 2005 13:15:04 -0800 Message-Id: <200502142115.j1ELF4wd028376@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: MD5 and SHA1 output format Date: Mon, 14 Feb 2005 13:15:04 -0800 From: william@bourbon.usc.edu Someone wrote: > With openssl, whenever a filename is supplied the output for MD5 and SHA1 > is like > MD5()= > and SHA1() = > > Is this output format to be followed? Please see my message with timestamp "Mon 07 Feb 13:03". > When decrypting the file in dec-des call, do we provide output only after > ensuring SHA1 value of the decrypted file is same as that of the one > provided in the file to be decrypted Usually, the output will be redirected to a file. So, you should output the data to stdout on the fly and print out an error message at the end to stderr if the SHA1 value does not match. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 14 08:05:22 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1EG5Mja031795 for ; Mon, 14 Feb 2005 08:05:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1EG3uio013914 for ; Mon, 14 Feb 2005 08:03:56 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1EG3ujn013912 for cs530@merlot.usc.edu; Mon, 14 Feb 2005 08:03:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1EG3uio013909 for ; Mon, 14 Feb 2005 08:03:56 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1EG3u7d013905 for ; Mon, 14 Feb 2005 08:03:56 -0800 Message-Id: <200502141603.j1EG3u7d013905@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hw2 interpretation question Date: Mon, 14 Feb 2005 08:03:56 -0800 From: william@bourbon.usc.edu Someone wrote: > The spec about DES says: > > "Since DES is a block cipher and it encrypts a 8-byte block at a time, THE > SIZE OF AN ENCRYPTED FILE is always a multiple of 8 bytes. (If the input > file size is not a multiple of 8 bytes, please pad enough bytes of '\0's at > the end.)" > > When it says "the size of an encrypted file"...should that read "the size of > a file to be encrypted" (I realize in theory they should both be a multiple > of 8 bytes)? The spec is correct. It's talking about the output file generated by your DES encryption. The size of the file to be encrypted can be any size. The size of the file to be encrypted, but after padding with zeroes, will be a multiple of 8 bytes. > My interpretation is that if the input file to be ENcrypted is not a > multiple of 8 bytes, then you must pad '\0' characters on the end and store > the # of real bytes in the last 8 byte block. That last line was incorrect. It should be "the # of real bytes in byte 3 of the output file". > If the input file to be DEcrypted is not a multiple of 8 bytes, then it's an > error condition and the error should be reported to the user. Yes. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 14 08:00:50 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1EG0oja031642 for ; Mon, 14 Feb 2005 08:00:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1EFxOio009639 for ; Mon, 14 Feb 2005 07:59:24 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1EFxOUf009635 for cs530@merlot.usc.edu; Mon, 14 Feb 2005 07:59:24 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1EFxOio009628 for ; Mon, 14 Feb 2005 07:59:24 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1EFxO48009624 for ; Mon, 14 Feb 2005 07:59:24 -0800 Message-Id: <200502141559.j1EFxO48009624@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Question-hw2 Date: Mon, 14 Feb 2005 07:59:24 -0800 From: william@bourbon.usc.edu Someone wrote: > (1) in the des-encoding,,,I rejected the empty files and I > considered an error since it is not logicat to create an > encryption for an empty file(Please correct me if i am > wrong)?????and if i am mistaken,,,then if we write the output > file do we discard the byte that represents the number of bytes > in the last block,,,in otherwords the output will be a file of 23 > byte only 3 for DES and 20 for the hash??? By the way, DES is not doing "encoding"; it's doing "encrypting". If you don't want to encrypt an empty file, make sure you print out a nice message if the input file is empty. I think this is better than deciding what byte 3 of the output should be. > (2) The outpout of md5 and sha1 a hex string,,,the question do we > append \n to it or not??? Yes. This is because you are running a commandline program and your output is ASCII. Always return the cursor to the left in this case. > (3)Something strange occured with openssl,,,if i give it a file > that consists of the following data "abcd" only with out \n(I > created the file programmatically)....it doesn't do base64 > decoding???(And i think it is a correct input)???so do consider > such a thing an error....(one line without \n) Hmm... interesting. Well, openssl is probably not without bugs. > (4)There were a lot of discussions in the error handling,,,as far > as our program mimic the openssl in error handling...would this > cause us to loose some marks,,,(the program doesn't crash and > does exactly as openssl in case of error)?Also,,,Is it necessary > to clarify exactly why the file has a wrong structure in the > error handling.......... Please look at the grading guideline for HW1. Not many points are deducted for not handling bad input files. We will do something similar for HW2. When you detect an error, you should report it. You do not have to pinpoint the error. But it's a good idea to let the user know why your program cannot complete its task. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 14 07:52:55 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1EFqtja031329 for ; Mon, 14 Feb 2005 07:52:55 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1EFpUio002071 for ; Mon, 14 Feb 2005 07:51:30 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1EFpUiT002069 for cs530@merlot.usc.edu; Mon, 14 Feb 2005 07:51:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1EFpUio002066 for ; Mon, 14 Feb 2005 07:51:30 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1EFpT5K002062 for ; Mon, 14 Feb 2005 07:51:30 -0800 Message-Id: <200502141551.j1EFpT5K002062@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: salting Date: Mon, 14 Feb 2005 07:51:29 -0800 From: william@bourbon.usc.edu Someone wrote: > I think may be it what openssl doing. because > *not* only my programme but openssl command > > openssl enc -e -des -in helloworld.txt > > is also giving the output with salt. > i agree that my program may go wrong, but why > openssl command giving output with salt? Are you trying to make your data look like openssl output? The DES part of the spec does *not* say that you should mimic openssl output. The documentation for "openssl enc" is at: http://www.openssl.org/docs/apps/enc.html I'm assuming that you have read it. Then it should be clear that salting is being done if you run the command above. If you don't want salt to be applied, please add -nosalt to your command. If you are asking why salting the key is needed in general, the answer is that it is a mechanism used to mitigate pre-computed dictonary attacks. We will talk about that later in the semester. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 14 00:51:31 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1E8pVja015212 for ; Mon, 14 Feb 2005 00:51:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1E8o6io009594 for ; Mon, 14 Feb 2005 00:50:06 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1E8o6wA009591 for cs530@merlot.usc.edu; Mon, 14 Feb 2005 00:50:06 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1E8o6io009583 for ; Mon, 14 Feb 2005 00:50:06 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1E8o6qX009579 for ; Mon, 14 Feb 2005 00:50:06 -0800 Message-Id: <200502140850.j1E8o6qX009579@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: minor DES question Date: Mon, 14 Feb 2005 00:50:06 -0800 From: william@bourbon.usc.edu Someone wrote: > It's somewhat vague in the assignment, so I just want to make sure. If the > operation is DES encoding, then we need to check the key for being a weak > key. If the operation is DES decoding, should we exclude this check? I > would image that it's the user's own fault if they don't know the password > and by throwing a weak key error, they might be getting more information > than they should from a bad password entry. Yes, you don't need to check if the key is weak if you are decrypting. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 14 00:48:45 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1E8mija015103 for ; Mon, 14 Feb 2005 00:48:44 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1E8lKio006930 for ; Mon, 14 Feb 2005 00:47:20 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1E8lKrY006928 for cs530@merlot.usc.edu; Mon, 14 Feb 2005 00:47:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1E8lJio006925 for ; Mon, 14 Feb 2005 00:47:19 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1E8lJTM006921 for ; Mon, 14 Feb 2005 00:47:19 -0800 Message-Id: <200502140847.j1E8lJTM006921@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: salt problem Date: Mon, 14 Feb 2005 00:47:19 -0800 From: william@bourbon.usc.edu Someone wrote: > >You should *not* ask any of the function to salt your key. > > I am not asking any fuction to do that but > even command > openssl enc -e -des -in helloworld.txt > gives the following output > Salted__}`&Ù-ÑJ¿¸xa[÷=Ç##U" > > Thats what happens with my programme also. > any suggestion? I have no idea what's causing this. But it's clear that you have asked a function to salt your key. As I've mentioned several times, you must know *exactly* what you are doing with every placement of bits and every library function calls. What you should do is to examine every bit that you are putting down and every function call you make. Unfortunately, I don't know what else to tell you. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 14 00:25:01 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1E8P1ja014216 for ; Mon, 14 Feb 2005 00:25:01 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1E8Naio016811 for ; Mon, 14 Feb 2005 00:23:36 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1E8NawS016809 for cs530@merlot.usc.edu; Mon, 14 Feb 2005 00:23:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1E8Naio016801 for ; Mon, 14 Feb 2005 00:23:36 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1E8Na4l016796 for ; Mon, 14 Feb 2005 00:23:36 -0800 Message-Id: <200502140823.j1E8Na4l016796@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: des encryption Date: Mon, 14 Feb 2005 00:23:36 -0800 From: william@bourbon.usc.edu Someone wrote: > --------------this is what in given specification--------------------- > Adjusting least significant bits in each byte so that each byte > has odd parity, the final key you should use is (in hexstring > representation): > > fec42aba67570b9d > > The 2nd 8 bytes is the above SHA-1 value is (in hexstring > representation): > > 32a14207fb6d3de3 > > And this is the value you should use for the initialization > vector when you call DES_ncbc_encrypt(). > > --------this is what openssl specification tells----------------------- > Before a DES key can be used, it must be converted into the > architecture dependent DES_key_schedule via the > DES_set_key_checked() or DES_set_key_unchecked() function. > > ---------------------------------------------------------------------- > so my simple question is that do we need to call > DES_set_key_checked() function or not?if not then getting key > with parity and intialization vector is just enough to call > DES_ncbc_encrypt(). and no other steps required How? DES_ncbc_encrypt() requires an object with type DES_key_schedule* in the 4th argument. You need to create an object of that type from the first 8 byte of the SHA1 output buffer. Looks like DES_set_key_checked() is not the only choice that can do that. > --------------------------------------------------------------------- > and when i do des encryption with openssl to given > hello-world.txt output starts with > "Salted_ " and that is excatly what happens with my programm. so > i am not getting hexdump as given by you. I have no idea where "Salted_" come from. You should *not* ask any of the function to salt your key. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Feb 13 21:06:39 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1E56dja006808 for ; Sun, 13 Feb 2005 21:06:39 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1E55Fio023047 for ; Sun, 13 Feb 2005 21:05:15 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1E55FPJ023045 for cs530@merlot.usc.edu; Sun, 13 Feb 2005 21:05:15 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1E55Fio023039 for ; Sun, 13 Feb 2005 21:05:15 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1E55Fod023033 for ; Sun, 13 Feb 2005 21:05:15 -0800 Message-Id: <200502140505.j1E55Fod023033@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Odd Parity Check Date: Sun, 13 Feb 2005 21:05:15 -0800 From: william@bourbon.usc.edu Someone wrote: > I am hitting a roadblock in trying to figure out the odd > parity in the DES key. Specifically, is the "yesnomaybe" > example on the class website correct? It states that > fec42bbb66560a9d > should be adjusted to > fec42aba67570b9d > > Why does byte "fe" not change, > fe = 0110 0110 0110 0101, which has even parity(eight 1's), > so it should change! I'm not sure how you get fe to be 0110 0110 0110 0101. The "fec42bbb66560a9d" is in hexstring representation. So, "fe" is just 1111 1110. > Then, "2b" changes into "2a", but > 2b = 0011 0010 0110 0010 changes into > 2a = 0011 0010 0110 0001 ???? > But this alters more than just the least-significant bit? Similarly, "2b" is just 0010 1011. > I feel like I am missing something very obvious here(probably > because I've been programming way too much!) I'd appreciate > it if you could clarify this for me. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Feb 13 21:03:15 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1E53Fja006658 for ; Sun, 13 Feb 2005 21:03:15 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1E51pio019800 for ; Sun, 13 Feb 2005 21:01:51 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1E51pVk019798 for cs530@merlot.usc.edu; Sun, 13 Feb 2005 21:01:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1E51pio019795 for ; Sun, 13 Feb 2005 21:01:51 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1E51pla019791 for ; Sun, 13 Feb 2005 21:01:51 -0800 Message-Id: <200502140501.j1E51pla019791@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: DES encryption Date: Sun, 13 Feb 2005 21:01:51 -0800 From: william@bourbon.usc.edu Someone wrote: > According to the openssl documentation - > "There are two phases to the use of DES encryption. The first is the > generation of a DES_key_schedule from a key, the second is the actual > encryption." > > Are we supposed to use a functions like DES_string_to_key() to change the > key form a string to type (DES_cblock *)and then use DES_set_key_sched() to > convert this key to type (DES_key_schedule *), before passing it to > DES_ncbc_encrypt()? Because when I do this I think the value of the key is > changing. No! Don't use DES_string_to_key() because we have a specific way of creating the key from passphrase. You must create the IV and the key according to the project spec. Hint: please note that in DES_cblock is declared as: typedef unsigned char DES_cblock[8]; So, you can just copy data into it using memcpy() from a data buffer (the output buffer of SHA-1). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Feb 13 20:58:09 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1E4w9ja006479 for ; Sun, 13 Feb 2005 20:58:09 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1E4uiio014930 for ; Sun, 13 Feb 2005 20:56:44 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1E4ui2c014925 for cs530@merlot.usc.edu; Sun, 13 Feb 2005 20:56:44 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1E4uiio014919 for ; Sun, 13 Feb 2005 20:56:44 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1E4uidj014915 for ; Sun, 13 Feb 2005 20:56:44 -0800 Message-Id: <200502140456.j1E4uidj014915@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: base64 decode bad input working Date: Sun, 13 Feb 2005 20:56:44 -0800 From: william@bourbon.usc.edu Someone wrote: > Just wanted to let you know that you were right about the callback > functions. They actually can be used to intercept the data before it gets > into the input buffer on a BIO_read. It's a bit tricky to set up since > OpenSSL's documentation is a little sparse, but usable if you can figure it > out. I can successfully terminate the program when there's bad input on a > Base64 decode. Ah ha! Great to hear that it works. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Feb 13 20:54:56 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1E4suja006330 for ; Sun, 13 Feb 2005 20:54:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1E4rVio011850 for ; Sun, 13 Feb 2005 20:53:31 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1E4rVmc011842 for cs530@merlot.usc.edu; Sun, 13 Feb 2005 20:53:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1E4rVio011839 for ; Sun, 13 Feb 2005 20:53:31 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1E4rVcj011835 for ; Sun, 13 Feb 2005 20:53:31 -0800 Message-Id: <200502140453.j1E4rVcj011835@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Question-hw2 Date: Sun, 13 Feb 2005 20:53:31 -0800 From: william@bourbon.usc.edu Someone wrote: > (1)Are we allowed to use temporary files.....????? By now you should know that it's a *bad idea*. As usual, you can do it, but you will lose a lot of points. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Feb 13 20:50:38 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1E4ocja006169 for ; Sun, 13 Feb 2005 20:50:38 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1E4nEio007748 for ; Sun, 13 Feb 2005 20:49:14 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1E4nExX007746 for cs530@merlot.usc.edu; Sun, 13 Feb 2005 20:49:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1E4nEio007737 for ; Sun, 13 Feb 2005 20:49:14 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1E4nEwJ007733 for ; Sun, 13 Feb 2005 20:49:14 -0800 Message-Id: <200502140449.j1E4nEwJ007733@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Question-hw2 Date: Sun, 13 Feb 2005 20:49:14 -0800 From: william@bourbon.usc.edu Someone wrote: > (1) Is there a max-limit on the passphrase size,,,,since you have > to specify the max-length of character in des_read_pw? Just use something reasonable (meaning not too small). > (2) You said that the number of bytes in the last block is > between 1..8 inclusive....It is always considered an error if we > have an empty file to be encrypted? There is nothing to encrypt in this case. Therefore, the "last block" does not exist. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Feb 13 20:48:09 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1E4m9ja006061 for ; Sun, 13 Feb 2005 20:48:09 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1E4kjio005379 for ; Sun, 13 Feb 2005 20:46:45 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1E4kjns005371 for cs530@merlot.usc.edu; Sun, 13 Feb 2005 20:46:45 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1E4kjio005368 for ; Sun, 13 Feb 2005 20:46:45 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1E4kjpM005364 for ; Sun, 13 Feb 2005 20:46:45 -0800 Message-Id: <200502140446.j1E4kjpM005364@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: base64 decode Date: Sun, 13 Feb 2005 20:46:45 -0800 From: william@bourbon.usc.edu Hi, I have mentioned in class that one of the great thing about the openssl package is that the source code is available. I'm not sure if the *only* way to solve the bad input problem is to read the source code. But for people who really want to spend the time, the code is there. It's only going to be a few points for bad base64 input. I'm cannot determine if it's worthwhile for individual students to figure things out by reading the source code. Although I think it's great to read source code of popular packages just to see how things are done. It's also great to learn how to read source code. When you work on a large project in the real world, you will spend a lot of time reading source code. Might as well get trained for it now! -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Sun, 13 Feb 2005 11:31:53 -0800 To: william@bourbon.usc.edu Subject: Re: base64 decode Hi Professor Cheng, It might be helpful to tell the class thet they need to look at the source fi les, not the header files, in the openssl package to see how to get access to t he innards of BIO. openssl just uses a void pointer where the crucial data is i n the bio struct, and that pointer is cast to a struct which is DEFINED ONLY IN ONE OF THE SOURCE FILES AND NOT IN THE HEADER FILES. So, without knowing the s tructure of ths struct, checking base64 decoding input is impossible. That shou ld save some head-bashing-into-walls. And really, who writes the documentation for openssl? I'm certainly against v erbose documentation that regurgitates the entire source, but this is just cr*p . They don't even explain what the arguments to the functions are! Well, I better finish my own homework off before worrying about others, shoul dn't I? :) Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Feb 13 10:00:49 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1DI0nja014519 for ; Sun, 13 Feb 2005 10:00:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1DHxQio011713 for ; Sun, 13 Feb 2005 09:59:26 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1DHxQJs011705 for cs530@merlot.usc.edu; Sun, 13 Feb 2005 09:59:26 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1DHxQio011702 for ; Sun, 13 Feb 2005 09:59:26 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1DHxQPu011698 for ; Sun, 13 Feb 2005 09:59:26 -0800 Message-Id: <200502131759.j1DHxQPu011698@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: base64 decode Date: Sun, 13 Feb 2005 09:59:26 -0800 From: william@bourbon.usc.edu Someone wrote: > I am of the opinion that it is virtually impossible to do this checking > without rewinding the file. If openssl was implemented correctly, it would > return an error code under these conditions. Also, correct me if I am wrong > (and I'm sure you will, with many exclamation points), but it may be a > little unreasonable to say two days before the due date that our programs > should work differently than openssl when in the assignment you state: " You > should compare your result against the result of running the following at a > command prompt: > openssl enc -d -base64 -in file"... and you sometimes directly compare > our output with openssl using "diff" when grading. I've mentioned during class that you should do the diff when you check for correct operation for your program. (I usually talk about HW stuff at the beginning of class.) > I spent most of my > Saturday yesterday trying to find a solution here, and came up empty. If it > is truly a requirement to behave differently than openssl, then we shouldn't > be forced to use the openssl library. My implementation of Base64 decoding > for homework 1 worked perfectly under all conditions, and performed the > necessary error checking/correcting. If this error checking is *absolutely* > necessary, can we not just use our hw1 solution for this? The only thing I can say, which I've said many times, if someone does better than you, you may get less points. Nothing is absolutely necessary. (You can certainly use some code from hw1 to check if the input data is legal. But you are suppose to use BIO_f_base64() to do the encoding and decoding.) > The most frustrating part of this is that I'm taking this class to learn > about security. After many hours of trying to fix this deficiency in > openssl, what more do I know about security? Nothing. What would I learn > about security if I ever managed to get it working? Nothing. I program for > a living, so please don't tell me you're trying to teach me to program > correctly. And, I learned more about Base64 in the last assignment by > implementing it myself. Why do we need to beat a dead horse? Unfortunately, not every assignment is suppose to make everyone learn new things. The next assignment will probably have some crypto questions. People who have taken the crypto class will probably feel the same way as you do here. Also, these are just HW assignments or exercises. What are exercises suppose to do? They should get you more familiar with some subjects or to try things out. It also helps in assigning grades. And in general, it would probably be true that you can learn more about security by reading some papers or books than doing any HW assignments. Since you program for a living, have you tried out the BIO_set_callback() and related functions? (My guess is that other students who haven't done serious programming may not even know what to do with callback functions since the man pages for these functions are kind of sketchy.) > I'm moving on... take off "lots of points" if you must. Of course! And from the grading guidelines of HW1, you can see that we don't spend too much time on bad data. Clearly, moving on would be the right thing to do if you believe that there is no way (or would require a lot of work) to get around the problem. Also, it should be clear that SHA1, MD5, BASE64, and DES will not be weighted equally in HW2. So, spending too much time on bad data for BASE64 may not be a good strategy. It's probably better to spend time on bullet-proofing your DES code. -- Bill Cheng // bill.cheng@usc.edu > -----Original Message----- > From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] > Sent: Sunday, February 13, 2005 12:18 AM > To: cs530@bourbon.usc.edu > Subject: Re: base64 decode > > Someone wrote: > > > The only way I've found that OpenSSL implements base64 decoding is > through > > the bio_f_base64 filter. To decode, this filter must be appended to an > > input stack on top of the BIO from which you read in the data. By > reading > > in data through this filter, it is decoded. Unfortunately, this also > leads > > to some problems in trying to detect bad data in the input file for > base64 > > decoding. > > > > There's no way to be able to look at the data before it's been run > through > > the decoding filter. If it's a file being read in, you can look and > rewind, > > but that's not feasible for working from stdin. The BIO_read functions > will > > return the # of bytes read in (through the filter). If you do > > BIO_read(infile,inBuffer,4096) and you get less than 4096 characters, > that's > > a possible indication that something went wrong, but that could also > mean > > that you've hit the last section of the input stream. > > > > Because of the way OpenSSL implements this functionality, it's virtually > > > impossible to check the encoded data. I've look into writing a > BIO_METHOD > > filter, but all the documents I've seen say that it's infeasible to do > it > > and get it working properly. > > > > Do you have any suggestions on how we can go about doing this? I've > > considered using a temporary file or stream, but I figured that was > against > > the rules. I'm not sure how else to proceed. > > I haven't tried the BIO_set_callback() and related functions. > They may work (or they may not work). > > If there is no way to do it, then don't do it! If no one in > class can report errors for base64 decoding, then everyone > loses the same number of points (if we end up testing these > conditions). Then it's like a no-op! > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Feb 13 08:55:56 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1DGtuja012065 for ; Sun, 13 Feb 2005 08:55:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1DGsXio024798 for ; Sun, 13 Feb 2005 08:54:33 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1DGsXMt024796 for cs530@merlot.usc.edu; Sun, 13 Feb 2005 08:54:33 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1DGsXio024793 for ; Sun, 13 Feb 2005 08:54:33 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1DGsW1b024789 for ; Sun, 13 Feb 2005 08:54:33 -0800 Message-Id: <200502131654.j1DGsW1b024789@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hw2 spec spec des_read_pw() In-Reply-To: My message of "Sat, 12 Feb 2005 22:23:21 PST." <200502130623.j1D6NLMw032459@bourbon.usc.edu> Date: Sun, 13 Feb 2005 08:54:32 -0800 From: william@bourbon.usc.edu Hi, Just want to make a clarification. The posting below referenced a message I posted earlier. In the earlier message, I wrote: > If you have trouble using it (des_read_pw()), you can also > write your own. In this case, you don't have to hide what > the user is typing. If the user sess the passphrase when he/she enters it, you may get less points (minor deductions) than other students who successfully use des_read_pw() so that the passphrase does not appear on the screen. My comment above about "you can also write your own" does not mean "without penalty". If you want to do your own, please make sure that you wipe out what the user types with "\r" or cover them with "*" (I would consider this to be equivalent to using des_read_pw()). -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Sat, 12 Feb 2005 22:23:21 -0800 From: william@bourbon.usc.edu To: cs530@bourbon.usc.edu Subject: Re: hw2 spec spec des_read_pw() Someone wrote: > I'm sorry if you already answered this, I didn't find anything in > any of the emails I have. You can go to the class home page, click on Messages from Bill, click on View All Archived Messages, then do a search for des_read_pw. > The spec says to use des_read_pw() but there are two options, you > can either read in the password once, or > make the user enter it twice to verify what he typed. Since the > grading will probably be done with a script as in hw1 > which should we use? It seems to me the read it twice option is > better.. To encrypt, a good UI would probably require entering password twice. To decrypt, you should only need to enter the password once. (The grader may not do everything with a script.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Feb 13 00:19:45 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1D8Jjja014167 for ; Sun, 13 Feb 2005 00:19:45 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1D8INio012480 for ; Sun, 13 Feb 2005 00:18:23 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1D8INw9012478 for cs530@merlot.usc.edu; Sun, 13 Feb 2005 00:18:23 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1D8INio012475 for ; Sun, 13 Feb 2005 00:18:23 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1D8INMw012471 for ; Sun, 13 Feb 2005 00:18:23 -0800 Message-Id: <200502130818.j1D8INMw012471@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: base64 decode Date: Sun, 13 Feb 2005 00:18:23 -0800 From: william@bourbon.usc.edu Someone wrote: > The only way I've found that OpenSSL implements base64 decoding is through > the bio_f_base64 filter. To decode, this filter must be appended to an > input stack on top of the BIO from which you read in the data. By reading > in data through this filter, it is decoded. Unfortunately, this also leads > to some problems in trying to detect bad data in the input file for base64 > decoding. > > There's no way to be able to look at the data before it's been run through > the decoding filter. If it's a file being read in, you can look and rewind, > but that's not feasible for working from stdin. The BIO_read functions will > return the # of bytes read in (through the filter). If you do > BIO_read(infile,inBuffer,4096) and you get less than 4096 characters, that's > a possible indication that something went wrong, but that could also mean > that you've hit the last section of the input stream. > > Because of the way OpenSSL implements this functionality, it's virtually > impossible to check the encoded data. I've look into writing a BIO_METHOD > filter, but all the documents I've seen say that it's infeasible to do it > and get it working properly. > > Do you have any suggestions on how we can go about doing this? I've > considered using a temporary file or stream, but I figured that was against > the rules. I'm not sure how else to proceed. I haven't tried the BIO_set_callback() and related functions. They may work (or they may not work). If there is no way to do it, then don't do it! If no one in class can report errors for base64 decoding, then everyone loses the same number of points (if we end up testing these conditions). Then it's like a no-op! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sat Feb 12 23:28:16 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1D7SGja012314 for ; Sat, 12 Feb 2005 23:28:16 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1D7Qrio028421 for ; Sat, 12 Feb 2005 23:26:53 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1D7Qr4b028417 for cs530@merlot.usc.edu; Sat, 12 Feb 2005 23:26:53 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1D7Qrio028410 for ; Sat, 12 Feb 2005 23:26:53 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1D7QrSm028406 for ; Sat, 12 Feb 2005 23:26:53 -0800 Message-Id: <200502130726.j1D7QrSm028406@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: illegal characters in base64 encoded file Date: Sat, 12 Feb 2005 23:26:53 -0800 From: william@bourbon.usc.edu Someone wrote: > I am not sure how we are going to check data since openssl > function reads data from bio (stdin/file) and decodes it using > BIO_read(bio, inbuf, ....) and gives decoded version of input.. > and if we read data from stdin (to check validity) then there is > no way to feed this data back to BIO_read I'm not sure about this. Have you look into the BIO_set_callback() and related functions? -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Saturday, February 12, 2005 9:41 am Subject: Re: illegal characters in base64 encoded file > Someone wrote: > > > I trying to run some tests on my program (specifically the base64 > > encoding/decoding functions). I am inserting some illegal > > characters (like '$') in the Base64 encoded file. When I try to > > decode it using the openssl command from the command prompt, it > > actually give more or less the actual original file except a few > > missing characters. The same output is given by my program. > > Probably because the functions are the same - from openssl. So is > > this correct or not. > > You are *not* suppose to mimic openssl's behavior when the > input is bad! > > The important thing about openssl is the libraries. The > openssl executable is kind of like a demo program for all the > library functions. It serves a useful purpose when the data > is correct. When the data is bad, you should do better than > the demo program. > > > Also, how is it possible to calculate whether the number of legal > > characters in base64 encoded file, is a multiple of 4 or not, > > without parsing the file twice. > > Even if all the characters in the file is legal, you cannot > predict where the '\n' are. So, you cannot *calculate* how > many regular characters there are using something like stat(). > Therefore, you must examine the data bytes. I'm not sure > exactly what you mean by parsing the file twice. You probably > have to look at each character more than once. But you don't > have to rewind the file. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sat Feb 12 22:26:30 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1D6QUja010025 for ; Sat, 12 Feb 2005 22:26:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1D6P8io001713 for ; Sat, 12 Feb 2005 22:25:08 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1D6P8c7001711 for cs530@merlot.usc.edu; Sat, 12 Feb 2005 22:25:08 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1D6P7io001702 for ; Sat, 12 Feb 2005 22:25:08 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1D6P7d2001698 for ; Sat, 12 Feb 2005 22:25:07 -0800 Message-Id: <200502130625.j1D6P7d2001698@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Number of characters in the last byte Date: Sat, 12 Feb 2005 22:25:07 -0800 From: william@bourbon.usc.edu Someone wrote: > The specifications say that if the input file is not a multiple > of 8 then pad it with enough '\0'. I was wondering in this case > why does one require to know the number of bytes on the last > block as in any case as anyways the characters after the first > '\0' are neglected. You should treat your input file as a *binary file*. There can be zeroes everywhere. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sat Feb 12 22:24:43 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1D6Ohja009943 for ; Sat, 12 Feb 2005 22:24:43 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1D6NLio032468 for ; Sat, 12 Feb 2005 22:23:21 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1D6NLh6032466 for cs530@merlot.usc.edu; Sat, 12 Feb 2005 22:23:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1D6NLio032463 for ; Sat, 12 Feb 2005 22:23:21 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1D6NLMw032459 for ; Sat, 12 Feb 2005 22:23:21 -0800 Message-Id: <200502130623.j1D6NLMw032459@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hw2 spec spec des_read_pw() Date: Sat, 12 Feb 2005 22:23:21 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm sorry if you already answered this, I didn't find anything in > any of the emails I have. You can go to the class home page, click on Messages from Bill, click on View All Archived Messages, then do a search for des_read_pw. > The spec says to use des_read_pw() but there are two options, you > can either read in the password once, or > make the user enter it twice to verify what he typed. Since the > grading will probably be done with a script as in hw1 > which should we use? It seems to me the read it twice option is > better.. To encrypt, a good UI would probably require entering password twice. To decrypt, you should only need to enter the password once. (The grader may not do everything with a script.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sat Feb 12 09:42:52 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1CHgqja014209 for ; Sat, 12 Feb 2005 09:42:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1CHfVio025203 for ; Sat, 12 Feb 2005 09:41:31 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1CHfVUt025201 for cs530@merlot.usc.edu; Sat, 12 Feb 2005 09:41:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1CHfVio025192 for ; Sat, 12 Feb 2005 09:41:31 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1CHfV8q025188 for ; Sat, 12 Feb 2005 09:41:31 -0800 Message-Id: <200502121741.j1CHfV8q025188@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: illegal characters in base64 encoded file Date: Sat, 12 Feb 2005 09:41:31 -0800 From: william@bourbon.usc.edu Someone wrote: > I trying to run some tests on my program (specifically the base64 > encoding/decoding functions). I am inserting some illegal > characters (like '$') in the Base64 encoded file. When I try to > decode it using the openssl command from the command prompt, it > actually give more or less the actual original file except a few > missing characters. The same output is given by my program. > Probably because the functions are the same - from openssl. So is > this correct or not. You are *not* suppose to mimic openssl's behavior when the input is bad! The important thing about openssl is the libraries. The openssl executable is kind of like a demo program for all the library functions. It serves a useful purpose when the data is correct. When the data is bad, you should do better than the demo program. > Also, how is it possible to calculate whether the number of legal > characters in base64 encoded file, is a multiple of 4 or not, > without parsing the file twice. Even if all the characters in the file is legal, you cannot predict where the '\n' are. So, you cannot *calculate* how many regular characters there are using something like stat(). Therefore, you must examine the data bytes. I'm not sure exactly what you mean by parsing the file twice. You probably have to look at each character more than once. But you don't have to rewind the file. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Feb 11 10:50:19 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1BIoJja026242 for ; Fri, 11 Feb 2005 10:50:19 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1BIn0io026779 for ; Fri, 11 Feb 2005 10:49:00 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1BIn0KH026774 for cs530@merlot.usc.edu; Fri, 11 Feb 2005 10:49:00 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1BIn0io026771 for ; Fri, 11 Feb 2005 10:49:00 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1BIn06T026767 for ; Fri, 11 Feb 2005 10:49:00 -0800 Message-Id: <200502111849.j1BIn06T026767@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: about encrypted file size Date: Fri, 11 Feb 2005 10:49:00 -0800 From: william@bourbon.usc.edu Someone wrote: > The DES encrypted file given on the class website > (yesterday.txt.enc) is of size 496 bytes. > When I opened it, there was no SHA1 hash in it. I'm not sure why you would say this. When I do a hexdump (using HW1) of yesterday.txt.enc, the first 2 lines are: 000000: 44 45 53 07 40 a6 8b 1b 47 a3 06 79 2d 74 f0 02 DES.@~~.G~.y-t~. 000010: e2 68 06 37 98 28 07 b7 56 5f ae 81 a5 24 ee 4b ~h.7~(.~V_~~~$~K If I do "openssl sha1 yesterday.txt", I get: 40a68b1b47a306792d74f002e2680637982807b7 Looks like this matches with bytes 0x04 through 0x17 (inclusive) of yesterday.txt.enc. Also, the file size of yesterday.txt is 471, which is 58*8+7. Therefore, the number bytes in the last 8-byte block is 7. This macehs byte 0x03 of yesterday.txt.enc. > But, when I put the hash in the file that I am encrypting, that > becomes 516 bytes (496+20 bytes of hash). > > Am I correct in saying that while grading, a file with the hash > will be used? I'm not sure what you mean. I think you may be confused about what needs to be done. You should read the spec again, carefully. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Feb 10 22:25:58 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1B6Pwja030592 for ; Thu, 10 Feb 2005 22:25:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1B6Ofio006835 for ; Thu, 10 Feb 2005 22:24:41 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1B6Of6e006830 for cs530@merlot.usc.edu; Thu, 10 Feb 2005 22:24:41 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1B6Ofio006824 for ; Thu, 10 Feb 2005 22:24:41 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1B6OftX006820 for ; Thu, 10 Feb 2005 22:24:41 -0800 Message-Id: <200502110624.j1B6OftX006820@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Question about term paper. Date: Thu, 10 Feb 2005 22:24:41 -0800 From: william@bourbon.usc.edu Someone wrote: > According to the class web page, my term paper should reference 3 > published peer-reviewed papers authored (or co-authored) by B. > Schneier. Does this mean that the topic of my term paper should > be closely related to (or same as) one of the topics dealt in > Schneier's papers? It needs to be related, but *not* necessarily *closely* related. B. Schneier has written a lot of papers, so there are plenty of topics to choose from. You may also suggest another author who has written a lot of security papers. If you are not sure, make a proposal and send it to the TA. Make sure you include at least 3 references from B. Schneier. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Feb 10 22:11:28 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1B6BSja030074 for ; Thu, 10 Feb 2005 22:11:28 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1B6ABio025576 for ; Thu, 10 Feb 2005 22:10:11 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1B6ABs7025574 for cs530@merlot.usc.edu; Thu, 10 Feb 2005 22:10:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1B6ABio025571 for ; Thu, 10 Feb 2005 22:10:11 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1B6ABoY025567 for ; Thu, 10 Feb 2005 22:10:11 -0800 Message-Id: <200502110610.j1B6ABoY025567@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: weak key Date: Thu, 10 Feb 2005 22:10:11 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm in the process of making final checks to my homework, but I > have one problem--making sure that the weak key check is working > correctly. I have yet to have my program warn me about a weak > key, and I'm not sure if it's working right, or that i just > haven't been creative enough with the passwords. Since there are not many weak keys for DES, randomly generated keys will unlikely be weak. > Do you have an instance of a password which generates a weak key? > I was hoping you do, seeing as how you'd probably test for that > in the grading. You should be able to find out what are some weak keys in DES (search the web, look into books, etc.) Since SHA-1 has the one-wayness property, you cannot find out what passwords can generate such weak keys. But, you have full control of your program. After you apply SHA-1, you can memcpy() a pattern to overwrite the SHA-1 buffer and test what you want. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Feb 10 22:04:48 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1B64mja029830 for ; Thu, 10 Feb 2005 22:04:48 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1B63Vio019135 for ; Thu, 10 Feb 2005 22:03:31 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1B63Vut019133 for cs530@merlot.usc.edu; Thu, 10 Feb 2005 22:03:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1B63Vio019130 for ; Thu, 10 Feb 2005 22:03:31 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1B63V5N019126 for ; Thu, 10 Feb 2005 22:03:31 -0800 Message-Id: <200502110603.j1B63V5N019126@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: base64 Date: Thu, 10 Feb 2005 22:03:31 -0800 From: william@bourbon.usc.edu Someone wrote: > How do I create a bad input and incorrect file format so that > openssl API for base64 encoding/decoding returns error? Do we > have any sample files with bad inputs and incorrect file format? It's your responsibility to check your program thoroughly. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Feb 10 22:03:28 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1B63Sja029749 for ; Thu, 10 Feb 2005 22:03:28 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1B62Bio017852 for ; Thu, 10 Feb 2005 22:02:11 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1B62AH0017850 for cs530@merlot.usc.edu; Thu, 10 Feb 2005 22:02:10 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1B62Aio017841 for ; Thu, 10 Feb 2005 22:02:10 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1B62Ast017837 for ; Thu, 10 Feb 2005 22:02:10 -0800 Message-Id: <200502110602.j1B62Ast017837@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: DEN site grades Date: Thu, 10 Feb 2005 22:02:10 -0800 From: william@bourbon.usc.edu Someone wrote: > Will you be posting our grades to the DEN site, or is the > emailed score going to be the only place we'll see it? The grades will be sent to you via individual e-mails. You should keep track of the scores you have received. You can also send me e-mail if you like to know your scores. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Feb 10 21:32:06 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1B5W6ja028631 for ; Thu, 10 Feb 2005 21:32:06 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1B5Unio020647 for ; Thu, 10 Feb 2005 21:30:49 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1B5UnGc020642 for cs530@merlot.usc.edu; Thu, 10 Feb 2005 21:30:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1B5Unio020639 for ; Thu, 10 Feb 2005 21:30:49 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1B5UnvX020635 for ; Thu, 10 Feb 2005 21:30:49 -0800 Message-Id: <200502110530.j1B5UnvX020635@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Spec Question Date: Thu, 10 Feb 2005 21:30:49 -0800 From: william@bourbon.usc.edu Someone wrote: > Under the explaination of enc-des and dec-des there is an example > which says the following. > > If the user enters: > yesnomaybe > whose SHA-1 hash value is (in hexstring representation): > fec42bbb66560a9d32a14207fb6d3de3e93bbdbe > > I just wanted to make sure that the above passpharase doesn't > produce the above SHA-1 hash value. It should be: > de075999100fd281bd1e7bef7c02708a2509b7ef The SHA-1 hash value of "yesnomaybe\n" is de075999100fd281bd1e7bef7c02708a2509b7ef The SHA-1 hash value of "yesnomaybe" is fec42bbb66560a9d32a14207fb6d3de3e93bbdbe The spec is correct. To verify, you can get these two different results from: echo "yesnomaybe" | openssl sha1 echo -n "yesnomaybe" | openssl sha1 The 2nd form (with the -n) means "without \n at the end". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Feb 10 09:50:47 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1AHolja002365 for ; Thu, 10 Feb 2005 09:50:47 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1AHnVio027006 for ; Thu, 10 Feb 2005 09:49:31 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1AHnVKD027004 for cs530@merlot.usc.edu; Thu, 10 Feb 2005 09:49:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1AHnVio027001 for ; Thu, 10 Feb 2005 09:49:31 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1AHnV8e026997 for ; Thu, 10 Feb 2005 09:49:31 -0800 Message-Id: <200502101749.j1AHnV8e026997@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Question...in decoding/encoding base64 Date: Thu, 10 Feb 2005 09:49:31 -0800 From: william@bourbon.usc.edu Someone wrote: > (1) We have always to assume that we may receive incorrect file > format when doing base64-decoding,,,,,Do we have to check the > file (whether it obeys to base64 encoding/decoding) using the > openssl functions or we can perform our own check? You can perform your own check if you cannot figure out how to do it with openssl functions. > (2) Could we do the checking of the correctness of the file > structure format even before starting doing the base64-decoding? > Or is this considered a bad way since we may scan the file two > times one for checking and the other for decoding.... It's up to you. I don't think that's a good way. I think you should do checks if a function fails. > (3) According to the specification in openssl > documentation,,,BIO_read and BIOwrite may return that no bytes > have been read/written even if there is no error....I know such a > case could occur in socket where you may try to read and you find > nothing but is this possbile with files??? Don't know. You may want to check the source code (you can download it) if you want to know for sure. > (4)if you do BIO_read and it returns 0...is it possible if you do > it again on the same file it will read some bytes???if yes,,,how > could we know that we reach the endof-file??? Don't know. My guess is that if you experiment with it a bit, you may find out what it's doing. But, in the worst case, if you really want to know for sure, you should download the source code and look at it. > (5)if we perform BIO_write for n characters,,,is it possible that > some of the n charachters are written???(i read the documentation > and still I am not sure) Don't know. You may want to check the source code (you can download it) if you want to know for sure. When you write documentation, is it always complete? If it's rarely complete, it's possible that other people's documentation is not complete. Good thing the source code is there if you really want to find out for sure. (You can also try to call other functions that look like they are better documented.) > (6)in openssl md5 and sha1,,,if we give them empty files they > produce some results,,,do we have to produce the same results if > we are given an empty file or we can issue an error??? You must produce the same result because the results are correct! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Feb 9 23:07:03 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1A773ja010290 for ; Wed, 9 Feb 2005 23:07:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1A75nio005660 for ; Wed, 9 Feb 2005 23:05:49 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1A75m4l005655 for cs530@merlot.usc.edu; Wed, 9 Feb 2005 23:05:48 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1A75mio005652 for ; Wed, 9 Feb 2005 23:05:48 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1A75mG4005648 for ; Wed, 9 Feb 2005 23:05:48 -0800 Message-Id: <200502100705.j1A75mG4005648@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: base64 library Date: Wed, 09 Feb 2005 23:05:48 -0800 From: william@bourbon.usc.edu Someone wrote: > I write this in my function > > char buf[100],buff[100]; > int i; > i= des_read_pw(buf,buff,10,"Enter Passphrase",1); > printf("%d",i); > printf("%s",buf); > > but very time it is returning -1 that is system error. Can > you pleasse tell me why it is happening. My guess is that it cannot find the des_read_pw() function. Did you follow everything in: http://merlot.usc.edu/cs530-s05/homeworks/hw2/#compile When you compile, did you turn on compiler warnings and see if it complained about anything? (Please do *not* send me your configuration as ask me if it's correct.) -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Tuesday, February 1, 2005 10:23 pm Subject: Re: base64 library > Someone wrote: > > > I've have been searching through the documentation online and > also grep'd > > the openssl library, and the only base64 function I can find > is the > > BIO_f_base64. Is this the one you would like us to use for > the program? > > I did "grep base64 *.h" in the openssl/include/openssl directory > and BIO_f_base64() in "evp.h" is the only one I found. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Feb 8 21:53:40 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j195reja015307 for ; Tue, 8 Feb 2005 21:53:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j195qSio009661 for ; Tue, 8 Feb 2005 21:52:28 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j195qSka009659 for cs530@merlot.usc.edu; Tue, 8 Feb 2005 21:52:28 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j195qRio009656 for ; Tue, 8 Feb 2005 21:52:27 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j195qRnG009652 for ; Tue, 8 Feb 2005 21:52:27 -0800 Message-Id: <200502090552.j195qRnG009652@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Where to write the warning message...? Date: Tue, 08 Feb 2005 21:52:27 -0800 From: william@bourbon.usc.edu Someone wrote: > According to the spec, when a file is decrypted using des, SHA-1 > value of the decrypted file is calculated > and compared with the one in the header. If they are different, > the program should print out the warning message. > Then, where should I write the message to? At the end of > decrypted file or to the monitor (terminal screen)? You should write to stderr. (You cannot write to stdout because that's the decrypted output goes. Usually, the output will be redirected to a file.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Feb 8 15:18:32 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j18NIWja000606 for ; Tue, 8 Feb 2005 15:18:32 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j18NHLio026570 for ; Tue, 8 Feb 2005 15:17:21 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j18NHL7s026568 for cs530@merlot.usc.edu; Tue, 8 Feb 2005 15:17:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j18NHLio026565 for ; Tue, 8 Feb 2005 15:17:21 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j18NHKKX026561 for ; Tue, 8 Feb 2005 15:17:21 -0800 Message-Id: <200502082317.j18NHKKX026561@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: HW2 hash calc Date: Tue, 08 Feb 2005 15:17:20 -0800 From: william@bourbon.usc.edu Someone wrote: | In an earlier email you said: | | > You can do a two-pass thing by calculating the SHA-1 first, | > then rewind the file (or close it and open it again) and | > encrypt on the 2nd pass. | > | > If the output were to go into a regular file (which is not | > the case for HW2), you could rewind the output file using | > lseek() or equivalent and write the SHA-1 value at the | > beginning of the output file. But since we are writing to | > stdout, lseek() may not work. So, this is not an option. | | Well, if the user enters data from stdin, then you call rewind() or | fseek() on the stdin stream and then try to fread() from it, you get a | bus error (although this method works just fine if your stream is a | file). So, are we allowed to create a temporary file on the local disk | to store the stdin data for the second pass through? For DES encryption and decryption, the spec says that you must specify an input file. So, the input data cannot come from stdin (but the passphrase comes from stdin). Therefore, you can always rewind the input for these cases. Also, you cannot get a bus error if you call rewind() or fseek() on stdin! As I've mentioned before, you must check your return code to any system call or library function! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Feb 8 08:10:43 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j18GAhja016696 for ; Tue, 8 Feb 2005 08:10:43 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j18G9Wio029725 for ; Tue, 8 Feb 2005 08:09:32 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j18G9W24029723 for cs530@merlot.usc.edu; Tue, 8 Feb 2005 08:09:32 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j18G9Wio029714 for ; Tue, 8 Feb 2005 08:09:32 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j18G9WvO029710 for ; Tue, 8 Feb 2005 08:09:32 -0800 Message-Id: <200502081609.j18G9WvO029710@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Memory Buffer Size Date: Tue, 08 Feb 2005 08:09:32 -0800 From: william@bourbon.usc.edu Someone wrote: > The specifications for hw2 say > "If the size of the input file is large, you must not read the > whole file into a large memory buffer and then process the file > data. The maximum size of a memory buffer is limited to 4,096 > bytes" > > for hw1 > "If the size of the input file is large, you must not read the > whole file into a large memory buffer and then process the file > data. The maximum size of a memory buffer is limited to 1,024 > bytes." > Why this discrepancy? Just that for HW2 you can use a larger buffer. Of course, using a smaller buffer would fall within spec. Personally, I would use a small one. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Feb 8 08:07:21 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j18G7Lja016520 for ; Tue, 8 Feb 2005 08:07:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j18G6Aio026569 for ; Tue, 8 Feb 2005 08:06:10 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j18G6Acn026567 for cs530@merlot.usc.edu; Tue, 8 Feb 2005 08:06:10 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j18G6Aio026564 for ; Tue, 8 Feb 2005 08:06:10 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j18G6Ag1026560 for ; Tue, 8 Feb 2005 08:06:10 -0800 Message-Id: <200502081606.j18G6Ag1026560@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: compile problem Date: Tue, 08 Feb 2005 08:06:10 -0800 From: william@bourbon.usc.edu Someone wrote: > whenever I compile the program I get this error. Can you > please tell me where I am wrong. I set the path in .cshrc and > also I am using #include > #include I'm having a hard time understanding why a graduate student still does not know the difference between *compile* and *link*. If you are not familiar with the basics, please find a good book about these and read it from beginning to end. > g++ -I/home/scf-22/csci551b/openssl/include enc.cpp > Undefined first referenced > symbol in file > BIO_f_base64 /var/tmp//ccyyEwei.o > BIO_write /var/tmp//ccyyEwei.o > BIO_new_fp /var/tmp//ccyyEwei.o > BIO_new /var/tmp//ccyyEwei.o > BIO_free_all /var/tmp//ccyyEwei.o > BIO_ctrl /var/tmp//ccyyEwei.o > BIO_push /var/tmp//ccyyEwei.o > ld: fatal: Symbol referencing errors. No output written to a.out > collect2: ld returned 1 exit status The spec says: To link to the crypto library, you should use: -L/home/scf-22/csci551b/openssl/lib -lcrypto And please make sure that you are doing separate compilation or you will lose a lot of points. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 7 22:12:00 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j186C0ja026521 for ; Mon, 7 Feb 2005 22:12:00 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j186Apio015956 for ; Mon, 7 Feb 2005 22:10:51 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j186ApGq015954 for cs530@merlot.usc.edu; Mon, 7 Feb 2005 22:10:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j186Aoio015951 for ; Mon, 7 Feb 2005 22:10:50 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j186AoPN015947 for ; Mon, 7 Feb 2005 22:10:50 -0800 Message-Id: <200502080610.j186AoPN015947@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: different version of openssl Date: Mon, 07 Feb 2005 22:10:50 -0800 From: william@bourbon.usc.edu Someone wrote: > I just wonder what is the difference between openssl in > "/home/scf-ss/csci551b/openssl/lib:/usr/lib" and in > "/usr/lsd/openssl/*". > > Because when I tried to run ~csci551b/openssl, I got > "permission denied". So I would like to use openssl > in "/usr/lsd/openssl/*" The instruction for HW1 said: [BC: Changed 1/11/2005] setenv LD_LIBRARY_PATH /home/scf-22/csci551b/openssl/lib:/usr/lib set path=(/home/scf-22/csci551b/openssl/bin $path) rehash Cleary, running "~csci551b/openssl" will not work because "~csci551b/openssl" is a directory and you cannot execute a directory (that's why you got "permissions denied"). Also, "/usr/lsd/openssl/*" are directories and you cannot execute them either. Please follow what's in the spec to get this to work for you (unless you are very familiar with UNIX environments). The reason you are required to use openssl in ~csci551b/openssl is that ISD has the nasty habbit of switching programs and libraries in the middle of the semester. This makes grading problematic. Therefore, do *not* use openssl stuff in /usr/lsd/openssl. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 7 18:40:54 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j182esja018772 for ; Mon, 7 Feb 2005 18:40:54 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j182djio010972 for ; Mon, 7 Feb 2005 18:39:45 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j182djXl010970 for cs530@merlot.usc.edu; Mon, 7 Feb 2005 18:39:45 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j182djio010961 for ; Mon, 7 Feb 2005 18:39:45 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j182djWC010957 for ; Mon, 7 Feb 2005 18:39:45 -0800 Message-Id: <200502080239.j182djWC010957@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: about guideline scripts Date: Mon, 07 Feb 2005 18:39:45 -0800 From: william@bourbon.usc.edu I just noticed a typo. It should be: more ~csci530/public/hw1/grading-guideline It's "guideline" and not "guidline". Sorry about the typo! -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Mon, 07 Feb 2005 18:30:47 -0800 From: william@bourbon.usc.edu To: cs530@bourbon.usc.edu Subject: Re: about guideline scripts Someone wrote: > I tried to run guideline scripts, but got wrong results. > > *********************** > nunki.usc.edu(1): ~csci530/public/hw1/grading-guidline > /home/scf-12/csci530/public/hw1/grading-guidline: Command not found > > nunki.usc.edu(3): more ~csci530/public/hw1/grading-guidline > /home/scf-12/csci530/public/hw1/grading-guidline: No such file or directo ry > > ************************ > > Is the path of following right? > "/home/scf-12/csci530/public/hw1/grading-guidline" The grading guidline is *not* a script. There are scripts inside. You need to copy and paste them to run them. Please do: more ~csci530/public/hw1/grading-guidline and look at the file. It should be obvious which lines can be cut and paste to your commandline. If you use bash, you probably need to modify the scripts. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 7 18:37:03 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j182b3ja018594 for ; Mon, 7 Feb 2005 18:37:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j182Zsio007281 for ; Mon, 7 Feb 2005 18:35:54 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j182Zsfb007279 for cs530@merlot.usc.edu; Mon, 7 Feb 2005 18:35:54 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j182Zsio007276 for ; Mon, 7 Feb 2005 18:35:54 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j182ZsLX007266 for ; Mon, 7 Feb 2005 18:35:54 -0800 Message-Id: <200502080235.j182ZsLX007266@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: graders office hours Date: Mon, 07 Feb 2005 18:35:54 -0800 From: william@bourbon.usc.edu Hi, The grader will hold office hours on Friday 2/11/2005 between 2pm and 4pm in SAL 329. Please make sure that you have done everything she has requested before going to see her. Thanks! -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Sun, 06 Feb 2005 16:21:06 -0800 From: william@bourbon.usc.edu To: cs530@bourbon.usc.edu Subject: Re: graders office hours Hi, After discussion with the grader, we decided that she will hold a 2-hour office on Friday 2/11. The exact time and location will be posted later. Please see her during that time. If you must see her before, please make an appointment with her via e-mail. But you must supply the information mentioned in my message with timestamp "Sun 6 Feb 16:13". She is free to refuse an appointment if you do not supply the information she requested. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Sun, 06 Feb 2005 13:41:03 -0800 From: william@bourbon.usc.edu To: cs530@bourbon.usc.edu Subject: Re: graders office hours Someone wrote: > when and where would be your office hours of the grader > be held about the regrading the hw1. Because we have so many low scores, if the grader hold an office hour, the line may be too long. We are considering alternatives. For now, please e-mail the grader to make an appointment if you would like to see her about your HW1 grade. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 7 18:31:56 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j182Vuja018360 for ; Mon, 7 Feb 2005 18:31:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j182Ulio002230 for ; Mon, 7 Feb 2005 18:30:47 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j182UlM0002228 for cs530@merlot.usc.edu; Mon, 7 Feb 2005 18:30:47 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j182Ulio002224 for ; Mon, 7 Feb 2005 18:30:47 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j182UlEb002220 for ; Mon, 7 Feb 2005 18:30:47 -0800 Message-Id: <200502080230.j182UlEb002220@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: about guideline scripts Date: Mon, 07 Feb 2005 18:30:47 -0800 From: william@bourbon.usc.edu Someone wrote: > I tried to run guideline scripts, but got wrong results. > > *********************** > nunki.usc.edu(1): ~csci530/public/hw1/grading-guidline > /home/scf-12/csci530/public/hw1/grading-guidline: Command not found > > nunki.usc.edu(3): more ~csci530/public/hw1/grading-guidline > /home/scf-12/csci530/public/hw1/grading-guidline: No such file or directory > > ************************ > > Is the path of following right? > "/home/scf-12/csci530/public/hw1/grading-guidline" The grading guidline is *not* a script. There are scripts inside. You need to copy and paste them to run them. Please do: more ~csci530/public/hw1/grading-guidline and look at the file. It should be obvious which lines can be cut and paste to your commandline. If you use bash, you probably need to modify the scripts. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Feb 7 13:25:20 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j17LPKja007001 for ; Mon, 7 Feb 2005 13:25:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j17LOBio031256 for ; Mon, 7 Feb 2005 13:24:11 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j17LOBb3031254 for cs530@merlot; Mon, 7 Feb 2005 13:24:11 -0800 Date: Mon, 7 Feb 2005 13:24:11 -0800 From: william@bourbon.usc.edu Message-Id: <200502072124.j17LOBb3031254@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: example of what can happen if a hash function is not one-way Hi, I couldn't come up with an example during lecture today regarding the one-wayness property of a cryptographic hash function. If a cryptographic hash function does not have the one-wayness property, someone can take a document you have signed and replace the document with garbage in order to embarrass you. This attack does not have as serious of a consequence as the case where a cryptographic hash function does not have the collision-resistance property. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Feb 7 13:05:05 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j17L55ja006246 for ; Mon, 7 Feb 2005 13:05:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j17L3vio023837 for ; Mon, 7 Feb 2005 13:03:57 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j17L3u9u023835 for cs530@merlot.usc.edu; Mon, 7 Feb 2005 13:03:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j17L3uio023826 for ; Mon, 7 Feb 2005 13:03:56 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j17L3uRq023822 for ; Mon, 7 Feb 2005 13:03:56 -0800 Message-Id: <200502072103.j17L3uRq023822@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: HW2 stdout redirect Date: Mon, 07 Feb 2005 13:03:56 -0800 From: william@bourbon.usc.edu Someone wrote: > I have a question regarding one of the specs in the assignment. For the > 'enc-des' and 'dec-des' features the spec says: > > enc-des: Your should be able to redirect stdout to a file so you can > later decrypt it. > > dec-des: Your should be able to redirect stdout to a file and compare it > against your original data file. > > For the redirecting of output, do you mean the the UNIX redirect > operator, '>'? If so, this doesn't require additional coding and I'm > trying to understand why it is in the specification. Is there something > I'm missing? Redirecting means the standard UNIX redirect. This can be done with '>' or '|'. It should not require additional coding because you should just send output to stdout. > Another question. When you call a hash function (MD5 or SHA1) with > openssl, the output is the following: > MD5(yesterday.txt)= 9f6205bcad54f230236649893ca5934c > > Do you want our program to have a similar output, so you can redirect > stdout and do a 'diff', or do you just want the hash by itself. The spec says: md5 : The output should be a hexstring of length 32 ... sha1 : The output should be a hexstring of length 40 ... So, there should be no additional characters. You can get rid of the stuff in front of the openssl output by something like (assuming there is no blank characters in FILENAME): openssl md5 FILENAME | cut -f2 -d' ' openssl sha1 FILENAME | cut -f2 -d' ' -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Feb 6 22:06:03 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j17663ja004528 for ; Sun, 6 Feb 2005 22:06:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1764uio007845 for ; Sun, 6 Feb 2005 22:04:56 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1764uBs007841 for ; Sun, 6 Feb 2005 22:04:56 -0800 Message-Id: <200502070604.j1764uBs007841@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: Question regarding enc-des [HW 2 -- CS 530] Date: Sun, 06 Feb 2005 22:04:56 -0800 From: william@bourbon.usc.edu Someone wrote: > The spec says > enc-des : Your should be able to redirect stdout to a file so > you can later decrypt it. > and The maximum size of a memory buffer is limited to 4,096 > bytes. > > But in case the input file is large (greater than the above > limit), we have to encrypt the data as soon as the buffer is > full and output it to stdout (to reuse the buffer) --- but the > sha1 hash which goes in the header of the encrypted data is known > only at the end so how are we suppose to output it before the > encrypted data to stdout? > > I hope the question is clear--- I am able to calculate both sha1 > and encrypted data, but in such cases, I can print sha1 (which > goes in header) only after encrypted data --- unless I output it > to a file. You can do a two-pass thing by calculating the SHA-1 first, then rewind the file (or close it and open it again) and encrypt on the 2nd pass. If the output were to go into a regular file (which is not the case for HW2), you could rewind the output file using lseek() or equivalent and write the SHA-1 value at the beginning of the output file. But since we are writing to stdout, lseek() may not work. So, this is not an option. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Feb 6 16:39:22 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j170dMja024870 for ; Sun, 6 Feb 2005 16:39:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j170cFio004034 for ; Sun, 6 Feb 2005 16:38:15 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j170cFUr004032 for cs530@merlot; Sun, 6 Feb 2005 16:38:15 -0800 Date: Sun, 6 Feb 2005 16:38:15 -0800 From: william@bourbon.usc.edu Message-Id: <200502070038.j170cFUr004032@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: send a transcript to the grader... Hi, Regarding my message with timstamp "Sun 6 Feb 16:13", if you only have small errors, one thing you can do is to create a transcript. To create a transcript of your session, do: script ~/my.script [ run some commands here ] exit Attach ~/my.script with your e-mail. If the difference is huge, ~/my.script will be huge too. Then it would *not* be very productive to send it with your e-mail. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Feb 6 16:33:46 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j170Xkja024653 for ; Sun, 6 Feb 2005 16:33:46 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j170Wdio001910 for ; Sun, 6 Feb 2005 16:32:39 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j170WdD6001908 for cs530@merlot.usc.edu; Sun, 6 Feb 2005 16:32:39 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j170Wdio001905 for ; Sun, 6 Feb 2005 16:32:39 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j170WdOx001895 for ; Sun, 6 Feb 2005 16:32:39 -0800 Message-Id: <200502070032.j170WdOx001895@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hw1 grading guidelines Date: Sun, 06 Feb 2005 16:32:39 -0800 From: william@bourbon.usc.edu Someone wrote: > I know you said to contact the grader first, but considering my > problem is with the test input and not the grading I thought I > should ask you instead. My problem is with the bad input files, > specifically f202.b64. I'm looking at this in a hex editor and > can't see any bad characters. Can you tell me the offset of the > bad character from the beginning of the file. f202.b64 is derived from f2.b64. I just deleted some characters from the input and the last few bytes are invalid (the last 4 bytes is just an "o", which is invalid). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Feb 6 16:22:13 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j170MCja024219 for ; Sun, 6 Feb 2005 16:22:12 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j170L6io030117 for ; Sun, 6 Feb 2005 16:21:06 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j170L6dQ030112 for cs530@merlot.usc.edu; Sun, 6 Feb 2005 16:21:06 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j170L6io030106 for ; Sun, 6 Feb 2005 16:21:06 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j170L6j5030102 for ; Sun, 6 Feb 2005 16:21:06 -0800 Message-Id: <200502070021.j170L6j5030102@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: graders office hours Date: Sun, 06 Feb 2005 16:21:06 -0800 From: william@bourbon.usc.edu Hi, After discussion with the grader, we decided that she will hold a 2-hour office on Friday 2/11. The exact time and location will be posted later. Please see her during that time. If you must see her before, please make an appointment with her via e-mail. But you must supply the information mentioned in my message with timestamp "Sun 6 Feb 16:13". She is free to refuse an appointment if you do not supply the information she requested. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Sun, 06 Feb 2005 13:41:03 -0800 From: william@bourbon.usc.edu To: cs530@bourbon.usc.edu Subject: Re: graders office hours Someone wrote: > when and where would be your office hours of the grader > be held about the regrading the hw1. Because we have so many low scores, if the grader hold an office hour, the line may be too long. We are considering alternatives. For now, please e-mail the grader to make an appointment if you would like to see her about your HW1 grade. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Feb 6 16:14:56 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j170Euja023906 for ; Sun, 6 Feb 2005 16:14:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j170Doio027422 for ; Sun, 6 Feb 2005 16:13:50 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j170DoTh027420 for cs530@merlot; Sun, 6 Feb 2005 16:13:50 -0800 Date: Sun, 6 Feb 2005 16:13:50 -0800 From: william@bourbon.usc.edu Message-Id: <200502070013.j170DoTh027420@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: HW1 regrade... Hi, If you have *not* run the scripts in ~csci530/public/hw1/grading-guidline, please do *not* bug the grader! I've noticed that many people who do not follow simple instructions like this also did not follow the project spec. You *must* follow the project spec or you will lose *a lot of points*. When you contact the grader for regrade, please be specific: 1) if you change the script in order for your program to run correctly, you should also tell the grader (this may be the reason for losing a lot of points) 2) which test cases are passing and which cases are not, please be very specific about the discrepancy you find If you cannot provide the above information, please do *not* contact the grader because she will just tell you to provide this information before seeing you. She is *not* required to see you if you do not follow these instructions. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Feb 6 16:05:22 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1705Mja023524 for ; Sun, 6 Feb 2005 16:05:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1704Fio023907 for ; Sun, 6 Feb 2005 16:04:15 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1704FoW023905 for cs530@merlot.usc.edu; Sun, 6 Feb 2005 16:04:15 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1704Fio023902 for ; Sun, 6 Feb 2005 16:04:15 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1704FAZ023898 for ; Sun, 6 Feb 2005 16:04:15 -0800 Message-Id: <200502070004.j1704FAZ023898@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Query regarding csci530-HW1 Date: Sun, 06 Feb 2005 16:04:15 -0800 From: william@bourbon.usc.edu Someone wrote: > I want to know how to acess the grading-guideine. > I am trying to execute the command > ~csci530/public/hw1/grading-guidline > Permission denied: error came..So please sugest me how I can > access the grading guideline and I want to know in which tests my > program fails. How about: more ~csci530/public/hw1/grading-guidline You must do this on nunki/aludra. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Feb 6 13:42:10 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j16LgAja018282 for ; Sun, 6 Feb 2005 13:42:10 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j16Lf3io003522 for ; Sun, 6 Feb 2005 13:41:03 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j16Lf3WZ003520 for cs530@merlot.usc.edu; Sun, 6 Feb 2005 13:41:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j16Lf3io003517 for ; Sun, 6 Feb 2005 13:41:03 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j16Lf3FX003513 for ; Sun, 6 Feb 2005 13:41:03 -0800 Message-Id: <200502062141.j16Lf3FX003513@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: graders office hours Date: Sun, 06 Feb 2005 13:41:03 -0800 From: william@bourbon.usc.edu Someone wrote: > when and where would be your office hours of the grader > be held about the regrading the hw1. Because we have so many low scores, if the grader hold an office hour, the line may be too long. We are considering alternatives. For now, please e-mail the grader to make an appointment if you would like to see her about your HW1 grade. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sat Feb 5 20:40:04 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j164e4ja001586 for ; Sat, 5 Feb 2005 20:40:04 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j164cxio011373 for ; Sat, 5 Feb 2005 20:38:59 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j164cxpF011371 for cs530@merlot.usc.edu; Sat, 5 Feb 2005 20:38:59 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j164cxio011363 for ; Sat, 5 Feb 2005 20:38:59 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j164cxOC011358 for ; Sat, 5 Feb 2005 20:38:59 -0800 Message-Id: <200502060438.j164cxOC011358@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: openssl md5 & sha1 Date: Sat, 05 Feb 2005 20:38:59 -0800 From: william@bourbon.usc.edu Someone wrote: > In the assignment spec, it says: > > "You must call the BASE64, MD5, SHA-1, and DES related functions in the > OpenSSL library directly. You will lose a lot of points if you invoke the > openssl program using popen(), fork your process and call one of the exec > system calls, or call system(). " > > I understand that you don't want us to invoke the openssl command line > utility from within our program, but from openssl libraries, there are > multiple ways to use the functionality. In the man pages for the sha1 and > md5 that are linked to off of the hw2 page, there's a line that says > "Applications should use the higher level functions EVP_DigestInit(3) etc. > instead of calling the hash functions directly". As of right now, I've > implemented md5 and sha1 by using "evp.h" and its functionality in the > openssl library instead of directly calling the md5 & sha1 hash functions in > "md5.h" and "sha1.h". Is this acceptable (I thought it was the proper way > to do it since the manual advises against uses the hash functions directly)? Sure! They are part of the OpenSSL library functions and they do not call fork(). -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Feb 3 22:18:42 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j146Igja027472 for ; Thu, 3 Feb 2005 22:18:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j146Hgio021441 for ; Thu, 3 Feb 2005 22:17:42 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j146Hgox021439 for cs530@merlot.usc.edu; Thu, 3 Feb 2005 22:17:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j146Hgio021436 for ; Thu, 3 Feb 2005 22:17:42 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j146Hgsr021430 for ; Thu, 3 Feb 2005 22:17:42 -0800 Message-Id: <200502040617.j146Hgsr021430@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: library path Date: Thu, 03 Feb 2005 22:17:42 -0800 From: william@bourbon.usc.edu Someone wrote: > part of my .cshrc file looks like this > > ###################################################################### > > if ( $?LD_LIBRARY_PATH ) then > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/auto/usc/gnu/gcc/2.95.2/lib:/usr/ucblib > setenv LD_LIBRARY_PATH /home/scf-22/csci551b/openssl/lib:/usr/lib > else > setenv LD_LIBRARY_PATH /auto/usc/gnu/gcc/2.95.2/lib:/usr/ucblib > endif > > if ( ${?LD_LIBRARY_PATH} ) then > setenv LD_LIBRARY_PATH /lib:/usr/usc/gnu/gcc/2.95.2/lib:/usr/ucblib:$LD_LIBRARY_PATH > else > setenv LD_LIBRARY_PATH /lib:/usr/ucblib/:/usr/usc/gnu/gcc/2.95.2/lib > endif > > ###################################################################### > > Is this correct ? because when i try to compile the compiler dosent find BIO_f_base64 . > i compile using "gcc -c main.cc -ggdb -I/home/scf-22/csci551b/openssl/include" > > what is wrong? Compiling has nothing to do with LD_LIBRARY_PATH. You should probably search the Internet or get a UNIX book to find out what LD_LIBRARY_PATH does. -I/home/scf-22/csci551b/openssl/include means that if you use #include it will look for the file "/home/scf-22/csci551b/openssl/include/foo.h". Did you do: #include or did you use the above? Anyway, you should be able to figure this out for yourself or search the Internet or talk to your fellow students in the Discussion Board. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Feb 1 23:07:53 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j1277rja018571 for ; Tue, 1 Feb 2005 23:07:53 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1276vio024401 for ; Tue, 1 Feb 2005 23:06:57 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j1276vW0024399 for cs530@merlot.usc.edu; Tue, 1 Feb 2005 23:06:57 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j1276vio024392 for ; Tue, 1 Feb 2005 23:06:57 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j1276vg4024386 for ; Tue, 1 Feb 2005 23:06:57 -0800 Message-Id: <200502020706.j1276vg4024386@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Hw2 Date: Tue, 01 Feb 2005 23:06:57 -0800 From: william@bourbon.usc.edu Someone wrote: > I tried to encode base64 with openssl function. But in output > the last line was missing. What is the problem? I have no idea! May be you are not calling the function correctly?! > I don't find the function for how to decode base64. Please keep looking. I'm not suppose to be doing your assignments. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Feb 1 22:24:30 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j126OUja016956 for ; Tue, 1 Feb 2005 22:24:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j126NZio015746 for ; Tue, 1 Feb 2005 22:23:35 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j126NZCo015738 for cs530@merlot.usc.edu; Tue, 1 Feb 2005 22:23:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j126NZio015735 for ; Tue, 1 Feb 2005 22:23:35 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j126NZ9s015725 for ; Tue, 1 Feb 2005 22:23:35 -0800 Message-Id: <200502020623.j126NZ9s015725@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: base64 library Date: Tue, 01 Feb 2005 22:23:35 -0800 From: william@bourbon.usc.edu Someone wrote: > I've have been searching through the documentation online and also grep'd > the openssl library, and the only base64 function I can find is the > BIO_f_base64. Is this the one you would like us to use for the program? I did "grep base64 *.h" in the openssl/include/openssl directory and BIO_f_base64() in "evp.h" is the only one I found. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Feb 1 12:00:49 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j11K0nja026014 for ; Tue, 1 Feb 2005 12:00:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j11Jxuio020815 for ; Tue, 1 Feb 2005 11:59:56 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j11JxuER020813 for cs530@merlot.usc.edu; Tue, 1 Feb 2005 11:59:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j11Jxtio020804 for ; Tue, 1 Feb 2005 11:59:55 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j11JxtDD020800 for ; Tue, 1 Feb 2005 11:59:55 -0800 Message-Id: <200502011959.j11JxtDD020800@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: [CS530] weak key Date: Tue, 01 Feb 2005 11:59:55 -0800 From: william@bourbon.usc.edu Someone wrote: > What kind of passphrase could be weak? > > I entered "a" or "1" as a passphrase which is pretty weak I think. > (Anyone can just enter "a" as a passphrase.) > However the program uses the sha1 value of the passphrase as its key, > so DES_is_weak_key() does not think it is weak. > Do we have to check if the passphrase is weak? > Or am I totally wrong? You are noticing the difference between "passphrase" and "encryption key". In HW2, the "encryption key" is derived (via SHA-1) from a "passphrase". DES_is_weak_key() only checks if the "encryption key" is weak. You do *not* have to check if the passphrase is weak. So, please do *not* reject short or simple passphrases. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Jan 31 08:04:20 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0VG4Kja023338 for ; Mon, 31 Jan 2005 08:04:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0VG6Wio007121 for ; Mon, 31 Jan 2005 08:06:32 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0VG6V2p007116 for cs530@merlot.usc.edu; Mon, 31 Jan 2005 08:06:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0VG6Vio007110 for ; Mon, 31 Jan 2005 08:06:31 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0VG6V3I007100 for ; Mon, 31 Jan 2005 08:06:31 -0800 Message-Id: <200501311606.j0VG6V3I007100@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hw2 DES password Date: Mon, 31 Jan 2005 08:06:31 -0800 From: william@bourbon.usc.edu Someone wrote: > In the hw2 spec it states: > > "...you must prompt the user for a passphrase, using > des_read_pw() for this...." > > I assume that we are supposed to write "des_read_pw", and it is > not provided through the openssl library. Is that correct? des_read_pw() is declared in: ~csci551b/openssl/include/openssl/ui_compat.h So, you can use it if you do: #include If you have trouble using it, you can also write your own. In this case, you don't have to hide what the user is typing. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Jan 29 08:49:56 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0TGnuja002632 for ; Sat, 29 Jan 2005 08:49:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0TGqCio026699 for ; Sat, 29 Jan 2005 08:52:12 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0TGqCbP026697 for cs530@merlot; Sat, 29 Jan 2005 08:52:12 -0800 Date: Sat, 29 Jan 2005 08:52:12 -0800 From: william@bourbon.usc.edu Message-Id: <200501291652.j0TGqCbP026697@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: reminder about modifications... Hi, This is a reminder that you can send in changes within 24 hours of the origial submission deadline of HW1. Please follow the instructions at: http://merlot.usc.edu/cs530-s05/homeworks.html#mods -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Jan 28 22:23:05 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0T6N5ja009829 for ; Fri, 28 Jan 2005 22:23:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0T6PMio023729 for ; Fri, 28 Jan 2005 22:25:22 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0T6PM9e023725 for ; Fri, 28 Jan 2005 22:25:22 -0800 Message-Id: <200501290625.j0T6PM9e023725@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: Re: submission deadline is getting close... Date: Fri, 28 Jan 2005 22:25:22 -0800 From: william@bourbon.usc.edu Someone wrote: > When I send the file I recieve the successful notice. Is this > fine like is there any other way by which I can check that you > recived my file or not. Please see: http://merlot.usc.edu/cs530-s05/bsubmit.html You are supposed to have read this long time ago. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Friday, January 28, 2005 8:28 pm Subject: submission deadline is getting close... > Hi, > > Some of you have not even submitted *anything*. Please try > to submit something soon just in case you cannot get things > to work exactly the way you want near the deadline. > > 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! > > Also, most likely I will not answer any more e-mail questions > tonight. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Jan 28 20:26:04 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0T4Q3ja005322 for ; Fri, 28 Jan 2005 20:26:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0T4SLio010685 for ; Fri, 28 Jan 2005 20:28:21 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0T4SL2g010683 for cs530@merlot; Fri, 28 Jan 2005 20:28:21 -0800 Date: Fri, 28 Jan 2005 20:28:21 -0800 From: william@bourbon.usc.edu Message-Id: <200501290428.j0T4SL2g010683@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: submission deadline is getting close... Hi, Some of you have not even submitted *anything*. Please try to submit something soon just in case you cannot get things to work exactly the way you want near the deadline. 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! Also, most likely I will not answer any more e-mail questions tonight. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Jan 28 20:22:35 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0T4MZja005162 for ; Fri, 28 Jan 2005 20:22:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0T4Orio007418 for ; Fri, 28 Jan 2005 20:24:53 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0T4OrjF007416 for cs530@merlot.usc.edu; Fri, 28 Jan 2005 20:24:53 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0T4Orio007413 for ; Fri, 28 Jan 2005 20:24:53 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0T4Or29007409 for ; Fri, 28 Jan 2005 20:24:53 -0800 Message-Id: <200501290424.j0T4Or29007409@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Fstream <-> stdin query Date: Fri, 28 Jan 2005 20:24:53 -0800 From: william@bourbon.usc.edu Someone wrote: > I know this is submission time, but i thought you might have done > this before. How to redirect stdin to a ifstream object in c++? > FILE fp=stdin works..however i have been using c++ and would not > want to rewrite code for the sake of maintaining > oops. Please see my message with timestamp "Mon 24 Jan 00:01". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Jan 28 16:09:20 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0T09Kja027799 for ; Fri, 28 Jan 2005 16:09:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0T0Bcio012197 for ; Fri, 28 Jan 2005 16:11:38 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0T0BcdN012195 for cs530@merlot.usc.edu; Fri, 28 Jan 2005 16:11:38 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0T0Bcio012192 for ; Fri, 28 Jan 2005 16:11:38 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0T0BcZW012188 for ; Fri, 28 Jan 2005 16:11:38 -0800 Message-Id: <200501290011.j0T0BcZW012188@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: expected input format for base64 decoding Date: Fri, 28 Jan 2005 16:11:38 -0800 From: william@bourbon.usc.edu Someone wrote: > I hope you didn't take my "being lazy" comment literally. It was > just a jesting way to say that it requires much less coding. I > didn't expect such an ireful response. If you found it upsetting, > I apologize. I'm glad you didn't mean it! But, I had to take what you said seriously you were *requesting* to do a lot less coding. I've seen people making unreasonable requests, hoping to get away with it. But when it's turned down, they just say that it was a joke. I hope this was not your tactic. > Also, I'm rather perplexed about your stand on small-increment > reads. You seem to suggest it is the right way to go, and later, > you shoot it down as bad programming practice. You probably misunderstood me about the "later" part. What I meant was that "being lazy" is a bad programming practice. > At the same time, you seemed very irritated by my comment about > I/O with large buffers being superior in performance. I'm irritated about the "obviously" comment. It's actually not quite obvious. (I thought you were concerned about reading data from disk and not the function call overhead.) > I have written a braindead file I/O program which simpy reads a > file in binary mode with a specified buffer size. > > Using time on the program reading in a 20 megabyte file on nunki > (generated with dd if=/dev/zero of=aaa bs=1k count=20000), the > results are as below: > > with 1byte buffer: > bash-2.05b$ time a.out > > real 0m6.727s > user 0m6.600s > sys 0m0.110s > > with 1024byte buffer: > bash-2.05b$ time a.out > > real 0m0.230s > user 0m0.100s > sys 0m0.110s > > Please let me know if I've done > something that undermines the validity of the test. I've tried > compiling with and without -O3 and it makes no difference. I > believe nunki runs UFS, but I doubt we'd see much of a difference > even in reiser or ext2/3. I'm sure you measured things correctly. It is clear what is happening here. Reading very small number of bytes at a time was not a good idea because the function call (fread) overhead is just too big. Therefore, for the sake of efficiency, I would not read 3 bytes at a time (this is why a 1k byte buffer was suggested). -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Thursday, January 27, 2005 10:27 pm Subject: Re: expected input format for base64 decoding > Someone wrote: > > > Can we expect the input to the base64 decoder to have a newline > > per 64 characters as per PEM specification? OpenSSL seems to > > follow the PEM specs for the base64 functions. RFC3548 allows for > > 76 characters per line though. > > Please read the spec and see the notes I added on 1/14/2005. > > > Of course, we could code for arbitrary length lines, but I'd > > rather avoid the effort if it's unnecessary. Since base64 encoded > > content will always be ASCII, there are much easier alternatives > > to fread() for this task. > > Your program should correctly decode a file that's base64 > encoded. If you want to "avoid the effort", please remember > that if someone else does a better job than you do, he/she > may get more points than you. It's your choice to "avoid > the effort" or not. > > > You seemed to imply in one of your earlier emails that you > > expected us to read 3 or 4 bytes (whatever was appropriate for > > the mode) at a time from the input stream. I had assumed that you > > wanted us to do buffered reads in blocks (as any > > performance-conscious program would do), seeing how you set a > > buffer limit of 1k. It's obviously a bad implementation to do I/O > > in small increments, > > I'm not sure why it's "obvious" to you. It's not obvious to > me at all. It's not like every time you call fread() you go > to the disk and fetch some data. The filesystem is doing a > lot of buffering already. > > > but it's a lot easier than dealing with > > boundary conditions with buffered reads. > > I'm not here to make things "easy" for you. The assignment > is already very easy for a grad class. > > Reading 3 bytes at a time is also "buffered read". > > > If it's OK in your eyes > > to do that, I'd like to get lazy with the decoding part and read > > in those small increments. > > What you call laziness is I would call bad programs. There > is a price for being lazy. Please do not complain if you get > less points than others because they did a better job. > > Let me tell you one very important thing. When you get a real > job to do programming for a living, you will notice that the > programmers who are not lazy and who can handle tedious jobs > will get raises. The reason is that they are *reliable* > employees. Lazy employees are usually not reliable. You > probably will say that when you get a real job, you will no > longer be lazy. I guess it's possible that you may be right. > But bad habits are very hard to get rid of. In this class, > I strongly encourage good habits. May be you don't plan to > be a programmer, then it doesn't really matter if you know > how to program. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Jan 28 03:35:45 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0SBZjja031480 for ; Fri, 28 Jan 2005 03:35:45 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0SBc5io006983 for ; Fri, 28 Jan 2005 03:38:05 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0SBc5AD006981 for cs530@merlot.usc.edu; Fri, 28 Jan 2005 03:38:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0SBc5io006978 for ; Fri, 28 Jan 2005 03:38:05 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0SBc5oA006974 for ; Fri, 28 Jan 2005 03:38:05 -0800 Message-Id: <200501281138.j0SBc5oA006974@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: About decoding Date: Fri, 28 Jan 2005 03:38:05 -0800 From: william@bourbon.usc.edu Someone wrote: > why does on encoding, "openssl enc -e -base64 -in /bin/less", > are there 2 "=" at the end of the of the base64 encoding. > The spec doesnt have "=" in the Base64 Encoding table at > > http://email.about.com/od/emailbehindthescenes/l/blbase64enctabl.htm > > when, i'm trying to test with "openssl enc -e -base64 -in > /bin/less" and with my "hw1 enc-base64 /bin/less", my output is > short of the last 2 characters(=). > > i have observed that, with file sizes not divisible by 3(for > every 3 bytes), the output of the "openssl enc -e -base64 -in " > appends "=". But the output of base64 cannot have an "=". > > can you please confirm this query. > > with file sizes divisble by 3(for every 3 bytes), such as the > given examples, there are no problems. In the last paragraph of: http://email.about.com/cs/standards/a/base64_encoding.htm It says: Of course, these artificial trailing '0's cannot be encoded using the encoding table. They must be represented by a 65th character. The Base64 *padding* character is '='. Naturally, it can only ever appear at the end of encoded data. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Jan 27 22:25:24 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0S6POja019042 for ; Thu, 27 Jan 2005 22:25:24 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0S6Riio006370 for ; Thu, 27 Jan 2005 22:27:44 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0S6RiZ1006368 for cs530@merlot.usc.edu; Thu, 27 Jan 2005 22:27:44 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0S6Riio006365 for ; Thu, 27 Jan 2005 22:27:44 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0S6RixV006361 for ; Thu, 27 Jan 2005 22:27:44 -0800 Message-Id: <200501280627.j0S6RixV006361@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: expected input format for base64 decoding Date: Thu, 27 Jan 2005 22:27:44 -0800 From: william@bourbon.usc.edu Someone wrote: > Can we expect the input to the base64 decoder to have a newline > per 64 characters as per PEM specification? OpenSSL seems to > follow the PEM specs for the base64 functions. RFC3548 allows for > 76 characters per line though. Please read the spec and see the notes I added on 1/14/2005. > Of course, we could code for arbitrary length lines, but I'd > rather avoid the effort if it's unnecessary. Since base64 encoded > content will always be ASCII, there are much easier alternatives > to fread() for this task. Your program should correctly decode a file that's base64 encoded. If you want to "avoid the effort", please remember that if someone else does a better job than you do, he/she may get more points than you. It's your choice to "avoid the effort" or not. > You seemed to imply in one of your earlier emails that you > expected us to read 3 or 4 bytes (whatever was appropriate for > the mode) at a time from the input stream. I had assumed that you > wanted us to do buffered reads in blocks (as any > performance-conscious program would do), seeing how you set a > buffer limit of 1k. It's obviously a bad implementation to do I/O > in small increments, I'm not sure why it's "obvious" to you. It's not obvious to me at all. It's not like every time you call fread() you go to the disk and fetch some data. The filesystem is doing a lot of buffering already. > but it's a lot easier than dealing with > boundary conditions with buffered reads. I'm not here to make things "easy" for you. The assignment is already very easy for a grad class. Reading 3 bytes at a time is also "buffered read". > If it's OK in your eyes > to do that, I'd like to get lazy with the decoding part and read > in those small increments. What you call laziness is I would call bad programs. There is a price for being lazy. Please do not complain if you get less points than others because they did a better job. Let me tell you one very important thing. When you get a real job to do programming for a living, you will notice that the programmers who are not lazy and who can handle tedious jobs will get raises. The reason is that they are *reliable* employees. Lazy employees are usually not reliable. You probably will say that when you get a real job, you will no longer be lazy. I guess it's possible that you may be right. But bad habits are very hard to get rid of. In this class, I strongly encourage good habits. May be you don't plan to be a programmer, then it doesn't really matter if you know how to program. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Jan 27 22:08:03 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0S683ja018427 for ; Thu, 27 Jan 2005 22:08:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0S6ANio022347 for ; Thu, 27 Jan 2005 22:10:23 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0S6AN6f022339 for cs530@merlot.usc.edu; Thu, 27 Jan 2005 22:10:23 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0S6ANio022336 for ; Thu, 27 Jan 2005 22:10:23 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0S6ANBM022332 for ; Thu, 27 Jan 2005 22:10:23 -0800 Message-Id: <200501280610.j0S6ANBM022332@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hexdump..buffer query Date: Thu, 27 Jan 2005 22:10:23 -0800 From: william@bourbon.usc.edu Someone wrote: > the same thing is happening with me.....can u tell us if we > have to resolve this problem or just keep it hte way it is... If the problem is with your login shell, you can solve the problem by using a different shell. Do you really want to do that if you are used to your login shell? If the problem is not with your login shell, then where is the problem? -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Thursday, January 27, 2005 5:11 pm Subject: Re: hexdump..buffer query > Someone wrote: > > > when we take the input from console from a user the after taking > > around 258 characters(if user didn't press enter inbetween) the > > console stop taking input and also stop displaying any more > > characters and then I have to press Ctrl+D at that time it > > diplays the result of previous input and start taking more input. > > Can you please tell me why this is happening... > > My guess is that this is the behavior of your login shell. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Jan 27 22:05:37 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0S65bja018278 for ; Thu, 27 Jan 2005 22:05:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0S67vio019976 for ; Thu, 27 Jan 2005 22:07:57 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0S67vtX019974 for cs530@merlot.usc.edu; Thu, 27 Jan 2005 22:07:57 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0S67vio019971 for ; Thu, 27 Jan 2005 22:07:57 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0S67vK4019967 for ; Thu, 27 Jan 2005 22:07:57 -0800 Message-Id: <200501280607.j0S67vK4019967@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: general question. Date: Thu, 27 Jan 2005 22:07:57 -0800 From: william@bourbon.usc.edu Someone wrote: > i just have a general question. > do you require comments in the source codes? Is there any reason why you think the answer would be no? > In other > words, will we get deducted becuase of no comments? Of course! Again, this is a grad class. For straight forward programs like the HW assignments in this class, I expect your code to work 100% and I expect your code to have good documentation and good comments. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Jan 27 17:08:46 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0S18kja007252 for ; Thu, 27 Jan 2005 17:08:46 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0S1B5io005021 for ; Thu, 27 Jan 2005 17:11:05 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0S1B59p005019 for cs530@merlot.usc.edu; Thu, 27 Jan 2005 17:11:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0S1B5io005016 for ; Thu, 27 Jan 2005 17:11:05 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0S1B5Vw005012 for ; Thu, 27 Jan 2005 17:11:05 -0800 Message-Id: <200501280111.j0S1B5Vw005012@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hexdump..buffer query Date: Thu, 27 Jan 2005 17:11:05 -0800 From: william@bourbon.usc.edu Someone wrote: > when we take the input from console from a user the after taking > around 258 characters(if user didn't press enter inbetween) the > console stop taking input and also stop displaying any more > characters and then I have to press Ctrl+D at that time it > diplays the result of previous input and start taking more input. > Can you please tell me why this is happening... My guess is that this is the behavior of your login shell. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Jan 27 13:53:26 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0RLrQja032107 for ; Thu, 27 Jan 2005 13:53:26 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0RLtlio030479 for ; Thu, 27 Jan 2005 13:55:47 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0RLtlAT030477 for cs530@merlot.usc.edu; Thu, 27 Jan 2005 13:55:47 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0RLtlio030474 for ; Thu, 27 Jan 2005 13:55:47 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0RLtlFI030470 for ; Thu, 27 Jan 2005 13:55:47 -0800 Message-Id: <200501272155.j0RLtlFI030470@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hexdump..buffer query Date: Thu, 27 Jan 2005 13:55:46 -0800 From: william@bourbon.usc.edu Someone wrote: > what if instead of storing a single character in every node of > linked list,I store a 1024 byte array in a single node of the > linked list ...and go on adding more nodes with same 1024 > storage.....if the input consists of more bytes.... > The reason I am not reusing the 1024 byte buffer.....is that...I > still cannot comprehend hows that possible without having the > user to enter data again from stdin ,after the first 1024 bytes > have been displayed......let me explain this with an eg.. > suppose I am using a condition like ...while(feof(fh)==0) .....to > terminate the input from stdin or a file.... > now in this while loop,I need to accept entire data from the user > ...(from file or stdin)...thats for sure... > There r two ways to do this,either I can get the first 1024 > bytes ..and display them...then reuse the buffer and get more > user input in it...but using this technique means after the first > 1024 bytes have been displayed .....(in case of stdin)... data > will have to be entered again ......I dont think this is > right........plz correct me if I am wrong... I don't understand why you think this is not right. For hexdump, I would read 16 bytes at a time, for enc-base64, I would read 3 bytes at a time, for dec-base64, I would read 4 bytes at a time. > The other way is the one where u can get the entire data(from > stdin or file) in one go ....in a large enough buffer and then > display the output in its entireity... Bad idea because of what I've mentioned before. > rather than having the user > to enter the data after every 1024 bytes just for the sake of > reusing the buffer..... Please *unstuck* yourself with this idea of "user enter data". > Tthats the reason I felt like using a > linked list with 1024 storage in a single node..... > I would really appreciate it ..if u can answer these > questions....however dumb they might sound........... If the input file is 2GB long, you *must* have a small memory footprint. Otherwise, your program is *bad*. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Wednesday, January 26, 2005 11:39 pm Subject: Re: hexdump..buffer query > Someone wrote: > > > many people have this doubt abt the amount of data that will be > > entered if input is from stdin....bcz the size of a array is > > restricted to 1024 bytes.....to get rid of this I have used a > > linked list to store the user input....and my program is working > > fine...irrespective of the input being from the file or from > > stdin...............my program takes a character( from file or > > stdin)and stores it in a linked list node.....and this process > > continues until EOF condition is reached.....shld i get rid of > > the linklist once the output has been displayed...and is this > > entire approach okay..... > > So, if you are reading a 2GB file, you will use up 2GB of > memory? Bad! > > The idea is that you should reuse the 1024-byte buffer so > you have a small memory footprint. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Jan 27 11:42:05 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0RJg5ja027211 for ; Thu, 27 Jan 2005 11:42:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0RJiQio010403 for ; Thu, 27 Jan 2005 11:44:26 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0RJiQNh010401 for cs530@merlot.usc.edu; Thu, 27 Jan 2005 11:44:26 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0RJiQio010398 for ; Thu, 27 Jan 2005 11:44:26 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0RJiQhw010388 for ; Thu, 27 Jan 2005 11:44:26 -0800 Message-Id: <200501271944.j0RJiQhw010388@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: early EOF in file Date: Thu, 27 Jan 2005 11:44:26 -0800 From: william@bourbon.usc.edu Someone wrote: > I understood what you meant about EOF being a condition...but I got slightly > confused by the ASCII table you gave in one of your earlier posts: > > http://www.delanet.com/~pparish/ascii.htm > > Standard ASCII Chart (character codes 0 - 127) > --------------------------------------------- > 000 (nul) 016 (dle) 032 048 0 064 @ 080 P 096 ` 112 p > 001 (soh) 017 (dc1) 033 ! 049 1 065 A 081 Q 097 a 113 q > 002 (stx) 018 (dc2) 034 " 050 2 066 B 082 R 098 b 114 r > 003 (etx) 019 (dc3) 035 # 051 3 067 C 083 S 099 c 115 s > 004 (eot) 020 (dc4) 036 $ 052 4 068 D 084 T 100 d 116 t > 005 (enq) 021 (nak) 037 % 053 5 069 E 085 U 101 e 117 u > 006 (ack) 022 (syn) 038 & 054 6 070 F 086 V 102 f 118 v > 007 (bel) 023 (etb) 039 ' 055 7 071 G 087 W 103 g 119 w > 008 (bs) 024 (can) 040 ( 056 8 072 H 088 X 104 h 120 x > 009 (tab) 025 (em) 041 ) 057 9 073 I 089 Y 105 i 121 y > 010 (lf) 026 (eof) 042 * 058 : 074 J 090 Z 106 j 122 z > 011 (vt) 027 (esc) 043 + 059 ; 075 K 091 [ 107 k 123 { > 012 (np) 028 (fs) 044 , 060 < 076 L 092 \ 108 l 124 | > 013 (cr) 029 (gs) 045 - 061 = 077 M 093 ] 109 m 125 } > 014 (so) 030 (rs) 046 . 062 > 078 N 094 ^ 110 n 126 ~ > 015 (si) 031 (us) 047 / 063 ? 079 O 095 _ 111 o 127 > > > Is character 026 (eof) something completely different then? I just thought > I remembered you saying something early on in the month about catching an > early EOF that might appear in a file. If not, then I'll completely > disregard this. I don't think I've said something like that. The bottomline, read man pages for the function you are using. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Thursday, January 27, 2005 12:23 AM To: cs530@bourbon.usc.edu Subject: Re: early EOF in file Someone wrote: > Do you know how to insert an early EOF character in a file? > > I'm using TCSH as my shell right now and I've tried both using ^D and ^D^D > as an EOF by typing in Ctrl-Q,Ctrl-D in Emacs, but it doesn't seem to be > having the desired effect. When the user types interactively, Ctrl-D,Ctrl-D > is EOF so I would've thought ^D^D would've worked. Please see my message with timestamp "Tue 25 Jan 22:47". I've also discussed in class today about this. EOF is a condition and not a character. Please read the man pages of the read() function you are using on how to detect the EOF condition. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Jan 27 00:42:04 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0R8g4ja002029 for ; Thu, 27 Jan 2005 00:42:04 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0R8iRio018850 for ; Thu, 27 Jan 2005 00:44:27 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0R8iR2k018848 for cs530@merlot.usc.edu; Thu, 27 Jan 2005 00:44:27 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0R8iQio018845 for ; Thu, 27 Jan 2005 00:44:26 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0R8iQeb018841 for ; Thu, 27 Jan 2005 00:44:26 -0800 Message-Id: <200501270844.j0R8iQeb018841@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: early EOF in file Date: Thu, 27 Jan 2005 00:44:26 -0800 From: william@bourbon.usc.edu Someone wrote: Plesae note that this is the *last time* I'll say anything about reading from the keyboard! It's getting too rediculous. This is a graduate class. You are suppose to know how to handle stdin and know how a *regular* program should behave. You should also know what's reasonable and what's not. I've also mentioned several times that you should get together with other students and exchange test data. > Can you please give us the sample output if the user is enetering > data from the console(stdin).... No, I will not. > I am using stdin as the same > pointer like I am using to access the file... My problem is that > if the user hits enter it displays the output at that > moment......But suppose user want to enter "\n"(enter) in the > characters he is going to send.... what should I do to take care > of this.... if you please give some suggestion or give the sample > output for that that will be very helpful The suggestion that I have given many times is that you should do something *reasonable*. Justify what you do is reasonable it in your README file. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Thursday, January 27, 2005 0:23 am Subject: Re: early EOF in file > Someone wrote: > > > Do you know how to insert an early EOF character in a file? > > > > I'm using TCSH as my shell right now and I've tried both using > ^D and ^D^D > > as an EOF by typing in Ctrl-Q,Ctrl-D in Emacs, but it doesn't > seem to be > > having the desired effect. When the user types interactively, > Ctrl-D,Ctrl-D > > is EOF so I would've thought ^D^D would've worked. > > Please see my message with timestamp "Tue 25 Jan 22:47". > I've also discussed in class today about this. EOF is > a condition and not a character. Please read the man > pages of the read() function you are using on how to > detect the EOF condition. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Jan 27 00:20:43 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0R8Khja001189 for ; Thu, 27 Jan 2005 00:20:43 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0R8N5io031025 for ; Thu, 27 Jan 2005 00:23:05 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0R8N5UR031023 for cs530@merlot.usc.edu; Thu, 27 Jan 2005 00:23:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0R8N5io031018 for ; Thu, 27 Jan 2005 00:23:05 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0R8N5FT031010 for ; Thu, 27 Jan 2005 00:23:05 -0800 Message-Id: <200501270823.j0R8N5FT031010@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: early EOF in file Date: Thu, 27 Jan 2005 00:23:05 -0800 From: william@bourbon.usc.edu Someone wrote: > Do you know how to insert an early EOF character in a file? > > I'm using TCSH as my shell right now and I've tried both using ^D and ^D^D > as an EOF by typing in Ctrl-Q,Ctrl-D in Emacs, but it doesn't seem to be > having the desired effect. When the user types interactively, Ctrl-D,Ctrl-D > is EOF so I would've thought ^D^D would've worked. Please see my message with timestamp "Tue 25 Jan 22:47". I've also discussed in class today about this. EOF is a condition and not a character. Please read the man pages of the read() function you are using on how to detect the EOF condition. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Jan 26 23:59:22 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0R7xMja000339 for ; Wed, 26 Jan 2005 23:59:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0R81iio010837 for ; Thu, 27 Jan 2005 00:01:44 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0R81i8F010835 for cs530@merlot.usc.edu; Thu, 27 Jan 2005 00:01:44 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0R81iio010832 for ; Thu, 27 Jan 2005 00:01:44 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0R81iCB010824 for ; Thu, 27 Jan 2005 00:01:44 -0800 Message-Id: <200501270801.j0R81iCB010824@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: input file to decode Date: Thu, 27 Jan 2005 00:01:44 -0800 From: william@bourbon.usc.edu Someone wrote: > what my concern is if the file is just created by the user > randomly putting alphabets or numbers in 1 single line and add a > \n at the end. openssl seems to be able to do more than 64+\n > characters, which i think the max is 70 somthing bytes. should i > follow the 64 character way or the openssl way? You should be able to handle everything in one line, even if the line is 2,000,000 bytes long! Why does it matter how long a line is? I really don't understand what the problem is. For base64 decode, you should read 4 characters and output 3 characters, then repeat. If you see a '\n', just skip it. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Wednesday, January 26, 2005 11:37 pm Subject: Re: input file to decode > Someone wrote: > > > As we have to have exactly 64 char + one "\n" as the output for > > the encoding. > > Do, we have to care about the input fire for the > > decoding? what i mean is if the input file to decode has more > > than 64 chars +one \n in one line. What should we do? > > Aren't the answers to your question in the spec? Please see > my message with timestamp "Fri 14 Jan 13:05". > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Jan 26 23:37:35 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0R7bZja031988 for ; Wed, 26 Jan 2005 23:37:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0R7dvio022632 for ; Wed, 26 Jan 2005 23:39:57 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0R7dva4022630 for cs530@merlot.usc.edu; Wed, 26 Jan 2005 23:39:57 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0R7dvio022621 for ; Wed, 26 Jan 2005 23:39:57 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0R7dv4T022617 for ; Wed, 26 Jan 2005 23:39:57 -0800 Message-Id: <200501270739.j0R7dv4T022617@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hexdump..buffer query Date: Wed, 26 Jan 2005 23:39:57 -0800 From: william@bourbon.usc.edu Someone wrote: > many people have this doubt abt the amount of data that will be > entered if input is from stdin....bcz the size of a array is > restricted to 1024 bytes.....to get rid of this I have used a > linked list to store the user input....and my program is working > fine...irrespective of the input being from the file or from > stdin...............my program takes a character( from file or > stdin)and stores it in a linked list node.....and this process > continues until EOF condition is reached.....shld i get rid of > the linklist once the output has been displayed...and is this > entire approach okay..... So, if you are reading a 2GB file, you will use up 2GB of memory? Bad! The idea is that you should reuse the 1024-byte buffer so you have a small memory footprint. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Jan 26 23:34:54 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0R7Ysja031907 for ; Wed, 26 Jan 2005 23:34:54 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0R7bHio020077 for ; Wed, 26 Jan 2005 23:37:17 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0R7bH9G020075 for cs530@merlot.usc.edu; Wed, 26 Jan 2005 23:37:17 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0R7bHio020066 for ; Wed, 26 Jan 2005 23:37:17 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0R7bHnA020062 for ; Wed, 26 Jan 2005 23:37:17 -0800 Message-Id: <200501270737.j0R7bHnA020062@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: input file to decode Date: Wed, 26 Jan 2005 23:37:17 -0800 From: william@bourbon.usc.edu Someone wrote: > As we have to have exactly 64 char + one "\n" as the output for > the encoding. > Do, we have to care about the input fire for the > decoding? what i mean is if the input file to decode has more > than 64 chars +one \n in one line. What should we do? Aren't the answers to your question in the spec? Please see my message with timestamp "Fri 14 Jan 13:05". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Jan 26 22:44:19 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0R6iJja030028 for ; Wed, 26 Jan 2005 22:44:19 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0R6kfio004644 for ; Wed, 26 Jan 2005 22:46:41 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0R6kfeC004639 for cs530@merlot.usc.edu; Wed, 26 Jan 2005 22:46:41 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0R6kfio004633 for ; Wed, 26 Jan 2005 22:46:41 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0R6kfBn004629 for ; Wed, 26 Jan 2005 22:46:41 -0800 Message-Id: <200501270646.j0R6kfBn004629@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: [CS530] Makefile Date: Wed, 26 Jan 2005 22:46:41 -0800 From: william@bourbon.usc.edu Someone wrote: > The spec said "make hw1" will create an excutable file named hw1. > Is there any chance to type "make foo" or "make bar" in order to > make an excutable file name foo or bar? I'm not understanding your question. The grader will type "make hw1" to create your executable called hw1. If you want the grader to type something else, make sure you mention that at the top of your README file. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Jan 26 13:27:52 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0QLRqja009184 for ; Wed, 26 Jan 2005 13:27:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0QLUGio020958 for ; Wed, 26 Jan 2005 13:30:16 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0QLUGmS020956 for cs530@merlot.usc.edu; Wed, 26 Jan 2005 13:30:16 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0QLUGio020953 for ; Wed, 26 Jan 2005 13:30:16 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0QLUGc5020949 for ; Wed, 26 Jan 2005 13:30:16 -0800 Message-Id: <200501262130.j0QLUGc5020949@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hw1 final questions Date: Wed, 26 Jan 2005 13:30:16 -0800 From: william@bourbon.usc.edu Someone wrote: > A few small things to finish up my homework #1. > > 1. Is it alright to use printf to print out the address portion (far left > column) of the hexdump? I'm using things like fputc and fwrite for the > actual binary data, but I thought the address field was just a counter and > it's much easier to get 6 digit precision using printf. I'm sorry, but I cannot answer questions like these! Please convince yourself that what you are doing is correct. > 2. When doing the 'interactive' mode (i.e. when someone just types "hw1 > hexdump" on the command line) and the user enters the EOF character, the > first line of the output for the hexdump will end up on the same line on the > screen as the last line the user typed in. It looks something like this: > > nunki.usc.edu(30): hw1 hexdump > jkdsaf;ldsfj;ldas;jlfdjk;ldasj;alksdkl;000000: 6a 6b 64 73 61 66 3b 6c 64 > 73 66 6a 3b 6c 64 61 jkdsaf;ldsfj;lda > 000010: 73 3b 6a 6c 66 64 6a 6b 3b 6c 64 61 73 6a 3b 61 s;jlfdjk;ldasj;a > 000020: 6c 6b 73 64 6b 6c 3b -- -- -- -- -- -- -- -- -- lksdkl; > > Is this acceptable? Because otherwise if something is piped into the > program through stdin, the output looks like this: > > nunki.usc.edu(31): echo "dsakfl;aasfdj;dasfjkl;dfkl;asdf" | hw1 hexdump > 000000: 64 73 61 6b 66 6c 3b 61 61 73 66 64 6a 3b 64 61 dsakfl;aasfdj;da > 000010: 73 66 6a 6b 6c 3b 64 66 6b 6c 3b 61 73 64 66 0a sfjkl;dfkl;asdf. > > And so I don't know how to tell the difference between which stdin is being > done (interactive or piping in) and I didn't think it would be correct to > just add a '\n' to the beginning of every file. The same problem exists for > the encoding and decoding as well and so adding a '\n' would cause them to > be different from the openssl output. As I've mentioned many times, you should treat stdin from pipe and stdin from keyboard the same. You do you want to care where data is coming from. You also have no control if the user is using your program correctly and you are not responsible for it. Decide for yourself what's reasonable and go with it. > 3. I found a slight error in the OpenSSL implementation of Base64 Decoding. > If an '=' (padding character) appears somewhere in the file to be decoded > (even though they should only be allowed to appear at the end), OpenSSL will > accept it and slightly skew the output. I tested this by randomly adding > some '=' characters to parts of the last line of the encoded file. Since > OpenSSL messes this up, do we have to try to fix it? Or can we just ignore > this special case and assume ='s will only appear at the end of the file? Please see my message with timestamp "Tue 25 Jan 15:12" regarding bad characters in the input stream. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Jan 25 22:49:12 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0Q6nCja007616 for ; Tue, 25 Jan 2005 22:49:12 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0Q6lIgv030185 for ; Tue, 25 Jan 2005 22:47:18 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0Q6lIUB030183 for cs530@merlot; Tue, 25 Jan 2005 22:47:18 -0800 Date: Tue, 25 Jan 2005 22:47:18 -0800 From: william@bourbon.usc.edu Message-Id: <200501260647.j0Q6lIUB030183@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: the EOF confusion... Hi, I have a guess regarding the EOF confusion. Is it the case that some of you think that EOF is the name of a character? I think most of the time when I refer to EOF, I said "the EOF condition". I think I've never use the term "the EOF character". I think it's unfortunate that there is a character whose name is EOF and it corresponds to z. May be this is the source of confusion. Since we are processing a binary file, it is possible that we will read a 0x1a character. Even though the name of this character is EOF, it's not the same as the EOF condition. When there is no more character to read, you have reached the end-of-file and the EOF condition will then become true. The bottomline, read the man pages for the function you are using to read in data bytes and see how you should detect end-of-file. Here is a complete list of ASCII characters from: http://www.delanet.com/~pparish/ascii.htm Standard ASCII Chart (character codes 0 - 127) --------------------------------------------- 000 (nul) 016 (dle) 032 048 0 064 @ 080 P 096 ` 112 p 001 (soh) 017 (dc1) 033 ! 049 1 065 A 081 Q 097 a 113 q 002 (stx) 018 (dc2) 034 " 050 2 066 B 082 R 098 b 114 r 003 (etx) 019 (dc3) 035 # 051 3 067 C 083 S 099 c 115 s 004 (eot) 020 (dc4) 036 $ 052 4 068 D 084 T 100 d 116 t 005 (enq) 021 (nak) 037 % 053 5 069 E 085 U 101 e 117 u 006 (ack) 022 (syn) 038 & 054 6 070 F 086 V 102 f 118 v 007 (bel) 023 (etb) 039 ' 055 7 071 G 087 W 103 g 119 w 008 (bs) 024 (can) 040 ( 056 8 072 H 088 X 104 h 120 x 009 (tab) 025 (em) 041 ) 057 9 073 I 089 Y 105 i 121 y 010 (lf) 026 (eof) 042 * 058 : 074 J 090 Z 106 j 122 z 011 (vt) 027 (esc) 043 + 059 ; 075 K 091 [ 107 k 123 { 012 (np) 028 (fs) 044 , 060 < 076 L 092 \ 108 l 124 | 013 (cr) 029 (gs) 045 - 061 = 077 M 093 ] 109 m 125 } 014 (so) 030 (rs) 046 . 062 > 078 N 094 ^ 110 n 126 ~ 015 (si) 031 (us) 047 / 063 ? 079 O 095 _ 111 o 127 Hope this helps. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Jan 25 22:38:34 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0Q6cYja007235 for ; Tue, 25 Jan 2005 22:38:34 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0Q6aegv020132 for ; Tue, 25 Jan 2005 22:36:40 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0Q6aekm020128 for cs530@merlot.usc.edu; Tue, 25 Jan 2005 22:36:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0Q6adgv020121 for ; Tue, 25 Jan 2005 22:36:39 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0Q6adJC020117 for ; Tue, 25 Jan 2005 22:36:39 -0800 Message-Id: <200501260636.j0Q6adJC020117@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: encoding/decoding question Date: Tue, 25 Jan 2005 22:36:39 -0800 From: william@bourbon.usc.edu Someone wrote: > My question is that when we take input from the user .... is the > input is in the for of 1010101...or is it in form of characters > or should we ask user what type of input he is entering For enc-base64, the spec says that you should compare your output with the output of the following command: openssl enc -e -base64 -in file So, just output in the same format. For dec-base64, your output should be identical to the file you start with when you do enc-base64. > other problem is that which so many students already asked but > still I am little confused... when I use stdin to take input like > before displaying the output I have to read the full input like > what function I can use for that ... should I use rewind or > something else... I mean any better choice I've suggested that you should use fread(). But you can use other functions that you like, or even C++. What I said before is that you should treat the input the same no matter if it's from a file or from stdin. If you use rewind(), then there is no way you are treating these 2 input sources the same because rewind() will not work on stdin (either from a pipe or from the keyboard). How do you fix it? Well, *don't* use rewind()! Your code must work without calling a function like rewind(). Once you've read a character, make sure you don't put it back or unread it. It's bad programming, don't do it! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Jan 25 22:27:38 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0Q6Rbja006787 for ; Tue, 25 Jan 2005 22:27:38 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0Q6Phgv009770 for ; Tue, 25 Jan 2005 22:25:43 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0Q6PhJO009768 for cs530@merlot.usc.edu; Tue, 25 Jan 2005 22:25:43 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0Q6Phgv009765 for ; Tue, 25 Jan 2005 22:25:43 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0Q6PhHf009761 for ; Tue, 25 Jan 2005 22:25:43 -0800 Message-Id: <200501260625.j0Q6PhHf009761@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: gdb Date: Tue, 25 Jan 2005 22:25:43 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm not sure how many people in the class are using C++--I only > use it over C for the easier data management, and I just use the > old stdio calls for I/O. > > nunki has gcc 3.3.2 installed. OK, it's somewhat recent. However, > it has ancient gdb (4.16). gdb is unable to read the debug > symbols generated by g++ -g correctly. Trying to view the > contents of class objects gets bogus data (totally misaligned > offsets), and trying to access class member objects results in an > "Internal error: `this' is not an aggregate." > > Perhaps I'm doing something egregiously wrong. What I've done so > far is just debug in VS .net and compile on nunki. I just tried what you said on nunki. You are correct that the default gdb version is 4.16 and the default g++ version is 3.3.2 I did what you said and got a similiar problem. Then I switch to gdb 6.3 and it worked! So, it looks like you should not use gdb 4.16. To use gdb 6.3, do the following if you are running csh: source /usr/usc/gnu/gdb/6.3/setup.csh If you are running bash, I think you can do: source /usr/usc/gnu/gdb/6.3/setup.sh -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Jan 25 22:13:09 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0Q6D9ja006269 for ; Tue, 25 Jan 2005 22:13:09 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0Q6BEgv028374 for ; Tue, 25 Jan 2005 22:11:14 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0Q6BEP3028372 for cs530@merlot.usc.edu; Tue, 25 Jan 2005 22:11:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0Q6BEgv028369 for ; Tue, 25 Jan 2005 22:11:14 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0Q6BE2M028365 for ; Tue, 25 Jan 2005 22:11:14 -0800 Message-Id: <200501260611.j0Q6BE2M028365@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: query ....hw1 Date: Tue, 25 Jan 2005 22:11:14 -0800 From: william@bourbon.usc.edu Someone wrote: > As u said in one of the mails,while reading from stdin,some > shells require a single ctrl D while others require 2 ctrl D's to > terminate the input.Are we supposed to consider any of these ctrl > D's as input and print their corresponding hex output. You cannot see these d's! Your shell captures these d's and do *not* pass them to your program. After the right number of d's, as determined by the shell, it will set the EOF condition for your input file. It is this EOF condition you need to handle. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Jan 25 16:58:32 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0Q0wWja027078 for ; Tue, 25 Jan 2005 16:58:32 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0Q0ucgv024026 for ; Tue, 25 Jan 2005 16:56:38 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0Q0uc8k024024 for cs530@merlot.usc.edu; Tue, 25 Jan 2005 16:56:38 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0Q0ucgv024018 for ; Tue, 25 Jan 2005 16:56:38 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0Q0ucQk024011 for ; Tue, 25 Jan 2005 16:56:38 -0800 Message-Id: <200501260056.j0Q0ucQk024011@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: encoding/decoding question Date: Tue, 25 Jan 2005 16:56:38 -0800 From: william@bourbon.usc.edu Someone wrote: > For doing enc-base64 and dec-base64, can we use algorithms found > on the Internet or do we have to come up with our own algorithm > to do the encoding and decoding? You can use any public code that you find on the Internet. Please make sure you give explicit and proper credit. Beware that code on the net *usually* doesn't work right, especially the ones that are not very extensive! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Jan 25 15:14:51 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0PNEpja023249 for ; Tue, 25 Jan 2005 15:14:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0PNCvgv018551 for ; Tue, 25 Jan 2005 15:12:57 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0PNCvnE018546 for cs530@merlot.usc.edu; Tue, 25 Jan 2005 15:12:57 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0PNCvgv018543 for ; Tue, 25 Jan 2005 15:12:57 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0PNCv7g018539 for ; Tue, 25 Jan 2005 15:12:57 -0800 Message-Id: <200501252312.j0PNCv7g018539@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Question: decoding Date: Tue, 25 Jan 2005 15:12:57 -0800 From: william@bourbon.usc.edu Someone wrote: > I have a problem in decoding.... Suppose while reading a text > from the file I encouter some characters whose value is greater > than 63... should I print error at the output or should I keep > executing the program taking only the last 6 bit of that 8 bit > character. If you encounter an illegal character, it's up to you to decide what to do. I think openssl stops reading from the input and will not process any more. Please make sure you document it. The bottomline is that if the input is good, your program should work properly. If the input is bad, your program would work reasonably/nicely. (There is no requirement that you must continue to process data even if you program encounters something bad.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Jan 24 22:02:29 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0P62Tja016816 for ; Mon, 24 Jan 2005 22:02:29 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0P60bgv015232 for ; Mon, 24 Jan 2005 22:00:37 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0P60bgr015227 for cs530@merlot.usc.edu; Mon, 24 Jan 2005 22:00:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0P60bgv015221 for ; Mon, 24 Jan 2005 22:00:37 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0P60b76015217 for ; Mon, 24 Jan 2005 22:00:37 -0800 Message-Id: <200501250600.j0P60b76015217@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Question: unexisting bytes Date: Mon, 24 Jan 2005 22:00:37 -0800 From: william@bourbon.usc.edu Someone wrote: > In dedump,,,we produce "--" for unexisting bytes as padding...the > question what are the corresponding characters for "--" is it > blank or nothing,,,,in the spec is blank but in the sample file > is nothing ....(It is a reminder ...I came to your office today) You are correct. There's a bug in the sample hexdump output. Specifically, in http://merlot.usc.edu/cs530-s05/homeworks/hw1/usctommy.hex.txt 7 space characters were missing in the last line, and in http://merlot.usc.edu/cs530-s05/homeworks/hw1/yesterday.hex.txt 9 space characters were missing in the last line. Thanks for pointing this out. I've fixed these files. You also mentioned something during the office hour. It is a UNIX convention to always append a '\n' in the last line of an ASCII output file if the last line is not a blank link. This way, you don't get the commandline prompt appearing at the wrong place on the screen. Please follow this convention. (I've added an item in the Miscellaneous sectino of the spec.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Jan 24 19:35:51 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0P3Zpja011181 for ; Mon, 24 Jan 2005 19:35:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0P3Y0gv006034 for ; Mon, 24 Jan 2005 19:34:00 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0P3Y0Ct006032 for cs530@merlot.usc.edu; Mon, 24 Jan 2005 19:34:00 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0P3Xxgv006029 for ; Mon, 24 Jan 2005 19:33:59 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0P3Xxw2006025 for ; Mon, 24 Jan 2005 19:33:59 -0800 Message-Id: <200501250333.j0P3Xxw2006025@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hw1 output buffer Date: Mon, 24 Jan 2005 19:33:59 -0800 From: william@bourbon.usc.edu Someone wrote: > The assignment specification doesn't specify whether or not we > are allowed to buffer output. So my question is are we allowed > to buffer a small amount of output before sending it to stdout, > say 1 line (100 chars or less) in addition to the 1024 input > buffer. The coding difficulty doesn't change either way, it only > requires me to change about two lines in my code, however > buffering the data allows for much faster execution time. This > might not be a concern for a small file, but lets say we wanted > to encode a 300MB attachment to base64 and we're outputing every > single char to stdout as we create it, as opposed to writing it > to a line and then outputing the line. I gaurantee outputing > every char as we generate it will take a much greater time. > > And if the answer is that we have a max buffer of 1024 bytes for > the entire program regardless of how it's used, does this mean I > can divide it up and use it as I like (use say 924 bytes for > input and 100 bytes for output). You are not reading the spec correctly. The spec says: The maximum size of a memory buffer is limited to 1,024 bytes. It says "a memory buffer". You can certainly have more than one memory buffer, as long as each one is not bigger than 1024 bytes. > Basically I just want to know if I'm going to be marked down for > making my code execute faster. This is an *exercise*. You will be marked down if you don't follow the spec. (In general, there is usually a tradeoff between space and time. Running fast is not the most important thing. Therefore, in general, if you use too much space in order to gain speed, you should think carefully if the extra space doesn't cause you problems.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Jan 24 15:44:43 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0ONihja002523 for ; Mon, 24 Jan 2005 15:44:43 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0ONgqgv014672 for ; Mon, 24 Jan 2005 15:42:52 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0ONgqNZ014670 for cs530@merlot.usc.edu; Mon, 24 Jan 2005 15:42:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0ONgqgv014667 for ; Mon, 24 Jan 2005 15:42:52 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0ONgqpS014663 for ; Mon, 24 Jan 2005 15:42:52 -0800 Message-Id: <200501242342.j0ONgqpS014663@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Question Regarding open and fopen Date: Mon, 24 Jan 2005 15:42:52 -0800 From: william@bourbon.usc.edu Someone wrote: > I've been wondering whether to open files with open( ) or fopen( ) > for this assignment. > I read the man page of fopen( ), and it says the stream will be > fully buffered. Does it mean the entire file will be buffered > once it is successfully opened? No. My guess is that open() also buffers the input file. May be it just doesn't say it in its man pages. I cannot imagine any user-level function like these don't buffer the file. > If so, I guess we are not supposed to use fopen to open files > larger than 1024 bytes. So for now, I'm using open to open files (looks > like open does not buffer any data), and use read( ) to read 1024 bytes > at a time. I've done some research and it's by far the best way i can > come up with. Is there any better way ? The requirement is that any single buffer *you* allocate should not be bigger thatn 1024 bytes. If a library or the OS is doing it, then you are not responsible. My guess is that these functions will try to buffer a disk track full of data (or at least a sector). -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Jan 24 13:50:09 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0OLo8ja030778 for ; Mon, 24 Jan 2005 13:50:08 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0OLmIgv002661 for ; Mon, 24 Jan 2005 13:48:18 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0OLmIUo002659 for cs530@merlot; Mon, 24 Jan 2005 13:48:18 -0800 Date: Mon, 24 Jan 2005 13:48:18 -0800 From: william@bourbon.usc.edu Message-Id: <200501242148.j0OLmIUo002659@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: handling commandline Hi, Someone just asked me during office hour if hw1 needs to handle commandline properly. For example, if something type "hw1 xyz", should your program do the right thing. Well, this is a graduate class. I expect your code to be perfect! Also, please remember, if someone does a better job than you, he/she *may* get more points. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Jan 24 13:47:36 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0OLlaja030602 for ; Mon, 24 Jan 2005 13:47:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0OLjjgv001705 for ; Mon, 24 Jan 2005 13:45:45 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0OLjjtm001703 for cs530@merlot.usc.edu; Mon, 24 Jan 2005 13:45:45 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0OLjjgv001700 for ; Mon, 24 Jan 2005 13:45:45 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0OLjj7v001696 for ; Mon, 24 Jan 2005 13:45:45 -0800 Message-Id: <200501242145.j0OLjj7v001696@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Assignment 1 problem Date: Mon, 24 Jan 2005 13:45:45 -0800 From: william@bourbon.usc.edu Someone wrote: > Well, actually, i created some test cases on my own and decoded > them with openssl and see the output. That clarified my question. > I was having problem on if the file given is somthing out of the > 64 character range ; if the file given doesn't contain enough > characters to decode; if the file given is decoded but without > enough bits to make a character. > > So, based on your reply on Jan 23, inputing 2 to make > the program stop is normal, right? As I mentioned in class today. It depends on what shell you are using. I've seen shell that only takes 1 d. So, I cannot say "yes" to your question for sure. Just test your program thoroughly and make sure it works right! -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Monday, January 24, 2005 10:15 am Subject: Re: Assignment 1 problem > Someone wrote: > > > I wonder if we have to find if a file is decodable or not before > > decoding it? If we do, how does a file identifies itself encoded > > or not. > > I'm not aware of anything that's not encodable/decodable > (other than the obvious case that if a file does not exist, > it is not encodable). Do you have an example? > > > Another question is about the stdin. My program is running > > perfectly no matter if it is stdin or file input (outputing enc, > > hexdum, dec). however, there is one wierd thing on the stdin > > part. In order for the program to realize the user is done > > entering, I have to either do 2 times , or in a > > newline. Is the behavior acceptable or it should not be like > > that. I have asked the get function to stop at EOF as delimiter. > > Please see my message with timestamp "Sun 23 Jan 22:10". > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Jan 24 10:17:06 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0OIH6ja022563 for ; Mon, 24 Jan 2005 10:17:06 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0OIFFgv022206 for ; Mon, 24 Jan 2005 10:15:15 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0OIFFK3022204 for cs530@merlot.usc.edu; Mon, 24 Jan 2005 10:15:15 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0OIFFgv022201 for ; Mon, 24 Jan 2005 10:15:15 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0OIFFAO022197 for ; Mon, 24 Jan 2005 10:15:15 -0800 Message-Id: <200501241815.j0OIFFAO022197@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Assignment 1 problem Date: Mon, 24 Jan 2005 10:15:15 -0800 From: william@bourbon.usc.edu Someone wrote: > I wonder if we have to find if a file is decodable or not before > decoding it? If we do, how does a file identifies itself encoded > or not. I'm not aware of anything that's not encodable/decodable (other than the obvious case that if a file does not exist, it is not encodable). Do you have an example? > Another question is about the stdin. My program is running > perfectly no matter if it is stdin or file input (outputing enc, > hexdum, dec). however, there is one wierd thing on the stdin > part. In order for the program to realize the user is done > entering, I have to either do 2 times , or in a > newline. Is the behavior acceptable or it should not be like > that. I have asked the get function to stop at EOF as delimiter. Please see my message with timestamp "Sun 23 Jan 22:10". -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Mon Jan 24 00:03:10 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0O83Aja031744 for ; Mon, 24 Jan 2005 00:03:10 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0O81Kgv008334 for ; Mon, 24 Jan 2005 00:01:20 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0O81KUU008326 for cs530@merlot.usc.edu; Mon, 24 Jan 2005 00:01:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0O81Kgv008323 for ; Mon, 24 Jan 2005 00:01:20 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0O81KrP008319 for ; Mon, 24 Jan 2005 00:01:20 -0800 Message-Id: <200501240801.j0O81KrP008319@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Assignment 1 problem Date: Mon, 24 Jan 2005 00:01:20 -0800 From: william@bourbon.usc.edu Someone wrote: > I am facing following problem in assignment 1: > > To read from a file I have used a 'ifstream' object and used the > file.open() method of the object to open the file in the binary > mode.The whole function is working properly, but now I am stuck > on how to use the code I have written for the case in which the > data has to be read from the stdin. Can I somehow pass the stdin > data to the ifstream object. Because if this is feasible, then > the code I have already written will work for the stdin case. I'm not familiar with ifstream. When I use C++, I actually just call C functions to do I/O! You need to figure this out on your own and/or with other students. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Jan 23 22:39:17 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0O6dHja028620 for ; Sun, 23 Jan 2005 22:39:17 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0O6bSgv025671 for ; Sun, 23 Jan 2005 22:37:28 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0O6bSrV025669 for cs530@merlot.usc.edu; Sun, 23 Jan 2005 22:37:28 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0O6bSgv025666 for ; Sun, 23 Jan 2005 22:37:28 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0O6bSOY025662 for ; Sun, 23 Jan 2005 22:37:28 -0800 Message-Id: <200501240637.j0O6bSOY025662@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: CS530 Dumb question Date: Sun, 23 Jan 2005 22:37:27 -0800 From: william@bourbon.usc.edu Someone wrote: > Which API are we supposed to use to read in 1024 bytes data > each time from the file? My favorite is fread(). You can use anything that's appropriate. Remember, don't read ASCII, read binary. Also remember, C is a subset of C++. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sun Jan 23 22:12:49 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0O6Cnja027657 for ; Sun, 23 Jan 2005 22:12:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0O6Axgv000301 for ; Sun, 23 Jan 2005 22:10:59 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0O6AxsC032767 for cs530@merlot.usc.edu; Sun, 23 Jan 2005 22:10:59 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0O6Axgv032764 for ; Sun, 23 Jan 2005 22:10:59 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0O6Axj8032754 for ; Sun, 23 Jan 2005 22:10:59 -0800 Message-Id: <200501240610.j0O6Axj8032754@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: max wait time from stdin/keyboard Date: Sun, 23 Jan 2005 22:10:59 -0800 From: william@bourbon.usc.edu Someone wrote: > (regarding reply below) > > Hexdump flushes and outputs the last characters if you press TWICE. > > so on keyboard inputs, do we loop and wait for TWO or as > suggested only one EOF (here i am guessing is enough? I'm not sure what the confusion is. EOF is EOF. If you press d and you don't get an EOF, keep reading. Let me say this one more time... Treat stdin just like a file. Don't worry if you are reading from the keyboard or a pipe. -- Bill Cheng // bill.cheng@usc.edu > > Just read until the EOF condition and flush the output and > > terminate your program. If you don't see EOF, don't abort! > > > > Your code is only required to run on nunki, which is a UNIX > > machine running Solaris. So of course you can assume that > > UNIX shell will handle everything it suppose to properly. Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sat Jan 22 23:37:47 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0N7blja031174 for ; Sat, 22 Jan 2005 23:37:47 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0N7a0gv020666 for ; Sat, 22 Jan 2005 23:36:00 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0N7a0sX020664 for cs530@merlot.usc.edu; Sat, 22 Jan 2005 23:36:00 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0N7a0gv020661 for ; Sat, 22 Jan 2005 23:36:00 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0N7a0jp020657 for ; Sat, 22 Jan 2005 23:36:00 -0800 Message-Id: <200501230736.j0N7a0jp020657@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: quick question Date: Sat, 22 Jan 2005 23:36:00 -0800 From: william@bourbon.usc.edu Someone wrote: > I have a simple question. > Does 1024 buffer size still applies to the enc and dec functions? > if it does. Since enc takes 3 bytes at a time, which 1024 is not > divisible by 3, what should we do with the 1 byte that is left in > the buffer? 1024 is just the buffer size. You can read 1020 bytes at a time if you want. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Sat Jan 22 22:27:40 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0N6Reja028549 for ; Sat, 22 Jan 2005 22:27:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0N6Prgv018965 for ; Sat, 22 Jan 2005 22:25:53 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0N6Prxs018963 for cs530@merlot.usc.edu; Sat, 22 Jan 2005 22:25:53 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0N6Prgv018954 for ; Sat, 22 Jan 2005 22:25:53 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0N6Prrl018950 for ; Sat, 22 Jan 2005 22:25:53 -0800 Message-Id: <200501230625.j0N6Prrl018950@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: max wait time from stdin/keyboard Date: Sat, 22 Jan 2005 22:25:53 -0800 From: william@bourbon.usc.edu Someone wrote: > if we are getting an input from keyboard > > 1. how often do i print the "hexdump" line? hexdump does it every > modulo 16 characters. > > stdin reading (thr' echo, cat ,etc) is fine since we know where > EOF exists and we can read 1024 chunks of data. However, in > keyboard typing, waiting for that long might be non-productive. > So, my guess is to output every n*16 characters between line > feeds, thus using line feeds to determine when user wants an > output.... and EOF will depend on control charcters. I don't know why you worry about your program being "non-productive". In the case you are talking about, it is the user who decides to stop typing. It's not your problem! I still don't understand why you would want to treat stdin differently if stdin is from a pipe or from the keyboard. > 2. what are the `escape` characters? , etc that should > make the program flush to output? > > do we assume that standard unix control chars, like ctrl-z, > ctrl-d, are handled by unix shell rather than by program? > > (may be this has been asked before. Sorry if i did not understand > the answer previously) Just read until the EOF condition and flush the output and terminate your program. If you don't see EOF, don't abort! Your code is only required to run on nunki, which is a UNIX machine running Solaris. So of course you can assume that UNIX shell will handle everything it suppose to properly. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Jan 21 22:16:04 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0M6G4ja007040 for ; Fri, 21 Jan 2005 22:16:04 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0M6EKgv003041 for ; Fri, 21 Jan 2005 22:14:20 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0M6EKXx003036 for cs530@merlot.usc.edu; Fri, 21 Jan 2005 22:14:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0M6EJgv003033 for ; Fri, 21 Jan 2005 22:14:20 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0M6EJEs003029 for ; Fri, 21 Jan 2005 22:14:19 -0800 Message-Id: <200501220614.j0M6EJEs003029@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Make file Date: Fri, 21 Jan 2005 22:14:19 -0800 From: william@bourbon.usc.edu Someone wrote: > In the make file you required from us to write the make file in > such away that when the grader type: > make hw1 > an executable hw1 file is created my questions are as follow: > (1) unix documentation, man pages, says that we have to use > option f if we want to have some different name for the make > file other than "makefile" or "Makefile",,,so the command , > according to unix specification , should be "make -f hw1",,,,,,it > tried to use "make hw1" without "-f" but it didn't work,,,so > could please tell me whether we have to use the option f and if > not how we can use the command make with different file > names????????????? Your makefile *must* have a filename of either "Makefile" or "makefile". The grader will not do "make -f ..." unless you have a good reason for it (and make sure you mention this at the beginning of your README file). > (2) you said that the executable file name should be hw1 and > the make file name should be hw1,,,,how both can have the same > name since they are in the same directory???would someone > overwrite the other????? After the grader types "make hw1", an executable called "hw1" must be produced. Don't call it anything else! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Jan 21 22:11:55 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0M6Btja006823 for ; Fri, 21 Jan 2005 22:11:55 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0M6ABgv031514 for ; Fri, 21 Jan 2005 22:10:11 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0M6ABHV031512 for cs530@merlot.usc.edu; Fri, 21 Jan 2005 22:10:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0M6AAgv031509 for ; Fri, 21 Jan 2005 22:10:10 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0M6AA81031505 for ; Fri, 21 Jan 2005 22:10:10 -0800 Message-Id: <200501220610.j0M6AA81031505@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: What happ during compiliation and preprocessing Date: Fri, 21 Jan 2005 22:10:10 -0800 From: william@bourbon.usc.edu Someone wrote: > My doubt is not related to security or HW1. Its related to C++. I want > to know how programs are preprocessed....that is...when include files > are processed and added to the main source program before compilation, > what happens....All I know is ...the header is added to the source file > in the corresponding location....I would like to know more on this....I > also tried opening the header files and couldnt figure out how this > happens.... > > For example, when I use "cout"...what happens???...it goes to "iostream" > and "<<" is overloaded...but after this....I couldnt clearly follow.... > > I feel that this understanding will give me a detailed knowledge of the > language and help me code better.... Umm... You are suppose to know this! What you described should have been taught in a prerequisite to CS 402! If you are really stuck on this, please see either the TA or myself during an office hour. You can also read some books about C/C++. You can ask a friend who is familiar with C/C++ -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Jan 20 22:25:31 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0L6PVja018480 for ; Thu, 20 Jan 2005 22:25:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0L6Nngv015453 for ; Thu, 20 Jan 2005 22:23:49 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0L6Nnxv015445 for cs530@merlot.usc.edu; Thu, 20 Jan 2005 22:23:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0L6Nngv015442 for ; Thu, 20 Jan 2005 22:23:49 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0L6NniW015438 for ; Thu, 20 Jan 2005 22:23:49 -0800 Message-Id: <200501210623.j0L6NniW015438@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: hw1 stdin quick question Date: Thu, 20 Jan 2005 22:23:49 -0800 From: william@bourbon.usc.edu Someone wrote: > I know you mentioned that we should not have to worry about the > case if the grader just enters "hw1 hexdump" (although we > shouldn't crash either). So is piping the only way we should > expect our program to receive standard input? > > I can see how things like this use STDin: > > echo "sadfjksdfalhadfs;asfhdlasd;f;l" | hw1 hexdump > > or > > cat filename | hw1 hexdump > > But is there any other way we can receive data on STDin without > piping that we have to handle? I'm just making sure I have all > my bases covered. The only other way that I can think of is to read data from the keyboard ("hw1 hexdump"). Good programming practice demands that even if the user run your program in an unexpected fashion, your program should behave in a reasonable way. Exchange your executable with someone in class and tell each other what cases are not handled *reasonably*. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Jan 20 13:49:29 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0KLnTja031664 for ; Thu, 20 Jan 2005 13:49:29 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0KLlmgv024095 for ; Thu, 20 Jan 2005 13:47:48 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0KLlmog024090 for cs530@merlot.usc.edu; Thu, 20 Jan 2005 13:47:48 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0KLlmgv024081 for ; Thu, 20 Jan 2005 13:47:48 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0KLlmka024077 for ; Thu, 20 Jan 2005 13:47:48 -0800 Message-Id: <200501202147.j0KLlmka024077@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: output question Date: Thu, 20 Jan 2005 13:47:48 -0800 From: william@bourbon.usc.edu Someone wrote: > I have 2 questions about the output format. I assume that you are talking about the hexdump output. > When i am outputing the ASCII characters for the right hand > column (like the sample gif file provided), there are some > differences. First, is the ' . ' sign (the hex is 0x00), but my > output is something like " ^@ ". Which one is right? I'm not sure what "^@" is. But please read the complete spec *carefully*. For hexdump, the spec says: If the data byte is >=0x20 and <=0x7e you should use the corresponding ASCII character. 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. So, if the data is 0x00, the corresponding character in the right column should be a ".". > Another question is that, while outputing the ASCII characters, > if there is a line feed character or new line character, it will > jump to the next line to keep printing the rest of the ASCII > characters. Is this normal, or i have to catch this and output > somthing else. I'm not sure what you mean. Could you give an example? Is the "line feed character or new line character" in the input file? Remember that you should treat the input file as binary. So, there is really no "line feed character or new line character" in the input file. Everything is just bytes. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Jan 19 16:36:03 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0K0a2ja016504 for ; Wed, 19 Jan 2005 16:36:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0K0YOgv007446 for ; Wed, 19 Jan 2005 16:34:24 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0K0YOjC007444 for cs530@merlot.usc.edu; Wed, 19 Jan 2005 16:34:24 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0K0YOgv007441 for ; Wed, 19 Jan 2005 16:34:24 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0K0YO3C007437 for ; Wed, 19 Jan 2005 16:34:24 -0800 Message-Id: <200501200034.j0K0YO3C007437@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: oops. Date: Wed, 19 Jan 2005 16:34:24 -0800 From: william@bourbon.usc.edu Someone wrote: > I just found that openssl sometimes works and sometimes > doesn't work in some condition. > Just disregard my previous email. When data is bad, a reasonable program should behave reasonably, unless the spec calls for a precise way to handle error. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Jan 19 16:34:21 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0K0YLja016422 for ; Wed, 19 Jan 2005 16:34:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0K0Wggv005835 for ; Wed, 19 Jan 2005 16:32:42 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0K0Wg5x005831 for cs530@merlot; Wed, 19 Jan 2005 16:32:42 -0800 Date: Wed, 19 Jan 2005 16:32:42 -0800 From: william@bourbon.usc.edu Message-Id: <200501200032.j0K0Wg5x005831@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: handling data from keyboard input for HW1 Hi, I told someone during office hour today that we would not test if your HW1 works correctly if the grader simply enters: hw1 hexdump (no piping of data into hw1). I just want to make a clarification here. I will *not* test to see if your program works correctly here. But, your program should *never* crash, no matter how it is run! So, if the grader enters the above command and enter random stuff on the keyboard, your program should not crash. (Personally, I really don't see why your program would not work reasonably.) Your program should also handle EOF correctly if the user types d on the keyboard at the beginning of a line. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Jan 19 16:30:59 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0K0Uxja016272 for ; Wed, 19 Jan 2005 16:30:59 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0K0TKgv002653 for ; Wed, 19 Jan 2005 16:29:20 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0K0TKmg002651 for cs530@merlot.usc.edu; Wed, 19 Jan 2005 16:29:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0K0TKgv002643 for ; Wed, 19 Jan 2005 16:29:20 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0K0TKTj002638 for ; Wed, 19 Jan 2005 16:29:20 -0800 Message-Id: <200501200029.j0K0TKTj002638@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: [cs530] linebreaks Date: Wed, 19 Jan 2005 16:29:20 -0800 From: william@bourbon.usc.edu Someone wrote: > In the class, you said that 'hw1 dec-base64' should work > even if input file contains characters that are not within the 64 > characters. > You said that we should just skip that character. > However, 'openssl enc -d' does not produce anything in this case > except that character is carage return. > > And if the input file has only one character and carage return per line, > 'openssl enc -d' still produce nothing in the output file. > > I found that 'openssl enc -d' only works when the input file has multiple > of 4 characters and following carage return per line. I'm not sure why you said this. Here's what I have tried. 1) openssl enc -e -base64 -in usctommy.gif > x 2) edit x with an editor, delete have of the file and make the file size not a multiple of 4 3) append my ~/.login to x 4) openssl enc -d -base64 -in x > y File "y" is *not* of zero size. Looks like openssl gives up when it cannot proceed. The requirement for HW1 for base64 encoding/decoding is that for *good data*, your output should produce exactly the same result as openssl. If data is bad, your program should behave *reasonably*. Please do not ask me exactly how to handle things when the data is bad, do something reasonable! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Jan 19 16:18:21 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0K0ILja015793 for ; Wed, 19 Jan 2005 16:18:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0K0Gggv023103 for ; Wed, 19 Jan 2005 16:16:42 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0K0GgZK023095 for cs530@merlot; Wed, 19 Jan 2005 16:16:42 -0800 Date: Wed, 19 Jan 2005 16:16:42 -0800 From: william@bourbon.usc.edu Message-Id: <200501200016.j0K0GgZK023095@bourbon.usc.edu> To: cs530@merlot.usc.edu Subject: companion lab course for CS 530... Hi, I just received information regarding the companion lab course for CS 530. I've posted the following to the News section of the class web page: 1/19/2005: A companion lab for this course will be offered as CSCI 590 (Directed Research). All students are encouraged to take this lab class. For more information, please see the web page for this class. The web page for the class is: http://www-scf.usc.edu/~csci590 -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Jan 18 23:11:26 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0J7BQja009423 for ; Tue, 18 Jan 2005 23:11:26 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0J79ngv003957 for ; Tue, 18 Jan 2005 23:09:49 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0J79njk003955 for cs530@merlot.usc.edu; Tue, 18 Jan 2005 23:09:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0J79ngv003952 for ; Tue, 18 Jan 2005 23:09:49 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0J79n4e003948 for ; Tue, 18 Jan 2005 23:09:49 -0800 Message-Id: <200501190709.j0J79n4e003948@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: cs530 hw1 question Date: Tue, 18 Jan 2005 23:09:49 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm having a strange error and I was wondering if either of you had any idea > what was causing it. I'm use the encoding and decoding of the sample > "yesterday.txt" file as an example. > > The file "yesterday.txt" is 471 bytes, which is divisible by 3, so it will > evenly encode into base64 without adding padding characters. > > I use openssl to encode it, then I use my hw1 to encode it, and the UNIX > diff command says that the encoding is the same. I assume that means my > file is properly encoded. The resulting encoded file is 638 bytes. 10 of > those bytes are \n characters, so there are 628 bytes to decode and 628 is > divisible by 4, so the decoding should be evenly done as well. > > For some reason that I can't figure out, my hw1 decoder finds a 629th byte > in the encoded file (both the openssl generated encoded file and my > generated encoded file). It seems that the openssl decoder does not find > this byte when it decodes the encoded file. When I do a UNIX diff command > on the output of the openssl decoding vs. my decoding, they are said to be > different. Visibly they look exactly the same. This 629th byte that my > program finds has an integer value of -1 and it doesn't even show up in the > filesize of the encoded file. I assume you meant 639 and not 629 since you are reading the file with '\n' at the end of each line. > I'm currently reading in bytes from the file one at a time and dumping them > if they're a \n character. I check for EOF after every byte I read. Do > you have any idea where this extra byte could be coming from? If you check every byte you read and everything you read until the last byte matches what you see visually in the input file (and the 638th character is '\n'), then you are not handling the EOF condition correctly. When you input routine (such as fread()) returns EOF, you should ignore the data in the buffer. Is this the problem? -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Jan 18 13:39:22 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0ILdMja020478 for ; Tue, 18 Jan 2005 13:39:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0ILbkgv003617 for ; Tue, 18 Jan 2005 13:37:46 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0ILbkRA003615 for cs530@merlot.usc.edu; Tue, 18 Jan 2005 13:37:46 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0ILbkgv003612 for ; Tue, 18 Jan 2005 13:37:46 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0ILbkNg003608 for ; Tue, 18 Jan 2005 13:37:46 -0800 Message-Id: <200501182137.j0ILbkNg003608@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: CS 530 HW1 - Input from stdin Date: Tue, 18 Jan 2005 13:37:46 -0800 From: william@bourbon.usc.edu Someone wrote: > While taking input from user (stdin), I am currently storing it > in a temporary file instead of buffer of 1024 bytes and after > user enters EOF - I process the file as usual and print out the > result -- Is this approach ok??; I am deleting this temporary > file before exiting the program. Is this okay? Well, anything is *okay*. You will probably lose quite a few points for doing something like this. I think I've mentioned this during the first lecture... If someone does a better job than you, you may get less points than hime/her. You should try your best! I'm not sure why you are taking the above approach. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Jan 18 08:03:21 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0IG3Lja007910 for ; Tue, 18 Jan 2005 08:03:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0IG1kgv029732 for ; Tue, 18 Jan 2005 08:01:46 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0IG1ke1029730 for cs530@merlot.usc.edu; Tue, 18 Jan 2005 08:01:46 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0IG1kgv029725 for ; Tue, 18 Jan 2005 08:01:46 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0IG1kSR029717 for ; Tue, 18 Jan 2005 08:01:46 -0800 Message-Id: <200501181601.j0IG1kSR029717@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Problems with binary output Date: Tue, 18 Jan 2005 08:01:46 -0800 From: william@bourbon.usc.edu Someone wrote: > I have a question about formatting, because setw(2) does not seem to keep my > hex numbers >=0x80 to only two bytes. For example, instead of 84, I get > ffffff84. > I am printing with > cout << hex << setw(2) << setfill('0') << (int)i[onbyte]; > > I checked in GDB, and the value listed in memory is -124...which comes to > ffffff84, so my program is working right, I just cant seem to trim off those > f's in front of large hex numbers. > > Sorry for the basic question, but its driving me nuts! You are not alone! "<<" (and ">>") in C++ drives me nuts too! I'm not sure how to do the above in *one line* in C++ using "<<"! I would just write a function to output one character at a time and write another function that takes a byte and call the first function twice and pass it the upper 4 bites and then the lower 4 bites. Since the argument for the first function can only be between 0 and 15, you can just write a big switch() statement! -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Jan 14 13:07:04 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0EL74ja018221 for ; Fri, 14 Jan 2005 13:07:04 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0EL5cgv018697 for ; Fri, 14 Jan 2005 13:05:38 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0EL5cGl018695 for cs530@merlot.usc.edu; Fri, 14 Jan 2005 13:05:38 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0EL5cgv018692 for ; Fri, 14 Jan 2005 13:05:38 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0EL5ciJ018688 for ; Fri, 14 Jan 2005 13:05:38 -0800 Message-Id: <200501142105.j0EL5ciJ018688@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: [CS530] stdin Date: Fri, 14 Jan 2005 13:05:38 -0800 From: william@bourbon.usc.edu Hi, I've updated the HW1 spec and add the following for base64 encoding: [BC: Added 1/14/2005] Please note that each line in the output much have at most 64 characters. In addition, all output lines, except for the last one, must contain exactly 64 characters (plus a '\n' at the end). I've also added the following for base64 decoding: [BC: Added 1/14/2005] Please note that you should ignore linebreaks in the input file. Even if the input is one character per line, your program should still works. Please also note that if the input file is garbage, your code must not crash! -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Fri, 14 Jan 2005 08:08:10 -0800 From: william@bourbon.usc.edu To: cs530@bourbon.usc.edu Subject: Re: [CS530] stdin Someone wrote: > We should limit a memory buffer to 1,024 bytes for large file. > However, if we type on the keyboard, do we still limit the > buffer to 1,024 byte? Yes! Again, there should be no difference reading from a file or stdin. (Of course, if stdin *is* from the keyboard, it would be difficult to type binary data. But you should always assume your input is binary.) > Because we are not print out the result to a file, every > keyboard inputs of 1024 bytes will be printed out on stdout, > and the program will be waiting for another input. This would be the exactly situation if you have a really really slow disk (or a really really slow file system). You should treat stdin and files the same way. > And why does the output of base64 encoding using openssl have > '\n' in every 64 character? I think that's the common format (I'm not sure if it is required). But please do the same. I'll update the spec today to say that this is required. -- Bill Cheng // bill.cheng@usc.edu > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Thursday, January 13, 2005 7:42 am > Subject: Re: [CS530] stdin > > > Someone wrote: > > > > > Could you tell me more specific about processing stream from > > stdin? > Do we have to finish it when we have ^Z? or Enter? > > > Buffer size is still 1024 bytes? > > > > You should make the processing of data from stdin or from a file > > identical. When you processs a file, you stop reading when an EOF > > condition is met. Same thing with stdin. > > > > By the way, stdin doesn't have to mean that you are typing on the > > keyboard. For example, the following should generate *identical* > > results on nunki: > > > > hw1 hexdump ~csci530/public/hw1/usctommy.gif > > cat ~csci530/public/hw1/usctommy.gif | hw1 hexdump > > > > > And should we print out the output to output file(then what > > name?) or > > > stdout? > > > > For hw1, the output always goes to stdout. > > -- > > Bill Cheng // bill.cheng@usc.edu > > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Fri Jan 14 08:09:35 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0EG9Zja007137 for ; Fri, 14 Jan 2005 08:09:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0EG8Agv020226 for ; Fri, 14 Jan 2005 08:08:10 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0EG8AHW020221 for cs530@merlot.usc.edu; Fri, 14 Jan 2005 08:08:10 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0EG8Agv020218 for ; Fri, 14 Jan 2005 08:08:10 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0EG8Agi020214 for ; Fri, 14 Jan 2005 08:08:10 -0800 Message-Id: <200501141608.j0EG8Agi020214@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: [CS530] stdin Date: Fri, 14 Jan 2005 08:08:10 -0800 From: william@bourbon.usc.edu Someone wrote: > We should limit a memory buffer to 1,024 bytes for large file. > However, if we type on the keyboard, do we still limit the > buffer to 1,024 byte? Yes! Again, there should be no difference reading from a file or stdin. (Of course, if stdin *is* from the keyboard, it would be difficult to type binary data. But you should always assume your input is binary.) > Because we are not print out the result to a file, every > keyboard inputs of 1024 bytes will be printed out on stdout, > and the program will be waiting for another input. This would be the exactly situation if you have a really really slow disk (or a really really slow file system). You should treat stdin and files the same way. > And why does the output of base64 encoding using openssl have > '\n' in every 64 character? I think that's the common format (I'm not sure if it is required). But please do the same. I'll update the spec today to say that this is required. -- Bill Cheng // bill.cheng@usc.edu > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Thursday, January 13, 2005 7:42 am > Subject: Re: [CS530] stdin > > > Someone wrote: > > > > > Could you tell me more specific about processing stream from > > stdin? > Do we have to finish it when we have ^Z? or Enter? > > > Buffer size is still 1024 bytes? > > > > You should make the processing of data from stdin or from a file > > identical. When you processs a file, you stop reading when an EOF > > condition is met. Same thing with stdin. > > > > By the way, stdin doesn't have to mean that you are typing on the > > keyboard. For example, the following should generate *identical* > > results on nunki: > > > > hw1 hexdump ~csci530/public/hw1/usctommy.gif > > cat ~csci530/public/hw1/usctommy.gif | hw1 hexdump > > > > > And should we print out the output to output file(then what > > name?) or > > > stdout? > > > > For hw1, the output always goes to stdout. > > -- > > Bill Cheng // bill.cheng@usc.edu > > Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Jan 13 22:13:14 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0E6DEja016624 for ; Thu, 13 Jan 2005 22:13:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0E6Bogv009289 for ; Thu, 13 Jan 2005 22:11:50 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0E6BoTD009287 for cs530@merlot.usc.edu; Thu, 13 Jan 2005 22:11:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0E6Bogv009279 for ; Thu, 13 Jan 2005 22:11:50 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0E6BoPF009274 for ; Thu, 13 Jan 2005 22:11:50 -0800 Message-Id: <200501140611.j0E6BoPF009274@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: Output File(s) Date: Thu, 13 Jan 2005 22:11:50 -0800 From: william@bourbon.usc.edu Someone wrote: > Do we have to support > > a) Multiple input files in the command line, with wild card support and No. The commandline contains either zero or one file name. > b) Output file name: Can the user specify the name of the output file? Or > do we always output to standard output? Always stdout. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Jan 13 19:56:55 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0E3utja011586 for ; Thu, 13 Jan 2005 19:56:55 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0E3tVgv010578 for ; Thu, 13 Jan 2005 19:55:31 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0E3tVAm010576 for cs530@merlot.usc.edu; Thu, 13 Jan 2005 19:55:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0E3tVgv010573 for ; Thu, 13 Jan 2005 19:55:31 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0E3tVQu010569 for ; Thu, 13 Jan 2005 19:55:31 -0800 Message-Id: <200501140355.j0E3tVQu010569@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: cs530 hw1 Date: Thu, 13 Jan 2005 19:55:31 -0800 From: william@bourbon.usc.edu Someone wrote: > Probably a dumb question, but does this assignment have to be > done purely in C? Or may we use C++? > > I didn't remember what you said and figured it's better safe than sorry. Either C or C++ would be fine. This would be true for all programming assignments. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Jan 13 07:47:31 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0DFlVja016538 for ; Thu, 13 Jan 2005 07:47:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0DFk8gv030939 for ; Thu, 13 Jan 2005 07:46:08 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0DFk8Wh030937 for cs530@merlot.usc.edu; Thu, 13 Jan 2005 07:46:08 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0DFk8gv030934 for ; Thu, 13 Jan 2005 07:46:08 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0DFk8Cm030930 for ; Thu, 13 Jan 2005 07:46:08 -0800 Message-Id: <200501131546.j0DFk8Cm030930@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: regarding HW1 In-Reply-To: My message of "Wed, 12 Jan 2005 20:31:21 PST." <200501130431.j0D4VLJd006613@bourbon.usc.edu> Date: Thu, 13 Jan 2005 07:46:08 -0800 From: william@bourbon.usc.edu Hi, Just noticed that I have made a mistake in one of my previous posts. I said: > In HW1, all the *printout* are in *string* format, so it's > okay to use printf(). This is not correct. When you do "hw1 dec-base64", the output should always be in binary because you don't know if the original file was ASCII or binary. Since you have no way to tell if the original file was ASCII or binary, you must assume the most general case. Sorry if this has caused any confusion. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Wed, 12 Jan 2005 20:31:21 -0800 From: william@bourbon.usc.edu To: cs530@bourbon.usc.edu Subject: Re: regarding HW1 Someone wrote: > you mentioned in class that we are not supposed to use printf or > scanf calls, which provides us to write a code like > fprintf(fp,"%x",ch). >From the spec: ... Do not use them to input/output binary data! What I meant was the if you plan to output *binary* data, don't use printf(). If what you want is to output *string* data, feel free to use it. > I extensively searched if there was something similar for the > write() function, but was unable to. > Could you please tell me if i could use the above printf > statement or if not can you direct me to a link or provide me > with some hint as to where i can find this information. In HW1, all the *printout* are in *string* format, so it's okay to use printf(). But, when you want to copy *binary* data from one place to another, or try to reformat *binary* data (like when you do base64 encoding or decoding), you should just manipulate memory directly. Just make sure you know exactly what's happening in your code. If you still have question, please come see me during office hours. (Although I would prefer you try to figure this out with other students since this is basic C/C++ stuff.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Thu Jan 13 07:43:53 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0DFhqja016381 for ; Thu, 13 Jan 2005 07:43:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0DFgUgv027541 for ; Thu, 13 Jan 2005 07:42:30 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0DFgUhw027539 for cs530@merlot.usc.edu; Thu, 13 Jan 2005 07:42:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0DFgUgv027536 for ; Thu, 13 Jan 2005 07:42:30 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0DFgTxX027532 for ; Thu, 13 Jan 2005 07:42:29 -0800 Message-Id: <200501131542.j0DFgTxX027532@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: [CS530] stdin Date: Thu, 13 Jan 2005 07:42:29 -0800 From: william@bourbon.usc.edu Someone wrote: > Could you tell me more specific about processing stream from stdin? > Do we have to finish it when we have ^Z? or Enter? > Buffer size is still 1024 bytes? You should make the processing of data from stdin or from a file identical. When you processs a file, you stop reading when an EOF condition is met. Same thing with stdin. By the way, stdin doesn't have to mean that you are typing on the keyboard. For example, the following should generate *identical* results on nunki: hw1 hexdump ~csci530/public/hw1/usctommy.gif cat ~csci530/public/hw1/usctommy.gif | hw1 hexdump > And should we print out the output to output file(then what name?) or > stdout? For hw1, the output always goes to stdout. -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Wed Jan 12 20:32:43 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0D4Whja022704 for ; Wed, 12 Jan 2005 20:32:43 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0D4VMgv006622 for ; Wed, 12 Jan 2005 20:31:22 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0D4VMZr006620 for cs530@merlot.usc.edu; Wed, 12 Jan 2005 20:31:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0D4VLgv006617 for ; Wed, 12 Jan 2005 20:31:22 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0D4VLJd006613 for ; Wed, 12 Jan 2005 20:31:21 -0800 Message-Id: <200501130431.j0D4VLJd006613@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: regarding HW1 Date: Wed, 12 Jan 2005 20:31:21 -0800 From: william@bourbon.usc.edu Someone wrote: > you mentioned in class that we are not supposed to use printf or > scanf calls, which provides us to write a code like > fprintf(fp,"%x",ch). >From the spec: ... Do not use them to input/output binary data! What I meant was the if you plan to output *binary* data, don't use printf(). If what you want is to output *string* data, feel free to use it. > I extensively searched if there was something similar for the > write() function, but was unable to. > Could you please tell me if i could use the above printf > statement or if not can you direct me to a link or provide me > with some hint as to where i can find this information. In HW1, all the *printout* are in *string* format, so it's okay to use printf(). But, when you want to copy *binary* data from one place to another, or try to reformat *binary* data (like when you do base64 encoding or decoding), you should just manipulate memory directly. Just make sure you know exactly what's happening in your code. If you still have question, please come see me during office hours. (Although I would prefer you try to figure this out with other students since this is basic C/C++ stuff.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Jan 11 11:25:46 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0BJPkja005663 for ; Tue, 11 Jan 2005 11:25:46 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0BJOSgv019602 for ; Tue, 11 Jan 2005 11:24:28 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0BJOS1M019600 for cs530@merlot.usc.edu; Tue, 11 Jan 2005 11:24:28 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0BJOSgv019597 for ; Tue, 11 Jan 2005 11:24:28 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0BJOSfs019593 for ; Tue, 11 Jan 2005 11:24:28 -0800 Message-Id: <200501111924.j0BJOSfs019593@bourbon.usc.edu> To: cs530@bourbon.usc.edu Subject: Re: openssl Date: Tue, 11 Jan 2005 11:24:28 -0800 From: william@bourbon.usc.edu Hi, I just realized that I forgot to remove the identity of the student who had e-mail me the question. I will try my best not to make the same mistake again. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Tue, 11 Jan 2005 08:05:03 -0800 From: william@bourbon.usc.edu To: ... Cc: cs530@bourbon.usc.edu Subject: Re: openssl Ooops! You also need to do: setenv LD_LIBRARY_PATH /home/scf-22/csci551b/openssl/lib:/usr/lib If you are running bash as your shell, you should do: export LD_LIBRARY_PATH="/home/scf-22/csci551b/openssl/lib:/usr/lib" I've fixed the spec. Thanks for letting me know about this. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Tue, 11 Jan 2005 01:07:19 -0800 From: ... To: chengw@usc.edu Subject: openssl Hi, professor I couldn't get the result of "openssl enc -e -base64 -in file". When I tried that command, I got the following : ld.so.1: openssl: fatal: libssl.so.0.9.7: open failed: No such file or direct ory Killed What did I do wrong? And there is a trivial typo : "Pleaes" Pleaes output reasonable and useful error messages if the command is malforme d or file does not exist or inaccessible. Thanks. Return-Path: cs530@bourbon.usc.edu Delivery-Date: Tue Jan 11 08:06:21 2005 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id j0BG6Lja030067 for ; Tue, 11 Jan 2005 08:06:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0BG53gv021014 for ; Tue, 11 Jan 2005 08:05:03 -0800 Received: (from cs530@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id j0BG53u9021012 for cs530@merlot.usc.edu; Tue, 11 Jan 2005 08:05:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id j0BG53gv021003; Tue, 11 Jan 2005 08:05:03 -0800 Received: from bourbon.usc.edu (william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) with ESMTP id j0BG53m6020999; Tue, 11 Jan 2005 08:05:03 -0800 Message-Id: <200501111605.j0BG53m6020999@bourbon.usc.edu> To: younho park Cc: cs530@bourbon.usc.edu Subject: Re: openssl In-Reply-To: Your message of "Tue, 11 Jan 2005 01:07:19 PST." <5cac4cc255ec.41e326c7@usc.edu> Date: Tue, 11 Jan 2005 08:05:03 -0800 From: william@bourbon.usc.edu Ooops! You also need to do: setenv LD_LIBRARY_PATH /home/scf-22/csci551b/openssl/lib:/usr/lib If you are running bash as your shell, you should do: export LD_LIBRARY_PATH="/home/scf-22/csci551b/openssl/lib:/usr/lib" I've fixed the spec. Thanks for letting me know about this. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Tue, 11 Jan 2005 01:07:19 -0800 From: younho park To: chengw@usc.edu Subject: openssl Hi, professor I couldn't get the result of "openssl enc -e -base64 -in file". When I tried that command, I got the following : ld.so.1: openssl: fatal: libssl.so.0.9.7: open failed: No such file or direct ory Killed What did I do wrong? And there is a trivial typo : "Pleaes" Pleaes output reasonable and useful error messages if the command is malforme d or file does not exist or inaccessible. Thanks. Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Dec 28 14:53:50 2004 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.12.8/8.12.8) with ESMTP id iBSMroja010311 for ; Tue, 28 Dec 2004 14:53:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.12.8/8.12.8) with ESMTP id iBSMr7gv012402 for ; Tue, 28 Dec 2004 14:53:07 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.12.8/8.12.8/Submit) id iBSMr78B012400 for cs530@merlot; Tue, 28 Dec 2004 14:53:07 -0800 Date: Tue, 28 Dec 2004 14:53:07 -0800 From: william@bourbon.usc.edu Message-Id: <200412282253.iBSMr78B012400@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-s05/mailinglist.html and register. Thanks! -- Bill Cheng // bill.cheng@usc.edu