It's not possible to use NodeJS-specific modules in Cordova, because Cordova is just a packaging tool that provides a WebView into which your application content is loaded. I would encourage you to investigate using the features that already exist in the WebView when possible, instead of trying to implement plugins.
In your case, the WebCrypto API might be sufficient: https://www.w3.org/TR/WebCryptoAPI/ It is supported in both iOS and Android WebViews. ~Darryl On Sat, Aug 24, 2019 at 2:39 PM James Marshall <jmarshall....@gmail.com> wrote: > > Hello, > > I'm writing a large cross-platform mobile app, and Cordova is just about > ideal for what I need-- uses WebView (my app needs to use HTML templates, > JS expertise is easy to find), open source, and controlled by a non-profit > rather than a corporation (yes, I need this). So I was happy to find > Cordova. > > I just discovered that Cordova doesn't support the NodeJS "crypto" module, > and I need to use extensive encryption. Are there any plans to support > it? Failing that, is there any work happening on a general crypto plugin > for Cordova? I've searched a lot but couldn't find any; some use > encryption but typically only for one specific purpose. > > If not, I'd like to start such a plugin. If there is already such an > effort, I can contribute to it. Does anyone know the current status of > crypto in Cordova? I searched the mailing list archives for "crypto" but > didn't find anything. > > If I write a plugin, it would start with just Android (I don't know > Objective C yet), and the specific features I need: encryption/decryption, > both symmetric and asymmetric, sign/verify, key pair generation, and > hashes. However, I would start it with a structure that could be filled in > with the other features, and with iOS and other support. > > As I understand it, writing a plugin just means creating a unified JS API, > plus wrapper code to each of the native encryption APIs, right? > > Thanks for any guidance! > > James --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org