Exporting and decrypting your Whatsapp message SQLite store (Android)

Ryan MarvinRyan Marvin
1 min read
  1. Create an E2E encrypted backup on Whatsapp Settings on your phone. It will prompt you to setup E2E encryption either with a custom password or an autogenerated 64 bit string. Choose the 64 bit option and save this string!

  2. Create a Python virtualenv and install wa-crypt-tools

     pip install wa-crypt-tools
    
  3. Create the key file

     wacreatekey --hex <your-hex-value>
     # creates a file called encrypted_backup.key
    
  4. Connect your phone and pull the encrypted DB file

     adb pull /sdcard/Android/media/com.whatsapp/WhatsApp/Databases/msgstore.db.crypt15
     # will copy this file to your cwd
    
  5. Decrypt the DB file using your key

     wadecrypt encrypted_backup.key msgstore.db.crypt15 msgstore.db
     # key15.py:54     : [I] Crypt15 / Raw key loaded
     # wadecrypt.py:271     : [I] Done
    
0
Subscribe to my newsletter

Read articles from Ryan Marvin directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Ryan Marvin
Ryan Marvin