[C#] WhatsApp Crypt5 Database Decryption

03/25/2014 23:00 ImmuneOne#1

If anyone desires it, it's for the newly updated database encryption WhatsApp uses to store chat history/data.
03/28/2014 20:20 ImmuneOne#2
Would anyone appreciate an app/program that exports it into sorted chats instead of a messy database overview?
05/04/2014 16:09 supercracker13#3
English:
I tried to use the code but i got one problem while opening the file.
I tried a few programms but it doent work.
Thats my code i used. Are there any mistakes? Or how do you open the file?

Deutsch:
Ich habe versucht deinen Code zu benutzen aber ich habe ein kleines Problem bekommen als ich versucht habe die Datei zu öffnen. Ich habe mit ein paar Programmen versucht die Datenbank zu öffnen aber es hat nicht wirklich funktioniert. Das hier ist der Code den ich benutzt habe.
Gibt es einen Fehler oder womit öffnest du die Datei?


Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenSSL.Crypto;
using System.IO;

namespace WhatsappDecrypt
{
    class Decrypt
    {
        static byte[] key = { 141, 75, 21, 92, 201, 255, 129, 229, 203, 246, 250, 120, 25, 54, 106, 62, 198, 33, 166, 86, 65, 108, 215, 147 };
        static byte[] iv = { 0x1E, 0x39, 0xF3, 0x69, 0xE9, 0xD, 0xB3, 0x3A, 0xA7, 0x3B, 0x44, 0x2B, 0xBB, 0xB6, 0xB0, 0xB9 };

        public void Run()
        {
            //Create cipher.
            CipherContext aes = new CipherContext(Cipher.AES_192_CBC);//aes cipher
            System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create();//md5 crypt
            byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes("MyMail");//get bytes from input string
            byte[] hash = md5.ComputeHash(inputBytes);
            //////////////UpdateKey//////////////
            for (int i = 0; i < 24; i++)
            {
                key[i] ^= hash[i & 0xF];
            }
            /////////////////////////////////////
            //Decrypt file and rewrite to new.
            byte[] returnedData = aes.Crypt(System.IO.File.ReadAllBytes(@"C:\Users\xxx\Downloads\msgstore.db.crypt5"), key, iv, false);
            File.WriteAllBytes(@"C:\Users\xxx\Desktop\recover.db", returnedData);
            Console.WriteLine("Ready");
        }
    }
}

Edit: Es funktioniert jetzt alles hab anstatt "gmail" "googlemail" geschrieben. War anscheinend ein Fehler