I've created a simple nodejs app that will use express to do some file processing operations. I will pack the final app using pkg this mean that the app will access the packaged resources in readonly mode. Since I want to implement a login system and a one time account creation, what's the best way to proceed? The app will open a browser tab that will run the a vuejs app for the UI. I'm thinking to use nedb-promises by implementing it in the vue app but the data stored inside it are accessible to all so the login will become insecure. Is there a way to encrypt/decrypt stored data inside nedb-promises?
Another solution I'm thinking to use is to run the one time account creation and to store the created account info inside a .env file that will be created inside the folder where te app will run. With this method how I can hash password and account data and when the app is launched check them with the credential that the user will input?
NeDB have two functions called
beforeDeserializationandafterSerialization. These can be used for encrypting and decrypting data when reading and writing from your database using thecryptomodule.You would want to your
SECRETvariable to be a random generated string stored in a.envfile