dhairya0907 / react-native-encryption

Encryption/Decryption for React Native
https://www.npmjs.com/package/@dhairyasharma/react-native-encryption
MIT License
7 stars 3 forks source link

why returning iv and salt after file encryption #6

Closed ngdph closed 1 year ago

ngdph commented 1 year ago

I'm doing an app that encrypts and decrypts files. The problem is the returned iv and salt are needed for decryption and in that case I have to store those both iv and salt with the key. Why not let us pass the iv and salt ourselves to the encryption? Those two parameters we can generate and pass them to the encrypt function, we just need to store only the key ourselves.

dhairya0907 commented 1 year ago

The same iv and salt that you generate during encryption must be stored for use during decryption, so why not use the same iv and salt generated by the module?

dhairya0907 commented 1 year ago

Closing as no update.