|
WEAK DIGITAL SIGNATURE
The weak digital signature is a digital signature using Microsoft CryptoAPI. It is an implimentation of the RSASSA-PKCS1-v1_5
digital signature protocol, using the MD5 hashing algorithm and a 512-bit (weak) RSA key (for more information about this
protocol, see the RSA Labs PKCS1 specification). The public key and exponent are stored in a resource in Storm. The signature
is stored uncompressed, unencrypted in the file "(signature)" in the archive. The archive is hashed from the beginning of the
archive (ArchiveOffset in the containing file) to the end of the archive (the length indicated by ArchiveSize); the signature
file is added to the archive before signing, and the space occupied by the file is considered to be all binary 0s during
signing/verification. This file is structured as follows:
00h: int32 Unknown : Must be 0.
04h: int32 Unknown : must be 0.
08h: int512 Signature : The digital signature. Like all other numbers in the MoPaQ format, this is stored in little-endian order.
STRONG DIGITAL SIGNATURE
The strong digital signature uses a simple proprietary implementation of RSA signing, using the SHA-1 hashing algorithm and
a 2048-bit (strong) RSA key. The default public key and exponent are stored in Storm, but other keys may be used as well.
The strong digital signature is stored immediately after the archive, in the containing file; the entire archive (ArchiveSize
bytes, starting at ArchiveOffset in the containing file) is hashed as a single block. The signature has the following format:
00h: char(4) Magic : Indicates the presence of a digital signature. Must be "NGIS" ("SIGN" backwards).
04h: int2048 Signature : The digital signature, stored in little-endian format.
When the Signature field is decrypted with the public key and exponent, and the result stored in little-endian order, it is structured as follows:
00h: byte Padding : Must be 0Bh.
01h: byte(235) Padding : Must be BBh.
ECh: byte(20) SHA-1 : SHA-1 hash of the archive, in standard SHA-1 format. 我使用软件做了蹩足的翻译意思说MPQ的数字签名有两个签名,一个是比较弱的数字签名,还有一个强壮的数字签名。
弱数字签名:
使用微软的CryptoAPI,它通过RSASSA-PKCS1-v1_5来实现。
数字签名协议,使用MD5散列算法和一个512位(弱在这里)的RSA密钥(有关此方面的信息参见RSA Labs PKCS1 specification),公钥和它的解释被放在Strom的资源中。数字签名不被压缩地使用 "(signature)"作为文件名放到MPQ包,它对MPQ包的从MPQ包开始位置到结束位置的所有数据进行签名。最后签名文件放到MPQ的header前面。所以它在文件中占据的存储空间会被过滤掉。
签名数据的组织结构:
00h: int32 Unknown : Must be 0.
04h: int32 Unknown : must be 0.
08h: int512 Signature : little-endian逆字节序的存放格式.
强数字签名:
强数字签名使用RSA算法来做简单的加密。它使用SHA-1散列算法和1个2048位(强在这里)的RSA密钥。默认的公钥和它的解释被放在Strom的资源中,但是其他的公钥似乎也能很好的被使用(译者注:说明作者很可能亲自试验过)。
强数字签名被附加到MPQ文件的末尾,使用'NGIS'作为标志。因为是使用逆字节序所以它们原本是'SIGN',整个MPQ包(从MPQheader开头)使用一个确定的block密钥来散列。
签名数据的组织结构:
00h: byte Padding : Must be 0Bh.
01h: byte(235) Padding : Must be BBh.
ECh: byte(20) SHA-1 : 标准的SHA-1格式. 上面的翻译看不懂很正常因为我也不懂。
但是能够猜测出签名过程:
首先用散列算法(摘要算法)对需要签名的数据进行加密。得到数据摘要。
然后使用RSA签名算法对数据摘要加密成签名数据并附加到MPQ文件中。
整个签名和验证过程都不会使用到RSA密钥,仅需要公钥。
但是我搞不懂被签名的数据的范围(翻译中说的范围可能是错的)。
root / Public RSA Keys
root / Public RSA Keys / Blizzard Weak.pem
View revision: Revision 73, 182 bytes (checked in by bahamut, 3 months ago)
- Known Blizzard public RSA keys in OpenSSL-compatible PEM format.
- signaturecheck can now be (is now) built using the Xcode project.
Line
1 -----BEGIN PUBLIC KEY-----
2 MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJJidwS/uILMBSO5DLGsBFknIXWWjQJe
3 2kfdfEk3G/j66w4KkhZ1V61Rt4zLaMVCYpDun7FLwRjkMDSepO1q2DcCAwEAAQ==
4 -----END PUBLIC KEY-----
root / Public RSA Keys / Warcraft 3 Map.pem
View revision: Revision 73, 451 bytes (checked in by bahamut, 3 months ago)
- Known Blizzard public RSA keys in OpenSSL-compatible PEM format.
- signaturecheck can now be (is now) built using the Xcode project.
Line
1 -----BEGIN PUBLIC KEY-----
2 MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1BwklUUQ3UvjizOBRoF5
3 yyOVc7KD+oGOQH5i6eUk1yfs0luCC70kNucNrfqhmviywVtahRse1JtXCPrx2bd3
4 iN8Dx91fbkxjYIOGTsjYoHKTp0BbaFkJih776fcHgnFSb+7mJcDuJVvJOXxEH6w0
5 1vo6VtujCqj1arqbyoal+xtAaczF3us5cOEp45sR1zAWTn1+7omN7VWV4QqJPaDS
6 gBSESc0l1grO0i1VUSumayk7yBKIkb+LBvcG6WnYZHCi7VdLmaxER5m8oZfER66b
7 heHoiSQIZf9PAY6Guw2DT5BTc54j/AaLQAKf2qcRSgQLVo5kQaddF3rCpsXoB/74
8 6QIDAQAB
9 -----END PUBLIC KEY-----
root / Public RSA Keys / Blizzard Strong.pem
View revision: Revision 73, 451 bytes (checked in by bahamut, 3 months ago)
- Known Blizzard public RSA keys in OpenSSL-compatible PEM format.
- signaturecheck can now be (is now) built using the Xcode project.
Line
1 -----BEGIN PUBLIC KEY-----
2 MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsQZ+ziT2h8h+J/iMQpgd
3 tH1HaJzOBE3agjU4yMPcrixaPOZoA4t8bwfey7qczfWywocYo3pleytFF+IuD4HD
4 Fl9OXN1SFyupSgMx1EGZlgbFAomnbq9MQJyMqQtMhRAjFgg4TndS7YNb+JMSAEKp
5 kXNqY28n/EVBHD5TsMuVCL579gIenbr61dI92DDEdy790IzIG0VKWLh/KOTcTJfm
6 Ds/7HQTkGouVW+WUsfekuqNQo7ND9DBnhLjLjptxeFE2AZqYcA1ao3S9LN3GL1tW
7 lVXFIX9c7fWqaVTQlZ2oNsI/ARVApOK3grNgqvwH6YoVYVXjNJEo5sQJsPsdV/hk
8 dwIDAQAB
9 -----END PUBLIC KEY-----
|
|