Skip to content

Instantly share code, notes, and snippets.

@kathrinrin
Created March 11, 2016 16:32
Show Gist options
  • Save kathrinrin/e81ad6c5963f75c6e198 to your computer and use it in GitHub Desktop.
Save kathrinrin/e81ad6c5963f75c6e198 to your computer and use it in GitHub Desktop.
decrypt whatsapp database
1) extract key
https://github.com/AbinashBishoyi/WhatsApp-Key-DB-Extractor-UnOfficial
2) run a few commands
hexdump -e '2/1 "%02x"' whatsapp.key | cut -b 253-316 > aes.txt
hexdump -n 67 -e '2/1 "%02x"' msgstore.db.crypt8 | cut -b 103-134 > iv.txt
dd if=msgstore.db.crypt8 of=msgstore.db.crypt8.nohdr ibs=67 skip=1
openssl enc -aes-256-cbc -d -nosalt -nopad -bufsize 16384 -in msgstore.db.crypt8.nohdr -K $(cat aes.txt) -iv $(cat iv.txt) > msgstore.gz
gzip -cdq msgstore.gz > msgstore.db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment