mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2025-01-05 18:38:19 +01:00
Update content of files
This commit is contained in:
parent
2486614b80
commit
61ef9d75bd
4 changed files with 277 additions and 227 deletions
|
@ -499,12 +499,8 @@ Note that the stickerset can be fetched using <a href="/constructor/inputSticker
|
|||
<h4><a class="anchor" href="#stories-changelog-user-id" id="stories-changelog-user-id" name="stories-changelog-user-id"><i class="anchor-icon"></i></a><code>stories_changelog_user_id</code></h4>
|
||||
<p>ID of the official Telegram user that will post stories about new Telegram features: stories posted by this user should be shown on the <a href="/api/stories#watching-stories">active or active and hidden stories bar</a> just like for contacts, even if the user was removed from the contact list. (integer, defaults to <code>777000</code>)</p>
|
||||
<h4><a class="anchor" href="#stories-entities" id="stories-entities" name="stories-entities"><i class="anchor-icon"></i></a><code>stories_entities</code></h4>
|
||||
<p>Whether <a href="/api/entities">styled text entities</a> in story text captions can be used by all users (<code>enabled</code>), only [Premium](/api/premium users) (<code>premium</code>), or no one (<code>disabled</code>). (string)</p>
|
||||
<p>Whether <a href="/api/entities">styled text entities</a> and links in story text captions can be used by all users (<code>enabled</code>), only [Premium](/api/premium users) (<code>premium</code>), or no one (<code>disabled</code>). (string)</p>
|
||||
<p>This field is used both when posting stories, to indicate to the user whether they can use entities, and when viewing stories, to hide entities (client-side) on stories posted by users whose <a href="/api/premium">Premium</a> subscription has expired (if <code>stories_entities == "premium"</code> and <a href="/constructor/user">user</a>.<code>premium</code> is not set, or if <code>stories_entities == "disabled"</code>). </p>
|
||||
<h4><a class="anchor" href="#stories-all-hidden" id="stories-all-hidden" name="stories-all-hidden"><i class="anchor-icon"></i></a><code>stories_all_hidden</code></h4>
|
||||
<h4><a class="anchor" href="#stories-export-nopublic-link" id="stories-export-nopublic-link" name="stories-export-nopublic-link"><i class="anchor-icon"></i></a><code>stories_export_nopublic_link</code></h4>
|
||||
<h4><a class="anchor" href="#stories-suggested-reactions-limit-default" id="stories-suggested-reactions-limit-default" name="stories-suggested-reactions-limit-default"><i class="anchor-icon"></i></a><code>stories_suggested_reactions_limit_default</code></h4>
|
||||
<h4><a class="anchor" href="#stories-suggested-reactions-limit-premium" id="stories-suggested-reactions-limit-premium" name="stories-suggested-reactions-limit-premium"><i class="anchor-icon"></i></a><code>stories_suggested_reactions_limit_premium</code></h4>
|
||||
<h3><a class="anchor" href="#suggestions" id="suggestions" name="suggestions"><i class="anchor-icon"></i></a>Suggestions</h3>
|
||||
<p>The API can return a set of useful suggestions for users of graphical clients. </p>
|
||||
<h4><a class="anchor" href="#basic-suggestions" id="basic-suggestions" name="basic-suggestions"><i class="anchor-icon"></i></a>Basic suggestions</h4>
|
||||
|
|
|
@ -77,22 +77,64 @@ Clicking on this button in the settings, clicking on the <a href="#badge">badge<
|
|||
<p><a href="/method/help.getAppConfig">help.getAppConfig</a> will return a list of Premium feature identifiers in the <a href="/api/config#premium-promo-order"><code>premium_promo_order</code> appConfig field</a>: the modal should contain a row for each returned feature, ordered as specified in the returned array. </p>
|
||||
<p>Possible feature identifiers:</p>
|
||||
<ul>
|
||||
<li><code>stories</code> - <a href="/api/stories">Stories</a> posted by Premium users are shown first to users, can have custom TTLs, longer captions, links and formatting; Premium users can also download non-protected stories, activate <a href="/api/stories#stealth-mode">stealth mode</a>, and much more! See the <a href="/api/stories">stories documentation »</a> for more information.</li>
|
||||
<li><code>double_limits</code> - Clicking on this entry should open a secondary popup with a list of the <a href="#premium-limits">improved Premium limits »</a>.</li>
|
||||
<li><code>more_upload</code> - Premium users can upload bigger files, as specified by the <a href="/api/config#upload-max-fileparts-default">upload_max_fileparts_default</a> vs <a href="/api/config#upload-max-fileparts-premium">upload_max_fileparts_premium</a> config keys.</li>
|
||||
<li><code>faster_download</code> - Premium users have no download speed limits.</li>
|
||||
<li><code>voice_to_text</code> - Premium users can <a href="/api/transcribe">transcribe voice messages</a>.</li>
|
||||
<li><code>translations</code> - Premium users can enable <a href="/api/translation">real-time chat translation</a>.</li>
|
||||
<li><code>no_ads</code> - Premium users see no <a href="/api/sponsored-messages">sponsored messages</a>.</li>
|
||||
<li><code>unique_reactions</code> - Premium users have access to more <a href="/api/reactions">message reactions</a>.</li>
|
||||
<li><code>premium_stickers</code> - Premium users have access to premium <a href="/api/stickers">stickersets</a>.</li>
|
||||
<li><code>animated_emoji</code> - Premium users can send custom <a href="/api/custom-emoji">animated emojis</a>.</li>
|
||||
<li><code>advanced_chat_management</code> - Premium users can <a href="/api/folders">reorder the default folder</a>, auto-archive and hide new chats from non-contacts.</li>
|
||||
<li><code>profile_badge</code> - Premium users have a <a href="#badge">badge</a> next to their name, showing that they are helping support Telegram.</li>
|
||||
<li><code>animated_userpics</code> - <a href="/api/files#animated-profile-pictures">Animated profile pictures</a> of Premium users will play in-chat and when browsing the dialog list.</li>
|
||||
<li><code>app_icons</code> - Premium users can change the default icon of the Telegram app.</li>
|
||||
<li><code>infinite_reactions</code> - Premium users can use <a href="/api/custom-emoji">custom emojis</a> when <a href="/api/reactions">reacting to messages</a>.</li>
|
||||
<li><code>emoji_status</code> - Premium users can set a <a href="/api/emoji-status">status emoji</a>.</li>
|
||||
<li>
|
||||
<p><code>stories</code> - Premium users have various <a href="/api/stories">Story</a>-related improvements:</p>
|
||||
<ul>
|
||||
<li>Stories posted by Premium users are shown first to users when fetching the list of active stories with <a href="/method/stories.getAllStories">stories.getAllStories »</a>. </li>
|
||||
<li>Premium users can activate <a href="/api/stories#stealth-mode">stealth mode »</a></li>
|
||||
<li>Premium users can <a href="/api/stories#fetching-the-viewer-list">fetch the full viewer list of stories, even after they expire »</a></li>
|
||||
<li>Premium users can set <a href="/api/stories">custom expiration options when posting stories »</a></li>
|
||||
<li>Premium users can post stories with longer captions, as specified by the <a href="/api/config#story-caption-length-limit-default"><code>story_caption_length_limit_*</code> »</a> config keys.</li>
|
||||
<li>Premium users can <a href="/api/entities">styled text entities</a> and links in story captions, as specified by the <a href="/api/config#stories-entities">stories_entities »</a> config key.</li>
|
||||
<li>Premium users can download non-protected stories.</li>
|
||||
</ul>
|
||||
<p>See the <a href="/api/stories">stories documentation »</a> for more information on stories.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>double_limits</code> - Clicking on this entry should open a secondary popup with a list of the <a href="#premium-limits">improved Premium limits »</a>.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>more_upload</code> - Premium users can upload bigger files, as specified by the <a href="/api/config#upload-max-fileparts-default">upload_max_fileparts_default</a> vs <a href="/api/config#upload-max-fileparts-premium">upload_max_fileparts_premium</a> config keys.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>faster_download</code> - Premium users have no download speed limits.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>voice_to_text</code> - Premium users can <a href="/api/transcribe">transcribe voice messages</a>.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>translations</code> - Premium users can enable <a href="/api/translation">real-time chat translation</a>.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>no_ads</code> - Premium users see no <a href="/api/sponsored-messages">sponsored messages</a>.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>unique_reactions</code> - Premium users have access to more <a href="/api/reactions">message reactions</a>.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>premium_stickers</code> - Premium users have access to premium <a href="/api/stickers">stickersets</a>.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>animated_emoji</code> - Premium users can send custom <a href="/api/custom-emoji">animated emojis</a>.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>advanced_chat_management</code> - Premium users can <a href="/api/folders">reorder the default folder</a>, auto-archive and hide new chats from non-contacts.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>profile_badge</code> - Premium users have a <a href="#badge">badge</a> next to their name, showing that they are helping support Telegram.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>animated_userpics</code> - <a href="/api/files#animated-profile-pictures">Animated profile pictures</a> of Premium users will play in-chat and when browsing the dialog list.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>app_icons</code> - Premium users can change the default icon of the Telegram app.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>infinite_reactions</code> - Premium users can use <a href="/api/custom-emoji">custom emojis</a> when <a href="/api/reactions">reacting to messages</a>.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>emoji_status</code> - Premium users can set a <a href="/api/emoji-status">status emoji</a>.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p>The <a href="/constructor/help.premiumPromo">help.premiumPromo</a> constructor returned by <a href="/method/help.getPremiumPromo">help.getPremiumPromo</a> contains various info about the subscription, as described in the <a href="/constructor/help.premiumPromo">constructor page</a>.</p>
|
||||
<h4><a class="anchor" href="#premium-limits" id="premium-limits" name="premium-limits"><i class="anchor-icon"></i></a>Premium limits</h4>
|
||||
|
@ -110,6 +152,8 @@ Clicking on this button in the settings, clicking on the <a href="#badge">badge<
|
|||
<li><code>channels_public_limit_*</code> - The maximum number of public <a href="/api/channel">channels or supergroups</a> a user may create.</li>
|
||||
<li><code>caption_length_limit_*</code> - The maximum UTF-8 length of media captions.</li>
|
||||
<li><code>about_length_limit_*</code> - The maximum UTF-8 length of user bios.</li>
|
||||
<li><code>chatlist_invites_limit_*</code> - Maximum number of per-folder <a href="/api/links#chat-folder-links">chat folder deep links »</a> that can be created.</li>
|
||||
<li><code>chatlists_joined_limit_*</code> - Maximum number of <a href="/api/links#chat-folder-links">shareable folders</a> a user may have. </li>
|
||||
</ul>
|
||||
<h4><a class="anchor" href="#badge" id="badge" name="badge"><i class="anchor-icon"></i></a>Badge</h4>
|
||||
<p>Users with a Telegram Premium subscription (<a href="/constructor/user">user</a>.<code>premium</code> is set) should have a Telegram Premium badge next to their name. </p>
|
||||
|
|
|
@ -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 58 5B 0E 00 35 39 6A 65
|
||||
0010 | 14 00 00 00 F1 8E 7E BE F8 21 AC 0F 4F D4 CE AA
|
||||
0020 | D0 13 3F E2 44 9F 86 D4</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 14 84 07 00 89 41 6A 65
|
||||
0010 | 14 00 00 00 F1 8E 7E BE C2 8F 15 55 BD 72 6E 6D
|
||||
0020 | 31 75 6E 83 F8 5D A7 39</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>585B0E0035396A65</code></td>
|
||||
<td><code>1484070089416A65</code></td>
|
||||
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -95,7 +95,7 @@
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>F821AC0F4FD4CEAAD0133FE2449F86D4</code></td>
|
||||
<td><code>C28F1555BD726E6D31756E83F85DA739</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 F2 74 35 39 6A 65
|
||||
0010 | A8 00 00 00 63 24 16 05 F8 21 AC 0F 4F D4 CE AA
|
||||
0020 | D0 13 3F E2 44 9F 86 D4 90 99 8E 8A AD 0D A1 6E
|
||||
0030 | 3B 99 50 BF 5A 7A E8 99 08 26 97 BF A6 44 87 25
|
||||
0040 | CD 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 3C 05 6D 89 41 6A 65
|
||||
0010 | 5C 00 00 00 63 24 16 05 C2 8F 15 55 BD 72 6E 6D
|
||||
0020 | 31 75 6E 83 F8 5D A7 39 F0 08 06 90 63 A5 C6 AF
|
||||
0030 | 2F 54 CD DD 23 3E 76 7C 08 1B 86 E2 01 26 86 DB
|
||||
0040 | EF 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
|
||||
0050 | 35 5F C3 0B 21 6B E8 6C 02 2B B4 C3 85 FD 64 DE
|
||||
0060 | 85 1D 9D D0</code></pre>
|
||||
<p>Payload (de)serialization:</p>
|
||||
|
@ -132,13 +132,13 @@
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>01E4F27435396A65</code></td>
|
||||
<td><code>013C056D89416A65</code></td>
|
||||
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>message_length</td>
|
||||
<td>16, 4</td>
|
||||
<td><code>A8000000</code> (168 in decimal)</td>
|
||||
<td><code>5C000000</code> (92 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -150,19 +150,19 @@
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>F821AC0F4FD4CEAAD0133FE2449F86D4</code></td>
|
||||
<td><code>C28F1555BD726E6D31756E83F85DA739</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>90998E8AAD0DA16E3B9950BF5A7AE899</code></td>
|
||||
<td><code>F008069063A5C6AF2F54CDDD233E767C</code></td>
|
||||
<td>Server-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pq</td>
|
||||
<td>56, 12</td>
|
||||
<td><code>082697BFA6448725CD000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2780902015759754701</td>
|
||||
<td><code>081B86E2012686DBEF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1983521180472499183</td>
|
||||
<td>Single-byte prefix denoting length, an 8-byte string, and three bytes of padding</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -208,22 +208,22 @@
|
|||
<h4><a class="anchor" href="#proof-of-work" id="proof-of-work" name="proof-of-work"><i class="anchor-icon"></i></a>Proof of work</h4>
|
||||
<h5><a class="anchor" href="#3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q" id="3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q" name="3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p < q.</h5>
|
||||
<!-- start pq -->
|
||||
<pre><code>pq = 2780902015759754701</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2780902015759754701 = 1447414093 * 1921289857</code></p>
|
||||
<pre><code>p = 1447414093
|
||||
q = 1921289857</code></pre>
|
||||
<pre><code>pq = 1983521180472499183</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1983521180472499183 = 1102309289 * 1799423447</code></p>
|
||||
<pre><code>p = 1102309289
|
||||
q = 1799423447</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 26 97 BF A6 44 87 25 CD 00 00 00
|
||||
0010 | 04 56 45 C9 4D 00 00 00 04 72 84 8E 81 00 00 00
|
||||
0020 | F8 21 AC 0F 4F D4 CE AA D0 13 3F E2 44 9F 86 D4
|
||||
0030 | 90 99 8E 8A AD 0D A1 6E 3B 99 50 BF 5A 7A E8 99
|
||||
0040 | 9B 92 95 7B 94 42 A5 1F 66 42 93 A0 F4 05 59 69
|
||||
0050 | 97 3B 7C 3A 0B DC AA 1C 63 80 6C 66 10 9C 62 9A
|
||||
<pre><code>0000 | 95 5F F5 A9 08 1B 86 E2 01 26 86 DB EF 00 00 00
|
||||
0010 | 04 41 B3 E7 A9 00 00 00 04 6B 41 05 D7 00 00 00
|
||||
0020 | C2 8F 15 55 BD 72 6E 6D 31 75 6E 83 F8 5D A7 39
|
||||
0030 | F0 08 06 90 63 A5 C6 AF 2F 54 CD DD 23 3E 76 7C
|
||||
0040 | 28 62 5E DE BB DE FA A3 96 71 02 93 12 0B 03 D6
|
||||
0050 | 5B 75 C3 F7 7F 2E 76 3F E5 7C 11 57 8E 46 8B 5A
|
||||
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 = 1921289857</code></pre>
|
|||
<tr>
|
||||
<td>pq</td>
|
||||
<td>4, 12</td>
|
||||
<td><code>082697BFA6448725CD000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2780902015759754701</td>
|
||||
<td><code>081B86E2012686DBEF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1983521180472499183</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>045645C94D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1447414093</td>
|
||||
<td><code>0441B3E7A9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1102309289</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>0472848E81000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1921289857</td>
|
||||
<td><code>046B4105D7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1799423447</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>F821AC0F4FD4CEAAD0133FE2449F86D4</code></td>
|
||||
<td><code>C28F1555BD726E6D31756E83F85DA739</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>48, 16</td>
|
||||
<td><code>90998E8AAD0DA16E3B9950BF5A7AE899</code></td>
|
||||
<td><code>F008069063A5C6AF2F54CDDD233E767C</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce</td>
|
||||
<td>64, 32</td>
|
||||
<td><code>9B92957B9442A51F664293A0F4055969</code> <code>973B7C3A0BDCAA1C63806C66109C629A</code></td>
|
||||
<td><code>28625EDEBBDEFAA396710293120B03D6</code> <code>5B75C3F77F2E763FE57C11578E468B5A</code></td>
|
||||
<td>Client-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -291,39 +291,39 @@ q = 1921289857</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 = 955FF5A9082697BFA6448725CD000000045645C94D0000000472848E81000000F821AC0F4FD4CEAAD0133FE2449F86D490998E8AAD0DA16E3B9950BF5A7AE8999B92957B9442A51F664293A0F4055969973B7C3A0BDCAA1C63806C66109C629A02000000
|
||||
random_padding_bytes = 6D401E9FBC96FFF4E42EDF9E0F36BCF77D54BDB15BE4CED43896165AA8D6D41FD257CF37C3B9D9C21321958145FD30F5A413735844EB201F00407CA8ECD915B039C899031F8A848510D8E40E87945742004BC3690545963F98B5DF6E</code></pre>
|
||||
<pre><code>data = 955FF5A9081B86E2012686DBEF0000000441B3E7A9000000046B4105D7000000C28F1555BD726E6D31756E83F85DA739F008069063A5C6AF2F54CDDD233E767C28625EDEBBDEFAA396710293120B03D65B75C3F77F2E763FE57C11578E468B5A02000000
|
||||
random_padding_bytes = 0B5C09C0EDD424CA0CF42B8D5A2008FEFF72518E00E41701157AC1155FDE95F56AE4E09B75BFFC25A591974E130AB5B5405B848D2E1FE5925A04B9F9D8D49441CEBFDF40E52B0DFD533F9F4E2B454E9090D7B5953F40A831ADE1334A</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 = 5186BB5EA844FCCAAE5CC77182122CB0069DA1A6F05E60A08D610C01019CDC01CE84E6B73EF460A8FDB7CDAA97688EEA443DEC2F78323E91F9A5EA74C64237937104841F7D3B5417784DFA5B4A47013DF87CA966D9087088133CC802F529CE414B393DC86F23A1A8A28F89358B5FE6E7E9B6CE9579DA0DA8E05EB8D346B8D9113ED89BE229BA4628A078FC44A77A9294C37FE5A410FB46604D130E2501E79F8AC5D1112EC638A6634CE958A575F5A095FD9EFF6DB439518A7124F1529D5FF8FE15BE776AE9F6F6255F4895DD5BB7CA0BF50861AFB9C51159EC3F92560C089A5B3E70353E33D081F51BC43F3B19F23C603A08207CCB8EE5AFA157C33FD3E9DD0E</code></pre>
|
||||
<pre><code>encrypted_data = B6CB01B9D20D1C5683ABDAA85CF69E219C71DBE0BD0E4A12EC88FF754EF425A198A26C03BC2B012441503CB21CCEAFBFA8042AB1BA9187E771EAAFF1C47C7584545CE57324A507509CBEE613510264205B6C56A82046BB41D89AD5F598C027B7196D2755CA13CB8614CCACA1BFD6586343186BE321D29D76946A683F8F2A175000A581677B2CBA64E342E79A126F61D94B28F3B8222B8CB1E85DC5EA031573B79C2D87AA5F9AF5FB91826B38A3FDBF8C4878A634F0084F7ACB26602B6E3C272DE4406AF4D2DEBCEA61FA200D23E1EC477368C05CE92B968410476F6E2C11DF305BA9C0C7CD385C4E8D14FDDCAB09ED1071AEB0DB20306569419B9AF6B04C99F9</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 5C 5B 0E 00 35 39 6A 65
|
||||
0010 | 40 01 00 00 BE E4 12 D7 F8 21 AC 0F 4F D4 CE AA
|
||||
0020 | D0 13 3F E2 44 9F 86 D4 90 99 8E 8A AD 0D A1 6E
|
||||
0030 | 3B 99 50 BF 5A 7A E8 99 04 56 45 C9 4D 00 00 00
|
||||
0040 | 04 72 84 8E 81 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 51 86 BB 5E A8 44 FC CA AE 5C C7 71
|
||||
0060 | 82 12 2C B0 06 9D A1 A6 F0 5E 60 A0 8D 61 0C 01
|
||||
0070 | 01 9C DC 01 CE 84 E6 B7 3E F4 60 A8 FD B7 CD AA
|
||||
0080 | 97 68 8E EA 44 3D EC 2F 78 32 3E 91 F9 A5 EA 74
|
||||
0090 | C6 42 37 93 71 04 84 1F 7D 3B 54 17 78 4D FA 5B
|
||||
00A0 | 4A 47 01 3D F8 7C A9 66 D9 08 70 88 13 3C C8 02
|
||||
00B0 | F5 29 CE 41 4B 39 3D C8 6F 23 A1 A8 A2 8F 89 35
|
||||
00C0 | 8B 5F E6 E7 E9 B6 CE 95 79 DA 0D A8 E0 5E B8 D3
|
||||
00D0 | 46 B8 D9 11 3E D8 9B E2 29 BA 46 28 A0 78 FC 44
|
||||
00E0 | A7 7A 92 94 C3 7F E5 A4 10 FB 46 60 4D 13 0E 25
|
||||
00F0 | 01 E7 9F 8A C5 D1 11 2E C6 38 A6 63 4C E9 58 A5
|
||||
0100 | 75 F5 A0 95 FD 9E FF 6D B4 39 51 8A 71 24 F1 52
|
||||
0110 | 9D 5F F8 FE 15 BE 77 6A E9 F6 F6 25 5F 48 95 DD
|
||||
0120 | 5B B7 CA 0B F5 08 61 AF B9 C5 11 59 EC 3F 92 56
|
||||
0130 | 0C 08 9A 5B 3E 70 35 3E 33 D0 81 F5 1B C4 3F 3B
|
||||
0140 | 19 F2 3C 60 3A 08 20 7C CB 8E E5 AF A1 57 C3 3F
|
||||
0150 | D3 E9 DD 0E</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 74 BF 0D 00 89 41 6A 65
|
||||
0010 | 40 01 00 00 BE E4 12 D7 C2 8F 15 55 BD 72 6E 6D
|
||||
0020 | 31 75 6E 83 F8 5D A7 39 F0 08 06 90 63 A5 C6 AF
|
||||
0030 | 2F 54 CD DD 23 3E 76 7C 04 41 B3 E7 A9 00 00 00
|
||||
0040 | 04 6B 41 05 D7 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 B6 CB 01 B9 D2 0D 1C 56 83 AB DA A8
|
||||
0060 | 5C F6 9E 21 9C 71 DB E0 BD 0E 4A 12 EC 88 FF 75
|
||||
0070 | 4E F4 25 A1 98 A2 6C 03 BC 2B 01 24 41 50 3C B2
|
||||
0080 | 1C CE AF BF A8 04 2A B1 BA 91 87 E7 71 EA AF F1
|
||||
0090 | C4 7C 75 84 54 5C E5 73 24 A5 07 50 9C BE E6 13
|
||||
00A0 | 51 02 64 20 5B 6C 56 A8 20 46 BB 41 D8 9A D5 F5
|
||||
00B0 | 98 C0 27 B7 19 6D 27 55 CA 13 CB 86 14 CC AC A1
|
||||
00C0 | BF D6 58 63 43 18 6B E3 21 D2 9D 76 94 6A 68 3F
|
||||
00D0 | 8F 2A 17 50 00 A5 81 67 7B 2C BA 64 E3 42 E7 9A
|
||||
00E0 | 12 6F 61 D9 4B 28 F3 B8 22 2B 8C B1 E8 5D C5 EA
|
||||
00F0 | 03 15 73 B7 9C 2D 87 AA 5F 9A F5 FB 91 82 6B 38
|
||||
0100 | A3 FD BF 8C 48 78 A6 34 F0 08 4F 7A CB 26 60 2B
|
||||
0110 | 6E 3C 27 2D E4 40 6A F4 D2 DE BC EA 61 FA 20 0D
|
||||
0120 | 23 E1 EC 47 73 68 C0 5C E9 2B 96 84 10 47 6F 6E
|
||||
0130 | 2C 11 DF 30 5B A9 C0 C7 CD 38 5C 4E 8D 14 FD DC
|
||||
0140 | AB 09 ED 10 71 AE B0 DB 20 30 65 69 41 9B 9A F6
|
||||
0150 | B0 4C 99 F9</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 = 6D401E9FBC96FFF4E42EDF9E0F36BCF77D54BDB15BE4CED43896165AA
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>5C5B0E0035396A65</code></td>
|
||||
<td><code>74BF0D0089416A65</code></td>
|
||||
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -363,25 +363,25 @@ random_padding_bytes = 6D401E9FBC96FFF4E42EDF9E0F36BCF77D54BDB15BE4CED43896165AA
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>F821AC0F4FD4CEAAD0133FE2449F86D4</code></td>
|
||||
<td><code>C28F1555BD726E6D31756E83F85DA739</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>90998E8AAD0DA16E3B9950BF5A7AE899</code></td>
|
||||
<td><code>F008069063A5C6AF2F54CDDD233E767C</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p</td>
|
||||
<td>56, 8</td>
|
||||
<td><code>045645C94D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1447414093</td>
|
||||
<td><code>0441B3E7A9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1102309289</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>0472848E81000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1921289857</td>
|
||||
<td><code>046B4105D7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1799423447</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 = 6D401E9FBC96FFF4E42EDF9E0F36BCF77D54BDB15BE4CED43896165AA
|
|||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>80, 260</td>
|
||||
<td><code>FE0001005186BB5EA844FCCAAE5CC771</code> <code>82122CB0069DA1A6F05E60A08D610C01</code> <code>019CDC01CE84E6B73EF460A8FDB7CDAA</code> <code>97688EEA443DEC2F78323E91F9A5EA74</code> <code>C64237937104841F7D3B5417784DFA5B</code> <code>4A47013DF87CA966D9087088133CC802</code> <code>F529CE414B393DC86F23A1A8A28F8935</code> <code>8B5FE6E7E9B6CE9579DA0DA8E05EB8D3</code> <code>46B8D9113ED89BE229BA4628A078FC44</code> <code>A77A9294C37FE5A410FB46604D130E25</code> <code>01E79F8AC5D1112EC638A6634CE958A5</code> <code>75F5A095FD9EFF6DB439518A7124F152</code> <code>9D5FF8FE15BE776AE9F6F6255F4895DD</code> <code>5BB7CA0BF50861AFB9C51159EC3F9256</code> <code>0C089A5B3E70353E33D081F51BC43F3B</code> <code>19F23C603A08207CCB8EE5AFA157C33F</code><br> <code>D3E9DD0E</code></td>
|
||||
<td><code>FE000100B6CB01B9D20D1C5683ABDAA8</code> <code>5CF69E219C71DBE0BD0E4A12EC88FF75</code> <code>4EF425A198A26C03BC2B012441503CB2</code> <code>1CCEAFBFA8042AB1BA9187E771EAAFF1</code> <code>C47C7584545CE57324A507509CBEE613</code> <code>510264205B6C56A82046BB41D89AD5F5</code> <code>98C027B7196D2755CA13CB8614CCACA1</code> <code>BFD6586343186BE321D29D76946A683F</code> <code>8F2A175000A581677B2CBA64E342E79A</code> <code>126F61D94B28F3B8222B8CB1E85DC5EA</code> <code>031573B79C2D87AA5F9AF5FB91826B38</code> <code>A3FDBF8C4878A634F0084F7ACB26602B</code> <code>6E3C272DE4406AF4D2DEBCEA61FA200D</code> <code>23E1EC477368C05CE92B968410476F6E</code> <code>2C11DF305BA9C0C7CD385C4E8D14FDDC</code> <code>AB09ED1071AEB0DB20306569419B9AF6</code><br> <code>B04C99F9</code></td>
|
||||
<td>Value generated above</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -402,47 +402,47 @@ random_padding_bytes = 6D401E9FBC96FFF4E42EDF9E0F36BCF77D54BDB15BE4CED43896165AA
|
|||
<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 18 53 2F 36 39 6A 65
|
||||
0010 | 98 02 00 00 5C 07 E8 D0 F8 21 AC 0F 4F D4 CE AA
|
||||
0020 | D0 13 3F E2 44 9F 86 D4 90 99 8E 8A AD 0D A1 6E
|
||||
0030 | 3B 99 50 BF 5A 7A E8 99 FE 50 02 00 8B EC 6E E4
|
||||
0040 | 68 5D 7C DF 09 24 96 27 E5 6C CC BD BD 31 3D 08
|
||||
0050 | 08 ED 66 5B D0 03 0E E5 71 05 95 36 E7 D5 31 A8
|
||||
0060 | 57 9E 3E EE AC 2F 56 6C 4D 0B 5B 29 C1 DF AD FC
|
||||
0070 | B0 22 86 9A 83 24 68 B3 ED 26 97 F1 FF EC 21 81
|
||||
0080 | 13 78 14 47 74 02 3A 40 F2 B6 64 5A 8D 2E BA AC
|
||||
0090 | EC 24 5D AB 53 5E 5E A2 73 8D EC 62 B3 F8 10 64
|
||||
00A0 | E1 17 B5 E3 44 7D 3E FC 04 24 81 51 95 A5 1B AE
|
||||
00B0 | 45 8E AF 4D DA 62 97 60 BE 99 7E 5C 41 4D 2E 46
|
||||
00C0 | 75 C2 66 19 1B 0C 74 BA 66 DA 2F C7 A9 4E CB C3
|
||||
00D0 | 54 3A 87 A8 12 06 80 49 1B 0F 02 4A 35 2E 1E 8F
|
||||
00E0 | 40 6C 79 68 9A 89 7E AE 90 6A 77 AF D7 2D 69 DF
|
||||
00F0 | 8F E4 2A 43 E6 F3 EB 49 C2 73 1F 84 04 F7 C3 ED
|
||||
0100 | 92 FC CA 2C 35 A3 BA 1A 84 44 82 8A A2 AF 99 C0
|
||||
0110 | 80 34 F8 91 45 0C A7 D0 F6 F1 AA 84 63 94 6C 77
|
||||
0120 | EC 7F C9 0D 3C 87 DE 82 23 29 FA A5 2E A5 D5 1D
|
||||
0130 | 42 5C C4 FD F6 28 8F 2D BB 0C D6 1F DD 0D 15 E5
|
||||
0140 | 10 78 6A 94 D2 90 E0 19 00 81 F6 B9 DD 27 20 2D
|
||||
0150 | F1 97 38 6B 91 5F 5E 08 B7 8E EB DF 49 38 B1 F7
|
||||
0160 | 8F 48 FD 47 C4 9A D4 6D 9F A7 F3 C7 7E F0 41 C7
|
||||
0170 | A8 F5 9B 1B B5 B7 F4 0E 43 04 A2 C5 0F 13 05 A8
|
||||
0180 | CD 96 11 C0 7F 2A 06 7C 77 30 68 B6 AA 2D A7 FB
|
||||
0190 | 40 81 59 B7 D6 FF D3 7C 86 84 85 53 01 D2 00 7E
|
||||
01A0 | 9D E3 2D 72 97 EC 10 FF 28 FB BE FB CD 0E 3A BE
|
||||
01B0 | B7 37 52 8E D7 AA 4C 7F 58 28 EE 8F 70 B7 B5 1A
|
||||
01C0 | 2A 04 18 4C 7B EB 52 E3 4B 2D 69 E4 D8 43 7D CE
|
||||
01D0 | 4F E4 E0 FD 4C ED 4C AF 1D 1E 57 53 44 6D E9 60
|
||||
01E0 | 25 75 18 AE E5 1C CC 7E 6E D9 3A A2 D0 36 CC B3
|
||||
01F0 | CC CC 93 BA D1 1F 63 77 94 D3 55 B9 68 B3 BC DD
|
||||
0200 | AD 40 E5 92 BB F1 2F 3B E7 D1 D4 22 AF 4A 82 3B
|
||||
0210 | D6 04 88 B9 B7 E6 6F C7 D4 29 F6 37 C7 64 6B 4A
|
||||
0220 | A0 88 6F 9C 8F A0 6D FC 26 97 6F 2F D6 C2 ED 9C
|
||||
0230 | 94 56 A7 CA 0A 13 F9 1E 97 FC D1 CF 7B D4 25 D8
|
||||
0240 | A2 0D BB 72 49 37 D6 45 02 FE 4F CA E3 22 07 D0
|
||||
0250 | 22 24 A1 59 92 E6 34 06 69 FC 58 65 93 61 70 E0
|
||||
0260 | 7E 87 ED 67 FA 1E 23 92 C3 2C A9 C2 84 96 8F 90
|
||||
0270 | A6 95 27 72 C6 A2 27 F5 04 18 8F C6 D1 A6 43 98
|
||||
0280 | 11 17 60 C0 CA 32 FE 69 F8 21 58 C2</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 40 FB 0A 8A 41 6A 65
|
||||
0010 | 90 02 00 00 5C 07 E8 D0 C2 8F 15 55 BD 72 6E 6D
|
||||
0020 | 31 75 6E 83 F8 5D A7 39 F0 08 06 90 63 A5 C6 AF
|
||||
0030 | 2F 54 CD DD 23 3E 76 7C FE 50 02 00 7F 0A 0E F3
|
||||
0040 | 36 7A 20 F2 88 88 D5 AC 07 9B 8F 09 BA 46 14 7D
|
||||
0050 | 1A 46 6E 8F 3A EA BE 47 15 0B 49 07 B5 C6 06 78
|
||||
0060 | 51 B6 FC A4 0B C2 D9 E4 8B 41 FF ED BD B2 17 44
|
||||
0070 | 93 37 EC C5 1F F7 96 00 70 92 89 64 81 45 3E 46
|
||||
0080 | 1E 7F E4 82 43 B7 8F 0B A7 2F A4 EB 2A E0 E0 64
|
||||
0090 | 96 26 59 02 EE 87 A8 9A 94 F1 E8 0B 3A F2 1D AA
|
||||
00A0 | 7C E7 CB A9 D6 23 04 97 10 41 D9 A2 75 0F D4 34
|
||||
00B0 | 9C A0 89 87 F1 84 39 04 4D 84 3B DD 4D 7C B8 FF
|
||||
00C0 | BA 72 CC 9D 13 32 B1 8D 38 3C AA 0A B9 4A 5B D7
|
||||
00D0 | 43 14 3B 0C 14 A1 4C CA C2 A0 8C 07 29 95 84 6E
|
||||
00E0 | 91 96 E6 8B 00 8F 0C F5 D4 7E C6 18 7F BA 11 8F
|
||||
00F0 | 9E D0 93 A9 B2 99 39 80 8F D2 BC 5B D0 7A 28 7D
|
||||
0100 | 5E 44 AA 9A AE ED E3 F4 C2 FC 65 93 9A 94 91 D4
|
||||
0110 | 2E B8 1E 69 63 61 8A C2 47 85 26 FB C0 32 E5 41
|
||||
0120 | 69 CA F5 08 F2 E2 3E C8 1A 20 F4 05 2F 4F BE E4
|
||||
0130 | E3 BC 9C C4 16 0A 45 76 09 CF 61 A7 0A AB 65 49
|
||||
0140 | D8 AF 75 B7 B4 88 C1 C6 F1 55 A5 29 1A 66 D7 FA
|
||||
0150 | 16 92 71 6D 64 66 CA 89 54 83 DA 13 6E 37 35 23
|
||||
0160 | 9F CA E5 55 EF 53 CC A6 B6 43 EE 3C 30 5F 0F 99
|
||||
0170 | BD 2B 80 83 2B 8B 7B 53 AB F1 02 5E DD D1 27 1F
|
||||
0180 | B6 6A F4 7B 6A 48 9A 03 9B 48 32 CE 81 E7 C0 0A
|
||||
0190 | 2A CC FD 8B 3D 58 5A E8 F0 05 D6 64 7B 55 C0 26
|
||||
01A0 | 06 AF E6 74 E7 A9 7B 7F 90 DF E9 97 5E 8F 57 50
|
||||
01B0 | 01 BF 66 35 09 99 54 F0 90 87 30 1C D1 C5 FF 1D
|
||||
01C0 | C6 71 74 E7 E7 16 EA 91 79 46 4D 6E 09 85 D8 7B
|
||||
01D0 | EE D3 4F F1 C2 1B 4E 4C B9 13 D6 CC 98 FB EA 1D
|
||||
01E0 | 82 78 34 1F 05 39 EF 45 9F 83 70 2F 84 E1 C8 AF
|
||||
01F0 | 91 1A AB 71 20 8D 1A 8A 37 A0 94 3E 5B 80 B0 84
|
||||
0200 | 2A 12 D5 56 FD 07 44 50 3F 49 1F E6 DE 6C 94 63
|
||||
0210 | 13 93 2F 79 5F 06 D7 68 D6 42 8E 99 0C F7 DF 6A
|
||||
0220 | 1B 1B FE 7A 6D 09 70 25 51 EC 72 09 27 5C A3 7D
|
||||
0230 | 53 77 99 68 2A 67 B9 DC 6C E7 34 C2 38 1C 3D D3
|
||||
0240 | D0 AF B1 01 4A 46 F0 CB 28 15 34 F6 ED BC 6C C5
|
||||
0250 | 59 D7 99 39 12 50 BB 54 40 97 3C 88 0D F0 43 2B
|
||||
0260 | AB FF 63 0A 76 76 67 95 C3 FD 9B 12 B5 21 DF 72
|
||||
0270 | 9E E3 A1 79 80 71 11 1A A1 50 7A 41 5E DB 2D 43
|
||||
0280 | 5B C0 7D A4 C2 28 15 08 30 DF F6 80</code></pre>
|
||||
<p>Payload (de)serialization:</p>
|
||||
<pre><code>server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;</code></pre>
|
||||
<table class="table">
|
||||
|
@ -464,13 +464,13 @@ random_padding_bytes = 6D401E9FBC96FFF4E42EDF9E0F36BCF77D54BDB15BE4CED43896165AA
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>0118532F36396A65</code></td>
|
||||
<td><code>0140FB0A8A416A65</code></td>
|
||||
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>message_length</td>
|
||||
<td>16, 4</td>
|
||||
<td><code>98020000</code> (664 in decimal)</td>
|
||||
<td><code>90020000</code> (656 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -482,19 +482,19 @@ random_padding_bytes = 6D401E9FBC96FFF4E42EDF9E0F36BCF77D54BDB15BE4CED43896165AA
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>F821AC0F4FD4CEAAD0133FE2449F86D4</code></td>
|
||||
<td><code>C28F1555BD726E6D31756E83F85DA739</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>90998E8AAD0DA16E3B9950BF5A7AE899</code></td>
|
||||
<td><code>F008069063A5C6AF2F54CDDD233E767C</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_answer</td>
|
||||
<td>56, 596</td>
|
||||
<td><code>FE5002008BEC6EE4685D7CDF09249627</code> <code>E56CCCBDBD313D0808ED665BD0030EE5</code> <code>71059536E7D531A8579E3EEEAC2F566C</code> <code>4D0B5B29C1DFADFCB022869A832468B3</code> <code>ED2697F1FFEC21811378144774023A40</code> <code>F2B6645A8D2EBAACEC245DAB535E5EA2</code> <code>738DEC62B3F81064E117B5E3447D3EFC</code> <code>0424815195A51BAE458EAF4DDA629760</code> <code>BE997E5C414D2E4675C266191B0C74BA</code> <code>66DA2FC7A94ECBC3543A87A812068049</code> <code>1B0F024A352E1E8F406C79689A897EAE</code> <code>906A77AFD72D69DF8FE42A43E6F3EB49</code> <code>C2731F8404F7C3ED92FCCA2C35A3BA1A</code> <code>8444828AA2AF99C08034F891450CA7D0</code> <code>F6F1AA8463946C77EC7FC90D3C87DE82</code> <code>2329FAA52EA5D51D425CC4FDF6288F2D</code> <code>BB0CD61FDD0D15E510786A94D290E019</code> <code>0081F6B9DD27202DF197386B915F5E08</code> <code>B78EEBDF4938B1F78F48FD47C49AD46D</code> <code>9FA7F3C77EF041C7A8F59B1BB5B7F40E</code> <code>4304A2C50F1305A8CD9611C07F2A067C</code> <code>773068B6AA2DA7FB408159B7D6FFD37C</code> <code>8684855301D2007E9DE32D7297EC10FF</code> <code>28FBBEFBCD0E3ABEB737528ED7AA4C7F</code> <code>5828EE8F70B7B51A2A04184C7BEB52E3</code> <code>4B2D69E4D8437DCE4FE4E0FD4CED4CAF</code> <code>1D1E5753446DE960257518AEE51CCC7E</code> <code>6ED93AA2D036CCB3CCCC93BAD11F6377</code> <code>94D355B968B3BCDDAD40E592BBF12F3B</code> <code>E7D1D422AF4A823BD60488B9B7E66FC7</code> <code>D429F637C7646B4AA0886F9C8FA06DFC</code> <code>26976F2FD6C2ED9C9456A7CA0A13F91E</code> <code>97FCD1CF7BD425D8A20DBB724937D645</code> <code>02FE4FCAE32207D02224A15992E63406</code> <code>69FC5865936170E07E87ED67FA1E2392</code> <code>C32CA9C284968F90A6952772C6A227F5</code> <code>04188FC6D1A64398111760C0CA32FE69</code><br> <code>F82158C2</code></td>
|
||||
<td><code>FE5002007F0A0EF3367A20F28888D5AC</code> <code>079B8F09BA46147D1A466E8F3AEABE47</code> <code>150B4907B5C6067851B6FCA40BC2D9E4</code> <code>8B41FFEDBDB217449337ECC51FF79600</code> <code>7092896481453E461E7FE48243B78F0B</code> <code>A72FA4EB2AE0E06496265902EE87A89A</code> <code>94F1E80B3AF21DAA7CE7CBA9D6230497</code> <code>1041D9A2750FD4349CA08987F1843904</code> <code>4D843BDD4D7CB8FFBA72CC9D1332B18D</code> <code>383CAA0AB94A5BD743143B0C14A14CCA</code> <code>C2A08C072995846E9196E68B008F0CF5</code> <code>D47EC6187FBA118F9ED093A9B2993980</code> <code>8FD2BC5BD07A287D5E44AA9AAEEDE3F4</code> <code>C2FC65939A9491D42EB81E6963618AC2</code> <code>478526FBC032E54169CAF508F2E23EC8</code> <code>1A20F4052F4FBEE4E3BC9CC4160A4576</code> <code>09CF61A70AAB6549D8AF75B7B488C1C6</code> <code>F155A5291A66D7FA1692716D6466CA89</code> <code>5483DA136E3735239FCAE555EF53CCA6</code> <code>B643EE3C305F0F99BD2B80832B8B7B53</code> <code>ABF1025EDDD1271FB66AF47B6A489A03</code> <code>9B4832CE81E7C00A2ACCFD8B3D585AE8</code> <code>F005D6647B55C02606AFE674E7A97B7F</code> <code>90DFE9975E8F575001BF6635099954F0</code> <code>9087301CD1C5FF1DC67174E7E716EA91</code> <code>79464D6E0985D87BEED34FF1C21B4E4C</code> <code>B913D6CC98FBEA1D8278341F0539EF45</code> <code>9F83702F84E1C8AF911AAB71208D1A8A</code> <code>37A0943E5B80B0842A12D556FD074450</code> <code>3F491FE6DE6C946313932F795F06D768</code> <code>D6428E990CF7DF6A1B1BFE7A6D097025</code> <code>51EC7209275CA37D537799682A67B9DC</code> <code>6CE734C2381C3DD3D0AFB1014A46F0CB</code> <code>281534F6EDBC6CC559D799391250BB54</code> <code>40973C880DF0432BABFF630A76766795</code> <code>C3FD9B12B521DF729EE3A1798071111A</code> <code>A1507A415EDB2D435BC07DA4C2281508</code><br> <code>30DFF680</code></td>
|
||||
<td>See below</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -502,20 +502,20 @@ random_padding_bytes = 6D401E9FBC96FFF4E42EDF9E0F36BCF77D54BDB15BE4CED43896165AA
|
|||
<!-- 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 = 8BEC6EE4685D7CDF09249627E56CCCBDBD313D0808ED665BD0030EE571059536E7D531A8579E3EEEAC2F566C4D0B5B29C1DFADFCB022869A832468B3ED2697F1FFEC21811378144774023A40F2B6645A8D2EBAACEC245DAB535E5EA2738DEC62B3F81064E117B5E3447D3EFC0424815195A51BAE458EAF4DDA629760BE997E5C414D2E4675C266191B0C74BA66DA2FC7A94ECBC3543A87A8120680491B0F024A352E1E8F406C79689A897EAE906A77AFD72D69DF8FE42A43E6F3EB49C2731F8404F7C3ED92FCCA2C35A3BA1A8444828AA2AF99C08034F891450CA7D0F6F1AA8463946C77EC7FC90D3C87DE822329FAA52EA5D51D425CC4FDF6288F2DBB0CD61FDD0D15E510786A94D290E0190081F6B9DD27202DF197386B915F5E08B78EEBDF4938B1F78F48FD47C49AD46D9FA7F3C77EF041C7A8F59B1BB5B7F40E4304A2C50F1305A8CD9611C07F2A067C773068B6AA2DA7FB408159B7D6FFD37C8684855301D2007E9DE32D7297EC10FF28FBBEFBCD0E3ABEB737528ED7AA4C7F5828EE8F70B7B51A2A04184C7BEB52E34B2D69E4D8437DCE4FE4E0FD4CED4CAF1D1E5753446DE960257518AEE51CCC7E6ED93AA2D036CCB3CCCC93BAD11F637794D355B968B3BCDDAD40E592BBF12F3BE7D1D422AF4A823BD60488B9B7E66FC7D429F637C7646B4AA0886F9C8FA06DFC26976F2FD6C2ED9C9456A7CA0A13F91E97FCD1CF7BD425D8A20DBB724937D64502FE4FCAE32207D02224A15992E6340669FC5865936170E07E87ED67FA1E2392C32CA9C284968F90A6952772C6A227F504188FC6D1A64398111760C0CA32FE69F82158C2
|
||||
tmp_aes_key = 29F7107633BDE69B33E3479A4D5424336B7A3C852107EB549320182AFB862BE0
|
||||
tmp_aes_iv = 2BCD03C014A3E84A827DC03D304624CE98CB6B5678D748D27B09204E9B92957B</code></pre>
|
||||
<pre><code>encrypted_answer = 7F0A0EF3367A20F28888D5AC079B8F09BA46147D1A466E8F3AEABE47150B4907B5C6067851B6FCA40BC2D9E48B41FFEDBDB217449337ECC51FF796007092896481453E461E7FE48243B78F0BA72FA4EB2AE0E06496265902EE87A89A94F1E80B3AF21DAA7CE7CBA9D62304971041D9A2750FD4349CA08987F18439044D843BDD4D7CB8FFBA72CC9D1332B18D383CAA0AB94A5BD743143B0C14A14CCAC2A08C072995846E9196E68B008F0CF5D47EC6187FBA118F9ED093A9B29939808FD2BC5BD07A287D5E44AA9AAEEDE3F4C2FC65939A9491D42EB81E6963618AC2478526FBC032E54169CAF508F2E23EC81A20F4052F4FBEE4E3BC9CC4160A457609CF61A70AAB6549D8AF75B7B488C1C6F155A5291A66D7FA1692716D6466CA895483DA136E3735239FCAE555EF53CCA6B643EE3C305F0F99BD2B80832B8B7B53ABF1025EDDD1271FB66AF47B6A489A039B4832CE81E7C00A2ACCFD8B3D585AE8F005D6647B55C02606AFE674E7A97B7F90DFE9975E8F575001BF6635099954F09087301CD1C5FF1DC67174E7E716EA9179464D6E0985D87BEED34FF1C21B4E4CB913D6CC98FBEA1D8278341F0539EF459F83702F84E1C8AF911AAB71208D1A8A37A0943E5B80B0842A12D556FD0744503F491FE6DE6C946313932F795F06D768D6428E990CF7DF6A1B1BFE7A6D09702551EC7209275CA37D537799682A67B9DC6CE734C2381C3DD3D0AFB1014A46F0CB281534F6EDBC6CC559D799391250BB5440973C880DF0432BABFF630A76766795C3FD9B12B521DF729EE3A1798071111AA1507A415EDB2D435BC07DA4C228150830DFF680
|
||||
tmp_aes_key = 6C7CE92A1E77D36A6319624098FA0D8712081E66A5FE7A20E50C8F0F7DAD5805
|
||||
tmp_aes_iv = 957600BBA5EF8C267B43B945CBD247823AAFA3EFBD957E8337E01DCD28625EDE</code></pre>
|
||||
<!-- end server_DH_inner_data_input -->
|
||||
<p>Yielding:</p>
|
||||
<!-- start server_DH_inner_data_output -->
|
||||
<pre><code>answer_with_hash = A0F4698C0DDC87F6D4D54219D9C1FFFD0B9D147ABA0D89B5F821AC0F4FD4CEAAD0133FE2449F86D490998E8AAD0DA16E3B9950BF5A7AE89903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001008363ECDFB02282CDF33277D7A9515E2B0FD4084C411C49105F5DBFBB9797261FB79D28E19E186152EB705941A0FA67C57E42C05BDC749F5C4DD53E9E30A01B624B93183A72E45114978C0BCDEE80AF17C4565E0A188AB2D5057C307A1187C4A1B04293544D447EE0B6970980E79D1F11D99CDBD68F498E672E968569A24D4850E928573E2089990E76529BA9B4ACED3C26B51F3646E6CAA6BFCE9BCF3B3B1E30E8B1366B320DD8126D2CD4F1E887975BC02E0D03F6DA6EC0D94839994BF95BE3576D7B8F113BBF4DDD00ABF6F0E4431BB87145AC0190432597EA43B3802359F99F6FCE3A61F611DBAC2A33F69189260B603EA5ADD2629168C38479DBEC4A22D636396A65EEDBE8C0542F86F7
|
||||
answer = BA0D89B5F821AC0F4FD4CEAAD0133FE2449F86D490998E8AAD0DA16E3B9950BF5A7AE89903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001008363ECDFB02282CDF33277D7A9515E2B0FD4084C411C49105F5DBFBB9797261FB79D28E19E186152EB705941A0FA67C57E42C05BDC749F5C4DD53E9E30A01B624B93183A72E45114978C0BCDEE80AF17C4565E0A188AB2D5057C307A1187C4A1B04293544D447EE0B6970980E79D1F11D99CDBD68F498E672E968569A24D4850E928573E2089990E76529BA9B4ACED3C26B51F3646E6CAA6BFCE9BCF3B3B1E30E8B1366B320DD8126D2CD4F1E887975BC02E0D03F6DA6EC0D94839994BF95BE3576D7B8F113BBF4DDD00ABF6F0E4431BB87145AC0190432597EA43B3802359F99F6FCE3A61F611DBAC2A33F69189260B603EA5ADD2629168C38479DBEC4A22D636396A65EEDBE8C0542F86F7</code></pre>
|
||||
<pre><code>answer_with_hash = D5A8D5D94590761C8538274B43847C2E219659F6BA0D89B5C28F1555BD726E6D31756E83F85DA739F008069063A5C6AF2F54CDDD233E767C03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001001CB3294DAA83FFCC700B43DD051EC5E788BD5CBFD1F140BC64E5DE58A98F53BBEA29402A0EB184832A107AC820CEDD2000AF59202F1E0F3D766CD1F12291F77D8550BB3A32A6AAF1FCBE5E12B21A8DE8FA48C7B6BFBA98861A69072015FFFC6CC1D32BEE2573178E29FE9FF1E5290D23672B2B795B52CFC0614C5AFD29C49D269BA8F9922987B2A996CC82CCA56E229C8993AD5FF289FA935FCB54F65918445F11DA325944B9CE74CB0D1F36B6456B0E9D744EEE370032B03C4B6E722CC9250F1F661A84726628E2C101E9E0CAF5799E4FF93C94C84736F4E3EC75DEA38F0A975B2B3AE975319DECF53EA56A3583B2CC8F145F9F20C8D578E701967876A84DD78A416A65362C6D1F470B159C
|
||||
answer = BA0D89B5C28F1555BD726E6D31756E83F85DA739F008069063A5C6AF2F54CDDD233E767C03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001001CB3294DAA83FFCC700B43DD051EC5E788BD5CBFD1F140BC64E5DE58A98F53BBEA29402A0EB184832A107AC820CEDD2000AF59202F1E0F3D766CD1F12291F77D8550BB3A32A6AAF1FCBE5E12B21A8DE8FA48C7B6BFBA98861A69072015FFFC6CC1D32BEE2573178E29FE9FF1E5290D23672B2B795B52CFC0614C5AFD29C49D269BA8F9922987B2A996CC82CCA56E229C8993AD5FF289FA935FCB54F65918445F11DA325944B9CE74CB0D1F36B6456B0E9D744EEE370032B03C4B6E722CC9250F1F661A84726628E2C101E9E0CAF5799E4FF93C94C84736F4E3EC75DEA38F0A975B2B3AE975319DECF53EA56A3583B2CC8F145F9F20C8D578E701967876A84DD78A416A65362C6D1F470B159C</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 F8 21 AC 0F 4F D4 CE AA D0 13 3F E2
|
||||
0010 | 44 9F 86 D4 90 99 8E 8A AD 0D A1 6E 3B 99 50 BF
|
||||
0020 | 5A 7A E8 99 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
||||
<pre><code>0000 | BA 0D 89 B5 C2 8F 15 55 BD 72 6E 6D 31 75 6E 83
|
||||
0010 | F8 5D A7 39 F0 08 06 90 63 A5 C6 AF 2F 54 CD DD
|
||||
0020 | 23 3E 76 7C 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 = BA0D89B5F821AC0F4FD4CEAAD0133FE2449F86D490998E8AAD0DA16E3B9950BF5A7AE89
|
|||
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 | 83 63 EC DF B0 22 82 CD F3 32 77 D7 A9 51 5E 2B
|
||||
0140 | 0F D4 08 4C 41 1C 49 10 5F 5D BF BB 97 97 26 1F
|
||||
0150 | B7 9D 28 E1 9E 18 61 52 EB 70 59 41 A0 FA 67 C5
|
||||
0160 | 7E 42 C0 5B DC 74 9F 5C 4D D5 3E 9E 30 A0 1B 62
|
||||
0170 | 4B 93 18 3A 72 E4 51 14 97 8C 0B CD EE 80 AF 17
|
||||
0180 | C4 56 5E 0A 18 8A B2 D5 05 7C 30 7A 11 87 C4 A1
|
||||
0190 | B0 42 93 54 4D 44 7E E0 B6 97 09 80 E7 9D 1F 11
|
||||
01A0 | D9 9C DB D6 8F 49 8E 67 2E 96 85 69 A2 4D 48 50
|
||||
01B0 | E9 28 57 3E 20 89 99 0E 76 52 9B A9 B4 AC ED 3C
|
||||
01C0 | 26 B5 1F 36 46 E6 CA A6 BF CE 9B CF 3B 3B 1E 30
|
||||
01D0 | E8 B1 36 6B 32 0D D8 12 6D 2C D4 F1 E8 87 97 5B
|
||||
01E0 | C0 2E 0D 03 F6 DA 6E C0 D9 48 39 99 4B F9 5B E3
|
||||
01F0 | 57 6D 7B 8F 11 3B BF 4D DD 00 AB F6 F0 E4 43 1B
|
||||
0200 | B8 71 45 AC 01 90 43 25 97 EA 43 B3 80 23 59 F9
|
||||
0210 | 9F 6F CE 3A 61 F6 11 DB AC 2A 33 F6 91 89 26 0B
|
||||
0220 | 60 3E A5 AD D2 62 91 68 C3 84 79 DB EC 4A 22 D6
|
||||
0230 | 36 39 6A 65</code></pre>
|
||||
0130 | 1C B3 29 4D AA 83 FF CC 70 0B 43 DD 05 1E C5 E7
|
||||
0140 | 88 BD 5C BF D1 F1 40 BC 64 E5 DE 58 A9 8F 53 BB
|
||||
0150 | EA 29 40 2A 0E B1 84 83 2A 10 7A C8 20 CE DD 20
|
||||
0160 | 00 AF 59 20 2F 1E 0F 3D 76 6C D1 F1 22 91 F7 7D
|
||||
0170 | 85 50 BB 3A 32 A6 AA F1 FC BE 5E 12 B2 1A 8D E8
|
||||
0180 | FA 48 C7 B6 BF BA 98 86 1A 69 07 20 15 FF FC 6C
|
||||
0190 | C1 D3 2B EE 25 73 17 8E 29 FE 9F F1 E5 29 0D 23
|
||||
01A0 | 67 2B 2B 79 5B 52 CF C0 61 4C 5A FD 29 C4 9D 26
|
||||
01B0 | 9B A8 F9 92 29 87 B2 A9 96 CC 82 CC A5 6E 22 9C
|
||||
01C0 | 89 93 AD 5F F2 89 FA 93 5F CB 54 F6 59 18 44 5F
|
||||
01D0 | 11 DA 32 59 44 B9 CE 74 CB 0D 1F 36 B6 45 6B 0E
|
||||
01E0 | 9D 74 4E EE 37 00 32 B0 3C 4B 6E 72 2C C9 25 0F
|
||||
01F0 | 1F 66 1A 84 72 66 28 E2 C1 01 E9 E0 CA F5 79 9E
|
||||
0200 | 4F F9 3C 94 C8 47 36 F4 E3 EC 75 DE A3 8F 0A 97
|
||||
0210 | 5B 2B 3A E9 75 31 9D EC F5 3E A5 6A 35 83 B2 CC
|
||||
0220 | 8F 14 5F 9F 20 C8 D5 78 E7 01 96 78 76 A8 4D D7
|
||||
0230 | 8A 41 6A 65</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 = BA0D89B5F821AC0F4FD4CEAAD0133FE2449F86D490998E8AAD0DA16E3B9950BF5A7AE89
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>F821AC0F4FD4CEAAD0133FE2449F86D4</code></td>
|
||||
<td><code>C28F1555BD726E6D31756E83F85DA739</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>90998E8AAD0DA16E3B9950BF5A7AE899</code></td>
|
||||
<td><code>F008069063A5C6AF2F54CDDD233E767C</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -594,13 +594,13 @@ answer = BA0D89B5F821AC0F4FD4CEAAD0133FE2449F86D490998E8AAD0DA16E3B9950BF5A7AE89
|
|||
<tr>
|
||||
<td>g_a</td>
|
||||
<td>300, 260</td>
|
||||
<td><code>FE0001008363ECDFB02282CDF33277D7</code> <code>A9515E2B0FD4084C411C49105F5DBFBB</code> <code>9797261FB79D28E19E186152EB705941</code> <code>A0FA67C57E42C05BDC749F5C4DD53E9E</code> <code>30A01B624B93183A72E45114978C0BCD</code> <code>EE80AF17C4565E0A188AB2D5057C307A</code> <code>1187C4A1B04293544D447EE0B6970980</code> <code>E79D1F11D99CDBD68F498E672E968569</code> <code>A24D4850E928573E2089990E76529BA9</code> <code>B4ACED3C26B51F3646E6CAA6BFCE9BCF</code> <code>3B3B1E30E8B1366B320DD8126D2CD4F1</code> <code>E887975BC02E0D03F6DA6EC0D9483999</code> <code>4BF95BE3576D7B8F113BBF4DDD00ABF6</code> <code>F0E4431BB87145AC0190432597EA43B3</code> <code>802359F99F6FCE3A61F611DBAC2A33F6</code> <code>9189260B603EA5ADD2629168C38479DB</code><br> <code>EC4A22D6</code></td>
|
||||
<td><code>FE0001001CB3294DAA83FFCC700B43DD</code> <code>051EC5E788BD5CBFD1F140BC64E5DE58</code> <code>A98F53BBEA29402A0EB184832A107AC8</code> <code>20CEDD2000AF59202F1E0F3D766CD1F1</code> <code>2291F77D8550BB3A32A6AAF1FCBE5E12</code> <code>B21A8DE8FA48C7B6BFBA98861A690720</code> <code>15FFFC6CC1D32BEE2573178E29FE9FF1</code> <code>E5290D23672B2B795B52CFC0614C5AFD</code> <code>29C49D269BA8F9922987B2A996CC82CC</code> <code>A56E229C8993AD5FF289FA935FCB54F6</code> <code>5918445F11DA325944B9CE74CB0D1F36</code> <code>B6456B0E9D744EEE370032B03C4B6E72</code> <code>2CC9250F1F661A84726628E2C101E9E0</code> <code>CAF5799E4FF93C94C84736F4E3EC75DE</code> <code>A38F0A975B2B3AE975319DECF53EA56A</code> <code>3583B2CC8F145F9F20C8D578E7019678</code><br> <code>76A84DD7</code></td>
|
||||
<td><code>g_a</code> diffie-hellman parameter</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_time</td>
|
||||
<td>560, 4</td>
|
||||
<td><code>36396A65</code> (1701460278 in decimal)</td>
|
||||
<td><code>8A416A65</code> (1701462410 in decimal)</td>
|
||||
<td>Server time</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -609,34 +609,34 @@ answer = BA0D89B5F821AC0F4FD4CEAAD0133FE2449F86D490998E8AAD0DA16E3B9950BF5A7AE89
|
|||
<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 = 513FFC0FC78F74BDB3C4616032EFC4D9203BBE9C69A66D332A5EAAA4A34EAE55362A03F3B6D6ABF100132E6F77F1552E2861DBD01780D99498993BC683877EAC3BF392D01F77CCECCEF1BF1575203832473466190F3EF484DC60FFA6B144E1F55A92CFD4D790729F8941F23CE8C52833FDF147B6AFF2B12087AEE70DCF444041360F253E331784EDA44C68708E0B6745819EAAF107CCDBF5C41D2834CCB7AB05FB52F9DCD04E622AC1A0A1E09F0A172596786CA88A62A0D7C6BF3D109FD827B152E3EDF0DD5F0D0068054E34087919E1BBE938B05F1C6769EA289A0423276ED41B85644D40A547D43F375A81358A5ABDBA330682BE92682EA80D5921BB974395</code></pre>
|
||||
<pre><code>b = B15E7E8679440AD21C5673205B909AB8DBAEAC175835AF5DD25CD2F2CAC14D2E0C82BCDA4D82B96E80B6A85A09C8FD02AC5A2E12099A32F3A4F65CF127AE66043E2B6D744D0E68E3E96B27D012AE4B72E8AE7CD7A3B4E7987A7B37B18F6F9868E00EA69119B3D1BC2E5BB671DA2FDFC828707A7251B2438D6A4279F8A700B41841B551C5FC3A7842280C1A514D5BD279F69C7E60756330170C8DDA0CA3F80481237A754A8A75C5C6402EC31981040166FF23C15266A2130A681B6EFD65466BF2B52307A6AC9F7007113BFCA3D9A38860F43E03FEF97F8A494AAE070870F7B196AFA66B95C0E2106E9CDD4DCFF2F92B76B39D6044AEEAA529E62EEDA546655CDA</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 = 57F9EA099BC77F1DFCBD1841D8A0BA7050C574D4B96E3DE335FE8929888B5249251CE9A1CC8BF5B59148010FE7D8E50C623EEECEB7C032255F03667996E4BF5BB6C74BFC3E8D7CEAB2FF8C860B13A6DCF89F49704D9B927FF1DEBD4FB7E50CAA2F3DF8AEEB5CF831A1D0B5B86DBE3E7724528412A34EE1E34487870A87A42C5CC6E8A3D368A788B6C06A43A336B34C881230C9A09EF838EBA84078C79C69A1ABAC3F9CB6FFAF0E69668ACC58F556434BB43FDDD39FC95A5EBFAF2F565B3A1B2AC665D5757DFA5625C50197AB6347B6F1BA958E83C70D55B8D5D529517E18700C4FD7B2D14922D9C813E98079E500099FEFA2D4EDC7B6A9C6E240D0C08DF2F1A0</code></pre>
|
||||
<pre><code>g_b = 7CD1DC488E57D09593A2DC616BE525626B52F6DE778110BB844BD132D9053A6D8CB26EDF072280111F59E76A0DAA5774C07FD1A73965E6DA3C7039C0C0FD452E0B7F8F4E8F0695118779046DF6C3E8135768CFFEAD1E0355B8333BBE19397075829241059FD806F756D26D66769ADF6FEA3B943A294F3B0A7867EE37E21CE0718EFC20A3DFB36EC8263C2F532C2B30709117ABCAF951EF4E2ECA9C7E3E323B9C5EBDD2D5F1ABB22DF8B349805C0A521ADCFF782A2325AD79BB43BFEBC563274106A2FA715BBB5AB5A9AAF08707571FB36FE2ACBC40787B7CCEF94230D781D7E63811961956A6EC11B9A74D5971EA3D62B89318CBBC8D9B3A13B0EF4E68264EEB</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 F8 21 AC 0F 4F D4 CE AA D0 13 3F E2
|
||||
0010 | 44 9F 86 D4 90 99 8E 8A AD 0D A1 6E 3B 99 50 BF
|
||||
0020 | 5A 7A E8 99 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | 57 F9 EA 09 9B C7 7F 1D FC BD 18 41 D8 A0 BA 70
|
||||
0040 | 50 C5 74 D4 B9 6E 3D E3 35 FE 89 29 88 8B 52 49
|
||||
0050 | 25 1C E9 A1 CC 8B F5 B5 91 48 01 0F E7 D8 E5 0C
|
||||
0060 | 62 3E EE CE B7 C0 32 25 5F 03 66 79 96 E4 BF 5B
|
||||
0070 | B6 C7 4B FC 3E 8D 7C EA B2 FF 8C 86 0B 13 A6 DC
|
||||
0080 | F8 9F 49 70 4D 9B 92 7F F1 DE BD 4F B7 E5 0C AA
|
||||
0090 | 2F 3D F8 AE EB 5C F8 31 A1 D0 B5 B8 6D BE 3E 77
|
||||
00A0 | 24 52 84 12 A3 4E E1 E3 44 87 87 0A 87 A4 2C 5C
|
||||
00B0 | C6 E8 A3 D3 68 A7 88 B6 C0 6A 43 A3 36 B3 4C 88
|
||||
00C0 | 12 30 C9 A0 9E F8 38 EB A8 40 78 C7 9C 69 A1 AB
|
||||
00D0 | AC 3F 9C B6 FF AF 0E 69 66 8A CC 58 F5 56 43 4B
|
||||
00E0 | B4 3F DD D3 9F C9 5A 5E BF AF 2F 56 5B 3A 1B 2A
|
||||
00F0 | C6 65 D5 75 7D FA 56 25 C5 01 97 AB 63 47 B6 F1
|
||||
0100 | BA 95 8E 83 C7 0D 55 B8 D5 D5 29 51 7E 18 70 0C
|
||||
0110 | 4F D7 B2 D1 49 22 D9 C8 13 E9 80 79 E5 00 09 9F
|
||||
0120 | EF A2 D4 ED C7 B6 A9 C6 E2 40 D0 C0 8D F2 F1 A0</code></pre>
|
||||
<pre><code>0000 | 54 B6 43 66 C2 8F 15 55 BD 72 6E 6D 31 75 6E 83
|
||||
0010 | F8 5D A7 39 F0 08 06 90 63 A5 C6 AF 2F 54 CD DD
|
||||
0020 | 23 3E 76 7C 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | 7C D1 DC 48 8E 57 D0 95 93 A2 DC 61 6B E5 25 62
|
||||
0040 | 6B 52 F6 DE 77 81 10 BB 84 4B D1 32 D9 05 3A 6D
|
||||
0050 | 8C B2 6E DF 07 22 80 11 1F 59 E7 6A 0D AA 57 74
|
||||
0060 | C0 7F D1 A7 39 65 E6 DA 3C 70 39 C0 C0 FD 45 2E
|
||||
0070 | 0B 7F 8F 4E 8F 06 95 11 87 79 04 6D F6 C3 E8 13
|
||||
0080 | 57 68 CF FE AD 1E 03 55 B8 33 3B BE 19 39 70 75
|
||||
0090 | 82 92 41 05 9F D8 06 F7 56 D2 6D 66 76 9A DF 6F
|
||||
00A0 | EA 3B 94 3A 29 4F 3B 0A 78 67 EE 37 E2 1C E0 71
|
||||
00B0 | 8E FC 20 A3 DF B3 6E C8 26 3C 2F 53 2C 2B 30 70
|
||||
00C0 | 91 17 AB CA F9 51 EF 4E 2E CA 9C 7E 3E 32 3B 9C
|
||||
00D0 | 5E BD D2 D5 F1 AB B2 2D F8 B3 49 80 5C 0A 52 1A
|
||||
00E0 | DC FF 78 2A 23 25 AD 79 BB 43 BF EB C5 63 27 41
|
||||
00F0 | 06 A2 FA 71 5B BB 5A B5 A9 AA F0 87 07 57 1F B3
|
||||
0100 | 6F E2 AC BC 40 78 7B 7C CE F9 42 30 D7 81 D7 E6
|
||||
0110 | 38 11 96 19 56 A6 EC 11 B9 A7 4D 59 71 EA 3D 62
|
||||
0120 | B8 93 18 CB BC 8D 9B 3A 13 B0 EF 4E 68 26 4E EB</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 = BA0D89B5F821AC0F4FD4CEAAD0133FE2449F86D490998E8AAD0DA16E3B9950BF5A7AE89
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>F821AC0F4FD4CEAAD0133FE2449F86D4</code></td>
|
||||
<td><code>C28F1555BD726E6D31756E83F85DA739</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>90998E8AAD0DA16E3B9950BF5A7AE899</code></td>
|
||||
<td><code>F008069063A5C6AF2F54CDDD233E767C</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>g_b</td>
|
||||
<td>36, 260</td>
|
||||
<td><code>FE00010057F9EA099BC77F1DFCBD1841</code> <code>D8A0BA7050C574D4B96E3DE335FE8929</code> <code>888B5249251CE9A1CC8BF5B59148010F</code> <code>E7D8E50C623EEECEB7C032255F036679</code> <code>96E4BF5BB6C74BFC3E8D7CEAB2FF8C86</code> <code>0B13A6DCF89F49704D9B927FF1DEBD4F</code> <code>B7E50CAA2F3DF8AEEB5CF831A1D0B5B8</code> <code>6DBE3E7724528412A34EE1E34487870A</code> <code>87A42C5CC6E8A3D368A788B6C06A43A3</code> <code>36B34C881230C9A09EF838EBA84078C7</code> <code>9C69A1ABAC3F9CB6FFAF0E69668ACC58</code> <code>F556434BB43FDDD39FC95A5EBFAF2F56</code> <code>5B3A1B2AC665D5757DFA5625C50197AB</code> <code>6347B6F1BA958E83C70D55B8D5D52951</code> <code>7E18700C4FD7B2D14922D9C813E98079</code> <code>E500099FEFA2D4EDC7B6A9C6E240D0C0</code><br> <code>8DF2F1A0</code></td>
|
||||
<td><code>FE0001007CD1DC488E57D09593A2DC61</code> <code>6BE525626B52F6DE778110BB844BD132</code> <code>D9053A6D8CB26EDF072280111F59E76A</code> <code>0DAA5774C07FD1A73965E6DA3C7039C0</code> <code>C0FD452E0B7F8F4E8F0695118779046D</code> <code>F6C3E8135768CFFEAD1E0355B8333BBE</code> <code>19397075829241059FD806F756D26D66</code> <code>769ADF6FEA3B943A294F3B0A7867EE37</code> <code>E21CE0718EFC20A3DFB36EC8263C2F53</code> <code>2C2B30709117ABCAF951EF4E2ECA9C7E</code> <code>3E323B9C5EBDD2D5F1ABB22DF8B34980</code> <code>5C0A521ADCFF782A2325AD79BB43BFEB</code> <code>C563274106A2FA715BBB5AB5A9AAF087</code> <code>07571FB36FE2ACBC40787B7CCEF94230</code> <code>D781D7E63811961956A6EC11B9A74D59</code> <code>71EA3D62B89318CBBC8D9B3A13B0EF4E</code><br> <code>68264EEB</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 = BA0D89B5F821AC0F4FD4CEAAD0133FE2449F86D490998E8AAD0DA16E3B9950BF5A7AE89
|
|||
<!-- 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 = 54B64366F821AC0F4FD4CEAAD0133FE2449F86D490998E8AAD0DA16E3B9950BF5A7AE8990000000000000000FE00010057F9EA099BC77F1DFCBD1841D8A0BA7050C574D4B96E3DE335FE8929888B5249251CE9A1CC8BF5B59148010FE7D8E50C623EEECEB7C032255F03667996E4BF5BB6C74BFC3E8D7CEAB2FF8C860B13A6DCF89F49704D9B927FF1DEBD4FB7E50CAA2F3DF8AEEB5CF831A1D0B5B86DBE3E7724528412A34EE1E34487870A87A42C5CC6E8A3D368A788B6C06A43A336B34C881230C9A09EF838EBA84078C79C69A1ABAC3F9CB6FFAF0E69668ACC58F556434BB43FDDD39FC95A5EBFAF2F565B3A1B2AC665D5757DFA5625C50197AB6347B6F1BA958E83C70D55B8D5D529517E18700C4FD7B2D14922D9C813E98079E500099FEFA2D4EDC7B6A9C6E240D0C08DF2F1A0
|
||||
padding = 08E683B08B4F3CC9206449AA
|
||||
tmp_aes_key = 29F7107633BDE69B33E3479A4D5424336B7A3C852107EB549320182AFB862BE0
|
||||
tmp_aes_iv = 2BCD03C014A3E84A827DC03D304624CE98CB6B5678D748D27B09204E9B92957B</code></pre>
|
||||
<pre><code>data = 54B64366C28F1555BD726E6D31756E83F85DA739F008069063A5C6AF2F54CDDD233E767C0000000000000000FE0001007CD1DC488E57D09593A2DC616BE525626B52F6DE778110BB844BD132D9053A6D8CB26EDF072280111F59E76A0DAA5774C07FD1A73965E6DA3C7039C0C0FD452E0B7F8F4E8F0695118779046DF6C3E8135768CFFEAD1E0355B8333BBE19397075829241059FD806F756D26D66769ADF6FEA3B943A294F3B0A7867EE37E21CE0718EFC20A3DFB36EC8263C2F532C2B30709117ABCAF951EF4E2ECA9C7E3E323B9C5EBDD2D5F1ABB22DF8B349805C0A521ADCFF782A2325AD79BB43BFEBC563274106A2FA715BBB5AB5A9AAF08707571FB36FE2ACBC40787B7CCEF94230D781D7E63811961956A6EC11B9A74D5971EA3D62B89318CBBC8D9B3A13B0EF4E68264EEB
|
||||
padding = 84A022CA231998BDC523EAB2
|
||||
tmp_aes_key = 6C7CE92A1E77D36A6319624098FA0D8712081E66A5FE7A20E50C8F0F7DAD5805
|
||||
tmp_aes_iv = 957600BBA5EF8C267B43B945CBD247823AAFA3EFBD957E8337E01DCD28625EDE</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 = 161550B26A25A0A55C07C5864C61B89109059D54AF6C38A79AFB50AD61F012E9EADD4BB61034971BF4ED90D97BF67BCA23B3B54D02F831D74ABE5AB403BB0410AF70856F08334CC38FA9783E11C399B1255FEFE481445D382FA6D17F3F39EE682DB49E62FA05909598EDAA12E6AEC66A71E5C997F1366DC0187B787E34ED75087C7149934A87435CC3295545D02BF4E699842D3D95372BFD25F6B6DB7DCC48DA9283A624CA7E45CACACAA4C73C395004FC2E854FE70551CD7B78C0EC1BAC598A43C597E112E574CDDC9ECD3150355E0C4C82AE24DD7CCC5B4CAA0E895F2EE60188BB677E82DB63648AFA21627CA10674968ED042F9B6D97A382BBB79E24DC36E8D0A8EC37DEBD56E0BE07E5AA03D222802FCD9456A68618512120B65950632007F348B175D8A715018BD3B67E8273FD9055FCADFECDCA50EF3A8DFD4EEBD5B9A24C3257E35584A12A1AA659D9C940B41</code></pre>
|
||||
<pre><code>encrypted_data = 516F3067F67848CB09499858B9F2997298A9C008EC04242041D0A7AB9227D2555E679587BCF91AC6DE88EC064FC081D41178B35448BE387C8BB61BA21D8B8723CE47DBBB8E6FAE531862B095882E3DB07D2E19396837E7DB538D4BB11D96A0E2A000D55B6FC7085B77E17D1C1AEAD547886F6F82B96624F7CBD7CFC7E460FB988F7AD6951BB1ACDBD3CC85F0EAC72AE206C4E59AAA4685056227B69777E37CC776CCC6986AD0DB28C0B30F1EE588DD4CBFEA2BDBB9D636BC2BDBD0FE5FE02B0E223B52FBA85178D93559516C06F88069D022978A3D009A6F52F2361C76D01AD940762B168CE3405EAA9FBD53F583A0CF5E9393B35526FF7A98A05F3D5F3539526DAA896301C68427D48987BED0BFBE82D2F10EBB29FA6AB1F43B4C4B886D07FD3DB0787CFE0AFC6397CAF3F5520A9D278FAAD931E63C6C3336FDD0CA67769EC4A3DE8FC9CB081713469168B5C0D27E54</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 DC 9D 08 00 36 39 6A 65
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 F8 21 AC 0F 4F D4 CE AA
|
||||
0020 | D0 13 3F E2 44 9F 86 D4 90 99 8E 8A AD 0D A1 6E
|
||||
0030 | 3B 99 50 BF 5A 7A E8 99 FE 50 01 00 16 15 50 B2
|
||||
0040 | 6A 25 A0 A5 5C 07 C5 86 4C 61 B8 91 09 05 9D 54
|
||||
0050 | AF 6C 38 A7 9A FB 50 AD 61 F0 12 E9 EA DD 4B B6
|
||||
0060 | 10 34 97 1B F4 ED 90 D9 7B F6 7B CA 23 B3 B5 4D
|
||||
0070 | 02 F8 31 D7 4A BE 5A B4 03 BB 04 10 AF 70 85 6F
|
||||
0080 | 08 33 4C C3 8F A9 78 3E 11 C3 99 B1 25 5F EF E4
|
||||
0090 | 81 44 5D 38 2F A6 D1 7F 3F 39 EE 68 2D B4 9E 62
|
||||
00A0 | FA 05 90 95 98 ED AA 12 E6 AE C6 6A 71 E5 C9 97
|
||||
00B0 | F1 36 6D C0 18 7B 78 7E 34 ED 75 08 7C 71 49 93
|
||||
00C0 | 4A 87 43 5C C3 29 55 45 D0 2B F4 E6 99 84 2D 3D
|
||||
00D0 | 95 37 2B FD 25 F6 B6 DB 7D CC 48 DA 92 83 A6 24
|
||||
00E0 | CA 7E 45 CA CA CA A4 C7 3C 39 50 04 FC 2E 85 4F
|
||||
00F0 | E7 05 51 CD 7B 78 C0 EC 1B AC 59 8A 43 C5 97 E1
|
||||
0100 | 12 E5 74 CD DC 9E CD 31 50 35 5E 0C 4C 82 AE 24
|
||||
0110 | DD 7C CC 5B 4C AA 0E 89 5F 2E E6 01 88 BB 67 7E
|
||||
0120 | 82 DB 63 64 8A FA 21 62 7C A1 06 74 96 8E D0 42
|
||||
0130 | F9 B6 D9 7A 38 2B BB 79 E2 4D C3 6E 8D 0A 8E C3
|
||||
0140 | 7D EB D5 6E 0B E0 7E 5A A0 3D 22 28 02 FC D9 45
|
||||
0150 | 6A 68 61 85 12 12 0B 65 95 06 32 00 7F 34 8B 17
|
||||
0160 | 5D 8A 71 50 18 BD 3B 67 E8 27 3F D9 05 5F CA DF
|
||||
0170 | EC DC A5 0E F3 A8 DF D4 EE BD 5B 9A 24 C3 25 7E
|
||||
0180 | 35 58 4A 12 A1 AA 65 9D 9C 94 0B 41</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 FC 34 0E 00 8A 41 6A 65
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 C2 8F 15 55 BD 72 6E 6D
|
||||
0020 | 31 75 6E 83 F8 5D A7 39 F0 08 06 90 63 A5 C6 AF
|
||||
0030 | 2F 54 CD DD 23 3E 76 7C FE 50 01 00 51 6F 30 67
|
||||
0040 | F6 78 48 CB 09 49 98 58 B9 F2 99 72 98 A9 C0 08
|
||||
0050 | EC 04 24 20 41 D0 A7 AB 92 27 D2 55 5E 67 95 87
|
||||
0060 | BC F9 1A C6 DE 88 EC 06 4F C0 81 D4 11 78 B3 54
|
||||
0070 | 48 BE 38 7C 8B B6 1B A2 1D 8B 87 23 CE 47 DB BB
|
||||
0080 | 8E 6F AE 53 18 62 B0 95 88 2E 3D B0 7D 2E 19 39
|
||||
0090 | 68 37 E7 DB 53 8D 4B B1 1D 96 A0 E2 A0 00 D5 5B
|
||||
00A0 | 6F C7 08 5B 77 E1 7D 1C 1A EA D5 47 88 6F 6F 82
|
||||
00B0 | B9 66 24 F7 CB D7 CF C7 E4 60 FB 98 8F 7A D6 95
|
||||
00C0 | 1B B1 AC DB D3 CC 85 F0 EA C7 2A E2 06 C4 E5 9A
|
||||
00D0 | AA 46 85 05 62 27 B6 97 77 E3 7C C7 76 CC C6 98
|
||||
00E0 | 6A D0 DB 28 C0 B3 0F 1E E5 88 DD 4C BF EA 2B DB
|
||||
00F0 | B9 D6 36 BC 2B DB D0 FE 5F E0 2B 0E 22 3B 52 FB
|
||||
0100 | A8 51 78 D9 35 59 51 6C 06 F8 80 69 D0 22 97 8A
|
||||
0110 | 3D 00 9A 6F 52 F2 36 1C 76 D0 1A D9 40 76 2B 16
|
||||
0120 | 8C E3 40 5E AA 9F BD 53 F5 83 A0 CF 5E 93 93 B3
|
||||
0130 | 55 26 FF 7A 98 A0 5F 3D 5F 35 39 52 6D AA 89 63
|
||||
0140 | 01 C6 84 27 D4 89 87 BE D0 BF BE 82 D2 F1 0E BB
|
||||
0150 | 29 FA 6A B1 F4 3B 4C 4B 88 6D 07 FD 3D B0 78 7C
|
||||
0160 | FE 0A FC 63 97 CA F3 F5 52 0A 9D 27 8F AA D9 31
|
||||
0170 | E6 3C 6C 33 36 FD D0 CA 67 76 9E C4 A3 DE 8F C9
|
||||
0180 | CB 08 17 13 46 91 68 B5 C0 D2 7E 54</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>DC9D080036396A65</code></td>
|
||||
<td><code>FC340E008A416A65</code></td>
|
||||
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -764,19 +764,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>F821AC0F4FD4CEAAD0133FE2449F86D4</code></td>
|
||||
<td><code>C28F1555BD726E6D31756E83F85DA739</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>90998E8AAD0DA16E3B9950BF5A7AE899</code></td>
|
||||
<td><code>F008069063A5C6AF2F54CDDD233E767C</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>56, 340</td>
|
||||
<td><code>FE500100161550B26A25A0A55C07C586</code> <code>4C61B89109059D54AF6C38A79AFB50AD</code> <code>61F012E9EADD4BB61034971BF4ED90D9</code> <code>7BF67BCA23B3B54D02F831D74ABE5AB4</code> <code>03BB0410AF70856F08334CC38FA9783E</code> <code>11C399B1255FEFE481445D382FA6D17F</code> <code>3F39EE682DB49E62FA05909598EDAA12</code> <code>E6AEC66A71E5C997F1366DC0187B787E</code> <code>34ED75087C7149934A87435CC3295545</code> <code>D02BF4E699842D3D95372BFD25F6B6DB</code> <code>7DCC48DA9283A624CA7E45CACACAA4C7</code> <code>3C395004FC2E854FE70551CD7B78C0EC</code> <code>1BAC598A43C597E112E574CDDC9ECD31</code> <code>50355E0C4C82AE24DD7CCC5B4CAA0E89</code> <code>5F2EE60188BB677E82DB63648AFA2162</code> <code>7CA10674968ED042F9B6D97A382BBB79</code> <code>E24DC36E8D0A8EC37DEBD56E0BE07E5A</code> <code>A03D222802FCD9456A68618512120B65</code> <code>950632007F348B175D8A715018BD3B67</code> <code>E8273FD9055FCADFECDCA50EF3A8DFD4</code> <code>EEBD5B9A24C3257E35584A12A1AA659D</code><br> <code>9C940B41</code></td>
|
||||
<td><code>FE500100516F3067F67848CB09499858</code> <code>B9F2997298A9C008EC04242041D0A7AB</code> <code>9227D2555E679587BCF91AC6DE88EC06</code> <code>4FC081D41178B35448BE387C8BB61BA2</code> <code>1D8B8723CE47DBBB8E6FAE531862B095</code> <code>882E3DB07D2E19396837E7DB538D4BB1</code> <code>1D96A0E2A000D55B6FC7085B77E17D1C</code> <code>1AEAD547886F6F82B96624F7CBD7CFC7</code> <code>E460FB988F7AD6951BB1ACDBD3CC85F0</code> <code>EAC72AE206C4E59AAA4685056227B697</code> <code>77E37CC776CCC6986AD0DB28C0B30F1E</code> <code>E588DD4CBFEA2BDBB9D636BC2BDBD0FE</code> <code>5FE02B0E223B52FBA85178D93559516C</code> <code>06F88069D022978A3D009A6F52F2361C</code> <code>76D01AD940762B168CE3405EAA9FBD53</code> <code>F583A0CF5E9393B35526FF7A98A05F3D</code> <code>5F3539526DAA896301C68427D48987BE</code> <code>D0BFBE82D2F10EBB29FA6AB1F43B4C4B</code> <code>886D07FD3DB0787CFE0AFC6397CAF3F5</code> <code>520A9D278FAAD931E63C6C3336FDD0CA</code> <code>67769EC4A3DE8FC9CB081713469168B5</code><br> <code>C0D27E54</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 = 3AFBF11452128AA72F132B1A687B8E19BAA16F91704CE5D19B0167AA78864581EB1160850CE88C019A6BBE35574DE258FB93C632F7149441B1D203C91CA41D876D94870821886BE34C2D8477CB820E260DD658AD4EA8B8867E8AB65E2F12CE81B271B3A9D9F0259C7257EBA6C78908005D500D9359C336FF7058FAEB3C4FD167C12E50A274394F201AA11B420A3BD9AB94D3184BA532FC2D2F70ADDD73F7600A8686716FB9C52B02AB1D68A9B841FC0923049F8AA8AB7D3BAA479CF16F99BACF97239B68FB637D0FD419A4924A24D5A0ACE20047CB37A4C05B0BA35D4FA2847B4D65B7EF5716DAB5C41C652EB9BF100AE92A5A432D533342E6DD870ED4E13B8F</code></pre>
|
||||
<pre><code>auth_key = 6AA456AF3C05911B9AE9AAF4331B1AD44C5DE8A2975EAECEE51B0EAE3E7B1E8AD72BC88E5D2575782F33D3074783AD6366FCD32F6ABB9D43EAB19E8BCBFD21DEDC7BF54C56A7F9F753A01F8570F62352525B05595A974B37E9F65C683730E3FAE4CA7B43B808B475D01F40B71D78CF682C9B7C7D116BCE35F9083438A77570D0C3E81648F4AE1496F2BF1CE0CA15EE027283129B0F6B76BDB5B144217F4C0E3C2CF9D394158972E3FBA423601C1F01EC905AE2601B3E58C29CE83C61BA943509AE0CE8C5BE8F792DFCEA569CA782D4F378638BDC9FED866B6288935225391C1E070F8D3920CB9A473907C814E8E5554782B97CA654E4DCEE982C4FAFC826A7AA</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 80 C0 93 36 39 6A 65
|
||||
0010 | A0 00 00 00 34 F7 CB 3B F8 21 AC 0F 4F D4 CE AA
|
||||
0020 | D0 13 3F E2 44 9F 86 D4 90 99 8E 8A AD 0D A1 6E
|
||||
0030 | 3B 99 50 BF 5A 7A E8 99 C2 97 BF 31 2D 62 6C C0
|
||||
0040 | 9E 84 15 52 67 36 CB DC</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 98 F1 5C 8A 41 6A 65
|
||||
0010 | 40 00 00 00 34 F7 CB 3B C2 8F 15 55 BD 72 6E 6D
|
||||
0020 | 31 75 6E 83 F8 5D A7 39 F0 08 06 90 63 A5 C6 AF
|
||||
0030 | 2F 54 CD DD 23 3E 76 7C F2 4C DB 7D 46 6D 0D 12
|
||||
0040 | 14 6F 26 88 EC 56 9A A9</code></pre>
|
||||
<p>Payload (de)serialization:</p>
|
||||
<pre><code>dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;</code></pre>
|
||||
<table class="table">
|
||||
|
@ -817,13 +817,13 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>0180C09336396A65</code></td>
|
||||
<td><code>0198F15C8A416A65</code></td>
|
||||
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>message_length</td>
|
||||
<td>16, 4</td>
|
||||
<td><code>A0000000</code> (160 in decimal)</td>
|
||||
<td><code>40000000</code> (64 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -835,19 +835,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>F821AC0F4FD4CEAAD0133FE2449F86D4</code></td>
|
||||
<td><code>C28F1555BD726E6D31756E83F85DA739</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>90998E8AAD0DA16E3B9950BF5A7AE899</code></td>
|
||||
<td><code>F008069063A5C6AF2F54CDDD233E767C</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce_hash1</td>
|
||||
<td>56, 16</td>
|
||||
<td><code>C297BF312D626CC09E8415526736CBDC</code></td>
|
||||
<td><code>F24CDB7D466D0D12146F2688EC569AA9</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>
|
||||
|
|
|
@ -1302,11 +1302,13 @@ var Random = {
|
|||
var LoginCodes = {
|
||||
init: function() {
|
||||
Aj.onLoad(function(state) {
|
||||
$('.js-toggle-receive').on('change', LoginCodes.eToggleReceive);
|
||||
state.needUpdate = true;
|
||||
state.updLastReq = +Date.now();
|
||||
state.updStateTo = setTimeout(LoginCodes.updateState, Main.UPDATE_PERIOD);
|
||||
});
|
||||
Aj.onUnload(function(state) {
|
||||
$('.js-toggle-receive').off('change', LoginCodes.eToggleReceive);
|
||||
clearTimeout(state.updStateTo);
|
||||
state.needUpdate = false;
|
||||
});
|
||||
|
@ -1337,6 +1339,14 @@ var LoginCodes = {
|
|||
}
|
||||
|
||||
}
|
||||
},
|
||||
eToggleReceive: function() {
|
||||
var can_receive = $(this).prop('checked');
|
||||
$('.js-codes-main').toggleClass('codes-disabled', !can_receive);
|
||||
Aj.apiRequest('toggleLoginCodes', {
|
||||
number: Aj.state.number,
|
||||
can_receive: can_receive ? 1 : 0
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue