WhatsApp has become one of the most popular messaging apps with over 2 billion users worldwide. It offers end-to-end encryption for messages between users for enhanced privacy and security. However, WhatsApp also provides the option to backup chats to Google Drive which are not end-to-end encrypted.
While this backup feature is useful to restore chats when switching devices or reinstalling WhatsApp, it also means that the chat history is stored unencrypted on Google’s servers. For users who want to access their chat backups on Google Drive in a readable format or export them for other purposes, the database files need to be decrypted.
In this detailed guide, we will walk through the steps to decrypt WhatsApp database backup files stored on Google Drive using free tools for both Windows and Mac operating systems.
Overview of WhatsApp Backup on Google Drive
Here is a quick overview of how WhatsApp chat backups work with Google Drive integration:
- WhatsApp provides the option to automatically backup chats daily, weekly or monthly to Google Drive.
- The backups include chat history, media files sent/received on WhatsApp and other app data.
- Backups are stored on Google Drive with each backup as an encrypted database file.
- The encryption keys to decrypt the backup files are stored locally on the user’s device and not on Google Drive.
- Restoring these backups when reinstalling WhatsApp or switching devices requires the encryption key from the old device.
- Without the proper encryption key, the Google Drive backups cannot be decrypted and remain unreadable.
So in order to decrypt and access the WhatsApp backup files from Google Drive, we need the appropriate encryption key which is only stored on the user’s device by default. The steps below will guide you through the process of extracting this key and using it to convert the encrypted backups into readable databases.
Requirements for Decrypting WhatsApp Backups from Google Drive
Here are the requirements for decrypting WhatsApp backup files from Google Drive:
- Root access on Android device or jailbroken iOS device used for WhatsApp
- Backup files from WhatsApp saved on Google Drive
- Encryption key for WhatsApp backups extracted from device using backup tools
- Desktop application to decrypt WhatsApp backups – we will use open-source WhatsApp-Decrypt tool (available for Windows and Mac)
The WhatsApp chat database uses SQLite database file format which can be opened and explored using various SQLite editors and tools once decrypted.
Having the encryption key and encrypted WhatsApp backup files is sufficient to decrypt the backups as long as you use the right decryption tool. We will extract the key using Android backup tools in the steps below.
Extracting WhatsApp Backup Key from Android
To decrypt WhatsApp chat backups from Google Drive, we first need to retrieve the encryption key used to encrypt the backups. This key is stored in the user preferences of WhatsApp app data on Android devices. Here are the steps to extract it:
- Root your Android phone – this gives access to the system files we need.
- Install a backup tool like ADB Backup Extractor on your computer.
- Connect phone to computer and enable USB debugging.
- Use the backup tool to create a full backup of your device.
- The tool will backup WhatsApp data including preferences where the encryption key is stored.
- Extract the WhatsApp folder from the backup to access the key as com.whatsapp_preferences.xml.
- Open the xml file in a text editor and look for the
tag – the encrypted key is under base64 encoded string - Copy this long encrypted string which is the encrypted backup key.
This encrypted key string extracted from the Android device is what we need to decrypt WhatsApp backups from Google Drive. The key acts as the password to decrypt the backups.
Getting WhatsApp Backups from Google Drive
Now that we have acquired the encryption key for our WhatsApp backups, we need to download the actual backup files from Google Drive to our computer:
- Open Google Drive and navigate to the WhatsApp chat backups folder.
- The backup files will have a .crypt extension such as msgstore-YYYY-MM-DD.1.db.crypt
- Select the latest backup files you want to decrypt and download them to your computer.
- Store these .crypt files in a separate folder on your computer for the decryption process.
Once you have both the encryption key and the encrypted backup files ready, we can move on to the decryption phase.
Decrypting WhatsApp Backup Files
To convert the encrypted WhatsApp backup files into readable databases, we will use open-source tool WhatsApp-Decrypt. It is available for both Windows and Mac operating systems.
Here are the steps to use WhatsApp-Decrypt to process your encrypted backups:
- Download and install WhatsApp-Decrypt on your computer:
- Windows: Download here
- Mac: Download here
- Run WhatsApp-Decrypt tool on your computer.
- Click on Add file and select the .crypt files you downloaded from Google Drive.
- In the top right, click on the Key icon to enter the encryption key extracted earlier.
- Paste the long encrypted key string extracted from the Android device.
- Click on Decrypt files – this will convert all selected .crypt backups into decrypted .db files.
- The decrypted database files will be saved in the same folder as the original .crypt files.
And that’s it! WhatsApp-Decrypt will decrypt all your encrypted WhatsApp backup files from Google Drive using the encryption key. You now have access to readable SQLite database files containing your chat history.
Accessing WhatsApp Backup Data
The decrypted WhatsApp backup files are in the standard SQLite database format. This allows you to access, view and export chat data in a readable format using SQLite tools.
Here are some ways to view and access the decrypted WhatsApp backup data:
- Use a SQLite browser like DB Browser for SQLite to open the .db files and browse the tables and data.
- Import the SQLite database into a tool like MySQL Workbench for structured querying.
- Use SQLite commands via terminal/command prompt to export tables as CSV files.
- Write scripts in Python/Node.js to query the databases and output chat history in a readable format.
- Convert entire SQLite database into JSON format using online converters.
The WhatsApp backup databases contain several tables storing your messages, media files, contacts and other data from WhatsApp. Here are some of the key tables and their purpose:
Table Name | Description |
---|---|
chat_list | Metadata about chats like name, last activity timestamp etc. |
messages | Stores actual message data including sender, timestamp, text etc. |
media_v2 | Metadata about media files like images, videos, audio sent on WhatsApp. |
contact | Contact information for your WhatsApp connections. |
group_participants | List of participants for each WhatsApp group. |
With the decrypted chats backed up in SQLite format, you can easily query and access your historical WhatsApp data for export or analysis purposes.
Important Security Notes
While having access to decrypted WhatsApp backups can be useful in some cases, it also poses security and privacy risks if the data falls into the wrong hands. Here are some important security notes to keep in mind:
- The encryption key extracted from your device can decrypt all historical WhatsApp backups, not just the latest one.
- Store the encryption key securely and avoid sharing it with others you do not trust.
- Delete the decrypted backup files after you have used them and no longer require access.
- Avoid uploading the decrypted backups to cloud storage in unencrypted form.
- Use security tools like VeraCrypt to store decrypted backups encrypted on your computer if required.
- Encrypt the encryption key and backups with a strong password for additional security.
WhatsApp does not recommend decrypting backups as it compromises privacy. Only use this decryption method for legitimate purposes and not to violate others’ privacy.
Conclusion
Decrypting your WhatsApp chat history backups from Google Drive is possible by extracting the encryption key from your Android or iOS device and using tools like WhatsApp-Decrypt to process the encrypted backups.
This allows access to your chat data in readable SQLite database format which can then be queried and analyzed as needed. However, proper security measures must be undertaken to store the encryption key securely and limit access to the decrypted backups.
The decryption process requires technical knowledge but gives full access to your historical WhatsApp data from Google Drive backups. Use this responsibility and only for legitimate purposes. And remember – when in doubt, the best option is leaving your WhatsApp backups encrypted for your own privacy.