/[gentoo]/xml/htdocs/proj/en/glep/glep-0059.txt
Gentoo

Diff of /xml/htdocs/proj/en/glep/glep-0059.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.3 Revision 1.5
1GLEP: 59 1GLEP: 59
2Title: Manifest2 hash policies and security implications 2Title: Manifest2 hash policies and security implications
3Version: $Revision: 1.3 $ 3Version: $Revision: 1.5 $
4Last-Modified: $Date: 2008/10/28 07:45:44 $ 4Last-Modified: $Date: 2010/01/31 07:55:45 $
5Author: Robin Hugh Johnson <robbat2@gentoo.org>, 5Author: Robin Hugh Johnson <robbat2@gentoo.org>,
6Status: Draft 6Status: Draft
7Type: Standards Track 7Type: Standards Track
8Content-Type: text/x-rst 8Content-Type: text/x-rst
9Requires: 44 9Requires: 44
10Created: October 2006 10Created: October 2006
11Updated: November 2007, June 2008, July 2008, October 2008 11Updated: November 2007, June 2008, July 2008, October 2008, January 2010
12Updates: 44 12Updates: 44
13Post-History: 13Post-History: December 2009, January 2010
14 14
15Abstract 15Abstract
16======== 16========
17While Manifest2 format allows multiple hashes, the question of which 17While Manifest2 format allows multiple hashes, the question of which
18checksums should be present, why, and the security implications of such 18checksums should be present, why, and the security implications of such
37The most common position (and indeed the one previously held by myself), 37The most common position (and indeed the one previously held by myself),
38is that multiple checksums would be an increase in security, but we 38is that multiple checksums would be an increase in security, but we
39could not provably quantify the amount of security this added. 39could not provably quantify the amount of security this added.
40The really bad news, is that this position is completely and utterly 40The really bad news, is that this position is completely and utterly
41wrong. Many of you will be aghast at this. There is extremely little 41wrong. Many of you will be aghast at this. There is extremely little
42added security in multiple checksums [J04]. For any set of checksums, 42added security in multiple checksums as noted by Joux [J04]. For any set
43the actual strength lies in that of the strongest checksum. 43of checksums, the actual strength lies in that of the strongest
44checksum.
45
46Wang et al [W04] extended Joux's [J04] work on SHA-0 to cover MD4, MD5,
47HAVAL-128 and RIPEMD families of hashes.
44 48
45How fast can MD5 be broken? 49How fast can MD5 be broken?
46--------------------------- 50---------------------------
47For a general collision, not a pre-image attack, since the original 51For a general collision, not a pre-image attack, since the announcement
48announcement by Wang et al [W04], the time required to break MD5 has 52by Wang et al [W04], the time required to break MD5 has been massively
49been massively reduced. Originally at 1 hour on a near-supercomputer 53reduced. Originally at 1 hour on a near-supercomputer (IBM P690) and
50(IBM P690) and estimated at 64 hours with a Pentium-3 1.7Ghz. This has 54estimated at 64 hours with a Pentium-3 1.7Ghz. This has gone down to
51gone down to less than in two years, to 17 seconds [K06a]! 55less than in two years, to 17 seconds [K06a].
52 56
5308/2004 - 1 hour, IBM pSeries 690 (32x 1.7Ghz POWER4+) = 54.4 GHz-Hours 5708/2004 - 1 hour, IBM pSeries 690 (32x 1.7Ghz POWER4+) = 54.4 GHz-Hours
5403/2005 - 8 hours, Pentium-M 1.6Ghz = 12.8 Ghz-Hours 5803/2005 - 8 hours, Pentium-M 1.6Ghz = 12.8 Ghz-Hours
5511/2005 - 5 hours, Pentium-4 1.7Ghz = 8.5 Ghz-Hours 5911/2005 - 5 hours, Pentium-4 1.7Ghz = 8.5 Ghz-Hours
5603/2006 - 1 minute, Pentium-4 3.2Ghz = .05 Ghz-Hours 6003/2006 - 1 minute, Pentium-4 3.2Ghz = .05 Ghz-Hours
59If we accept a factor of 800x as a sample of how much faster a checksum 63If we accept a factor of 800x as a sample of how much faster a checksum
60may be broken over the course of 2 years (MD5 using the above data is 64may be broken over the course of 2 years (MD5 using the above data is
61>2000x), then existing checksums do not stand a significant chance of 65>2000x), then existing checksums do not stand a significant chance of
62survival in the future. We should thus accept that whatever checksums we 66survival in the future. We should thus accept that whatever checksums we
63are using today, will be broken in the near future, and plan as best as 67are using today, will be broken in the near future, and plan as best as
64possible. (A brief review [H04] of the present SHA1 attacks indicates an 68possible. (A brief review [H04] of the SHA1 attacks indicates an
65improvement of ~600x in the same timespan). 69improvement of ~600x in the same timespan).
66 70
67And for those that claim implementation of these procedures is not yet 71And for those that claim implementation of these procedures is not yet
68feasible, see [K06b] for an application that can produce two 72feasible, see [K06b] for an application that can produce two
69self-extracting .exe files, with identical MD5s, and whatever payload 73self-extracting EXE files, with identical MD5s, and whatever payload you
70you want. 74want.
71 75
72The good news 76The good news
73------------- 77-------------
74Of the checksums presently used by Manifest2, one stands close to being 78Of the checksums presently used by Manifest2 (SHA1, SHA256, RIPEMD160),
75completely broken: SHA1. The SHA2 series has suffered some attacks, but 79one stands close to being completely broken: SHA1; and another is
76still remains reasonably solid [G07],[K08]. No attacks against RIPEMD160 80significantly weakened: RIPEMD160. The SHA2 series has suffered some
77have been published, however it is constructed in the same manner as 81attacks, but still remains reasonably solid [G07],[K08].
78MD5, SHA1 and SHA2, so is also vulnerable to the new methods of
79cryptanalysis [H04].
80 82
81To reduce the potential for future problems and any single checksum 83To reduce the potential for future problems and any single checksum
82break leading to a rapid decrease in security, we should incorporate the 84break leading to a rapid decrease in security, we should incorporate the
83strongest hash available from each family of checksums, and be prepared 85strongest hash available from each family of checksums, and be prepared
84to retire old checksums actively, unless there is a overriding reason to 86to retire old checksums actively, unless there is a overriding reason to
85keep a specific checksum. 87keep a specific checksum, such as part of a migration plan.
86 88
87What should be done 89What should be done
88------------------- 90-------------------
89Portage should always try to verify all supported hashes that are 91Portage should always try to verify all supported hashes that are
90available in a Manifest2, starting with the strongest ones as maintained 92available in a Manifest2, starting with the strongest ones as maintained
92from Manifest2 files, once all old Portage installations have had 94from Manifest2 files, once all old Portage installations have had
93sufficient time to upgrade. We should be prepared to add stronger 95sufficient time to upgrade. We should be prepared to add stronger
94checksums wherever possible, and to remove those that have been 96checksums wherever possible, and to remove those that have been
95defeated. 97defeated.
96 98
97An unsupported hash is not considered to be a failure unless no 99As soon as feasible, we should add the SHA512 and WHIRLPOOL algorithms.
98supported hashes are available. 100In future, as stream-based checksums are developed (in response to the
101development by NIST [AHS]), they should be considered and used.
99 102
100Checksum depreciation 103The SHA512 algorithm is available in Python 2.5, which has been a
101~~~~~~~~~~~~~~~~~~~~~ 104dependency of Portage since approximately Python 2.1.6.13.
102For the current Portage, SHA1 should be gradually removed, as presents
103no advantages over SHA256. Beyond one specific problem (see the next
104paragraph), we should add SHA512 (SHA2, 512 bit size), the Whirlpool
105checksum (standardized checksum, with no known weaknesses). In future,
106as stream-based checksums are developed (in response to the development
107by NIST [AHS]), they should be considered and used.
108 105
109There is one temporary stumbling block at hand - the existing Portage 106The WHIRLPOOL checksum is not available within the PyCrypto library or
110infrastructure does not support SHA384/512 or Whirlpool, thus hampering 107hashlib that is part of Python 2.5, but there are multiple alternative
111their immediate acceptance. SHA512 is available in Python 2.5, while 108Python implementations available, ranging from pure Python to C-based
112SHA1 is already available in Python 2.4. After Python2.5 is established 109(python-mhash).
113in a Gentoo media release, that would be a suitable time to remove SHA1 110
114from Manifest2 files. 111The existence unsupported hash is not considered to be a failure unless
112no supported hashes are available for a given Manifest entry.
113
114Checksum depreciation timing
115----------------------------
116For the current Portage, both SHA1 and RIPEMD160 should be immediately
117removed, as they present no advantages over the already present SHA256.
118SHA256 cannot be replaced immediately with SHA512, as existing Portage
119versions need at least one supported algorithm present (SHA256 support
120was added in June 2006), so it must be retained for some while.
121
122Immediately:
123- Add WHIRLPOOL and SHA512.
124- Remove SHA1 and RIPEMD160.
125
126After the majority of Portage installations include SHA512 support:
127- Remove SHA256.
115 128
116Backwards Compatibility 129Backwards Compatibility
117======================= 130=======================
118Old versions of Portage may support and expect only specific checksums. 131Old versions of Portage may support and expect only specific checksums.
119This is accounted for in the checksum depreciation discussion. 132This is accounted for in the checksum depreciation discussion.
172 (ferringb): for being knowledgeable about the Portage Manifest2 185 (ferringb): for being knowledgeable about the Portage Manifest2
173 codebase. 186 codebase.
174 187
175Copyright 188Copyright
176========= 189=========
177Copyright (c) 2006 by Robin Hugh Johnson. This material may be 190Copyright (c) 2006-2010 by Robin Hugh Johnson. This material may be
178distributed only subject to the terms and conditions set forth in the 191distributed only subject to the terms and conditions set forth in the
179Open Publication License, v1.0. 192Open Publication License, v1.0.
180 193
181vim: tw=72 ts=2 expandtab: 194vim: tw=72 ts=2 expandtab:

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.20