
Product
A Fresh Look for the Socket Dashboard
We’ve redesigned the Socket dashboard with simpler navigation, less visual clutter, and a cleaner UI that highlights what really matters.
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 1,451 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.
Product
We’ve redesigned the Socket dashboard with simpler navigation, less visual clutter, and a cleaner UI that highlights what really matters.
Industry Insights
Terry O’Daniel, Head of Security at Amplitude, shares insights on building high-impact security teams, aligning with engineering, and why AI gives defenders a fighting chance.
Security News
MCP spec updated with structured tool output, stronger OAuth 2.1 security, resource indicators, and protocol cleanups for safer, more reliable AI workflows.