csquared / fernet.js

Javascript implementation of Fernet symmetric encryption https://github.com/kr/fernet-spec
MIT License
73 stars 29 forks source link

Use with Node streams #21

Open jemc opened 3 years ago

jemc commented 3 years ago

I have a project where I want to encrypt a streaming input to a streaming output, without having to hold the entire large buffer in memory at any given time. I noticed that this fernet library does not seem to support this currently (though please correct me if I am wrong on this).

I plan to hack together a solution that uses this library as much as possible, but does support streaming encryption. If I do so, are you interested in considering such a feature for merging back into the main library?

If so, I can try to put together a pull request for it. If not, I'll save my time and just get my own application working.

mraleson commented 1 year ago

For anyone looking for something similar. I just hacked together a decrypt function in Node. It could easily changed Node crypto's streams. Here is the untested node decrypt code..

Here is the documentation for Node cryptos streams. I used their non streams update/finalize functions but it would be easy to change that.