https://github.com/canciucostin/crypt12-decrypt
Decrypt Whatsapp .crypt12 database files
https://github.com/canciucostin/crypt12-decrypt
aes-128 aes-gcm crypt12 decrypt decryption go golang whatsapp
Last synced: 6 months ago
JSON representation
Decrypt Whatsapp .crypt12 database files
- Host: GitHub
- URL: https://github.com/canciucostin/crypt12-decrypt
- Owner: CanciuCostin
- Created: 2020-07-14T14:25:02.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-26T08:15:23.000Z (over 4 years ago)
- Last Synced: 2025-03-30T07:01:34.256Z (6 months ago)
- Topics: aes-128, aes-gcm, crypt12, decrypt, decryption, go, golang, whatsapp
- Language: Go
- Homepage:
- Size: 17.7 MB
- Stars: 47
- Watchers: 3
- Forks: 8
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![GO][go-shield]
# Crypt12 DecryptDecrypt Whatsapp crypt12 sqlite database files
## Crypt12 algorithm
* AES GCM mode encryption using 128 bit block size and 16 bytes IV (nonce)
* key file must be 158 byte long (only last 32bytes represent the key)

* crypt12 file includes 67 byte header and 20 byte trailer which needs to be removed

* the resulted plain bytes need to be decompressed in order to obtain the final SQLite .db file
* for more information you can check [A Systems Approach to Cyber Security: Proceedings of the 2nd Singapore Cyber-Security R&D Conference (SG-CRC 2017)](https://books.google.ro/books?id=RUXiDgAAQBAJ&pg=PR7&lpg=PR7&dq=A+Systems+Approach+to+Cyber+Security:+Proceedings+of+the+2nd+Singapore+Cyber-Security+R%26D+Conference+(SG-CRC+2017)&source=bl&ots=vWJcT_nFMa&sig=ACfU3U1Tmj6ui8lYaPPZIY7fGz4UwAIN6w&hl=en&sa=X&ved=2ahUKEwjKpannwc_qAhWok4sKHTrNDtAQ6AEwBXoECBIQAQ#v=onepage&q=A%20Systems%20Approach%20to%20Cyber%20Security%3A%20Proceedings%20of%20the%202nd%20Singapore%20Cyber-Security%20R%26D%20Conference%20(SG-CRC%202017)&f=false)
## Usage example
1. Ensure you have the key file (**key**) and crypt12 file (**msgstore.db.crypt12**) in the same directory with the go entrypoint. You can use the existing key and msgstore files in the repo for testing.
* Run using GO:
```
go run crypt12-decrypt
```
* Or run Windows executable:
```
crypt12-decrypt.exe
```
2. Otherwise use the necessery arguments:
```
go run crypt12-decrypt.go -h
```
```
Usage of crypt12-decrypt.exe:
-crypt12file string
crypt12 file path (default "msgstore.db.crypt12")
-keyfile string
decryption key file path (default "key")
-outputfile string
decrypted output file path (default "msgstore.db")
```## Build
```
go get github.com/CanciuCostin/crypt12-decryptgo build crypt12-decrypt -> built with go version 1.14.4
```[go-shield]: https://img.shields.io/badge/go-1.14.4-green