-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IV derivation seems to be wrong (?) #1
Comments
The decryption key is x'decrypt_key', including x and the quotation marks on both sides. For example, if decrypt_key=1234, then the complete key would be x'1234'.
1. Open db file
2. Input decrypted key![]() 3. Show result![]() |
Hi and thanks for the overview :) I'm aware of how to use the decrypted key, and I already have a working implementation of this. Maybe there are differences between Signal versions, but in your example the decrypted key is 64 bytes long. This was not the case for me, when I ran your code without modification, where I only got a 48 byte key, which naturally didn't work. |
Hi. Thank you for all the effort and the code. I've got exactly the same issue as @x3ro. Decrypted key returned by the tool has 48 bytes and it does not decrypt Signal DB :( Fix proposed by @x3ro works for me. Thx! |
Built universal binary in a virtual machine: copied to machine for use, Seeing the same issue; the code dumps out a 48 byte Decrypted Key, which does not work even with the Utilizing the patch above does result in a working key. One thing I will say, this db was created years ago and has been copied from a much older system and upgraded. It predates the key being kept in the macOS keychain, if that is a differentiating factor at all. Happy to provide additional details when requested/if helpful. |
Hi and thanks for writing this, it was very helpful that someone already did most of the reserach 😅
I gave your code a try and found that it does indeed return a decrypted key, but this key did not successfully decrypt the test database. I played around with it a little bit and eventually noticed that the key does not have the right length: 48 bytes as opposed to the expected 64 bytes.
I eventually narrowed this down to
decrypt_string
, where you take the ciphertext and treat the first 16 bytes as the IV. However, looking at the OSCrypt code from Chromium, I noticed that it just uses an IV made up of0x20
instead.My resulting
decrypt_string
function looks like this, and works at least on my machine:The text was updated successfully, but these errors were encountered: