mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-12-01 12:42:07 +01:00
Update content of files
This commit is contained in:
parent
0173bcf8ab
commit
11778019c2
2 changed files with 209 additions and 207 deletions
|
@ -81,7 +81,7 @@
|
|||
<tr>
|
||||
<td><strong>reactions_first</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>Whether to return <a href="/constructor/storyView">storyView</a> info about users that reacted to the story (i.e. if set, the server will also sort results based on the presence of a reaction, after sorting it by date as usual).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>peer</strong></td>
|
||||
|
@ -132,6 +132,8 @@
|
|||
<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="#contacts" id="contacts" name="contacts"><i class="anchor-icon"></i></a><a href="/api/contacts">Contacts</a></h4>
|
||||
<p>Working with contacts.</p>
|
||||
<h4><a class="anchor" href="#storyview" id="storyview" name="storyview"><i class="anchor-icon"></i></a><a href="/constructor/storyView">storyView</a></h4>
|
||||
<p><a href="/api/stories">Story</a> view date and reaction information</p>
|
||||
<h4><a class="anchor" href="#storiesstoryviewslist" id="storiesstoryviewslist" name="storiesstoryviewslist"><i class="anchor-icon"></i></a><a href="/constructor/stories.storyViewsList">stories.storyViewsList</a></h4>
|
||||
<p>Reaction and view counters for a <a href="/api/stories">story</a></p>
|
||||
<h4><a class="anchor" href="#pagination-in-the-api" id="pagination-in-the-api" name="pagination-in-the-api"><i class="anchor-icon"></i></a><a href="/api/offsets">Pagination in the API</a></h4>
|
||||
|
|
|
@ -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 6C 28 05 00 77 57 6A 65
|
||||
0010 | 14 00 00 00 F1 8E 7E BE 32 E0 57 DC 82 0E 13 67
|
||||
0020 | DA C9 FD EF B0 0D FA E3</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 04 46 03 00 28 9B 6C 65
|
||||
0010 | 14 00 00 00 F1 8E 7E BE B0 69 7A FD F7 E5 50 64
|
||||
0020 | 0E A2 6A DB 92 59 0D E2</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>6C28050077576A65</code></td>
|
||||
<td><code>04460300289B6C65</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>32E057DC820E1367DAC9FDEFB00DFAE3</code></td>
|
||||
<td><code>B0697AFDF7E550640EA26ADB92590DE2</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 DC 7A C5 77 57 6A 65
|
||||
0010 | 84 00 00 00 63 24 16 05 32 E0 57 DC 82 0E 13 67
|
||||
0020 | DA C9 FD EF B0 0D FA E3 87 69 98 EC 69 F2 D2 8B
|
||||
0030 | 69 12 57 F3 D9 52 84 D8 08 2D 0D F2 8C 1F 09 F9
|
||||
0040 | 55 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 E4 1F 0C 29 9B 6C 65
|
||||
0010 | 8C 00 00 00 63 24 16 05 B0 69 7A FD F7 E5 50 64
|
||||
0020 | 0E A2 6A DB 92 59 0D E2 FE AC 66 0A F9 82 4B 19
|
||||
0030 | 0F 2A B1 7D A0 85 CE 8B 08 1D 6A 19 CB 72 22 7D
|
||||
0040 | 65 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>01DC7AC577576A65</code></td>
|
||||
<td><code>01E41F0C299B6C65</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>84000000</code> (132 in decimal)</td>
|
||||
<td><code>8C000000</code> (140 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -150,19 +150,19 @@
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>32E057DC820E1367DAC9FDEFB00DFAE3</code></td>
|
||||
<td><code>B0697AFDF7E550640EA26ADB92590DE2</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>876998EC69F2D28B691257F3D95284D8</code></td>
|
||||
<td><code>FEAC660AF9824B190F2AB17DA085CE8B</code></td>
|
||||
<td>Server-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pq</td>
|
||||
<td>56, 12</td>
|
||||
<td><code>082D0DF28C1F09F955000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 3246517590034086229</td>
|
||||
<td><code>081D6A19CB72227D65000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2119534936215158117</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 = 3246517590034086229</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>3246517590034086229 = 1693217573 * 1917365873</code></p>
|
||||
<pre><code>p = 1693217573
|
||||
q = 1917365873</code></pre>
|
||||
<pre><code>pq = 2119534936215158117</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2119534936215158117 = 1270235411 * 1668615847</code></p>
|
||||
<pre><code>p = 1270235411
|
||||
q = 1668615847</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 2D 0D F2 8C 1F 09 F9 55 00 00 00
|
||||
0010 | 04 64 EC 73 25 00 00 00 04 72 48 AE 71 00 00 00
|
||||
0020 | 32 E0 57 DC 82 0E 13 67 DA C9 FD EF B0 0D FA E3
|
||||
0030 | 87 69 98 EC 69 F2 D2 8B 69 12 57 F3 D9 52 84 D8
|
||||
0040 | 60 53 53 97 02 E3 B3 45 95 1B 83 0A 11 ED B8 30
|
||||
0050 | 56 0D 5A 46 F8 15 0F 31 EF 75 92 CA A5 86 F1 F8
|
||||
<pre><code>0000 | 95 5F F5 A9 08 1D 6A 19 CB 72 22 7D 65 00 00 00
|
||||
0010 | 04 4B B6 41 13 00 00 00 04 63 75 0E A7 00 00 00
|
||||
0020 | B0 69 7A FD F7 E5 50 64 0E A2 6A DB 92 59 0D E2
|
||||
0030 | FE AC 66 0A F9 82 4B 19 0F 2A B1 7D A0 85 CE 8B
|
||||
0040 | C9 6C B7 3B 8E B7 D5 00 DF 50 C1 FB F6 11 A5 46
|
||||
0050 | 0F 4B D9 A6 4C E6 91 8E 37 FC 77 0C 7F D4 B1 D3
|
||||
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 = 1917365873</code></pre>
|
|||
<tr>
|
||||
<td>pq</td>
|
||||
<td>4, 12</td>
|
||||
<td><code>082D0DF28C1F09F955000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 3246517590034086229</td>
|
||||
<td><code>081D6A19CB72227D65000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2119534936215158117</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>0464EC7325000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1693217573</td>
|
||||
<td><code>044BB64113000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1270235411</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>047248AE71000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1917365873</td>
|
||||
<td><code>0463750EA7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1668615847</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>32E057DC820E1367DAC9FDEFB00DFAE3</code></td>
|
||||
<td><code>B0697AFDF7E550640EA26ADB92590DE2</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>48, 16</td>
|
||||
<td><code>876998EC69F2D28B691257F3D95284D8</code></td>
|
||||
<td><code>FEAC660AF9824B190F2AB17DA085CE8B</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce</td>
|
||||
<td>64, 32</td>
|
||||
<td><code>6053539702E3B345951B830A11EDB830</code> <code>560D5A46F8150F31EF7592CAA586F1F8</code></td>
|
||||
<td><code>C96CB73B8EB7D500DF50C1FBF611A546</code> <code>0F4BD9A64CE6918E37FC770C7FD4B1D3</code></td>
|
||||
<td>Client-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -291,39 +291,39 @@ q = 1917365873</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 = 955FF5A9082D0DF28C1F09F9550000000464EC7325000000047248AE7100000032E057DC820E1367DAC9FDEFB00DFAE3876998EC69F2D28B691257F3D95284D86053539702E3B345951B830A11EDB830560D5A46F8150F31EF7592CAA586F1F802000000
|
||||
random_padding_bytes = 952ED4932915DBDB298617BE299380F501C64BF57F488A9D3B7A2CEBD4EC17E4E8DAB5B69F934BC7D7A838D08DB60D41E2F9872B9C73F48280462D2BF9181C6B36878897BA33B386EC6AA2A3401978600202E153D39FC24E917D09DF</code></pre>
|
||||
<pre><code>data = 955FF5A9081D6A19CB72227D65000000044BB641130000000463750EA7000000B0697AFDF7E550640EA26ADB92590DE2FEAC660AF9824B190F2AB17DA085CE8BC96CB73B8EB7D500DF50C1FBF611A5460F4BD9A64CE6918E37FC770C7FD4B1D302000000
|
||||
random_padding_bytes = B8F5B0C105FF2BF073B6C18AC3401F4F4576029E2DB1738EB5D5C5E244397C3568C4E5958747D7F88A32EE625B17E6C469D8BCB5485D5FBCC871AA9BE9CF77A613960B7940BF9F6C823EBF4D3569CF243F3C445E1C2CC27B75DD6063</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 = 8EDF03011B64DF2831577B8DBF0E739E04398A81A3249573DC873FF2F823D4ABE628438C59F1DF2D579DC845C5DB1037AA133836F8F41928BB41FD9709BDB288D52324C21FC89672E46302DF5AC6459A9ABEAB5C7EE29784935F2B396D54CB2580891E378B32DA6811B095C4F109BA10203F379DD98CE3D93DD34052BF70F77ED04D8E75538D33F7B86033D5CB9D1F4A8FA437D30C0D352EC6D52E382B8C105AD2478ACAC2B344B7D6804D30434FF8640FA0A9E34C15B46F89A54B8D875E34A0DF9F723F2F6751FDE78FCC7679A59A12D15AFAF408C1462858D0274895B481D9356C27830E2AB78B3DA7B31CD940F636AF29DB9ED38C841ED600BBBB825C4D93</code></pre>
|
||||
<pre><code>encrypted_data = E860B93D4388D29FEE6F4A6A3FD9C40FF5D1AEE7A7C6F34FFDAAC5074CB2C40DF66A4EAADBE7A5F9507092103285799B5DB0D22DC49CEF81573E06AB5C3A22C6512A55C6451426643C2CA784B3B1F5F54DEB82A908B76C7B69C7CFC685EC9806F2B74FC0A8EBE2BF6134A3000BE438AADB7E8AF0222C164FE10777475A536D1DBFFB1F442765D860FDFEA1DF48FB3707FA1D49DADFDBCDC1FE2CC4024DE0CA09F6A0F72B85E658A2471B551B53ECE9A844AB2933397E331033B90FF8DBB808D53977F29785D855CEF4A53EE6DE4ED8C87255E3D46E2E7865555B9DCDC025DC35CFF85B91189AFF56150E53A4F5EB4C640C10B0CC5625163E07F89B4E78FCC704</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 58 38 09 00 77 57 6A 65
|
||||
0010 | 40 01 00 00 BE E4 12 D7 32 E0 57 DC 82 0E 13 67
|
||||
0020 | DA C9 FD EF B0 0D FA E3 87 69 98 EC 69 F2 D2 8B
|
||||
0030 | 69 12 57 F3 D9 52 84 D8 04 64 EC 73 25 00 00 00
|
||||
0040 | 04 72 48 AE 71 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 8E DF 03 01 1B 64 DF 28 31 57 7B 8D
|
||||
0060 | BF 0E 73 9E 04 39 8A 81 A3 24 95 73 DC 87 3F F2
|
||||
0070 | F8 23 D4 AB E6 28 43 8C 59 F1 DF 2D 57 9D C8 45
|
||||
0080 | C5 DB 10 37 AA 13 38 36 F8 F4 19 28 BB 41 FD 97
|
||||
0090 | 09 BD B2 88 D5 23 24 C2 1F C8 96 72 E4 63 02 DF
|
||||
00A0 | 5A C6 45 9A 9A BE AB 5C 7E E2 97 84 93 5F 2B 39
|
||||
00B0 | 6D 54 CB 25 80 89 1E 37 8B 32 DA 68 11 B0 95 C4
|
||||
00C0 | F1 09 BA 10 20 3F 37 9D D9 8C E3 D9 3D D3 40 52
|
||||
00D0 | BF 70 F7 7E D0 4D 8E 75 53 8D 33 F7 B8 60 33 D5
|
||||
00E0 | CB 9D 1F 4A 8F A4 37 D3 0C 0D 35 2E C6 D5 2E 38
|
||||
00F0 | 2B 8C 10 5A D2 47 8A CA C2 B3 44 B7 D6 80 4D 30
|
||||
0100 | 43 4F F8 64 0F A0 A9 E3 4C 15 B4 6F 89 A5 4B 8D
|
||||
0110 | 87 5E 34 A0 DF 9F 72 3F 2F 67 51 FD E7 8F CC 76
|
||||
0120 | 79 A5 9A 12 D1 5A FA F4 08 C1 46 28 58 D0 27 48
|
||||
0130 | 95 B4 81 D9 35 6C 27 83 0E 2A B7 8B 3D A7 B3 1C
|
||||
0140 | D9 40 F6 36 AF 29 DB 9E D3 8C 84 1E D6 00 BB BB
|
||||
0150 | 82 5C 4D 93</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 B0 3A 0A 00 29 9B 6C 65
|
||||
0010 | 40 01 00 00 BE E4 12 D7 B0 69 7A FD F7 E5 50 64
|
||||
0020 | 0E A2 6A DB 92 59 0D E2 FE AC 66 0A F9 82 4B 19
|
||||
0030 | 0F 2A B1 7D A0 85 CE 8B 04 4B B6 41 13 00 00 00
|
||||
0040 | 04 63 75 0E A7 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 E8 60 B9 3D 43 88 D2 9F EE 6F 4A 6A
|
||||
0060 | 3F D9 C4 0F F5 D1 AE E7 A7 C6 F3 4F FD AA C5 07
|
||||
0070 | 4C B2 C4 0D F6 6A 4E AA DB E7 A5 F9 50 70 92 10
|
||||
0080 | 32 85 79 9B 5D B0 D2 2D C4 9C EF 81 57 3E 06 AB
|
||||
0090 | 5C 3A 22 C6 51 2A 55 C6 45 14 26 64 3C 2C A7 84
|
||||
00A0 | B3 B1 F5 F5 4D EB 82 A9 08 B7 6C 7B 69 C7 CF C6
|
||||
00B0 | 85 EC 98 06 F2 B7 4F C0 A8 EB E2 BF 61 34 A3 00
|
||||
00C0 | 0B E4 38 AA DB 7E 8A F0 22 2C 16 4F E1 07 77 47
|
||||
00D0 | 5A 53 6D 1D BF FB 1F 44 27 65 D8 60 FD FE A1 DF
|
||||
00E0 | 48 FB 37 07 FA 1D 49 DA DF DB CD C1 FE 2C C4 02
|
||||
00F0 | 4D E0 CA 09 F6 A0 F7 2B 85 E6 58 A2 47 1B 55 1B
|
||||
0100 | 53 EC E9 A8 44 AB 29 33 39 7E 33 10 33 B9 0F F8
|
||||
0110 | DB B8 08 D5 39 77 F2 97 85 D8 55 CE F4 A5 3E E6
|
||||
0120 | DE 4E D8 C8 72 55 E3 D4 6E 2E 78 65 55 5B 9D CD
|
||||
0130 | C0 25 DC 35 CF F8 5B 91 18 9A FF 56 15 0E 53 A4
|
||||
0140 | F5 EB 4C 64 0C 10 B0 CC 56 25 16 3E 07 F8 9B 4E
|
||||
0150 | 78 FC C7 04</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 = 952ED4932915DBDB298617BE299380F501C64BF57F488A9D3B7A2CEBD
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>5838090077576A65</code></td>
|
||||
<td><code>B03A0A00299B6C65</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 = 952ED4932915DBDB298617BE299380F501C64BF57F488A9D3B7A2CEBD
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>32E057DC820E1367DAC9FDEFB00DFAE3</code></td>
|
||||
<td><code>B0697AFDF7E550640EA26ADB92590DE2</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>876998EC69F2D28B691257F3D95284D8</code></td>
|
||||
<td><code>FEAC660AF9824B190F2AB17DA085CE8B</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p</td>
|
||||
<td>56, 8</td>
|
||||
<td><code>0464EC7325000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1693217573</td>
|
||||
<td><code>044BB64113000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1270235411</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>047248AE71000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1917365873</td>
|
||||
<td><code>0463750EA7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1668615847</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 = 952ED4932915DBDB298617BE299380F501C64BF57F488A9D3B7A2CEBD
|
|||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>80, 260</td>
|
||||
<td><code>FE0001008EDF03011B64DF2831577B8D</code> <code>BF0E739E04398A81A3249573DC873FF2</code> <code>F823D4ABE628438C59F1DF2D579DC845</code> <code>C5DB1037AA133836F8F41928BB41FD97</code> <code>09BDB288D52324C21FC89672E46302DF</code> <code>5AC6459A9ABEAB5C7EE29784935F2B39</code> <code>6D54CB2580891E378B32DA6811B095C4</code> <code>F109BA10203F379DD98CE3D93DD34052</code> <code>BF70F77ED04D8E75538D33F7B86033D5</code> <code>CB9D1F4A8FA437D30C0D352EC6D52E38</code> <code>2B8C105AD2478ACAC2B344B7D6804D30</code> <code>434FF8640FA0A9E34C15B46F89A54B8D</code> <code>875E34A0DF9F723F2F6751FDE78FCC76</code> <code>79A59A12D15AFAF408C1462858D02748</code> <code>95B481D9356C27830E2AB78B3DA7B31C</code> <code>D940F636AF29DB9ED38C841ED600BBBB</code><br> <code>825C4D93</code></td>
|
||||
<td><code>FE000100E860B93D4388D29FEE6F4A6A</code> <code>3FD9C40FF5D1AEE7A7C6F34FFDAAC507</code> <code>4CB2C40DF66A4EAADBE7A5F950709210</code> <code>3285799B5DB0D22DC49CEF81573E06AB</code> <code>5C3A22C6512A55C6451426643C2CA784</code> <code>B3B1F5F54DEB82A908B76C7B69C7CFC6</code> <code>85EC9806F2B74FC0A8EBE2BF6134A300</code> <code>0BE438AADB7E8AF0222C164FE1077747</code> <code>5A536D1DBFFB1F442765D860FDFEA1DF</code> <code>48FB3707FA1D49DADFDBCDC1FE2CC402</code> <code>4DE0CA09F6A0F72B85E658A2471B551B</code> <code>53ECE9A844AB2933397E331033B90FF8</code> <code>DBB808D53977F29785D855CEF4A53EE6</code> <code>DE4ED8C87255E3D46E2E7865555B9DCD</code> <code>C025DC35CFF85B91189AFF56150E53A4</code> <code>F5EB4C640C10B0CC5625163E07F89B4E</code><br> <code>78FCC704</code></td>
|
||||
<td>Value generated above</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -402,47 +402,47 @@ random_padding_bytes = 952ED4932915DBDB298617BE299380F501C64BF57F488A9D3B7A2CEBD
|
|||
<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 28 70 63 78 57 6A 65
|
||||
0010 | 8C 02 00 00 5C 07 E8 D0 32 E0 57 DC 82 0E 13 67
|
||||
0020 | DA C9 FD EF B0 0D FA E3 87 69 98 EC 69 F2 D2 8B
|
||||
0030 | 69 12 57 F3 D9 52 84 D8 FE 50 02 00 C1 7D E3 9B
|
||||
0040 | D4 AA 78 4B C8 4B 89 16 CF A0 08 DE C1 40 88 0A
|
||||
0050 | A6 A1 DD B0 D1 AF DA E9 D8 40 66 2E 41 70 3A 97
|
||||
0060 | 00 6C 94 F7 7B 13 73 21 78 A4 5F B9 3A 20 D2 D0
|
||||
0070 | D9 B8 C3 F5 73 4B 38 FE BE 91 69 55 30 C2 D5 CF
|
||||
0080 | C1 A7 30 45 38 0D 5D 11 B1 D7 2E 88 21 E6 43 87
|
||||
0090 | 78 33 E8 1B 64 DC 76 F8 1F 20 30 F7 8A 10 7A 8C
|
||||
00A0 | 7F 08 EF 6C FD DD 84 71 F0 8D 17 15 C1 96 1B 98
|
||||
00B0 | 31 6A 54 4B D9 B1 0A 86 E3 F5 5F 75 78 13 96 14
|
||||
00C0 | 6B E6 68 B3 1E 4B A7 DD 54 32 CA 04 F1 27 B8 05
|
||||
00D0 | CA C5 87 14 9E ED C2 17 7F 4B C3 63 E9 70 EB 2F
|
||||
00E0 | D3 30 31 B8 AE 04 65 8B E9 64 08 B9 5F CF 6F AF
|
||||
00F0 | 79 13 AC 2B 15 E9 52 73 B7 58 42 B2 E8 FD C6 C9
|
||||
0100 | CF B1 11 A4 2B EB DB 71 3B 34 FB 94 6B 7C 3D F5
|
||||
0110 | 8E E2 99 7C 6C 99 CC 3C E8 5E EF 80 52 5C BD C4
|
||||
0120 | B6 79 E0 56 59 86 67 5A 56 22 DA 67 5D EA 47 16
|
||||
0130 | F1 45 A5 25 51 8E FE 3B A2 25 01 58 0B CF 18 9D
|
||||
0140 | 91 F1 30 C3 AB 18 F3 D1 17 08 4E 14 AE 31 66 56
|
||||
0150 | 8C 26 4D 1C A5 F2 6A 49 02 3C E2 CD 9E 3F C1 8E
|
||||
0160 | B1 0F EE F8 71 12 D5 F9 2F 72 B4 16 4B 36 A8 48
|
||||
0170 | 12 B0 40 53 0E 53 4D EE DE 97 5F 9A CE 07 B9 1E
|
||||
0180 | CE A9 38 3E 91 C1 A8 59 C0 C6 09 BB 75 8E A4 21
|
||||
0190 | 11 DF 60 0F 79 8A C5 7E 26 A7 AB E3 79 EF C2 D1
|
||||
01A0 | FB B0 D4 43 4B E6 4D AC 69 35 DC 05 6F 31 B7 F7
|
||||
01B0 | 88 98 15 AE 7D D7 5F 1B F9 65 E6 2B 54 E8 97 D5
|
||||
01C0 | DE CD 2A 45 79 82 CE C6 81 72 DA 40 78 6D 42 5D
|
||||
01D0 | 28 32 E5 E1 58 A7 91 B4 78 76 78 FD 75 97 74 5F
|
||||
01E0 | A7 14 35 35 39 C9 64 BA 9E 53 C8 1F 1D 16 03 DC
|
||||
01F0 | 20 6F 9A 6D BB A4 9D D1 9A 0E 62 A7 04 2D F6 49
|
||||
0200 | 7F CB 56 E3 F3 45 0E FD 98 A6 CA 39 86 2A B2 4E
|
||||
0210 | 4F F1 B9 D7 5B 3D F8 81 52 EC F0 AA 9E 62 40 E3
|
||||
0220 | 9C 0B 18 77 FA 64 90 E2 E5 A7 B1 C1 33 4D 73 C8
|
||||
0230 | AE E6 CC F7 81 32 CE 64 27 D8 78 E8 7C E1 5A 46
|
||||
0240 | 0D 23 0B 50 7D 45 3A 02 AC A1 35 CF 81 B4 55 EE
|
||||
0250 | 1F 7D DF 8F EF D9 2F 1D 94 29 60 8A 7D 88 3A 07
|
||||
0260 | AC 79 96 AD BE FF D2 A0 92 09 FD 1F 4A D1 15 15
|
||||
0270 | 32 BF 12 ED B0 2E 49 A1 1A 6E 7E 49 49 87 FD 78
|
||||
0280 | 6B A8 83 68 93 E8 EF 60 19 D0 09 B7</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 94 D1 CA 29 9B 6C 65
|
||||
0010 | EC 02 00 00 5C 07 E8 D0 B0 69 7A FD F7 E5 50 64
|
||||
0020 | 0E A2 6A DB 92 59 0D E2 FE AC 66 0A F9 82 4B 19
|
||||
0030 | 0F 2A B1 7D A0 85 CE 8B FE 50 02 00 C3 9E E2 09
|
||||
0040 | EC 80 96 71 0D 35 2E 3B BE 1D 4B 26 12 41 CA 3F
|
||||
0050 | 83 F6 C5 ED 1E 42 72 13 DB C9 30 C4 15 0E 73 A1
|
||||
0060 | 18 5D F1 A2 5B 99 88 1C 8A 3C 2A 5E 12 0A B1 4E
|
||||
0070 | 51 05 C4 C2 41 4F D6 BD 25 79 89 25 D0 A4 62 18
|
||||
0080 | 67 6F B6 0A 19 89 CF F8 9C AC 9B 20 61 BE 4B 68
|
||||
0090 | CD E5 9B 0B CA 81 B4 47 75 B3 DE 66 A3 E3 05 AA
|
||||
00A0 | B9 06 AF 0E 5D 4D C0 06 F1 60 97 6E 21 45 43 E4
|
||||
00B0 | 78 EF A9 E9 1D 19 C3 AF FC FB 96 B1 DA E5 FE 18
|
||||
00C0 | AA ED 6F A3 96 E3 CE 63 63 42 83 EB 6E 61 90 66
|
||||
00D0 | A3 36 F3 F0 5D 4A 4F 95 37 01 53 31 4F F1 CC 0D
|
||||
00E0 | 5C 8E 7C FC 25 A9 22 F1 17 50 BD FA 60 50 1A B7
|
||||
00F0 | 0C 74 D0 C7 3D 13 10 33 74 2E 85 E8 9C EF 90 93
|
||||
0100 | 76 08 52 84 47 A8 A4 07 33 B9 3C D6 7C B3 FF A7
|
||||
0110 | C2 EE 74 29 6A 07 83 5E 16 07 27 80 AA E5 D3 E2
|
||||
0120 | 71 86 63 7C 7B 34 EB 97 43 2A A2 C8 98 0F 79 8C
|
||||
0130 | 1B C6 E5 BB B6 D6 F6 E0 CB A7 35 E7 7A 56 55 A3
|
||||
0140 | E4 55 22 A0 2B BC 29 F1 89 3C 53 7D B1 FC 3E E8
|
||||
0150 | A0 FD 9B 89 F6 F7 96 ED 6B B8 90 BE 2E E4 00 CB
|
||||
0160 | 02 86 69 90 B9 E4 3B AB 90 18 F9 B1 5C F3 AF BC
|
||||
0170 | 06 FD FB 82 3E 9A AD 0C B4 9C F4 E1 D0 C6 DD 39
|
||||
0180 | DE 93 25 A4 2B 5B D0 6E 7C 76 BC 16 F6 52 53 D1
|
||||
0190 | F7 24 6C E7 BE 1B D4 62 AD B2 7B A8 B0 2B 35 8C
|
||||
01A0 | 22 6C 84 DA 56 2A E0 56 13 92 02 61 F3 7C 77 1B
|
||||
01B0 | 89 F1 A1 B0 37 8C 4D 6D CE 71 A5 7E 25 80 39 43
|
||||
01C0 | 6F AF D7 FD 88 78 69 C7 37 D0 5E 9B FC 8D 95 A0
|
||||
01D0 | A8 63 3E 48 A6 39 08 A6 BD F4 E5 FC 12 B4 07 75
|
||||
01E0 | C8 40 CD CF 26 EE 68 44 AF 13 A4 E3 4C 53 9E F3
|
||||
01F0 | A6 15 D0 A7 38 1C 40 B0 03 E2 B1 8C 6D 27 DD 4F
|
||||
0200 | A5 87 64 27 4C DF 2F D5 26 FF 51 92 F7 0B D8 4D
|
||||
0210 | E9 B5 21 4C 07 31 06 30 EE 10 0B 5A 77 F2 6B F1
|
||||
0220 | B3 EA 3C 01 A5 11 33 79 91 B6 05 E6 71 7D A5 AB
|
||||
0230 | 0F E6 60 35 C1 18 D4 E1 05 46 F6 0E 30 17 B0 28
|
||||
0240 | 11 62 C8 95 88 E3 7A 69 15 9E E2 13 47 E9 C0 70
|
||||
0250 | 7E AB C9 DF 97 03 EE BC 88 78 45 97 E6 B9 3E D6
|
||||
0260 | 46 ED FE D5 D9 D3 7E 1C D0 88 FD 13 52 84 5B FB
|
||||
0270 | 6B 66 22 F8 02 BD 53 F3 AA 5A EC 62 F8 A5 69 8F
|
||||
0280 | 80 75 26 84 A0 9F 8C DA 95 90 F1 46</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 = 952ED4932915DBDB298617BE299380F501C64BF57F488A9D3B7A2CEBD
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>0128706378576A65</code></td>
|
||||
<td><code>0194D1CA299B6C65</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>8C020000</code> (652 in decimal)</td>
|
||||
<td><code>EC020000</code> (748 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -482,19 +482,19 @@ random_padding_bytes = 952ED4932915DBDB298617BE299380F501C64BF57F488A9D3B7A2CEBD
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>32E057DC820E1367DAC9FDEFB00DFAE3</code></td>
|
||||
<td><code>B0697AFDF7E550640EA26ADB92590DE2</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>876998EC69F2D28B691257F3D95284D8</code></td>
|
||||
<td><code>FEAC660AF9824B190F2AB17DA085CE8B</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_answer</td>
|
||||
<td>56, 596</td>
|
||||
<td><code>FE500200C17DE39BD4AA784BC84B8916</code> <code>CFA008DEC140880AA6A1DDB0D1AFDAE9</code> <code>D840662E41703A97006C94F77B137321</code> <code>78A45FB93A20D2D0D9B8C3F5734B38FE</code> <code>BE91695530C2D5CFC1A73045380D5D11</code> <code>B1D72E8821E643877833E81B64DC76F8</code> <code>1F2030F78A107A8C7F08EF6CFDDD8471</code> <code>F08D1715C1961B98316A544BD9B10A86</code> <code>E3F55F75781396146BE668B31E4BA7DD</code> <code>5432CA04F127B805CAC587149EEDC217</code> <code>7F4BC363E970EB2FD33031B8AE04658B</code> <code>E96408B95FCF6FAF7913AC2B15E95273</code> <code>B75842B2E8FDC6C9CFB111A42BEBDB71</code> <code>3B34FB946B7C3DF58EE2997C6C99CC3C</code> <code>E85EEF80525CBDC4B679E0565986675A</code> <code>5622DA675DEA4716F145A525518EFE3B</code> <code>A22501580BCF189D91F130C3AB18F3D1</code> <code>17084E14AE3166568C264D1CA5F26A49</code> <code>023CE2CD9E3FC18EB10FEEF87112D5F9</code> <code>2F72B4164B36A84812B040530E534DEE</code> <code>DE975F9ACE07B91ECEA9383E91C1A859</code> <code>C0C609BB758EA42111DF600F798AC57E</code> <code>26A7ABE379EFC2D1FBB0D4434BE64DAC</code> <code>6935DC056F31B7F7889815AE7DD75F1B</code> <code>F965E62B54E897D5DECD2A457982CEC6</code> <code>8172DA40786D425D2832E5E158A791B4</code> <code>787678FD7597745FA714353539C964BA</code> <code>9E53C81F1D1603DC206F9A6DBBA49DD1</code> <code>9A0E62A7042DF6497FCB56E3F3450EFD</code> <code>98A6CA39862AB24E4FF1B9D75B3DF881</code> <code>52ECF0AA9E6240E39C0B1877FA6490E2</code> <code>E5A7B1C1334D73C8AEE6CCF78132CE64</code> <code>27D878E87CE15A460D230B507D453A02</code> <code>ACA135CF81B455EE1F7DDF8FEFD92F1D</code> <code>9429608A7D883A07AC7996ADBEFFD2A0</code> <code>9209FD1F4AD1151532BF12EDB02E49A1</code> <code>1A6E7E494987FD786BA8836893E8EF60</code><br> <code>19D009B7</code></td>
|
||||
<td><code>FE500200C39EE209EC8096710D352E3B</code> <code>BE1D4B261241CA3F83F6C5ED1E427213</code> <code>DBC930C4150E73A1185DF1A25B99881C</code> <code>8A3C2A5E120AB14E5105C4C2414FD6BD</code> <code>25798925D0A46218676FB60A1989CFF8</code> <code>9CAC9B2061BE4B68CDE59B0BCA81B447</code> <code>75B3DE66A3E305AAB906AF0E5D4DC006</code> <code>F160976E214543E478EFA9E91D19C3AF</code> <code>FCFB96B1DAE5FE18AAED6FA396E3CE63</code> <code>634283EB6E619066A336F3F05D4A4F95</code> <code>370153314FF1CC0D5C8E7CFC25A922F1</code> <code>1750BDFA60501AB70C74D0C73D131033</code> <code>742E85E89CEF90937608528447A8A407</code> <code>33B93CD67CB3FFA7C2EE74296A07835E</code> <code>16072780AAE5D3E27186637C7B34EB97</code> <code>432AA2C8980F798C1BC6E5BBB6D6F6E0</code> <code>CBA735E77A5655A3E45522A02BBC29F1</code> <code>893C537DB1FC3EE8A0FD9B89F6F796ED</code> <code>6BB890BE2EE400CB02866990B9E43BAB</code> <code>9018F9B15CF3AFBC06FDFB823E9AAD0C</code> <code>B49CF4E1D0C6DD39DE9325A42B5BD06E</code> <code>7C76BC16F65253D1F7246CE7BE1BD462</code> <code>ADB27BA8B02B358C226C84DA562AE056</code> <code>13920261F37C771B89F1A1B0378C4D6D</code> <code>CE71A57E258039436FAFD7FD887869C7</code> <code>37D05E9BFC8D95A0A8633E48A63908A6</code> <code>BDF4E5FC12B40775C840CDCF26EE6844</code> <code>AF13A4E34C539EF3A615D0A7381C40B0</code> <code>03E2B18C6D27DD4FA58764274CDF2FD5</code> <code>26FF5192F70BD84DE9B5214C07310630</code> <code>EE100B5A77F26BF1B3EA3C01A5113379</code> <code>91B605E6717DA5AB0FE66035C118D4E1</code> <code>0546F60E3017B0281162C89588E37A69</code> <code>159EE21347E9C0707EABC9DF9703EEBC</code> <code>88784597E6B93ED646EDFED5D9D37E1C</code> <code>D088FD1352845BFB6B6622F802BD53F3</code> <code>AA5AEC62F8A5698F80752684A09F8CDA</code><br> <code>9590F146</code></td>
|
||||
<td>See below</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -502,20 +502,20 @@ random_padding_bytes = 952ED4932915DBDB298617BE299380F501C64BF57F488A9D3B7A2CEBD
|
|||
<!-- 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 = C17DE39BD4AA784BC84B8916CFA008DEC140880AA6A1DDB0D1AFDAE9D840662E41703A97006C94F77B13732178A45FB93A20D2D0D9B8C3F5734B38FEBE91695530C2D5CFC1A73045380D5D11B1D72E8821E643877833E81B64DC76F81F2030F78A107A8C7F08EF6CFDDD8471F08D1715C1961B98316A544BD9B10A86E3F55F75781396146BE668B31E4BA7DD5432CA04F127B805CAC587149EEDC2177F4BC363E970EB2FD33031B8AE04658BE96408B95FCF6FAF7913AC2B15E95273B75842B2E8FDC6C9CFB111A42BEBDB713B34FB946B7C3DF58EE2997C6C99CC3CE85EEF80525CBDC4B679E0565986675A5622DA675DEA4716F145A525518EFE3BA22501580BCF189D91F130C3AB18F3D117084E14AE3166568C264D1CA5F26A49023CE2CD9E3FC18EB10FEEF87112D5F92F72B4164B36A84812B040530E534DEEDE975F9ACE07B91ECEA9383E91C1A859C0C609BB758EA42111DF600F798AC57E26A7ABE379EFC2D1FBB0D4434BE64DAC6935DC056F31B7F7889815AE7DD75F1BF965E62B54E897D5DECD2A457982CEC68172DA40786D425D2832E5E158A791B4787678FD7597745FA714353539C964BA9E53C81F1D1603DC206F9A6DBBA49DD19A0E62A7042DF6497FCB56E3F3450EFD98A6CA39862AB24E4FF1B9D75B3DF88152ECF0AA9E6240E39C0B1877FA6490E2E5A7B1C1334D73C8AEE6CCF78132CE6427D878E87CE15A460D230B507D453A02ACA135CF81B455EE1F7DDF8FEFD92F1D9429608A7D883A07AC7996ADBEFFD2A09209FD1F4AD1151532BF12EDB02E49A11A6E7E494987FD786BA8836893E8EF6019D009B7
|
||||
tmp_aes_key = 1FA0C6C36D28340F63C36679A188F02CBC03D6791638C1933344638328FA854A
|
||||
tmp_aes_iv = 220ECFDF406702AC5470D1E4CB02A9E4978FD532FF34E56D05742C3B60535397</code></pre>
|
||||
<pre><code>encrypted_answer = C39EE209EC8096710D352E3BBE1D4B261241CA3F83F6C5ED1E427213DBC930C4150E73A1185DF1A25B99881C8A3C2A5E120AB14E5105C4C2414FD6BD25798925D0A46218676FB60A1989CFF89CAC9B2061BE4B68CDE59B0BCA81B44775B3DE66A3E305AAB906AF0E5D4DC006F160976E214543E478EFA9E91D19C3AFFCFB96B1DAE5FE18AAED6FA396E3CE63634283EB6E619066A336F3F05D4A4F95370153314FF1CC0D5C8E7CFC25A922F11750BDFA60501AB70C74D0C73D131033742E85E89CEF90937608528447A8A40733B93CD67CB3FFA7C2EE74296A07835E16072780AAE5D3E27186637C7B34EB97432AA2C8980F798C1BC6E5BBB6D6F6E0CBA735E77A5655A3E45522A02BBC29F1893C537DB1FC3EE8A0FD9B89F6F796ED6BB890BE2EE400CB02866990B9E43BAB9018F9B15CF3AFBC06FDFB823E9AAD0CB49CF4E1D0C6DD39DE9325A42B5BD06E7C76BC16F65253D1F7246CE7BE1BD462ADB27BA8B02B358C226C84DA562AE05613920261F37C771B89F1A1B0378C4D6DCE71A57E258039436FAFD7FD887869C737D05E9BFC8D95A0A8633E48A63908A6BDF4E5FC12B40775C840CDCF26EE6844AF13A4E34C539EF3A615D0A7381C40B003E2B18C6D27DD4FA58764274CDF2FD526FF5192F70BD84DE9B5214C07310630EE100B5A77F26BF1B3EA3C01A511337991B605E6717DA5AB0FE66035C118D4E10546F60E3017B0281162C89588E37A69159EE21347E9C0707EABC9DF9703EEBC88784597E6B93ED646EDFED5D9D37E1CD088FD1352845BFB6B6622F802BD53F3AA5AEC62F8A5698F80752684A09F8CDA9590F146
|
||||
tmp_aes_key = 668610D763D3448CD0105B192110D48F48A44E8F8881873208DAB2E4C0909447
|
||||
tmp_aes_iv = A922BBD641DBFA4F93367A356DC3477420A3D1E970DFECEAF029345EC96CB73B</code></pre>
|
||||
<!-- end server_DH_inner_data_input -->
|
||||
<p>Yielding:</p>
|
||||
<!-- start server_DH_inner_data_output -->
|
||||
<pre><code>answer_with_hash = F732413E871A433AECFB6FAC249466CEB1560585BA0D89B532E057DC820E1367DAC9FDEFB00DFAE3876998EC69F2D28B691257F3D95284D803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010036818F1E00E7591F6A206F579064D243E9F0064137DBBFD1A690484E5AAFB7B9EF7BB2A8955E92E37A7271736944E35E7C10015D24A9863931E9ACA5EFDE76A01339FBBC0334908CBBBB08304FD7D8D15DF0A211ADE4AA2FE558CFBF223063C6CD0F00673A5E5DA0C49D450923F9CEE7FAC37E7F79DB1307C35C6D3AAF26C41A2B7E44EA360AD75B9994B90C43FD2B344D3AC5ED7FBD69CC04E74C3FAFB27027AE55D600E1F74D24984A735551100256A579029DD39739D85BACF4C16279FA6728CA5B187FD5CF585C9C4039E6EB43E7F52F5A12956A465B057757AD0282DB99A67D2C7060E942E5587FB6B99FD43CE0BF6D06CB5089ABECFAD8C5CEA3C52DA078576A6597337D3B9DC224B6
|
||||
answer = BA0D89B532E057DC820E1367DAC9FDEFB00DFAE3876998EC69F2D28B691257F3D95284D803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010036818F1E00E7591F6A206F579064D243E9F0064137DBBFD1A690484E5AAFB7B9EF7BB2A8955E92E37A7271736944E35E7C10015D24A9863931E9ACA5EFDE76A01339FBBC0334908CBBBB08304FD7D8D15DF0A211ADE4AA2FE558CFBF223063C6CD0F00673A5E5DA0C49D450923F9CEE7FAC37E7F79DB1307C35C6D3AAF26C41A2B7E44EA360AD75B9994B90C43FD2B344D3AC5ED7FBD69CC04E74C3FAFB27027AE55D600E1F74D24984A735551100256A579029DD39739D85BACF4C16279FA6728CA5B187FD5CF585C9C4039E6EB43E7F52F5A12956A465B057757AD0282DB99A67D2C7060E942E5587FB6B99FD43CE0BF6D06CB5089ABECFAD8C5CEA3C52DA078576A6597337D3B9DC224B6</code></pre>
|
||||
<pre><code>answer_with_hash = F64B0014BE61E1AA96FCAA18C13FCCAB03858EBDBA0D89B5B0697AFDF7E550640EA26ADB92590DE2FEAC660AF9824B190F2AB17DA085CE8B03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100065039438661DCE2B8224967E92227644F6D61438224ECEAA11CD6B63A0CBB4D2845541292732A09720806035A6D3AC2DA0A4C49D15BDBC4B51663304FA8E0BAE80899FBAA3CD646D6A11701CF0F35F6E5678183C05B490507675F06434CEB2AAE2C9270A02FC0567D48211477A0767431E8E7E643B2527EF560ABB35CDB2C14C68B5ED55A11DF0EDF590E8D71FD9958C287112914B9E28B1382EDFF40362DD10ECBE73511C99BF6890BB126BA8D5F7F8B36436D2778A2101505D0909679C84D46A6887A8933FF36EAB1DC626D9A252F51AD6226734ED439CDE480F1D06A07E9E56E195675389FB017C8B2B3114CE1D4E2D16743EAD3176E00714BD9E1817FCC299B6C6570C651999F693459
|
||||
answer = BA0D89B5B0697AFDF7E550640EA26ADB92590DE2FEAC660AF9824B190F2AB17DA085CE8B03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100065039438661DCE2B8224967E92227644F6D61438224ECEAA11CD6B63A0CBB4D2845541292732A09720806035A6D3AC2DA0A4C49D15BDBC4B51663304FA8E0BAE80899FBAA3CD646D6A11701CF0F35F6E5678183C05B490507675F06434CEB2AAE2C9270A02FC0567D48211477A0767431E8E7E643B2527EF560ABB35CDB2C14C68B5ED55A11DF0EDF590E8D71FD9958C287112914B9E28B1382EDFF40362DD10ECBE73511C99BF6890BB126BA8D5F7F8B36436D2778A2101505D0909679C84D46A6887A8933FF36EAB1DC626D9A252F51AD6226734ED439CDE480F1D06A07E9E56E195675389FB017C8B2B3114CE1D4E2D16743EAD3176E00714BD9E1817FCC299B6C6570C651999F693459</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 32 E0 57 DC 82 0E 13 67 DA C9 FD EF
|
||||
0010 | B0 0D FA E3 87 69 98 EC 69 F2 D2 8B 69 12 57 F3
|
||||
0020 | D9 52 84 D8 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
||||
<pre><code>0000 | BA 0D 89 B5 B0 69 7A FD F7 E5 50 64 0E A2 6A DB
|
||||
0010 | 92 59 0D E2 FE AC 66 0A F9 82 4B 19 0F 2A B1 7D
|
||||
0020 | A0 85 CE 8B 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 = BA0D89B532E057DC820E1367DAC9FDEFB00DFAE3876998EC69F2D28B691257F3D95284D
|
|||
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 | 36 81 8F 1E 00 E7 59 1F 6A 20 6F 57 90 64 D2 43
|
||||
0140 | E9 F0 06 41 37 DB BF D1 A6 90 48 4E 5A AF B7 B9
|
||||
0150 | EF 7B B2 A8 95 5E 92 E3 7A 72 71 73 69 44 E3 5E
|
||||
0160 | 7C 10 01 5D 24 A9 86 39 31 E9 AC A5 EF DE 76 A0
|
||||
0170 | 13 39 FB BC 03 34 90 8C BB BB 08 30 4F D7 D8 D1
|
||||
0180 | 5D F0 A2 11 AD E4 AA 2F E5 58 CF BF 22 30 63 C6
|
||||
0190 | CD 0F 00 67 3A 5E 5D A0 C4 9D 45 09 23 F9 CE E7
|
||||
01A0 | FA C3 7E 7F 79 DB 13 07 C3 5C 6D 3A AF 26 C4 1A
|
||||
01B0 | 2B 7E 44 EA 36 0A D7 5B 99 94 B9 0C 43 FD 2B 34
|
||||
01C0 | 4D 3A C5 ED 7F BD 69 CC 04 E7 4C 3F AF B2 70 27
|
||||
01D0 | AE 55 D6 00 E1 F7 4D 24 98 4A 73 55 51 10 02 56
|
||||
01E0 | A5 79 02 9D D3 97 39 D8 5B AC F4 C1 62 79 FA 67
|
||||
01F0 | 28 CA 5B 18 7F D5 CF 58 5C 9C 40 39 E6 EB 43 E7
|
||||
0200 | F5 2F 5A 12 95 6A 46 5B 05 77 57 AD 02 82 DB 99
|
||||
0210 | A6 7D 2C 70 60 E9 42 E5 58 7F B6 B9 9F D4 3C E0
|
||||
0220 | BF 6D 06 CB 50 89 AB EC FA D8 C5 CE A3 C5 2D A0
|
||||
0230 | 78 57 6A 65</code></pre>
|
||||
0130 | 06 50 39 43 86 61 DC E2 B8 22 49 67 E9 22 27 64
|
||||
0140 | 4F 6D 61 43 82 24 EC EA A1 1C D6 B6 3A 0C BB 4D
|
||||
0150 | 28 45 54 12 92 73 2A 09 72 08 06 03 5A 6D 3A C2
|
||||
0160 | DA 0A 4C 49 D1 5B DB C4 B5 16 63 30 4F A8 E0 BA
|
||||
0170 | E8 08 99 FB AA 3C D6 46 D6 A1 17 01 CF 0F 35 F6
|
||||
0180 | E5 67 81 83 C0 5B 49 05 07 67 5F 06 43 4C EB 2A
|
||||
0190 | AE 2C 92 70 A0 2F C0 56 7D 48 21 14 77 A0 76 74
|
||||
01A0 | 31 E8 E7 E6 43 B2 52 7E F5 60 AB B3 5C DB 2C 14
|
||||
01B0 | C6 8B 5E D5 5A 11 DF 0E DF 59 0E 8D 71 FD 99 58
|
||||
01C0 | C2 87 11 29 14 B9 E2 8B 13 82 ED FF 40 36 2D D1
|
||||
01D0 | 0E CB E7 35 11 C9 9B F6 89 0B B1 26 BA 8D 5F 7F
|
||||
01E0 | 8B 36 43 6D 27 78 A2 10 15 05 D0 90 96 79 C8 4D
|
||||
01F0 | 46 A6 88 7A 89 33 FF 36 EA B1 DC 62 6D 9A 25 2F
|
||||
0200 | 51 AD 62 26 73 4E D4 39 CD E4 80 F1 D0 6A 07 E9
|
||||
0210 | E5 6E 19 56 75 38 9F B0 17 C8 B2 B3 11 4C E1 D4
|
||||
0220 | E2 D1 67 43 EA D3 17 6E 00 71 4B D9 E1 81 7F CC
|
||||
0230 | 29 9B 6C 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 = BA0D89B532E057DC820E1367DAC9FDEFB00DFAE3876998EC69F2D28B691257F3D95284D
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>32E057DC820E1367DAC9FDEFB00DFAE3</code></td>
|
||||
<td><code>B0697AFDF7E550640EA26ADB92590DE2</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>876998EC69F2D28B691257F3D95284D8</code></td>
|
||||
<td><code>FEAC660AF9824B190F2AB17DA085CE8B</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -594,13 +594,13 @@ answer = BA0D89B532E057DC820E1367DAC9FDEFB00DFAE3876998EC69F2D28B691257F3D95284D
|
|||
<tr>
|
||||
<td>g_a</td>
|
||||
<td>300, 260</td>
|
||||
<td><code>FE00010036818F1E00E7591F6A206F57</code> <code>9064D243E9F0064137DBBFD1A690484E</code> <code>5AAFB7B9EF7BB2A8955E92E37A727173</code> <code>6944E35E7C10015D24A9863931E9ACA5</code> <code>EFDE76A01339FBBC0334908CBBBB0830</code> <code>4FD7D8D15DF0A211ADE4AA2FE558CFBF</code> <code>223063C6CD0F00673A5E5DA0C49D4509</code> <code>23F9CEE7FAC37E7F79DB1307C35C6D3A</code> <code>AF26C41A2B7E44EA360AD75B9994B90C</code> <code>43FD2B344D3AC5ED7FBD69CC04E74C3F</code> <code>AFB27027AE55D600E1F74D24984A7355</code> <code>51100256A579029DD39739D85BACF4C1</code> <code>6279FA6728CA5B187FD5CF585C9C4039</code> <code>E6EB43E7F52F5A12956A465B057757AD</code> <code>0282DB99A67D2C7060E942E5587FB6B9</code> <code>9FD43CE0BF6D06CB5089ABECFAD8C5CE</code><br> <code>A3C52DA0</code></td>
|
||||
<td><code>FE000100065039438661DCE2B8224967</code> <code>E92227644F6D61438224ECEAA11CD6B6</code> <code>3A0CBB4D2845541292732A0972080603</code> <code>5A6D3AC2DA0A4C49D15BDBC4B5166330</code> <code>4FA8E0BAE80899FBAA3CD646D6A11701</code> <code>CF0F35F6E5678183C05B490507675F06</code> <code>434CEB2AAE2C9270A02FC0567D482114</code> <code>77A0767431E8E7E643B2527EF560ABB3</code> <code>5CDB2C14C68B5ED55A11DF0EDF590E8D</code> <code>71FD9958C287112914B9E28B1382EDFF</code> <code>40362DD10ECBE73511C99BF6890BB126</code> <code>BA8D5F7F8B36436D2778A2101505D090</code> <code>9679C84D46A6887A8933FF36EAB1DC62</code> <code>6D9A252F51AD6226734ED439CDE480F1</code> <code>D06A07E9E56E195675389FB017C8B2B3</code> <code>114CE1D4E2D16743EAD3176E00714BD9</code><br> <code>E1817FCC</code></td>
|
||||
<td><code>g_a</code> diffie-hellman parameter</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_time</td>
|
||||
<td>560, 4</td>
|
||||
<td><code>78576A65</code> (1701468024 in decimal)</td>
|
||||
<td><code>299B6C65</code> (1701616425 in decimal)</td>
|
||||
<td>Server time</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -609,34 +609,34 @@ answer = BA0D89B532E057DC820E1367DAC9FDEFB00DFAE3876998EC69F2D28B691257F3D95284D
|
|||
<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 = FA223F79DB839C4032A866C22627E8A2BEDC7D7DD97750EC78C16A1DD1EEB5A7A524B278E3CBF338F6B4534FA2E1D02F54AFE9DE6D2A0EF202AC120EF371EB46EA441593A97B55D3D6C1D953D745D61184F55E62FEB477C9EFDAB7DA2F140F3120E6EDE8BEAEAE832CB044C5D21B72736BC218852C83E79D273906AAE118C3A7A1869B231D07957ED3CEFDBC9288FCFB7D67124ECB741DA87F2F09DE5C9446EF701AAB6C669387281AA33C3DA36FD729FF262BBF882A571DABC0B536CF61901DEECC74FB50EAACA96853C36EAF9CE9618A8D0D1631670018306CA8259487D5F5AB8284D66E788B839BAE3E86A84361ED6E1932F1BE136974300965F624A9874F</code></pre>
|
||||
<pre><code>b = A6B98A45AB89CF2E759A556982AF732D1E78F44276DB83C371FD474ECBE1020CD825CE8DCC077B8CC8404514449BB66C2DD075E3C050CA0C2176948F033197912A1C32783A1C807ED82E76EE4203654D76A57601CDA8E4F45F03F4BD4418015380CBF778ED9ED702CB1954D9EE019A1530D635BA6A13F0D31CF7E1ECFC3C1482A159F1F7C6F801619D5D3C783D84EABA01D2B0A2BF926E4307EA5C8B0A2AAFBAE6A41F2E70E28D0B92BBA7D6F77CC724D297C6296AB3CAFB49CF6C82514FE075D86FA4DD20B4BBFAA91CDD5543325F6C700C3C560BF0CD3049066D01D3B9E2925273B32FF49710E5B24C5A3109490799F87E9026917147A47A820EC6A119A016</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 = 4794207B47FFE9402E417C311BBB1E5AB2208C86C54618B57ADFE9F3F76E4BC1A2C1F9A673633995763B7D841ED27560274F053C655A9E449CF202C1694D66E1FE8908456D575CFA9FB95EF93FA70A83E25065759D532B696358DAC071BEC0190E277CB1498E73CE014C9CBA14BF8B0760A52EBC54BDE6F9F82E97B20A734EE02DB16E086B5CBC896E750F61EC581D4B24F0A2FA6D4E4D0E93A20B3FCD59DDA25AD614F71A2C3A321A4203D27C711B8092ED126CA3D2A2D41D19A6E412B6AA1D8CFF391250E594B688F103DDBF0BB2FEDCE1C803F72C784E894C85A41E7CD8C922F53C84C7B0D0C518E9F1478F89681430A96674B0203CCDD6FD5D3F5E0EEA79</code></pre>
|
||||
<pre><code>g_b = 593D04663CDA5975735282EE4A67E7A1BCA672A2E44E1CECAEE63110734C101E8D1504CA33F98A94CD5DC904A4DE45C4117CE07E6D30AF3370E5AFCA20D0BCCE86B97B74A613DF0841A981CA8C6E2768D5041A371DF571EAD4BDD6645EB15742F4FEF19BEE1F317A400279D095CDB54B8A73998A7A46B50DAC02177537040412C72E1E103AE8E7D4E49C7D193DB043821EF06EA6EE4667F05B643B6C47C4AB13F3B1BE81DF776E2FC0A1C9969A8451833800E25537070E4FF6F78D017654B3C58168152D8959DA48DB34BBA1937D327A4891B2CB935D1CD9F624F599E5734D9D6CE4C8BDA382D331BCBE126E0598C86E55BF2BF98AF1BEDC695A1009F78AD0B1</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 32 E0 57 DC 82 0E 13 67 DA C9 FD EF
|
||||
0010 | B0 0D FA E3 87 69 98 EC 69 F2 D2 8B 69 12 57 F3
|
||||
0020 | D9 52 84 D8 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | 47 94 20 7B 47 FF E9 40 2E 41 7C 31 1B BB 1E 5A
|
||||
0040 | B2 20 8C 86 C5 46 18 B5 7A DF E9 F3 F7 6E 4B C1
|
||||
0050 | A2 C1 F9 A6 73 63 39 95 76 3B 7D 84 1E D2 75 60
|
||||
0060 | 27 4F 05 3C 65 5A 9E 44 9C F2 02 C1 69 4D 66 E1
|
||||
0070 | FE 89 08 45 6D 57 5C FA 9F B9 5E F9 3F A7 0A 83
|
||||
0080 | E2 50 65 75 9D 53 2B 69 63 58 DA C0 71 BE C0 19
|
||||
0090 | 0E 27 7C B1 49 8E 73 CE 01 4C 9C BA 14 BF 8B 07
|
||||
00A0 | 60 A5 2E BC 54 BD E6 F9 F8 2E 97 B2 0A 73 4E E0
|
||||
00B0 | 2D B1 6E 08 6B 5C BC 89 6E 75 0F 61 EC 58 1D 4B
|
||||
00C0 | 24 F0 A2 FA 6D 4E 4D 0E 93 A2 0B 3F CD 59 DD A2
|
||||
00D0 | 5A D6 14 F7 1A 2C 3A 32 1A 42 03 D2 7C 71 1B 80
|
||||
00E0 | 92 ED 12 6C A3 D2 A2 D4 1D 19 A6 E4 12 B6 AA 1D
|
||||
00F0 | 8C FF 39 12 50 E5 94 B6 88 F1 03 DD BF 0B B2 FE
|
||||
0100 | DC E1 C8 03 F7 2C 78 4E 89 4C 85 A4 1E 7C D8 C9
|
||||
0110 | 22 F5 3C 84 C7 B0 D0 C5 18 E9 F1 47 8F 89 68 14
|
||||
0120 | 30 A9 66 74 B0 20 3C CD D6 FD 5D 3F 5E 0E EA 79</code></pre>
|
||||
<pre><code>0000 | 54 B6 43 66 B0 69 7A FD F7 E5 50 64 0E A2 6A DB
|
||||
0010 | 92 59 0D E2 FE AC 66 0A F9 82 4B 19 0F 2A B1 7D
|
||||
0020 | A0 85 CE 8B 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | 59 3D 04 66 3C DA 59 75 73 52 82 EE 4A 67 E7 A1
|
||||
0040 | BC A6 72 A2 E4 4E 1C EC AE E6 31 10 73 4C 10 1E
|
||||
0050 | 8D 15 04 CA 33 F9 8A 94 CD 5D C9 04 A4 DE 45 C4
|
||||
0060 | 11 7C E0 7E 6D 30 AF 33 70 E5 AF CA 20 D0 BC CE
|
||||
0070 | 86 B9 7B 74 A6 13 DF 08 41 A9 81 CA 8C 6E 27 68
|
||||
0080 | D5 04 1A 37 1D F5 71 EA D4 BD D6 64 5E B1 57 42
|
||||
0090 | F4 FE F1 9B EE 1F 31 7A 40 02 79 D0 95 CD B5 4B
|
||||
00A0 | 8A 73 99 8A 7A 46 B5 0D AC 02 17 75 37 04 04 12
|
||||
00B0 | C7 2E 1E 10 3A E8 E7 D4 E4 9C 7D 19 3D B0 43 82
|
||||
00C0 | 1E F0 6E A6 EE 46 67 F0 5B 64 3B 6C 47 C4 AB 13
|
||||
00D0 | F3 B1 BE 81 DF 77 6E 2F C0 A1 C9 96 9A 84 51 83
|
||||
00E0 | 38 00 E2 55 37 07 0E 4F F6 F7 8D 01 76 54 B3 C5
|
||||
00F0 | 81 68 15 2D 89 59 DA 48 DB 34 BB A1 93 7D 32 7A
|
||||
0100 | 48 91 B2 CB 93 5D 1C D9 F6 24 F5 99 E5 73 4D 9D
|
||||
0110 | 6C E4 C8 BD A3 82 D3 31 BC BE 12 6E 05 98 C8 6E
|
||||
0120 | 55 BF 2B F9 8A F1 BE DC 69 5A 10 09 F7 8A D0 B1</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 = BA0D89B532E057DC820E1367DAC9FDEFB00DFAE3876998EC69F2D28B691257F3D95284D
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>32E057DC820E1367DAC9FDEFB00DFAE3</code></td>
|
||||
<td><code>B0697AFDF7E550640EA26ADB92590DE2</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>876998EC69F2D28B691257F3D95284D8</code></td>
|
||||
<td><code>FEAC660AF9824B190F2AB17DA085CE8B</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>g_b</td>
|
||||
<td>36, 260</td>
|
||||
<td><code>FE0001004794207B47FFE9402E417C31</code> <code>1BBB1E5AB2208C86C54618B57ADFE9F3</code> <code>F76E4BC1A2C1F9A673633995763B7D84</code> <code>1ED27560274F053C655A9E449CF202C1</code> <code>694D66E1FE8908456D575CFA9FB95EF9</code> <code>3FA70A83E25065759D532B696358DAC0</code> <code>71BEC0190E277CB1498E73CE014C9CBA</code> <code>14BF8B0760A52EBC54BDE6F9F82E97B2</code> <code>0A734EE02DB16E086B5CBC896E750F61</code> <code>EC581D4B24F0A2FA6D4E4D0E93A20B3F</code> <code>CD59DDA25AD614F71A2C3A321A4203D2</code> <code>7C711B8092ED126CA3D2A2D41D19A6E4</code> <code>12B6AA1D8CFF391250E594B688F103DD</code> <code>BF0BB2FEDCE1C803F72C784E894C85A4</code> <code>1E7CD8C922F53C84C7B0D0C518E9F147</code> <code>8F89681430A96674B0203CCDD6FD5D3F</code><br> <code>5E0EEA79</code></td>
|
||||
<td><code>FE000100593D04663CDA5975735282EE</code> <code>4A67E7A1BCA672A2E44E1CECAEE63110</code> <code>734C101E8D1504CA33F98A94CD5DC904</code> <code>A4DE45C4117CE07E6D30AF3370E5AFCA</code> <code>20D0BCCE86B97B74A613DF0841A981CA</code> <code>8C6E2768D5041A371DF571EAD4BDD664</code> <code>5EB15742F4FEF19BEE1F317A400279D0</code> <code>95CDB54B8A73998A7A46B50DAC021775</code> <code>37040412C72E1E103AE8E7D4E49C7D19</code> <code>3DB043821EF06EA6EE4667F05B643B6C</code> <code>47C4AB13F3B1BE81DF776E2FC0A1C996</code> <code>9A8451833800E25537070E4FF6F78D01</code> <code>7654B3C58168152D8959DA48DB34BBA1</code> <code>937D327A4891B2CB935D1CD9F624F599</code> <code>E5734D9D6CE4C8BDA382D331BCBE126E</code> <code>0598C86E55BF2BF98AF1BEDC695A1009</code><br> <code>F78AD0B1</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 = BA0D89B532E057DC820E1367DAC9FDEFB00DFAE3876998EC69F2D28B691257F3D95284D
|
|||
<!-- 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 = 54B6436632E057DC820E1367DAC9FDEFB00DFAE3876998EC69F2D28B691257F3D95284D80000000000000000FE0001004794207B47FFE9402E417C311BBB1E5AB2208C86C54618B57ADFE9F3F76E4BC1A2C1F9A673633995763B7D841ED27560274F053C655A9E449CF202C1694D66E1FE8908456D575CFA9FB95EF93FA70A83E25065759D532B696358DAC071BEC0190E277CB1498E73CE014C9CBA14BF8B0760A52EBC54BDE6F9F82E97B20A734EE02DB16E086B5CBC896E750F61EC581D4B24F0A2FA6D4E4D0E93A20B3FCD59DDA25AD614F71A2C3A321A4203D27C711B8092ED126CA3D2A2D41D19A6E412B6AA1D8CFF391250E594B688F103DDBF0BB2FEDCE1C803F72C784E894C85A41E7CD8C922F53C84C7B0D0C518E9F1478F89681430A96674B0203CCDD6FD5D3F5E0EEA79
|
||||
padding = 3D0E887B866287F60AB02427
|
||||
tmp_aes_key = 1FA0C6C36D28340F63C36679A188F02CBC03D6791638C1933344638328FA854A
|
||||
tmp_aes_iv = 220ECFDF406702AC5470D1E4CB02A9E4978FD532FF34E56D05742C3B60535397</code></pre>
|
||||
<pre><code>data = 54B64366B0697AFDF7E550640EA26ADB92590DE2FEAC660AF9824B190F2AB17DA085CE8B0000000000000000FE000100593D04663CDA5975735282EE4A67E7A1BCA672A2E44E1CECAEE63110734C101E8D1504CA33F98A94CD5DC904A4DE45C4117CE07E6D30AF3370E5AFCA20D0BCCE86B97B74A613DF0841A981CA8C6E2768D5041A371DF571EAD4BDD6645EB15742F4FEF19BEE1F317A400279D095CDB54B8A73998A7A46B50DAC02177537040412C72E1E103AE8E7D4E49C7D193DB043821EF06EA6EE4667F05B643B6C47C4AB13F3B1BE81DF776E2FC0A1C9969A8451833800E25537070E4FF6F78D017654B3C58168152D8959DA48DB34BBA1937D327A4891B2CB935D1CD9F624F599E5734D9D6CE4C8BDA382D331BCBE126E0598C86E55BF2BF98AF1BEDC695A1009F78AD0B1
|
||||
padding = 3873AFAE5B7795F8342CB49B
|
||||
tmp_aes_key = 668610D763D3448CD0105B192110D48F48A44E8F8881873208DAB2E4C0909447
|
||||
tmp_aes_iv = A922BBD641DBFA4F93367A356DC3477420A3D1E970DFECEAF029345EC96CB73B</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 = 66B0AD9E25FC2135F701BE15BD718C2532491B2AE8C015AACAD46D729A821DFAC4B6452FA1EC816CA2D703B138B4D20C713EB126B98B5B12EE3ED9624C876965C9432395F529CE5D21D85254343D213ED6FE54AFECE50C08183BE192F40C7405571C29322F4F3BBE01D5D71D928D9D559A47C73C6B72C48345AF3F92176B4B63F8BE8E9836378BA2FD2739D26A3ED48892A11A9E8FD02654B0CCB39CA9BB55F91DF7FF56CFCAFF11A592AEFAEC4D65D444F12BC2453DCF0AAFF7CCCF3FE9CDA1F6E372402DC37A397F2F0AEB75DE66B74DADBDBCD7969BF0AB870668A3D2E6B36ED9167855CF134E432A164CA000362A077DBD1646F3BA4E47E51764F9AEF0D0D4F89EEE2C2CC36B1E085E8133289DE510AC2696745330FC4FD49103995CC2556519D5CB27A924EAFAE46E6C8C7CB728FA99569541F2E2E188A18673EAF8C3E54CA0DB7C484F083F9F4165DD9EC603E3</code></pre>
|
||||
<pre><code>encrypted_data = EE7E78B01E5C903C68FD369A20E2D31A5CB0CB4432972ACEFCA6C070AB87655B43B7564834D9E2BFBF790113A20E36789236A264E29E086BBCE67D3284A0BACD1928C088D01091C494068365E22733C7FCE094332BFD5B621030808B96871B57122C4C338BDB5F03F7EA2B3D820A55E35285BC0A86135AEA53A49CF309CF4ADF083A64FD0E604044FDD2E2A1DF386C5A3B12DA3BCEB7F26AA8E49B358D1BC0B246F530E5BB834D24B62442EC257790F3DBBB1856F178511A0A7B8F6D531599F738C684D8AEC684BF9BE886FC5AA588D1C7045FCF542D8AC850C668DF948D739C425E3FBC2382E3EEFDBA4D1524CBE57934FC7DC6CDE2B69A581D1A6F1C4BA10FEB3E4DD8211DAF073143B8A916AA043C00587B9B1AB75843D63720A96BA9A6E9E06480F3A56451176C4AC5B4B99267423A93907A5E0F97BF080D924072A303D520B337904B2DBA47517CD7D2ECFCE551</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 C8 44 05 00 78 57 6A 65
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 32 E0 57 DC 82 0E 13 67
|
||||
0020 | DA C9 FD EF B0 0D FA E3 87 69 98 EC 69 F2 D2 8B
|
||||
0030 | 69 12 57 F3 D9 52 84 D8 FE 50 01 00 66 B0 AD 9E
|
||||
0040 | 25 FC 21 35 F7 01 BE 15 BD 71 8C 25 32 49 1B 2A
|
||||
0050 | E8 C0 15 AA CA D4 6D 72 9A 82 1D FA C4 B6 45 2F
|
||||
0060 | A1 EC 81 6C A2 D7 03 B1 38 B4 D2 0C 71 3E B1 26
|
||||
0070 | B9 8B 5B 12 EE 3E D9 62 4C 87 69 65 C9 43 23 95
|
||||
0080 | F5 29 CE 5D 21 D8 52 54 34 3D 21 3E D6 FE 54 AF
|
||||
0090 | EC E5 0C 08 18 3B E1 92 F4 0C 74 05 57 1C 29 32
|
||||
00A0 | 2F 4F 3B BE 01 D5 D7 1D 92 8D 9D 55 9A 47 C7 3C
|
||||
00B0 | 6B 72 C4 83 45 AF 3F 92 17 6B 4B 63 F8 BE 8E 98
|
||||
00C0 | 36 37 8B A2 FD 27 39 D2 6A 3E D4 88 92 A1 1A 9E
|
||||
00D0 | 8F D0 26 54 B0 CC B3 9C A9 BB 55 F9 1D F7 FF 56
|
||||
00E0 | CF CA FF 11 A5 92 AE FA EC 4D 65 D4 44 F1 2B C2
|
||||
00F0 | 45 3D CF 0A AF F7 CC CF 3F E9 CD A1 F6 E3 72 40
|
||||
0100 | 2D C3 7A 39 7F 2F 0A EB 75 DE 66 B7 4D AD BD BC
|
||||
0110 | D7 96 9B F0 AB 87 06 68 A3 D2 E6 B3 6E D9 16 78
|
||||
0120 | 55 CF 13 4E 43 2A 16 4C A0 00 36 2A 07 7D BD 16
|
||||
0130 | 46 F3 BA 4E 47 E5 17 64 F9 AE F0 D0 D4 F8 9E EE
|
||||
0140 | 2C 2C C3 6B 1E 08 5E 81 33 28 9D E5 10 AC 26 96
|
||||
0150 | 74 53 30 FC 4F D4 91 03 99 5C C2 55 65 19 D5 CB
|
||||
0160 | 27 A9 24 EA FA E4 6E 6C 8C 7C B7 28 FA 99 56 95
|
||||
0170 | 41 F2 E2 E1 88 A1 86 73 EA F8 C3 E5 4C A0 DB 7C
|
||||
0180 | 48 4F 08 3F 9F 41 65 DD 9E C6 03 E3</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 64 2C 0E 00 29 9B 6C 65
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 B0 69 7A FD F7 E5 50 64
|
||||
0020 | 0E A2 6A DB 92 59 0D E2 FE AC 66 0A F9 82 4B 19
|
||||
0030 | 0F 2A B1 7D A0 85 CE 8B FE 50 01 00 EE 7E 78 B0
|
||||
0040 | 1E 5C 90 3C 68 FD 36 9A 20 E2 D3 1A 5C B0 CB 44
|
||||
0050 | 32 97 2A CE FC A6 C0 70 AB 87 65 5B 43 B7 56 48
|
||||
0060 | 34 D9 E2 BF BF 79 01 13 A2 0E 36 78 92 36 A2 64
|
||||
0070 | E2 9E 08 6B BC E6 7D 32 84 A0 BA CD 19 28 C0 88
|
||||
0080 | D0 10 91 C4 94 06 83 65 E2 27 33 C7 FC E0 94 33
|
||||
0090 | 2B FD 5B 62 10 30 80 8B 96 87 1B 57 12 2C 4C 33
|
||||
00A0 | 8B DB 5F 03 F7 EA 2B 3D 82 0A 55 E3 52 85 BC 0A
|
||||
00B0 | 86 13 5A EA 53 A4 9C F3 09 CF 4A DF 08 3A 64 FD
|
||||
00C0 | 0E 60 40 44 FD D2 E2 A1 DF 38 6C 5A 3B 12 DA 3B
|
||||
00D0 | CE B7 F2 6A A8 E4 9B 35 8D 1B C0 B2 46 F5 30 E5
|
||||
00E0 | BB 83 4D 24 B6 24 42 EC 25 77 90 F3 DB BB 18 56
|
||||
00F0 | F1 78 51 1A 0A 7B 8F 6D 53 15 99 F7 38 C6 84 D8
|
||||
0100 | AE C6 84 BF 9B E8 86 FC 5A A5 88 D1 C7 04 5F CF
|
||||
0110 | 54 2D 8A C8 50 C6 68 DF 94 8D 73 9C 42 5E 3F BC
|
||||
0120 | 23 82 E3 EE FD BA 4D 15 24 CB E5 79 34 FC 7D C6
|
||||
0130 | CD E2 B6 9A 58 1D 1A 6F 1C 4B A1 0F EB 3E 4D D8
|
||||
0140 | 21 1D AF 07 31 43 B8 A9 16 AA 04 3C 00 58 7B 9B
|
||||
0150 | 1A B7 58 43 D6 37 20 A9 6B A9 A6 E9 E0 64 80 F3
|
||||
0160 | A5 64 51 17 6C 4A C5 B4 B9 92 67 42 3A 93 90 7A
|
||||
0170 | 5E 0F 97 BF 08 0D 92 40 72 A3 03 D5 20 B3 37 90
|
||||
0180 | 4B 2D BA 47 51 7C D7 D2 EC FC E5 51</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>C844050078576A65</code></td>
|
||||
<td><code>642C0E00299B6C65</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>32E057DC820E1367DAC9FDEFB00DFAE3</code></td>
|
||||
<td><code>B0697AFDF7E550640EA26ADB92590DE2</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>876998EC69F2D28B691257F3D95284D8</code></td>
|
||||
<td><code>FEAC660AF9824B190F2AB17DA085CE8B</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>56, 340</td>
|
||||
<td><code>FE50010066B0AD9E25FC2135F701BE15</code> <code>BD718C2532491B2AE8C015AACAD46D72</code> <code>9A821DFAC4B6452FA1EC816CA2D703B1</code> <code>38B4D20C713EB126B98B5B12EE3ED962</code> <code>4C876965C9432395F529CE5D21D85254</code> <code>343D213ED6FE54AFECE50C08183BE192</code> <code>F40C7405571C29322F4F3BBE01D5D71D</code> <code>928D9D559A47C73C6B72C48345AF3F92</code> <code>176B4B63F8BE8E9836378BA2FD2739D2</code> <code>6A3ED48892A11A9E8FD02654B0CCB39C</code> <code>A9BB55F91DF7FF56CFCAFF11A592AEFA</code> <code>EC4D65D444F12BC2453DCF0AAFF7CCCF</code> <code>3FE9CDA1F6E372402DC37A397F2F0AEB</code> <code>75DE66B74DADBDBCD7969BF0AB870668</code> <code>A3D2E6B36ED9167855CF134E432A164C</code> <code>A000362A077DBD1646F3BA4E47E51764</code> <code>F9AEF0D0D4F89EEE2C2CC36B1E085E81</code> <code>33289DE510AC2696745330FC4FD49103</code> <code>995CC2556519D5CB27A924EAFAE46E6C</code> <code>8C7CB728FA99569541F2E2E188A18673</code> <code>EAF8C3E54CA0DB7C484F083F9F4165DD</code><br> <code>9EC603E3</code></td>
|
||||
<td><code>FE500100EE7E78B01E5C903C68FD369A</code> <code>20E2D31A5CB0CB4432972ACEFCA6C070</code> <code>AB87655B43B7564834D9E2BFBF790113</code> <code>A20E36789236A264E29E086BBCE67D32</code> <code>84A0BACD1928C088D01091C494068365</code> <code>E22733C7FCE094332BFD5B621030808B</code> <code>96871B57122C4C338BDB5F03F7EA2B3D</code> <code>820A55E35285BC0A86135AEA53A49CF3</code> <code>09CF4ADF083A64FD0E604044FDD2E2A1</code> <code>DF386C5A3B12DA3BCEB7F26AA8E49B35</code> <code>8D1BC0B246F530E5BB834D24B62442EC</code> <code>257790F3DBBB1856F178511A0A7B8F6D</code> <code>531599F738C684D8AEC684BF9BE886FC</code> <code>5AA588D1C7045FCF542D8AC850C668DF</code> <code>948D739C425E3FBC2382E3EEFDBA4D15</code> <code>24CBE57934FC7DC6CDE2B69A581D1A6F</code> <code>1C4BA10FEB3E4DD8211DAF073143B8A9</code> <code>16AA043C00587B9B1AB75843D63720A9</code> <code>6BA9A6E9E06480F3A56451176C4AC5B4</code> <code>B99267423A93907A5E0F97BF080D9240</code> <code>72A303D520B337904B2DBA47517CD7D2</code><br> <code>ECFCE551</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 = A0983834503C26760938BC9F8089449624E25079568DF30B8E2DEB29275D6A37AC7A9C649B233DC4BFF38D6F26D38E458C836BA1617AF6DB987808714336AFCFB35E2E4ADC0002E087EC8BB873B0B834EDAF1734505BC30C17BE65839B7478533BE5275F752DD4025B229B5717E344578F207D6D8E14C0DE3444A1EC54200513A2E9C2343DBFC27972B9E4E54FCBA0EFE8EE76FD4E40628B984DFB7F5C11C7336E5B1830E40575C4CDB8B30B37A6ED28EF64CFF2987DE7EB6260C9393503CE3639E54EF3B1F69C2517B26F33879D98680878D398342DF0E696795E886F5139A3C096C7AB3DA69B0655829C0C72EE94AB5519A56C85DA4258B430025E734AC1AE</code></pre>
|
||||
<pre><code>auth_key = 4376473535A11FC78F947EA41F4CA6B3851B063824F7E6DA8D6E3643887D2865AAD3A0448CF0641170409ACE280B325AC0CF3802CA8E73F64675D59C90B750ADF2013A273D7AE5BD1D06BF9B59FA7FA62E9C3980E3A21E33B52FDA1CB10549CF6DB2945F7F295CD4EE605F81F7F9CCF819455B331DC860C5158733E4A6B3EF21EC93E4E7E3D7410EAAC498BDD40400FAE56941E59B514DF52B1201FA9489AFB7AC7FE222C71159E3BEAC0526E4207B80F0B37F2906B9C9BD6EBDF8959368758C26431EE83CAE372CA6BC8D3F0DFB349C72433A0A16E8ADF4161F362EF31F66E0A5FDF69A0547D8E5198BA128206E7A93EA4FAFCBA0A48C68279A0CA89536B2EA</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 1C 51 2F 79 57 6A 65
|
||||
0010 | 6C 00 00 00 34 F7 CB 3B 32 E0 57 DC 82 0E 13 67
|
||||
0020 | DA C9 FD EF B0 0D FA E3 87 69 98 EC 69 F2 D2 8B
|
||||
0030 | 69 12 57 F3 D9 52 84 D8 39 05 5F 23 70 02 4E 46
|
||||
0040 | 87 B3 CC A3 BD 03 31 D4</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 B0 E6 10 2A 9B 6C 65
|
||||
0010 | 74 00 00 00 34 F7 CB 3B B0 69 7A FD F7 E5 50 64
|
||||
0020 | 0E A2 6A DB 92 59 0D E2 FE AC 66 0A F9 82 4B 19
|
||||
0030 | 0F 2A B1 7D A0 85 CE 8B E8 E4 7E DE 0C 39 66 FA
|
||||
0040 | 4F 82 5E D6 F5 4B 76 C5</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>011C512F79576A65</code></td>
|
||||
<td><code>01B0E6102A9B6C65</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>6C000000</code> (108 in decimal)</td>
|
||||
<td><code>74000000</code> (116 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>32E057DC820E1367DAC9FDEFB00DFAE3</code></td>
|
||||
<td><code>B0697AFDF7E550640EA26ADB92590DE2</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>876998EC69F2D28B691257F3D95284D8</code></td>
|
||||
<td><code>FEAC660AF9824B190F2AB17DA085CE8B</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce_hash1</td>
|
||||
<td>56, 16</td>
|
||||
<td><code>39055F2370024E4687B3CCA3BD0331D4</code></td>
|
||||
<td><code>E8E47EDE0C3966FA4F825ED6F54B76C5</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