Closed carlosnufe closed 2 years ago
Hello,
We want to change if possible the elliptic implementation we have for our browser app with your library, which is better in different areas. However, either we didn't get how to do it (probably lack of knowledge) or it's not possible.
We do have this
const sharedPublicKeyPair = ecInstance.keyFromPublic(sharedPublicKey, 'hex'); const derivedKey = keyPair.derive(sharedPublicKeyPair.getPublic()).toString(16); const derivedKeySliceBase64 = hexadecimalToBase64(derivedKey.substring(0, 48));
After reading the documentation you provide we need help to achieve our goal. So we would have
// previously let privateKey = utils.randomPrivateKey() or window.crypto.getRandomValues(new Uint8Array(32)) const publicKey = getPublicKey(privateKey) const sharedPublic = getSharedSecret(privateKey, sharedPublicKey) // 'hex' 04... // next step
After getting the hex of 130 chars / ArrayBuffer of 65 bytes, we tried to import the key using the WebCrypto API, but the length is above 256bits.
Could we get some help?
Thanks
Do sharedPublic.slice(1)
@paulmillr it worked, thanks for your fast response. We are able to use the library.
Hello,
We want to change if possible the elliptic implementation we have for our browser app with your library, which is better in different areas. However, either we didn't get how to do it (probably lack of knowledge) or it's not possible.
We do have this
After reading the documentation you provide we need help to achieve our goal. So we would have
After getting the hex of 130 chars / ArrayBuffer of 65 bytes, we tried to import the key using the WebCrypto API, but the length is above 256bits.
Could we get some help?
Thanks