I went down a rabbit hole after reading the S-RM article "Cracking the Vault", which detailed vulnerabilities in privacy apps. I realized they were talking about Gallery Vault (by ThinkYeah), so I decided to audit it (v4.4.33, released March 2025) to see if it was as bad as it seemed.
Spoiler: It was.
The PIN you set is strictly a UI lock. It plays zero role in the actual file encryption. The app relies *entirely* on a hardcoded master key embedded in the APK. The implemented encryption is a static string (good_gv) that gets padded and run through DES-ECB with a static hex constant. This generates a global master key that is identical for every user on every device.
This master key is used to unwrap a unique per-file key stored in the file's tail metadata (sandwiched between >>tyfs>> and <<tyfs<< markers). Once that key is exposed, the actual file content is just a simple XOR cipher with a position-based salt.
Simply put, if you have a clean dump of the Android data, you can decrypt the files without ever knowing the user's password.
Practically speaking, the main legitimate use case here is forensic recovery from a lawful device dump. But the bigger takeaway is that 50M people think their files are protected when they really aren't.
I wrote a Python tool that automates the entire pipeline. It goes through the provided android dump and, using the hardcoded values, decrypts the per-file key, and reverses the XOR transform. It also handles magic byte detection to restore the correct file extensions (jpg, mp4, etc), although only images are supposed to be stored in the vault.
It has a nice TUI too if you prefer it to just CLI :)
Link: gv_decryptor
Disclaimer: For educational and legitimate forensic purposes only. Don't go poking around files that aren't yours.
[link] [comments]
from hacking: security in practice https://ift.tt/0oCD1tf
Comments
Post a Comment