Update content of files

This commit is contained in:
GitHub Action 2023-07-22 07:51:04 +00:00
parent 46c9149164
commit e43bc0b35b
10 changed files with 448 additions and 434 deletions

View file

@ -69,7 +69,7 @@
<li><a href="#payments">Payments</a></li> <li><a href="#payments">Payments</a></li>
<li><a href="#web-login">Web Login</a></li> <li><a href="#web-login">Web Login</a></li>
<li><a href="#html5-games">HTML5 Games</a></li> <li><a href="#html5-games">HTML5 Games</a></li>
<li><a href="#stickers">Stickers</a> </li> <li><a href="#stickers-and-custom-emoji">Stickers</a> </li>
</ul> </ul>
</li> </li>
<li><a href="#language-support"><strong>Language Support</strong></a></li> <li><a href="#language-support"><strong>Language Support</strong></a></li>
@ -241,7 +241,7 @@ width=44% /></a>
<li>Accept <a href="#payments">Payments</a> via dozens of integrated third-party payment providers.</li> <li>Accept <a href="#payments">Payments</a> via dozens of integrated third-party payment providers.</li>
<li>Connect to Telegram using the <a href="#web-login">Web Login</a> functionality.</li> <li>Connect to Telegram using the <a href="#web-login">Web Login</a> functionality.</li>
<li>Create gaming bots by integrating <a href="#html5-games">HTML5 Games</a>.</li> <li>Create gaming bots by integrating <a href="#html5-games">HTML5 Games</a>.</li>
<li>Help users create and manage <a href="#stickers">Telegram Stickers</a>.</li> <li>Help users create and manage <a href="#stickers-and-custom-emoji">Telegram Stickers</a>.</li>
</ul> </ul>
<h3><a class="anchor" name="web-apps" href="#web-apps"><i class="anchor-icon"></i></a>Web Apps</h3> <h3><a class="anchor" name="web-apps" href="#web-apps"><i class="anchor-icon"></i></a>Web Apps</h3>
<p>Bots can easily process <strong>complex inputs</strong> of any kind and <strong>dynamic interaction flows</strong> via <a href="webapps">Web Apps</a>. With this unique feature, you can develop any number of flexible, streamlined interfaces in <strong>JavaScript</strong>.</p> <p>Bots can easily process <strong>complex inputs</strong> of any kind and <strong>dynamic interaction flows</strong> via <a href="webapps">Web Apps</a>. With this unique feature, you can develop any number of flexible, streamlined interfaces in <strong>JavaScript</strong>.</p>
@ -344,7 +344,7 @@ width=44% /></a>
<ul> <ul>
<li>Your interfaces, texts and <a href="/bots/api#answerinlinequery">inline results</a> should adapt seamlessly to the <em>language_code</em>, without user intervention.</li> <li>Your interfaces, texts and <a href="/bots/api#answerinlinequery">inline results</a> should adapt seamlessly to the <em>language_code</em>, without user intervention.</li>
<li>Connected <a href="/bots/webapps">WebApps</a> will receive the user&#39;s <em>language_code</em> your HTML page should account for it.</li> <li>Connected <a href="/bots/webapps">WebApps</a> will receive the user&#39;s <em>language_code</em> your HTML page should account for it.</li>
<li><a href="/bots/html5-games">HTML5 Games</a> can obtain language information if you specify it as a <a href="/bots/games#using-url-parameters">URL parameter</a>. You can generate this parameter from the <em>language_code</em> field in the <a href="/bots/api#user">User</a> object served with the initial game <a href="/bots/api#callbackquery">CallbackQuery</a>.</li> <li><a href="/bots/games">HTML5 Games</a> can obtain language information if you specify it as a <a href="/bots/games#using-url-parameters">URL parameter</a>. You can generate this parameter from the <em>language_code</em> field in the <a href="/bots/api#user">User</a> object served with the initial game <a href="/bots/api#callbackquery">CallbackQuery</a>.</li>
<li>The bot&#39;s <strong>Name</strong>, <strong>Description</strong> and <strong>About text</strong> can be natively localized with the respective <a href="https://core.telegram.org/bots/api#setmydescription">methods</a>.</li> <li>The bot&#39;s <strong>Name</strong>, <strong>Description</strong> and <strong>About text</strong> can be natively localized with the respective <a href="https://core.telegram.org/bots/api#setmydescription">methods</a>.</li>
<li>Command lists can also be specified for individual languages more on this <a href="#commands">here</a>.</li> <li>Command lists can also be specified for individual languages more on this <a href="#commands">here</a>.</li>
</ul> </ul>

View file

@ -42,7 +42,7 @@
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/messageEntityMention" >messageEntityMention</a></li></ul></div> <div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/messageEntityMention" >messageEntityMention</a></li></ul></div>
<h1 id="dev_page_title">messageEntityMention</h1> <h1 id="dev_page_title">messageEntityMention</h1>
<div id="dev_page_content"><p>Message entity <a href="/api/mentions">mentioning</a> the current user</p> <div id="dev_page_content"><p>Message entity <a href="/api/mentions">mentioning</a> a user by <code>@username</code>; <a href="/constructor/messageEntityMentionName">messageEntityMentionName</a> can also be used to mention users by their ID.</p>
<p><div class="clearfix"> <p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills"> <ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown"> <li class="dropdown">

View file

@ -60,6 +60,9 @@ Client developers are required to comply with the <a href="/mtproto/security_gui
<p><a href="/mtproto/auth_key">Creating an Authorization Key</a></p> <p><a href="/mtproto/auth_key">Creating an Authorization Key</a></p>
</li> </li>
<li> <li>
<p><a href="/mtproto/samples-auth_key">Creating an Authorization Key: Example</a></p>
</li>
<li>
<p><a href="/mtproto/service_messages">Mobile Protocol: Service Messages</a></p> <p><a href="/mtproto/service_messages">Mobile Protocol: Service Messages</a></p>
</li> </li>
<li> <li>

View file

@ -138,7 +138,9 @@ In the first case, the client and the server have negotiated auth_key, following
<p><strong>IMPORTANT</strong>: Apart from the conditions on the Diffie-Hellman prime <strong>dh_prime</strong> and generator <strong>g</strong>, both sides are to check that <strong>g</strong>, <strong>g_a</strong> and <strong>g_b</strong> are greater than <strong>1</strong> and less than <strong>dh_prime - 1</strong>. We recommend checking that <strong>g_a</strong> and <strong>g_b</strong> are between <strong>2^{2048-64}</strong> and <strong>dh_prime - 2^{2048-64}</strong> as well.</p> <p><strong>IMPORTANT</strong>: Apart from the conditions on the Diffie-Hellman prime <strong>dh_prime</strong> and generator <strong>g</strong>, both sides are to check that <strong>g</strong>, <strong>g_a</strong> and <strong>g_b</strong> are greater than <strong>1</strong> and less than <strong>dh_prime - 1</strong>. We recommend checking that <strong>g_a</strong> and <strong>g_b</strong> are between <strong>2^{2048-64}</strong> and <strong>dh_prime - 2^{2048-64}</strong> as well.</p>
<h4><a class="anchor" href="#error-handling-lost-queries-and-responses" id="error-handling-lost-queries-and-responses" name="error-handling-lost-queries-and-responses"><i class="anchor-icon"></i></a>Error Handling (Lost Queries and Responses)</h4> <h4><a class="anchor" href="#error-handling-lost-queries-and-responses" id="error-handling-lost-queries-and-responses" name="error-handling-lost-queries-and-responses"><i class="anchor-icon"></i></a>Error Handling (Lost Queries and Responses)</h4>
<p>If the client fails to receive any response to its query from the server within a certain time interval, it may simply re-send the query. If the server has already sent a response to this query (<em>exactly</em> the same request and not just similar: all the parameters during the repeat request must take on the same values) but it did not get to the client, the server will simply re-send the same response. The server remembers the response for up to 10 minutes after having received the query in 1). If the server has already forgotten the response or the requisite temporary data, the client will have to start from the beginning.</p> <p>If the client fails to receive any response to its query from the server within a certain time interval, it may simply re-send the query. If the server has already sent a response to this query (<em>exactly</em> the same request and not just similar: all the parameters during the repeat request must take on the same values) but it did not get to the client, the server will simply re-send the same response. The server remembers the response for up to 10 minutes after having received the query in 1). If the server has already forgotten the response or the requisite temporary data, the client will have to start from the beginning.</p>
<p>The server may consider that if the client has already sent in the next query using the data from the previous server response to the specific client, the response is known to have been received by the client and may be forgotten by the server.</p></div> <p>The server may consider that if the client has already sent in the next query using the data from the previous server response to the specific client, the response is known to have been received by the client and may be forgotten by the server.</p>
<h4><a class="anchor" href="#usage-example" id="usage-example" name="usage-example"><i class="anchor-icon"></i></a>Usage Example</h4>
<p>An example of a complete list of queries required to generate an authorization key is shown on <a href="/mtproto/samples-auth_key">a separate page</a>.</p></div>
</div> </div>

View file

