April 2008 Archives

I just purchased a new hard drive for my laptop, a Seagate Momentus 7200.2 200GB drive.  Let me tell you - this thing is FAST.  Let me also mention that what I'm saying is no means scientific, and the environment in which I did the testing was not something I would consider "reliable" or "clean".  This is anecdotal evidence at best.

Seagate Momentus 7200.2 @ NewEgg

image

Above is a picture of HDTune showing the performance of the drive.  I am extremely happy with it, and it totally kicks ass over my slightly older Hitachi HITACHI Travelstar 7K100 HTS721010G9SA00.  Here is an ugly comparison shot of the Hitachi drive:

image

As you can see, the Seagate drive outperforms the Hitachi drive right from the start!

So, if you have a laptop and are looking for an inexpensive hard drive upgrade (@ time of purchase, $149 w/ free shipping from NewEgg) then I completely recommend the Seagate drive.  Also, the software available from Seagate's website to do the transfer was extremely easy to use.

I hooked up my new Seagate drive to a SATA->USB Converter.
I loaded up the backup software Seagate Disk Wizard.
I told the software that I wanted to clone my Hitachi drive to the Seagate drive.
It copied all 5 of my partitions to the new drive, including my Truecrypt partition.
The system rebooted, and then started doing the file transfer (Windows did not load, just the bootloader - i.e., where checkdisk and boot time defrag runs)
The system then let me know it was complete, and prompted to shutdown the computer.

Everything feels considerably faster now, and I am no longer waiting for the inevitable hard drive grind I usually get when I have a lot of programs active!  VMWare runs a lot faster as well, and everything just seems smoother and where it is supposed to be.  Additionally, the Seagate drive is Q-U-I-E-T (quiet) !!!  I could hear my Hitachi drive a mile away when it was busy.. I can not hear this drive at all.  Some people on the NewEgg message board mentioned vibration and other noises of which I have had no issues with.

I whole heartedly recommend this drive to anyone.  It was inexpensive, easy to hook up, easy to transfer the data (I usually use RIP & NTFSClone/Partimage/etc.), and boat loads faster.  As always, YMMV, but I am extremely happy/impressed with the new drive.  All is right in Matthew land. :)

- Matthew

My Favorite Tools List for Developers

| No Comments | No TrackBacks

Everyone else is doing it, and so should I :)  It's a good idea as well, because I may have to go looking to find out what I need to install on my machine the next time I decide to reinstall it.  Fortunately, I have a few things I use that I think are unique to me, that I haven't seen elsewhere.. so that makes me extra-cool in my book.

  • Webdrive - Webdrive is such a fantastic tool.  It allows you to connect to remote sites via FTP, SFTP[SSH], WebDAV, and a few other protocols.. the kicker is this:  It maps them as drives on your machine.  So for instance, I can have "Z:" mapped to ftp://www.csharpbydesign.com.  How utterly cool is that ?!
  • Pidgin - Everyone needs a cross platform, multi protocol IM client.  Pidgin is by far the best, and I think is better than all the rest.  Source code available.
  • SpeedSwitchXP - Because being able to change your CPU power from "mobile/battery/dynamic" to "max performance" in a click is nice.  Source code available.
  • KeePass (2.05Alpha)- I just recently discovered this gem (see my previous post Password Protection Utility) and I absolutely love it.  It's my new second brain.  Source code available.  A note on the source code - this has got to be the best looking source code I've ever seen in an Open Source application.  While there are very few code comments, it is almost self explanatory and extremely clean and concise.  I downloaded the source, opened it up in VS '08 and it just *worked*.  I could immediately run it and open up my password database.. not a lot of products work just "out of the box" like that.  I was impressed.  The author is old-school C++ so the code is full of m_'s, but that's not so bad.  You can tell he is a top-notch expert programmer.
  • RSSBandit - This is by far the best RSS reader that I have tried.  While I might like to try others, I'm sort of locked in at this point.. too much data to lose!  It downloads all of the posts and saves them locally which is a great feature.  I am a data collection junkie, and I would hate to lose the last 6-8 months worth of blog posts I've collected.  Source code available.
  • LogMeIn Ignition - I have a lot of remote sites that I need to control the machines of, and I use their Free version of LogMeIn, but pay for Ignition because it keeps everything in one place in a desktop app.. single click remote connect.
  • Developer Express Enterprise - Because these are some of the best .NET development tools I have ever used.  I've seen the competition and was just nowhere near as impressed with their products as I was with DevEx.  They are quick to fix bugs, update versions and add new functionality, send you daily builds if they have to, and have top-notch support.  The price is fair, and updates are included for a year.  Source code available ($).
  • Firefox 3 - Because it kicks ass over Firefox 2.  I was a die-hard Opera user for years, but Firefox 3 has taken the lead in my opinion and I've nearly stopped using Opera.  I was using the latest Beta version [9.50] and they haven't made any updates in months, and I was having some issues with it.. so I decided to try out the new Firefox and was pleasantly surprised.  Source code available.
  • Visual Studio 2008 - 'nuff said.
  • Putty - I have my own Linux server and there's nothing like opening up an SSH connection easily.  Putty is hands down the best SSH/telnet app available.  Source code available.
  • SnagIt/Camtasia Studio - Because being able to record/snap your desktop and make presentations easily is a nice thing to have.  Fortunately, I got a free version and am very happy with it!!  There's no way I could get my company to shell out for the latest-and-greatest, but it sure is a neat product. 
  • Jing Project - This is a new project by the folks that made SnagIt & Camtasia.  Currently, it's free but that may change in the future.  Seems to be a pretty nice program with quite a few options.  It takes a little getting used to, but I like it.  The "top" button (in the center of your screen) can be removed and it can be made to only sit in your System Tray.
  • LINQPad - Lets you run C# expressions/statements quickly and easily, in addition to being able to test LINQ statements easily.  Joseph Albahari is the author, and did a fantastic job on this must have utility.
  • Search and Replace [SR32] by Funduc software -This is a great search and replace utility.  I use it all the time for finding things, and doing mass replaces.  I'm quite happy with it and have been using it for nearly 10 years!  I haven't really looked for an alternate application to do the same thing.
  • MySQL Front Version 2.5 - Unfortunately this is abandon ware and is hard to find, but the 2.5 [the last "real" one] version of MySQL Front is amazing.  Lightweight, easy to use, and very functional database manager.  It still works with the latest MySQL database.  I am going to be very sad when MySQL-server is no longer able to work with this software.
  • HeidiSQL - I decided to check out the new incarnation of MySQL-Front again, and to my surprise HeidiSQL is actually pretty nice.  There are some differences between it and MySQL-Front that I don't like (doesn't seem to store "LIMIT" checkbox when exiting, but I'm sure I'm missing something) but I think I can get used to it and it has a LOT more features than MySQL-Front.
  • HomeSite 5.5 - Because I still write in PHP, and it's one of the best plain-jane HTML editors available.  I hate that there have been no updates made to this thing in so long, but that's probably a good idea as it would probably get bloated and messed up.  I've never used any of it's "fancy" features, I only like the HTML, PHP, and JavaScript color coding.
  • FreeLaunchBar - OMG!  I love this product.  I have a series of button icons in my Quick Launch that open up menus with my applications in them.  I don't like TrueLaunchBar though, as it has far to many bells and whistles for me.. but I would easily pay for FreeLaunchBar if there was a fee for it.
  • True Launch Bar - Unfortunately, Free Launch Bar doesn't work with Windows Vista.  So I had to buy True Launch Bar, and I highly recommend it.  The author is very responsive to support questions (see their forums) and the product is rock solid.  Additionally, he also worked out a deal with me - so it's high on my list of excellent products, an excellent company, with excellent support.
  • NuGenUnify/ILMerge - ILMerge is a Microsoft Research application for merging .NET assemblies into a single unit (for instance, your app has 100 dlls, merge them all into one single executable with your main application, easier distribution!).  NuGenUnify is a freeware program that is a GUI for ILMerge and makes life considerably easier than the command line.  Source code available ($).
  • NotePad++ - I am still getting used to this, but it's nice having tabs in "Notepad" and color coding.  Very lightweight.
  • Reflector! - Being able to look at other peoples code with the click of a button and learn cool-new-ways that they did things.  How awesome is that!?  I am however surprised that the Source Code is NOT available, and you can't use Reflector! on it :(
  • Microsoft OneNote - I have a TabletPC, but I don't use it anymore unfortunately so note-taking is not quite as fun as it used to be, however OneNote is still a great app and I put lots of things into it, especially Programming Solutions so I don't ever lose them.
  • Microsoft Office 2007 - Duh. I am a huge Outlook fan and probably always will be.  It's a bit bloated, but I've been using it for over 10 years, and there is just no switching.  I tried Thunderbird once, but was not impressed.  I suppose the only thing I could do, is write my own client.. but that would be to much work, and it would look just like Outlook!  I really only use it for email, nothing else.
  • Windows Live Writer - I'm writing this post with it now. I like it!  It even has a "Insert from Visual Studio" plugin which makes your pasted-code look pretty.  It is simple, and works with just about any blog.  Not only that, but it is extensible.
  • WinDirStat - excellent utility for seeing a visual representation of your drive usage.  Really neat program.  Source code available.
  • PerfectDisk - Excellent disk de-fragmentation utility.  Easy to use.
  • JKDefrag - Free and excellent disk de-fragmentation utility.  A little complicated to use, few "easy" options, but an excellent piece of software none the less.  Source code available.
  • Paint.NET - Great Photoshop alternative for those of us that don't know how to use Photoshop but for the basics.  Source code available.
  • 7zip - Next gen archive utility.  Way better than WinZip/PKZip. Source code available.
  • VMWare - Because everyone needs virtualization.  Note:  Not good to run it with Virtual PC side by side. :)  I HATE the new version of VMWare Server that is Vista compatible.  It's a bunch of web-based crap.
  • XMLPad
  • TortoiseSVN - Best SVN client for Windows.  Using a VS Subversion menu toolbar that some guy made makes it really rock!
  • Gaia Ajax Widgets - This set of AJAX controls for .NET is simply AMAZING.  By far the best AJAX implementation and controls for .NET, period.  Lightweight, easy to use, powerful, and totally kicks ass over ASP.NET controls, and many of their other direct competitors.  This toolkit is the #1 AJAX library for .NET in my opinion.  It is incredibly simple, but very complex.. it allows you to do just about anything that you need to do without writing a single line of JavaScript code.  Source code available.  ("Full Disclosure" - I am somewhat involved in the project, and know the author/owner, and have made some small contributions to the project and hope to make more in the future)

