The 4 digit password is there for a good reason.
You will need to hook up your iPhone to iTunes, and restore.
You may need to "Put your iPhone into DFU mode. To do this, reboot your iPhone by holding down the power and home buttons simultaneously for about 10 seconds. When you see the Apple logo, let go of the power button but continue holding down the home button. Soon you will see an image displaying a USB cable, the iTunes icon, and a message that says "Connect to iTunes."
Assuming you still have your iPhone connected to your computer with iTunes open, you'll also see a message telling you iTunes has detected an iPhone in recovery mode and needs to restore. Now you can click the Restore button in iTunes and then wait for iOS to download and install on your iPhone.
Sync your iPhone with iTunes to restore all your data and you'll have it back to normal with no password!"
Do this on the PC/mac you normally sync with.
http://support.apple.com/kb/HT1212http://support.apple.com/kb/HT1414