Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECDSA implementation #2

Closed
stevencedro opened this issue May 19, 2023 · 5 comments · Fixed by #30
Closed

ECDSA implementation #2

stevencedro opened this issue May 19, 2023 · 5 comments · Fixed by #30
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@stevencedro
Copy link
Member

stevencedro commented May 19, 2023

Implementation of ECDSA operations as per W3C specification at https://www.w3.org/TR/WebCryptoAPI/#ecdsa

@stevencedro stevencedro added enhancement New feature or request good first issue Good for newcomers labels May 19, 2023
@stevencedro stevencedro changed the title ECDSA *sign* method implementation ECDSA implementation May 25, 2023
@trancee
Copy link

trancee commented Apr 6, 2024

@stevencedro did this get merged? I can't find the implementation anywhere :(

@stevencedro
Copy link
Member Author

@trancee I haven't had a chance to implement this yet. I was waiting for someone to start requesting these features due to time constraints. I'll start working on it today and comment back here when it's done.

Thanks!

@stevencedro
Copy link
Member Author

@trancee ECDSA implementation completed. I added quite a considerable amount of tests however as with any pre-release libraries, some bugs/implementation errors might slip through. If you come across anything, please raise an issue and I'll look into it.

What I'm mainly concerned with is the cross-compatibility between this library and the actual WebCrypto browser/node implementations which are the main motivations for this library (e.g. sending keys/signatures from browser client to a server written in Go ). If you're using this library to communicate with a frontend application that uses the WebCrypto API and come across any incompatibilities, do let me know also until #31 is completed.

Finally, the next ticket I'll be working on is a slight refactor in the way algorithm params are passed into the subtle functions. Monitor #29 for upcoming changes. For now, follow the example here for the current implementation, and I'll update it once #29 is completed.

Thanks and happy coding!

@trancee
Copy link

trancee commented Apr 11, 2024

@stevencedro Wow, that was quite fast work! Thank you very much for the implementation, I will try to use it within my project, and let you know if I hit any issues on the way.

One thing I have noticed is that you only use PKCS8 and JWK for exporting/importing. I prefer to use Raw (compressed) to save bytes. Is that something you would consider as well? Or should I create a PR for this?

@stevencedro
Copy link
Member Author

@trancee I added an issue #32 for the exportKey raw support. I'll get onto that after I finish #29. Do note though that it seems the WebCrypto spec states that exported ECDSA keys in raw format will only export public keys so if you wish to save your private key, according to the spec, it looks like only JWK and PKCS8 are supported. See https://www.w3.org/TR/WebCryptoAPI/#ecdsa-operations under Export Key.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants