Decrypt image with Mediakey from ChatStorage.sqlite (IOS)

Author: JonesHHCreated Jun 14, 2019Updated Aug 27, 2023

Hi, i identified column ZMEDIAKEY in table ZWAMEDIAITEM in the IOS version of Whatsapp sqlite database containing the MediaKey for image decryption. (Ok, you could have guessed by the name of the column) Unfortunately the content is stored in a Blob and I#m not able to use it directly. Whatsapp-Web-Reveng is showing me the correct value. Also copying ZMEDIAKEY from another sqlite database leads me to a working MediaKey for decryption. Unfortunately this process is very clumsy. Would like to get it done by scrypt. Anybody any idea how to get from

{select quote(zmediakey) from zwamediaitem;"} X'0A2027BDE5011940BF16D599255AD8A2CA00FAF0ABE35D4BBE82984A3D1B0D73982E12204B6477490B97591CF29DE9272EFF25AF1CB32821891263B5D1BC60F910D05E7218F6FC84E7052000' to "mediaKey" : "J73lARlAvxbVmSVa2KLKAPrwq+NdS76CmEo9Gw1zmC4=" ????

regards jones

Source: sigalor/whatsapp-web-reveng