【问题标题】:Check if a compressed file is password protected检查压缩文件是否受密码保护
【发布时间】:2014-12-30 05:11:23
【问题描述】:

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

【问题讨论】:

    标签: php zip 7zip rar


    【解决方案1】:

    RAR technote中定义如下:

       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
    

    所以检查块上的那些标志。

    【讨论】:

      猜你喜欢
      • 2015-08-24
      • 2013-02-05
      • 1970-01-01
      • 1970-01-01
      • 2023-03-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-18
      相关资源
      最近更新 更多