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

Performance Metrics for Cryptographic Operations in React Native #230

Open
GitMark0 opened this issue Feb 6, 2024 · 1 comment
Open

Comments

@GitMark0
Copy link

GitMark0 commented Feb 6, 2024

Environment

  • React Native Quick Crypto Version: 0.6.1
  • Paillier-BigInt Version: 3.4.3
  • React Version: 18.2.0
  • React Native Version: 0.73.3
  • Expo Version: ~50.0.6
  • Platform: iOS

Description

I am utilizing react-native-quick-crypto for cryptographic operations in a React Native project, specifically working with paillier-bigint for encryption and decryption. I have observed the following performance metrics:

  • Encryption Time: Approximately 3.3 seconds for 2048-bit keys
  • Decryption Time: Approximately 2 seconds for 2048-bit keys

In contrast, when testing paillier-bigint in a Node.js environment (without react-native-quick-crypto), the execution times were significantly lower:

  • Encryption Time: 35 ms
  • Decryption Time: 25 ms

Questions

  1. Are the execution times observed in the React Native environment typical for cryptographic operations with react-native-quick-crypto?
  2. Given the stark difference in performance compared to a Node.js environment, could there be any potential optimizations, configurations, or issues affecting react-native-quick-crypto performance?

Steps to Reproduce

  1. Configure react-native-quick-crypto following the official documentation.
  2. Implement encryption and decryption using paillier-bigint.
  3. Measure the execution time for these operations in both React Native (with react-native-quick-crypto) and a standalone Node.js environment.

I am seeking guidance on whether the observed performance in the React Native environment is expected, and if not, any recommendations for improving these execution times would be greatly appreciated.

Thanks!

@shamilovtim
Copy link
Contributor

I would suggest running RN dev tools + benchmarking and see which functions are taking the most time. You'll have to find a guide on how to do it. That way you can make an informed decision as to what's causing this. Generally I doubt it's this lib, since this lib just exposes openSSL and binds to it from the JS engine.

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

No branches or pull requests

2 participants