yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] WoKoschekk:
All I know so far is that the structure of the key changed with v2.12.38 while the size of 158 byte didn't:

return ("\nMode: WhatsApp Crypt Key Generation"+
"\n\nAccount Seed: "+seed+
"\nDevice IMEI: "+imei+
"\nPassword: See \"/data/data/com.whatsapp/files/rc\" or \"/sdcard/WhatsApp/Profile Pictures/.nomedia\" (0-26 of key)"+
"\nPadding: Multiple variations \"0x0,0x0,0x1 / 0x0,0x1,0x1 / 0x0,0x1,0x2 / Etc\" (27-30 of key or 0-3 of enc db)"+
"\nRandom Key: "+randomKey+" (31-62 of key or 4-35 of enc db)"+
"\nRandom IV: "+randomIV+" (unused since WhatsApp v2.12.38) (63-78 of key or 36-51 of enc db)"+
"\nPaired Key: "+pairedKey+" (79-110 of key / internal marriage)"+
"\nStatic IV: "+staticIV+" (key zeroed WhatsApp >= 2.12.38) (111-126 of key or 52-67 of enc db)"+
"\nStatic Key: "+staticKey+" (127-158 of key) **DECRYPTION KEY**"+
"\n\nAuthor: TripCode\n");
}

source: https://github.com/EliteAndroidApps/WhatsApp-Key-Generator/blob/master/WhatsAppKeyGenerator.java

But I don't know if it's related to your issue.

However, maybe I found the reason for your initial error message in post #712:

Please connect your Android device with USB Debugging enabled:

* daemon not running. starting it now on port 5037 *
* daemon started successfully *

WhatsApp 2.6.9458 installed

Found legacy WhatsApp 2.11.431 in local folder

Backing up WhatsApp 2.6.9458
5185 KB/s (4787631 bytes in 0.901s)
Backup complete

Installing legacy WhatsApp 2.11.431
5284 KB/s (18329558 bytes in 3.386s)
pkg: /data/local/tmp/LegacyWhatsApp.apk
Success
rm failed for -f, No such file or directory
Install complete

It failed because you need the APKs (legacy and the backup of the current installed one) in /data/local/tmp and that's the reason why:

What is, "performing streamed install"

I am running a build through adb command, adb install myapp.apk In the console, I get the message, Performing streamed install What does this mean.

stackoverflow.com

Since you are using a very old device with very old binaries some commands do unexpected things. No matter what the script does.

Open the folder with the tool on your PC and paste the APK of the legacy v2.11.431 into it and also your current installed one. If you can't get your installed APK here is a download for v2.7.5813. That's the closest to v2.6 I've found.

Rename the legacy one => "LegacyWhatsApp.apk"

and

v2.6 (or v2.7) => "com.whatsapp-2.apk".

Then open a terminal window (right click somewhere in the folder => context menu => "Terminal" - or - type "cmd" in the upper address bar of the explorer window and hit "Enter"). Execute this command:

bin\adb.exe push LegacyWhatsApp.apk /data/local/tmp
bin\adb.exe push com.whatsapp-2.apk /data/local/tmp

After that run the script to start the tool.

Alternatively you could also try the following instead of the mentioned above:

bin\adb.exe backup -f tmp\whatsapp.ab -noapk com.whatsapp

Honestly, I'm just wondering why you need the tool to create a backup when already having a version installed with ADB backup enabled...
[Android Apps and Games] borisvp:
Well, many, many thanks for your efforts.

For most of the time I have just a vague idea what I'm doing following your suggestions, hoping that at some point I will be able to see that chat again and be able to save it in a readable form.

I try to summarize what I did so far:

- Tried WHATSAPP_XTRACT on the old device; didn't extract anything

- Tried WhatsApp-Key-DB-Extractor on the old device; same result

- Tried the same tool on the current device, which extracted some key that doesn't work

- Installed Bluestacks and WhatsApp and access that chat but don't know where to put the chat file to open it, if that's at all possible

All I want is to get that chat from the old device, which is emotionally very important to me. I mean, it's MY chat on MY phone with MY number which has never changed. But I start thinking that the whole WhatsApp thing is too ****ed up to permit this because no programmer in this Meta moloch has an idea what they are really doing. Or care for it, for that matter.

So, when I manage to reinstall WA 2.6 (or 2.7) on the old device, what would it do? I had that before, and got nothing. It's not about getting an old version of WA back on the old device, it's about reading that crypt8 file where my chat is in. But I never was able to get the old key I obviously need to decrypt this file out of that device.
[Android Apps and Games] WoKoschekk:
did u try this?

open the folder of the tool and open a command window like described above in my post.
[Android Apps and Games] borisvp:
I tried both.

First, I have no /data/local/tmp folder. What I have is

WhatsApp-Key-DB-Extractor-4.7 (the tool folder)
- bin
- extracted
- tmp

So I put both APK into the tmp folder and ran this cmd in the tool folder:

bin\adb.exe push LegacyWhatsApp.apk /tmp

I got this:

cannot stat 'LegacyWhatsApp.apk': No such file or directory

All I can say is that the APK is in that folder.

Then I tried the backup cmd and got a file whatsapp.ab with 33kB in the tmp folder.

Then I installed WA 2.7.5813 from the APK directly on the device. That worked.

I ran the script again and got the same error as before:

Installing legacy WhatsApp 2.11.431
3702 KB/s (18329558 bytes in 4.834s)
pkg: /data/local/tmp/LegacyWhatsApp.apk
Success
rm failed for -f, No such file or directory
Install complete

Now unlock your device and confirm the backup operation.
[Android Apps and Games] WoKoschekk:
on YOUR device and NOT the folder
[Android Apps and Games] WoKoschekk:
Please open the folder and

open a command window in the folder

! In the command window you must then see the path of that folder left of the cursor. That's important! You see in the previous post above how to do open it.

Then run the cmd from my previos post to create a backup manually!!
[Android Apps and Games] WoKoschekk:
this tool here in this thread has only one purpose: to downgrade WhatsApp and enable the function ADB backup. This function has been deleted for all versions higher than v2.11.431.

BUT YOUR VERSION ISN'T HIGHER AND THEREFORE YOU CAN DO A BACKUP WITHOUT USING THAT TOOL!!
[Android Apps and Games] alecxs:
usage problem. think about what you typed on cmd line, don't follow blind and type commands you don't understand.

Spoiler content hidden.
[Android Apps and Games] WoKoschekk:
@All here!! Please let him execute the backup command and nothing else!!!!
[Android Apps and Games] borisvp:
How should I know when that is said nowhere? I am by far no no expert in Android, and all I can do IS try and follow suggestions.

Before I again follow blind:

Which folder exactly?

I already said I got a file named whatsapp.ab. Is this a backup? If so, of what and what can I do with it?

Where would I find that folder? I don't see it on the device.
[Android Apps and Games] WoKoschekk:
wait a few minutes, I'm going to make a zip with a script for you
[Android Apps and Games] WoKoschekk:
So...,

1. Remove every ZIP you have downloaded before from your PC!

2. Then download the here attached one.

3. Unpack the ZIP.

4. Open the extracted folder.

5. Connect your device with ADB enabled to your PC and keep it next to you.

6. Doubleclick the BAT file.

This BAT file is reduced to the minimum. It contains a new version of abe.jar since you have installed a current version of Java. It also contains an old version of ADB since you have an old phone.

I tried it myself with success. I manually installed WhatsApp v2.7 and executed the BAT file with new Java and new ADB. Good luck!!
[Android Apps and Games] borisvp:
This is what happens:

