Cincinatti Skyline

This is only the second time I’ve ever made it to a place in Middle America (and that’s not a densely populated metropolitan area). It’s a great place to go when you want to get away from the hustle and the bustle of urban life.

Platt ParkAmong other things, Cincinnati has great views of the natural environment around it. Outdoor parks and trails line the streets. Even downtown, there are public parks with grass and benches to relax during a lunch break. For those of you who really need to work, but would like to enjoy the outdoors, the city has sponsored free public wireless Internet! The city promotes a strong outdoor active lifestyle, which I find very inviting.

Cincinnati Symphony Orchestra Music HallCincinnati also has a very popular art scene. The Cincinnati Art Museum features local artists, whom capture the beauty of the city and the area around it. Admission (and coat check) is free to the public. The Cincinnati Symphony Orchestra is an absolute delight to listen to. The orchestra, led by Paavo Jarvi, plays at a very well-preserved historic hall. Afterwards, I got to meet Paavo at a private reception. It’s nice to be able to have someone that well-respected that accessible to you.

Cincinnati TripletsOf course, what visit to Cincinnati would be complete without a visit to the Great American Ballpark, the home of the Cincinnati Reds. Unfortunately, it was the off season at the time, so I just spent my time at the Reds Hall of Fame (really just a small museum out by the ballpark). It was a great place to view memorabilia from players past, such as Johnny Bench, Pete Rose, and Tony Perez. I also had the whole place to myself, so I ended up running around the place, spending a lot of my time trying to pitch a strike in a replica bullpen, complete with mound and speed camera.

Is this a sight-seeing destination? Not so much. However, if you have the itch to be outside, definitely make this a place to hit up.

Pictures from this wandering.

My photostream.

City Reflection

Winds Drawn in Snow

I went to Chicago last winter to see some snow. Though, I did have some problems getting there, as the airports were closing that day. I ended up stuck in the middle of a layover for a few hours before finally making it there. There was a lot of snow to be seen, and now I can say that I’ve braved a Chicago winter.

It was my first time seeing a lake frozen over, trapping boats and ships parked at Navy Pier. Ice floats broke off and made their way down the river. Gardens and parks are blanketed with white powder, which records telltale signs of wanderers past. Skaters skated in Millennium Park in the falling snow. Winter time in the city is fun to explore.

Chicago Night SkylineThe biggest attraction to Chicago is the architecture that lines the city. Since the great fire, the city has rebuilt itself in a manner that allows for such great buildings to be constructed (and with decent traffic flow, unlike some cities not on a grid system). The Chicago Architecture Foundation offers guided tours and insight into these magnificent buildings.

One complaint I do have about skyscrapers in general and the architectural landscape of Chicago specifically is the phallic imagery that plagues the skyline. In particular, the Aon Center shoots out from the ground unapologetically, straight up into the air. The architect, Edward Durell Stone, had a quote where he emphasizes that a skyscraper should continue straight up in the air, with no hint of any downward tendencies. Of course, this tower is only the third tallest building, behind the Sears Tower and the newly build Trump Hotel and Tower, which beats the Aon Center out by a few hundred feet, thus perpetuating the mentality of, “mine is bigger.”

NighthawksOne of the highlights of the trip, though, was visiting the Chicago Institute of Art. The gallery holds a vast collection of works, including canvas paintings from all periods to a good sized photography gallery. The most impressive collection had to be the Thorne Miniature Rooms, featuring miniature interiors of homes from the late 13th century to the early 20th century. Though for the best individual work, my happiest moment was seeing Nighthawks, my favorite painting, in person with my own eyes.

I still need to see Chicago again some other time when the snow and the ice are gone. But that’s for another time.

More pictures from this photoset

My photostream

Recently, I’ve had the “pleasure” of dealing with a few cryptography libraries. Due to the nature of cryptography itself, it sometimes becomes difficult to properly build an secured application that conforms to the strict requirements that most algorithms prescribe. Any variation in ciphertext generation could lead to an insecure cryptosystem.

Cryptographic Basics

Before I discuss the libraries themselves, I’ll run you through a crash course on cryptography. When encrypting a string of text or a binary file, you use a block cipher such as 3DES or AES to encrypt a single block of text. To encrypt an entire message, you use a mode of operation that prescribes how to repeat the block cipher computation. Examples of modes of operation include Electronic Code Book (ECB), where each block is independently encrypted, and Cipher Block Chaining (CBC), where each block is combined with the previous block before being encrypted. More information on these and other techniques can be found here.

Python

The Python cryptography library, pyCrypto, is a great framework that’s easy to use, but there are some details about it that causes me agony and long hours of pondering. It seems to be difficult to use with anything other than a simple block cipher using ECB mode. Any other mode of encryption that relies on randomization will cause some headaches when trying to piece a scheme together.

