CampusChat

Today while going through some old files I found an old program I wrote back in college for a Microsoft-sponsored programming contest. Microsoft was doing a big marketing push for the newly-released .NET Framework and C#, so they sponsored programming contests at various universities to promote it (hook 'em while they're young? cough). I ended up winning an original Xbox, which was also new and cool at the time. Somewhat ironically, there was a guy from Sun Microsystems at the contest who saw my program and got me a part time job there working on Solaris.

The point of the contest was to write an application that would be useful for the university, so I decided to write an instant-messaging system called CampusChat. At the time the university had no global IM system that students could use to communicate with TAs and professors, or find and collaborate with other students. My ultimate goal would have been to create a grand, unified online environment like Project Athena at MIT, but I only had a couple of months so I went with IM.

It also allowed me to finally 'correct' all of the horrible (perceived) flaws in the corporate IM systems of the day (namely AIM, MSN and Yahoo). These flaws were:

  • The IM servers were centralized and under the control of one corporation; people could not run their own servers.
  • The IM client software contained advertisements that had to be hacked out of the executables.
  • IM sessions were not encrypted on the wire, so your dorm-neighbors and ISPs could read all the messages (this has been mostly corrected these days, thankfully).
  • IM sessions were not encrypted end-to-end, so the IM provider could read all your messages (this is still not fixed today..).
  • Trust and authentication were ad-hoc, with no method to determine who you were actually talking to.
  • There was no way to tell if the person you were talking to had actually received your recent IMs or had become disconnected (extremely annoying back in the dial-up days).
  • You didn't know if the other person was in the middle of typing a message to you or not.
  • Other users would often select horrible, ugly fonts that you could not override.
  • The customizability of your own font and UI themes were very limited.
  • There was no plugin architecture that you could use build apps on top of the IM system's authentication and communication layers.

The (arguably) largest flaw of the corporate IM systems was that they weren't interoperable with each other at the time, and by creating my own IM system I was admittedly making that problem even worse (open protocols like Jabber and SIP did not really exist yet).

I based CampusChat around Kerberos 5, which is a distributed authentication system that can be used for secure client-to-client communication using strong encryption. All of the IT infrastructure at the University of Colorado was based on Kerberos 5, so every student and faculty member already had Kerberos IDs, which were their usernames and passwords. It was also integrated into Windows 2000+, so if you were logged into a computer with your university username, CampusChat automatically grabbed your credentials from your login session and you didn't have to type in your password again.

Kerberos allowed for the encryption and mutual authentication of individual IM sessions between users, so that you knew exactly who you were talking to, and nobody along the wire (even the IM server itself) could read the communications. I realized later that since Kerberos is based on having a trusted third party generate the symmetric keys (rather than using public-key methods), its entire security rests with the "trusted third party" – in this case the university IT department, which was arguably nothing of the sort (as far as us Computer Science students were concerned). A malicious Kerberos server could have ruined the entire security scheme.

Once you logged into a CampusChat server, the main 'Buddy List' window looked like one of these (all screenshots are using the 'chess' theme):

CampusChat

The screen on the left is of a server in "community mode", where users can see all of the other people who are logged into the same server and the public chat rooms that are available. This mode was designed for individual classes or departments – a professor could set up a server for his/her students to use for collaboration, allowing students to find each other and their TAs during 'virtual office hours'. This mode is contrasted with 'classic mode', which is on the right, and behaves just like AIM or MSN, where you have lists of 'buddies' that you maintain, and you can only see the online status of the people you have explicitly added. This mode was designed more for university-wide servers which everyone could log into at once. The controls on the bottom allow you to add buddies and create public or private chat rooms. The blue slider at the bottom of the window allowed you to adjust the transparency of the window and set it to be "always on top".

IM windows look like this:

CampusChat

The first thing they do is initialize a secure encrypted connection with the other user. At the bottom of the window the status bar lets you know that all of your IMs have been received by the other party (or it lists the number of outstanding messages for which an ACK has not been received). It also tells you if the other person is currently typing, and has the transparency-slider control. The "Direct TCP connection" button allows you to establish a direct connection to the other user, in order to cut out the IM server from the conversation (for speed, as well as to prevent malicious servers from logging the timing and frequency of your messages).

The Text Settings dialog allows you complete control over all of your text. You can use any CSS styles you want on your text, and you are also given the ability to override your conversation partner's CSS text styles if you don't like them. For example, if you were to use the CSS string "text-align: right; background-image: url(http://www.google.com/images/logo.gif);", you would get this:

CampusChat

CampusChat also supports Unicode (natively, since it is written in C# and Managed C++), which allows you to converse in any language (AIM was infamous at the time for not supporting Unicode):

CampusChat

Multi-user chat windows are pretty similar to IM windows, though users have less control over various settings:

CampusChat

CampusChat supported an extensive plugin API, which you could use to modify the base client software and build your own applications on top of the secure connection. It just required implementing a specific C# interface and plopping your DLL into a specific folder. Complete .NET objects could be easily sent between clients using simple function calls (they were serialized to binary form, compressed, encrypted, and sent out automatically).

To keep things simple, I implemented a lot of CampusChat functionality as plugins, such as file-transfer, away-messages, directory lookups, speech recognition, and text-to-speech. The away-message functionality was particularly cool because you could write your own away-message provider that allowed all kinds of fancy logic about which specific people to send the messages to, different messages for different people, and so on. To demonstrate the flexibility and power of the API I also created a full-featured chess game as a plugin (only requiring a couple hundred lines of code):

CampusChat

Alas, in the end CampusChat died a death of neglect after the programming contest and was never widely adopted at the university. It still works great, but you can only use it if you have a valid Kerberos 5 account on some domain, which I no longer do. I've uploaded the ZIP file here for posterity:

Posted on March 2, 2008
Comments (7) Trackbacks (0)
  1. Sooooo, this is really cool! We know you got the job as a result of your genius, but did you win the contest?

    BTW, nice that you added your photo! It’s a good one. I am too addicted to anonymity to have my own photo out there anywhere.

  2. lol so I ‘forgot’ to mention the result of the contest :). I ended up losing the contest because the computer science professors who were judging it didn’t understand what this crazy “IM” thing was all about and couldn’t figure out how to log in :(. A ripoff of Notepad ended up beating me – it was basically an edit box pasted onto a window. It was quite the outrage 🙂
    About the photo – thanks! I wasn’t sure if it was a good one but I thought it seemed OK.

  3. Well, I think your chat project was a pretty ambitious entry into the contest and I’m sure your instructors now realize that you were ahead of the game.

    And I do like the photo! It’s friendly. 🙂

  4. I remember the contest vividly, and how my mouth dropped open when they announced the winner. I think the phrase “2 minutes of work” was used a few times.

  5. Yeah, fortunately you were there so the whole thing wasn’t a total waste! Working at Sun more than made up for losing the $2000 prize.

  6. CampusChat was the shiznit!

    that was very lame that you didn’t win the contest.
    Lookin pretty snazzy in the pic as well sir.

  7. Мне вот интересно: Как ты знал что он не король? И почему сразу на суку перешел? Надо было с дурака начинать, и оттуда прогрессировать

Trackbacks are disabled.

Me

Apps

CubeCheater Piratizer

Search

Archives

Site Tasks