backups: add backup multiple targets
This commit is contained in:
15
src/hush.js
15
src/hush.js
@@ -152,10 +152,25 @@ function decryptFilePath(filePath, encryption) {
|
||||
return { result: decryptedParts.join('/') };
|
||||
}
|
||||
|
||||
// this function is used in migrations - 20200512172301-settings-backup-encryption.js
|
||||
function generateEncryptionKeysSync(password) {
|
||||
assert.strictEqual(typeof password, 'string');
|
||||
|
||||
const aesKeys = crypto.scryptSync(password, Buffer.from('CLOUDRONSCRYPTSALT', 'utf8'), 128);
|
||||
return {
|
||||
dataKey: aesKeys.subarray(0, 32).toString('hex'),
|
||||
dataHmacKey: aesKeys.subarray(32, 64).toString('hex'),
|
||||
filenameKey: aesKeys.subarray(64, 96).toString('hex'),
|
||||
filenameHmacKey: aesKeys.subarray(96).toString('hex')
|
||||
};
|
||||
}
|
||||
|
||||
exports = module.exports = {
|
||||
EncryptStream,
|
||||
DecryptStream,
|
||||
|
||||
encryptFilePath,
|
||||
decryptFilePath,
|
||||
|
||||
generateEncryptionKeysSync,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user