Most encryption modes rely on using randomized initialization vectors to hide any information about the plaintext. Modes such as CBC and CFB will XOR plaintext or keys with these IVs to make the encryption process non-deterministic, which protects it against chosen plaintext attacks. This is a bit of what it looks like.

from Crypto.Cipher import AES
obj = AES.new('abcdefghijklmnop', AES.MODE_CBC, '1234567890123456')
obj.encode("Hello, World!!!!")
ciph = obj.encrypt("Hello, World!!!!")

In the call to AES.new(), the key is the first parameter, and the IV is the last parameter. Seems really easy, but the problem is how do you generate the IV randomly? Using a fixed IV is really no better than using ECB mode. Instead, randomly generate a string to use as the IV.

Now, the thing to remember is that you should not use the Python random module. It says so on the documentation. The reason is that it uses the Mersenne Twister, which is a completely deterministic function. If an attacker can determine what time a message will be encrypted, then it’s possible to craft a message to be encrypted that can feasibly break the cryptosystem. Instead, use the os.urandom() function, which reads from /dev/random.

One of the more flexible modes of operation, Counter mode (CTR), is difficult to implement. PyCrypto only provides the framework with which you can harness the block cipher and encryption mode. However, you are expected to provide a function that will generate an incrementing counter value each time it is called. Seems easy enough, right? Well, if you read the notes for it, you’ll realize that your function must meet a strict set of requirements, primarily that the counter values can never repeat across the entire lifetime of the key. Not just this instance of the cryptosystem, but across *all* runs. Ever. Or else encryption is insecure. For everything. If you think about it, the logistics are a bit daunting.

Java

Security in Java is implemented using the Java Cryptography Extension (JCE), using the javax.crypto and java.Security libraries. As with any other Java library, you have to do a lot of typing in order to make use of any cryptosystem.

The first difference you will notice between the Python and Java libraries is that PyCrypto defines access to block ciphers via wrapper classes, while JCE requires the API user to pass in encryption modes and ciphers via string in the constructor. Although this allows for greater flexibility, the immediate design flaw is that the application must check for the NoSuchAlgorithmException and NoSuchPaddingException compile time exceptions upon construction of the cryptosystem.

What’s nice about the JCE is that it does all the busy work normally required in PyCrypto for you. You don’t have to generate your own random values or implement any other randomization function. You simply specify what mode and padding scheme you want, and it will generate both the ciphertext and initialization parameters and return them to you. However, the shortcoming in this approach is that you do not have fine tuned control over how your data is encrypted. If a specific cryptosystem is not supported by the library, then you simply cannot use it. An example of a serious lacking is that you cannot use AES in anything other than ECB mode. If you try to specify CBC mode, it will actually generate the ciphertext for you, but when you try to retrieve the IV value, it won’t tell you what it is.

Another hassle of using this library is that it falls under strict U.S. export restriction policy. In order to use any of the longer keys for the AES cipher, you must have permission (from whom, I do not know) to use it. You also have to do more exception handling in case your app is run on a platform with a reduced set of cryptosystems. For this reason, PyCrypto only accepts code submissions from non-U.S. nationals, though a good portion still falls under the same restrictions as JCE.

Summary

PyCrypto will allow you to do anything you want, provided you meet it halfway. JCE is a breeze to use if you’re willing to work within its small capability confines, but won’t let you go outside of its limitations. I have yet to try other libraries for other languages, but I hope to find one someday that’s simply a dream to use. Though with the nature of cryptography, I doubt that this is likely.

I traveled a bit in the past few months, but I haven’t been able to get all the pictures online. I have a few weeks of downtime, so I’ll attempt my best at going through a city per post of my travels along with photographic visual aids.

I’d like to start a “What I Learned in School” series of posts discussing topics I picked up in graduate school in the hopes that some people could glean some information without spending the money nor the 60 hours a week of stress. The predicament, however, is that I don’t know if I could write it for any particular audience. On the one hand, most people don’t want to hear about the differences between existential forgery and selective forgery for cryptographic hash functions. On the other hand, people who would be interested in that topic already know all the proofs and don’t care to see anymore. I’m still looking through the past year’s worth of content for stuff that would be interesting yet useful.

That, combined with the fact that the last few weeks of the semester has been compressed in terms of assignment makes it very hard to try to look at school work when I don’t have to.

No, not the kinky fetish material…. I’m talking about the typesetting program.

Don’t get me wrong: I don’t hate LaTeX. It’s awesome that I can write professional looking documents that didn’t look like I banged something out on Microsoft Word. But to me, it’s such a beating to do all my homework assignments with it and try to remember all the symbols.

