We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to encrypt data when writing the dump to the file?
The text was updated successfully, but these errors were encountered:
Sure, but that would have to be handled by another stream. I can't personally recommend any specific approach, but I did find the following article interesting on the topic. https://medium.com/@brandonstilson/lets-encrypt-files-with-node-85037bea8c0e
Sorry, something went wrong.
I am not sure this is a right implementation but as a node implementation example u can you use this.
` const initVect = crypto.randomBytes(16);
const backup = async () => {
const algorithm = 'aes256'; const password = 'd6F3Efeq'; // zip content const zip = zlib.createGzip(); // encrypt content const encrypt = crypto.createCipheriv(algorithm, password, initVect); // write file const w = fs.createWriteStream('backup.txt'); zip.pipe(encrypt).pipe(w); await db.dump(zip, options);
}; `
` const restore = async () => {
const algorithm = 'aes256; const password = 'd6F3Efeq'; // zip content const unzip = zlib.createGunzip(); // encrypt content const decrypt = crypto.createDecipheriv(algorithm, password, initVect); // write file const r = fs.createReadStream('backup.txt'); r.pipe(decrypt).pipe(unzip); await db.load(unzip);
No branches or pull requests
Is it possible to encrypt data when writing the dump to the file?
The text was updated successfully, but these errors were encountered: