|
|
@ -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>
|
|
|
|
<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 -->
|
|
|
|
<!-- start req_pq_multi -->
|
|
|
|
<p>Sent payload (excluding transport headers/trailers):</p>
|
|
|
|
<p>Sent payload (excluding transport headers/trailers):</p>
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 7C 2B 0C 00 08 95 7C 65
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 58 30 09 00 63 9E 7C 65
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 36 95 5F 64 53 29 BE 74
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 48 74 C5 FF 34 54 3B DD
|
|
|
|
0020 | AA 26 D1 0E EC 5F BD 2D</code></pre>
|
|
|
|
0020 | F8 88 01 BE 34 4A 3C 4D</code></pre>
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
<pre><code>req_pq_multi#be7e8ef1 nonce:int128 = ResPQ;</code></pre>
|
|
|
|
<pre><code>req_pq_multi#be7e8ef1 nonce:int128 = ResPQ;</code></pre>
|
|
|
|
<table class="table">
|
|
|
|
<table class="table">
|
|
|
@ -77,7 +77,7 @@
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>message_id</td>
|
|
|
|
<td>message_id</td>
|
|
|
|
<td>8, 8</td>
|
|
|
|
<td>8, 8</td>
|
|
|
|
<td><code>7C2B0C0008957C65</code></td>
|
|
|
|
<td><code>58300900639E7C65</code></td>
|
|
|
|
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
|
|
|
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
@ -95,7 +95,7 @@
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>nonce</td>
|
|
|
|
<td>nonce</td>
|
|
|
|
<td>24, 16</td>
|
|
|
|
<td>24, 16</td>
|
|
|
|
<td><code>36955F645329BE74AA26D10EEC5FBD2D</code></td>
|
|
|
|
<td><code>4874C5FF34543BDDF88801BE344A3C4D</code></td>
|
|
|
|
<td>Random number</td>
|
|
|
|
<td>Random number</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</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>
|
|
|
|
<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 -->
|
|
|
|
<!-- start resPQ -->
|
|
|
|
<p>Received payload (excluding transport headers/trailers):</p>
|
|
|
|
<p>Received payload (excluding transport headers/trailers):</p>
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 74 A9 2F 08 95 7C 65
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 E8 74 D1 63 9E 7C 65
|
|
|
|
0010 | A8 00 00 00 63 24 16 05 36 95 5F 64 53 29 BE 74
|
|
|
|
0010 | CC 00 00 00 63 24 16 05 48 74 C5 FF 34 54 3B DD
|
|
|
|
0020 | AA 26 D1 0E EC 5F BD 2D 77 E0 62 22 2C 3E 29 5F
|
|
|
|
0020 | F8 88 01 BE 34 4A 3C 4D 69 08 BA 9B 24 01 96 62
|
|
|
|
0030 | D2 52 D2 9C AE F9 B1 46 08 26 FA BE 8A 23 38 D0
|
|
|
|
0030 | 11 6F B5 4B DC 8A D3 61 08 14 5B FB 90 DC C8 80
|
|
|
|
0040 | 3D 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
|
|
|
|
0040 | B7 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
|
|
|
|
0050 | 35 5F C3 0B 21 6B E8 6C 02 2B B4 C3 85 FD 64 DE
|
|
|
|
0060 | 85 1D 9D D0</code></pre>
|
|
|
|
0060 | 85 1D 9D D0</code></pre>
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
@ -132,13 +132,13 @@
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>message_id</td>
|
|
|
|
<td>message_id</td>
|
|
|
|
<td>8, 8</td>
|
|
|
|
<td>8, 8</td>
|
|
|
|
<td><code>0174A92F08957C65</code></td>
|
|
|
|
<td><code>01E874D1639E7C65</code></td>
|
|
|
|
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
|
|
|
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>message_length</td>
|
|
|
|
<td>message_length</td>
|
|
|
|
<td>16, 4</td>
|
|
|
|
<td>16, 4</td>
|
|
|
|
<td><code>A8000000</code> (168 in decimal)</td>
|
|
|
|
<td><code>CC000000</code> (204 in decimal)</td>
|
|
|
|
<td>Message body length</td>
|
|
|
|
<td>Message body length</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>nonce</td>
|
|
|
|
<td>nonce</td>
|
|
|
|
<td>24, 16</td>
|
|
|
|
<td>24, 16</td>
|
|
|
|
<td><code>36955F645329BE74AA26D10EEC5FBD2D</code></td>
|
|
|
|
<td><code>4874C5FF34543BDDF88801BE344A3C4D</code></td>
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>server_nonce</td>
|
|
|
|
<td>server_nonce</td>
|
|
|
|
<td>40, 16</td>
|
|
|
|
<td>40, 16</td>
|
|
|
|
<td><code>77E062222C3E295FD252D29CAEF9B146</code></td>
|
|
|
|
<td><code>6908BA9B24019662116FB54BDC8AD361</code></td>
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>pq</td>
|
|
|
|
<td>pq</td>
|
|
|
|
<td>56, 12</td>
|
|
|
|
<td>56, 12</td>
|
|
|
|
<td><code>0826FABE8A2338D03D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2808766818124615741</td>
|
|
|
|
<td><code>08145BFB90DCC880B7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1467042703237218487</td>
|
|
|
|
<td>Single-byte prefix denoting length, an 8-byte string, and three bytes of padding</td>
|
|
|
|
<td>Single-byte prefix denoting length, an 8-byte string, and three bytes of padding</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<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>
|
|
|
|
<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>
|
|
|
|
<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 -->
|
|
|
|
<!-- start pq -->
|
|
|
|
<pre><code>pq = 2808766818124615741</code></pre>
|
|
|
|
<pre><code>pq = 1467042703237218487</code></pre>
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2808766818124615741 = 1437256297 * 1954256053</code></p>
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1467042703237218487 = 1177597013 * 1245793499</code></p>
|
|
|
|
<pre><code>p = 1437256297
|
|
|
|
<pre><code>p = 1177597013
|
|
|
|
q = 1954256053</code></pre>
|
|
|
|
q = 1245793499</code></pre>
|
|
|
|
<!-- end pq -->
|
|
|
|
<!-- 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>
|
|
|
|
<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>
|
|
|
|
<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>
|
|
|
|
<p>First of all, generate an <code>encrypted_data</code> payload as follows:</p>
|
|
|
|
<!-- start p_q_inner_data_dc -->
|
|
|
|
<!-- start p_q_inner_data_dc -->
|
|
|
|
<p>Generated payload (excluding transport headers/trailers):</p>
|
|
|
|
<p>Generated payload (excluding transport headers/trailers):</p>
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 26 FA BE 8A 23 38 D0 3D 00 00 00
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 14 5B FB 90 DC C8 80 B7 00 00 00
|
|
|
|
0010 | 04 55 AA CA 69 00 00 00 04 74 7B 94 B5 00 00 00
|
|
|
|
0010 | 04 46 30 B4 55 00 00 00 04 4A 41 4C DB 00 00 00
|
|
|
|
0020 | 36 95 5F 64 53 29 BE 74 AA 26 D1 0E EC 5F BD 2D
|
|
|
|
0020 | 48 74 C5 FF 34 54 3B DD F8 88 01 BE 34 4A 3C 4D
|
|
|
|
0030 | 77 E0 62 22 2C 3E 29 5F D2 52 D2 9C AE F9 B1 46
|
|
|
|
0030 | 69 08 BA 9B 24 01 96 62 11 6F B5 4B DC 8A D3 61
|
|
|
|
0040 | 80 60 79 CB DD A7 E5 41 38 9F 59 49 DB B4 73 C2
|
|
|
|
0040 | FB D1 99 C5 22 9B ED 61 AB 48 A8 87 E3 8A 1B 0C
|
|
|
|
0050 | 12 1B 05 1E 2A 27 EE 60 41 DF 34 44 82 97 F8 14
|
|
|
|
0050 | 1A 6C 15 D7 D4 BF 10 D8 D4 4D D8 07 DB F5 4F 8D
|
|
|
|
0060 | 02 00 00 00</code></pre>
|
|
|
|
0060 | 02 00 00 00</code></pre>
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
<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>
|
|
|
|
<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 = 1954256053</code></pre>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>pq</td>
|
|
|
|
<td>pq</td>
|
|
|
|
<td>4, 12</td>
|
|
|
|
<td>4, 12</td>
|
|
|
|
<td><code>0826FABE8A2338D03D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2808766818124615741</td>
|
|
|
|
<td><code>08145BFB90DCC880B7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1467042703237218487</td>
|
|
|
|
<td>Single-byte prefix denoting length, 8-byte string, and three bytes of padding</td>
|
|
|
|
<td>Single-byte prefix denoting length, 8-byte string, and three bytes of padding</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>p</td>
|
|
|
|
<td>p</td>
|
|
|
|
<td>16, 8</td>
|
|
|
|
<td>16, 8</td>
|
|
|
|
<td><code>0455AACA69000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1437256297</td>
|
|
|
|
<td><code>044630B455000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1177597013</td>
|
|
|
|
<td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
|
|
|
|
<td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>q</td>
|
|
|
|
<td>q</td>
|
|
|
|
<td>24, 8</td>
|
|
|
|
<td>24, 8</td>
|
|
|
|
<td><code>04747B94B5000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1954256053</td>
|
|
|
|
<td><code>044A414CDB000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1245793499</td>
|
|
|
|
<td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
|
|
|
|
<td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>nonce</td>
|
|
|
|
<td>nonce</td>
|
|
|
|
<td>32, 16</td>
|
|
|
|
<td>32, 16</td>
|
|
|
|
<td><code>36955F645329BE74AA26D10EEC5FBD2D</code></td>
|
|
|
|
<td><code>4874C5FF34543BDDF88801BE344A3C4D</code></td>
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>server_nonce</td>
|
|
|
|
<td>server_nonce</td>
|
|
|
|
<td>48, 16</td>
|
|
|
|
<td>48, 16</td>
|
|
|
|
<td><code>77E062222C3E295FD252D29CAEF9B146</code></td>
|
|
|
|
<td><code>6908BA9B24019662116FB54BDC8AD361</code></td>
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>new_nonce</td>
|
|
|
|
<td>new_nonce</td>
|
|
|
|
<td>64, 32</td>
|
|
|
|
<td>64, 32</td>
|
|
|
|
<td><code>806079CBDDA7E541389F5949DBB473C2</code> <code>121B051E2A27EE6041DF34448297F814</code></td>
|
|
|
|
<td><code>FBD199C5229BED61AB48A887E38A1B0C</code> <code>1A6C15D7D4BF10D8D44DD807DBF54F8D</code></td>
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
@ -291,39 +291,39 @@ q = 1954256053</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>
|
|
|
|
<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>
|
|
|
|
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 -->
|
|
|
|
<!-- start p_q_inner_data_input -->
|
|
|
|
<pre><code>data = 955FF5A90826FABE8A2338D03D0000000455AACA6900000004747B94B500000036955F645329BE74AA26D10EEC5FBD2D77E062222C3E295FD252D29CAEF9B146806079CBDDA7E541389F5949DBB473C2121B051E2A27EE6041DF34448297F81402000000
|
|
|
|
<pre><code>data = 955FF5A908145BFB90DCC880B7000000044630B455000000044A414CDB0000004874C5FF34543BDDF88801BE344A3C4D6908BA9B24019662116FB54BDC8AD361FBD199C5229BED61AB48A887E38A1B0C1A6C15D7D4BF10D8D44DD807DBF54F8D02000000
|
|
|
|
random_padding_bytes = 0DD53F136121D8EF9B58F2C098AECB84809DB9D3530AFDBC240B48FB53DD9487358DFDBA83C2A288C25735678BF7164E5103AAB9F10B833A8502505D2A0D6D536031D939DF12142E931D167DC04764117C7D5B27D0F047AEAE2BFE37</code></pre>
|
|
|
|
random_padding_bytes = 0A19ECA57E3223E5F0F5091A57965F3BF705C668F1A079E6FFC6F38B0BDA876F3DEC701AA97E846E1D24124E3B18870DE8324914A4322CDF11912A40DD999778F6C682B1B74686F8A24EA4D0B3319E06CCC87D315F8FEF8AA56D0081</code></pre>
|
|
|
|
<!-- end p_q_inner_data_input -->
|
|
|
|
<!-- end p_q_inner_data_input -->
|
|
|
|
<p>And this is the output:</p>
|
|
|
|
<p>And this is the output:</p>
|
|
|
|
<!-- start p_q_inner_data_output -->
|
|
|
|
<!-- start p_q_inner_data_output -->
|
|
|
|
<pre><code>encrypted_data = 13A3D5B0D43F057E4A2910F5838D2558452709CEACD9CD1863ADBCD44F70EE90FD9E9D1E80BBBE81F1486F2C1D468F4E89451436A57E2ED75137E3543CD44C0F88429C97361E7E5B22E791B3B131EDCEC8F4B7F258A9FDB8D4CB592C6AC3E47DBFB68E8111A1A7280042ECC1F6D80F5067AE421054A12E299580FC0E1986FC79569F04942699C582521052982DA68376B9412E01A8F17958B8767CDB4912D9752F476B515C920957ED1D2E5332D48EA4AF3B3B52CFFFAEAAEB359B38E74D0838FA1C3EB21D02594203C9E49F14A70E8E348B0A1072B7834F59FBF8028ADEE1792F226CCC699623D9D255122D07460B855BAB532D99F3F4CADF4E706CB5B9707E</code></pre>
|
|
|
|
<pre><code>encrypted_data = 748798283453DD7DD0144E227464802F49763EFCCC6F2D1B374A189964F62D6932AA905B245BFD89492CD41905ED4EFD18EFFDF58729C144EEFFA6C65B0BD29D7834FEB4593B85762E715184A57793C78C6160237C653279F518272674C2DF420B440D8F1475C0CB61B168589D78620C224B76A94B2BB01F16EEDD8CA95757FED3947314496B03ED60523EB40F72EB17E75CB678B0ED55D4CD4631828045545ADC29FFC777FAC4D11AD4082A9C0BDE6832A240F62E1A823FF32A0C2B7C9213D40FB281890C443CC0F46C88F7440377AC7830FA2969A64975C8A183E42BC0041BE0620C4D20F473BE101DD90252D4BAF98294E05BE106EDC26C37359413A065B0</code></pre>
|
|
|
|
<!-- end p_q_inner_data_output -->
|
|
|
|
<!-- end p_q_inner_data_output -->
|
|
|
|
<p>The length of the final string is 256 bytes.</p>
|
|
|
|
<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>
|
|
|
|
<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 -->
|
|
|
|
<!-- start req_DH_params -->
|
|
|
|
<p>Sent payload (excluding transport headers/trailers):</p>
|
|
|
|
<p>Sent payload (excluding transport headers/trailers):</p>
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 7C 39 0F 00 08 95 7C 65
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 5C 30 09 00 63 9E 7C 65
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 36 95 5F 64 53 29 BE 74
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 48 74 C5 FF 34 54 3B DD
|
|
|
|
0020 | AA 26 D1 0E EC 5F BD 2D 77 E0 62 22 2C 3E 29 5F
|
|
|
|
0020 | F8 88 01 BE 34 4A 3C 4D 69 08 BA 9B 24 01 96 62
|
|
|
|
0030 | D2 52 D2 9C AE F9 B1 46 04 55 AA CA 69 00 00 00
|
|
|
|
0030 | 11 6F B5 4B DC 8A D3 61 04 46 30 B4 55 00 00 00
|
|
|
|
0040 | 04 74 7B 94 B5 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
0040 | 04 4A 41 4C DB 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
0050 | FE 00 01 00 13 A3 D5 B0 D4 3F 05 7E 4A 29 10 F5
|
|
|
|
0050 | FE 00 01 00 74 87 98 28 34 53 DD 7D D0 14 4E 22
|
|
|
|
0060 | 83 8D 25 58 45 27 09 CE AC D9 CD 18 63 AD BC D4
|
|
|
|
0060 | 74 64 80 2F 49 76 3E FC CC 6F 2D 1B 37 4A 18 99
|
|
|
|
0070 | 4F 70 EE 90 FD 9E 9D 1E 80 BB BE 81 F1 48 6F 2C
|
|
|
|
0070 | 64 F6 2D 69 32 AA 90 5B 24 5B FD 89 49 2C D4 19
|
|
|
|
0080 | 1D 46 8F 4E 89 45 14 36 A5 7E 2E D7 51 37 E3 54
|
|
|
|
0080 | 05 ED 4E FD 18 EF FD F5 87 29 C1 44 EE FF A6 C6
|
|
|
|
0090 | 3C D4 4C 0F 88 42 9C 97 36 1E 7E 5B 22 E7 91 B3
|
|
|
|
0090 | 5B 0B D2 9D 78 34 FE B4 59 3B 85 76 2E 71 51 84
|
|
|
|
00A0 | B1 31 ED CE C8 F4 B7 F2 58 A9 FD B8 D4 CB 59 2C
|
|
|
|
00A0 | A5 77 93 C7 8C 61 60 23 7C 65 32 79 F5 18 27 26
|
|
|
|
00B0 | 6A C3 E4 7D BF B6 8E 81 11 A1 A7 28 00 42 EC C1
|
|
|
|
00B0 | 74 C2 DF 42 0B 44 0D 8F 14 75 C0 CB 61 B1 68 58
|
|
|
|
00C0 | F6 D8 0F 50 67 AE 42 10 54 A1 2E 29 95 80 FC 0E
|
|
|
|
00C0 | 9D 78 62 0C 22 4B 76 A9 4B 2B B0 1F 16 EE DD 8C
|
|
|
|
00D0 | 19 86 FC 79 56 9F 04 94 26 99 C5 82 52 10 52 98
|
|
|
|
00D0 | A9 57 57 FE D3 94 73 14 49 6B 03 ED 60 52 3E B4
|
|
|
|
00E0 | 2D A6 83 76 B9 41 2E 01 A8 F1 79 58 B8 76 7C DB
|
|
|
|
00E0 | 0F 72 EB 17 E7 5C B6 78 B0 ED 55 D4 CD 46 31 82
|
|
|
|
00F0 | 49 12 D9 75 2F 47 6B 51 5C 92 09 57 ED 1D 2E 53
|
|
|
|
00F0 | 80 45 54 5A DC 29 FF C7 77 FA C4 D1 1A D4 08 2A
|
|
|
|
0100 | 32 D4 8E A4 AF 3B 3B 52 CF FF AE AA EB 35 9B 38
|
|
|
|
0100 | 9C 0B DE 68 32 A2 40 F6 2E 1A 82 3F F3 2A 0C 2B
|
|
|
|
0110 | E7 4D 08 38 FA 1C 3E B2 1D 02 59 42 03 C9 E4 9F
|
|
|
|
0110 | 7C 92 13 D4 0F B2 81 89 0C 44 3C C0 F4 6C 88 F7
|
|
|
|
0120 | 14 A7 0E 8E 34 8B 0A 10 72 B7 83 4F 59 FB F8 02
|
|
|
|
0120 | 44 03 77 AC 78 30 FA 29 69 A6 49 75 C8 A1 83 E4
|
|
|
|
0130 | 8A DE E1 79 2F 22 6C CC 69 96 23 D9 D2 55 12 2D
|
|
|
|
0130 | 2B C0 04 1B E0 62 0C 4D 20 F4 73 BE 10 1D D9 02
|
|
|
|
0140 | 07 46 0B 85 5B AB 53 2D 99 F3 F4 CA DF 4E 70 6C
|
|
|
|
0140 | 52 D4 BA F9 82 94 E0 5B E1 06 ED C2 6C 37 35 94
|
|
|
|
0150 | B5 B9 70 7E</code></pre>
|
|
|
|
0150 | 13 A0 65 B0</code></pre>
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
<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>
|
|
|
|
<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">
|
|
|
|
<table class="table">
|
|
|
@ -345,7 +345,7 @@ random_padding_bytes = 0DD53F136121D8EF9B58F2C098AECB84809DB9D3530AFDBC240B48FB5
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>message_id</td>
|
|
|
|
<td>message_id</td>
|
|
|
|
<td>8, 8</td>
|
|
|
|
<td>8, 8</td>
|
|
|
|
<td><code>7C390F0008957C65</code></td>
|
|
|
|
<td><code>5C300900639E7C65</code></td>
|
|
|
|
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
|
|
|
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
@ -363,25 +363,25 @@ random_padding_bytes = 0DD53F136121D8EF9B58F2C098AECB84809DB9D3530AFDBC240B48FB5
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>nonce</td>
|
|
|
|
<td>nonce</td>
|
|
|
|
<td>24, 16</td>
|
|
|
|
<td>24, 16</td>
|
|
|
|
<td><code>36955F645329BE74AA26D10EEC5FBD2D</code></td>
|
|
|
|
<td><code>4874C5FF34543BDDF88801BE344A3C4D</code></td>
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>server_nonce</td>
|
|
|
|
<td>server_nonce</td>
|
|
|
|
<td>40, 16</td>
|
|
|
|
<td>40, 16</td>
|
|
|
|
<td><code>77E062222C3E295FD252D29CAEF9B146</code></td>
|
|
|
|
<td><code>6908BA9B24019662116FB54BDC8AD361</code></td>
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>p</td>
|
|
|
|
<td>p</td>
|
|
|
|
<td>56, 8</td>
|
|
|
|
<td>56, 8</td>
|
|
|
|
<td><code>0455AACA69000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1437256297</td>
|
|
|
|
<td><code>044630B455000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1177597013</td>
|
|
|
|
<td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
|
|
|
|
<td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>q</td>
|
|
|
|
<td>q</td>
|
|
|
|
<td>64, 8</td>
|
|
|
|
<td>64, 8</td>
|
|
|
|
<td><code>04747B94B5000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1954256053</td>
|
|
|
|
<td><code>044A414CDB000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1245793499</td>
|
|
|
|
<td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
|
|
|
|
<td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
@ -393,7 +393,7 @@ random_padding_bytes = 0DD53F136121D8EF9B58F2C098AECB84809DB9D3530AFDBC240B48FB5
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
<td>80, 260</td>
|
|
|
|
<td>80, 260</td>
|
|
|
|
<td><code>FE00010013A3D5B0D43F057E4A2910F5</code> <code>838D2558452709CEACD9CD1863ADBCD4</code> <code>4F70EE90FD9E9D1E80BBBE81F1486F2C</code> <code>1D468F4E89451436A57E2ED75137E354</code> <code>3CD44C0F88429C97361E7E5B22E791B3</code> <code>B131EDCEC8F4B7F258A9FDB8D4CB592C</code> <code>6AC3E47DBFB68E8111A1A7280042ECC1</code> <code>F6D80F5067AE421054A12E299580FC0E</code> <code>1986FC79569F04942699C58252105298</code> <code>2DA68376B9412E01A8F17958B8767CDB</code> <code>4912D9752F476B515C920957ED1D2E53</code> <code>32D48EA4AF3B3B52CFFFAEAAEB359B38</code> <code>E74D0838FA1C3EB21D02594203C9E49F</code> <code>14A70E8E348B0A1072B7834F59FBF802</code> <code>8ADEE1792F226CCC699623D9D255122D</code> <code>07460B855BAB532D99F3F4CADF4E706C</code><br> <code>B5B9707E</code></td>
|
|
|
|
<td><code>FE000100748798283453DD7DD0144E22</code> <code>7464802F49763EFCCC6F2D1B374A1899</code> <code>64F62D6932AA905B245BFD89492CD419</code> <code>05ED4EFD18EFFDF58729C144EEFFA6C6</code> <code>5B0BD29D7834FEB4593B85762E715184</code> <code>A57793C78C6160237C653279F5182726</code> <code>74C2DF420B440D8F1475C0CB61B16858</code> <code>9D78620C224B76A94B2BB01F16EEDD8C</code> <code>A95757FED3947314496B03ED60523EB4</code> <code>0F72EB17E75CB678B0ED55D4CD463182</code> <code>8045545ADC29FFC777FAC4D11AD4082A</code> <code>9C0BDE6832A240F62E1A823FF32A0C2B</code> <code>7C9213D40FB281890C443CC0F46C88F7</code> <code>440377AC7830FA2969A64975C8A183E4</code> <code>2BC0041BE0620C4D20F473BE101DD902</code> <code>52D4BAF98294E05BE106EDC26C373594</code><br> <code>13A065B0</code></td>
|
|
|
|
<td>Value generated above</td>
|
|
|
|
<td>Value generated above</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</tbody>
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = 0DD53F136121D8EF9B58F2C098AECB84809DB9D3530AFDBC240B48FB5
|
|
|
|
<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>
|
|
|
|
<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 -->
|
|
|
|
<!-- start server_DH_params_ok -->
|
|
|
|
<p>Received payload (excluding transport headers/trailers):</p>
|
|
|
|
<p>Received payload (excluding transport headers/trailers):</p>
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 AC 55 08 09 95 7C 65
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 98 02 85 64 9E 7C 65
|
|
|
|
0010 | 98 02 00 00 5C 07 E8 D0 36 95 5F 64 53 29 BE 74
|
|
|
|
0010 | 94 02 00 00 5C 07 E8 D0 48 74 C5 FF 34 54 3B DD
|
|
|
|
0020 | AA 26 D1 0E EC 5F BD 2D 77 E0 62 22 2C 3E 29 5F
|
|
|
|
0020 | F8 88 01 BE 34 4A 3C 4D 69 08 BA 9B 24 01 96 62
|
|
|
|
0030 | D2 52 D2 9C AE F9 B1 46 FE 50 02 00 B8 2D 65 46
|
|
|
|
0030 | 11 6F B5 4B DC 8A D3 61 FE 50 02 00 D7 3B 28 3E
|
|
|
|
0040 | 4E D8 54 A3 4F 68 19 B5 A3 88 67 7B 0E 08 91 75
|
|
|
|
0040 | B3 CF DE 2D 06 45 24 F9 B5 03 CC 85 2D 1D 46 07
|
|
|
|
0050 | 0D 0F 83 AD C6 7F 2D 48 D5 D2 92 C7 74 EA B8 FB
|
|
|
|
0050 | 7C 55 91 6F ED C6 76 55 7C EB 47 96 AE 9C 5F 2A
|
|
|
|
0060 | E7 11 02 98 C3 AD 6E B2 D5 E8 2B 14 73 4F 0A 56
|
|
|
|
0060 | DD 74 6E 0D D4 4D 7F 64 0C F6 52 D5 70 43 71 93
|
|
|
|
0070 | 82 03 EC BE 81 92 02 C6 2E EC 2E 17 FB E0 53 B5
|
|
|
|
0070 | 87 F8 78 2E 8B 69 65 02 5D 03 FE 47 17 50 F1 14
|
|
|
|
0080 | 88 DE 6B 2C 44 62 55 B2 9C F9 03 D4 B3 CC 79 40
|
|
|
|
0080 | 64 9F 5B F0 A2 A2 31 EA 28 99 64 B0 E0 A9 9B 37
|
|
|
|
0090 | 4B FA BF 1E 5D 8E F6 F3 B2 B1 2E 18 9E A7 0F 5C
|
|
|
|
0090 | CD 59 EF 9D 41 81 BB 5A 63 A4 57 C5 2A 5D 9A 78
|
|
|
|
00A0 | 58 B0 3C 90 50 6C 1A 7F 8D A0 16 AC B4 61 BB E4
|
|
|
|
00A0 | 4C 79 B5 88 CB 14 F1 CA CC D9 C1 E5 2D EB 71 B6
|
|
|
|
00B0 | 91 2E 5F D5 46 3C 44 95 38 00 B8 AE 37 5A 32 BE
|
|
|
|
00B0 | FC F8 C4 C3 8E 76 4D 90 52 6C 4E 13 72 8F B2 96
|
|
|
|
00C0 | 2D 58 2B DC 23 51 EA F5 B1 FE 8F C9 AD 22 D4 91
|
|
|
|
00C0 | DB 6B BA 50 5E 1C D2 9A EE EF 10 1A D2 C7 99 AF
|
|
|
|
00D0 | 74 E3 FE 9C E9 48 62 62 D4 80 A5 6C 2F E2 DC A0
|
|
|
|
00D0 | 46 D6 7F 89 FA EC 5A 88 BD 1E 7C 00 4A 44 40 D8
|
|
|
|
00E0 | 1B B8 A1 3F 86 A6 D5 C8 1A E7 2D 0B 96 FC 04 02
|
|
|
|
00E0 | B9 25 A6 C2 A3 EE 56 CF 43 6E 97 FB 5A 2C 31 AD
|
|
|
|
00F0 | E0 CA 50 E1 99 23 9A 3A 1F FC 67 9B D5 95 AA ED
|
|
|
|
00F0 | F4 48 1D 7D 68 15 14 F8 9F 0E B4 15 1F C7 0D 6D
|
|
|
|
0100 | 76 49 92 64 3B 12 10 00 4D 29 B1 03 26 D4 92 E9
|
|
|
|
0100 | F1 64 1B B0 58 44 40 04 0E CC 73 13 C5 98 2C 11
|
|
|
|
0110 | EA AA AF 2A 51 22 9F 2D 5D C1 67 50 6B E3 A5 D2
|
|
|
|
0110 | B0 EF 8E E4 62 56 F4 36 28 BF 53 65 B0 D8 C4 F3
|
|
|
|
0120 | D7 5F E4 9E A7 CF D4 4B 31 6E 9D 6B 78 EE BF 6E
|
|
|
|
0120 | 80 F8 BC C1 E1 31 93 B5 01 92 0C 73 F3 D4 1E 8D
|
|
|
|
0130 | F9 F9 3B BE 06 BD 6D 31 34 DF AF 96 1C 5F 10 A5
|
|
|
|
0130 | 9A 2B 84 8E D3 86 7C 3D 9F 5E DC 71 1A B8 57 C7
|
|
|
|
0140 | 6A 22 C4 5E E3 13 1D 87 AB 34 C3 90 15 C5 7D 69
|
|
|
|
0140 | 90 C1 CC 4A 48 72 CB 7A 4A E8 9A 1A F3 7E 56 24
|
|
|
|
0150 | 07 C4 2F 53 DB 2E F3 E8 8B 65 BE 6B 36 F7 73 A4
|
|
|
|
0150 | 7E E7 B7 73 7A 0C EB 11 1F C6 48 9F B7 40 E8 EE
|
|
|
|
0160 | 39 75 38 0E DE 68 11 3C A2 39 68 72 E0 55 C3 DA
|
|
|
|
0160 | 10 15 A0 5A BA 5D 3A B7 E0 62 3A 7D CB 80 64 56
|
|
|
|
0170 | EB 03 9D FB 82 BA 33 80 63 86 AD 18 85 4A 00 ED
|
|
|
|
0170 | 40 3B F8 DA 6F 0A 2A 3B 20 FC C5 B5 8A D1 05 DD
|
|
|
|
0180 | 01 87 EF 48 99 86 CC 53 BA 4E AD BD 72 02 B7 9B
|
|
|
|
0180 | C6 1E 1A 18 F7 30 D9 5B 94 EC 20 44 1B E2 71 DB
|
|
|
|
0190 | DE 13 AE 5E 02 8E 9D DE 70 E2 50 89 29 65 75 37
|
|
|
|
0190 | 51 DC 78 8F C3 C5 E5 E5 B4 76 79 9C CD CE E8 55
|
|
|
|
01A0 | C7 B0 89 42 59 13 30 AD 13 8B D4 5D B7 33 48 85
|
|
|
|
01A0 | F2 C8 C5 3B 5D E8 72 8F 52 2A 04 47 F8 07 18 0A
|
|
|
|
01B0 | C0 13 17 00 32 B6 01 3E A4 AA 08 D3 DB CF 79 AB
|
|
|
|
01B0 | C8 FD 8D A0 5C 90 5F A7 3C 72 05 B8 6B 9C F3 6C
|
|
|
|
01C0 | F2 0B FD 68 B5 8D 08 28 2A E6 0D 5E 51 4C 77 A4
|
|
|
|
01C0 | CC 90 C9 FD 7E 26 B6 50 68 51 4F 31 98 36 1A 15
|
|
|
|
01D0 | 2A 45 23 D0 E9 9D B2 97 08 77 22 FA 19 D1 41 BE
|
|
|
|
01D0 | 42 9C 3E 9B 18 1F 7A 36 2C 56 E4 4C 9A 3A C1 A9
|
|
|
|
01E0 | 46 38 3F A2 E1 B7 03 8E DC 8A 6C 7C 04 B6 40 83
|
|
|
|
01E0 | 62 A6 4F C3 92 4F C3 80 9A DF 0F F8 05 B3 30 AE
|
|
|
|
01F0 | 09 78 02 D8 EB 79 54 37 C7 8B A0 80 05 6A AB 07
|
|
|
|
01F0 | D6 46 94 68 8B 10 9B 39 4D D7 64 37 99 36 31 9E
|
|
|
|
0200 | F3 2B DD 1C 11 75 15 44 23 0D 7B 60 55 C0 5A 48
|
|
|
|
0200 | 4A 2C F9 E3 62 F9 0A BE 8E 77 CD F1 00 67 21 F9
|
|
|
|
0210 | 24 F9 A5 B2 61 C6 C6 5A A0 DB 8E 02 33 B9 8C D5
|
|
|
|
0210 | CC 90 1B 82 CF C2 6A 9B 34 B9 46 BD B4 C2 F3 B4
|
|
|
|
0220 | FE 96 12 A5 EF D0 D0 E1 8D 47 DB C1 4E B9 BD E3
|
|
|
|
0220 | 98 45 F0 0E 28 EF 2F 31 10 AE 6B 4F 44 34 98 2B
|
|
|
|
0230 | FD F9 47 3C 16 B4 A8 99 C5 38 70 8A 20 11 65 91
|
|
|
|
0230 | 4E 19 83 3A 1A BE 7C 1E A8 A8 12 CC D4 9B 81 2B
|
|
|
|
0240 | 94 EB 05 90 79 D0 AA D4 58 2B BF 7C A3 65 54 76
|
|
|
|
0240 | 19 EA 70 F2 82 62 FD A7 DB 77 E9 E4 4B C8 FB BC
|
|
|
|
0250 | 4F E8 7E DB 60 1D A1 EE B9 5A 94 F1 F8 59 31 F4
|
|
|
|
0250 | 6D 36 39 AE C9 25 C2 6A B9 BD 92 1D 68 6F 82 D0
|
|
|
|
0260 | A8 30 25 D9 FB 59 4B 67 D6 EC B5 B5 B6 76 A5 7B
|
|
|
|
0260 | 25 61 76 3E B5 EB CE 34 EA 10 F1 C9 E5 77 C7 22
|
|
|
|
0270 | 93 E6 27 F0 90 2A 4B A6 EF 45 7D C2 78 84 7D 80
|
|
|
|
0270 | A2 91 56 D0 84 0E E8 DB B9 7F B3 71 44 E6 EA 9B
|
|
|
|
0280 | CD 56 9B 86 5F B2 0A A2 BE C4 D2 2F</code></pre>
|
|
|
|
0280 | 4C 9F DD FE 60 2F A3 E1 D6 BC C5 AE</code></pre>
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
<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>
|
|
|
|
<pre><code>server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;</code></pre>
|
|
|
|
<table class="table">
|
|
|
|
<table class="table">
|
|
|
@ -464,13 +464,13 @@ random_padding_bytes = 0DD53F136121D8EF9B58F2C098AECB84809DB9D3530AFDBC240B48FB5
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>message_id</td>
|
|
|
|
<td>message_id</td>
|
|
|
|
<td>8, 8</td>
|
|
|
|
<td>8, 8</td>
|
|
|
|
<td><code>01AC550809957C65</code></td>
|
|
|
|
<td><code>01980285649E7C65</code></td>
|
|
|
|
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
|
|
|
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>message_length</td>
|
|
|
|
<td>message_length</td>
|
|
|
|
<td>16, 4</td>
|
|
|
|
<td>16, 4</td>
|
|
|
|
<td><code>98020000</code> (664 in decimal)</td>
|
|
|
|
<td><code>94020000</code> (660 in decimal)</td>
|
|
|
|
<td>Message body length</td>
|
|
|
|
<td>Message body length</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
@ -482,19 +482,19 @@ random_padding_bytes = 0DD53F136121D8EF9B58F2C098AECB84809DB9D3530AFDBC240B48FB5
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>nonce</td>
|
|
|
|
<td>nonce</td>
|
|
|
|
<td>24, 16</td>
|
|
|
|
<td>24, 16</td>
|
|
|
|
<td><code>36955F645329BE74AA26D10EEC5FBD2D</code></td>
|
|
|
|
<td><code>4874C5FF34543BDDF88801BE344A3C4D</code></td>
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>server_nonce</td>
|
|
|
|
<td>server_nonce</td>
|
|
|
|
<td>40, 16</td>
|
|
|
|
<td>40, 16</td>
|
|
|
|
<td><code>77E062222C3E295FD252D29CAEF9B146</code></td>
|
|
|
|
<td><code>6908BA9B24019662116FB54BDC8AD361</code></td>
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
<td>56, 596</td>
|
|
|
|
<td>56, 596</td>
|
|
|
|
<td><code>FE500200B82D65464ED854A34F6819B5</code> <code>A388677B0E0891750D0F83ADC67F2D48</code> <code>D5D292C774EAB8FBE7110298C3AD6EB2</code> <code>D5E82B14734F0A568203ECBE819202C6</code> <code>2EEC2E17FBE053B588DE6B2C446255B2</code> <code>9CF903D4B3CC79404BFABF1E5D8EF6F3</code> <code>B2B12E189EA70F5C58B03C90506C1A7F</code> <code>8DA016ACB461BBE4912E5FD5463C4495</code> <code>3800B8AE375A32BE2D582BDC2351EAF5</code> <code>B1FE8FC9AD22D49174E3FE9CE9486262</code> <code>D480A56C2FE2DCA01BB8A13F86A6D5C8</code> <code>1AE72D0B96FC0402E0CA50E199239A3A</code> <code>1FFC679BD595AAED764992643B121000</code> <code>4D29B10326D492E9EAAAAF2A51229F2D</code> <code>5DC167506BE3A5D2D75FE49EA7CFD44B</code> <code>316E9D6B78EEBF6EF9F93BBE06BD6D31</code> <code>34DFAF961C5F10A56A22C45EE3131D87</code> <code>AB34C39015C57D6907C42F53DB2EF3E8</code> <code>8B65BE6B36F773A43975380EDE68113C</code> <code>A2396872E055C3DAEB039DFB82BA3380</code> <code>6386AD18854A00ED0187EF489986CC53</code> <code>BA4EADBD7202B79BDE13AE5E028E9DDE</code> <code>70E2508929657537C7B08942591330AD</code> <code>138BD45DB7334885C013170032B6013E</code> <code>A4AA08D3DBCF79ABF20BFD68B58D0828</code> <code>2AE60D5E514C77A42A4523D0E99DB297</code> <code>087722FA19D141BE46383FA2E1B7038E</code> <code>DC8A6C7C04B64083097802D8EB795437</code> <code>C78BA080056AAB07F32BDD1C11751544</code> <code>230D7B6055C05A4824F9A5B261C6C65A</code> <code>A0DB8E0233B98CD5FE9612A5EFD0D0E1</code> <code>8D47DBC14EB9BDE3FDF9473C16B4A899</code> <code>C538708A2011659194EB059079D0AAD4</code> <code>582BBF7CA36554764FE87EDB601DA1EE</code> <code>B95A94F1F85931F4A83025D9FB594B67</code> <code>D6ECB5B5B676A57B93E627F0902A4BA6</code> <code>EF457DC278847D80CD569B865FB20AA2</code><br> <code>BEC4D22F</code></td>
|
|
|
|
<td><code>FE500200D73B283EB3CFDE2D064524F9</code> <code>B503CC852D1D46077C55916FEDC67655</code> <code>7CEB4796AE9C5F2ADD746E0DD44D7F64</code> <code>0CF652D57043719387F8782E8B696502</code> <code>5D03FE471750F114649F5BF0A2A231EA</code> <code>289964B0E0A99B37CD59EF9D4181BB5A</code> <code>63A457C52A5D9A784C79B588CB14F1CA</code> <code>CCD9C1E52DEB71B6FCF8C4C38E764D90</code> <code>526C4E13728FB296DB6BBA505E1CD29A</code> <code>EEEF101AD2C799AF46D67F89FAEC5A88</code> <code>BD1E7C004A4440D8B925A6C2A3EE56CF</code> <code>436E97FB5A2C31ADF4481D7D681514F8</code> <code>9F0EB4151FC70D6DF1641BB058444004</code> <code>0ECC7313C5982C11B0EF8EE46256F436</code> <code>28BF5365B0D8C4F380F8BCC1E13193B5</code> <code>01920C73F3D41E8D9A2B848ED3867C3D</code> <code>9F5EDC711AB857C790C1CC4A4872CB7A</code> <code>4AE89A1AF37E56247EE7B7737A0CEB11</code> <code>1FC6489FB740E8EE1015A05ABA5D3AB7</code> <code>E0623A7DCB806456403BF8DA6F0A2A3B</code> <code>20FCC5B58AD105DDC61E1A18F730D95B</code> <code>94EC20441BE271DB51DC788FC3C5E5E5</code> <code>B476799CCDCEE855F2C8C53B5DE8728F</code> <code>522A0447F807180AC8FD8DA05C905FA7</code> <code>3C7205B86B9CF36CCC90C9FD7E26B650</code> <code>68514F3198361A15429C3E9B181F7A36</code> <code>2C56E44C9A3AC1A962A64FC3924FC380</code> <code>9ADF0FF805B330AED64694688B109B39</code> <code>4DD764379936319E4A2CF9E362F90ABE</code> <code>8E77CDF1006721F9CC901B82CFC26A9B</code> <code>34B946BDB4C2F3B49845F00E28EF2F31</code> <code>10AE6B4F4434982B4E19833A1ABE7C1E</code> <code>A8A812CCD49B812B19EA70F28262FDA7</code> <code>DB77E9E44BC8FBBC6D3639AEC925C26A</code> <code>B9BD921D686F82D02561763EB5EBCE34</code> <code>EA10F1C9E577C722A29156D0840EE8DB</code> <code>B97FB37144E6EA9B4C9FDDFE602FA3E1</code><br> <code>D6BCC5AE</code></td>
|
|
|
|
<td>See below</td>
|
|
|
|
<td>See below</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</tbody>
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = 0DD53F136121D8EF9B58F2C098AECB84809DB9D3530AFDBC240B48FB5
|
|
|
|
<!-- end server_DH_params_ok -->
|
|
|
|
<!-- 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>
|
|
|
|
<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 -->
|
|
|
|
<!-- start server_DH_inner_data_input -->
|
|
|
|
<pre><code>encrypted_answer = B82D65464ED854A34F6819B5A388677B0E0891750D0F83ADC67F2D48D5D292C774EAB8FBE7110298C3AD6EB2D5E82B14734F0A568203ECBE819202C62EEC2E17FBE053B588DE6B2C446255B29CF903D4B3CC79404BFABF1E5D8EF6F3B2B12E189EA70F5C58B03C90506C1A7F8DA016ACB461BBE4912E5FD5463C44953800B8AE375A32BE2D582BDC2351EAF5B1FE8FC9AD22D49174E3FE9CE9486262D480A56C2FE2DCA01BB8A13F86A6D5C81AE72D0B96FC0402E0CA50E199239A3A1FFC679BD595AAED764992643B1210004D29B10326D492E9EAAAAF2A51229F2D5DC167506BE3A5D2D75FE49EA7CFD44B316E9D6B78EEBF6EF9F93BBE06BD6D3134DFAF961C5F10A56A22C45EE3131D87AB34C39015C57D6907C42F53DB2EF3E88B65BE6B36F773A43975380EDE68113CA2396872E055C3DAEB039DFB82BA33806386AD18854A00ED0187EF489986CC53BA4EADBD7202B79BDE13AE5E028E9DDE70E2508929657537C7B08942591330AD138BD45DB7334885C013170032B6013EA4AA08D3DBCF79ABF20BFD68B58D08282AE60D5E514C77A42A4523D0E99DB297087722FA19D141BE46383FA2E1B7038EDC8A6C7C04B64083097802D8EB795437C78BA080056AAB07F32BDD1C11751544230D7B6055C05A4824F9A5B261C6C65AA0DB8E0233B98CD5FE9612A5EFD0D0E18D47DBC14EB9BDE3FDF9473C16B4A899C538708A2011659194EB059079D0AAD4582BBF7CA36554764FE87EDB601DA1EEB95A94F1F85931F4A83025D9FB594B67D6ECB5B5B676A57B93E627F0902A4BA6EF457DC278847D80CD569B865FB20AA2BEC4D22F
|
|
|
|
<pre><code>encrypted_answer = D73B283EB3CFDE2D064524F9B503CC852D1D46077C55916FEDC676557CEB4796AE9C5F2ADD746E0DD44D7F640CF652D57043719387F8782E8B6965025D03FE471750F114649F5BF0A2A231EA289964B0E0A99B37CD59EF9D4181BB5A63A457C52A5D9A784C79B588CB14F1CACCD9C1E52DEB71B6FCF8C4C38E764D90526C4E13728FB296DB6BBA505E1CD29AEEEF101AD2C799AF46D67F89FAEC5A88BD1E7C004A4440D8B925A6C2A3EE56CF436E97FB5A2C31ADF4481D7D681514F89F0EB4151FC70D6DF1641BB0584440040ECC7313C5982C11B0EF8EE46256F43628BF5365B0D8C4F380F8BCC1E13193B501920C73F3D41E8D9A2B848ED3867C3D9F5EDC711AB857C790C1CC4A4872CB7A4AE89A1AF37E56247EE7B7737A0CEB111FC6489FB740E8EE1015A05ABA5D3AB7E0623A7DCB806456403BF8DA6F0A2A3B20FCC5B58AD105DDC61E1A18F730D95B94EC20441BE271DB51DC788FC3C5E5E5B476799CCDCEE855F2C8C53B5DE8728F522A0447F807180AC8FD8DA05C905FA73C7205B86B9CF36CCC90C9FD7E26B65068514F3198361A15429C3E9B181F7A362C56E44C9A3AC1A962A64FC3924FC3809ADF0FF805B330AED64694688B109B394DD764379936319E4A2CF9E362F90ABE8E77CDF1006721F9CC901B82CFC26A9B34B946BDB4C2F3B49845F00E28EF2F3110AE6B4F4434982B4E19833A1ABE7C1EA8A812CCD49B812B19EA70F28262FDA7DB77E9E44BC8FBBC6D3639AEC925C26AB9BD921D686F82D02561763EB5EBCE34EA10F1C9E577C722A29156D0840EE8DBB97FB37144E6EA9B4C9FDDFE602FA3E1D6BCC5AE
|
|
|
|
tmp_aes_key = EA8E6BCE75807282BBA87A24BB3ADA8642FA637C7897F6C256316BA3634FABD8
|
|
|
|
tmp_aes_key = 9CE6361406319F2D525560C55CB735571D2B83E497907255400D1088EA914CE8
|
|
|
|
tmp_aes_iv = AD8254DDD5E3F0B4D3CA8C1778B838EF3490128FD67D33742993BD3D806079CB</code></pre>
|
|
|
|
tmp_aes_iv = E7467B94F4DAE2F7303285B9632C08FB25DA82E4947553BF6B4E8EF3FBD199C5</code></pre>
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
<p>Yielding:</p>
|
|
|
|
<p>Yielding:</p>
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
<pre><code>answer_with_hash = 4985915768EE8706A55FCF4BF1B0E16EB8FDDAFBBA0D89B536955F645329BE74AA26D10EEC5FBD2D77E062222C3E295FD252D29CAEF9B14603000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000D75FB27EAD322EEBF3B061FE047C707475E8838B537D00B8C1C7E034B4DCBF7F955D9FBDF8B0DB1703DB24975B74CB3E015DF174950972A85504E618899643979B68E7C855500221F22121C86A6290D440DFC27274F58CD94C56B3BAF6B574889B89AFC7F6DA0272436DCF29AFA4CAE98AC7C21DF1D04CA1B15C8ABD78A451B14E24CE5D29A59DD53CD7D20E5FCE1AE1CB16CF916AABE075BFAF3D6BC10C013E0B7AC18C353F5FE2E1CC9D6F342E5FEB175B01A6239F8E87088D8DD7BF70AE07FA56DF8AB68F6CFE4AEF3FF6EC0EF5AF09B6328D51B709E7309E08BF66932ED3D4CE5DFA3B37E445453D2611E20BDBB0DF6BFE7C001099D0C971B2BF84CBD4209957C65425D81AC5A90E1D4
|
|
|
|
<pre><code>answer_with_hash = 340E573FDF32F4F4440A6DB2B6B34FA93C342BCFBA0D89B54874C5FF34543BDDF88801BE344A3C4D6908BA9B24019662116FB54BDC8AD36103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000EA484A94BF797DA07474DF3DF95998F55BD22010BDDE5EB156EF45EA7EB07FA4555D1AC2CD228143E1A78CD22049CE54EF402C2606E98A31D64DF3EBE64ACF018D3BA9CC6D38644ECC08906DF3DF4C8201E536A6987A3E31C66F5C706E97B3DE957532B6616E484F3F3D2472F35638931559B1165D240FAF2B89B794CC985EF9D36A1260C66A0B1C545B71A2A2C31BE164FC5BE7BA79A9A64882DB14983F07D7763614AB3B751235402FAC6A1F7B0397210CC85E307BCBE0893D0FA0859A65D5AF658385FAF4409F68FA49F2754DFC232ECF013B1A94D8DD78E047478ECFE23AD5CCE6367E0D4F583FC94D71E16F6142B6EA69C960491E5704B87705FFCEFFF649E7C657B260CA48B6053D7
|
|
|
|
answer = BA0D89B536955F645329BE74AA26D10EEC5FBD2D77E062222C3E295FD252D29CAEF9B14603000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000D75FB27EAD322EEBF3B061FE047C707475E8838B537D00B8C1C7E034B4DCBF7F955D9FBDF8B0DB1703DB24975B74CB3E015DF174950972A85504E618899643979B68E7C855500221F22121C86A6290D440DFC27274F58CD94C56B3BAF6B574889B89AFC7F6DA0272436DCF29AFA4CAE98AC7C21DF1D04CA1B15C8ABD78A451B14E24CE5D29A59DD53CD7D20E5FCE1AE1CB16CF916AABE075BFAF3D6BC10C013E0B7AC18C353F5FE2E1CC9D6F342E5FEB175B01A6239F8E87088D8DD7BF70AE07FA56DF8AB68F6CFE4AEF3FF6EC0EF5AF09B6328D51B709E7309E08BF66932ED3D4CE5DFA3B37E445453D2611E20BDBB0DF6BFE7C001099D0C971B2BF84CBD4209957C65425D81AC5A90E1D4</code></pre>
|
|
|
|
answer = BA0D89B54874C5FF34543BDDF88801BE344A3C4D6908BA9B24019662116FB54BDC8AD36103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000EA484A94BF797DA07474DF3DF95998F55BD22010BDDE5EB156EF45EA7EB07FA4555D1AC2CD228143E1A78CD22049CE54EF402C2606E98A31D64DF3EBE64ACF018D3BA9CC6D38644ECC08906DF3DF4C8201E536A6987A3E31C66F5C706E97B3DE957532B6616E484F3F3D2472F35638931559B1165D240FAF2B89B794CC985EF9D36A1260C66A0B1C545B71A2A2C31BE164FC5BE7BA79A9A64882DB14983F07D7763614AB3B751235402FAC6A1F7B0397210CC85E307BCBE0893D0FA0859A65D5AF658385FAF4409F68FA49F2754DFC232ECF013B1A94D8DD78E047478ECFE23AD5CCE6367E0D4F583FC94D71E16F6142B6EA69C960491E5704B87705FFCEFFF649E7C657B260CA48B6053D7</code></pre>
|
|
|
|
<!-- end server_DH_inner_data_output -->
|
|
|
|
<!-- end server_DH_inner_data_output -->
|
|
|
|
<!-- start server_DH_inner_data -->
|
|
|
|
<!-- start server_DH_inner_data -->
|
|
|
|
<p>Generated payload (excluding transport headers/trailers):</p>
|
|
|
|
<p>Generated payload (excluding transport headers/trailers):</p>
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 36 95 5F 64 53 29 BE 74 AA 26 D1 0E
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 48 74 C5 FF 34 54 3B DD F8 88 01 BE
|
|
|
|
0010 | EC 5F BD 2D 77 E0 62 22 2C 3E 29 5F D2 52 D2 9C
|
|
|
|
0010 | 34 4A 3C 4D 69 08 BA 9B 24 01 96 62 11 6F B5 4B
|
|
|
|
0020 | AE F9 B1 46 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
0020 | DC 8A D3 61 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
|
|
|
|
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
|
|
|
|
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
|
|
|
|
0050 | A7 C1 40 58 22 94 93 D2 25 30 F4 DB FA 33 6F 6E
|
|
|
@ -532,23 +532,23 @@ answer = BA0D89B536955F645329BE74AA26D10EEC5FBD2D77E062222C3E295FD252D29CAEF9B14
|
|
|
|
0100 | F4 7B F9 59 D9 56 85 0C E9 29 85 1F 0D 81 15 F6
|
|
|
|
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
|
|
|
|
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
|
|
|
|
0120 | 34 B1 04 03 11 9C D8 E3 B9 2F CC 5B FE 00 01 00
|
|
|
|
0130 | 0D 75 FB 27 EA D3 22 EE BF 3B 06 1F E0 47 C7 07
|
|
|
|
0130 | 0E A4 84 A9 4B F7 97 DA 07 47 4D F3 DF 95 99 8F
|
|
|
|
0140 | 47 5E 88 38 B5 37 D0 0B 8C 1C 7E 03 4B 4D CB F7
|
|
|
|
0140 | 55 BD 22 01 0B DD E5 EB 15 6E F4 5E A7 EB 07 FA
|
|
|
|
0150 | F9 55 D9 FB DF 8B 0D B1 70 3D B2 49 75 B7 4C B3
|
|
|
|
0150 | 45 55 D1 AC 2C D2 28 14 3E 1A 78 CD 22 04 9C E5
|
|
|
|
0160 | E0 15 DF 17 49 50 97 2A 85 50 4E 61 88 99 64 39
|
|
|
|
0160 | 4E F4 02 C2 60 6E 98 A3 1D 64 DF 3E BE 64 AC F0
|
|
|
|
0170 | 79 B6 8E 7C 85 55 00 22 1F 22 12 1C 86 A6 29 0D
|
|
|
|
0170 | 18 D3 BA 9C C6 D3 86 44 EC C0 89 06 DF 3D F4 C8
|
|
|
|
0180 | 44 0D FC 27 27 4F 58 CD 94 C5 6B 3B AF 6B 57 48
|
|
|
|
0180 | 20 1E 53 6A 69 87 A3 E3 1C 66 F5 C7 06 E9 7B 3D
|
|
|
|
0190 | 89 B8 9A FC 7F 6D A0 27 24 36 DC F2 9A FA 4C AE
|
|
|
|
0190 | E9 57 53 2B 66 16 E4 84 F3 F3 D2 47 2F 35 63 89
|
|
|
|
01A0 | 98 AC 7C 21 DF 1D 04 CA 1B 15 C8 AB D7 8A 45 1B
|
|
|
|
01A0 | 31 55 9B 11 65 D2 40 FA F2 B8 9B 79 4C C9 85 EF
|
|
|
|
01B0 | 14 E2 4C E5 D2 9A 59 DD 53 CD 7D 20 E5 FC E1 AE
|
|
|
|
01B0 | 9D 36 A1 26 0C 66 A0 B1 C5 45 B7 1A 2A 2C 31 BE
|
|
|
|
01C0 | 1C B1 6C F9 16 AA BE 07 5B FA F3 D6 BC 10 C0 13
|
|
|
|
01C0 | 16 4F C5 BE 7B A7 9A 9A 64 88 2D B1 49 83 F0 7D
|
|
|
|
01D0 | E0 B7 AC 18 C3 53 F5 FE 2E 1C C9 D6 F3 42 E5 FE
|
|
|
|
01D0 | 77 63 61 4A B3 B7 51 23 54 02 FA C6 A1 F7 B0 39
|
|
|
|
01E0 | B1 75 B0 1A 62 39 F8 E8 70 88 D8 DD 7B F7 0A E0
|
|
|
|
01E0 | 72 10 CC 85 E3 07 BC BE 08 93 D0 FA 08 59 A6 5D
|
|
|
|
01F0 | 7F A5 6D F8 AB 68 F6 CF E4 AE F3 FF 6E C0 EF 5A
|
|
|
|
01F0 | 5A F6 58 38 5F AF 44 09 F6 8F A4 9F 27 54 DF C2
|
|
|
|
0200 | F0 9B 63 28 D5 1B 70 9E 73 09 E0 8B F6 69 32 ED
|
|
|
|
0200 | 32 EC F0 13 B1 A9 4D 8D D7 8E 04 74 78 EC FE 23
|
|
|
|
0210 | 3D 4C E5 DF A3 B3 7E 44 54 53 D2 61 1E 20 BD BB
|
|
|
|
0210 | AD 5C CE 63 67 E0 D4 F5 83 FC 94 D7 1E 16 F6 14
|
|
|
|
0220 | 0D F6 BF E7 C0 01 09 9D 0C 97 1B 2B F8 4C BD 42
|
|
|
|
0220 | 2B 6E A6 9C 96 04 91 E5 70 4B 87 70 5F FC EF FF
|
|
|
|
0230 | 09 95 7C 65</code></pre>
|
|
|
|
0230 | 64 9E 7C 65</code></pre>
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
<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>
|
|
|
|
<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">
|
|
|
|
<table class="table">
|
|
|
@ -570,13 +570,13 @@ answer = BA0D89B536955F645329BE74AA26D10EEC5FBD2D77E062222C3E295FD252D29CAEF9B14
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>nonce</td>
|
|
|
|
<td>nonce</td>
|
|
|
|
<td>4, 16</td>
|
|
|
|
<td>4, 16</td>
|
|
|
|
<td><code>36955F645329BE74AA26D10EEC5FBD2D</code></td>
|
|
|
|
<td><code>4874C5FF34543BDDF88801BE344A3C4D</code></td>
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>server_nonce</td>
|
|
|
|
<td>server_nonce</td>
|
|
|
|
<td>20, 16</td>
|
|
|
|
<td>20, 16</td>
|
|
|
|
<td><code>77E062222C3E295FD252D29CAEF9B146</code></td>
|
|
|
|
<td><code>6908BA9B24019662116FB54BDC8AD361</code></td>
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B536955F645329BE74AA26D10EEC5FBD2D77E062222C3E295FD252D29CAEF9B14
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>g_a</td>
|
|
|
|
<td>g_a</td>
|
|
|
|
<td>300, 260</td>
|
|
|
|
<td>300, 260</td>
|
|
|
|
<td><code>FE0001000D75FB27EAD322EEBF3B061F</code> <code>E047C707475E8838B537D00B8C1C7E03</code> <code>4B4DCBF7F955D9FBDF8B0DB1703DB249</code> <code>75B74CB3E015DF174950972A85504E61</code> <code>8899643979B68E7C855500221F22121C</code> <code>86A6290D440DFC27274F58CD94C56B3B</code> <code>AF6B574889B89AFC7F6DA0272436DCF2</code> <code>9AFA4CAE98AC7C21DF1D04CA1B15C8AB</code> <code>D78A451B14E24CE5D29A59DD53CD7D20</code> <code>E5FCE1AE1CB16CF916AABE075BFAF3D6</code> <code>BC10C013E0B7AC18C353F5FE2E1CC9D6</code> <code>F342E5FEB175B01A6239F8E87088D8DD</code> <code>7BF70AE07FA56DF8AB68F6CFE4AEF3FF</code> <code>6EC0EF5AF09B6328D51B709E7309E08B</code> <code>F66932ED3D4CE5DFA3B37E445453D261</code> <code>1E20BDBB0DF6BFE7C001099D0C971B2B</code><br> <code>F84CBD42</code></td>
|
|
|
|
<td><code>FE0001000EA484A94BF797DA07474DF3</code> <code>DF95998F55BD22010BDDE5EB156EF45E</code> <code>A7EB07FA4555D1AC2CD228143E1A78CD</code> <code>22049CE54EF402C2606E98A31D64DF3E</code> <code>BE64ACF018D3BA9CC6D38644ECC08906</code> <code>DF3DF4C8201E536A6987A3E31C66F5C7</code> <code>06E97B3DE957532B6616E484F3F3D247</code> <code>2F35638931559B1165D240FAF2B89B79</code> <code>4CC985EF9D36A1260C66A0B1C545B71A</code> <code>2A2C31BE164FC5BE7BA79A9A64882DB1</code> <code>4983F07D7763614AB3B751235402FAC6</code> <code>A1F7B0397210CC85E307BCBE0893D0FA</code> <code>0859A65D5AF658385FAF4409F68FA49F</code> <code>2754DFC232ECF013B1A94D8DD78E0474</code> <code>78ECFE23AD5CCE6367E0D4F583FC94D7</code> <code>1E16F6142B6EA69C960491E5704B8770</code><br> <code>5FFCEFFF</code></td>
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>server_time</td>
|
|
|
|
<td>server_time</td>
|
|
|
|
<td>560, 4</td>
|
|
|
|
<td>560, 4</td>
|
|
|
|
<td><code>09957C65</code> (1702663433 in decimal)</td>
|
|
|
|
<td><code>649E7C65</code> (1702665828 in decimal)</td>
|
|
|
|
<td>Server time</td>
|
|
|
|
<td>Server time</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</tbody>
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B536955F645329BE74AA26D10EEC5FBD2D77E062222C3E295FD252D29CAEF9B14
|
|
|
|
<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>
|
|
|
|
<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>
|
|
|
|
<p>First, generate a secure random 2048-bit number b:</p>
|
|
|
|
<!-- start b -->
|
|
|
|
<!-- start b -->
|
|
|
|
<pre><code>b = 26342456EC9EB5E7D938483A51D3A02B674F9CECE972D384AB8E54CC456F38F448C0BD38669F9369D84314253DDBB6FFBD2E90E5DFAB6BAB5C17C36FE359AC33D4A08490E1A2498529C6935D558C82BA747016682B5A388F421FA5A4C9D74F35BFA1A8C45DFF0AC0AA4917EB36AB624C752D5E784EFCC5AE6596551F4BCAD614D3C102F226D11D5C77E3D25DC4FCC1115483553A00526FF91103D79CC7BDA38D17EDF715C3DF863A435AD4D1F767D4894761B96CE151D7E63EB64233C1DA783282749FAA7C873542EF1E6AF7378BBE1FD8A5D8588B39A3B7E4D22121D1B30A099DE65CBF17D9E9A3C55594B520D16F70C8C0377A47842718E3C4A393B20BC9D0</code></pre>
|
|
|
|
<pre><code>b = 9E5FF1153F0B7EC139D9359F285F149FF808308BB98286A885FA4E464FB8BD9C92675A276028B616385ADF67D16721E2C5AC34CC0BDCBE34F943CB624408D332064A93221B1DA6F5A768DA079E546D5495A6E3C9DB9A013462AE5905AA5D1BD56E2FBE21858AFABBB86F0FA4EB502D84F4F02A676E31773B182EC72B98AC785CA30C793F7B18CA618FCC8A0899F8551A2D326588AAC25BCE6D613A32104445CFE0EC966C96ACD6E61912785E257B4E0B691C8DC0612045D385FAC8DC9106102CEF22686FE0F7D2A35AF73FA08E1474175866EA57928D558048FEBFCA3AFFCE20B20CF5580DB784DEDE46C596B6CBB62BD1A9A73D32EF1B2816E7FEEE78178FE0</code></pre>
|
|
|
|
<!-- end b -->
|
|
|
|
<!-- end b -->
|
|
|
|
<p>Then compute <code>g_b = pow(g, b) mod dh_prime</code></p>
|
|
|
|
<p>Then compute <code>g_b = pow(g, b) mod dh_prime</code></p>
|
|
|
|
<!-- start g_b -->
|
|
|
|
<!-- start g_b -->
|
|
|
|
<pre><code>g_b = 4254DB7DE02D7C30E6AF27D9F1A8A6F791D1DBE978D39DCD884335AE63599B5700EB639CDB48F77D933E79F3455D497B12B2BEB5B2317FEB648183A014D38E1F0F516EB32948F624A2457E31DCD837A8311B69BCA1AEC2D8054EE21438E2F2F714C071B94714D4515607FC5715B49983F8914D72F9555CF773CCC792421EED829FD5DF01D8C45EFB93A964D1F15DD72546E146E708173AD830B7C56EBA52D9FB42604030A9BDA981F367ABA23D8DACAC5D93EB1DA61047696BBB947C6DE68570501CAA110E8C110509AF877FCC0212AA33EEF395451725BEC15D32D3C602D744F8B19412BE90D406D76BB484F4B8B53F3E2F90DFAB5934B9713C43982F50C94E</code></pre>
|
|
|
|
<pre><code>g_b = 71FB756CFAF7A584EDDA8D39DB97C5E66BD02F06AC965A3EED930FA42750B519C123B5DFD386F1082A6D8A2F3FD0A1E4160366427BDAE338D7F307C2BFA669ECC1C64086959E35DC80F80992DCEA9D90923E7C4389F3E63FFBA695E9C4733E049752126A6884768D3B8EA739B89225D816485081311BDE1C2EDBCC9DD33C764491094E9EB56F5B6826494977D4ADF6E0586DA8B4F2DB9CC068A220265A5095D0DCE7794CD3DE7CA944A0A2A005093C2F0B5C6DFD80C519ABAE557285545F3B109F00791BFC8A9B77E5BF85D393C668F38C41442F60D3C6A66918FC96D976DC4FB8F061521DF0EE418A72374437917E5F94C23CC4CB4D1F5C60220B99CA387FC1</code></pre>
|
|
|
|
<!-- end g_b -->
|
|
|
|
<!-- end g_b -->
|
|
|
|
<h6>7.1) generation of encrypted_data</h6>
|
|
|
|
<h6>7.1) generation of encrypted_data</h6>
|
|
|
|
<!-- start client_DH_inner_data -->
|
|
|
|
<!-- start client_DH_inner_data -->
|
|
|
|
<p>Generated payload (excluding transport headers/trailers):</p>
|
|
|
|
<p>Generated payload (excluding transport headers/trailers):</p>
|
|
|
|
<pre><code>0000 | 54 B6 43 66 36 95 5F 64 53 29 BE 74 AA 26 D1 0E
|
|
|
|
<pre><code>0000 | 54 B6 43 66 48 74 C5 FF 34 54 3B DD F8 88 01 BE
|
|
|
|
0010 | EC 5F BD 2D 77 E0 62 22 2C 3E 29 5F D2 52 D2 9C
|
|
|
|
0010 | 34 4A 3C 4D 69 08 BA 9B 24 01 96 62 11 6F B5 4B
|
|
|
|
0020 | AE F9 B1 46 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
0020 | DC 8A D3 61 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
0030 | 42 54 DB 7D E0 2D 7C 30 E6 AF 27 D9 F1 A8 A6 F7
|
|
|
|
0030 | 71 FB 75 6C FA F7 A5 84 ED DA 8D 39 DB 97 C5 E6
|
|
|
|
0040 | 91 D1 DB E9 78 D3 9D CD 88 43 35 AE 63 59 9B 57
|
|
|
|
0040 | 6B D0 2F 06 AC 96 5A 3E ED 93 0F A4 27 50 B5 19
|
|
|
|
0050 | 00 EB 63 9C DB 48 F7 7D 93 3E 79 F3 45 5D 49 7B
|
|
|
|
0050 | C1 23 B5 DF D3 86 F1 08 2A 6D 8A 2F 3F D0 A1 E4
|
|
|
|
0060 | 12 B2 BE B5 B2 31 7F EB 64 81 83 A0 14 D3 8E 1F
|
|
|
|
0060 | 16 03 66 42 7B DA E3 38 D7 F3 07 C2 BF A6 69 EC
|
|
|
|
0070 | 0F 51 6E B3 29 48 F6 24 A2 45 7E 31 DC D8 37 A8
|
|
|
|
0070 | C1 C6 40 86 95 9E 35 DC 80 F8 09 92 DC EA 9D 90
|
|
|
|
0080 | 31 1B 69 BC A1 AE C2 D8 05 4E E2 14 38 E2 F2 F7
|
|
|
|
0080 | 92 3E 7C 43 89 F3 E6 3F FB A6 95 E9 C4 73 3E 04
|
|
|
|
0090 | 14 C0 71 B9 47 14 D4 51 56 07 FC 57 15 B4 99 83
|
|
|
|
0090 | 97 52 12 6A 68 84 76 8D 3B 8E A7 39 B8 92 25 D8
|
|
|
|
00A0 | F8 91 4D 72 F9 55 5C F7 73 CC C7 92 42 1E ED 82
|
|
|
|
00A0 | 16 48 50 81 31 1B DE 1C 2E DB CC 9D D3 3C 76 44
|
|
|
|
00B0 | 9F D5 DF 01 D8 C4 5E FB 93 A9 64 D1 F1 5D D7 25
|
|
|
|
00B0 | 91 09 4E 9E B5 6F 5B 68 26 49 49 77 D4 AD F6 E0
|
|
|
|
00C0 | 46 E1 46 E7 08 17 3A D8 30 B7 C5 6E BA 52 D9 FB
|
|
|
|
00C0 | 58 6D A8 B4 F2 DB 9C C0 68 A2 20 26 5A 50 95 D0
|
|
|
|
00D0 | 42 60 40 30 A9 BD A9 81 F3 67 AB A2 3D 8D AC AC
|
|
|
|
00D0 | DC E7 79 4C D3 DE 7C A9 44 A0 A2 A0 05 09 3C 2F
|
|
|
|
00E0 | 5D 93 EB 1D A6 10 47 69 6B BB 94 7C 6D E6 85 70
|
|
|
|
00E0 | 0B 5C 6D FD 80 C5 19 AB AE 55 72 85 54 5F 3B 10
|
|
|
|
00F0 | 50 1C AA 11 0E 8C 11 05 09 AF 87 7F CC 02 12 AA
|
|
|
|
00F0 | 9F 00 79 1B FC 8A 9B 77 E5 BF 85 D3 93 C6 68 F3
|
|
|
|
0100 | 33 EE F3 95 45 17 25 BE C1 5D 32 D3 C6 02 D7 44
|
|
|
|
0100 | 8C 41 44 2F 60 D3 C6 A6 69 18 FC 96 D9 76 DC 4F
|
|
|
|
0110 | F8 B1 94 12 BE 90 D4 06 D7 6B B4 84 F4 B8 B5 3F
|
|
|
|
0110 | B8 F0 61 52 1D F0 EE 41 8A 72 37 44 37 91 7E 5F
|
|
|
|
0120 | 3E 2F 90 DF AB 59 34 B9 71 3C 43 98 2F 50 C9 4E</code></pre>
|
|
|
|
0120 | 94 C2 3C C4 CB 4D 1F 5C 60 22 0B 99 CA 38 7F C1</code></pre>
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
<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>
|
|
|
|
<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">
|
|
|
|
<table class="table">
|
|
|
@ -658,19 +658,19 @@ answer = BA0D89B536955F645329BE74AA26D10EEC5FBD2D77E062222C3E295FD252D29CAEF9B14
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>nonce</td>
|
|
|
|
<td>nonce</td>
|
|
|
|
<td>4, 16</td>
|
|
|
|
<td>4, 16</td>
|
|
|
|
<td><code>36955F645329BE74AA26D10EEC5FBD2D</code></td>
|
|
|
|
<td><code>4874C5FF34543BDDF88801BE344A3C4D</code></td>
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>server_nonce</td>
|
|
|
|
<td>server_nonce</td>
|
|
|
|
<td>20, 16</td>
|
|
|
|
<td>20, 16</td>
|
|
|
|
<td><code>77E062222C3E295FD252D29CAEF9B146</code></td>
|
|
|
|
<td><code>6908BA9B24019662116FB54BDC8AD361</code></td>
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>g_b</td>
|
|
|
|
<td>g_b</td>
|
|
|
|
<td>36, 260</td>
|
|
|
|
<td>36, 260</td>
|
|
|
|
<td><code>FE0001004254DB7DE02D7C30E6AF27D9</code> <code>F1A8A6F791D1DBE978D39DCD884335AE</code> <code>63599B5700EB639CDB48F77D933E79F3</code> <code>455D497B12B2BEB5B2317FEB648183A0</code> <code>14D38E1F0F516EB32948F624A2457E31</code> <code>DCD837A8311B69BCA1AEC2D8054EE214</code> <code>38E2F2F714C071B94714D4515607FC57</code> <code>15B49983F8914D72F9555CF773CCC792</code> <code>421EED829FD5DF01D8C45EFB93A964D1</code> <code>F15DD72546E146E708173AD830B7C56E</code> <code>BA52D9FB42604030A9BDA981F367ABA2</code> <code>3D8DACAC5D93EB1DA61047696BBB947C</code> <code>6DE68570501CAA110E8C110509AF877F</code> <code>CC0212AA33EEF395451725BEC15D32D3</code> <code>C602D744F8B19412BE90D406D76BB484</code> <code>F4B8B53F3E2F90DFAB5934B9713C4398</code><br> <code>2F50C94E</code></td>
|
|
|
|
<td><code>FE00010071FB756CFAF7A584EDDA8D39</code> <code>DB97C5E66BD02F06AC965A3EED930FA4</code> <code>2750B519C123B5DFD386F1082A6D8A2F</code> <code>3FD0A1E4160366427BDAE338D7F307C2</code> <code>BFA669ECC1C64086959E35DC80F80992</code> <code>DCEA9D90923E7C4389F3E63FFBA695E9</code> <code>C4733E049752126A6884768D3B8EA739</code> <code>B89225D816485081311BDE1C2EDBCC9D</code> <code>D33C764491094E9EB56F5B6826494977</code> <code>D4ADF6E0586DA8B4F2DB9CC068A22026</code> <code>5A5095D0DCE7794CD3DE7CA944A0A2A0</code> <code>05093C2F0B5C6DFD80C519ABAE557285</code> <code>545F3B109F00791BFC8A9B77E5BF85D3</code> <code>93C668F38C41442F60D3C6A66918FC96</code> <code>D976DC4FB8F061521DF0EE418A723744</code> <code>37917E5F94C23CC4CB4D1F5C60220B99</code><br> <code>CA387FC1</code></td>
|
|
|
|
<td>Single-byte prefix denoting length, a 256-byte (2048-bit) string, and zero bytes of padding</td>
|
|
|
|
<td>Single-byte prefix denoting length, a 256-byte (2048-bit) string, and zero bytes of padding</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
@ -684,47 +684,47 @@ answer = BA0D89B536955F645329BE74AA26D10EEC5FBD2D77E062222C3E295FD252D29CAEF9B14
|
|
|
|
<!-- end client_DH_inner_data -->
|
|
|
|
<!-- 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>
|
|
|
|
<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 -->
|
|
|
|
<!-- start client_DH_inner_data_input -->
|
|
|
|
<pre><code>data = 54B6436636955F645329BE74AA26D10EEC5FBD2D77E062222C3E295FD252D29CAEF9B1460000000000000000FE0001004254DB7DE02D7C30E6AF27D9F1A8A6F791D1DBE978D39DCD884335AE63599B5700EB639CDB48F77D933E79F3455D497B12B2BEB5B2317FEB648183A014D38E1F0F516EB32948F624A2457E31DCD837A8311B69BCA1AEC2D8054EE21438E2F2F714C071B94714D4515607FC5715B49983F8914D72F9555CF773CCC792421EED829FD5DF01D8C45EFB93A964D1F15DD72546E146E708173AD830B7C56EBA52D9FB42604030A9BDA981F367ABA23D8DACAC5D93EB1DA61047696BBB947C6DE68570501CAA110E8C110509AF877FCC0212AA33EEF395451725BEC15D32D3C602D744F8B19412BE90D406D76BB484F4B8B53F3E2F90DFAB5934B9713C43982F50C94E
|
|
|
|
<pre><code>data = 54B643664874C5FF34543BDDF88801BE344A3C4D6908BA9B24019662116FB54BDC8AD3610000000000000000FE00010071FB756CFAF7A584EDDA8D39DB97C5E66BD02F06AC965A3EED930FA42750B519C123B5DFD386F1082A6D8A2F3FD0A1E4160366427BDAE338D7F307C2BFA669ECC1C64086959E35DC80F80992DCEA9D90923E7C4389F3E63FFBA695E9C4733E049752126A6884768D3B8EA739B89225D816485081311BDE1C2EDBCC9DD33C764491094E9EB56F5B6826494977D4ADF6E0586DA8B4F2DB9CC068A220265A5095D0DCE7794CD3DE7CA944A0A2A005093C2F0B5C6DFD80C519ABAE557285545F3B109F00791BFC8A9B77E5BF85D393C668F38C41442F60D3C6A66918FC96D976DC4FB8F061521DF0EE418A72374437917E5F94C23CC4CB4D1F5C60220B99CA387FC1
|
|
|
|
padding = C763975D420029F04B2B6063
|
|
|
|
padding = DD88AE924BC862C760A8293A
|
|
|
|
tmp_aes_key = EA8E6BCE75807282BBA87A24BB3ADA8642FA637C7897F6C256316BA3634FABD8
|
|
|
|
tmp_aes_key = 9CE6361406319F2D525560C55CB735571D2B83E497907255400D1088EA914CE8
|
|
|
|
tmp_aes_iv = AD8254DDD5E3F0B4D3CA8C1778B838EF3490128FD67D33742993BD3D806079CB</code></pre>
|
|
|
|
tmp_aes_iv = E7467B94F4DAE2F7303285B9632C08FB25DA82E4947553BF6B4E8EF3FBD199C5</code></pre>
|
|
|
|
<!-- end client_DH_inner_data_input -->
|
|
|
|
<!-- end client_DH_inner_data_input -->
|
|
|
|
<p>Process:</p>
|
|
|
|
<p>Process:</p>
|
|
|
|
<pre><code>data_with_hash := SHA1(data) + data + padding (0-15 random bytes such that total length is divisible by 16)
|
|
|
|
<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>
|
|
|
|
encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);</code></pre>
|
|
|
|
<p>Output:</p>
|
|
|
|
<p>Output:</p>
|
|
|
|
<!-- start client_DH_inner_data_output -->
|
|
|
|
<!-- start client_DH_inner_data_output -->
|
|
|
|
<pre><code>encrypted_data = 2C17FE832916AAA109923B14A5EBCA49EBD49E79C03BE30B10B077D6EC2DF95A0AC08CEB3F83E9E542B4A03E01535E0AE3FADE0B4CDFBDAB453EC19858AD21F803B93D61352F71ACAC421F56A7166061BAA3AB871EFE1366FE06B7FFA8342351AD37EAE42513871C0712264FAAC605C15CA3951F85CB12142687E692263FC8C70B8193C8C937A926AFB10D46B4491C63CEBF42D9BF94ACB674007F5E7F622C6971119DA5C58D898941B529BD5E0952FB7C8C4701341B6534C796111842B710CEB0DA0A89E1B250544C4E0F8BC651CAC23EC2607CF405317E852F266E4FA5F82ADE194B4B166A235DF855BC86FC22534455010FE3B9724E6AF47C4A112BF5EDBFD418F036E788D77732263522B91A6C91EDE484FDCDC3ED5CE8D61D66BE05EDC6CBC0D1C0A9EA02345494C2DA364DDA73EA2A3F26F9B134BD1AEBB41BC108B1096BDAB39CE9DADBDA31D4225EF79CC585</code></pre>
|
|
|
|
<pre><code>encrypted_data = 1CB72DD52537694C6C8994E7F9FC52A2DD1C4C0BC6BE8DE9D9EBD6A4A61EFA254DC5F30E8BD4DF76DC9887855314400799895C5C677E852FBA3B0394C006AB1FF771DD6672E61432649C704F82BFB4E55A8A6D39B4FFC1EC995A7ADF1FF663B6FC50E30A1C3A075C59B9857A00CB1A62B8D666B9F9AC913CDDB7531FFAB56E987D56A31383B1263D0D938C8073F452C9C4E8BD8FC2221DFA9C4EC2B2D6E6910EA9B15CB6D989B7F8262FB751C5122F199F6C9F442ED2925900EC41C0D5F5632599123684E2F0471D671E80A920555A009C654F6739D4D7653C8927C077A3FCF54A83C0C2CA03C980A8308089FDE43E838EE4FD0653EAA20E716EECADC44C64FCE8889A8E1C6FECAE3839CAEDC6128FB26307DF55CDAD88A847F4F72203393EDA597374DF7166FD89320B827B937A7CBCAA7889894C752F07BFF1D01E49A16CAB9B309AF0A01878742CA0ED84C2C267E7</code></pre>
|
|
|
|
<!-- end client_DH_inner_data_output -->
|
|
|
|
<!-- end client_DH_inner_data_output -->
|
|
|
|
<p>The length of the final string is 336 bytes.</p>
|
|
|
|
<p>The length of the final string is 336 bytes.</p>
|
|
|
|
<h6>7.2) set_client_DH_params query</h6>
|
|
|
|
<h6>7.2) set_client_DH_params query</h6>
|
|
|
|
<!-- start set_client_DH_params -->
|
|
|
|
<!-- start set_client_DH_params -->
|
|
|
|
<p>Sent payload (excluding transport headers/trailers):</p>
|
|
|
|
<p>Sent payload (excluding transport headers/trailers):</p>
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 64 41 01 00 09 95 7C 65
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 1C C9 06 00 64 9E 7C 65
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 36 95 5F 64 53 29 BE 74
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 48 74 C5 FF 34 54 3B DD
|
|
|
|
0020 | AA 26 D1 0E EC 5F BD 2D 77 E0 62 22 2C 3E 29 5F
|
|
|
|
0020 | F8 88 01 BE 34 4A 3C 4D 69 08 BA 9B 24 01 96 62
|
|
|
|
0030 | D2 52 D2 9C AE F9 B1 46 FE 50 01 00 2C 17 FE 83
|
|
|
|
0030 | 11 6F B5 4B DC 8A D3 61 FE 50 01 00 1C B7 2D D5
|
|
|
|
0040 | 29 16 AA A1 09 92 3B 14 A5 EB CA 49 EB D4 9E 79
|
|
|
|
0040 | 25 37 69 4C 6C 89 94 E7 F9 FC 52 A2 DD 1C 4C 0B
|
|
|
|
0050 | C0 3B E3 0B 10 B0 77 D6 EC 2D F9 5A 0A C0 8C EB
|
|
|
|
0050 | C6 BE 8D E9 D9 EB D6 A4 A6 1E FA 25 4D C5 F3 0E
|
|
|
|
0060 | 3F 83 E9 E5 42 B4 A0 3E 01 53 5E 0A E3 FA DE 0B
|
|
|
|
0060 | 8B D4 DF 76 DC 98 87 85 53 14 40 07 99 89 5C 5C
|
|
|
|
0070 | 4C DF BD AB 45 3E C1 98 58 AD 21 F8 03 B9 3D 61
|
|
|
|
0070 | 67 7E 85 2F BA 3B 03 94 C0 06 AB 1F F7 71 DD 66
|
|
|
|
0080 | 35 2F 71 AC AC 42 1F 56 A7 16 60 61 BA A3 AB 87
|
|
|
|
0080 | 72 E6 14 32 64 9C 70 4F 82 BF B4 E5 5A 8A 6D 39
|
|
|
|
0090 | 1E FE 13 66 FE 06 B7 FF A8 34 23 51 AD 37 EA E4
|
|
|
|
0090 | B4 FF C1 EC 99 5A 7A DF 1F F6 63 B6 FC 50 E3 0A
|
|
|
|
00A0 | 25 13 87 1C 07 12 26 4F AA C6 05 C1 5C A3 95 1F
|
|
|
|
00A0 | 1C 3A 07 5C 59 B9 85 7A 00 CB 1A 62 B8 D6 66 B9
|
|
|
|
00B0 | 85 CB 12 14 26 87 E6 92 26 3F C8 C7 0B 81 93 C8
|
|
|
|
00B0 | F9 AC 91 3C DD B7 53 1F FA B5 6E 98 7D 56 A3 13
|
|
|
|
00C0 | C9 37 A9 26 AF B1 0D 46 B4 49 1C 63 CE BF 42 D9
|
|
|
|
00C0 | 83 B1 26 3D 0D 93 8C 80 73 F4 52 C9 C4 E8 BD 8F
|
|
|
|
00D0 | BF 94 AC B6 74 00 7F 5E 7F 62 2C 69 71 11 9D A5
|
|
|
|
00D0 | C2 22 1D FA 9C 4E C2 B2 D6 E6 91 0E A9 B1 5C B6
|
|
|
|
00E0 | C5 8D 89 89 41 B5 29 BD 5E 09 52 FB 7C 8C 47 01
|
|
|
|
00E0 | D9 89 B7 F8 26 2F B7 51 C5 12 2F 19 9F 6C 9F 44
|
|
|
|
00F0 | 34 1B 65 34 C7 96 11 18 42 B7 10 CE B0 DA 0A 89
|
|
|
|
00F0 | 2E D2 92 59 00 EC 41 C0 D5 F5 63 25 99 12 36 84
|
|
|
|
0100 | E1 B2 50 54 4C 4E 0F 8B C6 51 CA C2 3E C2 60 7C
|
|
|
|
0100 | E2 F0 47 1D 67 1E 80 A9 20 55 5A 00 9C 65 4F 67
|
|
|
|
0110 | F4 05 31 7E 85 2F 26 6E 4F A5 F8 2A DE 19 4B 4B
|
|
|
|
0110 | 39 D4 D7 65 3C 89 27 C0 77 A3 FC F5 4A 83 C0 C2
|
|
|
|
0120 | 16 6A 23 5D F8 55 BC 86 FC 22 53 44 55 01 0F E3
|
|
|
|
0120 | CA 03 C9 80 A8 30 80 89 FD E4 3E 83 8E E4 FD 06
|
|
|
|
0130 | B9 72 4E 6A F4 7C 4A 11 2B F5 ED BF D4 18 F0 36
|
|
|
|
0130 | 53 EA A2 0E 71 6E EC AD C4 4C 64 FC E8 88 9A 8E
|
|
|
|
0140 | E7 88 D7 77 32 26 35 22 B9 1A 6C 91 ED E4 84 FD
|
|
|
|
0140 | 1C 6F EC AE 38 39 CA ED C6 12 8F B2 63 07 DF 55
|
|
|
|
0150 | CD C3 ED 5C E8 D6 1D 66 BE 05 ED C6 CB C0 D1 C0
|
|
|
|
0150 | CD AD 88 A8 47 F4 F7 22 03 39 3E DA 59 73 74 DF
|
|
|
|
0160 | A9 EA 02 34 54 94 C2 DA 36 4D DA 73 EA 2A 3F 26
|
|
|
|
0160 | 71 66 FD 89 32 0B 82 7B 93 7A 7C BC AA 78 89 89
|
|
|
|
0170 | F9 B1 34 BD 1A EB B4 1B C1 08 B1 09 6B DA B3 9C
|
|
|
|
0170 | 4C 75 2F 07 BF F1 D0 1E 49 A1 6C AB 9B 30 9A F0
|
|
|
|
0180 | E9 DA DB DA 31 D4 22 5E F7 9C C5 85</code></pre>
|
|
|
|
0180 | A0 18 78 74 2C A0 ED 84 C2 C2 67 E7</code></pre>
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
<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>
|
|
|
|
<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">
|
|
|
|
<table class="table">
|
|
|
@ -746,7 +746,7 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>message_id</td>
|
|
|
|
<td>message_id</td>
|
|
|
|
<td>8, 8</td>
|
|
|
|
<td>8, 8</td>
|
|
|
|
<td><code>6441010009957C65</code></td>
|
|
|
|
<td><code>1CC90600649E7C65</code></td>
|
|
|
|
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
|
|
|
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
@ -764,19 +764,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>nonce</td>
|
|
|
|
<td>nonce</td>
|
|
|
|
<td>24, 16</td>
|
|
|
|
<td>24, 16</td>
|
|
|
|
<td><code>36955F645329BE74AA26D10EEC5FBD2D</code></td>
|
|
|
|
<td><code>4874C5FF34543BDDF88801BE344A3C4D</code></td>
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>server_nonce</td>
|
|
|
|
<td>server_nonce</td>
|
|
|
|
<td>40, 16</td>
|
|
|
|
<td>40, 16</td>
|
|
|
|
<td><code>77E062222C3E295FD252D29CAEF9B146</code></td>
|
|
|
|
<td><code>6908BA9B24019662116FB54BDC8AD361</code></td>
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
<td>56, 340</td>
|
|
|
|
<td>56, 340</td>
|
|
|
|
<td><code>FE5001002C17FE832916AAA109923B14</code> <code>A5EBCA49EBD49E79C03BE30B10B077D6</code> <code>EC2DF95A0AC08CEB3F83E9E542B4A03E</code> <code>01535E0AE3FADE0B4CDFBDAB453EC198</code> <code>58AD21F803B93D61352F71ACAC421F56</code> <code>A7166061BAA3AB871EFE1366FE06B7FF</code> <code>A8342351AD37EAE42513871C0712264F</code> <code>AAC605C15CA3951F85CB12142687E692</code> <code>263FC8C70B8193C8C937A926AFB10D46</code> <code>B4491C63CEBF42D9BF94ACB674007F5E</code> <code>7F622C6971119DA5C58D898941B529BD</code> <code>5E0952FB7C8C4701341B6534C7961118</code> <code>42B710CEB0DA0A89E1B250544C4E0F8B</code> <code>C651CAC23EC2607CF405317E852F266E</code> <code>4FA5F82ADE194B4B166A235DF855BC86</code> <code>FC22534455010FE3B9724E6AF47C4A11</code> <code>2BF5EDBFD418F036E788D77732263522</code> <code>B91A6C91EDE484FDCDC3ED5CE8D61D66</code> <code>BE05EDC6CBC0D1C0A9EA02345494C2DA</code> <code>364DDA73EA2A3F26F9B134BD1AEBB41B</code> <code>C108B1096BDAB39CE9DADBDA31D4225E</code><br> <code>F79CC585</code></td>
|
|
|
|
<td><code>FE5001001CB72DD52537694C6C8994E7</code> <code>F9FC52A2DD1C4C0BC6BE8DE9D9EBD6A4</code> <code>A61EFA254DC5F30E8BD4DF76DC988785</code> <code>5314400799895C5C677E852FBA3B0394</code> <code>C006AB1FF771DD6672E61432649C704F</code> <code>82BFB4E55A8A6D39B4FFC1EC995A7ADF</code> <code>1FF663B6FC50E30A1C3A075C59B9857A</code> <code>00CB1A62B8D666B9F9AC913CDDB7531F</code> <code>FAB56E987D56A31383B1263D0D938C80</code> <code>73F452C9C4E8BD8FC2221DFA9C4EC2B2</code> <code>D6E6910EA9B15CB6D989B7F8262FB751</code> <code>C5122F199F6C9F442ED2925900EC41C0</code> <code>D5F5632599123684E2F0471D671E80A9</code> <code>20555A009C654F6739D4D7653C8927C0</code> <code>77A3FCF54A83C0C2CA03C980A8308089</code> <code>FDE43E838EE4FD0653EAA20E716EECAD</code> <code>C44C64FCE8889A8E1C6FECAE3839CAED</code> <code>C6128FB26307DF55CDAD88A847F4F722</code> <code>03393EDA597374DF7166FD89320B827B</code> <code>937A7CBCAA7889894C752F07BFF1D01E</code> <code>49A16CAB9B309AF0A01878742CA0ED84</code><br> <code>C2C267E7</code></td>
|
|
|
|
<td>Encrypted client_DH_inner_data generated previously, serialized as a TL byte string</td>
|
|
|
|
<td>Encrypted client_DH_inner_data generated previously, serialized as a TL byte string</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</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>
|
|
|
|
<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>
|
|
|
|
<p>The client computes the auth_key using formula <code>g_a^b mod dh_prime</code>:</p>
|
|
|
|
<!-- start auth_key -->
|
|
|
|
<!-- start auth_key -->
|
|
|
|
<pre><code>auth_key = 9E91C8D6290855BFBCB09E1284574FEC478668686B734B44927C11F9EA86604EDE079F292F72EBA198FC5A7DE121AA39D627246F8701A92813E4CA63F19B9A30FEC268D125EF26C8A1D90D8B71C4AFF5AE61461D5C658673D79FCEC2A46B9DCCCDA10C54C30CF17996E819D8AEA71EE24C2D39E55F05DE686AAB41C0CE36CCA1B927354830EDA884E52EF5DC686E7630CC474F3F9AD43FD3DA71179E49545637AB9367A2D799A528F572D42520598C374ADC3821FC466D59A5C101BCC09725822E0F1498452E0044C75FFE9E743AD3378B6674E061DC129ECCF762FF976B5F0BB2CA92A948158D8A6959CC30A5B3E94D78E59FCD6A151E7586A7BBB300755141</code></pre>
|
|
|
|
<pre><code>auth_key = AD7C95D885083E3FAF05A0AFECD150B4AEA9DBAE2FF587E3F443ECE81B1F12861D441FFB5E376798D98B272CDCE517E4F800119BA47E59C4C19FAA3F1DB6002E52ED39519DF618E05BDB618F6D6590AF9FEF6C4F73E9C42416A0FC7506DF09838AFD1DEE176B48E8720540351B9B4A83BF1BE5283A6317956CEDAD15D2D08F572F6F6353238C193751A084687B3693DEFD5A080BDE82FB3A5141F047BB07979238462B57EEEA4AD6EAEEAA179DB943631DFD0485E4A4A8C386166AD1DAB516D3C8732A253950A528F0C4588BA4537A3BD3433156E53450B30A6A87F69664B4AFF67FC312E27F5A7954BC93F59AE99D0153B7D60DF00F912E625914BF8CE481B4</code></pre>
|
|
|
|
<!-- end auth_key -->
|
|
|
|
<!-- 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>
|
|
|
|
<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>
|
|
|
|
<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 -->
|
|
|
|
<!-- start dh_gen_ok -->
|
|
|
|
<p>Received payload (excluding transport headers/trailers):</p>
|
|
|
|
<p>Received payload (excluding transport headers/trailers):</p>
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 CC B2 53 09 95 7C 65
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 1C 10 D1 64 9E 7C 65
|
|
|
|
0010 | 54 00 00 00 34 F7 CB 3B 36 95 5F 64 53 29 BE 74
|
|
|
|
0010 | 34 00 00 00 34 F7 CB 3B 48 74 C5 FF 34 54 3B DD
|
|
|
|
0020 | AA 26 D1 0E EC 5F BD 2D 77 E0 62 22 2C 3E 29 5F
|
|
|
|
0020 | F8 88 01 BE 34 4A 3C 4D 69 08 BA 9B 24 01 96 62
|
|
|
|
0030 | D2 52 D2 9C AE F9 B1 46 7B F6 24 CF 81 E1 F5 10
|
|
|
|
0030 | 11 6F B5 4B DC 8A D3 61 F2 F4 CE A6 48 64 FA 0A
|
|
|
|
0040 | BF 17 89 8E 53 4E 2F B8</code></pre>
|
|
|
|
0040 | F7 F9 4B C4 11 AC 58 E0</code></pre>
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
<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>
|
|
|
|
<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">
|
|
|
|
<table class="table">
|
|
|
@ -817,13 +817,13 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>message_id</td>
|
|
|
|
<td>message_id</td>
|
|
|
|
<td>8, 8</td>
|
|
|
|
<td>8, 8</td>
|
|
|
|
<td><code>01CCB25309957C65</code></td>
|
|
|
|
<td><code>011C10D1649E7C65</code></td>
|
|
|
|
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
|
|
|
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>message_length</td>
|
|
|
|
<td>message_length</td>
|
|
|
|
<td>16, 4</td>
|
|
|
|
<td>16, 4</td>
|
|
|
|
<td><code>54000000</code> (84 in decimal)</td>
|
|
|
|
<td><code>34000000</code> (52 in decimal)</td>
|
|
|
|
<td>Message body length</td>
|
|
|
|
<td>Message body length</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
@ -835,19 +835,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>nonce</td>
|
|
|
|
<td>nonce</td>
|
|
|
|
<td>24, 16</td>
|
|
|
|
<td>24, 16</td>
|
|
|
|
<td><code>36955F645329BE74AA26D10EEC5FBD2D</code></td>
|
|
|
|
<td><code>4874C5FF34543BDDF88801BE344A3C4D</code></td>
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>server_nonce</td>
|
|
|
|
<td>server_nonce</td>
|
|
|
|
<td>40, 16</td>
|
|
|
|
<td>40, 16</td>
|
|
|
|
<td><code>77E062222C3E295FD252D29CAEF9B146</code></td>
|
|
|
|
<td><code>6908BA9B24019662116FB54BDC8AD361</code></td>
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
<td>56, 16</td>
|
|
|
|
<td>56, 16</td>
|
|
|
|
<td><code>7BF624CF81E1F510BF17898E534E2FB8</code></td>
|
|
|
|
<td><code>F2F4CEA64864FA0AF7F94BC411AC58E0</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>
|
|
|
|
<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>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</tbody>
|
|
|
|