【问题标题】:Is Strawberry Perl safe?草莓 Perl 安全吗?
【发布时间】:2018-07-24 18:59:01
【问题描述】:

Strawberry Perl 在其download page 中列出了 SHA1 摘要。

但是,查看archive.org 上的下载页面快照,他们的SHA1 摘要对于相同的perl 版本和构建似乎会随着时间而改变。

示例:在download page snapshot from 2013-05-10 中,strawberry-perl-5.16.3.1-32bit-portable.zip 显示为 86.8 MB 长,SHA1 摘要为 3b9c4c32bf29e141329c3be417d9c425a7f6c2ff。

download page snapshot from 2017-02-14 中,相同的 strawberry-perl-5.16.3.1-32bit-portable.zip 显示为 87.3 MB 长,SHA1 摘要为 7f6da2c3e1b7a808f27969976777f47a7a7c6544。

current download page 上,同样的 strawberry-perl-5.16.3.1-32bit-portable.zip 显示为 91.0 MB 长,SHA1 摘要为 00ba29e351e2f74a7dbceaad5d9bc20159dd7003

我认为他们可能出于某种原因重新编译了该软件包,但当前的 strawberry-perl-5.10.0.6-portable.zip 只有一个文件的日期晚于 2009 年(它是 portable .perl),所以这并不能解释为什么存档会随着时间的推移而增长。遗憾的是,我没有旧的 zip 文件,所以我无法知道存档中发生了什么变化。

这里发生了什么?为什么过去的构建会随着时间而改变?我有点担心一些黑客可能会在二进制 perl 包中注入恶意代码或其他东西......

这里有合理的解释吗?谢谢...

【问题讨论】:

  • Re "所以这并不能解释为什么存档会随着时间的推移而增长",当然可以。这意味着必须部分或全部重新创建存档。不同的压缩机将导致不同的尺寸。与从头开始重新创建存档相比,修改存档的空间效率可能更低。唯一的谜团是为什么他们没有增加版本号。无论如何,它都是开源的,所以请随意将分发中的文件与它们的原始文件进行比较

标签: perl security sha1


【解决方案1】:

诸如 SHA1 摘要之类的哈希可以很好地防止通信错误,即确保您下载的内容的完整性(基本上证明:“硬盘上的文件”=“网络服务器上的文件”),但只是通过本身无助于确保身份验证。

为此,应使用某些 PGP 签名或使用 X.509 证书对文件进行签名。这是您可以验证文件确实是由真正的预期作者制作的唯一方法。

因此,就其本身而言,您的观察既不会发出攻击信号,也不会帮助您防御攻击。

就像@ikegami 所说,您甚至可以配置具有不同 RAM/时间比率的压缩器,并且相同的开启会产生不同的结果。

参见例如 Unix zip:

   -Z cm
   --compression-method cm
          Set the default compression method.  Currently the main methods supported by zip are store and deflate.  Compression method can be set to:

          store - Setting the compression method to store forces zip to store entries with no compression.  This is generally faster than compressing entries, but results in no space savings.  This is the same as using -0 (compression level zero).

          deflate - This is the default method for zip.  If zip determines that storing is better than deflation, the entry will be stored instead.

          bzip2 - If bzip2 support is compiled in, this compression method also becomes available.  Only some modern unzips currently support the bzip2 compression method, so test the unzip you will be using before relying on archives using this method (compression method 12).

   -#
   (-0, -1, -2, -3, -4, -5, -6, -7, -8, -9)
          Regulate the speed of compression using the specified digit #, where -0 indicates no compression (store all files), -1 indicates the fastest compression speed (less compression) and -9 indicates the slowest compression speed (optimal compression, ignores the suffix list). The default compression level is -6.

          Though still being worked, the intention is this setting will control compression speed for all compression methods.  Currently only deflation is controlled.

当网站重新生成时,相同的源代码可能会随着时间的推移而重新压缩。所以内容相同,但归档结果不同。

我已经下载了所有三个文件。事实上,它们的大小完全相同(或者 WayBack 机器没有正确存储它们,它不进行重定向),并且实际上都具有 00ba29e351e2f74a7dbceaad5d9bc20159dd7003 的 SHA1 哈希。

您最好的选择可能是直接询问 StrawberryPerl 组织。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-11-20
    • 2021-11-25
    • 1970-01-01
    • 2021-01-02
    • 2011-12-14
    • 2012-05-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多