WARNING: adb backup is deprecated and may be removed in a future release
adb server version (32) doesn't match this client (41); killing...
* daemon started successfully
Now unlock your device and confirm the backup operation...
41%
1024 bytes written to tmp\whatsapp.tar.
bin\tar.exe: Record size = 2 blocks
bin\tar.exe: apps/com.whatsapp/f/key: Not found in archive
bin\tar.exe: Error exit delayed from previous errors
bin\tar.exe: Record size = 2 blocks
bin\tar.exe: apps/com.whatsapp/db/msgstore.db: Not found in archive
bin\tar.exe: Error exit delayed from previous errors
bin\tar.exe: Record size = 2 blocks
bin\tar.exe: apps/com.whatsapp/db/wa.db: Not found in archive
bin\tar.exe: Error exit delayed from previous errors
bin\tar.exe: Record size = 2 blocks
bin\tar.exe: apps/com.whatsapp/db/axolotl.db: Not found in archive
bin\tar.exe: Error exit delayed from previous errors
bin\tar.exe: Record size = 2 blocks
bin\tar.exe: apps/com.whatsapp/db/chatsettings.db: Not found in archive
bin\tar.exe: Error exit delayed from previous errors

Cleaning up temporary files ...

Datei wurde gelöscht - C:\Users\boris\Downloads\WhatsApp-Key-DB-Extractor-master\tmp\whatsapp.ab
Datei wurde gelöscht - C:\Users\boris\Downloads\WhatsApp-Key-DB-Extractor-master\tmp\whatsapp.tar

Done

The folder structure on my device is different from what is in the script.

It is (main storage)

-Android

--data

---com.whatsapp

----cache

----debug

----testdata

and

-WhatsApp

--.Shared

--.trash

--Databases

--Media

--Pictures
[Android Apps and Games] WoKoschekk:
no, you need another adb.exe binary. wait
[Android Apps and Games] WoKoschekk:
replace the ~\bin with the attached one. erase your entire folder and copy & paste this one here
[Android Apps and Games] borisvp:
Different now, but...

* daemon not running. starting it now on port 5037 *
* daemon started successfully *
1% 3% 4% 6% 7% 8% 10% 11% 13% 14% 16% 17% 18% 20% 21% 23% 24% 25% 27% 28% 30% 31% 33% 34% 35% 37% 38% 40% 41% 42% 44% 45% 47% 48% 49% 51% 52% 54% 55% 57% 58% 59% 61% 62% 64% 65% 66% 68% 69% 71% 72% 74% 75% 76% 78% 79% 81% 82% 83% 85% 86% 88% 89% 90% 92% 93% 95% 96% 98% 99% 100%
166400 bytes written to tmp\whatsapp.tar.
bin\tar.exe: apps/com.whatsapp/f/key: Not found in archive
bin\tar.exe: Error exit delayed from previous errors
bin\tar.exe: apps/com.whatsapp/db/msgstore.db: Not found in archive
bin\tar.exe: Error exit delayed from previous errors
bin\tar.exe: apps/com.whatsapp/db/wa.db: Not found in archive
bin\tar.exe: Error exit delayed from previous errors
bin\tar.exe: apps/com.whatsapp/db/axolotl.db: Not found in archive
bin\tar.exe: Error exit delayed from previous errors
bin\tar.exe: apps/com.whatsapp/db/chatsettings.db: Not found in archive
bin\tar.exe: Error exit delayed from previous errors

Cleaning up temporary files ...

Datei wurde gelöscht - C:\Users\boris\Downloads\WhatsApp-Key-DB-Extractor-master\tmp\whatsapp.ab
Datei wurde gelöscht - C:\Users\boris\Downloads\WhatsApp-Key-DB-Extractor-master\tmp\whatsapp.tar

Done
[Android Apps and Games] WoKoschekk:
it seems that ADB created a backup but there are problems with the tar archive.

here's a script for a backup only. just replace it. when finished there should be a \tmp\whatsapp.ab file
[Android Apps and Games] borisvp:
There is one, with 36kB. What next?
[Android Apps and Games] WoKoschekk:
put this in the folder and doubleclick
[Android Apps and Games] borisvp:
Okay, I got a folder com.whatsapp with some subfolders and files in it. Can I already open my chat with it or are there additional steps?
[Android Apps and Games] WoKoschekk:
/com.whatsapp/d(atabase)/msgstore.db

this is your chat database and can be opened with the windows tool I gave you here.
[Android Apps and Games] borisvp:
I'm sorry, but there is no such file.

From the last steps, I got these folders (in the tmp folder of the Extractor tool on my PC):

-apps

--com.whatsapp

---f

----.trash

