├── README.md ├── WhatsApp-Key-DB-Extractor.zip └── whatsapp-key-extractor /README.md: -------------------------------------------------------------------------------- 1 | # WhatsApp Key DB Extractor 2 | 3 | The purpose of this script is to provide a method for WhatsApp users to extract their cipher key on NON-ROOTED 4 | Android devices. The cipher key is required to decrypt WhatsApp CRYPT6 and CRYPT7 backup files. This script 5 | works by hooking into the USB backup feature on Android 4.0 or higher. It will NOT work with earlier Android 6 | versions or on devices where this feature has been deliberately disabled by the manufacturer. The cipher key 7 | can be used with WhatCrypt (www.whatcrypt.com), both on the website (online decryption / exportation) and with 8 | the Android App (offline decryption / recryption). Other apps and websites may also support WhatsApp cipher keys. 9 | It should be noted that WhatsApp cipher keys can roll (update) periodically. If this happens then you will need 10 | to repeat the instructions contained within this file in order to extract the latest cipher key. This script will 11 | also extract the latest UNENCRYPTED WhatsApp Message Database (`msgstore.db`) and Contacts Database (`wa.db`). 12 | 13 | In addition to the above. A copy of the cipher key will also be pushed to the WhatsApp Database directory on the 14 | device itself and contained within a file called `.nomedia`. The reason for this is to allow Android Developers 15 | a unified method in which they can offer their app users WhatsApp Decryption for those willing to run this script. 16 | 17 | 18 | # Prerequisites 19 | 20 | 1. O/S: Windows Vista, Windows 7 or Windows 8, or Linux 21 | 2. Java (will start installation procedure if not already present on your system) 22 | 3. ADB (Android Debug Bridge) Drivers - If not installed: http://forum.xda-developers.com/showthread.php?t=2588979 23 | 4. USB Debugging must be enabled on the target device. Settings -> Developer Options -> (Debugging) USB debugging 24 | If you cannot find Developer Options then please go to: Settings -> About phone/device and tap the Build number 25 | multiple times until you're finally declared a developer. 26 | 27 | # Windows Instructions 28 | 29 | 1. Extract `WhatsApp-Key-DB-Extractor.zip` on your computer maintaining the directory structure. 30 | 2. Browse to the extracted folder and click on `WhatsAppKeyExtract.bat`. 31 | 3. Connect your device via USB, unlock your screen and wait for "Full backup" to appear. (If you have never used USB Debugging before, you may also need to verify the fingerprint.) 32 | 4. Leave the password field blank and tap on "Back up my data". 33 | 5. The "extracted" folder will now contain your "whatsapp.key", "msgstore.db" and "wa.db". 34 | 35 | # Linux Instructions 36 | 37 | 1. Download the script `./whatspp-key-extractor` 38 | 2. Connect your device via USB, unlock your screen and ensure that the device is connected by running "adb devices". (If you have never used USB Debugging before, you may also need to verify the fingerprint.) 39 | 3. Run ./whatsapp-key-extractor and wait for "Full backup" to appear. 40 | 4. Leave the password field blank and tap on "Back up my data". 41 | 5. The key will be copied back onto your machine in such a way that WhatsApp TriCrypt will work 42 | 43 | # Authors 44 | 45 | * Author: Abinash Bishoyi 46 | * Intial Work: TripCode 47 | * THANKS: Nikolay Elenkov for ade.jar and Snoop05 for ADB Installer. 48 | -------------------------------------------------------------------------------- /WhatsApp-Key-DB-Extractor.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidfraser/WhatsApp-Key-DB-Extractor/8717c6c0cdef6a21a26938f4bdf455ad5eec89e7/WhatsApp-Key-DB-Extractor.zip -------------------------------------------------------------------------------- /whatsapp-key-extractor: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | d="`mktemp -d`" 3 | ( 4 | cd "$d" 5 | [ -f whatsapp.ab ] || adb backup -f whatsapp.ab -noapk com.whatsapp 6 | dd if=whatsapp.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.write(zlib.decompress(sys.stdin.read()))" | tar x 7 | adb push apps/com.whatsapp/f/key /sdcard/WhatsApp/Databases/.nomedia 8 | ) 9 | rm -r "$d" 10 | --------------------------------------------------------------------------------