-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
[Feature] Integrity verification #35
Comments
There is no good reason to use md5 ever again (except for PoW and other hash collision games lol). I suggest using one of the more modern hashing algorithms that are both fast and decently secure. |
Would be way too slow to do this on every launch. |
Thanks for the suggestion. Please open a separate issue for this. |
I suggest running
That's roughly between 300MB and 700MB per second on a single core (the last column is the one that matters for our use case). For reference, my SATA SSD benchmarks at 550MB/s read speed. It totally is possible to build integrity checks without noticeably slowing down the startup time on most devices and for most binary sizes. |
Yes, with a 5 GB AppImage (like a game) it would be multiple seconds, which is too much. And think spinning disks, etc. |
We could expose/implement such a function in libappimage, so tools like AppImageLauncher could provide UIs that support this. Please open an issue there. |
Done !
Wouldn't it need support from the AppImage spec, to integrate the checksum in the file ? I would like to point out that most of the comments here are talking about MD5, when a more viable solution would be CRC (isn't it literally made for this use case ?) |
Any file this size will take seconds to load, because disk drives are slow. As long as the CPU is faster at hashing than the drive can load the bytes, the load time overhead will be negligible. |
libappimage respectively AppImageUpdate already implicitly define those hashing algorithms, however a formal specification is not available as of yet. This is subject to changes in the future. Nevertheless, it makes sense to implement this in libappimage. We need to reopen this issue therefore.
Agreed. Still, depending on the underlying disk's type (slow 2.5" HDD for instance), it'll introduce a severe performance overhead. For small AppImages, the "run always" argument may even end up in wasting battery life for no good reason. There are AppImages out there that run quite frequently, or are launched multiple times in parallel. There is no need to running this every time. Such a check makes sense once. Bit errors after downloading (e.g., due to disk errors) are not a valid argument, as they may affect any file all the time. Implementing a "first launch" style test is a perfect use case for AppImageLauncher and similar tools, which hook into first launches. I could imagine, e.g., providing a "check integrity" button in the first launch dialog. |
You're right, running this on every launch would be problematic for some hardware
Why not do it automatically (with maybe an option to disable it in the settings) ? I can easily imagine users skipping this check when integrating AppImages |
That's a discussion to have in AppImageLauncher's issue tracker. |
👍 So to conclude, what should be done in this repository ? Mention the hashs used and embedded in the AppImages ? |
AppImages are files which can get really big in size, and download errors can occur with such sizes
I propose to add some way to (at least try to) verify it's integrity at launch
Why ?
As of now, a partially downloaded AppImage will fail to launch with
It is maybe harmless in this case, but I think it could potentially cause problems if the partially downloaded AppImage seems like a legit squashfs image. (This is only a theory, I do not have any proof this can happen)
Implementation propositions :
Cons : as pointed there, that would be costly. Plus, I'm not sure if this section is actually going to be in the specification
.appimage_size
, and verify the size of the executed file is the sameCons : some programs might zerofill the file and fill bytes as their download them
.crc_checksum
, and verify it. I think that's the best option, because CRC is an algorithm made for file integrity (as opposed to a simple file size verification), and is more lightweight than MD5I think this feature should be looked at before #34 (because well, it would modify the spec)
The text was updated successfully, but these errors were encountered: