vexl-it / vexl

Vexl app
https://vexl.it
GNU General Public License v3.0
62 stars 12 forks source link

Specify faster crypto requirements #1258

Open leomira opened 1 month ago

kaladivo commented 1 week ago

We are using this library: https://github.com/margelo/react-native-quick-crypto/tree/main

Here is the list of implementation coverage: https://github.com/margelo/react-native-quick-crypto/blob/0.x/docs/implementation-coverage.md

Our app uses ECIES encryption to encrypt offers. Currently our biggest bottleneck when encrypting offers is generating ECDH shared secret.

Meaning that we need the following methods to be implemented: ❌ ecdh.computeSecret(otherPublicKey[, inputEncoding][, outputEncoding]) ❌ ecdh.generateKeys([encoding[, format]]) ❌ ecdh.getPrivateKey([encoding]) ❌ ecdh.getPublicKey([encoding][, format]) ❌ ecdh.setPrivateKey(privateKey[, encoding])

Curves that need to be supported: secp224r1 (P-224) and secp256k1 (P-256K).

Also the implementation of ECDH is already done in Node: https://github.com/nodejs/node/blob/main/src/crypto/crypto_dh.cc

Also, there are tests inside the app and in TS: https://github.com/vexl-it/vexl-next/blob/main/packages/cryptography/src/operations/eciesLegacy.test.ts