flutter_micro_ecc 0.0.2+1 flutter_micro_ecc: ^0.0.2+1 copied to clipboard
micro-ecc plugin for Flutter. Allows ECDH Key Generation and Shared Secret Computation.
micro-ecc plugin for Flutter.
Alpha version #
This library is actively developed alongside production apps, and the API will evolve as we continue our way to version 1.0.
Please be fully prepared to deal with breaking changes. This package must be tested on a real device.
Need a API which is currently unavailable? Please raise a issue. PRs are also appreciated.
Android NDK is needed for using this library on Android.
- Generate Key Pair
- Compute shared secret
Selecting a curve #
final curve = EcdhCurve.SECP256R1;
Generating a KeyPair #
final Ecdh ecdh = Ecdh(); EcdhKeyPair _alice = _ecdh.generateKeyPair(_curve);
Computing the shared secret #
final Ecdh ecdh = Ecdh(); Uint8List _aliceSharedSecret = _ecdh.computeSharedSecret(_alice.privateKey, _bob.publicKey, _curve);
Example Application #
Generate a keypair by clicking on the
- Compute the shared secret by clicking on the
- The ✅ indicates the shared secret on both the nodes is equal.
I developed this library because I could not find any decent clean solution to facilitate the ECDH key exchange. The functionality may still be limited though. Please feel free to contribute to this library, in case you find any functionality is missing.