Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
officecrypto-tool
Advanced tools
officeCrypto is a library for node.js that can be used to decrypt and encrypt excel files.
officecrypto-tool is a library for js that can be used to decrypt and encrypt office(excel/ppt/word) files..
The implementation of this library refers to xlsx and xlsx-populate, especially xlsx-populate
, part of the source code reference and directly copied over.
Now it supports encryption and decryption of MS office and WPS files
, Support doc docx xls xlsx ppt pptx
decryption, support xls decryption in BIFF8 and BIFF5 formats. support docx xlsx pptx
encryption.
npm/yarn/pnpm install officecrypto-tool
const officeCrypto = require('officecrypto-tool');
const fs = require('fs').promises;
//decrypt a file with a password
(async ()=>{
const input = await fs.readFile(`pass_test.xlsx`);
const output = await officeCrypto.decrypt(input, {password: '123456'});
await fs.writeFile(`out_success.xlsx`, output);
})()
//Setting up encrypted files with passwords
(async ()=>{
const input = await fs.readFile(`test.xlsx`);
const output = officeCrypto.encrypt(input, {password: '123456'});
await fs.writeFile(`standard_out_success.xlsx`, output);
})()
//Determine whether excel file is encrypted or not, support xls and xlsx format, encrypted is true, not encrypted is false.
(async ()=>{
const input = await fs.readFile(`encrypted_test.xlsx`);
const isEncrypted = officeCrypto.isEncrypted(input);
// output: true
const input1 = await fs.readFile(`not_encrypted_test.xlsx`);
const isEncrypted1 = officeCrypto.isEncrypted(input1);
// output: false
})()
PRs are welcome!
Now that the files referenced by the test use case have been modified to submodule
dependencies, if you have not downloaded the submodule
dependencies, execute the following command:
-> tests/
1: git submodule init
2: git submodule update
Then check to see if the test_files
directory is already in the tests
directory and if all the files in it are there.
With Jest:
pnpm i
pnpm run test
FAQs
officeCrypto is a library for node.js that can be used to decrypt and encrypt excel files.
We found that officecrypto-tool demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.