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

Request for Component: Web Cryptography API #1

Open
ebekker opened this issue Jun 10, 2018 · 9 comments
Open

Request for Component: Web Cryptography API #1

ebekker opened this issue Jun 10, 2018 · 9 comments
Assignees

Comments

@ebekker
Copy link

ebekker commented Jun 10, 2018

I propose developing a component that will map to the Cryptographic functions found in browsers.

The Web Cryptography API is exposed through the Crypto.subtle property and enjoys a good bit of compatibility across browsers.

@galvesribeiro
Copy link
Member

Hi @ebekker, thanks for reaching us.

Do you have any specific use-case for it?

Also, do you want us to implement it or do you plan to do it yourself or bring an existent codebase?

Thanks

@ebekker
Copy link
Author

ebekker commented Jul 12, 2018

I would be willing to contribute or even startup the project, based on the patterns you have used in your other API mappings.

I'm exploring the use of crypto in the browser to develop a sample application that supports getting PKI certs from Let's Encrypt through the use of my ACMESharpCore client library.

Right now I'm playing around with a sample Blazor app that's actually using BouncyCastle primitives. So far working, but might be nice to later swap this out to call into the Browser's own crypto implementation from a performance context.

@galvesribeiro
Copy link
Member

Nice! I'm in a really busy days recently so I can't commit now to implement it myself.

The next thing on line that should be out soon is the SignalR client.

Do you want me to create a repo for you in the Org so you can make PRs there?

@ebekker
Copy link
Author

ebekker commented Jul 12, 2018

Let me see if I can throw something together on my side over the next few days before I commit to that. If I can at least start the ground work and get a few working APIs like hashing, then we can startup an official repo. Thanks!

@galvesribeiro
Copy link
Member

Hello @ebekker

Any news on that?

Thanks!

@ebekker
Copy link
Author

ebekker commented Nov 9, 2018

Hello @galvesribeiro, I've been sleeping on it... :-)

Actually, so sorry for the long nap, had to put this on the back-burner for along time, but I've actually started to work on this a bit as part of another another experiment.

I started to map the WebCrypto API into what I think is a usable form, but the approach to crypto is a bit different than the way it's available in the BCL, so working on how to make it user friendly.

@galvesribeiro
Copy link
Member

Hey! No problem, was just following up...

So, I've briefly looked the crypto IDL and even thought it is big, it doesn't seems very complex.

The only problem with it, which was actually found on BE.SignalR and BE.WebUSB, is the lack of Uint8Array proper serializer on Mono/Blazor and that may cause perf issues on big byte[] marshalling.

We have a workaround on both packages that works, not ideal, but works.

Let me know if you need any help.

Thanks!

@ebekker
Copy link
Author

ebekker commented Nov 9, 2018

I'll check out what you have there, what I've been doing is simply converting byte[] by constructing Uint8Array on the JS side for inputs of byte arrays, and converting from ArrayBuffer (Uint8Array) back out to byte arrays using Array.from(), but that may not be the most efficient as you say, for large data sets.

@ebekker
Copy link
Author

ebekker commented Nov 9, 2018

Ah, I see that's the same thing you did in those cases as well. Oh well, I guess that's the best we can do for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants