Whatsapp crypt 12 file: what it is and how to open it

Decrypting a crypt12 file is not impossible: you can use the manual method, for which you need a key and some practice, or use apps.

If you're reading this article, most likely you'd like to open the encrypted database of messages in Whatsapp chat history so you can view and maybe save conversations. Or, you would like to simply find out to what extent your privacy is protected. You can do this by opening the crypt 12 file. What is it? How to carry out the procedure? Read on to find out more.

What is a Whatsapp crypt 12 file

A crypt 12 file is a 256-bit encrypted data store containing messages sent and received via Whatsapp Messenger. This document is often integrated with a .DB file, so that an additional .DB.Crypt 12 file is created: in this way, the database of conversations on Whatsapp installed on an Android device is given greater protection. In particular, the DB file, used to store contacts and messages, is not meant to be opened or edited manually, as it contains support files that in turn include important information for the device or an application.

This new encryption method was created after a flaw was discovered in 2016 that allowed WhatsApp Inc to request, without your knowledge, an encryption key from the client present on your phone. So, compared to before, to decrypt a crypt12 file you necessarily need a key. Tuttavia, recuperare questa chiave non è una missione impossibile, partendo dal presupposto che tu abbia sottomano il tuo device Android sul quale sono stati creati dei backup dei messaggi. Vediamo, qui di seguito come decrittografare un file crypt12.

Aprire un file crypt12: le soluzioni

Per aprire un file crypt 12 esistono due metodi principali:

  • decriptare con la procedura manuale;
  • decriptare con la procedura automatica.

Andiamo ad approfondire queste due soluzioni nel dettaglio, mostrando i vari step.

Apertura manuale di un file crypt12

Per decifrare un file crypt12 bisogna disporre di un file key. Questa chiave si trova nel file whatsapp.cryptkey, presente in questo percorso: /data/data/com.whatsapp/files/key.

Per estrarre la chiave, è necessario utilizzare uno smartphone che abbia il root installato e svolgere le seguenti operazioni:

  • Lancia ADB shell;
  • Passa a root;
  • Copia il file key sulla scheda SD;
  • Estrai i file di backup crypt12, usando ADB shell e lancia il seguente comando: $ adb pull /sdcard/WhatsApp/Databases/msgstore.db.crypt12

La chiave AES da 256 bit è salvata dalla posizione 0x7E del file fino alla 0x9D. Svolta questa procedura, estrai il cosiddetto vettore d’inizializzazione (IV) e assegnalo alla variabile $iv.

L’IV è salvato all’interno del file dalla posizione 0x6E fino alla 0x7D. Per fare questa operazione puoi scegliere uno di questi comandi, che vanno chiaramente svolti sempre in ambiente Linux:

  • $ iv=$(hexdump -e ‘2/1 “%02x"‘ key | cut -b 221-252)
  • $ iv=$(dd if=key bs=1 skip=110 count=16 2>/dev/null | hexdump -e ‘2/1 “%02x"‘)

Prima di iniziare la fase di apertura del file crypt12, devi rimuovere gli header di 67 byte dal file crypt12 attraverso questo comando:

  • $ dd if=msgstore.db.crypt8 of=msgstore.db.crypt8.nohdr ibs=67 skip=1

Questo comando serve per rimuovere i primi 67 byte dal file. Salva, successivamente il nuovo file con estensione cypt8.nohdr.

Adesso puoi decrittare il file delle conversazioni (msgstore.db.crypt8.nohdr), utilizzando l’utility openssl. Questo è il comando:

  • $ openssl enc -aes-256-cbc -d -nosalt -bufsize 16384 -in msgstore.db.crypt8.nohdr -K $k -iv $iv | gunzip > msgstore.db

Per aprire il database criptato di Whatsapp e leggere le chat, ti consigliamo il software per Windows, Whatsapp Viewer: è gratis e non richiede alcuna installazione.

Decriptare il file crypt12 con la procedura automatica

Se sei poco avvezzo all’ambiente Linus e desideri delle soluzioni pratiche e veloci, puoi utilizzare le seguenti app per aprire il file crypt12 di Whatsapp:

  • Whatcrypt. La versione "app per Android" è molto più sicura in termini di privacy rispetto al "servizio web". È davvero semplice da utilizzare: se il telefono è rootato, ti permette di convertire i file crypt12 in file db. e, con un semplice tap, puoi estrarre questo file che include la chiave di decrittazione. Se l’applicazione non svolge il suo lavoro, molto probabilmente non hai i privilegi del root;
  • Backup Text for Whatsapp. Gli ultimi aggiornamenti di questa applicazione supportano in maniera perfetta i file crypt12 e, un altro vantaggio, è il fatto di essere completamente in lingua italiana. Questa app ti permette, attraverso i privilegi del root, di fare il backup in chiaro (nel formato che preferisci) delle conversazioni, anche singole. It also allows you to filter messages and save those with a certain date.

.