I’ll admit that I cheat, though. I use LyX as a front-end GUI since I *really* don’t want to remember all the tags. Though, there are sometimes that I’ll need to use something that’s not on a button on screen or a key on my keyboard. Thankfully, I can use this guide:

http://www.artofproblemsolving.com/LaTeX/AoPS_L_GuideSym.php

It has handy little things like how to express set unions (\cup) and accent marks.

Now, if there was only some sort of software that could do my Crypto homework for me….

So late last year, Adobe released an early Christmas gift by releasing an alpha version of the 64-bit Flash Player plugin. What did that mean? You no longer had to run 32-bit browsers on your 64-bit Linux install or try nspluginwrapper for your 64-bit browser that ultimately failed out if you had too many windows open.

I’m posting this now because it took me this long to figure out what I was doing wrong and why it wouldn’t work. I had copied the libflashplayer.so file into one directory and then symlinked it into another, very much the same way Ubuntu does with the flashplugin-nonfree package. That’s a mistake. My system would crash every time it loaded an FLV.

It turns out if you (on Ubuntu 8.10) just do a straight copy into the /usr/lib/mozilla/plugins directory, it won’t crash. You can also copy it into the /usr/lib/firefox/plugins directory for good measure, but it didn’t do very much for me.

Some perks of having this:

  • Sites like Hulu took a long time to load, and now that no longer is the case.
  • When I have multiple pages with Flash (say, watching a lot of YouTube), sometimes, some pages would gray out the embedded Flash objects, and sometimes the Flash video wouldn’t even load; now, no problems.
  • I no longer have to run a 32-bit browser in my dchroot jail to view certain pages.

I’ll talk about my chroot jail some other time.

, , , , ,

I’m cautiously optimistic about the new presidential administration. Will things get better? It’s likely. Will America transform into the beacon of hope Obama promised on the campaign trail? Probably not. But we have to start somewhere. We’ll see in the next four to eight years.

The thing that agitated me the most was the amount of coverage all the major news outlets provided. It’s understandable that every network would want to cover the inauguration ceremony. Then, when they started eating lunch, the cameras were still rolling. When the President and First Lady were going back into the White House, the cameras followed them in, with comments like, “Michelle Obama has to do decide what dress she’ll be wearing this evening.” The cameras then waited patiently outside the White House to see what she finally came out wearing and proceeded to follow the First Couple around town to each and every ball.

The most annoying thing about that ordeal was that I was actually watching all of it (sneaking in an hour of Fringe when I could). I guess that’s where we’re heading as a society. News outlets are strictly putting out infotainment to please the masses. Sigh….

I found it amusing that NBC had Lester Holt covering the MTV Inaugural Ball. According to him, Obama is “hip” and “understands the youth” because he “listens to an iPod and carries a Blackberry.” I bet every twelve year old girl is jumping up and down after listening to that, saying, “OMG! HE HAS AN IPOD! HE TOTALLY GETS ME!”

The best part of the day, though, was the sleeping girl sitting behind Obama during the inauguration.

DIY XBox Upgrade Fun

I thought I could save a hundred bucks by upgrading the hard drive for my XBox360 hard drive by myself. Instead, I lost two days and had a few, “Sh*t, I broke it!” moments. I don’t recommend doing this unless you *really* know what you’re doing and have a lot of time on your hands.

Anyhow, I’m writing this up because of all the numerous guides that are out there, no one guide actually tells you all the minor “gotchas” that you’ll run across. I spent days scouring forums and search engines trying to figure out how to get the drive working and all the software tools needed. I’m hoping this will save some people trouble.

DISCLAIMER: This guide is provided as-is and without any warranty of any sort. I am not responsible for any damage, void of warranty, or any bodily harm that occurs as a result of this guide. Before beginning procedure on your equipment, you should read the entire article first to determine whether or not you are capable of completing the task.

Things you’ll need:

  • A very specific hard drive (newegg.com)
  • TORX Screw Drivers (T6 and T10)
  • A PC with a SATA controller and a SATA cable
  • Floppy drive and disk OR USB thumbdrive
  • HDDHackr
  • XPlorer360
  • A copy of hdss.bin (see end of post)
  • Patience

Remove the existing hard drive
First, get your little hard disk out. You can find detailed instructions with pictures here (pcworld.com). Hook it up to your computer and boot up Windows (yes, I had to use Windows for this since I can’t get some tools to run properly in Linux). Use Xplorer360 to backup your disk image. If you’re running Vista, make sure you run it as Administrator. From the menus, open “Drive->Open->Harddrive or Memcard….” Then, select “Backup Image.”

You’re pulling your previous image for two reasons: 1) To pull Partition 2, which is required for original Xbox game compatibility, and 2) to copy your existing data over (optional).