@ -44,7 +44,6 @@
<div id="dev_page_content"><!-- scroll_nav --> <div id="dev_page_content"><!-- scroll_nav -->
<h1><a class="anchor" href="#" id="" name=""><i class="anchor-icon"></i></a></h1>
<p>In the examples below, the <a href="/mtproto#transport">transport</a> headers are omitted:</p> <p>In the examples below, the <a href="/mtproto#transport">transport</a> headers are omitted:</p>
<blockquote> <blockquote>
<p>For example, for the <a href="/mtproto/mtproto-transports#abridged">abridged version of the transport »</a>, the client sends <code>0xef</code> as the first byte (<strong>important:</strong> only prior to the very first data packet), then the packet length is encoded with a single byte (<code>0x01-0x7e</code> = data length divided by 4; or <code>0x7f</code> followed by 3 bytes (little endian) divided by 4) followed by the data itself. In this case, server responses have the same structure (although the server does not send <code>0xef</code>as the first byte).</p> <p>For example, for the <a href="/mtproto/mtproto-transports#abridged">abridged version of the transport »</a>, the client sends <code>0xef</code> as the first byte (<strong>important:</strong> only prior to the very first data packet), then the packet length is encoded with a single byte (<code>0x01-0x7e</code> = data length divided by 4; or <code>0x7f</code> followed by 3 bytes (little endian) divided by 4) followed by the data itself. In this case, server responses have the same structure (although the server does not send <code>0xef</code>as the first byte).</p>
@ -54,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 84 8C 00 00 B1 AF 9C 64 <pre><code>0000 | 00 00 00 00 00 00 00 00 54 BC 00 00 FF 9A 9E 64
0010 | 14 00 00 00 F1 8E 7E BE B0 BB 83 C2 68 49 38 B7 0010 | 14 00 00 00 F1 8E 7E BE DA 60 3B 0B 6C 74 D6 0E
0020 | 6A C4 92 3A A5 45 C8 F0</code></pre> 0020 | C9 4A 04 D8 3A F2 02 7D</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">
@ -78,8 +77,8 @@
<tr> <tr>
<td>message_id</td> <td>message_id</td>
<td>8, 8</td> <td>8, 8</td>
<td><code>848C0000B1AF9C64</code></td> <td><code>54BC0000FF9A9E64</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a></td> <td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr> </tr>
<tr> <tr>
<td>message_length</td> <td>message_length</td>
@ -96,7 +95,7 @@
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>24, 16</td> <td>24, 16</td>
<td><code>B0BB83C2684938B76AC4923AA545C8F0</code></td> <td><code>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td>Random number</td> <td>Random number</td>
</tr> </tr>
</tbody> </tbody>
@ -105,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 9C 04 77 B1 AF 9C 64 <pre><code>0000 | 00 00 00 00 00 00 00 00 01 64 63 C2 FF 9A 9E 64
0010 | 50 00 00 00 63 24 16 05 B0 BB 83 C2 68 49 38 B7 0010 | 50 00 00 00 63 24 16 05 DA 60 3B 0B 6C 74 D6 0E
0020 | 6A C4 92 3A A5 45 C8 F0 59 2E 37 C5 BF 99 B8 DD 0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | AE 33 E6 EE 39 4B 47 42 08 2E 07 1E 8F 6E F5 45 0030 | 66 BA 31 F7 EF 43 97 39 08 1D 03 06 D7 8C 29 2A
0040 | 63 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09 0040 | 69 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>
@ -133,8 +132,8 @@
<tr> <tr>
<td>message_id</td> <td>message_id</td>
<td>8, 8</td> <td>8, 8</td>
<td><code>019C0477B1AF9C64</code></td> <td><code>016463C2FF9A9E64</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a></td> <td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr> </tr>
<tr> <tr>
<td>message_length</td> <td>message_length</td>
@ -151,19 +150,19 @@
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>24, 16</td> <td>24, 16</td>
<td><code>B0BB83C2684938B76AC4923AA545C8F0</code></td> <td><code>DA603B0B6C74D60EC94A04D83AF2027D</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>592E37C5BF99B8DDAE33E6EE394B4742</code></td> <td><code>8C0C719D738B757866BA31F7EF439739</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>082E071E8F6EF54563000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 3316653251972384099</td> <td><code>081D0306D78C292A69000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2090522174869285481</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>
@ -209,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--q" id="3-client-decomposes-pq-into-prime-factors-such-that-p--q" name="3-client-decomposes-pq-into-prime-factors-such-that-p--q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p &lt; q.</h5> <h5><a class="anchor" href="#3-client-decomposes-pq-into-prime-factors-such-that-p--q" id="3-client-decomposes-pq-into-prime-factors-such-that-p--q" name="3-client-decomposes-pq-into-prime-factors-such-that-p--q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p &lt; q.</h5>
<!-- start pq --> <!-- start pq -->
<pre><code>pq = 3316653251972384099</code></pre> <pre><code>pq = 2090522174869285481</code></pre>
<p>Decompose into 2 prime cofactors: <code>3316653251972384099 = 1704206131 * 1946157329</code></p> <p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2090522174869285481 = 1112973847 * 1878321023</code></p>
<pre><code>p = 1704206131 <pre><code>p = 1112973847
q = 1946157329</code></pre> q = 1878321023</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 2E 07 1E 8F 6E F5 45 63 00 00 00 <pre><code>0000 | 95 5F F5 A9 08 1D 03 06 D7 8C 29 2A 69 00 00 00
0010 | 04 65 94 1F 33 00 00 00 04 74 00 01 11 00 00 00 0010 | 04 42 56 A2 17 00 00 00 04 6F F4 E7 7F 00 00 00
0020 | B0 BB 83 C2 68 49 38 B7 6A C4 92 3A A5 45 C8 F0 0020 | DA 60 3B 0B 6C 74 D6 0E C9 4A 04 D8 3A F2 02 7D
0030 | 59 2E 37 C5 BF 99 B8 DD AE 33 E6 EE 39 4B 47 42 0030 | 8C 0C 71 9D 73 8B 75 78 66 BA 31 F7 EF 43 97 39
0040 | FA 05 D4 1E 4C C4 D7 94 58 F8 26 B2 33 4B 26 67 0040 | 0E 63 58 A8 84 41 7C 48 A8 81 CD B2 44 E1 CE 7D
0050 | 5C C6 64 8E 23 E7 62 6B 75 A1 B9 09 98 1A C9 55 0050 | 3F F7 C4 E4 4E 38 10 39 EF DC E2 57 66 F4 8C E4
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>
@ -247,37 +246,37 @@ q = 1946157329</code></pre>
<tr> <tr>
<td>pq</td> <td>pq</td>
<td>4, 12</td> <td>4, 12</td>
<td><code>082E071E8F6EF54563000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 3316653251972384099</td> <td><code>081D0306D78C292A69000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2090522174869285481</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>0465941F33000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1704206131</td> <td><code>044256A217000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1112973847</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>0474000111000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1946157329</td> <td><code>046FF4E77F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1878321023</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>B0BB83C2684938B76AC4923AA545C8F0</code></td> <td><code>DA603B0B6C74D60EC94A04D83AF2027D</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>592E37C5BF99B8DDAE33E6EE394B4742</code></td> <td><code>8C0C719D738B757866BA31F7EF439739</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>FA05D41E4CC4D79458F826B2334B2667</code> <code>5CC6648E23E7626B75A1B909981AC955</code></td> <td><code>0E6358A884417C48A881CDB244E1CE7D</code> <code>3FF7C4E44E381039EFDCE25766F48CE4</code></td>
<td>Client-generated random number</td> <td>Client-generated random number</td>
</tr> </tr>
<tr> <tr>
@ -292,39 +291,39 @@ q = 1946157329</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 = 955FF5A9082E071E8F6EF545630000000465941F330000000474000111000000B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B4742FA05D41E4CC4D79458F826B2334B26675CC6648E23E7626B75A1B909981AC95502000000 <pre><code>data = 955FF5A9081D0306D78C292A69000000044256A217000000046FF4E77F000000DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF4397390E6358A884417C48A881CDB244E1CE7D3FF7C4E44E381039EFDCE25766F48CE402000000
random_padding_bytes = 2F9E22AC78033569C4B3F7035D5FFAFC3EBF28ECD70A65926B2E64D9118B8AB14EB6A100AA469AACCB3B9961D5E588C19A4E0C17F8C5CEDC003442FD0AECC129BFD6EEA4AD293FF753A0B194AB005F24E74FA78A98E10EAA2F16AD98</code></pre> random_padding_bytes = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907CBA6FFDE7C240684F1767F3ABECA72A65B6B737894D25CF280679407F569BD4F5A52BCEB645852B499E9A467DFFD015FC2AA75DE1AB51568B018CEE65999DD3</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 = DF92287F32BBAE22049A7DF88007F9FBE0103D8DF533E4ED59C0A25B6D99FA0A9F2C83A8E45C28B2C7AB6D541B38C6254FDE09B773B38ECDB94B660D71415CDFD4B8BAD8B91DC60B837BF4205A781AB77885D8E0EF71E329D4B9356302C4D2BE16E34A6A939559BE65EC2F0EFE2CD561E9B058A13B5C8EEEB6907DF897AA7E48BE7F7DE1D13058476C8EDF60A79330D0A9178E3FA064EF069063BC37AAA3CC1B5E0E347290E5C1197A10C01986035E20C0B106074C857906131ACE5F75900037E16F66FC0D0D62383412CE7D7A9DCC45AFC3025AD9976268664F4162581175139A2F0910C69CDFBE9DA93CAC8C3CA67A4278E2CD2A67EF9D9FF5D7F866E24596</code></pre> <pre><code>encrypted_data = 978CD0DA71C89E58D5DD3A369FD23C91CDF29AE8DEF7D7FADC5303F2D7D0BF676E6408C20F9888167525245E891B2884D4894406FD34D0A3739BB89D8BEFC5982F4CE7D899CAD65156931C8048627A86C3549183D914CFFBCB3B39E2B719B1F243CEFBFEEB8E5EBCD0C343772500D27BA8CEB80A46FA4EEBD88435FDF979DF40938AC43C6947D55F7C3130122D5D90BAA23C03CDBD5EEDDF9D1F0D46054856E3A3F4A86E9BE4FF61E80FA5606A9A0D1F797DE334D6DE845B71C48544A5AC2ECEFC92F0194789C66085F6DBC1D81E6674A8CDAC6D1911BAEAE1279133C162A4091E04B85732AEBEC304C17DCD5A8637413EC2CAE8B00A06A2121179D4DBAACBB7</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 74 07 01 00 B1 AF 9C 64 <pre><code>0000 | 00 00 00 00 00 00 00 00 9C A0 09 00 FF 9A 9E 64
0010 | 40 01 00 00 BE E4 12 D7 B0 BB 83 C2 68 49 38 B7 0010 | 40 01 00 00 BE E4 12 D7 DA 60 3B 0B 6C 74 D6 0E
0020 | 6A C4 92 3A A5 45 C8 F0 59 2E 37 C5 BF 99 B8 DD 0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | AE 33 E6 EE 39 4B 47 42 04 65 94 1F 33 00 00 00 0030 | 66 BA 31 F7 EF 43 97 39 04 42 56 A2 17 00 00 00
0040 | 04 74 00 01 11 00 00 00 85 FD 64 DE 85 1D 9D D0 0040 | 04 6F F4 E7 7F 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 DF 92 28 7F 32 BB AE 22 04 9A 7D F8 0050 | FE 00 01 00 97 8C D0 DA 71 C8 9E 58 D5 DD 3A 36
0060 | 80 07 F9 FB E0 10 3D 8D F5 33 E4 ED 59 C0 A2 5B 0060 | 9F D2 3C 91 CD F2 9A E8 DE F7 D7 FA DC 53 03 F2
0070 | 6D 99 FA 0A 9F 2C 83 A8 E4 5C 28 B2 C7 AB 6D 54 0070 | D7 D0 BF 67 6E 64 08 C2 0F 98 88 16 75 25 24 5E
0080 | 1B 38 C6 25 4F DE 09 B7 73 B3 8E CD B9 4B 66 0D 0080 | 89 1B 28 84 D4 89 44 06 FD 34 D0 A3 73 9B B8 9D
0090 | 71 41 5C DF D4 B8 BA D8 B9 1D C6 0B 83 7B F4 20 0090 | 8B EF C5 98 2F 4C E7 D8 99 CA D6 51 56 93 1C 80
00A0 | 5A 78 1A B7 78 85 D8 E0 EF 71 E3 29 D4 B9 35 63 00A0 | 48 62 7A 86 C3 54 91 83 D9 14 CF FB CB 3B 39 E2
00B0 | 02 C4 D2 BE 16 E3 4A 6A 93 95 59 BE 65 EC 2F 0E 00B0 | B7 19 B1 F2 43 CE FB FE EB 8E 5E BC D0 C3 43 77
00C0 | FE 2C D5 61 E9 B0 58 A1 3B 5C 8E EE B6 90 7D F8 00C0 | 25 00 D2 7B A8 CE B8 0A 46 FA 4E EB D8 84 35 FD
00D0 | 97 AA 7E 48 BE 7F 7D E1 D1 30 58 47 6C 8E DF 60 00D0 | F9 79 DF 40 93 8A C4 3C 69 47 D5 5F 7C 31 30 12
00E0 | A7 93 30 D0 A9 17 8E 3F A0 64 EF 06 90 63 BC 37 00E0 | 2D 5D 90 BA A2 3C 03 CD BD 5E ED DF 9D 1F 0D 46
00F0 | AA A3 CC 1B 5E 0E 34 72 90 E5 C1 19 7A 10 C0 19 00F0 | 05 48 56 E3 A3 F4 A8 6E 9B E4 FF 61 E8 0F A5 60
0100 | 86 03 5E 20 C0 B1 06 07 4C 85 79 06 13 1A CE 5F 0100 | 6A 9A 0D 1F 79 7D E3 34 D6 DE 84 5B 71 C4 85 44
0110 | 75 90 00 37 E1 6F 66 FC 0D 0D 62 38 34 12 CE 7D 0110 | A5 AC 2E CE FC 92 F0 19 47 89 C6 60 85 F6 DB C1
0120 | 7A 9D CC 45 AF C3 02 5A D9 97 62 68 66 4F 41 62 0120 | D8 1E 66 74 A8 CD AC 6D 19 11 BA EA E1 27 91 33
0130 | 58 11 75 13 9A 2F 09 10 C6 9C DF BE 9D A9 3C AC 0130 | C1 62 A4 09 1E 04 B8 57 32 AE BE C3 04 C1 7D CD
0140 | 8C 3C A6 7A 42 78 E2 CD 2A 67 EF 9D 9F F5 D7 F8 0140 | 5A 86 37 41 3E C2 CA E8 B0 0A 06 A2 12 11 79 D4
0150 | 66 E2 45 96</code></pre> 0150 | DB AA CB B7</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">
@ -346,8 +345,8 @@ random_padding_bytes = 2F9E22AC78033569C4B3F7035D5FFAFC3EBF28ECD70A65926B2E64D91
<tr> <tr>
<td>message_id</td> <td>message_id</td>
<td>8, 8</td> <td>8, 8</td>
<td><code>74070100B1AF9C64</code></td> <td><code>9CA00900FF9A9E64</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a></td> <td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr> </tr>
<tr> <tr>
<td>message_length</td> <td>message_length</td>
@ -364,25 +363,25 @@ random_padding_bytes = 2F9E22AC78033569C4B3F7035D5FFAFC3EBF28ECD70A65926B2E64D91
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>24, 16</td> <td>24, 16</td>
<td><code>B0BB83C2684938B76AC4923AA545C8F0</code></td> <td><code>DA603B0B6C74D60EC94A04D83AF2027D</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>592E37C5BF99B8DDAE33E6EE394B4742</code></td> <td><code>8C0C719D738B757866BA31F7EF439739</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>0465941F33000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1704206131</td> <td><code>044256A217000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1112973847</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>0474000111000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1946157329</td> <td><code>046FF4E77F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1878321023</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>
@ -394,7 +393,7 @@ random_padding_bytes = 2F9E22AC78033569C4B3F7035D5FFAFC3EBF28ECD70A65926B2E64D91
<tr> <tr>
<td>encrypted_data</td> <td>encrypted_data</td>
<td>80, 260</td> <td>80, 260</td>
<td><code>FE000100DF92287F32BBAE22049A7DF8</code> <code>8007F9FBE0103D8DF533E4ED59C0A25B</code> <code>6D99FA0A9F2C83A8E45C28B2C7AB6D54</code> <code>1B38C6254FDE09B773B38ECDB94B660D</code> <code>71415CDFD4B8BAD8B91DC60B837BF420</code> <code>5A781AB77885D8E0EF71E329D4B93563</code> <code>02C4D2BE16E34A6A939559BE65EC2F0E</code> <code>FE2CD561E9B058A13B5C8EEEB6907DF8</code> <code>97AA7E48BE7F7DE1D13058476C8EDF60</code> <code>A79330D0A9178E3FA064EF069063BC37</code> <code>AAA3CC1B5E0E347290E5C1197A10C019</code> <code>86035E20C0B106074C857906131ACE5F</code> <code>75900037E16F66FC0D0D62383412CE7D</code> <code>7A9DCC45AFC3025AD9976268664F4162</code> <code>581175139A2F0910C69CDFBE9DA93CAC</code> <code>8C3CA67A4278E2CD2A67EF9D9FF5D7F8</code><br> <code>66E24596</code></td> <td><code>FE000100978CD0DA71C89E58D5DD3A36</code> <code>9FD23C91CDF29AE8DEF7D7FADC5303F2</code> <code>D7D0BF676E6408C20F9888167525245E</code> <code>891B2884D4894406FD34D0A3739BB89D</code> <code>8BEFC5982F4CE7D899CAD65156931C80</code> <code>48627A86C3549183D914CFFBCB3B39E2</code> <code>B719B1F243CEFBFEEB8E5EBCD0C34377</code> <code>2500D27BA8CEB80A46FA4EEBD88435FD</code> <code>F979DF40938AC43C6947D55F7C313012</code> <code>2D5D90BAA23C03CDBD5EEDDF9D1F0D46</code> <code>054856E3A3F4A86E9BE4FF61E80FA560</code> <code>6A9A0D1F797DE334D6DE845B71C48544</code> <code>A5AC2ECEFC92F0194789C66085F6DBC1</code> <code>D81E6674A8CDAC6D1911BAEAE1279133</code> <code>C162A4091E04B85732AEBEC304C17DCD</code> <code>5A8637413EC2CAE8B00A06A2121179D4</code><br> <code>DBAACBB7</code></td>
<td>Value generated above</td> <td>Value generated above</td>
</tr> </tr>
</tbody> </tbody>
@ -403,47 +402,47 @@ random_padding_bytes = 2F9E22AC78033569C4B3F7035D5FFAFC3EBF28ECD70A65926B2E64D91
<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 30 87 1E B2 AF 9C 64 <pre><code>0000 | 00 00 00 00 00 00 00 00 01 98 C2 50 00 9B 9E 64
0010 | 78 02 00 00 5C 07 E8 D0 B0 BB 83 C2 68 49 38 B7 0010 | 78 02 00 00 5C 07 E8 D0 DA 60 3B 0B 6C 74 D6 0E
0020 | 6A C4 92 3A A5 45 C8 F0 59 2E 37 C5 BF 99 B8 DD 0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | AE 33 E6 EE 39 4B 47 42 FE 50 02 00 07 3F F0 CE 0030 | 66 BA 31 F7 EF 43 97 39 FE 50 02 00 A0 35 2C C0
0040 | BA 1A 9E F8 80 F8 85 E4 D0 E9 C1 EF 93 F6 1A 18 0040 | 87 EA 1E 38 08 20 F7 C9 46 61 88 32 08 B6 F3 9D
0050 | BD 1B B7 8D 7A 36 D3 BF 1B 76 6E 28 13 91 02 C4 0050 | 47 BA DA 5D C7 2B 94 D7 22 F6 F7 C4 19 4B D2 56
0060 | 85 BA 0D 47 D3 83 C8 E6 03 9D BB D3 78 BA A6 4D 0060 | B0 75 4F BD 65 E2 C2 CA 64 28 AB 69 7A 3C D2 25
0070 | C0 67 F1 60 43 96 DA A0 4D 72 1E 11 0D 23 08 F4 0070 | 5C 3C 28 96 7A 0B 83 3C 1B 51 C9 D5 73 F2 DE BC
0080 | 95 A5 34 DE 44 30 06 DE 91 76 B4 B8 D9 27 24 84 0080 | B9 AE 8E BF 03 F6 C8 63 55 7D 44 02 7F 39 60 8B
0090 | 02 E1 6D 69 FC 8F 73 48 54 BA FB F8 06 00 4E 43 0090 | 2C A0 2F C9 8F EF CD 0C 1F 31 54 95 E7 EC C8 B1
00A0 | 26 9C A8 C8 72 91 D4 F8 F4 36 84 3A 0C B3 FD 63 00A0 | 7A 33 47 D6 6C FD E0 35 3D E7 EB 42 1F E0 63 B0
00B0 | 1F E4 D7 F4 1E 8F AC 2E 34 EF 84 0B DA C0 33 14 00B0 | C2 E4 85 DC 3E F6 EB 7B AE 57 4B 21 DD DB F7 D2
00C0 | 24 8A 4A F6 91 AD AB 7A 0C 6B DC CA 3D 85 FD 49 00C0 | 73 BF D0 8B 0A 17 CF B9 34 0D D2 C9 C4 B6 FF F2
00D0 | E4 9A E6 E5 18 AF 6D DA 95 CF 03 4F 90 EB 1B 42 00D0 | 4E 02 DE 47 32 22 D0 86 9E D1 A2 2E C6 59 3F 3A
00E0 | 50 CD F6 03 F5 81 21 BC 3C 48 89 E0 C6 73 0C 89 00E0 | 6E B6 55 07 2A CA B4 54 DC 17 33 A8 BA 64 A2 FA
00F0 | 77 3A 8D 77 C9 FC 7A F3 05 C9 F9 3B D8 35 10 FB 00F0 | FC B9 67 9D 8F 1A 43 20 4C BB F3 59 60 5A FB A7
0100 | F1 B9 8E D7 08 49 61 5A D2 C9 49 7F 9C 8A 94 4C 0100 | 7F 4F 4B 89 86 D8 A8 4B 35 76 83 38 09 78 BB 66
0110 | B1 D3 A5 1A D1 01 44 B7 77 7A 4A 5E D9 59 FF E0 0110 | F7 15 8C 5A 89 ED 75 B1 07 99 8E 89 51 6D D9 33
0120 | 3B 87 3D 4C F0 10 B3 61 C6 2F 7B 42 3E EC 02 CA 0120 | DE DE 35 D2 FA 4F 53 DF 49 29 54 1B 45 26 FB 13
0130 | CE 0D 28 0A 6E 34 1E A5 BD AE 28 EF BA 69 D0 50 0130 | 49 38 1F 96 A8 57 EE FB 9D F2 65 84 FF 51 6F D0
0140 | 58 10 56 35 6B 7B 6F 66 D9 A9 51 44 16 57 88 42 0140 | 6B 23 67 96 0A 4E 38 6D 7D FA 06 7E 60 30 41 DB
0150 | 24 0B ED 86 33 38 1F 0C 4A B0 06 C5 4B 60 29 E5 0150 | 1A BD 27 48 28 BD 3D 5F B7 43 6D B2 B1 C2 5D 81
0160 | 8E AF A3 6F 87 2E E7 C9 5B 5D F5 91 C7 C2 68 6A 0160 | 05 F2 10 8A 48 AE 0B F4 19 65 24 E6 83 EC 10 CC
0170 | 3E 61 48 9F FB 06 F9 10 AC 03 C5 F4 56 B9 A3 C3 0170 | 3A B8 CD 58 35 8C 02 AC 41 D9 26 FF 1E CD 4A 5F
0180 | 4A 5C CA CE 67 6E 87 5C F3 E7 67 91 C4 AD 88 C3 0180 | 19 36 98 6B C9 73 21 BD 4C 88 ED 7B 5F 09 4B 1E
0190 | 1F 9D 6F 43 EF 4E 9E F4 8E 0D BC 30 1E F2 9D 2E 0190 | 70 B7 2B 5E FC 1D 86 E9 82 43 05 19 52 35 F0 E0
01A0 | B3 80 30 70 5E 1A 0F 25 F2 00 7D 54 12 96 66 38 01A0 | 66 F2 DF A0 BB D2 48 8C C8 8B B5 7A C7 89 59 59
01B0 | DC 51 14 37 1A 63 08 2C 81 46 2C 3B 70 0E A5 35 01B0 | CB 1A FE BF B0 36 FB 92 00 E8 44 D2 60 31 A1 4A
01C0 | 6E 28 92 3F 50 87 AF 05 1C FD 81 59 B6 4B 2A DC 01C0 | BB F5 18 B0 89 3A FA 4C 29 D7 B0 6C 69 0D 5A 7F
01D0 | 80 4E 66 CB 70 F6 AD 25 17 21 C6 B8 CA 2F 21 68 01D0 | D3 16 CC 92 08 17 D4 5E 7E FE BF EB B5 89 BA 99
01E0 | 73 14 32 C9 67 BC 8B AE AD 02 96 40 E8 0C 2D C2 01E0 | F4 10 40 93 29 6E 99 99 B0 9E A6 6A 72 67 9A DD
01F0 | 7A E0 3C FC 5F C1 17 39 65 F9 CD F8 C2 93 1B 6E 01F0 | BA CE C3 63 D1 50 E1 6D FB 8D 51 C4 6E 19 50 5D
0200 | C5 D4 63 51 D7 E7 9D 33 AF BE 6C 58 66 3F 3E AD 0200 | C1 53 97 32 DD D3 CF F3 51 BD CE B2 8A D3 79 3C
0210 | A5 B2 A4 9D F6 CD E1 C9 90 78 61 08 11 65 11 DD 0210 | 0D A3 08 D1 2A 31 3B D7 D2 66 BB BA 88 76 5E 20
0220 | 9F C6 73 E0 55 9D 84 A5 51 36 C0 01 83 0F E6 2C 0220 | F3 39 22 08 58 43 97 68 07 2F 26 C4 AB EC CE 48
0230 | 49 5C 90 39 8E 96 05 49 4E 24 10 7C 02 67 BD A1 0230 | A5 F8 99 C5 26 E5 26 6F 7A 4A 4E F2 F3 B0 8B 5F
0240 | 29 79 7B 7B 1A CF 86 1C 04 F0 7D 6B BA 8B 11 1F 0240 | 53 AB 6B 45 90 F9 E0 DF 8B 44 10 05 C8 0C E4 72
0250 | 88 86 11 E5 63 1E FF 97 16 C4 06 A7 AE 8B E2 DD 0250 | E2 68 31 F8 64 E0 A9 CE 06 C9 DF FE C4 E6 01 3A
0260 | E1 D8 73 FB 57 1C 82 08 8A BD 18 FE 05 1F 6E 4A 0260 | 26 B8 23 A8 3B A4 64 3D 5F DD B6 DE EA F7 5D A3
0270 | EE 9B 90 94 C6 3F AC 38 CA 68 B4 EA 46 F1 2C D7 0270 | 0C 87 AB FE 29 F4 71 DD 82 7B 39 9C 6E C5 9D 98
0280 | 09 DF DA C9 44 ED 46 AF 79 2F DB A2</code></pre> 0280 | CE EE 1F D4 30 19 63 95 88 5F DB F9</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">
@ -465,8 +464,8 @@ random_padding_bytes = 2F9E22AC78033569C4B3F7035D5FFAFC3EBF28ECD70A65926B2E64D91
<tr> <tr>
<td>message_id</td> <td>message_id</td>
<td>8, 8</td> <td>8, 8</td>
<td><code>0130871EB2AF9C64</code></td> <td><code>0198C250009B9E64</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a></td> <td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr> </tr>
<tr> <tr>
<td>message_length</td> <td>message_length</td>
@ -483,19 +482,19 @@ random_padding_bytes = 2F9E22AC78033569C4B3F7035D5FFAFC3EBF28ECD70A65926B2E64D91
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>24, 16</td> <td>24, 16</td>
<td><code>B0BB83C2684938B76AC4923AA545C8F0</code></td> <td><code>DA603B0B6C74D60EC94A04D83AF2027D</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>592E37C5BF99B8DDAE33E6EE394B4742</code></td> <td><code>8C0C719D738B757866BA31F7EF439739</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>FE500200073FF0CEBA1A9EF880F885E4</code> <code>D0E9C1EF93F61A18BD1BB78D7A36D3BF</code> <code>1B766E28139102C485BA0D47D383C8E6</code> <code>039DBBD378BAA64DC067F1604396DAA0</code> <code>4D721E110D2308F495A534DE443006DE</code> <code>9176B4B8D927248402E16D69FC8F7348</code> <code>54BAFBF806004E43269CA8C87291D4F8</code> <code>F436843A0CB3FD631FE4D7F41E8FAC2E</code> <code>34EF840BDAC03314248A4AF691ADAB7A</code> <code>0C6BDCCA3D85FD49E49AE6E518AF6DDA</code> <code>95CF034F90EB1B4250CDF603F58121BC</code> <code>3C4889E0C6730C89773A8D77C9FC7AF3</code> <code>05C9F93BD83510FBF1B98ED70849615A</code> <code>D2C9497F9C8A944CB1D3A51AD10144B7</code> <code>777A4A5ED959FFE03B873D4CF010B361</code> <code>C62F7B423EEC02CACE0D280A6E341EA5</code> <code>BDAE28EFBA69D050581056356B7B6F66</code> <code>D9A9514416578842240BED8633381F0C</code> <code>4AB006C54B6029E58EAFA36F872EE7C9</code> <code>5B5DF591C7C2686A3E61489FFB06F910</code> <code>AC03C5F456B9A3C34A5CCACE676E875C</code> <code>F3E76791C4AD88C31F9D6F43EF4E9EF4</code> <code>8E0DBC301EF29D2EB38030705E1A0F25</code> <code>F2007D5412966638DC5114371A63082C</code> <code>81462C3B700EA5356E28923F5087AF05</code> <code>1CFD8159B64B2ADC804E66CB70F6AD25</code> <code>1721C6B8CA2F2168731432C967BC8BAE</code> <code>AD029640E80C2DC27AE03CFC5FC11739</code> <code>65F9CDF8C2931B6EC5D46351D7E79D33</code> <code>AFBE6C58663F3EADA5B2A49DF6CDE1C9</code> <code>90786108116511DD9FC673E0559D84A5</code> <code>5136C001830FE62C495C90398E960549</code> <code>4E24107C0267BDA129797B7B1ACF861C</code> <code>04F07D6BBA8B111F888611E5631EFF97</code> <code>16C406A7AE8BE2DDE1D873FB571C8208</code> <code>8ABD18FE051F6E4AEE9B9094C63FAC38</code> <code>CA68B4EA46F12CD709DFDAC944ED46AF</code><br> <code>792FDBA2</code></td> <td><code>FE500200A0352CC087EA1E380820F7C9</code> <code>4661883208B6F39D47BADA5DC72B94D7</code> <code>22F6F7C4194BD256B0754FBD65E2C2CA</code> <code>6428AB697A3CD2255C3C28967A0B833C</code> <code>1B51C9D573F2DEBCB9AE8EBF03F6C863</code> <code>557D44027F39608B2CA02FC98FEFCD0C</code> <code>1F315495E7ECC8B17A3347D66CFDE035</code> <code>3DE7EB421FE063B0C2E485DC3EF6EB7B</code> <code>AE574B21DDDBF7D273BFD08B0A17CFB9</code> <code>340DD2C9C4B6FFF24E02DE473222D086</code> <code>9ED1A22EC6593F3A6EB655072ACAB454</code> <code>DC1733A8BA64A2FAFCB9679D8F1A4320</code> <code>4CBBF359605AFBA77F4F4B8986D8A84B</code> <code>357683380978BB66F7158C5A89ED75B1</code> <code>07998E89516DD933DEDE35D2FA4F53DF</code> <code>4929541B4526FB1349381F96A857EEFB</code> <code>9DF26584FF516FD06B2367960A4E386D</code> <code>7DFA067E603041DB1ABD274828BD3D5F</code> <code>B7436DB2B1C25D8105F2108A48AE0BF4</code> <code>196524E683EC10CC3AB8CD58358C02AC</code> <code>41D926FF1ECD4A5F1936986BC97321BD</code> <code>4C88ED7B5F094B1E70B72B5EFC1D86E9</code> <code>824305195235F0E066F2DFA0BBD2488C</code> <code>C88BB57AC7895959CB1AFEBFB036FB92</code> <code>00E844D26031A14ABBF518B0893AFA4C</code> <code>29D7B06C690D5A7FD316CC920817D45E</code> <code>7EFEBFEBB589BA99F4104093296E9999</code> <code>B09EA66A72679ADDBACEC363D150E16D</code> <code>FB8D51C46E19505DC1539732DDD3CFF3</code> <code>51BDCEB28AD3793C0DA308D12A313BD7</code> <code>D266BBBA88765E20F339220858439768</code> <code>072F26C4ABECCE48A5F899C526E5266F</code> <code>7A4A4EF2F3B08B5F53AB6B4590F9E0DF</code> <code>8B441005C80CE472E26831F864E0A9CE</code> <code>06C9DFFEC4E6013A26B823A83BA4643D</code> <code>5FDDB6DEEAF75DA30C87ABFE29F471DD</code> <code>827B399C6EC59D98CEEE1FD430196395</code><br> <code>885FDBF9</code></td>
<td>See below</td> <td>See below</td>
</tr> </tr>
</tbody> </tbody>
@ -503,20 +502,20 @@ random_padding_bytes = 2F9E22AC78033569C4B3F7035D5FFAFC3EBF28ECD70A65926B2E64D91
<!-- 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 = 073FF0CEBA1A9EF880F885E4D0E9C1EF93F61A18BD1BB78D7A36D3BF1B766E28139102C485BA0D47D383C8E6039DBBD378BAA64DC067F1604396DAA04D721E110D2308F495A534DE443006DE9176B4B8D927248402E16D69FC8F734854BAFBF806004E43269CA8C87291D4F8F436843A0CB3FD631FE4D7F41E8FAC2E34EF840BDAC03314248A4AF691ADAB7A0C6BDCCA3D85FD49E49AE6E518AF6DDA95CF034F90EB1B4250CDF603F58121BC3C4889E0C6730C89773A8D77C9FC7AF305C9F93BD83510FBF1B98ED70849615AD2C9497F9C8A944CB1D3A51AD10144B7777A4A5ED959FFE03B873D4CF010B361C62F7B423EEC02CACE0D280A6E341EA5BDAE28EFBA69D050581056356B7B6F66D9A9514416578842240BED8633381F0C4AB006C54B6029E58EAFA36F872EE7C95B5DF591C7C2686A3E61489FFB06F910AC03C5F456B9A3C34A5CCACE676E875CF3E76791C4AD88C31F9D6F43EF4E9EF48E0DBC301EF29D2EB38030705E1A0F25F2007D5412966638DC5114371A63082C81462C3B700EA5356E28923F5087AF051CFD8159B64B2ADC804E66CB70F6AD251721C6B8CA2F2168731432C967BC8BAEAD029640E80C2DC27AE03CFC5FC1173965F9CDF8C2931B6EC5D46351D7E79D33AFBE6C58663F3EADA5B2A49DF6CDE1C990786108116511DD9FC673E0559D84A55136C001830FE62C495C90398E9605494E24107C0267BDA129797B7B1ACF861C04F07D6BBA8B111F888611E5631EFF9716C406A7AE8BE2DDE1D873FB571C82088ABD18FE051F6E4AEE9B9094C63FAC38CA68B4EA46F12CD709DFDAC944ED46AF792FDBA2 <pre><code>encrypted_answer = A0352CC087EA1E380820F7C94661883208B6F39D47BADA5DC72B94D722F6F7C4194BD256B0754FBD65E2C2CA6428AB697A3CD2255C3C28967A0B833C1B51C9D573F2DEBCB9AE8EBF03F6C863557D44027F39608B2CA02FC98FEFCD0C1F315495E7ECC8B17A3347D66CFDE0353DE7EB421FE063B0C2E485DC3EF6EB7BAE574B21DDDBF7D273BFD08B0A17CFB9340DD2C9C4B6FFF24E02DE473222D0869ED1A22EC6593F3A6EB655072ACAB454DC1733A8BA64A2FAFCB9679D8F1A43204CBBF359605AFBA77F4F4B8986D8A84B357683380978BB66F7158C5A89ED75B107998E89516DD933DEDE35D2FA4F53DF4929541B4526FB1349381F96A857EEFB9DF26584FF516FD06B2367960A4E386D7DFA067E603041DB1ABD274828BD3D5FB7436DB2B1C25D8105F2108A48AE0BF4196524E683EC10CC3AB8CD58358C02AC41D926FF1ECD4A5F1936986BC97321BD4C88ED7B5F094B1E70B72B5EFC1D86E9824305195235F0E066F2DFA0BBD2488CC88BB57AC7895959CB1AFEBFB036FB9200E844D26031A14ABBF518B0893AFA4C29D7B06C690D5A7FD316CC920817D45E7EFEBFEBB589BA99F4104093296E9999B09EA66A72679ADDBACEC363D150E16DFB8D51C46E19505DC1539732DDD3CFF351BDCEB28AD3793C0DA308D12A313BD7D266BBBA88765E20F339220858439768072F26C4ABECCE48A5F899C526E5266F7A4A4EF2F3B08B5F53AB6B4590F9E0DF8B441005C80CE472E26831F864E0A9CE06C9DFFEC4E6013A26B823A83BA4643D5FDDB6DEEAF75DA30C87ABFE29F471DD827B399C6EC59D98CEEE1FD430196395885FDBF9
tmp_aes_key = 3826079A7BBD2CC9B9AE0E9D1BEEDA1A663CE630DC446D259DE256A1C953E8FA tmp_aes_key = FD36AB8054D1E2F02F5205DC00729025F859AB708409CE4F32E82FDA951B0D7A
tmp_aes_iv = 7A6748BA29AAC95EF75BD4588351617832FD34568EF1C4018F04F871FA05D41E</code></pre> tmp_aes_iv = 049A211296D24BE36D7FFA1E3C30904487A544973922E4930CD594630E6358A8</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 = 3C9D681E6DB06E8B9F3D3CA74BC92D7E67D227D0BA0D89B5B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B474203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001002FDAB5904B04F687AFF2E819845CF3BE57A147004CFFEF1C5DEA2574EB87C7A1462EAF356CBAD7B11BC1AAF4C64924555834B4E0FECB94118F21958824D8E0EB78FD33BA711806508E1EFA3BDB4520DBD4459CA6BAD3A8CD59874AE8295DBD0B6EC31C2A381406FCFBCA4031EDB433CDCF43551BEDAC54CBF8209542C22BC0D564FC8585945869AF496994DEE5E9B1E59C96020713B4B3AE90ED7DC68FD1DB5B81C2411E7C0E70893BC1A5804563D424AE95A453419AFFEB3B8A8AF7C9995041DDBB3117F105397B250C2FF1F565926000CC06E175B9A7078ABFA6383D0771822291D83BC82DCD16E991B4ACF7F9C17814F6715D3517F4E66401863418F16AABB2AF9C641C1005E08D6EEDB1 <pre><code>answer_with_hash = 46A914334DFF3DF06D9A1E5330BF60A105E40B07BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010035D6639175B1FF6E0AC40189370B3067AF8D52CEA7087E49E01707B5E6112CB33327267BD526CDCD1E971B0488E8C93510E86049B25F640170B02BDE609E83050E5FAB0654C03837E7832018152B11928E0F2E4C3327DBE2717E123CC5994EA0A6034CED7EAD34D99CA90D8940B2065897EBF617B9B1662E682053CDC75A31FD6D7B27B1B8FE868C8139752A4848A5493DFC71477009E0653D185051A7D6F6C3A59C2A89EC8B9BCDD87CB849893D709261D690E3843565DEB19B76B21FB8A0A28DE3BEA19869F1D73346909D17666F94778077C599761176248536A8BB944F4F73C366BF70A04D13326D227999E146C830A473FC9B1F3525263FE30B7D82C2B7009B9E644AD2ABF1F215707B
answer = BA0D89B5B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B474203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001002FDAB5904B04F687AFF2E819845CF3BE57A147004CFFEF1C5DEA2574EB87C7A1462EAF356CBAD7B11BC1AAF4C64924555834B4E0FECB94118F21958824D8E0EB78FD33BA711806508E1EFA3BDB4520DBD4459CA6BAD3A8CD59874AE8295DBD0B6EC31C2A381406FCFBCA4031EDB433CDCF43551BEDAC54CBF8209542C22BC0D564FC8585945869AF496994DEE5E9B1E59C96020713B4B3AE90ED7DC68FD1DB5B81C2411E7C0E70893BC1A5804563D424AE95A453419AFFEB3B8A8AF7C9995041DDBB3117F105397B250C2FF1F565926000CC06E175B9A7078ABFA6383D0771822291D83BC82DCD16E991B4ACF7F9C17814F6715D3517F4E66401863418F16AABB2AF9C641C1005E08D6EEDB1</code></pre> answer = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010035D6639175B1FF6E0AC40189370B3067AF8D52CEA7087E49E01707B5E6112CB33327267BD526CDCD1E971B0488E8C93510E86049B25F640170B02BDE609E83050E5FAB0654C03837E7832018152B11928E0F2E4C3327DBE2717E123CC5994EA0A6034CED7EAD34D99CA90D8940B2065897EBF617B9B1662E682053CDC75A31FD6D7B27B1B8FE868C8139752A4848A5493DFC71477009E0653D185051A7D6F6C3A59C2A89EC8B9BCDD87CB849893D709261D690E3843565DEB19B76B21FB8A0A28DE3BEA19869F1D73346909D17666F94778077C599761176248536A8BB944F4F73C366BF70A04D13326D227999E146C830A473FC9B1F3525263FE30B7D82C2B7009B9E644AD2ABF1F215707B</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 B0 BB 83 C2 68 49 38 B7 6A C4 92 3A <pre><code>0000 | BA 0D 89 B5 DA 60 3B 0B 6C 74 D6 0E C9 4A 04 D8
0010 | A5 45 C8 F0 59 2E 37 C5 BF 99 B8 DD AE 33 E6 EE 0010 | 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78 66 BA 31 F7
0020 | 39 4B 47 42 03 00 00 00 FE 00 01 00 C7 1C AE B9 0020 | EF 43 97 39 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
@ -533,23 +532,23 @@ answer = BA0D89B5B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B474
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 | 2F DA B5 90 4B 04 F6 87 AF F2 E8 19 84 5C F3 BE 0130 | 35 D6 63 91 75 B1 FF 6E 0A C4 01 89 37 0B 30 67
0140 | 57 A1 47 00 4C FF EF 1C 5D EA 25 74 EB 87 C7 A1 0140 | AF 8D 52 CE A7 08 7E 49 E0 17 07 B5 E6 11 2C B3
0150 | 46 2E AF 35 6C BA D7 B1 1B C1 AA F4 C6 49 24 55 0150 | 33 27 26 7B D5 26 CD CD 1E 97 1B 04 88 E8 C9 35
0160 | 58 34 B4 E0 FE CB 94 11 8F 21 95 88 24 D8 E0 EB 0160 | 10 E8 60 49 B2 5F 64 01 70 B0 2B DE 60 9E 83 05
0170 | 78 FD 33 BA 71 18 06 50 8E 1E FA 3B DB 45 20 DB 0170 | 0E 5F AB 06 54 C0 38 37 E7 83 20 18 15 2B 11 92
0180 | D4 45 9C A6 BA D3 A8 CD 59 87 4A E8 29 5D BD 0B 0180 | 8E 0F 2E 4C 33 27 DB E2 71 7E 12 3C C5 99 4E A0
0190 | 6E C3 1C 2A 38 14 06 FC FB CA 40 31 ED B4 33 CD 0190 | A6 03 4C ED 7E AD 34 D9 9C A9 0D 89 40 B2 06 58
01A0 | CF 43 55 1B ED AC 54 CB F8 20 95 42 C2 2B C0 D5 01A0 | 97 EB F6 17 B9 B1 66 2E 68 20 53 CD C7 5A 31 FD
01B0 | 64 FC 85 85 94 58 69 AF 49 69 94 DE E5 E9 B1 E5 01B0 | 6D 7B 27 B1 B8 FE 86 8C 81 39 75 2A 48 48 A5 49
01C0 | 9C 96 02 07 13 B4 B3 AE 90 ED 7D C6 8F D1 DB 5B 01C0 | 3D FC 71 47 70 09 E0 65 3D 18 50 51 A7 D6 F6 C3
01D0 | 81 C2 41 1E 7C 0E 70 89 3B C1 A5 80 45 63 D4 24 01D0 | A5 9C 2A 89 EC 8B 9B CD D8 7C B8 49 89 3D 70 92
01E0 | AE 95 A4 53 41 9A FF EB 3B 8A 8A F7 C9 99 50 41 01E0 | 61 D6 90 E3 84 35 65 DE B1 9B 76 B2 1F B8 A0 A2
01F0 | DD BB 31 17 F1 05 39 7B 25 0C 2F F1 F5 65 92 60 01F0 | 8D E3 BE A1 98 69 F1 D7 33 46 90 9D 17 66 6F 94
0200 | 00 CC 06 E1 75 B9 A7 07 8A BF A6 38 3D 07 71 82 0200 | 77 80 77 C5 99 76 11 76 24 85 36 A8 BB 94 4F 4F
0210 | 22 91 D8 3B C8 2D CD 16 E9 91 B4 AC F7 F9 C1 78 0210 | 73 C3 66 BF 70 A0 4D 13 32 6D 22 79 99 E1 46 C8
0220 | 14 F6 71 5D 35 17 F4 E6 64 01 86 34 18 F1 6A AB 0220 | 30 A4 73 FC 9B 1F 35 25 26 3F E3 0B 7D 82 C2 B7
0230 | B2 AF 9C 64</code></pre> 0230 | 00 9B 9E 64</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">
@ -571,13 +570,13 @@ answer = BA0D89B5B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B474
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>4, 16</td> <td>4, 16</td>
<td><code>B0BB83C2684938B76AC4923AA545C8F0</code></td> <td><code>DA603B0B6C74D60EC94A04D83AF2027D</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>592E37C5BF99B8DDAE33E6EE394B4742</code></td> <td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td>Value received from server in Step 2</td> <td>Value received from server in Step 2</td>
</tr> </tr>
<tr> <tr>
@ -595,13 +594,13 @@ answer = BA0D89B5B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B474
<tr> <tr>
<td>g_a</td> <td>g_a</td>
<td>300, 260</td> <td>300, 260</td>
<td><code>FE0001002FDAB5904B04F687AFF2E819</code> <code>845CF3BE57A147004CFFEF1C5DEA2574</code> <code>EB87C7A1462EAF356CBAD7B11BC1AAF4</code> <code>C64924555834B4E0FECB94118F219588</code> <code>24D8E0EB78FD33BA711806508E1EFA3B</code> <code>DB4520DBD4459CA6BAD3A8CD59874AE8</code> <code>295DBD0B6EC31C2A381406FCFBCA4031</code> <code>EDB433CDCF43551BEDAC54CBF8209542</code> <code>C22BC0D564FC8585945869AF496994DE</code> <code>E5E9B1E59C96020713B4B3AE90ED7DC6</code> <code>8FD1DB5B81C2411E7C0E70893BC1A580</code> <code>4563D424AE95A453419AFFEB3B8A8AF7</code> <code>C9995041DDBB3117F105397B250C2FF1</code> <code>F565926000CC06E175B9A7078ABFA638</code> <code>3D0771822291D83BC82DCD16E991B4AC</code> <code>F7F9C17814F6715D3517F4E664018634</code><br> <code>18F16AAB</code></td> <td><code>FE00010035D6639175B1FF6E0AC40189</code> <code>370B3067AF8D52CEA7087E49E01707B5</code> <code>E6112CB33327267BD526CDCD1E971B04</code> <code>88E8C93510E86049B25F640170B02BDE</code> <code>609E83050E5FAB0654C03837E7832018</code> <code>152B11928E0F2E4C3327DBE2717E123C</code> <code>C5994EA0A6034CED7EAD34D99CA90D89</code> <code>40B2065897EBF617B9B1662E682053CD</code> <code>C75A31FD6D7B27B1B8FE868C8139752A</code> <code>4848A5493DFC71477009E0653D185051</code> <code>A7D6F6C3A59C2A89EC8B9BCDD87CB849</code> <code>893D709261D690E3843565DEB19B76B2</code> <code>1FB8A0A28DE3BEA19869F1D73346909D</code> <code>17666F94778077C599761176248536A8</code> <code>BB944F4F73C366BF70A04D13326D2279</code> <code>99E146C830A473FC9B1F3525263FE30B</code><br> <code>7D82C2B7</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>B2AF9C64</code> (1687990194 in decimal)</td> <td><code>009B9E64</code> (1688115968 in decimal)</td>
<td>Server time</td> <td>Server time</td>
</tr> </tr>
</tbody> </tbody>
@ -610,34 +609,34 @@ answer = BA0D89B5B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B474
<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 = 29F2FD3102D844146B82E7C115C554A80961BC260BCA739BB670787AF0A72A512BA2E47AD58D0C478415251E4D0F7A737C2BF06A364C6E995ED596C88F4685F412B60205ECB9FA3ECA18A5B7B2DBEF3F26614806067E2F5831BB9CFF38278A25BB79A8F081A9E72E92CF74DE524DFBC07B6F5F77DF5F1EFF385E0B943282DF43A220AF62387F662982CCEDB59302EAD733438089FE871856F3C6E9221198094EA76E20868AEC4A7D7C809223CB28627DF3A05961B5148BE043CC64ECA1BFCC427F476E8A6769CDD7F5B774311BC166DB8FEC80E7C2BB9DF3B391D5D441B6BB35F0828BB9A22C9151FC63F1F3C04517C127A0BB98A2850867D7074E8D0C2FC576</code></pre> <pre><code>b = F7C5CD46D4A88DED59C1B412D39FEC78BD86A6DC2BF2C5C5D8AF305204158F14B3244D42FFCF2363DC0D25DC6C48A16A3A0E63813D9E87442CA3C2CF84DF848C540531FCDBAD8290A6B25E021EB9AAEEB702F6FB31DC39C48EF615BB0CBBEDE1958D8BF5DCC205CBED3A9DFCD597115163A131DFD4939E68EB2C6F097A5632A3773D5201783A3B6CDE805794F5CBEEFD9FCB8DEAEAD1C5BCADD6366C8A907FABE99A026E59E8521085CE6130123E80B72DFD5EF3D2C0BC880F52DEEF7404638D8053D464036BF7057A77BE75EDA78D3C82221BB131FE6ECB8C43F77DF1D04935F978BA40F3F59385D6D6C2E7782BFFB040AB60F28459EB68A42A904B55E8088C</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 = 69A19DF1CA7E2F7EB2D1C4FB9BA2856EF2AA19510669FF991757F7A3A10AA176A81CBD993DC7BD794C4E169056601BABFFE5C1A8DC6BCB705BB24BDB5E17280D26DAF0A9A801558CB87A11E30D6E8DD29CC039D014EA819CD0F8148CBA1BDB21331FFCB6063ED8FB66A6E90A02A80B68CDE53CB45D1266E8C19617FDD5AFD824001FD16BF666A1946B54B45C751CDD535B3718C6BE7A2EBAD4B35F5CA61D128B5B10ED4223C08D7294FCE18C8D30B5CFC8D73A80469150F7180F5F76F4FEAA0156EFA7665BB37F87B5F9EEAA654550555C05F91342608BB76F1E394EA6C51CE64589540E8729F9F5AE1B33108E8D35233ABFEE824AA2B940C5F04335CA59E0C4</code></pre> <pre><code>g_b = 2545CE89DAD14BDF0F1E2E34F366124474E221B5C2019CF5240612B81798311E9ED33201DE78EA34B59DC0151E4CF820DEEC3850E1B08114B7599A1C99F28A85234ABCF8DC8BE8AB0CD1019EC56AB7BB2E05F07B7656338BE254ABB2F45AD42A86848E602B04A6B9CC9262780D4F87505A8B17191F53E72BDB00AB290B76810EB15C873183D72EC3D2CB411C3F4BDC7944E1CABF5571B152F7FC3CA1DA470977329DC49854BA62A85AE7645FECBD8183B5A4AAD06DFC56D4BA6106F81A45BEF32A9E4F56A213FB2A027B3ACDFDDDE6A6D57E68352C82F7C0D2108FC010725929CB7C88EE737F7B498D86134C7C7F2626F0357067A07813C0D3F2C86876CC1FF1</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 B0 BB 83 C2 68 49 38 B7 6A C4 92 3A <pre><code>0000 | 54 B6 43 66 DA 60 3B 0B 6C 74 D6 0E C9 4A 04 D8
0010 | A5 45 C8 F0 59 2E 37 C5 BF 99 B8 DD AE 33 E6 EE 0010 | 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78 66 BA 31 F7
0020 | 39 4B 47 42 00 00 00 00 00 00 00 00 FE 00 01 00 0020 | EF 43 97 39 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 69 A1 9D F1 CA 7E 2F 7E B2 D1 C4 FB 9B A2 85 6E 0030 | 25 45 CE 89 DA D1 4B DF 0F 1E 2E 34 F3 66 12 44
0040 | F2 AA 19 51 06 69 FF 99 17 57 F7 A3 A1 0A A1 76 0040 | 74 E2 21 B5 C2 01 9C F5 24 06 12 B8 17 98 31 1E
0050 | A8 1C BD 99 3D C7 BD 79 4C 4E 16 90 56 60 1B AB 0050 | 9E D3 32 01 DE 78 EA 34 B5 9D C0 15 1E 4C F8 20
0060 | FF E5 C1 A8 DC 6B CB 70 5B B2 4B DB 5E 17 28 0D 0060 | DE EC 38 50 E1 B0 81 14 B7 59 9A 1C 99 F2 8A 85
0070 | 26 DA F0 A9 A8 01 55 8C B8 7A 11 E3 0D 6E 8D D2 0070 | 23 4A BC F8 DC 8B E8 AB 0C D1 01 9E C5 6A B7 BB
0080 | 9C C0 39 D0 14 EA 81 9C D0 F8 14 8C BA 1B DB 21 0080 | 2E 05 F0 7B 76 56 33 8B E2 54 AB B2 F4 5A D4 2A
0090 | 33 1F FC B6 06 3E D8 FB 66 A6 E9 0A 02 A8 0B 68 0090 | 86 84 8E 60 2B 04 A6 B9 CC 92 62 78 0D 4F 87 50
00A0 | CD E5 3C B4 5D 12 66 E8 C1 96 17 FD D5 AF D8 24 00A0 | 5A 8B 17 19 1F 53 E7 2B DB 00 AB 29 0B 76 81 0E
00B0 | 00 1F D1 6B F6 66 A1 94 6B 54 B4 5C 75 1C DD 53 00B0 | B1 5C 87 31 83 D7 2E C3 D2 CB 41 1C 3F 4B DC 79
00C0 | 5B 37 18 C6 BE 7A 2E BA D4 B3 5F 5C A6 1D 12 8B 00C0 | 44 E1 CA BF 55 71 B1 52 F7 FC 3C A1 DA 47 09 77
00D0 | 5B 10 ED 42 23 C0 8D 72 94 FC E1 8C 8D 30 B5 CF 00D0 | 32 9D C4 98 54 BA 62 A8 5A E7 64 5F EC BD 81 83
00E0 | C8 D7 3A 80 46 91 50 F7 18 0F 5F 76 F4 FE AA 01 00E0 | B5 A4 AA D0 6D FC 56 D4 BA 61 06 F8 1A 45 BE F3
00F0 | 56 EF A7 66 5B B3 7F 87 B5 F9 EE AA 65 45 50 55 00F0 | 2A 9E 4F 56 A2 13 FB 2A 02 7B 3A CD FD DD E6 A6
0100 | 5C 05 F9 13 42 60 8B B7 6F 1E 39 4E A6 C5 1C E6 0100 | D5 7E 68 35 2C 82 F7 C0 D2 10 8F C0 10 72 59 29
0110 | 45 89 54 0E 87 29 F9 F5 AE 1B 33 10 8E 8D 35 23 0110 | CB 7C 88 EE 73 7F 7B 49 8D 86 13 4C 7C 7F 26 26
0120 | 3A BF EE 82 4A A2 B9 40 C5 F0 43 35 CA 59 E0 C4</code></pre> 0120 | F0 35 70 67 A0 78 13 C0 D3 F2 C8 68 76 CC 1F F1</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">
@ -659,19 +658,19 @@ answer = BA0D89B5B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B474
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>4, 16</td> <td>4, 16</td>
<td><code>B0BB83C2684938B76AC4923AA545C8F0</code></td> <td><code>DA603B0B6C74D60EC94A04D83AF2027D</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>592E37C5BF99B8DDAE33E6EE394B4742</code></td> <td><code>8C0C719D738B757866BA31F7EF439739</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>FE00010069A19DF1CA7E2F7EB2D1C4FB</code> <code>9BA2856EF2AA19510669FF991757F7A3</code> <code>A10AA176A81CBD993DC7BD794C4E1690</code> <code>56601BABFFE5C1A8DC6BCB705BB24BDB</code> <code>5E17280D26DAF0A9A801558CB87A11E3</code> <code>0D6E8DD29CC039D014EA819CD0F8148C</code> <code>BA1BDB21331FFCB6063ED8FB66A6E90A</code> <code>02A80B68CDE53CB45D1266E8C19617FD</code> <code>D5AFD824001FD16BF666A1946B54B45C</code> <code>751CDD535B3718C6BE7A2EBAD4B35F5C</code> <code>A61D128B5B10ED4223C08D7294FCE18C</code> <code>8D30B5CFC8D73A80469150F7180F5F76</code> <code>F4FEAA0156EFA7665BB37F87B5F9EEAA</code> <code>654550555C05F91342608BB76F1E394E</code> <code>A6C51CE64589540E8729F9F5AE1B3310</code> <code>8E8D35233ABFEE824AA2B940C5F04335</code><br> <code>CA59E0C4</code></td> <td><code>FE0001002545CE89DAD14BDF0F1E2E34</code> <code>F366124474E221B5C2019CF5240612B8</code> <code>1798311E9ED33201DE78EA34B59DC015</code> <code>1E4CF820DEEC3850E1B08114B7599A1C</code> <code>99F28A85234ABCF8DC8BE8AB0CD1019E</code> <code>C56AB7BB2E05F07B7656338BE254ABB2</code> <code>F45AD42A86848E602B04A6B9CC926278</code> <code>0D4F87505A8B17191F53E72BDB00AB29</code> <code>0B76810EB15C873183D72EC3D2CB411C</code> <code>3F4BDC7944E1CABF5571B152F7FC3CA1</code> <code>DA470977329DC49854BA62A85AE7645F</code> <code>ECBD8183B5A4AAD06DFC56D4BA6106F8</code> <code>1A45BEF32A9E4F56A213FB2A027B3ACD</code> <code>FDDDE6A6D57E68352C82F7C0D2108FC0</code> <code>10725929CB7C88EE737F7B498D86134C</code> <code>7C7F2626F0357067A07813C0D3F2C868</code><br> <code>76CC1FF1</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>
@ -685,47 +684,47 @@ answer = BA0D89B5B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B474
<!-- 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 = 54B64366B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B47420000000000000000FE00010069A19DF1CA7E2F7EB2D1C4FB9BA2856EF2AA19510669FF991757F7A3A10AA176A81CBD993DC7BD794C4E169056601BABFFE5C1A8DC6BCB705BB24BDB5E17280D26DAF0A9A801558CB87A11E30D6E8DD29CC039D014EA819CD0F8148CBA1BDB21331FFCB6063ED8FB66A6E90A02A80B68CDE53CB45D1266E8C19617FDD5AFD824001FD16BF666A1946B54B45C751CDD535B3718C6BE7A2EBAD4B35F5CA61D128B5B10ED4223C08D7294FCE18C8D30B5CFC8D73A80469150F7180F5F76F4FEAA0156EFA7665BB37F87B5F9EEAA654550555C05F91342608BB76F1E394EA6C51CE64589540E8729F9F5AE1B33108E8D35233ABFEE824AA2B940C5F04335CA59E0C4 <pre><code>data = 54B64366DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF4397390000000000000000FE0001002545CE89DAD14BDF0F1E2E34F366124474E221B5C2019CF5240612B81798311E9ED33201DE78EA34B59DC0151E4CF820DEEC3850E1B08114B7599A1C99F28A85234ABCF8DC8BE8AB0CD1019EC56AB7BB2E05F07B7656338BE254ABB2F45AD42A86848E602B04A6B9CC9262780D4F87505A8B17191F53E72BDB00AB290B76810EB15C873183D72EC3D2CB411C3F4BDC7944E1CABF5571B152F7FC3CA1DA470977329DC49854BA62A85AE7645FECBD8183B5A4AAD06DFC56D4BA6106F81A45BEF32A9E4F56A213FB2A027B3ACDFDDDE6A6D57E68352C82F7C0D2108FC010725929CB7C88EE737F7B498D86134C7C7F2626F0357067A07813C0D3F2C86876CC1FF1
padding = 4670CB59FFB7033A86C62AA9 padding = BD8A6AC82FFB68885A48E0ED
tmp_aes_key = 3826079A7BBD2CC9B9AE0E9D1BEEDA1A663CE630DC446D259DE256A1C953E8FA tmp_aes_key = FD36AB8054D1E2F02F5205DC00729025F859AB708409CE4F32E82FDA951B0D7A
tmp_aes_iv = 7A6748BA29AAC95EF75BD4588351617832FD34568EF1C4018F04F871FA05D41E</code></pre> tmp_aes_iv = 049A211296D24BE36D7FFA1E3C30904487A544973922E4930CD594630E6358A8</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 = B157BF3596956D48DF20A9E10AB507971128D20530E7E3B6087FB1BA74DBE774DE8C5A1AC9D01F70868ED3681FC694F30CE358FC74B854DB48143196F4555CB22721DB87E83D14286CBFB54F4C18F51C9EB719C5924B4E546D6B073C68BA93198FB7A91FB4538E88F6DA2DCCF3734F7EA0112595DEDD6E69C38A5F70E1507069C26E847FB39EEF4BE96863A898FB521117DA5289CAD8F26F3D912D3314A3D4E54D81202AB36ED3625704730BCB495D3464433CB2CC51D1A355AD788C04084CFF69AEAA9AC6282785192BE1C7C1E4AC14E91358056E1A4BC2B0D5E9840F19F70257AD7975DAC3338C5B393835296E51D4845C07962A58F88EE2E2E67C46B1F44CBCA4624D6BD8CC3BA6B59B635CAFF706893E6368404F0475975F652D4C7C69C4E8FA88A9023BB89895823132B3408C0326A4FE9EE68ADEBC56768F0329C9DB79108F080FCEE326135F10E4F89E4C9EF5</code></pre> <pre><code>encrypted_data = E3B5716AC2E86342AD2E8C7B75FD17C713CE5C8559659F8301258D63D9101D1DB99EA9C1909315495C8776FD7885CA40AB860F38C8BD946F90CCEC63F3ED2A5A8F06F4E45BFDD0CC4A626AF74C299623B64E8E384BB7A66C36483EA667CE513FB5C2B9C7C635206E824F6BFC45A259CE0692745EBF3FDE3DEE350903FC0E2FF821DAECDF333B23F77866A444E2AC3B1BC8CC2EA38D4C2C3FF375FF70CFAF76E35BE863D54969CF4A887C8D6223874017B4B509CF3DE096E288512FBEF295D4DE4CC3CA6EAEA779B07100D8CC9E2EF7A6B40575CCC5EC93E32E7F8E4FD7332737F3B179573B4BEC13ABD868CC06A725ECFFC29494FE6AFFD3CEF2DE94681D4A3F19DDE0CF9BB0F13974443EA04D6CE173E0655BAFC847B5D55393BE982E00903B557B61FB38F15A88CADA345BC8B7820BB1C051C0A8B13AE70A5479E87D6BCA8A7AA73C306AF0FACD6760C566014DE790</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 BC D6 09 00 B2 AF 9C 64 <pre><code>0000 | 00 00 00 00 00 00 00 00 E8 30 0F 00 00 9B 9E 64
0010 | 78 01 00 00 1F 5F 04 F5 B0 BB 83 C2 68 49 38 B7 0010 | 78 01 00 00 1F 5F 04 F5 DA 60 3B 0B 6C 74 D6 0E
0020 | 6A C4 92 3A A5 45 C8 F0 59 2E 37 C5 BF 99 B8 DD 0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | AE 33 E6 EE 39 4B 47 42 FE 50 01 00 B1 57 BF 35 0030 | 66 BA 31 F7 EF 43 97 39 FE 50 01 00 E3 B5 71 6A
0040 | 96 95 6D 48 DF 20 A9 E1 0A B5 07 97 11 28 D2 05 0040 | C2 E8 63 42 AD 2E 8C 7B 75 FD 17 C7 13 CE 5C 85
0050 | 30 E7 E3 B6 08 7F B1 BA 74 DB E7 74 DE 8C 5A 1A 0050 | 59 65 9F 83 01 25 8D 63 D9 10 1D 1D B9 9E A9 C1
0060 | C9 D0 1F 70 86 8E D3 68 1F C6 94 F3 0C E3 58 FC 0060 | 90 93 15 49 5C 87 76 FD 78 85 CA 40 AB 86 0F 38
0070 | 74 B8 54 DB 48 14 31 96 F4 55 5C B2 27 21 DB 87 0070 | C8 BD 94 6F 90 CC EC 63 F3 ED 2A 5A 8F 06 F4 E4
0080 | E8 3D 14 28 6C BF B5 4F 4C 18 F5 1C 9E B7 19 C5 0080 | 5B FD D0 CC 4A 62 6A F7 4C 29 96 23 B6 4E 8E 38
0090 | 92 4B 4E 54 6D 6B 07 3C 68 BA 93 19 8F B7 A9 1F 0090 | 4B B7 A6 6C 36 48 3E A6 67 CE 51 3F B5 C2 B9 C7
00A0 | B4 53 8E 88 F6 DA 2D CC F3 73 4F 7E A0 11 25 95 00A0 | C6 35 20 6E 82 4F 6B FC 45 A2 59 CE 06 92 74 5E
00B0 | DE DD 6E 69 C3 8A 5F 70 E1 50 70 69 C2 6E 84 7F 00B0 | BF 3F DE 3D EE 35 09 03 FC 0E 2F F8 21 DA EC DF
00C0 | B3 9E EF 4B E9 68 63 A8 98 FB 52 11 17 DA 52 89 00C0 | 33 3B 23 F7 78 66 A4 44 E2 AC 3B 1B C8 CC 2E A3
00D0 | CA D8 F2 6F 3D 91 2D 33 14 A3 D4 E5 4D 81 20 2A 00D0 | 8D 4C 2C 3F F3 75 FF 70 CF AF 76 E3 5B E8 63 D5
00E0 | B3 6E D3 62 57 04 73 0B CB 49 5D 34 64 43 3C B2 00E0 | 49 69 CF 4A 88 7C 8D 62 23 87 40 17 B4 B5 09 CF
00F0 | CC 51 D1 A3 55 AD 78 8C 04 08 4C FF 69 AE AA 9A 00F0 | 3D E0 96 E2 88 51 2F BE F2 95 D4 DE 4C C3 CA 6E
0100 | C6 28 27 85 19 2B E1 C7 C1 E4 AC 14 E9 13 58 05 0100 | AE A7 79 B0 71 00 D8 CC 9E 2E F7 A6 B4 05 75 CC
0110 | 6E 1A 4B C2 B0 D5 E9 84 0F 19 F7 02 57 AD 79 75 0110 | C5 EC 93 E3 2E 7F 8E 4F D7 33 27 37 F3 B1 79 57
0120 | DA C3 33 8C 5B 39 38 35 29 6E 51 D4 84 5C 07 96 0120 | 3B 4B EC 13 AB D8 68 CC 06 A7 25 EC FF C2 94 94
0130 | 2A 58 F8 8E E2 E2 E6 7C 46 B1 F4 4C BC A4 62 4D 0130 | FE 6A FF D3 CE F2 DE 94 68 1D 4A 3F 19 DD E0 CF
0140 | 6B D8 CC 3B A6 B5 9B 63 5C AF F7 06 89 3E 63 68 0140 | 9B B0 F1 39 74 44 3E A0 4D 6C E1 73 E0 65 5B AF
0150 | 40 4F 04 75 97 5F 65 2D 4C 7C 69 C4 E8 FA 88 A9 0150 | C8 47 B5 D5 53 93 BE 98 2E 00 90 3B 55 7B 61 FB
0160 | 02 3B B8 98 95 82 31 32 B3 40 8C 03 26 A4 FE 9E 0160 | 38 F1 5A 88 CA DA 34 5B C8 B7 82 0B B1 C0 51 C0
0170 | E6 8A DE BC 56 76 8F 03 29 C9 DB 79 10 8F 08 0F 0170 | A8 B1 3A E7 0A 54 79 E8 7D 6B CA 8A 7A A7 3C 30
0180 | CE E3 26 13 5F 10 E4 F8 9E 4C 9E F5</code></pre> 0180 | 6A F0 FA CD 67 60 C5 66 01 4D E7 90</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">
@ -747,8 +746,8 @@ 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>BCD60900B2AF9C64</code></td> <td><code>E8300F00009B9E64</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a></td> <td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr> </tr>
<tr> <tr>
<td>message_length</td> <td>message_length</td>
@ -765,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>B0BB83C2684938B76AC4923AA545C8F0</code></td> <td><code>DA603B0B6C74D60EC94A04D83AF2027D</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>592E37C5BF99B8DDAE33E6EE394B4742</code></td> <td><code>8C0C719D738B757866BA31F7EF439739</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>FE500100B157BF3596956D48DF20A9E1</code> <code>0AB507971128D20530E7E3B6087FB1BA</code> <code>74DBE774DE8C5A1AC9D01F70868ED368</code> <code>1FC694F30CE358FC74B854DB48143196</code> <code>F4555CB22721DB87E83D14286CBFB54F</code> <code>4C18F51C9EB719C5924B4E546D6B073C</code> <code>68BA93198FB7A91FB4538E88F6DA2DCC</code> <code>F3734F7EA0112595DEDD6E69C38A5F70</code> <code>E1507069C26E847FB39EEF4BE96863A8</code> <code>98FB521117DA5289CAD8F26F3D912D33</code> <code>14A3D4E54D81202AB36ED3625704730B</code> <code>CB495D3464433CB2CC51D1A355AD788C</code> <code>04084CFF69AEAA9AC6282785192BE1C7</code> <code>C1E4AC14E91358056E1A4BC2B0D5E984</code> <code>0F19F70257AD7975DAC3338C5B393835</code> <code>296E51D4845C07962A58F88EE2E2E67C</code> <code>46B1F44CBCA4624D6BD8CC3BA6B59B63</code> <code>5CAFF706893E6368404F0475975F652D</code> <code>4C7C69C4E8FA88A9023BB89895823132</code> <code>B3408C0326A4FE9EE68ADEBC56768F03</code> <code>29C9DB79108F080FCEE326135F10E4F8</code><br> <code>9E4C9EF5</code></td> <td><code>FE500100E3B5716AC2E86342AD2E8C7B</code> <code>75FD17C713CE5C8559659F8301258D63</code> <code>D9101D1DB99EA9C1909315495C8776FD</code> <code>7885CA40AB860F38C8BD946F90CCEC63</code> <code>F3ED2A5A8F06F4E45BFDD0CC4A626AF7</code> <code>4C299623B64E8E384BB7A66C36483EA6</code> <code>67CE513FB5C2B9C7C635206E824F6BFC</code> <code>45A259CE0692745EBF3FDE3DEE350903</code> <code>FC0E2FF821DAECDF333B23F77866A444</code> <code>E2AC3B1BC8CC2EA38D4C2C3FF375FF70</code> <code>CFAF76E35BE863D54969CF4A887C8D62</code> <code>23874017B4B509CF3DE096E288512FBE</code> <code>F295D4DE4CC3CA6EAEA779B07100D8CC</code> <code>9E2EF7A6B40575CCC5EC93E32E7F8E4F</code> <code>D7332737F3B179573B4BEC13ABD868CC</code> <code>06A725ECFFC29494FE6AFFD3CEF2DE94</code> <code>681D4A3F19DDE0CF9BB0F13974443EA0</code> <code>4D6CE173E0655BAFC847B5D55393BE98</code> <code>2E00903B557B61FB38F15A88CADA345B</code> <code>C8B7820BB1C051C0A8B13AE70A5479E8</code> <code>7D6BCA8A7AA73C306AF0FACD6760C566</code><br> <code>014DE790</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>
@ -786,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 = 4B2FB207D87D159C14CFBC094533E4305721FD3F8CF1F4C2E218481DAD5BDE4BD687064C86A2F9B15DDF2EB43F6558C7EF91B99FADF614711AEDC6BBAE02F10B97EC40B81837695E58F11F2FAC48E949AF2DBC35E3A8476FF2C8C1CA85835634BEA918657C9801AD8876E8319C02ADF9209EAF5A3D429560D98816943C3019971B67372E146106CD27FB110A589DA8890F43348AF77143AFFCB08BEBEF89BD14BBFECC6AFE2B028C4BEC26ADC3D6786DABFF738CDAEBFE2D15806977DB496736716CD0B64938F1AEC6911FB56B70CC86BFB458048E970CD28E2F3844B7082493C1D46C0EA0AA798068C4160DA2C2D7562A6160255C6A1D7C3C47B7B8DD1C6D55</code></pre> <pre><code>auth_key = 48892B997A14A133B6D5B234A7F9B19DCE70CB192B9238372639DD6230B1BCC8D31BBBCCFA7F00BBEF38303BAE50FFF3DC814333123CE6E5980EF4493A74F38AD6B05B6737E296ADF4C97C69C95C5EC840BC22694F4CBFC14598B28F83B5CD79FE881F6AB9615226DF63078688371B3CDD2F6E97B35D17E6710E29469E1476B596C1DE136F05D585290776B306D6946B1C33374A459ECB0E9BFBC5A43D145A6B37C276E94C840EA0950B0B2523744CD538817DBA33CD6C84175AEA8561EBA117D2589EFB30A304B0F7AF29FF141E6B3F6F9FA5CEFF31DF1166937EA07D850427B6D779BBAB5B062526D435206EA25158EABC659DE3DC5E4ABF0D93B87B35E5E7</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 60 9B 67 B2 AF 9C 64 <pre><code>0000 | 00 00 00 00 00 00 00 00 01 84 8C 9F 00 9B 9E 64
0010 | 34 00 00 00 34 F7 CB 3B B0 BB 83 C2 68 49 38 B7 0010 | 34 00 00 00 34 F7 CB 3B DA 60 3B 0B 6C 74 D6 0E
0020 | 6A C4 92 3A A5 45 C8 F0 59 2E 37 C5 BF 99 B8 DD 0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | AE 33 E6 EE 39 4B 47 42 6A F1 5D D5 EA 4A 58 6A 0030 | 66 BA 31 F7 EF 43 97 39 B0 91 C6 77 C6 99 6C 09
0040 | 27 E0 A1 DC 7E 26 D2 C4</code></pre> 0040 | FF 59 F2 F9 AB 28 16 78</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">
@ -818,8 +817,8 @@ 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>01609B67B2AF9C64</code></td> <td><code>01848C9F009B9E64</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a></td> <td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr> </tr>
<tr> <tr>
<td>message_length</td> <td>message_length</td>
@ -836,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>B0BB83C2684938B76AC4923AA545C8F0</code></td> <td><code>DA603B0B6C74D60EC94A04D83AF2027D</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>592E37C5BF99B8DDAE33E6EE394B4742</code></td> <td><code>8C0C719D738B757866BA31F7EF439739</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>6AF15DD5EA4A586A27E0A1DC7E26D2C4</code></td> <td><code>B091C677C6996C09FF59F2F9AB281678</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>
@ -920,8 +919,11 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
</div> </div>
</div> </div>
<script src="/js/main.js?47"></script> <script src="/js/main.js?47"></script>
<script src="/js/jquery.min.js?1"></script>
<script src="/js/bootstrap.min.js?1"></script>
<script>backToTopInit("Go up"); <script>window.initDevPageNav&&initDevPageNav();
backToTopInit("Go up");
removePreloadInit(); removePreloadInit();
</script> </script>
</body> </body>

