Implementation of browser-based file encryption to resolve #10
Some considerations and caveats
The file upload is now processed on the clientside - this introduces some possible file limitations, but in my testing I was able to process files that were a few mb in size without issue and the current enforced filesize with the multer middleware seems to be around 10mb anyway.
At the very least some graceful error handling of larger files could be done and preventing uploading files that exceed a certain size could be handled in the client-side to avoid having to wait until the file reaches the server.
As suggested large file handling could be done in chunks, but this would likely require a bit of refactoring.
Despite being encrypted on the client side, this isn't as secure as it could be namely because I am using parts of the private key - it would be better to generate these securely and store them separately.
There is no configuration for the encryption of the files - it would be ideal to allow enabling/disabling encryption, some consideration was made to minimise changes and keep the standard form submission and server-side response code intact.
Implementation of browser-based file encryption to resolve #10
Some considerations and caveats