检查 zip 或 gzip 是否经过密码加密(Node.JS) [英] Check if zip or gzip is password encrypted (Node.JS)
问题描述
我在尝试查看 zip 或 gzip 是否有密码保护文件时遇到了麻烦.我习惯于在 .net 中使用 DotNetZip,但在 Node.js 中我似乎找不到等价物.
我可以通过检查前导字节来查看文件是 gzip 还是 zip,但不能查看它们是否包含加密文件,这可能是 gpg、传统甚至 aes.
我已经尝试使用 unzip
、unzip2
和 adm-unzip
包,但它们都没有解决我的问题.>
我正在寻找纯 node.js 实现.
此时,我只是在考虑编写自己的模块来解决我的问题.
我正在使用 https://github.com/thejoshwolfe/yauzl#isencrypted 在当前时刻,但如果其他人能找到也可以处理 pdf 和 .docx 文件的东西,那就太好了!
I've had a bad time trying to see if a zip or gzip has password protected files. I'm used to DotNetZip to seeing in .net but in Node.js I can't seem to find an equivalent.
I'm able to see if the file is a gzip or a zip by checking the lead bytes but not if they contain encrypted files, this may be by gpg, traditional or even aes.
I've tried using the packages unzip
, unzip2
and adm-unzip
but they just haven't solved my issues.
I'm looking for a pure node.js implementation.
At this point, I'm just considering writing my own module to solve my issue.
I'm using https://github.com/thejoshwolfe/yauzl#isencrypted at this current moment in time but if anyone else can find something that can also do pdf's and .docx files, that'd be great!
这篇关于检查 zip 或 gzip 是否经过密码加密(Node.JS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!