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
10844a9890
commit
f7469cf058
4 changed files with 209 additions and 211 deletions
|
@ -129,8 +129,6 @@
|
|||
<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="#messagestogglebotinattachmenu" id="messagestogglebotinattachmenu" name="messagestogglebotinattachmenu"><i class="anchor-icon"></i></a><a href="/method/messages.toggleBotInAttachMenu">messages.toggleBotInAttachMenu</a></h4>
|
||||
<p>Enable or disable <a href="/api/bots/attach">web bot attachment menu »</a></p>
|
||||
<h4><a class="anchor" href="#mini-apps-on-telegram" id="mini-apps-on-telegram" name="mini-apps-on-telegram"><i class="anchor-icon"></i></a><a href="/api/bots/webapps">Mini Apps on Telegram</a></h4>
|
||||
<p>Bots can offer users interactive HTML5 web apps to completely replace any website.</p>
|
||||
<h4><a class="anchor" href="#bot-attachment-menu-and-side-menu-entries" id="bot-attachment-menu-and-side-menu-entries" name="bot-attachment-menu-and-side-menu-entries"><i class="anchor-icon"></i></a><a href="/api/bots/attach">Bot attachment menu and side menu entries</a></h4>
|
||||
<p>Bots can install attachment menu and side menu entries, offering conveniently accessible, versatile web apps.</p></div>
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
<tr>
|
||||
<td><strong>has_settings</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.2?<a href="/constructor/true">true</a></td>
|
||||
<td> </td>
|
||||
<td>Deprecated flag, can be ignored.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>app</strong></td>
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
<tr>
|
||||
<td><strong>pts_limit</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.1?<a href="/type/int">int</a></td>
|
||||
<td> </td>
|
||||
<td>PTS limit</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>pts_total_limit</strong></td>
|
||||
|
@ -104,7 +104,7 @@
|
|||
<tr>
|
||||
<td><strong>qts_limit</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.2?<a href="/type/int">int</a></td>
|
||||
<td> </td>
|
||||
<td>QTS limit</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -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 F0 E6 05 00 1C 31 87 65
|
||||
0010 | 14 00 00 00 F1 8E 7E BE FB E9 D8 14 18 04 88 D9
|
||||
0020 | D5 41 F4 89 59 74 00 FB</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 18 78 03 00 C8 32 87 65
|
||||
0010 | 14 00 00 00 F1 8E 7E BE 7E 79 38 C1 4A B7 30 24
|
||||
0020 | C3 94 DB C0 E8 0A 6B 5D</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>F0E605001C318765</code></td>
|
||||
<td><code>18780300C8328765</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>FBE9D814180488D9D541F489597400FB</code></td>
|
||||
<td><code>7E7938C14AB73024C394DBC0E80A6B5D</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 3C 50 77 1C 31 87 65
|
||||
0010 | 90 00 00 00 63 24 16 05 FB E9 D8 14 18 04 88 D9
|
||||
0020 | D5 41 F4 89 59 74 00 FB C8 49 6E 59 A0 44 46 E9
|
||||
0030 | 55 7D 76 EB A3 4A 6C 3E 08 19 6C 8A AD 08 45 5B
|
||||
0040 | A1 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 FC A6 AD C8 32 87 65
|
||||
0010 | 78 00 00 00 63 24 16 05 7E 79 38 C1 4A B7 30 24
|
||||
0020 | C3 94 DB C0 E8 0A 6B 5D DD F3 95 25 25 82 2D BE
|
||||
0030 | 37 BB F1 5E 0D C8 A8 60 08 28 E2 34 CE A3 7B CB
|
||||
0040 | 47 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>013C50771C318765</code></td>
|
||||
<td><code>01FCA6ADC8328765</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>90000000</code> (144 in decimal)</td>
|
||||
<td><code>78000000</code> (120 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -150,19 +150,19 @@
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>FBE9D814180488D9D541F489597400FB</code></td>
|
||||
<td><code>7E7938C14AB73024C394DBC0E80A6B5D</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>C8496E59A04446E9557D76EBA34A6C3E</code></td>
|
||||
<td><code>DDF3952525822DBE37BBF15E0DC8A860</code></td>
|
||||
<td>Server-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pq</td>
|
||||
<td>56, 12</td>
|
||||
<td><code>08196C8AAD08455BA1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1831991624205687713</td>
|
||||
<td><code>0828E234CEA37BCB47000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2945975168364432199</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 = 1831991624205687713</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1831991624205687713 = 1001004743 * 1830152791</code></p>
|
||||
<pre><code>p = 1001004743
|
||||
q = 1830152791</code></pre>
|
||||
<pre><code>pq = 2945975168364432199</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2945975168364432199 = 1479472661 * 1991233259</code></p>
|
||||
<pre><code>p = 1479472661
|
||||
q = 1991233259</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 19 6C 8A AD 08 45 5B A1 00 00 00
|
||||
0010 | 04 3B AA 1E C7 00 00 00 04 6D 15 EA 57 00 00 00
|
||||
0020 | FB E9 D8 14 18 04 88 D9 D5 41 F4 89 59 74 00 FB
|
||||
0030 | C8 49 6E 59 A0 44 46 E9 55 7D 76 EB A3 4A 6C 3E
|
||||
0040 | AC DE 69 ED A8 E4 F6 E0 B3 5E 32 C5 30 2C 28 F5
|
||||
0050 | EB 29 FB 0C 57 6B 4E 77 C3 BB 73 64 36 79 A3 38
|
||||
<pre><code>0000 | 95 5F F5 A9 08 28 E2 34 CE A3 7B CB 47 00 00 00
|
||||
0010 | 04 58 2E F6 15 00 00 00 04 76 AF CE EB 00 00 00
|
||||
0020 | 7E 79 38 C1 4A B7 30 24 C3 94 DB C0 E8 0A 6B 5D
|
||||
0030 | DD F3 95 25 25 82 2D BE 37 BB F1 5E 0D C8 A8 60
|
||||
0040 | EA 18 94 A9 03 E6 FE 90 28 FD BF 7A 08 F3 00 DC
|
||||
0050 | B4 24 11 F7 B2 1F AB CF 35 F9 54 5C 32 AB 3D 74
|
||||
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 = 1830152791</code></pre>
|
|||
<tr>
|
||||
<td>pq</td>
|
||||
<td>4, 12</td>
|
||||
<td><code>08196C8AAD08455BA1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1831991624205687713</td>
|
||||
<td><code>0828E234CEA37BCB47000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2945975168364432199</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>043BAA1EC7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1001004743</td>
|
||||
<td><code>04582EF615000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1479472661</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>046D15EA57000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1830152791</td>
|
||||
<td><code>0476AFCEEB000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1991233259</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>FBE9D814180488D9D541F489597400FB</code></td>
|
||||
<td><code>7E7938C14AB73024C394DBC0E80A6B5D</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>48, 16</td>
|
||||
<td><code>C8496E59A04446E9557D76EBA34A6C3E</code></td>
|
||||
<td><code>DDF3952525822DBE37BBF15E0DC8A860</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce</td>
|
||||
<td>64, 32</td>
|
||||
<td><code>ACDE69EDA8E4F6E0B35E32C5302C28F5</code> <code>EB29FB0C576B4E77C3BB73643679A338</code></td>
|
||||
<td><code>EA1894A903E6FE9028FDBF7A08F300DC</code> <code>B42411F7B21FABCF35F9545C32AB3D74</code></td>
|
||||
<td>Client-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -291,39 +291,39 @@ q = 1830152791</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 = 955FF5A908196C8AAD08455BA1000000043BAA1EC7000000046D15EA57000000FBE9D814180488D9D541F489597400FBC8496E59A04446E9557D76EBA34A6C3EACDE69EDA8E4F6E0B35E32C5302C28F5EB29FB0C576B4E77C3BB73643679A33802000000
|
||||
random_padding_bytes = CA31988C6BA6D0F47616E688B340A1B8699A20C07EDB9751E6DEC5F5B4D93E34443AB4DD1830729A6DF2431F7E8A5E5A3B0533F511F15E793291F1C8D5EAC6450878A84F6407B21B6708A0928672893AEC2F4CEED863CE1DA1FD0251</code></pre>
|
||||
<pre><code>data = 955FF5A90828E234CEA37BCB4700000004582EF6150000000476AFCEEB0000007E7938C14AB73024C394DBC0E80A6B5DDDF3952525822DBE37BBF15E0DC8A860EA1894A903E6FE9028FDBF7A08F300DCB42411F7B21FABCF35F9545C32AB3D7402000000
|
||||
random_padding_bytes = 3D1339ACBAC2FAD94051E2552D22E156939320323A0F95E163E5D02A8AF9B3E03D061C0C1FD9113C29439A04A7B2C1B998BA5A02E9DE2807079582B2E1A5EDF6E9D698C2D95780F5F4729F9584DFC05806E97867DB8D8971D9A4C721</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 = 561AFBEC48FFDE4F2B4B0B5BCE8E6A48854D09FFF124AFFA9524A321901FDB58B79E090CE4576EF26567C5CF82DA204F1FA04A64576124569577230F60FD00C81C89F8BB9257AEF7417F729CC44304D3B8AB0006801952A9C399166DDC1EE3FBD910D982582A9FD27A4D53696EB925B245A4249128FE9B3F5B0DB5E1B615E5E300EA7F3B26F358A92B10DEBCB40371E20797E3161F4F1D93D17F4C08A7523AB6F3B85F25EFB05A35667272002BA7FFAEF8D4A7AD34D1C5545C0B14EEF3CFC2F7E724D9BFC616E628827FB63BBC7CD79DE39FF6F695121A0409149A8F4FC6E8C776A5AEF16C9A8E08E91C70877FC6706DCC39A0C84872143CDB51AEC7EDCC3391</code></pre>
|
||||
<pre><code>encrypted_data = C2DA62C8601D370E922F5F7CBCCA4255C84910E5DDE9B562336BBBB7215B94E2F82C9C288C64F48FABE0140A5138C54F42879C21F7383FEC315989EB1EA95010EC6E78130037C490D40C3405EB69DD9A54FD9A1AB2F14D5086E8321E7D150E62F42D0B87C8A6C5AE07C9B53A21EB868509D4C96B5C13C45C230B58CAB63F7FC77A3A717CFCFF6D41DA5C6DF2EF6DBABCFB98370F515D00E4888F2D4B5DE2F1A0E893AA77E2E42F040A64ECF2AC0AE536CB3DE13BF17D7BC9AAACFB69FB28DAADBB198D4ED7FC512F50CC864758C1237B96BF59E2C8201F6C91223DE666B3B74541DA315EA71E5E7817535514BD45A258D49789650A8FBF156C996D00303F5543</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 1C AA 09 00 1C 31 87 65
|
||||
0010 | 40 01 00 00 BE E4 12 D7 FB E9 D8 14 18 04 88 D9
|
||||
0020 | D5 41 F4 89 59 74 00 FB C8 49 6E 59 A0 44 46 E9
|
||||
0030 | 55 7D 76 EB A3 4A 6C 3E 04 3B AA 1E C7 00 00 00
|
||||
0040 | 04 6D 15 EA 57 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 56 1A FB EC 48 FF DE 4F 2B 4B 0B 5B
|
||||
0060 | CE 8E 6A 48 85 4D 09 FF F1 24 AF FA 95 24 A3 21
|
||||
0070 | 90 1F DB 58 B7 9E 09 0C E4 57 6E F2 65 67 C5 CF
|
||||
0080 | 82 DA 20 4F 1F A0 4A 64 57 61 24 56 95 77 23 0F
|
||||
0090 | 60 FD 00 C8 1C 89 F8 BB 92 57 AE F7 41 7F 72 9C
|
||||
00A0 | C4 43 04 D3 B8 AB 00 06 80 19 52 A9 C3 99 16 6D
|
||||
00B0 | DC 1E E3 FB D9 10 D9 82 58 2A 9F D2 7A 4D 53 69
|
||||
00C0 | 6E B9 25 B2 45 A4 24 91 28 FE 9B 3F 5B 0D B5 E1
|
||||
00D0 | B6 15 E5 E3 00 EA 7F 3B 26 F3 58 A9 2B 10 DE BC
|
||||
00E0 | B4 03 71 E2 07 97 E3 16 1F 4F 1D 93 D1 7F 4C 08
|
||||
00F0 | A7 52 3A B6 F3 B8 5F 25 EF B0 5A 35 66 72 72 00
|
||||
0100 | 2B A7 FF AE F8 D4 A7 AD 34 D1 C5 54 5C 0B 14 EE
|
||||
0110 | F3 CF C2 F7 E7 24 D9 BF C6 16 E6 28 82 7F B6 3B
|
||||
0120 | BC 7C D7 9D E3 9F F6 F6 95 12 1A 04 09 14 9A 8F
|
||||
0130 | 4F C6 E8 C7 76 A5 AE F1 6C 9A 8E 08 E9 1C 70 87
|
||||
0140 | 7F C6 70 6D CC 39 A0 C8 48 72 14 3C DB 51 AE C7
|
||||
0150 | ED CC 33 91</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 8C 68 08 00 C8 32 87 65
|
||||
0010 | 40 01 00 00 BE E4 12 D7 7E 79 38 C1 4A B7 30 24
|
||||
0020 | C3 94 DB C0 E8 0A 6B 5D DD F3 95 25 25 82 2D BE
|
||||
0030 | 37 BB F1 5E 0D C8 A8 60 04 58 2E F6 15 00 00 00
|
||||
0040 | 04 76 AF CE EB 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 C2 DA 62 C8 60 1D 37 0E 92 2F 5F 7C
|
||||
0060 | BC CA 42 55 C8 49 10 E5 DD E9 B5 62 33 6B BB B7
|
||||
0070 | 21 5B 94 E2 F8 2C 9C 28 8C 64 F4 8F AB E0 14 0A
|
||||
0080 | 51 38 C5 4F 42 87 9C 21 F7 38 3F EC 31 59 89 EB
|
||||
0090 | 1E A9 50 10 EC 6E 78 13 00 37 C4 90 D4 0C 34 05
|
||||
00A0 | EB 69 DD 9A 54 FD 9A 1A B2 F1 4D 50 86 E8 32 1E
|
||||
00B0 | 7D 15 0E 62 F4 2D 0B 87 C8 A6 C5 AE 07 C9 B5 3A
|
||||
00C0 | 21 EB 86 85 09 D4 C9 6B 5C 13 C4 5C 23 0B 58 CA
|
||||
00D0 | B6 3F 7F C7 7A 3A 71 7C FC FF 6D 41 DA 5C 6D F2
|
||||
00E0 | EF 6D BA BC FB 98 37 0F 51 5D 00 E4 88 8F 2D 4B
|
||||
00F0 | 5D E2 F1 A0 E8 93 AA 77 E2 E4 2F 04 0A 64 EC F2
|
||||
0100 | AC 0A E5 36 CB 3D E1 3B F1 7D 7B C9 AA AC FB 69
|
||||
0110 | FB 28 DA AD BB 19 8D 4E D7 FC 51 2F 50 CC 86 47
|
||||
0120 | 58 C1 23 7B 96 BF 59 E2 C8 20 1F 6C 91 22 3D E6
|
||||
0130 | 66 B3 B7 45 41 DA 31 5E A7 1E 5E 78 17 53 55 14
|
||||
0140 | BD 45 A2 58 D4 97 89 65 0A 8F BF 15 6C 99 6D 00
|
||||
0150 | 30 3F 55 43</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 = CA31988C6BA6D0F47616E688B340A1B8699A20C07EDB9751E6DEC5F5B
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>1CAA09001C318765</code></td>
|
||||
<td><code>8C680800C8328765</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 = CA31988C6BA6D0F47616E688B340A1B8699A20C07EDB9751E6DEC5F5B
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>FBE9D814180488D9D541F489597400FB</code></td>
|
||||
<td><code>7E7938C14AB73024C394DBC0E80A6B5D</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>C8496E59A04446E9557D76EBA34A6C3E</code></td>
|
||||
<td><code>DDF3952525822DBE37BBF15E0DC8A860</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p</td>
|
||||
<td>56, 8</td>
|
||||
<td><code>043BAA1EC7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1001004743</td>
|
||||
<td><code>04582EF615000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1479472661</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>046D15EA57000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1830152791</td>
|
||||
<td><code>0476AFCEEB000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1991233259</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 = CA31988C6BA6D0F47616E688B340A1B8699A20C07EDB9751E6DEC5F5B
|
|||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>80, 260</td>
|
||||
<td><code>FE000100561AFBEC48FFDE4F2B4B0B5B</code> <code>CE8E6A48854D09FFF124AFFA9524A321</code> <code>901FDB58B79E090CE4576EF26567C5CF</code> <code>82DA204F1FA04A64576124569577230F</code> <code>60FD00C81C89F8BB9257AEF7417F729C</code> <code>C44304D3B8AB0006801952A9C399166D</code> <code>DC1EE3FBD910D982582A9FD27A4D5369</code> <code>6EB925B245A4249128FE9B3F5B0DB5E1</code> <code>B615E5E300EA7F3B26F358A92B10DEBC</code> <code>B40371E20797E3161F4F1D93D17F4C08</code> <code>A7523AB6F3B85F25EFB05A3566727200</code> <code>2BA7FFAEF8D4A7AD34D1C5545C0B14EE</code> <code>F3CFC2F7E724D9BFC616E628827FB63B</code> <code>BC7CD79DE39FF6F695121A0409149A8F</code> <code>4FC6E8C776A5AEF16C9A8E08E91C7087</code> <code>7FC6706DCC39A0C84872143CDB51AEC7</code><br> <code>EDCC3391</code></td>
|
||||
<td><code>FE000100C2DA62C8601D370E922F5F7C</code> <code>BCCA4255C84910E5DDE9B562336BBBB7</code> <code>215B94E2F82C9C288C64F48FABE0140A</code> <code>5138C54F42879C21F7383FEC315989EB</code> <code>1EA95010EC6E78130037C490D40C3405</code> <code>EB69DD9A54FD9A1AB2F14D5086E8321E</code> <code>7D150E62F42D0B87C8A6C5AE07C9B53A</code> <code>21EB868509D4C96B5C13C45C230B58CA</code> <code>B63F7FC77A3A717CFCFF6D41DA5C6DF2</code> <code>EF6DBABCFB98370F515D00E4888F2D4B</code> <code>5DE2F1A0E893AA77E2E42F040A64ECF2</code> <code>AC0AE536CB3DE13BF17D7BC9AAACFB69</code> <code>FB28DAADBB198D4ED7FC512F50CC8647</code> <code>58C1237B96BF59E2C8201F6C91223DE6</code> <code>66B3B74541DA315EA71E5E7817535514</code> <code>BD45A258D49789650A8FBF156C996D00</code><br> <code>303F5543</code></td>
|
||||
<td>Value generated above</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -402,47 +402,47 @@ random_padding_bytes = CA31988C6BA6D0F47616E688B340A1B8699A20C07EDB9751E6DEC5F5B
|
|||
<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 8C A7 2D 1D 31 87 65
|
||||
0010 | D8 02 00 00 5C 07 E8 D0 FB E9 D8 14 18 04 88 D9
|
||||
0020 | D5 41 F4 89 59 74 00 FB C8 49 6E 59 A0 44 46 E9
|
||||
0030 | 55 7D 76 EB A3 4A 6C 3E FE 50 02 00 CD CA 52 C6
|
||||
0040 | 8F 39 51 2A 6E C7 85 01 7C 6E BD D1 B2 3B 9E C8
|
||||
0050 | 04 8A 73 A5 FB EA 8D F4 86 18 19 9D E0 E9 E5 A3
|
||||
0060 | 07 AD B8 3F D3 65 46 61 28 75 F2 39 7E A8 96 B2
|
||||
0070 | 4F D3 63 A8 F9 A2 98 20 27 E4 51 D0 F3 0F 99 C6
|
||||
0080 | 81 FD 69 8E 80 BF 8D DA A1 3A 43 ED C4 E1 0A 55
|
||||
0090 | CE 4F 29 BB 7D DE 64 40 05 51 EB 5F D4 9E 2D 11
|
||||
00A0 | 8D CA E8 F4 23 47 32 89 57 59 C0 3A D9 43 08 E6
|
||||
00B0 | 0E 60 DC 32 9B 0A 18 28 9A 68 E3 FF 9F 92 38 51
|
||||
00C0 | 5E AA C1 93 1A F3 90 13 49 7B 6D 46 F6 AE 8F BC
|
||||
00D0 | 20 22 11 27 9D F4 7C 88 67 41 B3 91 60 E6 D4 C5
|
||||
00E0 | 52 8C 05 C9 83 38 E2 6E A0 8D A0 AB ED D2 19 D0
|
||||
00F0 | 44 3D FB 2E C9 8F D1 95 51 EB AF 1A 1C 26 33 3B
|
||||
0100 | 40 16 29 EF BD 83 3B 5F 53 99 17 35 4C 28 06 0C
|
||||
0110 | 9D 87 96 D0 80 1F 04 BD 05 89 3A 0C B0 84 9E CF
|
||||
0120 | 29 ED 8B 00 39 56 9C 9E 1C 1A 42 3A A0 88 3D 98
|
||||
0130 | 73 E7 8B 61 52 EB 7D AC 25 A4 84 17 36 23 2F 74
|
||||
0140 | 92 F1 D0 17 80 B1 09 6B 31 22 5F ED CE AA D9 5C
|
||||
0150 | FB A6 4F 03 25 D7 24 DC 62 22 B5 C3 BD 52 E6 81
|
||||
0160 | 67 59 66 81 E8 0E D0 7B 3B 9E 58 17 F3 0D 30 F0
|
||||
0170 | CD BE 20 08 F7 78 67 1A DC 4E C6 35 88 C5 7C F6
|
||||
0180 | D4 E1 42 28 58 14 10 D3 79 E1 3F DB E7 69 01 3B
|
||||
0190 | 48 10 6B F7 4B EA 66 8C F3 0C 3B 89 28 25 20 BD
|
||||
01A0 | 44 57 72 B9 43 AC 32 0C 6C 69 37 E7 CE 7E E5 37
|
||||
01B0 | 84 FD A5 A7 A9 96 7E 1B DB 73 04 30 51 E6 F6 FD
|
||||
01C0 | 80 4D 49 97 89 BD C0 1E 72 FC F6 AD AD DA 26 F0
|
||||
01D0 | D8 3C 43 F4 32 F1 8A 6C 14 D0 49 1E B2 B4 FF 35
|
||||
01E0 | F7 93 D0 23 94 DA D1 F3 C6 2D 9E 90 F2 11 CA A6
|
||||
01F0 | E9 3C 55 BE 22 44 29 4C 97 C6 97 37 6E F7 B2 BB
|
||||
0200 | 09 C9 4C 26 8E 69 F2 54 3F 5C EF 20 40 3D FD 2D
|
||||
0210 | 9F E6 4A 71 84 C6 D0 96 FA 64 E9 32 84 05 79 75
|
||||
0220 | 0A CF C7 6A A8 FD 79 66 69 E1 1B 88 AC 69 64 F6
|
||||
0230 | 95 E4 96 9B 96 15 4E F1 8F D1 D0 79 5E B8 50 F7
|
||||
0240 | ED 99 2A ED B9 4B E7 0F 18 81 03 40 74 4A 47 36
|
||||
0250 | 9E 11 AF 11 46 18 6F EB 6F 17 F3 B5 49 59 49 68
|
||||
0260 | 00 E9 BD 97 AD 05 DA CF 78 8E BB DD 85 A5 14 68
|
||||
0270 | 4D A7 14 30 90 EF 56 04 AE D2 C5 BB EF F8 6F 7A
|
||||
0280 | 4A 0B 09 D2 28 5B E9 F8 5C B8 79 E5</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 64 67 6B C9 32 87 65
|
||||
0010 | C8 02 00 00 5C 07 E8 D0 7E 79 38 C1 4A B7 30 24
|
||||
0020 | C3 94 DB C0 E8 0A 6B 5D DD F3 95 25 25 82 2D BE
|
||||
0030 | 37 BB F1 5E 0D C8 A8 60 FE 50 02 00 11 7B 12 70
|
||||
0040 | 27 9D F6 38 53 71 04 69 06 D7 7C 00 74 2E 68 54
|
||||
0050 | D6 A8 14 12 42 4F AD 5C B9 63 3D 68 21 53 D9 79
|
||||
0060 | 7A 4C 4F 10 EF 56 61 6B 9C 52 AA 5D 03 B8 4D A7
|
||||
0070 | 27 39 15 5A BC D0 6A 24 C3 83 5C A3 F4 0D 31 22
|
||||
0080 | 6F D8 B3 2A BF FE 68 AA 4E 19 7B 91 43 2E ED 29
|
||||
0090 | 97 48 B6 1F B6 CB E1 43 A5 E7 E1 30 DB 41 C9 30
|
||||
00A0 | C8 79 F8 FC 77 98 0C 72 B8 15 02 16 62 1D 53 B7
|
||||
00B0 | 31 2A DE 47 3D 5B 0A A1 79 92 C2 B1 06 52 E9 E8
|
||||
00C0 | DF 20 E4 66 3B CB 3B 2B 1C 5E 36 02 E4 F6 CA 87
|
||||
00D0 | F7 EC CF 33 A7 49 28 DB 8E 2F B0 C3 FF 4A F9 75
|
||||
00E0 | B0 51 32 50 09 93 B6 63 01 19 00 4D 05 1C B2 BA
|
||||
00F0 | 3F CA B2 82 38 C8 8F 0A 8A 91 B5 B5 24 2D F3 71
|
||||
0100 | B2 4A EE F1 C1 2D 83 3D 49 3C 5F 24 9C E9 4C 4F
|
||||
0110 | C1 AC 1F 50 3C C0 51 EB BB B2 7C 72 27 FE 89 56
|
||||
0120 | 94 A5 A4 92 F3 F0 56 EC B7 55 54 C7 F3 96 14 B6
|
||||
0130 | B6 C6 DD CA BB 4A 86 32 65 A3 6C EC B3 06 C8 F2
|
||||
0140 | EF 52 AE D8 AE CD 3D AD 04 3B 1C E7 F1 D8 BC F4
|
||||
0150 | 0F B3 B3 AA AF C7 BB EE 9A 32 67 36 EF 1A 87 FA
|
||||
0160 | 0A BB 18 BD D1 AF AC AA DB 0D CF 23 D5 9D 0A 6A
|
||||
0170 | F9 0E 76 A0 85 98 14 49 5E 76 D2 D9 9B 23 0F 46
|
||||
0180 | 9E FD F3 D1 4A 04 D2 D4 8D 89 23 2E 98 DE 50 79
|
||||
0190 | 21 D4 4E 58 00 13 F7 67 1C 9A 12 7A E3 EB 43 06
|
||||
01A0 | 46 67 71 C2 01 9E 88 C6 0F E1 62 30 19 05 CD 85
|
||||
01B0 | 55 B4 D3 80 F2 6A 10 93 D7 BE 05 27 10 5A DE EE
|
||||
01C0 | 7A CD AF 3A 91 56 2E F0 3F 76 B0 C9 81 73 AE 1E
|
||||
01D0 | 18 60 D7 B7 2C 1D 1F BF 20 8D FC 02 69 0D 17 81
|
||||
01E0 | 3A 26 A2 B4 7B B8 C3 6A 26 FC 41 01 0D 2E 2B 79
|
||||
01F0 | FF F6 C3 D1 0D B0 6A 66 CA CC B7 0D F1 5D 4A 51
|
||||
0200 | 6A DA 5A 7E 95 C1 D0 B0 FC AB 52 0A 6B 73 92 06
|
||||
0210 | E5 5B 68 C5 E6 18 90 51 FF B4 46 67 32 80 A4 BB
|
||||
0220 | 62 B5 E3 FC 0F 70 40 6B D6 CA 60 D6 4E 46 80 98
|
||||
0230 | 43 66 57 52 E3 6D FF 40 92 38 07 4F F5 7D C9 A4
|
||||
0240 | A2 88 76 F2 B4 FF 6A 54 97 A6 F3 BA 82 B9 13 8B
|
||||
0250 | B8 12 0D 2E 77 96 30 09 82 C5 F1 B8 82 DD FD 03
|
||||
0260 | DC E7 83 E6 89 05 E7 BB C2 10 6E ED 65 A8 69 71
|
||||
0270 | 3F 6D 4D 5D 2A 60 2F ED 31 A9 2F 31 E2 6F 46 AB
|
||||
0280 | 1F 5B 3B 71 FB 06 08 D1 3A 5A 57 49</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 = CA31988C6BA6D0F47616E688B340A1B8699A20C07EDB9751E6DEC5F5B
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>018CA72D1D318765</code></td>
|
||||
<td><code>0164676BC9328765</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>D8020000</code> (728 in decimal)</td>
|
||||
<td><code>C8020000</code> (712 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -482,19 +482,19 @@ random_padding_bytes = CA31988C6BA6D0F47616E688B340A1B8699A20C07EDB9751E6DEC5F5B
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>FBE9D814180488D9D541F489597400FB</code></td>
|
||||
<td><code>7E7938C14AB73024C394DBC0E80A6B5D</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>C8496E59A04446E9557D76EBA34A6C3E</code></td>
|
||||
<td><code>DDF3952525822DBE37BBF15E0DC8A860</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_answer</td>
|
||||
<td>56, 596</td>
|
||||
<td><code>FE500200CDCA52C68F39512A6EC78501</code> <code>7C6EBDD1B23B9EC8048A73A5FBEA8DF4</code> <code>8618199DE0E9E5A307ADB83FD3654661</code> <code>2875F2397EA896B24FD363A8F9A29820</code> <code>27E451D0F30F99C681FD698E80BF8DDA</code> <code>A13A43EDC4E10A55CE4F29BB7DDE6440</code> <code>0551EB5FD49E2D118DCAE8F423473289</code> <code>5759C03AD94308E60E60DC329B0A1828</code> <code>9A68E3FF9F9238515EAAC1931AF39013</code> <code>497B6D46F6AE8FBC202211279DF47C88</code> <code>6741B39160E6D4C5528C05C98338E26E</code> <code>A08DA0ABEDD219D0443DFB2EC98FD195</code> <code>51EBAF1A1C26333B401629EFBD833B5F</code> <code>539917354C28060C9D8796D0801F04BD</code> <code>05893A0CB0849ECF29ED8B0039569C9E</code> <code>1C1A423AA0883D9873E78B6152EB7DAC</code> <code>25A4841736232F7492F1D01780B1096B</code> <code>31225FEDCEAAD95CFBA64F0325D724DC</code> <code>6222B5C3BD52E68167596681E80ED07B</code> <code>3B9E5817F30D30F0CDBE2008F778671A</code> <code>DC4EC63588C57CF6D4E14228581410D3</code> <code>79E13FDBE769013B48106BF74BEA668C</code> <code>F30C3B89282520BD445772B943AC320C</code> <code>6C6937E7CE7EE53784FDA5A7A9967E1B</code> <code>DB73043051E6F6FD804D499789BDC01E</code> <code>72FCF6ADADDA26F0D83C43F432F18A6C</code> <code>14D0491EB2B4FF35F793D02394DAD1F3</code> <code>C62D9E90F211CAA6E93C55BE2244294C</code> <code>97C697376EF7B2BB09C94C268E69F254</code> <code>3F5CEF20403DFD2D9FE64A7184C6D096</code> <code>FA64E932840579750ACFC76AA8FD7966</code> <code>69E11B88AC6964F695E4969B96154EF1</code> <code>8FD1D0795EB850F7ED992AEDB94BE70F</code> <code>18810340744A47369E11AF1146186FEB</code> <code>6F17F3B54959496800E9BD97AD05DACF</code> <code>788EBBDD85A514684DA7143090EF5604</code> <code>AED2C5BBEFF86F7A4A0B09D2285BE9F8</code><br> <code>5CB879E5</code></td>
|
||||
<td><code>FE500200117B1270279DF63853710469</code> <code>06D77C00742E6854D6A81412424FAD5C</code> <code>B9633D682153D9797A4C4F10EF56616B</code> <code>9C52AA5D03B84DA72739155ABCD06A24</code> <code>C3835CA3F40D31226FD8B32ABFFE68AA</code> <code>4E197B91432EED299748B61FB6CBE143</code> <code>A5E7E130DB41C930C879F8FC77980C72</code> <code>B8150216621D53B7312ADE473D5B0AA1</code> <code>7992C2B10652E9E8DF20E4663BCB3B2B</code> <code>1C5E3602E4F6CA87F7ECCF33A74928DB</code> <code>8E2FB0C3FF4AF975B05132500993B663</code> <code>0119004D051CB2BA3FCAB28238C88F0A</code> <code>8A91B5B5242DF371B24AEEF1C12D833D</code> <code>493C5F249CE94C4FC1AC1F503CC051EB</code> <code>BBB27C7227FE895694A5A492F3F056EC</code> <code>B75554C7F39614B6B6C6DDCABB4A8632</code> <code>65A36CECB306C8F2EF52AED8AECD3DAD</code> <code>043B1CE7F1D8BCF40FB3B3AAAFC7BBEE</code> <code>9A326736EF1A87FA0ABB18BDD1AFACAA</code> <code>DB0DCF23D59D0A6AF90E76A085981449</code> <code>5E76D2D99B230F469EFDF3D14A04D2D4</code> <code>8D89232E98DE507921D44E580013F767</code> <code>1C9A127AE3EB4306466771C2019E88C6</code> <code>0FE162301905CD8555B4D380F26A1093</code> <code>D7BE0527105ADEEE7ACDAF3A91562EF0</code> <code>3F76B0C98173AE1E1860D7B72C1D1FBF</code> <code>208DFC02690D17813A26A2B47BB8C36A</code> <code>26FC41010D2E2B79FFF6C3D10DB06A66</code> <code>CACCB70DF15D4A516ADA5A7E95C1D0B0</code> <code>FCAB520A6B739206E55B68C5E6189051</code> <code>FFB446673280A4BB62B5E3FC0F70406B</code> <code>D6CA60D64E46809843665752E36DFF40</code> <code>9238074FF57DC9A4A28876F2B4FF6A54</code> <code>97A6F3BA82B9138BB8120D2E77963009</code> <code>82C5F1B882DDFD03DCE783E68905E7BB</code> <code>C2106EED65A869713F6D4D5D2A602FED</code> <code>31A92F31E26F46AB1F5B3B71FB0608D1</code><br> <code>3A5A5749</code></td>
|
||||
<td>See below</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -502,20 +502,20 @@ random_padding_bytes = CA31988C6BA6D0F47616E688B340A1B8699A20C07EDB9751E6DEC5F5B
|
|||
<!-- 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 = CDCA52C68F39512A6EC785017C6EBDD1B23B9EC8048A73A5FBEA8DF48618199DE0E9E5A307ADB83FD36546612875F2397EA896B24FD363A8F9A2982027E451D0F30F99C681FD698E80BF8DDAA13A43EDC4E10A55CE4F29BB7DDE64400551EB5FD49E2D118DCAE8F4234732895759C03AD94308E60E60DC329B0A18289A68E3FF9F9238515EAAC1931AF39013497B6D46F6AE8FBC202211279DF47C886741B39160E6D4C5528C05C98338E26EA08DA0ABEDD219D0443DFB2EC98FD19551EBAF1A1C26333B401629EFBD833B5F539917354C28060C9D8796D0801F04BD05893A0CB0849ECF29ED8B0039569C9E1C1A423AA0883D9873E78B6152EB7DAC25A4841736232F7492F1D01780B1096B31225FEDCEAAD95CFBA64F0325D724DC6222B5C3BD52E68167596681E80ED07B3B9E5817F30D30F0CDBE2008F778671ADC4EC63588C57CF6D4E14228581410D379E13FDBE769013B48106BF74BEA668CF30C3B89282520BD445772B943AC320C6C6937E7CE7EE53784FDA5A7A9967E1BDB73043051E6F6FD804D499789BDC01E72FCF6ADADDA26F0D83C43F432F18A6C14D0491EB2B4FF35F793D02394DAD1F3C62D9E90F211CAA6E93C55BE2244294C97C697376EF7B2BB09C94C268E69F2543F5CEF20403DFD2D9FE64A7184C6D096FA64E932840579750ACFC76AA8FD796669E11B88AC6964F695E4969B96154EF18FD1D0795EB850F7ED992AEDB94BE70F18810340744A47369E11AF1146186FEB6F17F3B54959496800E9BD97AD05DACF788EBBDD85A514684DA7143090EF5604AED2C5BBEFF86F7A4A0B09D2285BE9F85CB879E5
|
||||
tmp_aes_key = 050071522CD4EC58F1029B6A0DED20B8DEB6DB3D988487B3D57073640A5509ED
|
||||
tmp_aes_iv = 44744AEF8CA0A04940257D3E1D792720CBAFD0A13FFD92BE33D77071ACDE69ED</code></pre>
|
||||
<pre><code>encrypted_answer = 117B1270279DF6385371046906D77C00742E6854D6A81412424FAD5CB9633D682153D9797A4C4F10EF56616B9C52AA5D03B84DA72739155ABCD06A24C3835CA3F40D31226FD8B32ABFFE68AA4E197B91432EED299748B61FB6CBE143A5E7E130DB41C930C879F8FC77980C72B8150216621D53B7312ADE473D5B0AA17992C2B10652E9E8DF20E4663BCB3B2B1C5E3602E4F6CA87F7ECCF33A74928DB8E2FB0C3FF4AF975B05132500993B6630119004D051CB2BA3FCAB28238C88F0A8A91B5B5242DF371B24AEEF1C12D833D493C5F249CE94C4FC1AC1F503CC051EBBBB27C7227FE895694A5A492F3F056ECB75554C7F39614B6B6C6DDCABB4A863265A36CECB306C8F2EF52AED8AECD3DAD043B1CE7F1D8BCF40FB3B3AAAFC7BBEE9A326736EF1A87FA0ABB18BDD1AFACAADB0DCF23D59D0A6AF90E76A0859814495E76D2D99B230F469EFDF3D14A04D2D48D89232E98DE507921D44E580013F7671C9A127AE3EB4306466771C2019E88C60FE162301905CD8555B4D380F26A1093D7BE0527105ADEEE7ACDAF3A91562EF03F76B0C98173AE1E1860D7B72C1D1FBF208DFC02690D17813A26A2B47BB8C36A26FC41010D2E2B79FFF6C3D10DB06A66CACCB70DF15D4A516ADA5A7E95C1D0B0FCAB520A6B739206E55B68C5E6189051FFB446673280A4BB62B5E3FC0F70406BD6CA60D64E46809843665752E36DFF409238074FF57DC9A4A28876F2B4FF6A5497A6F3BA82B9138BB8120D2E7796300982C5F1B882DDFD03DCE783E68905E7BBC2106EED65A869713F6D4D5D2A602FED31A92F31E26F46AB1F5B3B71FB0608D13A5A5749
|
||||
tmp_aes_key = D28A87C0D70101BB2B10FB424BE653AE8EFB79805727725BD0189841E9004B8A
|
||||
tmp_aes_iv = FE8486D1C9DBCCC51BC4D8AFF6F9581FB6A086BC2F678552CF66D37BEA1894A9</code></pre>
|
||||
<!-- end server_DH_inner_data_input -->
|
||||
<p>Yielding:</p>
|
||||
<!-- start server_DH_inner_data_output -->
|
||||
<pre><code>answer_with_hash = B78BBC01EF7F1928AB5FEDF5711DDA3B7DDD74E2BA0D89B5FBE9D814180488D9D541F489597400FBC8496E59A04446E9557D76EBA34A6C3E03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000EBECA4AB9A6BD13C5469948B1587CD0BB5D994F5B3D982246AD4C518BA1E0E0EC627F5EC0F35816EED57ABAF2A6976C675DF84E2B7D36ED78EF66C355D88505947D59EF5A3458852D00E6431D4642597CACF0544C7522E62E58F55DC07D1DE01A0B603AC209A3D87B9DB4030813061C6D45604ABF3B3B605593BEAE6EDDFDB21E8DF4F9A81A89BA3E6E3A8F22ED0FBE08EAA492BF82C403C8E077BBF817C31324C6557D9AEC745FF2435A779B0DCB320AC591774FB10137DE81E65F75591A06399A3FAC28778F17A2B986AB3A8F4122B2CB404073AC80D27DA4699E02C5BC250EDF6B45A3612585576B95B9A7B0214A248EA3A0A267B34832BA10E53CFF3AFC1D3187650453E427FFAC57B7
|
||||
answer = BA0D89B5FBE9D814180488D9D541F489597400FBC8496E59A04446E9557D76EBA34A6C3E03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000EBECA4AB9A6BD13C5469948B1587CD0BB5D994F5B3D982246AD4C518BA1E0E0EC627F5EC0F35816EED57ABAF2A6976C675DF84E2B7D36ED78EF66C355D88505947D59EF5A3458852D00E6431D4642597CACF0544C7522E62E58F55DC07D1DE01A0B603AC209A3D87B9DB4030813061C6D45604ABF3B3B605593BEAE6EDDFDB21E8DF4F9A81A89BA3E6E3A8F22ED0FBE08EAA492BF82C403C8E077BBF817C31324C6557D9AEC745FF2435A779B0DCB320AC591774FB10137DE81E65F75591A06399A3FAC28778F17A2B986AB3A8F4122B2CB404073AC80D27DA4699E02C5BC250EDF6B45A3612585576B95B9A7B0214A248EA3A0A267B34832BA10E53CFF3AFC1D3187650453E427FFAC57B7</code></pre>
|
||||
<pre><code>answer_with_hash = CD620676A7F66F858B7AA1A7160C6423F43E4934BA0D89B57E7938C14AB73024C394DBC0E80A6B5DDDF3952525822DBE37BBF15E0DC8A86003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001004F6869C2282055E5119EB1046452FD4C2521575FA300221D0B350A58AE4196B6390518074614F869AD9705B929E15E9F05D1D3283D9FA8E3EF5702C04C3CFE05054266F759596D03F4FA731F74591F5D4B678A2975053C9D5294E879A43B1C8EE613082B7AD1FDABD75FCBE941EE19C2EAAD44BAB132355D509C4A816D9F59B486326899D8D1B5D22B8C6CD15F00040B5950D9ED6E3F8104EEC30DA48A4F5B37DACAC246A842FB9B535E9CD55D001FCC516A662203122F4A141D4B8BF8C8E9D5B1A84BD3F39296172A59420BA2E33729EFA6B78F7F27D53E0A4697490DA040FB730CC5B9D860530C17ACDA40FBFFC0A557D624B7C85D7AE8E75AA39E470540FEC93287653AFE6C493AF0C20F
|
||||
answer = BA0D89B57E7938C14AB73024C394DBC0E80A6B5DDDF3952525822DBE37BBF15E0DC8A86003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001004F6869C2282055E5119EB1046452FD4C2521575FA300221D0B350A58AE4196B6390518074614F869AD9705B929E15E9F05D1D3283D9FA8E3EF5702C04C3CFE05054266F759596D03F4FA731F74591F5D4B678A2975053C9D5294E879A43B1C8EE613082B7AD1FDABD75FCBE941EE19C2EAAD44BAB132355D509C4A816D9F59B486326899D8D1B5D22B8C6CD15F00040B5950D9ED6E3F8104EEC30DA48A4F5B37DACAC246A842FB9B535E9CD55D001FCC516A662203122F4A141D4B8BF8C8E9D5B1A84BD3F39296172A59420BA2E33729EFA6B78F7F27D53E0A4697490DA040FB730CC5B9D860530C17ACDA40FBFFC0A557D624B7C85D7AE8E75AA39E470540FEC93287653AFE6C493AF0C20F</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 FB E9 D8 14 18 04 88 D9 D5 41 F4 89
|
||||
0010 | 59 74 00 FB C8 49 6E 59 A0 44 46 E9 55 7D 76 EB
|
||||
0020 | A3 4A 6C 3E 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
||||
<pre><code>0000 | BA 0D 89 B5 7E 79 38 C1 4A B7 30 24 C3 94 DB C0
|
||||
0010 | E8 0A 6B 5D DD F3 95 25 25 82 2D BE 37 BB F1 5E
|
||||
0020 | 0D C8 A8 60 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 = BA0D89B5FBE9D814180488D9D541F489597400FBC8496E59A04446E9557D76EBA34A6C3
|
|||
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 | 0E BE CA 4A B9 A6 BD 13 C5 46 99 48 B1 58 7C D0
|
||||
0140 | BB 5D 99 4F 5B 3D 98 22 46 AD 4C 51 8B A1 E0 E0
|
||||
0150 | EC 62 7F 5E C0 F3 58 16 EE D5 7A BA F2 A6 97 6C
|
||||
0160 | 67 5D F8 4E 2B 7D 36 ED 78 EF 66 C3 55 D8 85 05
|
||||
0170 | 94 7D 59 EF 5A 34 58 85 2D 00 E6 43 1D 46 42 59
|
||||
0180 | 7C AC F0 54 4C 75 22 E6 2E 58 F5 5D C0 7D 1D E0
|
||||
0190 | 1A 0B 60 3A C2 09 A3 D8 7B 9D B4 03 08 13 06 1C
|
||||
01A0 | 6D 45 60 4A BF 3B 3B 60 55 93 BE AE 6E DD FD B2
|
||||
01B0 | 1E 8D F4 F9 A8 1A 89 BA 3E 6E 3A 8F 22 ED 0F BE
|
||||
01C0 | 08 EA A4 92 BF 82 C4 03 C8 E0 77 BB F8 17 C3 13
|
||||
01D0 | 24 C6 55 7D 9A EC 74 5F F2 43 5A 77 9B 0D CB 32
|
||||
01E0 | 0A C5 91 77 4F B1 01 37 DE 81 E6 5F 75 59 1A 06
|
||||
01F0 | 39 9A 3F AC 28 77 8F 17 A2 B9 86 AB 3A 8F 41 22
|
||||
0200 | B2 CB 40 40 73 AC 80 D2 7D A4 69 9E 02 C5 BC 25
|
||||
0210 | 0E DF 6B 45 A3 61 25 85 57 6B 95 B9 A7 B0 21 4A
|
||||
0220 | 24 8E A3 A0 A2 67 B3 48 32 BA 10 E5 3C FF 3A FC
|
||||
0230 | 1D 31 87 65</code></pre>
|
||||
0130 | 4F 68 69 C2 28 20 55 E5 11 9E B1 04 64 52 FD 4C
|
||||
0140 | 25 21 57 5F A3 00 22 1D 0B 35 0A 58 AE 41 96 B6
|
||||
0150 | 39 05 18 07 46 14 F8 69 AD 97 05 B9 29 E1 5E 9F
|
||||
0160 | 05 D1 D3 28 3D 9F A8 E3 EF 57 02 C0 4C 3C FE 05
|
||||
0170 | 05 42 66 F7 59 59 6D 03 F4 FA 73 1F 74 59 1F 5D
|
||||
0180 | 4B 67 8A 29 75 05 3C 9D 52 94 E8 79 A4 3B 1C 8E
|
||||
0190 | E6 13 08 2B 7A D1 FD AB D7 5F CB E9 41 EE 19 C2
|
||||
01A0 | EA AD 44 BA B1 32 35 5D 50 9C 4A 81 6D 9F 59 B4
|
||||
01B0 | 86 32 68 99 D8 D1 B5 D2 2B 8C 6C D1 5F 00 04 0B
|
||||
01C0 | 59 50 D9 ED 6E 3F 81 04 EE C3 0D A4 8A 4F 5B 37
|
||||
01D0 | DA CA C2 46 A8 42 FB 9B 53 5E 9C D5 5D 00 1F CC
|
||||
01E0 | 51 6A 66 22 03 12 2F 4A 14 1D 4B 8B F8 C8 E9 D5
|
||||
01F0 | B1 A8 4B D3 F3 92 96 17 2A 59 42 0B A2 E3 37 29
|
||||
0200 | EF A6 B7 8F 7F 27 D5 3E 0A 46 97 49 0D A0 40 FB
|
||||
0210 | 73 0C C5 B9 D8 60 53 0C 17 AC DA 40 FB FF C0 A5
|
||||
0220 | 57 D6 24 B7 C8 5D 7A E8 E7 5A A3 9E 47 05 40 FE
|
||||
0230 | C9 32 87 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 = BA0D89B5FBE9D814180488D9D541F489597400FBC8496E59A04446E9557D76EBA34A6C3
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>FBE9D814180488D9D541F489597400FB</code></td>
|
||||
<td><code>7E7938C14AB73024C394DBC0E80A6B5D</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>C8496E59A04446E9557D76EBA34A6C3E</code></td>
|
||||
<td><code>DDF3952525822DBE37BBF15E0DC8A860</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -594,13 +594,13 @@ answer = BA0D89B5FBE9D814180488D9D541F489597400FBC8496E59A04446E9557D76EBA34A6C3
|
|||
<tr>
|
||||
<td>g_a</td>
|
||||
<td>300, 260</td>
|
||||
<td><code>FE0001000EBECA4AB9A6BD13C5469948</code> <code>B1587CD0BB5D994F5B3D982246AD4C51</code> <code>8BA1E0E0EC627F5EC0F35816EED57ABA</code> <code>F2A6976C675DF84E2B7D36ED78EF66C3</code> <code>55D88505947D59EF5A3458852D00E643</code> <code>1D4642597CACF0544C7522E62E58F55D</code> <code>C07D1DE01A0B603AC209A3D87B9DB403</code> <code>0813061C6D45604ABF3B3B605593BEAE</code> <code>6EDDFDB21E8DF4F9A81A89BA3E6E3A8F</code> <code>22ED0FBE08EAA492BF82C403C8E077BB</code> <code>F817C31324C6557D9AEC745FF2435A77</code> <code>9B0DCB320AC591774FB10137DE81E65F</code> <code>75591A06399A3FAC28778F17A2B986AB</code> <code>3A8F4122B2CB404073AC80D27DA4699E</code> <code>02C5BC250EDF6B45A3612585576B95B9</code> <code>A7B0214A248EA3A0A267B34832BA10E5</code><br> <code>3CFF3AFC</code></td>
|
||||
<td><code>FE0001004F6869C2282055E5119EB104</code> <code>6452FD4C2521575FA300221D0B350A58</code> <code>AE4196B6390518074614F869AD9705B9</code> <code>29E15E9F05D1D3283D9FA8E3EF5702C0</code> <code>4C3CFE05054266F759596D03F4FA731F</code> <code>74591F5D4B678A2975053C9D5294E879</code> <code>A43B1C8EE613082B7AD1FDABD75FCBE9</code> <code>41EE19C2EAAD44BAB132355D509C4A81</code> <code>6D9F59B486326899D8D1B5D22B8C6CD1</code> <code>5F00040B5950D9ED6E3F8104EEC30DA4</code> <code>8A4F5B37DACAC246A842FB9B535E9CD5</code> <code>5D001FCC516A662203122F4A141D4B8B</code> <code>F8C8E9D5B1A84BD3F39296172A59420B</code> <code>A2E33729EFA6B78F7F27D53E0A469749</code> <code>0DA040FB730CC5B9D860530C17ACDA40</code> <code>FBFFC0A557D624B7C85D7AE8E75AA39E</code><br> <code>470540FE</code></td>
|
||||
<td><code>g_a</code> diffie-hellman parameter</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_time</td>
|
||||
<td>560, 4</td>
|
||||
<td><code>1D318765</code> (1703358749 in decimal)</td>
|
||||
<td><code>C9328765</code> (1703359177 in decimal)</td>
|
||||
<td>Server time</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -609,34 +609,34 @@ answer = BA0D89B5FBE9D814180488D9D541F489597400FBC8496E59A04446E9557D76EBA34A6C3
|
|||
<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 = A200BEC0B512C01DA3F2C4ECFF032337678B18CD181F71C09DCBA4D7B8606794203779F5AD80C02DDF09B7C775E6E73B69EC44BB280F61F8081AFDDC5EBD5EDB636F5410DA4CF1F35B69895189606E068C3AB401DEFA54C3D0F9706264E30229F51F92A9CECA5AEB65354E23679E4DE180A45ECB8B55A239CC4A8D50831F27824419036C1CE5D21A1E38FC7C9074C4350618D55537C95FE44AA143757C73A80ECEEEAC7309E87C00A83C005FAE22C5899AE4F101D21C1455924746D04F8CACE16ACC853A13C23F8DA02CC24300B680E9B911DB212EFD70946E0DE782C38D2D38BDA6627FDBFE2A424A6A3A484BB7308FF952D5A8831A80592F9463AEBAAF7733</code></pre>
|
||||
<pre><code>b = CA1889050E305B662888564636B20AD5A2303286A031867498FA652122269ED33E83280AE0F361C44272025BA7D025C0B440FF53A44757FBC41E2D323A483AF708D79E8F6F86E470D081D7E1C856ED766E94DDE74FE4747D69778D6B6A148985BAE39BB00549BAA266ACE81EFE787A5939A87CAED4FDF63F2CF37989313DE8AB825D2A50DCF90066A0665FC9FA43B8ED1728DE6167C9E82FA48AE9BDB9F795E86CB358BD5BC0DB7A03E89F49067E4C083829615983DE7A9EA75A1A22238FFC551A262D53E976BE695929031E193C5C134214C0213167E5969689CD33F3C08D038396554631E29B7EDF6F7B6686DC86CE6938CCF17B4D02818CB34561D8C8467C</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 = 9F61A8A79723EC5735659D63236CC4170AD5FEB7AC7F1B1539B7A3E75BF1288BF3DBD7493D22F650BB0A8B17BA5F2A7EF7CBE1EE148C73520653C1E9AB627929962C4606B4BE4724D121084268873775029C1A34D3F70455018CC599D09EC02EEB4625B804FE34E42B8F26AD5F87675202CD7CCAC9964CF1D925558BA1540DAB0ACBA68FE752C776A5659CDFB802451F359F4F7B24A8A19527C4B62813AC9DAA0D368633E1D1EE2A697166C5C9000ABD8998FC1AE3FFD9A739952E9503BC676D7E0C9C329E61C3C0255C0A5A45F39F9234190EE37027F53207FB068DD3A918F738E216C0B4A57A6E5DB01691F43D2B0F7197D8CDA45733D7420E3AD9D4C932AA</code></pre>
|
||||
<pre><code>g_b = B5C07CAB67304C7EC341D6CF79F231ABC9F3BBD72E3318586C426D7D2775435F37991FF37E915CA3338B3A7ABCEF1501E5FA3160278DC36184E202559A0F392DF0D8B3D44701682619BC8A7AA42166C83AC3FFCA427C9437F56B3D98FF04F64C7BD068B479FE88599473DEEB0638A61CC4F22343838CDD0736B384E6127D0C000FB0F1B5C283620F855BB51FEEA8D5C1F75A00FA90F063C0560EA66246CAB1045EEC355652442C4D85CDE65FF1D3A17AF09461C893FD17080D32B8ED50BCEF57A82B5C0D343CEAAECA94CECB2996923876F2CC3FF1BE2243A0EDC455B68ACB25B66CCB6BDC4CC668E68DC29F64A7DA6FDEACB7D9A837E26AE46B77B852495D71</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 FB E9 D8 14 18 04 88 D9 D5 41 F4 89
|
||||
0010 | 59 74 00 FB C8 49 6E 59 A0 44 46 E9 55 7D 76 EB
|
||||
0020 | A3 4A 6C 3E 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | 9F 61 A8 A7 97 23 EC 57 35 65 9D 63 23 6C C4 17
|
||||
0040 | 0A D5 FE B7 AC 7F 1B 15 39 B7 A3 E7 5B F1 28 8B
|
||||
0050 | F3 DB D7 49 3D 22 F6 50 BB 0A 8B 17 BA 5F 2A 7E
|
||||
0060 | F7 CB E1 EE 14 8C 73 52 06 53 C1 E9 AB 62 79 29
|
||||
0070 | 96 2C 46 06 B4 BE 47 24 D1 21 08 42 68 87 37 75
|
||||
0080 | 02 9C 1A 34 D3 F7 04 55 01 8C C5 99 D0 9E C0 2E
|
||||
0090 | EB 46 25 B8 04 FE 34 E4 2B 8F 26 AD 5F 87 67 52
|
||||
00A0 | 02 CD 7C CA C9 96 4C F1 D9 25 55 8B A1 54 0D AB
|
||||
00B0 | 0A CB A6 8F E7 52 C7 76 A5 65 9C DF B8 02 45 1F
|
||||
00C0 | 35 9F 4F 7B 24 A8 A1 95 27 C4 B6 28 13 AC 9D AA
|
||||
00D0 | 0D 36 86 33 E1 D1 EE 2A 69 71 66 C5 C9 00 0A BD
|
||||
00E0 | 89 98 FC 1A E3 FF D9 A7 39 95 2E 95 03 BC 67 6D
|
||||
00F0 | 7E 0C 9C 32 9E 61 C3 C0 25 5C 0A 5A 45 F3 9F 92
|
||||
0100 | 34 19 0E E3 70 27 F5 32 07 FB 06 8D D3 A9 18 F7
|
||||
0110 | 38 E2 16 C0 B4 A5 7A 6E 5D B0 16 91 F4 3D 2B 0F
|
||||
0120 | 71 97 D8 CD A4 57 33 D7 42 0E 3A D9 D4 C9 32 AA</code></pre>
|
||||
<pre><code>0000 | 54 B6 43 66 7E 79 38 C1 4A B7 30 24 C3 94 DB C0
|
||||
0010 | E8 0A 6B 5D DD F3 95 25 25 82 2D BE 37 BB F1 5E
|
||||
0020 | 0D C8 A8 60 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | B5 C0 7C AB 67 30 4C 7E C3 41 D6 CF 79 F2 31 AB
|
||||
0040 | C9 F3 BB D7 2E 33 18 58 6C 42 6D 7D 27 75 43 5F
|
||||
0050 | 37 99 1F F3 7E 91 5C A3 33 8B 3A 7A BC EF 15 01
|
||||
0060 | E5 FA 31 60 27 8D C3 61 84 E2 02 55 9A 0F 39 2D
|
||||
0070 | F0 D8 B3 D4 47 01 68 26 19 BC 8A 7A A4 21 66 C8
|
||||
0080 | 3A C3 FF CA 42 7C 94 37 F5 6B 3D 98 FF 04 F6 4C
|
||||
0090 | 7B D0 68 B4 79 FE 88 59 94 73 DE EB 06 38 A6 1C
|
||||
00A0 | C4 F2 23 43 83 8C DD 07 36 B3 84 E6 12 7D 0C 00
|
||||
00B0 | 0F B0 F1 B5 C2 83 62 0F 85 5B B5 1F EE A8 D5 C1
|
||||
00C0 | F7 5A 00 FA 90 F0 63 C0 56 0E A6 62 46 CA B1 04
|
||||
00D0 | 5E EC 35 56 52 44 2C 4D 85 CD E6 5F F1 D3 A1 7A
|
||||
00E0 | F0 94 61 C8 93 FD 17 08 0D 32 B8 ED 50 BC EF 57
|
||||
00F0 | A8 2B 5C 0D 34 3C EA AE CA 94 CE CB 29 96 92 38
|
||||
0100 | 76 F2 CC 3F F1 BE 22 43 A0 ED C4 55 B6 8A CB 25
|
||||
0110 | B6 6C CB 6B DC 4C C6 68 E6 8D C2 9F 64 A7 DA 6F
|
||||
0120 | DE AC B7 D9 A8 37 E2 6A E4 6B 77 B8 52 49 5D 71</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 = BA0D89B5FBE9D814180488D9D541F489597400FBC8496E59A04446E9557D76EBA34A6C3
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>FBE9D814180488D9D541F489597400FB</code></td>
|
||||
<td><code>7E7938C14AB73024C394DBC0E80A6B5D</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>C8496E59A04446E9557D76EBA34A6C3E</code></td>
|
||||
<td><code>DDF3952525822DBE37BBF15E0DC8A860</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>g_b</td>
|
||||
<td>36, 260</td>
|
||||
<td><code>FE0001009F61A8A79723EC5735659D63</code> <code>236CC4170AD5FEB7AC7F1B1539B7A3E7</code> <code>5BF1288BF3DBD7493D22F650BB0A8B17</code> <code>BA5F2A7EF7CBE1EE148C73520653C1E9</code> <code>AB627929962C4606B4BE4724D1210842</code> <code>68873775029C1A34D3F70455018CC599</code> <code>D09EC02EEB4625B804FE34E42B8F26AD</code> <code>5F87675202CD7CCAC9964CF1D925558B</code> <code>A1540DAB0ACBA68FE752C776A5659CDF</code> <code>B802451F359F4F7B24A8A19527C4B628</code> <code>13AC9DAA0D368633E1D1EE2A697166C5</code> <code>C9000ABD8998FC1AE3FFD9A739952E95</code> <code>03BC676D7E0C9C329E61C3C0255C0A5A</code> <code>45F39F9234190EE37027F53207FB068D</code> <code>D3A918F738E216C0B4A57A6E5DB01691</code> <code>F43D2B0F7197D8CDA45733D7420E3AD9</code><br> <code>D4C932AA</code></td>
|
||||
<td><code>FE000100B5C07CAB67304C7EC341D6CF</code> <code>79F231ABC9F3BBD72E3318586C426D7D</code> <code>2775435F37991FF37E915CA3338B3A7A</code> <code>BCEF1501E5FA3160278DC36184E20255</code> <code>9A0F392DF0D8B3D44701682619BC8A7A</code> <code>A42166C83AC3FFCA427C9437F56B3D98</code> <code>FF04F64C7BD068B479FE88599473DEEB</code> <code>0638A61CC4F22343838CDD0736B384E6</code> <code>127D0C000FB0F1B5C283620F855BB51F</code> <code>EEA8D5C1F75A00FA90F063C0560EA662</code> <code>46CAB1045EEC355652442C4D85CDE65F</code> <code>F1D3A17AF09461C893FD17080D32B8ED</code> <code>50BCEF57A82B5C0D343CEAAECA94CECB</code> <code>2996923876F2CC3FF1BE2243A0EDC455</code> <code>B68ACB25B66CCB6BDC4CC668E68DC29F</code> <code>64A7DA6FDEACB7D9A837E26AE46B77B8</code><br> <code>52495D71</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 = BA0D89B5FBE9D814180488D9D541F489597400FBC8496E59A04446E9557D76EBA34A6C3
|
|||
<!-- 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 = 54B64366FBE9D814180488D9D541F489597400FBC8496E59A04446E9557D76EBA34A6C3E0000000000000000FE0001009F61A8A79723EC5735659D63236CC4170AD5FEB7AC7F1B1539B7A3E75BF1288BF3DBD7493D22F650BB0A8B17BA5F2A7EF7CBE1EE148C73520653C1E9AB627929962C4606B4BE4724D121084268873775029C1A34D3F70455018CC599D09EC02EEB4625B804FE34E42B8F26AD5F87675202CD7CCAC9964CF1D925558BA1540DAB0ACBA68FE752C776A5659CDFB802451F359F4F7B24A8A19527C4B62813AC9DAA0D368633E1D1EE2A697166C5C9000ABD8998FC1AE3FFD9A739952E9503BC676D7E0C9C329E61C3C0255C0A5A45F39F9234190EE37027F53207FB068DD3A918F738E216C0B4A57A6E5DB01691F43D2B0F7197D8CDA45733D7420E3AD9D4C932AA
|
||||
padding = 8567AEC2B46C93B00DBFE546
|
||||
tmp_aes_key = 050071522CD4EC58F1029B6A0DED20B8DEB6DB3D988487B3D57073640A5509ED
|
||||
tmp_aes_iv = 44744AEF8CA0A04940257D3E1D792720CBAFD0A13FFD92BE33D77071ACDE69ED</code></pre>
|
||||
<pre><code>data = 54B643667E7938C14AB73024C394DBC0E80A6B5DDDF3952525822DBE37BBF15E0DC8A8600000000000000000FE000100B5C07CAB67304C7EC341D6CF79F231ABC9F3BBD72E3318586C426D7D2775435F37991FF37E915CA3338B3A7ABCEF1501E5FA3160278DC36184E202559A0F392DF0D8B3D44701682619BC8A7AA42166C83AC3FFCA427C9437F56B3D98FF04F64C7BD068B479FE88599473DEEB0638A61CC4F22343838CDD0736B384E6127D0C000FB0F1B5C283620F855BB51FEEA8D5C1F75A00FA90F063C0560EA66246CAB1045EEC355652442C4D85CDE65FF1D3A17AF09461C893FD17080D32B8ED50BCEF57A82B5C0D343CEAAECA94CECB2996923876F2CC3FF1BE2243A0EDC455B68ACB25B66CCB6BDC4CC668E68DC29F64A7DA6FDEACB7D9A837E26AE46B77B852495D71
|
||||
padding = BBA8B20E4238251F949799DA
|
||||
tmp_aes_key = D28A87C0D70101BB2B10FB424BE653AE8EFB79805727725BD0189841E9004B8A
|
||||
tmp_aes_iv = FE8486D1C9DBCCC51BC4D8AFF6F9581FB6A086BC2F678552CF66D37BEA1894A9</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 = 1B6EAFDA50DB20640D6D3532C120E7A1F1017D23E9BD6C1FA6CBE7A2F0EAA37167BFB3D02DB03B3497F046C2E802DB613BADE6DFEBE27CE0458451D7A84E0F643FDAB28C545C9826F6D765F58B2CC54CC1DA23E850619597C0E1896BA0FB1945A8F38AEA063D0AE633382DEB77DA5BF87BAEB8911314C0BDE1FD85803CF69FC16B834A1315629D06868B39D3C8C57BDACF830051072ACAD79EC9FAA05EA7FB85EBD0F36BC7C900958466CB3CFF15C2674275483DC47252D3611943AFA33DC4A45FAB2A206650E5766A6A83B6AB695D484ADDE406BDFC3216739E78AA3D05F0B5A2F1E92B2DA1D80DCB64B0A51B33FC85D9A6AAC1171477219187EFB13167CD8F64F34EBFBFB2F1A421FBD7A1EB2D43116AD63BAE95D0B15C4355FDC044338102CA0068A4D884CC6A84CA65FD5673248B71994EF4B0D7890C00C3CE7CADB16C709F25C67E5EBEE012BE0FA1EEE6A9EB05</code></pre>
|
||||
<pre><code>encrypted_data = 73FF308F4675402329FE202B4DEB8B710166302B2CA230CB60A89B0CA23BFD830D677F3D6AC21A9C5628C3D4F0D804F59A20273A9D85A3A1C83D2AC464066A1DFED37E2862BB9AB3D5D3871AA24B25F2CC07B387A2B6B0D4A947C329E57EF41FCE8DE2E0456BB90DD239A8E5A9324898FFE5F125750B29BA6943A491417A8C50DD5E8E47AA23F720759373B1527BE9D593A85F82DA527AAA4E361B1F2EFDA6BA392171FEAB13E0D09B43E7C626DB105E2DF116A384042B9DE5ECFF08795DBAC1AF0B6268783AFB889A49A2510D94079FB7EB9A25F86070BADD3AB3644C252771EB153A742F8D4CD20248843510EFFDADC498590AD6258C0381EE84987DD714B7804DF6AFEA76A7E8CD656ACE90C10260F0BAD3ABFF4466FD726E2E76E0CBBC8BF759C9C243C589CDED5389602C870A006D0B58C84D3DE8C01569D53F9489973945AF5AB6E5869CB76311B78F147359CE</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 4C F9 03 00 1D 31 87 65
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 FB E9 D8 14 18 04 88 D9
|
||||
0020 | D5 41 F4 89 59 74 00 FB C8 49 6E 59 A0 44 46 E9
|
||||
0030 | 55 7D 76 EB A3 4A 6C 3E FE 50 01 00 1B 6E AF DA
|
||||
0040 | 50 DB 20 64 0D 6D 35 32 C1 20 E7 A1 F1 01 7D 23
|
||||
0050 | E9 BD 6C 1F A6 CB E7 A2 F0 EA A3 71 67 BF B3 D0
|
||||
0060 | 2D B0 3B 34 97 F0 46 C2 E8 02 DB 61 3B AD E6 DF
|
||||
0070 | EB E2 7C E0 45 84 51 D7 A8 4E 0F 64 3F DA B2 8C
|
||||
0080 | 54 5C 98 26 F6 D7 65 F5 8B 2C C5 4C C1 DA 23 E8
|
||||
0090 | 50 61 95 97 C0 E1 89 6B A0 FB 19 45 A8 F3 8A EA
|
||||
00A0 | 06 3D 0A E6 33 38 2D EB 77 DA 5B F8 7B AE B8 91
|
||||
00B0 | 13 14 C0 BD E1 FD 85 80 3C F6 9F C1 6B 83 4A 13
|
||||
00C0 | 15 62 9D 06 86 8B 39 D3 C8 C5 7B DA CF 83 00 51
|
||||
00D0 | 07 2A CA D7 9E C9 FA A0 5E A7 FB 85 EB D0 F3 6B
|
||||
00E0 | C7 C9 00 95 84 66 CB 3C FF 15 C2 67 42 75 48 3D
|
||||
00F0 | C4 72 52 D3 61 19 43 AF A3 3D C4 A4 5F AB 2A 20
|
||||
0100 | 66 50 E5 76 6A 6A 83 B6 AB 69 5D 48 4A DD E4 06
|
||||
0110 | BD FC 32 16 73 9E 78 AA 3D 05 F0 B5 A2 F1 E9 2B
|
||||
0120 | 2D A1 D8 0D CB 64 B0 A5 1B 33 FC 85 D9 A6 AA C1
|
||||
0130 | 17 14 77 21 91 87 EF B1 31 67 CD 8F 64 F3 4E BF
|
||||
0140 | BF B2 F1 A4 21 FB D7 A1 EB 2D 43 11 6A D6 3B AE
|
||||
0150 | 95 D0 B1 5C 43 55 FD C0 44 33 81 02 CA 00 68 A4
|
||||
0160 | D8 84 CC 6A 84 CA 65 FD 56 73 24 8B 71 99 4E F4
|
||||
0170 | B0 D7 89 0C 00 C3 CE 7C AD B1 6C 70 9F 25 C6 7E
|
||||
0180 | 5E BE E0 12 BE 0F A1 EE E6 A9 EB 05</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 58 33 0D 00 C9 32 87 65
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 7E 79 38 C1 4A B7 30 24
|
||||
0020 | C3 94 DB C0 E8 0A 6B 5D DD F3 95 25 25 82 2D BE
|
||||
0030 | 37 BB F1 5E 0D C8 A8 60 FE 50 01 00 73 FF 30 8F
|
||||
0040 | 46 75 40 23 29 FE 20 2B 4D EB 8B 71 01 66 30 2B
|
||||
0050 | 2C A2 30 CB 60 A8 9B 0C A2 3B FD 83 0D 67 7F 3D
|
||||
0060 | 6A C2 1A 9C 56 28 C3 D4 F0 D8 04 F5 9A 20 27 3A
|
||||
0070 | 9D 85 A3 A1 C8 3D 2A C4 64 06 6A 1D FE D3 7E 28
|
||||
0080 | 62 BB 9A B3 D5 D3 87 1A A2 4B 25 F2 CC 07 B3 87
|
||||
0090 | A2 B6 B0 D4 A9 47 C3 29 E5 7E F4 1F CE 8D E2 E0
|
||||
00A0 | 45 6B B9 0D D2 39 A8 E5 A9 32 48 98 FF E5 F1 25
|
||||
00B0 | 75 0B 29 BA 69 43 A4 91 41 7A 8C 50 DD 5E 8E 47
|
||||
00C0 | AA 23 F7 20 75 93 73 B1 52 7B E9 D5 93 A8 5F 82
|
||||
00D0 | DA 52 7A AA 4E 36 1B 1F 2E FD A6 BA 39 21 71 FE
|
||||
00E0 | AB 13 E0 D0 9B 43 E7 C6 26 DB 10 5E 2D F1 16 A3
|
||||
00F0 | 84 04 2B 9D E5 EC FF 08 79 5D BA C1 AF 0B 62 68
|
||||
0100 | 78 3A FB 88 9A 49 A2 51 0D 94 07 9F B7 EB 9A 25
|
||||
0110 | F8 60 70 BA DD 3A B3 64 4C 25 27 71 EB 15 3A 74
|
||||
0120 | 2F 8D 4C D2 02 48 84 35 10 EF FD AD C4 98 59 0A
|
||||
0130 | D6 25 8C 03 81 EE 84 98 7D D7 14 B7 80 4D F6 AF
|
||||
0140 | EA 76 A7 E8 CD 65 6A CE 90 C1 02 60 F0 BA D3 AB
|
||||
0150 | FF 44 66 FD 72 6E 2E 76 E0 CB BC 8B F7 59 C9 C2
|
||||
0160 | 43 C5 89 CD ED 53 89 60 2C 87 0A 00 6D 0B 58 C8
|
||||
0170 | 4D 3D E8 C0 15 69 D5 3F 94 89 97 39 45 AF 5A B6
|
||||
0180 | E5 86 9C B7 63 11 B7 8F 14 73 59 CE</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>4CF903001D318765</code></td>
|
||||
<td><code>58330D00C9328765</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>FBE9D814180488D9D541F489597400FB</code></td>
|
||||
<td><code>7E7938C14AB73024C394DBC0E80A6B5D</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>C8496E59A04446E9557D76EBA34A6C3E</code></td>
|
||||
<td><code>DDF3952525822DBE37BBF15E0DC8A860</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>56, 340</td>
|
||||
<td><code>FE5001001B6EAFDA50DB20640D6D3532</code> <code>C120E7A1F1017D23E9BD6C1FA6CBE7A2</code> <code>F0EAA37167BFB3D02DB03B3497F046C2</code> <code>E802DB613BADE6DFEBE27CE0458451D7</code> <code>A84E0F643FDAB28C545C9826F6D765F5</code> <code>8B2CC54CC1DA23E850619597C0E1896B</code> <code>A0FB1945A8F38AEA063D0AE633382DEB</code> <code>77DA5BF87BAEB8911314C0BDE1FD8580</code> <code>3CF69FC16B834A1315629D06868B39D3</code> <code>C8C57BDACF830051072ACAD79EC9FAA0</code> <code>5EA7FB85EBD0F36BC7C900958466CB3C</code> <code>FF15C2674275483DC47252D3611943AF</code> <code>A33DC4A45FAB2A206650E5766A6A83B6</code> <code>AB695D484ADDE406BDFC3216739E78AA</code> <code>3D05F0B5A2F1E92B2DA1D80DCB64B0A5</code> <code>1B33FC85D9A6AAC1171477219187EFB1</code> <code>3167CD8F64F34EBFBFB2F1A421FBD7A1</code> <code>EB2D43116AD63BAE95D0B15C4355FDC0</code> <code>44338102CA0068A4D884CC6A84CA65FD</code> <code>5673248B71994EF4B0D7890C00C3CE7C</code> <code>ADB16C709F25C67E5EBEE012BE0FA1EE</code><br> <code>E6A9EB05</code></td>
|
||||
<td><code>FE50010073FF308F4675402329FE202B</code> <code>4DEB8B710166302B2CA230CB60A89B0C</code> <code>A23BFD830D677F3D6AC21A9C5628C3D4</code> <code>F0D804F59A20273A9D85A3A1C83D2AC4</code> <code>64066A1DFED37E2862BB9AB3D5D3871A</code> <code>A24B25F2CC07B387A2B6B0D4A947C329</code> <code>E57EF41FCE8DE2E0456BB90DD239A8E5</code> <code>A9324898FFE5F125750B29BA6943A491</code> <code>417A8C50DD5E8E47AA23F720759373B1</code> <code>527BE9D593A85F82DA527AAA4E361B1F</code> <code>2EFDA6BA392171FEAB13E0D09B43E7C6</code> <code>26DB105E2DF116A384042B9DE5ECFF08</code> <code>795DBAC1AF0B6268783AFB889A49A251</code> <code>0D94079FB7EB9A25F86070BADD3AB364</code> <code>4C252771EB153A742F8D4CD202488435</code> <code>10EFFDADC498590AD6258C0381EE8498</code> <code>7DD714B7804DF6AFEA76A7E8CD656ACE</code> <code>90C10260F0BAD3ABFF4466FD726E2E76</code> <code>E0CBBC8BF759C9C243C589CDED538960</code> <code>2C870A006D0B58C84D3DE8C01569D53F</code> <code>9489973945AF5AB6E5869CB76311B78F</code><br> <code>147359CE</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 = 569A656776A6357CC732BD9AEDF557BF8481443211786900DE82A3125665375E802D58FAA460D710890D160DA7AF2B7A8B801B1644A3F1E394C44A857CC81425D86D397BBE987F32AC379F68FB6CA532F5CC4959F30E0E805BA080EBA19E278E6AE116FBBD3E65448B2A1F7FE99B7032DF9E5B0294A4EDD5CAD0536EDEB86996B93985B2CCBA62A25BD94CD6AB3BE97EF8A3BD5BFBAA8540AC563BEE779C1184009E51B340939F11811236A07B459987AF9E6F0B82EEB3278D5AD462326D5911463FCD51A89BFF2DFB6161C6A7F777A826633B95D3DA023BC78252829AF0AA7D4B14142689F7B318BBEDF7ABB3D0367BD2EEF4EC36E7E110B481F47406E97941</code></pre>
|
||||
<pre><code>auth_key = 939D202589036350FD00600C0CC822E3065B4AEC892004714CE49FC098254F73A5A909116A35D2543E56A2908694701F0E05D1A7FB76D72E5A4D004DA6B559B714ECE285DC49E82704EAA3DBA24983F3E626FB134DEA02B41DEF75EDEE8F0C4DC5EEBC807365068F6CB5BD24FF2B5847F9C8DB65CE658F3839E553AADAFF64DF3281CA3B8D27DA8850E80A5B211951C0491D6A57FF6F2A4DB59652EBE8FB7BD9B03A6214D673E4B517FA0A827D2AB2079B7CBF8B938254C13A95F4331495D2FCB449821FAC4D3A07BA2A2E2C22B0B718B8FFF5E872A19CF20C784E8376705CF2C20257A1AD3BF3FFCE25B84A69FD6D006AEDD3F9F5D72C5DD2EB56ABFD7EFCBF</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 BC 5C 81 1D 31 87 65
|
||||
0010 | 40 00 00 00 34 F7 CB 3B FB E9 D8 14 18 04 88 D9
|
||||
0020 | D5 41 F4 89 59 74 00 FB C8 49 6E 59 A0 44 46 E9
|
||||
0030 | 55 7D 76 EB A3 4A 6C 3E 77 7B 06 DC FD 38 23 46
|
||||
0040 | B3 28 05 FB 01 AA 9D 80</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 D0 C0 BC C9 32 87 65
|
||||
0010 | 6C 00 00 00 34 F7 CB 3B 7E 79 38 C1 4A B7 30 24
|
||||
0020 | C3 94 DB C0 E8 0A 6B 5D DD F3 95 25 25 82 2D BE
|
||||
0030 | 37 BB F1 5E 0D C8 A8 60 04 F9 91 DD 4F 67 9B 4C
|
||||
0040 | A2 E7 C7 3B 00 19 4D EC</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>01BC5C811D318765</code></td>
|
||||
<td><code>01D0C0BCC9328765</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>40000000</code> (64 in decimal)</td>
|
||||
<td><code>6C000000</code> (108 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>FBE9D814180488D9D541F489597400FB</code></td>
|
||||
<td><code>7E7938C14AB73024C394DBC0E80A6B5D</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>C8496E59A04446E9557D76EBA34A6C3E</code></td>
|
||||
<td><code>DDF3952525822DBE37BBF15E0DC8A860</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce_hash1</td>
|
||||
<td>56, 16</td>
|
||||
<td><code>777B06DCFD382346B32805FB01AA9D80</code></td>
|
||||
<td><code>04F991DD4F679B4CA2E7C73B00194DEC</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>
|
||||
|
|
Loading…
Reference in a new issue