Socket
Socket
Sign inDemoInstall

officecrypto-tool

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

officecrypto-tool - npm Package Compare versions

Comparing version 0.0.11 to 0.0.12

2

package.json
{
"name": "officecrypto-tool",
"version": "0.0.11",
"version": "0.0.12",
"description": "officeCrypto is a library for node.js that can be used to decrypt and encrypt excel files.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -28,13 +28,13 @@ /* eslint-disable valid-jsdoc */

*/
exports.verifyPassword = function verifyPassword(password, salt, keySize, encryptedVerifier, encryptedVerifierHash, algId = 0x00006801, block = 0) {
// https://learn.microsoft.com/en-us/openspecs/office_file_formats/ms-offcrypto/fbfe41db-ca02-413a-a3bb-609fa0b25cd3?redirectedfrom=MSDN
const key = convertPasswordToKey(password, salt, keySize, block);
const cipher = crypto.createDecipheriv('rc4', key, '');
const verifier = Buffer.concat([cipher.update(encryptedVerifier)]);
const verifierHash = Buffer.concat([cipher.update(encryptedVerifierHash), cipher.final()]);
// exports.verifyPassword = function verifyPassword(password, salt, keySize, encryptedVerifier, encryptedVerifierHash, algId = 0x00006801, block = 0) {
// // https://learn.microsoft.com/en-us/openspecs/office_file_formats/ms-offcrypto/fbfe41db-ca02-413a-a3bb-609fa0b25cd3?redirectedfrom=MSDN
// const key = convertPasswordToKey(password, salt, keySize, block);
// const cipher = crypto.createDecipheriv('rc4', key, '');
// const verifier = Buffer.concat([cipher.update(encryptedVerifier)]);
// const verifierHash = Buffer.concat([cipher.update(encryptedVerifierHash), cipher.final()]);
const hash = crypto.createHash('sha1').update(verifier).digest();
// console.log([verifierHash, hash]);
return Buffer.compare(verifierHash, hash) === 0;
};
// const hash = crypto.createHash('sha1').update(verifier).digest();
// // console.log([verifierHash, hash]);
// return Buffer.compare(verifierHash, hash) === 0;
// };

@@ -41,0 +41,0 @@ /**

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc