iPhone 3.1.3 Upgrade Issues

Today, I was trying to update the iPhone OS from 3.1.2 to 3.1.3. While doing the update, I made couple of mistakes

1) I was running a older version of iTunes. [ not the 9.0.3 version ]
2) I did not sync my existing applications with iTunes.

It so happened that iTunes started downloading the update, and when it was trying to update the firmware there was a problem and everything just stopped working..My iphone started giving a display indicating me to connect to iTunes but when I connected, it prompted me to do a "restore". When I did the restore, it stopped with an error => Error Code 14. Searching across the forums did not help and I did all of these to get rid of the problem

1) Installed iTunes in a different administrator account and tried downloading the update, the problem persisted.

2) Tried the entire process [ iTunes download + update ] on a different PC, same error code again.

3) I tried downloading a 3.1.2 version and with Shift + restore, pointed the update file to this file. Apple was not able to do the update..

4) Rebooted the PC multiple times...no clue at all..

5) Tried across multiple USB ports, multiple connecting wires.. no clue either.

After doing all this, I got fed up and thought I would have to take this to an Apple genius store to get this fixed..but this simple activity solved the problem.

1) I generated the MD5 hash of the download file(s)..(for both the logins)..I took the file from this location

C:\Users\[User Name]\AppData\Roaming\Apple Computer\iTunes\iPhone Software Updates

In both these cases, the MD5 hash was different. Then I noted that there is some problem in the downloaded file.

2) I tried cleaning up all the existing updates and downloaded the update once again. With this update, when I tried restoring...it was successful this time. The correct MD5 hash of the downloaded file came to be

4117E4B22565E69205A84E9EEEF0583E

The MD5 hash was generated with ChaosMD5v2.5.

So, if you get the same problem, (Error code 14), then verify the downloaded file and re-download it..May be ,it could solve your problem too..