|
|
|
@ -53,9 +53,9 @@
|
|
|
|
|
<h5><a class="anchor" href="#1-client-sends-query-to-server" id="1-client-sends-query-to-server" name="1-client-sends-query-to-server"><i class="anchor-icon"></i></a>1) Client sends query to server</h5>
|
|
|
|
|
<!-- start req_pq_multi -->
|
|
|
|
|
<p>Sent payload (excluding transport headers/trailers):</p>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 7C 81 07 00 81 68 AE 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 81 BA A8 90 1B 79 63 A6
|
|
|
|
|
0020 | 9A 8E 8B EB C1 05 93 FD</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 B0 24 08 00 BE 72 AE 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 59 61 46 10 15 D1 2F 9A
|
|
|
|
|
0020 | 72 99 59 CC 38 A8 12 1E</code></pre>
|
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
|
<pre><code>req_pq_multi#be7e8ef1 nonce:int128 = ResPQ;</code></pre>
|
|
|
|
|
<table class="table">
|
|
|
|
@ -77,7 +77,7 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>7C8107008168AE66</code></td>
|
|
|
|
|
<td><code>B0240800BE72AE66</code></td>
|
|
|
|
|
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -95,7 +95,7 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>81BAA8901B7963A69A8E8BEBC10593FD</code></td>
|
|
|
|
|
<td><code>5961461015D12F9A729959CC38A8121E</code></td>
|
|
|
|
|
<td>Random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -104,11 +104,11 @@
|
|
|
|
|
<h5><a class="anchor" href="#2-server-sends-response-of-the-form" id="2-server-sends-response-of-the-form" name="2-server-sends-response-of-the-form"><i class="anchor-icon"></i></a>2) Server sends response of the form</h5>
|
|
|
|
|
<!-- start resPQ -->
|
|
|
|
|
<p>Received payload (excluding transport headers/trailers):</p>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 B4 68 3C 81 68 AE 66
|
|
|
|
|
0010 | B4 00 00 00 63 24 16 05 81 BA A8 90 1B 79 63 A6
|
|
|
|
|
0020 | 9A 8E 8B EB C1 05 93 FD 9C FC EE B6 10 AF F6 64
|
|
|
|
|
0030 | 73 95 1E A6 F9 78 4C F9 08 31 12 2C 48 EB 28 59
|
|
|
|
|
0040 | 5B 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 64 FE D1 BE 72 AE 66
|
|
|
|
|
0010 | A8 00 00 00 63 24 16 05 59 61 46 10 15 D1 2F 9A
|
|
|
|
|
0020 | 72 99 59 CC 38 A8 12 1E 3A 55 D0 19 2D C6 6C 12
|
|
|
|
|
0030 | 8C 5C 5E C5 C4 F0 25 B1 08 1E 53 D7 AD FD 5A F2
|
|
|
|
|
0040 | 73 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
|
|
|
|
|
0050 | 35 5F C3 0B 21 6B E8 6C 02 2B B4 C3 85 FD 64 DE
|
|
|
|
|
0060 | 85 1D 9D D0</code></pre>
|
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
@ -132,13 +132,13 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>01B4683C8168AE66</code></td>
|
|
|
|
|
<td><code>0164FED1BE72AE66</code></td>
|
|
|
|
|
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_length</td>
|
|
|
|
|
<td>16, 4</td>
|
|
|
|
|
<td><code>B4000000</code> (180 in decimal)</td>
|
|
|
|
|
<td><code>A8000000</code> (168 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>81BAA8901B7963A69A8E8BEBC10593FD</code></td>
|
|
|
|
|
<td><code>5961461015D12F9A729959CC38A8121E</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>9CFCEEB610AFF66473951EA6F9784CF9</code></td>
|
|
|
|
|
<td><code>3A55D0192DC66C128C5C5EC5C4F025B1</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>0831122C48EB28595B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 3535937349133818203</td>
|
|
|
|
|
<td><code>081E53D7ADFD5AF273000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2185327386484732531</td>
|
|
|
|
|
<td>Single-byte prefix denoting length, an 8-byte string, and three bytes of padding</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -208,22 +208,22 @@
|
|
|
|
|
<h4><a class="anchor" href="#proof-of-work" id="proof-of-work" name="proof-of-work"><i class="anchor-icon"></i></a>Proof of work</h4>
|
|
|
|
|
<h5><a class="anchor" href="#3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q" id="3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q" name="3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p < q.</h5>
|
|
|
|
|
<!-- start pq -->
|
|
|
|
|
<pre><code>pq = 3535937349133818203</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>3535937349133818203 = 1822522799 * 1940133397</code></p>
|
|
|
|
|
<pre><code>p = 1822522799
|
|
|
|
|
q = 1940133397</code></pre>
|
|
|
|
|
<pre><code>pq = 2185327386484732531</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2185327386484732531 = 1283944313 * 1702042187</code></p>
|
|
|
|
|
<pre><code>p = 1283944313
|
|
|
|
|
q = 1702042187</code></pre>
|
|
|
|
|
<!-- end pq -->
|
|
|
|
|
<h4><a class="anchor" href="#presenting-proof-of-work-server-authentication" id="presenting-proof-of-work-server-authentication" name="presenting-proof-of-work-server-authentication"><i class="anchor-icon"></i></a>Presenting proof of work; Server authentication</h4>
|
|
|
|
|
<h5><a class="anchor" href="#4-encrypted-data-payload-generation" id="4-encrypted-data-payload-generation" name="4-encrypted-data-payload-generation"><i class="anchor-icon"></i></a>4) <code>encrypted_data</code> payload generation</h5>
|
|
|
|
|
<p>First of all, generate an <code>encrypted_data</code> payload as follows:</p>
|
|
|
|
|
<!-- start p_q_inner_data_dc -->
|
|
|
|
|
<p>Generated payload (excluding transport headers/trailers):</p>
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 31 12 2C 48 EB 28 59 5B 00 00 00
|
|
|
|
|
0010 | 04 6C A1 7D AF 00 00 00 04 73 A4 16 15 00 00 00
|
|
|
|
|
0020 | 81 BA A8 90 1B 79 63 A6 9A 8E 8B EB C1 05 93 FD
|
|
|
|
|
0030 | 9C FC EE B6 10 AF F6 64 73 95 1E A6 F9 78 4C F9
|
|
|
|
|
0040 | 47 00 1B 49 AE 5F 60 08 7D 38 1B 0E 1D F9 D1 8B
|
|
|
|
|
0050 | 0B DF 52 4F E3 50 AC ED E5 A8 A4 AB 80 CC 56 35
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 1E 53 D7 AD FD 5A F2 73 00 00 00
|
|
|
|
|
0010 | 04 4C 87 6F 79 00 00 00 04 65 73 1A 4B 00 00 00
|
|
|
|
|
0020 | 59 61 46 10 15 D1 2F 9A 72 99 59 CC 38 A8 12 1E
|
|
|
|
|
0030 | 3A 55 D0 19 2D C6 6C 12 8C 5C 5E C5 C4 F0 25 B1
|
|
|
|
|
0040 | 4D E4 3B 54 09 91 74 21 64 FD 9C D9 21 54 76 69
|
|
|
|
|
0050 | CA 87 CA AB 33 BA 10 7E B8 AA 6C F8 F6 0B 7E D6
|
|
|
|
|
0060 | 02 00 00 00</code></pre>
|
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
|
<pre><code>p_q_inner_data_dc#a9f55f95 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int = P_Q_inner_data;</code></pre>
|
|
|
|
@ -246,37 +246,37 @@ q = 1940133397</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>0831122C48EB28595B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 3535937349133818203</td>
|
|
|
|
|
<td><code>081E53D7ADFD5AF273000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2185327386484732531</td>
|
|
|
|
|
<td>Single-byte prefix denoting length, 8-byte string, and three bytes of padding</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>16, 8</td>
|
|
|
|
|
<td><code>046CA17DAF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1822522799</td>
|
|
|
|
|
<td><code>044C876F79000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1283944313</td>
|
|
|
|
|
<td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>q</td>
|
|
|
|
|
<td>24, 8</td>
|
|
|
|
|
<td><code>0473A41615000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1940133397</td>
|
|
|
|
|
<td><code>0465731A4B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1702042187</td>
|
|
|
|
|
<td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>32, 16</td>
|
|
|
|
|
<td><code>81BAA8901B7963A69A8E8BEBC10593FD</code></td>
|
|
|
|
|
<td><code>5961461015D12F9A729959CC38A8121E</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>9CFCEEB610AFF66473951EA6F9784CF9</code></td>
|
|
|
|
|
<td><code>3A55D0192DC66C128C5C5EC5C4F025B1</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>47001B49AE5F60087D381B0E1DF9D18B</code> <code>0BDF524FE350ACEDE5A8A4AB80CC5635</code></td>
|
|
|
|
|
<td><code>4DE43B540991742164FD9CD921547669</code> <code>CA87CAAB33BA107EB8AA6CF8F60B7ED6</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1940133397</code></pre>
|
|
|
|
|
<p>The serialization of <em>P_Q_inner_data</em> produces <strong>data</strong>, which is used to generate <strong>encrypted_data</strong> as specified in <a href="/mtproto/auth_key">step 4.1</a>.<br>
|
|
|
|
|
These are the inputs to the algorithm specified in <a href="/mtproto/auth_key">step 4.1</a>:</p>
|
|
|
|
|
<!-- start p_q_inner_data_input -->
|
|
|
|
|
<pre><code>data = 955FF5A90831122C48EB28595B000000046CA17DAF0000000473A4161500000081BAA8901B7963A69A8E8BEBC10593FD9CFCEEB610AFF66473951EA6F9784CF947001B49AE5F60087D381B0E1DF9D18B0BDF524FE350ACEDE5A8A4AB80CC563502000000
|
|
|
|
|
random_padding_bytes = 660A1A1E5EB46A6BC07D20589613E340859CDAA8CBD8091F74F11A4DF4B99F245CE6D93A067FDC8D08F3D88E3A80B1DC1FCB1B477272E0756781F371AA0427DB84E901A3820EE1737FC55C10AAF1C03B32B1EDCC026C76C8BB0C7B46</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A9081E53D7ADFD5AF273000000044C876F790000000465731A4B0000005961461015D12F9A729959CC38A8121E3A55D0192DC66C128C5C5EC5C4F025B14DE43B540991742164FD9CD921547669CA87CAAB33BA107EB8AA6CF8F60B7ED602000000
|
|
|
|
|
random_padding_bytes = 2ED9D33A4D32526B2B430449E4C6B13D566B07CB0F3FCD8CC9D3C669B7374D9585E8C688306E2A90391D344396A38E440254E30BCF3CF10D7F890F7001CECBE155400E8B429BF6085B4D1B3E9E671F1DE18CACF544FF00BACCF71BC1</code></pre>
|
|
|
|
|
<!-- end p_q_inner_data_input -->
|
|
|
|
|
<p>And this is the output:</p>
|
|
|
|
|
<!-- start p_q_inner_data_output -->
|
|
|
|
|
<pre><code>encrypted_data = B4AE43924D0F4888D78999BE94242A19FB0823A18FE8A5A05B682ECA77FD6FB02100059ECB4C1C25C599318929A2749DDD53EED08A219587BEDEC54495ECE760698E11D221531E2F47E9940C9EDBF428948386C46A38EE64658082795C415F3D9767C4E6F6413DDD8F783F6C3CDFFAEA5AA68CF397F5CF6D1A1BC0DBAA060FA69600C153FFD933D69156BB74175272E78A8E6127B6C584813D7F2712E92B2AE9F4268122CDE8193F42F21D40B505572870B49F78FC08750D6F66D144B0C7CC63666BD51FFAC64988DC0DEE280247F26965F893BCD3C75108DC94C7E0C1BA39A83CC79F02CFBB6AFE9E3C4159DC8173084E9AAA2B122819C0AAD95EB0DD5DCC65</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = AE36F90367E6401DE8E3C8FE6497F24A33698905ECC60496BF724D3B8C13978E0069668A9F621F4EC2AE7ACAD04F02CA59C1EE152AD8E2285D8FF57CF80109512737A6719CBDAF94AE725B4C3CC65F416DD13CDD3A8FA39D41A961490476AA2BCF2E3483A746AEC4F80CEFFBBF13891783191D28F60A0A01C4C6EBD34992EC27BF10823840A31E584826AECB8E3F923BC0CE8CDE0E6C273B2E764BDD54D9EA277E3B6D090CA51D58AFB22FE6084A8FC3105FA14A2D35455C01CE5247925C7B8C382C422AD1E52D1628C9987BE5B70829D1515CE8A7199404EFDF27C80A88FF1179656EE5E5D6F6631CC4906216F242C5831D6B915DAEC31CBF8DFB4629691E1D</code></pre>
|
|
|
|
|
<!-- end p_q_inner_data_output -->
|
|
|
|
|
<p>The length of the final string is 256 bytes.</p>
|
|
|
|
|
<h5><a class="anchor" href="#5-send-req-dh-params-query-with-generated-encrypted-data" id="5-send-req-dh-params-query-with-generated-encrypted-data" name="5-send-req-dh-params-query-with-generated-encrypted-data"><i class="anchor-icon"></i></a>5) Send req_DH_params query with generated <code>encrypted_data</code></h5>
|
|
|
|
|
<!-- start req_DH_params -->
|
|
|
|
|
<p>Sent payload (excluding transport headers/trailers):</p>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 04 95 09 00 81 68 AE 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 81 BA A8 90 1B 79 63 A6
|
|
|
|
|
0020 | 9A 8E 8B EB C1 05 93 FD 9C FC EE B6 10 AF F6 64
|
|
|
|
|
0030 | 73 95 1E A6 F9 78 4C F9 04 6C A1 7D AF 00 00 00
|
|
|
|
|
0040 | 04 73 A4 16 15 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 B4 AE 43 92 4D 0F 48 88 D7 89 99 BE
|
|
|
|
|
0060 | 94 24 2A 19 FB 08 23 A1 8F E8 A5 A0 5B 68 2E CA
|
|
|
|
|
0070 | 77 FD 6F B0 21 00 05 9E CB 4C 1C 25 C5 99 31 89
|
|
|
|
|
0080 | 29 A2 74 9D DD 53 EE D0 8A 21 95 87 BE DE C5 44
|
|
|
|
|
0090 | 95 EC E7 60 69 8E 11 D2 21 53 1E 2F 47 E9 94 0C
|
|
|
|
|
00A0 | 9E DB F4 28 94 83 86 C4 6A 38 EE 64 65 80 82 79
|
|
|
|
|
00B0 | 5C 41 5F 3D 97 67 C4 E6 F6 41 3D DD 8F 78 3F 6C
|
|
|
|
|
00C0 | 3C DF FA EA 5A A6 8C F3 97 F5 CF 6D 1A 1B C0 DB
|
|
|
|
|
00D0 | AA 06 0F A6 96 00 C1 53 FF D9 33 D6 91 56 BB 74
|
|
|
|
|
00E0 | 17 52 72 E7 8A 8E 61 27 B6 C5 84 81 3D 7F 27 12
|
|
|
|
|
00F0 | E9 2B 2A E9 F4 26 81 22 CD E8 19 3F 42 F2 1D 40
|
|
|
|
|
0100 | B5 05 57 28 70 B4 9F 78 FC 08 75 0D 6F 66 D1 44
|
|
|
|
|
0110 | B0 C7 CC 63 66 6B D5 1F FA C6 49 88 DC 0D EE 28
|
|
|
|
|
0120 | 02 47 F2 69 65 F8 93 BC D3 C7 51 08 DC 94 C7 E0
|
|
|
|
|
0130 | C1 BA 39 A8 3C C7 9F 02 CF BB 6A FE 9E 3C 41 59
|
|
|
|
|
0140 | DC 81 73 08 4E 9A AA 2B 12 28 19 C0 AA D9 5E B0
|
|
|
|
|
0150 | DD 5D CC 65</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 40 41 01 00 BF 72 AE 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 59 61 46 10 15 D1 2F 9A
|
|
|
|
|
0020 | 72 99 59 CC 38 A8 12 1E 3A 55 D0 19 2D C6 6C 12
|
|
|
|
|
0030 | 8C 5C 5E C5 C4 F0 25 B1 04 4C 87 6F 79 00 00 00
|
|
|
|
|
0040 | 04 65 73 1A 4B 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 AE 36 F9 03 67 E6 40 1D E8 E3 C8 FE
|
|
|
|
|
0060 | 64 97 F2 4A 33 69 89 05 EC C6 04 96 BF 72 4D 3B
|
|
|
|
|
0070 | 8C 13 97 8E 00 69 66 8A 9F 62 1F 4E C2 AE 7A CA
|
|
|
|
|
0080 | D0 4F 02 CA 59 C1 EE 15 2A D8 E2 28 5D 8F F5 7C
|
|
|
|
|
0090 | F8 01 09 51 27 37 A6 71 9C BD AF 94 AE 72 5B 4C
|
|
|
|
|
00A0 | 3C C6 5F 41 6D D1 3C DD 3A 8F A3 9D 41 A9 61 49
|
|
|
|
|
00B0 | 04 76 AA 2B CF 2E 34 83 A7 46 AE C4 F8 0C EF FB
|
|
|
|
|
00C0 | BF 13 89 17 83 19 1D 28 F6 0A 0A 01 C4 C6 EB D3
|
|
|
|
|
00D0 | 49 92 EC 27 BF 10 82 38 40 A3 1E 58 48 26 AE CB
|
|
|
|
|
00E0 | 8E 3F 92 3B C0 CE 8C DE 0E 6C 27 3B 2E 76 4B DD
|
|
|
|
|
00F0 | 54 D9 EA 27 7E 3B 6D 09 0C A5 1D 58 AF B2 2F E6
|
|
|
|
|
0100 | 08 4A 8F C3 10 5F A1 4A 2D 35 45 5C 01 CE 52 47
|
|
|
|
|
0110 | 92 5C 7B 8C 38 2C 42 2A D1 E5 2D 16 28 C9 98 7B
|
|
|
|
|
0120 | E5 B7 08 29 D1 51 5C E8 A7 19 94 04 EF DF 27 C8
|
|
|
|
|
0130 | 0A 88 FF 11 79 65 6E E5 E5 D6 F6 63 1C C4 90 62
|
|
|
|
|
0140 | 16 F2 42 C5 83 1D 6B 91 5D AE C3 1C BF 8D FB 46
|
|
|
|
|
0150 | 29 69 1E 1D</code></pre>
|
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
|
<pre><code>req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;</code></pre>
|
|
|
|
|
<table class="table">
|
|
|
|
@ -345,7 +345,7 @@ random_padding_bytes = 660A1A1E5EB46A6BC07D20589613E340859CDAA8CBD8091F74F11A4DF
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>049509008168AE66</code></td>
|
|
|
|
|
<td><code>40410100BF72AE66</code></td>
|
|
|
|
|
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -363,25 +363,25 @@ random_padding_bytes = 660A1A1E5EB46A6BC07D20589613E340859CDAA8CBD8091F74F11A4DF
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>81BAA8901B7963A69A8E8BEBC10593FD</code></td>
|
|
|
|
|
<td><code>5961461015D12F9A729959CC38A8121E</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>9CFCEEB610AFF66473951EA6F9784CF9</code></td>
|
|
|
|
|
<td><code>3A55D0192DC66C128C5C5EC5C4F025B1</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>046CA17DAF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1822522799</td>
|
|
|
|
|
<td><code>044C876F79000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1283944313</td>
|
|
|
|
|
<td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>q</td>
|
|
|
|
|
<td>64, 8</td>
|
|
|
|
|
<td><code>0473A41615000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1940133397</td>
|
|
|
|
|
<td><code>0465731A4B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1702042187</td>
|
|
|
|
|
<td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -393,7 +393,7 @@ random_padding_bytes = 660A1A1E5EB46A6BC07D20589613E340859CDAA8CBD8091F74F11A4DF
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE000100B4AE43924D0F4888D78999BE</code> <code>94242A19FB0823A18FE8A5A05B682ECA</code> <code>77FD6FB02100059ECB4C1C25C5993189</code> <code>29A2749DDD53EED08A219587BEDEC544</code> <code>95ECE760698E11D221531E2F47E9940C</code> <code>9EDBF428948386C46A38EE6465808279</code> <code>5C415F3D9767C4E6F6413DDD8F783F6C</code> <code>3CDFFAEA5AA68CF397F5CF6D1A1BC0DB</code> <code>AA060FA69600C153FFD933D69156BB74</code> <code>175272E78A8E6127B6C584813D7F2712</code> <code>E92B2AE9F4268122CDE8193F42F21D40</code> <code>B505572870B49F78FC08750D6F66D144</code> <code>B0C7CC63666BD51FFAC64988DC0DEE28</code> <code>0247F26965F893BCD3C75108DC94C7E0</code> <code>C1BA39A83CC79F02CFBB6AFE9E3C4159</code> <code>DC8173084E9AAA2B122819C0AAD95EB0</code><br> <code>DD5DCC65</code></td>
|
|
|
|
|
<td><code>FE000100AE36F90367E6401DE8E3C8FE</code> <code>6497F24A33698905ECC60496BF724D3B</code> <code>8C13978E0069668A9F621F4EC2AE7ACA</code> <code>D04F02CA59C1EE152AD8E2285D8FF57C</code> <code>F80109512737A6719CBDAF94AE725B4C</code> <code>3CC65F416DD13CDD3A8FA39D41A96149</code> <code>0476AA2BCF2E3483A746AEC4F80CEFFB</code> <code>BF13891783191D28F60A0A01C4C6EBD3</code> <code>4992EC27BF10823840A31E584826AECB</code> <code>8E3F923BC0CE8CDE0E6C273B2E764BDD</code> <code>54D9EA277E3B6D090CA51D58AFB22FE6</code> <code>084A8FC3105FA14A2D35455C01CE5247</code> <code>925C7B8C382C422AD1E52D1628C9987B</code> <code>E5B70829D1515CE8A7199404EFDF27C8</code> <code>0A88FF1179656EE5E5D6F6631CC49062</code> <code>16F242C5831D6B915DAEC31CBF8DFB46</code><br> <code>29691E1D</code></td>
|
|
|
|
|
<td>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = 660A1A1E5EB46A6BC07D20589613E340859CDAA8CBD8091F74F11A4DF
|
|
|
|
|
<h5><a class="anchor" href="#6-server-responds-with" id="6-server-responds-with" name="6-server-responds-with"><i class="anchor-icon"></i></a>6) Server responds with:</h5>
|
|
|
|
|
<!-- start server_DH_params_ok -->
|
|
|
|
|
<p>Received payload (excluding transport headers/trailers):</p>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 A4 1A 05 82 68 AE 66
|
|
|
|
|
0010 | B8 02 00 00 5C 07 E8 D0 81 BA A8 90 1B 79 63 A6
|
|
|
|
|
0020 | 9A 8E 8B EB C1 05 93 FD 9C FC EE B6 10 AF F6 64
|
|
|
|
|
0030 | 73 95 1E A6 F9 78 4C F9 FE 50 02 00 52 91 D8 15
|
|
|
|
|
0040 | 21 26 DA FF 92 59 DC F2 BD 3F 8B CC 2C 6B CB 61
|
|
|
|
|
0050 | 25 84 E5 C7 3C B8 3E 9E 7C 8C BA 88 6A F4 F0 EA
|
|
|
|
|
0060 | 93 81 B3 6C C5 5C 7A 31 37 F2 C6 D1 74 48 1B CB
|
|
|
|
|
0070 | EC E9 3C 7A DE 99 52 D4 FB 4E 44 15 11 A6 8B DE
|
|
|
|
|
0080 | B2 C5 B6 E6 37 C3 72 CF CC 2C 94 B8 41 44 A4 88
|
|
|
|
|
0090 | 20 BD E4 3D 57 C8 FC 9C 97 B6 D3 5B 6F 53 48 A1
|
|
|
|
|
00A0 | 18 06 9C 09 95 CB 86 B4 EF 48 C4 11 F3 7C 69 46
|
|
|
|
|
00B0 | 47 DB 10 9D B5 1C FF 21 F4 E2 C8 75 79 1C 48 FF
|
|
|
|
|
00C0 | 45 1D 5E 2D 1F 19 F9 A0 94 DE 35 CC EE 5C B7 51
|
|
|
|
|
00D0 | 33 83 58 92 D9 86 DD C5 D6 53 3A 34 BE 70 E1 28
|
|
|
|
|
00E0 | 16 7A E1 28 ED 47 C0 30 21 5D 73 7D C8 50 37 85
|
|
|
|
|
00F0 | 6B AE 74 00 9D C6 03 09 CC 74 A3 94 8E 28 8C E5
|
|
|
|
|
0100 | 2D 3D 20 C9 C8 C7 69 4B AE 9D DB 65 78 6A 07 FB
|
|
|
|
|
0110 | 31 CA 32 A1 6A 17 1D 6F B2 C3 4D BF FA DD DC 54
|
|
|
|
|
0120 | 8F E2 91 D7 43 B1 24 2E E6 69 DB 71 BA 2A 5A 54
|
|
|
|
|
0130 | 7B 72 9B 9C 4C 48 63 55 FC CB FB D3 61 C4 DF 54
|
|
|
|
|
0140 | AA E8 EA 9F 57 A5 09 77 E4 18 39 92 49 56 30 C4
|
|
|
|
|
0150 | D6 2D CE B9 80 5A 70 D2 64 FD D4 E5 35 3A AC C3
|
|
|
|
|
0160 | 02 36 03 65 40 95 1C 34 72 87 DC 7C B2 A8 EE 8F
|
|
|
|
|
0170 | 27 8E 03 08 18 37 4B 79 EF 71 42 11 F9 3B BF 36
|
|
|
|
|
0180 | 67 ED 7D 44 38 42 2B 83 66 8E 6B CB 79 19 8D C5
|
|
|
|
|
0190 | 66 62 AA C4 17 CC 3F E6 00 5D 4E C2 4C 9C E5 2F
|
|
|
|
|
01A0 | 71 7E E0 EB 2F C6 21 62 ED 1E 6A C4 85 F1 EC 98
|
|
|
|
|
01B0 | BF 76 83 28 C4 55 3B DD 67 17 2D 9B 14 EB 7B 48
|
|
|
|
|
01C0 | 9A 8D EF 7A 2F DB 84 D2 FA B4 0D 61 5C 32 06 4F
|
|
|
|
|
01D0 | E5 9A B4 FD 0B 4D 2F 5A B7 1C 1F BE 91 FC 19 78
|
|
|
|
|
01E0 | E6 DA 06 12 2C DC 79 DA C2 B4 43 4A A9 B1 B2 E5
|
|
|
|
|
01F0 | B4 5B 4B A3 EB BA EF A7 1E 1D 0B 85 27 62 F7 F8
|
|
|
|
|
0200 | DF 1B 9E FC E9 7E 70 A7 3D 9B 2B AA 0A 95 E1 7F
|
|
|
|
|
0210 | FB 94 45 05 E5 FE 17 DF AC 06 D3 1F 73 16 69 00
|
|
|
|
|
0220 | 53 44 81 F5 93 FD 25 C0 95 72 60 1F 8A 54 34 40
|
|
|
|
|
0230 | 7C 60 A8 15 B4 4D C8 32 9E 48 F5 38 F3 7C 08 D0
|
|
|
|
|
0240 | 05 BD 31 69 F9 95 E6 51 3C 0B 33 CB 7C 28 FA 50
|
|
|
|
|
0250 | 7A 04 4E B0 31 6B 2A 8A EB 93 28 5B A5 32 4E A2
|
|
|
|
|
0260 | EC 61 54 FC 8D 8B E2 88 EE 8F 84 57 68 41 69 B7
|
|
|
|
|
0270 | 70 02 49 07 AA 06 A6 26 6D 04 F5 15 A9 37 8B DC
|
|
|
|
|
0280 | 96 19 79 ED DC 18 F1 F0 D9 7E A9 49</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 C8 14 9D BF 72 AE 66
|
|
|
|
|
0010 | C8 02 00 00 5C 07 E8 D0 59 61 46 10 15 D1 2F 9A
|
|
|
|
|
0020 | 72 99 59 CC 38 A8 12 1E 3A 55 D0 19 2D C6 6C 12
|
|
|
|
|
0030 | 8C 5C 5E C5 C4 F0 25 B1 FE 50 02 00 74 71 FC A2
|
|
|
|
|
0040 | DC C5 D8 A5 71 46 A5 F3 A7 AC 48 48 26 94 F9 8B
|
|
|
|
|
0050 | 93 48 0F 50 DB 1E 2B 8F 27 BC FF 3A E1 EA FC E1
|
|
|
|
|
0060 | 06 A9 3A 3D 52 53 63 4A 43 15 7F 85 F9 E0 BC 08
|
|
|
|
|
0070 | 35 95 AB AE 92 4A CD 77 3F 32 6F EA 17 9C 8C 55
|
|
|
|
|
0080 | 7D 98 6B EE 26 92 3C FC D0 05 7B 95 D3 36 A6 27
|
|
|
|
|
0090 | 65 59 81 6B BD AB B9 DA F7 F0 F7 B0 8B 25 DA FA
|
|
|
|
|
00A0 | FF F5 5B C4 89 95 B6 D2 08 7F 00 B9 6C E7 18 BA
|
|
|
|
|
00B0 | 05 14 EF DF 94 59 30 6C A0 43 09 20 4E DC 92 88
|
|
|
|
|
00C0 | E7 F8 4F 8C 69 AD 44 17 1C 2B 37 B2 48 67 3F 48
|
|
|
|
|
00D0 | E7 B2 FE 6E 2A 7D 43 6A AD EE 49 8C 81 B1 D6 C0
|
|
|
|
|
00E0 | 97 25 46 3D E1 E7 4B E9 01 18 51 34 8B 73 E4 65
|
|
|
|
|
00F0 | B2 D4 BB D4 E3 60 61 4E D7 74 FC 3C CB F7 29 38
|
|
|
|
|
0100 | F5 73 CE C3 F1 62 33 F2 92 B0 6A A3 38 65 9E D4
|
|
|
|
|
0110 | 3E BC 07 7A C6 B5 2A 94 17 CB B7 88 B7 24 97 8E
|
|
|
|
|
0120 | F5 9E 4C 29 ED E1 54 1F 81 8E 05 68 A8 25 03 0A
|
|
|
|
|
0130 | 90 53 52 EF B0 76 CC CE 7C 78 E9 22 FF 76 41 28
|
|
|
|
|
0140 | 7B 48 0A 22 7C 55 C9 FE E1 97 5C B8 89 5C EF 71
|
|
|
|
|
0150 | F1 87 89 52 43 2B 34 F8 18 AB 84 BB A7 3E 7F C1
|
|
|
|
|
0160 | 0F 7A 3D F4 53 B4 D5 DF 4A D6 D5 BC 92 C2 3C B4
|
|
|
|
|
0170 | 80 84 C7 95 1B BD B3 25 EE 37 33 A8 A1 1F 8A C6
|
|
|
|
|
0180 | E6 D0 32 F0 83 58 92 B2 81 0A F9 EB B4 D1 2C 70
|
|
|
|
|
0190 | B2 0F CB 5B 38 AD 1F 33 B0 32 0C 2C FE 39 01 B9
|
|
|
|
|
01A0 | 7A 4D BA 3C 06 AB 24 F3 89 B3 C4 1E 7E 99 B6 B2
|
|
|
|
|
01B0 | B9 75 B2 DB 47 31 7A 2D A9 9A AB BA 19 E2 6C B0
|
|
|
|
|
01C0 | BD D1 84 F4 8F FF 1F 47 CB 46 BC 6F C5 57 45 47
|
|
|
|
|
01D0 | 84 D1 24 4F CC 88 55 09 10 C2 CF 3F 22 04 84 46
|
|
|
|
|
01E0 | 39 59 D5 FF 1D 50 F6 FB D5 A0 2C 9C DC 21 84 CF
|
|
|
|
|
01F0 | 97 8B E4 8C 29 59 0F 85 A6 AB E0 75 5D 61 05 9D
|
|
|
|
|
0200 | 9D F3 A3 94 C3 E4 D2 7E 0A 63 DD 0B B0 56 2C CA
|
|
|
|
|
0210 | 0B E9 4F CE DB AA F1 6D 9D 50 02 1A FD 03 90 DB
|
|
|
|
|
0220 | D7 B9 62 D2 CF E5 E3 43 B3 03 32 7B 6F 14 F8 FC
|
|
|
|
|
0230 | 54 FA FE 74 E6 F8 6C FF 7A 53 B6 34 52 12 5D 3A
|
|
|
|
|
0240 | DD 35 DD E2 FA C5 1A 8A 74 79 19 70 7E D0 87 14
|
|
|
|
|
0250 | 7B 89 5D 57 82 E7 B4 CD 98 5D 2A D0 9E B0 C9 F4
|
|
|
|
|
0260 | 09 85 04 58 B0 BC 18 95 26 27 3D 88 BE A0 C3 6F
|
|
|
|
|
0270 | 17 56 00 59 68 D5 7B F7 E9 88 87 25 4E 93 92 30
|
|
|
|
|
0280 | D1 89 34 C1 A8 1B A1 A5 78 F2 49 67</code></pre>
|
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
|
<pre><code>server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;</code></pre>
|
|
|
|
|
<table class="table">
|
|
|
|
@ -464,13 +464,13 @@ random_padding_bytes = 660A1A1E5EB46A6BC07D20589613E340859CDAA8CBD8091F74F11A4DF
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>01A41A058268AE66</code></td>
|
|
|
|
|
<td><code>01C8149DBF72AE66</code></td>
|
|
|
|
|
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_length</td>
|
|
|
|
|
<td>16, 4</td>
|
|
|
|
|
<td><code>B8020000</code> (696 in decimal)</td>
|
|
|
|
|
<td><code>C8020000</code> (712 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -482,19 +482,19 @@ random_padding_bytes = 660A1A1E5EB46A6BC07D20589613E340859CDAA8CBD8091F74F11A4DF
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>81BAA8901B7963A69A8E8BEBC10593FD</code></td>
|
|
|
|
|
<td><code>5961461015D12F9A729959CC38A8121E</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>9CFCEEB610AFF66473951EA6F9784CF9</code></td>
|
|
|
|
|
<td><code>3A55D0192DC66C128C5C5EC5C4F025B1</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE5002005291D8152126DAFF9259DCF2</code> <code>BD3F8BCC2C6BCB612584E5C73CB83E9E</code> <code>7C8CBA886AF4F0EA9381B36CC55C7A31</code> <code>37F2C6D174481BCBECE93C7ADE9952D4</code> <code>FB4E441511A68BDEB2C5B6E637C372CF</code> <code>CC2C94B84144A48820BDE43D57C8FC9C</code> <code>97B6D35B6F5348A118069C0995CB86B4</code> <code>EF48C411F37C694647DB109DB51CFF21</code> <code>F4E2C875791C48FF451D5E2D1F19F9A0</code> <code>94DE35CCEE5CB75133835892D986DDC5</code> <code>D6533A34BE70E128167AE128ED47C030</code> <code>215D737DC85037856BAE74009DC60309</code> <code>CC74A3948E288CE52D3D20C9C8C7694B</code> <code>AE9DDB65786A07FB31CA32A16A171D6F</code> <code>B2C34DBFFADDDC548FE291D743B1242E</code> <code>E669DB71BA2A5A547B729B9C4C486355</code> <code>FCCBFBD361C4DF54AAE8EA9F57A50977</code> <code>E4183992495630C4D62DCEB9805A70D2</code> <code>64FDD4E5353AACC30236036540951C34</code> <code>7287DC7CB2A8EE8F278E030818374B79</code> <code>EF714211F93BBF3667ED7D4438422B83</code> <code>668E6BCB79198DC56662AAC417CC3FE6</code> <code>005D4EC24C9CE52F717EE0EB2FC62162</code> <code>ED1E6AC485F1EC98BF768328C4553BDD</code> <code>67172D9B14EB7B489A8DEF7A2FDB84D2</code> <code>FAB40D615C32064FE59AB4FD0B4D2F5A</code> <code>B71C1FBE91FC1978E6DA06122CDC79DA</code> <code>C2B4434AA9B1B2E5B45B4BA3EBBAEFA7</code> <code>1E1D0B852762F7F8DF1B9EFCE97E70A7</code> <code>3D9B2BAA0A95E17FFB944505E5FE17DF</code> <code>AC06D31F73166900534481F593FD25C0</code> <code>9572601F8A5434407C60A815B44DC832</code> <code>9E48F538F37C08D005BD3169F995E651</code> <code>3C0B33CB7C28FA507A044EB0316B2A8A</code> <code>EB93285BA5324EA2EC6154FC8D8BE288</code> <code>EE8F8457684169B770024907AA06A626</code> <code>6D04F515A9378BDC961979EDDC18F1F0</code><br> <code>D97EA949</code></td>
|
|
|
|
|
<td><code>FE5002007471FCA2DCC5D8A57146A5F3</code> <code>A7AC48482694F98B93480F50DB1E2B8F</code> <code>27BCFF3AE1EAFCE106A93A3D5253634A</code> <code>43157F85F9E0BC083595ABAE924ACD77</code> <code>3F326FEA179C8C557D986BEE26923CFC</code> <code>D0057B95D336A6276559816BBDABB9DA</code> <code>F7F0F7B08B25DAFAFFF55BC48995B6D2</code> <code>087F00B96CE718BA0514EFDF9459306C</code> <code>A04309204EDC9288E7F84F8C69AD4417</code> <code>1C2B37B248673F48E7B2FE6E2A7D436A</code> <code>ADEE498C81B1D6C09725463DE1E74BE9</code> <code>011851348B73E465B2D4BBD4E360614E</code> <code>D774FC3CCBF72938F573CEC3F16233F2</code> <code>92B06AA338659ED43EBC077AC6B52A94</code> <code>17CBB788B724978EF59E4C29EDE1541F</code> <code>818E0568A825030A905352EFB076CCCE</code> <code>7C78E922FF7641287B480A227C55C9FE</code> <code>E1975CB8895CEF71F1878952432B34F8</code> <code>18AB84BBA73E7FC10F7A3DF453B4D5DF</code> <code>4AD6D5BC92C23CB48084C7951BBDB325</code> <code>EE3733A8A11F8AC6E6D032F0835892B2</code> <code>810AF9EBB4D12C70B20FCB5B38AD1F33</code> <code>B0320C2CFE3901B97A4DBA3C06AB24F3</code> <code>89B3C41E7E99B6B2B975B2DB47317A2D</code> <code>A99AABBA19E26CB0BDD184F48FFF1F47</code> <code>CB46BC6FC557454784D1244FCC885509</code> <code>10C2CF3F220484463959D5FF1D50F6FB</code> <code>D5A02C9CDC2184CF978BE48C29590F85</code> <code>A6ABE0755D61059D9DF3A394C3E4D27E</code> <code>0A63DD0BB0562CCA0BE94FCEDBAAF16D</code> <code>9D50021AFD0390DBD7B962D2CFE5E343</code> <code>B303327B6F14F8FC54FAFE74E6F86CFF</code> <code>7A53B63452125D3ADD35DDE2FAC51A8A</code> <code>747919707ED087147B895D5782E7B4CD</code> <code>985D2AD09EB0C9F409850458B0BC1895</code> <code>26273D88BEA0C36F1756005968D57BF7</code> <code>E98887254E939230D18934C1A81BA1A5</code><br> <code>78F24967</code></td>
|
|
|
|
|
<td>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = 660A1A1E5EB46A6BC07D20589613E340859CDAA8CBD8091F74F11A4DF
|
|
|
|
|
<!-- end server_DH_params_ok -->
|
|
|
|
|
<p>Decrypt <code>encrypted_answer</code> using the reverse of the process specified in <a href="/mtproto/auth_key#6-server-responds-with">step 6</a>:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_input -->
|
|
|
|
|
<pre><code>encrypted_answer = 5291D8152126DAFF9259DCF2BD3F8BCC2C6BCB612584E5C73CB83E9E7C8CBA886AF4F0EA9381B36CC55C7A3137F2C6D174481BCBECE93C7ADE9952D4FB4E441511A68BDEB2C5B6E637C372CFCC2C94B84144A48820BDE43D57C8FC9C97B6D35B6F5348A118069C0995CB86B4EF48C411F37C694647DB109DB51CFF21F4E2C875791C48FF451D5E2D1F19F9A094DE35CCEE5CB75133835892D986DDC5D6533A34BE70E128167AE128ED47C030215D737DC85037856BAE74009DC60309CC74A3948E288CE52D3D20C9C8C7694BAE9DDB65786A07FB31CA32A16A171D6FB2C34DBFFADDDC548FE291D743B1242EE669DB71BA2A5A547B729B9C4C486355FCCBFBD361C4DF54AAE8EA9F57A50977E4183992495630C4D62DCEB9805A70D264FDD4E5353AACC30236036540951C347287DC7CB2A8EE8F278E030818374B79EF714211F93BBF3667ED7D4438422B83668E6BCB79198DC56662AAC417CC3FE6005D4EC24C9CE52F717EE0EB2FC62162ED1E6AC485F1EC98BF768328C4553BDD67172D9B14EB7B489A8DEF7A2FDB84D2FAB40D615C32064FE59AB4FD0B4D2F5AB71C1FBE91FC1978E6DA06122CDC79DAC2B4434AA9B1B2E5B45B4BA3EBBAEFA71E1D0B852762F7F8DF1B9EFCE97E70A73D9B2BAA0A95E17FFB944505E5FE17DFAC06D31F73166900534481F593FD25C09572601F8A5434407C60A815B44DC8329E48F538F37C08D005BD3169F995E6513C0B33CB7C28FA507A044EB0316B2A8AEB93285BA5324EA2EC6154FC8D8BE288EE8F8457684169B770024907AA06A6266D04F515A9378BDC961979EDDC18F1F0D97EA949
|
|
|
|
|
tmp_aes_key = 193D433DA179C2B9BBEC2861895A71A884B707887D2CE6D60BD2E9AAAB243E91
|
|
|
|
|
tmp_aes_iv = 46D34D4E464337AC6C81E0E4D58B221A353C524BFE62B059B152350A47001B49</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = 7471FCA2DCC5D8A57146A5F3A7AC48482694F98B93480F50DB1E2B8F27BCFF3AE1EAFCE106A93A3D5253634A43157F85F9E0BC083595ABAE924ACD773F326FEA179C8C557D986BEE26923CFCD0057B95D336A6276559816BBDABB9DAF7F0F7B08B25DAFAFFF55BC48995B6D2087F00B96CE718BA0514EFDF9459306CA04309204EDC9288E7F84F8C69AD44171C2B37B248673F48E7B2FE6E2A7D436AADEE498C81B1D6C09725463DE1E74BE9011851348B73E465B2D4BBD4E360614ED774FC3CCBF72938F573CEC3F16233F292B06AA338659ED43EBC077AC6B52A9417CBB788B724978EF59E4C29EDE1541F818E0568A825030A905352EFB076CCCE7C78E922FF7641287B480A227C55C9FEE1975CB8895CEF71F1878952432B34F818AB84BBA73E7FC10F7A3DF453B4D5DF4AD6D5BC92C23CB48084C7951BBDB325EE3733A8A11F8AC6E6D032F0835892B2810AF9EBB4D12C70B20FCB5B38AD1F33B0320C2CFE3901B97A4DBA3C06AB24F389B3C41E7E99B6B2B975B2DB47317A2DA99AABBA19E26CB0BDD184F48FFF1F47CB46BC6FC557454784D1244FCC88550910C2CF3F220484463959D5FF1D50F6FBD5A02C9CDC2184CF978BE48C29590F85A6ABE0755D61059D9DF3A394C3E4D27E0A63DD0BB0562CCA0BE94FCEDBAAF16D9D50021AFD0390DBD7B962D2CFE5E343B303327B6F14F8FC54FAFE74E6F86CFF7A53B63452125D3ADD35DDE2FAC51A8A747919707ED087147B895D5782E7B4CD985D2AD09EB0C9F409850458B0BC189526273D88BEA0C36F1756005968D57BF7E98887254E939230D18934C1A81BA1A578F24967
|
|
|
|
|
tmp_aes_key = 8FE1C7AA466D69BC2CA662D231CBA55187624040931DF384876D11FDBB183CEF
|
|
|
|
|
tmp_aes_iv = DAE265F5C19D6BA057B409EE108DF6D9ADCA5DBDFF95D662DDB7E9CE4DE43B54</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = B7021C84DF7099D62437262D4CA612C54695F201BA0D89B581BAA8901B7963A69A8E8BEBC10593FD9CFCEEB610AFF66473951EA6F9784CF903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001002F06E047C03A469913D6EEBDFE444536C11B3FBBE14B97F992B2E428C1833EB73884D48574504F78220944D8834D843FDEB7D0DE12E00F87F767F55EED24E4F2F9AA6C0D5359C7CACACFBB6917F0989ACB99503BB2F5FE9FB34F4FDAC763E173BA81F93D77A3FDF98C05ED9C1D33E7DE4016655F2E21B1EB272D245FE266B8835AEA5FA0835E643BE58D0B406EE3D3F7C2B93C8F6EF8FB4F0CE05B78CC08B21D64F6658243C6D40625394514B988DDC671222C4EAA05B37BDE9957201AF7061D9A037E4F8551C0C76A01D27D41B38B25B70C0995BF7951AD5F3053CD196C9DF4C3F95BC003718CE2DC92086935D117907E8AF0EDFFBB3C619F9CA8BF54C018928268AE665016D8AB67897248
|
|
|
|
|
answer = BA0D89B581BAA8901B7963A69A8E8BEBC10593FD9CFCEEB610AFF66473951EA6F9784CF903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001002F06E047C03A469913D6EEBDFE444536C11B3FBBE14B97F992B2E428C1833EB73884D48574504F78220944D8834D843FDEB7D0DE12E00F87F767F55EED24E4F2F9AA6C0D5359C7CACACFBB6917F0989ACB99503BB2F5FE9FB34F4FDAC763E173BA81F93D77A3FDF98C05ED9C1D33E7DE4016655F2E21B1EB272D245FE266B8835AEA5FA0835E643BE58D0B406EE3D3F7C2B93C8F6EF8FB4F0CE05B78CC08B21D64F6658243C6D40625394514B988DDC671222C4EAA05B37BDE9957201AF7061D9A037E4F8551C0C76A01D27D41B38B25B70C0995BF7951AD5F3053CD196C9DF4C3F95BC003718CE2DC92086935D117907E8AF0EDFFBB3C619F9CA8BF54C018928268AE665016D8AB67897248</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = B83B6DB5B7C5DC392ABB0670C5D48B882029B1F2BA0D89B55961461015D12F9A729959CC38A8121E3A55D0192DC66C128C5C5EC5C4F025B103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001002E4355723122477401E5E5312EE12B2B692B31E7A8C061AB278709A53EAEE4CFDFDD653DD1EB009610AB5E20E27F2F085E2F5372D50D6A47F196E590A52755CFF4F840BE47C6703553E70BEB384B4F905F68E61C387CFC9B9D0EC8D0DEB59E9E645B4DCB504F3E9E7AD34CEEE75A0EDBA08EFA476CBDAC102146DBEB0ECD47F5350A75A17ABD94EF62704A540530B62C93D89AE46BCA5B2312E4AAD68460E32D63E990A75AB8E51017E4FC806C990D0452FE42EDF57E6D7B85157CB7B60C975F512F3E4CEA21781FAAED4704CF810620BC59FF2975693628A1E378BBC18A9343738A677B12A2000D1B3F29434B6019B1A27C94EC786C1209CCAE1DC6375FE95CBF72AE6635F4238179B78A94
|
|
|
|
|
answer = BA0D89B55961461015D12F9A729959CC38A8121E3A55D0192DC66C128C5C5EC5C4F025B103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001002E4355723122477401E5E5312EE12B2B692B31E7A8C061AB278709A53EAEE4CFDFDD653DD1EB009610AB5E20E27F2F085E2F5372D50D6A47F196E590A52755CFF4F840BE47C6703553E70BEB384B4F905F68E61C387CFC9B9D0EC8D0DEB59E9E645B4DCB504F3E9E7AD34CEEE75A0EDBA08EFA476CBDAC102146DBEB0ECD47F5350A75A17ABD94EF62704A540530B62C93D89AE46BCA5B2312E4AAD68460E32D63E990A75AB8E51017E4FC806C990D0452FE42EDF57E6D7B85157CB7B60C975F512F3E4CEA21781FAAED4704CF810620BC59FF2975693628A1E378BBC18A9343738A677B12A2000D1B3F29434B6019B1A27C94EC786C1209CCAE1DC6375FE95CBF72AE6635F4238179B78A94</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_output -->
|
|
|
|
|
<!-- start server_DH_inner_data -->
|
|
|
|
|
<p>Generated payload (excluding transport headers/trailers):</p>
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 81 BA A8 90 1B 79 63 A6 9A 8E 8B EB
|
|
|
|
|
0010 | C1 05 93 FD 9C FC EE B6 10 AF F6 64 73 95 1E A6
|
|
|
|
|
0020 | F9 78 4C F9 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 59 61 46 10 15 D1 2F 9A 72 99 59 CC
|
|
|
|
|
0010 | 38 A8 12 1E 3A 55 D0 19 2D C6 6C 12 8C 5C 5E C5
|
|
|
|
|
0020 | C4 F0 25 B1 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
0030 | C6 B1 C9 04 8E 6C 52 2F 70 F1 3F 73 98 0D 40 23
|
|
|
|
|
0040 | 8E 3E 21 C1 49 34 D0 37 56 3D 93 0F 48 19 8A 0A
|
|
|
|
|
0050 | A7 C1 40 58 22 94 93 D2 25 30 F4 DB FA 33 6F 6E
|
|
|
|
@ -532,23 +532,23 @@ answer = BA0D89B581BAA8901B7963A69A8E8BEBC10593FD9CFCEEB610AFF66473951EA6F9784CF
|
|
|
|
|
0100 | F4 7B F9 59 D9 56 85 0C E9 29 85 1F 0D 81 15 F6
|
|
|
|
|
0110 | 35 B1 05 EE 2E 4E 15 D0 4B 24 54 BF 6F 4F AD F0
|
|
|
|
|
0120 | 34 B1 04 03 11 9C D8 E3 B9 2F CC 5B FE 00 01 00
|
|
|
|
|
0130 | 2F 06 E0 47 C0 3A 46 99 13 D6 EE BD FE 44 45 36
|
|
|
|
|
0140 | C1 1B 3F BB E1 4B 97 F9 92 B2 E4 28 C1 83 3E B7
|
|
|
|
|
0150 | 38 84 D4 85 74 50 4F 78 22 09 44 D8 83 4D 84 3F
|
|
|
|
|
0160 | DE B7 D0 DE 12 E0 0F 87 F7 67 F5 5E ED 24 E4 F2
|
|
|
|
|
0170 | F9 AA 6C 0D 53 59 C7 CA CA CF BB 69 17 F0 98 9A
|
|
|
|
|
0180 | CB 99 50 3B B2 F5 FE 9F B3 4F 4F DA C7 63 E1 73
|
|
|
|
|
0190 | BA 81 F9 3D 77 A3 FD F9 8C 05 ED 9C 1D 33 E7 DE
|
|
|
|
|
01A0 | 40 16 65 5F 2E 21 B1 EB 27 2D 24 5F E2 66 B8 83
|
|
|
|
|
01B0 | 5A EA 5F A0 83 5E 64 3B E5 8D 0B 40 6E E3 D3 F7
|
|
|
|
|
01C0 | C2 B9 3C 8F 6E F8 FB 4F 0C E0 5B 78 CC 08 B2 1D
|
|
|
|
|
01D0 | 64 F6 65 82 43 C6 D4 06 25 39 45 14 B9 88 DD C6
|
|
|
|
|
01E0 | 71 22 2C 4E AA 05 B3 7B DE 99 57 20 1A F7 06 1D
|
|
|
|
|
01F0 | 9A 03 7E 4F 85 51 C0 C7 6A 01 D2 7D 41 B3 8B 25
|
|
|
|
|
0200 | B7 0C 09 95 BF 79 51 AD 5F 30 53 CD 19 6C 9D F4
|
|
|
|
|
0210 | C3 F9 5B C0 03 71 8C E2 DC 92 08 69 35 D1 17 90
|
|
|
|
|
0220 | 7E 8A F0 ED FF BB 3C 61 9F 9C A8 BF 54 C0 18 92
|
|
|
|
|
0230 | 82 68 AE 66</code></pre>
|
|
|
|
|
0130 | 2E 43 55 72 31 22 47 74 01 E5 E5 31 2E E1 2B 2B
|
|
|
|
|
0140 | 69 2B 31 E7 A8 C0 61 AB 27 87 09 A5 3E AE E4 CF
|
|
|
|
|
0150 | DF DD 65 3D D1 EB 00 96 10 AB 5E 20 E2 7F 2F 08
|
|
|
|
|
0160 | 5E 2F 53 72 D5 0D 6A 47 F1 96 E5 90 A5 27 55 CF
|
|
|
|
|
0170 | F4 F8 40 BE 47 C6 70 35 53 E7 0B EB 38 4B 4F 90
|
|
|
|
|
0180 | 5F 68 E6 1C 38 7C FC 9B 9D 0E C8 D0 DE B5 9E 9E
|
|
|
|
|
0190 | 64 5B 4D CB 50 4F 3E 9E 7A D3 4C EE E7 5A 0E DB
|
|
|
|
|
01A0 | A0 8E FA 47 6C BD AC 10 21 46 DB EB 0E CD 47 F5
|
|
|
|
|
01B0 | 35 0A 75 A1 7A BD 94 EF 62 70 4A 54 05 30 B6 2C
|
|
|
|
|
01C0 | 93 D8 9A E4 6B CA 5B 23 12 E4 AA D6 84 60 E3 2D
|
|
|
|
|
01D0 | 63 E9 90 A7 5A B8 E5 10 17 E4 FC 80 6C 99 0D 04
|
|
|
|
|
01E0 | 52 FE 42 ED F5 7E 6D 7B 85 15 7C B7 B6 0C 97 5F
|
|
|
|
|
01F0 | 51 2F 3E 4C EA 21 78 1F AA ED 47 04 CF 81 06 20
|
|
|
|
|
0200 | BC 59 FF 29 75 69 36 28 A1 E3 78 BB C1 8A 93 43
|
|
|
|
|
0210 | 73 8A 67 7B 12 A2 00 0D 1B 3F 29 43 4B 60 19 B1
|
|
|
|
|
0220 | A2 7C 94 EC 78 6C 12 09 CC AE 1D C6 37 5F E9 5C
|
|
|
|
|
0230 | BF 72 AE 66</code></pre>
|
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
|
<pre><code>server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;</code></pre>
|
|
|
|
|
<table class="table">
|
|
|
|
@ -570,13 +570,13 @@ answer = BA0D89B581BAA8901B7963A69A8E8BEBC10593FD9CFCEEB610AFF66473951EA6F9784CF
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>81BAA8901B7963A69A8E8BEBC10593FD</code></td>
|
|
|
|
|
<td><code>5961461015D12F9A729959CC38A8121E</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>9CFCEEB610AFF66473951EA6F9784CF9</code></td>
|
|
|
|
|
<td><code>3A55D0192DC66C128C5C5EC5C4F025B1</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B581BAA8901B7963A69A8E8BEBC10593FD9CFCEEB610AFF66473951EA6F9784CF
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE0001002F06E047C03A469913D6EEBD</code> <code>FE444536C11B3FBBE14B97F992B2E428</code> <code>C1833EB73884D48574504F78220944D8</code> <code>834D843FDEB7D0DE12E00F87F767F55E</code> <code>ED24E4F2F9AA6C0D5359C7CACACFBB69</code> <code>17F0989ACB99503BB2F5FE9FB34F4FDA</code> <code>C763E173BA81F93D77A3FDF98C05ED9C</code> <code>1D33E7DE4016655F2E21B1EB272D245F</code> <code>E266B8835AEA5FA0835E643BE58D0B40</code> <code>6EE3D3F7C2B93C8F6EF8FB4F0CE05B78</code> <code>CC08B21D64F6658243C6D40625394514</code> <code>B988DDC671222C4EAA05B37BDE995720</code> <code>1AF7061D9A037E4F8551C0C76A01D27D</code> <code>41B38B25B70C0995BF7951AD5F3053CD</code> <code>196C9DF4C3F95BC003718CE2DC920869</code> <code>35D117907E8AF0EDFFBB3C619F9CA8BF</code><br> <code>54C01892</code></td>
|
|
|
|
|
<td><code>FE0001002E4355723122477401E5E531</code> <code>2EE12B2B692B31E7A8C061AB278709A5</code> <code>3EAEE4CFDFDD653DD1EB009610AB5E20</code> <code>E27F2F085E2F5372D50D6A47F196E590</code> <code>A52755CFF4F840BE47C6703553E70BEB</code> <code>384B4F905F68E61C387CFC9B9D0EC8D0</code> <code>DEB59E9E645B4DCB504F3E9E7AD34CEE</code> <code>E75A0EDBA08EFA476CBDAC102146DBEB</code> <code>0ECD47F5350A75A17ABD94EF62704A54</code> <code>0530B62C93D89AE46BCA5B2312E4AAD6</code> <code>8460E32D63E990A75AB8E51017E4FC80</code> <code>6C990D0452FE42EDF57E6D7B85157CB7</code> <code>B60C975F512F3E4CEA21781FAAED4704</code> <code>CF810620BC59FF2975693628A1E378BB</code> <code>C18A9343738A677B12A2000D1B3F2943</code> <code>4B6019B1A27C94EC786C1209CCAE1DC6</code><br> <code>375FE95C</code></td>
|
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>8268AE66</code> (1722706050 in decimal)</td>
|
|
|
|
|
<td><code>BF72AE66</code> (1722708671 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B581BAA8901B7963A69A8E8BEBC10593FD9CFCEEB610AFF66473951EA6F9784CF
|
|
|
|
|
<h5><a class="anchor" href="#7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message" id="7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message" name="7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message"><i class="anchor-icon"></i></a>7) Client computes random 2048-bit number <em>b</em> (using a sufficient amount of entropy) and sends the server a message</h5>
|
|
|
|
|
<p>First, generate a secure random 2048-bit number b:</p>
|
|
|
|
|
<!-- start b -->
|
|
|
|
|
<pre><code>b = 2D31A8A808F5E5E54A9FC59FB282245A5B7333CEF72AC877C911E9B4CA3977D7E9CD657AEA138E3FB9BA15ACEF338C049F59F9A0073EE37C95B4A8255735DF1B8C9C711851EB997E2696466D46B67715B0689EC79FC4E7D30278A75D7D29293638761171619B328348F1680960E6031FE398B3AFC70B097833173F2C4CA14EFA110A8304D9BA70801B40D9508DA1BC7CA56D0C06D31B3ADA169ED9AA42344544D1A1AD18C95A61F28987455AE7E1521A70A1E433E3B5FF832F4E273115BEB1C28686B4F69844E68B89078AA28A5B048027170CF24C71371E399DA78F20514783EC871D13E4B9CFD054A107557BCAC353FCFF0B4ABACC143EFA2EF1EB27BC437C</code></pre>
|
|
|
|
|
<pre><code>b = CDB97A803C4B396F18113566E043087EA1FF978C66A5597D8379F2E737206C9BE578CC10054270D7B8F6C53E65539726673DA5ADA81C89A2DD37AFDFE5DAD9614D36E3E5281FF261F6DDF2515A8200020E360E670314D71BEACAACD68C4962E005885434A35C13D9FAE943AD0558ABFD96EAE5EDAAEEF7B125E693E89CDB2D8419F8EB57A4E786DC60B2482E7EEE8D6F5894EB750B27AD44829549C01EA98E4878C5DFD26CCC3A69D8729E6B4FC0B3155E896CF5DE6AAE8C7EAE8BBC4AF8272A5190D083A32D80D539EBFD27EB5D117ED33A85C906EF3C51219D8C6FA8641F453E8A5B1CDCF041DCC15C1AAA0C5E65B987053B2AD5A65E48B74E985357916293</code></pre>
|
|
|
|
|
<!-- end b -->
|
|
|
|
|
<p>Then compute <code>g_b = pow(g, b) mod dh_prime</code></p>
|
|
|
|
|
<!-- start g_b -->
|
|
|
|
|
<pre><code>g_b = AC31D4BF09B3D713DCEF1D4D74C3591E05DC39C41BF08FED8D9FA89258E137D3E09AD57593D22616835AB9476B78E3B438B92077574DE56B2026B72CD4963E170566EBB87DBD6549EC656663D5326A7F071326470B5B2AEE70A904FD509785DF360A672CF226F92613DB090D4C56F7D77CAB1B602D468C863DA10C82D853C68AEC5CAF28F53D8F7E488093F992CC0AF0CA71D24C46F899CAEDA29B3752B0B68E4F2F529EFCACAFA2FC76DBFF2ABAC3B8E414CC1216B5E4D72AFA8F5838F133501CBA81132562FA563877C08C0FAEBE1404C27208BE21621B4046ECF68C33A469F7E8ABF7E2EAEE2187B563B58CE441A6314299C8A4A1D2AD6F6CC5C9D507FD1E</code></pre>
|
|
|
|
|
<pre><code>g_b = 8A2CB602C36171DB8B884A52F73FFD24B53C988587C4110A9D0C99B6093939BD8444B6E2FAD50B0ABFB2D953086F5DD4DAB2F870D4E702434B229B05ABC5AD9D12A6E945EAA86701D84565A8FA99A9DB5AA1A58D3C081E52F4701063E202641975B10531F931639B152B2869BD2B9E7279677D3F5EE56A216365B222B06F94D616390FEC09747A7F9CC55098D9BF6836B5219B88BED2351BE98A45ED6353D2A20974F040496C53CA6C592D5750C5D93BF09CF38C281EA487330572178B0F91F6F4F61903D02953F1F8E0C059357566470F8F1743F8260B3519188815ADCAD95E6F4D9067BFB41FC8E41C6E05F25C5A12BAF39D2070F303BEE13CAC7C4AE90ED5</code></pre>
|
|
|
|
|
<!-- end g_b -->
|
|
|
|
|
<h6>7.1) generation of encrypted_data</h6>
|
|
|
|
|
<!-- start client_DH_inner_data -->
|
|
|
|
|
<p>Generated payload (excluding transport headers/trailers):</p>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 81 BA A8 90 1B 79 63 A6 9A 8E 8B EB
|
|
|
|
|
0010 | C1 05 93 FD 9C FC EE B6 10 AF F6 64 73 95 1E A6
|
|
|
|
|
0020 | F9 78 4C F9 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | AC 31 D4 BF 09 B3 D7 13 DC EF 1D 4D 74 C3 59 1E
|
|
|
|
|
0040 | 05 DC 39 C4 1B F0 8F ED 8D 9F A8 92 58 E1 37 D3
|
|
|
|
|
0050 | E0 9A D5 75 93 D2 26 16 83 5A B9 47 6B 78 E3 B4
|
|
|
|
|
0060 | 38 B9 20 77 57 4D E5 6B 20 26 B7 2C D4 96 3E 17
|
|
|
|
|
0070 | 05 66 EB B8 7D BD 65 49 EC 65 66 63 D5 32 6A 7F
|
|
|
|
|
0080 | 07 13 26 47 0B 5B 2A EE 70 A9 04 FD 50 97 85 DF
|
|
|
|
|
0090 | 36 0A 67 2C F2 26 F9 26 13 DB 09 0D 4C 56 F7 D7
|
|
|
|
|
00A0 | 7C AB 1B 60 2D 46 8C 86 3D A1 0C 82 D8 53 C6 8A
|
|
|
|
|
00B0 | EC 5C AF 28 F5 3D 8F 7E 48 80 93 F9 92 CC 0A F0
|
|
|
|
|
00C0 | CA 71 D2 4C 46 F8 99 CA ED A2 9B 37 52 B0 B6 8E
|
|
|
|
|
00D0 | 4F 2F 52 9E FC AC AF A2 FC 76 DB FF 2A BA C3 B8
|
|
|
|
|
00E0 | E4 14 CC 12 16 B5 E4 D7 2A FA 8F 58 38 F1 33 50
|
|
|
|
|
00F0 | 1C BA 81 13 25 62 FA 56 38 77 C0 8C 0F AE BE 14
|
|
|
|
|
0100 | 04 C2 72 08 BE 21 62 1B 40 46 EC F6 8C 33 A4 69
|
|
|
|
|
0110 | F7 E8 AB F7 E2 EA EE 21 87 B5 63 B5 8C E4 41 A6
|
|
|
|
|
0120 | 31 42 99 C8 A4 A1 D2 AD 6F 6C C5 C9 D5 07 FD 1E</code></pre>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 59 61 46 10 15 D1 2F 9A 72 99 59 CC
|
|
|
|
|
0010 | 38 A8 12 1E 3A 55 D0 19 2D C6 6C 12 8C 5C 5E C5
|
|
|
|
|
0020 | C4 F0 25 B1 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 8A 2C B6 02 C3 61 71 DB 8B 88 4A 52 F7 3F FD 24
|
|
|
|
|
0040 | B5 3C 98 85 87 C4 11 0A 9D 0C 99 B6 09 39 39 BD
|
|
|
|
|
0050 | 84 44 B6 E2 FA D5 0B 0A BF B2 D9 53 08 6F 5D D4
|
|
|
|
|
0060 | DA B2 F8 70 D4 E7 02 43 4B 22 9B 05 AB C5 AD 9D
|
|
|
|
|
0070 | 12 A6 E9 45 EA A8 67 01 D8 45 65 A8 FA 99 A9 DB
|
|
|
|
|
0080 | 5A A1 A5 8D 3C 08 1E 52 F4 70 10 63 E2 02 64 19
|
|
|
|
|
0090 | 75 B1 05 31 F9 31 63 9B 15 2B 28 69 BD 2B 9E 72
|
|
|
|
|
00A0 | 79 67 7D 3F 5E E5 6A 21 63 65 B2 22 B0 6F 94 D6
|
|
|
|
|
00B0 | 16 39 0F EC 09 74 7A 7F 9C C5 50 98 D9 BF 68 36
|
|
|
|
|
00C0 | B5 21 9B 88 BE D2 35 1B E9 8A 45 ED 63 53 D2 A2
|
|
|
|
|
00D0 | 09 74 F0 40 49 6C 53 CA 6C 59 2D 57 50 C5 D9 3B
|
|
|
|
|
00E0 | F0 9C F3 8C 28 1E A4 87 33 05 72 17 8B 0F 91 F6
|
|
|
|
|
00F0 | F4 F6 19 03 D0 29 53 F1 F8 E0 C0 59 35 75 66 47
|
|
|
|
|
0100 | 0F 8F 17 43 F8 26 0B 35 19 18 88 15 AD CA D9 5E
|
|
|
|
|
0110 | 6F 4D 90 67 BF B4 1F C8 E4 1C 6E 05 F2 5C 5A 12
|
|
|
|
|
0120 | BA F3 9D 20 70 F3 03 BE E1 3C AC 7C 4A E9 0E D5</code></pre>
|
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
|
<pre><code>client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;</code></pre>
|
|
|
|
|
<table class="table">
|
|
|
|
@ -658,19 +658,19 @@ answer = BA0D89B581BAA8901B7963A69A8E8BEBC10593FD9CFCEEB610AFF66473951EA6F9784CF
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>81BAA8901B7963A69A8E8BEBC10593FD</code></td>
|
|
|
|
|
<td><code>5961461015D12F9A729959CC38A8121E</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>9CFCEEB610AFF66473951EA6F9784CF9</code></td>
|
|
|
|
|
<td><code>3A55D0192DC66C128C5C5EC5C4F025B1</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE000100AC31D4BF09B3D713DCEF1D4D</code> <code>74C3591E05DC39C41BF08FED8D9FA892</code> <code>58E137D3E09AD57593D22616835AB947</code> <code>6B78E3B438B92077574DE56B2026B72C</code> <code>D4963E170566EBB87DBD6549EC656663</code> <code>D5326A7F071326470B5B2AEE70A904FD</code> <code>509785DF360A672CF226F92613DB090D</code> <code>4C56F7D77CAB1B602D468C863DA10C82</code> <code>D853C68AEC5CAF28F53D8F7E488093F9</code> <code>92CC0AF0CA71D24C46F899CAEDA29B37</code> <code>52B0B68E4F2F529EFCACAFA2FC76DBFF</code> <code>2ABAC3B8E414CC1216B5E4D72AFA8F58</code> <code>38F133501CBA81132562FA563877C08C</code> <code>0FAEBE1404C27208BE21621B4046ECF6</code> <code>8C33A469F7E8ABF7E2EAEE2187B563B5</code> <code>8CE441A6314299C8A4A1D2AD6F6CC5C9</code><br> <code>D507FD1E</code></td>
|
|
|
|
|
<td><code>FE0001008A2CB602C36171DB8B884A52</code> <code>F73FFD24B53C988587C4110A9D0C99B6</code> <code>093939BD8444B6E2FAD50B0ABFB2D953</code> <code>086F5DD4DAB2F870D4E702434B229B05</code> <code>ABC5AD9D12A6E945EAA86701D84565A8</code> <code>FA99A9DB5AA1A58D3C081E52F4701063</code> <code>E202641975B10531F931639B152B2869</code> <code>BD2B9E7279677D3F5EE56A216365B222</code> <code>B06F94D616390FEC09747A7F9CC55098</code> <code>D9BF6836B5219B88BED2351BE98A45ED</code> <code>6353D2A20974F040496C53CA6C592D57</code> <code>50C5D93BF09CF38C281EA48733057217</code> <code>8B0F91F6F4F61903D02953F1F8E0C059</code> <code>357566470F8F1743F8260B3519188815</code> <code>ADCAD95E6F4D9067BFB41FC8E41C6E05</code> <code>F25C5A12BAF39D2070F303BEE13CAC7C</code><br> <code>4AE90ED5</code></td>
|
|
|
|
|
<td>Single-byte prefix denoting length, a 256-byte (2048-bit) string, and zero bytes of padding</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -684,47 +684,47 @@ answer = BA0D89B581BAA8901B7963A69A8E8BEBC10593FD9CFCEEB610AFF66473951EA6F9784CF
|
|
|
|
|
<!-- end client_DH_inner_data -->
|
|
|
|
|
<p>The serialization of <em>Client_DH_Inner_Data</em> produces a string <strong>data</strong>. This is used to generate <strong>encrypted_data</strong> as specified in <a href="#7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message">step 6</a>, using the following inputs:</p>
|
|
|
|
|
<!-- start client_DH_inner_data_input -->
|
|
|
|
|
<pre><code>data = 54B6436681BAA8901B7963A69A8E8BEBC10593FD9CFCEEB610AFF66473951EA6F9784CF90000000000000000FE000100AC31D4BF09B3D713DCEF1D4D74C3591E05DC39C41BF08FED8D9FA89258E137D3E09AD57593D22616835AB9476B78E3B438B92077574DE56B2026B72CD4963E170566EBB87DBD6549EC656663D5326A7F071326470B5B2AEE70A904FD509785DF360A672CF226F92613DB090D4C56F7D77CAB1B602D468C863DA10C82D853C68AEC5CAF28F53D8F7E488093F992CC0AF0CA71D24C46F899CAEDA29B3752B0B68E4F2F529EFCACAFA2FC76DBFF2ABAC3B8E414CC1216B5E4D72AFA8F5838F133501CBA81132562FA563877C08C0FAEBE1404C27208BE21621B4046ECF68C33A469F7E8ABF7E2EAEE2187B563B58CE441A6314299C8A4A1D2AD6F6CC5C9D507FD1E
|
|
|
|
|
padding = 6BF96602E0860E13C471AFA6
|
|
|
|
|
tmp_aes_key = 193D433DA179C2B9BBEC2861895A71A884B707887D2CE6D60BD2E9AAAB243E91
|
|
|
|
|
tmp_aes_iv = 46D34D4E464337AC6C81E0E4D58B221A353C524BFE62B059B152350A47001B49</code></pre>
|
|
|
|
|
<pre><code>data = 54B643665961461015D12F9A729959CC38A8121E3A55D0192DC66C128C5C5EC5C4F025B10000000000000000FE0001008A2CB602C36171DB8B884A52F73FFD24B53C988587C4110A9D0C99B6093939BD8444B6E2FAD50B0ABFB2D953086F5DD4DAB2F870D4E702434B229B05ABC5AD9D12A6E945EAA86701D84565A8FA99A9DB5AA1A58D3C081E52F4701063E202641975B10531F931639B152B2869BD2B9E7279677D3F5EE56A216365B222B06F94D616390FEC09747A7F9CC55098D9BF6836B5219B88BED2351BE98A45ED6353D2A20974F040496C53CA6C592D5750C5D93BF09CF38C281EA487330572178B0F91F6F4F61903D02953F1F8E0C059357566470F8F1743F8260B3519188815ADCAD95E6F4D9067BFB41FC8E41C6E05F25C5A12BAF39D2070F303BEE13CAC7C4AE90ED5
|
|
|
|
|
padding = 4ECF342F2E5560E2D79E447D
|
|
|
|
|
tmp_aes_key = 8FE1C7AA466D69BC2CA662D231CBA55187624040931DF384876D11FDBB183CEF
|
|
|
|
|
tmp_aes_iv = DAE265F5C19D6BA057B409EE108DF6D9ADCA5DBDFF95D662DDB7E9CE4DE43B54</code></pre>
|
|
|
|
|
<!-- end client_DH_inner_data_input -->
|
|
|
|
|
<p>Process:</p>
|
|
|
|
|
<pre><code>data_with_hash := SHA1(data) + data + padding (0-15 random bytes such that total length is divisible by 16)
|
|
|
|
|
encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);</code></pre>
|
|
|
|
|
<p>Output:</p>
|
|
|
|
|
<!-- start client_DH_inner_data_output -->
|
|
|
|
|
<pre><code>encrypted_data = ED09946D9708F80E7E1EC8B8BE8681727E4D0E2C3D64E39518BD987155090D3AFAE586E728028EE2973AD2D55B9B818A5BC615925D6B2C8FAAA65DB022472FF937FD2F0ADFE06ED1297252F47AC605DDAF3472FD3141D3ED690E6E9EDB6D230A28B0C9AB38C4417F620E85357B2DEFF3E320A4AC0F11B83499FA934CD5D67A9C75138FC1DE2564E886E7055DDF27BE0F9CE8F483D6B92B8401717A4173896498393BD79D8050BC683910FE6713C520CFFE09617576F11C62B9CCAD38BF06FA5CBE3BE3D4721D69ED0343CD3FCEE9E861165FBF5089896CF320D2BF5E0ED3793856944182742BE978AFC85EA38809260C318EB4AAD260367FD5A21503EB58ECB682D08B3BAA37B90646DD6AF8FB403C336210188FD97C33BD653A30C207862C943CCC614830A28A523CE195F23C0027CB14A1894458D870B210F19CB4F30D5109B2F5B1B62D11F2F46E8704B0615489E0</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 6C7EE84A9DA45C60DC25B3D6BBA412C55EB42F6097CF105E48896297C948BB5F8C070FC25C3F0F31D20AE916A257998F97385FDDE030DF934A84A620B134774D2B160577285F81D375AA32660CE38A1DC16A53C3A752A4AC530B7EF4DEA4928BDAD94F2851F3103CDEC4ED3E04AB5F5FA5EB01B3D3192E0A061657EF4E4DE6812FCB470210D66BE8BDDFC9DE3F38EC259AACAE6348B115759C792F95E6943CA186DFA52BF228F4C92F8A4FC1C84446C748B5B65382EBA2B40E1527D3EEAB048F33F43EA1840B2DBE58B2A48B99A3C86C1A437921A764D4A67374675D6782E2CA0555D83B956B36DAE58C43308396F7F2802939EB4A050E6923E0AE45A6CA85E39B00667429E88341C6E352159E4FCB26BA5A6A5ABF208D28F3E50AB65AE8DA7C3440CE6C09059C45AAD08CD8DC92123189E3DF9107C2173B0A8678F06E0159D55B1708222CCAF69209BEB40498075920</code></pre>
|
|
|
|
|
<!-- end client_DH_inner_data_output -->
|
|
|
|
|
<p>The length of the final string is 336 bytes.</p>
|
|
|
|
|
<h6>7.2) set_client_DH_params query</h6>
|
|
|
|
|
<!-- start set_client_DH_params -->
|
|
|
|
|
<p>Sent payload (excluding transport headers/trailers):</p>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 F0 4B 04 00 82 68 AE 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 81 BA A8 90 1B 79 63 A6
|
|
|
|
|
0020 | 9A 8E 8B EB C1 05 93 FD 9C FC EE B6 10 AF F6 64
|
|
|
|
|
0030 | 73 95 1E A6 F9 78 4C F9 FE 50 01 00 ED 09 94 6D
|
|
|
|
|
0040 | 97 08 F8 0E 7E 1E C8 B8 BE 86 81 72 7E 4D 0E 2C
|
|
|
|
|
0050 | 3D 64 E3 95 18 BD 98 71 55 09 0D 3A FA E5 86 E7
|
|
|
|
|
0060 | 28 02 8E E2 97 3A D2 D5 5B 9B 81 8A 5B C6 15 92
|
|
|
|
|
0070 | 5D 6B 2C 8F AA A6 5D B0 22 47 2F F9 37 FD 2F 0A
|
|
|
|
|
0080 | DF E0 6E D1 29 72 52 F4 7A C6 05 DD AF 34 72 FD
|
|
|
|
|
0090 | 31 41 D3 ED 69 0E 6E 9E DB 6D 23 0A 28 B0 C9 AB
|
|
|
|
|
00A0 | 38 C4 41 7F 62 0E 85 35 7B 2D EF F3 E3 20 A4 AC
|
|
|
|
|
00B0 | 0F 11 B8 34 99 FA 93 4C D5 D6 7A 9C 75 13 8F C1
|
|
|
|
|
00C0 | DE 25 64 E8 86 E7 05 5D DF 27 BE 0F 9C E8 F4 83
|
|
|
|
|
00D0 | D6 B9 2B 84 01 71 7A 41 73 89 64 98 39 3B D7 9D
|
|
|
|
|
00E0 | 80 50 BC 68 39 10 FE 67 13 C5 20 CF FE 09 61 75
|
|
|
|
|
00F0 | 76 F1 1C 62 B9 CC AD 38 BF 06 FA 5C BE 3B E3 D4
|
|
|
|
|
0100 | 72 1D 69 ED 03 43 CD 3F CE E9 E8 61 16 5F BF 50
|
|
|
|
|
0110 | 89 89 6C F3 20 D2 BF 5E 0E D3 79 38 56 94 41 82
|
|
|
|
|
0120 | 74 2B E9 78 AF C8 5E A3 88 09 26 0C 31 8E B4 AA
|
|
|
|
|
0130 | D2 60 36 7F D5 A2 15 03 EB 58 EC B6 82 D0 8B 3B
|
|
|
|
|
0140 | AA 37 B9 06 46 DD 6A F8 FB 40 3C 33 62 10 18 8F
|
|
|
|
|
0150 | D9 7C 33 BD 65 3A 30 C2 07 86 2C 94 3C CC 61 48
|
|
|
|
|
0160 | 30 A2 8A 52 3C E1 95 F2 3C 00 27 CB 14 A1 89 44
|
|
|
|
|
0170 | 58 D8 70 B2 10 F1 9C B4 F3 0D 51 09 B2 F5 B1 B6
|
|
|
|
|
0180 | 2D 11 F2 F4 6E 87 04 B0 61 54 89 E0</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 64 25 05 00 C0 72 AE 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 59 61 46 10 15 D1 2F 9A
|
|
|
|
|
0020 | 72 99 59 CC 38 A8 12 1E 3A 55 D0 19 2D C6 6C 12
|
|
|
|
|
0030 | 8C 5C 5E C5 C4 F0 25 B1 FE 50 01 00 6C 7E E8 4A
|
|
|
|
|
0040 | 9D A4 5C 60 DC 25 B3 D6 BB A4 12 C5 5E B4 2F 60
|
|
|
|
|
0050 | 97 CF 10 5E 48 89 62 97 C9 48 BB 5F 8C 07 0F C2
|
|
|
|
|
0060 | 5C 3F 0F 31 D2 0A E9 16 A2 57 99 8F 97 38 5F DD
|
|
|
|
|
0070 | E0 30 DF 93 4A 84 A6 20 B1 34 77 4D 2B 16 05 77
|
|
|
|
|
0080 | 28 5F 81 D3 75 AA 32 66 0C E3 8A 1D C1 6A 53 C3
|
|
|
|
|
0090 | A7 52 A4 AC 53 0B 7E F4 DE A4 92 8B DA D9 4F 28
|
|
|
|
|
00A0 | 51 F3 10 3C DE C4 ED 3E 04 AB 5F 5F A5 EB 01 B3
|
|
|
|
|
00B0 | D3 19 2E 0A 06 16 57 EF 4E 4D E6 81 2F CB 47 02
|
|
|
|
|
00C0 | 10 D6 6B E8 BD DF C9 DE 3F 38 EC 25 9A AC AE 63
|
|
|
|
|
00D0 | 48 B1 15 75 9C 79 2F 95 E6 94 3C A1 86 DF A5 2B
|
|
|
|
|
00E0 | F2 28 F4 C9 2F 8A 4F C1 C8 44 46 C7 48 B5 B6 53
|
|
|
|
|
00F0 | 82 EB A2 B4 0E 15 27 D3 EE AB 04 8F 33 F4 3E A1
|
|
|
|
|
0100 | 84 0B 2D BE 58 B2 A4 8B 99 A3 C8 6C 1A 43 79 21
|
|
|
|
|
0110 | A7 64 D4 A6 73 74 67 5D 67 82 E2 CA 05 55 D8 3B
|
|
|
|
|
0120 | 95 6B 36 DA E5 8C 43 30 83 96 F7 F2 80 29 39 EB
|
|
|
|
|
0130 | 4A 05 0E 69 23 E0 AE 45 A6 CA 85 E3 9B 00 66 74
|
|
|
|
|
0140 | 29 E8 83 41 C6 E3 52 15 9E 4F CB 26 BA 5A 6A 5A
|
|
|
|
|
0150 | BF 20 8D 28 F3 E5 0A B6 5A E8 DA 7C 34 40 CE 6C
|
|
|
|
|
0160 | 09 05 9C 45 AA D0 8C D8 DC 92 12 31 89 E3 DF 91
|
|
|
|
|
0170 | 07 C2 17 3B 0A 86 78 F0 6E 01 59 D5 5B 17 08 22
|
|
|
|
|
0180 | 2C CA F6 92 09 BE B4 04 98 07 59 20</code></pre>
|
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
|
<pre><code>set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;</code></pre>
|
|
|
|
|
<table class="table">
|
|
|
|
@ -746,7 +746,7 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>F04B04008268AE66</code></td>
|
|
|
|
|
<td><code>64250500C072AE66</code></td>
|
|
|
|
|
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -764,19 +764,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>81BAA8901B7963A69A8E8BEBC10593FD</code></td>
|
|
|
|
|
<td><code>5961461015D12F9A729959CC38A8121E</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>9CFCEEB610AFF66473951EA6F9784CF9</code></td>
|
|
|
|
|
<td><code>3A55D0192DC66C128C5C5EC5C4F025B1</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE500100ED09946D9708F80E7E1EC8B8</code> <code>BE8681727E4D0E2C3D64E39518BD9871</code> <code>55090D3AFAE586E728028EE2973AD2D5</code> <code>5B9B818A5BC615925D6B2C8FAAA65DB0</code> <code>22472FF937FD2F0ADFE06ED1297252F4</code> <code>7AC605DDAF3472FD3141D3ED690E6E9E</code> <code>DB6D230A28B0C9AB38C4417F620E8535</code> <code>7B2DEFF3E320A4AC0F11B83499FA934C</code> <code>D5D67A9C75138FC1DE2564E886E7055D</code> <code>DF27BE0F9CE8F483D6B92B8401717A41</code> <code>73896498393BD79D8050BC683910FE67</code> <code>13C520CFFE09617576F11C62B9CCAD38</code> <code>BF06FA5CBE3BE3D4721D69ED0343CD3F</code> <code>CEE9E861165FBF5089896CF320D2BF5E</code> <code>0ED3793856944182742BE978AFC85EA3</code> <code>8809260C318EB4AAD260367FD5A21503</code> <code>EB58ECB682D08B3BAA37B90646DD6AF8</code> <code>FB403C336210188FD97C33BD653A30C2</code> <code>07862C943CCC614830A28A523CE195F2</code> <code>3C0027CB14A1894458D870B210F19CB4</code> <code>F30D5109B2F5B1B62D11F2F46E8704B0</code><br> <code>615489E0</code></td>
|
|
|
|
|
<td><code>FE5001006C7EE84A9DA45C60DC25B3D6</code> <code>BBA412C55EB42F6097CF105E48896297</code> <code>C948BB5F8C070FC25C3F0F31D20AE916</code> <code>A257998F97385FDDE030DF934A84A620</code> <code>B134774D2B160577285F81D375AA3266</code> <code>0CE38A1DC16A53C3A752A4AC530B7EF4</code> <code>DEA4928BDAD94F2851F3103CDEC4ED3E</code> <code>04AB5F5FA5EB01B3D3192E0A061657EF</code> <code>4E4DE6812FCB470210D66BE8BDDFC9DE</code> <code>3F38EC259AACAE6348B115759C792F95</code> <code>E6943CA186DFA52BF228F4C92F8A4FC1</code> <code>C84446C748B5B65382EBA2B40E1527D3</code> <code>EEAB048F33F43EA1840B2DBE58B2A48B</code> <code>99A3C86C1A437921A764D4A67374675D</code> <code>6782E2CA0555D83B956B36DAE58C4330</code> <code>8396F7F2802939EB4A050E6923E0AE45</code> <code>A6CA85E39B00667429E88341C6E35215</code> <code>9E4FCB26BA5A6A5ABF208D28F3E50AB6</code> <code>5AE8DA7C3440CE6C09059C45AAD08CD8</code> <code>DC92123189E3DF9107C2173B0A8678F0</code> <code>6E0159D55B1708222CCAF69209BEB404</code><br> <code>98075920</code></td>
|
|
|
|
|
<td>Encrypted client_DH_inner_data generated previously, serialized as a TL byte string</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -785,17 +785,17 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
|
|
|
|
|
<h5><a class="anchor" href="#8-auth-key-generation" id="8-auth-key-generation" name="8-auth-key-generation"><i class="anchor-icon"></i></a>8) Auth key generation</h5>
|
|
|
|
|
<p>The client computes the auth_key using formula <code>g_a^b mod dh_prime</code>:</p>
|
|
|
|
|
<!-- start auth_key -->
|
|
|
|
|
<pre><code>auth_key = 24A37A35A158CDCE75FD48B39EC25D533C05D89FC6C4E8BC63A166CAA66962FFA1CBE96115A0586C5EDA91DEE03758D258BD91F744EA591AFD0AB9356CB9D1CD7B1D00F418F23A158D3BAF8D4E0044D951E0A3A36B16B7E8AE30F838B73A8D5DFE07481724695CBE632FC70F8615774D52492236F9379278A29AB02FFA496D43BAA634D9AB297AF93BA532ACF21872DCA2206332CD5FC0711FD0AEDE548814C4A7F22EF6B54010BD4D16A395DFDCAC38626A3F93F44DD2C008DEFB7396D3FAE822F6B273EFF6F9CD53C977ED96E86281480DB1112352BAB990D8F6151905722714BA0881C60A7624BD4B6B57F7D7DF77238E9E436A248625C9F36B24A066CBE5</code></pre>
|
|
|
|
|
<pre><code>auth_key = 3A1797B1E1CC13A1AA51DEB4E8744622F60BE8D49692F3B1FF86A21A6793F54D7BC5E9747CA6D656222EDB0141575AEBD4B468C342F54E91033F7DAADCEBC1E306D634CF2C929273F118290E130FEAEF6DBB26289AD655C667D02DB106585CCC813185ED7E1B642D487FBF58135F31B57840BBB386E377EA7BAB1D4708D9732C531FF8625EB246894B91C1C19EE837472A20BEBE8384836678C4C21EC0432F82048EE3F27A6AB9028BC97342A27C6F98C427A3E99C41803A509CB4C5D03D091EE61B15D2CC0502AEEBCE102352A79DEA4B7208E9A3800AF50053B849761473BF53845D14BDB5F88E1E7A95D243D33A52BB9D178B3A2A0F43470E7FF188914B02</code></pre>
|
|
|
|
|
<!-- end auth_key -->
|
|
|
|
|
<h5><a class="anchor" href="#9-final-server-reply" id="9-final-server-reply" name="9-final-server-reply"><i class="anchor-icon"></i></a>9) Final server reply</h5>
|
|
|
|
|
<p>The server verifies and confirms that auth_key_hash is unique: since it's unique, it replies with the following:</p>
|
|
|
|
|
<!-- start dh_gen_ok -->
|
|
|
|
|
<p>Received payload (excluding transport headers/trailers):</p>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 E0 8C 9E 82 68 AE 66
|
|
|
|
|
0010 | 90 00 00 00 34 F7 CB 3B 81 BA A8 90 1B 79 63 A6
|
|
|
|
|
0020 | 9A 8E 8B EB C1 05 93 FD 9C FC EE B6 10 AF F6 64
|
|
|
|
|
0030 | 73 95 1E A6 F9 78 4C F9 92 E5 40 DB 4E FF B8 D9
|
|
|
|
|
0040 | 2F 92 4D 74 83 D5 DC EF</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 A4 40 54 C1 72 AE 66
|
|
|
|
|
0010 | 8C 00 00 00 34 F7 CB 3B 59 61 46 10 15 D1 2F 9A
|
|
|
|
|
0020 | 72 99 59 CC 38 A8 12 1E 3A 55 D0 19 2D C6 6C 12
|
|
|
|
|
0030 | 8C 5C 5E C5 C4 F0 25 B1 DA 0C 2F 2A 94 0C 1C 0E
|
|
|
|
|
0040 | 06 15 DD B1 B2 2A B0 FF</code></pre>
|
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
|
<pre><code>dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;</code></pre>
|
|
|
|
|
<table class="table">
|
|
|
|
@ -817,13 +817,13 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>01E08C9E8268AE66</code></td>
|
|
|
|
|
<td><code>01A44054C172AE66</code></td>
|
|
|
|
|
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_length</td>
|
|
|
|
|
<td>16, 4</td>
|
|
|
|
|
<td><code>90000000</code> (144 in decimal)</td>
|
|
|
|
|
<td><code>8C000000</code> (140 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -835,19 +835,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>81BAA8901B7963A69A8E8BEBC10593FD</code></td>
|
|
|
|
|
<td><code>5961461015D12F9A729959CC38A8121E</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>9CFCEEB610AFF66473951EA6F9784CF9</code></td>
|
|
|
|
|
<td><code>3A55D0192DC66C128C5C5EC5C4F025B1</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>92E540DB4EFFB8D92F924D7483D5DCEF</code></td>
|
|
|
|
|
<td><code>DA0C2F2A940C1C0E0615DDB1B22AB0FF</code></td>
|
|
|
|
|
<td>The 128 lower-order bits of SHA1 of the byte string derived from the <code>new_nonce</code> string by adding a single byte with the value of 1, 2, or 3, and followed by another 8 bytes with <code>auth_key_aux_hash</code>. Different values are required to prevent an intruder from changing server response dh_gen_ok into dh_gen_retry.</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|