I recently attempted to restore a phone from my backup file. It prompted me for a password but none of the passwords I typed would work. I tried every password I know. I was very frustrating because if you don't have the password, you can't use the backup file.
So, after calling support and spinning around on this for a while, I figured out how to find what the password on the file was. It turns out, I had mistyped it (twice) when I set the password, so none of my known passwords would match.
For this to work the following things need to be true:
NOTE: For this to work, you need to be on a Mac. Also, it requires that when you set your password, you clicked the "Remember this password in my keychain" check box.
To retrieve my password, I did the following:
1. Opened Applications>Utilities>Keychain Access.app
2. In the search dialog, searched for "iPhone Backup"
3. Double clicked on the most recent entry for "iPhone Backup"
4. At the bottom of the dialogue box, click "Show password" and type in the administrative password for the computer.
The password is then revealed.