![]() |
|
#1
|
||||
|
||||
|
How the private key of WinRAR ECC is deduced
It seems that the author of WinRAR made a big mistake. He passed a zero-length seed to his home-made Key Derivation Function (KDF) to get the ECC private key. LOL
https://github.com/bitcookies/winrar-keygen/blob/master/README.HOW_DOES_IT_WORK.md And SeVeN/FFF incidentally found this 17 years ago? Not sure. But that KDF GeneratePrivateKey() is called twice when generating license key. The first call is GeneratePrivateKey(userName, strlen(userName)). Maybe SeVeN was inspired by those 2 calls. private key: k = 0x59fe6abcca90bdb95f0105271fa85fb9f11f467450c1ae9044b7fd61d65e = GeneratePrivateKey(NULL, 0); Code:
static BigInteger GeneratePrivateKey(const void* lpSeed, size_t cbSeed) {
uint32_t Generator[6];
uint16_t RawPrivateKey[15] = {};
if (cbSeed) {
Hasher Sha1(HasherSha1Traits{}, lpSeed, cbSeed);
HasherSha1Traits::DigestType Sha1Digest;
Sha1Digest = Sha1.Evaluate();
for (unsigned i = 0; i < 5; ++i) {
Generator[i + 1] = _byteswap_ulong(reinterpret_cast<uint32_t*>(Sha1Digest.Bytes)[i]);
}
} else {
Generator[1] = 0xeb3eb781;
Generator[2] = 0x50265329;
Generator[3] = 0xdc5ef4a3;
Generator[4] = 0x6847b9d5;
Generator[5] = 0xcde43b4c;
}
for (uint32_t i = 0; i < 15; ++i) {
Hasher Sha1(HasherSha1Traits{});
HasherSha1Traits::DigestType Sha1Digest;
Generator[0] = i + 1;
Sha1.Update(Generator, sizeof(Generator));
Sha1Digest = Sha1.Evaluate();
RawPrivateKey[i] = static_cast<uint16_t>(
_byteswap_ulong(reinterpret_cast<uint32_t*>(Sha1Digest.Bytes)[0])
);
}
// `Order` has 241 bits, while `RawPrivateKey` has (15 * 16 = 240) bits at most
// So `RawPrivateKey` must be less than `Order` which means `RawPrivateKey` must be valid private key.
return BigInteger(false, RawPrivateKey, sizeof(RawPrivateKey), true);
}
Quote:
__________________
AKA Solomon/blowfish. Last edited by WhoCares; 03-06-2026 at 09:42. |
| The Following 5 Users Say Thank You to WhoCares For This Useful Post: | ||
emo (03-06-2026), niculaita (03-05-2026), ontryit (03-06-2026), tonyweb (03-08-2026), wx69wx2023 (03-10-2026) | ||
![]() |
| Thread Tools | |
| Display Modes | |
|
|