https://discussions.apple.com/thread/3091672?start=30&tstart=0 - One of the posts includes the following quote:
"I may have found a solution to this, as it has worked for me already.Another similar post here suggests:
My problem was similar to this; I had restored my phone to an old point just to see what it was like and when I tried to restore it back to my most recent one it asked for a password. I put in any it could possibly be to no avail. On the summary page on itunes, I went down to the back up section and saw the "Encrypt iPhone backup" part was unchecked, so I checked it and entered a new password. I went to restore it and when asked for the password, I simply put in the password I just set it as and it worked. From my observation everything is back exactly how it was.
I hope this helps anyone with this problem."
- from /Application/Utilities open the Keychain Access utility
- make sure that on the left side "All items" is selected under categories
- in the upper right search field enter "iphone" and then look for a keychain item named "iPhone Backup" of kind "application password". If there is no such item, you´re mostly out of luck
- double click on the "iPhone Backup" entry and in the new window that will open, click on the "show password" checkbox
- you will now be prompted to enter your password (the one your user has on your Mac) to show the iPhone backup password; click Allow (once). You should now see the iPhone Backup password in clear text.