This works to recover a forgotten or lost iOS Backup password made in iTunes, it’s the same whether the device backup is for an iPhone, iPad, or iPod touch. Here are the necessary steps to find the backup password:
Open Keychain Access, found in /Applications/Utilities/
Use the Search box in the upper right corner and type “iphone backup”
Double click the result, assuming something is found in Keychain
Check the box next to “Show password” and enter the Mac administrator password to reveal the lost password associated with the encrypted iPhone backup
Make note of the password, then close out of Keychain Access
Now you can go back to iTunes and use that recovered password to use the Encrypted backup through the normal restoring from a backup process.
If nothing related to the iOS backup shows up in Keychain Access, you’re kind of out of luck in terms of accessing the encrypted backups unless you can somehow guess their password. The encryption is extremely secure (as it should be), and thus can’t be circumvented in any reasonable manner that is available to a human.
What if there is no password recovery option for the encrypted backups?
If the above trick doesn’t reveal the backup password, it doesn’t mean the iOS device is suddenly unusable, but it does mean that it must be used either in it’s current state, or reset to factory defaults and then set up as a new device without restoring from the encrypted backup, which basically treats it like a brand new phone. iCloud backups may still be available as well, as accessible through an Apple ID, but that’s also not guaranteed since not everyone uses the iCloud backup service.
It’s important to point out that this is specifically for accessing the password protected encrypted backups made from iTunes, and this is not going to have any impact on lost passcodes set on the device itself, or any other security measures that were taken to lock down the iPhone, iPad, or iPod touch, through a third party encryption service or otherwise.