Code Monkey home page Code Monkey logo

Comments (5)

sounisi5011 avatar sounisi5011 commented on September 27, 2024 1

Thanks for your message!

Unfortunately, there is no alternative to the @sounisi5011/encrypted-archive package. The data generated by this package is in a format specific to this package. Since I designed it, there is no other implementation.

However, the data format uses unsigned varint and Protocol Buffers, so you should be able to decrypt the file without using this package. All you need is:

  • A decipher function that supports AES-GCM (256-bit) or ChaCha20-Poly1305

    You can use the Node.js built-in crypto module for this.

  • An Argon2 implementation

    This package uses argon2-browser, but argon2 is also available.


It's interesting that @sounisi5011/encrypted-archive doesn't work in React Native. I'm not familiar with React Native, but I'll try to fix it as best I can.

If possible, could you please provide the following information?

  • Version of React Native and Node.js
  • Target platform for your app - iOS, Android, etc.
  • The operating system used to build - In other words, the operating system of the computer you are using to develop.
  • Circumstances in which the problem occurs - When you build, launch an app, try to decrypt, etc.
  • Problem details - Error messages are generated, apps are force-quit, decryption always fails, etc.

from npm-packages.

mikaoelitiana avatar mikaoelitiana commented on September 27, 2024 1

Thank you for your answer @sounisi5011.

React Native does not have the same modules as nodejs, that's why compatibility is not there by default. Here are some details about my current setup :

  • react native: v0.66
  • nodejs: v16
  • os: macos 12.01

The problem happens when I try to decrypt a file, just as I import the decrypt function (the app crashes)

from npm-packages.

sounisi5011 avatar sounisi5011 commented on September 27, 2024 1

I am still aware of this issue. However, I can't fix it for now because I can't build Native Modules for React Native.

At the very least, @sounisi5011/encrypted-archive requires an Argon2 library that supports binary data input. However, the React Native-compatible Argon2 library that currently exists in npm only accepts string input. For this reason, I need to choose one of the following:

  1. create my own React Native-compatible Argon2 library
  2. send a pull request to the existing Argon2 library
  3. wait until React Native supports WebAssembly

At first, I tried 1. However, I could not build React Native on my macOS using XCode and CocoaPods. I get an unknown error, and moreover, the error is not reproducible. I could not even choose 2 because I could not build it in my local environment.

With react-native-wasm, I can solve this problem without waiting for 3. But methods like react-native-wasm use WebView. I think the way a mere encryption/decryption library calls WebView has a fatal negative impact on the performance of an app using @sounisi5011/encrypted-archive.

Writing again, I am still aware of this issue. I have not forgotten about it.
But now I'm stuck and left it.
I will keep this Issue open until it is resolved, but I don't know when I will be able to resolve it (possibly I will have to get a new Mac to use for development only).

from npm-packages.

sounisi5011 avatar sounisi5011 commented on September 27, 2024

Interim report: Currently, I'm using React Native, which I built at Expo, to conduct my research.

Since the @sounisi5011/encrypted-archive package was designed for Node.js, it depends on many built-in modules that React Native does not support. These can be solved by editing metro.config.js. However, a more serious problem was found. Support is going to take a long time.

from npm-packages.

mikaoelitiana avatar mikaoelitiana commented on September 27, 2024

Thank you for your time @sounisi5011. On my side, I try to implement a decrypt without this package as you described before.

from npm-packages.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.