alexpgp: (pitching!)
2012-04-29 08:54 am
Entry tags:

Almost a workday...

The feet hit the floor at 5:30 am for a second day in a row, and staying away from the crypto homework was, for me, like staying away from the second cigarette of the day, which is to say, not bloody likely. (Back when I used to smoke—especially after I had begun to seriously think about quitting after having failed to do so several times—I noticed that I could get along pretty well without that first cigarette until some time in the afternoon. After that, however, I was effectively powerless to stop the craving for a second, etc.)

Probably what did it was a hint dropped about tackling the extra-credit homework problem, whose point was to examine a series of supposedly random numbers and then supply the number following the last number shown. The hint suggested that representing the numbers in binary might help. So I wrote a quick program to print all the numbers in binary and bingo! I immediately noticed the recurrence of a rather long sequence of '1's, and the rest was easy.

Having so easily dispatched what, in my mind, was supposed to be the hardest problem in the set, I turned my attention to the remaining problem, the point of which was to drive home, to the student, why a particular method of calculating a string's hash was flawed.

Now, calculating a hash for a string is a little like taking the string's "fingerprint." And if the hash is calculated competently, the hash will change a lot and unpredictably if you change the original string in any way. This also means if you know the hash, it's (very, very) hard to figure out what the original string is. It also means you can electronically send a message such as "Your order is now ready" along with the message's hash, and the recipient can't claim the message actually said "Your order is not ready", because the hash of the alleged message won't match the original, but I digress...

After a few minutes of thinking about the problem, I realized I had imagined it to be much more complicated than it was. To solve the problem, you had to figure out what the weakness in the calculation was, and then write a function that took a string as input and then changed it so that the new string's hash value would be the same as that of the original string.

It took me a while (mostly because I don't know Python that well), but I figured out a one-line solution and thereby completed the problem set. I am feeling positively accomplished.

So now, with my swelled head, I should sit down and get to work. I've got 2,900 words due on Tuesday, 5,000 words due the end of the week, and about 1,500 words due in the foreseeable future (like, by tomorrow night).

And it's time to start packing, again, as well.

Never a dull moment around here, let me tell you!
alexpgp: (Computing)
2006-06-08 09:29 am
Entry tags:

A marvelous start to the day...

A client sent me a reminder a few minutes ago - part of a broader effort aimed at its entire freelance staff (about 100 names), since their names were included in the "From:" field - about the need to maintain confidentiality. There is a sort of quintessential irony there, which could have been avoided via the judicious use of the "bcc:" option, but in any event, the irony brought a smile to my face.

I've just discovered Pixel, an image editor that performs much the same functions as Photoshop, but at a much lower price. It does not use the cookie-cutter functionality (i.e., standard dialogs and controls) available through commercial Windows application frameworks, which gives it a slightly different look and feel, but the plus side is that Pixel is available for a number of platforms (including Linux). The trial version is said to be full-featured, except for a popup window exhorting the user to buy a copy of the program and the fact that processed images have a watermark applied to them.

I ran into a feature of TrueCrypt this morning that at first looked like a bug, which I discovered as follows: My VAIO went into hibernation from a Windows session yesterday, but as I am used to starting the machine by jogging the power switch (I am told one hits the "any key" to revive a hibernating Windows session), the unit came up in boot-ready configuration and booted into Ubuntu Linux.

An attempt to mount the TrueCrypt "partition" failed, which flummoxed me, as I was absolutely sure I had the passphrase right. I put it out of my mind until I rebooted the VAIO into Windows (restoring the "hibernating" session) where, hey, presto! it was apparent that the TrueCrypt "partition" was still mounted. I haven't checked to make sure, but I've since dismounted and remounted the partition using the right passphrase, and suspect my problem lay with the partition's having already been mounted (even if hibernating) when I tried to mount it again under Linux.

I'll verify that later, however. As it is, I'm behind the eight-ball for the day's work: I need to apply some effort now.

Cheers...