yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] gheedalzubaidi:
Help :(

So I was wondering if there was a way to edit a chat history then transfer it to a new android and it gets backed up like a real chat happened?

Please tell me this is possible?

Thank you.

I was blackmailed and just want to prove to others that chats can be faked.
[Android Apps and Games] Madhumohandas:
hi guys after all done when i drag and drop the crypt file i get the following message i was searching allover thread kindly please some one guide

whats wrong
[Android Apps and Games] no.human.being:
Same here.

I think it doesn't support the new WhatsApp versions. These use files callled "*.db.crypt7" (instead of just "*.db.crypt"). These seem to make use of a new encryption scheme that this application doesn't appear to support.

However, even by grabbing the unencrypted "msgstore.db" and "wa.db" files from "/data/data/com.whatsapp/databases" (you need root access for this!), you won't get this tool to process them. Seems the database tables have new internal structure as well so the database queries that the Python script performs fail on them.

Any updates to be expected? I love this tool for WhatsApp backup.

EDIT: As a quick solution, in case you only want to view your WhatsApp history from the "msgstore.db.crypt7" you obtained from your device, you can use the tool WhatsApp viewer. It's a Windows-only application. It can decrypt the "*.db.crypt7" file with a key obtained from "/data/data/com.whatsapp/files/key" (you need root access for this!) and display conversations, as well as image-thumbnails. The export format is very basic plain-text only though (not the sophisticated HTML export that WhatsApp Xtract provided), so you really only wanna use in-application viewing.

EDIT2: To the creator of this software. In case you want to decrypt the new "*.db.crypt7" encryption scheme. It uses the AES/Rijndael block cipher in CBC (cipher-block chaining) mode with 128 bit block size and 256 bit key size. The key file is stored under "/data/data/com.whatsapp/files/key" (need root access for this!). In this file, the last 32 bytes (256 bits) are the AES encryption key, while the 16 bytes (128 bits) before that are the CBC initialization vector. The "*.db.crypt7" files have a 67 byte header (that I have no idea what data is stored here, but it seems you can just ignore it). After this, encrypted data starts. So you skip 67 bytes into the file "*.db.crypt7", then start using AES decryption in CBC mode with the key and initialization vector you extracted from the key file. After you did this, you obtain an unencrypted SQLite database file (like "msgstore.db" from "/data/data/com.whatsapp/databases"). This now has a different table structure than what you used in your software, so even after decryption, I cannot use your tool on this database. However, it should be relatively straight-forward to figure out the new table structure and adapt your tool from there.
[Android Apps and Games] sarikapoor:
only crypt7

I only have the crypt7 file from the memory card.

I lost my phone and so cant get the key.

What do i do? :(
[Android Apps and Games] kbot82:
Can I help out with a Nokia Symbian MsgStore.bak?

a solution for Nokia users would be really nice

the MsgStore.bak.1, MsgStore.bak.2 etc. can be found in \data\wa\ ... the drive depends on the settings of the Nokia Store (standard is C: )
[Android Apps and Games] no.human.being:
When you install WhatsApp on another phone, which is registered to the same primary Google account, you may receive the same key again.

When I uninstall WhatsApp, the key file gets deleted. When I reinstall it, the same key file gets generated so that I can restore a "msgstore.db.crypt7" backup. I don't think that the key is tied to the device so it must be tied to either the phone number or the primary Google account. Internet says it's tied to the primary Google account, but it may change from time to time (with the database getting reencrypted as well). I'm not sure on that.

Other than that you're pretty much lost. It's a 256-bit symmetric cipher. No chance to brute-force.
[Android Apps and Games] dataguruviru:
how to decrypt crypt 7 file without rooted device....i rrealy need help for it

i have an a database files of whats app but i cant fect the key .. tell me any other way to decrypt the crypt 7 file
[Android Apps and Games] kLow-BR:
in other words, Whatsapp xtract does not work anymore on the last release of whatsapp?
[Android Apps and Games] no.human.being:
You absolutely need the key. As we don't know how it's generated (it's probably tied somehow to your Google account) there's currently no way around it. I heard that, when the device is not rooted, it might be fetched from some sort of backup that includes the app data. I don't know more details. Just get your device rooted, it saves you lots of trouble.

Right. It doesn't handle the crypto and (this is more severe, as the crypto may be bypassed externally before handing the database over to the tool) it doesn't handle the database structure that's used by current WhatsApp. Is the author of this software still around so that he might adapt it to the new table structure?
[Android Apps and Games] john1deer:
Why can't you _ask_ WhatsApp server for key?

If you have the crypt7 file, why can't you issue the same request WhatsApp would to the "key-gen" server and retrieve the key?
[Android Apps and Games] no.human.being:
You probably could, but it would require reverse-engineering and is not neccessary. You can just install WhatsApp on a rooted device, restore the crypt7 backup and WhatsApp will store the key it obtained from the "key-gen" server in "/data/data/com.whatsapp/files/key".

I don't think it's a "key-gen" server, I think it's rather a "key-store" server. It probably has a database with phone numbers or Google accounts (I read the key is tied to your primary Google account) and their corresponding keys and if someone queries, that is not already in the database, the server will grab 32 bytes (256 bits) from "/dev/urandom" and store that as the key.

That's at least how I'd implement it. This way, even if you'd get the "key-gen" code, you wouldn't get any keys since all that code does is generate random keys and store them somewhere. In order to get the keys, you'd need to fetch the entire "key-store" database, which after a compromise could get replaced.

Disk space is cheap. Even if WhatsApp has one billion users, that's only 32 GB of storage for the keys. Put a few TB hard drives (they're really cheap now) into your storage in RAID 5 (get even a bit of redundancy) and you won't even think about something as small as 32 GB.
[Android Apps and Games] john1deer:
Unless you find a way to break SHA{1,2} (and after you mined enough bitcoins), it really doesn't matter whether they calculate the key or just use a database.

As for why would someone need it: rooting/backing up to PC/etc. are not something the average user would do.

Asking WA to pretty please provide us with the code is more elegant...
[Android Apps and Games] tehriddler:
Successfully merged 3 databases from 3 devices. I have copied the new combined media folder back to my internal storage. However the media still shows as thumbnails with download/upload icons. Do I need to do something to link them?
[Android Apps and Games] no.human.being:
If they don't just use the data that the app provides them, but mix in a secret, randomly chosen nonce of appropriate size (normally the size of the hash) as well, then you're right.

If they just do SHA1(phonenumber) or SHA1(strcat(googleaccount, phonenumber)) or SHA1(strcat(strcat("WhatsApp", googleaccount), phonenumber)), that's not too secure. ;)

It's "secure" in that it cannot be inverted, but you don't neccessary have to invert it in order to break it.

Just because they use a cryptographic primitive that's considered secure doesn't mean that the implementation is secure. It's really easy to implement really crappy cryptography on top of secure algorithms like AES or SHA2 or whatever. In cryptography, you need to pay attention to lots of details. Just throwing one "secure algorithm" at it doesn't mean it's secure.

For example when you want to send a message both signed and encrypted, it makes a difference whether you "encrypt, then sign" (what IPsec does), "encrypt and sign" (what SSH does) or "sign, then encrypt" (what SSL does). They leak different information.

WhatsApp is notorious for "doing crypto wrong". I wouldn't be too certain that it can't be broken, just because it's based on AES, which is currently not broken.
[Android Apps and Games] timsl:
How to make media work properly.

I had a Galaxy S3 where i used whatsapp, now i`m using S4 about 6 month. I decided to merge my msgstore.db from my old phone whith new one.

Because i have rooted devise it was simple to decrypt *.crypt7 db with WhatsApp Viever and following the instructions from post 239 i successfully merged my two DB. But media worked only from that DB in which i copied the data. The data i copied show only text, but not media. So i spent about 3 hours trying to understand why is it so.

At the end i found that after merging two DB in one, field thumb_image in new DB consists from BLOB data in case of original record and from much shorter text in case of copied data from the second DB. So before merging DB`s i changed the data type of field thumb_image in my two DB files from TEXT to BLOB whith SQLiteStudio (i used this program because SQLite Database Browser damage indexes when I tried to change the data type). After that i merge my DB`s and my media is working fine.

To change the data type in DB field.

1. You need to download and run SQLiteStudio

2. Press "Add database" and locate your Database file.

3. Connect to DB that your addet.

4. Rigth click on table messages - "Edit table".

5. Select field thumb_image in "Columns" and double-click on it, or press "Edit selected".

6. Change data type from TEXT to BLOB.

7. Press "Change", than again "Change" in other window.

8. Disconnect from DB.

Repeat steps 2-8 to all DB files that you want to merge.
[Android Apps and Games] hgklp:
"Alert! Sorry, we were unable to restore any of your message history backups."

Hi! I just got Lg g3 and tried to restore my chat history. As u might know i had to copy the"msgstore" crypt file from my old phone to new phone by connecting it to pc. However I couldn't find the whatsapp databases folder even though I downloaded it to my new phone. So I created one manually, whatsapp did found the chat history once i started it and tried to restore but gave me this error message "Alert! Sorry, we were unable to restore any of your message history backups."

Anyone have any idea how to get my messages back? could it be related to the fact that I couldnt find a whatsapp database folder on G3? Or maybe because the chat history is kinda old date? like 2 months old..? :/

Any help will be much appreciated, thanks!
[Android Apps and Games] zeekabal:
ImportError: DLL load failed: %1 is not a valid Win32 application.

Hi,

how can I solve this error ?

C:\Whatsapp>python whatsapp_xtract.py msgstore.db -w wa.db

Python Version 2.x

Android mode!

trying to repair android database...

trying to decrypt android database...

Traceback (most recent call last):

File "whatsapp_xtract.py", line 2062, in <module>

main(sys.argv[1:])

File "whatsapp_xtract.py", line 988, in main

from Crypto.Cipher import AES

File "C:\Program Files (x86)\Python27\lib\site-packages\Crypto\Cipher\AES.py",

line 50, in <module>

from Crypto.Cipher import _AES

ImportError: DLL load failed: %1 is not a valid Win32 application.

C:\Whatsapp>pause

Press any key to continue . . .
[Android Apps and Games] ptdeath:
Messages not getting decrypted .crypt7

Hello XDA Universe.

Let me cry first for a couple of lines here. My girlfriend recently ditched me and took all my belongings and money. I found from some of her emails she is a con artist. God knows how many more she will ditch. I need a big favor from you all. I had got her phone with her sd card in it from which I extracted (i.e copied the damn whatsapp folder on to my computer). It has database folder and message.db file among other dated files. I came to this community and saw there were some tools mentioned Whatspp Extract and Python. I have installed both, went step by step instructions but getting error message when I drag drop the database file to whatspp_xtract_drag'n'drop_database(s)_here bat file.

For your consideration I am sending snapshot once I try running the file above.

Kindly help me........
[Android Apps and Games] Hazzard17:
So, if I have a crypt7 file and i know my primary Google account, I could install WhatsApp in a new phone related with same Google account and then restore conversations from the crypt7 file, even if phone number is different? Right?

Someone has already tried?
[Android Apps and Games] Wolfskin95:
Convert "me" to number?

Hi,

i have exported all my history perfectly, but all i wanted is my old number back, so that i can register my new smartphone with my old one - but evrytime i wrote something there's "me" standing instead of my number :confused:

but there must be my number anywhere 'cause the programm has to overwrite my number with "me" - so there's my question:

How can i see my number? I have to see it - does it stand anywhere? there's only "me" - how do i see the number behind my "me"?

Yours

Can anyone extract my number behind "me"

Would be awesome!
[Android Apps and Games] ztedd:
images do not show

Thanks. The newer mail I want to answer here, since it may be of interest for others as well:

Showing of images is optional. You need to copy the media files in the correct folder.

As explained in the Readme and in the 3rd post on page 1 - Some Additional Information - MEDIA FILES:

In your case, the image files need to be in the folder

.../WhatsApp/Media/....@s.whatsapp.net/

so that e.g. the file

.../WhatsApp/Media/....@s.whatsapp.net/6236....f.jpg

can be displayed correctly.

Use Itunes Backup and an Iphone Backup Tool like I-Twin or Iphone Backup Extractor to get the files.
[Android Apps and Games] ztedd:
empty msgstore.plain.db file with 0 kb

I have no idea what went wrong on decrypting your

msgstore.db.crypt file. Maybe you could send me that file and I have a

look into it.

Which version of

- Windows

- ActivePython

- Whatsapp Xtract

- and Whatsapp on Android

do you use?

Which input file did you use? Did you use msgstore.db.crypt from the android SD card?

What does your input file look like? How big is it? What is

the content of the beginning of the file, if opened with an editor or

hex-editor?
[Android Apps and Games] PulseDroid:
Works gr8 thanks

PS:That guy you text has a gr8 name (same as mine) LOL!
[Android Apps and Games] dradeloos:
Deleted records

Hi ztedd

Thanks for the last update, works perfectly now on Iphone....:D

Am I mistaken or does the deleted records not display? I'm sure it showed deleted records from my Android, unless it was because it was records from when I had another sim in - Guess I will need to verify, unless someone knows the answer already?

Cheers
[Android Apps and Games] ztedd:
Please, do the following:

- Download, extract and Run SQLite Database Browser

http://sqlitebrowser.sourceforge.net/

- open ChatStorage.sqlite with SQLite Database Browser

- go to "Execute SQL" tab

- paste this SQL String and then click "Execute query":

SELECT * FROM ZWAMESSAGE WHERE ZCHATSESSION Not In (Select Z_PK From ZWACHATSESSION)

- make a screenshot of the result and post it here (you may blacken parts with private data)

This will help me to get more information on the question whether there are messages that the script doesn't show.
[Android Apps and Games] Mayn:
Yes, you're right, I should have read that!

Anyway, it's working like a charm now!

Many thanks!!
[Android Apps and Games] ztedd:
great! :)
[Android Apps and Games] dradeloos:
No records

Hi ztedd

I ran the script and no records were generated. So I presume that deleted records are REALLY deleted :(

Cheers
[Android Apps and Games] ztedd:
Yes, that seems to be the case unfortunately...

Whatsapp Xtract only can extract those messages that are inside the database. If they are deleted already, it can't help. (Maybe an older backup would contain them)
[Android Apps and Games] ztedd:
received this question by PM:

The HowTo that you have quoted refers to an older version. The new version is able to decrypt the msgstore.db.crypt file that you can find on the SD card of your Samsung Galaxy Ace. I guess you know how to connect your Samsung to your Computer and copy files from the SD card?

Do this:

- in Whatsapp, go to settings - more - Backup Chats and hit Backup

- then connect the mobile to your computer, copy the whole folder /WhatsApp to your computer to e.g. C:\WhatsApp

- on your computer in folder C:\WhatsApp, copy the file C:\WhatsApp\Databases\msgstore.db.crypt to C:\WhatsApp

- download and extract the newest version of Whatsapp Xtract (download link in first post) and extract the .zip file also to e.g. C:\WhatsApp

- Now msgstore.db.crypt and the new files, e.g. !README.txt should be in the same folder, e.g. C:\WhatsApp

- Now download and install Activepython (see Howto in first post)

- Now run "install pyCrypto.bat"

- Now everything should be prepared. Now you can run "whatsapp_xtract_android_crypted.bat"
[Android Apps and Games] myrhre:
Hi ztedd,

works great on Android.

But in the title of HTML-File is a little bug. It shows the phone-number of some contact and not of the owner.
[Android Apps and Games] ztedd:
For me, it works. Which version of Whatsapp Xtract and of Whatsapp do you use?
[Android Apps and Games] ztedd:
empty msgstore.plain.db file with 0 kb

issue resolved:

:)
[Android Apps and Games] ztedd:
How to repair a corrupted database if you get the error "file is encrypted or is not"

Update: hape70 helped me with this solution, posted in the Some additional information post on the first page:

Maybe in a future version I will try to include that as script if I get a sample corrupted database. Can someone send me such an corrupted file?
[Android Apps and Games] myrhre:
It's the actual version in both cases.

2.0 Whatsapp Xtract

2.7.5813 WhatsApp

The filename is also named with the wrong number.
[Android Apps and Games] ztedd:
You are right. It's just not possible to get the owner number out of the message database. Will change that in the next version, just naming the output file like the input file + .html.

It only works with older Iphone versions of Whatsapp.
[Android Apps and Games] arda_satata:
Wow It's Cool :D

I will Try it
[Android Apps and Games] Lexani88:
How can I restore a deleted conversation on the iPhone?
[Android Apps and Games] ztedd:
There is a new version: v2.1

- improved install pyCrypto.bat

- added easy drag and drop possibility with whatsapp_xtract_drag'n'drop_database(s)_here.bat

- (Android Version) added support to fix corrupted android whatsapp database (needs sqlite3, for windows sqlite3.exe is contained in the archive)

- (Android Version) removed wrong extraction of owner in android version

- (Iphone Version) information from Z_METADATA table will be printed to shell

- (Iphone Version) fixed bug in support of older Iphone whatsapp databases
[Android Apps and Games] ztedd:
If you don't have an older backup of the database that contains the conversation that you need, then you can't display it with this tool.

Maybe you can use forensic approaches on file recovery to restore an older whatsapp database.

On Android, Whatsapp puts backups on the SD card: /WhatsApp/Databases. I don't know if it's similar on Iphone.
[Android Apps and Games] ashwini008:
Unable to open Crypt7 file

Dear Team ,

I have installed all software provided by you , but at the end of this process i am getting below error message : Please help me ,what to do ?:confused:

Value Error : Input strings must be a multiple of 16 in length.

Value Error Screenshot is also attached in this mail .

Please help me .I really need this ... Please ......
[Android Apps and Games] sagaryadav0385:
db.crypt file open on my pc

C:\Users\sagar yadav\Desktop>python "C:\Users\sagar yadav\Desktop\wx\whatsapp_xt

ract.py" "C:\Users\sagar yadav\Desktop\msgstore.db.crypt7"

Python Version 2.x

Android mode!

trying to repair android database...

'sqlite3' is not recognized as an internal or external command,

operable program or batch file.

'sqlite3' is not recognized as an internal or external command,

operable program or batch file.

trying to decrypt android database...

Traceback (most recent call last):

File "C:\Users\sagar yadav\Desktop\wx\whatsapp_xtract.py", line 2062, in <modu

le>

main(sys.argv[1:])

File "C:\Users\sagar yadav\Desktop\wx\whatsapp_xtract.py", line 995, in main

decoded = cipher.decrypt(open(options.infile,"rb").read())

File "C:\Users\sagar yadav\AppData\Roaming\Python\Python27\site-packages\Crypt

o\Cipher\blockalgo.py", line 295, in decrypt

return self._cipher.decrypt(ciphertext)

ValueError: Input strings must be a multiple of 16 in length

Press any key to continue . . .

sir when i drag my whatsapp chat backup file i found this error plz help me

my system sonfigeratuon is

window 8 64 bit

but also try win 32 ypthon softwer plz help me
[Android Apps and Games] JP*2706:
Ich hab mich jetzt schon ein bisschen hier durchgelesen, konnte aber mein Problem nicht finden...

Wenn ich diesen Schritt ausführen möchte:

5 (Alternativ zu 4: Öffne das Startmenü, dann "ActiveState ActivePython", dann starte "Python Package Manager (PyPM)", im geöffneten DOS fenster, gib ein: install pypm pycrypto )

Kommt immer eine Fehlermeldung, Can`t install pycrypto-2.6 ... siehe Screenshot.

Hoffe mir kann jmd helfen..

Vielen Dank.
[Android Apps and Games] ipois0n1:
du weisst schon dass das ein englisches forum ist?

//

you do realise this is an english forum only?
[Android Apps and Games] JP*2706:
Yes, but i saw a few german post...that's the reason why i ask in german..
[Android Apps and Games] monterofan:
.nomedia file

Hi:

Have read all the discussion, but nobody mentioned the value of .nomedia file in the profile pictures folder. I read that it contains a key to give other applications the possibility to access the message database.

Has anyone succeeded using this file? What is the value of this .nomedia file in the decryption process?

If it is useful, how can I use it in a script to decrypt a crypt7 database.

Thanks for your time and comments.
[Android Apps and Games] saske87:
ok guy that's my question:

I saved whatsapp folder to m pc before flashing the smartphone formatting sd data too.

now im trying to open my old backups.

I used different app even whatsapp tri crypt.. nothing worked.

i think my key of the new installation is different by the old one. and this may cause the issue...

may you tell me if I have any chance to read my backups now that i formatted??

please dont be unsesnsitive.... :crying: :crying:
[Android Apps and Games] Androidre:
Thanks!!!

Hey guys!

I could try to use this tool, and it works great! Thank you very very much... ;)
[Android Apps and Games] andresx013:
i got a question, i have the entire whatsapp folder from other phone, means other number... how can i do in this case.... i really have no idea

its crypt7..

i downloaded whatsappviewer but it didnt worked because i need the key

i tried to copy database and paste on my phone and tried to use whatsapp tri crypt but it failed..

is there any other way to do it?

i havee acces to the other phone because its the phone of my gf, but im doing this because im thinking shes cheating me so im investigatin.. i have access but i cant put the phone on my pc via usb... is there any wayy?? thank you,,
[Android Apps and Games] enmatt:
Thank you, ztedd. Awesome explanation about merging db's in post http://xdaforums.com/showpost.php?p=28899881&postcount=239. Thanks to OP and everyone who contributed to instructions.
[Android Apps and Games] whiskey90tango:
how to read MsgStore.bak.1

i have found three files in my nokia,

MsgStore.bak.1

MsgStore.bak.2

MsgStore.bak.3

can please somebody help me?? how to read it??