Android JCA Backend for package:webcrypto
This project proposes an experimental Android-specific backend for package:webcrypto that replaces the bundled BoringSSL native library with calls to Android's built-in Java Cryptography Architecture (JCA), accessed through package:jnigen. The current BoringSSL/FFI backend ships an approximately 300-500 KB native library per ABI. A JCA backend eliminates this binary overhead entirely by using cryptographic providers already present in the Android runtime. The project will implement Dart wrappers for all Web Crypto primitives (digest, HMAC, AES-GCM/CBC/CTR, RSA, ECDSA, ECDH, HKDF, PBKDF2) behind the existing webcrypto platform interface, with full conformance testing against the BoringSSL backend. A working sample project already demonstrates the approach for P0 primitives (SHA-1/256/384/512, HMAC, AES-GCM) with statistical benchmarks across 7 Android devices showing JCA is 7-29x faster for hashing at large payloads while BoringSSL retains advantages for AES-GCM. Deliverables include the complete JCA backend on an experimental branch, a performance analysis report with binary size comparison, documentation, and a migration guide.
Project details
Technologies
Not listed in the archive