Comments (21)
deriveBits for ECDH was added. Current code is not added to NPM yet. Could you test deriveBits
function with your code before?
from node-webcrypto-ossl.
OK, after fixing #52 as well, now it works!
from node-webcrypto-ossl.
DeriveBits function is not implemented yet.
from node-webcrypto-ossl.
Great! I will look into it now.
from node-webcrypto-ossl.
You should make
git pull
tsd install
tsc
npm install
from node-webcrypto-ossl.
It does not work. The error I get:
Error: Error: 4353290240:error:2B064064:lib(43):ECDH_compute_key:no private value:../deps/openssl/openssl/crypto/ecdh/ech_ossl.c:136:
at SubtleCrypto.deriveBits (node_modules/node-webcrypto-ossl/buildjs/subtle.js:290:16)
from node-webcrypto-ossl.
I am working on reproduction.
from node-webcrypto-ossl.
Done: https://github.com/mitar/ecdh-test
npm install
node test.js
I get:
Possible Unhandled Promise Rejection: [Error: 4343992320:error:2B064064:lib(43):ECDH_compute_key:no private value:../deps/openssl/openssl/crypto/ecdh/ech_ossl.c:136:
]
from node-webcrypto-ossl.
(Interesting that ]
is in new line.)
from node-webcrypto-ossl.
Also observe that the example works in at least Chrome, if you remove the use of the Buffer
call at the end.
from node-webcrypto-ossl.
Is it right?
from node-webcrypto-ossl.
Sorry, I am not sure what you are trying to convey here. :-) So result of Promise.all
is an array, and it should contain two keys. I just extract them into two variables.
So are you saying that:
- reproduction code has a bug
- that you are confirming that this library has a bug
- or that Chrome is too lenient and that it should not work in Chrome, but it does?
from node-webcrypto-ossl.
It seems I found an error. I chaked baseKey
from deriveBits
function. It's not a private key, but it has attr type private
. It seems export/import EC function has error. I'm checking it.
from node-webcrypto-ossl.
I found an error. I made test with your example, it's ok. Could you test by yourself and close current issue?
from node-webcrypto-ossl.
Hm, now I get:
Named corves of EC keys are not equals
from node-webcrypto-ossl.
(There is also a typo in corves
.)
from node-webcrypto-ossl.
Not sure why this does not come up in the reproduction. Maybe because in my case one key comes from browser, and the other key comes from this package.
from node-webcrypto-ossl.
I updated the reproduction repository. It fails with:
error [Error: Named corves of EC keys are not equals]
Key embedded in the code was generated on Chrome using the same parameters. It seems shorter than what this package generates. Are you sure this package respects parameters for key generation correctly? Because example of the public key for same parameters generated by this package is (in hex):
3082014b3082010306072a8648ce3d02013081f7020101302c06072a8648ce3d0101022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff305b0420ffffffff00000001000000000000000000000000fffffffffffffffffffffffc04205ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b031500c49d360886e704936a6678e1139d26b7819f7e900441046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63255102010103420004858c079390e3a9151fdda8536c5a08d336b05092a871d2491a0c56cf27ecbc5fa1c941502921f46e61cf921c94901e7c375d7fab9fb31f995b5a2cf993dd8a59
And from Chrome it is:
3059301306072a8648ce3d020106082a8648ce3d030107034200047a9f5058422c18043bcb3df3ea56b513a533cfe4c2c3fa489a8606bff6a6677d9a9eb0505fcc8011a329013f96b3646a438ea4e55343a0d3b8fdf60c954c36e5
from node-webcrypto-ossl.
Thank you. You found new error. Imported private key doesn't have named curve.
I have to fix it.
from node-webcrypto-ossl.
I fixed last error (again). I hope it's last error for current issue. I tested code from your repo, it's OK
from node-webcrypto-ossl.
It works very well! Thank you! It also improved our crypto speeds a lot!
from node-webcrypto-ossl.
Related Issues (20)
- Cannot wrap key if wrapping key has only `wrapKey` usage
- Update webcrypto-core
- Double-free when exporting a JWK key HOT 6
- Is OpenSSL needed with latest Node? HOT 2
- Fails to build on MacOS Catalina 10.15 HOT 3
- Can't build on Windows. HOT 5
- Error: 404 response downloading https://nodejs.org/dist/v6.0.3/node-v6.0.3-headers.tar.gz
- typo
- Support AES_CTR 256 HOT 8
- index.d.ts outdated
- Should CryptoKeyStorage really be required in v2? HOT 7
- TypeError: (intermediate value).Crypto is not a constructor HOT 5
- Error with NODE_MODULE_VERSION HOT 1
- `CryptoKey[Symbol.toStringTag]` not implemented. HOT 1
- Ensure validity of K-256 keys when importing
- install fail HOT 2
- Node.js 15.x began to provide WebCrypto HOT 4
- build fails on macos 11.4, nodejs 16.3.0, HOT 4
- AES-KW key unwrapping does not check for integrity HOT 5
- Use native webcrypto instead of node-webcrypto-ossl HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-webcrypto-ossl.