officecrypto-tool
Advanced tools
Comparing version 0.0.11 to 0.0.12
{ | ||
"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 @@ /** |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
805498