4 ms·
APK files are zips, although the same code that reads them probably checks signatures.
by swiley 5y ago
APK files are zips, although the same code that reads them probably checks signatures.
- Karliss 5y agoThere was at least one or two vulnerabilities in Android because it wasn't the same code doing those two things. Later they added a signature for whole zip(almost*) instead of previous approach inherited from jar which hashed each file inside the zip individually. That way signature check doesn't need to parse zip headers*. * Since the signature is put somewhwere between zip headers instead of separate file there needs to be little bit of parsing to locate it and the hash isn't straight forward hash of whole file because it needs to exclude the signature part. edit: turns out they later also added a version of external signature
- formerly_proven 5y agoIntermingling signatures or authentication and data layout is such a common failure and people do it over and over again, even in relatively new projects like Android. I wonder why the initial design took off? This is something were I would expect any crypto engineer to refuse to sign the design off, because it is going to break; it's not even a question. If you do anything other than Sign(Blob) and later Verify(Signature, Blob) && Parse(Blob) you're going to do it wrong.
- m4rtink 5y agoNot just APK, EPUB (ebook file format) as well, likely many others as well (IIRC JAR for Java ?).