Crypto in Expo app?

See original GitHub issue

šŸ› Bug Report

Hi,

I’m using crypto-js to handle AES encryption in my Expo app. Not sensitive data, but still, better be safe than sorry. Recently, I noticed that crypto-js, which was working fine, stopped working since (I guess) I upgrade to Expo 37, throwing this error:

The package at "node_modules/crypto-js/core.js" attempted to import the Node standard library module "crypto". It failed because React Native does not include the Node standard library. Read more at https://docs.expo.io/versions/latest/introduction/faq/#can-i-use-nodejs-packages-with-expo
Failed building JavaScript bundle.

Any idea how I can keep using an AES encryption in Expo?

Environment

Expo CLI 3.18.6 environment info:
  System:
    OS: macOS 10.15.4
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.7.0 - ~/.nvm/versions/node/v12.7.0/bin/node
    Yarn: 1.17.3 - /usr/local/bin/yarn
    npm: 6.14.4 - ~/.nvm/versions/node/v12.7.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.5900203
    Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
  npmPackages:
    expo: ^37.0.7 => 37.0.7 
    react: 16.9.0 => 16.9.0 
    react-native: https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz => 0.61.4 
    react-navigation: ^4.0.10 => 4.3.8 
  npmGlobalPackages:
    expo-cli: 3.18.6

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
josh-greecommented, Sep 7, 2021

Anybody got any updates on this? Can’t seem to find any packages for doing RSA encryption that work with managed expo? Do I need to move to bare workflow in order to do it?

1reaction
enguerranwscommented, May 12, 2020

Thanks @brentvatne for looking into this! I’ll open an issue on crypto-js repo. Meanwhile, I’ll downgrade the package in my package.json.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crypto - Expo Documentation
expo -crypto enables you to hash data in an equivalent manner to the Node.js core crypto API. Platform Compatibility. Android DeviceĀ ...
Read more >
expo-crypto - npm
Expo universal module for crypto. Latest version: 12.0.0, last published: 2 months ago. Start using expo-crypto in your project by runningĀ ...
Read more >
Crypto API | Voters - Expo - Canny
Crypto API | Voters | Expo. Crypto module from nodejs is essential to make cryptocurrency wallet. I wanted to use this library which...
Read more >
Build a Crypto Price Tracker App with REACT NATIVE (Expo ...
Crypto Price Tracker App - Turning our Figma design into a React Native app ! What you'll learn: using expo to create a...
Read more >
expo-crypto examples - CodeSandbox
Learn how to use expo-crypto by viewing and forking example apps that make use of expo-crypto on CodeSandbox. ; coinbase-app ; yonahforst/trackandtrace ;...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found