Prepare your DOS disk
Usually, you would put a floppy disk in the drive and tell Windows to format it as an MS-DOS boot disk. But most of you are saying, “Oh noes! I don’t have a floppy drive!” Well, you can use a USB key instead. Most of the guides tell you to use an HP USB disk utility and grab an MS-DOS 6.22 image. I couldn’t get that working for me, so instead, I used FreeDOS bootstrapped with UNetbootin (which even runs on Linux!).

To use UNetbootin, launch it and select “FreeDOS” from the distribution drop down. Then, select the latest version. At the time of this writing, only version 1.0 is available. Now, select the location of your USB disk at the bottom of the dialog and hit “OK.” The tool will download FreeDOS and install it to your USB drive.

No matter what your installation method is, copy the HDDHackr utility and the hdss.bin file (read the bottom of the section) onto your disk.

Flash the firmware of the new disk
This is the tricky part. As different hardware can produce different results, YMMV. It’s advised that you either print out these instructions or load it on another computer since you’ll be rebooting your machine a few times.

Shutdown your computer and unplug all of the SATA devices from the motherboard. Then, hook up your new 120GB hard drive to the computer. Plug in your USB disk or insert your floppy boot disk. When you turn your computer on, bring up the BIOS settings. Adjust your SATA controller settings to “Legacy” or “IDE” mode. This isn’t always necessary, but again, YMMV. FreeDOS wouldn’t pick up the hard drive in AHCI mode on my computer.

Also, if necessary, tweak with your device boot priorities so that your DOS boot disk will boot up. Save your configuration and continue booting.

Once you arrive at the prompt, run “hddhackr -f” to flash the firmware. If your hard drive isn’t detected, then try switching your SATA settings described above. More details on what else you can do with the utility on the hddhackr page on Xbox Scene.

Format the new drive
Now, your 120GB drive should now be recognizable to the Xbox360. Turn off your computer, unplug the hard drive, and reattach the hard drive to the Xbox console. Don’t bother putting the enclosure back together as you will be moving it back to the computer soon. Navigate to the Xbox System menu and bring up the Memory section. You should be able to format your drive by pressing Y.

Restore the old HDD image onto the new drive
Detach the hard drive from the Xbox and plug it back into the computer. Also, reattach your Windows hard drive back into the SATA controller and boot it up. Make sure you reset the SATA mode back to “AHCI” mode if you changed it! Failing to do so will prevent Windows from booting.

Once your up and running, run Xplorer360 again and open the 120GB hard drive. If your hard drive can’t be found, you may need to read up on this post. From the Drive menu, select “Restore Image” and select the HDD image from your original hard drive. This will set up the missing partition required for playing original Xbox games. Once that’s done, shut down the computer and unplug the new hard drive. Do not ever “hot swap” the drive while the computer is still running.

A note about this section. Other guides leave this out because an updated version of Xplorer360, dubbed Xplorer360 extreme 2, does it for you. I couldn’t find a copy of it that worked for me (most of the links I found were dead), so I did my method above. There seems to be one on IVC (see end of post), so you can give that a try.

Format the drive again
Yes, again. The first format was so that Xplorer360 can read the hard drive. After restoring the image from the smaller hard drive, the allocation tables now tell the console that the disk has a smaller capacity, so you will need to reformat it to recover the original size.

Plug in the hard drive back onto the console and follow the same instructions on Format the new drive section above.

(Optional) Migrate content from your old drive
I didn’t do this since I have a memory card to transfer game saves. I also just redownloaded all the Live content from the network. But if you want to recover your old data, here’s how.

Plug the hard drive back into your computer and boot Windows back up. Launch Xplorer360, and this time, select Drive->Open->Image. Open up the image file from the original hard drive. Select Partition 3 and export the directory onto your local disk.

From the Drive menu, open the new hard drive. Move the contents from your local disk containing the original Partition 3 onto the new hard disk (in the appropriate place, of course). After the data loads, shut down your computer and unplug the drive.

Reassemble the enclosure
Pretty self explanatory. Put everything back together and reattach the hard drive back onto the console. Turn it on, and enjoy your 107GBs of storage!

Extra Resources
Now you see why I don’t recommend doing this unless you’re bored? ;-) Anyhow, here are some extra links that I used while trying to get my drive up and running.

Alaskan Senator Ted Stevens was unseated by Democrat Mayor Mark Begich. As you may recall, Ted Stevens was responsible for providing us with such amusement as the Bridge to Nowhere, drilling for oil in the National Arctic Wildlife Reserve, and more recently, indicted for taking bribes.

Most of us, though, will remember him for the enlightening us that the Internet is a series of tubes.

Ah, Ted. You will be missed.