View file

@ -42,7 +42,7 @@
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/messageEntityMention" >messageEntityMention</a></li></ul></div> <div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/messageEntityMention" >messageEntityMention</a></li></ul></div>
<h1 id="dev_page_title">messageEntityMention</h1> <h1 id="dev_page_title">messageEntityMention</h1>
<div id="dev_page_content"><p>Message entity <a href="/api/mentions">mentioning</a> the current user</p> <div id="dev_page_content"><p>Message entity <a href="/api/mentions">mentioning</a> a user by <code>@username</code>; <a href="/constructor/messageEntityMentionName">messageEntityMentionName</a> can also be used to mention users by their ID.</p>
<p><div class="clearfix"> <p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills"> <ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown"> <li class="dropdown">

View file

@ -60,6 +60,9 @@ Client developers are required to comply with the <a href="/mtproto/security_gui
<p><a href="/mtproto/auth_key">Creating an Authorization Key</a></p> <p><a href="/mtproto/auth_key">Creating an Authorization Key</a></p>
</li> </li>
<li> <li>
<p><a href="/mtproto/samples-auth_key">Creating an Authorization Key: Example</a></p>
</li>
<li>
<p><a href="/mtproto/service_messages">Mobile Protocol: Service Messages</a></p> <p><a href="/mtproto/service_messages">Mobile Protocol: Service Messages</a></p>
</li> </li>
<li> <li>

