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

Is there any plans to add WebCrypto API to React-Native? #83

Closed
pedrouid opened this issue Jan 10, 2019 · 6 comments
Closed

Is there any plans to add WebCrypto API to React-Native? #83

pedrouid opened this issue Jan 10, 2019 · 6 comments
Labels
🗣 Discussion This label identifies an ongoing discussion on a subject

Comments

@pedrouid
Copy link

A lot of quick hacks and libraries try to either polyfill or build their own solutions for crypto but browsers already have a good library that is super performant for cryptography.

Is there any plans to add WebCrypto API to the React-Native environment?

@pedrouid
Copy link
Author

The most used and supported library currently is react-native-crypto but it requires rn-nodeify which is not an ideal solution and it feels like it should be built-in into react-native.

However if it was I think the API shouldn't use the NodeJS Crypto module API but the WebCrypto API which is supported by all major browsers. In my view, the react-native environment should aim to match the browser environment as much as possible and I think this would be a great addition

@axemclion
Copy link

I am not sure if it makes sense to make this a part of Web Core. Why not have a "recommended" community support library for Web Crypto ?

@pedrouid
Copy link
Author

Why not? Most APIs that are available on browsers are supported or provide alternatives. Fetch API is available. LocalStorage API is available as AsyncStorage. How is WebCrypto API different?

@kelset
Copy link
Member

kelset commented Jan 11, 2019

Relevant conversation ->
facebook/react-native#20686

cc @LinusU @TheSavior

@kelset kelset added the 🗣 Discussion This label identifies an ongoing discussion on a subject label Jan 11, 2019
@LinusU
Copy link
Member

LinusU commented Jan 11, 2019

I personally would like having WebCrypto added, even though I can see the benefit of having it in a separate module as well...

Deno is also in the process of adding it, and I really like the idea of many JavaScript runtimes that are compatible with each other.

I started working on react-native-webcrypto but it only supports Android currently...

edit: I also implemented getRandomValues() here, it's stable for both iOS and Android 🎉

@cpojer
Copy link
Member

cpojer commented Jan 21, 2019

I agree with @TheSavior and @axemclion that our current focus is to reduce the surface area instead of adding to it. @LinusU I would recommend you to build out your third-party dependency as you are doing now. Maybe eventually we could move it to react-native-community, and officially recommend it in the documentation for people who would like to use this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗣 Discussion This label identifies an ongoing discussion on a subject
Projects
None yet
Development

No branches or pull requests

5 participants