Update content of files

This commit is contained in:
GitHub Action 2024-11-12 17:43:06 +00:00
parent fbbc717ef8
commit c0f4c1352e
9 changed files with 249 additions and 223 deletions

View file

@ -151,7 +151,11 @@ Optionally, the <a href="/constructor/peerSettings">peerSettings</a>.<code>need_
<li>A button to manage the bot, by opening the deep link in <code>business_bot_manage_url</code></li>
<li>A button to disconnect the bot from this chat, which when pressed should invoke <a href="/method/account.toggleConnectedBotPaused">account.disablePeerConnectedBot »</a> to permanently disconnect the bot from this peer (this will also hide the action bar, unsetting the <code>business_bot_manage_url</code> and <code>business_bot_id</code> fields). </li>
</ul>
<p>See <a href="/api/business#connected-bots">here »</a> for more info on business bots.</p></div>
<p>See <a href="/api/business#connected-bots">here »</a> for more info on business bots. </p>
<h3><a class="anchor" href="#bot-ads" id="bot-ads" name="bot-ads"><i class="anchor-icon"></i></a>Bot ads</h3>
<p>This bar contains <a href="/api/sponsored-messages">advertisements</a>. </p>
<p><strong>Condition</strong>: the current chat is a private chat with a bot and <a href="/method/messages.getSponsoredMessages">messages.getSponsoredMessages</a> returned some sponsored messages for this bot. </p>
<p>See <a href="/api/sponsored-messages#displaying-sponsored-messages">here »</a> for more info on how to render this action bar.</p></div>
</div>

View file

@ -46,6 +46,7 @@
<p>Below you will find information on schema changes. For more details on the use of layers, see <a href="/api/invoking#layers">Invoking API methods</a>.</p>
<h3><a class="anchor" href="#layer-192" id="layer-192" name="layer-192"><i class="anchor-icon"></i></a><a href="/schema?layer=192">Layer 192</a></h3>
<p>This layer adds support for <a href="/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once">paid broadcasts</a> for bots, through the new <code>allow_paid_floodskip</code> flag.</p>
<h4><a class="anchor" href="#schema-changes" id="schema-changes" name="schema-changes"><i class="anchor-icon"></i></a>Schema changes</h4>
<h5><a class="anchor" href="#new-methods" id="new-methods" name="new-methods"><i class="anchor-icon"></i></a>New Methods</h5>
<ul>

View file

@ -56,14 +56,17 @@ sponsoredMessage#4d93a990 flags:# recommended:flags.5?true can_report:flags.12?t
---functions---
channels.getSponsoredMessages#ec210fbf channel:InputChannel = messages.SponsoredMessages;</code></pre>
<p>Each time the user opens a channel, <code>channels.getSponsoredMessages</code> must be called to receive <a href="https://promote.telegram.org">sponsored messages</a> available for this channel. The result must be cached for <strong>5 minutes</strong>.</p>
<a href='/method/messages.getSponsoredMessages'>messages.getSponsoredMessages</a>#9bd2f439 peer:<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/messages.SponsoredMessages'>messages.SponsoredMessages</a>;</code></pre>
<p>Each time the user opens a channel or a chat with a bot, <a href="/method/messages.getSponsoredMessages">messages.getSponsoredMessages</a> must be called to receive <a href="https://promote.telegram.org">sponsored messages</a> available for the channel or bot. The result must be cached for <strong>5 minutes</strong>.</p>
<blockquote>
<p><a href="https://t.me/durov/172">More about sponsored messages on Telegram</a></p>
</blockquote>
<h4><a class="anchor" href="#displaying-sponsored-messages" id="displaying-sponsored-messages" name="displaying-sponsored-messages"><i class="anchor-icon"></i></a>Displaying sponsored messages</h4>
<p>Sponsored messages must be displayed below all other posts in the channel, after the user scrolls further down, past the last message. </p>
<p>Sponsored messages have:</p>
<p>Sponsored messages must be displayed as follows:</p>
<ul>
<li>
<p>In channels, they must be displayed below all other posts in the channel, after the user scrolls further down, past the last message.<br>
Sponsored channel messages have:</p>
<ul>
<li>A title (contained in <code>title</code>)</li>
<li>A text (contained in <code>message</code>+<code>entities</code>)</li>
@ -73,23 +76,37 @@ A confirmation prompt should be shown before opening the URL, unless the host pa
<p>The message should be marked as "Recommended" instead of "Sponsored" if the <code>recommended</code> flag is set. </p>
<p>If the <code>photo</code> flag is set, it should be used to display a profile photo bubble for the sponsored message, like for messages sent in groups. </p>
<p>If the <code>sponsor_info</code> or <code>additional_info</code> flags are set, an additional "Sponsor info" menu item must be present in the message context menu (the menu that pops up when clicking on a button), that when clicked, displays the contents of the flags. </p>
<p>If set, the sponsored message should use the <a href="/api/colors">message accent color »</a> specified in <code>color</code>.</p>
</li>
<li>
<p>In bots, they must be displayed <a href="https://telegram.org/blog/dynamic-video-quality-and-more#telegram-ads-in-bots">above the chat</a>, akin to an <a href="/api/action-bar">action bar</a>
Bot ads have:</p>
<ul>
<li>A title (contained in <code>title</code>): must be locally prepended with a blue-colored "Ad" prefix, or a "Recommended" prefix if the <code>recommended</code> flag is set. </li>
<li>A text (contained in <code>message</code>+<code>entities</code>)</li>
<li>When the ad action bar is clicked, clients should open the URL in <code>url</code>.<br>
A confirmation prompt should be shown before opening the URL, unless the host part of the URL matches the following regex: <code>(^|\\.)(telegram\.(org|me|dog)|t\.me|te\.?legra\.ph|graph\.org|fragment\.com|telesco\.pe)$</code>, in which case the URL should be opened without confirmation (and if it's a <a href="/api/links">deep link »</a>, it should be opened directly in-app, without passing through the browser). </li>
</ul>
<p>If the <code>photo</code> flag is set, a thumbnail-sized version of it should be displayed in the right section of the action bar.</p>
</li>
</ul>
<p>If set, the sponsored message/action bar should use the <a href="/api/colors">message accent color »</a> specified in <code>color</code>.</p>
<h4><a class="anchor" href="#counting-sponsored-message-views" id="counting-sponsored-message-views" name="counting-sponsored-message-views"><i class="anchor-icon"></i></a>Counting sponsored message views</h4>
<pre><code>---functions---
channels.viewSponsoredMessage#beaedb94 channel:InputChannel random_id:bytes = Bool;</code></pre>
<p>Once the entire text is shown on the screen (excluding the button), <a href="/method/channels.viewSponsoredMessage">channels.viewSponsoredMessage</a> must be called with the <code>random_id</code> of the sponsored message.</p>
<a href='/method/messages.viewSponsoredMessage'>messages.viewSponsoredMessage</a>#673ad8f1 peer:<a href='/type/InputPeer'>InputPeer</a> random_id:<a href='/type/bytes'>bytes</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
<p>Once the entire text of the ad is shown on the screen (excluding the button for channel ads), <a href="/method/messages.viewSponsoredMessage">messages.viewSponsoredMessage</a> must be called with the <code>random_id</code> of the sponsored message.</p>
<h4><a class="anchor" href="#clicking-on-sponsored-messages" id="clicking-on-sponsored-messages" name="clicking-on-sponsored-messages"><i class="anchor-icon"></i></a>Clicking on sponsored messages</h4>
<pre><code>---functions---
channels.clickSponsoredMessage#18afbc93 channel:InputChannel random_id:bytes = Bool;</code></pre>
<a href='/method/messages.clickSponsoredMessage'>messages.clickSponsoredMessage</a>#f093465 flags:<a href='/type/%23'>#</a> media:flags.0?<a href='/constructor/true'>true</a> fullscreen:flags.1?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> random_id:<a href='/type/bytes'>bytes</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
<p>If the user either:</p>
<ul>
<li>Clicks on a link in the sponsored message</li>
<li>Clicks on the bot ad bar</li>
<li>Opens a sponsored chat or a sponsored website via the associated button</li>
<li>Opens the sponsored chat via the sponsored message name, the sponsored message photo, or a mention in the sponsored message</li>
</ul>
<p><a href="/method/channels.clickSponsoredMessage">channels.clickSponsoredMessage</a> must be called with the <code>random_id</code> of the sponsored message.</p>
<p><a href="/method/messages.clickSponsoredMessage">messages.clickSponsoredMessage</a> must be called with the <code>random_id</code> of the sponsored message.</p>
<h4><a class="anchor" href="#reporting-sponsored-messages" id="reporting-sponsored-messages" name="reporting-sponsored-messages"><i class="anchor-icon"></i></a>Reporting sponsored messages</h4>
<pre><code><a href='/constructor/sponsoredMessage'>sponsoredMessage</a>#4d93a990 flags:<a href='/type/%23'>#</a> recommended:flags.5?<a href='/constructor/true'>true</a> can_report:flags.12?<a href='/constructor/true'>true</a> random_id:<a href='/type/bytes'>bytes</a> url:<a href='/type/string'>string</a> title:<a href='/type/string'>string</a> message:<a href='/type/string'>string</a> entities:flags.1?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; photo:flags.6?<a href='/type/Photo'>Photo</a> media:flags.14?<a href='/type/MessageMedia'>MessageMedia</a> color:flags.13?<a href='/type/PeerColor'>PeerColor</a> button_text:<a href='/type/string'>string</a> sponsor_info:flags.7?<a href='/type/string'>string</a> additional_info:flags.8?<a href='/type/string'>string</a> = <a href='/type/SponsoredMessage'>SponsoredMessage</a>;
@ -101,8 +118,8 @@ channels.clickSponsoredMessage#18afbc93 channel:InputChannel random_id:bytes = B
---functions---
channels.reportSponsoredMessage#af8ff6b9 channel:InputChannel random_id:bytes option:bytes = channels.SponsoredMessageReportResult;</code></pre>
<p>To report a sponsored message to Telegram's moderators, invoke <a href="/method/channels.reportSponsoredMessage">channels.reportSponsoredMessage</a>, passing the channel ID, the <code>random_id</code> of the sponsored message and an empty <code>option</code> field. </p>
<a href='/method/messages.reportSponsoredMessage'>messages.reportSponsoredMessage</a>#1af3dbb8 peer:<a href='/type/InputPeer'>InputPeer</a> random_id:<a href='/type/bytes'>bytes</a> option:<a href='/type/bytes'>bytes</a> = <a href='/type/channels.SponsoredMessageReportResult'>channels.SponsoredMessageReportResult</a>;</code></pre>
<p>To report a sponsored message to Telegram's moderators, invoke <a href="/method/messages.reportSponsoredMessage">messages.reportSponsoredMessage</a>, passing the channel/bot ID, the <code>random_id</code> of the sponsored message and an empty <code>option</code> field. </p>
<p>Note that only sponsored messages with the <a href="/constructor/sponsoredMessage">sponsoredMessage</a>.<code>can_report</code> flag set may be reported. </p>
<p>Then, if the result is:</p>
<ul>
@ -118,9 +135,9 @@ The <code>title</code> field of <a href="/constructor/channels.sponsoredMessageR
</ul>
<h4><a class="anchor" href="#testing-sponsored-messages" id="testing-sponsored-messages" name="testing-sponsored-messages"><i class="anchor-icon"></i></a>Testing sponsored messages</h4>
<p>For the channel <a href="https://t.me/SecretAdTestChannel">https://t.me/SecretAdTestChannel</a> the system will <strong>always</strong> return a sponsored message: promoting either a channel, a particular message in a channel, or a bot with a start parameter.</p>
<h4><a class="anchor" href="#withdrawing-ad-revenue-as-a-channel-owner" id="withdrawing-ad-revenue-as-a-channel-owner" name="withdrawing-ad-revenue-as-a-channel-owner"><i class="anchor-icon"></i></a>Withdrawing ad revenue as a channel owner</h4>
<p>Telegram has one of the <strong>most generous reward systems</strong> in the history of social media. Telegram channel owners can now receive <strong>50%</strong> of the revenue from ads displayed in their channels.</p>
<p><a href="/api/revenue">See here »</a> for more info on how to withdraw channel ad revenue, as well as view detailed revenue stats. </p>
<h4><a class="anchor" href="#withdrawing-ad-revenue-as-a-channel-bot-owner" id="withdrawing-ad-revenue-as-a-channel-bot-owner" name="withdrawing-ad-revenue-as-a-channel-bot-owner"><i class="anchor-icon"></i></a>Withdrawing ad revenue as a channel/bot owner</h4>
<p>Telegram has one of the <strong>most generous reward systems</strong> in the history of social media. Telegram channel/bot owners can now receive <strong>50%</strong> of the revenue from ads displayed in their channels.</p>
<p><a href="/api/revenue">See here »</a> for more info on how to withdraw channel/bot ad revenue, as well as view detailed revenue stats. </p>
<hr>
<h4><a class="anchor" href="#sponsored-messages-in-third-party-apps" id="sponsored-messages-in-third-party-apps" name="sponsored-messages-in-third-party-apps"><i class="anchor-icon"></i></a>Sponsored messages in third-party apps</h4>
<p>Telegram continues to grow worldwide, in part thanks to third-party apps using the Telegram API. To cover the increasing costs that come with this growth, Telegram added <a href="https://promote.telegram.org">sponsored messages</a> a paid <a href="https://t.me/durov/172">privacy-friendly way</a> to promote <strong>bots and channels</strong>. </p>

View file

@ -112,7 +112,7 @@
<tr>
<td><strong>allow_paid_floodskip</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.19?<a href="/constructor/true">true</a></td>
<td> </td>
<td>Bots only: if set, allows sending up to 1000 messages per second, ignoring <a href="/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once">broadcasting limits</a> for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.</td>
</tr>
<tr>
<td><strong>from_peer</strong></td>
@ -412,6 +412,7 @@
</table>
<h3><a class="anchor" href="#bots-can-use-this-method" id="bots-can-use-this-method" name="bots-can-use-this-method"><i class="anchor-icon"></i></a>Bots can use this method</h3>
<h3><a class="anchor" href="#related-pages" id="related-pages" name="related-pages"><i class="anchor-icon"></i></a>Related pages</h3>
<h4><a class="anchor" href="#bots-faq" id="bots-faq" name="bots-faq"><i class="anchor-icon"></i></a><a href="/bots/faq">Bots FAQ</a></h4>
<h4><a class="anchor" href="#forums" id="forums" name="forums"><i class="anchor-icon"></i></a><a href="/api/forum">Forums</a></h4>
<p>Telegram allows creating forums with multiple distinct topics.</p>
<h4><a class="anchor" href="#business" id="business" name="business"><i class="anchor-icon"></i></a><a href="/api/business">Business</a></h4>

View file

@ -112,7 +112,7 @@
<tr>
<td><strong>allow_paid_floodskip</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.19?<a href="/constructor/true">true</a></td>
<td> </td>
<td>Bots only: if set, allows sending up to 1000 messages per second, ignoring <a href="/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once">broadcasting limits</a> for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.</td>
</tr>
<tr>
<td><strong>peer</strong></td>
@ -624,6 +624,7 @@
<h3><a class="anchor" href="#related-pages" id="related-pages" name="related-pages"><i class="anchor-icon"></i></a>Related pages</h3>
<h4><a class="anchor" href="#stickers" id="stickers" name="stickers"><i class="anchor-icon"></i></a><a href="/api/stickers">Stickers</a></h4>
<p>Telegram clients support displaying static and animated stickers.</p>
<h4><a class="anchor" href="#bots-faq" id="bots-faq" name="bots-faq"><i class="anchor-icon"></i></a><a href="/bots/faq">Bots FAQ</a></h4>
<h4><a class="anchor" href="#styled-text-with-message-entities" id="styled-text-with-message-entities" name="styled-text-with-message-entities"><i class="anchor-icon"></i></a><a href="/api/entities">Styled text with message entities</a></h4>
<p>How to create styled text with message entities</p>
<h4><a class="anchor" href="#scheduled-messages" id="scheduled-messages" name="scheduled-messages"><i class="anchor-icon"></i></a><a href="/api/scheduled-messages">Scheduled messages</a></h4>

View file

@ -117,7 +117,7 @@
<tr>
<td><strong>allow_paid_floodskip</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.19?<a href="/constructor/true">true</a></td>
<td> </td>
<td>Bots only: if set, allows sending up to 1000 messages per second, ignoring <a href="/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once">broadcasting limits</a> for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.</td>
</tr>
<tr>
<td><strong>peer</strong></td>
@ -469,6 +469,7 @@
<h3><a class="anchor" href="#related-pages" id="related-pages" name="related-pages"><i class="anchor-icon"></i></a>Related pages</h3>
<h4><a class="anchor" href="#stickers" id="stickers" name="stickers"><i class="anchor-icon"></i></a><a href="/api/stickers">Stickers</a></h4>
<p>Telegram clients support displaying static and animated stickers.</p>
<h4><a class="anchor" href="#bots-faq" id="bots-faq" name="bots-faq"><i class="anchor-icon"></i></a><a href="/bots/faq">Bots FAQ</a></h4>
<h4><a class="anchor" href="#styled-text-with-message-entities" id="styled-text-with-message-entities" name="styled-text-with-message-entities"><i class="anchor-icon"></i></a><a href="/api/entities">Styled text with message entities</a></h4>
<p>How to create styled text with message entities</p>
<h4><a class="anchor" href="#scheduled-messages" id="scheduled-messages" name="scheduled-messages"><i class="anchor-icon"></i></a><a href="/api/scheduled-messages">Scheduled messages</a></h4>

View file

@ -112,7 +112,7 @@
<tr>
<td><strong>allow_paid_floodskip</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.19?<a href="/constructor/true">true</a></td>
<td> </td>
<td>Bots only: if set, allows sending up to 1000 messages per second, ignoring <a href="/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once">broadcasting limits</a> for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.</td>
</tr>
<tr>
<td><strong>peer</strong></td>
@ -306,6 +306,7 @@
<p>How to handle message drafts</p>
<h4><a class="anchor" href="#stickers" id="stickers" name="stickers"><i class="anchor-icon"></i></a><a href="/api/stickers">Stickers</a></h4>
<p>Telegram clients support displaying static and animated stickers.</p>
<h4><a class="anchor" href="#bots-faq" id="bots-faq" name="bots-faq"><i class="anchor-icon"></i></a><a href="/bots/faq">Bots FAQ</a></h4>
<h4><a class="anchor" href="#messagesuploadmedia" id="messagesuploadmedia" name="messagesuploadmedia"><i class="anchor-icon"></i></a><a href="/method/messages.uploadMedia">messages.uploadMedia</a></h4>
<p>Upload a file and associate it to a chat (without actually sending it to the chat)</p>
<h4><a class="anchor" href="#business" id="business" name="business"><i class="anchor-icon"></i></a><a href="/api/business">Business</a></h4>

View file

@ -53,9 +53,9 @@
<h5><a class="anchor" href="#1-client-sends-query-to-server" id="1-client-sends-query-to-server" name="1-client-sends-query-to-server"><i class="anchor-icon"></i></a>1) Client sends query to server</h5>
<!-- start req_pq_multi -->
<p>Sent payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 24 EE 06 00 B9 B8 30 67
0010 | 14 00 00 00 F1 8E 7E BE 2F AF 63 7D 5B C0 6E B2
0020 | EF 1C 5B 3D 62 04 7E 51</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 0C 61 06 00 E2 88 33 67
0010 | 14 00 00 00 F1 8E 7E BE 28 72 1A 8E C4 CD 99 F8
0020 | A9 B9 5B DB 5A 5F D8 30</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>req_pq_multi#be7e8ef1 nonce:int128 = ResPQ;</code></pre>
<table class="table">
@ -77,7 +77,7 @@
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>24EE0600B9B83067</code></td>
<td><code>0C610600E2883367</code></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>
@ -95,7 +95,7 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>2FAF637D5BC06EB2EF1C5B3D62047E51</code></td>
<td><code>28721A8EC4CD99F8A9B95BDB5A5FD830</code></td>
<td>Random number</td>
</tr>
</tbody>
@ -104,11 +104,11 @@
<h5><a class="anchor" href="#2-server-sends-response-of-the-form" id="2-server-sends-response-of-the-form" name="2-server-sends-response-of-the-form"><i class="anchor-icon"></i></a>2) Server sends response of the form</h5>
<!-- start resPQ -->
<p>Received payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 E4 D4 9F B9 B8 30 67
0010 | 50 00 00 00 63 24 16 05 2F AF 63 7D 5B C0 6E B2
0020 | EF 1C 5B 3D 62 04 7E 51 F6 9E 6A 9C E3 D2 E7 19
0030 | 66 40 68 B0 69 FE 4E 8E 08 20 3D 5A 71 20 24 36
0040 | 21 00 00 00 15 C4 B5 1C 03 00 00 00 85 FD 64 DE
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 44 DB B9 E2 88 33 67
0010 | 50 00 00 00 63 24 16 05 28 72 1A 8E C4 CD 99 F8
0020 | A9 B9 5B DB 5A 5F D8 30 71 7F 48 CF 46 34 E2 07
0030 | D3 21 B7 A6 A0 50 39 82 08 13 9E 3B B6 1E B5 BA
0040 | 8D 00 00 00 15 C4 B5 1C 03 00 00 00 85 FD 64 DE
0050 | 85 1D 9D D0 A5 B7 F7 09 35 5F C3 0B 21 6B E8 6C
0060 | 02 2B B4 C3</code></pre>
<p>Payload (de)serialization:</p>
@ -132,7 +132,7 @@
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>01E4D49FB9B83067</code></td>
<td><code>0144DBB9E2883367</code></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>
@ -150,19 +150,19 @@
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>2FAF637D5BC06EB2EF1C5B3D62047E51</code></td>
<td><code>28721A8EC4CD99F8A9B95BDB5A5FD830</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>F69E6A9CE3D2E719664068B069FE4E8E</code></td>
<td><code>717F48CF4634E207D321B7A6A0503982</code></td>
<td>Server-generated random number</td>
</tr>
<tr>
<td>pq</td>
<td>56, 12</td>
<td><code>08203D5A7120243621000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2323112424710092321</td>
<td><code>08139E3BB61EB5BA8D000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1413632986426227341</td>
<td>Single-byte prefix denoting length, an 8-byte string, and three bytes of padding</td>
</tr>
<tr>
@ -208,22 +208,22 @@
<h4><a class="anchor" href="#proof-of-work" id="proof-of-work" name="proof-of-work"><i class="anchor-icon"></i></a>Proof of work</h4>
<h5><a class="anchor" href="#3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q" id="3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q" name="3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p &lt; q.</h5>
<!-- start pq -->
<pre><code>pq = 2323112424710092321</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>2323112424710092321 = 1230924953 * 1887290057</code></p>
<pre><code>p = 1230924953
q = 1887290057</code></pre>
<pre><code>pq = 1413632986426227341</code></pre>
<p>Decompose into 2 prime cofactors <code>p &lt; q</code>: <code>1413632986426227341 = 1168940321 * 1209328621</code></p>
<pre><code>p = 1168940321
q = 1209328621</code></pre>
<!-- end pq -->
<h4><a class="anchor" href="#presenting-proof-of-work-server-authentication" id="presenting-proof-of-work-server-authentication" name="presenting-proof-of-work-server-authentication"><i class="anchor-icon"></i></a>Presenting proof of work; Server authentication</h4>
<h5><a class="anchor" href="#4-encrypted-data-payload-generation" id="4-encrypted-data-payload-generation" name="4-encrypted-data-payload-generation"><i class="anchor-icon"></i></a>4) <code>encrypted_data</code> payload generation</h5>
<p>First of all, generate an <code>encrypted_data</code> payload as follows:</p>
<!-- start p_q_inner_data_dc -->
<p>Generated payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 95 5F F5 A9 08 20 3D 5A 71 20 24 36 21 00 00 00
0010 | 04 49 5E 6C 99 00 00 00 04 70 7D C2 C9 00 00 00
0020 | 2F AF 63 7D 5B C0 6E B2 EF 1C 5B 3D 62 04 7E 51
0030 | F6 9E 6A 9C E3 D2 E7 19 66 40 68 B0 69 FE 4E 8E
0040 | B3 08 1C 99 E5 91 24 5D 97 06 64 58 3A AA F1 59
0050 | 5D E1 AF F3 BB BC 1D 1A 32 27 3F E8 5E 07 1C E5
<pre><code>0000 | 95 5F F5 A9 08 13 9E 3B B6 1E B5 BA 8D 00 00 00
0010 | 04 45 AC 9D 21 00 00 00 04 48 14 E3 ED 00 00 00
0020 | 28 72 1A 8E C4 CD 99 F8 A9 B9 5B DB 5A 5F D8 30
0030 | 71 7F 48 CF 46 34 E2 07 D3 21 B7 A6 A0 50 39 82
0040 | 56 84 9E 7F 80 A3 5D DD 7E EC A0 AC 29 69 D1 7D
0050 | 53 AB CA C9 EA A1 4E 7D 02 FB 16 CC E5 17 18 9F
0060 | 02 00 00 00</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>p_q_inner_data_dc#a9f55f95 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int = P_Q_inner_data;</code></pre>
@ -246,37 +246,37 @@ q = 1887290057</code></pre>
<tr>
<td>pq</td>
<td>4, 12</td>
<td><code>08203D5A7120243621000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 2323112424710092321</td>
<td><code>08139E3BB61EB5BA8D000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1413632986426227341</td>
<td>Single-byte prefix denoting length, 8-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>p</td>
<td>16, 8</td>
<td><code>04495E6C99000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1230924953</td>
<td><code>0445AC9D21000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1168940321</td>
<td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>q</td>
<td>24, 8</td>
<td><code>04707DC2C9000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1887290057</td>
<td><code>044814E3ED000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1209328621</td>
<td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>nonce</td>
<td>32, 16</td>
<td><code>2FAF637D5BC06EB2EF1C5B3D62047E51</code></td>
<td><code>28721A8EC4CD99F8A9B95BDB5A5FD830</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>48, 16</td>
<td><code>F69E6A9CE3D2E719664068B069FE4E8E</code></td>
<td><code>717F48CF4634E207D321B7A6A0503982</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce</td>
<td>64, 32</td>
<td><code>B3081C99E591245D970664583AAAF159</code> <code>5DE1AFF3BBBC1D1A32273FE85E071CE5</code></td>
<td><code>56849E7F80A35DDD7EECA0AC2969D17D</code> <code>53ABCAC9EAA14E7D02FB16CCE517189F</code></td>
<td>Client-generated random number</td>
</tr>
<tr>
@ -291,39 +291,39 @@ q = 1887290057</code></pre>
<p>The serialization of <em>P_Q_inner_data</em> produces <strong>data</strong>, which is used to generate <strong>encrypted_data</strong> as specified in <a href="/mtproto/auth_key">step 4.1</a>.<br>
These are the inputs to the algorithm specified in <a href="/mtproto/auth_key">step 4.1</a>:</p>
<!-- start p_q_inner_data_input -->
<pre><code>data = 955FF5A908203D5A712024362100000004495E6C9900000004707DC2C90000002FAF637D5BC06EB2EF1C5B3D62047E51F69E6A9CE3D2E719664068B069FE4E8EB3081C99E591245D970664583AAAF1595DE1AFF3BBBC1D1A32273FE85E071CE502000000
random_padding_bytes = CEA8B0A0A9B4BE1ACB48910B7CC80DA1B83A643D34A6B4AE52B76487C3B9B043AD1C504C7E7C8A8B10D2377707F31AD949B0D6A0B58AE49CDB5F84B3EDB141EDAD492DF34B6087ED3D5C96DDC309D6323FFC1368A2FC945FE57FA8CC</code></pre>
<pre><code>data = 955FF5A908139E3BB61EB5BA8D0000000445AC9D21000000044814E3ED00000028721A8EC4CD99F8A9B95BDB5A5FD830717F48CF4634E207D321B7A6A050398256849E7F80A35DDD7EECA0AC2969D17D53ABCAC9EAA14E7D02FB16CCE517189F02000000
random_padding_bytes = EE2FE5580491683FA67D4DD722AA8385F57F20D61CB0196FB6388C643D4FD818976EC97FD085798FCC165B07096ED3868B393B61F798CB300A96725D71574DBE8DF845C6C2CACBA0F2B8A1920DE3973FE4036831811B1248A14BE97F</code></pre>
<!-- end p_q_inner_data_input -->
<p>And this is the output:</p>
<!-- start p_q_inner_data_output -->
<pre><code>encrypted_data = 5A07310F2E03891001C20F2A6B2BA8D6A123EBBB714119FDE9DD3B8D5812AEB9A6C7B464A97E1435E2E5C7B3323490679CA9D38800B013C9BAAAB9025AAFCA53B88DB3A91F95A54D01959D00CF8E8BD402C9F3995914B974E2C657AD61274BBE0C49B561BD18C194E5062CA225AD0DDF525523D2AAD2F7DE28AA13FF89E1DB38C555CEC068B7A3D2B75535A72B256C91EA1D6B754A872B0A115CC7CF47F983795FB52AD542243E375FD71D4A8BDE4578C2906BDD0FB51E3FE2847E1E36F820499F41112C085379CA4F7B5206EB6BAB73CE246A17E8B6E0214FEF06DA3DFB8E953197ABA4092D2832C6F1786E67EB03EB2D35C209530F2160CE867D925DB89334</code></pre>
<pre><code>encrypted_data = 1B49394C7AE3D72AB7D6A53CF1AF23DF667AC7D9ADC11AB1CC9CA06F7688F870A1C6896482E6082AEC7AC5DFF08D83D4A03612E9478C9157DD223DCE03FA9C1E04797F41F2213C254608DA94B3B2693075B81FA72BEB40D607EED5303C813AED46E84D11F73769D74ED1D345A04CF9F1485A3330992E373CC51EA01E309CCD6BD3CF0445DA2698AF3205E040E0267E5BEC220B08E94DA59FD456E521D21B9296E5B150E61CE52C0CD25075DC19C7DFE0598C05FD515F0F5E834C778F28E353A84E917241D014D68FB65DA21FEBD75D7D8F27274B6784DAAEEECF1AB781D314B736B3803FA198D893D25B8C6EE1FBB143B7680D053B8A43D3D01F16E6567D4849</code></pre>
<!-- end p_q_inner_data_output -->
<p>The length of the final string is 256 bytes.</p>
<h5><a class="anchor" href="#5-send-req-dh-params-query-with-generated-encrypted-data" id="5-send-req-dh-params-query-with-generated-encrypted-data" name="5-send-req-dh-params-query-with-generated-encrypted-data"><i class="anchor-icon"></i></a>5) Send req_DH_params query with generated <code>encrypted_data</code></h5>
<!-- start req_DH_params -->
<p>Sent payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 84 67 0C 00 B9 B8 30 67
0010 | 40 01 00 00 BE E4 12 D7 2F AF 63 7D 5B C0 6E B2
0020 | EF 1C 5B 3D 62 04 7E 51 F6 9E 6A 9C E3 D2 E7 19
0030 | 66 40 68 B0 69 FE 4E 8E 04 49 5E 6C 99 00 00 00
0040 | 04 70 7D C2 C9 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 5A 07 31 0F 2E 03 89 10 01 C2 0F 2A
0060 | 6B 2B A8 D6 A1 23 EB BB 71 41 19 FD E9 DD 3B 8D
0070 | 58 12 AE B9 A6 C7 B4 64 A9 7E 14 35 E2 E5 C7 B3
0080 | 32 34 90 67 9C A9 D3 88 00 B0 13 C9 BA AA B9 02
0090 | 5A AF CA 53 B8 8D B3 A9 1F 95 A5 4D 01 95 9D 00
00A0 | CF 8E 8B D4 02 C9 F3 99 59 14 B9 74 E2 C6 57 AD
00B0 | 61 27 4B BE 0C 49 B5 61 BD 18 C1 94 E5 06 2C A2
00C0 | 25 AD 0D DF 52 55 23 D2 AA D2 F7 DE 28 AA 13 FF
00D0 | 89 E1 DB 38 C5 55 CE C0 68 B7 A3 D2 B7 55 35 A7
00E0 | 2B 25 6C 91 EA 1D 6B 75 4A 87 2B 0A 11 5C C7 CF
00F0 | 47 F9 83 79 5F B5 2A D5 42 24 3E 37 5F D7 1D 4A
0100 | 8B DE 45 78 C2 90 6B DD 0F B5 1E 3F E2 84 7E 1E
0110 | 36 F8 20 49 9F 41 11 2C 08 53 79 CA 4F 7B 52 06
0120 | EB 6B AB 73 CE 24 6A 17 E8 B6 E0 21 4F EF 06 DA
0130 | 3D FB 8E 95 31 97 AB A4 09 2D 28 32 C6 F1 78 6E
0140 | 67 EB 03 EB 2D 35 C2 09 53 0F 21 60 CE 86 7D 92
0150 | 5D B8 93 34</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 10 61 06 00 E2 88 33 67
0010 | 40 01 00 00 BE E4 12 D7 28 72 1A 8E C4 CD 99 F8
0020 | A9 B9 5B DB 5A 5F D8 30 71 7F 48 CF 46 34 E2 07
0030 | D3 21 B7 A6 A0 50 39 82 04 45 AC 9D 21 00 00 00
0040 | 04 48 14 E3 ED 00 00 00 85 FD 64 DE 85 1D 9D D0
0050 | FE 00 01 00 1B 49 39 4C 7A E3 D7 2A B7 D6 A5 3C
0060 | F1 AF 23 DF 66 7A C7 D9 AD C1 1A B1 CC 9C A0 6F
0070 | 76 88 F8 70 A1 C6 89 64 82 E6 08 2A EC 7A C5 DF
0080 | F0 8D 83 D4 A0 36 12 E9 47 8C 91 57 DD 22 3D CE
0090 | 03 FA 9C 1E 04 79 7F 41 F2 21 3C 25 46 08 DA 94
00A0 | B3 B2 69 30 75 B8 1F A7 2B EB 40 D6 07 EE D5 30
00B0 | 3C 81 3A ED 46 E8 4D 11 F7 37 69 D7 4E D1 D3 45
00C0 | A0 4C F9 F1 48 5A 33 30 99 2E 37 3C C5 1E A0 1E
00D0 | 30 9C CD 6B D3 CF 04 45 DA 26 98 AF 32 05 E0 40
00E0 | E0 26 7E 5B EC 22 0B 08 E9 4D A5 9F D4 56 E5 21
00F0 | D2 1B 92 96 E5 B1 50 E6 1C E5 2C 0C D2 50 75 DC
0100 | 19 C7 DF E0 59 8C 05 FD 51 5F 0F 5E 83 4C 77 8F
0110 | 28 E3 53 A8 4E 91 72 41 D0 14 D6 8F B6 5D A2 1F
0120 | EB D7 5D 7D 8F 27 27 4B 67 84 DA AE EE CF 1A B7
0130 | 81 D3 14 B7 36 B3 80 3F A1 98 D8 93 D2 5B 8C 6E
0140 | E1 FB B1 43 B7 68 0D 05 3B 8A 43 D3 D0 1F 16 E6
0150 | 56 7D 48 49</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;</code></pre>
<table class="table">
@ -345,7 +345,7 @@ random_padding_bytes = CEA8B0A0A9B4BE1ACB48910B7CC80DA1B83A643D34A6B4AE52B76487C
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>84670C00B9B83067</code></td>
<td><code>10610600E2883367</code></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>
@ -363,25 +363,25 @@ random_padding_bytes = CEA8B0A0A9B4BE1ACB48910B7CC80DA1B83A643D34A6B4AE52B76487C
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>2FAF637D5BC06EB2EF1C5B3D62047E51</code></td>
<td><code>28721A8EC4CD99F8A9B95BDB5A5FD830</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>F69E6A9CE3D2E719664068B069FE4E8E</code></td>
<td><code>717F48CF4634E207D321B7A6A0503982</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>p</td>
<td>56, 8</td>
<td><code>04495E6C99000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1230924953</td>
<td><code>0445AC9D21000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1168940321</td>
<td>First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr>
<tr>
<td>q</td>
<td>64, 8</td>
<td><code>04707DC2C9000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1887290057</td>
<td><code>044814E3ED000000</code><br>TL byte deserialization <br>=&gt; bigendian conversion to decimal<br>=&gt; 1209328621</td>
<td>Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding</td>
</tr>
<tr>
@ -393,7 +393,7 @@ random_padding_bytes = CEA8B0A0A9B4BE1ACB48910B7CC80DA1B83A643D34A6B4AE52B76487C
<tr>
<td>encrypted_data</td>
<td>80, 260</td>
<td><code>FE0001005A07310F2E03891001C20F2A</code> <code>6B2BA8D6A123EBBB714119FDE9DD3B8D</code> <code>5812AEB9A6C7B464A97E1435E2E5C7B3</code> <code>323490679CA9D38800B013C9BAAAB902</code> <code>5AAFCA53B88DB3A91F95A54D01959D00</code> <code>CF8E8BD402C9F3995914B974E2C657AD</code> <code>61274BBE0C49B561BD18C194E5062CA2</code> <code>25AD0DDF525523D2AAD2F7DE28AA13FF</code> <code>89E1DB38C555CEC068B7A3D2B75535A7</code> <code>2B256C91EA1D6B754A872B0A115CC7CF</code> <code>47F983795FB52AD542243E375FD71D4A</code> <code>8BDE4578C2906BDD0FB51E3FE2847E1E</code> <code>36F820499F41112C085379CA4F7B5206</code> <code>EB6BAB73CE246A17E8B6E0214FEF06DA</code> <code>3DFB8E953197ABA4092D2832C6F1786E</code> <code>67EB03EB2D35C209530F2160CE867D92</code><br> <code>5DB89334</code></td>
<td><code>FE0001001B49394C7AE3D72AB7D6A53C</code> <code>F1AF23DF667AC7D9ADC11AB1CC9CA06F</code> <code>7688F870A1C6896482E6082AEC7AC5DF</code> <code>F08D83D4A03612E9478C9157DD223DCE</code> <code>03FA9C1E04797F41F2213C254608DA94</code> <code>B3B2693075B81FA72BEB40D607EED530</code> <code>3C813AED46E84D11F73769D74ED1D345</code> <code>A04CF9F1485A3330992E373CC51EA01E</code> <code>309CCD6BD3CF0445DA2698AF3205E040</code> <code>E0267E5BEC220B08E94DA59FD456E521</code> <code>D21B9296E5B150E61CE52C0CD25075DC</code> <code>19C7DFE0598C05FD515F0F5E834C778F</code> <code>28E353A84E917241D014D68FB65DA21F</code> <code>EBD75D7D8F27274B6784DAAEEECF1AB7</code> <code>81D314B736B3803FA198D893D25B8C6E</code> <code>E1FBB143B7680D053B8A43D3D01F16E6</code><br> <code>567D4849</code></td>
<td>Value generated above</td>
</tr>
</tbody>
@ -402,47 +402,47 @@ random_padding_bytes = CEA8B0A0A9B4BE1ACB48910B7CC80DA1B83A643D34A6B4AE52B76487C
<h5><a class="anchor" href="#6-server-responds-with" id="6-server-responds-with" name="6-server-responds-with"><i class="anchor-icon"></i></a>6) Server responds with:</h5>
<!-- start server_DH_params_ok -->
<p>Received payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 40 D3 B7 B9 B8 30 67
0010 | 78 02 00 00 5C 07 E8 D0 2F AF 63 7D 5B C0 6E B2
0020 | EF 1C 5B 3D 62 04 7E 51 F6 9E 6A 9C E3 D2 E7 19
0030 | 66 40 68 B0 69 FE 4E 8E FE 50 02 00 2C 35 3B 45
0040 | BB 4C 8A 02 86 1B 5D 80 F4 28 60 BF A9 3B 75 CD
0050 | 22 E7 8F 8D 74 32 54 BE 72 8E C2 2A 49 4A 6B 7E
0060 | 51 61 91 6F F9 11 A9 A3 8E DE E3 8C D1 EE 4E 50
0070 | 33 F1 6E 53 99 10 D7 56 CA 82 82 A0 04 B8 AC D8
0080 | 23 F5 B8 17 FC D5 52 E6 51 1E 4C CE 6E F6 17 44
0090 | 00 57 9B 86 EA 86 5F 77 AF 95 D6 E2 1D 6D 08 CA
00A0 | 0A 9A 51 D0 52 8C A3 76 AC 77 86 2D D6 80 A5 98
00B0 | 7C B1 1C 4E 0B 1C DE 61 FA BB 72 F1 D2 4D 3E 7C
00C0 | 80 CA 71 F9 01 75 DC 64 41 E1 36 70 49 2C D9 94
00D0 | A6 7D 01 00 D6 9B AD 71 40 09 38 0D 27 7E F6 A3
00E0 | 79 D7 E5 89 20 75 90 76 A4 53 88 4C 01 0C F9 8B
00F0 | 4F 07 7F 0A 0D 11 2C 35 99 19 D7 10 75 95 DA FB
0100 | 03 BA D7 C6 4B F0 3C E5 36 D7 89 60 D7 AC CD 3B
0110 | DA 50 49 67 63 9A E8 C2 06 CB 37 53 A7 D5 AD 03
0120 | 18 0A 85 57 6D 34 2D 07 0B BB D3 A0 D2 13 12 29
0130 | 82 C2 5E 62 B8 7D DE CA 06 1F A6 8E 97 91 40 74
0140 | 6D 8B 33 17 34 3D E6 BF 75 F0 44 09 C1 9E AD 57
0150 | 68 48 D5 46 E6 F0 D5 F3 23 78 C5 72 F2 8B EA 68
0160 | 53 2D 08 DC E0 FC AF 27 7A 55 3D 87 F2 84 9A D6
0170 | BB B0 8B A2 3E FF 3B 9A C7 50 99 11 7D 8B C3 0F
0180 | A3 B5 04 DB A3 42 42 AA 3F 9F FB C2 0A F8 D6 87
0190 | 74 65 DA 84 13 48 96 70 78 B1 03 73 61 11 68 8D
01A0 | 78 77 5F 63 B6 92 C7 2B EC 94 CC 3C 24 87 03 8D
01B0 | E6 42 A1 8B BF FB DA 1A F5 5F 99 63 0F DD 41 7A
01C0 | 6C 4A 4F 2B A6 D9 FC 77 2C 53 1F 28 6B 0B 84 D9
01D0 | E0 E3 56 96 CD 67 E3 85 C2 E9 74 4A 0F B3 8C 0F
01E0 | 46 A0 A8 40 EE 1B 72 51 1B A8 39 D0 6C 83 C9 55
01F0 | 1B 21 D0 93 52 50 FD CB 01 B9 61 7F D4 0D 6B 45
0200 | 7E 00 F6 C8 26 86 39 F0 5D B0 60 98 08 9E FB 43
0210 | C3 2E D0 F0 13 6E 5C E6 94 56 06 63 A2 16 3E A7
0220 | D8 BC C3 C7 B5 EB 7C E2 64 3B 35 85 71 EF C7 D6
0230 | 8E 1F 03 C3 4C F6 AF 1C 78 21 00 00 5F B2 5E 52
0240 | 69 1A 9D 61 75 62 74 38 BA 4A 21 2B 2C 07 00 6D
0250 | 86 9A FD 8C 3F 74 A5 4D 0B FE 72 05 73 26 E9 FE
0260 | E4 8B 2D 32 9C 7A 0F 18 DF 47 92 AD 07 BF D1 F7
0270 | C1 15 5E 86 4E 79 4C E1 14 EA 67 3B 51 57 F7 9D
0280 | 41 20 87 CB 41 FC 65 BA F3 FB 80 9B</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 1C DE CC E2 88 33 67
0010 | 78 02 00 00 5C 07 E8 D0 28 72 1A 8E C4 CD 99 F8
0020 | A9 B9 5B DB 5A 5F D8 30 71 7F 48 CF 46 34 E2 07
0030 | D3 21 B7 A6 A0 50 39 82 FE 50 02 00 CD EB 38 E4
0040 | 95 1C 47 81 4F 9C 69 D4 68 9B AB E2 FD E1 B3 2B
0050 | E3 8D 5B BF D6 DE 93 F2 57 30 F8 42 D2 B0 77 3D
0060 | F9 52 C4 F3 21 84 42 FA 77 E7 E7 13 94 D8 94 49
0070 | 4E 78 7D 34 B4 41 12 66 9E 25 75 14 2F 1B 2E 8C
0080 | 42 F7 CD 03 36 DD BD D9 15 D9 42 C4 56 3B 7F 4A
0090 | 1C 21 63 49 77 30 60 DE 03 8E AF 14 35 93 B4 17
00A0 | 5E D1 F6 84 ED 90 A7 30 81 E0 E7 CC 63 B5 7A EE
00B0 | 98 40 31 09 E6 41 EA DD 87 5A 16 DE 07 C6 BA 51
00C0 | 5E 72 27 43 C2 14 8C D3 6B 8F 3D D7 67 4D 82 B7
00D0 | C4 27 B9 52 3E BA CC 1F D1 8F DE 29 0F 37 86 4C
00E0 | 4D CB 7A 3E 45 5F 97 4E D7 A3 ED C6 47 10 DB EB
00F0 | 42 29 C1 AD 29 10 3E 25 3F B3 C0 37 35 57 C3 22
0100 | D1 E6 5C B0 19 AD 18 CE E0 53 12 C3 00 01 A1 9A
0110 | A7 79 18 4D 11 FF 7E 59 21 C6 ED AD 23 E5 90 8E
0120 | BB AA D6 8B BB D7 E5 AE 08 8B 73 00 3C B0 80 9F
0130 | 9C 03 76 BC 13 1B C5 8B E3 32 AD 17 0A B5 50 71
0140 | A2 52 88 B5 6E 8B A7 09 1B F7 3D 59 E7 B8 B9 CB
0150 | D0 C6 0A 88 A4 59 DD 36 AE 9E 0A 2C FE F9 98 A0
0160 | 6B 91 4C D0 43 99 D4 D1 20 19 2A 8D C4 94 13 61
0170 | F4 D4 22 3B E6 E2 4A 81 72 DF AA 51 A3 6C 25 AA
0180 | D8 1E E7 86 5B F9 4A DF 1D D9 3F 90 D1 B0 83 DE
0190 | 81 2D 4E 67 25 F5 6B 6D FB 5D 8E 5D 15 79 5E 5F
01A0 | 36 56 3B A0 63 3F 30 8F 35 EB 50 72 42 E4 41 66
01B0 | 4A AE 15 42 97 07 25 9F 44 E4 A1 F2 77 FE 67 6A
01C0 | 13 BD BA C7 6D 8D AD 42 40 44 85 E5 33 E8 C1 51
01D0 | 33 A5 CA 83 75 53 B8 CB 94 94 3F 31 CD 10 53 74
01E0 | A8 7A E8 7B 8D E0 25 12 32 4E DF 0F B2 63 AC 99
01F0 | 5C 5D 87 61 5C EC BA DD 7B FD C5 38 CD F1 57 AB
0200 | 82 22 B5 79 69 2F 9F 40 4B 51 5A 2A C0 4D 64 8F
0210 | E8 65 6B 03 9D 15 03 86 CF 55 0A E1 C2 02 03 9C
0220 | 88 73 90 57 DC 3C 82 40 A2 0F AB 6A 3C 31 04 6B
0230 | FC 1E 7E E7 EF 2B B8 91 81 A3 9F 1D 08 15 AE F3
0240 | 83 43 5B DD 8F E9 66 D0 AF 5C 95 3D 2D 1C 44 7E
0250 | F0 5A 52 7A 34 D2 4F BB D1 7F 14 7A 53 E1 30 40
0260 | A6 AF DA 17 BD B7 16 11 18 8F 53 34 30 E8 4E CB
0270 | 18 5E AD 2A FA D1 71 57 AC 3A C0 D7 FA AD B1 EC
0280 | E9 23 23 D9 11 27 3D 50 86 13 70 8E</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;</code></pre>
<table class="table">
@ -464,7 +464,7 @@ random_padding_bytes = CEA8B0A0A9B4BE1ACB48910B7CC80DA1B83A643D34A6B4AE52B76487C
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>0140D3B7B9B83067</code></td>
<td><code>011CDECCE2883367</code></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>
@ -482,19 +482,19 @@ random_padding_bytes = CEA8B0A0A9B4BE1ACB48910B7CC80DA1B83A643D34A6B4AE52B76487C
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>2FAF637D5BC06EB2EF1C5B3D62047E51</code></td>
<td><code>28721A8EC4CD99F8A9B95BDB5A5FD830</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>F69E6A9CE3D2E719664068B069FE4E8E</code></td>
<td><code>717F48CF4634E207D321B7A6A0503982</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_answer</td>
<td>56, 596</td>
<td><code>FE5002002C353B45BB4C8A02861B5D80</code> <code>F42860BFA93B75CD22E78F8D743254BE</code> <code>728EC22A494A6B7E5161916FF911A9A3</code> <code>8EDEE38CD1EE4E5033F16E539910D756</code> <code>CA8282A004B8ACD823F5B817FCD552E6</code> <code>511E4CCE6EF6174400579B86EA865F77</code> <code>AF95D6E21D6D08CA0A9A51D0528CA376</code> <code>AC77862DD680A5987CB11C4E0B1CDE61</code> <code>FABB72F1D24D3E7C80CA71F90175DC64</code> <code>41E13670492CD994A67D0100D69BAD71</code> <code>4009380D277EF6A379D7E58920759076</code> <code>A453884C010CF98B4F077F0A0D112C35</code> <code>9919D7107595DAFB03BAD7C64BF03CE5</code> <code>36D78960D7ACCD3BDA504967639AE8C2</code> <code>06CB3753A7D5AD03180A85576D342D07</code> <code>0BBBD3A0D213122982C25E62B87DDECA</code> <code>061FA68E979140746D8B3317343DE6BF</code> <code>75F04409C19EAD576848D546E6F0D5F3</code> <code>2378C572F28BEA68532D08DCE0FCAF27</code> <code>7A553D87F2849AD6BBB08BA23EFF3B9A</code> <code>C75099117D8BC30FA3B504DBA34242AA</code> <code>3F9FFBC20AF8D6877465DA8413489670</code> <code>78B103736111688D78775F63B692C72B</code> <code>EC94CC3C2487038DE642A18BBFFBDA1A</code> <code>F55F99630FDD417A6C4A4F2BA6D9FC77</code> <code>2C531F286B0B84D9E0E35696CD67E385</code> <code>C2E9744A0FB38C0F46A0A840EE1B7251</code> <code>1BA839D06C83C9551B21D0935250FDCB</code> <code>01B9617FD40D6B457E00F6C8268639F0</code> <code>5DB06098089EFB43C32ED0F0136E5CE6</code> <code>94560663A2163EA7D8BCC3C7B5EB7CE2</code> <code>643B358571EFC7D68E1F03C34CF6AF1C</code> <code>782100005FB25E52691A9D6175627438</code> <code>BA4A212B2C07006D869AFD8C3F74A54D</code> <code>0BFE72057326E9FEE48B2D329C7A0F18</code> <code>DF4792AD07BFD1F7C1155E864E794CE1</code> <code>14EA673B5157F79D412087CB41FC65BA</code><br> <code>F3FB809B</code></td>
<td><code>FE500200CDEB38E4951C47814F9C69D4</code> <code>689BABE2FDE1B32BE38D5BBFD6DE93F2</code> <code>5730F842D2B0773DF952C4F3218442FA</code> <code>77E7E71394D894494E787D34B4411266</code> <code>9E2575142F1B2E8C42F7CD0336DDBDD9</code> <code>15D942C4563B7F4A1C216349773060DE</code> <code>038EAF143593B4175ED1F684ED90A730</code> <code>81E0E7CC63B57AEE98403109E641EADD</code> <code>875A16DE07C6BA515E722743C2148CD3</code> <code>6B8F3DD7674D82B7C427B9523EBACC1F</code> <code>D18FDE290F37864C4DCB7A3E455F974E</code> <code>D7A3EDC64710DBEB4229C1AD29103E25</code> <code>3FB3C0373557C322D1E65CB019AD18CE</code> <code>E05312C30001A19AA779184D11FF7E59</code> <code>21C6EDAD23E5908EBBAAD68BBBD7E5AE</code> <code>088B73003CB0809F9C0376BC131BC58B</code> <code>E332AD170AB55071A25288B56E8BA709</code> <code>1BF73D59E7B8B9CBD0C60A88A459DD36</code> <code>AE9E0A2CFEF998A06B914CD04399D4D1</code> <code>20192A8DC4941361F4D4223BE6E24A81</code> <code>72DFAA51A36C25AAD81EE7865BF94ADF</code> <code>1DD93F90D1B083DE812D4E6725F56B6D</code> <code>FB5D8E5D15795E5F36563BA0633F308F</code> <code>35EB507242E441664AAE15429707259F</code> <code>44E4A1F277FE676A13BDBAC76D8DAD42</code> <code>404485E533E8C15133A5CA837553B8CB</code> <code>94943F31CD105374A87AE87B8DE02512</code> <code>324EDF0FB263AC995C5D87615CECBADD</code> <code>7BFDC538CDF157AB8222B579692F9F40</code> <code>4B515A2AC04D648FE8656B039D150386</code> <code>CF550AE1C202039C88739057DC3C8240</code> <code>A20FAB6A3C31046BFC1E7EE7EF2BB891</code> <code>81A39F1D0815AEF383435BDD8FE966D0</code> <code>AF5C953D2D1C447EF05A527A34D24FBB</code> <code>D17F147A53E13040A6AFDA17BDB71611</code> <code>188F533430E84ECB185EAD2AFAD17157</code> <code>AC3AC0D7FAADB1ECE92323D911273D50</code><br> <code>8613708E</code></td>
<td>See below</td>
</tr>
</tbody>
@ -502,20 +502,20 @@ random_padding_bytes = CEA8B0A0A9B4BE1ACB48910B7CC80DA1B83A643D34A6B4AE52B76487C
<!-- end server_DH_params_ok -->
<p>Decrypt <code>encrypted_answer</code> using the reverse of the process specified in <a href="/mtproto/auth_key#6-server-responds-with">step 6</a>:</p>
<!-- start server_DH_inner_data_input -->
<pre><code>encrypted_answer = 2C353B45BB4C8A02861B5D80F42860BFA93B75CD22E78F8D743254BE728EC22A494A6B7E5161916FF911A9A38EDEE38CD1EE4E5033F16E539910D756CA8282A004B8ACD823F5B817FCD552E6511E4CCE6EF6174400579B86EA865F77AF95D6E21D6D08CA0A9A51D0528CA376AC77862DD680A5987CB11C4E0B1CDE61FABB72F1D24D3E7C80CA71F90175DC6441E13670492CD994A67D0100D69BAD714009380D277EF6A379D7E58920759076A453884C010CF98B4F077F0A0D112C359919D7107595DAFB03BAD7C64BF03CE536D78960D7ACCD3BDA504967639AE8C206CB3753A7D5AD03180A85576D342D070BBBD3A0D213122982C25E62B87DDECA061FA68E979140746D8B3317343DE6BF75F04409C19EAD576848D546E6F0D5F32378C572F28BEA68532D08DCE0FCAF277A553D87F2849AD6BBB08BA23EFF3B9AC75099117D8BC30FA3B504DBA34242AA3F9FFBC20AF8D6877465DA841348967078B103736111688D78775F63B692C72BEC94CC3C2487038DE642A18BBFFBDA1AF55F99630FDD417A6C4A4F2BA6D9FC772C531F286B0B84D9E0E35696CD67E385C2E9744A0FB38C0F46A0A840EE1B72511BA839D06C83C9551B21D0935250FDCB01B9617FD40D6B457E00F6C8268639F05DB06098089EFB43C32ED0F0136E5CE694560663A2163EA7D8BCC3C7B5EB7CE2643B358571EFC7D68E1F03C34CF6AF1C782100005FB25E52691A9D6175627438BA4A212B2C07006D869AFD8C3F74A54D0BFE72057326E9FEE48B2D329C7A0F18DF4792AD07BFD1F7C1155E864E794CE114EA673B5157F79D412087CB41FC65BAF3FB809B
tmp_aes_key = 91EEAB4AB17C4AF217B52B8A88DCE9BA718F0E0F749A18D608E707A02CB15B83
tmp_aes_iv = E18679D9BC148D5235CBD0A511AC2745B6591852402B750B62C44E63B3081C99</code></pre>
<pre><code>encrypted_answer = CDEB38E4951C47814F9C69D4689BABE2FDE1B32BE38D5BBFD6DE93F25730F842D2B0773DF952C4F3218442FA77E7E71394D894494E787D34B44112669E2575142F1B2E8C42F7CD0336DDBDD915D942C4563B7F4A1C216349773060DE038EAF143593B4175ED1F684ED90A73081E0E7CC63B57AEE98403109E641EADD875A16DE07C6BA515E722743C2148CD36B8F3DD7674D82B7C427B9523EBACC1FD18FDE290F37864C4DCB7A3E455F974ED7A3EDC64710DBEB4229C1AD29103E253FB3C0373557C322D1E65CB019AD18CEE05312C30001A19AA779184D11FF7E5921C6EDAD23E5908EBBAAD68BBBD7E5AE088B73003CB0809F9C0376BC131BC58BE332AD170AB55071A25288B56E8BA7091BF73D59E7B8B9CBD0C60A88A459DD36AE9E0A2CFEF998A06B914CD04399D4D120192A8DC4941361F4D4223BE6E24A8172DFAA51A36C25AAD81EE7865BF94ADF1DD93F90D1B083DE812D4E6725F56B6DFB5D8E5D15795E5F36563BA0633F308F35EB507242E441664AAE15429707259F44E4A1F277FE676A13BDBAC76D8DAD42404485E533E8C15133A5CA837553B8CB94943F31CD105374A87AE87B8DE02512324EDF0FB263AC995C5D87615CECBADD7BFDC538CDF157AB8222B579692F9F404B515A2AC04D648FE8656B039D150386CF550AE1C202039C88739057DC3C8240A20FAB6A3C31046BFC1E7EE7EF2BB89181A39F1D0815AEF383435BDD8FE966D0AF5C953D2D1C447EF05A527A34D24FBBD17F147A53E13040A6AFDA17BDB71611188F533430E84ECB185EAD2AFAD17157AC3AC0D7FAADB1ECE92323D911273D508613708E
tmp_aes_key = F12B07E505018CEF441EC420E14670A2D76C55D01508ED3E0CA30463E513172B
tmp_aes_iv = 683098AF19C8B22A4C3BF3CA68BEC24BC944B62BD94EAC23AADABF7B56849E7F</code></pre>
<!-- end server_DH_inner_data_input -->
<p>Yielding:</p>
<!-- start server_DH_inner_data_output -->
<pre><code>answer_with_hash = 4C127C3A367CB983D98DEBA706C08DF7D7C86D70BA0D89B52FAF637D5BC06EB2EF1C5B3D62047E51F69E6A9CE3D2E719664068B069FE4E8E03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001003A76DA32A6D20B3A15D000FE359BA214B48BD4CE0EFC7938999A13E0F265272D488D439D25BD1DBF31BB9F65D1B4B664EBD6882A68764CD363E28BC8D30C9AEF07EFA3C302E96FEFCAD795A5FA6CD3D19A3D54D0C02DF32708E26B63ED747B034DCF2FBA997D52CED31A45F32E89077CB83D3F80F0AB485A8FE79738348BD714EF4C0A95D720758A6533757591A7E28396F54DD4914D19B0D02E2FAF4217B7E6948BE4CE7D7711ACC9A454BEC2E81F1E7C3FF397032246EB197429342E63BCD92F8F6E027CE7068D79304129CBBFF6F58DF9C2156AAF5287428C150BDCF63BFDD3E7693A9035EE34DB4E953A5BDA78264091A07009CF98E03F1F00119CC1FD69B9B830675DCAD3DB6E23E9BE
answer = BA0D89B52FAF637D5BC06EB2EF1C5B3D62047E51F69E6A9CE3D2E719664068B069FE4E8E03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001003A76DA32A6D20B3A15D000FE359BA214B48BD4CE0EFC7938999A13E0F265272D488D439D25BD1DBF31BB9F65D1B4B664EBD6882A68764CD363E28BC8D30C9AEF07EFA3C302E96FEFCAD795A5FA6CD3D19A3D54D0C02DF32708E26B63ED747B034DCF2FBA997D52CED31A45F32E89077CB83D3F80F0AB485A8FE79738348BD714EF4C0A95D720758A6533757591A7E28396F54DD4914D19B0D02E2FAF4217B7E6948BE4CE7D7711ACC9A454BEC2E81F1E7C3FF397032246EB197429342E63BCD92F8F6E027CE7068D79304129CBBFF6F58DF9C2156AAF5287428C150BDCF63BFDD3E7693A9035EE34DB4E953A5BDA78264091A07009CF98E03F1F00119CC1FD69B9B830675DCAD3DB6E23E9BE</code></pre>
<pre><code>answer_with_hash = 1D19AEE2F97D1271F02A9C2E11357FBEC93AFB44BA0D89B528721A8EC4CD99F8A9B95BDB5A5FD830717F48CF4634E207D321B7A6A050398203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001009F3F786150218F6372353293B0B058436C6E0909E7725DF6F9253A7226347EAF95201B6692D9D66C96D08CB5574AE5BC94F599F3219B09BCE0AF7389A5C1C663C896B18EA73CE88A118B32C2080C197052C84687279C0B2BFEE96971511A64C75A4C32934F83EEBA5AD4D6E82204B8B877F7FF86F993EB5B6460067FC711F87C377E2898A9FDBAB1D30FC4E2F084F3D65844089637F3B0E67AAFAEB345D80F0A6B6BE2A65D1726F942431A3E89F7D3094BB570EE3E2DC325BCE3472F65582910DC21C7A7CB96CB9F8B9767192F053DCE8AE71C6E8C3C6C4D56D990FA7A37D8808A5723119D3D0D4E97932C5BC269453A3D1605CEC250605A42F527E080626B7AE2883367328EF2E0C51ACECC
answer = BA0D89B528721A8EC4CD99F8A9B95BDB5A5FD830717F48CF4634E207D321B7A6A050398203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001009F3F786150218F6372353293B0B058436C6E0909E7725DF6F9253A7226347EAF95201B6692D9D66C96D08CB5574AE5BC94F599F3219B09BCE0AF7389A5C1C663C896B18EA73CE88A118B32C2080C197052C84687279C0B2BFEE96971511A64C75A4C32934F83EEBA5AD4D6E82204B8B877F7FF86F993EB5B6460067FC711F87C377E2898A9FDBAB1D30FC4E2F084F3D65844089637F3B0E67AAFAEB345D80F0A6B6BE2A65D1726F942431A3E89F7D3094BB570EE3E2DC325BCE3472F65582910DC21C7A7CB96CB9F8B9767192F053DCE8AE71C6E8C3C6C4D56D990FA7A37D8808A5723119D3D0D4E97932C5BC269453A3D1605CEC250605A42F527E080626B7AE2883367328EF2E0C51ACECC</code></pre>
<!-- end server_DH_inner_data_output -->
<!-- start server_DH_inner_data -->
<p>Generated payload (excluding transport headers/trailers):</p>
<pre><code>0000 | BA 0D 89 B5 2F AF 63 7D 5B C0 6E B2 EF 1C 5B 3D
0010 | 62 04 7E 51 F6 9E 6A 9C E3 D2 E7 19 66 40 68 B0
0020 | 69 FE 4E 8E 03 00 00 00 FE 00 01 00 C7 1C AE B9
<pre><code>0000 | BA 0D 89 B5 28 72 1A 8E C4 CD 99 F8 A9 B9 5B DB
0010 | 5A 5F D8 30 71 7F 48 CF 46 34 E2 07 D3 21 B7 A6
0020 | A0 50 39 82 03 00 00 00 FE 00 01 00 C7 1C AE B9
0030 | C6 B1 C9 04 8E 6C 52 2F 70 F1 3F 73 98 0D 40 23
0040 | 8E 3E 21 C1 49 34 D0 37 56 3D 93 0F 48 19 8A 0A
0050 | A7 C1 40 58 22 94 93 D2 25 30 F4 DB FA 33 6F 6E
@ -532,23 +532,23 @@ answer = BA0D89B52FAF637D5BC06EB2EF1C5B3D62047E51F69E6A9CE3D2E719664068B069FE4E8
0100 | F4 7B F9 59 D9 56 85 0C E9 29 85 1F 0D 81 15 F6
0110 | 35 B1 05 EE 2E 4E 15 D0 4B 24 54 BF 6F 4F AD F0
0120 | 34 B1 04 03 11 9C D8 E3 B9 2F CC 5B FE 00 01 00
0130 | 3A 76 DA 32 A6 D2 0B 3A 15 D0 00 FE 35 9B A2 14
0140 | B4 8B D4 CE 0E FC 79 38 99 9A 13 E0 F2 65 27 2D
0150 | 48 8D 43 9D 25 BD 1D BF 31 BB 9F 65 D1 B4 B6 64
0160 | EB D6 88 2A 68 76 4C D3 63 E2 8B C8 D3 0C 9A EF
0170 | 07 EF A3 C3 02 E9 6F EF CA D7 95 A5 FA 6C D3 D1
0180 | 9A 3D 54 D0 C0 2D F3 27 08 E2 6B 63 ED 74 7B 03
0190 | 4D CF 2F BA 99 7D 52 CE D3 1A 45 F3 2E 89 07 7C
01A0 | B8 3D 3F 80 F0 AB 48 5A 8F E7 97 38 34 8B D7 14
01B0 | EF 4C 0A 95 D7 20 75 8A 65 33 75 75 91 A7 E2 83
01C0 | 96 F5 4D D4 91 4D 19 B0 D0 2E 2F AF 42 17 B7 E6
01D0 | 94 8B E4 CE 7D 77 11 AC C9 A4 54 BE C2 E8 1F 1E
01E0 | 7C 3F F3 97 03 22 46 EB 19 74 29 34 2E 63 BC D9
01F0 | 2F 8F 6E 02 7C E7 06 8D 79 30 41 29 CB BF F6 F5
0200 | 8D F9 C2 15 6A AF 52 87 42 8C 15 0B DC F6 3B FD
0210 | D3 E7 69 3A 90 35 EE 34 DB 4E 95 3A 5B DA 78 26
0220 | 40 91 A0 70 09 CF 98 E0 3F 1F 00 11 9C C1 FD 69
0230 | B9 B8 30 67</code></pre>
0130 | 9F 3F 78 61 50 21 8F 63 72 35 32 93 B0 B0 58 43
0140 | 6C 6E 09 09 E7 72 5D F6 F9 25 3A 72 26 34 7E AF
0150 | 95 20 1B 66 92 D9 D6 6C 96 D0 8C B5 57 4A E5 BC
0160 | 94 F5 99 F3 21 9B 09 BC E0 AF 73 89 A5 C1 C6 63
0170 | C8 96 B1 8E A7 3C E8 8A 11 8B 32 C2 08 0C 19 70
0180 | 52 C8 46 87 27 9C 0B 2B FE E9 69 71 51 1A 64 C7
0190 | 5A 4C 32 93 4F 83 EE BA 5A D4 D6 E8 22 04 B8 B8
01A0 | 77 F7 FF 86 F9 93 EB 5B 64 60 06 7F C7 11 F8 7C
01B0 | 37 7E 28 98 A9 FD BA B1 D3 0F C4 E2 F0 84 F3 D6
01C0 | 58 44 08 96 37 F3 B0 E6 7A AF AE B3 45 D8 0F 0A
01D0 | 6B 6B E2 A6 5D 17 26 F9 42 43 1A 3E 89 F7 D3 09
01E0 | 4B B5 70 EE 3E 2D C3 25 BC E3 47 2F 65 58 29 10
01F0 | DC 21 C7 A7 CB 96 CB 9F 8B 97 67 19 2F 05 3D CE
0200 | 8A E7 1C 6E 8C 3C 6C 4D 56 D9 90 FA 7A 37 D8 80
0210 | 8A 57 23 11 9D 3D 0D 4E 97 93 2C 5B C2 69 45 3A
0220 | 3D 16 05 CE C2 50 60 5A 42 F5 27 E0 80 62 6B 7A
0230 | E2 88 33 67</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;</code></pre>
<table class="table">
@ -570,13 +570,13 @@ answer = BA0D89B52FAF637D5BC06EB2EF1C5B3D62047E51F69E6A9CE3D2E719664068B069FE4E8
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>2FAF637D5BC06EB2EF1C5B3D62047E51</code></td>
<td><code>28721A8EC4CD99F8A9B95BDB5A5FD830</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>F69E6A9CE3D2E719664068B069FE4E8E</code></td>
<td><code>717F48CF4634E207D321B7A6A0503982</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
@ -594,13 +594,13 @@ answer = BA0D89B52FAF637D5BC06EB2EF1C5B3D62047E51F69E6A9CE3D2E719664068B069FE4E8
<tr>
<td>g_a</td>
<td>300, 260</td>
<td><code>FE0001003A76DA32A6D20B3A15D000FE</code> <code>359BA214B48BD4CE0EFC7938999A13E0</code> <code>F265272D488D439D25BD1DBF31BB9F65</code> <code>D1B4B664EBD6882A68764CD363E28BC8</code> <code>D30C9AEF07EFA3C302E96FEFCAD795A5</code> <code>FA6CD3D19A3D54D0C02DF32708E26B63</code> <code>ED747B034DCF2FBA997D52CED31A45F3</code> <code>2E89077CB83D3F80F0AB485A8FE79738</code> <code>348BD714EF4C0A95D720758A65337575</code> <code>91A7E28396F54DD4914D19B0D02E2FAF</code> <code>4217B7E6948BE4CE7D7711ACC9A454BE</code> <code>C2E81F1E7C3FF397032246EB19742934</code> <code>2E63BCD92F8F6E027CE7068D79304129</code> <code>CBBFF6F58DF9C2156AAF5287428C150B</code> <code>DCF63BFDD3E7693A9035EE34DB4E953A</code> <code>5BDA78264091A07009CF98E03F1F0011</code><br> <code>9CC1FD69</code></td>
<td><code>FE0001009F3F786150218F6372353293</code> <code>B0B058436C6E0909E7725DF6F9253A72</code> <code>26347EAF95201B6692D9D66C96D08CB5</code> <code>574AE5BC94F599F3219B09BCE0AF7389</code> <code>A5C1C663C896B18EA73CE88A118B32C2</code> <code>080C197052C84687279C0B2BFEE96971</code> <code>511A64C75A4C32934F83EEBA5AD4D6E8</code> <code>2204B8B877F7FF86F993EB5B6460067F</code> <code>C711F87C377E2898A9FDBAB1D30FC4E2</code> <code>F084F3D65844089637F3B0E67AAFAEB3</code> <code>45D80F0A6B6BE2A65D1726F942431A3E</code> <code>89F7D3094BB570EE3E2DC325BCE3472F</code> <code>65582910DC21C7A7CB96CB9F8B976719</code> <code>2F053DCE8AE71C6E8C3C6C4D56D990FA</code> <code>7A37D8808A5723119D3D0D4E97932C5B</code> <code>C269453A3D1605CEC250605A42F527E0</code><br> <code>80626B7A</code></td>
<td><code>g_a</code> diffie-hellman parameter</td>
</tr>
<tr>
<td>server_time</td>
<td>560, 4</td>
<td><code>B9B83067</code> (1731246265 in decimal)</td>
<td><code>E2883367</code> (1731430626 in decimal)</td>
<td>Server time</td>
</tr>
</tbody>
@ -609,34 +609,34 @@ answer = BA0D89B52FAF637D5BC06EB2EF1C5B3D62047E51F69E6A9CE3D2E719664068B069FE4E8
<h5><a class="anchor" href="#7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message" id="7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message" name="7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message"><i class="anchor-icon"></i></a>7) Client computes random 2048-bit number <em>b</em> (using a sufficient amount of entropy) and sends the server a message</h5>
<p>First, generate a secure random 2048-bit number b:</p>
<!-- start b -->
<pre><code>b = 98CBA014470F284618197699ABD32699E447FF11FB8EA5F0A9565A18E6B656D23A7F397B27B1EC7B289F775E80317130656FCBD595947BB1DACAE7470B4DFC8EFD720D9CF730E6B97E3335A098F5CE3B79020AD63D4520506EB0F3F691DD3F841D3E011C5D1C7AA29D6321224B7F3BF831A14443D8B7EBE96061BA2194A4BCB9D8B61DB428D8170835611880688CAAE2260D3D77DABE335D3BBC84C0CED8E8097C7231F08F9FBE281201CF3BA7A0D0DBBFA617F69FEC3C9B36F6C19057BE711A247D2555DF10C35F803F09BEEB2A400FED4F4D79638BE775DCD0BAF23BA1963518E460D0BB0040E9C6D09F05CC59E8636C6D457EE1249E377487F3EB9E86BC24</code></pre>
<pre><code>b = BF5313623DDC964E770267719AF1999200EA654AFB5908430F1591AC20F06239B4C604A3B4F92FD79AF775FE706937E5A4D51505BF632510109E9F8B874DA67E312520030E21631718F12FEA4B0FFF7B5765FF5C74CA85EB4BE33CE2B58A2B7F0D9DFEF7888EB30C6F693FDB70EAB365D7B6D052EE8DC5163A4F9BFAE3CFC62C3913D5E83063A96167D16F56446BB0B3837154FA8F92EBF17DDB51DE4872A76F6E3A55D2DAF77E69456966DB9F60AA3F063143F4600F5F22E7BD530E3A5FC613EBFAAC2F96F798C04B1BBA9B038A8C951F07EE9E9EDD3316F7823A104AE6D2AC931417E3E251AE898A7E7CEDD3B661BDAAA4B1111CC9CA07AB38D7869C9557B4</code></pre>
<!-- end b -->
<p>Then compute <code>g_b = pow(g, b) mod dh_prime</code></p>
<!-- start g_b -->
<pre><code>g_b = A259648B8D9CC2B1F9BA6AA8F823D84422B5E9C079096845D373EC7D7EAAB4DD5D4EE538FE2FED007A888FE87D4F3732E24341BE1E0D2CCA37CCAAABC823FFCE6C6125F4C834CFC493277F7F2C3D8E4A1D8D2A4DE861395474E670FC78273A1C7CEB8D1A18036DFD88C35598FA481EF1ED1D37D84A307325686D2E1A735ABFF7C7E3FD903FB168CA943F89D034F34B0E4F89BCAB7CF39483D9DA47777F835D6895FEA841719963906EE4B5EC08ACF9E1A77FE13DF860F8B06380A866A0B0FD39D90D819F439E0A79160C9CDCEDBA0250358FFD96EEAA2E13B4DE932A744B79065E509B0C9329AB055C079F15D482F623822361C93A383E571035D9F489118D85</code></pre>
<pre><code>g_b = 31E2FE823C46A7A7AD37A807D74635A473C2BBFE73C00261D190B10AC27F65107CCB4525169C418516B721B2CE33675C26FDF584DB3CF3637F02B559E84EF49472DA402D94BF5B58E17ADD1C11D45567FA67E3F15242F380B50C53F806AC764B3E4725E685ADB52A0EF2D272F750931B327670D29F273802DB7C161BA8A34454026AA687694A11459D79AE92F9678D110E33E561B31C1F421BC00EBD0BA0AD735FB77732ED37308ADE5CD069D13BAD0D6B22214D04DFE804EA44E3A5418B0AB8A04D32B6CBBE32714E2596F4E7DCBE4EB8F9124C20E467D4B3256F8E80F06B9009BC40C1E387FC8DC38A8A50832670F37C8921E3D84FE15BDD58F677346354D1</code></pre>
<!-- end g_b -->
<h6>7.1) generation of encrypted_data</h6>
<!-- start client_DH_inner_data -->
<p>Generated payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 54 B6 43 66 2F AF 63 7D 5B C0 6E B2 EF 1C 5B 3D
0010 | 62 04 7E 51 F6 9E 6A 9C E3 D2 E7 19 66 40 68 B0
0020 | 69 FE 4E 8E 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | A2 59 64 8B 8D 9C C2 B1 F9 BA 6A A8 F8 23 D8 44
0040 | 22 B5 E9 C0 79 09 68 45 D3 73 EC 7D 7E AA B4 DD
0050 | 5D 4E E5 38 FE 2F ED 00 7A 88 8F E8 7D 4F 37 32
0060 | E2 43 41 BE 1E 0D 2C CA 37 CC AA AB C8 23 FF CE
0070 | 6C 61 25 F4 C8 34 CF C4 93 27 7F 7F 2C 3D 8E 4A
0080 | 1D 8D 2A 4D E8 61 39 54 74 E6 70 FC 78 27 3A 1C
0090 | 7C EB 8D 1A 18 03 6D FD 88 C3 55 98 FA 48 1E F1
00A0 | ED 1D 37 D8 4A 30 73 25 68 6D 2E 1A 73 5A BF F7
00B0 | C7 E3 FD 90 3F B1 68 CA 94 3F 89 D0 34 F3 4B 0E
00C0 | 4F 89 BC AB 7C F3 94 83 D9 DA 47 77 7F 83 5D 68
00D0 | 95 FE A8 41 71 99 63 90 6E E4 B5 EC 08 AC F9 E1
00E0 | A7 7F E1 3D F8 60 F8 B0 63 80 A8 66 A0 B0 FD 39
00F0 | D9 0D 81 9F 43 9E 0A 79 16 0C 9C DC ED BA 02 50
0100 | 35 8F FD 96 EE AA 2E 13 B4 DE 93 2A 74 4B 79 06
0110 | 5E 50 9B 0C 93 29 AB 05 5C 07 9F 15 D4 82 F6 23
0120 | 82 23 61 C9 3A 38 3E 57 10 35 D9 F4 89 11 8D 85</code></pre>
<pre><code>0000 | 54 B6 43 66 28 72 1A 8E C4 CD 99 F8 A9 B9 5B DB
0010 | 5A 5F D8 30 71 7F 48 CF 46 34 E2 07 D3 21 B7 A6
0020 | A0 50 39 82 00 00 00 00 00 00 00 00 FE 00 01 00
0030 | 31 E2 FE 82 3C 46 A7 A7 AD 37 A8 07 D7 46 35 A4
0040 | 73 C2 BB FE 73 C0 02 61 D1 90 B1 0A C2 7F 65 10
0050 | 7C CB 45 25 16 9C 41 85 16 B7 21 B2 CE 33 67 5C
0060 | 26 FD F5 84 DB 3C F3 63 7F 02 B5 59 E8 4E F4 94
0070 | 72 DA 40 2D 94 BF 5B 58 E1 7A DD 1C 11 D4 55 67
0080 | FA 67 E3 F1 52 42 F3 80 B5 0C 53 F8 06 AC 76 4B
0090 | 3E 47 25 E6 85 AD B5 2A 0E F2 D2 72 F7 50 93 1B
00A0 | 32 76 70 D2 9F 27 38 02 DB 7C 16 1B A8 A3 44 54
00B0 | 02 6A A6 87 69 4A 11 45 9D 79 AE 92 F9 67 8D 11
00C0 | 0E 33 E5 61 B3 1C 1F 42 1B C0 0E BD 0B A0 AD 73
00D0 | 5F B7 77 32 ED 37 30 8A DE 5C D0 69 D1 3B AD 0D
00E0 | 6B 22 21 4D 04 DF E8 04 EA 44 E3 A5 41 8B 0A B8
00F0 | A0 4D 32 B6 CB BE 32 71 4E 25 96 F4 E7 DC BE 4E
0100 | B8 F9 12 4C 20 E4 67 D4 B3 25 6F 8E 80 F0 6B 90
0110 | 09 BC 40 C1 E3 87 FC 8D C3 8A 8A 50 83 26 70 F3
0120 | 7C 89 21 E3 D8 4F E1 5B DD 58 F6 77 34 63 54 D1</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;</code></pre>
<table class="table">
@ -658,19 +658,19 @@ answer = BA0D89B52FAF637D5BC06EB2EF1C5B3D62047E51F69E6A9CE3D2E719664068B069FE4E8
<tr>
<td>nonce</td>
<td>4, 16</td>
<td><code>2FAF637D5BC06EB2EF1C5B3D62047E51</code></td>
<td><code>28721A8EC4CD99F8A9B95BDB5A5FD830</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>20, 16</td>
<td><code>F69E6A9CE3D2E719664068B069FE4E8E</code></td>
<td><code>717F48CF4634E207D321B7A6A0503982</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>g_b</td>
<td>36, 260</td>
<td><code>FE000100A259648B8D9CC2B1F9BA6AA8</code> <code>F823D84422B5E9C079096845D373EC7D</code> <code>7EAAB4DD5D4EE538FE2FED007A888FE8</code> <code>7D4F3732E24341BE1E0D2CCA37CCAAAB</code> <code>C823FFCE6C6125F4C834CFC493277F7F</code> <code>2C3D8E4A1D8D2A4DE861395474E670FC</code> <code>78273A1C7CEB8D1A18036DFD88C35598</code> <code>FA481EF1ED1D37D84A307325686D2E1A</code> <code>735ABFF7C7E3FD903FB168CA943F89D0</code> <code>34F34B0E4F89BCAB7CF39483D9DA4777</code> <code>7F835D6895FEA841719963906EE4B5EC</code> <code>08ACF9E1A77FE13DF860F8B06380A866</code> <code>A0B0FD39D90D819F439E0A79160C9CDC</code> <code>EDBA0250358FFD96EEAA2E13B4DE932A</code> <code>744B79065E509B0C9329AB055C079F15</code> <code>D482F623822361C93A383E571035D9F4</code><br> <code>89118D85</code></td>
<td><code>FE00010031E2FE823C46A7A7AD37A807</code> <code>D74635A473C2BBFE73C00261D190B10A</code> <code>C27F65107CCB4525169C418516B721B2</code> <code>CE33675C26FDF584DB3CF3637F02B559</code> <code>E84EF49472DA402D94BF5B58E17ADD1C</code> <code>11D45567FA67E3F15242F380B50C53F8</code> <code>06AC764B3E4725E685ADB52A0EF2D272</code> <code>F750931B327670D29F273802DB7C161B</code> <code>A8A34454026AA687694A11459D79AE92</code> <code>F9678D110E33E561B31C1F421BC00EBD</code> <code>0BA0AD735FB77732ED37308ADE5CD069</code> <code>D13BAD0D6B22214D04DFE804EA44E3A5</code> <code>418B0AB8A04D32B6CBBE32714E2596F4</code> <code>E7DCBE4EB8F9124C20E467D4B3256F8E</code> <code>80F06B9009BC40C1E387FC8DC38A8A50</code> <code>832670F37C8921E3D84FE15BDD58F677</code><br> <code>346354D1</code></td>
<td>Single-byte prefix denoting length, a 256-byte (2048-bit) string, and zero bytes of padding</td>
</tr>
<tr>
@ -684,47 +684,47 @@ answer = BA0D89B52FAF637D5BC06EB2EF1C5B3D62047E51F69E6A9CE3D2E719664068B069FE4E8
<!-- end client_DH_inner_data -->
<p>The serialization of <em>Client_DH_Inner_Data</em> produces a string <strong>data</strong>. This is used to generate <strong>encrypted_data</strong> as specified in <a href="#7-client-computes-random-2048-bit-number-b-using-a-sufficient-amount-of-entropy-and-sends-the-server-a-message">step 6</a>, using the following inputs:</p>
<!-- start client_DH_inner_data_input -->
<pre><code>data = 54B643662FAF637D5BC06EB2EF1C5B3D62047E51F69E6A9CE3D2E719664068B069FE4E8E0000000000000000FE000100A259648B8D9CC2B1F9BA6AA8F823D84422B5E9C079096845D373EC7D7EAAB4DD5D4EE538FE2FED007A888FE87D4F3732E24341BE1E0D2CCA37CCAAABC823FFCE6C6125F4C834CFC493277F7F2C3D8E4A1D8D2A4DE861395474E670FC78273A1C7CEB8D1A18036DFD88C35598FA481EF1ED1D37D84A307325686D2E1A735ABFF7C7E3FD903FB168CA943F89D034F34B0E4F89BCAB7CF39483D9DA47777F835D6895FEA841719963906EE4B5EC08ACF9E1A77FE13DF860F8B06380A866A0B0FD39D90D819F439E0A79160C9CDCEDBA0250358FFD96EEAA2E13B4DE932A744B79065E509B0C9329AB055C079F15D482F623822361C93A383E571035D9F489118D85
padding = B7CE3116745C647F117D8ABF
tmp_aes_key = 91EEAB4AB17C4AF217B52B8A88DCE9BA718F0E0F749A18D608E707A02CB15B83
tmp_aes_iv = E18679D9BC148D5235CBD0A511AC2745B6591852402B750B62C44E63B3081C99</code></pre>
<pre><code>data = 54B6436628721A8EC4CD99F8A9B95BDB5A5FD830717F48CF4634E207D321B7A6A05039820000000000000000FE00010031E2FE823C46A7A7AD37A807D74635A473C2BBFE73C00261D190B10AC27F65107CCB4525169C418516B721B2CE33675C26FDF584DB3CF3637F02B559E84EF49472DA402D94BF5B58E17ADD1C11D45567FA67E3F15242F380B50C53F806AC764B3E4725E685ADB52A0EF2D272F750931B327670D29F273802DB7C161BA8A34454026AA687694A11459D79AE92F9678D110E33E561B31C1F421BC00EBD0BA0AD735FB77732ED37308ADE5CD069D13BAD0D6B22214D04DFE804EA44E3A5418B0AB8A04D32B6CBBE32714E2596F4E7DCBE4EB8F9124C20E467D4B3256F8E80F06B9009BC40C1E387FC8DC38A8A50832670F37C8921E3D84FE15BDD58F677346354D1
padding = 5CC4064BAFD1F5AAD4341D9E
tmp_aes_key = F12B07E505018CEF441EC420E14670A2D76C55D01508ED3E0CA30463E513172B
tmp_aes_iv = 683098AF19C8B22A4C3BF3CA68BEC24BC944B62BD94EAC23AADABF7B56849E7F</code></pre>
<!-- end client_DH_inner_data_input -->
<p>Process:</p>
<pre><code>data_with_hash := SHA1(data) + data + padding (0-15 random bytes such that total length is divisible by 16)
encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);</code></pre>
<p>Output:</p>
<!-- start client_DH_inner_data_output -->
<pre><code>encrypted_data = 516A435DC614F1DE23344C2F119175F514E879A93A05E8989C31817EE3EAB235ABBDDD2ED8A15C3656571D533D0155DBA0DEFC5E8942E36703C6EF2863907D2A2932B7C592018A7338391DAE3ABAFD7268AFAB4569F7872B9EA00370C9DE70B0A48EB82613A0F1618F631D6555DDFAF4CC1FFBC56A2CAA24D788F503821BEF69FB53D510450E2DA50ABDEE509DD4B09EFBEBAEB227257E1721B0961749F697DD1D7CEE0E52A1687D4AAE57A2A202D742DE195AB731D9BFF42D103541EA8735985621202E8D703C7EFD6A2FD78124E148247A2A177AD4FC3CC1D217D63953449F8DFF396F304285CD515B1876643D02FABF4C6281E03B359213085589F2363D8C2DCAED99A4803A80269A513C0F32340CFFD17EE07647306E03537155B034B9CA001493F81E49ED5774DCCDBCF8E08D7EAAA3D60856C0D9721C02BA298F52B3F69274E45A916DD630F669870DD611EE54</code></pre>
<pre><code>encrypted_data = C53460B35E1B0E9202D41310487197DFDB1E1A5BF3ED6FC4758B2FCB7587FA63E5B14EF202493E2A59EA09C8547927243F16EE93C3F2EB0277FC6C723BE7C53CE5571741EB192FDEC9ECD38D19490647E28B295149C1A9C8CA064B7C7ED6A05E0BDCF339B5CCFC9262721794DE5136C0441C2F130B7BF548692F252E47D9DD37FBCF08A4A1ECE99991EFAAA2869B159DF72EDB286546DBFB805DD19722BB5683F3A424B2CE0FC1A6CAEC4CA01568ADFC1CBDBB1F75260C9E065B13F33A6E7ECD5283E96B6664BC546EA0531EC210B7F8EC4C9BA760A84E5E2D95D52F1A83A2C1DA0C512DB8F30E8B4449DDE7C028D34BC54C05271B3F72C3F3FC60438B76F7E51CB1E7DCE53DCFE23686E39E9C4A9954A1784C2EE4F8E70520D2F2805600BDFF733ED7DD6EA619F74BFB4BA2AD24F12D07416CB4F59FB50CB1E59C244ADC44E897870C71EF5C24E89BE1D56F94F071F7</code></pre>
<!-- end client_DH_inner_data_output -->
<p>The length of the final string is 336 bytes.</p>
<h6>7.2) set_client_DH_params query</h6>
<!-- start set_client_DH_params -->
<p>Sent payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 88 67 0C 00 B9 B8 30 67
0010 | 78 01 00 00 1F 5F 04 F5 2F AF 63 7D 5B C0 6E B2
0020 | EF 1C 5B 3D 62 04 7E 51 F6 9E 6A 9C E3 D2 E7 19
0030 | 66 40 68 B0 69 FE 4E 8E FE 50 01 00 51 6A 43 5D
0040 | C6 14 F1 DE 23 34 4C 2F 11 91 75 F5 14 E8 79 A9
0050 | 3A 05 E8 98 9C 31 81 7E E3 EA B2 35 AB BD DD 2E
0060 | D8 A1 5C 36 56 57 1D 53 3D 01 55 DB A0 DE FC 5E
0070 | 89 42 E3 67 03 C6 EF 28 63 90 7D 2A 29 32 B7 C5
0080 | 92 01 8A 73 38 39 1D AE 3A BA FD 72 68 AF AB 45
0090 | 69 F7 87 2B 9E A0 03 70 C9 DE 70 B0 A4 8E B8 26
00A0 | 13 A0 F1 61 8F 63 1D 65 55 DD FA F4 CC 1F FB C5
00B0 | 6A 2C AA 24 D7 88 F5 03 82 1B EF 69 FB 53 D5 10
00C0 | 45 0E 2D A5 0A BD EE 50 9D D4 B0 9E FB EB AE B2
00D0 | 27 25 7E 17 21 B0 96 17 49 F6 97 DD 1D 7C EE 0E
00E0 | 52 A1 68 7D 4A AE 57 A2 A2 02 D7 42 DE 19 5A B7
00F0 | 31 D9 BF F4 2D 10 35 41 EA 87 35 98 56 21 20 2E
0100 | 8D 70 3C 7E FD 6A 2F D7 81 24 E1 48 24 7A 2A 17
0110 | 7A D4 FC 3C C1 D2 17 D6 39 53 44 9F 8D FF 39 6F
0120 | 30 42 85 CD 51 5B 18 76 64 3D 02 FA BF 4C 62 81
0130 | E0 3B 35 92 13 08 55 89 F2 36 3D 8C 2D CA ED 99
0140 | A4 80 3A 80 26 9A 51 3C 0F 32 34 0C FF D1 7E E0
0150 | 76 47 30 6E 03 53 71 55 B0 34 B9 CA 00 14 93 F8
0160 | 1E 49 ED 57 74 DC CD BC F8 E0 8D 7E AA A3 D6 08
0170 | 56 C0 D9 72 1C 02 BA 29 8F 52 B3 F6 92 74 E4 5A
0180 | 91 6D D6 30 F6 69 87 0D D6 11 EE 54</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 14 61 06 00 E2 88 33 67
0010 | 78 01 00 00 1F 5F 04 F5 28 72 1A 8E C4 CD 99 F8
0020 | A9 B9 5B DB 5A 5F D8 30 71 7F 48 CF 46 34 E2 07
0030 | D3 21 B7 A6 A0 50 39 82 FE 50 01 00 C5 34 60 B3
0040 | 5E 1B 0E 92 02 D4 13 10 48 71 97 DF DB 1E 1A 5B
0050 | F3 ED 6F C4 75 8B 2F CB 75 87 FA 63 E5 B1 4E F2
0060 | 02 49 3E 2A 59 EA 09 C8 54 79 27 24 3F 16 EE 93
0070 | C3 F2 EB 02 77 FC 6C 72 3B E7 C5 3C E5 57 17 41
0080 | EB 19 2F DE C9 EC D3 8D 19 49 06 47 E2 8B 29 51
0090 | 49 C1 A9 C8 CA 06 4B 7C 7E D6 A0 5E 0B DC F3 39
00A0 | B5 CC FC 92 62 72 17 94 DE 51 36 C0 44 1C 2F 13
00B0 | 0B 7B F5 48 69 2F 25 2E 47 D9 DD 37 FB CF 08 A4
00C0 | A1 EC E9 99 91 EF AA A2 86 9B 15 9D F7 2E DB 28
00D0 | 65 46 DB FB 80 5D D1 97 22 BB 56 83 F3 A4 24 B2
00E0 | CE 0F C1 A6 CA EC 4C A0 15 68 AD FC 1C BD BB 1F
00F0 | 75 26 0C 9E 06 5B 13 F3 3A 6E 7E CD 52 83 E9 6B
0100 | 66 64 BC 54 6E A0 53 1E C2 10 B7 F8 EC 4C 9B A7
0110 | 60 A8 4E 5E 2D 95 D5 2F 1A 83 A2 C1 DA 0C 51 2D
0120 | B8 F3 0E 8B 44 49 DD E7 C0 28 D3 4B C5 4C 05 27
0130 | 1B 3F 72 C3 F3 FC 60 43 8B 76 F7 E5 1C B1 E7 DC
0140 | E5 3D CF E2 36 86 E3 9E 9C 4A 99 54 A1 78 4C 2E
0150 | E4 F8 E7 05 20 D2 F2 80 56 00 BD FF 73 3E D7 DD
0160 | 6E A6 19 F7 4B FB 4B A2 AD 24 F1 2D 07 41 6C B4
0170 | F5 9F B5 0C B1 E5 9C 24 4A DC 44 E8 97 87 0C 71
0180 | EF 5C 24 E8 9B E1 D5 6F 94 F0 71 F7</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;</code></pre>
<table class="table">
@ -746,7 +746,7 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>88670C00B9B83067</code></td>
<td><code>14610600E2883367</code></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>
@ -764,19 +764,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>2FAF637D5BC06EB2EF1C5B3D62047E51</code></td>
<td><code>28721A8EC4CD99F8A9B95BDB5A5FD830</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>F69E6A9CE3D2E719664068B069FE4E8E</code></td>
<td><code>717F48CF4634E207D321B7A6A0503982</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>encrypted_data</td>
<td>56, 340</td>
<td><code>FE500100516A435DC614F1DE23344C2F</code> <code>119175F514E879A93A05E8989C31817E</code> <code>E3EAB235ABBDDD2ED8A15C3656571D53</code> <code>3D0155DBA0DEFC5E8942E36703C6EF28</code> <code>63907D2A2932B7C592018A7338391DAE</code> <code>3ABAFD7268AFAB4569F7872B9EA00370</code> <code>C9DE70B0A48EB82613A0F1618F631D65</code> <code>55DDFAF4CC1FFBC56A2CAA24D788F503</code> <code>821BEF69FB53D510450E2DA50ABDEE50</code> <code>9DD4B09EFBEBAEB227257E1721B09617</code> <code>49F697DD1D7CEE0E52A1687D4AAE57A2</code> <code>A202D742DE195AB731D9BFF42D103541</code> <code>EA8735985621202E8D703C7EFD6A2FD7</code> <code>8124E148247A2A177AD4FC3CC1D217D6</code> <code>3953449F8DFF396F304285CD515B1876</code> <code>643D02FABF4C6281E03B359213085589</code> <code>F2363D8C2DCAED99A4803A80269A513C</code> <code>0F32340CFFD17EE07647306E03537155</code> <code>B034B9CA001493F81E49ED5774DCCDBC</code> <code>F8E08D7EAAA3D60856C0D9721C02BA29</code> <code>8F52B3F69274E45A916DD630F669870D</code><br> <code>D611EE54</code></td>
<td><code>FE500100C53460B35E1B0E9202D41310</code> <code>487197DFDB1E1A5BF3ED6FC4758B2FCB</code> <code>7587FA63E5B14EF202493E2A59EA09C8</code> <code>547927243F16EE93C3F2EB0277FC6C72</code> <code>3BE7C53CE5571741EB192FDEC9ECD38D</code> <code>19490647E28B295149C1A9C8CA064B7C</code> <code>7ED6A05E0BDCF339B5CCFC9262721794</code> <code>DE5136C0441C2F130B7BF548692F252E</code> <code>47D9DD37FBCF08A4A1ECE99991EFAAA2</code> <code>869B159DF72EDB286546DBFB805DD197</code> <code>22BB5683F3A424B2CE0FC1A6CAEC4CA0</code> <code>1568ADFC1CBDBB1F75260C9E065B13F3</code> <code>3A6E7ECD5283E96B6664BC546EA0531E</code> <code>C210B7F8EC4C9BA760A84E5E2D95D52F</code> <code>1A83A2C1DA0C512DB8F30E8B4449DDE7</code> <code>C028D34BC54C05271B3F72C3F3FC6043</code> <code>8B76F7E51CB1E7DCE53DCFE23686E39E</code> <code>9C4A9954A1784C2EE4F8E70520D2F280</code> <code>5600BDFF733ED7DD6EA619F74BFB4BA2</code> <code>AD24F12D07416CB4F59FB50CB1E59C24</code> <code>4ADC44E897870C71EF5C24E89BE1D56F</code><br> <code>94F071F7</code></td>
<td>Encrypted client_DH_inner_data generated previously, serialized as a TL byte string</td>
</tr>
</tbody>
@ -785,17 +785,17 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<h5><a class="anchor" href="#8-auth-key-generation" id="8-auth-key-generation" name="8-auth-key-generation"><i class="anchor-icon"></i></a>8) Auth key generation</h5>
<p>The client computes the auth_key using formula <code>g_a^b mod dh_prime</code>:</p>
<!-- start auth_key -->
<pre><code>auth_key = 771D2DCA207E0C8E10CF07249AA7F92A4A722C03328B95B25322A7C94BFC74122E7722257EBDB2465D8B4173A07118E72A6518874257CC520DF24E91086E19A811B4F4D05DF146D15718F3CF6AE5C41308DAA9336A7A7ACC4DC839A84B3406FCA26A28D5D265EF00F0CA57729FD68C69F05E1DAE4DF0A02BB16DA7F1EB1F2521482558DAC42B6BC2E929CD59774CF3E0FD617919161A0D62B7ECBAC94BADFEB3959C5DE9EB40B7CE02E58EE62DCEFA0D98786134DA6CA7667D17737FCACD184C3836CEB27F8F160C07089111040C547BBAA7DBA08FA6BCD5354CBC77B137BB778DB5797CA6669F713AC489132D38E25E3B21FE0C711DA63E3180C41D098AF65B</code></pre>
<pre><code>auth_key = 13A90127DB37DB45A823B8ED894849E8FC5ED9A6805E00EF8CFC5FBCD04FEDCE077937C7A74328321BE620B10EDC05C884A1F9414277A9E9C325787ADA0A0399ACB98BCF6C3383B559E0EBA30F6EF5614E214FC8D0CD399456541D2E5EC0AED92A0F2CA2025F3B291009069F3A994BCE011D312EBBBC57081AF04660777B087C11070E29B5E190DA3C2CD5A4C3B5890BCD0DA6BACCDA745A0E99B58B327150D5BB63770794198AD5056676E0C19F6EF10163F018E64DDFAAEA002124B361761358A63B5B29DFE3E1E66F1441B725156FB1DABE444E576F1F8D28AE611903B2C5BF1158F2B36F702440A617B52F72122BE3039702E36138AAF50567F8794E3C7D</code></pre>
<!-- end auth_key -->
<h5><a class="anchor" href="#9-final-server-reply" id="9-final-server-reply" name="9-final-server-reply"><i class="anchor-icon"></i></a>9) Final server reply</h5>
<p>The server verifies and confirms that auth_key_hash is unique: since it's unique, it replies with the following:</p>
<!-- start dh_gen_ok -->
<p>Received payload (excluding transport headers/trailers):</p>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 E0 27 E0 BA B8 30 67
0010 | 34 00 00 00 34 F7 CB 3B 2F AF 63 7D 5B C0 6E B2
0020 | EF 1C 5B 3D 62 04 7E 51 F6 9E 6A 9C E3 D2 E7 19
0030 | 66 40 68 B0 69 FE 4E 8E ED 09 73 F6 AA DD F3 96
0040 | BD CE 3E B1 C4 B6 6D E1</code></pre>
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 98 6C 59 E4 88 33 67
0010 | 34 00 00 00 34 F7 CB 3B 28 72 1A 8E C4 CD 99 F8
0020 | A9 B9 5B DB 5A 5F D8 30 71 7F 48 CF 46 34 E2 07
0030 | D3 21 B7 A6 A0 50 39 82 05 7A 67 C6 69 0F DF 67
0040 | B2 F1 49 27 FE A2 E3 22</code></pre>
<p>Payload (de)serialization:</p>
<pre><code>dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;</code></pre>
<table class="table">
@ -817,7 +817,7 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>message_id</td>
<td>8, 8</td>
<td><code>01E027E0BAB83067</code></td>
<td><code>01986C59E4883367</code></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>
@ -835,19 +835,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
<tr>
<td>nonce</td>
<td>24, 16</td>
<td><code>2FAF637D5BC06EB2EF1C5B3D62047E51</code></td>
<td><code>28721A8EC4CD99F8A9B95BDB5A5FD830</code></td>
<td>Value generated by client in Step 1</td>
</tr>
<tr>
<td>server_nonce</td>
<td>40, 16</td>
<td><code>F69E6A9CE3D2E719664068B069FE4E8E</code></td>
<td><code>717F48CF4634E207D321B7A6A0503982</code></td>
<td>Value received from server in Step 2</td>
</tr>
<tr>
<td>new_nonce_hash1</td>
<td>56, 16</td>
<td><code>ED0973F6AADDF396BDCE3EB1C4B66DE1</code></td>
<td><code>057A67C6690FDF67B2F14927FEA2E322</code></td>
<td>The 128 lower-order bits of SHA1 of the byte string derived from the <code>new_nonce</code> string by adding a single byte with the value of 1, 2, or 3, and followed by another 8 bytes with <code>auth_key_aux_hash</code>. Different values are required to prevent an intruder from changing server response dh_gen_ok into dh_gen_retry.</td>
</tr>
</tbody>

View file

@ -102,7 +102,7 @@
</ul>
<ul>
<li><a href="javascript:DemoApp.setEmojiStatus(this, '5213305508034783384');">Set emoji status</a> <span></span></li>
<li><a href="javascript:DemoApp.setEmojiStatus(this, '5213305508034783384', 1731433104);">Set emoji status</a> for 5 min <span></span></li>
<li><a href="javascript:DemoApp.setEmojiStatus(this, '5213305508034783384', 1731433622);">Set emoji status</a> for 5 min <span></span></li>
<li><a href="javascript:DemoApp.setEmojiStatus(this, '123');">Set emoji status</a> (invalid id) <span></span></li>
</ul>
<p>Test permissions:</p>