View file

@ -138,7 +138,9 @@ In the first case, the client and the server have negotiated auth_key, following
<p><strong>IMPORTANT</strong>: Apart from the conditions on the Diffie-Hellman prime <strong>dh_prime</strong> and generator <strong>g</strong>, both sides are to check that <strong>g</strong>, <strong>g_a</strong> and <strong>g_b</strong> are greater than <strong>1</strong> and less than <strong>dh_prime - 1</strong>. We recommend checking that <strong>g_a</strong> and <strong>g_b</strong> are between <strong>2^{2048-64}</strong> and <strong>dh_prime - 2^{2048-64}</strong> as well.</p> <p><strong>IMPORTANT</strong>: Apart from the conditions on the Diffie-Hellman prime <strong>dh_prime</strong> and generator <strong>g</strong>, both sides are to check that <strong>g</strong>, <strong>g_a</strong> and <strong>g_b</strong> are greater than <strong>1</strong> and less than <strong>dh_prime - 1</strong>. We recommend checking that <strong>g_a</strong> and <strong>g_b</strong> are between <strong>2^{2048-64}</strong> and <strong>dh_prime - 2^{2048-64}</strong> as well.</p>
<h4><a class="anchor" href="#error-handling-lost-queries-and-responses" id="error-handling-lost-queries-and-responses" name="error-handling-lost-queries-and-responses"><i class="anchor-icon"></i></a>Error Handling (Lost Queries and Responses)</h4> <h4><a class="anchor" href="#error-handling-lost-queries-and-responses" id="error-handling-lost-queries-and-responses" name="error-handling-lost-queries-and-responses"><i class="anchor-icon"></i></a>Error Handling (Lost Queries and Responses)</h4>
<p>If the client fails to receive any response to its query from the server within a certain time interval, it may simply re-send the query. If the server has already sent a response to this query (<em>exactly</em> the same request and not just similar: all the parameters during the repeat request must take on the same values) but it did not get to the client, the server will simply re-send the same response. The server remembers the response for up to 10 minutes after having received the query in 1). If the server has already forgotten the response or the requisite temporary data, the client will have to start from the beginning.</p> <p>If the client fails to receive any response to its query from the server within a certain time interval, it may simply re-send the query. If the server has already sent a response to this query (<em>exactly</em> the same request and not just similar: all the parameters during the repeat request must take on the same values) but it did not get to the client, the server will simply re-send the same response. The server remembers the response for up to 10 minutes after having received the query in 1). If the server has already forgotten the response or the requisite temporary data, the client will have to start from the beginning.</p>
<p>The server may consider that if the client has already sent in the next query using the data from the previous server response to the specific client, the response is known to have been received by the client and may be forgotten by the server.</p></div> <p>The server may consider that if the client has already sent in the next query using the data from the previous server response to the specific client, the response is known to have been received by the client and may be forgotten by the server.</p>
<h4><a class="anchor" href="#usage-example" id="usage-example" name="usage-example"><i class="anchor-icon"></i></a>Usage Example</h4>
<p>An example of a complete list of queries required to generate an authorization key is shown on <a href="/mtproto/samples-auth_key">a separate page</a>.</p></div>
</div> </div>

View file

@ -44,7 +44,6 @@
<div id="dev_page_content"><!-- scroll_nav --> <div id="dev_page_content"><!-- scroll_nav -->
<h1><a class="anchor" href="#" id="" name=""><i class="anchor-icon"></i></a></h1>
<p>In the examples below, the <a href="/mtproto#transport">transport</a> headers are omitted:</p> <p>In the examples below, the <a href="/mtproto#transport">transport</a> headers are omitted:</p>
<blockquote> <blockquote>
<p>For example, for the <a href="/mtproto/mtproto-transports#abridged">abridged version of the transport »</a>, the client sends <code>0xef</code> as the first byte (<strong>important:</strong> only prior to the very first data packet), then the packet length is encoded with a single byte (<code>0x01-0x7e</code> = data length divided by 4; or <code>0x7f</code> followed by 3 bytes (little endian) divided by 4) followed by the data itself. In this case, server responses have the same structure (although the server does not send <code>0xef</code>as the first byte).</p> <p>For example, for the <a href="/mtproto/mtproto-transports#abridged">abridged version of the transport »</a>, the client sends <code>0xef</code> as the first byte (<strong>important:</strong> only prior to the very first data packet), then the packet length is encoded with a single byte (<code>0x01-0x7e</code> = data length divided by 4; or <code>0x7f</code> followed by 3 bytes (little endian) divided by 4) followed by the data itself. In this case, server responses have the same structure (although the server does not send <code>0xef</code>as the first byte).</p>
@ -54,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 84 8C 00 00 B1 AF 9C 64 <pre><code>0000 | 00 00 00 00 00 00 00 00 54 BC 00 00 FF 9A 9E 64
0010 | 14 00 00 00 F1 8E 7E BE B0 BB 83 C2 68 49 38 B7 0010 | 14 00 00 00 F1 8E 7E BE DA 60 3B 0B 6C 74 D6 0E
0020 | 6A C4 92 3A A5 45 C8 F0</code></pre> 0020 | C9 4A 04 D8 3A F2 02 7D</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">
@ -78,8 +77,8 @@
<tr> <tr>
<td>message_id</td> <td>message_id</td>
<td>8, 8</td> <td>8, 8</td>
<td><code>848C0000B1AF9C64</code></td> <td><code>54BC0000FF9A9E64</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a></td> <td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr> </tr>
<tr> <tr>
<td>message_length</td> <td>message_length</td>
@ -96,7 +95,7 @@
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>24, 16</td> <td>24, 16</td>
<td><code>B0BB83C2684938B76AC4923AA545C8F0</code></td> <td><code>DA603B0B6C74D60EC94A04D83AF2027D</code></td>
<td>Random number</td> <td>Random number</td>
</tr> </tr>
</tbody> </tbody>
@ -105,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 9C 04 77 B1 AF 9C 64 <pre><code>0000 | 00 00 00 00 00 00 00 00 01 64 63 C2 FF 9A 9E 64
0010 | 50 00 00 00 63 24 16 05 B0 BB 83 C2 68 49 38 B7 0010 | 50 00 00 00 63 24 16 05 DA 60 3B 0B 6C 74 D6 0E
0020 | 6A C4 92 3A A5 45 C8 F0 59 2E 37 C5 BF 99 B8 DD 0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | AE 33 E6 EE 39 4B 47 42 08 2E 07 1E 8F 6E F5 45 0030 | 66 BA 31 F7 EF 43 97 39 08 1D 03 06 D7 8C 29 2A
0040 | 63 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09 0040 | 69 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>
@ -133,8 +132,8 @@
<tr> <tr>
<td>message_id</td> <td>message_id</td>
<td>8, 8</td> <td>8, 8</td>
<td><code>019C0477B1AF9C64</code></td> <td><code>016463C2FF9A9E64</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a></td> <td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr> </tr>
<tr> <tr>
<td>message_length</td> <td>message_length</td>
@ -151,19 +150,19 @@
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>24, 16</td> <td>24, 16</td>
<td><code>B0BB83C2684938B76AC4923AA545C8F0</code></td> <td><code>DA603B0B6C74D60EC94A04D83AF2027D</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>592E37C5BF99B8DDAE33E6EE394B4742</code></td> <td><code>8C0C719D738B757866BA31F7EF439739</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>082E071E8F6EF54563000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 3316653251972384099</td> <td><code>081D0306D78C292A69000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2090522174869285481</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>
@ -209,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--q" id="3-client-decomposes-pq-into-prime-factors-such-that-p--q" name="3-client-decomposes-pq-into-prime-factors-such-that-p--q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p &lt; q.</h5> <h5><a class="anchor" href="#3-client-decomposes-pq-into-prime-factors-such-that-p--q" id="3-client-decomposes-pq-into-prime-factors-such-that-p--q" name="3-client-decomposes-pq-into-prime-factors-such-that-p--q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p &lt; q.</h5>
<!-- start pq --> <!-- start pq -->
<pre><code>pq = 3316653251972384099</code></pre> <pre><code>pq = 2090522174869285481</code></pre>
<p>Decompose into 2 prime cofactors: <code>3316653251972384099 = 1704206131 * 1946157329</code></p> <p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2090522174869285481 = 1112973847 * 1878321023</code></p>
<pre><code>p = 1704206131 <pre><code>p = 1112973847
q = 1946157329</code></pre> q = 1878321023</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 2E 07 1E 8F 6E F5 45 63 00 00 00 <pre><code>0000 | 95 5F F5 A9 08 1D 03 06 D7 8C 29 2A 69 00 00 00
0010 | 04 65 94 1F 33 00 00 00 04 74 00 01 11 00 00 00 0010 | 04 42 56 A2 17 00 00 00 04 6F F4 E7 7F 00 00 00
0020 | B0 BB 83 C2 68 49 38 B7 6A C4 92 3A A5 45 C8 F0 0020 | DA 60 3B 0B 6C 74 D6 0E C9 4A 04 D8 3A F2 02 7D
0030 | 59 2E 37 C5 BF 99 B8 DD AE 33 E6 EE 39 4B 47 42 0030 | 8C 0C 71 9D 73 8B 75 78 66 BA 31 F7 EF 43 97 39
0040 | FA 05 D4 1E 4C C4 D7 94 58 F8 26 B2 33 4B 26 67 0040 | 0E 63 58 A8 84 41 7C 48 A8 81 CD B2 44 E1 CE 7D
0050 | 5C C6 64 8E 23 E7 62 6B 75 A1 B9 09 98 1A C9 55 0050 | 3F F7 C4 E4 4E 38 10 39 EF DC E2 57 66 F4 8C E4
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>
@ -247,37 +246,37 @@ q = 1946157329</code></pre>
<tr> <tr>
<td>pq</td> <td>pq</td>
<td>4, 12</td> <td>4, 12</td>
<td><code>082E071E8F6EF54563000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 3316653251972384099</td> <td><code>081D0306D78C292A69000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2090522174869285481</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>0465941F33000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1704206131</td> <td><code>044256A217000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1112973847</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>0474000111000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1946157329</td> <td><code>046FF4E77F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1878321023</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>B0BB83C2684938B76AC4923AA545C8F0</code></td> <td><code>DA603B0B6C74D60EC94A04D83AF2027D</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>592E37C5BF99B8DDAE33E6EE394B4742</code></td> <td><code>8C0C719D738B757866BA31F7EF439739</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>FA05D41E4CC4D79458F826B2334B2667</code> <code>5CC6648E23E7626B75A1B909981AC955</code></td> <td><code>0E6358A884417C48A881CDB244E1CE7D</code> <code>3FF7C4E44E381039EFDCE25766F48CE4</code></td>
<td>Client-generated random number</td> <td>Client-generated random number</td>
</tr> </tr>
<tr> <tr>
@ -292,39 +291,39 @@ q = 1946157329</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 = 955FF5A9082E071E8F6EF545630000000465941F330000000474000111000000B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B4742FA05D41E4CC4D79458F826B2334B26675CC6648E23E7626B75A1B909981AC95502000000 <pre><code>data = 955FF5A9081D0306D78C292A69000000044256A217000000046FF4E77F000000DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF4397390E6358A884417C48A881CDB244E1CE7D3FF7C4E44E381039EFDCE25766F48CE402000000
random_padding_bytes = 2F9E22AC78033569C4B3F7035D5FFAFC3EBF28ECD70A65926B2E64D9118B8AB14EB6A100AA469AACCB3B9961D5E588C19A4E0C17F8C5CEDC003442FD0AECC129BFD6EEA4AD293FF753A0B194AB005F24E74FA78A98E10EAA2F16AD98</code></pre> random_padding_bytes = 6A5F16CE16C2F010CF1F5B1305F4340A22E68A8BC48EC863A7F3FB907CBA6FFDE7C240684F1767F3ABECA72A65B6B737894D25CF280679407F569BD4F5A52BCEB645852B499E9A467DFFD015FC2AA75DE1AB51568B018CEE65999DD3</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 = DF92287F32BBAE22049A7DF88007F9FBE0103D8DF533E4ED59C0A25B6D99FA0A9F2C83A8E45C28B2C7AB6D541B38C6254FDE09B773B38ECDB94B660D71415CDFD4B8BAD8B91DC60B837BF4205A781AB77885D8E0EF71E329D4B9356302C4D2BE16E34A6A939559BE65EC2F0EFE2CD561E9B058A13B5C8EEEB6907DF897AA7E48BE7F7DE1D13058476C8EDF60A79330D0A9178E3FA064EF069063BC37AAA3CC1B5E0E347290E5C1197A10C01986035E20C0B106074C857906131ACE5F75900037E16F66FC0D0D62383412CE7D7A9DCC45AFC3025AD9976268664F4162581175139A2F0910C69CDFBE9DA93CAC8C3CA67A4278E2CD2A67EF9D9FF5D7F866E24596</code></pre> <pre><code>encrypted_data = 978CD0DA71C89E58D5DD3A369FD23C91CDF29AE8DEF7D7FADC5303F2D7D0BF676E6408C20F9888167525245E891B2884D4894406FD34D0A3739BB89D8BEFC5982F4CE7D899CAD65156931C8048627A86C3549183D914CFFBCB3B39E2B719B1F243CEFBFEEB8E5EBCD0C343772500D27BA8CEB80A46FA4EEBD88435FDF979DF40938AC43C6947D55F7C3130122D5D90BAA23C03CDBD5EEDDF9D1F0D46054856E3A3F4A86E9BE4FF61E80FA5606A9A0D1F797DE334D6DE845B71C48544A5AC2ECEFC92F0194789C66085F6DBC1D81E6674A8CDAC6D1911BAEAE1279133C162A4091E04B85732AEBEC304C17DCD5A8637413EC2CAE8B00A06A2121179D4DBAACBB7</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 74 07 01 00 B1 AF 9C 64 <pre><code>0000 | 00 00 00 00 00 00 00 00 9C A0 09 00 FF 9A 9E 64
0010 | 40 01 00 00 BE E4 12 D7 B0 BB 83 C2 68 49 38 B7 0010 | 40 01 00 00 BE E4 12 D7 DA 60 3B 0B 6C 74 D6 0E
0020 | 6A C4 92 3A A5 45 C8 F0 59 2E 37 C5 BF 99 B8 DD 0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | AE 33 E6 EE 39 4B 47 42 04 65 94 1F 33 00 00 00 0030 | 66 BA 31 F7 EF 43 97 39 04 42 56 A2 17 00 00 00
0040 | 04 74 00 01 11 00 00 00 85 FD 64 DE 85 1D 9D D0 0040 | 04 6F F4 E7 7F 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 DF 92 28 7F 32 BB AE 22 04 9A 7D F8 0050 | FE 00 01 00 97 8C D0 DA 71 C8 9E 58 D5 DD 3A 36
0060 | 80 07 F9 FB E0 10 3D 8D F5 33 E4 ED 59 C0 A2 5B 0060 | 9F D2 3C 91 CD F2 9A E8 DE F7 D7 FA DC 53 03 F2
0070 | 6D 99 FA 0A 9F 2C 83 A8 E4 5C 28 B2 C7 AB 6D 54 0070 | D7 D0 BF 67 6E 64 08 C2 0F 98 88 16 75 25 24 5E
0080 | 1B 38 C6 25 4F DE 09 B7 73 B3 8E CD B9 4B 66 0D 0080 | 89 1B 28 84 D4 89 44 06 FD 34 D0 A3 73 9B B8 9D
0090 | 71 41 5C DF D4 B8 BA D8 B9 1D C6 0B 83 7B F4 20 0090 | 8B EF C5 98 2F 4C E7 D8 99 CA D6 51 56 93 1C 80
00A0 | 5A 78 1A B7 78 85 D8 E0 EF 71 E3 29 D4 B9 35 63 00A0 | 48 62 7A 86 C3 54 91 83 D9 14 CF FB CB 3B 39 E2
00B0 | 02 C4 D2 BE 16 E3 4A 6A 93 95 59 BE 65 EC 2F 0E 00B0 | B7 19 B1 F2 43 CE FB FE EB 8E 5E BC D0 C3 43 77
00C0 | FE 2C D5 61 E9 B0 58 A1 3B 5C 8E EE B6 90 7D F8 00C0 | 25 00 D2 7B A8 CE B8 0A 46 FA 4E EB D8 84 35 FD
00D0 | 97 AA 7E 48 BE 7F 7D E1 D1 30 58 47 6C 8E DF 60 00D0 | F9 79 DF 40 93 8A C4 3C 69 47 D5 5F 7C 31 30 12
00E0 | A7 93 30 D0 A9 17 8E 3F A0 64 EF 06 90 63 BC 37 00E0 | 2D 5D 90 BA A2 3C 03 CD BD 5E ED DF 9D 1F 0D 46
00F0 | AA A3 CC 1B 5E 0E 34 72 90 E5 C1 19 7A 10 C0 19 00F0 | 05 48 56 E3 A3 F4 A8 6E 9B E4 FF 61 E8 0F A5 60
0100 | 86 03 5E 20 C0 B1 06 07 4C 85 79 06 13 1A CE 5F 0100 | 6A 9A 0D 1F 79 7D E3 34 D6 DE 84 5B 71 C4 85 44
0110 | 75 90 00 37 E1 6F 66 FC 0D 0D 62 38 34 12 CE 7D 0110 | A5 AC 2E CE FC 92 F0 19 47 89 C6 60 85 F6 DB C1
0120 | 7A 9D CC 45 AF C3 02 5A D9 97 62 68 66 4F 41 62 0120 | D8 1E 66 74 A8 CD AC 6D 19 11 BA EA E1 27 91 33
0130 | 58 11 75 13 9A 2F 09 10 C6 9C DF BE 9D A9 3C AC 0130 | C1 62 A4 09 1E 04 B8 57 32 AE BE C3 04 C1 7D CD
0140 | 8C 3C A6 7A 42 78 E2 CD 2A 67 EF 9D 9F F5 D7 F8 0140 | 5A 86 37 41 3E C2 CA E8 B0 0A 06 A2 12 11 79 D4
0150 | 66 E2 45 96</code></pre> 0150 | DB AA CB B7</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">
@ -346,8 +345,8 @@ random_padding_bytes = 2F9E22AC78033569C4B3F7035D5FFAFC3EBF28ECD70A65926B2E64D91
<tr> <tr>
<td>message_id</td> <td>message_id</td>
<td>8, 8</td> <td>8, 8</td>
<td><code>74070100B1AF9C64</code></td> <td><code>9CA00900FF9A9E64</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a></td> <td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr> </tr>
<tr> <tr>
<td>message_length</td> <td>message_length</td>
@ -364,25 +363,25 @@ random_padding_bytes = 2F9E22AC78033569C4B3F7035D5FFAFC3EBF28ECD70A65926B2E64D91
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>24, 16</td> <td>24, 16</td>
<td><code>B0BB83C2684938B76AC4923AA545C8F0</code></td> <td><code>DA603B0B6C74D60EC94A04D83AF2027D</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>592E37C5BF99B8DDAE33E6EE394B4742</code></td> <td><code>8C0C719D738B757866BA31F7EF439739</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>0465941F33000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1704206131</td> <td><code>044256A217000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1112973847</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>0474000111000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1946157329</td> <td><code>046FF4E77F000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1878321023</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>
@ -394,7 +393,7 @@ random_padding_bytes = 2F9E22AC78033569C4B3F7035D5FFAFC3EBF28ECD70A65926B2E64D91
<tr> <tr>
<td>encrypted_data</td> <td>encrypted_data</td>
<td>80, 260</td> <td>80, 260</td>
<td><code>FE000100DF92287F32BBAE22049A7DF8</code> <code>8007F9FBE0103D8DF533E4ED59C0A25B</code> <code>6D99FA0A9F2C83A8E45C28B2C7AB6D54</code> <code>1B38C6254FDE09B773B38ECDB94B660D</code> <code>71415CDFD4B8BAD8B91DC60B837BF420</code> <code>5A781AB77885D8E0EF71E329D4B93563</code> <code>02C4D2BE16E34A6A939559BE65EC2F0E</code> <code>FE2CD561E9B058A13B5C8EEEB6907DF8</code> <code>97AA7E48BE7F7DE1D13058476C8EDF60</code> <code>A79330D0A9178E3FA064EF069063BC37</code> <code>AAA3CC1B5E0E347290E5C1197A10C019</code> <code>86035E20C0B106074C857906131ACE5F</code> <code>75900037E16F66FC0D0D62383412CE7D</code> <code>7A9DCC45AFC3025AD9976268664F4162</code> <code>581175139A2F0910C69CDFBE9DA93CAC</code> <code>8C3CA67A4278E2CD2A67EF9D9FF5D7F8</code><br> <code>66E24596</code></td> <td><code>FE000100978CD0DA71C89E58D5DD3A36</code> <code>9FD23C91CDF29AE8DEF7D7FADC5303F2</code> <code>D7D0BF676E6408C20F9888167525245E</code> <code>891B2884D4894406FD34D0A3739BB89D</code> <code>8BEFC5982F4CE7D899CAD65156931C80</code> <code>48627A86C3549183D914CFFBCB3B39E2</code> <code>B719B1F243CEFBFEEB8E5EBCD0C34377</code> <code>2500D27BA8CEB80A46FA4EEBD88435FD</code> <code>F979DF40938AC43C6947D55F7C313012</code> <code>2D5D90BAA23C03CDBD5EEDDF9D1F0D46</code> <code>054856E3A3F4A86E9BE4FF61E80FA560</code> <code>6A9A0D1F797DE334D6DE845B71C48544</code> <code>A5AC2ECEFC92F0194789C66085F6DBC1</code> <code>D81E6674A8CDAC6D1911BAEAE1279133</code> <code>C162A4091E04B85732AEBEC304C17DCD</code> <code>5A8637413EC2CAE8B00A06A2121179D4</code><br> <code>DBAACBB7</code></td>
<td>Value generated above</td> <td>Value generated above</td>
</tr> </tr>
</tbody> </tbody>
@ -403,47 +402,47 @@ random_padding_bytes = 2F9E22AC78033569C4B3F7035D5FFAFC3EBF28ECD70A65926B2E64D91
<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 30 87 1E B2 AF 9C 64 <pre><code>0000 | 00 00 00 00 00 00 00 00 01 98 C2 50 00 9B 9E 64
0010 | 78 02 00 00 5C 07 E8 D0 B0 BB 83 C2 68 49 38 B7 0010 | 78 02 00 00 5C 07 E8 D0 DA 60 3B 0B 6C 74 D6 0E
0020 | 6A C4 92 3A A5 45 C8 F0 59 2E 37 C5 BF 99 B8 DD 0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | AE 33 E6 EE 39 4B 47 42 FE 50 02 00 07 3F F0 CE 0030 | 66 BA 31 F7 EF 43 97 39 FE 50 02 00 A0 35 2C C0
0040 | BA 1A 9E F8 80 F8 85 E4 D0 E9 C1 EF 93 F6 1A 18 0040 | 87 EA 1E 38 08 20 F7 C9 46 61 88 32 08 B6 F3 9D
0050 | BD 1B B7 8D 7A 36 D3 BF 1B 76 6E 28 13 91 02 C4 0050 | 47 BA DA 5D C7 2B 94 D7 22 F6 F7 C4 19 4B D2 56
0060 | 85 BA 0D 47 D3 83 C8 E6 03 9D BB D3 78 BA A6 4D 0060 | B0 75 4F BD 65 E2 C2 CA 64 28 AB 69 7A 3C D2 25
0070 | C0 67 F1 60 43 96 DA A0 4D 72 1E 11 0D 23 08 F4 0070 | 5C 3C 28 96 7A 0B 83 3C 1B 51 C9 D5 73 F2 DE BC
0080 | 95 A5 34 DE 44 30 06 DE 91 76 B4 B8 D9 27 24 84 0080 | B9 AE 8E BF 03 F6 C8 63 55 7D 44 02 7F 39 60 8B
0090 | 02 E1 6D 69 FC 8F 73 48 54 BA FB F8 06 00 4E 43 0090 | 2C A0 2F C9 8F EF CD 0C 1F 31 54 95 E7 EC C8 B1
00A0 | 26 9C A8 C8 72 91 D4 F8 F4 36 84 3A 0C B3 FD 63 00A0 | 7A 33 47 D6 6C FD E0 35 3D E7 EB 42 1F E0 63 B0
00B0 | 1F E4 D7 F4 1E 8F AC 2E 34 EF 84 0B DA C0 33 14 00B0 | C2 E4 85 DC 3E F6 EB 7B AE 57 4B 21 DD DB F7 D2
00C0 | 24 8A 4A F6 91 AD AB 7A 0C 6B DC CA 3D 85 FD 49 00C0 | 73 BF D0 8B 0A 17 CF B9 34 0D D2 C9 C4 B6 FF F2
00D0 | E4 9A E6 E5 18 AF 6D DA 95 CF 03 4F 90 EB 1B 42 00D0 | 4E 02 DE 47 32 22 D0 86 9E D1 A2 2E C6 59 3F 3A
00E0 | 50 CD F6 03 F5 81 21 BC 3C 48 89 E0 C6 73 0C 89 00E0 | 6E B6 55 07 2A CA B4 54 DC 17 33 A8 BA 64 A2 FA
00F0 | 77 3A 8D 77 C9 FC 7A F3 05 C9 F9 3B D8 35 10 FB 00F0 | FC B9 67 9D 8F 1A 43 20 4C BB F3 59 60 5A FB A7
0100 | F1 B9 8E D7 08 49 61 5A D2 C9 49 7F 9C 8A 94 4C 0100 | 7F 4F 4B 89 86 D8 A8 4B 35 76 83 38 09 78 BB 66
0110 | B1 D3 A5 1A D1 01 44 B7 77 7A 4A 5E D9 59 FF E0 0110 | F7 15 8C 5A 89 ED 75 B1 07 99 8E 89 51 6D D9 33
0120 | 3B 87 3D 4C F0 10 B3 61 C6 2F 7B 42 3E EC 02 CA 0120 | DE DE 35 D2 FA 4F 53 DF 49 29 54 1B 45 26 FB 13
0130 | CE 0D 28 0A 6E 34 1E A5 BD AE 28 EF BA 69 D0 50 0130 | 49 38 1F 96 A8 57 EE FB 9D F2 65 84 FF 51 6F D0
0140 | 58 10 56 35 6B 7B 6F 66 D9 A9 51 44 16 57 88 42 0140 | 6B 23 67 96 0A 4E 38 6D 7D FA 06 7E 60 30 41 DB
0150 | 24 0B ED 86 33 38 1F 0C 4A B0 06 C5 4B 60 29 E5 0150 | 1A BD 27 48 28 BD 3D 5F B7 43 6D B2 B1 C2 5D 81
0160 | 8E AF A3 6F 87 2E E7 C9 5B 5D F5 91 C7 C2 68 6A 0160 | 05 F2 10 8A 48 AE 0B F4 19 65 24 E6 83 EC 10 CC
0170 | 3E 61 48 9F FB 06 F9 10 AC 03 C5 F4 56 B9 A3 C3 0170 | 3A B8 CD 58 35 8C 02 AC 41 D9 26 FF 1E CD 4A 5F
0180 | 4A 5C CA CE 67 6E 87 5C F3 E7 67 91 C4 AD 88 C3 0180 | 19 36 98 6B C9 73 21 BD 4C 88 ED 7B 5F 09 4B 1E
0190 | 1F 9D 6F 43 EF 4E 9E F4 8E 0D BC 30 1E F2 9D 2E 0190 | 70 B7 2B 5E FC 1D 86 E9 82 43 05 19 52 35 F0 E0
01A0 | B3 80 30 70 5E 1A 0F 25 F2 00 7D 54 12 96 66 38 01A0 | 66 F2 DF A0 BB D2 48 8C C8 8B B5 7A C7 89 59 59
01B0 | DC 51 14 37 1A 63 08 2C 81 46 2C 3B 70 0E A5 35 01B0 | CB 1A FE BF B0 36 FB 92 00 E8 44 D2 60 31 A1 4A
01C0 | 6E 28 92 3F 50 87 AF 05 1C FD 81 59 B6 4B 2A DC 01C0 | BB F5 18 B0 89 3A FA 4C 29 D7 B0 6C 69 0D 5A 7F
01D0 | 80 4E 66 CB 70 F6 AD 25 17 21 C6 B8 CA 2F 21 68 01D0 | D3 16 CC 92 08 17 D4 5E 7E FE BF EB B5 89 BA 99
01E0 | 73 14 32 C9 67 BC 8B AE AD 02 96 40 E8 0C 2D C2 01E0 | F4 10 40 93 29 6E 99 99 B0 9E A6 6A 72 67 9A DD
01F0 | 7A E0 3C FC 5F C1 17 39 65 F9 CD F8 C2 93 1B 6E 01F0 | BA CE C3 63 D1 50 E1 6D FB 8D 51 C4 6E 19 50 5D
0200 | C5 D4 63 51 D7 E7 9D 33 AF BE 6C 58 66 3F 3E AD 0200 | C1 53 97 32 DD D3 CF F3 51 BD CE B2 8A D3 79 3C
0210 | A5 B2 A4 9D F6 CD E1 C9 90 78 61 08 11 65 11 DD 0210 | 0D A3 08 D1 2A 31 3B D7 D2 66 BB BA 88 76 5E 20
0220 | 9F C6 73 E0 55 9D 84 A5 51 36 C0 01 83 0F E6 2C 0220 | F3 39 22 08 58 43 97 68 07 2F 26 C4 AB EC CE 48
0230 | 49 5C 90 39 8E 96 05 49 4E 24 10 7C 02 67 BD A1 0230 | A5 F8 99 C5 26 E5 26 6F 7A 4A 4E F2 F3 B0 8B 5F
0240 | 29 79 7B 7B 1A CF 86 1C 04 F0 7D 6B BA 8B 11 1F 0240 | 53 AB 6B 45 90 F9 E0 DF 8B 44 10 05 C8 0C E4 72
0250 | 88 86 11 E5 63 1E FF 97 16 C4 06 A7 AE 8B E2 DD 0250 | E2 68 31 F8 64 E0 A9 CE 06 C9 DF FE C4 E6 01 3A
0260 | E1 D8 73 FB 57 1C 82 08 8A BD 18 FE 05 1F 6E 4A 0260 | 26 B8 23 A8 3B A4 64 3D 5F DD B6 DE EA F7 5D A3
0270 | EE 9B 90 94 C6 3F AC 38 CA 68 B4 EA 46 F1 2C D7 0270 | 0C 87 AB FE 29 F4 71 DD 82 7B 39 9C 6E C5 9D 98
0280 | 09 DF DA C9 44 ED 46 AF 79 2F DB A2</code></pre> 0280 | CE EE 1F D4 30 19 63 95 88 5F DB F9</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">
@ -465,8 +464,8 @@ random_padding_bytes = 2F9E22AC78033569C4B3F7035D5FFAFC3EBF28ECD70A65926B2E64D91
<tr> <tr>
<td>message_id</td> <td>message_id</td>
<td>8, 8</td> <td>8, 8</td>
<td><code>0130871EB2AF9C64</code></td> <td><code>0198C250009B9E64</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a></td> <td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr> </tr>
<tr> <tr>
<td>message_length</td> <td>message_length</td>
@ -483,19 +482,19 @@ random_padding_bytes = 2F9E22AC78033569C4B3F7035D5FFAFC3EBF28ECD70A65926B2E64D91
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>24, 16</td> <td>24, 16</td>
<td><code>B0BB83C2684938B76AC4923AA545C8F0</code></td> <td><code>DA603B0B6C74D60EC94A04D83AF2027D</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>592E37C5BF99B8DDAE33E6EE394B4742</code></td> <td><code>8C0C719D738B757866BA31F7EF439739</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>FE500200073FF0CEBA1A9EF880F885E4</code> <code>D0E9C1EF93F61A18BD1BB78D7A36D3BF</code> <code>1B766E28139102C485BA0D47D383C8E6</code> <code>039DBBD378BAA64DC067F1604396DAA0</code> <code>4D721E110D2308F495A534DE443006DE</code> <code>9176B4B8D927248402E16D69FC8F7348</code> <code>54BAFBF806004E43269CA8C87291D4F8</code> <code>F436843A0CB3FD631FE4D7F41E8FAC2E</code> <code>34EF840BDAC03314248A4AF691ADAB7A</code> <code>0C6BDCCA3D85FD49E49AE6E518AF6DDA</code> <code>95CF034F90EB1B4250CDF603F58121BC</code> <code>3C4889E0C6730C89773A8D77C9FC7AF3</code> <code>05C9F93BD83510FBF1B98ED70849615A</code> <code>D2C9497F9C8A944CB1D3A51AD10144B7</code> <code>777A4A5ED959FFE03B873D4CF010B361</code> <code>C62F7B423EEC02CACE0D280A6E341EA5</code> <code>BDAE28EFBA69D050581056356B7B6F66</code> <code>D9A9514416578842240BED8633381F0C</code> <code>4AB006C54B6029E58EAFA36F872EE7C9</code> <code>5B5DF591C7C2686A3E61489FFB06F910</code> <code>AC03C5F456B9A3C34A5CCACE676E875C</code> <code>F3E76791C4AD88C31F9D6F43EF4E9EF4</code> <code>8E0DBC301EF29D2EB38030705E1A0F25</code> <code>F2007D5412966638DC5114371A63082C</code> <code>81462C3B700EA5356E28923F5087AF05</code> <code>1CFD8159B64B2ADC804E66CB70F6AD25</code> <code>1721C6B8CA2F2168731432C967BC8BAE</code> <code>AD029640E80C2DC27AE03CFC5FC11739</code> <code>65F9CDF8C2931B6EC5D46351D7E79D33</code> <code>AFBE6C58663F3EADA5B2A49DF6CDE1C9</code> <code>90786108116511DD9FC673E0559D84A5</code> <code>5136C001830FE62C495C90398E960549</code> <code>4E24107C0267BDA129797B7B1ACF861C</code> <code>04F07D6BBA8B111F888611E5631EFF97</code> <code>16C406A7AE8BE2DDE1D873FB571C8208</code> <code>8ABD18FE051F6E4AEE9B9094C63FAC38</code> <code>CA68B4EA46F12CD709DFDAC944ED46AF</code><br> <code>792FDBA2</code></td> <td><code>FE500200A0352CC087EA1E380820F7C9</code> <code>4661883208B6F39D47BADA5DC72B94D7</code> <code>22F6F7C4194BD256B0754FBD65E2C2CA</code> <code>6428AB697A3CD2255C3C28967A0B833C</code> <code>1B51C9D573F2DEBCB9AE8EBF03F6C863</code> <code>557D44027F39608B2CA02FC98FEFCD0C</code> <code>1F315495E7ECC8B17A3347D66CFDE035</code> <code>3DE7EB421FE063B0C2E485DC3EF6EB7B</code> <code>AE574B21DDDBF7D273BFD08B0A17CFB9</code> <code>340DD2C9C4B6FFF24E02DE473222D086</code> <code>9ED1A22EC6593F3A6EB655072ACAB454</code> <code>DC1733A8BA64A2FAFCB9679D8F1A4320</code> <code>4CBBF359605AFBA77F4F4B8986D8A84B</code> <code>357683380978BB66F7158C5A89ED75B1</code> <code>07998E89516DD933DEDE35D2FA4F53DF</code> <code>4929541B4526FB1349381F96A857EEFB</code> <code>9DF26584FF516FD06B2367960A4E386D</code> <code>7DFA067E603041DB1ABD274828BD3D5F</code> <code>B7436DB2B1C25D8105F2108A48AE0BF4</code> <code>196524E683EC10CC3AB8CD58358C02AC</code> <code>41D926FF1ECD4A5F1936986BC97321BD</code> <code>4C88ED7B5F094B1E70B72B5EFC1D86E9</code> <code>824305195235F0E066F2DFA0BBD2488C</code> <code>C88BB57AC7895959CB1AFEBFB036FB92</code> <code>00E844D26031A14ABBF518B0893AFA4C</code> <code>29D7B06C690D5A7FD316CC920817D45E</code> <code>7EFEBFEBB589BA99F4104093296E9999</code> <code>B09EA66A72679ADDBACEC363D150E16D</code> <code>FB8D51C46E19505DC1539732DDD3CFF3</code> <code>51BDCEB28AD3793C0DA308D12A313BD7</code> <code>D266BBBA88765E20F339220858439768</code> <code>072F26C4ABECCE48A5F899C526E5266F</code> <code>7A4A4EF2F3B08B5F53AB6B4590F9E0DF</code> <code>8B441005C80CE472E26831F864E0A9CE</code> <code>06C9DFFEC4E6013A26B823A83BA4643D</code> <code>5FDDB6DEEAF75DA30C87ABFE29F471DD</code> <code>827B399C6EC59D98CEEE1FD430196395</code><br> <code>885FDBF9</code></td>
<td>See below</td> <td>See below</td>
</tr> </tr>
</tbody> </tbody>
@ -503,20 +502,20 @@ random_padding_bytes = 2F9E22AC78033569C4B3F7035D5FFAFC3EBF28ECD70A65926B2E64D91
<!-- 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 = 073FF0CEBA1A9EF880F885E4D0E9C1EF93F61A18BD1BB78D7A36D3BF1B766E28139102C485BA0D47D383C8E6039DBBD378BAA64DC067F1604396DAA04D721E110D2308F495A534DE443006DE9176B4B8D927248402E16D69FC8F734854BAFBF806004E43269CA8C87291D4F8F436843A0CB3FD631FE4D7F41E8FAC2E34EF840BDAC03314248A4AF691ADAB7A0C6BDCCA3D85FD49E49AE6E518AF6DDA95CF034F90EB1B4250CDF603F58121BC3C4889E0C6730C89773A8D77C9FC7AF305C9F93BD83510FBF1B98ED70849615AD2C9497F9C8A944CB1D3A51AD10144B7777A4A5ED959FFE03B873D4CF010B361C62F7B423EEC02CACE0D280A6E341EA5BDAE28EFBA69D050581056356B7B6F66D9A9514416578842240BED8633381F0C4AB006C54B6029E58EAFA36F872EE7C95B5DF591C7C2686A3E61489FFB06F910AC03C5F456B9A3C34A5CCACE676E875CF3E76791C4AD88C31F9D6F43EF4E9EF48E0DBC301EF29D2EB38030705E1A0F25F2007D5412966638DC5114371A63082C81462C3B700EA5356E28923F5087AF051CFD8159B64B2ADC804E66CB70F6AD251721C6B8CA2F2168731432C967BC8BAEAD029640E80C2DC27AE03CFC5FC1173965F9CDF8C2931B6EC5D46351D7E79D33AFBE6C58663F3EADA5B2A49DF6CDE1C990786108116511DD9FC673E0559D84A55136C001830FE62C495C90398E9605494E24107C0267BDA129797B7B1ACF861C04F07D6BBA8B111F888611E5631EFF9716C406A7AE8BE2DDE1D873FB571C82088ABD18FE051F6E4AEE9B9094C63FAC38CA68B4EA46F12CD709DFDAC944ED46AF792FDBA2 <pre><code>encrypted_answer = A0352CC087EA1E380820F7C94661883208B6F39D47BADA5DC72B94D722F6F7C4194BD256B0754FBD65E2C2CA6428AB697A3CD2255C3C28967A0B833C1B51C9D573F2DEBCB9AE8EBF03F6C863557D44027F39608B2CA02FC98FEFCD0C1F315495E7ECC8B17A3347D66CFDE0353DE7EB421FE063B0C2E485DC3EF6EB7BAE574B21DDDBF7D273BFD08B0A17CFB9340DD2C9C4B6FFF24E02DE473222D0869ED1A22EC6593F3A6EB655072ACAB454DC1733A8BA64A2FAFCB9679D8F1A43204CBBF359605AFBA77F4F4B8986D8A84B357683380978BB66F7158C5A89ED75B107998E89516DD933DEDE35D2FA4F53DF4929541B4526FB1349381F96A857EEFB9DF26584FF516FD06B2367960A4E386D7DFA067E603041DB1ABD274828BD3D5FB7436DB2B1C25D8105F2108A48AE0BF4196524E683EC10CC3AB8CD58358C02AC41D926FF1ECD4A5F1936986BC97321BD4C88ED7B5F094B1E70B72B5EFC1D86E9824305195235F0E066F2DFA0BBD2488CC88BB57AC7895959CB1AFEBFB036FB9200E844D26031A14ABBF518B0893AFA4C29D7B06C690D5A7FD316CC920817D45E7EFEBFEBB589BA99F4104093296E9999B09EA66A72679ADDBACEC363D150E16DFB8D51C46E19505DC1539732DDD3CFF351BDCEB28AD3793C0DA308D12A313BD7D266BBBA88765E20F339220858439768072F26C4ABECCE48A5F899C526E5266F7A4A4EF2F3B08B5F53AB6B4590F9E0DF8B441005C80CE472E26831F864E0A9CE06C9DFFEC4E6013A26B823A83BA4643D5FDDB6DEEAF75DA30C87ABFE29F471DD827B399C6EC59D98CEEE1FD430196395885FDBF9
tmp_aes_key = 3826079A7BBD2CC9B9AE0E9D1BEEDA1A663CE630DC446D259DE256A1C953E8FA tmp_aes_key = FD36AB8054D1E2F02F5205DC00729025F859AB708409CE4F32E82FDA951B0D7A
tmp_aes_iv = 7A6748BA29AAC95EF75BD4588351617832FD34568EF1C4018F04F871FA05D41E</code></pre> tmp_aes_iv = 049A211296D24BE36D7FFA1E3C30904487A544973922E4930CD594630E6358A8</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 = 3C9D681E6DB06E8B9F3D3CA74BC92D7E67D227D0BA0D89B5B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B474203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001002FDAB5904B04F687AFF2E819845CF3BE57A147004CFFEF1C5DEA2574EB87C7A1462EAF356CBAD7B11BC1AAF4C64924555834B4E0FECB94118F21958824D8E0EB78FD33BA711806508E1EFA3BDB4520DBD4459CA6BAD3A8CD59874AE8295DBD0B6EC31C2A381406FCFBCA4031EDB433CDCF43551BEDAC54CBF8209542C22BC0D564FC8585945869AF496994DEE5E9B1E59C96020713B4B3AE90ED7DC68FD1DB5B81C2411E7C0E70893BC1A5804563D424AE95A453419AFFEB3B8A8AF7C9995041DDBB3117F105397B250C2FF1F565926000CC06E175B9A7078ABFA6383D0771822291D83BC82DCD16E991B4ACF7F9C17814F6715D3517F4E66401863418F16AABB2AF9C641C1005E08D6EEDB1 <pre><code>answer_with_hash = 46A914334DFF3DF06D9A1E5330BF60A105E40B07BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010035D6639175B1FF6E0AC40189370B3067AF8D52CEA7087E49E01707B5E6112CB33327267BD526CDCD1E971B0488E8C93510E86049B25F640170B02BDE609E83050E5FAB0654C03837E7832018152B11928E0F2E4C3327DBE2717E123CC5994EA0A6034CED7EAD34D99CA90D8940B2065897EBF617B9B1662E682053CDC75A31FD6D7B27B1B8FE868C8139752A4848A5493DFC71477009E0653D185051A7D6F6C3A59C2A89EC8B9BCDD87CB849893D709261D690E3843565DEB19B76B21FB8A0A28DE3BEA19869F1D73346909D17666F94778077C599761176248536A8BB944F4F73C366BF70A04D13326D227999E146C830A473FC9B1F3525263FE30B7D82C2B7009B9E644AD2ABF1F215707B
answer = BA0D89B5B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B474203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001002FDAB5904B04F687AFF2E819845CF3BE57A147004CFFEF1C5DEA2574EB87C7A1462EAF356CBAD7B11BC1AAF4C64924555834B4E0FECB94118F21958824D8E0EB78FD33BA711806508E1EFA3BDB4520DBD4459CA6BAD3A8CD59874AE8295DBD0B6EC31C2A381406FCFBCA4031EDB433CDCF43551BEDAC54CBF8209542C22BC0D564FC8585945869AF496994DEE5E9B1E59C96020713B4B3AE90ED7DC68FD1DB5B81C2411E7C0E70893BC1A5804563D424AE95A453419AFFEB3B8A8AF7C9995041DDBB3117F105397B250C2FF1F565926000CC06E175B9A7078ABFA6383D0771822291D83BC82DCD16E991B4ACF7F9C17814F6715D3517F4E66401863418F16AABB2AF9C641C1005E08D6EEDB1</code></pre> answer = BA0D89B5DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF43973903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010035D6639175B1FF6E0AC40189370B3067AF8D52CEA7087E49E01707B5E6112CB33327267BD526CDCD1E971B0488E8C93510E86049B25F640170B02BDE609E83050E5FAB0654C03837E7832018152B11928E0F2E4C3327DBE2717E123CC5994EA0A6034CED7EAD34D99CA90D8940B2065897EBF617B9B1662E682053CDC75A31FD6D7B27B1B8FE868C8139752A4848A5493DFC71477009E0653D185051A7D6F6C3A59C2A89EC8B9BCDD87CB849893D709261D690E3843565DEB19B76B21FB8A0A28DE3BEA19869F1D73346909D17666F94778077C599761176248536A8BB944F4F73C366BF70A04D13326D227999E146C830A473FC9B1F3525263FE30B7D82C2B7009B9E644AD2ABF1F215707B</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 B0 BB 83 C2 68 49 38 B7 6A C4 92 3A <pre><code>0000 | BA 0D 89 B5 DA 60 3B 0B 6C 74 D6 0E C9 4A 04 D8
0010 | A5 45 C8 F0 59 2E 37 C5 BF 99 B8 DD AE 33 E6 EE 0010 | 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78 66 BA 31 F7
0020 | 39 4B 47 42 03 00 00 00 FE 00 01 00 C7 1C AE B9 0020 | EF 43 97 39 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
@ -533,23 +532,23 @@ answer = BA0D89B5B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B474
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 | 2F DA B5 90 4B 04 F6 87 AF F2 E8 19 84 5C F3 BE 0130 | 35 D6 63 91 75 B1 FF 6E 0A C4 01 89 37 0B 30 67
0140 | 57 A1 47 00 4C FF EF 1C 5D EA 25 74 EB 87 C7 A1 0140 | AF 8D 52 CE A7 08 7E 49 E0 17 07 B5 E6 11 2C B3
0150 | 46 2E AF 35 6C BA D7 B1 1B C1 AA F4 C6 49 24 55 0150 | 33 27 26 7B D5 26 CD CD 1E 97 1B 04 88 E8 C9 35
0160 | 58 34 B4 E0 FE CB 94 11 8F 21 95 88 24 D8 E0 EB 0160 | 10 E8 60 49 B2 5F 64 01 70 B0 2B DE 60 9E 83 05
0170 | 78 FD 33 BA 71 18 06 50 8E 1E FA 3B DB 45 20 DB 0170 | 0E 5F AB 06 54 C0 38 37 E7 83 20 18 15 2B 11 92
0180 | D4 45 9C A6 BA D3 A8 CD 59 87 4A E8 29 5D BD 0B 0180 | 8E 0F 2E 4C 33 27 DB E2 71 7E 12 3C C5 99 4E A0
0190 | 6E C3 1C 2A 38 14 06 FC FB CA 40 31 ED B4 33 CD 0190 | A6 03 4C ED 7E AD 34 D9 9C A9 0D 89 40 B2 06 58
01A0 | CF 43 55 1B ED AC 54 CB F8 20 95 42 C2 2B C0 D5 01A0 | 97 EB F6 17 B9 B1 66 2E 68 20 53 CD C7 5A 31 FD
01B0 | 64 FC 85 85 94 58 69 AF 49 69 94 DE E5 E9 B1 E5 01B0 | 6D 7B 27 B1 B8 FE 86 8C 81 39 75 2A 48 48 A5 49
01C0 | 9C 96 02 07 13 B4 B3 AE 90 ED 7D C6 8F D1 DB 5B 01C0 | 3D FC 71 47 70 09 E0 65 3D 18 50 51 A7 D6 F6 C3
01D0 | 81 C2 41 1E 7C 0E 70 89 3B C1 A5 80 45 63 D4 24 01D0 | A5 9C 2A 89 EC 8B 9B CD D8 7C B8 49 89 3D 70 92
01E0 | AE 95 A4 53 41 9A FF EB 3B 8A 8A F7 C9 99 50 41 01E0 | 61 D6 90 E3 84 35 65 DE B1 9B 76 B2 1F B8 A0 A2
01F0 | DD BB 31 17 F1 05 39 7B 25 0C 2F F1 F5 65 92 60 01F0 | 8D E3 BE A1 98 69 F1 D7 33 46 90 9D 17 66 6F 94
0200 | 00 CC 06 E1 75 B9 A7 07 8A BF A6 38 3D 07 71 82 0200 | 77 80 77 C5 99 76 11 76 24 85 36 A8 BB 94 4F 4F
0210 | 22 91 D8 3B C8 2D CD 16 E9 91 B4 AC F7 F9 C1 78 0210 | 73 C3 66 BF 70 A0 4D 13 32 6D 22 79 99 E1 46 C8
0220 | 14 F6 71 5D 35 17 F4 E6 64 01 86 34 18 F1 6A AB 0220 | 30 A4 73 FC 9B 1F 35 25 26 3F E3 0B 7D 82 C2 B7
0230 | B2 AF 9C 64</code></pre> 0230 | 00 9B 9E 64</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">
@ -571,13 +570,13 @@ answer = BA0D89B5B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B474
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>4, 16</td> <td>4, 16</td>
<td><code>B0BB83C2684938B76AC4923AA545C8F0</code></td> <td><code>DA603B0B6C74D60EC94A04D83AF2027D</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>592E37C5BF99B8DDAE33E6EE394B4742</code></td> <td><code>8C0C719D738B757866BA31F7EF439739</code></td>
<td>Value received from server in Step 2</td> <td>Value received from server in Step 2</td>
</tr> </tr>
<tr> <tr>
@ -595,13 +594,13 @@ answer = BA0D89B5B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B474
<tr> <tr>
<td>g_a</td> <td>g_a</td>
<td>300, 260</td> <td>300, 260</td>
<td><code>FE0001002FDAB5904B04F687AFF2E819</code> <code>845CF3BE57A147004CFFEF1C5DEA2574</code> <code>EB87C7A1462EAF356CBAD7B11BC1AAF4</code> <code>C64924555834B4E0FECB94118F219588</code> <code>24D8E0EB78FD33BA711806508E1EFA3B</code> <code>DB4520DBD4459CA6BAD3A8CD59874AE8</code> <code>295DBD0B6EC31C2A381406FCFBCA4031</code> <code>EDB433CDCF43551BEDAC54CBF8209542</code> <code>C22BC0D564FC8585945869AF496994DE</code> <code>E5E9B1E59C96020713B4B3AE90ED7DC6</code> <code>8FD1DB5B81C2411E7C0E70893BC1A580</code> <code>4563D424AE95A453419AFFEB3B8A8AF7</code> <code>C9995041DDBB3117F105397B250C2FF1</code> <code>F565926000CC06E175B9A7078ABFA638</code> <code>3D0771822291D83BC82DCD16E991B4AC</code> <code>F7F9C17814F6715D3517F4E664018634</code><br> <code>18F16AAB</code></td> <td><code>FE00010035D6639175B1FF6E0AC40189</code> <code>370B3067AF8D52CEA7087E49E01707B5</code> <code>E6112CB33327267BD526CDCD1E971B04</code> <code>88E8C93510E86049B25F640170B02BDE</code> <code>609E83050E5FAB0654C03837E7832018</code> <code>152B11928E0F2E4C3327DBE2717E123C</code> <code>C5994EA0A6034CED7EAD34D99CA90D89</code> <code>40B2065897EBF617B9B1662E682053CD</code> <code>C75A31FD6D7B27B1B8FE868C8139752A</code> <code>4848A5493DFC71477009E0653D185051</code> <code>A7D6F6C3A59C2A89EC8B9BCDD87CB849</code> <code>893D709261D690E3843565DEB19B76B2</code> <code>1FB8A0A28DE3BEA19869F1D73346909D</code> <code>17666F94778077C599761176248536A8</code> <code>BB944F4F73C366BF70A04D13326D2279</code> <code>99E146C830A473FC9B1F3525263FE30B</code><br> <code>7D82C2B7</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>B2AF9C64</code> (1687990194 in decimal)</td> <td><code>009B9E64</code> (1688115968 in decimal)</td>
<td>Server time</td> <td>Server time</td>
</tr> </tr>
</tbody> </tbody>
@ -610,34 +609,34 @@ answer = BA0D89B5B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B474
<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 = 29F2FD3102D844146B82E7C115C554A80961BC260BCA739BB670787AF0A72A512BA2E47AD58D0C478415251E4D0F7A737C2BF06A364C6E995ED596C88F4685F412B60205ECB9FA3ECA18A5B7B2DBEF3F26614806067E2F5831BB9CFF38278A25BB79A8F081A9E72E92CF74DE524DFBC07B6F5F77DF5F1EFF385E0B943282DF43A220AF62387F662982CCEDB59302EAD733438089FE871856F3C6E9221198094EA76E20868AEC4A7D7C809223CB28627DF3A05961B5148BE043CC64ECA1BFCC427F476E8A6769CDD7F5B774311BC166DB8FEC80E7C2BB9DF3B391D5D441B6BB35F0828BB9A22C9151FC63F1F3C04517C127A0BB98A2850867D7074E8D0C2FC576</code></pre> <pre><code>b = F7C5CD46D4A88DED59C1B412D39FEC78BD86A6DC2BF2C5C5D8AF305204158F14B3244D42FFCF2363DC0D25DC6C48A16A3A0E63813D9E87442CA3C2CF84DF848C540531FCDBAD8290A6B25E021EB9AAEEB702F6FB31DC39C48EF615BB0CBBEDE1958D8BF5DCC205CBED3A9DFCD597115163A131DFD4939E68EB2C6F097A5632A3773D5201783A3B6CDE805794F5CBEEFD9FCB8DEAEAD1C5BCADD6366C8A907FABE99A026E59E8521085CE6130123E80B72DFD5EF3D2C0BC880F52DEEF7404638D8053D464036BF7057A77BE75EDA78D3C82221BB131FE6ECB8C43F77DF1D04935F978BA40F3F59385D6D6C2E7782BFFB040AB60F28459EB68A42A904B55E8088C</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 = 69A19DF1CA7E2F7EB2D1C4FB9BA2856EF2AA19510669FF991757F7A3A10AA176A81CBD993DC7BD794C4E169056601BABFFE5C1A8DC6BCB705BB24BDB5E17280D26DAF0A9A801558CB87A11E30D6E8DD29CC039D014EA819CD0F8148CBA1BDB21331FFCB6063ED8FB66A6E90A02A80B68CDE53CB45D1266E8C19617FDD5AFD824001FD16BF666A1946B54B45C751CDD535B3718C6BE7A2EBAD4B35F5CA61D128B5B10ED4223C08D7294FCE18C8D30B5CFC8D73A80469150F7180F5F76F4FEAA0156EFA7665BB37F87B5F9EEAA654550555C05F91342608BB76F1E394EA6C51CE64589540E8729F9F5AE1B33108E8D35233ABFEE824AA2B940C5F04335CA59E0C4</code></pre> <pre><code>g_b = 2545CE89DAD14BDF0F1E2E34F366124474E221B5C2019CF5240612B81798311E9ED33201DE78EA34B59DC0151E4CF820DEEC3850E1B08114B7599A1C99F28A85234ABCF8DC8BE8AB0CD1019EC56AB7BB2E05F07B7656338BE254ABB2F45AD42A86848E602B04A6B9CC9262780D4F87505A8B17191F53E72BDB00AB290B76810EB15C873183D72EC3D2CB411C3F4BDC7944E1CABF5571B152F7FC3CA1DA470977329DC49854BA62A85AE7645FECBD8183B5A4AAD06DFC56D4BA6106F81A45BEF32A9E4F56A213FB2A027B3ACDFDDDE6A6D57E68352C82F7C0D2108FC010725929CB7C88EE737F7B498D86134C7C7F2626F0357067A07813C0D3F2C86876CC1FF1</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 B0 BB 83 C2 68 49 38 B7 6A C4 92 3A <pre><code>0000 | 54 B6 43 66 DA 60 3B 0B 6C 74 D6 0E C9 4A 04 D8
0010 | A5 45 C8 F0 59 2E 37 C5 BF 99 B8 DD AE 33 E6 EE 0010 | 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78 66 BA 31 F7
0020 | 39 4B 47 42 00 00 00 00 00 00 00 00 FE 00 01 00 0020 | EF 43 97 39 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 69 A1 9D F1 CA 7E 2F 7E B2 D1 C4 FB 9B A2 85 6E 0030 | 25 45 CE 89 DA D1 4B DF 0F 1E 2E 34 F3 66 12 44
0040 | F2 AA 19 51 06 69 FF 99 17 57 F7 A3 A1 0A A1 76 0040 | 74 E2 21 B5 C2 01 9C F5 24 06 12 B8 17 98 31 1E
0050 | A8 1C BD 99 3D C7 BD 79 4C 4E 16 90 56 60 1B AB 0050 | 9E D3 32 01 DE 78 EA 34 B5 9D C0 15 1E 4C F8 20
0060 | FF E5 C1 A8 DC 6B CB 70 5B B2 4B DB 5E 17 28 0D 0060 | DE EC 38 50 E1 B0 81 14 B7 59 9A 1C 99 F2 8A 85
0070 | 26 DA F0 A9 A8 01 55 8C B8 7A 11 E3 0D 6E 8D D2 0070 | 23 4A BC F8 DC 8B E8 AB 0C D1 01 9E C5 6A B7 BB
0080 | 9C C0 39 D0 14 EA 81 9C D0 F8 14 8C BA 1B DB 21 0080 | 2E 05 F0 7B 76 56 33 8B E2 54 AB B2 F4 5A D4 2A
0090 | 33 1F FC B6 06 3E D8 FB 66 A6 E9 0A 02 A8 0B 68 0090 | 86 84 8E 60 2B 04 A6 B9 CC 92 62 78 0D 4F 87 50
00A0 | CD E5 3C B4 5D 12 66 E8 C1 96 17 FD D5 AF D8 24 00A0 | 5A 8B 17 19 1F 53 E7 2B DB 00 AB 29 0B 76 81 0E
00B0 | 00 1F D1 6B F6 66 A1 94 6B 54 B4 5C 75 1C DD 53 00B0 | B1 5C 87 31 83 D7 2E C3 D2 CB 41 1C 3F 4B DC 79
00C0 | 5B 37 18 C6 BE 7A 2E BA D4 B3 5F 5C A6 1D 12 8B 00C0 | 44 E1 CA BF 55 71 B1 52 F7 FC 3C A1 DA 47 09 77
00D0 | 5B 10 ED 42 23 C0 8D 72 94 FC E1 8C 8D 30 B5 CF 00D0 | 32 9D C4 98 54 BA 62 A8 5A E7 64 5F EC BD 81 83
00E0 | C8 D7 3A 80 46 91 50 F7 18 0F 5F 76 F4 FE AA 01 00E0 | B5 A4 AA D0 6D FC 56 D4 BA 61 06 F8 1A 45 BE F3
00F0 | 56 EF A7 66 5B B3 7F 87 B5 F9 EE AA 65 45 50 55 00F0 | 2A 9E 4F 56 A2 13 FB 2A 02 7B 3A CD FD DD E6 A6
0100 | 5C 05 F9 13 42 60 8B B7 6F 1E 39 4E A6 C5 1C E6 0100 | D5 7E 68 35 2C 82 F7 C0 D2 10 8F C0 10 72 59 29
0110 | 45 89 54 0E 87 29 F9 F5 AE 1B 33 10 8E 8D 35 23 0110 | CB 7C 88 EE 73 7F 7B 49 8D 86 13 4C 7C 7F 26 26
0120 | 3A BF EE 82 4A A2 B9 40 C5 F0 43 35 CA 59 E0 C4</code></pre> 0120 | F0 35 70 67 A0 78 13 C0 D3 F2 C8 68 76 CC 1F F1</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">
@ -659,19 +658,19 @@ answer = BA0D89B5B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B474
<tr> <tr>
<td>nonce</td> <td>nonce</td>
<td>4, 16</td> <td>4, 16</td>
<td><code>B0BB83C2684938B76AC4923AA545C8F0</code></td> <td><code>DA603B0B6C74D60EC94A04D83AF2027D</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>592E37C5BF99B8DDAE33E6EE394B4742</code></td> <td><code>8C0C719D738B757866BA31F7EF439739</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>FE00010069A19DF1CA7E2F7EB2D1C4FB</code> <code>9BA2856EF2AA19510669FF991757F7A3</code> <code>A10AA176A81CBD993DC7BD794C4E1690</code> <code>56601BABFFE5C1A8DC6BCB705BB24BDB</code> <code>5E17280D26DAF0A9A801558CB87A11E3</code> <code>0D6E8DD29CC039D014EA819CD0F8148C</code> <code>BA1BDB21331FFCB6063ED8FB66A6E90A</code> <code>02A80B68CDE53CB45D1266E8C19617FD</code> <code>D5AFD824001FD16BF666A1946B54B45C</code> <code>751CDD535B3718C6BE7A2EBAD4B35F5C</code> <code>A61D128B5B10ED4223C08D7294FCE18C</code> <code>8D30B5CFC8D73A80469150F7180F5F76</code> <code>F4FEAA0156EFA7665BB37F87B5F9EEAA</code> <code>654550555C05F91342608BB76F1E394E</code> <code>A6C51CE64589540E8729F9F5AE1B3310</code> <code>8E8D35233ABFEE824AA2B940C5F04335</code><br> <code>CA59E0C4</code></td> <td><code>FE0001002545CE89DAD14BDF0F1E2E34</code> <code>F366124474E221B5C2019CF5240612B8</code> <code>1798311E9ED33201DE78EA34B59DC015</code> <code>1E4CF820DEEC3850E1B08114B7599A1C</code> <code>99F28A85234ABCF8DC8BE8AB0CD1019E</code> <code>C56AB7BB2E05F07B7656338BE254ABB2</code> <code>F45AD42A86848E602B04A6B9CC926278</code> <code>0D4F87505A8B17191F53E72BDB00AB29</code> <code>0B76810EB15C873183D72EC3D2CB411C</code> <code>3F4BDC7944E1CABF5571B152F7FC3CA1</code> <code>DA470977329DC49854BA62A85AE7645F</code> <code>ECBD8183B5A4AAD06DFC56D4BA6106F8</code> <code>1A45BEF32A9E4F56A213FB2A027B3ACD</code> <code>FDDDE6A6D57E68352C82F7C0D2108FC0</code> <code>10725929CB7C88EE737F7B498D86134C</code> <code>7C7F2626F0357067A07813C0D3F2C868</code><br> <code>76CC1FF1</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>
@ -685,47 +684,47 @@ answer = BA0D89B5B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B474
<!-- 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 = 54B64366B0BB83C2684938B76AC4923AA545C8F0592E37C5BF99B8DDAE33E6EE394B47420000000000000000FE00010069A19DF1CA7E2F7EB2D1C4FB9BA2856EF2AA19510669FF991757F7A3A10AA176A81CBD993DC7BD794C4E169056601BABFFE5C1A8DC6BCB705BB24BDB5E17280D26DAF0A9A801558CB87A11E30D6E8DD29CC039D014EA819CD0F8148CBA1BDB21331FFCB6063ED8FB66A6E90A02A80B68CDE53CB45D1266E8C19617FDD5AFD824001FD16BF666A1946B54B45C751CDD535B3718C6BE7A2EBAD4B35F5CA61D128B5B10ED4223C08D7294FCE18C8D30B5CFC8D73A80469150F7180F5F76F4FEAA0156EFA7665BB37F87B5F9EEAA654550555C05F91342608BB76F1E394EA6C51CE64589540E8729F9F5AE1B33108E8D35233ABFEE824AA2B940C5F04335CA59E0C4 <pre><code>data = 54B64366DA603B0B6C74D60EC94A04D83AF2027D8C0C719D738B757866BA31F7EF4397390000000000000000FE0001002545CE89DAD14BDF0F1E2E34F366124474E221B5C2019CF5240612B81798311E9ED33201DE78EA34B59DC0151E4CF820DEEC3850E1B08114B7599A1C99F28A85234ABCF8DC8BE8AB0CD1019EC56AB7BB2E05F07B7656338BE254ABB2F45AD42A86848E602B04A6B9CC9262780D4F87505A8B17191F53E72BDB00AB290B76810EB15C873183D72EC3D2CB411C3F4BDC7944E1CABF5571B152F7FC3CA1DA470977329DC49854BA62A85AE7645FECBD8183B5A4AAD06DFC56D4BA6106F81A45BEF32A9E4F56A213FB2A027B3ACDFDDDE6A6D57E68352C82F7C0D2108FC010725929CB7C88EE737F7B498D86134C7C7F2626F0357067A07813C0D3F2C86876CC1FF1
padding = 4670CB59FFB7033A86C62AA9 padding = BD8A6AC82FFB68885A48E0ED
tmp_aes_key = 3826079A7BBD2CC9B9AE0E9D1BEEDA1A663CE630DC446D259DE256A1C953E8FA tmp_aes_key = FD36AB8054D1E2F02F5205DC00729025F859AB708409CE4F32E82FDA951B0D7A
tmp_aes_iv = 7A6748BA29AAC95EF75BD4588351617832FD34568EF1C4018F04F871FA05D41E</code></pre> tmp_aes_iv = 049A211296D24BE36D7FFA1E3C30904487A544973922E4930CD594630E6358A8</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 = B157BF3596956D48DF20A9E10AB507971128D20530E7E3B6087FB1BA74DBE774DE8C5A1AC9D01F70868ED3681FC694F30CE358FC74B854DB48143196F4555CB22721DB87E83D14286CBFB54F4C18F51C9EB719C5924B4E546D6B073C68BA93198FB7A91FB4538E88F6DA2DCCF3734F7EA0112595DEDD6E69C38A5F70E1507069C26E847FB39EEF4BE96863A898FB521117DA5289CAD8F26F3D912D3314A3D4E54D81202AB36ED3625704730BCB495D3464433CB2CC51D1A355AD788C04084CFF69AEAA9AC6282785192BE1C7C1E4AC14E91358056E1A4BC2B0D5E9840F19F70257AD7975DAC3338C5B393835296E51D4845C07962A58F88EE2E2E67C46B1F44CBCA4624D6BD8CC3BA6B59B635CAFF706893E6368404F0475975F652D4C7C69C4E8FA88A9023BB89895823132B3408C0326A4FE9EE68ADEBC56768F0329C9DB79108F080FCEE326135F10E4F89E4C9EF5</code></pre> <pre><code>encrypted_data = E3B5716AC2E86342AD2E8C7B75FD17C713CE5C8559659F8301258D63D9101D1DB99EA9C1909315495C8776FD7885CA40AB860F38C8BD946F90CCEC63F3ED2A5A8F06F4E45BFDD0CC4A626AF74C299623B64E8E384BB7A66C36483EA667CE513FB5C2B9C7C635206E824F6BFC45A259CE0692745EBF3FDE3DEE350903FC0E2FF821DAECDF333B23F77866A444E2AC3B1BC8CC2EA38D4C2C3FF375FF70CFAF76E35BE863D54969CF4A887C8D6223874017B4B509CF3DE096E288512FBEF295D4DE4CC3CA6EAEA779B07100D8CC9E2EF7A6B40575CCC5EC93E32E7F8E4FD7332737F3B179573B4BEC13ABD868CC06A725ECFFC29494FE6AFFD3CEF2DE94681D4A3F19DDE0CF9BB0F13974443EA04D6CE173E0655BAFC847B5D55393BE982E00903B557B61FB38F15A88CADA345BC8B7820BB1C051C0A8B13AE70A5479E87D6BCA8A7AA73C306AF0FACD6760C566014DE790</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 BC D6 09 00 B2 AF 9C 64 <pre><code>0000 | 00 00 00 00 00 00 00 00 E8 30 0F 00 00 9B 9E 64
0010 | 78 01 00 00 1F 5F 04 F5 B0 BB 83 C2 68 49 38 B7 0010 | 78 01 00 00 1F 5F 04 F5 DA 60 3B 0B 6C 74 D6 0E
0020 | 6A C4 92 3A A5 45 C8 F0 59 2E 37 C5 BF 99 B8 DD 0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | AE 33 E6 EE 39 4B 47 42 FE 50 01 00 B1 57 BF 35 0030 | 66 BA 31 F7 EF 43 97 39 FE 50 01 00 E3 B5 71 6A
0040 | 96 95 6D 48 DF 20 A9 E1 0A B5 07 97 11 28 D2 05 0040 | C2 E8 63 42 AD 2E 8C 7B 75 FD 17 C7 13 CE 5C 85
0050 | 30 E7 E3 B6 08 7F B1 BA 74 DB E7 74 DE 8C 5A 1A 0050 | 59 65 9F 83 01 25 8D 63 D9 10 1D 1D B9 9E A9 C1
0060 | C9 D0 1F 70 86 8E D3 68 1F C6 94 F3 0C E3 58 FC 0060 | 90 93 15 49 5C 87 76 FD 78 85 CA 40 AB 86 0F 38
0070 | 74 B8 54 DB 48 14 31 96 F4 55 5C B2 27 21 DB 87 0070 | C8 BD 94 6F 90 CC EC 63 F3 ED 2A 5A 8F 06 F4 E4
0080 | E8 3D 14 28 6C BF B5 4F 4C 18 F5 1C 9E B7 19 C5 0080 | 5B FD D0 CC 4A 62 6A F7 4C 29 96 23 B6 4E 8E 38
0090 | 92 4B 4E 54 6D 6B 07 3C 68 BA 93 19 8F B7 A9 1F 0090 | 4B B7 A6 6C 36 48 3E A6 67 CE 51 3F B5 C2 B9 C7
00A0 | B4 53 8E 88 F6 DA 2D CC F3 73 4F 7E A0 11 25 95 00A0 | C6 35 20 6E 82 4F 6B FC 45 A2 59 CE 06 92 74 5E
00B0 | DE DD 6E 69 C3 8A 5F 70 E1 50 70 69 C2 6E 84 7F 00B0 | BF 3F DE 3D EE 35 09 03 FC 0E 2F F8 21 DA EC DF
00C0 | B3 9E EF 4B E9 68 63 A8 98 FB 52 11 17 DA 52 89 00C0 | 33 3B 23 F7 78 66 A4 44 E2 AC 3B 1B C8 CC 2E A3
00D0 | CA D8 F2 6F 3D 91 2D 33 14 A3 D4 E5 4D 81 20 2A 00D0 | 8D 4C 2C 3F F3 75 FF 70 CF AF 76 E3 5B E8 63 D5
00E0 | B3 6E D3 62 57 04 73 0B CB 49 5D 34 64 43 3C B2 00E0 | 49 69 CF 4A 88 7C 8D 62 23 87 40 17 B4 B5 09 CF
00F0 | CC 51 D1 A3 55 AD 78 8C 04 08 4C FF 69 AE AA 9A 00F0 | 3D E0 96 E2 88 51 2F BE F2 95 D4 DE 4C C3 CA 6E
0100 | C6 28 27 85 19 2B E1 C7 C1 E4 AC 14 E9 13 58 05 0100 | AE A7 79 B0 71 00 D8 CC 9E 2E F7 A6 B4 05 75 CC
0110 | 6E 1A 4B C2 B0 D5 E9 84 0F 19 F7 02 57 AD 79 75 0110 | C5 EC 93 E3 2E 7F 8E 4F D7 33 27 37 F3 B1 79 57
0120 | DA C3 33 8C 5B 39 38 35 29 6E 51 D4 84 5C 07 96 0120 | 3B 4B EC 13 AB D8 68 CC 06 A7 25 EC FF C2 94 94
0130 | 2A 58 F8 8E E2 E2 E6 7C 46 B1 F4 4C BC A4 62 4D 0130 | FE 6A FF D3 CE F2 DE 94 68 1D 4A 3F 19 DD E0 CF
0140 | 6B D8 CC 3B A6 B5 9B 63 5C AF F7 06 89 3E 63 68 0140 | 9B B0 F1 39 74 44 3E A0 4D 6C E1 73 E0 65 5B AF
0150 | 40 4F 04 75 97 5F 65 2D 4C 7C 69 C4 E8 FA 88 A9 0150 | C8 47 B5 D5 53 93 BE 98 2E 00 90 3B 55 7B 61 FB
0160 | 02 3B B8 98 95 82 31 32 B3 40 8C 03 26 A4 FE 9E 0160 | 38 F1 5A 88 CA DA 34 5B C8 B7 82 0B B1 C0 51 C0
0170 | E6 8A DE BC 56 76 8F 03 29 C9 DB 79 10 8F 08 0F 0170 | A8 B1 3A E7 0A 54 79 E8 7D 6B CA 8A 7A A7 3C 30
0180 | CE E3 26 13 5F 10 E4 F8 9E 4C 9E F5</code></pre> 0180 | 6A F0 FA CD 67 60 C5 66 01 4D E7 90</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">
@ -747,8 +746,8 @@ 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>BCD60900B2AF9C64</code></td> <td><code>E8300F00009B9E64</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a></td> <td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr> </tr>
<tr> <tr>
<td>message_length</td> <td>message_length</td>
@ -765,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>B0BB83C2684938B76AC4923AA545C8F0</code></td> <td><code>DA603B0B6C74D60EC94A04D83AF2027D</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>592E37C5BF99B8DDAE33E6EE394B4742</code></td> <td><code>8C0C719D738B757866BA31F7EF439739</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>FE500100B157BF3596956D48DF20A9E1</code> <code>0AB507971128D20530E7E3B6087FB1BA</code> <code>74DBE774DE8C5A1AC9D01F70868ED368</code> <code>1FC694F30CE358FC74B854DB48143196</code> <code>F4555CB22721DB87E83D14286CBFB54F</code> <code>4C18F51C9EB719C5924B4E546D6B073C</code> <code>68BA93198FB7A91FB4538E88F6DA2DCC</code> <code>F3734F7EA0112595DEDD6E69C38A5F70</code> <code>E1507069C26E847FB39EEF4BE96863A8</code> <code>98FB521117DA5289CAD8F26F3D912D33</code> <code>14A3D4E54D81202AB36ED3625704730B</code> <code>CB495D3464433CB2CC51D1A355AD788C</code> <code>04084CFF69AEAA9AC6282785192BE1C7</code> <code>C1E4AC14E91358056E1A4BC2B0D5E984</code> <code>0F19F70257AD7975DAC3338C5B393835</code> <code>296E51D4845C07962A58F88EE2E2E67C</code> <code>46B1F44CBCA4624D6BD8CC3BA6B59B63</code> <code>5CAFF706893E6368404F0475975F652D</code> <code>4C7C69C4E8FA88A9023BB89895823132</code> <code>B3408C0326A4FE9EE68ADEBC56768F03</code> <code>29C9DB79108F080FCEE326135F10E4F8</code><br> <code>9E4C9EF5</code></td> <td><code>FE500100E3B5716AC2E86342AD2E8C7B</code> <code>75FD17C713CE5C8559659F8301258D63</code> <code>D9101D1DB99EA9C1909315495C8776FD</code> <code>7885CA40AB860F38C8BD946F90CCEC63</code> <code>F3ED2A5A8F06F4E45BFDD0CC4A626AF7</code> <code>4C299623B64E8E384BB7A66C36483EA6</code> <code>67CE513FB5C2B9C7C635206E824F6BFC</code> <code>45A259CE0692745EBF3FDE3DEE350903</code> <code>FC0E2FF821DAECDF333B23F77866A444</code> <code>E2AC3B1BC8CC2EA38D4C2C3FF375FF70</code> <code>CFAF76E35BE863D54969CF4A887C8D62</code> <code>23874017B4B509CF3DE096E288512FBE</code> <code>F295D4DE4CC3CA6EAEA779B07100D8CC</code> <code>9E2EF7A6B40575CCC5EC93E32E7F8E4F</code> <code>D7332737F3B179573B4BEC13ABD868CC</code> <code>06A725ECFFC29494FE6AFFD3CEF2DE94</code> <code>681D4A3F19DDE0CF9BB0F13974443EA0</code> <code>4D6CE173E0655BAFC847B5D55393BE98</code> <code>2E00903B557B61FB38F15A88CADA345B</code> <code>C8B7820BB1C051C0A8B13AE70A5479E8</code> <code>7D6BCA8A7AA73C306AF0FACD6760C566</code><br> <code>014DE790</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>
@ -786,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 = 4B2FB207D87D159C14CFBC094533E4305721FD3F8CF1F4C2E218481DAD5BDE4BD687064C86A2F9B15DDF2EB43F6558C7EF91B99FADF614711AEDC6BBAE02F10B97EC40B81837695E58F11F2FAC48E949AF2DBC35E3A8476FF2C8C1CA85835634BEA918657C9801AD8876E8319C02ADF9209EAF5A3D429560D98816943C3019971B67372E146106CD27FB110A589DA8890F43348AF77143AFFCB08BEBEF89BD14BBFECC6AFE2B028C4BEC26ADC3D6786DABFF738CDAEBFE2D15806977DB496736716CD0B64938F1AEC6911FB56B70CC86BFB458048E970CD28E2F3844B7082493C1D46C0EA0AA798068C4160DA2C2D7562A6160255C6A1D7C3C47B7B8DD1C6D55</code></pre> <pre><code>auth_key = 48892B997A14A133B6D5B234A7F9B19DCE70CB192B9238372639DD6230B1BCC8D31BBBCCFA7F00BBEF38303BAE50FFF3DC814333123CE6E5980EF4493A74F38AD6B05B6737E296ADF4C97C69C95C5EC840BC22694F4CBFC14598B28F83B5CD79FE881F6AB9615226DF63078688371B3CDD2F6E97B35D17E6710E29469E1476B596C1DE136F05D585290776B306D6946B1C33374A459ECB0E9BFBC5A43D145A6B37C276E94C840EA0950B0B2523744CD538817DBA33CD6C84175AEA8561EBA117D2589EFB30A304B0F7AF29FF141E6B3F6F9FA5CEFF31DF1166937EA07D850427B6D779BBAB5B062526D435206EA25158EABC659DE3DC5E4ABF0D93B87B35E5E7</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 60 9B 67 B2 AF 9C 64 <pre><code>0000 | 00 00 00 00 00 00 00 00 01 84 8C 9F 00 9B 9E 64
0010 | 34 00 00 00 34 F7 CB 3B B0 BB 83 C2 68 49 38 B7 0010 | 34 00 00 00 34 F7 CB 3B DA 60 3B 0B 6C 74 D6 0E
0020 | 6A C4 92 3A A5 45 C8 F0 59 2E 37 C5 BF 99 B8 DD 0020 | C9 4A 04 D8 3A F2 02 7D 8C 0C 71 9D 73 8B 75 78
0030 | AE 33 E6 EE 39 4B 47 42 6A F1 5D D5 EA 4A 58 6A 0030 | 66 BA 31 F7 EF 43 97 39 B0 91 C6 77 C6 99 6C 09
0040 | 27 E0 A1 DC 7E 26 D2 C4</code></pre> 0040 | FF 59 F2 F9 AB 28 16 78</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">
@ -818,8 +817,8 @@ 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>01609B67B2AF9C64</code></td> <td><code>01848C9F009B9E64</code></td>
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a></td> <td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() &lt;&lt; 32) + (N*4)</td>
</tr> </tr>
<tr> <tr>
<td>message_length</td> <td>message_length</td>
@ -836,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>B0BB83C2684938B76AC4923AA545C8F0</code></td> <td><code>DA603B0B6C74D60EC94A04D83AF2027D</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>592E37C5BF99B8DDAE33E6EE394B4742</code></td> <td><code>8C0C719D738B757866BA31F7EF439739</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>6AF15DD5EA4A586A27E0A1DC7E26D2C4</code></td> <td><code>B091C677C6996C09FF59F2F9AB281678</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>
@ -920,8 +919,11 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
</div> </div>
</div> </div>
<script src="/js/main.js?47"></script> <script src="/js/main.js?47"></script>
<script src="/js/jquery.min.js?1"></script>
<script src="/js/bootstrap.min.js?1"></script>
<script>backToTopInit("Go up"); <script>window.initDevPageNav&&initDevPageNav();
backToTopInit("Go up");
removePreloadInit(); removePreloadInit();
</script> </script>
</body> </body>

