繁体   English   中英

检查压缩文件是否受密码保护

[英]Check if a compressed file is password protected

我正在开发一个门户网站,用户可以在其中提交一些存档的样本。我需要检查这些样本是否是受密码保护的压缩文件。 我能够检测这些文件是否被压缩,但是我卡住了如何检查文件是否受密码保护。 有人可以帮忙吗? 我正在使用php。

RAR技术说明中定义了以下内容:

   Archive header ( MAIN_HEAD )

HEAD_FLAGS      Bit flags:
2 bytes
                0x0040  - Recovery record present
                0x0080  - Block headers are encrypted
                0x0100  - First volume (set only by RAR 3.0 and later)

   File header (File in archive)

HEAD_FLAGS      Bit flags:
2 bytes
                0x01 - file continued from previous volume
                0x02 - file continued in next volume
                0x04 - file encrypted with password

因此,请检查块上的那些标志。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM