-
Notifications
You must be signed in to change notification settings - Fork 45
Reduce size to 922 bytes with elliptic-curve signatures. #4
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
Conversation
|
Adb doesn't seem to want to install an APK I generated with this method: This seems like a really promising approach though! Also, the APK I generated was 821 bytes, so it looks like there's scope for generating an optimal keystore. |
|
https://source.android.com/security/apksigning/v2#apk-signature-scheme-v2-block says that the 3 ec curves supported are NIST P-256, P-384, and P-521, so maybe use -keysize 256 to get the 256-bit curve? |
|
@zhuowei thanks for the tip. I used a 256-byte EC curve and it works fine, albeit a little bigger. At least it is under 1KB (and under 1KiB) now! |
|
@nneonneo Can confirm this installs on a physical device running Android 8.0.0. |
|
Can also confirm that this works on an Android device - would you be add the keysigning steps to the build script currently on master? I'll happily merge it in after that. Congrats @nneonneo - you got it under a kilobyte! |
|
I have added the new keystore. The keysigning steps didn't change but I took the opportunity to make a few very minor tweaks to the build script. |
|
Random luck made it 922 bytes. If I have time I might play with the crypto a bit to generate a really bad (but small) signature. It should be possible... I also added the keystore generation to the |
"ec.keystore" was generated using:
and then the APK was signed with
Unfortunately, I haven't tested this yet because I don't have an Android 7.0 phone, nor enough internet on this airplane to download a suitable emulator :(.I have tested the latest committed version, and it works properly on an Android 7.1.1 emulator.