
Security News
Opengrep Adds Apex Support and New Rule Controls in Latest Updates
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
file-encryptor
Advanced tools
Encrypts files using Node's built-in Cipher class. Encryption is stream-based for low memory footprint.
Install the module:
npm install file-encryptor
Use it in your script:
var encryptor = require('file-encryptor');
var key = 'My Super Secret Key';
// Encrypt file.
encryptor.encryptFile('input_file.txt', 'encrypted.dat', key, function(err) {
// Encryption complete.
});
...
// Decrypt file.
encryptor.decryptFile('encrypted.dat', 'output_file.txt', key, function(err) {
// Decryption complete.
});
The input file will be streamed through the Cipher and to the output file. If the output files does not exists, it will be created. If the output file already exists, it will be truncated.
By default the "aes192" cipher algorithm is used. This can be changed by passing a new algorithm string as an option.
Available algorithms can be found by executing:
openssl list-cipher-algorithms
Setting algorithm option:
var key = 'My Super Secret Key';
var options = { algorithm: 'aes256' };
encryptor.encryptFile('input_file.txt', 'encrypted.dat', key, options, function(err) {
// Decryption complete;
});
...
encryptor.decryptFile('encrypted.dat', 'outputfile.txt', key, options, function(err) {
// Encryption complete;
});
Copyright (c) 2013 Modulus Licensed under the MIT license.
FAQs
Encrypts files using Node's built-in Cipher class.
The npm package file-encryptor receives a total of 2,670 weekly downloads. As such, file-encryptor popularity was classified as popular.
We found that file-encryptor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.