Archive for February, 2005

Class Diagram And Use-Case Exercises

Monday, February 28th, 2005

Click here for today’s Lab Exercises.

Assignment 1

Friday, February 25th, 2005

Now that the deadline has passed, I’ve posted a working solution to Assignment 1. If you weren’t able to get your program working, feel free to steal the code. If your program worked, feel free to laugh at it.

Note that posting code for this assignment does not imply that I will do so again. In fact, I probably won’t. But if you can’t get past the first assignment, you’re likely to have trouble for the rest of the semester.

One more thing: remember that you are allowed to work with a partner on programming assignments (you did read the syllabus, right?). I note that the students who didn’t finish the assignment on time were all working alone. If you’re having trouble, find a buddy. If you can’t find a buddy, get in touch with me.

An Illustrated Guide to Cryptographic Hashes

Wednesday, February 23rd, 2005

I’ve added a link to Steve Friedl’s An Illustrated Guide to Cryptographic Hashes to the course outline. I’ll say about this page what I said about the Kerberos paper: if you have trouble following the book, see if this helps.

Cracking DES

Wednesday, February 23rd, 2005

For the full story on DES, see Cracking DES: Secrets of Encryption Research, Wiretap Politics, and Chip Design.

Assignment Update

Tuesday, February 22nd, 2005

I’ve updated the assignment sheet with a more detailed list of guidelines, based on common problems with the first set of summaries. Please take a few moments to read them prior to turning in Assignment 2.

A clarification

Tuesday, February 22nd, 2005

I received an e-mail asking whether the example programming language is case-sensitive.

Well, err… yes, isn’t everything these days case-sensitive? (Whaddaya mean “not Visual Basic?”)

Yes, Pascal was case-insensitive, but subsequent languages in the Wirth family (e.g., Modula-2, Modula-3, Oberon, Component Pascal) have all been case-sensitive. I’ve updated the assignment to reflect that.

Compiler Construction using Flex and Bison

Sunday, February 20th, 2005

If you decide to use lex and yacc (or GNU flex and bison) for the programming projects this semester, you may find this book helpful.

Assignment 2 Extra Credit

Saturday, February 19th, 2005

Apparently I’m getting soft in my old age. You are no longer required to add antialiasing to Assignment 2, but you may do so for extra credit.

The Reshape Callback

Wednesday, February 16th, 2005

Ok, so I had to go back and re-read the documentation to get this working.

The default reshape callback (the one you get if you don’t call glutReshapeFunc()) calls glViewport(0, 0, w, h) and doesn’t change the coordinate system. The default coordinate system (which won’t change unless you call gluOrtho2D()) has its origin in thelower left corner of the window.

Unfortunately, the coordinate system used for the mouse position has its origin in the upper left corner. That means that if you don’t have a reshape callback, or if you call gluOrtho2d(0, w, 0, h);, you’ll end up with mouse coordinates that are the opposite of drawing coordinates. To fix that, you need to do one of two things:

  1. Subtract the mouse y-coordinate from the height of the window
  2. Change your drawing coordinate system to match the mouse coordinate system

Luckily, option (2) also allows us to resize the window without stretching the drawing or moving it all over the screen. Use the following reshape callback:

void reshape(int w, int h)
    glViewport(0, 0, w, h);
    gluOrtho2D(0, w, h, 0);

Don’t forget to register the callback in main() with glutReshapeFunc(reshape).

Here’s what the function does:

glViewport(0, 0, w, h);

Specifies that the viewport rectangle should occupy the entire window. The default reshape callback does the same thing.


We’re about to specify 2D Orthographic projection. The default matrix mode is GL_MODELVIEW, so we need to switch.


Clear any existing projection matrix

gluOrtho2D(0, w, h, 0);

Specify the left, right, bottom, and top clipping planes. Note that the bottom clipping plane is h, not 0.

Big Crypto News

Wednesday, February 16th, 2005

From Bruce Schneier’s weblog: SHA-1 has been broken. Two weeks from now we’ll be talking about hash functions. By that time it may be confirmed, and we’ll talk about the implications.