View file

@ -69,7 +69,7 @@
<li><a href="#payments">Payments</a></li> <li><a href="#payments">Payments</a></li>
<li><a href="#web-login">Web Login</a></li> <li><a href="#web-login">Web Login</a></li>
<li><a href="#html5-games">HTML5 Games</a></li> <li><a href="#html5-games">HTML5 Games</a></li>
<li><a href="#stickers">Stickers</a> </li> <li><a href="#stickers-and-custom-emoji">Stickers</a> </li>
</ul> </ul>
</li> </li>
<li><a href="#language-support"><strong>Language Support</strong></a></li> <li><a href="#language-support"><strong>Language Support</strong></a></li>
@ -241,7 +241,7 @@ width=44% /></a>
<li>Accept <a href="#payments">Payments</a> via dozens of integrated third-party payment providers.</li> <li>Accept <a href="#payments">Payments</a> via dozens of integrated third-party payment providers.</li>
<li>Connect to Telegram using the <a href="#web-login">Web Login</a> functionality.</li> <li>Connect to Telegram using the <a href="#web-login">Web Login</a> functionality.</li>
<li>Create gaming bots by integrating <a href="#html5-games">HTML5 Games</a>.</li> <li>Create gaming bots by integrating <a href="#html5-games">HTML5 Games</a>.</li>
<li>Help users create and manage <a href="#stickers">Telegram Stickers</a>.</li> <li>Help users create and manage <a href="#stickers-and-custom-emoji">Telegram Stickers</a>.</li>
</ul> </ul>
<h3><a class="anchor" name="web-apps" href="#web-apps"><i class="anchor-icon"></i></a>Web Apps</h3> <h3><a class="anchor" name="web-apps" href="#web-apps"><i class="anchor-icon"></i></a>Web Apps</h3>
<p>Bots can easily process <strong>complex inputs</strong> of any kind and <strong>dynamic interaction flows</strong> via <a href="webapps">Web Apps</a>. With this unique feature, you can develop any number of flexible, streamlined interfaces in <strong>JavaScript</strong>.</p> <p>Bots can easily process <strong>complex inputs</strong> of any kind and <strong>dynamic interaction flows</strong> via <a href="webapps">Web Apps</a>. With this unique feature, you can develop any number of flexible, streamlined interfaces in <strong>JavaScript</strong>.</p>
@ -344,7 +344,7 @@ width=44% /></a>
<ul> <ul>
<li>Your interfaces, texts and <a href="/bots/api#answerinlinequery">inline results</a> should adapt seamlessly to the <em>language_code</em>, without user intervention.</li> <li>Your interfaces, texts and <a href="/bots/api#answerinlinequery">inline results</a> should adapt seamlessly to the <em>language_code</em>, without user intervention.</li>
<li>Connected <a href="/bots/webapps">WebApps</a> will receive the user&#39;s <em>language_code</em> your HTML page should account for it.</li> <li>Connected <a href="/bots/webapps">WebApps</a> will receive the user&#39;s <em>language_code</em> your HTML page should account for it.</li>
<li><a href="/bots/html5-games">HTML5 Games</a> can obtain language information if you specify it as a <a href="/bots/games#using-url-parameters">URL parameter</a>. You can generate this parameter from the <em>language_code</em> field in the <a href="/bots/api#user">User</a> object served with the initial game <a href="/bots/api#callbackquery">CallbackQuery</a>.</li> <li><a href="/bots/games">HTML5 Games</a> can obtain language information if you specify it as a <a href="/bots/games#using-url-parameters">URL parameter</a>. You can generate this parameter from the <em>language_code</em> field in the <a href="/bots/api#user">User</a> object served with the initial game <a href="/bots/api#callbackquery">CallbackQuery</a>.</li>
<li>The bot&#39;s <strong>Name</strong>, <strong>Description</strong> and <strong>About text</strong> can be natively localized with the respective <a href="https://core.telegram.org/bots/api#setmydescription">methods</a>.</li> <li>The bot&#39;s <strong>Name</strong>, <strong>Description</strong> and <strong>About text</strong> can be natively localized with the respective <a href="https://core.telegram.org/bots/api#setmydescription">methods</a>.</li>
<li>Command lists can also be specified for individual languages more on this <a href="#commands">here</a>.</li> <li>Command lists can also be specified for individual languages more on this <a href="#commands">here</a>.</li>
</ul> </ul>