Well, that is just about it for my list!!  I hope it was worth the read.  These are the utilities that I use on a daily basis and for me are the best possible.  I've seen a lot of lists like this floating around the Internet, and wanted to add my opinion to the mix.  Some of these things are just indispensable (like Webdrive) to me and I wanted to share with you what I think are the best utilities to have on your development box.

*UPDATE 06-16-08:  I added links.

- Matthew

Password Protection Utility

| No Comments | No TrackBacks

I was browsing one of the blogs that I read from time to time, and noticed a utility posting for a program called KeePass!

It's an open source application that stores and manages your passwords for you.  I was really impressed with it.. it's fast, convenient and allows exporting of your passwords.  Above all - it seems safe and uses some of the best encryption methods available.

If you're looking for an excellent, free, secure, and open source password management tool [Windows only, it looks like] then this one looks like a fantastic tool to use.  It also auto-writes your username & passwords to a webpage with a single click!! 

For me, this means that I can A: change my passwords to more secure entities and not have to worry about remembering them all.

P.S.  I'm not sure the above is such-a-good idea :P

P.S.S.  I switched to using Windows Live Writer for writing posts in this blog, and I'm quite happy with it so far!

- Matthew

Asymmetric Key Encryption with RSA and X509

| 3 Comments | No TrackBacks

I had a requirement for a project that I am working on.  The project consists of a Windows 2003 Web Server serving up custom C# Web Services, and a public-facing LAMP [Linux, Apache, MySQL, PHP] web server.  I have certain data that I am storing in a MySQL database that must be encrypted.  Given that this is a webserver symmetric encryption does not make sense because if someone gained access to the PHP files, they would have the password to decrypt the data!!  That would be bad.

So I chose to do asymmetric encryption, thus only the Public Key would reside on the server.  The PHP scripts would encrypt the data, store it in a database, and when needed would be transmitted to the web-services server and decrypted using C#.  This proved to be a rather daunting task however. 

PHP requires either an X509 certificate, or a PEM certificate.  On the surface, .NET does neither!  The RSACryptoProviderService was able to create keys, but they were in some XML format which was incompatible with what I needed to do with PHP.

It turns out that I needed to use X509 certificates to accomplish what I needed.  Yikes, I had absolutely no idea what X509 was and how I was going to use it.  Little did I know that the internet was going to conspire against me and make finding all of the information that I needed virtually impossible.  After spending countless hours going over the MSDN, web pages, and other resources.. I finally managed to figure out what exactly needed to be done.

Following this blogpost on using Makecert I was able to create a certificate authority to sign my certificate, and create a certificate.  I installed in it in the Certificate Store, exported BOTH the Private and Public key file.  The public key I exported in BASE64 (second option) and the private key in PKCS#12 (PFX) format.  The private key is readable by .NET for the decryption.

I sent the public key to my PHP webserver.  Using the following code I was able to encrypt a string:

Now on the .NET side.. here is the code I used to decrypt the data using a private certificate file:

/// <summary>
///
Decrypt data
/// </summary>
/// <param name="Base64EncryptedData"></param>
/// <param name="PathToPrivateKey"></param>
/// <returns></returns>
public static string DecryptEncryptedData(stringBase64EncryptedData, stringPathToPrivateKeyFile) {
    X509Certificate2myCertificate;
    try{
        myCertificate = newX509Certificate2(PathToPrivateKeyFile);
    } catch{
        throw newCryptographicException("Unable to open key file.");
    }

    RSACryptoServiceProvider rsaObj;
    if(myCertificate.HasPrivateKey) {
         rsaObj = (RSACryptoServiceProvider)myCertificate.PrivateKey;
    } else
        throw new
CryptographicException("Private key not contained within certificate.");

    if(rsaObj == null)
        returnString.Empty;

    byte[] decryptedBytes;
    try{
        decryptedBytes = rsaObj.Decrypt(Convert.FromBase64String(Base64EncryptedData), false);
    } catch {
        throw newCryptographicException("Unable to decrypt data.");
    }

    //    Check to make sure we decrpyted the string
  
if(decryptedBytes.Length == 0)
        returnString.Empty;
    else
        return
System.Text.Encoding.UTF8.GetString(decryptedBytes);
}

There you have it! That's it in a nutshell. By using the X509Certificate2 class, I was able to read in the key [this reads in several key formats, by the way], then create the RSACryptoServiceProvider object and cast the .PrivateKey field into it, and perform the decryption.

- Matthew

About this Archive

This page is an archive of entries from April 2008 listed from newest to oldest.

March 2008 is the previous archive.

May 2008 is the next archive.

Find recent content on the main index or look in the archives to find all content.