|
|
|
@ -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 04 57 05 00 32 33 84 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 67 F6 E1 F4 DA E0 9F 02
|
|
|
|
|
0020 | 21 53 DD D2 73 3C 2E 26</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 7C EF 05 00 54 36 88 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE F4 1E 05 98 BA BA EF 42
|
|
|
|
|
0020 | 9A 98 83 ED F3 C9 47 22</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>0457050032338466</code></td>
|
|
|
|
|
<td><code>7CEF050054368866</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>67F6E1F4DAE09F022153DDD2733C2E26</code></td>
|
|
|
|
|
<td><code>F41E0598BABAEF429A9883EDF3C94722</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 38 07 FD 32 33 84 66
|
|
|
|
|
0010 | 9C 00 00 00 63 24 16 05 67 F6 E1 F4 DA E0 9F 02
|
|
|
|
|
0020 | 21 53 DD D2 73 3C 2E 26 80 EF C4 FA AE 09 0C 46
|
|
|
|
|
0030 | 7E DE 04 9A 55 81 12 3E 08 18 9F 8E C6 EE E0 55
|
|
|
|
|
0040 | C5 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 7C 5B 47 54 36 88 66
|
|
|
|
|
0010 | 78 00 00 00 63 24 16 05 F4 1E 05 98 BA BA EF 42
|
|
|
|
|
0020 | 9A 98 83 ED F3 C9 47 22 F3 62 D2 D6 A6 22 24 04
|
|
|
|
|
0030 | 75 83 86 C4 3F CF E9 42 08 18 5C 9D 9E 55 2F C9
|
|
|
|
|
0040 | 93 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>013807FD32338466</code></td>
|
|
|
|
|
<td><code>017C5B4754368866</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>9C000000</code> (156 in decimal)</td>
|
|
|
|
|
<td><code>78000000</code> (120 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>67F6E1F4DAE09F022153DDD2733C2E26</code></td>
|
|
|
|
|
<td><code>F41E0598BABAEF429A9883EDF3C94722</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>80EFC4FAAE090C467EDE049A5581123E</code></td>
|
|
|
|
|
<td><code>F362D2D6A6222404758386C43FCFE942</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>08189F8EC6EEE055C5000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1774293763269612997</td>
|
|
|
|
|
<td><code>08185C9D9E552FC993000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1755451258127239571</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 = 1774293763269612997</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1774293763269612997 = 1155057941 * 1536108017</code></p>
|
|
|
|
|
<pre><code>p = 1155057941
|
|
|
|
|
q = 1536108017</code></pre>
|
|
|
|
|
<pre><code>pq = 1755451258127239571</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1755451258127239571 = 1027635551 * 1708243021</code></p>
|
|
|
|
|
<pre><code>p = 1027635551
|
|
|
|
|
q = 1708243021</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 18 9F 8E C6 EE E0 55 C5 00 00 00
|
|
|
|
|
0010 | 04 44 D8 C9 15 00 00 00 04 5B 8F 25 F1 00 00 00
|
|
|
|
|
0020 | 67 F6 E1 F4 DA E0 9F 02 21 53 DD D2 73 3C 2E 26
|
|
|
|
|
0030 | 80 EF C4 FA AE 09 0C 46 7E DE 04 9A 55 81 12 3E
|
|
|
|
|
0040 | C3 22 18 C0 56 1D BA 27 4A 04 E5 A1 EF 71 FB 5F
|
|
|
|
|
0050 | 3A 19 D9 4B E9 17 B3 D3 29 CE 94 AA 2B 0D 18 02
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 18 5C 9D 9E 55 2F C9 93 00 00 00
|
|
|
|
|
0010 | 04 3D 40 79 5F 00 00 00 04 65 D1 B8 4D 00 00 00
|
|
|
|
|
0020 | F4 1E 05 98 BA BA EF 42 9A 98 83 ED F3 C9 47 22
|
|
|
|
|
0030 | F3 62 D2 D6 A6 22 24 04 75 83 86 C4 3F CF E9 42
|
|
|
|
|
0040 | 09 1A AA 71 29 03 A7 A3 53 93 80 67 93 FB 93 84
|
|
|
|
|
0050 | DF 07 B0 CC 00 51 CC 62 53 35 80 E0 69 3A 1E E0
|
|
|
|
|
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 = 1536108017</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>08189F8EC6EEE055C5000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1774293763269612997</td>
|
|
|
|
|
<td><code>08185C9D9E552FC993000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1755451258127239571</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>0444D8C915000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1155057941</td>
|
|
|
|
|
<td><code>043D40795F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1027635551</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>045B8F25F1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1536108017</td>
|
|
|
|
|
<td><code>0465D1B84D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1708243021</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>67F6E1F4DAE09F022153DDD2733C2E26</code></td>
|
|
|
|
|
<td><code>F41E0598BABAEF429A9883EDF3C94722</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>80EFC4FAAE090C467EDE049A5581123E</code></td>
|
|
|
|
|
<td><code>F362D2D6A6222404758386C43FCFE942</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>C32218C0561DBA274A04E5A1EF71FB5F</code> <code>3A19D94BE917B3D329CE94AA2B0D1802</code></td>
|
|
|
|
|
<td><code>091AAA712903A7A35393806793FB9384</code> <code>DF07B0CC0051CC62533580E0693A1EE0</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1536108017</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 = 955FF5A908189F8EC6EEE055C50000000444D8C915000000045B8F25F100000067F6E1F4DAE09F022153DDD2733C2E2680EFC4FAAE090C467EDE049A5581123EC32218C0561DBA274A04E5A1EF71FB5F3A19D94BE917B3D329CE94AA2B0D180202000000
|
|
|
|
|
random_padding_bytes = CEEB8F53A85A094BDC120CDFAD2D3E88C58AA93ED6C4EAA09E7E1DC3236D04CEC465BBEC98B33372291C697ACCF8760498D79D9B81FB4FF98579266902DB25F1E7346397060C50DBB92622764A6F812475FC68879C54CC7609D23687</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A908185C9D9E552FC993000000043D40795F0000000465D1B84D000000F41E0598BABAEF429A9883EDF3C94722F362D2D6A6222404758386C43FCFE942091AAA712903A7A35393806793FB9384DF07B0CC0051CC62533580E0693A1EE002000000
|
|
|
|
|
random_padding_bytes = 9762C3C980F1F993A8E7F526C8E9BB1645F23C3ED26FEB50B52E56910FFC90AA619E1D0AD7D758E2F90CD2CFCC2B0DE4C06FB0D1D80196564D2B81C5D47F97119AD2054B8B0F6896E7279CF4C8A1D759ECF894EECE60ABB9C3E06B57</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 = C274E4EB5B00D34BF77B1B0873A0CE4D7D114030DEA90961D599C057893841CD90DEAC4B6D3C10926A9CD38306E789484FB17C6E03F6FB4AE99C6334FC0073970243D80550E1C4ECC4C1BAEA62147345E0525C5616C4364E63418434EBBB27AD1753A017595CF534281D0456AF65E46F3D0892971D3790B9DBFA4BF0A78E899F2C9A4DF18B9B469F13C6199833A69BF78853471E5FC51D96B852CB9DAC1D052527936A02E20A80EE477EE7EFDE44060554255E803EAB9DF16EEE9933DC36F66BCF5EF15E3391C8C871AD10C8B8322BC81E060E3AF8A70C0C9D806BCE54BBFE5FF6C1525A305B92055061434538AB6F1B1797A0BD86B08B69189502FFD575E97E</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = C8A5917FB4D2AB31BA447AC5947B5381B5385930ECD60675CEB94F3D68B53E4707CF8281A19A864E17915DE868A02896DF26D687DE1B76916D13952836D9B9D65811F9CBA39C28A71C1D0A5FD47118D0D4EB02ABBD5BBB447CBCCC16EC543D227AC7D6CA67E250359013FD5741B564D04F5A033D983AC8AD301A2EDE3B3CA0A7F41F8F3B8D8F704FCC941951130800FE6E4C898D99F80CCAD9BE7B3DAB0C266509CE3629EEFAA75D4BC7DDEB56552BF4D173B8E1716B8B638250E7F2F2B64A89E7F0222A521AE23026190514BAE8022571F26C224A9289DFDEFB5499B8B8DCF4875438D06248F967C61CF417C314BC2AC349D674B9BCE4E9D70A5B04479BC303</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 74 B4 07 00 33 33 84 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 67 F6 E1 F4 DA E0 9F 02
|
|
|
|
|
0020 | 21 53 DD D2 73 3C 2E 26 80 EF C4 FA AE 09 0C 46
|
|
|
|
|
0030 | 7E DE 04 9A 55 81 12 3E 04 44 D8 C9 15 00 00 00
|
|
|
|
|
0040 | 04 5B 8F 25 F1 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 C2 74 E4 EB 5B 00 D3 4B F7 7B 1B 08
|
|
|
|
|
0060 | 73 A0 CE 4D 7D 11 40 30 DE A9 09 61 D5 99 C0 57
|
|
|
|
|
0070 | 89 38 41 CD 90 DE AC 4B 6D 3C 10 92 6A 9C D3 83
|
|
|
|
|
0080 | 06 E7 89 48 4F B1 7C 6E 03 F6 FB 4A E9 9C 63 34
|
|
|
|
|
0090 | FC 00 73 97 02 43 D8 05 50 E1 C4 EC C4 C1 BA EA
|
|
|
|
|
00A0 | 62 14 73 45 E0 52 5C 56 16 C4 36 4E 63 41 84 34
|
|
|
|
|
00B0 | EB BB 27 AD 17 53 A0 17 59 5C F5 34 28 1D 04 56
|
|
|
|
|
00C0 | AF 65 E4 6F 3D 08 92 97 1D 37 90 B9 DB FA 4B F0
|
|
|
|
|
00D0 | A7 8E 89 9F 2C 9A 4D F1 8B 9B 46 9F 13 C6 19 98
|
|
|
|
|
00E0 | 33 A6 9B F7 88 53 47 1E 5F C5 1D 96 B8 52 CB 9D
|
|
|
|
|
00F0 | AC 1D 05 25 27 93 6A 02 E2 0A 80 EE 47 7E E7 EF
|
|
|
|
|
0100 | DE 44 06 05 54 25 5E 80 3E AB 9D F1 6E EE 99 33
|
|
|
|
|
0110 | DC 36 F6 6B CF 5E F1 5E 33 91 C8 C8 71 AD 10 C8
|
|
|
|
|
0120 | B8 32 2B C8 1E 06 0E 3A F8 A7 0C 0C 9D 80 6B CE
|
|
|
|
|
0130 | 54 BB FE 5F F6 C1 52 5A 30 5B 92 05 50 61 43 45
|
|
|
|
|
0140 | 38 AB 6F 1B 17 97 A0 BD 86 B0 8B 69 18 95 02 FF
|
|
|
|
|
0150 | D5 75 E9 7E</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 80 EF 05 00 54 36 88 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 F4 1E 05 98 BA BA EF 42
|
|
|
|
|
0020 | 9A 98 83 ED F3 C9 47 22 F3 62 D2 D6 A6 22 24 04
|
|
|
|
|
0030 | 75 83 86 C4 3F CF E9 42 04 3D 40 79 5F 00 00 00
|
|
|
|
|
0040 | 04 65 D1 B8 4D 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 C8 A5 91 7F B4 D2 AB 31 BA 44 7A C5
|
|
|
|
|
0060 | 94 7B 53 81 B5 38 59 30 EC D6 06 75 CE B9 4F 3D
|
|
|
|
|
0070 | 68 B5 3E 47 07 CF 82 81 A1 9A 86 4E 17 91 5D E8
|
|
|
|
|
0080 | 68 A0 28 96 DF 26 D6 87 DE 1B 76 91 6D 13 95 28
|
|
|
|
|
0090 | 36 D9 B9 D6 58 11 F9 CB A3 9C 28 A7 1C 1D 0A 5F
|
|
|
|
|
00A0 | D4 71 18 D0 D4 EB 02 AB BD 5B BB 44 7C BC CC 16
|
|
|
|
|
00B0 | EC 54 3D 22 7A C7 D6 CA 67 E2 50 35 90 13 FD 57
|
|
|
|
|
00C0 | 41 B5 64 D0 4F 5A 03 3D 98 3A C8 AD 30 1A 2E DE
|
|
|
|
|
00D0 | 3B 3C A0 A7 F4 1F 8F 3B 8D 8F 70 4F CC 94 19 51
|
|
|
|
|
00E0 | 13 08 00 FE 6E 4C 89 8D 99 F8 0C CA D9 BE 7B 3D
|
|
|
|
|
00F0 | AB 0C 26 65 09 CE 36 29 EE FA A7 5D 4B C7 DD EB
|
|
|
|
|
0100 | 56 55 2B F4 D1 73 B8 E1 71 6B 8B 63 82 50 E7 F2
|
|
|
|
|
0110 | F2 B6 4A 89 E7 F0 22 2A 52 1A E2 30 26 19 05 14
|
|
|
|
|
0120 | BA E8 02 25 71 F2 6C 22 4A 92 89 DF DE FB 54 99
|
|
|
|
|
0130 | B8 B8 DC F4 87 54 38 D0 62 48 F9 67 C6 1C F4 17
|
|
|
|
|
0140 | C3 14 BC 2A C3 49 D6 74 B9 BC E4 E9 D7 0A 5B 04
|
|
|
|
|
0150 | 47 9B C3 03</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 = CEEB8F53A85A094BDC120CDFAD2D3E88C58AA93ED6C4EAA09E7E1DC32
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>74B4070033338466</code></td>
|
|
|
|
|
<td><code>80EF050054368866</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 = CEEB8F53A85A094BDC120CDFAD2D3E88C58AA93ED6C4EAA09E7E1DC32
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>67F6E1F4DAE09F022153DDD2733C2E26</code></td>
|
|
|
|
|
<td><code>F41E0598BABAEF429A9883EDF3C94722</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>80EFC4FAAE090C467EDE049A5581123E</code></td>
|
|
|
|
|
<td><code>F362D2D6A6222404758386C43FCFE942</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>0444D8C915000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1155057941</td>
|
|
|
|
|
<td><code>043D40795F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1027635551</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>045B8F25F1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1536108017</td>
|
|
|
|
|
<td><code>0465D1B84D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1708243021</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 = CEEB8F53A85A094BDC120CDFAD2D3E88C58AA93ED6C4EAA09E7E1DC32
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE000100C274E4EB5B00D34BF77B1B08</code> <code>73A0CE4D7D114030DEA90961D599C057</code> <code>893841CD90DEAC4B6D3C10926A9CD383</code> <code>06E789484FB17C6E03F6FB4AE99C6334</code> <code>FC0073970243D80550E1C4ECC4C1BAEA</code> <code>62147345E0525C5616C4364E63418434</code> <code>EBBB27AD1753A017595CF534281D0456</code> <code>AF65E46F3D0892971D3790B9DBFA4BF0</code> <code>A78E899F2C9A4DF18B9B469F13C61998</code> <code>33A69BF78853471E5FC51D96B852CB9D</code> <code>AC1D052527936A02E20A80EE477EE7EF</code> <code>DE44060554255E803EAB9DF16EEE9933</code> <code>DC36F66BCF5EF15E3391C8C871AD10C8</code> <code>B8322BC81E060E3AF8A70C0C9D806BCE</code> <code>54BBFE5FF6C1525A305B920550614345</code> <code>38AB6F1B1797A0BD86B08B69189502FF</code><br> <code>D575E97E</code></td>
|
|
|
|
|
<td><code>FE000100C8A5917FB4D2AB31BA447AC5</code> <code>947B5381B5385930ECD60675CEB94F3D</code> <code>68B53E4707CF8281A19A864E17915DE8</code> <code>68A02896DF26D687DE1B76916D139528</code> <code>36D9B9D65811F9CBA39C28A71C1D0A5F</code> <code>D47118D0D4EB02ABBD5BBB447CBCCC16</code> <code>EC543D227AC7D6CA67E250359013FD57</code> <code>41B564D04F5A033D983AC8AD301A2EDE</code> <code>3B3CA0A7F41F8F3B8D8F704FCC941951</code> <code>130800FE6E4C898D99F80CCAD9BE7B3D</code> <code>AB0C266509CE3629EEFAA75D4BC7DDEB</code> <code>56552BF4D173B8E1716B8B638250E7F2</code> <code>F2B64A89E7F0222A521AE23026190514</code> <code>BAE8022571F26C224A9289DFDEFB5499</code> <code>B8B8DCF4875438D06248F967C61CF417</code> <code>C314BC2AC349D674B9BCE4E9D70A5B04</code><br> <code>479BC303</code></td>
|
|
|
|
|
<td>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = CEEB8F53A85A094BDC120CDFAD2D3E88C58AA93ED6C4EAA09E7E1DC32
|
|
|
|
|
<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 20 49 C7 33 33 84 66
|
|
|
|
|
0010 | E8 02 00 00 5C 07 E8 D0 67 F6 E1 F4 DA E0 9F 02
|
|
|
|
|
0020 | 21 53 DD D2 73 3C 2E 26 80 EF C4 FA AE 09 0C 46
|
|
|
|
|
0030 | 7E DE 04 9A 55 81 12 3E FE 50 02 00 3C 3A A2 64
|
|
|
|
|
0040 | A5 B4 86 6B CD 97 7C EE E7 4B E8 35 F1 B7 EB 39
|
|
|
|
|
0050 | 55 46 25 F1 7D 59 47 45 28 45 C7 80 02 70 84 7D
|
|
|
|
|
0060 | 00 C5 10 89 C5 41 BC 44 AC C3 4A CB 3F 1A AF 8B
|
|
|
|
|
0070 | 0B A3 AE 23 FA 04 C3 52 8B F1 50 72 6A 8B 89 EE
|
|
|
|
|
0080 | 09 6C 3A 45 0B 37 C6 AC 6B 03 D1 EA 16 80 17 84
|
|
|
|
|
0090 | 2C BF 94 D6 F9 A7 34 1B 7A 9D 53 6D FE CE 95 8C
|
|
|
|
|
00A0 | 82 2D D9 34 6B 9D C5 E0 46 B6 6E D9 16 0B B4 18
|
|
|
|
|
00B0 | 1C D9 30 5C BB E2 9C 11 FB C5 CD E4 DA B0 DA F8
|
|
|
|
|
00C0 | F3 74 2F 60 76 AF AE 1F 2F A0 62 6B D4 6D 78 32
|
|
|
|
|
00D0 | 76 DE F4 5A 8B 77 5F 03 72 2E EA 1D 54 41 0B 33
|
|
|
|
|
00E0 | F0 B5 E9 49 D3 AF 87 63 49 CB AA D6 C0 22 1D 3B
|
|
|
|
|
00F0 | E7 63 E1 AA 6B 0B 2C 36 29 45 A3 9E 8D 27 7D 84
|
|
|
|
|
0100 | 53 6C BA 18 69 E8 8D FC AD AC D6 9B 5B 94 0C 63
|
|
|
|
|
0110 | 24 FF BE 79 68 06 C5 19 1E 2E D7 19 64 66 2F 0A
|
|
|
|
|
0120 | 0E 17 D3 C3 DF 68 33 69 A9 98 3D 61 5D 77 CC 78
|
|
|
|
|
0130 | 8B C8 AA 90 DC 21 2C D0 66 B5 51 C8 CF 1C C7 05
|
|
|
|
|
0140 | 39 9C B3 E5 08 10 FA FD B2 1F 0F F0 86 AD 08 0D
|
|
|
|
|
0150 | B8 44 D6 A8 BD D9 B7 48 40 89 25 9B 36 24 E0 0F
|
|
|
|
|
0160 | 99 F4 BA D4 D5 D5 61 E1 16 C4 C3 FE F2 0E 4A 0E
|
|
|
|
|
0170 | 92 2B 54 D6 BC 90 6D A2 6B 52 C8 E1 21 66 C8 BC
|
|
|
|
|
0180 | 5D 7F CC 99 47 B9 40 6D 1C 46 96 2C 02 7D 29 02
|
|
|
|
|
0190 | 27 29 C3 79 19 59 F0 DA D7 F7 03 EA C9 C4 85 5C
|
|
|
|
|
01A0 | 24 38 25 64 51 CA FB 2B BC 0B EE E9 D1 76 13 61
|
|
|
|
|
01B0 | 96 C4 DA 63 0C 64 F6 51 9C 92 56 B7 9A 53 01 06
|
|
|
|
|
01C0 | 17 6C 25 74 FB EE 44 5C ED 94 1B 60 12 7D 33 24
|
|
|
|
|
01D0 | 79 44 69 CD 8D F9 30 1A 33 7D 80 18 24 AB 16 58
|
|
|
|
|
01E0 | 7D 9F 64 B7 8D 04 38 6E 18 0A AE 7B 2A 48 D0 78
|
|
|
|
|
01F0 | 50 92 FD B2 B8 D4 55 45 C6 A4 7D 64 E7 9F 4E E6
|
|
|
|
|
0200 | 4B 89 35 5A DC E3 28 DC 5E D7 FD B1 2F 57 2C 8F
|
|
|
|
|
0210 | 10 D6 23 EE 14 C7 F8 22 C1 D9 75 11 F1 A2 95 DB
|
|
|
|
|
0220 | 3A 41 E1 05 B2 23 10 D0 60 F9 27 45 6D 68 0A FB
|
|
|
|
|
0230 | 82 A5 67 87 07 ED 15 D2 82 3D C9 F7 55 2C AB B8
|
|
|
|
|
0240 | 8B 42 E3 8E 85 36 8E 8E 9D BA B3 17 33 8B 0F 7F
|
|
|
|
|
0250 | B8 B2 04 B0 43 CA 84 8A 49 78 C5 50 48 5E 2F 59
|
|
|
|
|
0260 | DD A7 46 D0 A2 D5 06 13 4B E2 4A 6E 6D FE 24 73
|
|
|
|
|
0270 | EC 1F 51 A5 C1 5F E2 B8 EC 69 71 8F F8 E2 AB D7
|
|
|
|
|
0280 | CD E6 3E D2 72 18 FE BF F2 95 1E 2E</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 08 C8 04 55 36 88 66
|
|
|
|
|
0010 | 90 02 00 00 5C 07 E8 D0 F4 1E 05 98 BA BA EF 42
|
|
|
|
|
0020 | 9A 98 83 ED F3 C9 47 22 F3 62 D2 D6 A6 22 24 04
|
|
|
|
|
0030 | 75 83 86 C4 3F CF E9 42 FE 50 02 00 13 79 F7 7A
|
|
|
|
|
0040 | 37 52 4F 55 31 58 60 02 0A A7 C0 A9 3F 22 19 C9
|
|
|
|
|
0050 | BC AF 2D 9D 68 C3 3D 67 DB 3B 92 DB B1 7D 6C 7D
|
|
|
|
|
0060 | 44 5E 59 CB 3D 4C 89 B3 25 5A 50 AB 09 A3 AD 18
|
|
|
|
|
0070 | A1 3A EA 8C DD 2F 39 26 81 C3 C7 C5 31 F8 42 8C
|
|
|
|
|
0080 | DE 71 7E 6D 59 77 3E 4C 2E D7 D1 82 62 68 90 AA
|
|
|
|
|
0090 | 3F E9 07 80 A6 90 98 6E D2 A6 90 BD C4 B1 CA DB
|
|
|
|
|
00A0 | 0A 94 57 19 3D 5C A2 CD 5C 40 38 A1 ED 5E DC 48
|
|
|
|
|
00B0 | 58 2F 02 4B E4 06 83 C6 32 CA 27 9A FD 8F A3 52
|
|
|
|
|
00C0 | A2 2F ED 98 CB 13 5B FF 45 98 65 46 3A 4B 93 76
|
|
|
|
|
00D0 | 0D 0E CF DE ED FB A5 5C F6 EE AB 8E F5 58 C7 5F
|
|
|
|
|
00E0 | 13 E5 1C 36 60 32 9F AE 40 07 8B 98 C8 8E 44 B3
|
|
|
|
|
00F0 | 97 04 67 57 30 61 B6 FC 42 63 A4 67 B3 60 F9 BC
|
|
|
|
|
0100 | FE 5D 53 73 D9 55 88 ED CF C4 8E 77 7C 68 BD 13
|
|
|
|
|
0110 | AC 42 C3 60 7B AD 93 55 74 1B DC E3 E3 34 21 FA
|
|
|
|
|
0120 | 36 CC 47 11 D3 C0 A2 58 62 80 77 16 8D 3E 6A D3
|
|
|
|
|
0130 | 9A 8E D4 4D A6 30 1A 8F C2 2D CC 66 5F C6 B7 08
|
|
|
|
|
0140 | E2 19 E5 36 A0 D0 41 98 5E 44 5E E2 1C 91 EA 72
|
|
|
|
|
0150 | 5C E4 28 C4 88 6F 85 7A DA 51 F2 49 53 99 8D CB
|
|
|
|
|
0160 | 09 97 6E 6F 11 DA 27 3A F3 61 FF 72 A9 91 28 51
|
|
|
|
|
0170 | 57 2C 2E 21 1E 38 D7 10 1A 02 00 8D 2F 5D A9 3F
|
|
|
|
|
0180 | E4 91 60 61 96 4D 10 4C 81 32 81 05 B5 C4 E4 41
|
|
|
|
|
0190 | 65 09 1A FC A4 38 A3 C1 41 96 B3 55 96 84 46 9A
|
|
|
|
|
01A0 | 8E EF 38 7F 16 97 4A 24 CE 17 D5 FA B7 2C CF 30
|
|
|
|
|
01B0 | 6F B3 B4 94 AF D4 27 9F B0 09 41 5D 65 F0 3C 5B
|
|
|
|
|
01C0 | E5 20 01 9E F3 04 D3 94 0F 6A 99 3A A1 B1 86 E0
|
|
|
|
|
01D0 | 43 59 F1 8B B9 78 5C 06 3A 6D 85 72 66 98 0A 4C
|
|
|
|
|
01E0 | 53 1B 37 71 2F 3C 44 04 30 2F 21 8D 2C ED 8B A2
|
|
|
|
|
01F0 | D0 59 6A D8 49 77 FF 83 BC 68 C1 7E EB 8B DF 9B
|
|
|
|
|
0200 | 1B 0D E8 CA 1D 56 B1 59 8F 86 90 C4 A2 0E 43 A0
|
|
|
|
|
0210 | 80 77 99 7E BB 9C 07 37 E7 74 C7 0B D0 43 CE 5F
|
|
|
|
|
0220 | CF BB 6D 4C 75 0D 37 7F 98 6A 5B 4B 97 BA AF D7
|
|
|
|
|
0230 | 03 19 4C C0 96 A3 EA 0E BE 9D 31 3A 05 51 1A 99
|
|
|
|
|
0240 | 7F 9B D5 7F CE 77 AE FA 22 83 DE 5A 16 BD CD 0E
|
|
|
|
|
0250 | 6D B7 AF 02 F2 CF 1C 9D 3F F4 C2 81 8B 40 CF D6
|
|
|
|
|
0260 | 42 4C 98 5F 38 ED 61 8D AD 9C 9E 97 85 E7 60 95
|
|
|
|
|
0270 | 5B FA 1A 11 7E FE 9F 4D FD 5A 7F 52 BA 5E 31 1C
|
|
|
|
|
0280 | E8 55 DF B9 F5 8E 8C 93 ED 78 12 A8</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 = CEEB8F53A85A094BDC120CDFAD2D3E88C58AA93ED6C4EAA09E7E1DC32
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>012049C733338466</code></td>
|
|
|
|
|
<td><code>0108C80455368866</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>E8020000</code> (744 in decimal)</td>
|
|
|
|
|
<td><code>90020000</code> (656 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -482,19 +482,19 @@ random_padding_bytes = CEEB8F53A85A094BDC120CDFAD2D3E88C58AA93ED6C4EAA09E7E1DC32
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>67F6E1F4DAE09F022153DDD2733C2E26</code></td>
|
|
|
|
|
<td><code>F41E0598BABAEF429A9883EDF3C94722</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>80EFC4FAAE090C467EDE049A5581123E</code></td>
|
|
|
|
|
<td><code>F362D2D6A6222404758386C43FCFE942</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE5002003C3AA264A5B4866BCD977CEE</code> <code>E74BE835F1B7EB39554625F17D594745</code> <code>2845C7800270847D00C51089C541BC44</code> <code>ACC34ACB3F1AAF8B0BA3AE23FA04C352</code> <code>8BF150726A8B89EE096C3A450B37C6AC</code> <code>6B03D1EA168017842CBF94D6F9A7341B</code> <code>7A9D536DFECE958C822DD9346B9DC5E0</code> <code>46B66ED9160BB4181CD9305CBBE29C11</code> <code>FBC5CDE4DAB0DAF8F3742F6076AFAE1F</code> <code>2FA0626BD46D783276DEF45A8B775F03</code> <code>722EEA1D54410B33F0B5E949D3AF8763</code> <code>49CBAAD6C0221D3BE763E1AA6B0B2C36</code> <code>2945A39E8D277D84536CBA1869E88DFC</code> <code>ADACD69B5B940C6324FFBE796806C519</code> <code>1E2ED71964662F0A0E17D3C3DF683369</code> <code>A9983D615D77CC788BC8AA90DC212CD0</code> <code>66B551C8CF1CC705399CB3E50810FAFD</code> <code>B21F0FF086AD080DB844D6A8BDD9B748</code> <code>4089259B3624E00F99F4BAD4D5D561E1</code> <code>16C4C3FEF20E4A0E922B54D6BC906DA2</code> <code>6B52C8E12166C8BC5D7FCC9947B9406D</code> <code>1C46962C027D29022729C3791959F0DA</code> <code>D7F703EAC9C4855C2438256451CAFB2B</code> <code>BC0BEEE9D176136196C4DA630C64F651</code> <code>9C9256B79A530106176C2574FBEE445C</code> <code>ED941B60127D3324794469CD8DF9301A</code> <code>337D801824AB16587D9F64B78D04386E</code> <code>180AAE7B2A48D0785092FDB2B8D45545</code> <code>C6A47D64E79F4EE64B89355ADCE328DC</code> <code>5ED7FDB12F572C8F10D623EE14C7F822</code> <code>C1D97511F1A295DB3A41E105B22310D0</code> <code>60F927456D680AFB82A5678707ED15D2</code> <code>823DC9F7552CABB88B42E38E85368E8E</code> <code>9DBAB317338B0F7FB8B204B043CA848A</code> <code>4978C550485E2F59DDA746D0A2D50613</code> <code>4BE24A6E6DFE2473EC1F51A5C15FE2B8</code> <code>EC69718FF8E2ABD7CDE63ED27218FEBF</code><br> <code>F2951E2E</code></td>
|
|
|
|
|
<td><code>FE5002001379F77A37524F5531586002</code> <code>0AA7C0A93F2219C9BCAF2D9D68C33D67</code> <code>DB3B92DBB17D6C7D445E59CB3D4C89B3</code> <code>255A50AB09A3AD18A13AEA8CDD2F3926</code> <code>81C3C7C531F8428CDE717E6D59773E4C</code> <code>2ED7D182626890AA3FE90780A690986E</code> <code>D2A690BDC4B1CADB0A9457193D5CA2CD</code> <code>5C4038A1ED5EDC48582F024BE40683C6</code> <code>32CA279AFD8FA352A22FED98CB135BFF</code> <code>459865463A4B93760D0ECFDEEDFBA55C</code> <code>F6EEAB8EF558C75F13E51C3660329FAE</code> <code>40078B98C88E44B3970467573061B6FC</code> <code>4263A467B360F9BCFE5D5373D95588ED</code> <code>CFC48E777C68BD13AC42C3607BAD9355</code> <code>741BDCE3E33421FA36CC4711D3C0A258</code> <code>628077168D3E6AD39A8ED44DA6301A8F</code> <code>C22DCC665FC6B708E219E536A0D04198</code> <code>5E445EE21C91EA725CE428C4886F857A</code> <code>DA51F24953998DCB09976E6F11DA273A</code> <code>F361FF72A9912851572C2E211E38D710</code> <code>1A02008D2F5DA93FE4916061964D104C</code> <code>81328105B5C4E44165091AFCA438A3C1</code> <code>4196B3559684469A8EEF387F16974A24</code> <code>CE17D5FAB72CCF306FB3B494AFD4279F</code> <code>B009415D65F03C5BE520019EF304D394</code> <code>0F6A993AA1B186E04359F18BB9785C06</code> <code>3A6D857266980A4C531B37712F3C4404</code> <code>302F218D2CED8BA2D0596AD84977FF83</code> <code>BC68C17EEB8BDF9B1B0DE8CA1D56B159</code> <code>8F8690C4A20E43A08077997EBB9C0737</code> <code>E774C70BD043CE5FCFBB6D4C750D377F</code> <code>986A5B4B97BAAFD703194CC096A3EA0E</code> <code>BE9D313A05511A997F9BD57FCE77AEFA</code> <code>2283DE5A16BDCD0E6DB7AF02F2CF1C9D</code> <code>3FF4C2818B40CFD6424C985F38ED618D</code> <code>AD9C9E9785E760955BFA1A117EFE9F4D</code> <code>FD5A7F52BA5E311CE855DFB9F58E8C93</code><br> <code>ED7812A8</code></td>
|
|
|
|
|
<td>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = CEEB8F53A85A094BDC120CDFAD2D3E88C58AA93ED6C4EAA09E7E1DC32
|
|
|
|
|
<!-- 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 = 3C3AA264A5B4866BCD977CEEE74BE835F1B7EB39554625F17D5947452845C7800270847D00C51089C541BC44ACC34ACB3F1AAF8B0BA3AE23FA04C3528BF150726A8B89EE096C3A450B37C6AC6B03D1EA168017842CBF94D6F9A7341B7A9D536DFECE958C822DD9346B9DC5E046B66ED9160BB4181CD9305CBBE29C11FBC5CDE4DAB0DAF8F3742F6076AFAE1F2FA0626BD46D783276DEF45A8B775F03722EEA1D54410B33F0B5E949D3AF876349CBAAD6C0221D3BE763E1AA6B0B2C362945A39E8D277D84536CBA1869E88DFCADACD69B5B940C6324FFBE796806C5191E2ED71964662F0A0E17D3C3DF683369A9983D615D77CC788BC8AA90DC212CD066B551C8CF1CC705399CB3E50810FAFDB21F0FF086AD080DB844D6A8BDD9B7484089259B3624E00F99F4BAD4D5D561E116C4C3FEF20E4A0E922B54D6BC906DA26B52C8E12166C8BC5D7FCC9947B9406D1C46962C027D29022729C3791959F0DAD7F703EAC9C4855C2438256451CAFB2BBC0BEEE9D176136196C4DA630C64F6519C9256B79A530106176C2574FBEE445CED941B60127D3324794469CD8DF9301A337D801824AB16587D9F64B78D04386E180AAE7B2A48D0785092FDB2B8D45545C6A47D64E79F4EE64B89355ADCE328DC5ED7FDB12F572C8F10D623EE14C7F822C1D97511F1A295DB3A41E105B22310D060F927456D680AFB82A5678707ED15D2823DC9F7552CABB88B42E38E85368E8E9DBAB317338B0F7FB8B204B043CA848A4978C550485E2F59DDA746D0A2D506134BE24A6E6DFE2473EC1F51A5C15FE2B8EC69718FF8E2ABD7CDE63ED27218FEBFF2951E2E
|
|
|
|
|
tmp_aes_key = 7323EE1EE0D31171084998F213328182F2781B1CF5019242A6CB98991B4CC3EF
|
|
|
|
|
tmp_aes_iv = 082414941F579C4BBB2866D55063C927B91757DE8283B60D029CEAB6C32218C0</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = 1379F77A37524F55315860020AA7C0A93F2219C9BCAF2D9D68C33D67DB3B92DBB17D6C7D445E59CB3D4C89B3255A50AB09A3AD18A13AEA8CDD2F392681C3C7C531F8428CDE717E6D59773E4C2ED7D182626890AA3FE90780A690986ED2A690BDC4B1CADB0A9457193D5CA2CD5C4038A1ED5EDC48582F024BE40683C632CA279AFD8FA352A22FED98CB135BFF459865463A4B93760D0ECFDEEDFBA55CF6EEAB8EF558C75F13E51C3660329FAE40078B98C88E44B3970467573061B6FC4263A467B360F9BCFE5D5373D95588EDCFC48E777C68BD13AC42C3607BAD9355741BDCE3E33421FA36CC4711D3C0A258628077168D3E6AD39A8ED44DA6301A8FC22DCC665FC6B708E219E536A0D041985E445EE21C91EA725CE428C4886F857ADA51F24953998DCB09976E6F11DA273AF361FF72A9912851572C2E211E38D7101A02008D2F5DA93FE4916061964D104C81328105B5C4E44165091AFCA438A3C14196B3559684469A8EEF387F16974A24CE17D5FAB72CCF306FB3B494AFD4279FB009415D65F03C5BE520019EF304D3940F6A993AA1B186E04359F18BB9785C063A6D857266980A4C531B37712F3C4404302F218D2CED8BA2D0596AD84977FF83BC68C17EEB8BDF9B1B0DE8CA1D56B1598F8690C4A20E43A08077997EBB9C0737E774C70BD043CE5FCFBB6D4C750D377F986A5B4B97BAAFD703194CC096A3EA0EBE9D313A05511A997F9BD57FCE77AEFA2283DE5A16BDCD0E6DB7AF02F2CF1C9D3FF4C2818B40CFD6424C985F38ED618DAD9C9E9785E760955BFA1A117EFE9F4DFD5A7F52BA5E311CE855DFB9F58E8C93ED7812A8
|
|
|
|
|
tmp_aes_key = AB9279E6573234EE8C58F5DF0582D96E0C8565AF421956273B4566749973F014
|
|
|
|
|
tmp_aes_iv = CC9DB090E4B756E038674E7D3471F4866629D75BBC2185CE49E75A0B091AAA71</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = 22967C5933384A39E3060FBAB0DE9BD25D376530BA0D89B567F6E1F4DAE09F022153DDD2733C2E2680EFC4FAAE090C467EDE049A5581123E03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100A733B8BEBDB36A66183321321FCA483ECA10F0833BFEE08FF2BDFA7852E0984AF61EBCDACE933BFB40A04497E0B7E30F1EFBBB52C563AC364E713B1029029359F6AC4AC2139129EFB897DD6488438AD126FDDC2F8EAA0696CC70B440ECC0E6C230EA528E1899948DBAEFCA28CAB59B403D27DCE748447450AE729F488603D9B2FD3193E9BC227428D2B79BC94483554DB9B7FEB399BA966C36108993191F465BA3CFFD13287082F1BBEBDB1283654B9CEFCB2F8F0CD6DC471B3A5604B3586BB685A65461835B5711F1B0A2B1BBF048DCDE2AD4F3C8E2CA57B922D142691EB7C085E3D12607A1A0649BD5A14CC5B8245289ED8CCC0297192AD91500E4E6DF68043333846620E87519D492EC17
|
|
|
|
|
answer = BA0D89B567F6E1F4DAE09F022153DDD2733C2E2680EFC4FAAE090C467EDE049A5581123E03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100A733B8BEBDB36A66183321321FCA483ECA10F0833BFEE08FF2BDFA7852E0984AF61EBCDACE933BFB40A04497E0B7E30F1EFBBB52C563AC364E713B1029029359F6AC4AC2139129EFB897DD6488438AD126FDDC2F8EAA0696CC70B440ECC0E6C230EA528E1899948DBAEFCA28CAB59B403D27DCE748447450AE729F488603D9B2FD3193E9BC227428D2B79BC94483554DB9B7FEB399BA966C36108993191F465BA3CFFD13287082F1BBEBDB1283654B9CEFCB2F8F0CD6DC471B3A5604B3586BB685A65461835B5711F1B0A2B1BBF048DCDE2AD4F3C8E2CA57B922D142691EB7C085E3D12607A1A0649BD5A14CC5B8245289ED8CCC0297192AD91500E4E6DF68043333846620E87519D492EC17</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = 93B3E6A73ECB761901C306C673AEEB8ADF2E6B74BA0D89B5F41E0598BABAEF429A9883EDF3C94722F362D2D6A6222404758386C43FCFE94203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000653720F187D514C0C42DEF6B12D9E800A37AAC1438D5B685C04CA62B78FCF209DA40AA99C8D889300F83B33FCAFE4CEF78C852F361ADC220031483E2FA9A1F26B141BC44EA495807A4682943631ADA223371C493D2CFB86D69991CD5F441ECAE69168A701048B8D54B95337BD8967CAF5038656ACF19FEF86FD0A4861D8AC40DA8872034894655C5CC7C3A09A3DEA76FB4CE3688A1D8DD19DD624347E6B50287A375FE36F7F6B3BE825A558C9FC89BACF77426F767B047CD4AC85C325239F4998D78D0D2A7AB48A555DD29616C40142706CE9A78B39AFB3B5F1FC82D76149736181B6D4CFA563A3BCF064ABA151D31CEAB267C6646362679E36F5621DBCDDA755368866BD518A77076B8660
|
|
|
|
|
answer = BA0D89B5F41E0598BABAEF429A9883EDF3C94722F362D2D6A6222404758386C43FCFE94203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000653720F187D514C0C42DEF6B12D9E800A37AAC1438D5B685C04CA62B78FCF209DA40AA99C8D889300F83B33FCAFE4CEF78C852F361ADC220031483E2FA9A1F26B141BC44EA495807A4682943631ADA223371C493D2CFB86D69991CD5F441ECAE69168A701048B8D54B95337BD8967CAF5038656ACF19FEF86FD0A4861D8AC40DA8872034894655C5CC7C3A09A3DEA76FB4CE3688A1D8DD19DD624347E6B50287A375FE36F7F6B3BE825A558C9FC89BACF77426F767B047CD4AC85C325239F4998D78D0D2A7AB48A555DD29616C40142706CE9A78B39AFB3B5F1FC82D76149736181B6D4CFA563A3BCF064ABA151D31CEAB267C6646362679E36F5621DBCDDA755368866BD518A77076B8660</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 67 F6 E1 F4 DA E0 9F 02 21 53 DD D2
|
|
|
|
|
0010 | 73 3C 2E 26 80 EF C4 FA AE 09 0C 46 7E DE 04 9A
|
|
|
|
|
0020 | 55 81 12 3E 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 F4 1E 05 98 BA BA EF 42 9A 98 83 ED
|
|
|
|
|
0010 | F3 C9 47 22 F3 62 D2 D6 A6 22 24 04 75 83 86 C4
|
|
|
|
|
0020 | 3F CF E9 42 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 = BA0D89B567F6E1F4DAE09F022153DDD2733C2E2680EFC4FAAE090C467EDE049A5581123
|
|
|
|
|
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 | A7 33 B8 BE BD B3 6A 66 18 33 21 32 1F CA 48 3E
|
|
|
|
|
0140 | CA 10 F0 83 3B FE E0 8F F2 BD FA 78 52 E0 98 4A
|
|
|
|
|
0150 | F6 1E BC DA CE 93 3B FB 40 A0 44 97 E0 B7 E3 0F
|
|
|
|
|
0160 | 1E FB BB 52 C5 63 AC 36 4E 71 3B 10 29 02 93 59
|
|
|
|
|
0170 | F6 AC 4A C2 13 91 29 EF B8 97 DD 64 88 43 8A D1
|
|
|
|
|
0180 | 26 FD DC 2F 8E AA 06 96 CC 70 B4 40 EC C0 E6 C2
|
|
|
|
|
0190 | 30 EA 52 8E 18 99 94 8D BA EF CA 28 CA B5 9B 40
|
|
|
|
|
01A0 | 3D 27 DC E7 48 44 74 50 AE 72 9F 48 86 03 D9 B2
|
|
|
|
|
01B0 | FD 31 93 E9 BC 22 74 28 D2 B7 9B C9 44 83 55 4D
|
|
|
|
|
01C0 | B9 B7 FE B3 99 BA 96 6C 36 10 89 93 19 1F 46 5B
|
|
|
|
|
01D0 | A3 CF FD 13 28 70 82 F1 BB EB DB 12 83 65 4B 9C
|
|
|
|
|
01E0 | EF CB 2F 8F 0C D6 DC 47 1B 3A 56 04 B3 58 6B B6
|
|
|
|
|
01F0 | 85 A6 54 61 83 5B 57 11 F1 B0 A2 B1 BB F0 48 DC
|
|
|
|
|
0200 | DE 2A D4 F3 C8 E2 CA 57 B9 22 D1 42 69 1E B7 C0
|
|
|
|
|
0210 | 85 E3 D1 26 07 A1 A0 64 9B D5 A1 4C C5 B8 24 52
|
|
|
|
|
0220 | 89 ED 8C CC 02 97 19 2A D9 15 00 E4 E6 DF 68 04
|
|
|
|
|
0230 | 33 33 84 66</code></pre>
|
|
|
|
|
0130 | 06 53 72 0F 18 7D 51 4C 0C 42 DE F6 B1 2D 9E 80
|
|
|
|
|
0140 | 0A 37 AA C1 43 8D 5B 68 5C 04 CA 62 B7 8F CF 20
|
|
|
|
|
0150 | 9D A4 0A A9 9C 8D 88 93 00 F8 3B 33 FC AF E4 CE
|
|
|
|
|
0160 | F7 8C 85 2F 36 1A DC 22 00 31 48 3E 2F A9 A1 F2
|
|
|
|
|
0170 | 6B 14 1B C4 4E A4 95 80 7A 46 82 94 36 31 AD A2
|
|
|
|
|
0180 | 23 37 1C 49 3D 2C FB 86 D6 99 91 CD 5F 44 1E CA
|
|
|
|
|
0190 | E6 91 68 A7 01 04 8B 8D 54 B9 53 37 BD 89 67 CA
|
|
|
|
|
01A0 | F5 03 86 56 AC F1 9F EF 86 FD 0A 48 61 D8 AC 40
|
|
|
|
|
01B0 | DA 88 72 03 48 94 65 5C 5C C7 C3 A0 9A 3D EA 76
|
|
|
|
|
01C0 | FB 4C E3 68 8A 1D 8D D1 9D D6 24 34 7E 6B 50 28
|
|
|
|
|
01D0 | 7A 37 5F E3 6F 7F 6B 3B E8 25 A5 58 C9 FC 89 BA
|
|
|
|
|
01E0 | CF 77 42 6F 76 7B 04 7C D4 AC 85 C3 25 23 9F 49
|
|
|
|
|
01F0 | 98 D7 8D 0D 2A 7A B4 8A 55 5D D2 96 16 C4 01 42
|
|
|
|
|
0200 | 70 6C E9 A7 8B 39 AF B3 B5 F1 FC 82 D7 61 49 73
|
|
|
|
|
0210 | 61 81 B6 D4 CF A5 63 A3 BC F0 64 AB A1 51 D3 1C
|
|
|
|
|
0220 | EA B2 67 C6 64 63 62 67 9E 36 F5 62 1D BC DD A7
|
|
|
|
|
0230 | 55 36 88 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 = BA0D89B567F6E1F4DAE09F022153DDD2733C2E2680EFC4FAAE090C467EDE049A5581123
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>67F6E1F4DAE09F022153DDD2733C2E26</code></td>
|
|
|
|
|
<td><code>F41E0598BABAEF429A9883EDF3C94722</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>80EFC4FAAE090C467EDE049A5581123E</code></td>
|
|
|
|
|
<td><code>F362D2D6A6222404758386C43FCFE942</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B567F6E1F4DAE09F022153DDD2733C2E2680EFC4FAAE090C467EDE049A5581123
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE000100A733B8BEBDB36A6618332132</code> <code>1FCA483ECA10F0833BFEE08FF2BDFA78</code> <code>52E0984AF61EBCDACE933BFB40A04497</code> <code>E0B7E30F1EFBBB52C563AC364E713B10</code> <code>29029359F6AC4AC2139129EFB897DD64</code> <code>88438AD126FDDC2F8EAA0696CC70B440</code> <code>ECC0E6C230EA528E1899948DBAEFCA28</code> <code>CAB59B403D27DCE748447450AE729F48</code> <code>8603D9B2FD3193E9BC227428D2B79BC9</code> <code>4483554DB9B7FEB399BA966C36108993</code> <code>191F465BA3CFFD13287082F1BBEBDB12</code> <code>83654B9CEFCB2F8F0CD6DC471B3A5604</code> <code>B3586BB685A65461835B5711F1B0A2B1</code> <code>BBF048DCDE2AD4F3C8E2CA57B922D142</code> <code>691EB7C085E3D12607A1A0649BD5A14C</code> <code>C5B8245289ED8CCC0297192AD91500E4</code><br> <code>E6DF6804</code></td>
|
|
|
|
|
<td><code>FE0001000653720F187D514C0C42DEF6</code> <code>B12D9E800A37AAC1438D5B685C04CA62</code> <code>B78FCF209DA40AA99C8D889300F83B33</code> <code>FCAFE4CEF78C852F361ADC220031483E</code> <code>2FA9A1F26B141BC44EA495807A468294</code> <code>3631ADA223371C493D2CFB86D69991CD</code> <code>5F441ECAE69168A701048B8D54B95337</code> <code>BD8967CAF5038656ACF19FEF86FD0A48</code> <code>61D8AC40DA8872034894655C5CC7C3A0</code> <code>9A3DEA76FB4CE3688A1D8DD19DD62434</code> <code>7E6B50287A375FE36F7F6B3BE825A558</code> <code>C9FC89BACF77426F767B047CD4AC85C3</code> <code>25239F4998D78D0D2A7AB48A555DD296</code> <code>16C40142706CE9A78B39AFB3B5F1FC82</code> <code>D76149736181B6D4CFA563A3BCF064AB</code> <code>A151D31CEAB267C6646362679E36F562</code><br> <code>1DBCDDA7</code></td>
|
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>33338466</code> (1719939891 in decimal)</td>
|
|
|
|
|
<td><code>55368866</code> (1720202837 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B567F6E1F4DAE09F022153DDD2733C2E2680EFC4FAAE090C467EDE049A5581123
|
|
|
|
|
<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 = 2C82F0371A84B7FAABC9EC09AEB52CD720734C9A2515AF3CB233829C9F2B0DB26E6F28C93EFDF70B9F0445756BC525CF8628C41A4B1AD218929F08C6C5CE9465D14B24C746D1D6B4D026312309066CAD827A1B3643699FBC371F611372D1E65D85B52713C8E682469D1B1BE42C85D9BD72A1E2F1A6BF01755CACA09D8800199E23976DF6040808AD4BC4B598ACA863A320C1F995AD42164AA3616D98C4DECB033851FEA270224E3D9B698D0D24CBAB559B058830492EB85FAA60AF4FE0B784EA99830CF9CD29E2E1280D49D050787717B6A4E736AF367866A380C331DB450F3A2889DB5FF08657D312E84233B9DA48F4D1B0F2821C2730C08E38F5CBA4B6E041</code></pre>
|
|
|
|
|
<pre><code>b = 214731A5917AFB2E65ACA58FF6B287DBFB066E45FE502742BF04D04EBFAF1825EBF733EAF77C00AFE0C708CA86A17D0617F6ACCF3201FE0459FF3BC4F53064BCA7C86F6950BC2953032C34EC5F4F04238473B7CA741267909C6EDFB44A1A9903E6527051207B945EB9B77C7683B8294B19A31CA56643C583C499CBF634653D40BD0CF68F5CF7638540D69F652CA1F97C68894423717DA93318A9264C5BF9467AC3478B61371A6806169BC99FDCF3556EF7D1F1DA879D8F8AFA20E28A9DDA25BE100ED11B8849FB4ED7789211A8C0E5097A339543CCCC8FEB5036CEEE90A8CD5374C277C7158DD168623EEB1EE3231A40FC6788C6F7F9585DBB7E73504C7CE24F</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 = AA3A52D7DFAECA40115433F90B35D66EFC622FB9D43DF2A48F505324522B0AF6E711A8ECFE48642FD24F4E3C90DF6412EB39870C5B5CB06BFA6B4B04871809AA5F089374B1007A692043BDCDCE8EB45A5901D75D5215DD7FA0849527872B6796FDE7CAEAF63EB3A42A929374CA08DE8E8C6AD994A72A461A98F573801944A394B0F35A8ACBE0222324B931CAE3E0A29D1C51BBE56CE890375C82CC3F61FEE8E89116547F4D232DB233644B1576B40CEB98E5168D9F31FBF79E4B19E81277B823216C10FEB6B7A0842D8AB41D2B31FE9616BF3F6A385E77201E716DC7E17C5B7D5D71F7BA423FA882E224415A50A59AE3CA60E0449E2FC1B391598D5E2DB72274</code></pre>
|
|
|
|
|
<pre><code>g_b = BDD94C16E30FA21FEFE8666865F0D0FCE25F3EDF1B1D86187D1EAEADB8F695DF826EDD914AE36C379DEAC562EA326A0F90AABA6C54F628957B256769164302441E24A59C59E66A6C890A89F01FEAF2DF39CC3CDA4F7C9F3DFBF251048F13BA6AECC0C5951375388D67842FC4901B89E1BA5E7E83D3AB2635FD4B343D894B27E589F8AE3E8625A8B4DFD00686629F4990CFF85435474DC3191A996322DC222D2C893627CB2CF6930F3339B224FDAF6AEACE4B549B15A1DA1CFE17D6EEBDE770D39ADDCE4E5A130F2D84EB0EDBBE35D832BBC4D410F2D6E72F34B2D394FC1DA9133DA63532BDC39C496E7A21D09A924A8F21AC00445BF5676FDE5C2F336FA819B7</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 67 F6 E1 F4 DA E0 9F 02 21 53 DD D2
|
|
|
|
|
0010 | 73 3C 2E 26 80 EF C4 FA AE 09 0C 46 7E DE 04 9A
|
|
|
|
|
0020 | 55 81 12 3E 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | AA 3A 52 D7 DF AE CA 40 11 54 33 F9 0B 35 D6 6E
|
|
|
|
|
0040 | FC 62 2F B9 D4 3D F2 A4 8F 50 53 24 52 2B 0A F6
|
|
|
|
|
0050 | E7 11 A8 EC FE 48 64 2F D2 4F 4E 3C 90 DF 64 12
|
|
|
|
|
0060 | EB 39 87 0C 5B 5C B0 6B FA 6B 4B 04 87 18 09 AA
|
|
|
|
|
0070 | 5F 08 93 74 B1 00 7A 69 20 43 BD CD CE 8E B4 5A
|
|
|
|
|
0080 | 59 01 D7 5D 52 15 DD 7F A0 84 95 27 87 2B 67 96
|
|
|
|
|
0090 | FD E7 CA EA F6 3E B3 A4 2A 92 93 74 CA 08 DE 8E
|
|
|
|
|
00A0 | 8C 6A D9 94 A7 2A 46 1A 98 F5 73 80 19 44 A3 94
|
|
|
|
|
00B0 | B0 F3 5A 8A CB E0 22 23 24 B9 31 CA E3 E0 A2 9D
|
|
|
|
|
00C0 | 1C 51 BB E5 6C E8 90 37 5C 82 CC 3F 61 FE E8 E8
|
|
|
|
|
00D0 | 91 16 54 7F 4D 23 2D B2 33 64 4B 15 76 B4 0C EB
|
|
|
|
|
00E0 | 98 E5 16 8D 9F 31 FB F7 9E 4B 19 E8 12 77 B8 23
|
|
|
|
|
00F0 | 21 6C 10 FE B6 B7 A0 84 2D 8A B4 1D 2B 31 FE 96
|
|
|
|
|
0100 | 16 BF 3F 6A 38 5E 77 20 1E 71 6D C7 E1 7C 5B 7D
|
|
|
|
|
0110 | 5D 71 F7 BA 42 3F A8 82 E2 24 41 5A 50 A5 9A E3
|
|
|
|
|
0120 | CA 60 E0 44 9E 2F C1 B3 91 59 8D 5E 2D B7 22 74</code></pre>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 F4 1E 05 98 BA BA EF 42 9A 98 83 ED
|
|
|
|
|
0010 | F3 C9 47 22 F3 62 D2 D6 A6 22 24 04 75 83 86 C4
|
|
|
|
|
0020 | 3F CF E9 42 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | BD D9 4C 16 E3 0F A2 1F EF E8 66 68 65 F0 D0 FC
|
|
|
|
|
0040 | E2 5F 3E DF 1B 1D 86 18 7D 1E AE AD B8 F6 95 DF
|
|
|
|
|
0050 | 82 6E DD 91 4A E3 6C 37 9D EA C5 62 EA 32 6A 0F
|
|
|
|
|
0060 | 90 AA BA 6C 54 F6 28 95 7B 25 67 69 16 43 02 44
|
|
|
|
|
0070 | 1E 24 A5 9C 59 E6 6A 6C 89 0A 89 F0 1F EA F2 DF
|
|
|
|
|
0080 | 39 CC 3C DA 4F 7C 9F 3D FB F2 51 04 8F 13 BA 6A
|
|
|
|
|
0090 | EC C0 C5 95 13 75 38 8D 67 84 2F C4 90 1B 89 E1
|
|
|
|
|
00A0 | BA 5E 7E 83 D3 AB 26 35 FD 4B 34 3D 89 4B 27 E5
|
|
|
|
|
00B0 | 89 F8 AE 3E 86 25 A8 B4 DF D0 06 86 62 9F 49 90
|
|
|
|
|
00C0 | CF F8 54 35 47 4D C3 19 1A 99 63 22 DC 22 2D 2C
|
|
|
|
|
00D0 | 89 36 27 CB 2C F6 93 0F 33 39 B2 24 FD AF 6A EA
|
|
|
|
|
00E0 | CE 4B 54 9B 15 A1 DA 1C FE 17 D6 EE BD E7 70 D3
|
|
|
|
|
00F0 | 9A DD CE 4E 5A 13 0F 2D 84 EB 0E DB BE 35 D8 32
|
|
|
|
|
0100 | BB C4 D4 10 F2 D6 E7 2F 34 B2 D3 94 FC 1D A9 13
|
|
|
|
|
0110 | 3D A6 35 32 BD C3 9C 49 6E 7A 21 D0 9A 92 4A 8F
|
|
|
|
|
0120 | 21 AC 00 44 5B F5 67 6F DE 5C 2F 33 6F A8 19 B7</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 = BA0D89B567F6E1F4DAE09F022153DDD2733C2E2680EFC4FAAE090C467EDE049A5581123
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>67F6E1F4DAE09F022153DDD2733C2E26</code></td>
|
|
|
|
|
<td><code>F41E0598BABAEF429A9883EDF3C94722</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>80EFC4FAAE090C467EDE049A5581123E</code></td>
|
|
|
|
|
<td><code>F362D2D6A6222404758386C43FCFE942</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE000100AA3A52D7DFAECA40115433F9</code> <code>0B35D66EFC622FB9D43DF2A48F505324</code> <code>522B0AF6E711A8ECFE48642FD24F4E3C</code> <code>90DF6412EB39870C5B5CB06BFA6B4B04</code> <code>871809AA5F089374B1007A692043BDCD</code> <code>CE8EB45A5901D75D5215DD7FA0849527</code> <code>872B6796FDE7CAEAF63EB3A42A929374</code> <code>CA08DE8E8C6AD994A72A461A98F57380</code> <code>1944A394B0F35A8ACBE0222324B931CA</code> <code>E3E0A29D1C51BBE56CE890375C82CC3F</code> <code>61FEE8E89116547F4D232DB233644B15</code> <code>76B40CEB98E5168D9F31FBF79E4B19E8</code> <code>1277B823216C10FEB6B7A0842D8AB41D</code> <code>2B31FE9616BF3F6A385E77201E716DC7</code> <code>E17C5B7D5D71F7BA423FA882E224415A</code> <code>50A59AE3CA60E0449E2FC1B391598D5E</code><br> <code>2DB72274</code></td>
|
|
|
|
|
<td><code>FE000100BDD94C16E30FA21FEFE86668</code> <code>65F0D0FCE25F3EDF1B1D86187D1EAEAD</code> <code>B8F695DF826EDD914AE36C379DEAC562</code> <code>EA326A0F90AABA6C54F628957B256769</code> <code>164302441E24A59C59E66A6C890A89F0</code> <code>1FEAF2DF39CC3CDA4F7C9F3DFBF25104</code> <code>8F13BA6AECC0C5951375388D67842FC4</code> <code>901B89E1BA5E7E83D3AB2635FD4B343D</code> <code>894B27E589F8AE3E8625A8B4DFD00686</code> <code>629F4990CFF85435474DC3191A996322</code> <code>DC222D2C893627CB2CF6930F3339B224</code> <code>FDAF6AEACE4B549B15A1DA1CFE17D6EE</code> <code>BDE770D39ADDCE4E5A130F2D84EB0EDB</code> <code>BE35D832BBC4D410F2D6E72F34B2D394</code> <code>FC1DA9133DA63532BDC39C496E7A21D0</code> <code>9A924A8F21AC00445BF5676FDE5C2F33</code><br> <code>6FA819B7</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 = BA0D89B567F6E1F4DAE09F022153DDD2733C2E2680EFC4FAAE090C467EDE049A5581123
|
|
|
|
|
<!-- 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 = 54B6436667F6E1F4DAE09F022153DDD2733C2E2680EFC4FAAE090C467EDE049A5581123E0000000000000000FE000100AA3A52D7DFAECA40115433F90B35D66EFC622FB9D43DF2A48F505324522B0AF6E711A8ECFE48642FD24F4E3C90DF6412EB39870C5B5CB06BFA6B4B04871809AA5F089374B1007A692043BDCDCE8EB45A5901D75D5215DD7FA0849527872B6796FDE7CAEAF63EB3A42A929374CA08DE8E8C6AD994A72A461A98F573801944A394B0F35A8ACBE0222324B931CAE3E0A29D1C51BBE56CE890375C82CC3F61FEE8E89116547F4D232DB233644B1576B40CEB98E5168D9F31FBF79E4B19E81277B823216C10FEB6B7A0842D8AB41D2B31FE9616BF3F6A385E77201E716DC7E17C5B7D5D71F7BA423FA882E224415A50A59AE3CA60E0449E2FC1B391598D5E2DB72274
|
|
|
|
|
padding = 0D480DC4C7EB18AAEFEC8ADA
|
|
|
|
|
tmp_aes_key = 7323EE1EE0D31171084998F213328182F2781B1CF5019242A6CB98991B4CC3EF
|
|
|
|
|
tmp_aes_iv = 082414941F579C4BBB2866D55063C927B91757DE8283B60D029CEAB6C32218C0</code></pre>
|
|
|
|
|
<pre><code>data = 54B64366F41E0598BABAEF429A9883EDF3C94722F362D2D6A6222404758386C43FCFE9420000000000000000FE000100BDD94C16E30FA21FEFE8666865F0D0FCE25F3EDF1B1D86187D1EAEADB8F695DF826EDD914AE36C379DEAC562EA326A0F90AABA6C54F628957B256769164302441E24A59C59E66A6C890A89F01FEAF2DF39CC3CDA4F7C9F3DFBF251048F13BA6AECC0C5951375388D67842FC4901B89E1BA5E7E83D3AB2635FD4B343D894B27E589F8AE3E8625A8B4DFD00686629F4990CFF85435474DC3191A996322DC222D2C893627CB2CF6930F3339B224FDAF6AEACE4B549B15A1DA1CFE17D6EEBDE770D39ADDCE4E5A130F2D84EB0EDBBE35D832BBC4D410F2D6E72F34B2D394FC1DA9133DA63532BDC39C496E7A21D09A924A8F21AC00445BF5676FDE5C2F336FA819B7
|
|
|
|
|
padding = C887A13A49F62FEEB07A8973
|
|
|
|
|
tmp_aes_key = AB9279E6573234EE8C58F5DF0582D96E0C8565AF421956273B4566749973F014
|
|
|
|
|
tmp_aes_iv = CC9DB090E4B756E038674E7D3471F4866629D75BBC2185CE49E75A0B091AAA71</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 = 023C5CB13D9866A7BDA563E0E4AA11615110F36B0E2872EA57AABBD145F628C4991874AFBFC32EFB8C977A758F979706CB214677D2A945273F90B427F81B86A406D4A106F9F9A29DDB4F24AD16E52BCCEDDAFD8581BB3105532BF40B4128380429F53257C50077DEB35DD8E62658B1F6064B24275E961095F93E03045E091C03455FEAA079EE41081CBFCB187E0341A55DC7C6C2BA43155C61805332D4961535E5CEA8BB29BCAB3BCC547504F22FF2A79A746311270E686660FC397E78C52DAAE66DFC458D806B746A5E67CCE129E51A1D925C638C53693C46ACC05A38C9443ABF8B648DDD05C90C744750D05F6C6A469D1B62B85C5F5B3FDB8D2D2AE19C4F007F65E263796819632BBBED25AD7D5FF198F5D2C82FB5A77EE8CFFED18DAA13D5EBBC17AD18449ED13D0772CEDB97DE78768281F321219F8EEB9BCF36F8CA685C89C0DE9054FAF7BE9691C32737B792D7</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 24CD7D425A7F375B3DFA0E08B0EF4C7855B682102B639D87849DA3FAA6996A20A5293C7FB4B2548B221D24B128102B324F1418FC6153C71E421DD19DDA18FDF7324F8725873FE1CD490B854E2DB5B07EDA289AC42705C11025B20683B3BE45F21FCC4C130346F5920A381B47DF3AAC3F374471AD273CF35A8A3239EEA383A4B8BA1E73B9ABC299EC1CBE8E33ABCC4AA1E71D2CC2E045B6E1D9FD3B8075497F381F353A85D8112F1AAA6ABA9C273FC4B06E5A947425484C757556D25D9C3952EE45C663DE37D6BD72D9AE7E46F6414BF937F824BEA9481BD4B5B8CD938735F984D2DB48FBEB282C61DF46A603BE2E13D636B5DFA14E7EA8B4D29684DAC5A571B477CD8F7D7635A4414F5B38C4D962747D0D006FEA064BAD3BF88B5E2847F69F128F2AF59CBB5466832A8750EB6D8449A1D01F8D6668BED0E6F33A43825E0E70B9D95CEBCCB19A71F2C28113DD5EE7EB94</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 38 37 0D 00 33 33 84 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 67 F6 E1 F4 DA E0 9F 02
|
|
|
|
|
0020 | 21 53 DD D2 73 3C 2E 26 80 EF C4 FA AE 09 0C 46
|
|
|
|
|
0030 | 7E DE 04 9A 55 81 12 3E FE 50 01 00 02 3C 5C B1
|
|
|
|
|
0040 | 3D 98 66 A7 BD A5 63 E0 E4 AA 11 61 51 10 F3 6B
|
|
|
|
|
0050 | 0E 28 72 EA 57 AA BB D1 45 F6 28 C4 99 18 74 AF
|
|
|
|
|
0060 | BF C3 2E FB 8C 97 7A 75 8F 97 97 06 CB 21 46 77
|
|
|
|
|
0070 | D2 A9 45 27 3F 90 B4 27 F8 1B 86 A4 06 D4 A1 06
|
|
|
|
|
0080 | F9 F9 A2 9D DB 4F 24 AD 16 E5 2B CC ED DA FD 85
|
|
|
|
|
0090 | 81 BB 31 05 53 2B F4 0B 41 28 38 04 29 F5 32 57
|
|
|
|
|
00A0 | C5 00 77 DE B3 5D D8 E6 26 58 B1 F6 06 4B 24 27
|
|
|
|
|
00B0 | 5E 96 10 95 F9 3E 03 04 5E 09 1C 03 45 5F EA A0
|
|
|
|
|
00C0 | 79 EE 41 08 1C BF CB 18 7E 03 41 A5 5D C7 C6 C2
|
|
|
|
|
00D0 | BA 43 15 5C 61 80 53 32 D4 96 15 35 E5 CE A8 BB
|
|
|
|
|
00E0 | 29 BC AB 3B CC 54 75 04 F2 2F F2 A7 9A 74 63 11
|
|
|
|
|
00F0 | 27 0E 68 66 60 FC 39 7E 78 C5 2D AA E6 6D FC 45
|
|
|
|
|
0100 | 8D 80 6B 74 6A 5E 67 CC E1 29 E5 1A 1D 92 5C 63
|
|
|
|
|
0110 | 8C 53 69 3C 46 AC C0 5A 38 C9 44 3A BF 8B 64 8D
|
|
|
|
|
0120 | DD 05 C9 0C 74 47 50 D0 5F 6C 6A 46 9D 1B 62 B8
|
|
|
|
|
0130 | 5C 5F 5B 3F DB 8D 2D 2A E1 9C 4F 00 7F 65 E2 63
|
|
|
|
|
0140 | 79 68 19 63 2B BB ED 25 AD 7D 5F F1 98 F5 D2 C8
|
|
|
|
|
0150 | 2F B5 A7 7E E8 CF FE D1 8D AA 13 D5 EB BC 17 AD
|
|
|
|
|
0160 | 18 44 9E D1 3D 07 72 CE DB 97 DE 78 76 82 81 F3
|
|
|
|
|
0170 | 21 21 9F 8E EB 9B CF 36 F8 CA 68 5C 89 C0 DE 90
|
|
|
|
|
0180 | 54 FA F7 BE 96 91 C3 27 37 B7 92 D7</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 54 D3 0C 00 55 36 88 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 F4 1E 05 98 BA BA EF 42
|
|
|
|
|
0020 | 9A 98 83 ED F3 C9 47 22 F3 62 D2 D6 A6 22 24 04
|
|
|
|
|
0030 | 75 83 86 C4 3F CF E9 42 FE 50 01 00 24 CD 7D 42
|
|
|
|
|
0040 | 5A 7F 37 5B 3D FA 0E 08 B0 EF 4C 78 55 B6 82 10
|
|
|
|
|
0050 | 2B 63 9D 87 84 9D A3 FA A6 99 6A 20 A5 29 3C 7F
|
|
|
|
|
0060 | B4 B2 54 8B 22 1D 24 B1 28 10 2B 32 4F 14 18 FC
|
|
|
|
|
0070 | 61 53 C7 1E 42 1D D1 9D DA 18 FD F7 32 4F 87 25
|
|
|
|
|
0080 | 87 3F E1 CD 49 0B 85 4E 2D B5 B0 7E DA 28 9A C4
|
|
|
|
|
0090 | 27 05 C1 10 25 B2 06 83 B3 BE 45 F2 1F CC 4C 13
|
|
|
|
|
00A0 | 03 46 F5 92 0A 38 1B 47 DF 3A AC 3F 37 44 71 AD
|
|
|
|
|
00B0 | 27 3C F3 5A 8A 32 39 EE A3 83 A4 B8 BA 1E 73 B9
|
|
|
|
|
00C0 | AB C2 99 EC 1C BE 8E 33 AB CC 4A A1 E7 1D 2C C2
|
|
|
|
|
00D0 | E0 45 B6 E1 D9 FD 3B 80 75 49 7F 38 1F 35 3A 85
|
|
|
|
|
00E0 | D8 11 2F 1A AA 6A BA 9C 27 3F C4 B0 6E 5A 94 74
|
|
|
|
|
00F0 | 25 48 4C 75 75 56 D2 5D 9C 39 52 EE 45 C6 63 DE
|
|
|
|
|
0100 | 37 D6 BD 72 D9 AE 7E 46 F6 41 4B F9 37 F8 24 BE
|
|
|
|
|
0110 | A9 48 1B D4 B5 B8 CD 93 87 35 F9 84 D2 DB 48 FB
|
|
|
|
|
0120 | EB 28 2C 61 DF 46 A6 03 BE 2E 13 D6 36 B5 DF A1
|
|
|
|
|
0130 | 4E 7E A8 B4 D2 96 84 DA C5 A5 71 B4 77 CD 8F 7D
|
|
|
|
|
0140 | 76 35 A4 41 4F 5B 38 C4 D9 62 74 7D 0D 00 6F EA
|
|
|
|
|
0150 | 06 4B AD 3B F8 8B 5E 28 47 F6 9F 12 8F 2A F5 9C
|
|
|
|
|
0160 | BB 54 66 83 2A 87 50 EB 6D 84 49 A1 D0 1F 8D 66
|
|
|
|
|
0170 | 68 BE D0 E6 F3 3A 43 82 5E 0E 70 B9 D9 5C EB CC
|
|
|
|
|
0180 | B1 9A 71 F2 C2 81 13 DD 5E E7 EB 94</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>38370D0033338466</code></td>
|
|
|
|
|
<td><code>54D30C0055368866</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>67F6E1F4DAE09F022153DDD2733C2E26</code></td>
|
|
|
|
|
<td><code>F41E0598BABAEF429A9883EDF3C94722</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>80EFC4FAAE090C467EDE049A5581123E</code></td>
|
|
|
|
|
<td><code>F362D2D6A6222404758386C43FCFE942</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE500100023C5CB13D9866A7BDA563E0</code> <code>E4AA11615110F36B0E2872EA57AABBD1</code> <code>45F628C4991874AFBFC32EFB8C977A75</code> <code>8F979706CB214677D2A945273F90B427</code> <code>F81B86A406D4A106F9F9A29DDB4F24AD</code> <code>16E52BCCEDDAFD8581BB3105532BF40B</code> <code>4128380429F53257C50077DEB35DD8E6</code> <code>2658B1F6064B24275E961095F93E0304</code> <code>5E091C03455FEAA079EE41081CBFCB18</code> <code>7E0341A55DC7C6C2BA43155C61805332</code> <code>D4961535E5CEA8BB29BCAB3BCC547504</code> <code>F22FF2A79A746311270E686660FC397E</code> <code>78C52DAAE66DFC458D806B746A5E67CC</code> <code>E129E51A1D925C638C53693C46ACC05A</code> <code>38C9443ABF8B648DDD05C90C744750D0</code> <code>5F6C6A469D1B62B85C5F5B3FDB8D2D2A</code> <code>E19C4F007F65E263796819632BBBED25</code> <code>AD7D5FF198F5D2C82FB5A77EE8CFFED1</code> <code>8DAA13D5EBBC17AD18449ED13D0772CE</code> <code>DB97DE78768281F321219F8EEB9BCF36</code> <code>F8CA685C89C0DE9054FAF7BE9691C327</code><br> <code>37B792D7</code></td>
|
|
|
|
|
<td><code>FE50010024CD7D425A7F375B3DFA0E08</code> <code>B0EF4C7855B682102B639D87849DA3FA</code> <code>A6996A20A5293C7FB4B2548B221D24B1</code> <code>28102B324F1418FC6153C71E421DD19D</code> <code>DA18FDF7324F8725873FE1CD490B854E</code> <code>2DB5B07EDA289AC42705C11025B20683</code> <code>B3BE45F21FCC4C130346F5920A381B47</code> <code>DF3AAC3F374471AD273CF35A8A3239EE</code> <code>A383A4B8BA1E73B9ABC299EC1CBE8E33</code> <code>ABCC4AA1E71D2CC2E045B6E1D9FD3B80</code> <code>75497F381F353A85D8112F1AAA6ABA9C</code> <code>273FC4B06E5A947425484C757556D25D</code> <code>9C3952EE45C663DE37D6BD72D9AE7E46</code> <code>F6414BF937F824BEA9481BD4B5B8CD93</code> <code>8735F984D2DB48FBEB282C61DF46A603</code> <code>BE2E13D636B5DFA14E7EA8B4D29684DA</code> <code>C5A571B477CD8F7D7635A4414F5B38C4</code> <code>D962747D0D006FEA064BAD3BF88B5E28</code> <code>47F69F128F2AF59CBB5466832A8750EB</code> <code>6D8449A1D01F8D6668BED0E6F33A4382</code> <code>5E0E70B9D95CEBCCB19A71F2C28113DD</code><br> <code>5EE7EB94</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 = 64244689F699D38F723C45718E9AB531429148F52EFE74388C6ACD6BB78DE4C738E43CEDCF868311B3C8C1D9733743DD3AF69DA2FFD1705096D78915364C3526EF37A158B317905C478A54915DBB13DF8EB403B6FD2D51FD05068C1D6BA952FABA341959335FC119C6196CA1AC97701ED69A6B7246300B49A81EF9BB61BF3D934A4371A3A97D7E91FFCCF92B4CD52E4482CAEA1E279459B4909C0E1C46D9E28458C0E7667B70B9D9D1EA929FAA043DADB52672B6B391CBF3896A9B4CC4BEA393B036D97910B3C8E52C9A31955AAAFDBAB9C5E95670CC465ECC0A993D8B54B2F5B6F4A4BDEB4468550C6405D009C379BD108617EB174979C97120BD9C43D96CEF</code></pre>
|
|
|
|
|
<pre><code>auth_key = 627331A13A3D9868E456AA9B5CAF6398E5D93EA80E05296A0E8699DB541EF517626F8ADA7ED3E57DEA9AF8CEFEE1D23927F9F352BFCF8DEF851471D69066A3B4D52115946D348304E72F46812E18BAEE33D5FDA6C2E801CDC80FEA0951A8B81E068A1F5BC86C321423546EBBBE71E29017CDE5E0C99FD6BC7F13B878E4DA3DFB9F29AD57B68845DA5575DC25BCD9A77F4B06F13645C6D811CA2E67FC75499A276471F8DCF5B4FED6DFD3C567BB3C4583EBAD9917666D9BBE187913E047D70CBCB631E84C639C72472390DE8DDF5605E47F6F13D1E67CF6EC553AC4A2851A9126E75AAC8422D5F6986751A37D81F79513E5CC676F16B1A5B12577E922CB52F247</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 20 4C 4F 34 33 84 66
|
|
|
|
|
0010 | 8C 00 00 00 34 F7 CB 3B 67 F6 E1 F4 DA E0 9F 02
|
|
|
|
|
0020 | 21 53 DD D2 73 3C 2E 26 80 EF C4 FA AE 09 0C 46
|
|
|
|
|
0030 | 7E DE 04 9A 55 81 12 3E 60 9F 9B 34 0C 56 1B F1
|
|
|
|
|
0040 | 0B F5 9B 8A D6 AC 19 74</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 9C FF A1 55 36 88 66
|
|
|
|
|
0010 | 80 00 00 00 34 F7 CB 3B F4 1E 05 98 BA BA EF 42
|
|
|
|
|
0020 | 9A 98 83 ED F3 C9 47 22 F3 62 D2 D6 A6 22 24 04
|
|
|
|
|
0030 | 75 83 86 C4 3F CF E9 42 F5 81 1E 06 A2 8A BC 60
|
|
|
|
|
0040 | F6 C8 D2 47 3C 4B 34 5D</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>01204C4F34338466</code></td>
|
|
|
|
|
<td><code>019CFFA155368866</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>8C000000</code> (140 in decimal)</td>
|
|
|
|
|
<td><code>80000000</code> (128 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>67F6E1F4DAE09F022153DDD2733C2E26</code></td>
|
|
|
|
|
<td><code>F41E0598BABAEF429A9883EDF3C94722</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>80EFC4FAAE090C467EDE049A5581123E</code></td>
|
|
|
|
|
<td><code>F362D2D6A6222404758386C43FCFE942</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>609F9B340C561BF10BF59B8AD6AC1974</code></td>
|
|
|
|
|
<td><code>F5811E06A28ABC60F6C8D2473C4B345D</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>
|
|
|
|
|