Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlite3.DatabaseError: file is encrypted or is not a database #14

Closed
bacoboy opened this issue Dec 28, 2016 · 7 comments
Closed

sqlite3.DatabaseError: file is encrypted or is not a database #14

bacoboy opened this issue Dec 28, 2016 · 7 comments

Comments

@bacoboy
Copy link

bacoboy commented Dec 28, 2016

Following on from conversation in #13 and #10, I wasn't sure if this was the same or different problem so posting as a separate issue:

% python ./backup_tool.py /Users/shoffman/Library/Application\ Support/MobileSync/Backup/6460815e649d545617c60b38ff4efe459c32c935/
Device Name : sPhone6
Display Name : sPhone6
Last Backup Date : 2016-12-28 01:23:50
IMEI : XXXXXXXXXXX
Serial Number : XXXXXXXXXX
Product Type : iPhone7,1
Product Version : 10.2
iTunes Version : 12.5.4.42
Extract backup to /Users/shoffman/Library/Application Support/MobileSync/Backup/6460815e649d545617c60b38ff4efe459c32c935_extract ? (y/n)
y
Backup is encrypted
Enter backup password :
XXXXXXXXXXXXXXXXXXXXXXXXXX
Traceback (most recent call last):
  File "./backup_tool.py", line 104, in <module>
    main()
  File "./backup_tool.py", line 101, in main
    extract_backup(backup_path, output_path)
  File "./backup_tool.py", line 54, in extract_backup
    manifset_db = ManifestDB(backup_path)
  File "/Users/shoffman/workspace/iphone-dataprotection/python_scripts/backups/backup10.py", line 94, in __init__
    for record in cursor.execute("SELECT fileID, domain, relativePath, flags, file FROM Files"):
sqlite3.DatabaseError: file is encrypted or is not a database

This was using commit 241e52f.

Happy to help debug if somebody more familiar with the codebase can assist...

@lcfr123
Copy link
Contributor

lcfr123 commented Jan 2, 2017

Confirm.

iOS 10.1.1 with iTunes 12.5.3.17 works as expected.
iOS 10.2 with iTunes 12.5.4.42 has the problem you describe.

@conrado
Copy link

conrado commented Jan 12, 2017

iOS 10.2 with iTunes 12.5.4.42 also has a problem here, 866f834

@akemin-dayo
Copy link

akemin-dayo commented Jan 20, 2017

iOS 10.2 with iTunes 12.5.3.16 (passwordless backup) also experiences the same problem — seems like the issue here is possibly not the iTunes version, but rather iOS 10.2.

@bkerler
Copy link

bkerler commented Feb 7, 2017

Here are details and fixes for this issue : horrorho/InflatableDonkey#41
Seems keybag structure and pbkdf scheme has changed.

@tnull
Copy link

tnull commented May 3, 2017

Hello,
I'm still experiencing the same issue as the OP. Is it still worked on? Or should it already be fixed, as f408bf9 was done after this conversation?

@akemin-dayo
Copy link

akemin-dayo commented Jul 7, 2017

Can confirm pull request #18 works fine for me, I successfully decrypted an encrypted iOS 10.2 backup with it.

@tnull
Copy link

tnull commented Jul 8, 2017

I can also confirm this! Worked like a charm! Thanks!

dinosec added a commit that referenced this issue Jul 11, 2017
Add decryption for iOS 10.2 Manifest.DB (fixes #14)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants