Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Jan 3 13:42:21 2007 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id l03LgGc3000753; Wed, 3 Jan 2007 13:42:16 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id l03LcGYv000828; Wed, 3 Jan 2007 13:38:16 -0800 Message-Id: <200701032138.l03LcGYv000828@bourbon.usc.edu> To: csac@merlot.usc.edu, cs551@merlot.usc.edu Cc: Andreas Binnewies Subject: FWD: A job with meebo... In-reply-to: References: Comments: In-reply-to Andreas Binnewies message dated "Tue, 02 Jan 2007 13:11:01 -0800." Date: Wed, 03 Jan 2007 13:38:16 -0800 From: william@bourbon.usc.edu Dear Students, I've received the following e-mail. I'm just forwarding it to you in case you are interested. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Tue, 02 Jan 2007 13:11:01 -0800 From: Andreas Binnewies To: chengw@usc.edu Subject: A job with meebo for your students Hi Professor Cheng, My name is Andreas, and I am one of the developers for meebo , a web based instant messaging application. I remember back in 2005, I started flipping out as graduation approached because I didn't have a job for after school. Not knowing what to do, I went to all of the professors that I had close rapport with, and asked them if they knew of any career opportunties that I could pursue. Many of them did, which really helped to (a) calm my nerves and (b) kick start my job search. I was very thankful for their assistance. Just in case any near graduates come to you in a panic (like I did :), I would like to let you know about some awesome opportunities that meebo has available for your CS students. We are currently looking for talented and energetic Javascript and C/C++ programmers (both full-time and intern) that would feel right at home in a fast-paced and exciting environment. We have openings for: * Front End Intern (JavaScript) * Front End Full Time (JavaScript) * Backend Full Time (C/C++) * Systems Administrator Intern (Unix) * Systems Administrator (Unix) You can also point them to http://blog.meebo.com/jobs for more information about the openings. Please feel free to email me if you have any questions or comments, or definitely pass my email along to potential candidates. Thank you so much! Happy Holidays! -Andreas Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Dec 19 17:08:00 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kBK1803G027058 for ; Tue, 19 Dec 2006 17:08:00 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kBK14spW016897 for ; Tue, 19 Dec 2006 17:04:54 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id kBK14shZ016896 for csac@merlot; Tue, 19 Dec 2006 17:04:54 -0800 Date: Tue, 19 Dec 2006 17:04:54 -0800 From: william@bourbon.usc.edu Message-Id: <200612200104.kBK14shZ016896@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Please make backups of HW assignments... Hi, The current HW assignments will be deleted soon. There may be a chance that in a future semester, you would like to update your resume or get ready for an interview, and you would want to recall exactly what were in the HW assignments for this semester. Please make a backup copy of the *specs* now! (If you ask me to put them back on the web again in the future, I may not be able to do it.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Dec 13 11:11:02 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kBDJB2U5003355; Wed, 13 Dec 2006 11:11:02 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kBDJ8I2c014754; Wed, 13 Dec 2006 11:08:18 -0800 Message-Id: <200612131908.kBDJ8I2c014754@bourbon.usc.edu> To: cs551@merlot.usc.edu To: csac@merlot.usc.edu Subject: FWD: Software Engineering positions in Southern California Date: Wed, 13 Dec 2006 11:08:18 -0800 From: william@bourbon.usc.edu Dear Students, I'm forwarding an e-mail from someone in Aerotek who has a couple of positions opened. Please read through the entire e-mail *carefully* before applying. US Citizenship is not required, but they are *not* looking to provide H1 sponsorship for a short term project. There is also a permanent position for a more Senior level person where they might be willing to sponsor. All candidates must have at least a Bachelors, and a Masters is preferred. Please contact Chris Northup if you are qualified and interested. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Wed, 13 Dec 2006 10:24:07 -0800 (PST) From: Chris Northup To: chengw@usc.edu Subject: Software Engineering positions in Southern California Hi Bill, I got your name from the USC Engineering directory and I wanted to reach out for a little guidance. Aerotek (www.aerotek.com) is the largest privately held placement firm in the US and I focus on technical positions from San Diego to Seattle. Currently we have a client in San Clemente looking for a couple Software Engineers for a 6-9 month project. The ideal candidate might possibly be someone you know. They are looking for someone with 1-3 years of development experience with C++, some test script development experience, and as much formal education as possible. This could be an excellent opportunity for someone to really accelerate their career growth while helping others (the client makes heart related medical devices). Pay depends on experience and should range from $35-$50/hr. If you know anyone who might fit, pass this along. If you have questions, feel free to reach out to me directly at 503-403-1937 or wnorthup@aerotek.com Thanks for your time, Chris Northup Sr. Technical Recruiter Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Dec 8 11:29:23 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB8JTNMU027572 for ; Fri, 8 Dec 2006 11:29:23 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB8JQvWs012112 for ; Fri, 8 Dec 2006 11:26:57 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id kB8JQvIW012111 for csac@merlot; Fri, 8 Dec 2006 11:26:57 -0800 Date: Fri, 8 Dec 2006 11:26:57 -0800 From: william@bourbon.usc.edu Message-Id: <200612081926.kB8JQvIW012111@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: common mistakes (so far)... Hi, I've noticed a couple of common mistakes that many have made in the final exam so far. Just want to mention them before I forget: 1) When you use the Table Method to solve ax+by=d, you should stop when rem[i] becomes 0 or 1. If the stopping condition you encounter is rem[i]=0, the solution to the above equation is not with d=0 because d must be gcd(a,b). So, you need to go back one line to read out the answers. 2) Let's say that x = 2^13 mod 105 (and this can take some time to calculate by hand). Once you got x, to calculate 2^{2*13} mod 105, you simply have to do x^2 mod 105. You do have to start from the beginning to calculate 2^26 mod 105. Similarly, if y = x^2 mod 105, then 2^{4*13} mod 105 is just y^2 mod 105. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Dec 7 16:23:59 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB80NxXa018300 for ; Thu, 7 Dec 2006 16:23:59 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB80LZgA031464 for ; Thu, 7 Dec 2006 16:21:35 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id kB80LZKZ031463 for csac@merlot; Thu, 7 Dec 2006 16:21:35 -0800 Date: Thu, 7 Dec 2006 16:21:35 -0800 From: william@bourbon.usc.edu Message-Id: <200612080021.kB80LZKZ031463@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: tentative grading schedule... Hi, I'm planning on getting everything graded and e-mail your grades (final letter grade and final exam score) to you by the end of this weekend. If you have grading issues regarding homeworks assignments, please resolve them with the TA as soon as possible. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Dec 7 10:12:22 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB7ICMeQ026996 for ; Thu, 7 Dec 2006 10:12:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB7IA0Lb026466 for ; Thu, 7 Dec 2006 10:10:00 -0800 Message-Id: <200612071810.kB7IA0Lb026466@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599-Mersenne Numbers Date: Thu, 07 Dec 2006 10:10:00 -0800 From: william@bourbon.usc.edu Someone wrote: > I was trying to work out an example for Mersenne numbers: > --- where s>=3 , n=2^s -1 is prime iff (1) s is prime and > sequence of integers defined by u0=4 and uk+1=(uk^2 -2)mod n > for k>=0 satisfies u_(s-2)=0 ---- > > for s=5 ---> n=2^5 - 1 = 32-1 = 31. > (1) s is prime so (1) is satisfied > (2) u0=4 > u1=4^2 -2 mod 31 = 16-2mod 31 = 4 mod31 > u2=4^2 -2 mod 31 = 16-2mod 31 = 4 mod31 > u3=4^2 -2 mod 31 = 16-2mod 31 = 4 mod31 <--- u_(s-2) =/= 0 > > so since one of the conditions is not satisfied and it is > a if and only if, doesn't that mean 31 is not a prime, which > is a contradiction? Am I missing something? You calculation of u1 was incorrect! (16-2) mod 31 = 14. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Dec 6 22:08:28 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB768Smn012651 for ; Wed, 6 Dec 2006 22:08:28 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB76671N018579 for ; Wed, 6 Dec 2006 22:06:07 -0800 Message-Id: <200612070606.kB76671N018579@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: MDC's, MDC-2, MDC-4 Date: Wed, 06 Dec 2006 22:06:07 -0800 From: william@bourbon.usc.edu Someone wrote: > Is it sufficient to be able to identify Matyas-Meyer-Oseas as a > single-length MDC of rate 1 and to say MDC-2 uses 2 iterations of MMO, > and MDC-4 uses 4 iteration of MMO...or should I be worrying about being > able to draw each of them out, identify the IV, g, A,B,C,D components, > etc? The most important block diagram is the DES block diagram. For hash functions, the basic block is the one-way function "E_k(x) XOR x" and you do see this all over the place. Other than using this basic block, all the hash functions you mentioned above are just confusion and diffusion with different twists. I don't feel it's that interesting exactly what the twists are. It's the basic principle that's important. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Dec 6 21:42:22 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB75gMLI010863 for ; Wed, 6 Dec 2006 21:42:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB75e1Vc018239 for ; Wed, 6 Dec 2006 21:40:02 -0800 Message-Id: <200612070540.kB75e1Vc018239@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599-Quadratic residue & table method Date: Wed, 06 Dec 2006 21:40:01 -0800 From: william@bourbon.usc.edu Someone wrote: > When calculating size of quadratic residues, it is PHI(n) / x > <----How come x is 4 when n=21 and x is 2 when n=7 in the > examples? I tried some other numbers to figure out what it was: > when n=15, i get Q15={1,4} so size of Q15=2 and PHI(15) = > PHI(5*3)= PHI(5)*PHI(3)=8 so x=4 > when n=13, i get Q13={1,3,4,9,10,12}, so size of Q13=6 and > PHI(13)=13-1 = 12, so x=2 > does x depend on whether n is a prime or a composite number? It's a little more complicated than that. It depends on the prime factorization of n. The actual equation is on slide 28 of lecture 27. > Also, I understand how table method works for integers and > polynomials but I can't seem to figure out how to do it for > polynomials with coefficients in GF(2^8) (lecture 19 slide 22). > -Why does {00}{00}{00}{01} go into the first remainder slot > (rem[1]), is it because {01}x^4+{01} is too big and get modulo > itself to become 1? Exactly! > -Then how do you go about continuing the algorithm. Could you > show me the first step or two? This is HW6. If you go to: http://merlot.usc.edu/csac-f06/msgs/bill/all.txt Just look for the string "{00}{00}{4f}{c5}" and you can find *many* discussions about this. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Dec 6 21:18:17 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB75IHxg009316 for ; Wed, 6 Dec 2006 21:18:17 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB75Fuuq017963 for ; Wed, 6 Dec 2006 21:15:56 -0800 Message-Id: <200612070515.kB75Fuuq017963@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: table method Date: Wed, 06 Dec 2006 21:15:56 -0800 From: william@bourbon.usc.edu Someone wrote: > I am still a bit confused regarding this. The problem i was > solving is from Garner's method....slide 6, where > > we are solving 2 equations, x = 22 mod 25 & x = 2 mod 11. I assume you had a typo above. Slide 6 of lecture 21 has the 2nd equation as x = 3 mod 11. > I am not able to figure out the step that says, > > 35^{-1} mod 11 = 6. ( steap 4) > > I also got the ans as 16 before, but that is inverse of 11 mod > 35. We need to find inverse of 35 mod 11. > As u said before, we get, y = -5 in this example after slving it > completely & it satisfies the equation; > > 35 * -5 + 11 * 16 = 1. > > So how come '-5' is not the inverse of 35. Thats why i asked, do > we need to find '-5 mod 11' to get the actual inverse value..... > ?? But -5 (mod 11) is the same as 6 (mod 11). They belong to the same congruence class modulo 11. If you end up with a negative number modulo n, then you can keep adding n to it until the number is in Z_n. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Wednesday, December 6, 2006 7:27 pm Subject: Re: table method To: csac@merlot.usc.edu > Someone wrote: > > > I am getting a bit confused about the table method. Say I have, > > a = 35, n = 11. > > > > Now, when I solve this to find inverse of 35 using table method i > > get, > > > > q rem x y > > - 35 0 1 > > - 11 1 0 > > --------------------------- > > 3 2 -3 1 > > --------------------------- > > 5 1 16 -5 > > > > Now here , when rem is 1, we get x = 16. > > And, y = -5. > > > "So Do we always have to take mod of this result with respect to > > n to get the actual inverse value. ......?? " > > > > i.e. in this case, though x = 16, the actual inverse value is 6 > > which is = 16 mod 11. > > Instead of trying to memorize some rules, the most reliable > way to make sure that you get things right is to understand > what the extended Euclidean algorithm is trying to accomplish. > > We are solving ax+by=d, from the first step, a = 35 and b = 11 > (or the other way around, it doesn't matter). From the last > step, d = 1. Is x = 16 and y = -5? Or is it x = -5 and y = 16? > Well, you simply plug into ax+by=d and see what happens. This > becomes, is (35)(16)+(11)(-5)=1 or (35)(-5)+(11)(16)=1? The > first one is wrong. So we have (35)(-5)+(11)(16)=1. > > Since n = 35 and a = 11, the inverse of a is the number right > next to it in the above resule. Therefore, the inverse of a > is 16. Then you verify that 11*16 mod 35 is 1. Also, it is > a^{-1} mod n, so you should *not* do mod 11. > > I'm glad that you are practicing the table method. You will > need it for the final exam! Don't go to sleep until you can > do it in your sleep! :-) Well, you do need sleep. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Dec 6 19:28:38 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB73Sc60002333 for ; Wed, 6 Dec 2006 19:28:38 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB73QIG6016739 for ; Wed, 6 Dec 2006 19:26:18 -0800 Message-Id: <200612070326.kB73QIG6016739@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: table method Date: Wed, 06 Dec 2006 19:26:18 -0800 From: william@bourbon.usc.edu Someone wrote: > I am getting a bit confused about the table method. Say I have, > a = 35, n = 11. > > Now, when I solve this to find inverse of 35 using table method i > get, > > q rem x y > - 35 0 1 > - 11 1 0 > --------------------------- > 3 2 -3 1 > --------------------------- > 5 1 16 -5 > > Now here , when rem is 1, we get x = 16. And, y = -5. > "So Do we always have to take mod of this result with respect to > n to get the actual inverse value. ......?? " > > i.e. in this case, though x = 16, the actual inverse value is 6 > which is = 16 mod 11. Instead of trying to memorize some rules, the most reliable way to make sure that you get things right is to understand what the extended Euclidean algorithm is trying to accomplish. We are solving ax+by=d, from the first step, a = 35 and b = 11 (or the other way around, it doesn't matter). From the last step, d = 1. Is x = 16 and y = -5? Or is it x = -5 and y = 16? Well, you simply plug into ax+by=d and see what happens. This becomes, is (35)(16)+(11)(-5)=1 or (35)(-5)+(11)(16)=1? The first one is wrong. So we have (35)(-5)+(11)(16)=1. Since n = 35 and a = 11, the inverse of a is the number right next to it in the above resule. Therefore, the inverse of a is 16. Then you verify that 11*16 mod 35 is 1. Also, it is a^{-1} mod n, so you should *not* do mod 11. I'm glad that you are practicing the table method. You will need it for the final exam! Don't go to sleep until you can do it in your sleep! :-) Well, you do need sleep. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Dec 6 14:57:18 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB6MvIlk017339 for ; Wed, 6 Dec 2006 14:57:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB6MsxoU013447 for ; Wed, 6 Dec 2006 14:54:59 -0800 Message-Id: <200612062254.kB6MsxoU013447@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Exam Date: Wed, 06 Dec 2006 14:54:59 -0800 From: william@bourbon.usc.edu Someone wrote: > Do we have to learn the details of why each algorithm does the complex > manipulations, for ex, ElGamal public-key scheme. Its too much information, > and it is very difficult to remember even the concepts. ElGamal is a relatively simple scheme. I think once you understood Diffie-Hellman, ElGamal is quite straight forward (the only thing you have to remember is that it needs to generate a random value y and the rest sort of falls out naturally). > I guess my question is where do we stop focusing, as each slide contains > lot of detail. For the exam, I like to stick to "basic principles". This includes simple equations that make all the public-key algorithms work. Any math that is too involved, you do not have to memorize the equations. But you do need to understand the concepts well enough to put it together. For example, if I give you all the ingredients (i.e., all the equations involed) you should be able to write down the steps in the right order. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Dec 6 07:34:03 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB6FY3UX021747 for ; Wed, 6 Dec 2006 07:34:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB6FVifJ007890 for ; Wed, 6 Dec 2006 07:31:44 -0800 Message-Id: <200612061531.kB6FVifJ007890@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 Rabin Public-Key Encryption Date: Wed, 06 Dec 2006 07:31:44 -0800 From: william@bourbon.usc.edu Someone wrote: > I just wonder if it is possible for the Rabin decryption to obtain 4 > roots s.t. more than 1 of the roots satisfy the required redundancy. > For example, on slide 18 of lecture 22 we could obtain more than one > root in which last 6 bits are replicated. In this case it can be hard > to decide which one of the roots is the original message. I think it's possible since the redundancy is rather simplistic. If we use a complex redundancy function such as the one specified in ISO 9796 (slide 24 of lecture 26), then the chance of getting multiple solutions with the correct redundancy would be very small. (Recall that one of the main use of ISO 9796 was for Rabin signatures.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Dec 5 22:31:41 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB66VfPh016518 for ; Tue, 5 Dec 2006 22:31:41 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB66TOKa032112 for ; Tue, 5 Dec 2006 22:29:24 -0800 Message-Id: <200612060629.kB66TOKa032112@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS599: m||m? Date: Tue, 05 Dec 2006 22:29:24 -0800 From: william@bourbon.usc.edu Someone wrote: > I've seen this a few times, and I'm not 100% sure what it means. If > m=101, is m||m 101101? Yes. ("||" is the concatenation operator, so "m||m" is m concatenat with itself.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Dec 5 22:05:20 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB665KaL014858 for ; Tue, 5 Dec 2006 22:05:20 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB6633Js031417 for ; Tue, 5 Dec 2006 22:03:03 -0800 Message-Id: <200612060603.kB6633Js031417@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: DiffieHellman algorithm Date: Tue, 05 Dec 2006 22:03:03 -0800 From: william@bourbon.usc.edu Someone wrote: > You mentioned in the class: > > Alice has private key x and public key X = g^x mod p > > Bob has private key y and public key Y = g^y mod p > > Alice computes Z = Y^x mod p [and say Z is treated as z] > > Bob computes Z'=X^y mod p and Z' = Z so Bob decrypts Alice's message! > > My question is what ever Bob did, could also be done by an eavesdropper. So > may be an eavesdropper can also have Private key e and Public key E=g^e mod > p. Then he could generate E'=X^e mod p and E' would be equal to Z, thus > message could be decrypted by him? An eavesdropper (a passive attacker) does not have y (Bob's private key), so it cannot compute what Bob can compute. The main problem with Diffie-Hellman is with an active attacker (man-in-the-middle attack). -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Dec 5 19:43:46 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB63hjLi005789 for ; Tue, 5 Dec 2006 19:43:45 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB63fTOS029039 for ; Tue, 5 Dec 2006 19:41:29 -0800 Message-Id: <200612060341.kB63fTOS029039@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Quadratic residue ?? Date: Tue, 05 Dec 2006 19:41:29 -0800 From: william@bourbon.usc.edu By the way, if anyone has an answer to the red question marks, please let me know! -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Tue, 05 Dec 2006 19:40:32 -0800 From: william@bourbon.usc.edu To: csac@merlot.usc.edu Subject: Re: Quadratic residue ?? Someone wrote: > I am confused about what would be quadratic residue for n > =pq(where both p n q are odd primes) > let take example form slides > n=21 p=7 q=3 > Q21={1,4,16} > Q3={1} > Q7={1,2,4} > > slide say that if n=pq as above then > a belongs to Z*21 is quadratic residue modulo 21 iff > a belongs to Q3 > and a belongs to Q7 > > what is values of a?? > Please explain. This is the slide with red question marks! As I've mentioned during lectures that I cannot find an *explanation* for the "if and only if" part. The above says "a is a quadratic residue modulo n". So, "a" is a quadratic residue, which means that it is a square of something. > according to me ans should be a={1} > as 1 belongs to Z*21 > 1 belongs to Q7 > 1 belongs to Q3 > > but slide says ans is Q21={1,4,16} > you have also put question marks there Becuase I cannot explain it! I think this slide is the only slide for the whole semester that has red question marks in it. > but please explain if > question arises in exam what we should do. A better question would be, how should I grade?! I usually try very hard to only have questions that I know answers of in exams. :-) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Dec 5 19:42:49 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB63gn0s005774 for ; Tue, 5 Dec 2006 19:42:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB63eW3D029013 for ; Tue, 5 Dec 2006 19:40:32 -0800 Message-Id: <200612060340.kB63eW3D029013@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Quadratic residue ?? Date: Tue, 05 Dec 2006 19:40:32 -0800 From: william@bourbon.usc.edu Someone wrote: > I am confused about what would be quadratic residue for n > =pq(where both p n q are odd primes) > let take example form slides > n=21 p=7 q=3 > Q21={1,4,16} > Q3={1} > Q7={1,2,4} > > slide say that if n=pq as above then > a belongs to Z*21 is quadratic residue modulo 21 iff > a belongs to Q3 > and a belongs to Q7 > > what is values of a?? > Please explain. This is the slide with red question marks! As I've mentioned during lectures that I cannot find an *explanation* for the "if and only if" part. The above says "a is a quadratic residue modulo n". So, "a" is a quadratic residue, which means that it is a square of something. > according to me ans should be a={1} > as 1 belongs to Z*21 > 1 belongs to Q7 > 1 belongs to Q3 > > but slide says ans is Q21={1,4,16} > you have also put question marks there Becuase I cannot explain it! I think this slide is the only slide for the whole semester that has red question marks in it. > but please explain if > question arises in exam what we should do. A better question would be, how should I grade?! I usually try very hard to only have questions that I know answers of in exams. :-) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Dec 5 11:54:10 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB5Js9gA008200 for ; Tue, 5 Dec 2006 11:54:10 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB5JpsbX022550 for ; Tue, 5 Dec 2006 11:51:54 -0800 Message-Id: <200612051951.kB5JpsbX022550@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Forgery Date: Tue, 05 Dec 2006 11:51:54 -0800 From: william@bourbon.usc.edu Someone wrote: > In selective forgery, the attacker produces a new text-MAC pair for a text > of his choice. Does this mean that he can influence the sender to change > the text, and generate the correct MAC for the text. No. It means that for *some* restricted text, the attacker can generate corresponding MAC. > In this case the scheme is completely broken, b/c what ever the attacker > wants the sender to send, he can simply make the sender do that. It is not completely broekn since the attacker cannot do this for *any* text. With forgery, the attacker does want the sender to know anything funny is going on. So, most likely, the attack will not interact with the sender. If the attack can forget a text-MAC pair, as if it's coming from the sender, it doesn't need to go through the sender. > I am asking this b/c I was of the opinion that that MAC is secured through > a digital sig (or something else) and the attacker can only attemp to > modify the text, in which case he can not product the text-MAC pair he > wants. I think you are mixing MAC and digital signatures. It is possible to digitally sign a text-MAC pair, but it is not necessary. Recall that MAC is generated by keyed-hash function and it can provide data integrity and data origin authentication. But it cannot provide non-repudiation since a shared key is involved. That's where digital signatures come in. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Dec 4 23:24:54 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB57OsUV024841 for ; Mon, 4 Dec 2006 23:24:54 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB57MeZH013625 for ; Mon, 4 Dec 2006 23:22:40 -0800 Message-Id: <200612050722.kB57MeZH013625@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS599: Yuvals Birthday Attack Date: Mon, 04 Dec 2006 23:22:40 -0800 From: william@bourbon.usc.edu Someone wrote: > I do not understand Yuval's attack clearly. Specifically i do not > understand how it can be related to the birthday attack. > > In Yuval's attack we are taking two unrelated messages x1 and x2 and > then trying to change the last 64 bits of each message > to produce a minor modification (with m = 128). > > It does not make sense intuitively, as to how there will be a collision > between x1' and x2'? > > Is there any relation between x1 and x2? X1 and x2 can be totally unrelated. The birthday paradox basically says that given there are N possible outcomes, if you generate on the order of sqrt(N) outcomes, with probability greater than 1/2, two of the outcomes will be the same (collision). When this is applied to hash functions of m=128 bits, N is 2^128 and sqrt(N) is 2^64. An easy way to generate 2^64 variations of x1 (or x2) is to change the last 64 bits of x1 (or x2). Intuitively, this doesn't make sense! That's why it's called a "paradox". (But it does make sense once you've figured out that you are *not* modifying x2 to match a single modified x1 that you have generated. For every modified x2, you are trying to see if it matches any of the modified x1 that you have genearted, and the probability of getting a hit is a lot higher.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Dec 2 09:09:05 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB2H95hJ019579 for ; Sat, 2 Dec 2006 09:09:05 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB2H71k7015303 for ; Sat, 2 Dec 2006 09:07:01 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id kB2H711H015302 for csac@merlot; Sat, 2 Dec 2006 09:07:01 -0800 Date: Sat, 2 Dec 2006 09:07:01 -0800 From: william@bourbon.usc.edu Message-Id: <200612021707.kB2H711H015302@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: reminder about modifications... Hi, Just a reminder that it's a good idea to very what you have submitted. Please see: http://merlot.usc.edu/csac-f06/submit.html#verify If you have minor modifications, please follow the instructions at the following URL: http://merlot.usc.edu/csac-f06/homeworks.html#mods -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Dec 1 14:30:55 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB1MUtB6003156 for ; Fri, 1 Dec 2006 14:30:55 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB1MSsGk001097 for ; Fri, 1 Dec 2006 14:28:54 -0800 Message-Id: <200612012228.kB1MSsGk001097@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW7 maxitr Date: Fri, 01 Dec 2006 14:28:54 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm a little confused about what purpose "maxitr" has for the > rndsearch and maurer commands. I know for rndsearch maxitr is > used for the Miller-Rabin function, but does it serve any other > purpose here? As for maurer, I am not sure what maxitr is used > for if at all. So what is it supposed to be for these two > commands? For rndsearch, when you call MillerRabin(), you must pass maxitr to it. I'm not sure what you meant by "does it serve any other purpose here". When you invoke MillerRabin(), you must tell it how many iterations to run before declaring a number to be prime. As for Maurer's Algorithm, you are correct that it is not needed! I'm surprised that no one has complained about this. Thanks for letting me know. I don't think it's necessary to change the spec now since everyone is probably parsing for -t=maxitr already. Sorry about this bug in the spec! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Dec 1 14:22:24 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB1MMOrf002634 for ; Fri, 1 Dec 2006 14:22:24 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB1MKNNA000999 for ; Fri, 1 Dec 2006 14:20:23 -0800 Message-Id: <200612012220.kB1MKNNA000999@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 lecture 27 Date: Fri, 01 Dec 2006 14:20:23 -0800 From: william@bourbon.usc.edu Someone wrote: > Slides for lecture 27 are not available on the course website, could > you please upload them? Done. I actually did it yesterday, but forgot to update the web page. Now I just noticed that I have 14 extra slides at the beginning. I'm not on campus today and I won't be on campus till next Monday. So, please just ignore the first 14 slides. Sorry about this. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Dec 1 13:41:35 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB1LfZJ1032240 for ; Fri, 1 Dec 2006 13:41:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB1LdYca032658 for ; Fri, 1 Dec 2006 13:39:34 -0800 Message-Id: <200612012139.kB1LdYca032658@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Hw7: Compilation problem Date: Fri, 01 Dec 2006 13:39:34 -0800 From: william@bourbon.usc.edu Someone wrote: > In rndsearch, how long should the program run if it does not find a prime? > Is there a upper bound for the max iteration we should do for this step? There is no limit. Well, the limit is when it runs out of random bytes in rndfile. So, you do need to terminate your program with an error message when that occurs. -- Bill Cheng // bill.cheng@usc.edu On 11/30/06, william@bourbon.usc.edu wrote: > > Someone wrote: > > > I am trying to run the Makefile on nunki, but there's some sort > > of error displayed. It says that "openssl/bn.h not found". I > > "included -I/home/scf-22/csci551b/openssl/include > > -L/home/scf-22/csci551b/openssl/lib -lcrypto" also, but still its > > giving me error. So, what can be the problem? > > > > When I run the same Makefile on Fedora core 5, on which I work, > > its working properly..whithout any errors. > > Hmm... This is strange. Could you do the following and see if > you can see the "bn.h" file: > > cat /home/scf-22/csci551b/openssl/include/openssl/bn.h > > Please let me know if this command can successfully print > "bn.h". By the way, I am assuming that in your source code, > you have done the following: > > #include > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Dec 1 13:20:02 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB1LK134030859 for ; Fri, 1 Dec 2006 13:20:01 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB1LI0Lf032214 for ; Fri, 1 Dec 2006 13:18:00 -0800 Message-Id: <200612012118.kB1LI0Lf032214@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Hw7: Error Messages Date: Fri, 01 Dec 2006 13:18:00 -0800 From: william@bourbon.usc.edu Someone wrote: > Which messages in are considered to be error messages? Error > messages should go to stderr. This usually means "unless otherwise specified". > So, which messages are considered error messages? > > In the grading guidelines: > > n0=1012897331475683 > ./hw7 trialdiv -n=$n0 -p=primes.n220 > (not enough primes) > > So, is this message considered error message? Because this is > the output of the program. This is a bug in the grading guidelines since the spec says exactly what to output in the Commandline Syntax section. I have changed the grading guidelines to say: set n0=1012897331475683 ./hw7 trialdiv -n=$n0 -p=primes.n220 should output: n passes trial division test (not enough primes) > If this is error messages, then rest of the outputs like > > "Miller Rabing found a strong witness ....." > "Miller Rabin declares n to be a primes no",etc.. > > should also be considered error messages...because they are > outputs of the program. In this case, they are all program output. Things that should go to stderr are the error messages that are not explicitly specified. Thanks for catching this bug in the grading guidelines. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 30 20:09:30 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB149UYl029435 for ; Thu, 30 Nov 2006 20:09:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB147VIZ022551 for ; Thu, 30 Nov 2006 20:07:31 -0800 Message-Id: <200612010407.kB147VIZ022551@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Hw7: Compilation problem Date: Thu, 30 Nov 2006 20:07:31 -0800 From: william@bourbon.usc.edu Someone wrote: > I am trying to run the Makefile on nunki, but there's some sort > of error displayed. It says that "openssl/bn.h not found". I > "included -I/home/scf-22/csci551b/openssl/include > -L/home/scf-22/csci551b/openssl/lib -lcrypto" also, but still its > giving me error. So, what can be the problem? > > When I run the same Makefile on Fedora core 5, on which I work, > its working properly..whithout any errors. Hmm... This is strange. Could you do the following and see if you can see the "bn.h" file: cat /home/scf-22/csci551b/openssl/include/openssl/bn.h Please let me know if this command can successfully print "bn.h". By the way, I am assuming that in your source code, you have done the following: #include -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 30 20:05:26 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB145QXK029171 for ; Thu, 30 Nov 2006 20:05:26 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB143RhZ022500 for ; Thu, 30 Nov 2006 20:03:27 -0800 Message-Id: <200612010403.kB143RhZ022500@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW7 Date: Thu, 30 Nov 2006 20:03:27 -0800 From: william@bourbon.usc.edu Someone wrote: > Is it ok if Miller-Rabin returns failure for n=1, 2, 3? Yes. This is because, according to the spec, it needs to try t prime numbers to see if any of them are witnesses to the compositness of n. Since n are too small, there is not enough prime numbers and step (2.1.1) will return failure. So, you should print an error message saying that maxitr is too large. This is mentioned in the Test Data & Sample Output section of the spec for n=13 and t=20. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 30 19:59:15 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB13xEWn028778 for ; Thu, 30 Nov 2006 19:59:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB13vGnW022418 for ; Thu, 30 Nov 2006 19:57:16 -0800 Message-Id: <200612010357.kB13vGnW022418@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] spacing issue for Maurer's Date: Thu, 30 Nov 2006 19:57:16 -0800 From: william@bourbon.usc.edu Someone wrote: > In the first example of the output for the maurer function you have 2 > extra spaces at the beginning this line: > " Maurer's Algorithm found an 40-bit prime:" Oops! Fixed. Thanks for catching this. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 30 19:51:42 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB13pgBO028213 for ; Thu, 30 Nov 2006 19:51:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB13ni4l022253 for ; Thu, 30 Nov 2006 19:49:44 -0800 Message-Id: <200612010349.kB13ni4l022253@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: BN_sqrt Date: Thu, 30 Nov 2006 19:49:44 -0800 From: william@bourbon.usc.edu Hi, I'm forwarding an e-mail from a student in our class. Thanks for sending it! I haven't read this reference in detail. I'm guessing that this square-root of n is probably defined as n = x^2 + y where y is as small as possible, then this square-root of n is x. (I might be totally wrong since I'm just guessing.) Anyway, we should stick to the OpenSSL BIGNUM library. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Thu, 30 Nov 2006 16:50:36 -0800 From: Michael Bailey To: "william@bourbon.usc.edu" Subject: Re: BN_sqrt I understand the assignment can be done without a sqrt function, but I have a few comments. The function that student is looking for is just sqrt not modulo sqrt. The faster and more complete GNU bignum library ( http://swox.com/gmp/ ) has a sqrt function that uses the "Karatsuba Square Root" algorithm (http://swox.com/gmp/manual/Square-Root-Algorithm.html#Square-Root-Algorithm) . Michael On 11/30/06, william@bourbon.usc.edu wrote: > Someone wrote: > > > I was reading the wrong file for my previous question. I am sorry for t hat. > > > > Also, professor, I am trying to calculate square root of a BIGNUM, but I > > didn;t find a function for that. > > Even exponent to the power of 0.5 does not work, since it rounds the 0. 5 to > > 0! > > I was wondering how should we find the sqrt of a BIGNUM. > > There is no such function! As you have learned in this > class, doing squart-root modulo a prime number is possible > provided that the number is a quadratic residue. Doing > square-root modulo a composite number is NP-complete. That's > why there is no such function. > > If you are looking to convert a BIGNUM to a double, and then > call sqrt(), that's also not possible. This is because by > definition, the value of a BIGNUM can be larger than MAXFLOAT. > > So, you need to look for another way (e.g., use BN_sqr()) to > do what you need to do. Please see my message with timestamp > "Wed 22 Nov 17:47". > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 30 16:21:49 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB10LnFU014958 for ; Thu, 30 Nov 2006 16:21:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kB10JoJm020053 for ; Thu, 30 Nov 2006 16:19:50 -0800 Message-Id: <200612010019.kB10JoJm020053@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: BN_sqrt Date: Thu, 30 Nov 2006 16:19:50 -0800 From: william@bourbon.usc.edu Someone wrote: > I was reading the wrong file for my previous question. I am sorry for that. > > Also, professor, I am trying to calculate square root of a BIGNUM, but I > didn;t find a function for that. > Even exponent to the power of 0.5 does not work, since it rounds the 0.5 to > 0! > I was wondering how should we find the sqrt of a BIGNUM. There is no such function! As you have learned in this class, doing squart-root modulo a prime number is possible provided that the number is a quadratic residue. Doing square-root modulo a composite number is NP-complete. That's why there is no such function. If you are looking to convert a BIGNUM to a double, and then call sqrt(), that's also not possible. This is because by definition, the value of a BIGNUM can be larger than MAXFLOAT. So, you need to look for another way (e.g., use BN_sqr()) to do what you need to do. Please see my message with timestamp "Wed 22 Nov 17:47". -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 30 16:01:30 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kB101UbS013647 for ; Thu, 30 Nov 2006 16:01:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAUNxWrm019769 for ; Thu, 30 Nov 2006 15:59:32 -0800 Message-Id: <200611302359.kAUNxWrm019769@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS599: Maurers Algorithm rand_file usage Date: Thu, 30 Nov 2006 15:59:32 -0800 From: william@bourbon.usc.edu Someone wrote: > In the grading script, in section (D) > I am testing > ./hw7 rndsearch -k=$k1 -t=10 -p=$pf -r=$rf > f1.rs > and the first number is > n = 132069 > Which passes the trial divison test in the grading script, while in my code > it does not, because it is divisible by prime number 3. > Infact, number 132069 is divisible by 3, (123069/3=41023). I think I am > missing something, or there is an error in the file. > Please clearify. The first 3 lines of "~csci551b/public/csac/hw7/f1.rs" is: RANDOM-SEARCH: iteration 1 n = 132069 n is composite by trial division (mod 3 = 0) So, it's declaring 132069 a composite number. Are you reading the wrong file? -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 30 15:13:01 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAUND1Cb010393 for ; Thu, 30 Nov 2006 15:13:01 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAUNB3jt019022 for ; Thu, 30 Nov 2006 15:11:03 -0800 Message-Id: <200611302311.kAUNB3jt019022@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS599: Maurers Algorithm rand_file usage Date: Thu, 30 Nov 2006 15:11:03 -0800 From: william@bourbon.usc.edu Someone wrote: > So when we recursively call Maurer, we pass the pointer in the call > (instead of reading from the beginning)? Yes! -- Bill Cheng // bill.cheng@usc.edu On 11/26/06, william@bourbon.usc.edu wrote: > Someone wrote: > > > Your first answer cleared my doubt. > > > > The second question was just to confirm if the same file pointer is > > incremented by all the calls (made at 3 different places) in the code. > > > > I thought maybe we have to open the same rand_file multiple times and > > then use the different pointers in each of those calls. I was wondering > > if we may run out of random bytes if we use the same file pointer in all > > the locations. > > > > But i think i will assume here that we have enough random bytes for all > > your cases. > > Well, if there is not enough random bytes, you should print > an error message (to say that there is not enough random > bytes in rndfile) and exit. > -- > Bill Cheng // bill.cheng@usc.edu > > > > william@bourbon.usc.edu wrote: > > Someone wrote: > > > > > In the Maurers algorithm, the function RndOddNum() is invoked at > > > many places. > > > The function RndByte() is invoked at 1 place. > > > > > > Both of them use the same rand_file that is specified. > > > > > > Q1. Do we have to maintain separate stream pointers for > > > RndOddNum() and RndByte() or do these functions share a single > > > file pointer? > > > > They share a single file pointer. > > > > > Q2. If the above is true then do we also need to maintain > > > different pointers for the different instances of RndOddNum? > > > > I'm not sure what you mean. You should read rndfile using > > the current file points for the correct number of bytes. > > Let's the file pointer move to the right place by itself > > since you have read the correct number of bytes. You don't > > need to call seek() or anything to move the file pointer > > manually. > > > > I don't know if I'm answering you question. If you have a > > more specific question, please feel free to ask! > > -- > > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 30 13:07:37 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAUL7bEh001962 for ; Thu, 30 Nov 2006 13:07:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAUL5dOZ017814 for ; Thu, 30 Nov 2006 13:05:39 -0800 Message-Id: <200611302105.kAUL5dOZ017814@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW7 Date: Thu, 30 Nov 2006 13:05:39 -0800 From: william@bourbon.usc.edu In step (7.2) of the Maurer's Algorithm, currently, it says: 7.2) if (TrialDivision(n) == "pass") { TrialDivision() here is used to weed out n that has small prime divisors. So, it is okay to run out of prime numbers here. Therefore, I have just changed the spec to say the following instead: 7.2) [BC: Fixed 11/30/2006] if (TrialDivision(n) != "fail") { Sorry about the oversight. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Thu, 30 Nov 2006 12:23:15 -0800 From: william@bourbon.usc.edu To: csac@merlot.usc.edu Subject: Re: CSCI599 HW7 Someone wrote: > For rndsearch you mentioned > "TrialDivision(n) tries all prime numbers that are less than or equal to > sqrt(n) in primesfile in increasing order to see if it is a divisor of n. > It returns "fail" if a prime divisor is found. Otherwise, it returns > "pass". (It should return "error" if there are not enough prime numbers in > primesfile.) " > > So what should the algorithm do when TrialDivision returns "error"? > > Random-Search(k,maxitr): > 1) n = RndOddNum(k) > 2) if (TrialDivision(n) == "fail") goto step (1) > 3) if (Miller-Rabin(n,maxitr) == "prime") return(n) > goto step (1) > > For fail, it goes to step 1, and for pass it keeps going down. For error, > should it stop on declaring and error? Then it should go to step (3) since it's not equal to "fail". -- Bill Cheng // bill.cheng@usc.edu On 11/30/06, william@bourbon.usc.edu wrote: > > Hi, > > I have just fixed rs.128 and ma.128 on the spec to print > "(not enough primes)" at the right places. (As it turns out, > the files in the grading guidelines are not affected.) > -- > Bill Cheng // bill.cheng@usc.edu > > > > -----Original Message----- > Date: Thu, 30 Nov 2006 07:24:54 -0800 > From: william@bourbon.usc.edu > To: csac@merlot.usc.edu > Subject: Re: CSCI599 HW7 > > Someone wrote: > > > for the following commands, > > hw7 rndsearch -k=128 -t=10 -p=primes.n220 -r=rnd.220 > > and > > hw7 maurer -k=128 -t=10 -p=primes.n220 -r=rnd.220 > > since the functions use trial division my output contains following > line: > > n passes trial division test (not enough primes) > > whenever it passes trial division however your output does not > contain > > '(not enough primes)' string, it only reports > > n passes trial division test > > > > Is it ok if my output will contain '(not enough primes)'? > > Your output is correct! I need to fix the "solutions". > I'll do that later today when I get some time. Thanks > for catching the bug! > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 30 13:00:45 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAUL0jxq001471 for ; Thu, 30 Nov 2006 13:00:45 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAUKwlhH017722 for ; Thu, 30 Nov 2006 12:58:47 -0800 Message-Id: <200611302058.kAUKwlhH017722@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Hw7: maurer 7.2.1 Date: Thu, 30 Nov 2006 12:58:47 -0800 From: william@bourbon.usc.edu Someone wrote: > In the maurer's algo given on the homework specs, in step 7.2.1 , > after while(a<=1 or a>=n-1) there is one more opening curly > brace, which seems insignifact to me. You are right. It is fixed now. Thanks for catching it. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 30 12:25:13 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAUKPD8e031577 for ; Thu, 30 Nov 2006 12:25:13 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAUKNFOw017384 for ; Thu, 30 Nov 2006 12:23:15 -0800 Message-Id: <200611302023.kAUKNFOw017384@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW7 Date: Thu, 30 Nov 2006 12:23:15 -0800 From: william@bourbon.usc.edu Someone wrote: > For rndsearch you mentioned > "TrialDivision(n) tries all prime numbers that are less than or equal to > sqrt(n) in primesfile in increasing order to see if it is a divisor of n. > It returns "fail" if a prime divisor is found. Otherwise, it returns > "pass". (It should return "error" if there are not enough prime numbers in > primesfile.) " > > So what should the algorithm do when TrialDivision returns "error"? > > Random-Search(k,maxitr): > 1) n = RndOddNum(k) > 2) if (TrialDivision(n) == "fail") goto step (1) > 3) if (Miller-Rabin(n,maxitr) == "prime") return(n) > goto step (1) > > For fail, it goes to step 1, and for pass it keeps going down. For error, > should it stop on declaring and error? Then it should go to step (3) since it's not equal to "fail". -- Bill Cheng // bill.cheng@usc.edu On 11/30/06, william@bourbon.usc.edu wrote: > > Hi, > > I have just fixed rs.128 and ma.128 on the spec to print > "(not enough primes)" at the right places. (As it turns out, > the files in the grading guidelines are not affected.) > -- > Bill Cheng // bill.cheng@usc.edu > > > > -----Original Message----- > Date: Thu, 30 Nov 2006 07:24:54 -0800 > From: william@bourbon.usc.edu > To: csac@merlot.usc.edu > Subject: Re: CSCI599 HW7 > > Someone wrote: > > > for the following commands, > > hw7 rndsearch -k=128 -t=10 -p=primes.n220 -r=rnd.220 > > and > > hw7 maurer -k=128 -t=10 -p=primes.n220 -r=rnd.220 > > since the functions use trial division my output contains following > line: > > n passes trial division test (not enough primes) > > whenever it passes trial division however your output does not > contain > > '(not enough primes)' string, it only reports > > n passes trial division test > > > > Is it ok if my output will contain '(not enough primes)'? > > Your output is correct! I need to fix the "solutions". > I'll do that later today when I get some time. Thanks > for catching the bug! > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 30 10:06:58 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAUI6who022707 for ; Thu, 30 Nov 2006 10:06:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAUI51fo015636 for ; Thu, 30 Nov 2006 10:05:01 -0800 Message-Id: <200611301805.kAUI51fo015636@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW7 Date: Thu, 30 Nov 2006 10:05:01 -0800 From: william@bourbon.usc.edu Hi, I have just fixed rs.128 and ma.128 on the spec to print "(not enough primes)" at the right places. (As it turns out, the files in the grading guidelines are not affected.) -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Thu, 30 Nov 2006 07:24:54 -0800 From: william@bourbon.usc.edu To: csac@merlot.usc.edu Subject: Re: CSCI599 HW7 Someone wrote: > for the following commands, > hw7 rndsearch -k=128 -t=10 -p=primes.n220 -r=rnd.220 > and > hw7 maurer -k=128 -t=10 -p=primes.n220 -r=rnd.220 > since the functions use trial division my output contains following line: > n passes trial division test (not enough primes) > whenever it passes trial division however your output does not contain > '(not enough primes)' string, it only reports > n passes trial division test > > Is it ok if my output will contain '(not enough primes)'? Your output is correct! I need to fix the "solutions". I'll do that later today when I get some time. Thanks for catching the bug! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 30 07:26:51 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAUFQpvq012398 for ; Thu, 30 Nov 2006 07:26:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAUFOsNo014005 for ; Thu, 30 Nov 2006 07:24:54 -0800 Message-Id: <200611301524.kAUFOsNo014005@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW7 Date: Thu, 30 Nov 2006 07:24:54 -0800 From: william@bourbon.usc.edu Someone wrote: > for the following commands, > hw7 rndsearch -k=128 -t=10 -p=primes.n220 -r=rnd.220 > and > hw7 maurer -k=128 -t=10 -p=primes.n220 -r=rnd.220 > since the functions use trial division my output contains following line: > n passes trial division test (not enough primes) > whenever it passes trial division however your output does not contain > '(not enough primes)' string, it only reports > n passes trial division test > > Is it ok if my output will contain '(not enough primes)'? Your output is correct! I need to fix the "solutions". I'll do that later today when I get some time. Thanks for catching the bug! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 29 22:21:48 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAU6Lmba009729 for ; Wed, 29 Nov 2006 22:21:48 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAU6JrRt008995 for ; Wed, 29 Nov 2006 22:19:53 -0800 Message-Id: <200611300619.kAU6JrRt008995@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Hw7: Date: Wed, 29 Nov 2006 22:19:53 -0800 From: william@bourbon.usc.edu Someone wrote: > I am trying to run the specs given for rndsearch. for k=128, when > we come to iteration 7, > n="222762911882905198568317087234672146247" and primes.n220 file > the first byte is 1048576. So, as per the rules given in specs > for trialdivision, if maxval primes. This is equivalent to maxval*maxval So, here, first byte, i.e. maxval= 1048576. squaring it gives > 1099511627776 which is smaller than n. so, it should go back to > step 1 in rndsearch algorithm as the number of primes are not > enough. Is my understanding right? If I am wrong, where am I > going wrong? If you have exhausted all the primes in primesfile, it is considered that the trial division test did *not* fail. So, you should go on to step (3). -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 29 22:11:24 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAU6BOFG009077 for ; Wed, 29 Nov 2006 22:11:24 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAU69SJw008833 for ; Wed, 29 Nov 2006 22:09:28 -0800 Message-Id: <200611300609.kAU69SJw008833@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW7 Date: Wed, 29 Nov 2006 22:09:28 -0800 From: william@bourbon.usc.edu Someone wrote: > I have a question regarding grading guidelines for Maurer's. > For lines, > ./hw7 maurer -k=$k5 -t=10 -p=$pf -r=$rf > f5.ma > ./hw7 maurer -k=$k6 -t=10 -p=$pf -r=$rf > f6.ma > ./hw7 maurer -k=$k10 -t=10 -p=$pf -r=$rf > f10.ma > output says that 29, 32 and 44 bits number generated, however we > provide -k=30, 33, and 45. > > Is it ok? Yes. This is because we are not following the Maurer's Algorithm in the textbook exactly. Please see my message with timestamp "Tue 28 Nov 10:00". -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 29 18:52:22 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAU2qMZj028806 for ; Wed, 29 Nov 2006 18:52:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAU2oRqj007197 for ; Wed, 29 Nov 2006 18:50:27 -0800 Message-Id: <200611300250.kAU2oRqj007197@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: hw7:rndsearch query Date: Wed, 29 Nov 2006 18:50:27 -0800 From: william@bourbon.usc.edu Someone wrote: > I am not getting a part of rndsearch algorithm > > The first step is to generate a random number of x bytes, where > x=ceil(x/8). So, after generating the number n. we go to step 2 > and check if n passes trialdivision test. In case, it does not, > the we need to revert back to step 1) of generating another > random number. Now, my question is that how can we generate > random? > > For e.g. if x=4 , then we read first four bytes from rndfile and > manipulate as per the specs. given. Now , we go to step 2) and > check if it passes trial division. In case it doesn't pass the > test, we go back to step of generating random no. So, to generate > another random number, do we need to read next x(in this case > x=4) bytes from rndfile? Exactly! (What we are trying to do with rndfile is to simulate the calling of random number generater so that it's easier to grade. If we were to use a real random number generator, it will be much harder to grade because everyone may generate a different sequence.) > Because if we read the same first four > bytes from rndfile, then it will generate the same random number > n and again step 2 will fail and the program will go to infinite > loop. As I've mentioned in my message with timestamp "Sun 26 Nov 15:02", you do not need to manipulate file pointer. Just read the next x bytes! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 29 15:10:31 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kATNAVmA014629 for ; Wed, 29 Nov 2006 15:10:31 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kATN8amS004596 for ; Wed, 29 Nov 2006 15:08:36 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id kATN8aTW004595 for csac@merlot; Wed, 29 Nov 2006 15:08:36 -0800 Date: Wed, 29 Nov 2006 15:08:36 -0800 From: william@bourbon.usc.edu Message-Id: <200611292308.kATN8aTW004595@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: CS 599 Final Exam... Hi, Our final exam will be held between 2pm and 4pm on Thursday, 12/7/2006. The final exam will be closed book, closed notes, and closed everything (and no "cheat sheet"). Also, no calculators, cell phones, or any electronic gadgets are allowed. Please bring a photo ID. Your ID will be collected at the beginning of the exam and will be returned to you when you turn in your exam. There will be assigned seating. I've updated the class web page to list a summary of topics (assuming that the last lecture will cover everything on the last set of lecture slides). -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 29 14:51:57 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kATMpvYw013225 for ; Wed, 29 Nov 2006 14:51:57 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kATMo3Bq004357 for ; Wed, 29 Nov 2006 14:50:03 -0800 Message-Id: <200611292250.kATMo3Bq004357@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: power optimization Date: Wed, 29 Nov 2006 14:50:03 -0800 From: william@bourbon.usc.edu Someone wrote: > Is there a optimization to calculate > y = a^r mod n > As r is a very big number, and a^r would be huge. [I am trying to print it > for debugging and it takes ages] The man pages for BN_mod_exp() says: int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m, ...) BN_mod_exp() computes a to the p-th power modulo m ("r=a^p % m"). which is exactly what you need. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 29 10:36:04 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kATIa3hF029314 for ; Wed, 29 Nov 2006 10:36:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kATIYA0i001145 for ; Wed, 29 Nov 2006 10:34:10 -0800 Message-Id: <200611291834.kATIYA0i001145@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Print Bignum as decimal Date: Wed, 29 Nov 2006 10:34:10 -0800 From: william@bourbon.usc.edu Someone wrote: > Professor I am trying to print values of Bignum on screen. I am only aware > of functions > int BN_print(BIO *fp, const BIGNUM *a); > int BN_print_fp(FILE *fp, const BIGNUM *a); > as mentioned on http://www.openssl.org/docs/crypto/bn.html > Both of these functions write output in hex. Is there any other > way/function which could be used to output BIGNUM as decimal? The bottom of the spec mentioned BN_bn2dec(). You can use it together with printf(). -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 29 10:30:36 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kATIUaFk028910 for ; Wed, 29 Nov 2006 10:30:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kATISgrb000948 for ; Wed, 29 Nov 2006 10:28:42 -0800 Message-Id: <200611291828.kATISgrb000948@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: query about chinese remainder theorem Date: Wed, 29 Nov 2006 10:28:42 -0800 From: william@bourbon.usc.edu Someone wrote: > I tried solving the given problem by CRT(chinese remainder thm), Great that you are practicing for the final exam! > x=4 mod 5 > x=5 mod 11 Using the notation in lectures, we have: v_1=4, m_1=5, v_2=5, m_2=11. Furthermore, M = m_1 m_2 = 55. > can you please guide me how to go about for this problem ... cause 'y2' > term comes negative in this case ... y2 is negative should not be a problem since we are doing modular arithematics. You just need to find a positive number that is congruent to y2 (by adding the modulus to it). Let's go over the whole calculation... Using the straight-forward solution (slide 37 of lecture 20): x = sum_{i=1}^2 v_i M_i y_i mod M where M_1 = M/m_1 = 11, M_2 = M/m_2 = 5. Furthermore, y_1 = (M_1)^(-1) mod m_1 y_2 = (M_2)^(-1) mod m_2 or y_1 = 11^(-1) mod 5 y_2 = 5^(-1) mod 11 since 11 is congruent to 1 mod 5, we have y_1 = 1^(-1) mod 5 therefore, y_1 is 1 (since 1^(-1) is always 1 no matter what the modulus is). You can verify this with (1)(11) mod 5 = 1. We are now left with: y_2 = 5^(-1) mod 11 Using the table method for calculating inverses, we have: i quo[i] rem[i] x y --------------------------------- 1 - 11 0 1 2 - 5 1 0 3 2 1 -2 1 If the rule for determining which one is the inverse is confusing, we can just try it both ways... Which equation is true: (11)(-2)+(5)(1) = 1 or (11)(1)+(5)(-2) = 1 The 2nd equation is correct, therefore the inverse of 5 (modulo 11) is -2. Furthermore, -2 (modulo 11) is 9 (modulo 11). So, the inverse of 5 (modulo 11) is 9. Sure enough, (5)(9)=45 and 45 mod 11 is 1. Put it all together, x = sum_{i=1}^2 v_i M_i y_i mod M = (v_1 M_1 y_1 + v_2 M_2 y_2) mod M = ( (4)(11)(1) + (5)(5)(9) ) mod 55 = 269 mod 55 = 49 Checking to make sure... 49 mod 5 = 4 49 mod 11 = 5 -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 28 19:24:22 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAT3OMpd029267 for ; Tue, 28 Nov 2006 19:24:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAT3MVLb025351 for ; Tue, 28 Nov 2006 19:22:31 -0800 Message-Id: <200611290322.kAT3MVLb025351@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Big Num library Date: Tue, 28 Nov 2006 19:22:31 -0800 From: william@bourbon.usc.edu Hi, I just want to mention that usually we would change the testdata in the grading guidelines for grading. So, although right now we don't use anything grader than 2^32 for testing trialdiv, we may use larger numbers in actual grading. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Tue, 28 Nov 2006 19:16:14 -0800 From: william@bourbon.usc.edu To: csac@merlot.usc.edu Subject: Re: Big Num library Someone wrote: > Which parts of the hw7 require that we use BigNum library. > Do we have to use them for calculating primes and for trialdiv? You should not use BIGNUM for "primes" since maxval is between 2 and 2^24. For all other commands, you should use BIGNUM. -- Bill Cheng // bill.cheng@usc.edu On 11/28/06, william@bourbon.usc.edu wrote: > > Someone wrote: > > > I am currently working on the Maurer's Algo. implementation. > > It runs successfully for all the test cases, except > > Test case # 5, 6 and 10. > > > > Here the end result, i.e. the final prime number and also all > > the rest of the statements match. Only thing that does not > > match is the no of bits in the number. > > > > ( > > For test case 5....my prg returns, '29-bit prime'. > > Script Result, '30-bit prime' > > For test case 6....my prg returns, '32-bit prime'. > > Script Result, '33-bit prime' > > For test case 10....my prg returns,' 44-bit prime'. > > Script Result, '45-bit prime' > > ) > > > > When I computed the number of bits for each result manually > > using a calculator, it matched the results returned by my > > program. I have used BN_num_bits() to evaluate no of bits in > > a BIGNUM. > > > > Can you please help me out regarding what I might be doing > > wrong ? > > You did not do it wrong. Please see my message with timestamp > "Wed 22 Nov 13:26". I think the best thing to do is to report > the actual number of bits in n when Maurer's Algorithm finishes. > I have just modified the spec and added: > > [BC: Added 11/28/2006] > When Maurer's Algorithm terminates, please use BN_num_bits() > to report the actual number of bits in the generated prime > number n. > > I have also changed the "solutions" on nunki. > > Thanks for catching this bug! > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 28 19:18:06 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAT3I68j028877 for ; Tue, 28 Nov 2006 19:18:06 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAT3GEhc025266 for ; Tue, 28 Nov 2006 19:16:14 -0800 Message-Id: <200611290316.kAT3GEhc025266@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Big Num library Date: Tue, 28 Nov 2006 19:16:14 -0800 From: william@bourbon.usc.edu Someone wrote: > Which parts of the hw7 require that we use BigNum library. > Do we have to use them for calculating primes and for trialdiv? You should not use BIGNUM for "primes" since maxval is between 2 and 2^24. For all other commands, you should use BIGNUM. -- Bill Cheng // bill.cheng@usc.edu On 11/28/06, william@bourbon.usc.edu wrote: > > Someone wrote: > > > I am currently working on the Maurer's Algo. implementation. > > It runs successfully for all the test cases, except > > Test case # 5, 6 and 10. > > > > Here the end result, i.e. the final prime number and also all > > the rest of the statements match. Only thing that does not > > match is the no of bits in the number. > > > > ( > > For test case 5....my prg returns, '29-bit prime'. > > Script Result, '30-bit prime' > > For test case 6....my prg returns, '32-bit prime'. > > Script Result, '33-bit prime' > > For test case 10....my prg returns,' 44-bit prime'. > > Script Result, '45-bit prime' > > ) > > > > When I computed the number of bits for each result manually > > using a calculator, it matched the results returned by my > > program. I have used BN_num_bits() to evaluate no of bits in > > a BIGNUM. > > > > Can you please help me out regarding what I might be doing > > wrong ? > > You did not do it wrong. Please see my message with timestamp > "Wed 22 Nov 13:26". I think the best thing to do is to report > the actual number of bits in n when Maurer's Algorithm finishes. > I have just modified the spec and added: > > [BC: Added 11/28/2006] > When Maurer's Algorithm terminates, please use BN_num_bits() > to report the actual number of bits in the generated prime > number n. > > I have also changed the "solutions" on nunki. > > Thanks for catching this bug! > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 28 10:02:11 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kASI2AOT025408 for ; Tue, 28 Nov 2006 10:02:10 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kASI0LKs020354 for ; Tue, 28 Nov 2006 10:00:21 -0800 Message-Id: <200611281800.kASI0LKs020354@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: hw7 query Date: Tue, 28 Nov 2006 10:00:21 -0800 From: william@bourbon.usc.edu Someone wrote: > I am currently working on the Maurer's Algo. implementation. > It runs successfully for all the test cases, except > Test case # 5, 6 and 10. > > Here the end result, i.e. the final prime number and also all > the rest of the statements match. Only thing that does not > match is the no of bits in the number. > > ( > For test case 5....my prg returns, '29-bit prime'. > Script Result, '30-bit prime' > For test case 6....my prg returns, '32-bit prime'. > Script Result, '33-bit prime' > For test case 10....my prg returns,' 44-bit prime'. > Script Result, '45-bit prime' > ) > > When I computed the number of bits for each result manually > using a calculator, it matched the results returned by my > program. I have used BN_num_bits() to evaluate no of bits in > a BIGNUM. > > Can you please help me out regarding what I might be doing > wrong ? You did not do it wrong. Please see my message with timestamp "Wed 22 Nov 13:26". I think the best thing to do is to report the actual number of bits in n when Maurer's Algorithm finishes. I have just modified the spec and added: [BC: Added 11/28/2006] When Maurer's Algorithm terminates, please use BN_num_bits() to report the actual number of bits in the generated prime number n. I have also changed the "solutions" on nunki. Thanks for catching this bug! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 27 11:18:16 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kARJIFKl002640 for ; Mon, 27 Nov 2006 11:18:16 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kARJGTI2001757 for ; Mon, 27 Nov 2006 11:16:29 -0800 Message-Id: <200611271916.kARJGTI2001757@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: hw7 query Date: Mon, 27 Nov 2006 11:16:29 -0800 From: william@bourbon.usc.edu Someone wrote: > I have a doubt about the trial division method. You posted the > answer to the question about finding out the square root using > BIGNUM. > > You have said that instead of taking the square root of the > number, we can take square of the prime no read from the file. I > am confused about how to proceed with this ? > > In the usual case, we iterate from 2 to > floor(squareRoot(number)), trying primes one by one. Now as we > are not taking the square root , do we iterate from , square(2) > to number ? If not, can you please explain how to proceed after > taking primes number's squares ? You can do something like the following (let "number" be the commandline argument for n, "count" be the number of primes in "primesfile", let GetPrim(i) return the i'th prime in "primesfile", and Square(i) returns i^2): for (i=0; i < count; i++) { int prime=GetPrime(i); if (Square(i) > number) break; ... } Of course, number, Square(), and related operations should be in BIGNUM. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 26 22:18:08 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAR6I8tm016720 for ; Sun, 26 Nov 2006 22:18:08 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAR6GNHp026592 for ; Sun, 26 Nov 2006 22:16:23 -0800 Message-Id: <200611270616.kAR6GNHp026592@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS599: Final Exam Date: Sun, 26 Nov 2006 22:16:23 -0800 From: william@bourbon.usc.edu Someone wrote: > I remember reading in the notes following the midterm grades you sent > that the final exam coverage will not overlap the midterm coverage. Correct. > So does that mean that we will have the syllabus for the final exam from > DES onwards? Please clarify. Exactly! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 26 22:16:30 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAR6GUWD016584 for ; Sun, 26 Nov 2006 22:16:30 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAR6Ek7h026553 for ; Sun, 26 Nov 2006 22:14:46 -0800 Message-Id: <200611270614.kAR6Ek7h026553@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS599: Maurers Algorithm rand_file usage Date: Sun, 26 Nov 2006 22:14:46 -0800 From: william@bourbon.usc.edu Someone wrote: > Your first answer cleared my doubt. > > The second question was just to confirm if the same file pointer is > incremented by all the calls (made at 3 different places) in the code. > > I thought maybe we have to open the same rand_file multiple times and > then use the different pointers in each of those calls. I was wondering > if we may run out of random bytes if we use the same file pointer in all > the locations. > > But i think i will assume here that we have enough random bytes for all > your cases. Well, if there is not enough random bytes, you should print an error message (to say that there is not enough random bytes in rndfile) and exit. -- Bill Cheng // bill.cheng@usc.edu william@bourbon.usc.edu wrote: > Someone wrote: > > > In the Maurers algorithm, the function RndOddNum() is invoked at > > many places. > > The function RndByte() is invoked at 1 place. > > > > Both of them use the same rand_file that is specified. > > > > Q1. Do we have to maintain separate stream pointers for > > RndOddNum() and RndByte() or do these functions share a single > > file pointer? > > They share a single file pointer. > > > Q2. If the above is true then do we also need to maintain > > different pointers for the different instances of RndOddNum? > > I'm not sure what you mean. You should read rndfile using > the current file points for the correct number of bytes. > Let's the file pointer move to the right place by itself > since you have read the correct number of bytes. You don't > need to call seek() or anything to move the file pointer > manually. > > I don't know if I'm answering you question. If you have a > more specific question, please feel free to ask! > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 26 15:04:35 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAQN4ZDD021500 for ; Sun, 26 Nov 2006 15:04:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAQN2pgv023165 for ; Sun, 26 Nov 2006 15:02:51 -0800 Message-Id: <200611262302.kAQN2pgv023165@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS599: Maurers Algorithm rand_file usage Date: Sun, 26 Nov 2006 15:02:51 -0800 From: william@bourbon.usc.edu Someone wrote: > In the Maurers algorithm, the function RndOddNum() is invoked at > many places. > The function RndByte() is invoked at 1 place. > > Both of them use the same rand_file that is specified. > > Q1. Do we have to maintain separate stream pointers for > RndOddNum() and RndByte() or do these functions share a single > file pointer? They share a single file pointer. > Q2. If the above is true then do we also need to maintain > different pointers for the different instances of RndOddNum? I'm not sure what you mean. You should read rndfile using the current file points for the correct number of bytes. Let's the file pointer move to the right place by itself since you have read the correct number of bytes. You don't need to call seek() or anything to move the file pointer manually. I don't know if I'm answering you question. If you have a more specific question, please feel free to ask! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 26 15:01:24 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAQN1ON7021233 for ; Sun, 26 Nov 2006 15:01:24 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAQMxfOb023092 for ; Sun, 26 Nov 2006 14:59:41 -0800 Message-Id: <200611262259.kAQMxfOb023092@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: hw7 query Date: Sun, 26 Nov 2006 14:59:41 -0800 From: william@bourbon.usc.edu Someone wrote: > I am working on the Miller Rabin algo implementation currently. > For step 2.2 i.e. > > 2.2) compute y = a^r mod n > > I am trying to get a^r by executing BN_mul funcyion r times and > after that take the mod by n. But this is very inefficient as > value of r is huuge. It takes a loooooooooooooooooooot of time > for this operation to complete. > > Can you please suggest me how to deal with this problem. Is there > any specific method in BIGNUM to get around this prob. You should use BN_mod_exp(). -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 24 23:28:48 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAP7SmWD006317 for ; Fri, 24 Nov 2006 23:28:48 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAP7RA0B010195 for ; Fri, 24 Nov 2006 23:27:10 -0800 Message-Id: <200611250727.kAP7RA0B010195@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: hw7 primes Date: Fri, 24 Nov 2006 23:27:10 -0800 From: william@bourbon.usc.edu Hi, Just realized that there was a typo in the following e-mail that I sent a while back. I hope it was obvious that it was a typo. In the previous message, I wrote: So, please don't do something like: int *a=(int*)malloc(n*sizeof(int)); ... You should do something like: int num_bytes=ceiling(n/8); int *a=(int*)malloc(num_bytes*sizeof(int)); ... I should have said: char *a=(char*)malloc(num_bytes*sizeof(char)); because num_bytes is the number of bytes to allocate and allocating num_bytes*sizeof(int) bytes is clearly allocating 4 times as much memory! So, it should be allocating num_bytes*sizeof(char) bytes. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Fri, 17 Nov 2006 12:29:04 -0800 From: william@bourbon.usc.edu To: csac@merlot.usc.edu Subject: Re: hw7 primes Someone wrote: > Specs says > > "Since the sieve of Eratosthenes uses an array of maxval integers > whose values can only be 0 or 1, please be memory efficient and > use only maxval bits (i.e., ceil(maxval/8) bytes) for the array." > > Can you please explain what does the above sentence exactly mean? The Eratosthenes(n) starts with: a[1] := 0 for i := 2 to n do a[i] := 1 So, please don't do something like: int *a=(int*)malloc(n*sizeof(int)); a[i] = 0; for (i=2; i <= n; i++) a[i] = 1; You should do something like: int num_bytes=ceiling(n/8); int *a=(int*)malloc(num_bytes*sizeof(int)); SetBit(a, i, 0); for (i=2; i <= n; i++) SetBit(a, i, 1); where SetBit(a,i,b) sets bit i of array a to binary value b. This way, you only use 1/32 amount of memory compared to using int to store a bit. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 23 23:25:17 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAO7PGS5010846 for ; Thu, 23 Nov 2006 23:25:17 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAO7Nhmx029220 for ; Thu, 23 Nov 2006 23:23:43 -0800 Message-Id: <200611240723.kAO7Nhmx029220@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW7 Date: Thu, 23 Nov 2006 23:23:43 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm not understanding primesfile format. I've been trying to > store the prime as a long datatype, divide into four bytes, and > output each as char. Is this anything close to what we're > supposed to do? I guess I'm not sure how to convert from integer > values to what I'm assuming is binary. (I'm using aludra.) It doesn't matter if you write things out as char or as 32-bit integers since they are just bytes. Let's use the first case in the grading guidelinss as an example: ./hw7 primes -n=23 The first 4 bytes in stdiout should be the value 23 in big endian format (every 4 bytes afterwards is in the same format). So, you can do something like the following: uint32_t word=htonl(23); fwrite(&word, sizeof(unit32_t), 1, stdout); The above is equivalent to: uint32_t word=htonl(23); for (i=0; i < 4; i++) { fwrite(&((unsigned char*)(&word))[i], sizeof(char), 1, stdout); } The htonl() is necessary if you want your code to work on both big endian machines and small endian machines. It's not a requirement if you only want it to work on nunki/aludra. If you close the file right after the above code and run hexdump (from HW1), you should see the following: 000000: 00 00 00 17 -- -- -- -- -- -- -- -- -- -- -- -- .... The first 4 byte is 23 (or 0x00000017 in hex) in big endian format. If your HW1 hexdump is not working, you can run: ~csci551b/bin/hexdump -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 23 10:21:50 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kANILoev026104 for ; Thu, 23 Nov 2006 10:21:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kANIKI7t023115 for ; Thu, 23 Nov 2006 10:20:18 -0800 Message-Id: <200611231820.kANIKI7t023115@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Website access Date: Thu, 23 Nov 2006 10:20:18 -0800 From: william@bourbon.usc.edu Someone wrote: > I can not access the website > http://merlot.usc.edu/csac-f06/ > from yesterday. Is it me, or is there a problem with the server. Hmm... It seemed to be working at this time. I wasn't aware of any network problem. By the way, it's probably a good idea to make a copy of the HW spec once in a while but don't look at it until you have trouble going to the web. (If you work off of a copy, you may miss important changes.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 22 20:35:43 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAN4Zhqw004998 for ; Wed, 22 Nov 2006 20:35:43 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAN4YDhY015812 for ; Wed, 22 Nov 2006 20:34:13 -0800 Message-Id: <200611230434.kAN4YDhY015812@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW7 Date: Wed, 22 Nov 2006 20:34:13 -0800 From: william@bourbon.usc.edu Someone wrote: > I guess for Maurer's algorithm c is not used in line 2 --> 2) > c = 0.1, m = 20 Correct. c is used to set the trial division bound B in step (3) on slide 13 of lecture 20. But we have eliminated step (3) in our spec. So, there is no use for c. > Also I can't figure out where "#define round(X) (((X) >= 0) ? > (int)((X)+0.5) : (int)((X)-0.5))" is used. It's only used when you print out the value of r in step (4). Since r is a real number between 0 and 1 and the spec calls for an integer percentage value, you should multiply r by 100 and then apply the round() function before you print out the percentage value. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 22 17:48:35 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAN1mZae026740 for ; Wed, 22 Nov 2006 17:48:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAN1l6KN014314 for ; Wed, 22 Nov 2006 17:47:06 -0800 Message-Id: <200611230147.kAN1l6KN014314@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: hw7 Date: Wed, 22 Nov 2006 17:47:06 -0800 From: william@bourbon.usc.edu In the spec, there are a few places where it mentioned sqrt(number). One place is for trialdiv. Instead of taking a squareroot of number, you can square the number you read in primesfile. This can be accomplished using BN_sqr(). Here's what you can do: BIGNUM *CalcSqareOfN(BIGNUM *bn_n) { BN_CTX *bn_ctx=BN_CTX_new(); BIGNUM *bn_return=BN_new(); BN_CTX_init(bn_ctx); BN_sqr(bn_return, bn_n, bn_ctx); BN_CTX_free(bn_ctx); return bn_return; } I skipped all the error checking, so you have to put them at the right places. You can also download openssl and look into the crypto/rsa and other directories to find examples. If you want to see how BN_mod() is used, just do: grep BN_mod *.c in the crypto/rsa directory. Please do not ask me for more examples (unless you have something very specific). Part of this assignment is for you to figure out how to use BIGNUM. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Wed, 22 Nov 2006 16:32:17 -0800 From: william@bourbon.usc.edu To: csac@merlot.usc.edu Subject: Re: hw7 Someone wrote: > can you please guide me as to how to calculate squareroot of a bignumber > using BIGNUM library. > or > do we use the normal C function sqrt() for calculating ? I do not see a squareroot function in: http://www.openssl.org/docs/crypto/bn.html Why do you need squareroot? -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 22 16:33:47 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAN0Xlvf021839 for ; Wed, 22 Nov 2006 16:33:47 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAN0WHPN013608 for ; Wed, 22 Nov 2006 16:32:17 -0800 Message-Id: <200611230032.kAN0WHPN013608@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: hw7 Date: Wed, 22 Nov 2006 16:32:17 -0800 From: william@bourbon.usc.edu Someone wrote: > can you please guide me as to how to calculate squareroot of a bignumber > using BIGNUM library. > or > do we use the normal C function sqrt() for calculating ? I do not see a squareroot function in: http://www.openssl.org/docs/crypto/bn.html Why do you need squareroot? -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 22 13:31:28 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME, OBSCURED_EMAIL autolearn=no version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAMLVSFx009958 for ; Wed, 22 Nov 2006 13:31:28 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAMLQbqn011196 for ; Wed, 22 Nov 2006 13:26:37 -0800 Message-Id: <200611222126.kAMLQbqn011196@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Maurer Date: Wed, 22 Nov 2006 13:26:37 -0800 From: william@bourbon.usc.edu Someone wrote: > One last thing: > I ran into an odd situation that I fixed in my code, but I still > don't know what's going on. I was having issues with example f9.ma > and I figured out that, in the spec, you say: > > 5) (recursion) q = PROVABLE_PRIME(floor(r*k)+1) > 6) set num_bits_in_q = floor(r*k)+1 > > Of course, this is what we should expect, because we're supposed to > get a value back that has the number of bits we request. For some > odd reason, when I printed out the number of bits requested and the > number returned (using BN_num_bits) I'm getting 22 bits requested, > but only 21 bits returned in q. > > I've only seen this issue in that example (at least not counting > f10.ma, I haven't looked at it yet), and it will cause problems if > you assume num_bits_in_q is the value passed in recursion (as in > spec). I can match the grading guidelines 100% by instead changing > num_bits_in_q to BN_num_bits(q). > > Anyway, you might want to change the spec to > 6) set num_bits_in_q = BN_num_bits(q) > > But then again... maybe the problem is somewhere else. You are absolute right. The problem is with the way I modified Maurer for easier grading. Now I end up with the problem that n=2Rq+1 is not always the right number of bits. One way to fix it is to change step (7.1) to a loop so that it keeps generating a new R until 2Rq+1 is a k-bit integer. An easier fix would be what you suggested, which is to change step (6) so that num_bits_in_q is the actual number of bits in q: set num_bits_in_q = BN_num_bits(q) With this modification, when Maurer(k) returns, the returned number might not always be exactly k-bit in size. But I guess that's okay for this HW. I have just modified the spec. (And again, the "solution" is doing this already but I did not notice the problem until you pointed it out. Thanks very much for catching it!) -- Bill Cheng // bill.cheng@usc.edu On Nov 21, 2006, at 7:47 PM, william@bourbon.usc.edu wrote: > Someone wrote: > >> Having trouble with the grading guidelines in Maurer... >> >> Guidelines: >> >> Maurer: level 0, k=21 >> step 4, r = 50% >> Maurer: level 1, k=11 >> step 1.1, n = 1027 >> n is composite by trial division (mod 13 = 0) >> step 1.1, n = 1471 >> n passes trial division test >> Maurer: back to level 0, k=21, q=1471 >> step 7, itr 1: R = 413, n = 1215047 >> >> Mine: >> >> Maurer: level 0, k=21 >> step 4, r = 50% >> Maurer: level 1, k=11 >> step 1.1, n = 1027 >> n is composite by trial division (mod 13 = 0) >> step 1.1, n = 1471 >> n passes trial division test >> Maurer: back to level 0, k=21, q=1471 >> step 7, itr 1: R = 129, n = 379519 >> >> >> Maurer spec says: >> >> 7.1) R = RndOddNum(k-2-num_bits_in_q) >> >> If k = 21, and num_bit_in_q = 11 (equal to k of lower level), then R >> = RndOddNum(8). And 413 is larger than 8 bits. Apprently I'm >> missing something. Help? > > I think you've found a bug in the spec! If you look at the > Maurer code in slide 14 of lecture 20, it says: > > I = floor(2^{k-1}/(2q)) > > When I convert this to the HW7 spec, I decided to count the > number of bits in I instead of using the above equation. The > number of bits in I is approximately (k-1-1-num_bits_in_q). > If (k-2-num_bits_in_q) is, say 5, then I=2^5=32. Slide 14 of > lecture 20 then say: > > 7.1) select a random integer R in the interval [I+1,2I] > > If I=32, then this interval is [33,64] which is a 5+1=6 bit > integer! Therefore, the original spec said that: > > R = RndOddNum(k-2-num_bits_in_q) > > is wrong! It should be: > > R = RndOddNum(k-1-num_bits_in_q) > > So, the grading guidelines has it right and the spec is wrong. > I've just modified the spec to: > > 7.1) [BC: Fixed 11/21/2006] > R = RndOddNum(k-1-num_bits_in_q) > > Sorry about the bug and thanks for catching it! > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 21 23:02:21 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME, OBSCURED_EMAIL autolearn=no version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAM72LEC018677 for ; Tue, 21 Nov 2006 23:02:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAM6vVKi002353 for ; Tue, 21 Nov 2006 22:57:31 -0800 Message-Id: <200611220657.kAM6vVKi002353@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Maurer Date: Tue, 21 Nov 2006 22:57:31 -0800 From: william@bourbon.usc.edu Someone wrote: > Another issue in the spec that took a bit of debugging time to figure > out :-\ > > As written: > > 7.2.1) a = RndOddNum(num_bits_in_n) > if (a > 1 and < n-1)) { > 7.2.2) b = a^{n-1} mod n > if (b == 1) { > b = a^{2R} mod n > d = gcd(b-1,n) > if (d == 1) return(n) > } > } > > Should be (to match grading guidelines): > > 7.2.1) do { > a = RndOddNum(num_bits_in_n) > } while (a < 1 or > n-1); > 7.2.2) b = a^{n-1} mod n > if (b == 1) { > b = a^{2R} mod n > d = gcd(b-1,n) > if (d == 1) return(n) > } You are absolutely correct. From slide 14 of lecture 20, it says: 7.2.1) select a random integer a in the interval [2,n-2] Therefore, we should keep calling RndOddNum() until the returned value is between 2 and n-2, inclusive. So, one minor modification to your fix at the end of 7.2.1 in the while-condition: while (a <= 1 or a >= n-1) which is the same as saying a is in the interval [2,n-2]. I have modified the spec accordingly. Sorry about the bug and thanks for catching it! (As before, my "solution" did the right thing, but the spec was written incorrectly.) -- Bill Cheng // bill.cheng@usc.edu On Nov 21, 2006, at 7:47 PM, william@bourbon.usc.edu wrote: > Someone wrote: > >> Having trouble with the grading guidelines in Maurer... >> >> Guidelines: >> >> Maurer: level 0, k=21 >> step 4, r = 50% >> Maurer: level 1, k=11 >> step 1.1, n = 1027 >> n is composite by trial division (mod 13 = 0) >> step 1.1, n = 1471 >> n passes trial division test >> Maurer: back to level 0, k=21, q=1471 >> step 7, itr 1: R = 413, n = 1215047 >> >> Mine: >> >> Maurer: level 0, k=21 >> step 4, r = 50% >> Maurer: level 1, k=11 >> step 1.1, n = 1027 >> n is composite by trial division (mod 13 = 0) >> step 1.1, n = 1471 >> n passes trial division test >> Maurer: back to level 0, k=21, q=1471 >> step 7, itr 1: R = 129, n = 379519 >> >> >> Maurer spec says: >> >> 7.1) R = RndOddNum(k-2-num_bits_in_q) >> >> If k = 21, and num_bit_in_q = 11 (equal to k of lower level), then R >> = RndOddNum(8). And 413 is larger than 8 bits. Apprently I'm >> missing something. Help? > > I think you've found a bug in the spec! If you look at the > Maurer code in slide 14 of lecture 20, it says: > > I = floor(2^{k-1}/(2q)) > > When I convert this to the HW7 spec, I decided to count the > number of bits in I instead of using the above equation. The > number of bits in I is approximately (k-1-1-num_bits_in_q). > If (k-2-num_bits_in_q) is, say 5, then I=2^5=32. Slide 14 of > lecture 20 then say: > > 7.1) select a random integer R in the interval [I+1,2I] > > If I=32, then this interval is [33,64] which is a 5+1=6 bit > integer! Therefore, the original spec said that: > > R = RndOddNum(k-2-num_bits_in_q) > > is wrong! It should be: > > R = RndOddNum(k-1-num_bits_in_q) > > So, the grading guidelines has it right and the spec is wrong. > I've just modified the spec to: > > 7.1) [BC: Fixed 11/21/2006] > R = RndOddNum(k-1-num_bits_in_q) > > Sorry about the bug and thanks for catching it! > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 21 19:51:59 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME, OBSCURED_EMAIL autolearn=no version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAM3pwId006185 for ; Tue, 21 Nov 2006 19:51:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAM3lA01000313 for ; Tue, 21 Nov 2006 19:47:10 -0800 Message-Id: <200611220347.kAM3lA01000313@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Maurer Date: Tue, 21 Nov 2006 19:47:10 -0800 From: william@bourbon.usc.edu Someone wrote: > Having trouble with the grading guidelines in Maurer... > > Guidelines: > > Maurer: level 0, k=21 > step 4, r = 50% > Maurer: level 1, k=11 > step 1.1, n = 1027 > n is composite by trial division (mod 13 = 0) > step 1.1, n = 1471 > n passes trial division test > Maurer: back to level 0, k=21, q=1471 > step 7, itr 1: R = 413, n = 1215047 > > Mine: > > Maurer: level 0, k=21 > step 4, r = 50% > Maurer: level 1, k=11 > step 1.1, n = 1027 > n is composite by trial division (mod 13 = 0) > step 1.1, n = 1471 > n passes trial division test > Maurer: back to level 0, k=21, q=1471 > step 7, itr 1: R = 129, n = 379519 > > > Maurer spec says: > > 7.1) R = RndOddNum(k-2-num_bits_in_q) > > If k = 21, and num_bit_in_q = 11 (equal to k of lower level), then R > = RndOddNum(8). And 413 is larger than 8 bits. Apprently I'm > missing something. Help? I think you've found a bug in the spec! If you look at the Maurer code in slide 14 of lecture 20, it says: I = floor(2^{k-1}/(2q)) When I convert this to the HW7 spec, I decided to count the number of bits in I instead of using the above equation. The number of bits in I is approximately (k-1-1-num_bits_in_q). If (k-2-num_bits_in_q) is, say 5, then I=2^5=32. Slide 14 of lecture 20 then say: 7.1) select a random integer R in the interval [I+1,2I] If I=32, then this interval is [33,64] which is a 5+1=6 bit integer! Therefore, the original spec said that: R = RndOddNum(k-2-num_bits_in_q) is wrong! It should be: R = RndOddNum(k-1-num_bits_in_q) So, the grading guidelines has it right and the spec is wrong. I've just modified the spec to: 7.1) [BC: Fixed 11/21/2006] R = RndOddNum(k-1-num_bits_in_q) Sorry about the bug and thanks for catching it! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 21 10:18:44 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kALIIi9G001619 for ; Tue, 21 Nov 2006 10:18:44 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kALIDuFK026482 for ; Tue, 21 Nov 2006 10:13:56 -0800 Message-Id: <200611211813.kALIDuFK026482@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: hw7 primes Date: Tue, 21 Nov 2006 10:13:56 -0800 From: william@bourbon.usc.edu Someone wrote: > > I'm not sure what you meant by "i". When p=3, p^2=9. Inside > > the (p^2 <= n) while loop, there is: > > > > j = p^2 /* if p=3, then j=9 */ > > while (j <= n) do { > > a[j] = 0 > > j = j + p > > } > > > > When the inner while loop finishes, p is still 3. Then: > > > > repeat p=p+1 until a[p]==1 > > > --->What I'm trying to say is that the first loop in the code is the for > loop: > > for i := 2 to n do a[i] := 1 > > So when i is incremented from 2 to 3, a[3] is now = 1. Yes. At the beginning, you start with the assumption that all numbers are prime. So, you set a[i]=1 for all i up to n. > Therefore, for any number from i=3 up to maxval, the second while loop > only executes twice, because p=2, then p=p+1 (which = 3). And as you can > see two lines ago, a[3]=1, so the loop terminates. > > Am I missing something here? You are correct that the code: repeat p=p+1 until a[p]==1 only execute once at the end of the first iteration of the outer while loop. But that does not break you out of the outer while loop. You go to the beginning of the outer while loop with p=3. I can rewrite the "repeat" code in C as follows: do { p++; } while (a[p] == 0); Rewriting the whole inner and outer loops, now it looks something like: while (p^2 <= n) { j = p^2; while (j <= n) { a[j] = 0; j = j+p; } do { p++; } while (a[p] == 0); } So, you only break out of the outer loop if p^2 > n. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 21 08:04:30 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kALG4TLj025485 for ; Tue, 21 Nov 2006 08:04:29 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kALFxgHc024450 for ; Tue, 21 Nov 2006 07:59:42 -0800 Message-Id: <200611211559.kALFxgHc024450@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: hw7 primes Date: Tue, 21 Nov 2006 07:59:42 -0800 From: william@bourbon.usc.edu Someone wrote: > > "It's part of the outer while loop and it's outside of the inner > > while loop. Sorry about the formatting. I was trying to make it > > look more or less like the original web page at: > > > > http://primes.utm.edu/glossary/page.php?sort=SieveOfEratosthenes" > > > > No worries, that's exactly what I thought and how I was coding it, but > could never get past i=3. > > At i=3, a[3]=1; > > In the for loop: > p=2 > while(p^2 <=n) { > ... > p=p+1; until a[p]=1 > } > > After one iteration through the while loop, p will equal 3. We set > a[3]=1 when i was 3, so for every i>3, this while loops exits at p=3. It > doesn't seem right, and definitely doesn't output right. > > Does this make sense? I'm not sure what you meant by "i". When p=3, p^2=9. Inside the (p^2 <= n) while loop, there is: j = p^2 /* if p=3, then j=9 */ while (j <= n) do { a[j] = 0 j = j + p } When the inner while loop finishes, p is still 3. Then: repeat p=p+1 until a[p]==1 will first increment p by 1 to 4, check if a[4]==1 which is false, then increment p by 1 to 5, check if a[5]==1 which is true. Now it goes on to the next iteration of the output while loop with p=5. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 20 22:59:28 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAL6xRAE022800 for ; Mon, 20 Nov 2006 22:59:27 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAL6sgMM019254 for ; Mon, 20 Nov 2006 22:54:42 -0800 Message-Id: <200611210654.kAL6sgMM019254@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: hw7 primes Date: Mon, 20 Nov 2006 22:54:42 -0800 From: william@bourbon.usc.edu Someone wrote: > Does the "repeat" apply to repeating the inner while loop or repeating > the outer while loop? The way it is written, it looks like you are > repeating the outer while loop of: while(p^2 <= n). It's part of the outer while loop and it's outside of the inner while loop. Sorry about the formatting. I was trying to make it look more or less like the original web page at: http://primes.utm.edu/glossary/page.php?sort=SieveOfEratosthenes If you match the curly braces, it should show you exactly where each statement belongs. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Monday, November 20, 2006 9:51 PM To: csac@merlot.usc.edu Subject: Re: hw7 primes Someone wrote: > In the sieve of Erastosthenes algorithm, what does > > repeat p := p+1 until a[p] = 1 > > accomplish? I'm trying to follow the algorithm (using n=7 and n=16), but > I don't see why this step is necessary. a[p] is 0 means that p is not a prime. So, the code in question just skips all the non-primes. At the end of the 1st pass through the main while loop, you set a[p] to 0 for all p's that are multiples of 2. The above code will loop until p=3, which is the next prime number. At the end of the 2nd pass through the main while loop, you set a[p] to 0 for all p's that are multiples of 3. The above code will loop until p=5, which is the next prime number. And so on. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 20 21:55:58 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAL5twQK018332 for ; Mon, 20 Nov 2006 21:55:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAL5pDp5018353 for ; Mon, 20 Nov 2006 21:51:13 -0800 Message-Id: <200611210551.kAL5pDp5018353@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: hw7 primes Date: Mon, 20 Nov 2006 21:51:13 -0800 From: william@bourbon.usc.edu Someone wrote: > In the sieve of Erastosthenes algorithm, what does > > repeat p := p+1 until a[p] = 1 > > accomplish? I'm trying to follow the algorithm (using n=7 and n=16), but > I don't see why this step is necessary. a[p] is 0 means that p is not a prime. So, the code in question just skips all the non-primes. At the end of the 1st pass through the main while loop, you set a[p] to 0 for all p's that are multiples of 2. The above code will loop until p=3, which is the next prime number. At the end of the 2nd pass through the main while loop, you set a[p] to 0 for all p's that are multiples of 3. The above code will loop until p=5, which is the next prime number. And so on. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 20 21:50:04 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAL5o4Av018051 for ; Mon, 20 Nov 2006 21:50:04 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAL5jJFk018295 for ; Mon, 20 Nov 2006 21:45:19 -0800 Message-Id: <200611210545.kAL5jJFk018295@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW7 Date: Mon, 20 Nov 2006 21:45:19 -0800 From: william@bourbon.usc.edu Someone wrote: > By failure I mean 2.1.1 in the provided algorithm. Right... Please print a message saying that you have exhausted the prime numbers in primesfile. -- Bill Cheng // bill.cheng@usc.edu On 11/20/06, william@bourbon.usc.edu wrote: > Someone wrote: > > > What do we have to print out in case of failure for Miller-Rabin? > > The spec gives two sample outputs, one for declaring n a > prime and the other one for declaring n a composite number. > > By "failure", do you mean running out of prime numbers? If > that happens, just print a message saying that you have > exhausted the prime numebers in primesfile. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 20 20:11:11 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAL4BBCo011684 for ; Mon, 20 Nov 2006 20:11:11 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAL46QMx017334 for ; Mon, 20 Nov 2006 20:06:26 -0800 Message-Id: <200611210406.kAL46QMx017334@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW7 Date: Mon, 20 Nov 2006 20:06:26 -0800 From: william@bourbon.usc.edu Someone wrote: > What do we have to print out in case of failure for Miller-Rabin? The spec gives two sample outputs, one for declaring n a prime and the other one for declaring n a composite number. By "failure", do you mean running out of prime numbers? If that happens, just print a message saying that you have exhausted the prime numebers in primesfile. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 20 20:06:34 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAL46YUV011411 for ; Mon, 20 Nov 2006 20:06:34 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAL41nR7017258 for ; Mon, 20 Nov 2006 20:01:49 -0800 Message-Id: <200611210401.kAL41nR7017258@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW7 Date: Mon, 20 Nov 2006 20:01:49 -0800 From: william@bourbon.usc.edu Someone wrote: > In the grading guidelines, > For primes, rm f$f.pms could be added in the loop with diff so that > temporary output files could be deleted. > For millerrabin, $pf should be instead of $fp and /bin/rm -f f?.ke is > wrong, line rm -f f$f.mr could be added to loop with diff. Thanks for catching these. I've fixed them. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 20 16:22:27 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAL0MRVN029606 for ; Mon, 20 Nov 2006 16:22:27 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAL0Hg4b015486 for ; Mon, 20 Nov 2006 16:17:42 -0800 Message-Id: <200611210017.kAL0Hg4b015486@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS599: rndsearch Date: Mon, 20 Nov 2006 16:17:42 -0800 From: william@bourbon.usc.edu Someone wrote: > But what if k is 16 instead of 15? Then you wouldn't change the bits at > all.... Correct. So rule (3) is satisfied automatically since there is no bits k and above (since you only have 2 bytes of data). -- Bill Cheng // bill.cheng@usc.edu On 11/20/06, william@bourbon.usc.edu wrote: > > Someone wrote: > > > So do you: > > > > 1) set bit 0 to 1 > > 2) set bit k-1 to 1 > > 3) set bits k and above to 0 > > > > Under all circumstances?? Or when the MSB is 1? Or when any bit k and > above > > is 1? > > Under all circumstances! The result will always be an odd number > that's exactly k-bit long. > -- > Bill Cheng // bill.cheng@usc.edu > > > > On 11/20/06, william@bourbon.usc.edu wrote: > > > > Someone wrote: > > > > > I'm confused, the spec says: > > > > > > If the least significant bit is bit zero, RndOddNum(k) then sets > both > > bit > > > zero and bit k-1 to one and sets all bits from k and above to zero > in > > the > > > BIGNUM and returns the resulting BIGNUM. > > > > The above sentense reads a little bit weird. I'm deleting the > > first phrase and change the rest to: > > > > RndOddNum(k) then sets both bit zero > > ([BC: Modified 11/20/2006] the least significant bit) > > and bit k-1 to one and sets all bits from k and above to zero > > in the BIGNUM and returns the resulting BIGNUM. > > > > > You say something different: to change the MSB to 0 and change the > k-1 > > bit > > > to 1... > > > > I think it's consistent. The above in the spec says 3 things: > > > > 1) set bit 0 to 1 > > 2) set bit k-1 to 1 > > 3) set bits k and above to 0 > > > > In this case, k is 15. Setting the "most significant bit" to > > 0 is following rule (3) above. > > -- > > Bill Cheng // bill.cheng@usc.edu http://merlot.usc.edu/william/usc/> > > > > > > > > > > On 11/20/06, william@bourbon.usc.edu > wrote: > > > > > > Someone wrote: > > > > > > > I'm having trouble getting the same n the grading script gets > in > > > rndsearch. > > > > For example, for the first test case, i read ceil(15/8) = 2 > bytes > > from > > > rs. > > > > That gives me 164 and 3. The decimal equivalent should be > 164*256 > > + 3 > > > = > > > > 41987. That doesn't work for some reason. Then, if i pass a > string > > of > > > 1 and > > > > 0 characters ("1010010000000011") that doesn't work either. > > Finally, > > > if I > > > > send BN_bin2dec a char array of integer values 1 and 0, that > > doesn't > > > work. > > > > I don't know what else to try. > > > > > > The binary representation for 41987 (or 0xa403) is (like you > said): > > > > > > 1010 0100 0000 0011 > > > > > > Since the commandline is -k=15, we want a 15-bit integer. > > > The above value is a 16-bit integer! So, you need to set the > > > highest order bit to 0 and the next bit to 1, then you should > > > get: > > > > > > 0110 0100 0000 0011 > > > > > > This is 25603 in decimal. So, you need to fix your RndOddNum() > > > a bit. > > > -- > > > Bill Cheng // bill.cheng@usc.edu > http://merlot.usc.edu/william/usc/> Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 20 12:47:45 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAKKljx6015533 for ; Mon, 20 Nov 2006 12:47:45 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAKKh1sl012482 for ; Mon, 20 Nov 2006 12:43:01 -0800 Message-Id: <200611202043.kAKKh1sl012482@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS599: rndsearch Date: Mon, 20 Nov 2006 12:43:01 -0800 From: william@bourbon.usc.edu Someone wrote: > So do you: > > 1) set bit 0 to 1 > 2) set bit k-1 to 1 > 3) set bits k and above to 0 > > Under all circumstances?? Or when the MSB is 1? Or when any bit k and above > is 1? Under all circumstances! The result will always be an odd number that's exactly k-bit long. -- Bill Cheng // bill.cheng@usc.edu On 11/20/06, william@bourbon.usc.edu wrote: > > Someone wrote: > > > I'm confused, the spec says: > > > > If the least significant bit is bit zero, RndOddNum(k) then sets both > bit > > zero and bit k-1 to one and sets all bits from k and above to zero in > the > > BIGNUM and returns the resulting BIGNUM. > > The above sentense reads a little bit weird. I'm deleting the > first phrase and change the rest to: > > RndOddNum(k) then sets both bit zero > ([BC: Modified 11/20/2006] the least significant bit) > and bit k-1 to one and sets all bits from k and above to zero > in the BIGNUM and returns the resulting BIGNUM. > > > You say something different: to change the MSB to 0 and change the k-1 > bit > > to 1... > > I think it's consistent. The above in the spec says 3 things: > > 1) set bit 0 to 1 > 2) set bit k-1 to 1 > 3) set bits k and above to 0 > > In this case, k is 15. Setting the "most significant bit" to > 0 is following rule (3) above. > -- > Bill Cheng // bill.cheng@usc.edu > > > > > On 11/20/06, william@bourbon.usc.edu wrote: > > > > Someone wrote: > > > > > I'm having trouble getting the same n the grading script gets in > > rndsearch. > > > For example, for the first test case, i read ceil(15/8) = 2 bytes > from > > rs. > > > That gives me 164 and 3. The decimal equivalent should be 164*256 > + 3 > > = > > > 41987. That doesn't work for some reason. Then, if i pass a string > of > > 1 and > > > 0 characters ("1010010000000011") that doesn't work either. > Finally, > > if I > > > send BN_bin2dec a char array of integer values 1 and 0, that > doesn't > > work. > > > I don't know what else to try. > > > > The binary representation for 41987 (or 0xa403) is (like you said): > > > > 1010 0100 0000 0011 > > > > Since the commandline is -k=15, we want a 15-bit integer. > > The above value is a 16-bit integer! So, you need to set the > > highest order bit to 0 and the next bit to 1, then you should > > get: > > > > 0110 0100 0000 0011 > > > > This is 25603 in decimal. So, you need to fix your RndOddNum() > > a bit. > > -- > > Bill Cheng // bill.cheng@usc.edu http://merlot.usc.edu/william/usc/> Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 20 11:15:48 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAKJFmZV009704 for ; Mon, 20 Nov 2006 11:15:48 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAKJB4sE011417 for ; Mon, 20 Nov 2006 11:11:04 -0800 Message-Id: <200611201911.kAKJB4sE011417@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS599: rndsearch Date: Mon, 20 Nov 2006 11:11:04 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm confused, the spec says: > > If the least significant bit is bit zero, RndOddNum(k) then sets both bit > zero and bit k-1 to one and sets all bits from k and above to zero in the > BIGNUM and returns the resulting BIGNUM. The above sentense reads a little bit weird. I'm deleting the first phrase and change the rest to: RndOddNum(k) then sets both bit zero ([BC: Modified 11/20/2006] the least significant bit) and bit k-1 to one and sets all bits from k and above to zero in the BIGNUM and returns the resulting BIGNUM. > You say something different: to change the MSB to 0 and change the k-1 bit > to 1... I think it's consistent. The above in the spec says 3 things: 1) set bit 0 to 1 2) set bit k-1 to 1 3) set bits k and above to 0 In this case, k is 15. Setting the "most significant bit" to 0 is following rule (3) above. -- Bill Cheng // bill.cheng@usc.edu On 11/20/06, william@bourbon.usc.edu wrote: > > Someone wrote: > > > I'm having trouble getting the same n the grading script gets in > rndsearch. > > For example, for the first test case, i read ceil(15/8) = 2 bytes from > rs. > > That gives me 164 and 3. The decimal equivalent should be 164*256 + 3 > = > > 41987. That doesn't work for some reason. Then, if i pass a string of > 1 and > > 0 characters ("1010010000000011") that doesn't work either. Finally, > if I > > send BN_bin2dec a char array of integer values 1 and 0, that doesn't > work. > > I don't know what else to try. > > The binary representation for 41987 (or 0xa403) is (like you said): > > 1010 0100 0000 0011 > > Since the commandline is -k=15, we want a 15-bit integer. > The above value is a 16-bit integer! So, you need to set the > highest order bit to 0 and the next bit to 1, then you should > get: > > 0110 0100 0000 0011 > > This is 25603 in decimal. So, you need to fix your RndOddNum() > a bit. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 20 10:18:56 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAKIIubR006074 for ; Mon, 20 Nov 2006 10:18:56 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAKIECC4010389 for ; Mon, 20 Nov 2006 10:14:12 -0800 Message-Id: <200611201814.kAKIECC4010389@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] Public source code use for HW7 Date: Mon, 20 Nov 2006 10:14:12 -0800 From: william@bourbon.usc.edu Someone wrote: > Are there any limitations or restrictions on the use of public source > code and libraries for Homework 7? No limitations or restrictions. As long as you cite things properly in your README file and put comments in proper places. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 20 10:17:07 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAKIH7Cp005934 for ; Mon, 20 Nov 2006 10:17:07 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAKICNVf010283 for ; Mon, 20 Nov 2006 10:12:23 -0800 Message-Id: <200611201812.kAKICNVf010283@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS599: rndsearch Date: Mon, 20 Nov 2006 10:12:23 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm having trouble getting the same n the grading script gets in rndsearch. > For example, for the first test case, i read ceil(15/8) = 2 bytes from rs. > That gives me 164 and 3. The decimal equivalent should be 164*256 + 3 = > 41987. That doesn't work for some reason. Then, if i pass a string of 1 and > 0 characters ("1010010000000011") that doesn't work either. Finally, if I > send BN_bin2dec a char array of integer values 1 and 0, that doesn't work. > I don't know what else to try. The binary representation for 41987 (or 0xa403) is (like you said): 1010 0100 0000 0011 Since the commandline is -k=15, we want a 15-bit integer. The above value is a 16-bit integer! So, you need to set the highest order bit to 0 and the next bit to 1, then you should get: 0110 0100 0000 0011 This is 25603 in decimal. So, you need to fix your RndOddNum() a bit. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 19 21:41:47 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAK5floG022081 for ; Sun, 19 Nov 2006 21:41:47 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAK5b5Vs002794 for ; Sun, 19 Nov 2006 21:37:05 -0800 Message-Id: <200611200537.kAK5b5Vs002794@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS 599 HW6 grade... Date: Sun, 19 Nov 2006 21:37:05 -0800 From: william@bourbon.usc.edu Someone wrote: > Could you post the avg, std dev, high, low statistics? Oops! Sorry! Cannot believe I didn't include those. Here they are: Count = 18 Avg = 73.11 StdDev = 26.60 Max = 100.00 Min = 24.00 6 90+ XXXXXX 7 80+ XXXXXXX 0 70+ 0 60+ 0 50+ 1 40+ X 3 30+ XXX 1 20+ X -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 18 20:15:00 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAJ4F0nj020958 for ; Sat, 18 Nov 2006 20:15:00 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAJ4AMNa015253 for ; Sat, 18 Nov 2006 20:10:22 -0800 Message-Id: <200611190410.kAJ4AMNa015253@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: hw7 primes Date: Sat, 18 Nov 2006 20:10:22 -0800 From: william@bourbon.usc.edu Someone wrote: > In Unix int is 32 bits then why to do ceil(n/8) , because we > all know max no. of primes is > for example maxval=16 > so 2 ^ 16=65536 > max value of prime is less than sqrt(65536)=256 > and as answered by u the value of num_bytes=n/8 > in our case 16/8=2 > so we will allocate mem for two int that means 64 bits but we require > 256 bits still didn't got your point could you please help me out. > Can you give me a small example ? The spec says: primes : Generate all prime numbers less than or equal to maxval So, maxval is *not* the number of bits but the maximum value. For example, if maxval is 7, you should output the following 32-bit values (in big endian format) to stdout: 7 2 3 5 7 If maxval is 16, you should output the following 32-bit values to stdout: 16 2 3 5 7 11 13 and when you run sieve of Eratosthenes, you should only allocate 2 bytes (not 2 ints as you mentioned above) to keep track of the primes. So, at the end of sieve, bits 2, 3, 5, 7, 11, and 13 in a[] should be 1 and everything else should be 0 (a[] is an array of *bits* now). There is no requirement if the most significant bit in a[] is the left most bit or the right most bit. You can choose what you feel more comfortable with. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Friday, November 17, 2006 12:32 pm Subject: Re: hw7 primes To: csac@merlot.usc.edu > Someone wrote: > > > Specs says > > > > "Since the sieve of Eratosthenes uses an array of maxval integers > > whose values can only be 0 or 1, please be memory efficient and > > use only maxval bits (i.e., ceil(maxval/8) bytes) for the array." > > > > Can you please explain what does the above sentence exactly mean? > > The Eratosthenes(n) starts with: > > a[1] := 0 > for i := 2 to n do a[i] := 1 > > So, please don't do something like: > > int *a=(int*)malloc(n*sizeof(int)); > > a[i] = 0; > for (i=2; i <= n; i++) a[i] = 1; > > You should do something like: > > int num_bytes=ceiling(n/8); > int *a=(int*)malloc(num_bytes*sizeof(int)); > > SetBit(a, i, 0); > for (i=2; i <= n; i++) SetBit(a, i, 1); > > where SetBit(a,i,b) sets bit i of array a to binary value b. > This way, you only use 1/32 amount of memory compared to > using int to store a bit. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 17 23:20:22 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAI7KMvG032661 for ; Fri, 17 Nov 2006 23:20:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAI7FlEa001158 for ; Fri, 17 Nov 2006 23:15:47 -0800 Message-Id: <200611180715.kAI7FlEa001158@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW7 Date: Fri, 17 Nov 2006 23:15:47 -0800 From: william@bourbon.usc.edu Someone wrote: > I think there is a typo on the page > http://merlot.usc.edu/csac-f06/homeworks/sieve.html. There should be > <= signs instead of < for while loops. Fixed! Thanks for catching it! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 17 12:33:37 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAHKXbGE021585 for ; Fri, 17 Nov 2006 12:33:37 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAHKT4TC023167 for ; Fri, 17 Nov 2006 12:29:04 -0800 Message-Id: <200611172029.kAHKT4TC023167@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: hw7 primes Date: Fri, 17 Nov 2006 12:29:04 -0800 From: william@bourbon.usc.edu Someone wrote: > Specs says > > "Since the sieve of Eratosthenes uses an array of maxval integers > whose values can only be 0 or 1, please be memory efficient and > use only maxval bits (i.e., ceil(maxval/8) bytes) for the array." > > Can you please explain what does the above sentence exactly mean? The Eratosthenes(n) starts with: a[1] := 0 for i := 2 to n do a[i] := 1 So, please don't do something like: int *a=(int*)malloc(n*sizeof(int)); a[i] = 0; for (i=2; i <= n; i++) a[i] = 1; You should do something like: int num_bytes=ceiling(n/8); int *a=(int*)malloc(num_bytes*sizeof(int)); SetBit(a, i, 0); for (i=2; i <= n; i++) SetBit(a, i, 1); where SetBit(a,i,b) sets bit i of array a to binary value b. This way, you only use 1/32 amount of memory compared to using int to store a bit. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 16 22:05:05 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAH654RK030794 for ; Thu, 16 Nov 2006 22:05:04 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAH60XwT010881 for ; Thu, 16 Nov 2006 22:00:33 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id kAH60Xfc010880 for csac@merlot; Thu, 16 Nov 2006 22:00:33 -0800 Date: Thu, 16 Nov 2006 22:00:33 -0800 From: william@bourbon.usc.edu Message-Id: <200611170600.kAH60Xfc010880@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: new HW7 deadline... Hi, I just changed the HW7 deadline to Friday, 12/1. As I have mentioned in class today, the university has a policy that does not allow any assignment to be due during study time (after the last day of lecture on Friday and the first day of the final exam). This means that in case there is any extended network outage or system problem, I will *not* be able to extend the deadline! So, please pretend the deadline is 11/29 or 11/30, get as much done as possible, and make a few submissions early, just in case bad things happen. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 16 21:59:35 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAH5xZoL030294 for ; Thu, 16 Nov 2006 21:59:35 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAH5t44a010788 for ; Thu, 16 Nov 2006 21:55:04 -0800 Message-Id: <200611170555.kAH5t44a010788@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS599: Error in grading script Date: Thu, 16 Nov 2006 21:55:04 -0800 From: william@bourbon.usc.edu Someone wrote: > I feel bad starting this early, but I was bored at work and started > assignment 7. Any reason to start your assignments early is a good reason! :-) > There's an error in the grading script for "primes." Either > n0-n10 need to be changed to f0-f10 or the f's in the foreach loop need to > be changed to n's. Thanks for catching it! It's fixed. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 15 22:56:23 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAG6uNCw004340 for ; Wed, 15 Nov 2006 22:56:23 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAG6pt7e011989 for ; Wed, 15 Nov 2006 22:51:55 -0800 Message-Id: <200611160651.kAG6pt7e011989@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW6 Date: Wed, 15 Nov 2006 22:51:55 -0800 From: william@bourbon.usc.edu Someone wrote: > I knew what x stands for, I just could not figure out which polynomial > it belongs to. I though it was in aux, but it is actually in rem. Right. The aux[] is where you read the output for the table algorithm for finding the inverse. -- Bill Cheng // bill.cheng@usc.edu On 11/15/06, william@bourbon.usc.edu wrote: > Someone wrote: > > > I don't understand following line: > > "If the coefficient for x^(5-i) is {00} at the beginning of iteration > > i, this means that the input polynomial does not have an inverse. In > > this case, you should terminate the output and prints an error message > > to stdout." > > > > What is x in the above sentence? Is it a value in the aux? > > "x" is just the *variable* used to specify the polynomial. > For example, in AES, M(x)=x^4+1 (slide 19 of lecture 17). > It's the same "x". > > > Why does it report on iteration i=5 following? > > > > i=4, rem[i]={00}{00}{00}{00}, quo[i]={00}{00}{52}{a4}, aux[i]={00}{52}{00}{52} > > {01}{02}{01}{02} does not have a multiplicative inverse. > > > > Please clarify. > > For i=4, x^(5-i) is just x. The coefficient for x is {00} in the > above line, so there is no inverse. Comparing with the example > in the spec where there is an inverse, the i=4 line looks like: > > i=4, rem[i]={00}{00}{4f}{c5}, quo[i]={00}{00}{8a}{4f}, aux[i]={00}{8f}{40}{45} > > The rem[i] is {4f}x+{c5}, so the coefficient for x is {4f}. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 15 22:42:43 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAG6ggwg003445 for ; Wed, 15 Nov 2006 22:42:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAG6cEDx011801 for ; Wed, 15 Nov 2006 22:38:14 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id kAG6cEhn011800 for csac@merlot; Wed, 15 Nov 2006 22:38:14 -0800 Date: Wed, 15 Nov 2006 22:38:14 -0800 From: william@bourbon.usc.edu Message-Id: <200611160638.kAG6cEhn011800@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: HW6 deadline approaching... Hi, If you haven't submitted anything and you are struggling with "inverse", I strongly recommend that you create something that can be submitted, submit it, verify your submission, check the grading guidelines and make sure you don't lose "silly" points. This probably worth a lot more than getting "inverse" to work and lose all your points because you have not run through the grading guidelines. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 15 22:39:06 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAG6d6G3003167 for ; Wed, 15 Nov 2006 22:39:06 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAG6YcuR011751 for ; Wed, 15 Nov 2006 22:34:38 -0800 Message-Id: <200611160634.kAG6YcuR011751@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW6 Date: Wed, 15 Nov 2006 22:34:38 -0800 From: william@bourbon.usc.edu Someone wrote: > I don't understand following line: > "If the coefficient for x^(5-i) is {00} at the beginning of iteration > i, this means that the input polynomial does not have an inverse. In > this case, you should terminate the output and prints an error message > to stdout." > > What is x in the above sentence? Is it a value in the aux? "x" is just the *variable* used to specify the polynomial. For example, in AES, M(x)=x^4+1 (slide 19 of lecture 17). It's the same "x". > Why does it report on iteration i=5 following? > > i=4, rem[i]={00}{00}{00}{00}, quo[i]={00}{00}{52}{a4}, aux[i]={00}{52}{00}{52} > {01}{02}{01}{02} does not have a multiplicative inverse. > > Please clarify. For i=4, x^(5-i) is just x. The coefficient for x is {00} in the above line, so there is no inverse. Comparing with the example in the spec where there is an inverse, the i=4 line looks like: i=4, rem[i]={00}{00}{4f}{c5}, quo[i]={00}{00}{8a}{4f}, aux[i]={00}{8f}{40}{45} The rem[i] is {4f}x+{c5}, so the coefficient for x is {4f}. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 15 21:19:27 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAG5JRWN030396 for ; Wed, 15 Nov 2006 21:19:27 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAG5ExhB010884 for ; Wed, 15 Nov 2006 21:14:59 -0800 Message-Id: <200611160514.kAG5ExhB010884@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW6 Date: Wed, 15 Nov 2006 21:14:59 -0800 From: william@bourbon.usc.edu Someone wrote: > I have a question regarding the division of polynomials. > In the example we divide {00}{00}{4f}{c5} by {00}{00}{00}{9a} and the > result is Q: {00}{00}{a8}{05}, R: {00}{00}{00}{01}. > > Why can't it be Q: {00}{00}{a8}{9a}, R: {00}{00}{00}{00} ? > > 00 00 4f c5 | 00 00 00 9a > +------------------- > 00 00 4f 00 | a8 9a > ----------------- > 00 00 00 c5 > 00 00 00 c5 > ----------------- > 00 00 00 00 > > Or is there a special rule that R must always be non-zero? Exactly! We want it to be 1. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 14 19:14:24 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAF3EO2m020672 for ; Tue, 14 Nov 2006 19:14:24 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAF3A0XQ022414 for ; Tue, 14 Nov 2006 19:10:00 -0800 Message-Id: <200611150310.kAF3A0XQ022414@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: hw6 query Date: Tue, 14 Nov 2006 19:10:00 -0800 From: william@bourbon.usc.edu Someone wrote: > In the decrypt operation of the AES, is the expanded key > vector the same as that used in the encrypt operation. If no, > then how do we compute this vector. The w[] array is the same as encryption. > So we use the inverted S-Box values to compute this vector ? > Please explain. Yes. You use exactly the KeyExpansion() algorithm on page 20 of FIPS-197 for both encryption and decryption. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 13 22:36:33 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAE6aSHA006263; Mon, 13 Nov 2006 22:36:28 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAE6W7Ws009537; Mon, 13 Nov 2006 22:32:07 -0800 Message-Id: <200611140632.kAE6W7Ws009537@bourbon.usc.edu> To: csac@merlot.usc.edu To: cs551@merlot.usc.edu Subject: FWD: FOX Interactive Media at USC 11/15/06 Date: Mon, 13 Nov 2006 22:32:07 -0800 From: william@bourbon.usc.edu Dear Students, I'm forwarding an announcement from a perspective employer. I've put a copy of their flyer/handout at: http://merlot.usc.edu/csac-f06/fox.pdf http://merlot.usc.edu/cs551-f06/fox.pdf -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Mon, 13 Nov 2006 15:41:19 -0800 From: Daria Hall To: undisclosed-recipients: Subject: FOX Interactive Media at USC 11/15/06 Hello Faculty, You and your Students are invited, Please send an email blast to your students and tell all of the students in your classes. Fox Interactive Media will be at USC on Wednesday. Are you on myspace.com? Do you know the other FOX Interactive Media groups? Looking for an exciting place to work? A division of News Corp., Fox Interactive Media (FIM) is an integrated network of sites offering socially rich media experiences centered on entertainment, news, information and self-expression. The company's network includes Internet assets from News Corp., including the highly trafficked Foxsports.com ( http://www.foxsports.com ), Americanidol.com ( http://www.americanidol.com ) and Fox.com ( http://www.fox.com ). FIM also owns and operates such category leaders as MySpace.com ( http://www.myspace.com ), the number one social networking site on the Web; Scout.com ( http://www.scout.com ), a dynamic collegiate and pro sports network; and IGN Entertainment ( http://www.ign.com ), a network of leading gaming and entertainment sites including men's lifestyle site AskMen ( http://www.askmen.com ) and premier destination for movie-goers Rotten Tomatoes ( http://www.rottentomatoes.com ) among others. Fox Interactive Media (FIM) Talent Acquisition and College Relations, will host an Information session, meet and greet on Wednesday, November 15, 2006 at USC. Please come meet and speak with hiring managers and recruiters from FIM. FIM's Information Session at USC Date: Wednesday, November 15, 2006 Time: 6:30 pm - 8:30 pm Place: USC University Club (Next door to the Marshall School of Business) Dress: Business Casual/Casual Purpose: Provide USC students with an opportunity to learn more about FIM in an informal networking fashion. Bring your resumes... Daria R. Hall College Relations and Talent Acquisition Fox Interactive Media (FIM) 407 North Maple Drive Beverly Hills, CA 90210 (310) 969-7880 daria.hall@fox.com www.foxcareers.com Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 12 21:34:23 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAD5YNZd006726 for ; Sun, 12 Nov 2006 21:34:23 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAD5U6Yo022389 for ; Sun, 12 Nov 2006 21:30:06 -0800 Message-Id: <200611130530.kAD5U6Yo022389@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: hw6 query Date: Sun, 12 Nov 2006 21:30:06 -0800 From: william@bourbon.usc.edu Someone wrote: > For tablecheck command, we need to find the product of p and > INVP; & check if its equal to 00 00 00 01. > > Both these are 3rd order polynomials. So while finding the > product, do we need to find the modular product of these, using > X^4 + 1. If no, then how to proceed ? > > Please explain. You just need to call your modprod code to find the modular product of P and INVP. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Nov 12 14:57:38 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kACMvcJZ013736 for ; Sun, 12 Nov 2006 14:57:38 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kACMrMM6018079 for ; Sun, 12 Nov 2006 14:53:22 -0800 Message-Id: <200611122253.kACMrMM6018079@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: HW6: mix columns Date: Sun, 12 Nov 2006 14:53:22 -0800 From: william@bourbon.usc.edu Someone wrote: > Thanks for pointing that our professor. > However it says in the spec that for InvMixColumns, we have to use a-1(x). > Just the way we used a(x) for MixColumns. > However I am running the grading script and in the first iteration, every > thing is fine untill I do InvMixColumns using a-1(x). > > so for ex > round[ 1].istart 67e560be37d02cf90545e2d270719739 > round[ 1].is_row 6771e23937e597d205d0603970452cbe > round[ 1].is_box 2b43db0d8eb2f74c4fc1a70d21aa1b06 > round[ 1].ik_sch 70c984db010877b8985485cfe81f3216 > round[ 1].ik_add 5b8a5fd68fba80f4d79522c2c9b52910 > ------ every thing matches till here---- > a-1(x) given in the input file is > INVP=3a544fff > > so s'(x) = a-1(x) CIRCLEX s(x) > s' [ 0 ] = > ({0xff}DOT{0x5b})^({0x3a}DOT{0x8a})^({0x54}DOT{0x5f})^({0x4f}DOT{0xd6}) = > 0xeb. > However in the script it is 0x5f. > > It is really confusing and I have no idea what to do. Any help would be > greatly appreciated. Your round[ 1].ik_add does not match what's in "f0.dec"! The 4th byte (byte 3) should be "b5", but you have "d6". Everything else looks right. If you have "b5", then you should get 0x5f in your above CIRCLEX calculation. -- Bill Cheng // bill.cheng@usc.edu On 11/11/06, william@bourbon.usc.edu wrote: > > Someone wrote: > > > I am confused regarding the mix Column operation. > > I implemented it as it was said, and I used the example in the AES > > standards document. I worked perfectly. > > However, when I am trying the grading script, it is giving wrong > results > > for this operation. I have wasted countless hours and still could not > > figure out > > whats wrong. > > So for ex, in the first iteration of the first example in the script > > round[ 0].input bc6ccc03ed51f7fc4790bc18dabbfbe5 > > round[ 0].k_sch c0ec442dfea83c54620fa12e1df2d66c > > round[ 1].start 7c80882e13f9cba8259f1d36c7492d89 > > round[ 1].s_box 785ef749483396cb9982a83c3869b2c6 > > round[ 1].s_row 7833a8c64882b2499969f7cb385e963c > > ------ Till here every thing matches ----- > > > > now to compute Mix column (using the method on slides and standard > docs) > > out[ 0 ] = ((0x78) DOT (0x02)) ^ ((0x33) DOT (0x03)) ^ 0xa8 ^ 0xc6 > > out [0] = 0xc7 > > where as the answer should be 0x6d as mentioned in the script. > > > > Please let me know what is going wrong. Specially since my code works > fine > > for the example in the standards. > > You are running: > > ./hw6 encrypt -k=$k0 -t=$srcdir/f0.tbl $srcdir/f0 > f0.enc > > In $srcdir/f0.tbl, it has: > > P=7fd582b8 > INVP=3a544fff > > This means that: > > a(x) = {7f}x^3 + {d5}x^2 + {82}x + {b8} > a^{-1}(x) = {3a}x^3 + {54}x^2 + {4f}x + {ff} > > Therefore, you need to change MixColumn accordingly. The > last sentense on page 17 of FIPS-197 says: > > s'(x) = a(x) CIRCLEX s(x) > > So, you should use the a(x) in $srcdir/f0.tbl and not {03}{01}{01}{02}. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 11 23:58:42 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAC7wgar027992 for ; Sat, 11 Nov 2006 23:58:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAC7sTcG016791 for ; Sat, 11 Nov 2006 23:54:29 -0800 Message-Id: <200611120754.kAC7sTcG016791@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSci 599 HW6 Date: Sat, 11 Nov 2006 23:54:29 -0800 From: william@bourbon.usc.edu Although what I said before was still correct, I put the bytes in the wrong places. Byte 0 of the key should go to the most significant byte of w[0]. I apologize for mis-reading the previous question. The answer to the previous question should have been that it's a bug in my solution! It worked correctly on Linux but did the wrong thing on Solaris. The bugs is fixed now. Again, sorry about this. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Wed, 08 Nov 2006 15:41:59 -0800 From: william@bourbon.usc.edu To: csac@merlot.usc.edu Subject: Re: CSci 599 HW6 Someone wrote: > I thought that the first 4 words output by the key expansion algorithm wa s > just the key itself divided into 4. For example, in the grading guideline s, > it says > > set k0=c0ec442dfea83c54620fa12e1df2d66c > > but the output of f0.ke is > > w[ 0]: 2d44ecc0 > w[ 1]: 543ca8fe > w[ 2]: 2ea10f62 > w[ 3]: 6cd6f21d > etc. > > Why isn't it: > > w[ 0]: c0ec442d > w[ 1]: fea83c54 > etc. > ? AES uses "words" (which are always 4 bytes long), and a subkey is represented as a word in AES. The convention is that when you print a word, you don't treat it like an array of bytes. You would print from the most-significant byte. While when you print something like a key, you should treat it like an array of bytes, and you would print from byte 0. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 11 23:49:12 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAC7nCgO027355 for ; Sat, 11 Nov 2006 23:49:12 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAC7ix8F016691 for ; Sat, 11 Nov 2006 23:44:59 -0800 Message-Id: <200611120744.kAC7ix8F016691@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSci 599 HW6 Date: Sat, 11 Nov 2006 23:44:59 -0800 From: william@bourbon.usc.edu Hi, I've fixed the "solutions". Hopefully, they are correct now. If you see more bugs, please let me know ASAP! -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Sat, 11 Nov 2006 15:52:35 -0800 From: william@bourbon.usc.edu To: csac@merlot.usc.edu Subject: Re: CSci 599 HW6 Someone wrote: > From the AES spec: > "This section contains the key expansion of the following cipher key: > Cipher Key = 2b 7e 15 16 28 ae d2 a6 ab f7 15 88 09 cf 4f 3c > for Nk = 4, which results in > w0 = 2b7e1516 w1 = 28aed2a6 w2 = abf71588 w3 = 09cf4f3c" > > Your example in the HW spec is: > > w[ 0]: 2b7e1516 > w[ 1]: 28aed2a6 > w[ 2]: abf71588 > > You are saying this should really be > > w[ 0]: 16157e2b > w[ 1]: a6d2ae28 > w[ 2]: 8815f7ab > > Please clarify. The AES spec is, of course, correct. I apologize for mis-reading the previous question. The answer to the previous question should have been that it's a bug in my solution! It worked correctly on Linux but did the wrong thing on Solaris. I guess it's one of those big endian / little endian bug. I'll try to get it fixed tonight. Sorry about this. -- Bill Cheng // bill.cheng@usc.edu On 11/8/06, william@bourbon.usc.edu wrote: > Someone wrote: > > > I thought that the first 4 words output by the key expansion algorit hm was > > just the key itself divided into 4. For example, in the grading guid elines, > > it says > > > > set k0=c0ec442dfea83c54620fa12e1df2d66c > > > > but the output of f0.ke is > > > > w[ 0]: 2d44ecc0 > > w[ 1]: 543ca8fe > > w[ 2]: 2ea10f62 > > w[ 3]: 6cd6f21d > > etc. > > > > Why isn't it: > > > > w[ 0]: c0ec442d > > w[ 1]: fea83c54 > > etc. > > ? > > AES uses "words" (which are always 4 bytes long), and a > subkey is represented as a word in AES. > > The convention is that when you print a word, you don't > treat it like an array of bytes. You would print from the > most-significant byte. While when you print something like > a key, you should treat it like an array of bytes, and you > would print from byte 0. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 11 23:47:52 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAC7lqcg027220 for ; Sat, 11 Nov 2006 23:47:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAC7hcWw016650 for ; Sat, 11 Nov 2006 23:43:38 -0800 Message-Id: <200611120743.kAC7hcWw016650@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: HW6 question Date: Sat, 11 Nov 2006 23:43:38 -0800 From: william@bourbon.usc.edu Hi, I've just fixed this bug in the "solutions". If you see more bugs, please let me know! -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Sat, 11 Nov 2006 19:34:05 -0800 From: william@bourbon.usc.edu To: csac@merlot.usc.edu Subject: Re: HW6 question Someone wrote: > In the spec, it says to print out the trace of how we get to the inverse . > rem[i]==....... But in the grading guidelines files, there are no traces at > all, just the answer (inverse). Should the traces go to stderr, or do we not > print them at all? This is a bug in the "solution". I'll fix them tonight. -- Bill Cheng // bill.cheng@usc.edu On 11/8/06, william@bourbon.usc.edu wrote: > > Hi, > > I've made the same mistake below. I should have said "CIRCLEX" > instead of "DOT". Sorry if this caused any confusion. > -- > Bill Cheng // bill.cheng@usc.edu > > > > -----Original Message----- > Date: Wed, 08 Nov 2006 09:46:12 -0800 > From: william@bourbon.usc.edu > To: csac@merlot.usc.edu > Subject: Re: HW6 question > > Someone wrote: > > > in the hw6 specs, in these lines > > > > i=4, rem[i]={00}{00}{4f}{c5}, quo[i]={00}{00}{8a}{4f}, > aux[i]={00}{8f}{4 > 0}{45} > > i=5, rem[i]={00}{00}{00}{9a}, quo[i]={00}{00}{f3}{ca}, > aux[i]={09}{78}{2 > 6}{cd} > > i=6, rem[i]={00}{00}{00}{01}, quo[i]={00}{00}{a8}{05}, > aux[i]={0b}{0d}{0 > 9}{0e} > > > > I want to learn how {0e} was calculated in aux[6]. The way I > > understand is that we first multiply {05} with {cd}, then subtract > the > > result from {45}. > > however, {05}*{cd}-{45} = {91} and not {0e}. > > All my previous aux values are correct, but this one is incorrect. > > To get aux[i], you should do: > > (quo[i] DOT aux[i-1]) XOR aux[i-2] > > where DOT is modular product (modprod). So, you should have: > > {00}{00}{a8}{05} DOT {09}{78}{26}{cd} = {0b}{82}{49}{4b} > {0b}{82}{49}{4b} XOR {00}{8f}{40}{45} = {0b}{0d}{09}{0e} > -- > Bill Cheng // bill.cheng@usc.edu ; Sat, 11 Nov 2006 23:21:17 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAC7H3HB016237 for ; Sat, 11 Nov 2006 23:17:03 -0800 Message-Id: <200611120717.kAC7H3HB016237@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: HW6: mix columns Date: Sat, 11 Nov 2006 23:17:03 -0800 From: william@bourbon.usc.edu Someone wrote: > I am confused regarding the mix Column operation. > I implemented it as it was said, and I used the example in the AES > standards document. I worked perfectly. > However, when I am trying the grading script, it is giving wrong results > for this operation. I have wasted countless hours and still could not > figure out > whats wrong. > So for ex, in the first iteration of the first example in the script > round[ 0].input bc6ccc03ed51f7fc4790bc18dabbfbe5 > round[ 0].k_sch c0ec442dfea83c54620fa12e1df2d66c > round[ 1].start 7c80882e13f9cba8259f1d36c7492d89 > round[ 1].s_box 785ef749483396cb9982a83c3869b2c6 > round[ 1].s_row 7833a8c64882b2499969f7cb385e963c > ------ Till here every thing matches ----- > > now to compute Mix column (using the method on slides and standard docs) > out[ 0 ] = ((0x78) DOT (0x02)) ^ ((0x33) DOT (0x03)) ^ 0xa8 ^ 0xc6 > out [0] = 0xc7 > where as the answer should be 0x6d as mentioned in the script. > > Please let me know what is going wrong. Specially since my code works fine > for the example in the standards. You are running: ./hw6 encrypt -k=$k0 -t=$srcdir/f0.tbl $srcdir/f0 > f0.enc In $srcdir/f0.tbl, it has: P=7fd582b8 INVP=3a544fff This means that: a(x) = {7f}x^3 + {d5}x^2 + {82}x + {b8} a^{-1}(x) = {3a}x^3 + {54}x^2 + {4f}x + {ff} Therefore, you need to change MixColumn accordingly. The last sentense on page 17 of FIPS-197 says: s'(x) = a(x) CIRCLEX s(x) So, you should use the a(x) in $srcdir/f0.tbl and not {03}{01}{01}{02}. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 11 19:38:18 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAC3cIkv011480 for ; Sat, 11 Nov 2006 19:38:18 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAC3Y5IZ014173 for ; Sat, 11 Nov 2006 19:34:05 -0800 Message-Id: <200611120334.kAC3Y5IZ014173@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: HW6 question Date: Sat, 11 Nov 2006 19:34:05 -0800 From: william@bourbon.usc.edu Someone wrote: > In the spec, it says to print out the trace of how we get to the inverse. > rem[i]==....... But in the grading guidelines files, there are no traces at > all, just the answer (inverse). Should the traces go to stderr, or do we not > print them at all? This is a bug in the "solution". I'll fix them tonight. -- Bill Cheng // bill.cheng@usc.edu On 11/8/06, william@bourbon.usc.edu wrote: > > Hi, > > I've made the same mistake below. I should have said "CIRCLEX" > instead of "DOT". Sorry if this caused any confusion. > -- > Bill Cheng // bill.cheng@usc.edu > > > > -----Original Message----- > Date: Wed, 08 Nov 2006 09:46:12 -0800 > From: william@bourbon.usc.edu > To: csac@merlot.usc.edu > Subject: Re: HW6 question > > Someone wrote: > > > in the hw6 specs, in these lines > > > > i=4, rem[i]={00}{00}{4f}{c5}, quo[i]={00}{00}{8a}{4f}, > aux[i]={00}{8f}{4 > 0}{45} > > i=5, rem[i]={00}{00}{00}{9a}, quo[i]={00}{00}{f3}{ca}, > aux[i]={09}{78}{2 > 6}{cd} > > i=6, rem[i]={00}{00}{00}{01}, quo[i]={00}{00}{a8}{05}, > aux[i]={0b}{0d}{0 > 9}{0e} > > > > I want to learn how {0e} was calculated in aux[6]. The way I > > understand is that we first multiply {05} with {cd}, then subtract > the > > result from {45}. > > however, {05}*{cd}-{45} = {91} and not {0e}. > > All my previous aux values are correct, but this one is incorrect. > > To get aux[i], you should do: > > (quo[i] DOT aux[i-1]) XOR aux[i-2] > > where DOT is modular product (modprod). So, you should have: > > {00}{00}{a8}{05} DOT {09}{78}{26}{cd} = {0b}{82}{49}{4b} > {0b}{82}{49}{4b} XOR {00}{8f}{40}{45} = {0b}{0d}{09}{0e} > -- > Bill Cheng // bill.cheng@usc.edu ; Sat, 11 Nov 2006 15:56:47 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kABNqZwX009546 for ; Sat, 11 Nov 2006 15:52:35 -0800 Message-Id: <200611112352.kABNqZwX009546@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSci 599 HW6 Date: Sat, 11 Nov 2006 15:52:35 -0800 From: william@bourbon.usc.edu Someone wrote: > From the AES spec: > "This section contains the key expansion of the following cipher key: > Cipher Key = 2b 7e 15 16 28 ae d2 a6 ab f7 15 88 09 cf 4f 3c > for Nk = 4, which results in > w0 = 2b7e1516 w1 = 28aed2a6 w2 = abf71588 w3 = 09cf4f3c" > > Your example in the HW spec is: > > w[ 0]: 2b7e1516 > w[ 1]: 28aed2a6 > w[ 2]: abf71588 > > You are saying this should really be > > w[ 0]: 16157e2b > w[ 1]: a6d2ae28 > w[ 2]: 8815f7ab > > Please clarify. The AES spec is, of course, correct. I apologize for mis-reading the previous question. The answer to the previous question should have been that it's a bug in my solution! It worked correctly on Linux but did the wrong thing on Solaris. I guess it's one of those big endian / little endian bug. I'll try to get it fixed tonight. Sorry about this. -- Bill Cheng // bill.cheng@usc.edu On 11/8/06, william@bourbon.usc.edu wrote: > Someone wrote: > > > I thought that the first 4 words output by the key expansion algorithm was > > just the key itself divided into 4. For example, in the grading guidelines, > > it says > > > > set k0=c0ec442dfea83c54620fa12e1df2d66c > > > > but the output of f0.ke is > > > > w[ 0]: 2d44ecc0 > > w[ 1]: 543ca8fe > > w[ 2]: 2ea10f62 > > w[ 3]: 6cd6f21d > > etc. > > > > Why isn't it: > > > > w[ 0]: c0ec442d > > w[ 1]: fea83c54 > > etc. > > ? > > AES uses "words" (which are always 4 bytes long), and a > subkey is represented as a word in AES. > > The convention is that when you print a word, you don't > treat it like an array of bytes. You would print from the > most-significant byte. While when you print something like > a key, you should treat it like an array of bytes, and you > would print from byte 0. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Nov 11 15:30:06 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kABNU5Hw025345 for ; Sat, 11 Nov 2006 15:30:06 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kABNPr2P009145 for ; Sat, 11 Nov 2006 15:25:53 -0800 Message-Id: <200611112325.kABNPr2P009145@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs 599 , inverse query Date: Sat, 11 Nov 2006 15:25:53 -0800 From: william@bourbon.usc.edu Someone wrote: > in inverse after > > i=3, rem[i]={00}{a4}{a5}{a5}, > now indorder to cancel out a4 i need find a number so that when the dot > product is calculated with 03 i get a4, is it correct? No. Saying that you want to cancel out {a4} means that you are working the i=5 row. If you are working on the i=5 row, then you need to ask what you need to multiply {4f} with since rem[5-1] = {00}{00}{4f}{c5}. If you are working on the i=4 row, then you need to ask what you need to multiply {a4} with in order to cancel out {03} in rem[2]. > the number which i get is 95( inv(03) CIRCLEX a4 ) , If you want to get {a4} from {03}, you need to calculate byte inverse of {03} DOT {a4} which is {f6} DOT {a4}. And you are correct that it's {95}. > i multiply it with > 03 01 01 02 and xor with the remainder i get {00} {00} {01} {f6} as > remainder but actually according to the spec the answer is {00}{00}{4f}{c5} > so could you please elaborate the calculation after i=3 i mean the > intermediate values apart from remainder and quo . > as before you had explained in the previous mail for values of i <= 2 I think you got it row indices backwards. You should be trying to cancel out {03} in rem[2] by multiply {a4} in rem[3] by something. Please see the Table Method on slide 8 of lecture 17 (and generalize it for polynomials with byte coefficients). So, if i=3, then: rem[3] = rem[1] % rem[2] quo[3] = rem[1] % rem[2] -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 9 23:03:52 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAA73qoa032240 for ; Thu, 9 Nov 2006 23:03:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAA6xjxK015184 for ; Thu, 9 Nov 2006 22:59:45 -0800 Message-Id: <200611100659.kAA6xjxK015184@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: HW6 question-Multiplication Date: Thu, 09 Nov 2006 22:59:45 -0800 From: william@bourbon.usc.edu Someone wrote: > Augh. The AES spec (and the lecture slides) say "For the AES algorithm, > this is accomplished with the polynomial x^4+1, so that... x^i mod(x^4 + > 1) = x^imod4." > > What is accomplished? Since we are dealing with polynomials with byte coefficients (or equivalently, coefficients in GF(2^8)), let me be more precise here. So, the polynomial in question is {01}x^4+{01}. The magic of this particial polynomial is that it makes CIRCLEX easy to compute. With this specific polynomial, you can then have the very elegant equation shown on slide 20 of lecture 17. The previous slide uses the property that with the chosen polynomial, you have: x^i mod ({01}x^4 + {01}) = x^{i mod 4} This can be used to reduce the mess from the previous page to the simple and symmetric form on slide 20. For HW6, you just need to implement CIRCLEX (or equivalently, modular product) shown on slide 20 of lecture 17. > I don't understand what the equation is telling > us. More directly, the HW6 specs reference equation 4.11 for modprod: > > d(x) = d3x^3 + d2x^2 + d1x + d0. > > Modprod has two polynomials as input. I don't see where d(x) has > anything to do with two polynomials, except in equation 4.12 below it. > Is this what is implied, that poly1=a and poly2=b in 4.12 and we should > use that to calculate d(x)? You are correct. I've just modified the spec to say: (4.11) and (4.12) So, for example, if poly1 is 03010102 and poly2 is 0b0d090e then: a3=0x03, a2=0x01, a1=0x01, a0=0x02 b3=0x0b, b2=0x0d, b1=0x09, b0=0x0e d0 = (a0 DOT b0) XOR (a3 DOT b1) XOR (a2 DOT b2) XOR (a1 DOT b3) d1 = (a1 DOT b0) XOR (a0 DOT b1) XOR (a3 DOT b2) XOR (a2 DOT b3) d2 = (a2 DOT b0) XOR (a1 DOT b1) XOR (a0 DOT b2) XOR (a3 DOT b3) d3 = (a3 DOT b0) XOR (a2 DOT b1) XOR (a1 DOT b2) XOR (a0 DOT b3) where DOT is multiplication in AES's GF(2^F) as described in section 4.2.1 of FIPS-197. In class, I've mentioned the following link for the implementation of DOT: http://en.wikipedia.org/wiki/Finite_field_arithmetic#Program_examples I don't guarantee its correctness. You should check to make sure that it actually works. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 9 15:49:40 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kA9Nne5h004457 for ; Thu, 9 Nov 2006 15:49:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kA9NjZuN010446 for ; Thu, 9 Nov 2006 15:45:35 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id kA9NjZAd010445 for csac@merlot; Thu, 9 Nov 2006 15:45:35 -0800 Date: Thu, 9 Nov 2006 15:45:35 -0800 From: william@bourbon.usc.edu Message-Id: <200611092345.kA9NjZAd010445@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: grading problem with bad makefiles... Hi, I'm going to send out the HW5 scores soon. Some of the submissions of HW5 cannot be graded because the TA cannot get the Makefile to work. The recorded score will be 1. But since the grading guidelines says: Cannot compile : -5 to -10, depending on effort to *make it work* This means that you can only lose between 5 and 10 points for a bad makefile, no matter how bad your Makefile is. So, if you have submitted a bad Makefile and got a score of 1 because we cannot grade it, please fix your Makefile and e-mail it to Alix. We will simply deduct 10 points and regrade your submission. If you have previous submissions where you got a 1 because of bad Makefile, please do the same and request for a regrade (although the regrade deadlines have passed). Sorry that this has not been made clear earlier. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 8 22:14:53 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kA96Eqkr001921 for ; Wed, 8 Nov 2006 22:14:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kA96AoeG031841 for ; Wed, 8 Nov 2006 22:10:50 -0800 Message-Id: <200611090610.kA96AoeG031841@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: HW6 question Date: Wed, 08 Nov 2006 22:10:50 -0800 From: william@bourbon.usc.edu Hi, I've made the same mistake below. I should have said "CIRCLEX" instead of "DOT". Sorry if this caused any confusion. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Wed, 08 Nov 2006 09:46:12 -0800 From: william@bourbon.usc.edu To: csac@merlot.usc.edu Subject: Re: HW6 question Someone wrote: > in the hw6 specs, in these lines > > i=4, rem[i]={00}{00}{4f}{c5}, quo[i]={00}{00}{8a}{4f}, aux[i]={00}{8f}{4 0}{45} > i=5, rem[i]={00}{00}{00}{9a}, quo[i]={00}{00}{f3}{ca}, aux[i]={09}{78}{2 6}{cd} > i=6, rem[i]={00}{00}{00}{01}, quo[i]={00}{00}{a8}{05}, aux[i]={0b}{0d}{0 9}{0e} > > I want to learn how {0e} was calculated in aux[6]. The way I > understand is that we first multiply {05} with {cd}, then subtract the > result from {45}. > however, {05}*{cd}-{45} = {91} and not {0e}. > All my previous aux values are correct, but this one is incorrect. To get aux[i], you should do: (quo[i] DOT aux[i-1]) XOR aux[i-2] where DOT is modular product (modprod). So, you should have: {00}{00}{a8}{05} DOT {09}{78}{26}{cd} = {0b}{82}{49}{4b} {0b}{82}{49}{4b} XOR {00}{8f}{40}{45} = {0b}{0d}{09}{0e} -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 8 22:13:16 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kA96DGpV001777 for ; Wed, 8 Nov 2006 22:13:16 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kA969ElM031770 for ; Wed, 8 Nov 2006 22:09:14 -0800 Message-Id: <200611090609.kA969ElM031770@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: HW6 question In-reply-to: <200611090406.kA946J5o030516@bourbon.usc.edu> References: <200611090406.kA946J5o030516@bourbon.usc.edu> Comments: In-reply-to william@bourbon.usc.edu message dated "Wed, 08 Nov 2006 20:06:19 -0800." Date: Wed, 08 Nov 2006 22:09:14 -0800 From: william@bourbon.usc.edu Hi, Just a minor correction. I should have been more careful with notations. I keep using "DOT" when I should have said "CIRCLEX". When multiplying two 4-terms polynomials, I should say "CIRCLEX". So, quo[3] CIRCLEX aux[2] = {00}{00}{f6}{52} CIRCLEX {00}{00}{00}{01} = {00}{00}{f6}{52}. By the way, I also wrote: {03}{01}{01}{02} DOT {f6} is {01}{f6}{f6}{f7}. This is okay since I'm doing DOT term-by-term. According to the definition of CIRCLEX (slide 20 of lecture 17), it would be the same as saying: {03}{01}{01}{02} CIRCLEX {00}{00}{00}{f6} = {01}{f6}{f6}{f7} since all the zero terms disappear. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Wed, 08 Nov 2006 20:06:19 -0800 From: william@bourbon.usc.edu To: csac@merlot.usc.edu Subject: Re: HW6 question Someone wrote: > I am very confused about finding the quo's, I have been unsuccessfully > trying to figure it out. In this example: > > i=1, rem[i]={00}{00}{00}{01}, quo[i]={00}{00}{00}{00}, aux[i]={00}{00}{0 0}{00} > i=2, rem[i]={03}{01}{01}{02}, quo[i]={00}{00}{00}{00}, aux[i]={00}{00}{0 0}{01} > i=3, rem[i]={00}{a4}{a5}{a5}, quo[i]={00}{00}{f6}{52}, aux[i]={00}{00}{f 6}{52} > > Where does f652 come from?? What is 03010102 being multiplied/divided by ? This is analagous to long-hand division with decimal numbers. For example, if you try to divide the decimal number 12345 by 375, you can write: 12345 | 375 -------+----- So, first you would divide 1234 by 375, and you'd get a quotient of 3 and a remainder of 109 with 3*375=1125. So you can write: 12345 | 375 1125 | 3 -------+----- 1095 | Notice that the 5 from 12345 got copied downward. Now, dividing 1095 by 375, you'd get a quotient of 2 and a remainder of 345 with 2*375=750. So you can write: 12345 | 375 1125 | 32 -------+----- 1095 | 750 | -------+----- 345 | Since 345 is less than 375, we are done. Now, with polynomials with coefficients in GF(2^8), it's a bit different. Since +x and -x are identical (both are done with XOR), even if you have {01}{xx} dividing {76}{yy}, you can take one more step because you can find something to multiply {76} with and get {01}. So, let's start from the top: {01}{00}{00}{00}{01} | {03}{01}{01}{02} ----------------------+------------------ So, first you divide {01}{00}{00}{00} by {03}{01}{01}{02}. What do you need to multiply {03} with to knock out the first {01} term? The answer is the multiplicative inverse of {03}. From the table given in the spec, that would be {f6}. Since you are multiplying {03} by {f6}, you need to multiple everything by {f6}. So, {03}{01}{01}{02} DOT {f6} is {01}{f6}{f6}{f7}. So, you can write: {01}{00}{00}{00}{01} | {03}{01}{01}{02} {01}{f6}{f6}{f7} | {f6} ----------------------+------------------ {f6}{f6}{f7}{01} | Notice that the last {01} from the original polynomal got copied downward. Now, you need to divide {f6}{f6}{f7}{01} by {03}{01}{01}{02}. What can you multiply {03} with to knock out {f6}? You know that if you multiply {03} by {f6}, you'd get {01}. So, if you multiple {03} by {f6} and then by {f6} again, you will get {f6}. So, {f6} DOT {f6} = {52}. So, multiplying every term in {03}{01}{01}{02} by {52}, you'd get {f6}{52}{52}{a4}. So, you can write: {01}{00}{00}{00}{01} | {03}{01}{01}{02} {01}{f6}{f6}{f7} | {f6}{52} <-- this is quo[3] ----------------------+------------------ {f6}{f6}{f7}{01} | {f6}{52}{52}{a4} | ----------------------+------------------ {a4}{a5}{a5} | <-- this is rem[3] To get aux[3], you multiple quo[3] by aux[2] and XOR with aux[1]. quo[3] DOT aux[2] = {00}{00}{f6}{52} DOT {00}{00}{00}{01} = {00}{00}{f6}{52}. If you XOR {00}{00}{f6}{52} with all zeroes, you get {00}{00}{f6}{52}. Therefore, aux[3] is {00}{00}{f6}{52}. Below, I'm listing the byte inverse table so it's easier to read (this is the same table in the spec with space added): | 0 1 2 3 4 5 6 7 8 9 a b c d e f --+------------------------------------------------- 0 | 00 01 8d f6 cb 52 7b d1 e8 4f 29 c0 b0 e1 e5 c7 1 | 74 b4 aa 4b 99 2b 60 5f 58 3f fd cc ff 40 ee b2 2 | 3a 6e 5a f1 55 4d a8 c9 c1 0a 98 15 30 44 a2 c2 3 | 2c 45 92 6c f3 39 66 42 f2 35 20 6f 77 bb 59 19 4 | 1d fe 37 67 2d 31 f5 69 a7 64 ab 13 54 25 e9 09 5 | ed 5c 05 ca 4c 24 87 bf 18 3e 22 f0 51 ec 61 17 6 | 16 5e af d3 49 a6 36 43 f4 47 91 df 33 93 21 3b 7 | 79 b7 97 85 10 b5 ba 3c b6 70 d0 06 a1 fa 81 82 8 | 83 7e 7f 80 96 73 be 56 9b 9e 95 d9 f7 02 b9 a4 9 | de 6a 32 6d d8 8a 84 72 2a 14 9f 88 f9 dc 89 9a a | fb 7c 2e c3 8f b8 65 48 26 c8 12 4a ce e7 d2 62 b | 0c e0 1f ef 11 75 78 71 a5 8e 76 3d bd bc 86 57 c | 0b 28 2f a3 da d4 e4 0f a9 27 53 04 1b fc ac e6 d | 7a 07 ae 63 c5 db e2 ea 94 8b c4 d5 9d f8 90 6b e | b1 0d d6 eb c6 0e cf ad 08 4e d7 e3 5d 50 1e b3 f | 5b 23 38 34 68 46 03 8c dd 9c 7d a0 cd 1a 41 1c -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 8 20:11:25 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kA94BP8j026455 for ; Wed, 8 Nov 2006 20:11:25 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kA947NEm030546 for ; Wed, 8 Nov 2006 20:07:23 -0800 Message-Id: <200611090407.kA947NEm030546@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW6 Date: Wed, 08 Nov 2006 20:07:23 -0800 From: william@bourbon.usc.edu Someone wrote: > AFAIU for encrypt/decrypt commands we process only first 16 bytes and > not more. Is that ok? It is *required* that you do not process beyond the first 16 bytes of input. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 8 20:10:21 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kA94ALYg026439 for ; Wed, 8 Nov 2006 20:10:21 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kA946J5o030516 for ; Wed, 8 Nov 2006 20:06:19 -0800 Message-Id: <200611090406.kA946J5o030516@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: HW6 question Date: Wed, 08 Nov 2006 20:06:19 -0800 From: william@bourbon.usc.edu Someone wrote: > I am very confused about finding the quo's, I have been unsuccessfully > trying to figure it out. In this example: > > i=1, rem[i]={00}{00}{00}{01}, quo[i]={00}{00}{00}{00}, aux[i]={00}{00}{00}{00} > i=2, rem[i]={03}{01}{01}{02}, quo[i]={00}{00}{00}{00}, aux[i]={00}{00}{00}{01} > i=3, rem[i]={00}{a4}{a5}{a5}, quo[i]={00}{00}{f6}{52}, aux[i]={00}{00}{f6}{52} > > Where does f652 come from?? What is 03010102 being multiplied/divided by? This is analagous to long-hand division with decimal numbers. For example, if you try to divide the decimal number 12345 by 375, you can write: 12345 | 375 -------+----- So, first you would divide 1234 by 375, and you'd get a quotient of 3 and a remainder of 109 with 3*375=1125. So you can write: 12345 | 375 1125 | 3 -------+----- 1095 | Notice that the 5 from 12345 got copied downward. Now, dividing 1095 by 375, you'd get a quotient of 2 and a remainder of 345 with 2*375=750. So you can write: 12345 | 375 1125 | 32 -------+----- 1095 | 750 | -------+----- 345 | Since 345 is less than 375, we are done. Now, with polynomials with coefficients in GF(2^8), it's a bit different. Since +x and -x are identical (both are done with XOR), even if you have {01}{xx} dividing {76}{yy}, you can take one more step because you can find something to multiply {76} with and get {01}. So, let's start from the top: {01}{00}{00}{00}{01} | {03}{01}{01}{02} ----------------------+------------------ So, first you divide {01}{00}{00}{00} by {03}{01}{01}{02}. What do you need to multiply {03} with to knock out the first {01} term? The answer is the multiplicative inverse of {03}. From the table given in the spec, that would be {f6}. Since you are multiplying {03} by {f6}, you need to multiple everything by {f6}. So, {03}{01}{01}{02} DOT {f6} is {01}{f6}{f6}{f7}. So, you can write: {01}{00}{00}{00}{01} | {03}{01}{01}{02} {01}{f6}{f6}{f7} | {f6} ----------------------+------------------ {f6}{f6}{f7}{01} | Notice that the last {01} from the original polynomal got copied downward. Now, you need to divide {f6}{f6}{f7}{01} by {03}{01}{01}{02}. What can you multiply {03} with to knock out {f6}? You know that if you multiply {03} by {f6}, you'd get {01}. So, if you multiple {03} by {f6} and then by {f6} again, you will get {f6}. So, {f6} DOT {f6} = {52}. So, multiplying every term in {03}{01}{01}{02} by {52}, you'd get {f6}{52}{52}{a4}. So, you can write: {01}{00}{00}{00}{01} | {03}{01}{01}{02} {01}{f6}{f6}{f7} | {f6}{52} <-- this is quo[3] ----------------------+------------------ {f6}{f6}{f7}{01} | {f6}{52}{52}{a4} | ----------------------+------------------ {a4}{a5}{a5} | <-- this is rem[3] To get aux[3], you multiple quo[3] by aux[2] and XOR with aux[1]. quo[3] DOT aux[2] = {00}{00}{f6}{52} DOT {00}{00}{00}{01} = {00}{00}{f6}{52}. If you XOR {00}{00}{f6}{52} with all zeroes, you get {00}{00}{f6}{52}. Therefore, aux[3] is {00}{00}{f6}{52}. Below, I'm listing the byte inverse table so it's easier to read (this is the same table in the spec with space added): | 0 1 2 3 4 5 6 7 8 9 a b c d e f --+------------------------------------------------- 0 | 00 01 8d f6 cb 52 7b d1 e8 4f 29 c0 b0 e1 e5 c7 1 | 74 b4 aa 4b 99 2b 60 5f 58 3f fd cc ff 40 ee b2 2 | 3a 6e 5a f1 55 4d a8 c9 c1 0a 98 15 30 44 a2 c2 3 | 2c 45 92 6c f3 39 66 42 f2 35 20 6f 77 bb 59 19 4 | 1d fe 37 67 2d 31 f5 69 a7 64 ab 13 54 25 e9 09 5 | ed 5c 05 ca 4c 24 87 bf 18 3e 22 f0 51 ec 61 17 6 | 16 5e af d3 49 a6 36 43 f4 47 91 df 33 93 21 3b 7 | 79 b7 97 85 10 b5 ba 3c b6 70 d0 06 a1 fa 81 82 8 | 83 7e 7f 80 96 73 be 56 9b 9e 95 d9 f7 02 b9 a4 9 | de 6a 32 6d d8 8a 84 72 2a 14 9f 88 f9 dc 89 9a a | fb 7c 2e c3 8f b8 65 48 26 c8 12 4a ce e7 d2 62 b | 0c e0 1f ef 11 75 78 71 a5 8e 76 3d bd bc 86 57 c | 0b 28 2f a3 da d4 e4 0f a9 27 53 04 1b fc ac e6 d | 7a 07 ae 63 c5 db e2 ea 94 8b c4 d5 9d f8 90 6b e | b1 0d d6 eb c6 0e cf ad 08 4e d7 e3 5d 50 1e b3 f | 5b 23 38 34 68 46 03 8c dd 9c 7d a0 cd 1a 41 1c -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 8 15:46:00 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kA8Nk0ib009405 for ; Wed, 8 Nov 2006 15:46:00 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kA8NfxgF027243 for ; Wed, 8 Nov 2006 15:41:59 -0800 Message-Id: <200611082341.kA8NfxgF027243@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSci 599 HW6 Date: Wed, 08 Nov 2006 15:41:59 -0800 From: william@bourbon.usc.edu Someone wrote: > I thought that the first 4 words output by the key expansion algorithm was > just the key itself divided into 4. For example, in the grading guidelines, > it says > > set k0=c0ec442dfea83c54620fa12e1df2d66c > > but the output of f0.ke is > > w[ 0]: 2d44ecc0 > w[ 1]: 543ca8fe > w[ 2]: 2ea10f62 > w[ 3]: 6cd6f21d > etc. > > Why isn't it: > > w[ 0]: c0ec442d > w[ 1]: fea83c54 > etc. > ? AES uses "words" (which are always 4 bytes long), and a subkey is represented as a word in AES. The convention is that when you print a word, you don't treat it like an array of bytes. You would print from the most-significant byte. While when you print something like a key, you should treat it like an array of bytes, and you would print from byte 0. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 8 10:01:40 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kA8I1aGd020204; Wed, 8 Nov 2006 10:01:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kA8HvZNe017605; Wed, 8 Nov 2006 09:57:35 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id kA8HvZhA017604; Wed, 8 Nov 2006 09:57:35 -0800 Date: Wed, 8 Nov 2006 09:57:35 -0800 From: william@bourbon.usc.edu Message-Id: <200611081757.kA8HvZhA017604@bourbon.usc.edu> To: cs551@merlot.usc.edu, csac@merlot.usc.edu Subject: if you would like to discuss your midterm exam today... Hi, I'm in my office (SAL 228) most of the day today between 10am and 4pm (I'll be out to lunch probably between noone and 12:30pm). If you would like to discuss your midterm, you are welcome to come by. If you would like to make sure that I'm in the office, please send me an e-mail to let me know when you plan to come by. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Nov 8 09:50:14 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kA8HoEue019559 for ; Wed, 8 Nov 2006 09:50:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kA8HkCR6017414 for ; Wed, 8 Nov 2006 09:46:12 -0800 Message-Id: <200611081746.kA8HkCR6017414@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: HW6 question Date: Wed, 08 Nov 2006 09:46:12 -0800 From: william@bourbon.usc.edu Someone wrote: > in the hw6 specs, in these lines > > i=4, rem[i]={00}{00}{4f}{c5}, quo[i]={00}{00}{8a}{4f}, aux[i]={00}{8f}{40}{45} > i=5, rem[i]={00}{00}{00}{9a}, quo[i]={00}{00}{f3}{ca}, aux[i]={09}{78}{26}{cd} > i=6, rem[i]={00}{00}{00}{01}, quo[i]={00}{00}{a8}{05}, aux[i]={0b}{0d}{09}{0e} > > I want to learn how {0e} was calculated in aux[6]. The way I > understand is that we first multiply {05} with {cd}, then subtract the > result from {45}. > however, {05}*{cd}-{45} = {91} and not {0e}. > All my previous aux values are correct, but this one is incorrect. To get aux[i], you should do: (quo[i] DOT aux[i-1]) XOR aux[i-2] where DOT is modular product (modprod). So, you should have: {00}{00}{a8}{05} DOT {09}{78}{26}{cd} = {0b}{82}{49}{4b} {0b}{82}{49}{4b} XOR {00}{8f}{40}{45} = {0b}{0d}{09}{0e} -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 7 16:02:14 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kA802EEx016232 for ; Tue, 7 Nov 2006 16:02:14 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kA7NwGqr006359 for ; Tue, 7 Nov 2006 15:58:16 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id kA7NwGMU006358 for csac@merlot; Tue, 7 Nov 2006 15:58:16 -0800 Date: Tue, 7 Nov 2006 15:58:16 -0800 From: william@bourbon.usc.edu Message-Id: <200611072358.kA7NwGMU006358@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: confusion about x and y in today's lecture... Hi, When we ran through the Table Method in class today, there was this question about which column has the inverse. Here's what's going on... Using the table method, we can start with the following: rem x y a 0 1 b 1 0 where a > b. Recall that the extended Euclidean algorithm is to calculate x, y, and d for ax + by = d where a > b. Therefore, if we are trying to get multiplicative inverse of a number m modulo p, we just have to figure out where m is. If m is a, then we need to look at the x column. If m is b, then we need to look at the y column. That's it! How do you know if m is a or b? Well, if m > p, then m is a and p is b. If m < p, then m is b and p is a. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 7 10:14:53 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kA7IErch026113 for ; Tue, 7 Nov 2006 10:14:53 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kA7IAu7u003075 for ; Tue, 7 Nov 2006 10:10:56 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id kA7IAu9W003074 for csac@merlot; Tue, 7 Nov 2006 10:10:56 -0800 Date: Tue, 7 Nov 2006 10:10:56 -0800 From: william@bourbon.usc.edu Message-Id: <200611071810.kA7IAu9W003074@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: HW6 extension... Hi, I'm extending the HW6 deadline by two days! The reason is that I'm having trouble getting HW7 spec done by the HW6 submission deadline. I have also changed the title of HW7 from "primes & RSA" to just "primes". As it turns out, after writing the code to generate primes, it's trivial to do RSA. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 3 21:06:23 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kA456NwX015638 for ; Fri, 3 Nov 2006 21:06:23 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kA452dtW017387 for ; Fri, 3 Nov 2006 21:02:39 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id kA452dp9017386 for csac@merlot; Fri, 3 Nov 2006 21:02:39 -0800 Date: Fri, 3 Nov 2006 21:02:39 -0800 From: william@bourbon.usc.edu Message-Id: <200611040502.kA452dp9017386@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: minor spec change for HW6... Hi, I just realized that I should not have used "DOT" in modprod. It's more appropriate to say "CIRCLEX" since the symbol for modular product is a circle with an X in it. I just modified the spec to change "DOT" to "CIRCLEX". I will update the solutions soon. For the "algorithm" of modular product, please see slide 20 of lecture 17. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 3 20:59:03 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kA44x3Pp015068 for ; Fri, 3 Nov 2006 20:59:03 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kA44tJQ8017299 for ; Fri, 3 Nov 2006 20:55:19 -0800 Message-Id: <200611040455.kA44tJQ8017299@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW6 Date: Fri, 03 Nov 2006 20:55:19 -0800 From: william@bourbon.usc.edu Someone wrote: > could u pl guide me with the foll > > is the polynomial P in the table file to be applied while mixing columns ? Yes. > or > what is the significance of polynomial P in table file ?? The spec says: P : This table contains a hexstring of length 8 which corresponds to 4 byte of binary values. Each byte is a coefficient of the a(x) polynomial in the MixColumns() transformation. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 3 13:48:49 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kA3LmnFL020154 for ; Fri, 3 Nov 2006 13:48:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kA3Lj6Yg011079 for ; Fri, 3 Nov 2006 13:45:06 -0800 Message-Id: <200611032145.kA3Lj6Yg011079@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW6 Date: Fri, 03 Nov 2006 13:45:06 -0800 From: william@bourbon.usc.edu Hi, I have added these files. I have also fixed the points so that they add up to be 100 positive points. Sorry about the delay. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Fri, 03 Nov 2006 07:12:43 -0800 From: william@bourbon.usc.edu To: csac@merlot.usc.edu Subject: Re: CSCI599 HW6 Someone wrote: > I can't test following from the grading guidelines: > > ./hw6 tablecheck -t=$srcdir/f200.tbl > (invalid S-box, wrong number of entries) > ./hw6 tablecheck -t=$srcdir/f201.tbl > (invalid S-box, repeated entries) > ./hw6 tablecheck -t=$srcdir/f202.tbl > (invalid P, too many terms in the poly) > ./hw6 tablecheck -t=$srcdir/f203.tbl > (missing INVP) > ./hw6 tablecheck -t=$srcdir/f204.tbl > (invalid characters in P) > > Table files do not exist. Oops! I haven't created them. I'll do it today. Thanks for letting me know. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 3 07:16:25 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kA3FGP7e027850 for ; Fri, 3 Nov 2006 07:16:25 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kA3FChTp006952 for ; Fri, 3 Nov 2006 07:12:43 -0800 Message-Id: <200611031512.kA3FChTp006952@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW6 Date: Fri, 03 Nov 2006 07:12:43 -0800 From: william@bourbon.usc.edu Someone wrote: > I can't test following from the grading guidelines: > > ./hw6 tablecheck -t=$srcdir/f200.tbl > (invalid S-box, wrong number of entries) > ./hw6 tablecheck -t=$srcdir/f201.tbl > (invalid S-box, repeated entries) > ./hw6 tablecheck -t=$srcdir/f202.tbl > (invalid P, too many terms in the poly) > ./hw6 tablecheck -t=$srcdir/f203.tbl > (missing INVP) > ./hw6 tablecheck -t=$srcdir/f204.tbl > (invalid characters in P) > > Table files do not exist. Oops! I haven't created them. I'll do it today. Thanks for letting me know. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 2 23:57:39 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kA37vdYO029981 for ; Thu, 2 Nov 2006 23:57:39 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kA37rw7U031577 for ; Thu, 2 Nov 2006 23:53:58 -0800 Message-Id: <200611030753.kA37rw7U031577@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] HW6 query Date: Thu, 02 Nov 2006 23:53:58 -0800 From: william@bourbon.usc.edu Someone wrote: > Could you please guide me with the foll. > > 1- Is Rcon[i / Nk] , always of the form > (RC[i],‘00’,‘00’,‘00’) ,so while > using this in xoring the word is XX000000 > where XX = RC[i] . Yes. Please see pages 27 and 28 of the AES spec. It has all the values of Rcon[i/Nk]. You can hardcode it if you'd like. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 2 18:41:49 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kA32fnCC007503 for ; Thu, 2 Nov 2006 18:41:49 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kA32c8KT028599 for ; Thu, 2 Nov 2006 18:38:08 -0800 Message-Id: <200611030238.kA32c8KT028599@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] HW6 questions Date: Thu, 02 Nov 2006 18:38:08 -0800 From: william@bourbon.usc.edu Someone wrote: > 1. What are the limitations if any on the public source code/libraries > that we can use besides the explicit citation requirement? None! > 2. The plus points in the grading guidelines only add up to 60 points, > but the assignment is worth 100 points. Oops! Thanks for catching this. I'll adjust the points soon. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Nov 2 13:08:18 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kA2L8Hkc018668 for ; Thu, 2 Nov 2006 13:08:17 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kA2L4cwR024700 for ; Thu, 2 Nov 2006 13:04:38 -0800 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id kA2L4cjp024699 for csac@merlot; Thu, 2 Nov 2006 13:04:38 -0800 Date: Thu, 2 Nov 2006 13:04:38 -0800 From: william@bourbon.usc.edu Message-Id: <200611022104.kA2L4cjp024699@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: class canceled today (11/02/2006) Hi, I'm sorry about the short notice, but I have to cancel class today due to family emergency. I will be leaving my office hour today at 1:45pm promptly. If you have questions regarding HW6, please send me e-mail. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 30 22:19:55 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9V6JttL021445 for ; Mon, 30 Oct 2006 22:19:55 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9V6GPKA003625 for ; Mon, 30 Oct 2006 22:16:25 -0800 Message-Id: <200610310616.k9V6GPKA003625@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: encrypt3 Date: Mon, 30 Oct 2006 22:16:25 -0800 From: william@bourbon.usc.edu Someone wrote: > It is kind of late to ask, > for triple des: > I am trying to use the first 8 hex char in the 24hex long key for first enc, > second 8 for second etc. However i am getting the results to be incorrect, > so I was wondering if I have to do it in some other order. I assume you meant first 8 bytes (which is 16 hex characters long). The first 8 bytes are for the first key, the 2nd 8 bytes are for the 2nd key, and the 3rd 8 bytes are for the 3rd key. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 30 21:33:50 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9V5XoDM018405 for ; Mon, 30 Oct 2006 21:33:50 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9V5UK6E002275 for ; Mon, 30 Oct 2006 21:30:20 -0800 Message-Id: <200610310530.k9V5UK6E002275@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci599 : Weak keys Date: Mon, 30 Oct 2006 21:30:20 -0800 From: william@bourbon.usc.edu Someone wrote: > Regarding the weak keys, is it that the keys mentioned in > the slides/grading guidelines are the only weak or semi-weak keys > Or is it the pattern that we are talkin about.. > Becoz then we can just do a string compare to all the i/p > keys and the weak keys to check if they are weak or not. Since we can change the tablefile, you should not do a string compare. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 30 21:31:59 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9V5VxZn018272 for ; Mon, 30 Oct 2006 21:31:59 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9V5ST4c002225 for ; Mon, 30 Oct 2006 21:28:29 -0800 Message-Id: <200610310528.k9V5ST4c002225@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] HW5 Date: Mon, 30 Oct 2006 21:28:29 -0800 From: william@bourbon.usc.edu Someone wrote: > I am generating the keys for decryption by rotating the bits > right (instead of left) during the key scheduling. Slide 7 of lecture 16 says that you need to circular left shifts. > Your outputs expect the keys to be in the same order as that of > the decryption. For DES, you need to run exactly the same key scheduling algorithm whether you are doing encryption or decryption. > Though my outputs are matching, my keys K1 to K16 are in the > exact reverse order of that expected by you. > > The diff shows a difference for the err files because of the > ordering. > > I know my method is not wrong as i am gettign the encryption / > decryption correct? > > Is the difference acceptable? Do i need to generate keys in the > order expected by you? The grading guidelines said that if it doesn't match, you will not get the credit. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 30 21:20:22 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9V5KM8P017628 for ; Mon, 30 Oct 2006 21:20:22 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9V5GqjR002107 for ; Mon, 30 Oct 2006 21:16:52 -0800 Message-Id: <200610310516.k9V5GqjR002107@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: tablefile Date: Mon, 30 Oct 2006 21:16:52 -0800 From: william@bourbon.usc.edu > If we just print the message saying error in line only , > not the exact location or reason?? If you use a software like that, what would you think? Good user interface? Bad user interface? It should be very easy to give good error report. When you decide to reject a line, you know exactly why you were rejecting it. Just report why you reject it. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Monday, October 30, 2006 7:53 pm Subject: Re: Semi-weak keys To: csac@merlot.usc.edu > Someone wrote: > > > According to the specs: "Use the palidromic (and anti-palindromic) > > definition. If key is weak or semi-weak, please print an error > message > and only the subkeys." > > > > So since palindromic means k1=k16, k2=k15, k3=k14... > > And anti-palidromic means k1=~k16, k2=~k15, k3=~k14... > > > > can you confirm that this means we do NOT need to test for the > remaining > 8 weak sub-keys that are not anti-palidromic? > > Correct. That's what I mentioned in my message with timestamp > "Sat 28 Oct 16:15". > -- > Bill Cheng // bill.cheng@usc.edu > > > > > > -----Original Message----- > > From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] > > Sent: Sunday, October 29, 2006 6:45 PM > > To: csac@merlot.usc.edu > > Subject: Re: Semi-weak keys > > > > Someone wrote: > > > > > Yes, I've seen that, but I'm not following what the '~' > means. > > > > On that slide, it means bit complement. > > -- > > Bill Cheng // bill.cheng@usc.edu > > > > > > > > > > -----Original Message----- > > From: william@bourbon.usc.edu > [mailto:william@bourbon.usc.edu] > > Sent: Sunday, October 29, 2006 6:33 PM > > To: csac@merlot.usc.edu > > Subject: Re: Semi-weak keys > > > > Someone wrote: > > > > > I'm still a little unclear as to what a semi-weak key > looks like. > > > > > For weak keys, the 16 48-bit sub-keys exhibit the > property k1=k16, > > > k2=k15, k3=k14...k16=k1. How do you tell what a semi-weak > key is? > > > > k1=~k16, k2=~k15, ... Please see slide 13 of lecture 16. > > -- > > Bill Cheng // bill.cheng@usc.edu > > Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 30 19:54:36 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9V3savG012189 for ; Mon, 30 Oct 2006 19:54:36 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9V3p6pc001251 for ; Mon, 30 Oct 2006 19:51:06 -0800 Message-Id: <200610310351.k9V3p6pc001251@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Semi-weak keys Date: Mon, 30 Oct 2006 19:51:06 -0800 From: william@bourbon.usc.edu Someone wrote: > According to the specs: "Use the palidromic (and anti-palindromic) > definition. If key is weak or semi-weak, please print an error message > and only the subkeys." > > So since palindromic means k1=k16, k2=k15, k3=k14... > And anti-palidromic means k1=~k16, k2=~k15, k3=~k14... > > can you confirm that this means we do NOT need to test for the remaining > 8 weak sub-keys that are not anti-palidromic? Correct. That's what I mentioned in my message with timestamp "Sat 28 Oct 16:15". -- Bill Cheng // bill.cheng@usc.edu > -----Original Message----- > From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] > Sent: Sunday, October 29, 2006 6:45 PM > To: csac@merlot.usc.edu > Subject: Re: Semi-weak keys > > Someone wrote: > > > Yes, I've seen that, but I'm not following what the '~' means. > > On that slide, it means bit complement. > -- > Bill Cheng // bill.cheng@usc.edu > > > > > -----Original Message----- > From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] > Sent: Sunday, October 29, 2006 6:33 PM > To: csac@merlot.usc.edu > Subject: Re: Semi-weak keys > > Someone wrote: > > > I'm still a little unclear as to what a semi-weak key looks like. > > > For weak keys, the 16 48-bit sub-keys exhibit the property k1=k16, > > k2=k15, k3=k14...k16=k1. How do you tell what a semi-weak key is? > > k1=~k16, k2=~k15, ... Please see slide 13 of lecture 16. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 30 19:49:59 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9V3nxNa011777 for ; Mon, 30 Oct 2006 19:49:59 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9V3kUos001174 for ; Mon, 30 Oct 2006 19:46:30 -0800 Message-Id: <200610310346.k9V3kUos001174@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci 599 : Weak keys Date: Mon, 30 Oct 2006 19:46:30 -0800 From: william@bourbon.usc.edu Someone wrote: > Do the weak keys matter in case of 3DES ? Yes. > If yes, then we have to account for it in the assgn as well Well, the grading guidelines only test these keys with the encript and decrypt commands. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 30 13:56:00 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9ULu0Po021760 for ; Mon, 30 Oct 2006 13:56:00 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9ULqVP8030104 for ; Mon, 30 Oct 2006 13:52:32 -0800 Message-Id: <200610302152.k9ULqVP8030104@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: HW5 Date: Mon, 30 Oct 2006 13:52:31 -0800 From: william@bourbon.usc.edu Someone wrote: > Is running time a factor for grading? My program produces the > correct outputs, but it runs fairly slow. About 1 minute for > encrypt/decrypt and 2-3 minutes for encrypt3/decrypt3. Running is not a factor. If it takes a long time to run, please make sure you document it in your README file. No points will be deducted. > Also, when compiling, is the -g flag required? I know -Wall is, > but what about -g? No. But it doesn't hurt either. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 30 10:56:58 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9UIuwYX010245 for ; Mon, 30 Oct 2006 10:56:58 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9UIrTJ7028063 for ; Mon, 30 Oct 2006 10:53:29 -0800 Message-Id: <200610301853.k9UIrTJ7028063@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: HW5 Date: Mon, 30 Oct 2006 10:53:29 -0800 From: william@bourbon.usc.edu Someone wrote: > So, just to be sure, when we encounter weak or semi-keys, we are only to > output Ci,Di,and,Ki (not Li, Ri) and display an error message. Exactly. > I assume > this also means we do not process the input. Can you verify? Thanks. Correct. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 30 10:53:52 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9UIrqAj009987 for ; Mon, 30 Oct 2006 10:53:52 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9UIoN6k027987 for ; Mon, 30 Oct 2006 10:50:23 -0800 Message-Id: <200610301850.k9UIoN6k027987@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS599: encrypt3/decrypt3 stderr? Date: Mon, 30 Oct 2006 10:50:23 -0800 From: william@bourbon.usc.edu Someone wrote: > > Please do not do that. You should let the user controls it > > as demonstrated in the grading guidelines. > > Do not do what? > Let the user control what? > The program should not be printing C,D and L,R sets or anything else > besides error messages to stderr for the encrypt3/decrypt3. > > (http://merlot.usc.edu/csac-f06/msgs/bill/157) > > Please clarify. Oh! I though you were only asking about "pipe it to /dev/null automatically". So, I was replying that you should not do that. If the user wants to pipe stderr to /dev/null, he/she should have control over that. You should print C,D and L,R as in encrypt and decrypt to stderr (so you don't need to modify code there). But this conflicts with what I said in message 157 above. In message 157, I missed the question about encrypt3/decrypt3 and thought it was a general question. My mistake! So, you can do it either way and there is no penalty (which is what the grading guidelines is doing anyway). Sorry about the mistake. -- Bill Cheng // bill.cheng@usc.edu On 10/30/06, william@bourbon.usc.edu wrote: > Someone wrote: > > > Should I output the 3 different C,D and L,R sets for the encrypt3/decrypt3, > > or just pipe it to /dev/null automatically? > > Please do not do that. You should let the user controls it > as demonstrated in the grading guidelines. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 30 09:51:51 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9UHppOi005987 for ; Mon, 30 Oct 2006 09:51:51 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9UHmNTo027061 for ; Mon, 30 Oct 2006 09:48:23 -0800 Message-Id: <200610301748.k9UHmNTo027061@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS599: encrypt3/decrypt3 stderr? Date: Mon, 30 Oct 2006 09:48:23 -0800 From: william@bourbon.usc.edu Someone wrote: > Should I output the 3 different C,D and L,R sets for the encrypt3/decrypt3, > or just pipe it to /dev/null automatically? Please do not do that. You should let the user controls it as demonstrated in the grading guidelines. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 29 20:20:57 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9U4KvB6014681 for ; Sun, 29 Oct 2006 20:20:57 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9U4HV80014405 for ; Sun, 29 Oct 2006 20:17:31 -0800 Message-Id: <200610300417.k9U4HV80014405@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: table check!! Date: Sun, 29 Oct 2006 20:17:31 -0800 From: william@bourbon.usc.edu Someone wrote: > So we should check or not ,i mean we shud expect 001,002 in input?? Well, we won't test with these cases. But if you just read a string that represents an integer, then it would not matter. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Sunday, October 29, 2006 6:29 pm Subject: Re: table check!! To: csac@merlot.usc.edu > Someone wrote: > > > if in table we get 01 instead of value we should print error or > not? > You mean "01" instead of "1"? "01" or "0000001" is equivalent > to "1". > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 29 18:48:04 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9U2m4ac008749 for ; Sun, 29 Oct 2006 18:48:04 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9U2icc4013316 for ; Sun, 29 Oct 2006 18:44:38 -0800 Message-Id: <200610300244.k9U2icc4013316@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Semi-weak keys Date: Sun, 29 Oct 2006 18:44:38 -0800 From: william@bourbon.usc.edu Someone wrote: > Yes, I've seen that, but I'm not following what the '~' means. On that slide, it means bit complement. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Sunday, October 29, 2006 6:33 PM To: csac@merlot.usc.edu Subject: Re: Semi-weak keys Someone wrote: > I'm still a little unclear as to what a semi-weak key looks like. > For weak keys, the 16 48-bit sub-keys exhibit the property k1=k16, > k2=k15, k3=k14...k16=k1. How do you tell what a semi-weak key is? k1=~k16, k2=~k15, ... Please see slide 13 of lecture 16. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 29 18:36:24 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9U2aOlX007958 for ; Sun, 29 Oct 2006 18:36:24 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9U2WwmA013088 for ; Sun, 29 Oct 2006 18:32:58 -0800 Message-Id: <200610300232.k9U2WwmA013088@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Semi-weak keys Date: Sun, 29 Oct 2006 18:32:58 -0800 From: william@bourbon.usc.edu Someone wrote: > I'm still a little unclear as to what a semi-weak key looks like. > For weak keys, the 16 48-bit sub-keys exhibit the property k1=k16, > k2=k15, k3=k14...k16=k1. How do you tell what a semi-weak key is? k1=~k16, k2=~k15, ... Please see slide 13 of lecture 16. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 29 18:35:00 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9U2Z0lC007819 for ; Sun, 29 Oct 2006 18:35:00 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9U2VYXR013064 for ; Sun, 29 Oct 2006 18:31:34 -0800 Message-Id: <200610300231.k9U2VYXR013064@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] weak keys Date: Sun, 29 Oct 2006 18:31:34 -0800 From: william@bourbon.usc.edu Someone wrote: > Does the set of the weak and semi-weak keys depend on the values of > PC1, PC2 and V tables? > If so, how do we detect semi-weak keys for PC1, PC2 and V tables other > that the standard DES tables? For palodromic and anti-palodromic keys, you can run through the key schedulingn algorithm and check if the subkeys have the right relationships (i.e., k1=k16, ... or k1=~k16, ...) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 29 18:30:47 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9U2UlRR007552 for ; Sun, 29 Oct 2006 18:30:47 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9U2RLqG013006 for ; Sun, 29 Oct 2006 18:27:21 -0800 Message-Id: <200610300227.k9U2RLqG013006@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: table check!! Date: Sun, 29 Oct 2006 18:27:21 -0800 From: william@bourbon.usc.edu Someone wrote: > if in table we get 01 instead of value we should print error or not? You mean "01" instead of "1"? "01" or "0000001" is equivalent to "1". -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 28 16:18:35 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9SNIZB1006916 for ; Sat, 28 Oct 2006 16:18:35 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9SNFD9C005224 for ; Sat, 28 Oct 2006 16:15:13 -0700 Message-Id: <200610282315.k9SNFD9C005224@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] guidelines question Date: Sat, 28 Oct 2006 16:15:13 -0700 From: william@bourbon.usc.edu Someone wrote: > "DES other semi-weak keys : -1 point each for each not handling properly > (it's okay if each command below is terminated with error > message saying that the key is bad or weak, it's also okey > if no error is reported; fout2 should be identical to f21)" > > If we are allowed to print an error or not print an error, Yes and yes! > what is "not handling it properly"? I guess if you print some other error messages not related to bad or weak key, then it's not handling it properly. > If I treat these keys like any other keys, is that correct? It's probably correct. The problem with these "other semi-weak keys" is that we haven't talked about how to detect them (unlike the anti-palodromic semi-weak keys or weak keys). So, if you have figured out how to detect them and report the semi-weak keys, that would be fine. If you have not figured out how to detect them and treat them as good keys, that would be fine too. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 28 15:09:17 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9SM9GfU002446 for ; Sat, 28 Oct 2006 15:09:16 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9SM5t1t004560 for ; Sat, 28 Oct 2006 15:05:55 -0700 Message-Id: <200610282205.k9SM5t1t004560@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] HW5 spec confirmation Date: Sat, 28 Oct 2006 15:05:55 -0700 From: william@bourbon.usc.edu Someone wrote: > For DES do we have to implitly call the table integrity check > or do we assume that the table file given will be accurate I think the spec says that you have to check. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 28 13:34:25 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9SKYPQ0028887 for ; Sat, 28 Oct 2006 13:34:25 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9SKV3jt003659 for ; Sat, 28 Oct 2006 13:31:03 -0700 Message-Id: <200610282031.k9SKV3jt003659@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] HW5 spec confirmation Date: Sat, 28 Oct 2006 13:31:03 -0700 From: william@bourbon.usc.edu Someone wrote: > So for 'tablecheck' we are obviously printing out errors to stderr, but > if the tables check out, should be print out any message? (i.e. "tables > ok") You should print nothing at all. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Wednesday, October 25, 2006 7:06 PM To: csac@merlot.usc.edu Subject: Re: [cs599] HW5 spec confirmation Someone wrote: > Per the spec, we do not have to print anything to stderr for > encrypt3/decrypt3, but will we be penalized if we do? Stderr is for error messages. If you are not encountering any error, you should not be printing to stderr. If you want to print debugging information, make sure they don't show up in your submission! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 28 09:36:13 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9SGaDGx013861 for ; Sat, 28 Oct 2006 09:36:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9SGWqRH001489 for ; Sat, 28 Oct 2006 09:32:52 -0700 Message-Id: <200610281632.k9SGWqRH001489@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] Grading guidelines problem Date: Sat, 28 Oct 2006 09:32:52 -0700 From: william@bourbon.usc.edu Someone wrote: > Do we have to print out those exact statements? No. The comment there is for your debugging pleasure. :-) > Can we print an equivalent > error statement instead? i.e. "the value 2 occured more than 12 times" vs > "the value 1 occured more than 4 times"? You don't have to pinpoint the exact error because there can be many interpretation of an error. You should print something useful so that the user can know approximately what the error is. So, anything reasonable suffice. -- Bill Cheng // bill.cheng@usc.edu On 10/27/06, william@bourbon.usc.edu wrote: > > Someone wrote: > > > None of the other testfiles have the problems that the grading > > guideline say they should. > > Hmm... the files were apparently renamed. Here's what they > should be: > > f10: (PC2) the value 30 in the PC2 table occur too many times > f11: (PC1) the value 21 in the PC1 table did not occur > f12: ( V) the value 1 in the V table did not occur 4 times > f13: ( V) the value 2 in the V table did not occur 12 times > f14: ( S8) 63 values read while 64 was expected > f15: ( S4) the value 10 in the S4 table did not occur 4 times > f16: ( S1) the value 11 in the S1 table did not occur 4 times > f17: ( P) 34 values read while 32 was expected > f18: ( E) the value 16 in the E table occur too many times > f19: ( IP) too few values read > > I've fixed the grading guidelines. Sorry about the bugs and > thanks for catching them. > -- > Bill Cheng // bill.cheng@usc.edu > > > > On 10/26/06, william@bourbon.usc.edu wrote: > > Someone wrote: > > > > > The guidelines are incorrect regarding what is wrong with the > > > tablefile inputs. for example: > > > > > > f11: ( E) the value 16 in the E table occur too many times > > > > > > but 16 only appears twice in table E in test file f11. > > > > Looks like the comments for f11 and f18 are reversed. I've > > swapped them. Sorry about the error and thanks for catching > > them. > > -- > > Bill Cheng // bill.cheng@usc.edu http://merlot.usc.edu/william/usc/> Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 27 22:24:51 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9S5OpnU003411 for ; Fri, 27 Oct 2006 22:24:51 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9S5LWxl019341 for ; Fri, 27 Oct 2006 22:21:32 -0700 Message-Id: <200610280521.k9S5LWxl019341@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] Grading guidelines problem Date: Fri, 27 Oct 2006 22:21:32 -0700 From: william@bourbon.usc.edu Someone wrote: > None of the other testfiles have the problems that the grading > guideline say they should. Hmm... the files were apparently renamed. Here's what they should be: f10: (PC2) the value 30 in the PC2 table occur too many times f11: (PC1) the value 21 in the PC1 table did not occur f12: ( V) the value 1 in the V table did not occur 4 times f13: ( V) the value 2 in the V table did not occur 12 times f14: ( S8) 63 values read while 64 was expected f15: ( S4) the value 10 in the S4 table did not occur 4 times f16: ( S1) the value 11 in the S1 table did not occur 4 times f17: ( P) 34 values read while 32 was expected f18: ( E) the value 16 in the E table occur too many times f19: ( IP) too few values read I've fixed the grading guidelines. Sorry about the bugs and thanks for catching them. -- Bill Cheng // bill.cheng@usc.edu On 10/26/06, william@bourbon.usc.edu wrote: > Someone wrote: > > > The guidelines are incorrect regarding what is wrong with the > > tablefile inputs. for example: > > > > f11: ( E) the value 16 in the E table occur too many times > > > > but 16 only appears twice in table E in test file f11. > > Looks like the comments for f11 and f18 are reversed. I've > swapped them. Sorry about the error and thanks for catching > them. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 26 22:57:45 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9R5vjQC010157 for ; Thu, 26 Oct 2006 22:57:45 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9R5sThx004571 for ; Thu, 26 Oct 2006 22:54:29 -0700 Message-Id: <200610270554.k9R5sThx004571@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Error in your DES Slides (Pg 12) Date: Thu, 26 Oct 2006 22:54:29 -0700 From: william@bourbon.usc.edu Someone wrote: > There is an error in your DES slides on Pg. 12 in the algorithm that you > have mentioned. > > In Step 2 of the algorithm R0 is written to be b57b49 etc which is > wrong. It gives an impression that we have to use the bits from the key > for R0. > Instead it is m57m49 etc... > > 2) (L0,R0) ¬ IP(m1m2...m64), L0=m58m50...m8, R0=b57b49...b7 You are correct. For those who couldn't figure exactly which slide you are referring to... it's slide 33 of lecture 15. It's a minor typo. I'll fix the slide when I get back on campus next week. Thanks for catching it. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 26 22:56:29 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9R5uSGd010130 for ; Thu, 26 Oct 2006 22:56:28 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9R5rDgW004528 for ; Thu, 26 Oct 2006 22:53:13 -0700 Message-Id: <200610270553.k9R5rDgW004528@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: HW5 S# Date: Thu, 26 Oct 2006 22:53:13 -0700 From: william@bourbon.usc.edu Someone wrote: > In S# in the speck it is written: > "S# : This table contains 64 values, in a group of 16. > Each group is a random permutation of the values from 0 > through 15, inclusive." > So this means their should be 0-15 each value 4 times ,or we have > to check group wise i mean every 16 bytes should have at least > 0-15 each??? > please clarify Yes. An S# corresponds to an S-box in DES. Each S-box is viewed as 4 rows by 16 columns. Each row must be a permutation of the values from 0 throught 15, inclusive. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 26 22:17:18 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9R5HH7i007298 for ; Thu, 26 Oct 2006 22:17:17 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9R5E2uJ003774 for ; Thu, 26 Oct 2006 22:14:02 -0700 Message-Id: <200610270514.k9R5E2uJ003774@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] table format Date: Thu, 26 Oct 2006 22:14:02 -0700 From: william@bourbon.usc.edu Someone wrote: > Do we have to check for the occurrence of all vector entries in the table > file? Yes. -- Bill Cheng // bill.cheng@usc.edu On 10/26/06, william@bourbon.usc.edu wrote: > > Someone wrote: > > > Can we expect the order of the vectors in the table file to be the > same.. > > No. They can come in any order. You must look for the '=' > and look to the left of that to see what an entry is. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 26 19:34:39 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9R2Yd9U029417 for ; Thu, 26 Oct 2006 19:34:39 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9R2VOig002026 for ; Thu, 26 Oct 2006 19:31:24 -0700 Message-Id: <200610270231.k9R2VOig002026@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] Grading guidelines problem Date: Thu, 26 Oct 2006 19:31:24 -0700 From: william@bourbon.usc.edu Someone wrote: > The guidelines are incorrect regarding what is wrong with the > tablefile inputs. for example: > > f11: ( E) the value 16 in the E table occur too many times > > but 16 only appears twice in table E in test file f11. Looks like the comments for f11 and f18 are reversed. I've swapped them. Sorry about the error and thanks for catching them. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 26 19:06:13 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9R26D0w027524 for ; Thu, 26 Oct 2006 19:06:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9R22we8001521 for ; Thu, 26 Oct 2006 19:02:58 -0700 Message-Id: <200610270202.k9R22we8001521@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] table format Date: Thu, 26 Oct 2006 19:02:58 -0700 From: william@bourbon.usc.edu Someone wrote: > Can we expect the order of the vectors in the table file to be the same.. No. They can come in any order. You must look for the '=' and look to the left of that to see what an entry is. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 25 19:09:25 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9Q29P8j032662 for ; Wed, 25 Oct 2006 19:09:25 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9Q26EFF018222 for ; Wed, 25 Oct 2006 19:06:14 -0700 Message-Id: <200610260206.k9Q26EFF018222@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] HW5 spec confirmation Date: Wed, 25 Oct 2006 19:06:14 -0700 From: william@bourbon.usc.edu Someone wrote: > Per the spec, we do not have to print anything to stderr for > encrypt3/decrypt3, but will we be penalized if we do? Stderr is for error messages. If you are not encountering any error, you should not be printing to stderr. If you want to print debugging information, make sure they don't show up in your submission! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 24 15:58:37 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9OMwWNs025435; Tue, 24 Oct 2006 15:58:32 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9OMtPxr031899; Tue, 24 Oct 2006 15:55:25 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id k9OMtOcU031898; Tue, 24 Oct 2006 15:55:24 -0700 Date: Tue, 24 Oct 2006 15:55:24 -0700 From: william@bourbon.usc.edu Message-Id: <200610242255.k9OMtOcU031898@bourbon.usc.edu> To: cs551@merlot.usc.edu, csac@merlot.usc.edu Subject: midterm grading schedule... Hi, I usually wait for all the midterm exams to arrive from DEN before I start grading, and it usually take them 48 hours to arrive. So, most likely, I won't start grading until this weekend. I should be able to finish grading around Wednesday next week. I will send your midterm scores to you via individual e-mails. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 24 10:29:48 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9OHTml5004595 for ; Tue, 24 Oct 2006 10:29:48 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9OHQgV4028459 for ; Tue, 24 Oct 2006 10:26:42 -0700 Message-Id: <200610241726.k9OHQgV4028459@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cheat sheet Date: Tue, 24 Oct 2006 10:26:42 -0700 From: william@bourbon.usc.edu Someone wrote: > Is any cheat sheet allowed where in we can note down the formulae > of diff tests and other mathematical stuff.? Sorry, no cheat sheet is allowed, as mentioned in the News section (red color section) of the class web page regarding midterm exam. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 23 23:09:19 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9O69JFS025473 for ; Mon, 23 Oct 2006 23:09:19 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9O66ENO020763 for ; Mon, 23 Oct 2006 23:06:14 -0700 Message-Id: <200610240606.k9O66ENO020763@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: LFSR doubts Date: Mon, 23 Oct 2006 23:06:14 -0700 From: william@bourbon.usc.edu Someone wrote: > For LFSR the register on the extreme right is the one from which > we always get the o/p and send the f/b(one of the reg). > Now is this reg used to denote the highest degree or is the one > on the extreme left > I thought it was the one on the left, if so i could not > understand the poly eqn on lect 10 slide 4. The above slide is correct. > If it is the one on the ext right then, how can we have a poly of > degree less than L If c_L is zero (output bit does not feedback), then the degree is less than L. (It is *permitted* that c_L is zero.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 22 20:42:55 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9N3gtil020754 for ; Sun, 22 Oct 2006 20:42:55 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9N3dsBb001637 for ; Sun, 22 Oct 2006 20:39:54 -0700 Message-Id: <200610230339.k9N3dsBb001637@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: midterm syllabus Date: Sun, 22 Oct 2006 20:39:54 -0700 From: william@bourbon.usc.edu Someone wrote: > I had a query regarding the portion of the syllabus for the > midterm. As you have specified on the web page, it covers > everything upto 10th Slide for lect on 5th Oct. But in the > topics covered section below, you have also included topics like > > *attacks: > complexity of attacks > *modes of operation > ECB > CBC > CFB > OFB > *cascade cipher and multiple encryption > meet-in-the-middle attacks > known-plaintext unicity distance > > Are these also in the midterm syllabus, though these were > covered later i.e. listed after 10th slide of 5th oct lecture? Sorry about the confusion... My mistake. You are correct (and the topics covered on the class web page was correct). I've just fixed the reference to the lecture page to say: ([BC: Fixed 10/22/2006] last slide is slide 21 of lecture on 10/10/2006). The midterm covers up to block ciphers (except DES and AES). -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 18 19:58:55 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9J2wtAd013257 for ; Wed, 18 Oct 2006 19:58:55 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9J2u9Td017641 for ; Wed, 18 Oct 2006 19:56:09 -0700 Message-Id: <200610190256.k9J2u9Td017641@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Question for Exam Date: Wed, 18 Oct 2006 19:56:09 -0700 From: william@bourbon.usc.edu Someone wrote: > I am wondering if we are supposed to remember details of the algorithms and > other mathematical slides. For ex, the equations for X1, X2 etc, and some of > the encryption algorithms. You don't need to memory complex equations. But you should know the meaning of them. You should be familiar with all encryption algorithms (both public-key and secret-key). You should know the mathematics and be able to do simple algebraic manipulations with small numbers by hand. You should also know how hard a particular problem is so that you don't waste time on a long problem that does not have too many points (unless you are finished with the rest of the exam). -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 17 22:53:50 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9I5roxY029633 for ; Tue, 17 Oct 2006 22:53:50 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9I5p7AR004686 for ; Tue, 17 Oct 2006 22:51:07 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id k9I5p7sx004685 for csac@merlot; Tue, 17 Oct 2006 22:51:07 -0700 Date: Tue, 17 Oct 2006 22:51:07 -0700 From: william@bourbon.usc.edu Message-Id: <200610180551.k9I5p7sx004685@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: wikipedia page on multiplication in GF(2^8)... Hi, During class today, I had trouble finding the wikipedia page that has code for multiplication in GF(2^8) for AES. The code is at: http://en.wikipedia.org/wiki/Finite_field_arithmetic#Program_examples -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 17 22:05:13 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9I55DjH026148 for ; Tue, 17 Oct 2006 22:05:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9I52UhX004217 for ; Tue, 17 Oct 2006 22:02:30 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id k9I52Uv4004216 for csac@merlot; Tue, 17 Oct 2006 22:02:30 -0700 Date: Tue, 17 Oct 2006 22:02:30 -0700 From: william@bourbon.usc.edu Message-Id: <200610180502.k9I52Uv4004216@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: midterm coverage... Hi, I've mentioned in class today that the midterm exam will cover everything from the beginning of the semester to the end of classical ciphers and cryptanalysis. I've updated the main class web page with a list of topics (not all topics covered are listed). Please see the web page for details. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 14 18:59:10 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9F1xAJQ030411 for ; Sat, 14 Oct 2006 18:59:10 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9F1ucpW026142 for ; Sat, 14 Oct 2006 18:56:38 -0700 Message-Id: <200610150156.k9F1ucpW026142@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci 599 hw4 Date: Sat, 14 Oct 2006 18:56:38 -0700 From: william@bourbon.usc.edu Someone wrote: > I have used CTIME fucntion for passphrase creating in the keygen part. > I used sleep command between two iterations to get the enw time. > Its taking while to get the output when 't' is large. Is that delay ok...? I've mentioned in class that you should probably call gettimeofday() so that you can keep calling it and not get into trouble like this. If you have to call time(), you should make your code generate different keys even when time() returns the same value (like what we did with previoius HWs). > Also in the histo command i guess when there is a tie between two chars > it doesnt matter which one we print first.? Please see my message with timestamp "Wed 04 Oct 13:22". -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 14 18:48:51 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9F1mpxV029773 for ; Sat, 14 Oct 2006 18:48:51 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9F1kJDE025974 for ; Sat, 14 Oct 2006 18:46:19 -0700 Message-Id: <200610150146.k9F1kJDE025974@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW4 Date: Sat, 14 Oct 2006 18:46:19 -0700 From: william@bourbon.usc.edu Someone wrote: > For the plaintext recovery of the mystery.ct files, it says for > each line to not exceed 72 characters. Does this mean actual > characters, or does whitespace count as a character? All characters. > Exaple string: > Does "abc de" equal 5 characters, or 6? 6. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 14 09:09:45 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9EG9jR4025484 for ; Sat, 14 Oct 2006 09:09:45 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9EG7F8Z021317 for ; Sat, 14 Oct 2006 09:07:15 -0700 Message-Id: <200610141607.k9EG7F8Z021317@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: something left in earlier mail Date: Sat, 14 Oct 2006 09:07:15 -0700 From: william@bourbon.usc.edu Someone wrote: > Sorry I forgot to mention in my last mail that I also tried > using, 'g' instead of 'lf' i.e > > fprintf(stdout,"\nt=%d, E(IC)=%0.9g",i+1,*(EIC + i)); > > But if this is used then, it displays following as the output > of diff command, > > < t=2, E(IC)=0.0521268469 > < t=3, E(IC)=0.0475691292 > < t=4, E(IC)=0.0452902704 > < t=5, E(IC)=0.0439229551 > < t=6, E(IC)=0.0430114115 > --- > > t=2, E(IC)=0.052126847 > > t=3, E(IC)=0.047569129 > > t=4, E(IC)=0.04529027 > > t=5, E(IC)=0.043922955 > > t=6, E(IC)=0.043011412 > > Please suggest how to work around this problem I don't know what you mean by "problem". The numbers look fine to me! (Again, please see item 5 of the grading guidelines.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 14 09:07:42 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9EG7fJ9025340 for ; Sat, 14 Oct 2006 09:07:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9EG5BXh021285 for ; Sat, 14 Oct 2006 09:05:11 -0700 Message-Id: <200610141605.k9EG5BXh021285@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: query about solve command Date: Sat, 14 Oct 2006 09:05:11 -0700 From: william@bourbon.usc.edu Someone wrote: > I have implemented the complete code for the solve command. Now > to print the value of E(IC) i use the following code; > > fprintf(stdout,"\nt=%d E(IC)=%0.9lf",i+1,*(EIC + i)); > > This prints values for all the E(IC)s for all periods correctly > right upto the last digit after decimal point, but for the first > output it prints > > t=1, E(IC)=0.065800000 > > while in the output by your code it is > > t=1, E(IC)=0.0658 > > Also for the results in which last digit after decimal is '0', my > prg prints it, but your program doesnt. > > So though all the values are correct, after running the script it > shows me this difference. Can you please tell me how to work > around this problem. > Also the script for the last program takes a lot of time to run, > so should I note this down in the README file as well. Just want to mention it again that it's okay as far as grading goes (please see the last sentence of item 5 near the top of the grading guidelines). The only difference is that I used "%0.9lg". But according to the man pages, it does do rounding. But again, the 9th digit is certainly not important. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 14 09:03:08 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9EG38Fs025023 for ; Sat, 14 Oct 2006 09:03:08 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9EG0cj9021204 for ; Sat, 14 Oct 2006 09:00:38 -0700 Message-Id: <200610141600.k9EG0cj9021204@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW4 Date: Sat, 14 Oct 2006 09:00:38 -0700 From: william@bourbon.usc.edu Someone wrote: > I have another question which I did not see addressed in the > spec. I don't recall you covering it in lecture either, so I apologize > if you have already answered this: > > Do we essentially need to remove all punctuation and whitespace from the > input for the Kasiski method? For example, with a period=6, if the > ciphertext input is: > > cf, hjw. akpqk nak.... > > then should our first block of text be "cfhjwa"? (as opposed to > "cf,_hj") No. You need to *skip* them (and not *delete* them). If you delete one of them, then for a character that was encrypted with function E_i (understore means subscript), you may mistakenly consider that it was encrypted with function E_{i-1} and all your calculations will be off. So, when you encrypt, you just skip applying the transformation function. When you do a histogram, you don't count them. When you do solve, you skip them. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Friday, October 13, 2006 9:18 PM To: csac@merlot.usc.edu Subject: Re: CSCI599 HW4 Someone wrote: > The spec says, "For the purpose of this assignment, you may assume that > the original plaintext is a single line of ASCII text." > > Can we assume this for the input to the 'solve' command? Yes. > I noticed the > above statement was under the section 'Full Vigenere Cipher' so I didn't > know for sure if the assumption only applied to using the Vigenere > cipher or if it was applicable to the entire assignment. Please advise, This is for "crypt", "histo", and "solve" commands. Since this whole assignment is about the Full Vigenere Cipher, it applies to all commands that takes a data input file. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 13 21:50:48 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9E4omU7012435 for ; Fri, 13 Oct 2006 21:50:48 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9E4mK2P014760 for ; Fri, 13 Oct 2006 21:48:20 -0700 Message-Id: <200610140448.k9E4mK2P014760@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW4 : Period Determination Date: Fri, 13 Oct 2006 21:48:20 -0700 From: william@bourbon.usc.edu Someone wrote: > 1. Regarding the peaks in Auto corr is it poss that if > we only get peaks at muliples of 14 and no peaks at 7 ? > Can we say somethin about the period from this only ? > Could it still be 7 nd its multiples OR > would it be 14 nd multiples Anything is possible. You cannot say anything with 100% certainty. That's the nature of cryptanalysis. > 2. If we get the following scenario > - For Kasiski : If gcd of (j-i) is say 7 then poss values > could be 7 or its multiples > - For AC : the peaks are at muliples of 14 and no peaks at 7 > Can we say somethin about the period ? No. They may both be wrong! > Now if we calculate the IC which returns an approximate > single value. > > So the best judge would be to to look at IC and confirm > it with the other methods ? When you combine all 3 methods, hopefully, you will get the best guess at what the period might be. It is possible that even though all 3 agrees on a period and it's the wrong period. Again, this is the nature of cryptanalysis. After all said and done, although it could be wrong, it could also be right. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 13 21:20:32 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9E4KWQE010558 for ; Fri, 13 Oct 2006 21:20:32 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9E4I3Lw014374 for ; Fri, 13 Oct 2006 21:18:03 -0700 Message-Id: <200610140418.k9E4I3Lw014374@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW4 Date: Fri, 13 Oct 2006 21:18:03 -0700 From: william@bourbon.usc.edu Someone wrote: > The spec says, "For the purpose of this assignment, you may assume that > the original plaintext is a single line of ASCII text." > > Can we assume this for the input to the 'solve' command? Yes. > I noticed the > above statement was under the section 'Full Vigenere Cipher' so I didn't > know for sure if the assumption only applied to using the Vigenere > cipher or if it was applicable to the entire assignment. Please advise, This is for "crypt", "histo", and "solve" commands. Since this whole assignment is about the Full Vigenere Cipher, it applies to all commands that takes a data input file. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 13 15:53:50 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9DMroHx022141 for ; Fri, 13 Oct 2006 15:53:50 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9DMpMaH011491 for ; Fri, 13 Oct 2006 15:51:22 -0700 Message-Id: <200610132251.k9DMpMaH011491@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: floating point rounding Date: Fri, 13 Oct 2006 15:51:22 -0700 From: william@bourbon.usc.edu Someone wrote: > I assume that I should not worry even if the grading script result do not > match at the very last digit. Correct. Item 5 at the top of the grading guidelines does say: The only values that are allowed to be different are the "real values". -- Bill Cheng // bill.cheng@usc.edu On 10/13/06, william@bourbon.usc.edu wrote: > > Someone wrote: > > > I am bit confused. Any help is appreciated. > > I computed ic, and did something like this > > fprintf(stdout,"t=%.0f, E(IC)=%.9f \n",iter,ic); > > assuming %.9f would round up properly, but what is happening is that it > is > > simply truncating the following values. I was wondering what can i do to > > prevent this, as googling it suggest that this is an architecture > dependent > > issue. > > I think the error is so small at the last digit that this > shouldn't matter. It is very likely that it's implementation > dependent and some may have this *minor* bug at the last > digit. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 13 13:18:36 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9DKIa4s012318 for ; Fri, 13 Oct 2006 13:18:36 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9DKG9V1009881 for ; Fri, 13 Oct 2006 13:16:09 -0700 Message-Id: <200610132016.k9DKG9V1009881@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: floating point rounding Date: Fri, 13 Oct 2006 13:16:09 -0700 From: william@bourbon.usc.edu Someone wrote: > I am bit confused. Any help is appreciated. > I computed ic, and did something like this > fprintf(stdout,"t=%.0f, E(IC)=%.9f \n",iter,ic); > assuming %.9f would round up properly, but what is happening is that it is > simply truncating the following values. I was wondering what can i do to > prevent this, as googling it suggest that this is an architecture dependent > issue. I think the error is so small at the last digit that this shouldn't matter. It is very likely that it's implementation dependent and some may have this *minor* bug at the last digit. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 12 16:51:46 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9CNpk4W030248 for ; Thu, 12 Oct 2006 16:51:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9CNnLcR028406 for ; Thu, 12 Oct 2006 16:49:21 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id k9CNnLBE028405 for csac@merlot; Thu, 12 Oct 2006 16:49:21 -0700 Date: Thu, 12 Oct 2006 16:49:21 -0700 From: william@bourbon.usc.edu Message-Id: <200610122349.k9CNnLBE028405@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: errors in today's lecture near the end... Hi, I just realized that near the end of today's lecture, I've made a mistake. This happened when I was not using slides and was writing on the piece of paper. When I said "squared", well, it was incorrect. I'll redo this in the next lecture. Sorry about the mistake. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 11 10:12:15 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9BHCFEa009681 for ; Wed, 11 Oct 2006 10:12:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9BH9ul0008658 for ; Wed, 11 Oct 2006 10:09:56 -0700 Message-Id: <200610111709.k9BH9ul0008658@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci 599 h/w4 Date: Wed, 11 Oct 2006 10:09:56 -0700 From: william@bourbon.usc.edu Someone wrote: > I am still confuse regarding whether we have to cretae seperate > file whn we use this cmd " hw4 invkey keyfile" > spec says output of this command is " The output of this > command is a key file in the format identical to that of the > input key file." So wht we hav to do ,to create a temprary file > or to output in stdout ??? Stdout (which is a file). -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Friday, October 6, 2006 2:34 pm Subject: Re: csci 599 h/w4 To: csac@merlot.usc.edu > Someone wrote: > > > Oh ok , I just got things mixed up. I was using the hardcoded > > file to store my results and dint send the output to stdout > > as I read somewhere that output of that command is a keyfile. > > Thanx alot for clearing the doubts. > > Please also remember that if you want to create temporary > files, it must be in /tmp. And, you should use mkstemp() > or equivalent. > -- > Bill Cheng // bill.cheng@usc.edu > > > > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Friday, October 6, 2006 12:57 pm > Subject: Re: csci 599 h/w4 > To: csac@merlot.usc.edu > > > Someone wrote: > > > > > The specs say "keygen : The output of this command is a > > > key file Each line is exactly 26 characters long (lowercase > > > English characters) and is terminated with a '\n' character." > > > > In UNIX, stdout is basically a file! And it's often > > redirected to a file. > > > > > I did that. Created a file called "keygen.keys" (which will be > > > used to encrypt ascii text) and wrote the output of hw4 > keygen > > -t=period command there. > > > > The spec says nothing about what using a hard-coded filename > > for output. > > > > > I dint read anything on the specs that said we need to > output the > > > "hw4 keygen -t" output to stdout. > > > and yea the x1.keys or x2.keys.....x7.keys are blank. but as i > > > said earlier the keyfile that i generate has the correct > output. > > > The spec says: > > > > Output of your program must go to stdout and error messages > > must go to stderr. > > > > It's usually a very bad practice to hardcode the name of an > > output file (unless some spec calls for it specifically). > > -- > > Bill Cheng // bill.cheng@usc.edu > > > > > > > > ----- Original Message ----- > > From: william@bourbon.usc.edu > > Date: Friday, October 6, 2006 12:06 pm > > Subject: Re: csci 599 h/w4 > > To: csac@merlot.usc.edu > > > > > Someone wrote: > > > > > > > When i run the grading script for keygen it says pass in > > all the > > > > files. > > > > when I check the files created in my local directory the > files > > > i.e the .keys files, they are blank. But the output > does get > > > > written into 'my' file i.e the file that i create. > > > > Is that ok? > > > > > > I'm not sure what you are saying... If you run: > > > > > > ./hw4 keygen -t=10 > x1.keys > > > > > > Is x1.keys blank? If it is blank, your program is not > > > doing the right thing. The output must go to stdout. > > > I don't know what you meant by "the files that you create". > > > Are you generating output in using specific filenames? > > > That's certainly not in the spec. > > > > > > The checkKeys program just check if each line in your input > > > has all the letters from 'a' through 'z'. > > > -- > > > Bill Cheng // bill.cheng@usc.edu > > > > > > > > > > > > ----- Original Message ----- > > > From: william@bourbon.usc.edu > > > Date: Thursday, October 5, 2006 1:36 pm > > > Subject: Re: csci 599 h/w4 > > > To: csac@merlot.usc.edu > > > > > > > Someone wrote: > > > > > > > > > So for each new line that we generate for the keygen > > file we > > > > > need to call gettimeofday() > > > > > and the current time will be used as the passphrase to > > generate > > > the key which should be in put to the key > > scheduling algo? > > > > > Is my understanding correct? > > > > > > > > Again, this is not spepcified in the spec. If you feel this > > > > is reasonable and generate random enough looking data, > please > > > go ahead! (As you can see from the grading > guidelines, we > > > > don't do too much. You can also run the checkKey script > to > > > > make sure your output passes the simple integrity check.) > > > > -- > > > > Bill Cheng // bill.cheng@usc.edu > > > > > > > > > > > > > > > > ----- Original Message ----- > > > > From: william@bourbon.usc.edu > > > > Date: Wednesday, October 4, 2006 4:14 pm > > > > Subject: Re: csci 599 h/w4 > > > > To: csac@merlot.usc.edu > > > > > > > > > Someone wrote: > > > > > > > > > > > As you have mentioned in the mail below, suppose we > > use > > > the key > > > > > > generation algo with S of size 26 then at the end > of > > the key > > > > > > generation algo with 26 iteration, we will get the > > scrambled > > > > version of S. But this will correspond to > > only one line > > > in the > > > > > > keyfile. > > > > > > > > > > > > So now to generate the next line, do we use this > > > scrambled > > > > S as > > > > > > the input S array and execute the key generation > algo > > > again on > > > > > > this new S ? > > > > > > > > > > Sure, why not?! Or you can call gettimeofday() and > get > > another > > > microsecond resolution clock, reset S[], and > > start again. > > > Again, > > anything that's reasonable. > > > > > -- > > > > > Bill Cheng // bill.cheng@usc.edu > > > > > > > > > > > > > > > ----- Original Message ----- > > > > > From: william@bourbon.usc.edu > > > > > Date: Wednesday, October 4, 2006 12:59 pm > > > > > Subject: Re: csci 599 h/w4 > > > > > To: csac@merlot.usc.edu > > > > > > > > > > > Someone wrote: > > > > > > > > > > > > > I am not able to understand how can we implement > > key > > > > scheduling > > > algorithm to generate the keygen file. > > > > > > > > > > > > > > Do we have to use "abcd...z" as the key and then > > use > > > > that > > > > > in the > > > > > > > key scheduling algorithm? > > > > > > > > > > > > The spec says: > > > > > > > > > > > > ...and use the current date and time as the key. > > > > > > > > > > > > You can map 'a' to 0, 'b' to 1, ... 'z' to 25. So, > > at the > > > > > > beginning of the key scheduling algorith, S[0..25] > > can be > > > > > > thought of as initialized with "abcd...z". > > > > > > > > > > > > > And then do we need to use the output of the > > output > > > > > algorithm to > > > > > > > generate the key gen file? > > > > > > > > > > > > At the end of the key scheduling algorithm, you can > just > > > > > output the states S[0..25]. You do not need to > run the > > > > > > output algorithm at all. > > > > > > > > > > > > Again, this is just a suggestion. You can use > other > > methods > > > > (one I mentioned in class) as a way to > > generate a random > > > > > > permutation. > > > > > > -- > > > > > > Bill Cheng // bill.cheng@usc.edu > > > > > > Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 10 10:22:11 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9AHMBJ8014917 for ; Tue, 10 Oct 2006 10:22:11 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9AHJtTk026748 for ; Tue, 10 Oct 2006 10:19:55 -0700 Message-Id: <200610101719.k9AHJtTk026748@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS599: Ordering len=x.. in Solve Date: Tue, 10 Oct 2006 10:19:55 -0700 From: william@bourbon.usc.edu Someone wrote: > How are we supposed to order the matches we find in solve? In f1.solve it's > like this: > > len=9, i=106, j=4596, j-i=4490, rirhfpimf > len=9, i=106, j=4631, j-i=4525, rirhfpimf > len=9, i=185, j=555, j-i=370, sugnnyudh > len=9, i=185, j=1825, j-i=1640, sugnnyudh > len=9, i=426, j=611, j-i=185, rirhfpimf > len=9, i=426, j=4596, j-i=4170, rirhfpimf > len=9, i=426, j=4631, j-i=4205, rirhfpimf > len=9, i=555, j=1825, j-i=1270, sugnnyudh > len=9, i=574, j=2389, j-i=1815, eedxbyomv > len=9, i=611, j=4596, j-i=3985, rirhfpimf > len=9, i=611, j=4631, j-i=4020, rirhfpimf > > How do you choose which i to match a string with if there are multiple > occurences? Apparently it's not the first occurence of the string. i is non-decreasing. When i stays the same, j is increasing. > And how > can these two semi-redundant lines be in the same input file?: > > len=9, i=426, j=4596, j-i=4170, rirhfpimf > len=9, i=611, j=4596, j-i=3985, rirhfpimf This means that "rirhfpimf" appears at indices 426, 661, and 4596. > Are we enumerating all possible i-j combinations? Apparently not because the > 4596/4631 pair is not an i/j pair. I'm very confused with this, it doesn't > seem to be in the spec. I'm sure that when i=4596, you should see a j=4631. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 10 07:12:14 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9AECE4i002996 for ; Tue, 10 Oct 2006 07:12:14 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9AE9xIa024864 for ; Tue, 10 Oct 2006 07:09:59 -0700 Message-Id: <200610101409.k9AE9xIa024864@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW4 Date: Tue, 10 Oct 2006 07:09:59 -0700 From: william@bourbon.usc.edu Someone wrote: > In Kasiski method, while finding repeating patterns my code runs slow. > It can take several minutes before file is processed. Is it ok? That's kind of slow, but it's fine. Please make sure you mention that near the top of your README file. Of course it would be better if you can figure out what's wrong with it and make it go a little faster. Could someone remind me to talk briefly about this at the beginning of lecture today? Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 10 07:08:27 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k9AE8RQI002729 for ; Tue, 10 Oct 2006 07:08:27 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k9AE6BD3024784 for ; Tue, 10 Oct 2006 07:06:11 -0700 Message-Id: <200610101406.k9AE6BD3024784@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci 599 h/w 4 Date: Tue, 10 Oct 2006 07:06:11 -0700 From: william@bourbon.usc.edu Someone wrote: > Something is causing memory overlapping in my code? > I am freeing the mem allocation after the use of each buffer. > Could you suggest some thing that can prevent memory overlapping? There is no magic solution to seg-faults. Please see: http://merlot.usc.edu/csac-f06/homeworks.html#segfault You have probably correcupted the memory allocation chain. You can try one of the tools suggested in the web page above. But there is no guarantee that it will find your bug. If you want to see if freeing the memory can be the problem, you can do a global replace of free() with a no-op function and see if the bug goes away. That may help you to find the bug. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 9 11:50:29 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k99IoTgk026332 for ; Mon, 9 Oct 2006 11:50:29 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k99ImG7g014052 for ; Mon, 9 Oct 2006 11:48:16 -0700 Message-Id: <200610091848.k99ImG7g014052@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: midterm Date: Mon, 09 Oct 2006 11:48:16 -0700 From: william@bourbon.usc.edu Someone wrote: > What is the best study material to prepare for your midterm? Since most materials will come from lecture slides, I would say that the primary source is lecture slides. Most of the lecture slides come directly out of the online textbook. So, you should be familar with the textbook too. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Monday, October 9, 2006 10:00 am Subject: Re: CSCI599 HW4 To: csac@merlot.usc.edu > Someone wrote: > > > I just wonder what value should we use for Kp in the > coincidence. Hw > > spec says 0.0658, book says 0.0667. Please clarify. > > Please use the value from the spec. > > > Could you please also post midterm papers from previous years > so that > > we had an idea of the content? > > I'm sorry but I do not post exams from previous semesters. > > The exam will be closed everything and no calculators or any > electronic gadgets. Most materials will come from lecture > slides. Most questions will be in the form, "In X words or > less, ...", where X is like 5, 15, 30, or other numbers in > between. You do not need to count the number of words in > your answer. I will stop reading the answer after X number > of words. The idea here is that you must *choose* what to > write down as answers at the beginning of your answer and > cannot just write down all possible answers and let me choose. > > The exam will look kind of long. It will have 6 to 8 sections > with several questions in each section. Most questions are on > the short and medium side. Some will require calculations to > demonstrate that you understand certain concepts. You will be > asked to compute things like a^b mod c for small values of a, > b, and c. I will give partial credits. In general, better > answers may get more points. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 9 10:10:12 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,AWL, MAILTO_TO_SPAM_ADDR,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k99HACAe019829; Mon, 9 Oct 2006 10:10:12 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k99H7xRX012238; Mon, 9 Oct 2006 10:07:59 -0700 Message-Id: <200610091707.k99H7xRX012238@bourbon.usc.edu> Cc: Manish Kankani To: cs551@merlot.usc.edu, csac@merlot.usc.edu Subject: Re: Job Opening at Broadcom Corporation In-reply-to: References: <200610091608.k99G8gF1011256@bourbon.usc.edu> Comments: In-reply-to Manish Kankani message dated "Mon, 09 Oct 2006 10:00:19 -0700." Date: Mon, 09 Oct 2006 10:07:59 -0700 From: william@bourbon.usc.edu Dear Students, Please do not send your resume if you will not graduate by the end of this year. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Mon, 09 Oct 2006 10:00:19 -0700 From: Manish Kankani To: william@bourbon.usc.edu Cc: cs551@merlot.usc.edu, csac@merlot.usc.edu Subject: Re: Job Opening at Broadcom Corporation Hello, Even though it is clearly mentioned in the mail and also repeated by Prof. B ill Cheng, I have started receiving resumes of people graduating in May 2007. Please note that the said position is only for people who have already graduat ed or intend to gradute by Dec 2006. Please donot forward your resumes if you are graduating any time later than Dec 2006. Also mention you GPA in the resume. Thanks -Manish Kankani ----- Original Message ----- From: william@bourbon.usc.edu Date: Monday, October 9, 2006 9:09 am Subject: Re: Job Opening at Broadcom Corporation To: cs551@merlot.usc.edu, csac@merlot.usc.edu Cc: Manish Kankani > Dear Students, > > I'm forwarding a message for a job opportunity. My > understanding is that this is only for students who intend > to graduate by Dec 2006. Please contact Manish Kankani > if you have questions. > -- > Bill Cheng // bill.cheng@usc.edu > > > > -----Original Message----- > Date: Sun, 08 Oct 2006 21:40:52 -0700 > From: Manish Kankani > To: chengw@usc.edu > Subject: Job Opening at Broadcom Corporation > > Hello, > > I am a graduate student from USC, working at Broadcom Corporation > in San Die > go. We have an immediate opening for the following job. It would be > great if y > ou could forward this to all the CS 402, CS 551, CS599 students who > have alrea > dy graduated or intend to graduate by Dec 2006. > > JOB DESCRIPTION: > Position Type : Firmware > Job Title : Engineer, Firmware > Job Requirements : Requirements include a MSEE with some embedded > firmware e > xperience. Exceptional candidates with less experience will be > considered. Ski > lls include knowledge of RISC processors, microcontrollers, C and > Assembly lan > guage programming and debugging, low-level system debugging, > including skills > related to debugging firmware and operating system kernels, and > experience in > trouble-shooting HW device level problems. Knowledge of > Cryptography, MPEG tra > nsport, audio and/or video desired. > > Internal Description : Duties include firmware development and > verification > of new architectures/features/enhancements for the security design > inside sett > op box chip. This person will work as an integral part of the HW-SW > co-design > team for System-on-chip design and participate in fine tuning of > SW/HW archite > cture. Responsibilities include firmware development, testbench > development, d > ocumentation, and support of lab checkout of module > > Please forward your resume to me, if you meet the requirements. > > Thanks > -Manish Kankani > Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 9 10:01:52 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k99H1qBu019161 for ; Mon, 9 Oct 2006 10:01:52 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k99GxeV3011882 for ; Mon, 9 Oct 2006 09:59:40 -0700 Message-Id: <200610091659.k99GxeV3011882@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW4 Date: Mon, 09 Oct 2006 09:59:40 -0700 From: william@bourbon.usc.edu Someone wrote: > I just wonder what value should we use for Kp in the coincidence. Hw > spec says 0.0658, book says 0.0667. Please clarify. Please use the value from the spec. > Could you please also post midterm papers from previous years so that > we had an idea of the content? I'm sorry but I do not post exams from previous semesters. The exam will be closed everything and no calculators or any electronic gadgets. Most materials will come from lecture slides. Most questions will be in the form, "In X words or less, ...", where X is like 5, 15, 30, or other numbers in between. You do not need to count the number of words in your answer. I will stop reading the answer after X number of words. The idea here is that you must *choose* what to write down as answers at the beginning of your answer and cannot just write down all possible answers and let me choose. The exam will look kind of long. It will have 6 to 8 sections with several questions in each section. Most questions are on the short and medium side. Some will require calculations to demonstrate that you understand certain concepts. You will be asked to compute things like a^b mod c for small values of a, b, and c. I will give partial credits. In general, better answers may get more points. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Oct 9 09:10:54 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k99GAshe015941; Mon, 9 Oct 2006 09:10:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k99G8gF1011256; Mon, 9 Oct 2006 09:08:42 -0700 Message-Id: <200610091608.k99G8gF1011256@bourbon.usc.edu> To: cs551@merlot.usc.edu, csac@merlot.usc.edu Cc: Manish Kankani Subject: Re: Job Opening at Broadcom Corporation In-reply-to: References: Comments: In-reply-to Manish Kankani message dated "Sun, 08 Oct 2006 21:40:52 -0700." Date: Mon, 09 Oct 2006 09:08:42 -0700 From: william@bourbon.usc.edu Dear Students, I'm forwarding a message for a job opportunity. My understanding is that this is only for students who intend to graduate by Dec 2006. Please contact Manish Kankani if you have questions. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Sun, 08 Oct 2006 21:40:52 -0700 From: Manish Kankani To: chengw@usc.edu Subject: Job Opening at Broadcom Corporation Hello, I am a graduate student from USC, working at Broadcom Corporation in San Die go. We have an immediate opening for the following job. It would be great if y ou could forward this to all the CS 402, CS 551, CS599 students who have alrea dy graduated or intend to graduate by Dec 2006. JOB DESCRIPTION: Position Type : Firmware Job Title : Engineer, Firmware Job Requirements : Requirements include a MSEE with some embedded firmware e xperience. Exceptional candidates with less experience will be considered. Ski lls include knowledge of RISC processors, microcontrollers, C and Assembly lan guage programming and debugging, low-level system debugging, including skills related to debugging firmware and operating system kernels, and experience in trouble-shooting HW device level problems. Knowledge of Cryptography, MPEG tra nsport, audio and/or video desired. Internal Description : Duties include firmware development and verification of new architectures/features/enhancements for the security design inside sett op box chip. This person will work as an integral part of the HW-SW co-design team for System-on-chip design and participate in fine tuning of SW/HW archite cture. Responsibilities include firmware development, testbench development, d ocumentation, and support of lab checkout of module Please forward your resume to me, if you meet the requirements. Thanks -Manish Kankani Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 8 15:27:01 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k98MR1V8013244 for ; Sun, 8 Oct 2006 15:27:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k98MOqqF002154 for ; Sun, 8 Oct 2006 15:24:52 -0700 Message-Id: <200610082224.k98MOqqF002154@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] H/W 4 Query Date: Sun, 08 Oct 2006 15:24:52 -0700 From: william@bourbon.usc.edu Someone wrote: > you said > if "-i=1" then we need to do the stats of > i,i+T,i+2*T,i+3*T,.... > what if "-i=3" ? Same! Just need to substitute the actual value of i. So, it would be: 3,3+T,3+2*T,3+3*T,.... -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Saturday, October 7, 2006 9:58 pm Subject: Re: [cs599] Attacks on RC4 To: csac@merlot.usc.edu > Someone wrote: > > > In the command > > > > hw4 histo -t=period -i=which [file] > > > > I am not bale to understand the meaning and use of " -i=which" > > parameter, the spec says that which means the one based index for > > the alphabet. I am not bale to understand that. > > I would really appreciate if you could clarify my doubt > > Assuming that the period is T, then there are T mono-alphabetic > substitution ciphers that we need to deal with and we can only > crack one at a time. One way to deal with a mono-alphabetic > substitution ciphers is to get the letter frequencies and that's > what the histo command tries to do. > > The "-i=which" commandline option tell you which one of the > T mono-alphabetic substitution ciphers to crack. The "which" > value must be between 1 and T, inclusive. If "-i=1" is > specified, you should only generate statistics for the > following characters in the input (the very first character > in the input is called character 1, that's what "one based" > index meant): > > i, i+T, i+2*T, i+3*T, i+4*T, ... > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 8 08:05:58 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k98F5w5H017739 for ; Sun, 8 Oct 2006 08:05:58 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k98F3oK2031114 for ; Sun, 8 Oct 2006 08:03:50 -0700 Message-Id: <200610081503.k98F3oK2031114@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS 599 HW3 grade... Date: Sun, 08 Oct 2006 08:03:50 -0700 From: william@bourbon.usc.edu Hi, Just realized that I've made a mistake in the score breakdown... The scores are correct, but the description was wrong. It should be: README/documentation: rc4 (A): x1 (B): x2 (C): x3 (D): x4 (E): x5 (F): various errors: and *not*: README/documentation: stream (A): encrypt (B): merge (C): decrypt (D): whole thing (E): whole thing (F): various errors: Sorry about the mistake! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 7 22:23:01 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k985N1mn018507 for ; Sat, 7 Oct 2006 22:23:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k985KssG032161 for ; Sat, 7 Oct 2006 22:20:54 -0700 Message-Id: <200610080520.k985KssG032161@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci 599 h/w4 Date: Sat, 07 Oct 2006 22:20:54 -0700 From: william@bourbon.usc.edu Someone wrote: > Is the input to the "histo" command always a .ct file? > or do we need to first encrypt the given file and then > output the frequencies of chars? The input is always an ASCII text file. The filename extension has no meaning. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Oct 7 21:59:08 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k984x8BK016858 for ; Sat, 7 Oct 2006 21:59:08 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k984v1EQ031869 for ; Sat, 7 Oct 2006 21:57:01 -0700 Message-Id: <200610080457.k984v1EQ031869@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] Attacks on RC4 Date: Sat, 07 Oct 2006 21:57:01 -0700 From: william@bourbon.usc.edu Someone wrote: > In the command > > hw4 histo -t=period -i=which [file] > > I am not bale to understand the meaning and use of " -i=which" > parameter, the spec says that which means the one based index for > the alphabet. I am not bale to understand that. > I would really appreciate if you could clarify my doubt Assuming that the period is T, then there are T mono-alphabetic substitution ciphers that we need to deal with and we can only crack one at a time. One way to deal with a mono-alphabetic substitution ciphers is to get the letter frequencies and that's what the histo command tries to do. The "-i=which" commandline option tell you which one of the T mono-alphabetic substitution ciphers to crack. The "which" value must be between 1 and T, inclusive. If "-i=1" is specified, you should only generate statistics for the following characters in the input (the very first character in the input is called character 1, that's what "one based" index meant): i, i+T, i+2*T, i+3*T, i+4*T, ... -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 6 15:33:41 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k96MXfBF030294 for ; Fri, 6 Oct 2006 15:33:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k96MVc7r016190 for ; Fri, 6 Oct 2006 15:31:38 -0700 Message-Id: <200610062231.k96MVc7r016190@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] Attacks on RC4 Date: Fri, 06 Oct 2006 15:31:38 -0700 From: william@bourbon.usc.edu Someone wrote: > In your slide 28 of lecture 12, the slide says "no public cryptanalytic > results". > What about this: > http://www.wisdom.weizmann.ac.il/~itsik/RC4/Papers/Rc4_ksa.ps You are absolutely correct. I totally forgot about this very famous work by Fluhrer, Mantin and Shamir. A brief description about this can be found at: http://en.wikipedia.org/wiki/RC4#Fluhrer.2C_Mantin_and_Shamir_attack The textbook was written in 1996 and the above paper was written in 2001. The break was primarily for recovering the long-term key used in the key scheduling algorithm of RC4 (such as the one used in the WEP protocol). Thanks for pointing it out! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 6 14:35:15 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k96LZFGQ026601 for ; Fri, 6 Oct 2006 14:35:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k96LXDR8015676 for ; Fri, 6 Oct 2006 14:33:13 -0700 Message-Id: <200610062133.k96LXDR8015676@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci 599 h/w4 Date: Fri, 06 Oct 2006 14:33:13 -0700 From: william@bourbon.usc.edu Someone wrote: > Oh ok , I just got things mixed up. I was using the hardcoded > file to store my results and dint send the output to stdout > as I read somewhere that output of that command is a keyfile. > Thanx alot for clearing the doubts. Please also remember that if you want to create temporary files, it must be in /tmp. And, you should use mkstemp() or equivalent. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Friday, October 6, 2006 12:57 pm Subject: Re: csci 599 h/w4 To: csac@merlot.usc.edu > Someone wrote: > > > The specs say "keygen : The output of this command is a > > key file Each line is exactly 26 characters long (lowercase > > English characters) and is terminated with a '\n' character." > > In UNIX, stdout is basically a file! And it's often > redirected to a file. > > > I did that. Created a file called "keygen.keys" (which will be > > used to encrypt ascii text) and wrote the output of hw4 keygen > > -t=period command there. > > The spec says nothing about what using a hard-coded filename > for output. > > > I dint read anything on the specs that said we need to output the > > "hw4 keygen -t" output to stdout. > > and yea the x1.keys or x2.keys.....x7.keys are blank. but as i > > said earlier the keyfile that i generate has the correct output. > > The spec says: > > Output of your program must go to stdout and error messages > must go to stderr. > > It's usually a very bad practice to hardcode the name of an > output file (unless some spec calls for it specifically). > -- > Bill Cheng // bill.cheng@usc.edu > > > > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Friday, October 6, 2006 12:06 pm > Subject: Re: csci 599 h/w4 > To: csac@merlot.usc.edu > > > Someone wrote: > > > > > When i run the grading script for keygen it says pass in > all the > > > files. > > > when I check the files created in my local directory the files > > > i.e the .keys files, they are blank. But the output does get > > > written into 'my' file i.e the file that i create. > > > Is that ok? > > > > I'm not sure what you are saying... If you run: > > > > ./hw4 keygen -t=10 > x1.keys > > > > Is x1.keys blank? If it is blank, your program is not > > doing the right thing. The output must go to stdout. > > I don't know what you meant by "the files that you create". > > Are you generating output in using specific filenames? > > That's certainly not in the spec. > > > > The checkKeys program just check if each line in your input > > has all the letters from 'a' through 'z'. > > -- > > Bill Cheng // bill.cheng@usc.edu > > > > > > > > ----- Original Message ----- > > From: william@bourbon.usc.edu > > Date: Thursday, October 5, 2006 1:36 pm > > Subject: Re: csci 599 h/w4 > > To: csac@merlot.usc.edu > > > > > Someone wrote: > > > > > > > So for each new line that we generate for the keygen > file we > > > > need to call gettimeofday() > > > > and the current time will be used as the passphrase to > generate > > > the key which should be in put to the key > scheduling algo? > > > > Is my understanding correct? > > > > > > Again, this is not spepcified in the spec. If you feel this > > > is reasonable and generate random enough looking data, please > > > go ahead! (As you can see from the grading guidelines, we > > > don't do too much. You can also run the checkKey script to > > > make sure your output passes the simple integrity check.) > > > -- > > > Bill Cheng // bill.cheng@usc.edu > > > > > > > > > > > > ----- Original Message ----- > > > From: william@bourbon.usc.edu > > > Date: Wednesday, October 4, 2006 4:14 pm > > > Subject: Re: csci 599 h/w4 > > > To: csac@merlot.usc.edu > > > > > > > Someone wrote: > > > > > > > > > As you have mentioned in the mail below, suppose we > use > > the key > > > > > generation algo with S of size 26 then at the end of > the key > > > > > generation algo with 26 iteration, we will get the > scrambled > > > > version of S. But this will correspond to > only one line > > in the > > > > > keyfile. > > > > > > > > > > So now to generate the next line, do we use this > > scrambled > > > S as > > > > > the input S array and execute the key generation algo > > again on > > > > > this new S ? > > > > > > > > Sure, why not?! Or you can call gettimeofday() and get > another > > > microsecond resolution clock, reset S[], and > start again. > > Again, > > anything that's reasonable. > > > > -- > > > > Bill Cheng // bill.cheng@usc.edu > > > > > > > > > > > > ----- Original Message ----- > > > > From: william@bourbon.usc.edu > > > > Date: Wednesday, October 4, 2006 12:59 pm > > > > Subject: Re: csci 599 h/w4 > > > > To: csac@merlot.usc.edu > > > > > > > > > Someone wrote: > > > > > > > > > > > I am not able to understand how can we implement > key > > > scheduling > > > algorithm to generate the keygen file. > > > > > > > > > > > > Do we have to use "abcd...z" as the key and then > use > > > that > > > > in the > > > > > > key scheduling algorithm? > > > > > > > > > > The spec says: > > > > > > > > > > ...and use the current date and time as the key. > > > > > > > > > > You can map 'a' to 0, 'b' to 1, ... 'z' to 25. So, > at the > > > > > beginning of the key scheduling algorith, S[0..25] > can be > > > > > thought of as initialized with "abcd...z". > > > > > > > > > > > And then do we need to use the output of the > output > > > > algorithm to > > > > > > generate the key gen file? > > > > > > > > > > At the end of the key scheduling algorithm, you can just > > > > > output the states S[0..25]. You do not need to run the > > > > > output algorithm at all. > > > > > > > > > > Again, this is just a suggestion. You can use other > methods > > > > (one I mentioned in class) as a way to > generate a random > > > > > permutation. > > > > > -- > > > > > Bill Cheng // bill.cheng@usc.edu > > > > > Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 6 12:58:42 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k96JwgOH020483 for ; Fri, 6 Oct 2006 12:58:42 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k96JueWB014291 for ; Fri, 6 Oct 2006 12:56:40 -0700 Message-Id: <200610061956.k96JueWB014291@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci 599 h/w4 Date: Fri, 06 Oct 2006 12:56:40 -0700 From: william@bourbon.usc.edu Someone wrote: > The specs say "keygen : The output of this command is a > key file Each line is exactly 26 characters long (lowercase > English characters) and is terminated with a '\n' character." In UNIX, stdout is basically a file! And it's often redirected to a file. > I did that. Created a file called "keygen.keys" (which will be > used to encrypt ascii text) and wrote the output of hw4 keygen > -t=period command there. The spec says nothing about what using a hard-coded filename for output. > I dint read anything on the specs that said we need to output the > "hw4 keygen -t" output to stdout. > and yea the x1.keys or x2.keys.....x7.keys are blank. but as i > said earlier the keyfile that i generate has the correct output. The spec says: Output of your program must go to stdout and error messages must go to stderr. It's usually a very bad practice to hardcode the name of an output file (unless some spec calls for it specifically). -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Friday, October 6, 2006 12:06 pm Subject: Re: csci 599 h/w4 To: csac@merlot.usc.edu > Someone wrote: > > > When i run the grading script for keygen it says pass in all the > > files. > > when I check the files created in my local directory the files > > i.e the .keys files, they are blank. But the output does get > > written into 'my' file i.e the file that i create. > > Is that ok? > > I'm not sure what you are saying... If you run: > > ./hw4 keygen -t=10 > x1.keys > > Is x1.keys blank? If it is blank, your program is not > doing the right thing. The output must go to stdout. > I don't know what you meant by "the files that you create". > Are you generating output in using specific filenames? > That's certainly not in the spec. > > The checkKeys program just check if each line in your input > has all the letters from 'a' through 'z'. > -- > Bill Cheng // bill.cheng@usc.edu > > > > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Thursday, October 5, 2006 1:36 pm > Subject: Re: csci 599 h/w4 > To: csac@merlot.usc.edu > > > Someone wrote: > > > > > So for each new line that we generate for the keygen file we > > > need to call gettimeofday() > > > and the current time will be used as the passphrase to generate > > > the key which should be in put to the key scheduling algo? > > > Is my understanding correct? > > > > Again, this is not spepcified in the spec. If you feel this > > is reasonable and generate random enough looking data, please > > go ahead! (As you can see from the grading guidelines, we > > don't do too much. You can also run the checkKey script to > > make sure your output passes the simple integrity check.) > > -- > > Bill Cheng // bill.cheng@usc.edu > > > > > > > > ----- Original Message ----- > > From: william@bourbon.usc.edu > > Date: Wednesday, October 4, 2006 4:14 pm > > Subject: Re: csci 599 h/w4 > > To: csac@merlot.usc.edu > > > > > Someone wrote: > > > > > > > As you have mentioned in the mail below, suppose we use > the key > > > > generation algo with S of size 26 then at the end of the key > > > > generation algo with 26 iteration, we will get the scrambled > > > > version of S. But this will correspond to only one line > in the > > > > keyfile. > > > > > > > > So now to generate the next line, do we use this > scrambled > > S as > > > > the input S array and execute the key generation algo > again on > > > > this new S ? > > > > > > Sure, why not?! Or you can call gettimeofday() and get another > > > microsecond resolution clock, reset S[], and start again. > Again, > > anything that's reasonable. > > > -- > > > Bill Cheng // bill.cheng@usc.edu > > > > > > > > > ----- Original Message ----- > > > From: william@bourbon.usc.edu > > > Date: Wednesday, October 4, 2006 12:59 pm > > > Subject: Re: csci 599 h/w4 > > > To: csac@merlot.usc.edu > > > > > > > Someone wrote: > > > > > > > > > I am not able to understand how can we implement key > > scheduling > > > algorithm to generate the keygen file. > > > > > > > > > > Do we have to use "abcd...z" as the key and then use > > that > > > in the > > > > > key scheduling algorithm? > > > > > > > > The spec says: > > > > > > > > ...and use the current date and time as the key. > > > > > > > > You can map 'a' to 0, 'b' to 1, ... 'z' to 25. So, at the > > > > beginning of the key scheduling algorith, S[0..25] can be > > > > thought of as initialized with "abcd...z". > > > > > > > > > And then do we need to use the output of the output > > > algorithm to > > > > > generate the key gen file? > > > > > > > > At the end of the key scheduling algorithm, you can just > > > > output the states S[0..25]. You do not need to run the > > > > output algorithm at all. > > > > > > > > Again, this is just a suggestion. You can use other methods > > > > (one I mentioned in class) as a way to generate a random > > > > permutation. > > > > -- > > > > Bill Cheng // bill.cheng@usc.edu > > > > Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Oct 6 12:06:55 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k96J6svT017207 for ; Fri, 6 Oct 2006 12:06:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k96J4rO4013639 for ; Fri, 6 Oct 2006 12:04:53 -0700 Message-Id: <200610061904.k96J4rO4013639@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci 599 h/w4 Date: Fri, 06 Oct 2006 12:04:53 -0700 From: william@bourbon.usc.edu Someone wrote: > When i run the grading script for keygen it says pass in all the > files. > when I check the files created in my local directory the files > i.e the .keys files, they are blank. But the output does get > written into 'my' file i.e the file that i create. > Is that ok? I'm not sure what you are saying... If you run: ./hw4 keygen -t=10 > x1.keys Is x1.keys blank? If it is blank, your program is not doing the right thing. The output must go to stdout. I don't know what you meant by "the files that you create". Are you generating output in using specific filenames? That's certainly not in the spec. The checkKeys program just check if each line in your input has all the letters from 'a' through 'z'. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Thursday, October 5, 2006 1:36 pm Subject: Re: csci 599 h/w4 To: csac@merlot.usc.edu > Someone wrote: > > > So for each new line that we generate for the keygen file we > > need to call gettimeofday() > > and the current time will be used as the passphrase to generate > > the key which should be in put to the key scheduling algo? > > Is my understanding correct? > > Again, this is not spepcified in the spec. If you feel this > is reasonable and generate random enough looking data, please > go ahead! (As you can see from the grading guidelines, we > don't do too much. You can also run the checkKey script to > make sure your output passes the simple integrity check.) > -- > Bill Cheng // bill.cheng@usc.edu > > > > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Wednesday, October 4, 2006 4:14 pm > Subject: Re: csci 599 h/w4 > To: csac@merlot.usc.edu > > > Someone wrote: > > > > > As you have mentioned in the mail below, suppose we use the key > > > generation algo with S of size 26 then at the end of the key > > > generation algo with 26 iteration, we will get the scrambled > > > version of S. But this will correspond to only one line in the > > > keyfile. > > > > > > So now to generate the next line, do we use this scrambled > S as > > > the input S array and execute the key generation algo again on > > > this new S ? > > > > Sure, why not?! Or you can call gettimeofday() and get another > > microsecond resolution clock, reset S[], and start again. Again, > > anything that's reasonable. > > -- > > Bill Cheng // bill.cheng@usc.edu > > > > > > ----- Original Message ----- > > From: william@bourbon.usc.edu > > Date: Wednesday, October 4, 2006 12:59 pm > > Subject: Re: csci 599 h/w4 > > To: csac@merlot.usc.edu > > > > > Someone wrote: > > > > > > > I am not able to understand how can we implement key > scheduling > > > algorithm to generate the keygen file. > > > > > > > > Do we have to use "abcd...z" as the key and then use > that > > in the > > > > key scheduling algorithm? > > > > > > The spec says: > > > > > > ...and use the current date and time as the key. > > > > > > You can map 'a' to 0, 'b' to 1, ... 'z' to 25. So, at the > > > beginning of the key scheduling algorith, S[0..25] can be > > > thought of as initialized with "abcd...z". > > > > > > > And then do we need to use the output of the output > > algorithm to > > > > generate the key gen file? > > > > > > At the end of the key scheduling algorithm, you can just > > > output the states S[0..25]. You do not need to run the > > > output algorithm at all. > > > > > > Again, this is just a suggestion. You can use other methods > > > (one I mentioned in class) as a way to generate a random > > > permutation. > > > -- > > > Bill Cheng // bill.cheng@usc.edu > > > Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 5 13:37:33 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k95KbXna028435 for ; Thu, 5 Oct 2006 13:37:33 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k95KZZsZ029832 for ; Thu, 5 Oct 2006 13:35:35 -0700 Message-Id: <200610052035.k95KZZsZ029832@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci 599 h/w4 Date: Thu, 05 Oct 2006 13:35:35 -0700 From: william@bourbon.usc.edu Someone wrote: > So for each new line that we generate for the keygen file we > need to call gettimeofday() > and the current time will be used as the passphrase to generate > the key which should be in put to the key scheduling algo? > Is my understanding correct? Again, this is not spepcified in the spec. If you feel this is reasonable and generate random enough looking data, please go ahead! (As you can see from the grading guidelines, we don't do too much. You can also run the checkKey script to make sure your output passes the simple integrity check.) -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Wednesday, October 4, 2006 4:14 pm Subject: Re: csci 599 h/w4 To: csac@merlot.usc.edu > Someone wrote: > > > As you have mentioned in the mail below, suppose we use the key > > generation algo with S of size 26 then at the end of the key > > generation algo with 26 iteration, we will get the scrambled > > version of S. But this will correspond to only one line in the > > keyfile. > > > > So now to generate the next line, do we use this scrambled S as > > the input S array and execute the key generation algo again on > > this new S ? > > Sure, why not?! Or you can call gettimeofday() and get another > microsecond resolution clock, reset S[], and start again. Again, > anything that's reasonable. > -- > Bill Cheng // bill.cheng@usc.edu > > > ----- Original Message ----- > From: william@bourbon.usc.edu > Date: Wednesday, October 4, 2006 12:59 pm > Subject: Re: csci 599 h/w4 > To: csac@merlot.usc.edu > > > Someone wrote: > > > > > I am not able to understand how can we implement key scheduling > > > algorithm to generate the keygen file. > > > > > > Do we have to use "abcd...z" as the key and then use that > in the > > > key scheduling algorithm? > > > > The spec says: > > > > ...and use the current date and time as the key. > > > > You can map 'a' to 0, 'b' to 1, ... 'z' to 25. So, at the > > beginning of the key scheduling algorith, S[0..25] can be > > thought of as initialized with "abcd...z". > > > > > And then do we need to use the output of the output > algorithm to > > > generate the key gen file? > > > > At the end of the key scheduling algorithm, you can just > > output the states S[0..25]. You do not need to run the > > output algorithm at all. > > > > Again, this is just a suggestion. You can use other methods > > (one I mentioned in class) as a way to generate a random > > permutation. > > -- > > Bill Cheng // bill.cheng@usc.edu > > Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Oct 5 09:42:35 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k95GgZmJ013270 for ; Thu, 5 Oct 2006 09:42:35 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k95Geb6p027545 for ; Thu, 5 Oct 2006 09:40:37 -0700 Message-Id: <200610051640.k95Geb6p027545@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599 hw4 query Date: Thu, 05 Oct 2006 09:40:37 -0700 From: william@bourbon.usc.edu Someone wrote: > In the histo part of the hw i am getting the output as > > z: 0 (0.00%) > u: 0 (0.00%) > q: 0 (0.00%) > c: 0 (0.00%) > the expected is > q: 0 (0.00%) > u: 0 (0.00%) > z: 0 (0.00%) > c: 0 (0.00%) > > could u please tell me as to how we have to sort the output. Also in > case of equality what is to be done? Please see my message with timestamp "Wed 04 Oct 13:22". -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 4 16:14:52 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k94NEqC4011714 for ; Wed, 4 Oct 2006 16:14:52 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k94NCvNa018887 for ; Wed, 4 Oct 2006 16:12:57 -0700 Message-Id: <200610042312.k94NCvNa018887@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci 599 h/w4 Date: Wed, 04 Oct 2006 16:12:56 -0700 From: william@bourbon.usc.edu Someone wrote: > As you have mentioned in the mail below, suppose we use the key > generation algo with S of size 26 then at the end of the key > generation algo with 26 iteration, we will get the scrambled > version of S. But this will correspond to only one line in the > keyfile. > > So now to generate the next line, do we use this scrambled S as > the input S array and execute the key generation algo again on > this new S ? Sure, why not?! Or you can call gettimeofday() and get another microsecond resolution clock, reset S[], and start again. Again, anything that's reasonable. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Wednesday, October 4, 2006 12:59 pm Subject: Re: csci 599 h/w4 To: csac@merlot.usc.edu > Someone wrote: > > > I am not able to understand how can we implement key scheduling > > algorithm to generate the keygen file. > > > > Do we have to use "abcd...z" as the key and then use that in the > > key scheduling algorithm? > > The spec says: > > ...and use the current date and time as the key. > > You can map 'a' to 0, 'b' to 1, ... 'z' to 25. So, at the > beginning of the key scheduling algorith, S[0..25] can be > thought of as initialized with "abcd...z". > > > And then do we need to use the output of the output algorithm to > > generate the key gen file? > > At the end of the key scheduling algorithm, you can just > output the states S[0..25]. You do not need to run the > output algorithm at all. > > Again, this is just a suggestion. You can use other methods > (one I mentioned in class) as a way to generate a random > permutation. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 4 13:24:21 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k94KOLOe000886 for ; Wed, 4 Oct 2006 13:24:21 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k94KMQSJ017177 for ; Wed, 4 Oct 2006 13:22:26 -0700 Message-Id: <200610042022.k94KMQSJ017177@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW4 Date: Wed, 04 Oct 2006 13:22:26 -0700 From: william@bourbon.usc.edu Someone wrote: > While running the grading guideline for histo I found out that the > order of characters differs between your output and mine. This is > because of the sorting algorithm used. For example, both characters > 'c' and 'g' have 5 occurences. Your output can show 'c' followed by > 'g', but mine shows 'g' followed by 'c'. What should I do to fit your > output? No. There is no tie breaking rule. So, you may output in any order if there is a tie. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 4 13:04:24 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k94K4Oal032089 for ; Wed, 4 Oct 2006 13:04:24 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k94K2UJG016681 for ; Wed, 4 Oct 2006 13:02:30 -0700 Message-Id: <200610042002.k94K2UJG016681@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW4 query Date: Wed, 04 Oct 2006 13:02:30 -0700 From: william@bourbon.usc.edu Someone wrote: > Could you please explain the significance of period and 'i' in the > command histo > i.e. how we have to find the frequency based on that.. > i am not getting how exactly we have to go about for histo command If period is T, then i can only range from 1 through T. You are suppose to look only at characters i, i+T, i+2T, i+3T, ... in the input and compute the frequence of each letter. If there are a total of N characters at positions i, i+T, i+2T, ..., and a particular letter occurs m times, then the frequency for this letter is m/N. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 4 13:00:33 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k94K0XWP031821 for ; Wed, 4 Oct 2006 13:00:33 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k94JwcVb016610 for ; Wed, 4 Oct 2006 12:58:38 -0700 Message-Id: <200610041958.k94JwcVb016610@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci 599 h/w4 Date: Wed, 04 Oct 2006 12:58:38 -0700 From: william@bourbon.usc.edu Someone wrote: > I am not able to understand how can we implement key scheduling > algorithm to generate the keygen file. > > Do we have to use "abcd...z" as the key and then use that in the > key scheduling algorithm? The spec says: ...and use the current date and time as the key. You can map 'a' to 0, 'b' to 1, ... 'z' to 25. So, at the beginning of the key scheduling algorith, S[0..25] can be thought of as initialized with "abcd...z". > And then do we need to use the output of the output algorithm to > generate the key gen file? At the end of the key scheduling algorithm, you can just output the states S[0..25]. You do not need to run the output algorithm at all. Again, this is just a suggestion. You can use other methods (one I mentioned in class) as a way to generate a random permutation. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 3 21:43:45 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k944hjYE005806 for ; Tue, 3 Oct 2006 21:43:45 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k944frse008247 for ; Tue, 3 Oct 2006 21:41:53 -0700 Message-Id: <200610040441.k944frse008247@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW4 Date: Tue, 03 Oct 2006 21:41:53 -0700 From: william@bourbon.usc.edu Someone wrote: > There is a bug in grading guidelines for decrypting. Line "/bin/rm -f > f?.invkeys" should be changed to " /bin/rm -f f?.pt" You are correct. It's fixed now. Thanks for catching it. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Oct 3 09:51:32 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k93GpWgj024423 for ; Tue, 3 Oct 2006 09:51:32 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k93Gnf6Q001570 for ; Tue, 3 Oct 2006 09:49:41 -0700 Message-Id: <200610031649.k93Gnf6Q001570@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599 hw4 query Date: Tue, 03 Oct 2006 09:49:41 -0700 From: william@bourbon.usc.edu Someone wrote: > could you please guide me with the foll. > > 1. In Vigenère cipher we usually take a keyword and perform encryption > accordingly... but in the spec it is give that we have to generate a key > file based on period , i have understood that, but i am not getting how > to create the key file i mean how & what algorithm or permutation we > should use for generating both keys and inverse keys. In the spec, it is suggested that you can use the key scheduling algorithm of RC4. The key scheduling algorithm of RC4 fills S[0..255] with 0 through 255 and then perform a permutation on S[] based on a key. If you rewrite the key scheduling algorithm of RC4 using S[0..25], you will get a random permutation of 26 values. If this is still not clear, you should probably come see me during my office hour or make an appointment. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Oct 1 00:12:10 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k917CAKT028197 for ; Sun, 1 Oct 2006 00:12:10 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k917ASxp007911 for ; Sun, 1 Oct 2006 00:10:28 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id k917ASbO007910 for csac@merlot; Sun, 1 Oct 2006 00:10:28 -0700 Date: Sun, 1 Oct 2006 00:10:28 -0700 From: william@bourbon.usc.edu Message-Id: <200610010710.k917ASbO007910@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: HW4 spec... Hi, HW4 spec is available on the web. The course materials for most of the commands have been covered. The only exception is the "solve" command. We should be able to get to it by Thursday. I'll talk a little bit about it at the beginning of class on Tuesday. Please bring questions about HW4 if you have them. Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Sep 30 07:48:04 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8UEm4Mu027656 for ; Sat, 30 Sep 2006 07:48:04 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8UEkO49030970 for ; Sat, 30 Sep 2006 07:46:24 -0700 Message-Id: <200609301446.k8UEkO49030970@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] Can we use openssl for the RC4 generation? Date: Sat, 30 Sep 2006 07:46:24 -0700 From: william@bourbon.usc.edu Someone wrote: > Ok, based on your summary below then, hw3 rc4 -p="passphrase" -l=20 > means: > Use "passphrase" in *key generation algorithm*, which will produce a > 256-byte key=K1. > Then, use K1 in the *key scheduling algorithm*, along with '20' as the > value of L. > This creates the S[] for use in the *output algorithm*, each byte of > which is XORed with one byte of plaintext input to produce the > ciphertext for the statistics. A couple of things was wrong... L is not the "l" in the key scheduling algorithm. The "l" in the key scheduling algorithm is the length of K1, which is 256, a constant, as far as HW3 is concerned. Also the last sentense was incorrect. There is no plaintext! You only need to run the *output algorithm* to output L=20 bytes. > For hw3 rc4 -p="passphrase" -states; use "passphrase" in the *key > generation algorithm* to generate a 256-byte key=K2 use this in the *key > scheduling algorithm* but with no L value (so its always K2 mod 256). > Output S[0]-S[256] from each iteration of *key scheduling algorithm*. Only the last sentense was incorrect. Ouput S[0] through S[255] *at the end* of the key scheduling algorithm. -- Bill Cheng // bill.cheng@usc.edu >>To summarize: Rc4 -p=passphrase -l=20 means we generate a 20 byte key using the *output* algorithm at: http://merlot.usc.edu/csac-f06/rc4.html#output to generate a 256-byte key for the *key scheduling* algorithm, which is specified at: http://merlot.usc.edu/csac-f06/rc4.html#keysched please use the *key generation* algorithm at: http://merlot.usc.edu/csac-f06/homeworks/hw3/#keygen > Rc4 -p=passphrase -states means we generate a 256 byte key? I'm not > following what happens here. Please advise. This means that you should run the *key generation* algorithm in HW3 to generate a 256-byte key, and use this key in the *key scheduling* algorithm of RC4. Output the 256 internal states at the end of the *key scheduling* algorithm of RC4. (You do not need to run the *output* algorithm of RC4.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Sep 29 22:41:54 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8U5fsm7023539 for ; Fri, 29 Sep 2006 22:41:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8U5eFVJ026432 for ; Fri, 29 Sep 2006 22:40:15 -0700 Message-Id: <200609300540.k8U5eFVJ026432@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] Can we use openssl for the RC4 generation? Date: Fri, 29 Sep 2006 22:40:15 -0700 From: william@bourbon.usc.edu Someone wrote: > Ok, I thought I understood, but the more I read into it the more I am > confused. > > Rc4 -p=passphrase -l=20 means we generate a 20 byte key using the key > generation algorithm at: > > http://merlot.usc.edu/csac-f06/homeworks/hw3/#keygen > > and then use the key in the rc4 algorithm at > > http://merlot.usc.edu/csac-f06/rc4.html#keysched Unfortunately, the terminology may have been what was confusing... RC4 has two parts, the first part is called "key scheduling" and that's where it permutes its 256 internal states according to a "key". The 2nd part of RC4 is called "output" and that's where it output a sequence of bytes, which can be used as "keys" for a stream cipher! Unfortunately, the word "key" appears too many times above! The first part of RC4 needs a "key". To generate this "key" for it, HW3 spec has a "key generation" algorithm. To summarize: Rc4 -p=passphrase -l=20 means we generate a 20 byte key using the *output* algorithm at: http://merlot.usc.edu/csac-f06/rc4.html#output to generate a 256-byte key for the *key scheduling* algorithm, which is specified at: http://merlot.usc.edu/csac-f06/rc4.html#keysched please use the *key generation* algorithm at: http://merlot.usc.edu/csac-f06/homeworks/hw3/#keygen > Rc4 -p=passphrase -states means we generate a 256 byte key? I'm not > following what happens here. Please advise. This means that you should run the *key generation* algorithm in HW3 to generate a 256-byte key, and use this key in the *key scheduling* algorithm of RC4. Output the 256 internal states at the end of the *key scheduling* algorithm of RC4. (You do not need to run the *output* algorithm of RC4.) -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: william@bourbon.usc.edu [mailto:william@bourbon.usc.edu] Sent: Monday, September 25, 2006 7:30 PM To: csac@merlot.usc.edu Subject: Re: [cs599] Can we use openssl for the RC4 generation? Someone wrote: > Can we use openssl for the RC4 generation? > I don't see anything in the Homework specification forbidding it. Hmm... you are right that nothing in the spec forbids it! But, since we are implementing exactly the RC4 algorithm, I would say that the spirit of the spec should imply that you do not use openssl's RC4 implementation. Here's what I'm going to do... I'll change the spec to require the output of the 256 internal states and I'll give a one day extension for this change. The spec change will be posted tonight. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Sep 29 22:27:32 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8U5RWZR022600 for ; Fri, 29 Sep 2006 22:27:32 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8U5PsuU026256 for ; Fri, 29 Sep 2006 22:25:54 -0700 Message-Id: <200609300525.k8U5PsuU026256@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW3 Date: Fri, 29 Sep 2006 22:25:54 -0700 From: william@bourbon.usc.edu Someone wrote: > I think I missed something about autocorrelation test. > > 1. It is said that A(d) is the number of bits in s not equal to their > d shifts. In the given formula for calculating A(d), there is a XOR > operation on original and shifted sequence S(i) XOR S(i+d). Although > when we XOR two sequences, result does not give us the number of bits > that differ, the number of 1's in the result gives it. I'm not sure why you would say that. When you XOR two bits, you get a 1 if they are different and you get a 0 if they are the same. So, A(d) sounds to me to be exactly what it was advertised to be. > 2. What kind of shift operation do we have to perform? Left or right? > Since when we do left shift the number of bits that differ is > different from that of the right shift. AFAIU we must shift the whole > input by some number of bits. You need to follow the equation exactly. Since d can be large, you really are not shifting. You should XOR the correct bits together, according to the equation. Please see my message with timestamp "Thu 28 Sep 10:33". -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 28 20:02:39 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8T32d7L014699 for ; Thu, 28 Sep 2006 20:02:39 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8T315oP008241 for ; Thu, 28 Sep 2006 20:01:05 -0700 Message-Id: <200609290301.k8T315oP008241@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW3 Date: Thu, 28 Sep 2006 20:01:05 -0700 From: william@bourbon.usc.edu Someone wrote: > For X4 test, can we assume that k (largest i for which Ei >= 5) is 30 > for any input since > n >= 20 * 2^i + i - 3 for i=30 n >= 20*2^30 + 27 (which is greater > than 1 GB). If your calculation is correct (I didn't check it), then it's fine. In my message with timestamp "Wed 27 Sep 15:42", I did say 1GB. Please remember that I also have a disk quota on nunki and I cannot create a file close to 1GB! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 28 19:54:31 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8T2sV7V014150 for ; Thu, 28 Sep 2006 19:54:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8T2quOS008012 for ; Thu, 28 Sep 2006 19:52:56 -0700 Message-Id: <200609290252.k8T2quOS008012@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW3 Date: Thu, 28 Sep 2006 19:52:56 -0700 From: william@bourbon.usc.edu Someone wrote: > In case if the input is insufficient or large, should we still print > the hexdump and then give an error message or no hexdump is required? > My program does the hexdump and then gives error messages. Either way would be fine, as long as you print the error message. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 28 19:51:37 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8T2pbWG013878 for ; Thu, 28 Sep 2006 19:51:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8T2o3iu007934 for ; Thu, 28 Sep 2006 19:50:03 -0700 Message-Id: <200609290250.k8T2o3iu007934@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: hw3 Date: Thu, 28 Sep 2006 19:50:03 -0700 From: william@bourbon.usc.edu Someone wrote: > In the grading guideline, in the last 3 tests for X5, your > output says fail although X5 is smaller than 0. X5 is a two-sided test. You should check the absolute value. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 28 10:35:27 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8SHZRN9009572 for ; Thu, 28 Sep 2006 10:35:27 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8SHXsYY002192 for ; Thu, 28 Sep 2006 10:33:55 -0700 Message-Id: <200609281733.k8SHXsYY002192@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] buffer size for large d in x5 Date: Thu, 28 Sep 2006 10:33:54 -0700 From: william@bourbon.usc.edu Someone wrote: > If d is greater than 4096x8 for the x5 test, how should we handle it given > that we aren't allowed to have a file I/O buffer that big? Since the only limit for d is n/2, you are correct that you need to consider handling very large d. One easy thing I can think of is to write the input into two temporary files. Then read one from the beginning and read another one from byte offset d/8 (you need to skip d mod 8 bits). -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 28 00:02:13 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8S72D2k032555 for ; Thu, 28 Sep 2006 00:02:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8S70gTg028867 for ; Thu, 28 Sep 2006 00:00:42 -0700 Message-Id: <200609280700.k8S70gTg028867@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW3 Date: Thu, 28 Sep 2006 00:00:42 -0700 From: william@bourbon.usc.edu Someone wrote: > Some may consider using FILE *tmpfile (void). Yes. What I meant to say was to use mkstemp() or equivalent. -- Bill Cheng // bill.cheng@usc.edu On 9/27/06, william@bourbon.usc.edu wrote: > It's a good practice to make sure that you are using a unique > temporary file in a shared directory. If you use a fixed > filename, you may run into trouble! It's a good idea to be > able to run multiple instances of your program concurrently. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 27 22:29:51 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8S5TpQV026086 for ; Wed, 27 Sep 2006 22:29:51 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8S5SK8V028018 for ; Wed, 27 Sep 2006 22:28:20 -0700 Message-Id: <200609280528.k8S5SK8V028018@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW3 Date: Wed, 27 Sep 2006 22:28:20 -0700 From: william@bourbon.usc.edu Someone wrote: > What is the reason for using mkstemp() instead of just creating a > temporary file with ofstream? Is it just to eliminate testing whether > the file exists, such that there is no possibility to open an existing > file? It's a good practice to make sure that you are using a unique temporary file in a shared directory. If you use a fixed filename, you may run into trouble! It's a good idea to be able to run multiple instances of your program concurrently. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 27 15:48:07 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8RMm7PT031901 for ; Wed, 27 Sep 2006 15:48:07 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8RMkbDo021940 for ; Wed, 27 Sep 2006 15:46:37 -0700 Message-Id: <200609272246.k8RMkbDo021940@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] Autocorrelation Test Date: Wed, 27 Sep 2006 15:46:37 -0700 From: william@bourbon.usc.edu Someone wrote: > I am unable to understand the practical working / usage of the > autocorrelation test. Can you give some trivial example of how it helps > to reveal non-randomness? If d=8 and you are using an ASCII file, since the most significan bit of every character is 0, X5 can easily reveal that the input is not random. Autocorrelation is a very useful tool in detection repeating patterns in the input. The repeated patter does not even have to be identical every time. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 27 15:44:20 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8RMiKhe031632 for ; Wed, 27 Sep 2006 15:44:20 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8RMgobs021790 for ; Wed, 27 Sep 2006 15:42:50 -0700 Message-Id: <200609272242.k8RMgobs021790@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: input sizes Date: Wed, 27 Sep 2006 15:42:50 -0700 From: william@bourbon.usc.edu Someone wrote: > Could you provide limits to the number of bits of input that you will test > with? How about 1GB?! (Actually, I have quota on nunki too. So, I cannot even create a file that big.) > I would like to know so that I know if 64-bit integers are enough to perform > all the calculations. > > For instance, if you were to give an input of all zeros of size 2^33 bits (1 > GigaByte) for x1 then (n0 -n1)^2 would be on the order of 2^66 and > a 64-bit unsigned integer would not be sufficient. > > Can you provide assurances that you won't test with such input or should I > be looking into arbitrary precision math libraries? I can assure that using 64-bit integers will work. Please do not use arbitrary precision math libraries! That's for HW7. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 27 15:38:41 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8RMcfIU031204 for ; Wed, 27 Sep 2006 15:38:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8RMbBKT021672 for ; Wed, 27 Sep 2006 15:37:11 -0700 Message-Id: <200609272237.k8RMbBKT021672@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci599: Runs test? Date: Wed, 27 Sep 2006 15:37:11 -0700 From: william@bourbon.usc.edu Someone wrote: > I am confused when it comes to x4. What is a run? Is there an overlap? You should not count overlaps. Just look at the longest sequence. > For the string: > > 0001, if k=3 then what do we have? > 1 "length 1" run of 0's and 1 "length 2" run of 0's? I would intuitively > think that a run of length 1 is just a 0 or a 1, but looking at the > solutions given in the hw3 directory, this is not the case... For 0001, there is one run of zeroes of length 3 and a one run of ones of length 1. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Sep 26 16:25:59 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8QNPxHS003206 for ; Tue, 26 Sep 2006 16:25:59 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8QNOXG0006370 for ; Tue, 26 Sep 2006 16:24:33 -0700 Message-Id: <200609262324.k8QNOXG0006370@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: 24 hour extension for HW3... Date: Tue, 26 Sep 2006 16:24:33 -0700 From: william@bourbon.usc.edu Someone wrote: > In the new spec the memory buffer size limit only applies to File i/o, but > the grading guidelines do not reflect that. Fixed! Thanks for catching it! -- Bill Cheng // bill.cheng@usc.edu On 9/25/06, william@bourbon.usc.edu wrote: > > Hi, > > I've change the HW3 spec to add a "-state" commandline option > to the "rc4" command. I've also updated the grading > guidelines to test this command. Please take a look at them. > > Since this is a spec change (although a minor one), I've > extended the HW3 submission dateline by 24 hours. > -- > Bill Cheng // bill.cheng@usc.edu > > > > -----Original Message----- > Date: Mon, 25 Sep 2006 19:30:13 -0700 > From: william@bourbon.usc.edu > To: csac@merlot.usc.edu > Subject: Re: [cs599] Can we use openssl for the RC4 generation? > > Someone wrote: > > > Can we use openssl for the RC4 generation? > > I don't see anything in the Homework specification forbidding it. > > Hmm... you are right that nothing in the spec forbids it! > But, since we are implementing exactly the RC4 algorithm, > I would say that the spirit of the spec should imply that you > do not use openssl's RC4 implementation. > > Here's what I'm going to do... I'll change the spec to > require the output of the 256 internal states and I'll give > a one day extension for this change. The spec change will > be posted tonight. > -- > Bill Cheng // bill.cheng@usc.edu ; Tue, 26 Sep 2006 16:24:08 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8QNMgZ2006337 for ; Tue, 26 Sep 2006 16:22:42 -0700 Message-Id: <200609262322.k8QNMgZ2006337@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: RC4 new spec query Date: Tue, 26 Sep 2006 16:22:42 -0700 From: william@bourbon.usc.edu Someone wrote: > I am a bit confused regarding the new spec specified in the doc: > > You have mentioned that according to the new spec meaning of > command rc4 is as below; > > rc4 : Simulate the RC4 stream cipher. > [BC: Changed 9/25/2006] The ASCII string pphrase contains the > passphrase for key generation and len is the number of bytes to > output if the -states commandline option is not specified. If the > -states commandline option is specified, please ignore the -l > commandline option and output the 256 internal states at the end > of the key scheduling algorithm instead. > > And in the output section you have mentioned that; > > rc4 : [BC: Changed 9/25/2006] The output is a binary > stream of bytes of length len if the -states commandline option > is not specified. The output is a binary stream of bytes of > length 256 if the -states commandline option is specified. > > From the first para it looks as if we need to output all the > states which equals to 256 States * 256 bytes / state. Will you > please clarify what exactly the output should be in presence of > argument '-states' ? The S[] array contains only 256 *single-byte* elements. If "-states" is specified, you need to output the S[] array. I don't know why you said that a state is 256 bytes long. It's only one byte long. If you look at the bottom of the internal states for the example given in the spec: http://merlot.usc.edu/csac-f06/homeworks/hw3/states.txt you need to output the bytes (in binary) which comes after "At end of iteration 255:". -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Sep 26 16:18:11 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8QNIB5i002713 for ; Tue, 26 Sep 2006 16:18:11 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8QNGjHg006262 for ; Tue, 26 Sep 2006 16:16:45 -0700 Message-Id: <200609262316.k8QNGjHg006262@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci599: x3 buffer? Date: Tue, 26 Sep 2006 16:16:45 -0700 From: william@bourbon.usc.edu Someone wrote: > Using stat.h > And accessing the structure stat > we can get the total file size in bytes before reading the file. This works if you are reading a file. If data is coming from stdin, there is no way you can tell how many bytes are coming. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Monday, September 25, 2006 9:34 pm Subject: Re: csci599: x3 buffer? To: csac@merlot.usc.edu > Someone wrote: > > > It seems like we can only figure out how big m should be after > we take in > > all the data (know the total data size). Now, since we can have > a maximum > > buffer size of 4096 bytes, this means that we either need to > calculate ni's > > for all possible values of m (1-29) or we read in the input > twice. Are we > > just supposed to read in the input twice? Can we just make a > huge buffer > > instead? > > If your input is stdin, you cannot read it twice! So, the > only thing you can do, I think, is to write the data to a > temporary file as you read it the first time. Please use > mkstemp() to create a temporary file in /tmp. You can assume > that /tmp is always available for creating temporary files. > (Please do not create temporary files in the current working > directory.) > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Sep 26 16:17:05 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8QNH5rS002575 for ; Tue, 26 Sep 2006 16:17:05 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8QNFdPD006244 for ; Tue, 26 Sep 2006 16:15:39 -0700 Message-Id: <200609262315.k8QNFdPD006244@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: 24 hour extension for HW3... Date: Tue, 26 Sep 2006 16:15:39 -0700 From: william@bourbon.usc.edu Someone wrote: > I was just wondering, why doesnt this new addition of > functionality doesnt increase the points of the assignment i.e. > more than 100 points? Though its a minor change, it does involve > some more efforts than earlier! Because the overall assignment is still worth 100 points. Of course, this is my personal view... I guess you can also argue why hw1 is worth 50 points instead of 49 points. But there is no end to discussions like that. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Monday, September 25, 2006 9:54 pm Subject: 24 hour extension for HW3... To: csac@merlot.usc.edu > Hi, > > I've change the HW3 spec to add a "-state" commandline option > to the "rc4" command. I've also updated the grading > guidelines to test this command. Please take a look at them. > > Since this is a spec change (although a minor one), I've > extended the HW3 submission dateline by 24 hours. > -- > Bill Cheng // bill.cheng@usc.edu > > > > -----Original Message----- > Date: Mon, 25 Sep 2006 19:30:13 -0700 > From: william@bourbon.usc.edu > To: csac@merlot.usc.edu > Subject: Re: [cs599] Can we use openssl for the RC4 generation? > > Someone wrote: > > > Can we use openssl for the RC4 generation? > > I don't see anything in the Homework specification forbidding > it. > Hmm... you are right that nothing in the spec forbids it! > But, since we are implementing exactly the RC4 algorithm, > I would say that the spirit of the spec should imply that you > do not use openssl's RC4 implementation. > > Here's what I'm going to do... I'll change the spec to > require the output of the 256 internal states and I'll give > a one day extension for this change. The spec change will > be posted tonight. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Sep 25 21:54:47 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8Q4sl3u026916 for ; Mon, 25 Sep 2006 21:54:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8Q4rNaF002804 for ; Mon, 25 Sep 2006 21:53:23 -0700 Message-Id: <200609260453.k8Q4rNaF002804@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: 24 hour extension for HW3... Date: Mon, 25 Sep 2006 21:53:23 -0700 From: william@bourbon.usc.edu Hi, I've change the HW3 spec to add a "-state" commandline option to the "rc4" command. I've also updated the grading guidelines to test this command. Please take a look at them. Since this is a spec change (although a minor one), I've extended the HW3 submission dateline by 24 hours. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Mon, 25 Sep 2006 19:30:13 -0700 From: william@bourbon.usc.edu To: csac@merlot.usc.edu Subject: Re: [cs599] Can we use openssl for the RC4 generation? Someone wrote: > Can we use openssl for the RC4 generation? > I don't see anything in the Homework specification forbidding it. Hmm... you are right that nothing in the spec forbids it! But, since we are implementing exactly the RC4 algorithm, I would say that the spirit of the spec should imply that you do not use openssl's RC4 implementation. Here's what I'm going to do... I'll change the spec to require the output of the 256 internal states and I'll give a one day extension for this change. The spec change will be posted tonight. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Sep 25 21:35:00 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8Q4Z0H8025538 for ; Mon, 25 Sep 2006 21:35:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8Q4XaML002392 for ; Mon, 25 Sep 2006 21:33:36 -0700 Message-Id: <200609260433.k8Q4XaML002392@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci599: x3 buffer? Date: Mon, 25 Sep 2006 21:33:36 -0700 From: william@bourbon.usc.edu Someone wrote: > It seems like we can only figure out how big m should be after we take in > all the data (know the total data size). Now, since we can have a maximum > buffer size of 4096 bytes, this means that we either need to calculate ni's > for all possible values of m (1-29) or we read in the input twice. Are we > just supposed to read in the input twice? Can we just make a huge buffer > instead? If your input is stdin, you cannot read it twice! So, the only thing you can do, I think, is to write the data to a temporary file as you read it the first time. Please use mkstemp() to create a temporary file in /tmp. You can assume that /tmp is always available for creating temporary files. (Please do not create temporary files in the current working directory.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Sep 25 19:31:37 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8Q2VbG4017302 for ; Mon, 25 Sep 2006 19:31:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8Q2UDWE001105 for ; Mon, 25 Sep 2006 19:30:13 -0700 Message-Id: <200609260230.k8Q2UDWE001105@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] Can we use openssl for the RC4 generation? Date: Mon, 25 Sep 2006 19:30:13 -0700 From: william@bourbon.usc.edu Someone wrote: > Can we use openssl for the RC4 generation? > I don't see anything in the Homework specification forbidding it. Hmm... you are right that nothing in the spec forbids it! But, since we are implementing exactly the RC4 algorithm, I would say that the spirit of the spec should imply that you do not use openssl's RC4 implementation. Here's what I'm going to do... I'll change the spec to require the output of the 256 internal states and I'll give a one day extension for this change. The spec change will be posted tonight. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 24 19:26:15 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8P2QFXj018591 for ; Sun, 24 Sep 2006 19:26:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8P2OtIc017084 for ; Sun, 24 Sep 2006 19:24:55 -0700 Message-Id: <200609250224.k8P2OtIc017084@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: hw3 Date: Sun, 24 Sep 2006 19:24:55 -0700 From: william@bourbon.usc.edu Someone wrote: > Is there really a possibility that you might try the X3 test with > such an input that m is close to 30. Am I wrong: if m is 30, the > input file has to be at least 150GB. > > n/m >= 5*(2^m) > n/30 >= 5*(2^30) > n >= 150*(2^30) You were almost correct. n is in bits. So, it's 150/8GB. Clearly, we have no room on nunki to store such a big file. But the limitation on m can be used to choose an implmentation method, i.e., 2^m can be stored in an "int". -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 24 19:21:12 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8P2LCOG018190 for ; Sun, 24 Sep 2006 19:21:12 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8P2JpZf017027 for ; Sun, 24 Sep 2006 19:19:51 -0700 Message-Id: <200609250219.k8P2JpZf017027@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci 599 hw3 doubt Date: Sun, 24 Sep 2006 19:19:51 -0700 From: william@bourbon.usc.edu Someone wrote: > I had a doubt regarding the RC4 key. > We just need to output the result of the output algorithm rite? > and that too only the number of bytes as entered by the user i.e > -l. Am i correct in my understanding? Yes. > and; > Once we are done implementing the scheduling algo and the out put > algo, do we have to use that key to encrypt any of the inputs in > x1 x2 x3 x4 or x5. > or we just need to use the input (i.e file or stdin) given by > the user to run the tests? According to the spec, it should be the 2nd case. Please see the grading guidelines for examples. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 24 17:46:41 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8P0kfp7011813 for ; Sun, 24 Sep 2006 17:46:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8P0jL7k016271 for ; Sun, 24 Sep 2006 17:45:21 -0700 Message-Id: <200609250045.k8P0jL7k016271@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS599: Hw3 : Float values Date: Sun, 24 Sep 2006 17:45:21 -0700 From: william@bourbon.usc.edu Someone wrote: > I remember you mentioned about 'The float values not > matching' in the class, but i just wanted to reconfirm. > For eg : > X5 computed in o/p file x5 = -0.536556 > From my routine : x5 = -0.525140 > > Other values : A(d) and n match > But the computed x5 shows the difference as above. > Please let me know if this is acceptable. This is too far off! If your A(d) and n match, I think you can get the difference to be below 0.1% (or 1/1000). You probably have a minor bug in your calculation. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 24 17:44:14 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8P0iEE9011660 for ; Sun, 24 Sep 2006 17:44:14 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8P0gsZW016241 for ; Sun, 24 Sep 2006 17:42:54 -0700 Message-Id: <200609250042.k8P0gsZW016241@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: A doubt in RC4 Date: Sun, 24 Sep 2006 17:42:54 -0700 From: william@bourbon.usc.edu Someone wrote: > I was reading about RC4 from Bruce Schneier's book (Section > 17.1) and there is a statement which says: > > RC4 can be in about 256! x 256 x 256 states. > > I could not understand why that extra 256 is for ? > > This is what i get as per my calculations. > - There are total of 256 bytes so there are 256! possibilities. > - Every byte itself can in 256 states > > So total number of states is 256! x 256. > > Why is that extra 256 for? What am i missing ? Using the notation from our spec, the total "state" for RC4 consists of S[], i, and j (during the output phase). Since S[] is a permutation, it can be in 256! states. i and j each have 256 choises. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Sep 23 16:15:53 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8NNFrIK014948 for ; Sat, 23 Sep 2006 16:15:53 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8NNEbxD009903 for ; Sat, 23 Sep 2006 16:14:37 -0700 Message-Id: <200609232314.k8NNEbxD009903@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS599: General: One time pad Date: Sat, 23 Sep 2006 16:14:37 -0700 From: william@bourbon.usc.edu Someone wrote: > Why is one-time-pad called as one-time-pad? I think in the old days (when people were doing encryption by hand and before there were CDs), these random keys were written on a paper notepad and the whole notepad is just a very very long sequence of "truely" random numbers. The sender and the receiver has an identical notepad to start with. To encrypt, the sender tear off the top page and use the numbers on it as keys. Then you burn the page. That's why this notepad is called the one time pad. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Sep 22 11:19:18 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8MIJINV029651 for ; Fri, 22 Sep 2006 11:19:18 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8MII69q025219 for ; Fri, 22 Sep 2006 11:18:06 -0700 Message-Id: <200609221818.k8MII69q025219@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599 : hexdump Date: Fri, 22 Sep 2006 11:18:06 -0700 From: william@bourbon.usc.edu Someone wrote: > From the spec : > "Hexdump: > > * Except for the last output line, each output line should be 32 > consecutive characters. Every output line should be terminated by > a '\n' character. Please output at most 256 lines of hexdump data > (which corresponds to 4,096 bytes of input data.) " > > "# 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." > > Could you please explain this. > 1) Hexdump on a line is 32 char > 2) At most 256 lines... ( However large the file is only 256 > lines of hexdump ? ) > 3) 256*32 > 8192 bytes .. ( What is with the 4096 bytes ) Please see my message with timestamp "Fri 22 Sep 11:09". > 4) So we print the first 2 buffers or do we want 4096 bytes on > screen (i.e. 1 buffer) ? I would read 16 bytes of input data at a time, convert it to hexstring and print a line out, then go read another 16 bytes, etc. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Sep 22 11:10:18 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8MIAITh029115 for ; Fri, 22 Sep 2006 11:10:18 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8MI96sI024886 for ; Fri, 22 Sep 2006 11:09:06 -0700 Message-Id: <200609221809.k8MI96sI024886@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW3 Date: Fri, 22 Sep 2006 11:09:06 -0700 From: william@bourbon.usc.edu Someone wrote: > In the hexdump specification it is said: > "Except for the last output line, each output line should be 32 > consecutive characters. Every output line should be terminated by a > '\n' character. Please output at most 256 lines of hexdump data (which > corresponds to 4,096 bytes of input data.)" > > But 32 consecutive characters on 256 lines make 8192 bytes (not 4096). > Please clarify. The spec says "4,096 bytes of *input* data". -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Sep 22 00:38:58 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8M7cwur019560 for ; Fri, 22 Sep 2006 00:38:58 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8M7bmDD015246 for ; Fri, 22 Sep 2006 00:37:48 -0700 Message-Id: <200609220737.k8M7bmDD015246@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599 query Date: Fri, 22 Sep 2006 00:37:48 -0700 From: william@bourbon.usc.edu Someone wrote: > Sorry, my mistake in typing the internal state: > it is > 310102..... > > So, my question is: > in the sample 1st internal state, it is > d60102... > > So, my question is, is it ok, if the internal states do not > match to the given sample states? If you look at the grading guidelines, you should realize that you will lose points. Please take my suggestion... Go through the steps by hand and find out why you were swapping location 0x00 with location 0x31 instead of location 0xd6, given the key in the spec. You can start with the pseudo code in the spec web page and see if you agree that you should swap location 0x00 with location 0xd6. If you agree, then it should be easy to debug your code. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Friday, September 22, 2006 12:13 am Subject: Re: cs599 query To: csac@merlot.usc.edu > Someone wrote: > > > The MD5 key generated through my program is matching with the > > one given on spec. But when I used this key for key scheduling > > algorithm, the internal states are not matching. > > Here is my key scheduling code: > > > > [ code deleted ] > > > > so what might be causing the difference in the internal states? > > The first state through my program is : > > 3102....(rest matching) > > This is clearly wrong... During the first iteration of the > key scheduling step of RC4, you should swap location 0 with > another location in the state. So, you should end up with > ??01... where ?? is the byte you are swapping with. You > should check your code to see how your 2nd byte got changed > to 02. > > > second state > > 3167...(rest matching) > > > > Could you please giude me? > > By the way, please do not send code to me and ask me to tell > you what's wrong. The homework assignments are assignments > after all. So, I cannot comment on your code. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Sep 22 00:13:46 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8M7DkTX017855 for ; Fri, 22 Sep 2006 00:13:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8M7CZYT015029 for ; Fri, 22 Sep 2006 00:12:35 -0700 Message-Id: <200609220712.k8M7CZYT015029@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599 query Date: Fri, 22 Sep 2006 00:12:35 -0700 From: william@bourbon.usc.edu Someone wrote: > The MD5 key generated through my program is matching with the > one given on spec. But when I used this key for key scheduling > algorithm, the internal states are not matching. > Here is my key scheduling code: > > [ code deleted ] > > so what might be causing the difference in the internal states? > The first state through my program is : > 3102....(rest matching) This is clearly wrong... During the first iteration of the key scheduling step of RC4, you should swap location 0 with another location in the state. So, you should end up with ??01... where ?? is the byte you are swapping with. You should check your code to see how your 2nd byte got changed to 02. > second state > 3167...(rest matching) > > Could you please giude me? By the way, please do not send code to me and ask me to tell you what's wrong. The homework assignments are assignments after all. So, I cannot comment on your code. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 21 22:10:20 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8M5AJxa009907 for ; Thu, 21 Sep 2006 22:10:19 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8M59AHJ013970 for ; Thu, 21 Sep 2006 22:09:10 -0700 Message-Id: <200609220509.k8M59AHJ013970@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599 query Date: Thu, 21 Sep 2006 22:09:10 -0700 From: william@bourbon.usc.edu Someone wrote: > also in X2 do we consider the file as a continuous long run of 1's and > 0's for calculating x00,x01,x10,x11 or we take 256bytes at a time. I'm not sure where this 256 bytes at a time came from... But you should treat the whole file as a continuous stream of bits for all tests. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 21 19:46:46 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8M2kkt6000351 for ; Thu, 21 Sep 2006 19:46:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8M2jaWs012524 for ; Thu, 21 Sep 2006 19:45:36 -0700 Message-Id: <200609220245.k8M2jaWs012524@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599 query Date: Thu, 21 Sep 2006 19:45:36 -0700 From: william@bourbon.usc.edu Someone wrote: > In X2 if we have a binary data for eg 000001 > then there how many occurrence of '00' in this Four. > the question is do we consider bits 1&2 as one and bits 2&3 as another > occurrence You should. X2 considers "overlaps" which X1, X3, and X4 do not. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 21 15:56:49 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8LMunMo017099 for ; Thu, 21 Sep 2006 15:56:49 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8LMteka009677 for ; Thu, 21 Sep 2006 15:55:40 -0700 Message-Id: <200609212255.k8LMteka009677@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599 hw3 query Date: Thu, 21 Sep 2006 15:55:40 -0700 From: william@bourbon.usc.edu Someone wrote: > could you please guide me with the foll. > > 1. do we have to always have to do 'mod 256' in RC4 and the MD5 > key which we generate should also be 256? If you implementing everything using 'unsigned char', 'mod 256' should be a no-op. > 2. in the sample for RC4 mentioned in the spec what is the value > of 'l' (length) 'l' is the length of the key. Since our key is always 256 bytes long, this is the same as 'mod 256' and it's a no-op. > 3. and while outputting the byte after key generation, which > value is to be outputted is it from array 'S[(S[i] + S[j]) mod 256]' > or from the MD5 key array 'key[(S[i] + S[j]) mod 256]' S[(S[i] + S[j]) mod 256]. Remember, this gives you a "random" value between 0 and 255. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 21 12:37:26 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8LJbQEd003481 for ; Thu, 21 Sep 2006 12:37:26 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8LJaIhi007825 for ; Thu, 21 Sep 2006 12:36:18 -0700 Message-Id: <200609211936.k8LJaIhi007825@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 : Doubts w.r.t Keys Date: Thu, 21 Sep 2006 12:36:18 -0700 From: william@bourbon.usc.edu Someone wrote: > Could you help me differentiate between > SHARED KEY .. SESSION KEY .. and SECRET KEY > As per my understanding.. > > Shared key : is generated using receiver's public key and my > private key (assuming i am sending it ) and this key would then > be used to encrypt a message. And at the receivers end > decryption is done using the same key considering it is > symmetric.. { like Diffie-Hellman } Shared key and secret key are the same thing. They are used in a symmetric crypto system. (In a public-key system, one should *never* share one's private key with anyone else.) Please also use the term "private key" to refer to the private part of the key in the public-key system. If you are using symmetric encryption, please do not refer to the key as "private key"; you can say "shared key" or "secret key". The secret must be shared in this case. > Session Key : encrypted and sent in the mesage and later on used > for decrypting. > How this is generated.. Something like a timestamp ? A session key is a symmetric key generated for a communication session. You are correct that it is often encrypted (using a long term key, depending on which crypto system you are using) and sent along with the message. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 21 07:11:53 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8LEBrE3014284 for ; Thu, 21 Sep 2006 07:11:53 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8LEAjUS004315 for ; Thu, 21 Sep 2006 07:10:45 -0700 Message-Id: <200609211410.k8LEAjUS004315@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW3 Date: Thu, 21 Sep 2006 07:10:45 -0700 From: william@bourbon.usc.edu Someone wrote: > In your test specification, for example, for X1 it is said that > minimum number of bits is 10. But our input comes in bytes. Should we > assume that if input is less than 2 bytes it is insufficient? Yes. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 20 22:42:36 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8L5gais012974 for ; Wed, 20 Sep 2006 22:42:36 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8L5fUY8031414 for ; Wed, 20 Sep 2006 22:41:30 -0700 Message-Id: <200609210541.k8L5fUY8031414@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Minor modifications to HW3 spec... Date: Wed, 20 Sep 2006 22:41:30 -0700 From: william@bourbon.usc.edu Hi, There is also one change for x4: [BC: Added 9/20/2006] If number of input bits is less than 38, please print: x4: insufficient data -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Wed, 20 Sep 2006 20:27:54 -0700 From: william@bourbon.usc.edu To: csac@merlot.usc.edu Subject: Minor modifications to HW3 spec... Hi, I've added some error conditions for x3: [BC: Added 9/20/2006] If number of input bits is less than 10, please print: x3: insufficient data [BC: Added 9/20/2006] Also, if m is greater or equal to 30, please print: x3: m is too large -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 20 20:29:00 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8L3T0E5004020 for ; Wed, 20 Sep 2006 20:29:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8L3RsHu029018 for ; Wed, 20 Sep 2006 20:27:54 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id k8L3Rsv4029017 for csac@merlot; Wed, 20 Sep 2006 20:27:54 -0700 Date: Wed, 20 Sep 2006 20:27:54 -0700 From: william@bourbon.usc.edu Message-Id: <200609210327.k8L3Rsv4029017@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Minor modifications to HW3 spec... Hi, I've added some error conditions for x3: [BC: Added 9/20/2006] If number of input bits is less than 10, please print: x3: insufficient data [BC: Added 9/20/2006] Also, if m is greater or equal to 30, please print: x3: m is too large -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Sep 19 10:44:39 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8JHidMx001967 for ; Tue, 19 Sep 2006 10:44:39 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8JHhcJP005903 for ; Tue, 19 Sep 2006 10:43:38 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id k8JHhbOW005902 for csac@merlot; Tue, 19 Sep 2006 10:43:37 -0700 Date: Tue, 19 Sep 2006 10:43:37 -0700 From: william@bourbon.usc.edu Message-Id: <200609191743.k8JHhbOW005902@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: HW3 spec... Hi, HW3 spec is available on the web. It is based on today's lecture. I'll talk a little bit about it at the beginning of class today. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Sep 18 23:02:06 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8J626dP021091 for ; Mon, 18 Sep 2006 23:02:06 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8J617oS030557 for ; Mon, 18 Sep 2006 23:01:07 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id k8J6174m030556 for csac@merlot; Mon, 18 Sep 2006 23:01:07 -0700 Date: Mon, 18 Sep 2006 23:01:07 -0700 From: william@bourbon.usc.edu Message-Id: <200609190601.k8J6174m030556@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: deadline for HW2 is approaching... Hi, 1/3 of you still haven't submitted anything. Please remember that I *must* use the timestamp on the server to determine if your submission is late or not. If your submission is one second past midnight, according to the timestamp on the server, I will have *no choice* but to deduct 25% from your score. So, please don't submit late! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Sep 18 22:59:24 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8J5xOSc020804 for ; Mon, 18 Sep 2006 22:59:24 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8J5wOPI030476 for ; Mon, 18 Sep 2006 22:58:24 -0700 Message-Id: <200609190558.k8J5wOPI030476@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI 599: merge Date: Mon, 18 Sep 2006 22:58:24 -0700 From: william@bourbon.usc.edu Someone wrote: > For Merge section, do yo want us to pad a 0 at tend of each row?? Since the merge output is a PBM file, you should follow the spec on outputing a PBM file. Also, if you are not sure, please check the grading guidelines and compare your output with the "solutions". -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Sep 18 16:38:20 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8INcKbS028910 for ; Mon, 18 Sep 2006 16:38:20 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8INbMK5026888 for ; Mon, 18 Sep 2006 16:37:22 -0700 Message-Id: <200609182337.k8INbMK5026888@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 - encrypt key Date: Mon, 18 Sep 2006 16:37:22 -0700 From: william@bourbon.usc.edu Someone wrote: > In this case, is it ok if my hw2 folder always contains a tmp > directory? Or should the directory be created and deleted by > the program? Please clarify. Please create *all* temporary files in /tmp. You should not create any files in the current working directory or a subdirectory of the current working directory. You have no control of where the grader may run your program. So, please do not assume that you a tmp subdirectory. It is reasonable to assume that there is /tmp in all UNIX machines. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Sunday, September 17, 2006 4:22 pm Subject: Re: CSCI599 - encrypt key To: csac@merlot.usc.edu > Someone wrote: > > > In the class you mentioned that the key for encrytion should be > > generated on the fly; depending on the file size. Is this part of > > the spec or a suggestion? Is it ok if I first create the key of > > required size, store it somewhere and then use it in encrypt > > function? > > If you need 30 bytes of key but you've generated 32 bytes of > data in a temporary file, that would be fine and there will > be no penalty. > > If you generated a 2MB temporary file and you only need 30 > bytes of key, then we will have to deduct some points. > > Please make sure you use something like mkstemp() and create > your temporary file in /tmp, and make sure you delete all > your temporary files before your program exits. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Sep 18 15:33:58 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8IMXwo2024429 for ; Mon, 18 Sep 2006 15:33:58 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8IMX0ox025577 for ; Mon, 18 Sep 2006 15:33:00 -0700 Message-Id: <200609182233.k8IMX0ox025577@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI 599: Segmentation falut Date: Mon, 18 Sep 2006 15:33:00 -0700 From: william@bourbon.usc.edu Someone wrote: > I am not sure if you are aware of a tool called "valgrind" on > linux(maybe on other unices as well). I use it very effectively > to trace my faults, buffer overruns and off-by-one errors. > > Valgrind would typically be included in the standard > distribution. I run a FC5 on my laptop and i use the command as > follows > > $ valgrind > > Maybe this information can be included in your webpage. I've just included it at the bottom of the homeworks page at: http://merlot.usc.edu/csac-f06/homeworks.html#segfault > Also, i was not able to send a mail to csac@merlot.usc.edu. I get > an auto-generated mail asking me not to send to that account. Is > that expected? Please do not send e-mail to csac@merlot.usc.edu. It gets a lot of spam. So it cannot be used to send e-mail messages to students in this class. The appropriate place for doing this is the discussion board on DEN. -- Bill Cheng // bill.cheng@usc.edu william@bourbon.usc.edu wrote: > Someone wrote: > > > Could you please clarify how to find out what is causing the > > segmentation fault? I am freeing all the memory allocated by > > malloc. Please guide. > > You have checked out the following section of the homeworks web > page? > > http://merlot.usc.edu/csac-f06/homeworks.html#segfault > > Please read it carefully so you understand exactly what it's > saying... There is no magical solutions, unfortunately. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Sep 18 14:35:41 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8ILZfPh020249 for ; Mon, 18 Sep 2006 14:35:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8ILYhUN024351 for ; Mon, 18 Sep 2006 14:34:43 -0700 Message-Id: <200609182134.k8ILYhUN024351@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI 599: Segmentation falut Date: Mon, 18 Sep 2006 14:34:43 -0700 From: william@bourbon.usc.edu Someone wrote: > Could you please clarify how to find out what is causing the > segmentation fault? I am freeing all the memory allocated by > malloc. Please guide. You have checked out the following section of the homeworks web page? http://merlot.usc.edu/csac-f06/homeworks.html#segfault Please read it carefully so you understand exactly what it's saying... There is no magical solutions, unfortunately. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Sep 18 06:55:14 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8IDtEMm023506 for ; Mon, 18 Sep 2006 06:55:14 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8IDsHfD018799 for ; Mon, 18 Sep 2006 06:54:17 -0700 Message-Id: <200609181354.k8IDsHfD018799@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci 599 h/w2 doubt** Date: Mon, 18 Sep 2006 06:54:17 -0700 From: william@bourbon.usc.edu Someone wrote: > In the stream section, > -l= len > should the number "len" always be divisble by 8? Or can user > enter len which is not exactly divisble by 8? > My program ran successfully for all the test cases but i found > that all "len" values were exactly divisible by 8, Please see the grading guidelines and see how many points you would have gotten! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 17 21:48:10 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8I4mAVW017118 for ; Sun, 17 Sep 2006 21:48:10 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8I4lEX7013896 for ; Sun, 17 Sep 2006 21:47:14 -0700 Message-Id: <200609180447.k8I4lEX7013896@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599 hw2 query Date: Sun, 17 Sep 2006 21:47:14 -0700 From: william@bourbon.usc.edu Someone wrote: > while decryption .. if we enter the foll > hw2 decrypt > then should an error be displayed or we should read from stdin ... You *must* read from stdin. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 17 20:33:10 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8I3XAVx012256 for ; Sun, 17 Sep 2006 20:33:10 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8I3WF5l013227 for ; Sun, 17 Sep 2006 20:32:15 -0700 Message-Id: <200609180332.k8I3WF5l013227@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci 599 h/w2 doubt** Date: Sun, 17 Sep 2006 20:32:15 -0700 From: william@bourbon.usc.edu Someone wrote: > During merge operation do we have to perform OR operation on > the bits from two .pbm files? Yes. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Sunday, September 17, 2006 4:14 pm Subject: Re: csci 599 h/w2 doubt** To: csac@merlot.usc.edu > Someone wrote: > > > 1) Aboutt he width being 70 i read it for PBM1. My mistake. > > No problem. > > > 2) I had one more doubt --> will the user input the passphrase in > > doble qoutes " " > > If the passphrase do not contain a space, there is no need > for the double quotes. But as was pointed out in a > previous message, the shell on Solaris remove the > double quotes before the argument was passed to your > program. So, your program won't see it anyways. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 17 16:23:32 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8HNNWPG028583 for ; Sun, 17 Sep 2006 16:23:32 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8HNMbX2010662 for ; Sun, 17 Sep 2006 16:22:37 -0700 Message-Id: <200609172322.k8HNMbX2010662@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 - encrypt key Date: Sun, 17 Sep 2006 16:22:37 -0700 From: william@bourbon.usc.edu Someone wrote: > In the class you mentioned that the key for encrytion should be > generated on the fly; depending on the file size. Is this part of > the spec or a suggestion? Is it ok if I first create the key of > required size, store it somewhere and then use it in encrypt > function? If you need 30 bytes of key but you've generated 32 bytes of data in a temporary file, that would be fine and there will be no penalty. If you generated a 2MB temporary file and you only need 30 bytes of key, then we will have to deduct some points. Please make sure you use something like mkstemp() and create your temporary file in /tmp, and make sure you delete all your temporary files before your program exits. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 17 16:04:49 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8HN4m0M027237 for ; Sun, 17 Sep 2006 16:04:48 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8HN3sBs010192 for ; Sun, 17 Sep 2006 16:03:54 -0700 Message-Id: <200609172303.k8HN3sBs010192@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci 599 h/w doubt Date: Sun, 17 Sep 2006 16:03:54 -0700 From: william@bourbon.usc.edu Someone wrote: > I saw the height and width of small1.pbm and also money1.pbm and > the file sie doubles in both of those compared to the original > file. > So are we using 2 bits to represent 1 pixel? This is called "message expansion" in encryption. So, it's not that we are using 2 bits to represent 1 pixel. We are encrypting 1 pixel into 4 bits. So, the data part of the ciphertext is 4 times are large as the data part of the plaintext. > Are the examples of small1.pbm based on the algorithm depicted on > the top of the homework page? Yes. The "algorithm" is part of the spec. You must implement the "algorithm". -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 17 16:01:55 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8HN1t7N026979 for ; Sun, 17 Sep 2006 16:01:55 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8HN11lX010134 for ; Sun, 17 Sep 2006 16:01:01 -0700 Message-Id: <200609172301.k8HN11lX010134@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599: hw2 query : Stream Cipher Date: Sun, 17 Sep 2006 16:01:01 -0700 From: william@bourbon.usc.edu Someone wrote: > In the following example where the user wants 30 bytes of output, you said: > "If you need 30 bytes of output, you need to go through the loop 4 times" > and > "Every iteration in the infinite loop you output 8 bytes" > > Does this mean that after going through 4 loops, total 32 bytes will > be outputed and not only 30? Please clarify. In this the spec is pretty clear that you need to modify the code in the spec so that it works according to the spec. If you need to output 30 bytes of data, you cannot use the code as it to output 32 bytes! You must code it correctly to output only 30 bytes. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Tuesday, September 12, 2006 5:28 pm Subject: Re: cs599: hw2 query : Stream Cipher To: csac@merlot.usc.edu > Someone wrote: > > > For the command > > hw2 stream -p=pphrase -l=len > > If len is say 30 > > Should the o/p be the first 8 bytes of the generated key or > > do you want the whole 16 bytes to count towards len > > > > I understand that the key for the encrypt function is the first > > 8 bytes but do you also want the first 8 bytes ONLY to count > > towards the total len for the stream function > > Every iteration in the infinite loop you output 8 bytes. > If you need 30 bytes of output, you need to go through > the loop 4 times. > > When in doubt, you can check the grading guidelines and see > what the "solutions" are like. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 17 15:16:56 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8HMGu7n024049 for ; Sun, 17 Sep 2006 15:16:56 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8HMG1v8009344 for ; Sun, 17 Sep 2006 15:16:01 -0700 Message-Id: <200609172216.k8HMG1v8009344@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI 599 H/W2 Query ** Date: Sun, 17 Sep 2006 15:16:01 -0700 From: william@bourbon.usc.edu Someone wrote: > I had a couple of questions > 1) Are their any restrictions on height and width of the pbm file > - I read that maximum number of characters that can be in one line = 70 > but the file money.pbm has more than 100 characters.. I don't think there is a restriction. Where did you read about 70? > 2)In the Encrypt portion , if the user doesnt give the optional > [pbm file] then what file should we consider ? You should read stdin and assume that it's a PBM file. In this case, usually the following command was run: cat FILE.pbm | ./hw2 encrypt ... If you want more example, please see the grading guidelines? -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 17 15:13:18 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8HMDIKW023789 for ; Sun, 17 Sep 2006 15:13:18 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8HMCNSj009275 for ; Sun, 17 Sep 2006 15:12:23 -0700 Message-Id: <200609172212.k8HMCNSj009275@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS599: stop.1.pbm & stop.2.pbm Date: Sun, 17 Sep 2006 15:12:23 -0700 From: william@bourbon.usc.edu Someone wrote: > I haven't done merge or decrypt yet since I'm still trying to get > encrypt working with all the test files. > > It's working with hello, nouturn, and viterbi, but not stop. Is > there anything special about stop.pbm that makes > it stand out from the other three? I don't think there is anything special about "stop.pbm". > The message I get is: > > ==> /home/scf-22/csci551b/public/csac/hw2/stop.pbm > Binary files /home/scf-22/csci551b/public/csac/hw2/stop.1.pbm and > foo-stop.1.pbm differ > Binary files /home/scf-22/csci551b/public/csac/hw2/stop.2.pbm and > foo-stop.2.pbm differ Since you've written a hexdump utility in HW1, you can use it to do a hexdump of your result and the "solution" and compare the hexdump. If your hexdump is not working, please try ~csci551b/bin/hexdump. -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Saturday, September 16, 2006 11:02 pm Subject: Re: CS599: stop.1.pbm & stop.2.pbm To: csac@merlot.usc.edu > Someone wrote: > > > My encrypt function works on hello.pbm, nouturn.pbm, and > > viterbi.pbm, but I cannot get stop.pbm to match your stop.1.pbm > > and stop.2.pbm. > > > > I looked at the stop.1.pbm and stop.2.pbm files and both have > > several blank lines at the end of the file. Is this > > intentional/correct? hello.*.pbm, nouturn.*.pbm, and > > viterbi.*.pbm do not have all these blank lines at the end of > > them. > > I think it's correct. You should process without worrying > about whether the picture "make sense" or not. When you > do "merge" and "decrypt" with your files, do you get the > original image? > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Sep 16 23:03:03 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8H632Pq001187 for ; Sat, 16 Sep 2006 23:03:02 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8H62AFU008020 for ; Sat, 16 Sep 2006 23:02:10 -0700 Message-Id: <200609170602.k8H62AFU008020@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS599: stop.1.pbm & stop.2.pbm Date: Sat, 16 Sep 2006 23:02:10 -0700 From: william@bourbon.usc.edu Someone wrote: > My encrypt function works on hello.pbm, nouturn.pbm, and > viterbi.pbm, but I cannot get stop.pbm to match your stop.1.pbm > and stop.2.pbm. > > I looked at the stop.1.pbm and stop.2.pbm files and both have > several blank lines at the end of the file. Is this > intentional/correct? hello.*.pbm, nouturn.*.pbm, and > viterbi.*.pbm do not have all these blank lines at the end of > them. I think it's correct. You should process without worrying about whether the picture "make sense" or not. When you do "merge" and "decrypt" with your files, do you get the original image? -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Sep 16 22:00:26 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8H50Qqq029599 for ; Sat, 16 Sep 2006 22:00:26 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8H4xYKF007075 for ; Sat, 16 Sep 2006 21:59:34 -0700 Message-Id: <200609170459.k8H4xYKF007075@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Seprate compilation Date: Sat, 16 Sep 2006 21:59:34 -0700 From: william@bourbon.usc.edu Someone wrote: > I got stuck while spliting my source code. Could you please tell > me what to do. > > Suppose i have 2 .cpp files, let us say a.cpp and b.cpp > > b.cpp has some function say, do_something(); > > now we create a header file, newheader.h, in which we have to > define the function of b.cpp First of all, I will not call this file "newheader.h". I will call it "b.h" since it's the header for "b.cpp". > to use the function in a.cpp we have to include the > "newheader.h", with the statement > #include "newheader.h" in a.cpp > > Question:- how define the function in "newheader.h" > > Please help me out, or correct me if i am wrong in the steps. It depends on the function prototype of do_something(). If do_something() is defined as: int do_something(char*, int, unsigned char *); Then in "b.h", I will have: #ifndef B_H #define B_H extern int do_something(char*, int, unsigne char *); #endif /* B_H */ The #ifdef stuff is there so that I won't get an #include loop. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Sep 16 21:55:44 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8H4th2Z029113 for ; Sat, 16 Sep 2006 21:55:43 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8H4sp6Y007006 for ; Sat, 16 Sep 2006 21:54:51 -0700 Message-Id: <200609170454.k8H4sp6Y007006@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: grading guidelines in general... Date: Sat, 16 Sep 2006 21:54:51 -0700 From: william@bourbon.usc.edu Someone wrote: > Does this mean that you can change the requirements of the assignment > after we submit the assignment? Hmm... you are asking a tricky question since you used the word "requirements" and not the word "spec". I will not change the "spec". Please note that "requirements" is not the same as "spec". The spec" is basically the "functional requirement", while the term of "requirements" can mean a lot more. Let's take a wild example. If someone does not indent his/her source code and the TA asks me what should be done, I'll most likely ask the TA to deduct 2 points. In this case, although neither the assignment nor the grading guidelines say that you must indent your source code, I would say that it is reasonable to grade this way and certainly do not consider this a "spec change". Is this a change in the requirements? I guess it depends on how you look at it. That's why in my previouse e-mail I stated that "we reserve the right..." The problem is that there is no way for me to specify all possible deductions since I don't want to, and probably not qualified to, write a legal document. I can only do what's reasonable. I'll try my best to be reasonable and be fair. And please remember that you are all graduate students and it's reasonable for me to expect certain level of performance from you. Also, in general, if student A did a better job than student B, student A *may* get more points than student B. -- Bill Cheng // bill.cheng@usc.edu On 9/15/06, william@bourbon.usc.edu wrote: > Hi everyone, > > I think I've never mentioned the following in class, although > I meant to mention it. > > The posted grading guidelines is not perfect. We will try > our best to stick to the grading guidelines. Sometimes, > after we started grading some of the submissions, we realize > that we missed something. > > The bottomline is that we reserve the right to add or change > things in the grading guidelines as we see fit. Again, we > will try our best to stick to them. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Sep 16 21:35:38 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8H4ZcMR027834 for ; Sat, 16 Sep 2006 21:35:38 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8H4YkwE006810 for ; Sat, 16 Sep 2006 21:34:46 -0700 Message-Id: <200609170434.k8H4YkwE006810@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci 599 hw2 query * Date: Sat, 16 Sep 2006 21:34:46 -0700 From: william@bourbon.usc.edu Someone wrote: > I am understanding that the output of the "stream cipher" is > binary bytes of length "len". > > Does this mean we need to take first "len" number of bytes from > the keystream that we generate. i.e we need to execute the for > loop only till we output "len" number of binry bytes. > And the output should be binary and not the hex right? Yes. That's what exactly the spec says in bold face. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sat Sep 16 00:06:37 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8G76bgO010155 for ; Sat, 16 Sep 2006 00:06:37 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8G75mhw026830 for ; Sat, 16 Sep 2006 00:05:48 -0700 Message-Id: <200609160705.k8G75mhw026830@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599 - query Date: Sat, 16 Sep 2006 00:05:48 -0700 From: william@bourbon.usc.edu Someone wrote: > Can u please send me some sample pbm file [where wdth is divisible by 8] > with their encrypted versions . > because there is no file in the grading directory with the above spec. I'm sorry but I cannot do this. Please look at the spec and figure out how the file suppose to look. There are enough samples in ~csci551b/public/csci/hw2. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Sep 15 23:37:27 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8G6bRxY008218 for ; Fri, 15 Sep 2006 23:37:27 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8G6adtE026483 for ; Fri, 15 Sep 2006 23:36:39 -0700 Message-Id: <200609160636.k8G6adtE026483@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Homework Grades Date: Fri, 15 Sep 2006 23:36:39 -0700 From: william@bourbon.usc.edu Someone wrote: > I was just curious to know when will the grades for the first homework > be declared. I just got the report from the TA. I need to record them and send e-mail to individual students. I should be able to get this done over the weekend. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Sep 15 13:57:13 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8FKvD1X004313 for ; Fri, 15 Sep 2006 13:57:13 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8FKuQIL020909 for ; Fri, 15 Sep 2006 13:56:26 -0700 Message-Id: <200609152056.k8FKuQIL020909@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 : HW2 : Merge & Decrypt Date: Fri, 15 Sep 2006 13:56:26 -0700 From: william@bourbon.usc.edu Someone wrote: > 2 questions on hw2 > > 1.For the merge command, are we just XOR the bits of the pbm file > like below? > > Bits in files > PBM1 PBM2 MERGED > 0 0 -> 0 > 0 1 -> 1 > 1 1 -> 1 The example was correct, but you've made a typo above. I think you meant OR and not XOR. > 2. For the decryption process, it is the process of > getting rid of the grey scale. How do we go about this? > Do we just search for 4-bit blocks which are half 1's and half 0's > > so a pbm file with the following content run through the decrypt command: > MERGED FILE > P4 > 6 2 > 1 1 0 1 1 1 > 1 1 1 0 1 1 > > DECRYPTED FILE > P4 > 3 1 > 1 0 1 I think that's correct. > and if that is correct, are we to reject files which have a > total of bits which is not a multiple of 4 and not structured in blocks? > For example the file > P4 > 1 4 > 1 > 1 > 1 > is not decrypt-able? > and neither is the below? > P4 > 5 2 > 1 1 1 0 1 1 > 1 1 1 1 0 1 > are my thoughts on this correct? Yes. When you run into an error, you should print out an error an abort. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Sep 15 13:52:24 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8FKqN4h004053 for ; Fri, 15 Sep 2006 13:52:23 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8FKpaid020833 for ; Fri, 15 Sep 2006 13:51:36 -0700 Message-Id: <200609152051.k8FKpaid020833@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS599 HW2 Date: Fri, 15 Sep 2006 13:51:36 -0700 From: william@bourbon.usc.edu Someone wrote: > In the assignment's merge operation it is said: > "You must use 0 as the padding bit at the end of a row in the > output PBM file." > But If we merge two PBM files, the resultant image is already > padded. > Isn't that right? Yes, but you should "clear out" the padding bits. So, if the two input PBM files have non-zero padding bits, you should make sure you don't use these non-zero padding bits. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Sep 15 07:36:57 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8FEarUC015154; Fri, 15 Sep 2006 07:36:53 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8FEa7K8016777; Fri, 15 Sep 2006 07:36:07 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id k8FEa75F016776; Fri, 15 Sep 2006 07:36:07 -0700 Date: Fri, 15 Sep 2006 07:36:07 -0700 From: william@bourbon.usc.edu Message-Id: <200609151436.k8FEa75F016776@bourbon.usc.edu> To: cs551@merlot.usc.edu, csac@merlot.usc.edu Subject: grading guidelines in general... Hi everyone, I think I've never mentioned the following in class, although I meant to mention it. The posted grading guidelines is not perfect. We will try our best to stick to the grading guidelines. Sometimes, after we started grading some of the submissions, we realize that we missed something. The bottomline is that we reserve the right to add or change things in the grading guidelines as we see fit. Again, we will try our best to stick to them. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 14 19:49:54 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8F2nsYr006762 for ; Thu, 14 Sep 2006 19:49:54 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8F2nAG2009164 for ; Thu, 14 Sep 2006 19:49:10 -0700 Message-Id: <200609150249.k8F2nAG2009164@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 : HW2 : Merge Date: Thu, 14 Sep 2006 19:49:10 -0700 From: william@bourbon.usc.edu Someone wrote: > Are there any specifications for the name of the output file > generated from the Merge command ? The (binary) output must go to stdout. Please see the grading guidelines for how it's used. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 14 19:49:15 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8F2nF0B006748 for ; Thu, 14 Sep 2006 19:49:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8F2mVDa009140 for ; Thu, 14 Sep 2006 19:48:31 -0700 Message-Id: <200609150248.k8F2mVDa009140@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599: hw2 query Date: Thu, 14 Sep 2006 19:48:31 -0700 From: william@bourbon.usc.edu Someone wrote: > Because I'm more of a java person, I'm not sure how to get the given key > stream code to run. Using reinterpret_cast on everything but otherwise > running the code as-is allows the program to compile but gives a seg fault. > I'm assuming the typecasting and/or using c++ is the cause. Can you point me > in the right direction as to what could be the problem? I don't see how reinterpret_cast could create problems unless you are typecasting a C++ object to a C data type. Could you give me a short sample of what you are doing? I will be on campus tomorrow between 2pm and 4pm. Please make an appointment if you would like to see me about this. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 14 19:44:22 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8F2iMA2006512 for ; Thu, 14 Sep 2006 19:44:22 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8F2hcsY009047 for ; Thu, 14 Sep 2006 19:43:38 -0700 Message-Id: <200609150243.k8F2hcsY009047@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [CSCI599] HW2 Date: Thu, 14 Sep 2006 19:43:38 -0700 From: william@bourbon.usc.edu Someone wrote: > I have some questions in my mind. > A PBM file can consist of a sequence of one or more PBM images. Do we > have to support this multi-image property in our code / will there be > any input file with more than one image? We will not use such PBM files for grading. > Also PBM files can have comments (a line prefixed by '#" character), > should we also handle them? We will also not use such PBM files for grading. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 14 13:08:40 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8EK8e7Z016125 for ; Thu, 14 Sep 2006 13:08:40 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8EK7uQ3005007 for ; Thu, 14 Sep 2006 13:07:56 -0700 Message-Id: <200609142007.k8EK7uQ3005007@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI599 HW2 Date: Thu, 14 Sep 2006 13:07:56 -0700 From: william@bourbon.usc.edu Someone wrote: > Should we assume that our PBM input files are errorless and > in the exact format? Yes. But you should still do the right things if the intput is bad. It's just a good habit. If you see something unexpected, print an error message and exit and try not to seg-fault. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 14 10:37:16 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8EHbGqV007257 for ; Thu, 14 Sep 2006 10:37:16 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8EHaXXC003413 for ; Thu, 14 Sep 2006 10:36:33 -0700 Message-Id: <200609141736.k8EHaXXC003413@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: stream question Date: Thu, 14 Sep 2006 10:36:33 -0700 From: william@bourbon.usc.edu Someone wrote: > Oh sorry, my mistake. > I used the input len of 320 in the first sample provided in the grading > script. > So the solution in the grading script is only a file which is 320bytes > long, and my output comes out to be 320*8 = 2560 bytes b/c of > sizeof(md5_buf)>>1. So thats why I asked. If you run: ./hw2 stream -p="yesnomaybe" -l=320 > s0.stream s0.stream should be 320 bytes long. And ~csci551b/public/csac/hw2/s0.stream is exactly that. So, you have to go through the loop 40 times to generate enough key bytes. -- Bill Cheng // bill.cheng@usc.edu On 9/14/06, william@bourbon.usc.edu wrote: > Someone wrote: > > > In your code, you did something like this. > > fwrite(md5_buf, 1, sizeof(md5_buf)>>1, f); > > This command writes the first byte at md5_buf and writes it > > sizeof(md5_buf)>>1 times. In my code, sizeof(md5_buf)>>1 is 8, so the > > total size of the output file is 320*8 = 2560 bytes. > > Hence the outputs dont match. > > Can you please let me know if we should use sizeof(md5_buf)>>1 as our > > number of items. > > I don't know where the 320 came from and why you did 320*8. > sizeof(md5_buf)>>1 must be 8 and you got it right. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 14 07:45:15 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8EEjFut029822 for ; Thu, 14 Sep 2006 07:45:15 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8EEiWtm020019 for ; Thu, 14 Sep 2006 07:44:32 -0700 Message-Id: <200609141444.k8EEiWtm020019@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS599 HW2 Date: Thu, 14 Sep 2006 07:44:32 -0700 From: william@bourbon.usc.edu Someone wrote: > Do we have to write all our error messages and program > usage message to 'cerr'? Yes. That's what stderr/cerr is for, error messages. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 14 07:43:38 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8EEhcDJ029695 for ; Thu, 14 Sep 2006 07:43:38 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8EEgs8G019963 for ; Thu, 14 Sep 2006 07:42:54 -0700 Message-Id: <200609141442.k8EEgs8G019963@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: stream question Date: Thu, 14 Sep 2006 07:42:54 -0700 From: william@bourbon.usc.edu Someone wrote: > In your code, you did something like this. > fwrite(md5_buf, 1, sizeof(md5_buf)>>1, f); > This command writes the first byte at md5_buf and writes it > sizeof(md5_buf)>>1 times. In my code, sizeof(md5_buf)>>1 is 8, so the > total size of the output file is 320*8 = 2560 bytes. > Hence the outputs dont match. > Can you please let me know if we should use sizeof(md5_buf)>>1 as our > number of items. I don't know where the 320 came from and why you did 320*8. sizeof(md5_buf)>>1 must be 8 and you got it right. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 13 23:24:01 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8E6O1MT000932 for ; Wed, 13 Sep 2006 23:24:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8E6NJUH014979 for ; Wed, 13 Sep 2006 23:23:19 -0700 Message-Id: <200609140623.k8E6NJUH014979@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599 - General C doubt Date: Wed, 13 Sep 2006 23:23:19 -0700 From: william@bourbon.usc.edu Someone wrote: > int *func(int x) > { > temp=malloc of size x > return(temp) > } > > main() > { > int *p; > p=func(int abc); > } > > In this case : > 1) When the function : func : ends does the scope of the > "temp" end and there is no reference to temp remaining ? The memory allocated in func() is pointed to by p in main(). So, the memory allocated in func() is not lost. > 2) Will this will be a dangling pointer ? After func() returns, the "temp" variable in func() no longer exists. So, I woldn't call it a dangling pointer. > If yes, > 3) How do i free 'temp' from within the function and still > pass it back to the main I'm not sure what "temp" is. Is it a local variable in func()? Or is it a global variable? If it's a local variable in func(), then it was sitting in the *stack* when func() is executing. After func() returns, "temp" is sitting beyond the top of stack, so you don't need to worry about it. If it's a global variable, then both "temp" and p in main() are pointing to the same memory object in the *heap*. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 13 22:00:50 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8E50oUJ028054 for ; Wed, 13 Sep 2006 22:00:50 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8E508Ba012845 for ; Wed, 13 Sep 2006 22:00:08 -0700 Message-Id: <200609140500.k8E508Ba012845@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] options quoting Date: Wed, 13 Sep 2006 22:00:08 -0700 From: william@bourbon.usc.edu Someone wrote: > In the grading guideline, the -p option is quoted but the rest are not. > e.g. > ./hw2 encrypt -p="yesnomaybe" -out=foo-money > > Will -p always have quotes? > Will -l and -out never have quotes? > Are the quotes part of the passphrase? > Why is foo-money not quoted? The quotes are not part of the passphrase. They are optional for both -p and -out. It's there because a passphrase may have space characters in it. Often, file names do not have space characters on UNIX. As it turns out, the UNIX shell on Solaris removes them, so there is no issue here. (I'm not sure if this is a POSIX thing. May be for another OS, you need to remove it yourself.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 13 19:16:57 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8E2GvNJ018830 for ; Wed, 13 Sep 2006 19:16:57 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8E2GGm7010549 for ; Wed, 13 Sep 2006 19:16:16 -0700 Message-Id: <200609140216.k8E2GGm7010549@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] argument ordering Date: Wed, 13 Sep 2006 19:16:16 -0700 From: william@bourbon.usc.edu Someone wrote: > Will the pbm filename always come last ( if at all ) for the > encrypt function? Yes. -- Bill Cheng // bill.cheng@usc.edu On 9/12/06, william@bourbon.usc.edu wrote: > Someone wrote: > > > When you say that arguments can come in any order do you mean that > > these command lines should be accepted? > > > > hw2 -p='foo' stream -l=124 > > hw2 encrypt foo.pbm -p='bar' -out='baz' > > hw2 encrypt -out='baz' foo.pbm -p='bar' > > hw2 -out='baz' foo.pbm encrypt -p='bar' > > hw2 pbmfile2.pbm merge pbmfile1.pbm > > It's not that the arguments can come in any order. The > commandline options can come in any order. The commandline > options are the arguments that starts with a dash. > > The only commandline options in the spec are -p and -l > for the "stream" command and -p and -out for the "encrypt" > command. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 13 12:04:46 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8DJ4kAj025987 for ; Wed, 13 Sep 2006 12:04:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8DJ46Ok003857 for ; Wed, 13 Sep 2006 12:04:06 -0700 Message-Id: <200609131904.k8DJ46Ok003857@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599 - hw2 query Date: Wed, 13 Sep 2006 12:04:06 -0700 From: william@bourbon.usc.edu Someone wrote: > This is a question regarding .pbm file formatting. When we expand the > file, one bit becomes 4 bits in the new file. However these 4 bits > dont seem to be contigious, as two are in the top line and two in the > bottom line. Do we have to take care of that, or we can simply write > the 4 bits next to each other, and the editor will pick it? You should not write the 4 bits next to each other because you will get the wrong image. Since these are bitmap files, they are usually not too large. So, you don't have to be too memory efficient. One way to do this is to write a PBM abstract data type. When you do your bit manipulation, you can just set the bits in the array in memory. (You should dynamically allocate your array and don't use a constant size.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 13 10:09:10 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8DH9AmV019383 for ; Wed, 13 Sep 2006 10:09:10 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8DH8UXL001234 for ; Wed, 13 Sep 2006 10:08:30 -0700 Message-Id: <200609131708.k8DH8UXL001234@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599 - hw2 query Date: Wed, 13 Sep 2006 10:08:30 -0700 From: william@bourbon.usc.edu Someone wrote: > could u pl guide me as to when we have to pad zeros .. for example if > the pbm image is 17x17(wxh) > hence the number of bytes that follows is h* (ceil or floor ???(w/8) + 1 ) > > so when while outputting we have to pad zeros??? If the width of the image is 17 pixels, you need to output 17 bits. It takes 2 bytes and 1 bit to output 17 bits and the smallest unit we can output to a file is a byte. Therefore, we must output 3 bytes. The last byte only has 1 bit that came from the image. Determining what to do with the other 7 bits in the last byte is called padding. For HW2, when you write, the 7 bits in question must be all zero bits. When you read, you must ignore these 7 bits. If this is still not clear, you should probably come see me. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Sep 12 21:45:14 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8D4jEaJ009569 for ; Tue, 12 Sep 2006 21:45:14 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8D4iZat026258 for ; Tue, 12 Sep 2006 21:44:35 -0700 Message-Id: <200609130444.k8D4iZat026258@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] argument ordering Date: Tue, 12 Sep 2006 21:44:35 -0700 From: william@bourbon.usc.edu Someone wrote: > When you say that arguments can come in any order do you mean that > these command lines should be accepted? > > hw2 -p='foo' stream -l=124 > hw2 encrypt foo.pbm -p='bar' -out='baz' > hw2 encrypt -out='baz' foo.pbm -p='bar' > hw2 -out='baz' foo.pbm encrypt -p='bar' > hw2 pbmfile2.pbm merge pbmfile1.pbm It's not that the arguments can come in any order. The commandline options can come in any order. The commandline options are the arguments that starts with a dash. The only commandline options in the spec are -p and -l for the "stream" command and -p and -out for the "encrypt" command. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Sep 12 17:29:10 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8D0TAIB027682 for ; Tue, 12 Sep 2006 17:29:10 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8D0PcF2023809 for ; Tue, 12 Sep 2006 17:25:38 -0700 Message-Id: <200609130025.k8D0PcF2023809@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599: hw2 query : Stream Cipher Date: Tue, 12 Sep 2006 17:25:38 -0700 From: william@bourbon.usc.edu Someone wrote: > For the command > hw2 stream -p=pphrase -l=len > If len is say 30 > Should the o/p be the first 8 bytes of the generated key or > do you want the whole 16 bytes to count towards len > > I understand that the key for the encrypt function is the first > 8 bytes but do you also want the first 8 bytes ONLY to count > towards the total len for the stream function Every iteration in the infinite loop you output 8 bytes. If you need 30 bytes of output, you need to go through the loop 4 times. When in doubt, you can check the grading guidelines and see what the "solutions" are like. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Sep 12 16:17:30 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8CNHUiZ023494 for ; Tue, 12 Sep 2006 16:17:30 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8CNDw4L022818 for ; Tue, 12 Sep 2006 16:13:58 -0700 Message-Id: <200609122313.k8CNDw4L022818@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599: hw2 query Date: Tue, 12 Sep 2006 16:13:58 -0700 From: william@bourbon.usc.edu Someone wrote: > i am getting the foll errors when i tried to use the stream code given > so, can you please suggest something ... > > make > g++ -c hw2_stream.cpp -I/home/scf-22/csci551b/openssl/include > hw2_stream.cpp: In function `int strm(char*, int)': > hw2_stream.cpp:11: error: invalid conversion from `char*' to `const > unsigned > char*' > hw2_stream.cpp:11: error: invalid conversion from `char*' to `unsigned > char*' > hw2_stream.cpp:16: error: invalid conversion from `char*' to `const > unsigned > char*' > hw2_stream.cpp:16: error: invalid conversion from `char*' to `unsigned > char*' > *** Error code 1 > make: Fatal error: Command failed for target `hw2_stream.o' I think all you have to do is type-casting since everything above looks like *compatible* types. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Sep 12 12:59:41 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8CJxfxw010889 for ; Tue, 12 Sep 2006 12:59:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8CJu9Au020176 for ; Tue, 12 Sep 2006 12:56:09 -0700 Message-Id: <200609121956.k8CJu9Au020176@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599: view pbm files Date: Tue, 12 Sep 2006 12:56:09 -0700 From: william@bourbon.usc.edu Someone wrote: > how do we view pbm files in their text mode? > When i open the small.pbm in emacs, I get the P4 and the 24 7 > but the bits are either /377 or /200 > > Is there a way to view it as below with 0's and 1's? > example: > P1 > 24 7 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 > 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 > 0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 1 0 > 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 > 0 1 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Since you have written hexdump in HW1, it should be very easy for you to do a binary dump of your PBM file! (There may also be some conversion tools out in the net that will convert a P4 PBM file to a P1 PBM file. But it would probably look like your HW1.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Sep 12 12:56:44 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8CJuinY010763 for ; Tue, 12 Sep 2006 12:56:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8CJrCT3020134 for ; Tue, 12 Sep 2006 12:53:12 -0700 Message-Id: <200609121953.k8CJrCT3020134@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci599 : encrypting with stream cipher Date: Tue, 12 Sep 2006 12:53:12 -0700 From: william@bourbon.usc.edu Someone wrote: > My understanding is that when encrypt is called, we create a new > stream cipher using the passphrase from input. Of what length do > we create this new cipher? Does it depend on the size of the > file or is it fixed? The "keystream" generated by the stream cipher should have infinite length! But of course, you should only generate what you need. A better way is to generate it on the fly. It's probably a good idea to create an abstract data type for the stream cipher and have a function that returns the "next 8 bytes" in the keystream when you call it. So, you should take the code in the spec and write it in an equivalent way. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Sep 12 12:47:30 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8CJlUo5010197 for ; Tue, 12 Sep 2006 12:47:30 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8CJhwdv020025 for ; Tue, 12 Sep 2006 12:43:58 -0700 Message-Id: <200609121943.k8CJhwdv020025@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: writing binary to stdout Date: Tue, 12 Sep 2006 12:43:58 -0700 From: william@bourbon.usc.edu Someone wrote: > I have spent a considerable amount of time researching and trying to > output my binary data to stdout. After extensive search, the functions > I learned do not run on nunki, since they are also implementation > dependable. For ex, freopen, reopen etc. > The problem is that I want to reopen stdout in binary mode, so that my > output is correctly displayed. > Currently I am writing it in a binary file, and it is correctly > written. However the program is crashing when i try to reopen stdout > in binary. > Can you please give suggestions. Solaris (and most systems out there) are POSIX compliant systems. So, if you do fopen(FILE,"rb"), it's exactly the same as fopen(FILE,"r"). There is no "binary mode". More correctly, there is no "text mode". So, when you want to read a file, what you get depends on what function you called to read the binary data. If the function you use treats data as text strings, it would appear that you are reading a text file. There is no problem writing binary data to stdout. Here is an example: char buf[80]; buf[0] = 0xc9; /* a binary character */ fwrite(stdout, sizeof(char), 1, buf); Or, if you like to use write(), you can do: write(fileno(stdout), buf, 1); You should *not* use printf() because it is for outputing ASCII characters. That's what "formatted output" mean (it means "human readable"). I'm not sure what happens if you do fopen(stdout,...). May be it's not allowed. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Sep 12 07:38:21 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8CEcL7l025142 for ; Tue, 12 Sep 2006 07:38:21 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8CEYopP016117 for ; Tue, 12 Sep 2006 07:34:50 -0700 Message-Id: <200609121434.k8CEYopP016117@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci599 : Key Generation for a Simple Stream Cipher Date: Tue, 12 Sep 2006 07:34:50 -0700 From: william@bourbon.usc.edu Someone wrote: > Also in the algorithm after the first iteration we have data in > the md5_buf. > So for the first iteration is there no data other than the > integer and the pphrase? I'm not sure why you are saying this. Please run the debugger and step through the code so you can see exactly what's going on. If the above is what you observed, please describe it in more details. Thanks! -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Monday, September 11, 2006 10:44 pm Subject: Re: csci599 : Key Generation for a Simple Stream Cipher To: csac@merlot.usc.edu > Someone wrote: > > > I have two questions regarding the key generation. > > > > 1. Will the key length always be a multiple of 8 bytes? > > No. When you use them to encrypt files, it's a funciton > of the file size. > > > 2. According to your algorithm on every iteration only 8 bytes are > > appended to the key. Do we have to do the same or can we append 16 > > bytes to the key if applicable since the output of MD5 is a 128 > bit > stream? > > No. You must run exactly the same algorithm since grading > depends on it. (In general, you can use all 16 bytes.) > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Sep 11 22:45:02 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8C5j1eU026795 for ; Mon, 11 Sep 2006 22:45:01 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8C5fWFh011072 for ; Mon, 11 Sep 2006 22:41:32 -0700 Message-Id: <200609120541.k8C5fWFh011072@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci599 : Key Generation for a Simple Stream Cipher Date: Mon, 11 Sep 2006 22:41:32 -0700 From: william@bourbon.usc.edu Someone wrote: > I have two questions regarding the key generation. > > 1. Will the key length always be a multiple of 8 bytes? No. When you use them to encrypt files, it's a funciton of the file size. > 2. According to your algorithm on every iteration only 8 bytes are > appended to the key. Do we have to do the same or can we append 16 > bytes to the key if applicable since the output of MD5 is a 128 bit > stream? No. You must run exactly the same algorithm since grading depends on it. (In general, you can use all 16 bytes.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Sep 11 22:22:49 2006 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8C5MmR6025274 for ; Mon, 11 Sep 2006 22:22:48 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8C5JJj6010644 for ; Mon, 11 Sep 2006 22:19:19 -0700 Message-Id: <200609120519.k8C5JJj6010644@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: csci599 : Undefined symbol MD5 Date: Mon, 11 Sep 2006 22:19:19 -0700 From: william@bourbon.usc.edu Someone wrote: > I m gettin the foll error : > > gcc -I/home/scf-22/csci551b/openssl/include -L/home/scf-22/csci551b/openssl/lib -lcrypto -o hw2 md5_stream.c > Undefined first referenced > symbol in file > MD5 /var/tmp//ccUKtwRl.o > ld: fatal: Symbol referencing errors. No output written to hw2 > collect2: ld returned 1 exit status > > Could you plz advise. The order in which the files appear in your command matters. You need to put your source file ahead of the libraries. (And please don't forget to use "-Wall" to turn on all compiler warnings and to use "-g" to turn on debugging.) So, you should try: gcc -g -Wall md5_stream.c -I/home/scf-22/csci551b/openssl/include \ -L/home/scf-22/csci551b/openssl/lib -lcrypto -o hw2 -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 10 22:20:44 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8B5Kiop008386 for ; Sun, 10 Sep 2006 22:20:44 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8B5HI8A029163 for ; Sun, 10 Sep 2006 22:17:18 -0700 Message-Id: <200609110517.k8B5HI8A029163@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Typo on the HW page Date: Sun, 10 Sep 2006 22:17:18 -0700 From: william@bourbon.usc.edu Someone wrote: > I think there is typos on http://merlot.usc.edu/csac-f06/homeworks/hw2/ > since it says > hw3 stream -p=pphrase -l=len > hw3 encrypt -p=pphrase -out=name [pbmfile] > hw3 merge pbmfile1 pbmfile2 > hw3 decrypt [pbmfile] > > "hw3" instead of "hw2" at a bunch of places. Oop! Fixed. Thanks! > Also I am getting this error when I compile after includeing md5.h > /home/scf-22/csci551b/openssl/include/openssl/md5.h:108: error: parse > error before "size_t" > /home/scf-22/csci551b/openssl/include/openssl/md5.h:110: error: parse > error before "size_t" This is the machine/architecture-dependent part. I usually include a bunch of standard stuff at the top of my .c file: #include #include #include #include -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 10 11:45:21 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k8AIjLgL004887 for ; Sun, 10 Sep 2006 11:45:21 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k8AIfuAQ022761 for ; Sun, 10 Sep 2006 11:41:56 -0700 Message-Id: <200609101841.k8AIfuAQ022761@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Submission deadline is getting close... Date: Sun, 10 Sep 2006 11:41:56 -0700 From: william@bourbon.usc.edu Someone wrote: > Prof, in the MD5 stream algorithm, > md5_buf[MD5_DIGEST_LENGTH]; > What should be the length of the MD5_DIGEST_LENGTH. You should use the constant MD5_DIGEST_LENGTH in your code. If you set everything up correctly (according to the openssl notes link on the HW2 spec web page), you should be able to do "man MD5" on nunki and you should see that you need to do: #include The openssl notes web page tells you where you can find this file and MD5_DIGEST_LENGTH is defined in it. If you have trouble finding this information, please let me know. > Also is there a good resource where we can read up on MD5 and the > stream cipher. You should click on the MD5 link in the HW2 spec. We have talked a bit about stream cipher in class. You can read the textbook if you want to know more. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Sep 8 20:59:29 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k893xTk0009201 for ; Fri, 8 Sep 2006 20:59:29 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k893uAO7008085 for ; Fri, 8 Sep 2006 20:56:10 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id k893uA8g008084 for csac@merlot; Fri, 8 Sep 2006 20:56:10 -0700 Date: Fri, 8 Sep 2006 20:56:10 -0700 From: william@bourbon.usc.edu Message-Id: <200609090356.k893uA8g008084@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Submission deadline is getting close... Hi, Please remember that you can submit multiple times. If you have not submitted anything yet, it's probably a good idea to submit something now (and make sure you don't accidentically delete some files). Please also remember that the late policy must be followed. So, if your submission is 1 second past midnight, according to the clock of the server, I have no choice but deduct 25% from your submission. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Sep 8 20:56:41 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k893ufaK009088 for ; Fri, 8 Sep 2006 20:56:41 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k893rMII008036 for ; Fri, 8 Sep 2006 20:53:22 -0700 Message-Id: <200609090353.k893rMII008036@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: submission Date: Fri, 08 Sep 2006 20:53:22 -0700 From: william@bourbon.usc.edu Someone wrote: > The "Electronic Submission Guidelines" for csci599 that we are directed > to for submitting assignments states ~csci551 in all of the paths. > > I don't recall hearing anything in the lecture, and I don't see any > email updates on the matter. Should I assume we are to use ~csci599 > instead? Or is ~csci551 correct? It is correct. I only have access to the ~csci551 account. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Sep 8 13:58:23 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k88KwNT6020762 for ; Fri, 8 Sep 2006 13:58:23 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k88Kt5Ok002781 for ; Fri, 8 Sep 2006 13:55:05 -0700 Message-Id: <200609082055.k88Kt5Ok002781@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: binary hexdump Date: Fri, 08 Sep 2006 13:55:05 -0700 From: william@bourbon.usc.edu Someone wrote: > I'm doing pretty good on the first HW assignment; I have the encoding > and decoding working (which I thought was going to be the most > difficult), and the hexdump working for stdin and ASCII files. > However, I'm still unable to resolve one last issue when it comes to > hexdump of binary files. I copy the bytes one at a time to an > uint16_t. On some of these, the upper 8 bits are '1111 1111'. So > instead of getting a two digit output such as '8e', I end up with > 'ff8e'. Any sugguestion on how I can "force" '0000 0000' into the > upper 8 bits of my uint16_t? Or is this a sign of another problem I > am not aware of? I usually like to typecast the hack out of things. So, if you have: char ch=(char)0x8e; uint16_t x=(uint16_t)0; If would do: x = (uint16_t)(unsigned int)(unsigned char)ch; Then in your debugger, you can do a "print x" right after this statement and see if x has 0x8e or 0xff8e in it. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Sep 8 13:50:02 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k88Ko2IC020277 for ; Fri, 8 Sep 2006 13:50:02 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k88KkieT002594 for ; Fri, 8 Sep 2006 13:46:44 -0700 Message-Id: <200609082046.k88KkieT002594@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599: question on reading from cin Date: Fri, 08 Sep 2006 13:46:44 -0700 From: william@bourbon.usc.edu Someone wrote: > Professor, I was under the assumption that, when reading from cin, you > start processing and stop listening to the input on a carriage return. > However, when you pipe in the input like you do for the test cases, > this means the input stops being processed after a newline "/n" in the > file. When are we supposed to stop reading from cin if not on a > carriage return? You should detect the end-of-file condition. With C, if you opened a file with fopen(), then you can call feof(). Or, you can keep reading until fopen() returns NULL. I'm guessing that with C++, there is something similar for cin. Please *always* assume that you are dealing with a binary file when you are doing a hexdump or base64 encoding. When you are doing base64 decoding, it's fine to assume that input is ASCII, but you should be ready to handle errors (such as input being a binary file). -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Sep 8 06:56:08 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k88Du8dc032617 for ; Fri, 8 Sep 2006 06:56:08 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k88DqpYd030493 for ; Fri, 8 Sep 2006 06:52:51 -0700 Message-Id: <200609081352.k88DqpYd030493@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CS 599: HW1 Output Date: Fri, 08 Sep 2006 06:52:51 -0700 From: william@bourbon.usc.edu Someone wrote: > For HW1, do you want the output to be to the monitor screen or to > a file? If file, what do you want the files to be named as? The output must go to stdout. Please do not write to a file. (Error messages should go to stderr.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 7 20:57:25 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k883vPSF002632 for ; Thu, 7 Sep 2006 20:57:25 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k883s997023812 for ; Thu, 7 Sep 2006 20:54:09 -0700 Message-Id: <200609080354.k883s997023812@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Test cases Date: Thu, 07 Sep 2006 20:54:09 -0700 From: william@bourbon.usc.edu Someone wrote: > For the test cases, my code can open the files if they're located > in the same directory, but is not able to open in $srcdir/f$f > file. Is that acceptable? We will grade according to the grading guidelines; therefore, you will lose points. I don't know why your code won't work! If you simply call open()/fopen() with the file given, then it shouldn't matter where the file is. You are probably doing something strange. May be you should come see me to discuss this. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 7 20:31:07 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k883V7Xb001262 for ; Thu, 7 Sep 2006 20:31:07 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k883RqgS023172 for ; Thu, 7 Sep 2006 20:27:52 -0700 Message-Id: <200609080327.k883RqgS023172@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: CSCI 599 (h/w 1) Date: Thu, 07 Sep 2006 20:27:52 -0700 From: william@bourbon.usc.edu Someone wrote: > In the specifications, do you mean that if the third arguement in > the command line is not given (i.e file name is not given) > then do we have to ask for the file name to be entered by the > user on stdin??? > OR > Should we just produce the hexdump of the data user types on > stdin?? In this case, you must read data from stdin. Please do not make this an "interactive" application. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Sep 7 17:30:07 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k880U7Sh024816 for ; Thu, 7 Sep 2006 17:30:07 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k880QrtK021610 for ; Thu, 7 Sep 2006 17:26:53 -0700 Message-Id: <200609080026.k880QrtK021610@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: cs599: question on testcase Date: Thu, 07 Sep 2006 17:26:53 -0700 From: william@bourbon.usc.edu Someone wrote: > Professor, I don't understand the error we are supposed to see in > the test case: > > ./hw1 dec-base64 $srcdir/f202.b64 > /dev/null > (should generate error messages to stderr) > > My program produces no error... I don't remember exactly, but I think f202.b64 has the wrong number of characters in it, so it's not a legitimate base64 file. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 6 19:33:27 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k872XRrY023900 for ; Wed, 6 Sep 2006 19:33:27 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k872UFIb001233 for ; Wed, 6 Sep 2006 19:30:16 -0700 Message-Id: <200609070230.k872UFIb001233@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Including test suite in the hw1 directory Date: Wed, 06 Sep 2006 19:30:15 -0700 From: william@bourbon.usc.edu Someone wrote: > I have a habit of including a small regression test suite with all the > code that i write. I have done a similar thing for the hw1 also. The test > suite in this case consists of all your scripts along with all the data > files and also my specific test cases for the code. It's a good habit! > I typically run the tests using "make regress" everytime i make a change > to the code. It's no problem to keep that in the Makefile since the TA will never do a "make regress". > I would like to know if its ok for the test suite to be present in the tar > that i would be submitting using bsubmit. > > The grading guidelines mention loss of points for including .o, core files > but i just wanted to clarify if including a test suite is fine. Please do *not* include the test data files in your submission. You should add "make submit" in your Makefile to *not* include test data files in creating a tar file. You can add "make backup" in your Makefile to *include* test data files so you don't lose them. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 6 19:28:42 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k872SfCc023688 for ; Wed, 6 Sep 2006 19:28:42 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k872PUbZ001158 for ; Wed, 6 Sep 2006 19:25:30 -0700 Message-Id: <200609070225.k872PUbZ001158@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] questions Date: Wed, 06 Sep 2006 19:25:30 -0700 From: william@bourbon.usc.edu Someone wrote: > 2 questions. > > 1. What should go in the README? Anything you think the TA should know when he grades. If you use any external source, you should state it (in addition to what you may write in the source files). If you have made any design decisions, you should document it in your README file. One thing you should definitely *not* put in your README file is part of the spec! You may assume that the grader is familiar with the spec. When you are graduating and interviewing, you may wonder what you have done in these programming assignments, you should be able to just read your README files and recall what were your accomplishments and what was hard about it. > 2. Do our error messages have to be the exact same as the > grading guidelines? No. We only compare stuff in stdout. If everything is correct, your program must *not* produce any extra output. If something is wrong, you should output error messages to stderr. (These are not explicitly stated in the spec because they are common practices in UNIX.) -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Sep 4 10:42:29 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k84HgTKm014662 for ; Mon, 4 Sep 2006 10:42:29 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k84HdQbS022179 for ; Mon, 4 Sep 2006 10:39:26 -0700 Message-Id: <200609041739.k84HdQbS022179@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] Syntax query Date: Mon, 04 Sep 2006 10:39:26 -0700 From: william@bourbon.usc.edu Someone wrote: > If the input text is entered through stdin, is it limited to 1024 bytes? If you look at the grading guidelines, you can see that we use very large files for grading! -- Bill Cheng // bill.cheng@usc.edu ----- Original Message ----- From: william@bourbon.usc.edu Date: Sunday, September 3, 2006 9:41 pm Subject: Re: [cs599] Syntax query To: csac@merlot.usc.edu > Someone wrote: > > > If the program is run as: > > > > ./hw1 hexdump ABC > > > > should we consider ABC as the input text to be hexdumped or > > is that an error? Please clarify. > > The spec use the notation [file] to indicate that file is > an *optional* commandline argument. Therefore, if file is > specified, it's not an error. So, in your example, you > must try to open ABC in the current working directory for > processing. > -- > Bill Cheng // bill.cheng@usc.edu > Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 3 21:41:49 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k844fnrQ008697 for ; Sun, 3 Sep 2006 21:41:49 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k844cmme015594 for ; Sun, 3 Sep 2006 21:38:48 -0700 Message-Id: <200609040438.k844cmme015594@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] Syntax query Date: Sun, 03 Sep 2006 21:38:48 -0700 From: william@bourbon.usc.edu Someone wrote: > If the program is run as: > > ./hw1 hexdump ABC > > should we consider ABC as the input text to be hexdumped or > is that an error? Please clarify. The spec use the notation [file] to indicate that file is an *optional* commandline argument. Therefore, if file is specified, it's not an error. So, in your example, you must try to open ABC in the current working directory for processing. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 3 13:53:42 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k83Krgom018229 for ; Sun, 3 Sep 2006 13:53:42 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k83KogSS011764 for ; Sun, 3 Sep 2006 13:50:42 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id k83KoguH011763 for csac@merlot; Sun, 3 Sep 2006 13:50:42 -0700 Date: Sun, 3 Sep 2006 13:50:42 -0700 From: william@bourbon.usc.edu Message-Id: <200609032050.k83KoguH011763@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: updated base64 encoding page Hi, I've made a copy of the base64 encoding/decoding web page from email.about.com to the merlot server. One reason was that the encoding table had a minor bug (62 should map to '+'. What I have copied was identical to where it came from. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 3 09:34:19 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k83GYJ0f005524 for ; Sun, 3 Sep 2006 09:34:19 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k83GVJvi009242 for ; Sun, 3 Sep 2006 09:31:19 -0700 Message-Id: <200609031631.k83GVJvi009242@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Compilation question Date: Sun, 03 Sep 2006 09:31:19 -0700 From: william@bourbon.usc.edu Someone wrote: > In the guideline it is written: > Separate compilation : -10 points > if the executable is compiled with a single line, deduct > all 10 points > I do not entirely understand what it means. I have done this in my Makefile > all: > $(CC) $(OPTION) $(SRCS) -o $(TARGET) > Please let me know if this is fine. You will lose some points for doing the above. If your $(SRCS) only contains one file, you will lose all 10 points. You must compile each of your .c file into a .o file and then *link* the .o files into the final executables. The idea is that you must break your program into modules and compile each module separately and then link all the module together to create your executable. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 3 09:00:48 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k83G0muI003846 for ; Sun, 3 Sep 2006 09:00:48 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k83FvmgU008953 for ; Sun, 3 Sep 2006 08:57:48 -0700 Message-Id: <200609031557.k83FvmgU008953@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: 2 questions Date: Sun, 03 Sep 2006 08:57:48 -0700 From: william@bourbon.usc.edu Someone wrote: > I have two questions: > 1) It said on the website, > "To ensure the encoded data can be properly printed and does not > exceed any mail server's line length limit, newline characters are > inserted to keep line lengths below 76 characters. The newline > characters are encoded like all other data. " > Does this mean that we insert newline character in the original data. No, you should not. > For ex, after 76 lines of original data, we should insert a newline, > and then decode it. I do not find a need for it, since it will be > decoded and will not remain as newline character when server reads it. The above sentences you quoted was phrased a bit strangely. What it's trying to say is that you should treat your input as a binary file and do base64 encoding. The output you can first consider to be a very long of encoded characters (with no newline). You cannot sent this output through mail because some mail server will truncate this very long line. Therefore, the safe thing to do is to insert newline characters for every 76 *output* charater to break up the lines. For our HW1, you should do this for every 64 output characters (please check your output against the "solutions" on nunki.) > 2) This is just to confirm. After decoding, will the size of > transmitted data increase. For example 3 bytes are converted in 4 > bytes of encoded data, each carrying only 6 bits of useful > information? You mean "after encoding"? Yes, after encoding, there is a 3 to 4 expansion from the intput file to the output file. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Sep 1 13:39:00 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k81Kd0W3006846 for ; Fri, 1 Sep 2006 13:39:00 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k81Ka7W3024305 for ; Fri, 1 Sep 2006 13:36:07 -0700 Message-Id: <200609012036.k81Ka7W3024305@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599]--query about decoding Date: Fri, 01 Sep 2006 13:36:07 -0700 From: william@bourbon.usc.edu Someone wrote: > Queries related to HW1, > when we encode a given file, do we just have to produce the > encoded txt file? Yes. If you cannot decode, you should give some error message. Since the decoded data goes to stdout, it is possible that in the middle of processing the input, you find something you cannot decode and you have sent some decoded data to the output already. In this case, just output your error message and terminate your program and do not process any more input. > Also inorder to complete the 64 character line do we need to > insert '=' char ? You need to follow the spec of base64. > Also when we have to decode the file what exactly is required ? > do we need to create a txt file with the decoded char? You *must* assume that the output is a *binary* file although the input for base64 decoding is an ASCII file. If you are not clear *exactly* what you should produce, please look at the grading guidelines. Your output must match *exactly* as show in the solution. If you still have trouble, you should come see me. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Sep 1 07:33:19 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k81EXJTg021490 for ; Fri, 1 Sep 2006 07:33:19 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k81EUSnh020565 for ; Fri, 1 Sep 2006 07:30:28 -0700 Message-Id: <200609011430.k81EUSnh020565@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] printf usage Date: Fri, 01 Sep 2006 07:30:28 -0700 From: william@bourbon.usc.edu Someone wrote: > Just to clarify, did you mean I CAN or CANNOT use printf with %x? > I took it as I CAN use it. Yes, you can. -- Bill Cheng // bill.cheng@usc.edu On 8/31/06, william@bourbon.usc.edu wrote: > > Someone wrote: > > > from the HW1 spec: > > "String I/O functions such as fgets(), scanf(), and printf() are > really > > meant for inputing/outputing null-terminated *strings*. Do *not* use > them to > > input/output binary data!" > > > > Is this a requirement or a hint? > > It's a hint. I guess the following should be added at the end: > "unless you are sure what you are doing". > > > Does this mean that I can't use printf with %x in the format string? > > Yes, but you must do it just right. Please remember that > printf() expects the corresponding value for %x to be an > integer (and not char). > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Aug 31 22:41:20 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k815fK0J027023 for ; Thu, 31 Aug 2006 22:41:20 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k815cTKl014424 for ; Thu, 31 Aug 2006 22:38:29 -0700 Message-Id: <200609010538.k815cTKl014424@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] printf usage Date: Thu, 31 Aug 2006 22:38:29 -0700 From: william@bourbon.usc.edu Someone wrote: > from the HW1 spec: > "String I/O functions such as fgets(), scanf(), and printf() are really > meant for inputing/outputing null-terminated *strings*. Do *not* use them to > input/output binary data!" > > Is this a requirement or a hint? It's a hint. I guess the following should be added at the end: "unless you are sure what you are doing". > Does this mean that I can't use printf with %x in the format string? Yes, but you must do it just right. Please remember that printf() expects the corresponding value for %x to be an integer (and not char). -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Thu Aug 31 10:28:31 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k7VHSVEJ023076 for ; Thu, 31 Aug 2006 10:28:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k7VHPg1B006999 for ; Thu, 31 Aug 2006 10:25:42 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id k7VHPgda006998 for csac@merlot; Thu, 31 Aug 2006 10:25:42 -0700 Date: Thu, 31 Aug 2006 10:25:42 -0700 From: william@bourbon.usc.edu Message-Id: <200608311725.k7VHPgda006998@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: short office hour today... Hi, Today is RAP day for the CS department: http://www.cs.usc.edu/rapday/ You are encouraged to attend the talks when you have free time. I'm planning to attend some talks. So, today's office hour will be from 12:45pm to 1:25pm. Sorry about the short notice. If you would like to make an appointment, I'm available from 3:30pm to 4:30pm. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Aug 30 21:00:47 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k7V40lBR015446 for ; Wed, 30 Aug 2006 21:00:47 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k7V3w07w031386 for ; Wed, 30 Aug 2006 20:58:00 -0700 Message-Id: <200608310358.k7V3w07w031386@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] development environment Date: Wed, 30 Aug 2006 20:58:00 -0700 From: william@bourbon.usc.edu Someone wrote: > The default make seems to NOT be GNU make, but the make man page on > nunki is for GNU make. > Will we be penalized if we use GNU make? There is no penalty for using something installed on nunki, as long as you give instructions in README. > Where can I find the man page for the default make on nunki? I have no idea. I tried a few things and it doesn't seem to be there. > GNU make is here: > /usr/usc/gnu/make/3.80/bin/make -- Bill Cheng // bill.cheng@usc.edu On 8/30/06, william@bourbon.usc.edu wrote: > Someone wrote: > > > Which version of gcc should we use? > > > > /usr/usc/gnu/gcc/2.95.2/bin/gcc > > or > > /usr/usc/gnu/gcc/3.3.2/bin/gcc > > You should use the default (I think it's 3.3.2). > > > Should we use GNU make or old UNIX make? > > You should use the default. If you don't, please specify how > to compile your code near the top of your README file. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Aug 30 17:34:24 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k7V0YNL6005457 for ; Wed, 30 Aug 2006 17:34:23 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k7V0VcQf029317 for ; Wed, 30 Aug 2006 17:31:38 -0700 Message-Id: <200608310031.k7V0VcQf029317@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] development environment Date: Wed, 30 Aug 2006 17:31:37 -0700 From: william@bourbon.usc.edu Someone wrote: > Which version of gcc should we use? > > /usr/usc/gnu/gcc/2.95.2/bin/gcc > or > /usr/usc/gnu/gcc/3.3.2/bin/gcc You should use the default (I think it's 3.3.2). > Should we use GNU make or old UNIX make? You should use the default. If you don't, please specify how to compile your code near the top of your README file. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Aug 30 10:12:35 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k7UHCZLU013919 for ; Wed, 30 Aug 2006 10:12:35 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k7UH9oAA024486 for ; Wed, 30 Aug 2006 10:09:50 -0700 Message-Id: <200608301709.k7UH9oAA024486@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: information about cygwin... Date: Wed, 30 Aug 2006 10:09:50 -0700 From: william@bourbon.usc.edu Hi, I'm forwarding an e-mail from a student in class. (I think he is saying that you should contact him via e-mail if you'd like to borrow his CD.) -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Wed, 30 Aug 2006 09:34:42 -0700 From: Arun Viswanathan To: william@bourbon.usc.edu Cc: csac@merlot.usc.edu Subject: Re: information about cygwin... william@bourbon.usc.edu wrote: > Hi, > > If you have some spare time and would like to "run UNIX on > your Windows XP", please check out "cygwin". I've added some > information about it at: > > http://merlot.usc.edu/csac-f06/description.html#unix > > The download and installation can take a very long time. > Please only download if you have a good Internet connection > or do it over night. I've been getting a pretty good > connection from ftp://cygwin.osuosl.org. > -- > Bill Cheng // bill.cheng@usc.edu In case if someone cannot get the download from the net, I have a CD burnt with the complete installables. Regards Arun Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Aug 29 23:10:46 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k7U6AkoQ013768 for ; Tue, 29 Aug 2006 23:10:46 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k7U683YP018386 for ; Tue, 29 Aug 2006 23:08:03 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id k7U683oj018385 for csac@merlot; Tue, 29 Aug 2006 23:08:03 -0700 Date: Tue, 29 Aug 2006 23:08:03 -0700 From: william@bourbon.usc.edu Message-Id: <200608300608.k7U683oj018385@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: information about cygwin... Hi, If you have some spare time and would like to "run UNIX on your Windows XP", please check out "cygwin". I've added some information about it at: http://merlot.usc.edu/csac-f06/description.html#unix The download and installation can take a very long time. Please only download if you have a good Internet connection or do it over night. I've been getting a pretty good connection from ftp://cygwin.osuosl.org. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Aug 29 17:20:10 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k7U0KAsY028223 for ; Tue, 29 Aug 2006 17:20:10 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k7U0HRXq014379 for ; Tue, 29 Aug 2006 17:17:27 -0700 Message-Id: <200608300017.k7U0HRXq014379@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: [cs599] I would like to create a makefile before the last minute. Date: Tue, 29 Aug 2006 17:17:27 -0700 From: william@bourbon.usc.edu Someone wrote: > But why do you recommend NOT creating a Makefile? Yikes! I think it's my broken English. I've fixed the web page. Sorry! -- Bill Cheng // bill.cheng@usc.edu On 8/29/06, william@bourbon.usc.edu wrote: > Someone wrote: > > > I am curious. What is the reasoning is behind this hint? > > I always create a Makefile first, because it speeds development. > > You may not believe this, but some people (even professionals) > will do "gcc ..." every time they compile! > -- > Bill Cheng // bill.cheng@usc.edu > > > > > > > On 8/29/06, william@bourbon.usc.edu wrote: > > > > Someone wrote: > > > > > Please reconsider this rule from > > > http://merlot.usc.edu/csac-f06/makefile.html > > > > > > "Don't create a Makefile until the last minute!" > > > > I'm not sure what you are trying to say! What you are referring > > to are not rules but "hints". > > > > Please remember that if we cannot grade your submissions as-is, > > we have to take points off for tweeking your submissions. > > -- > > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Aug 29 17:02:55 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k7U02tUo027332 for ; Tue, 29 Aug 2006 17:02:55 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k7U00DEe014050 for ; Tue, 29 Aug 2006 17:00:13 -0700 Message-Id: <200608300000.k7U00DEe014050@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: I would like to create a makefile before the last minute. Date: Tue, 29 Aug 2006 17:00:13 -0700 From: william@bourbon.usc.edu Someone wrote: > I am curious. What is the reasoning is behind this hint? > I always create a Makefile first, because it speeds development. You may not believe this, but some people (even professionals) will do "gcc ..." every time they compile! -- Bill Cheng // bill.cheng@usc.edu On 8/29/06, william@bourbon.usc.edu wrote: > > Someone wrote: > > > Please reconsider this rule from > > http://merlot.usc.edu/csac-f06/makefile.html > > > > "Don't create a Makefile until the last minute!" > > I'm not sure what you are trying to say! What you are referring > to are not rules but "hints". > > Please remember that if we cannot grade your submissions as-is, > we have to take points off for tweeking your submissions. > -- > Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Aug 29 16:56:38 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k7TNucBt027008 for ; Tue, 29 Aug 2006 16:56:38 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k7TNruGL013937 for ; Tue, 29 Aug 2006 16:53:56 -0700 Message-Id: <200608292353.k7TNruGL013937@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: Linux Date: Tue, 29 Aug 2006 16:53:56 -0700 From: william@bourbon.usc.edu Someone wrote: > For DEN students, having the homework test server (nunki) be a Sun machine > is inconvenient. > I don't have access to the Sun lab machines and I can't afford a Sun at > home. > A Linux server would be just as easy for you to grade on, but would allow > DEN students to have home access to a development machine. > > Thank you for your consideration. I'm sorry that this cannot be accommodated because we must grade on the same machine for all submissions. You are in a better position than those who would prefer to develop on the Windows platform. If you use only portable library functions, your code should run on nunki without modification. For the reason of fairness, we have to use a single platform for grading. Since day one on the course web page, it has been made very clear the we will only do this on nunki.usc.edu, so I am sorry that I will not change it. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Aug 29 16:49:03 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k7TNn3xD026608 for ; Tue, 29 Aug 2006 16:49:03 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k7TNkKti013747 for ; Tue, 29 Aug 2006 16:46:21 -0700 Message-Id: <200608292346.k7TNkKti013747@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: I would like to create a makefile before the last minute. Date: Tue, 29 Aug 2006 16:46:20 -0700 From: william@bourbon.usc.edu Someone wrote: > Please reconsider this rule from > http://merlot.usc.edu/csac-f06/makefile.html > > "Don't create a Makefile until the last minute!" I'm not sure what you are trying to say! What you are referring to are not rules but "hints". Please remember that if we cannot grade your submissions as-is, we have to take points off for tweeking your submissions. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Aug 29 16:41:38 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k7TNfcwX026216 for ; Tue, 29 Aug 2006 16:41:38 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k7TNcuLf013589 for ; Tue, 29 Aug 2006 16:38:56 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id k7TNcugH013588 for csac@merlot; Tue, 29 Aug 2006 16:38:56 -0700 Date: Tue, 29 Aug 2006 16:38:56 -0700 From: william@bourbon.usc.edu Message-Id: <200608292338.k7TNcugH013588@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: messages for me... Hi everyone, Since I'm teaching two classes, it would great appreciate if you can all begin your message subject line with [cs599] so I know which class it's for. When I reply to your message, the reply will also contain the same string and you can use it for your mail filter. Win-win situation! :-) Thanks! -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Aug 28 10:09:58 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k7SH9wgJ023583 for ; Mon, 28 Aug 2006 10:09:58 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k7SH7K5u011087 for ; Mon, 28 Aug 2006 10:07:20 -0700 Message-Id: <200608281707.k7SH7K5u011087@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: SHA-1 hash function under pressure Date: Mon, 28 Aug 2006 10:07:20 -0700 From: william@bourbon.usc.edu Hi, I'm just forwarding a link sent by a student from our class. We will talk about hash functions towards the end of the semester. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Mon, 28 Aug 2006 08:52:45 -0700 From: ... To: chengw@usc.edu Subject: SHA-1 hash function under pressure http://www.heise-security.co.uk/news/77244 Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Aug 25 22:45:31 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k7Q5jUaJ003260 for ; Fri, 25 Aug 2006 22:45:30 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k7Q5h2VT000594 for ; Fri, 25 Aug 2006 22:43:02 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id k7Q5h2vb000593 for csac@merlot; Fri, 25 Aug 2006 22:43:02 -0700 Date: Fri, 25 Aug 2006 22:43:02 -0700 From: william@bourbon.usc.edu Message-Id: <200608260543.k7Q5h2vb000593@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: HW1 grading guidelines... Hi, HW1 grading guidelines are available. Please click on the grading guidelines link in the spec. -- Bill Cheng // bill.cheng@usc.edu Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Aug 25 13:46:42 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k7PKkgM1005438; Fri, 25 Aug 2006 13:46:42 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k7PKiE6I023831; Fri, 25 Aug 2006 13:44:14 -0700 Message-Id: <200608252044.k7PKiE6I023831@bourbon.usc.edu> To: cs551@merlot.usc.edu To: csac@merlot.usc.edu Subject: USC Programming Contest Date: Fri, 25 Aug 2006 13:44:14 -0700 From: william@bourbon.usc.edu Dear Students, Please see the announcement below for the USC Programming Contest. (The USC Programming Contest is used to recruit talented students for the upcoming regional ACM Programming Contest). -- Bill Cheng // bill.cheng@usc.edu ---------------------------------- USC Programming Contest Saturday, September 9, 2005, 1-6pm in RTH 105/115 (new location!) www.cs.usc.edu/contest organized by David Kempe and Sven Koenig, Computer Science Department Have fun! Extend your resume! Show how smart you are! Impress your friends! Win cash and other prizes! Represent USC at the ACM Programming Contest! Do you like to solve problems like the following? To pay your friends a dollar, you can give them, for example, four quarters, or five dimes and ten nickels. Write a program that calculates how many different combinations of coins there are that make up a given amount of money from pennies, nickels, dimes and quarters. You are given the description of a lake as a polygon, as well as your own position in a boat somewhere on the lake. When you throw a rock in the water, the waves travel away from the impact point at a speed of 1 meter per second. Write a program to calculate the earliest time at which a wave will hit the shore. You are given the names of n people, who are to be divided into k alphabetical segments, for instance, to stand in line for registration at USC. An "alphabetical segment" consists of all people whose last name starts with a letter between two given endpoints (for example, D-H). Write a program that finds a division into k alphabetical segments such that each person is in exactly one segment, and the number of people in the largest segment is minimized. Participate in the USC Programming Contest! The contest is open to all undergraduate and first-year graduate USC students, regardless of major, as long as they are at most in their fifth year of attending any college. We also use the USC Programming Contests to pick students that we train for the ACM Regional Programming Contest. Students from USC placed 5th in the ACM Regional Programming Contest in Fall 2005, ahead of all teams from UC Los Angeles, UC San Diego and UC Irvine! Find out more by visiting the contest webpage www.cs.usc.edu/contest If you would like to keep updated about the contest, please sign up for our mailing list at groups.yahoo.com/group/usc-programmingcontest Please contact Prof. David Kempe (dkempe@usc.edu) with any questions and to register for the contest. Registration deadline is September 6, 2006. Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Aug 25 13:37:36 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k7PKbaw9004729 for ; Fri, 25 Aug 2006 13:37:36 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k7PKZ82N023575 for ; Fri, 25 Aug 2006 13:35:08 -0700 Message-Id: <200608252035.k7PKZ82N023575@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: Re: A nice book on code and code-breaking In-reply-to: <44EDFF77.5060700@usc.edu> References: <44EDFF77.5060700@usc.edu> Comments: In-reply-to Arun Viswanathan message dated "Thu, 24 Aug 2006 12:35:19 -0700." Date: Fri, 25 Aug 2006 13:35:08 -0700 From: william@bourbon.usc.edu Hi, I'm forwarding a message sent by a student. In the future, please post this type of information on the DEN message board for our class. Thanks! -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- Date: Thu, 24 Aug 2006 12:35:19 -0700 From: ... Subject: A nice book on code and code-breaking Hello Prof. Cheng, Just thought of sharing this information with you so that you can broadcast this to a wider audience if you feel it is appropriate. There is a very nice book on the history of code and code-breaking called "The Code Book" by Simon Singh. I have read this book and i think it will be very useful to understand the history of some of the techniques that we will cover in this course. According to me the book is very well written and is easy to grasp and understand. As i was browsing through your slides i saw the Demaratus wax-tablet episode and the microdots mentioned and that reminded me that the whole incident is given nicely in the book. This is what the Irish times had to say about this book: "A fascinating meander through the centuries; replete with tales of intrigue, political chicanery, military secrecy and academic rivalry" Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Aug 13 20:31:53 2006 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME autolearn=ham version=3.1.0 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id k7E3VrcT000633 for ; Sun, 13 Aug 2006 20:31:53 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id k7E3U7gF011365 for ; Sun, 13 Aug 2006 20:30:07 -0700 Received: (from william@localhost) by bourbon.usc.edu (8.13.5/8.13.5/Submit) id k7E3U7gw011364 for csac@merlot.usc.edu; Sun, 13 Aug 2006 20:30:07 -0700 Date: Sun, 13 Aug 2006 20:30:07 -0700 From: william@bourbon.usc.edu Message-Id: <200608140330.k7E3U7gw011364@bourbon.usc.edu> To: csac@merlot.usc.edu Subject: getting on the class mailing list... Hi, If you have not done so, please go to the following page: http://merlot.usc.edu/csac-f06/mailinglist.html and register with the class mailing list. Register with this list is *required* for this class. Thanks! -- Bill Cheng // bill.cheng@usc.edu