mirror of
https://github.com/ElDavoo/wa-crypt-tools.git
synced 2026-04-26 22:25:50 +03:00
[GH-ISSUE #35] feature request: export 64-digit encryption key #24
Labels
No labels
bug
documentation
enhancement
enhancement
good first issue
help wanted
info needed
invalid
low priority
pull-request
skill issue
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/wa-crypt-tools#24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @privnote42 on GitHub (Sep 3, 2022).
Original GitHub issue: https://github.com/ElDavoo/wa-crypt-tools/issues/35
Originally assigned to: @ElDavoo on GitHub.
Hello,
I have a feature request.
Would it be possible to output / export the 64-digit encryption key so that I can import an E2E encrypted backup?
This is the use case:
I forgot my password for the E2E encrypted backup and did not save the 64-digit encryption key.
I wanted to update my phone to a new LineageOS version, so I backed up Whatsapp and then deleted all partitions.
I also made a backup of the Whatsapp folder in /data/data, so I still have encrypted_backup.key as a file.
The export also works without problems, but unfortunately Whatsapp does not seem to accept this non-encrypted database; at least when I reinstalled Whatsapp, I was not offered a restore with it.
@ElDavoo commented on GitHub (Sep 3, 2022):
I don't know if that's going to work, but it's certainly doable. Tomorrow morning I will make it that it will be printed in verbose mode. In the meantime, you can try inserting a print(key) in the program, as the Key object has the print method
@privnote42 commented on GitHub (Sep 3, 2022):
Hi,
I have already tried to output the key in the load_crypt15 function.
But I only get a byte hex code there, which I can't convert with the decode function either, because i got an error.
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa2 in position 3: invalid start byte
Or is that already all I need?
This would be the output (I have already changed some parts so that my real key is not published here):
b'<k\x1f\xb1_\xc0\x06\xbe\xff\xeb\x1cU\nI\x13\xf9\x9c\xe0I\x16DP\x51N\\x9doJ\xc8R\xfc~'
I would then translate it like this
1FB1C006....C8FC
@privnote42 commented on GitHub (Sep 3, 2022):
ok, I think I got it now.
Now I just output the key object at the end of the main function.
The hex function was probably the missing piece of the puzzle, now I probably have the right hex code.
The next restore attempt I can only do in 12h, because of the frequent reinstallations today...
I will let you know after my next try is done
@privnote42 commented on GitHub (Sep 4, 2022):
ok, the displayed key was accepted during restore.
Thanks again for your help.
Unfortunately, the restore itself did not restore my chats.
I have now found another way and have overwritten the msgstore.db directly in the folder /data/data/com.whatsapp/databases/ after I did the failed restore (without reinstalling whatsapp).
Before overwriting, I stopped whatsapp to be on the safe side and after restarting, all my chats were there again.
Just a quick note in case anyone has the same problem as me with a non-functioning restore
@ElDavoo commented on GitHub (Sep 5, 2022):
ok, sorry for not doing it yesterday. Would you mind making a pull request?
@ElDavoo commented on GitHub (Sep 14, 2022):
you just had to uncomment line 683 lol