----Logs

---sp

plus a couple of smaller files in these folders.

On the old device, there is a msgstore.db.crypt8 file, which is in \WhatsApp\Databases on the device's main drive. This file has about 17MB. To open this, the Viewer needs a key.
[Android Apps and Games] WoKoschekk:
Yes, I know...

Whatsapp app data:

/data/data/com.whatsapp => only accessible as root

Whatsapp internal backup:

/internal_storage/Whatsapp

The backup file msgstore.db.cryptXX is an encrypted version of $Whatsapp app data/databases/msgstore.db . The key file $Whatsapp app data/files/key is needed to decrypt it.

BUT: The key file + msgstore.db will be extracted from whatsapp.ab (ADB backup created by the tool). Both should be somewhere in your folder \tmp\*.
[Android Apps and Games] WoKoschekk:
This is the directory tree of a current WhatsApp version in /data/data:

./com.whatsapp
├── app_minidumps
├── cache
├── code_cache
├── databases
│ ├── _jobqueue-WhatsAppJobManager
│ ├── axolotl.db
│ ├── chatsettings.db
│ ├── commerce.db
│ ├── companion_devices.db
│ ├── daily_metrics.db
│ ├── emojidictionary.db
│ ├── hsmpacks.db
│ ├── location.db
│ ├── media.db
│ ├── msgstore.db
│ ├── payments.db
│ ├── stickers.db
│ ├── sync.db
│ └── wa.db
├── files
│ ├── Avatars
│ ├── Gifs
│ ├── Logs
│ ├── MessageService.pid
│ ├── NetworkResource
│ ├── ShortcutInfoCompatSaver_share_targets
│ ├── Stickers
│ ├── ViewOnce
│ ├── WhatsApp Images
│ ├── WhatsApp Video
│ ├── app_state
│ ├── backup_token
│ ├── biz_directory
│ ├── cldr_strings_1687761747.pack
│ ├── decompressed
│ ├── device_id
│ ├── downloadable
│ ├── emoji
│ ├── invalid_numbers
│ ├── key
│ ├── me
│ ├── network_statistics.json
│ ├── statistics.json
│ ├── wam.wam
│ ├── wamdit3.wam
│ ├── wamprivatestats.wam
│ └── wamrealtime.wam
├── lib-main
├── no_backup
└── shared_prefs

32 directories, 112 files

Just for you to know the difference between app data/backup internal storage.
[Android Apps and Games] WoKoschekk:
As I can see in your cmd output your device (or Android version) doesn't prompt you to allow the ADB backup. That should be ok since this confirmation was introduced with Android 4.0.0 and that was 3 month before Android 4.0.3 was released. So, no worries.

But I'm not sure if your app data directory is restricted on Android 4.0.3 and therefore just try to open the folder com.whatsapp with ADB and pull out the msgstore.db file.

1. open a cmd window in \bin of the tool folder by right click somewhere in the folder window.

2. type 'adb shell ls -al /data/data/com.whatsapp'

post the output here
[Android Apps and Games] borisvp:
opendir failed, Permission denied
[Android Apps and Games] WoKoschekk:
Let me some research about that stuff. I'm still optimistic that we'll get these messages back. ;-)
[Android Apps and Games] WoKoschekk:
Is there somewhere in the folders a file called 'key'? It's only 158 Byte of size (or maybe +/- some Byte)
[Android Apps and Games] borisvp:
Great, thanks again :)

No file called "key" or other files of that size.

I'm away until next week, so don't rush .
[Android Apps and Games] alecxs:
there is simply no app data, it's already gone. probably during the uninstall.
[Android Apps and Games] WoKoschekk:
that might be... but the key from a newer version isn't completely different to the old one. WhatsApp changed sth in v2.11.xxx and I'm trying to find out what it is. I know the structure of a key file. found it in a github repo of tripcode. So far I know that one part of the new key is zeroed but it can be found in the encrypted database file.

it's very interesting stuff but unfortunately not well documented.
[Android Apps and Games] fillobotto:
WhatsApp keys are generated depending on what? Just the device id or even the account you are logged in with?
[Android Apps and Games] Sephi:
Hey,

