在Linux和Windows 8上加密工作和解密也已完成,但与原始文件相比,文件损坏程度较小。
在Windows 10上它可以工作:
var encryptor = require('file-encryptor')
var key = '123';
var options = { algorithm: 'aes256' };
encryptor.encryptFile('project/assets/MIHQM16FMSQ811TS2111.mp4', 'project/assets/MIHQM16FMSQ811TS2111Encrypted.dat', key, function(err) {
});
encryptor.decryptFile('project/assets/MIHQM16FMSQ811TS2111Encrypted.dat', 'project/assets/MIHQM16FMSQ811TS2111Decrypted.mp4', key, function(err) {
console.log('Decryption complete');
});