Rev 1072 | Rev 1116 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1072 | Rev 1073 | ||
---|---|---|---|
Line 21... | Line 21... | ||
21 | define('TARGET_ID', '6175446'); // ViaThinkSoft RA |
21 | define('TARGET_ID', '6175446'); // ViaThinkSoft RA |
22 | 22 | ||
23 | $config = array("digest_alg" => "sha512", |
23 | $config = array("digest_alg" => "sha512", |
24 | "private_key_bits" => 2048, |
24 | "private_key_bits" => 2048, |
25 | "private_key_type" => OPENSSL_KEYTYPE_RSA, |
25 | "private_key_type" => OPENSSL_KEYTYPE_RSA, |
- | 26 | "config" => __DIR__."/../vendor/phpseclib/phpseclib/phpseclib/openssl.cnf", |
|
26 | ); |
27 | ); |
27 | 28 | ||
28 | # --- |
29 | # --- |
29 | 30 | ||
30 | $cnt = 0; |
31 | $cnt = 0; |
Line 42... | Line 43... | ||
42 | unset($details); |
43 | unset($details); |
43 | 44 | ||
44 | $system_id = smallhash(base64_decode($pubKey)); |
45 | $system_id = smallhash(base64_decode($pubKey)); |
45 | 46 | ||
46 | if ($system_id == TARGET_ID) { |
47 | if ($system_id == TARGET_ID) { |
47 | openssl_pkey_export($res, $privKey); |
48 | openssl_pkey_export($res, $privKey, null, $config); |
48 | echo date('Y-m-d H:i:s')." COLLISSION WITH $system_id AFTER $cnt TRIES: ".$pubKey." / ".$privKey."\n"; |
49 | echo date('Y-m-d H:i:s')." COLLISSION WITH $system_id AFTER $cnt TRIES: ".$pubKey." / ".$privKey."\n"; |
49 | unset($privKey); |
50 | unset($privKey); |
50 | } |
51 | } |
51 | 52 | ||
52 | unset($res); |
53 | unset($res); |
53 | 54 | ||
54 | if ($cnt%25 == 0) echo "PROCESSING: $cnt \r"; |
55 | if ($cnt%25 == 0) echo "PROCESSING: $cnt \r"; |
55 | } |
56 | } |
56 | 57 | ||
57 | function smallhash($data) { // get 31 bits from SHA1. Values 0..2147483647 |
58 | function smallhash($data) { // get 31 bits from SHA1. Values 0..2147483647 |
58 | return (hexdec(substr(sha1($data),-4*2)) & 2147483647); |
59 | return (hexdec(substr(sha1($data),-4*2)) & 0x7FFFFFFF); |
59 | } |
60 | } |
60 | 61 |