How to decrypt iPhone backup
I screwed up my iPhone today. the backup was corrupt and could not be restored. to make the matter worst, backups were encrypted as well.
Fortunately, I did know my encryption password. there are a few apps out there supporting encrypted iPhone password, but they are all paid apps. My inner hacker told me to do it yourself. So, I did.
- Xcode. remember to install command-line tools in preferences
- Python 2.7 (or 2.6) : for building a custom kernel and computer-side tools. Python 3 is not supported.
curl -O http://networkpx.googlecode.com/files/ldid
chmod +x ldid
sudo mv ldid /usr/bin/
#fix if unix tools were not installed with xcode
sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate /usr/bin
#create symlink to the new xcode folder
sudo ln -s /Applications/Xcode.App/Contents/Developer /
#install OSXFuse for img3fs
curl -O -L https://github.com/downloads/osxfuse/osxfuse/OSXFUSE-2.3.4.dmg
hdiutil mount OSXFUSE-2.3.4.dmg
sudo installer -pkg /Volumes/FUSE\ for\ OS\ X/Install\ OSXFUSE\ 2.3.pkg -target /
hdiutil eject /Volumes/FUSE\ for\ OS\ X/
#you will need these python modules on Windows as well
sudo easy_install M2crypto construct progressbar setuptools
sudo ARCHFLAGS='-arch i386 -arch x86_64' easy_install pycrypto
I recommend using Homebrew for installing OSXFuse.
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
and then just run
brew install osxfuse
Note: if you get ‘Swig’ error whist installing M2crypto, just run brew install swig then try again.
Now, download iPhone-dataprotection and decompress it. then run
python iphone-dataprotection/python_scripts/backup_tool.py \ ~/Library/Application\ Support/MobileSync/Backup/long-hex-string \ outdir
don’t just copy/paste this command. notice the bold parts. choose your backup folder (long hash string) and decide where to save the decrypted backup.
enter your password and that is all.
Device Name : My iPhone Display Name : My iPhone Last Backup Date : 2012-12-09 16:00:18 IMEI : 565988269232005 Serial Number : LN1G2AIND69G Product Type : iPhone4,1 Product Version : 6.0.1 iTunes Version : 11.0 Extract backup to outdir ? (y/n) y Backup is encrypted Enter backup password : ******************* Writing Documents/products/97266p_bifold_3.jpg ... ... ...