the program isn't working for me, I get "file not found". Any idea?
[Android Apps and Games] Sephi:
Here is a screenshot how it looks:

http://imgur.com/AjpIxwx
[Android Apps and Games] darshan_shah:
Facing the same errors.

:crying:

appreciate quick help.
[Android Apps and Games] Abinash Bishoyi:
Make sure you're using the WhatsApp Key/DB Extractor v2.2 from my git repo... if any issue PM me... abiansh.bishoyi@gmail.com

---------- Post added at 09:22 PM ---------- Previous post was at 09:12 PM ----------

Try WhatsApp Key/DB Extractor v2.2 from my git repo
[Android Apps and Games] TripCode:
The keys are generated by WhatsApp's web server. A random hash is first created by the device and there is a comparison hash that is linked to your gmail. You can find these in the first 168 bytes of a crypt7 backup file. These are used by WhatsApp to create the decryption hash. They basically seed the info sent to them to do this. As we do not know their seeding process, there is no way to generate a compatible key without their server.

Are you rooted?
[Android Apps and Games] Uzair40:
Hi, I have a Xperia Z with android 4.2.2 unrooted. I had whatsapp registered with the number of another country. Yesterday a message appeared telling me that one number cannot be used on 2 devices. I have Windows 8 with the drivers installed, and I have done the steps mentioned in the tutorial, but when I connect my Xperia after opening "WhatsAppKeyExtract.bat" nothing happens. USB Debugging is enabled.
[Android Apps and Games] bskumar:
Please help. . Protocol fault (read status) error is displayed

I am unable to extract key using WhatsApp Key/DB Extractor v2.2.1 from non rooted xperia z1 device.

Below error message is displayed.

error: Protocol fault (read status)

adb: unable to connect for backup

Attached screenshot for your reference. Please help me.
[Android Apps and Games] guspsiu:
After I've uninstalled bluestacks, the backup button appeard on my phone, but the error on the program is the same. I get this dropbox.com/s/0e6k52n27wjoqen/Captura%20de%20tela%202014-11-01%2018.26.03.png?dl=0 (new user, so, no direct link). Is the same of the above
[Android Apps and Games] Doallyn:
Getting an "doesn't know how to process Version 2" error?

Any ideas on whether this is due to a recent release of android and if there will be an update?
[Android Apps and Games] zuberbaluch:
hi, i have completed all the instructions given by you... But as soon as i connect m

Hi Buddies,

i have completed all the instructions given by you... But as soon as i connect my samsung note 3 a message pops up like .unable to connect

press any key to continue..

you have also mentioned that you need to verify the finger print if you are using USB DEBUGGING for the 1st time

please let me know how to verify finger print.

Regards

Zuber
[Android Apps and Games] cfrank38:
Hy are you working on crypt8 ? I didnt test that new format i found crypt8 in the newest whatsapp :( I hope we dont get problems
[Android Apps and Games] CHEF-KOCH:
This will not working anymore if WhatsApp really already use encryption (same as on TextSecure). Sad and good news, but we better wait for an audit.

https://whispersystems.org/blog/whatsapp/
[Android Apps and Games] sercankd:
i think its not about message backups, its live streaming encryption to prevent man in the middle attacks. even so if its impossible to read those backups how whatsapp going to restore them back :D
[Android Apps and Games] CHEF-KOCH:
The source is open, it's same as TextSecure which also can't restore them, Wa use for each messages new keys which are stored on the server same as the public key. I think the server checks for you id/key and msg id. In whatsapp+ there is an backup button and the folders with the db, WhisperSystem said there are coming more changes, maybe we get an option or more details how this exactly works, bur until there is no whitepaper or audit I don't belive anything here. It's facebook, do not believe the hype. ;)
[Android Apps and Games] Abinash Bishoyi:
Yes, you're right that it won't impact the db store file as the Textsecure is more about the realtime transmission. But WhatsApp has also upgraded the db version to Crypt8 which is currently Tri-Crypt is not capable to understand, that's why the script failed for the new version of WhatsApp. Let's wait to get the next update to Tri-Crypt which can handle Crypt8.
[Android Apps and Games] zyoks:
Full backup step

i have installed all the requirement ( java, adb and the zip file ) , launched the bat file as administrator, connected my phone whose usb debugging enabled and it still freezes on " daemon started successfully", the "full backup" doesn't appear.

any help please ?
[Android Apps and Games] rakeamg:
Same issue as above - won't go past * deamon started successfully *

I am having the same issue as above. I have Java installed, USB debugging is checked, phone is connected to PC. But the extractor gets stuck at * deamon started successfully * :(:(:(

Please help. :confused:
[Android Apps and Games] m.a.r.k.i.94:
2nd time getting error

i dont know y but the 2nd time i get error and the file doesnt get extracted.using android 5 on nexus 5. any tips where i went wrong ? :(
[Android Apps and Games] VijayKakad:
getting error..please help.

I am getting error while extracting key. Attached plz find the screen cap of error.
[Android Apps and Games] nishuodeduiyayayaya:
Hello,everyone.

I'm really honored to have discovered this forum and this post. This is great for me.

In fact, I am a novice in security and have never been exposed to this before.

Since I didn't backup my WhatsApp messages and accidentally cleared the conversation, I downloaded and installed a new version of WhatsApp. In this case, can I still retrieve the chat history?

This is very important to me, I would appreciate any reply.
[Android Apps and Games] WoKoschekk:
no, you need a backup.
[Android Apps and Games] nishuodeduiyayayaya:
you mean I can't get back it anymore?
[Android Apps and Games] WoKoschekk:
yes, that's what I said. how you wanna restore sth without any data?
[Android Apps and Games] nishuodeduiyayayaya:
so sad.

is there reslly no way?

I'm willing to pay for it if someone can restore it for me
[Android Apps and Games] WoKoschekk:
It's impossible to restore anything that was deleted from internal storage without having already root access. Installing root will delete the entire internal storage and since it's encrypted you are not able to restore any data after that.

Restoring from Google Drive is also not possible.
[Android Apps and Games] nishuodeduiyayayaya:
yes,that's why I'm so grateful for this post. Because it contains how to restore data without root
[Android Apps and Games] WoKoschekk:
no, the purpose of this thread is getting your backup encryption key and some other data without root. these app data files are not accessible under normal conditions like any other app data. this thread should help you to decrypt backup files. but you haven't got any backups.
[Android Apps and Games] nishuodeduiyayayaya:
well,if you have any other better way to recommend?
[Android Apps and Games] mayowa_olu:
This worked for me but I just installed the old WhatsApp apk before running the script.

Use this link to get it

WhatsApp APK (2.11.431) Download

androidapksfree.com
[Android Apps and Games] borisvp:
So, I'm back. Shall we try some more?
[Android Apps and Games] _tnt_:
Hello,

maybe it is not the right thread, but I'm wondering if it is possible to use the WhatsApp Key extractor also to get the key for the "WhatsApp for Windows" database file.

As I don't have the phone any longer, but I'm still logged in at my Windows PC, I'm locking for a possibility to get the key file and decrypt the local database.

Any ideas?
[Android Apps and Games] BlacklightMG:
I'm a bit lazy, but it should be somewhere in AppData. I don't have it installed rn, so I can't check it. See if you can make a local backup from the desktop app, if so the key should be stored somewhere similar.

Edit:

Locations of WhatsApp data, as I found from Reddit (there could be some files elsewhere too):

Non store version: C:\Users\<your user>\AppData\Local\Whatsapp (or similar)

The Microsoft Store version: C:\Program Files\WindowsApps\5319275A.WhatsAppDesktop_<version>_x64__<some letters>

Also note that if you choose to use encrypted backups (crypt15), Whatsapp will delete your previous key and also your local databases (crypt14) on your PC, making you unable to access any previous backups which used the old key.
[Android Apps and Games] WoKoschekk:
how? this tool is for Android and not for Windows. apart from that there's no key file on your Windows desktop. the Windows app is connected to your mobile device running the Whatsapp Android app. Or did you verify your account with your mobile no. when running Whatsapp on Windows?