mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2025-01-11 12:41:37 +01:00
Update content of files
This commit is contained in:
parent
9401bc16c2
commit
ee26355209
5 changed files with 217 additions and 217 deletions
|
@ -49,7 +49,7 @@ An error is characterized by several parameters:</p>
|
|||
<h4><a class="anchor" href="#error-type" id="error-type" name="error-type"><i class="anchor-icon"></i></a>Error Type</h4>
|
||||
<p>A string literal in the form of <code>/[A-Z_0-9]+/</code>, which summarizes the problem. For example, <code>AUTH_KEY_UNREGISTERED</code>. This is an optional parameter.</p>
|
||||
<h4><a class="anchor" href="#error-database" id="error-database" name="error-database"><i class="anchor-icon"></i></a>Error Database</h4>
|
||||
<p>A full human-readable JSON list of RPC errors that can be returned by all methods in the API can be found <a href="/file/400780400741/4/8hsnYXGWGeI.133746.json/837006fc367dabeebe">here »</a>, what follows is a description of its fields: </p>
|
||||
<p>A full human-readable JSON list of RPC errors that can be returned by all methods in the API can be found <a href="/file/400780400140/4/W2B7HlBhs4A.133720.json/2a040b3350d928b33c">here »</a>, what follows is a description of its fields: </p>
|
||||
<ul>
|
||||
<li><code>errors</code> - All error messages and codes for each method (object).<ul>
|
||||
<li>Keys: Error codes as strings (numeric strings)</li>
|
||||
|
|
|
@ -211,37 +211,37 @@
|
|||
<tr>
|
||||
<td><strong>access_hash</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.0?<a href="/type/long">long</a></td>
|
||||
<td>Access hash of the user, see <a href="/api/peers#access-hash">here »</a> for more info. <br>If this flag is set, when updating the <a href="/api/peers">local peer database</a>, generate a virtual flag called <code>min_access_hash</code>, which is: <br>- Set to <code>true</code> if <code>min</code> is set AND <br>- The <code>phone</code> flag is <strong>not</strong> set OR <br>- The <code>phone</code> flag is set and the associated phone number string is non-empty <br>- Set to <code>false</code> otherwise. <br><br>Then, apply both <code>access_hash</code> and <code>min_access_hash</code> to the local database if: <br>- <code>min_access_hash</code> is false OR <br>- <code>min_access_hash</code> is true AND <br>- There is no locally cached object for this user OR <br>- There is no <code>access_hash</code> in the local cache OR <br>- The cached object's <code>min_access_hash</code> is also true <br>If the final merged object stored to the database has the <code>min_access_hash</code> field set to true, the related <code>access_hash</code> is <strong>only</strong> suitable to use in <a href="/constructor/inputPeerPhotoFileLocation"><code>inputPeerPhotoFileLocation</code> »</a>, to directly <a href="/api/files">download the profile pictures</a> of users, everywhere else a <code>inputPeer*FromMessage</code> constructor will have to be generated as specified <a href="/api/min">here »</a>. <br>Bots can also use min access hashes in some conditions, by passing <code>0</code> instead of the min access hash.</td>
|
||||
<td>Access hash of the user, see <a href="/api/peers#access-hash">here »</a> for more info. <br>If this flag is set, when updating the <a href="/api/peers">local peer database</a>, generate a virtual flag called <code>min_access_hash</code>, which is: <br>- Set to <code>true</code> if <code>min</code> is set AND <br>-- The <code>phone</code> flag is <strong>not</strong> set OR <br>-- The <code>phone</code> flag is set and the associated phone number string is non-empty <br>- Set to <code>false</code> otherwise. <br><br>Then, apply both <code>access_hash</code> and <code>min_access_hash</code> to the local database if: <br>- <code>min_access_hash</code> is false OR <br>- <code>min_access_hash</code> is true AND <br>-- There is no locally cached object for this user OR <br>-- There is no <code>access_hash</code> in the local cache OR <br>-- The cached object's <code>min_access_hash</code> is also true <br><br>If the final merged object stored to the database has the <code>min_access_hash</code> field set to true, the related <code>access_hash</code> is <strong>only</strong> suitable to use in <a href="/constructor/inputPeerPhotoFileLocation"><code>inputPeerPhotoFileLocation</code> »</a>, to directly <a href="/api/files">download the profile pictures</a> of users, everywhere else a <code>inputPeer*FromMessage</code> constructor will have to be generated as specified <a href="/api/min">here »</a>. <br>Bots can also use min access hashes in some conditions, by passing <code>0</code> instead of the min access hash.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>first_name</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.1?<a href="/type/string">string</a></td>
|
||||
<td>First name. <br>When updating the <a href="/api/peers">local peer database</a>, apply changes to this field only if: <br>- The <code>min</code> flag is not set OR <br>- The <code>min</code> flag is set AND <br>- The <code>min</code> flag of the locally cached user entry is set.</td>
|
||||
<td>First name. <br>When updating the <a href="/api/peers">local peer database</a>, apply changes to this field only if: <br>- The <code>min</code> flag is not set OR <br>- The <code>min</code> flag is set AND <br>-- The <code>min</code> flag of the locally cached user entry is set.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>last_name</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.2?<a href="/type/string">string</a></td>
|
||||
<td>Last name. <br>When updating the <a href="/api/peers">local peer database</a>, apply changes to this field only if: <br>- The <code>min</code> flag is not set OR <br>- The <code>min</code> flag is set AND <br>- The <code>min</code> flag of the locally cached user entry is set.</td>
|
||||
<td>Last name. <br>When updating the <a href="/api/peers">local peer database</a>, apply changes to this field only if: <br>- The <code>min</code> flag is not set OR <br>- The <code>min</code> flag is set AND <br>-- The <code>min</code> flag of the locally cached user entry is set.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>username</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.3?<a href="/type/string">string</a></td>
|
||||
<td>Main active username. <br>When updating the <a href="/api/peers">local peer database</a>, apply changes to this field only if: <br>- The <code>min</code> flag is not set OR <br>- The <code>min</code> flag is set AND <br>- The <code>min</code> flag of the locally cached user entry is set. <br>Changes to this flag should invalidate the local <a href="/constructor/userFull">userFull</a> cache for this user ID if the above conditions are respected and the <code>bot_can_edit</code> flag is also set.</td>
|
||||
<td>Main active username. <br>When updating the <a href="/api/peers">local peer database</a>, apply changes to this field only if: <br>- The <code>min</code> flag is not set OR <br>- The <code>min</code> flag is set AND <br>-- The <code>min</code> flag of the locally cached user entry is set. <br>Changes to this flag should invalidate the local <a href="/constructor/userFull">userFull</a> cache for this user ID if the above conditions are respected and the <code>bot_can_edit</code> flag is also set.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>phone</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.4?<a href="/type/string">string</a></td>
|
||||
<td>Phone number. <br>When updating the <a href="/api/peers">local peer database</a>, apply changes to this field only if: <br>- The <code>min</code> flag is not set OR <br>- The <code>min</code> flag is set AND <br>- The <code>min</code> flag of the locally cached user entry is set.</td>
|
||||
<td>Phone number. <br>When updating the <a href="/api/peers">local peer database</a>, apply changes to this field only if: <br>- The <code>min</code> flag is not set OR <br>- The <code>min</code> flag is set AND <br>-- The <code>min</code> flag of the locally cached user entry is set.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>photo</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.5?<a href="/type/UserProfilePhoto">UserProfilePhoto</a></td>
|
||||
<td>Profile picture of user. <br>When updating the <a href="/api/peers">local peer database</a>, apply changes to this field only if: <br>- The <code>min</code> flag is not set OR <br>- The <code>min</code> flag is set AND <br>- The <code>apply_min_photo</code> flag is set OR <br>- The <code>min</code> flag of the locally cached user entry is set.</td>
|
||||
<td>Profile picture of user. <br>When updating the <a href="/api/peers">local peer database</a>, apply changes to this field only if: <br>- The <code>min</code> flag is not set OR <br>- The <code>min</code> flag is set AND <br>-- The <code>apply_min_photo</code> flag is set OR <br>-- The <code>min</code> flag of the locally cached user entry is set.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>status</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.6?<a href="/type/UserStatus">UserStatus</a></td>
|
||||
<td>Online status of user. <br>When updating the <a href="/api/peers">local peer database</a>, apply changes to this field only if: <br>- The <code>min</code> flag is not set OR <br>- The <code>min</code> flag is set AND <br>- The <code>min</code> flag of the locally cached user entry is set OR <br>- The locally cached user entry is equal to <a href="/constructor/userStatusEmpty">userStatusEmpty</a>.</td>
|
||||
<td>Online status of user. <br>When updating the <a href="/api/peers">local peer database</a>, apply changes to this field only if: <br>- The <code>min</code> flag is not set OR <br>- The <code>min</code> flag is set AND <br>-- The <code>min</code> flag of the locally cached user entry is set OR <br>-- The locally cached user entry is equal to <a href="/constructor/userStatusEmpty">userStatusEmpty</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>bot_info_version</strong></td>
|
||||
|
@ -271,7 +271,7 @@
|
|||
<tr>
|
||||
<td><strong>usernames</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags2</a>.0?<a href="/type/Vector%20t">Vector</a><<a href="/type/Username">Username</a>></td>
|
||||
<td>Additional usernames. <br>When updating the <a href="/api/peers">local peer database</a>, apply changes to this field only if: <br>- The <code>min</code> flag is not set OR <br>- The <code>min</code> flag is set AND <br>- The <code>min</code> flag of the locally cached user entry is set. <br>Changes to this flag (if the above conditions are respected) should invalidate the local <a href="/constructor/userFull">userFull</a> cache for this user ID.</td>
|
||||
<td>Additional usernames. <br>When updating the <a href="/api/peers">local peer database</a>, apply changes to this field only if: <br>- The <code>min</code> flag is not set OR <br>- The <code>min</code> flag is set AND <br>-- The <code>min</code> flag of the locally cached user entry is set. <br>Changes to this flag (if the above conditions are respected) should invalidate the local <a href="/constructor/userFull">userFull</a> cache for this user ID.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>stories_max_id</strong></td>
|
||||
|
|
|
@ -156,7 +156,7 @@
|
|||
<tr>
|
||||
<td>406</td>
|
||||
<td>UPDATE_APP_TO_LOGIN</td>
|
||||
<td>Please update to the latest version of MadelineProto to login.</td>
|
||||
<td>Please update your client to login.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
|
|
|
@ -146,7 +146,7 @@
|
|||
<tr>
|
||||
<td>406</td>
|
||||
<td>UPDATE_APP_TO_LOGIN</td>
|
||||
<td>Please update to the latest version of MadelineProto to login.</td>
|
||||
<td>Please update your client to login.</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 2C A3 0D 00 0D 0D C3 66
|
||||
0010 | 14 00 00 00 F1 8E 7E BE AC 7E C6 49 66 2E CF 3C
|
||||
0020 | F3 BA 99 1B 9D 8D AB D5</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 68 BD 06 00 F4 2D F8 66
|
||||
0010 | 14 00 00 00 F1 8E 7E BE F4 8D 0E 7A 11 34 9A 03
|
||||
0020 | 3A AC A4 9E 64 75 1C C2</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>2CA30D000D0DC366</code></td>
|
||||
<td><code>68BD0600F42DF866</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>AC7EC649662ECF3CF3BA991B9D8DABD5</code></td>
|
||||
<td><code>F48D0E7A11349A033AACA49E64751CC2</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 74 FF E0 0D 0D C3 66
|
||||
0010 | 90 00 00 00 63 24 16 05 AC 7E C6 49 66 2E CF 3C
|
||||
0020 | F3 BA 99 1B 9D 8D AB D5 6C 8D 9C F5 77 54 AE 5A
|
||||
0030 | 5C B3 05 75 9A 60 50 D0 08 1B E3 63 A4 6F 8E DF
|
||||
0040 | C1 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 5C CB 4E F4 2D F8 66
|
||||
0010 | 60 00 00 00 63 24 16 05 F4 8D 0E 7A 11 34 9A 03
|
||||
0020 | 3A AC A4 9E 64 75 1C C2 20 14 FE 46 29 11 BC 79
|
||||
0030 | D0 88 9C 60 4D E6 07 04 08 18 C6 49 E3 8F 59 10
|
||||
0040 | DD 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>0174FFE00D0DC366</code></td>
|
||||
<td><code>015CCB4EF42DF866</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>60000000</code> (96 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -150,19 +150,19 @@
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>AC7EC649662ECF3CF3BA991B9D8DABD5</code></td>
|
||||
<td><code>F48D0E7A11349A033AACA49E64751CC2</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>6C8D9CF57754AE5A5CB305759A6050D0</code></td>
|
||||
<td><code>2014FE462911BC79D0889C604DE60704</code></td>
|
||||
<td>Server-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pq</td>
|
||||
<td>56, 12</td>
|
||||
<td><code>081BE363A46F8EDFC1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2009559416634793921</td>
|
||||
<td><code>0818C649E38F5910DD000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1785195544010363101</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 = 2009559416634793921</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2009559416634793921 = 1090123583 * 1843423487</code></p>
|
||||
<pre><code>p = 1090123583
|
||||
q = 1843423487</code></pre>
|
||||
<pre><code>pq = 1785195544010363101</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1785195544010363101 = 1206075373 * 1480169137</code></p>
|
||||
<pre><code>p = 1206075373
|
||||
q = 1480169137</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 1B E3 63 A4 6F 8E DF C1 00 00 00
|
||||
0010 | 04 40 F9 F7 3F 00 00 00 04 6D E0 68 FF 00 00 00
|
||||
0020 | AC 7E C6 49 66 2E CF 3C F3 BA 99 1B 9D 8D AB D5
|
||||
0030 | 6C 8D 9C F5 77 54 AE 5A 5C B3 05 75 9A 60 50 D0
|
||||
0040 | DB 3F 7E 5E 2E E1 CF 4C 86 05 74 57 84 5C 5C 5B
|
||||
0050 | 4F 2A 99 51 F0 38 E4 31 B2 94 33 4E 12 C6 C4 19
|
||||
<pre><code>0000 | 95 5F F5 A9 08 18 C6 49 E3 8F 59 10 DD 00 00 00
|
||||
0010 | 04 47 E3 3F ED 00 00 00 04 58 39 96 B1 00 00 00
|
||||
0020 | F4 8D 0E 7A 11 34 9A 03 3A AC A4 9E 64 75 1C C2
|
||||
0030 | 20 14 FE 46 29 11 BC 79 D0 88 9C 60 4D E6 07 04
|
||||
0040 | D7 4C 18 34 B3 6B 2D 77 10 DD 5D F5 2A 33 31 4A
|
||||
0050 | AC C9 6F 4B A5 C4 D7 89 27 15 3E D6 E0 BD E3 DA
|
||||
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 = 1843423487</code></pre>
|
|||
<tr>
|
||||
<td>pq</td>
|
||||
<td>4, 12</td>
|
||||
<td><code>081BE363A46F8EDFC1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2009559416634793921</td>
|
||||
<td><code>0818C649E38F5910DD000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1785195544010363101</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>0440F9F73F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1090123583</td>
|
||||
<td><code>0447E33FED000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1206075373</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>046DE068FF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1843423487</td>
|
||||
<td><code>04583996B1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1480169137</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>AC7EC649662ECF3CF3BA991B9D8DABD5</code></td>
|
||||
<td><code>F48D0E7A11349A033AACA49E64751CC2</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>48, 16</td>
|
||||
<td><code>6C8D9CF57754AE5A5CB305759A6050D0</code></td>
|
||||
<td><code>2014FE462911BC79D0889C604DE60704</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce</td>
|
||||
<td>64, 32</td>
|
||||
<td><code>DB3F7E5E2EE1CF4C86057457845C5C5B</code> <code>4F2A9951F038E431B294334E12C6C419</code></td>
|
||||
<td><code>D74C1834B36B2D7710DD5DF52A33314A</code> <code>ACC96F4BA5C4D78927153ED6E0BDE3DA</code></td>
|
||||
<td>Client-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -291,39 +291,39 @@ q = 1843423487</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 = 955FF5A9081BE363A46F8EDFC10000000440F9F73F000000046DE068FF000000AC7EC649662ECF3CF3BA991B9D8DABD56C8D9CF57754AE5A5CB305759A6050D0DB3F7E5E2EE1CF4C86057457845C5C5B4F2A9951F038E431B294334E12C6C41902000000
|
||||
random_padding_bytes = 82EF77A67CA950176B3C8A6AED8C49B22B5B8338E93D9A8077219C1F643736C7ADE8802882B4E6667914AA15469B2AAC5111CA5F9D52D0C5949AAB0B8F9D894DCDA3ECD755440EBBC1A5FD15EB5486870DA7BA006C53D35B1C76B0B4</code></pre>
|
||||
<pre><code>data = 955FF5A90818C649E38F5910DD0000000447E33FED00000004583996B1000000F48D0E7A11349A033AACA49E64751CC22014FE462911BC79D0889C604DE60704D74C1834B36B2D7710DD5DF52A33314AACC96F4BA5C4D78927153ED6E0BDE3DA02000000
|
||||
random_padding_bytes = 5BC70897BDB41A498022A604772329410D0501E0C612EB5789D5F27A60B1F08F735E8AA83F8D5C0F6D6DA5A73825E9A1C0F9BFAE46E8EC6E2C1286EDF997DC07C4550CC6A6D78B74645AA434DE4894D3B0C58759D58DDC2116DCB3A7</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 = C71092A1879498AD33CCAF6BF2F48145F0F624E20B99A8439CFC4D59974ED6299399FE92C80D06DF951CDA757AAB3014EC0B33B7D9B1F9AB6BFF3CFB7284552A27BBC42FBCE1D5D22BB05E9D90F04691F50C990BF4F315D204F1208FCC938C59F04B7F8E612DAA6F65BD768A085D4263F024496447833F731DB4C9960BE5263F98F448C32F8943258C687DC7CD6C3581FD371B2114654F3A5CD92BC032E8C6B644D859D5615712BA528CF8EC73E1B0887E204CA81847304A2FB3C4AAAA8A45C364D6CC6FE070913B7B19C2045BE3426D2CFEC5533A0CA28D5B47D69752D68F740CB1BC9C23CD1559C2054BAF7EB8622C39348A2B95A7D79FD4F8A3901B1501C5</code></pre>
|
||||
<pre><code>encrypted_data = 3EFA30A4F9CE1A69CEC2A3DB7F2663C27F9B3ACD8D6F41DFA6149A16029B18066D7D84EB89258A610821649E4A5411A42BD402BB5CD50AEDA54152C7C8563E041A1DFE8DC519AAE48EC88EAA5CBA62757C0D6542E72C1A5152FA4F36E585DA97142D190F891C9016CC7437A6A265AB7D70D24A3F4B3C2CDF5D0A76F2A50C55A0A09D5BD03F0FD679A08C43DC0CEA3E64590D205F552A353B940E4303D393A00624ABF12B7B0C1ABD65144AA0E3B22863429D4B85BC24B74C9405B22F15D3445208E31A05A0248A8962CADCB4A6FD0912E48581CD33F44934733FA3B1B5EB78F96E6157A5A29994629AD4C54B38049F329B680FB7CF78CF8AE5BE89A470FC11AD</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 94 C9 0E 00 0E 0D C3 66
|
||||
0010 | 40 01 00 00 BE E4 12 D7 AC 7E C6 49 66 2E CF 3C
|
||||
0020 | F3 BA 99 1B 9D 8D AB D5 6C 8D 9C F5 77 54 AE 5A
|
||||
0030 | 5C B3 05 75 9A 60 50 D0 04 40 F9 F7 3F 00 00 00
|
||||
0040 | 04 6D E0 68 FF 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 C7 10 92 A1 87 94 98 AD 33 CC AF 6B
|
||||
0060 | F2 F4 81 45 F0 F6 24 E2 0B 99 A8 43 9C FC 4D 59
|
||||
0070 | 97 4E D6 29 93 99 FE 92 C8 0D 06 DF 95 1C DA 75
|
||||
0080 | 7A AB 30 14 EC 0B 33 B7 D9 B1 F9 AB 6B FF 3C FB
|
||||
0090 | 72 84 55 2A 27 BB C4 2F BC E1 D5 D2 2B B0 5E 9D
|
||||
00A0 | 90 F0 46 91 F5 0C 99 0B F4 F3 15 D2 04 F1 20 8F
|
||||
00B0 | CC 93 8C 59 F0 4B 7F 8E 61 2D AA 6F 65 BD 76 8A
|
||||
00C0 | 08 5D 42 63 F0 24 49 64 47 83 3F 73 1D B4 C9 96
|
||||
00D0 | 0B E5 26 3F 98 F4 48 C3 2F 89 43 25 8C 68 7D C7
|
||||
00E0 | CD 6C 35 81 FD 37 1B 21 14 65 4F 3A 5C D9 2B C0
|
||||
00F0 | 32 E8 C6 B6 44 D8 59 D5 61 57 12 BA 52 8C F8 EC
|
||||
0100 | 73 E1 B0 88 7E 20 4C A8 18 47 30 4A 2F B3 C4 AA
|
||||
0110 | AA 8A 45 C3 64 D6 CC 6F E0 70 91 3B 7B 19 C2 04
|
||||
0120 | 5B E3 42 6D 2C FE C5 53 3A 0C A2 8D 5B 47 D6 97
|
||||
0130 | 52 D6 8F 74 0C B1 BC 9C 23 CD 15 59 C2 05 4B AF
|
||||
0140 | 7E B8 62 2C 39 34 8A 2B 95 A7 D7 9F D4 F8 A3 90
|
||||
0150 | 1B 15 01 C5</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 6C BD 06 00 F4 2D F8 66
|
||||
0010 | 40 01 00 00 BE E4 12 D7 F4 8D 0E 7A 11 34 9A 03
|
||||
0020 | 3A AC A4 9E 64 75 1C C2 20 14 FE 46 29 11 BC 79
|
||||
0030 | D0 88 9C 60 4D E6 07 04 04 47 E3 3F ED 00 00 00
|
||||
0040 | 04 58 39 96 B1 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 3E FA 30 A4 F9 CE 1A 69 CE C2 A3 DB
|
||||
0060 | 7F 26 63 C2 7F 9B 3A CD 8D 6F 41 DF A6 14 9A 16
|
||||
0070 | 02 9B 18 06 6D 7D 84 EB 89 25 8A 61 08 21 64 9E
|
||||
0080 | 4A 54 11 A4 2B D4 02 BB 5C D5 0A ED A5 41 52 C7
|
||||
0090 | C8 56 3E 04 1A 1D FE 8D C5 19 AA E4 8E C8 8E AA
|
||||
00A0 | 5C BA 62 75 7C 0D 65 42 E7 2C 1A 51 52 FA 4F 36
|
||||
00B0 | E5 85 DA 97 14 2D 19 0F 89 1C 90 16 CC 74 37 A6
|
||||
00C0 | A2 65 AB 7D 70 D2 4A 3F 4B 3C 2C DF 5D 0A 76 F2
|
||||
00D0 | A5 0C 55 A0 A0 9D 5B D0 3F 0F D6 79 A0 8C 43 DC
|
||||
00E0 | 0C EA 3E 64 59 0D 20 5F 55 2A 35 3B 94 0E 43 03
|
||||
00F0 | D3 93 A0 06 24 AB F1 2B 7B 0C 1A BD 65 14 4A A0
|
||||
0100 | E3 B2 28 63 42 9D 4B 85 BC 24 B7 4C 94 05 B2 2F
|
||||
0110 | 15 D3 44 52 08 E3 1A 05 A0 24 8A 89 62 CA DC B4
|
||||
0120 | A6 FD 09 12 E4 85 81 CD 33 F4 49 34 73 3F A3 B1
|
||||
0130 | B5 EB 78 F9 6E 61 57 A5 A2 99 94 62 9A D4 C5 4B
|
||||
0140 | 38 04 9F 32 9B 68 0F B7 CF 78 CF 8A E5 BE 89 A4
|
||||
0150 | 70 FC 11 AD</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 = 82EF77A67CA950176B3C8A6AED8C49B22B5B8338E93D9A8077219C1F6
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>94C90E000E0DC366</code></td>
|
||||
<td><code>6CBD0600F42DF866</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 = 82EF77A67CA950176B3C8A6AED8C49B22B5B8338E93D9A8077219C1F6
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>AC7EC649662ECF3CF3BA991B9D8DABD5</code></td>
|
||||
<td><code>F48D0E7A11349A033AACA49E64751CC2</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>6C8D9CF57754AE5A5CB305759A6050D0</code></td>
|
||||
<td><code>2014FE462911BC79D0889C604DE60704</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p</td>
|
||||
<td>56, 8</td>
|
||||
<td><code>0440F9F73F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1090123583</td>
|
||||
<td><code>0447E33FED000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1206075373</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>046DE068FF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1843423487</td>
|
||||
<td><code>04583996B1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1480169137</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 = 82EF77A67CA950176B3C8A6AED8C49B22B5B8338E93D9A8077219C1F6
|
|||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>80, 260</td>
|
||||
<td><code>FE000100C71092A1879498AD33CCAF6B</code> <code>F2F48145F0F624E20B99A8439CFC4D59</code> <code>974ED6299399FE92C80D06DF951CDA75</code> <code>7AAB3014EC0B33B7D9B1F9AB6BFF3CFB</code> <code>7284552A27BBC42FBCE1D5D22BB05E9D</code> <code>90F04691F50C990BF4F315D204F1208F</code> <code>CC938C59F04B7F8E612DAA6F65BD768A</code> <code>085D4263F024496447833F731DB4C996</code> <code>0BE5263F98F448C32F8943258C687DC7</code> <code>CD6C3581FD371B2114654F3A5CD92BC0</code> <code>32E8C6B644D859D5615712BA528CF8EC</code> <code>73E1B0887E204CA81847304A2FB3C4AA</code> <code>AA8A45C364D6CC6FE070913B7B19C204</code> <code>5BE3426D2CFEC5533A0CA28D5B47D697</code> <code>52D68F740CB1BC9C23CD1559C2054BAF</code> <code>7EB8622C39348A2B95A7D79FD4F8A390</code><br> <code>1B1501C5</code></td>
|
||||
<td><code>FE0001003EFA30A4F9CE1A69CEC2A3DB</code> <code>7F2663C27F9B3ACD8D6F41DFA6149A16</code> <code>029B18066D7D84EB89258A610821649E</code> <code>4A5411A42BD402BB5CD50AEDA54152C7</code> <code>C8563E041A1DFE8DC519AAE48EC88EAA</code> <code>5CBA62757C0D6542E72C1A5152FA4F36</code> <code>E585DA97142D190F891C9016CC7437A6</code> <code>A265AB7D70D24A3F4B3C2CDF5D0A76F2</code> <code>A50C55A0A09D5BD03F0FD679A08C43DC</code> <code>0CEA3E64590D205F552A353B940E4303</code> <code>D393A00624ABF12B7B0C1ABD65144AA0</code> <code>E3B22863429D4B85BC24B74C9405B22F</code> <code>15D3445208E31A05A0248A8962CADCB4</code> <code>A6FD0912E48581CD33F44934733FA3B1</code> <code>B5EB78F96E6157A5A29994629AD4C54B</code> <code>38049F329B680FB7CF78CF8AE5BE89A4</code><br> <code>70FC11AD</code></td>
|
||||
<td>Value generated above</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -402,47 +402,47 @@ random_padding_bytes = 82EF77A67CA950176B3C8A6AED8C49B22B5B8338E93D9A8077219C1F6
|
|||
<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 3C 42 AF 0E 0D C3 66
|
||||
0010 | F0 02 00 00 5C 07 E8 D0 AC 7E C6 49 66 2E CF 3C
|
||||
0020 | F3 BA 99 1B 9D 8D AB D5 6C 8D 9C F5 77 54 AE 5A
|
||||
0030 | 5C B3 05 75 9A 60 50 D0 FE 50 02 00 28 D0 E4 6D
|
||||
0040 | 08 A4 80 08 9A 50 37 02 51 A2 2F 16 07 0A 5D 0F
|
||||
0050 | C7 51 4D BB 6D F2 BE 81 A6 48 9E 9B 53 66 A1 DD
|
||||
0060 | 30 C4 DD 51 E9 98 54 E0 FA 9A A1 A2 3F 97 F4 A2
|
||||
0070 | E6 80 59 DF 84 AE C5 5C 3F 81 06 55 51 F3 A0 66
|
||||
0080 | B1 17 8F 4C F2 82 C6 34 A6 07 87 3F 42 10 87 C0
|
||||
0090 | 73 99 FE EC 09 07 36 B9 7C 5D 2E FD 71 DB 7D C0
|
||||
00A0 | B7 2B F3 B6 36 C6 D6 3E 20 FE DE 5D 86 5A 71 8E
|
||||
00B0 | 85 84 DE 49 9E 8C 94 54 38 03 B4 40 30 54 C8 FE
|
||||
00C0 | DE C8 1C AF F5 C7 56 6B 65 6B 4D 85 EF 92 7A 7C
|
||||
00D0 | 06 A3 CF ED 2E 45 19 A6 22 EE 63 D5 FE 5D 51 1F
|
||||
00E0 | 3A 01 9B 63 FC 11 F9 5B BC E7 FD E9 B0 58 C9 A7
|
||||
00F0 | 12 02 09 C8 0C 57 38 08 43 59 8B 62 3B 94 FC D7
|
||||
0100 | 16 96 04 7F 2A E1 07 69 0E 2F CD 61 EB 05 DA 5A
|
||||
0110 | 6E 0F 13 FA 1E E1 4C 7B E1 E5 5D 47 D0 96 A7 87
|
||||
0120 | 6F 2E 27 A3 C3 62 44 A9 86 E6 17 D9 1A 36 44 D7
|
||||
0130 | DE 98 96 8B FD 09 A4 2C EB 3B 66 14 7A 0F C7 76
|
||||
0140 | 92 2A F1 2D A3 37 7C 8F 33 AA C5 CF C8 75 0C 2F
|
||||
0150 | 4C F9 89 48 09 EF E9 81 F2 88 63 64 FA 81 C7 59
|
||||
0160 | 0A 12 24 4D 00 66 B8 62 D4 2D 78 86 5D DE 8F 2C
|
||||
0170 | 8C 3E 1E ED FA ED 40 1A E2 36 23 D9 19 23 AA CC
|
||||
0180 | A0 71 EE 9D D6 E3 F8 F6 C4 25 A6 06 AF 0B FE F1
|
||||
0190 | 75 A5 17 B6 D4 F7 5C 56 BE 51 F6 DC 45 95 D7 45
|
||||
01A0 | 4D A1 B5 DA D0 5D 59 69 F8 3F E8 DA F2 1C E6 CD
|
||||
01B0 | 4A 57 95 12 CA FF 5F 58 D9 BC 9A 8E 45 92 95 D1
|
||||
01C0 | 35 45 DD 4A C9 B8 37 7B 7A EC 68 2C F3 D7 7E FB
|
||||
01D0 | D4 6B 46 5D 74 40 1F DA C1 7A 6A E4 C3 2F 1A 80
|
||||
01E0 | 53 23 DC 9B 87 DB 38 21 05 38 E1 5D B5 B9 DE DA
|
||||
01F0 | 6A 83 92 E0 1C 4C C4 02 27 16 36 FE BE 42 FE 7A
|
||||
0200 | 2C 81 35 C4 85 A1 A1 04 F4 9B 1F 48 4F B1 8A 80
|
||||
0210 | C8 C0 97 D3 D0 C2 0A 9B 4D 93 09 86 33 8E 2D F5
|
||||
0220 | 56 59 CD F5 0C DE 50 E4 5E 05 CA 09 A3 94 8B BE
|
||||
0230 | 2F 3D 68 E3 EA 5F 3B BF 3E 2E 9F F2 1B B4 5B 18
|
||||
0240 | AF B4 44 F6 75 41 6C 27 C5 5F 3F 52 DA 11 B6 10
|
||||
0250 | D6 C0 D7 07 90 1B 5A 39 3F 81 51 80 1A 3E 2E 38
|
||||
0260 | 75 37 DC 21 DA EF 83 D1 44 1C 47 48 86 60 C0 07
|
||||
0270 | 5F FE 01 D0 E2 0F 65 57 8F FB 6C F2 B3 98 25 38
|
||||
0280 | 4B 29 5F BD 83 9B 46 FA 64 16 C0 A4</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 74 4E FA F4 2D F8 66
|
||||
0010 | E0 02 00 00 5C 07 E8 D0 F4 8D 0E 7A 11 34 9A 03
|
||||
0020 | 3A AC A4 9E 64 75 1C C2 20 14 FE 46 29 11 BC 79
|
||||
0030 | D0 88 9C 60 4D E6 07 04 FE 50 02 00 81 39 3B E2
|
||||
0040 | 2F CB 6D 23 AF 78 17 21 EB C2 20 D4 8E 2A 32 6B
|
||||
0050 | 53 BC 21 F2 1B A4 55 FF 5E D5 E4 18 14 53 7C C6
|
||||
0060 | 28 8A E9 98 B3 C7 F4 6B 41 25 F6 84 8C 6E DF 21
|
||||
0070 | 8C 47 CC 8D 87 6D D0 9C 29 3B 23 68 43 C7 18 00
|
||||
0080 | 32 D0 12 95 91 B9 56 92 A5 97 FE EE 72 42 FC FB
|
||||
0090 | 20 AA 1C 83 54 31 3E 45 27 8E FF 98 19 07 58 CD
|
||||
00A0 | 83 E5 7B 9B B7 01 2E FF 06 6F 17 DE B5 96 63 E3
|
||||
00B0 | 98 6F 78 5B 7A 6D 3B FE B6 8F 13 79 38 82 35 A4
|
||||
00C0 | 3E 2F 86 18 D0 6E 08 BB DB 9D 11 0E 38 04 EC 5B
|
||||
00D0 | E0 62 E0 BD 56 02 DA 1E 52 D9 16 2D 57 E1 1F D6
|
||||
00E0 | AE E5 65 93 39 6B E1 0F 16 6C 54 10 C2 12 4E C2
|
||||
00F0 | F4 E8 B7 69 27 42 D5 4E BD DD D1 B0 B3 81 6E DA
|
||||
0100 | AF B8 42 C8 8A AC C8 29 CD A9 89 E3 CC 1F 4D AB
|
||||
0110 | 80 93 20 C1 43 9E 5A EE C2 8D A4 5B 20 BF 2A 48
|
||||
0120 | 40 C4 10 B5 61 EC 3E 2A 9C 97 3B C3 DC E4 C5 A3
|
||||
0130 | 0D BF 43 D7 2A 44 01 75 A5 93 4E 7D 20 19 76 79
|
||||
0140 | C3 96 BD 30 23 12 95 51 AE 20 8C 98 3E 6B 78 C8
|
||||
0150 | B4 BE 4D F5 48 87 54 C4 B0 3F AA E5 D3 FB 4E D3
|
||||
0160 | 6A BC 87 20 08 4F AF 57 1B 7A D5 B4 8B 55 BD C7
|
||||
0170 | 24 D0 F5 CD F6 CE 65 A6 EC D0 57 40 82 FB 01 6B
|
||||
0180 | FA 76 2F 46 65 73 28 2E E4 C7 85 99 65 82 68 7E
|
||||
0190 | 9A 04 C1 04 47 CB F0 F0 C4 5E C2 5C 14 45 48 EE
|
||||
01A0 | E3 0F 79 6B B8 B9 49 AA C6 05 34 9F 1D D2 5D 90
|
||||
01B0 | 33 7A 0E 8E F5 28 A0 9F 17 80 F3 BF DB AF DF 4B
|
||||
01C0 | A8 A0 6B 47 D7 46 20 21 1B 1F 6D B2 82 D1 EF 87
|
||||
01D0 | AA 0E F1 0E 2C AD E0 4B 5A 08 F5 79 D3 0B 01 B7
|
||||
01E0 | CC B8 A3 A3 6E 70 2D 22 0B 45 4A 18 62 43 60 90
|
||||
01F0 | 0D 02 77 A8 C3 F2 57 F7 48 1D E2 1B 35 0E B2 84
|
||||
0200 | F4 81 FB 36 8D C1 13 97 1A C8 55 C5 69 BC 54 A2
|
||||
0210 | A5 DE 60 B8 C3 BB 64 29 D3 25 A7 93 BD 47 A2 2D
|
||||
0220 | E5 39 07 1D 4A F7 31 F2 94 80 C9 B0 8B 6D 67 56
|
||||
0230 | F3 7C 93 AC FC D9 D0 CF 36 66 EA 9F 06 62 C1 A5
|
||||
0240 | BC 0D B7 5B 7B 28 9E 73 B6 7A FA 94 88 3D A8 E5
|
||||
0250 | 8F 65 42 AB A0 A9 C3 0A 95 C0 95 AE 3D 0B A7 3E
|
||||
0260 | 2C D2 D7 84 D0 A3 D1 09 95 BB F8 08 BD 8A 47 E8
|
||||
0270 | E5 8D 6C 9E FA 51 44 05 38 18 62 49 A5 6A 16 A9
|
||||
0280 | 60 A8 B4 02 A1 19 53 76 CA B8 0E 9A</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 = 82EF77A67CA950176B3C8A6AED8C49B22B5B8338E93D9A8077219C1F6
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>013C42AF0E0DC366</code></td>
|
||||
<td><code>01744EFAF42DF866</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>F0020000</code> (752 in decimal)</td>
|
||||
<td><code>E0020000</code> (736 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -482,19 +482,19 @@ random_padding_bytes = 82EF77A67CA950176B3C8A6AED8C49B22B5B8338E93D9A8077219C1F6
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>AC7EC649662ECF3CF3BA991B9D8DABD5</code></td>
|
||||
<td><code>F48D0E7A11349A033AACA49E64751CC2</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>6C8D9CF57754AE5A5CB305759A6050D0</code></td>
|
||||
<td><code>2014FE462911BC79D0889C604DE60704</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_answer</td>
|
||||
<td>56, 596</td>
|
||||
<td><code>FE50020028D0E46D08A480089A503702</code> <code>51A22F16070A5D0FC7514DBB6DF2BE81</code> <code>A6489E9B5366A1DD30C4DD51E99854E0</code> <code>FA9AA1A23F97F4A2E68059DF84AEC55C</code> <code>3F81065551F3A066B1178F4CF282C634</code> <code>A607873F421087C07399FEEC090736B9</code> <code>7C5D2EFD71DB7DC0B72BF3B636C6D63E</code> <code>20FEDE5D865A718E8584DE499E8C9454</code> <code>3803B4403054C8FEDEC81CAFF5C7566B</code> <code>656B4D85EF927A7C06A3CFED2E4519A6</code> <code>22EE63D5FE5D511F3A019B63FC11F95B</code> <code>BCE7FDE9B058C9A7120209C80C573808</code> <code>43598B623B94FCD71696047F2AE10769</code> <code>0E2FCD61EB05DA5A6E0F13FA1EE14C7B</code> <code>E1E55D47D096A7876F2E27A3C36244A9</code> <code>86E617D91A3644D7DE98968BFD09A42C</code> <code>EB3B66147A0FC776922AF12DA3377C8F</code> <code>33AAC5CFC8750C2F4CF9894809EFE981</code> <code>F2886364FA81C7590A12244D0066B862</code> <code>D42D78865DDE8F2C8C3E1EEDFAED401A</code> <code>E23623D91923AACCA071EE9DD6E3F8F6</code> <code>C425A606AF0BFEF175A517B6D4F75C56</code> <code>BE51F6DC4595D7454DA1B5DAD05D5969</code> <code>F83FE8DAF21CE6CD4A579512CAFF5F58</code> <code>D9BC9A8E459295D13545DD4AC9B8377B</code> <code>7AEC682CF3D77EFBD46B465D74401FDA</code> <code>C17A6AE4C32F1A805323DC9B87DB3821</code> <code>0538E15DB5B9DEDA6A8392E01C4CC402</code> <code>271636FEBE42FE7A2C8135C485A1A104</code> <code>F49B1F484FB18A80C8C097D3D0C20A9B</code> <code>4D930986338E2DF55659CDF50CDE50E4</code> <code>5E05CA09A3948BBE2F3D68E3EA5F3BBF</code> <code>3E2E9FF21BB45B18AFB444F675416C27</code> <code>C55F3F52DA11B610D6C0D707901B5A39</code> <code>3F8151801A3E2E387537DC21DAEF83D1</code> <code>441C47488660C0075FFE01D0E20F6557</code> <code>8FFB6CF2B39825384B295FBD839B46FA</code><br> <code>6416C0A4</code></td>
|
||||
<td><code>FE50020081393BE22FCB6D23AF781721</code> <code>EBC220D48E2A326B53BC21F21BA455FF</code> <code>5ED5E41814537CC6288AE998B3C7F46B</code> <code>4125F6848C6EDF218C47CC8D876DD09C</code> <code>293B236843C7180032D0129591B95692</code> <code>A597FEEE7242FCFB20AA1C8354313E45</code> <code>278EFF98190758CD83E57B9BB7012EFF</code> <code>066F17DEB59663E3986F785B7A6D3BFE</code> <code>B68F1379388235A43E2F8618D06E08BB</code> <code>DB9D110E3804EC5BE062E0BD5602DA1E</code> <code>52D9162D57E11FD6AEE56593396BE10F</code> <code>166C5410C2124EC2F4E8B7692742D54E</code> <code>BDDDD1B0B3816EDAAFB842C88AACC829</code> <code>CDA989E3CC1F4DAB809320C1439E5AEE</code> <code>C28DA45B20BF2A4840C410B561EC3E2A</code> <code>9C973BC3DCE4C5A30DBF43D72A440175</code> <code>A5934E7D20197679C396BD3023129551</code> <code>AE208C983E6B78C8B4BE4DF5488754C4</code> <code>B03FAAE5D3FB4ED36ABC8720084FAF57</code> <code>1B7AD5B48B55BDC724D0F5CDF6CE65A6</code> <code>ECD0574082FB016BFA762F466573282E</code> <code>E4C785996582687E9A04C10447CBF0F0</code> <code>C45EC25C144548EEE30F796BB8B949AA</code> <code>C605349F1DD25D90337A0E8EF528A09F</code> <code>1780F3BFDBAFDF4BA8A06B47D7462021</code> <code>1B1F6DB282D1EF87AA0EF10E2CADE04B</code> <code>5A08F579D30B01B7CCB8A3A36E702D22</code> <code>0B454A18624360900D0277A8C3F257F7</code> <code>481DE21B350EB284F481FB368DC11397</code> <code>1AC855C569BC54A2A5DE60B8C3BB6429</code> <code>D325A793BD47A22DE539071D4AF731F2</code> <code>9480C9B08B6D6756F37C93ACFCD9D0CF</code> <code>3666EA9F0662C1A5BC0DB75B7B289E73</code> <code>B67AFA94883DA8E58F6542ABA0A9C30A</code> <code>95C095AE3D0BA73E2CD2D784D0A3D109</code> <code>95BBF808BD8A47E8E58D6C9EFA514405</code> <code>38186249A56A16A960A8B402A1195376</code><br> <code>CAB80E9A</code></td>
|
||||
<td>See below</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -502,20 +502,20 @@ random_padding_bytes = 82EF77A67CA950176B3C8A6AED8C49B22B5B8338E93D9A8077219C1F6
|
|||
<!-- 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 = 28D0E46D08A480089A50370251A22F16070A5D0FC7514DBB6DF2BE81A6489E9B5366A1DD30C4DD51E99854E0FA9AA1A23F97F4A2E68059DF84AEC55C3F81065551F3A066B1178F4CF282C634A607873F421087C07399FEEC090736B97C5D2EFD71DB7DC0B72BF3B636C6D63E20FEDE5D865A718E8584DE499E8C94543803B4403054C8FEDEC81CAFF5C7566B656B4D85EF927A7C06A3CFED2E4519A622EE63D5FE5D511F3A019B63FC11F95BBCE7FDE9B058C9A7120209C80C57380843598B623B94FCD71696047F2AE107690E2FCD61EB05DA5A6E0F13FA1EE14C7BE1E55D47D096A7876F2E27A3C36244A986E617D91A3644D7DE98968BFD09A42CEB3B66147A0FC776922AF12DA3377C8F33AAC5CFC8750C2F4CF9894809EFE981F2886364FA81C7590A12244D0066B862D42D78865DDE8F2C8C3E1EEDFAED401AE23623D91923AACCA071EE9DD6E3F8F6C425A606AF0BFEF175A517B6D4F75C56BE51F6DC4595D7454DA1B5DAD05D5969F83FE8DAF21CE6CD4A579512CAFF5F58D9BC9A8E459295D13545DD4AC9B8377B7AEC682CF3D77EFBD46B465D74401FDAC17A6AE4C32F1A805323DC9B87DB38210538E15DB5B9DEDA6A8392E01C4CC402271636FEBE42FE7A2C8135C485A1A104F49B1F484FB18A80C8C097D3D0C20A9B4D930986338E2DF55659CDF50CDE50E45E05CA09A3948BBE2F3D68E3EA5F3BBF3E2E9FF21BB45B18AFB444F675416C27C55F3F52DA11B610D6C0D707901B5A393F8151801A3E2E387537DC21DAEF83D1441C47488660C0075FFE01D0E20F65578FFB6CF2B39825384B295FBD839B46FA6416C0A4
|
||||
tmp_aes_key = F9AC244019A3D256B2D0B2A57CCBCB837A05D4A70685F26C926FBAAED69F4148
|
||||
tmp_aes_iv = 1F5D43DF6BEE2B294A86F4F1DCE4E0A30C97CECB011C15F2E09241A4DB3F7E5E</code></pre>
|
||||
<pre><code>encrypted_answer = 81393BE22FCB6D23AF781721EBC220D48E2A326B53BC21F21BA455FF5ED5E41814537CC6288AE998B3C7F46B4125F6848C6EDF218C47CC8D876DD09C293B236843C7180032D0129591B95692A597FEEE7242FCFB20AA1C8354313E45278EFF98190758CD83E57B9BB7012EFF066F17DEB59663E3986F785B7A6D3BFEB68F1379388235A43E2F8618D06E08BBDB9D110E3804EC5BE062E0BD5602DA1E52D9162D57E11FD6AEE56593396BE10F166C5410C2124EC2F4E8B7692742D54EBDDDD1B0B3816EDAAFB842C88AACC829CDA989E3CC1F4DAB809320C1439E5AEEC28DA45B20BF2A4840C410B561EC3E2A9C973BC3DCE4C5A30DBF43D72A440175A5934E7D20197679C396BD3023129551AE208C983E6B78C8B4BE4DF5488754C4B03FAAE5D3FB4ED36ABC8720084FAF571B7AD5B48B55BDC724D0F5CDF6CE65A6ECD0574082FB016BFA762F466573282EE4C785996582687E9A04C10447CBF0F0C45EC25C144548EEE30F796BB8B949AAC605349F1DD25D90337A0E8EF528A09F1780F3BFDBAFDF4BA8A06B47D74620211B1F6DB282D1EF87AA0EF10E2CADE04B5A08F579D30B01B7CCB8A3A36E702D220B454A18624360900D0277A8C3F257F7481DE21B350EB284F481FB368DC113971AC855C569BC54A2A5DE60B8C3BB6429D325A793BD47A22DE539071D4AF731F29480C9B08B6D6756F37C93ACFCD9D0CF3666EA9F0662C1A5BC0DB75B7B289E73B67AFA94883DA8E58F6542ABA0A9C30A95C095AE3D0BA73E2CD2D784D0A3D10995BBF808BD8A47E8E58D6C9EFA51440538186249A56A16A960A8B402A1195376CAB80E9A
|
||||
tmp_aes_key = 2023941FFF5A2DB7A0C168FCFCFE5DE4DE7F5151A6C2262DB6E18B6D8C1A6BB4
|
||||
tmp_aes_iv = 56B9A097F20D603B13C624754C821F7547E209B3F02450F58511B25FD74C1834</code></pre>
|
||||
<!-- end server_DH_inner_data_input -->
|
||||
<p>Yielding:</p>
|
||||
<!-- start server_DH_inner_data_output -->
|
||||
<pre><code>answer_with_hash = 581A0BF9CCAD9F42310DD6E06AAB84510994EDCFBA0D89B5AC7EC649662ECF3CF3BA991B9D8DABD56C8D9CF57754AE5A5CB305759A6050D003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001007B42B299039FBDE3A58969368398697AC952271DC43A5438E7782BB65291F69483575A6ED2C3630E9175C7D423174305FF382CE1DED0895A9CEAFA2EE922D6ABF3096665988A10F86D458A967E1328154A8B6DEFA57C0443276AAAAFC9BF7EBEFDFD6B1A512B7A7DA6042C75AD9A1DA99C1B8DA5291E614F942FE51FD4FC134D8C8E4A2020215FD803455E0D1CF12A48B03E77FE29424D184D095B545539183AEAC1C5DA980ADA7EF3BC20493A00BBEAD819933981E9184BED92211B76C02B66DC1A54918634A1AEB3167178B846465FB172CD525C2AC7DEA4C7C342068EECED7240981B353F47601F45B52E83B7AD97D400CF5FD31F810808D8D857EB8924930E0DC36658A349CC05C7B750
|
||||
answer = BA0D89B5AC7EC649662ECF3CF3BA991B9D8DABD56C8D9CF57754AE5A5CB305759A6050D003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001007B42B299039FBDE3A58969368398697AC952271DC43A5438E7782BB65291F69483575A6ED2C3630E9175C7D423174305FF382CE1DED0895A9CEAFA2EE922D6ABF3096665988A10F86D458A967E1328154A8B6DEFA57C0443276AAAAFC9BF7EBEFDFD6B1A512B7A7DA6042C75AD9A1DA99C1B8DA5291E614F942FE51FD4FC134D8C8E4A2020215FD803455E0D1CF12A48B03E77FE29424D184D095B545539183AEAC1C5DA980ADA7EF3BC20493A00BBEAD819933981E9184BED92211B76C02B66DC1A54918634A1AEB3167178B846465FB172CD525C2AC7DEA4C7C342068EECED7240981B353F47601F45B52E83B7AD97D400CF5FD31F810808D8D857EB8924930E0DC36658A349CC05C7B750</code></pre>
|
||||
<pre><code>answer_with_hash = E4B8704066E1349B06FC19015AEB17E7DDBC6E8FBA0D89B5F48D0E7A11349A033AACA49E64751CC22014FE462911BC79D0889C604DE6070403000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100A52FE320823A15DE9456B7389ECA0A75183D5577A31C5F4CF39C6D465AD774BDA6692473EB6997A60C07469E24E34804707B873E5FC9F2F6ED2C76225B368E35B60E756C2E6EC2910C0B869B736FBAFA53D2B2B23A2F90FFF74D4E4EE4BBA0D98B326E1939F00EF1A07FA5B687893A269BF38DB887A64B7AF1B3EE1B1288AC058A7C92543291D43800045DBCFBCBE4A052B840AE7A6D38EFB7E6832F7E78FE3B824401D811015AE466E78FF7AA935E08888447D2512A572BD5180A05186F333A57DB8D42ED5490A1C5D66E03FE6D8C252445BE663B06ECA53794B21EB51967DA22E0434F5B86EECF4A554BFFDE0ED633E8804E143DEAF67D693AC4B5E239AE51F42DF866F4CBC15C54F7C1AD
|
||||
answer = BA0D89B5F48D0E7A11349A033AACA49E64751CC22014FE462911BC79D0889C604DE6070403000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100A52FE320823A15DE9456B7389ECA0A75183D5577A31C5F4CF39C6D465AD774BDA6692473EB6997A60C07469E24E34804707B873E5FC9F2F6ED2C76225B368E35B60E756C2E6EC2910C0B869B736FBAFA53D2B2B23A2F90FFF74D4E4EE4BBA0D98B326E1939F00EF1A07FA5B687893A269BF38DB887A64B7AF1B3EE1B1288AC058A7C92543291D43800045DBCFBCBE4A052B840AE7A6D38EFB7E6832F7E78FE3B824401D811015AE466E78FF7AA935E08888447D2512A572BD5180A05186F333A57DB8D42ED5490A1C5D66E03FE6D8C252445BE663B06ECA53794B21EB51967DA22E0434F5B86EECF4A554BFFDE0ED633E8804E143DEAF67D693AC4B5E239AE51F42DF866F4CBC15C54F7C1AD</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 AC 7E C6 49 66 2E CF 3C F3 BA 99 1B
|
||||
0010 | 9D 8D AB D5 6C 8D 9C F5 77 54 AE 5A 5C B3 05 75
|
||||
0020 | 9A 60 50 D0 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
||||
<pre><code>0000 | BA 0D 89 B5 F4 8D 0E 7A 11 34 9A 03 3A AC A4 9E
|
||||
0010 | 64 75 1C C2 20 14 FE 46 29 11 BC 79 D0 88 9C 60
|
||||
0020 | 4D E6 07 04 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 = BA0D89B5AC7EC649662ECF3CF3BA991B9D8DABD56C8D9CF57754AE5A5CB305759A6050D
|
|||
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 | 7B 42 B2 99 03 9F BD E3 A5 89 69 36 83 98 69 7A
|
||||
0140 | C9 52 27 1D C4 3A 54 38 E7 78 2B B6 52 91 F6 94
|
||||
0150 | 83 57 5A 6E D2 C3 63 0E 91 75 C7 D4 23 17 43 05
|
||||
0160 | FF 38 2C E1 DE D0 89 5A 9C EA FA 2E E9 22 D6 AB
|
||||
0170 | F3 09 66 65 98 8A 10 F8 6D 45 8A 96 7E 13 28 15
|
||||
0180 | 4A 8B 6D EF A5 7C 04 43 27 6A AA AF C9 BF 7E BE
|
||||
0190 | FD FD 6B 1A 51 2B 7A 7D A6 04 2C 75 AD 9A 1D A9
|
||||
01A0 | 9C 1B 8D A5 29 1E 61 4F 94 2F E5 1F D4 FC 13 4D
|
||||
01B0 | 8C 8E 4A 20 20 21 5F D8 03 45 5E 0D 1C F1 2A 48
|
||||
01C0 | B0 3E 77 FE 29 42 4D 18 4D 09 5B 54 55 39 18 3A
|
||||
01D0 | EA C1 C5 DA 98 0A DA 7E F3 BC 20 49 3A 00 BB EA
|
||||
01E0 | D8 19 93 39 81 E9 18 4B ED 92 21 1B 76 C0 2B 66
|
||||
01F0 | DC 1A 54 91 86 34 A1 AE B3 16 71 78 B8 46 46 5F
|
||||
0200 | B1 72 CD 52 5C 2A C7 DE A4 C7 C3 42 06 8E EC ED
|
||||
0210 | 72 40 98 1B 35 3F 47 60 1F 45 B5 2E 83 B7 AD 97
|
||||
0220 | D4 00 CF 5F D3 1F 81 08 08 D8 D8 57 EB 89 24 93
|
||||
0230 | 0E 0D C3 66</code></pre>
|
||||
0130 | A5 2F E3 20 82 3A 15 DE 94 56 B7 38 9E CA 0A 75
|
||||
0140 | 18 3D 55 77 A3 1C 5F 4C F3 9C 6D 46 5A D7 74 BD
|
||||
0150 | A6 69 24 73 EB 69 97 A6 0C 07 46 9E 24 E3 48 04
|
||||
0160 | 70 7B 87 3E 5F C9 F2 F6 ED 2C 76 22 5B 36 8E 35
|
||||
0170 | B6 0E 75 6C 2E 6E C2 91 0C 0B 86 9B 73 6F BA FA
|
||||
0180 | 53 D2 B2 B2 3A 2F 90 FF F7 4D 4E 4E E4 BB A0 D9
|
||||
0190 | 8B 32 6E 19 39 F0 0E F1 A0 7F A5 B6 87 89 3A 26
|
||||
01A0 | 9B F3 8D B8 87 A6 4B 7A F1 B3 EE 1B 12 88 AC 05
|
||||
01B0 | 8A 7C 92 54 32 91 D4 38 00 04 5D BC FB CB E4 A0
|
||||
01C0 | 52 B8 40 AE 7A 6D 38 EF B7 E6 83 2F 7E 78 FE 3B
|
||||
01D0 | 82 44 01 D8 11 01 5A E4 66 E7 8F F7 AA 93 5E 08
|
||||
01E0 | 88 84 47 D2 51 2A 57 2B D5 18 0A 05 18 6F 33 3A
|
||||
01F0 | 57 DB 8D 42 ED 54 90 A1 C5 D6 6E 03 FE 6D 8C 25
|
||||
0200 | 24 45 BE 66 3B 06 EC A5 37 94 B2 1E B5 19 67 DA
|
||||
0210 | 22 E0 43 4F 5B 86 EE CF 4A 55 4B FF DE 0E D6 33
|
||||
0220 | E8 80 4E 14 3D EA F6 7D 69 3A C4 B5 E2 39 AE 51
|
||||
0230 | F4 2D F8 66</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 = BA0D89B5AC7EC649662ECF3CF3BA991B9D8DABD56C8D9CF57754AE5A5CB305759A6050D
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>AC7EC649662ECF3CF3BA991B9D8DABD5</code></td>
|
||||
<td><code>F48D0E7A11349A033AACA49E64751CC2</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>6C8D9CF57754AE5A5CB305759A6050D0</code></td>
|
||||
<td><code>2014FE462911BC79D0889C604DE60704</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -594,13 +594,13 @@ answer = BA0D89B5AC7EC649662ECF3CF3BA991B9D8DABD56C8D9CF57754AE5A5CB305759A6050D
|
|||
<tr>
|
||||
<td>g_a</td>
|
||||
<td>300, 260</td>
|
||||
<td><code>FE0001007B42B299039FBDE3A5896936</code> <code>8398697AC952271DC43A5438E7782BB6</code> <code>5291F69483575A6ED2C3630E9175C7D4</code> <code>23174305FF382CE1DED0895A9CEAFA2E</code> <code>E922D6ABF3096665988A10F86D458A96</code> <code>7E1328154A8B6DEFA57C0443276AAAAF</code> <code>C9BF7EBEFDFD6B1A512B7A7DA6042C75</code> <code>AD9A1DA99C1B8DA5291E614F942FE51F</code> <code>D4FC134D8C8E4A2020215FD803455E0D</code> <code>1CF12A48B03E77FE29424D184D095B54</code> <code>5539183AEAC1C5DA980ADA7EF3BC2049</code> <code>3A00BBEAD819933981E9184BED92211B</code> <code>76C02B66DC1A54918634A1AEB3167178</code> <code>B846465FB172CD525C2AC7DEA4C7C342</code> <code>068EECED7240981B353F47601F45B52E</code> <code>83B7AD97D400CF5FD31F810808D8D857</code><br> <code>EB892493</code></td>
|
||||
<td><code>FE000100A52FE320823A15DE9456B738</code> <code>9ECA0A75183D5577A31C5F4CF39C6D46</code> <code>5AD774BDA6692473EB6997A60C07469E</code> <code>24E34804707B873E5FC9F2F6ED2C7622</code> <code>5B368E35B60E756C2E6EC2910C0B869B</code> <code>736FBAFA53D2B2B23A2F90FFF74D4E4E</code> <code>E4BBA0D98B326E1939F00EF1A07FA5B6</code> <code>87893A269BF38DB887A64B7AF1B3EE1B</code> <code>1288AC058A7C92543291D43800045DBC</code> <code>FBCBE4A052B840AE7A6D38EFB7E6832F</code> <code>7E78FE3B824401D811015AE466E78FF7</code> <code>AA935E08888447D2512A572BD5180A05</code> <code>186F333A57DB8D42ED5490A1C5D66E03</code> <code>FE6D8C252445BE663B06ECA53794B21E</code> <code>B51967DA22E0434F5B86EECF4A554BFF</code> <code>DE0ED633E8804E143DEAF67D693AC4B5</code><br> <code>E239AE51</code></td>
|
||||
<td><code>g_a</code> diffie-hellman parameter</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_time</td>
|
||||
<td>560, 4</td>
|
||||
<td><code>0E0DC366</code> (1724058894 in decimal)</td>
|
||||
<td><code>F42DF866</code> (1727540724 in decimal)</td>
|
||||
<td>Server time</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -609,34 +609,34 @@ answer = BA0D89B5AC7EC649662ECF3CF3BA991B9D8DABD56C8D9CF57754AE5A5CB305759A6050D
|
|||
<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 = 592CF3A19B9F0EAF00180A82A163D2734BD5B520CD6E7DFAFEACCDB4E64203CCB37CE3D94B45F10AF1D590B9FE8ACEED5FC0390C4B82FCC6E7FB83744382FC1643953D8E7B63AF64EEF000B16EAA8A5B80A8E432A1C23EDA3595E595FFEEB429F54B3CEA2A505B5E4CE9B43CA620FE8BB21079C53900852A26CD29062D22176B711435EBA75E446C8C72CE622E461D9D8C4322E0C2170E825E383B45C88A04E5C1CB33E19A859EB12D81F9AE6A3483A6DD45545F56227EE76841462EE855901E5121C73CAC985F6A21655557AE0ED4659B8F6B383C90F13B98ECF55A9F242EB1B0C5E695B83D1015236DED146C70C4D8C421E8B61F21BBBD8714C6656C06B162</code></pre>
|
||||
<pre><code>b = DDB465BF2B15BB5E590E65AD5119D9A755FAEA5B56272376348FEA06B7272AA740180743B318DDA2FA847276080E749C37B6BCF31AEE36025E38D8D3639409F2E8B603F4FB0362749FDF507CE6E1580421DF2B96B0F0FC7FA07280C28EC5D40DC40BF7E3AC43EE2F403DD2ABE82ADF3567BC33AD734C42415ABDBB902851000F5E42C8B491ACA893B87CFB2F08DFB5149459CDDB704AE6629CF51F4C6B4B5A3F243B1CFC6E7B011ECDE08FB5271BE221AE7F920729A2B78EDD3251AA994F142CC27FE7F4F2CDFBE293CF6C3E4E605F1F214C2CD237F01E7B4DBA48951D6B305C6AE132A5EC418CA0CE4C6A8136145A3B4076D48D7130CB032B0A4B81EC5F5299</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 = 8D1278EB55A89D367A6E59DA3EDE2FB197719FEDB8D0267AE15A609E6E631352A2BAF8C2877AD56010AF1A7C28C58F67C82E7F16360B40519FE75E169930B96F55D677B3F248E01472A76800BC08CE8DAA8919E4902D5E9C5B344AD4D75DFA7500701C0B6E43BCB27DD1038B77DA5BE15E0478C97F71650D656D8788144673597AA665EDDDC485F703AB0A326BCCB8C11D2CB748673D4DD5BD21C279F31F893036930DC74DD564CBC2DE3FB243032979A41CFDB7FD06463F43721E79D0C2FD44F4BE371C7385D48CC71D7A104CF1BB8CC21AC3FC7E64FD647021F77864DD28A617F2386160A7DCD7BA7EA71C1DE7D21B304BEE614B3F24031F70E2CE02368BC7</code></pre>
|
||||
<pre><code>g_b = 6EB00018684EC0A4283662EF83A50A51C289FD222B36B426D12EFB77FD6F25E7A6D024B424E819A8D46255F083F847C1CE19FF06CA06EABACD38A0AFB345519D83B7705AEE47EDE37C1FED6CC6EABC5FAACF539D7A0072F0B85C6C57C947C0271B96F6146BE0D98A8B1C743F449CC22F14591403BD0082F82611144E57A946FB2D1381419EF36412776BE932213E79A567D5C18AC66A05577F2638C932A0795AEDAA89616C055B47F6B978670AC407D4C93D048432E20F55588CEA2CD2C945239842917702607406D54E1844933F62531087C1A4D892C31241BC8C7BB2705C13043922D5E20F697CEEC6DAF65C85B34A7ACD41CA181FFC61E4A862EB949FD0FA</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 AC 7E C6 49 66 2E CF 3C F3 BA 99 1B
|
||||
0010 | 9D 8D AB D5 6C 8D 9C F5 77 54 AE 5A 5C B3 05 75
|
||||
0020 | 9A 60 50 D0 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | 8D 12 78 EB 55 A8 9D 36 7A 6E 59 DA 3E DE 2F B1
|
||||
0040 | 97 71 9F ED B8 D0 26 7A E1 5A 60 9E 6E 63 13 52
|
||||
0050 | A2 BA F8 C2 87 7A D5 60 10 AF 1A 7C 28 C5 8F 67
|
||||
0060 | C8 2E 7F 16 36 0B 40 51 9F E7 5E 16 99 30 B9 6F
|
||||
0070 | 55 D6 77 B3 F2 48 E0 14 72 A7 68 00 BC 08 CE 8D
|
||||
0080 | AA 89 19 E4 90 2D 5E 9C 5B 34 4A D4 D7 5D FA 75
|
||||
0090 | 00 70 1C 0B 6E 43 BC B2 7D D1 03 8B 77 DA 5B E1
|
||||
00A0 | 5E 04 78 C9 7F 71 65 0D 65 6D 87 88 14 46 73 59
|
||||
00B0 | 7A A6 65 ED DD C4 85 F7 03 AB 0A 32 6B CC B8 C1
|
||||
00C0 | 1D 2C B7 48 67 3D 4D D5 BD 21 C2 79 F3 1F 89 30
|
||||
00D0 | 36 93 0D C7 4D D5 64 CB C2 DE 3F B2 43 03 29 79
|
||||
00E0 | A4 1C FD B7 FD 06 46 3F 43 72 1E 79 D0 C2 FD 44
|
||||
00F0 | F4 BE 37 1C 73 85 D4 8C C7 1D 7A 10 4C F1 BB 8C
|
||||
0100 | C2 1A C3 FC 7E 64 FD 64 70 21 F7 78 64 DD 28 A6
|
||||
0110 | 17 F2 38 61 60 A7 DC D7 BA 7E A7 1C 1D E7 D2 1B
|
||||
0120 | 30 4B EE 61 4B 3F 24 03 1F 70 E2 CE 02 36 8B C7</code></pre>
|
||||
<pre><code>0000 | 54 B6 43 66 F4 8D 0E 7A 11 34 9A 03 3A AC A4 9E
|
||||
0010 | 64 75 1C C2 20 14 FE 46 29 11 BC 79 D0 88 9C 60
|
||||
0020 | 4D E6 07 04 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | 6E B0 00 18 68 4E C0 A4 28 36 62 EF 83 A5 0A 51
|
||||
0040 | C2 89 FD 22 2B 36 B4 26 D1 2E FB 77 FD 6F 25 E7
|
||||
0050 | A6 D0 24 B4 24 E8 19 A8 D4 62 55 F0 83 F8 47 C1
|
||||
0060 | CE 19 FF 06 CA 06 EA BA CD 38 A0 AF B3 45 51 9D
|
||||
0070 | 83 B7 70 5A EE 47 ED E3 7C 1F ED 6C C6 EA BC 5F
|
||||
0080 | AA CF 53 9D 7A 00 72 F0 B8 5C 6C 57 C9 47 C0 27
|
||||
0090 | 1B 96 F6 14 6B E0 D9 8A 8B 1C 74 3F 44 9C C2 2F
|
||||
00A0 | 14 59 14 03 BD 00 82 F8 26 11 14 4E 57 A9 46 FB
|
||||
00B0 | 2D 13 81 41 9E F3 64 12 77 6B E9 32 21 3E 79 A5
|
||||
00C0 | 67 D5 C1 8A C6 6A 05 57 7F 26 38 C9 32 A0 79 5A
|
||||
00D0 | ED AA 89 61 6C 05 5B 47 F6 B9 78 67 0A C4 07 D4
|
||||
00E0 | C9 3D 04 84 32 E2 0F 55 58 8C EA 2C D2 C9 45 23
|
||||
00F0 | 98 42 91 77 02 60 74 06 D5 4E 18 44 93 3F 62 53
|
||||
0100 | 10 87 C1 A4 D8 92 C3 12 41 BC 8C 7B B2 70 5C 13
|
||||
0110 | 04 39 22 D5 E2 0F 69 7C EE C6 DA F6 5C 85 B3 4A
|
||||
0120 | 7A CD 41 CA 18 1F FC 61 E4 A8 62 EB 94 9F D0 FA</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 = BA0D89B5AC7EC649662ECF3CF3BA991B9D8DABD56C8D9CF57754AE5A5CB305759A6050D
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>AC7EC649662ECF3CF3BA991B9D8DABD5</code></td>
|
||||
<td><code>F48D0E7A11349A033AACA49E64751CC2</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>6C8D9CF57754AE5A5CB305759A6050D0</code></td>
|
||||
<td><code>2014FE462911BC79D0889C604DE60704</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>g_b</td>
|
||||
<td>36, 260</td>
|
||||
<td><code>FE0001008D1278EB55A89D367A6E59DA</code> <code>3EDE2FB197719FEDB8D0267AE15A609E</code> <code>6E631352A2BAF8C2877AD56010AF1A7C</code> <code>28C58F67C82E7F16360B40519FE75E16</code> <code>9930B96F55D677B3F248E01472A76800</code> <code>BC08CE8DAA8919E4902D5E9C5B344AD4</code> <code>D75DFA7500701C0B6E43BCB27DD1038B</code> <code>77DA5BE15E0478C97F71650D656D8788</code> <code>144673597AA665EDDDC485F703AB0A32</code> <code>6BCCB8C11D2CB748673D4DD5BD21C279</code> <code>F31F893036930DC74DD564CBC2DE3FB2</code> <code>43032979A41CFDB7FD06463F43721E79</code> <code>D0C2FD44F4BE371C7385D48CC71D7A10</code> <code>4CF1BB8CC21AC3FC7E64FD647021F778</code> <code>64DD28A617F2386160A7DCD7BA7EA71C</code> <code>1DE7D21B304BEE614B3F24031F70E2CE</code><br> <code>02368BC7</code></td>
|
||||
<td><code>FE0001006EB00018684EC0A4283662EF</code> <code>83A50A51C289FD222B36B426D12EFB77</code> <code>FD6F25E7A6D024B424E819A8D46255F0</code> <code>83F847C1CE19FF06CA06EABACD38A0AF</code> <code>B345519D83B7705AEE47EDE37C1FED6C</code> <code>C6EABC5FAACF539D7A0072F0B85C6C57</code> <code>C947C0271B96F6146BE0D98A8B1C743F</code> <code>449CC22F14591403BD0082F82611144E</code> <code>57A946FB2D1381419EF36412776BE932</code> <code>213E79A567D5C18AC66A05577F2638C9</code> <code>32A0795AEDAA89616C055B47F6B97867</code> <code>0AC407D4C93D048432E20F55588CEA2C</code> <code>D2C945239842917702607406D54E1844</code> <code>933F62531087C1A4D892C31241BC8C7B</code> <code>B2705C13043922D5E20F697CEEC6DAF6</code> <code>5C85B34A7ACD41CA181FFC61E4A862EB</code><br> <code>949FD0FA</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 = BA0D89B5AC7EC649662ECF3CF3BA991B9D8DABD56C8D9CF57754AE5A5CB305759A6050D
|
|||
<!-- 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 = 54B64366AC7EC649662ECF3CF3BA991B9D8DABD56C8D9CF57754AE5A5CB305759A6050D00000000000000000FE0001008D1278EB55A89D367A6E59DA3EDE2FB197719FEDB8D0267AE15A609E6E631352A2BAF8C2877AD56010AF1A7C28C58F67C82E7F16360B40519FE75E169930B96F55D677B3F248E01472A76800BC08CE8DAA8919E4902D5E9C5B344AD4D75DFA7500701C0B6E43BCB27DD1038B77DA5BE15E0478C97F71650D656D8788144673597AA665EDDDC485F703AB0A326BCCB8C11D2CB748673D4DD5BD21C279F31F893036930DC74DD564CBC2DE3FB243032979A41CFDB7FD06463F43721E79D0C2FD44F4BE371C7385D48CC71D7A104CF1BB8CC21AC3FC7E64FD647021F77864DD28A617F2386160A7DCD7BA7EA71C1DE7D21B304BEE614B3F24031F70E2CE02368BC7
|
||||
padding = FE5409530AA9DA24EA778019
|
||||
tmp_aes_key = F9AC244019A3D256B2D0B2A57CCBCB837A05D4A70685F26C926FBAAED69F4148
|
||||
tmp_aes_iv = 1F5D43DF6BEE2B294A86F4F1DCE4E0A30C97CECB011C15F2E09241A4DB3F7E5E</code></pre>
|
||||
<pre><code>data = 54B64366F48D0E7A11349A033AACA49E64751CC22014FE462911BC79D0889C604DE607040000000000000000FE0001006EB00018684EC0A4283662EF83A50A51C289FD222B36B426D12EFB77FD6F25E7A6D024B424E819A8D46255F083F847C1CE19FF06CA06EABACD38A0AFB345519D83B7705AEE47EDE37C1FED6CC6EABC5FAACF539D7A0072F0B85C6C57C947C0271B96F6146BE0D98A8B1C743F449CC22F14591403BD0082F82611144E57A946FB2D1381419EF36412776BE932213E79A567D5C18AC66A05577F2638C932A0795AEDAA89616C055B47F6B978670AC407D4C93D048432E20F55588CEA2CD2C945239842917702607406D54E1844933F62531087C1A4D892C31241BC8C7BB2705C13043922D5E20F697CEEC6DAF65C85B34A7ACD41CA181FFC61E4A862EB949FD0FA
|
||||
padding = 5ED0D63A4F919565BB53FDBD
|
||||
tmp_aes_key = 2023941FFF5A2DB7A0C168FCFCFE5DE4DE7F5151A6C2262DB6E18B6D8C1A6BB4
|
||||
tmp_aes_iv = 56B9A097F20D603B13C624754C821F7547E209B3F02450F58511B25FD74C1834</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 = 6DB219ECBF7D9D7F82C74ED3A0F94C6B2DD8EFD9D013CE3C83711187BCDFAF7A7D6422CC3563BF797CF49D6B019899E8B0A9F6BFF7343A2F7B257E37C5AF8BBEC9B107A84D17BD11567846C804C25CF1D64A669410EFCF2D6FDCE346ECD3431AFAB0B7C0A4B514CC502B6AA66D3FFFBB240B0926E2747E687910C2BA53CAFAC8F7F678D678896169CBD6178733F069AD85B23CA0A84BF76A52AA470FDA804A1F9FBF34A6C944E419697AE7D2B9A4FD2D28BD44204E66FF5E6E7178669128D68EDE1D03B26020A1E9E2F38780FEA68AEB6297F7A282E164C9BA2DC5317A7541B26F726AB2B13E8192AFCE8A664FCFC71FCD0B6A7F1A829ED70CB7F0126E0E15FCAFE07E103CA90992E00071C996A2257B25FA51EE5F2F97255C15FADCE648D9051C03F0F5F5ABA532CA7A5340E5424E4831B296F361FE4C47ACEC49F0F00E8DA434A5FC4CFAB5D004D9867C9CA9195EC6</code></pre>
|
||||
<pre><code>encrypted_data = 76DC991F1256ADEA1130EF0A9A3F008BD3C9CC710BDD3345470C57A0EB055D0327777FFCD1557F6095667CC188C571796D981B4A8C9B514BCE268EE6C98CC4E4FCA0E0D5F919AC57940EAE92D6F35A466C080DD403C436060169838FA40BD7C45E59C73581BB755F65DB4EB2EF80D81D16442F7C4B7FD390040A533EBA5DDA38D424329DE91F00AE4A304C4A14E0A415EBBD68769121EC2477BC75FBD3ED4B802A61A1557661BDFC69DD2FFEC724F2C46B8F01108B285A9AB5D61ABD0B0C341C3061324510E819B87A5FF977AC2F7A3C5A6582614A2F2E45A013A6A92C1F80E6783CDFB39585A85E2112E57760745857F5DD95C1E7F8CA983FECD9951135B24485F3151CDDED424A44564AF0A29C89843D58794F015E11A6EB7A3F1643747E4A76256569A41DCD2603D7D4DB5CE4B1D95AEE257F93536B5D0103A7BC6D47A8247EE1EFD2FFEBC8DBEC00F4C5F5634ABE</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 98 C9 0E 00 0E 0D C3 66
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 AC 7E C6 49 66 2E CF 3C
|
||||
0020 | F3 BA 99 1B 9D 8D AB D5 6C 8D 9C F5 77 54 AE 5A
|
||||
0030 | 5C B3 05 75 9A 60 50 D0 FE 50 01 00 6D B2 19 EC
|
||||
0040 | BF 7D 9D 7F 82 C7 4E D3 A0 F9 4C 6B 2D D8 EF D9
|
||||
0050 | D0 13 CE 3C 83 71 11 87 BC DF AF 7A 7D 64 22 CC
|
||||
0060 | 35 63 BF 79 7C F4 9D 6B 01 98 99 E8 B0 A9 F6 BF
|
||||
0070 | F7 34 3A 2F 7B 25 7E 37 C5 AF 8B BE C9 B1 07 A8
|
||||
0080 | 4D 17 BD 11 56 78 46 C8 04 C2 5C F1 D6 4A 66 94
|
||||
0090 | 10 EF CF 2D 6F DC E3 46 EC D3 43 1A FA B0 B7 C0
|
||||
00A0 | A4 B5 14 CC 50 2B 6A A6 6D 3F FF BB 24 0B 09 26
|
||||
00B0 | E2 74 7E 68 79 10 C2 BA 53 CA FA C8 F7 F6 78 D6
|
||||
00C0 | 78 89 61 69 CB D6 17 87 33 F0 69 AD 85 B2 3C A0
|
||||
00D0 | A8 4B F7 6A 52 AA 47 0F DA 80 4A 1F 9F BF 34 A6
|
||||
00E0 | C9 44 E4 19 69 7A E7 D2 B9 A4 FD 2D 28 BD 44 20
|
||||
00F0 | 4E 66 FF 5E 6E 71 78 66 91 28 D6 8E DE 1D 03 B2
|
||||
0100 | 60 20 A1 E9 E2 F3 87 80 FE A6 8A EB 62 97 F7 A2
|
||||
0110 | 82 E1 64 C9 BA 2D C5 31 7A 75 41 B2 6F 72 6A B2
|
||||
0120 | B1 3E 81 92 AF CE 8A 66 4F CF C7 1F CD 0B 6A 7F
|
||||
0130 | 1A 82 9E D7 0C B7 F0 12 6E 0E 15 FC AF E0 7E 10
|
||||
0140 | 3C A9 09 92 E0 00 71 C9 96 A2 25 7B 25 FA 51 EE
|
||||
0150 | 5F 2F 97 25 5C 15 FA DC E6 48 D9 05 1C 03 F0 F5
|
||||
0160 | F5 AB A5 32 CA 7A 53 40 E5 42 4E 48 31 B2 96 F3
|
||||
0170 | 61 FE 4C 47 AC EC 49 F0 F0 0E 8D A4 34 A5 FC 4C
|
||||
0180 | FA B5 D0 04 D9 86 7C 9C A9 19 5E C6</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 A4 4C 0D 00 F5 2D F8 66
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 F4 8D 0E 7A 11 34 9A 03
|
||||
0020 | 3A AC A4 9E 64 75 1C C2 20 14 FE 46 29 11 BC 79
|
||||
0030 | D0 88 9C 60 4D E6 07 04 FE 50 01 00 76 DC 99 1F
|
||||
0040 | 12 56 AD EA 11 30 EF 0A 9A 3F 00 8B D3 C9 CC 71
|
||||
0050 | 0B DD 33 45 47 0C 57 A0 EB 05 5D 03 27 77 7F FC
|
||||
0060 | D1 55 7F 60 95 66 7C C1 88 C5 71 79 6D 98 1B 4A
|
||||
0070 | 8C 9B 51 4B CE 26 8E E6 C9 8C C4 E4 FC A0 E0 D5
|
||||
0080 | F9 19 AC 57 94 0E AE 92 D6 F3 5A 46 6C 08 0D D4
|
||||
0090 | 03 C4 36 06 01 69 83 8F A4 0B D7 C4 5E 59 C7 35
|
||||
00A0 | 81 BB 75 5F 65 DB 4E B2 EF 80 D8 1D 16 44 2F 7C
|
||||
00B0 | 4B 7F D3 90 04 0A 53 3E BA 5D DA 38 D4 24 32 9D
|
||||
00C0 | E9 1F 00 AE 4A 30 4C 4A 14 E0 A4 15 EB BD 68 76
|
||||
00D0 | 91 21 EC 24 77 BC 75 FB D3 ED 4B 80 2A 61 A1 55
|
||||
00E0 | 76 61 BD FC 69 DD 2F FE C7 24 F2 C4 6B 8F 01 10
|
||||
00F0 | 8B 28 5A 9A B5 D6 1A BD 0B 0C 34 1C 30 61 32 45
|
||||
0100 | 10 E8 19 B8 7A 5F F9 77 AC 2F 7A 3C 5A 65 82 61
|
||||
0110 | 4A 2F 2E 45 A0 13 A6 A9 2C 1F 80 E6 78 3C DF B3
|
||||
0120 | 95 85 A8 5E 21 12 E5 77 60 74 58 57 F5 DD 95 C1
|
||||
0130 | E7 F8 CA 98 3F EC D9 95 11 35 B2 44 85 F3 15 1C
|
||||
0140 | DD ED 42 4A 44 56 4A F0 A2 9C 89 84 3D 58 79 4F
|
||||
0150 | 01 5E 11 A6 EB 7A 3F 16 43 74 7E 4A 76 25 65 69
|
||||
0160 | A4 1D CD 26 03 D7 D4 DB 5C E4 B1 D9 5A EE 25 7F
|
||||
0170 | 93 53 6B 5D 01 03 A7 BC 6D 47 A8 24 7E E1 EF D2
|
||||
0180 | FF EB C8 DB EC 00 F4 C5 F5 63 4A BE</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>98C90E000E0DC366</code></td>
|
||||
<td><code>A44C0D00F52DF866</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>AC7EC649662ECF3CF3BA991B9D8DABD5</code></td>
|
||||
<td><code>F48D0E7A11349A033AACA49E64751CC2</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>6C8D9CF57754AE5A5CB305759A6050D0</code></td>
|
||||
<td><code>2014FE462911BC79D0889C604DE60704</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>56, 340</td>
|
||||
<td><code>FE5001006DB219ECBF7D9D7F82C74ED3</code> <code>A0F94C6B2DD8EFD9D013CE3C83711187</code> <code>BCDFAF7A7D6422CC3563BF797CF49D6B</code> <code>019899E8B0A9F6BFF7343A2F7B257E37</code> <code>C5AF8BBEC9B107A84D17BD11567846C8</code> <code>04C25CF1D64A669410EFCF2D6FDCE346</code> <code>ECD3431AFAB0B7C0A4B514CC502B6AA6</code> <code>6D3FFFBB240B0926E2747E687910C2BA</code> <code>53CAFAC8F7F678D678896169CBD61787</code> <code>33F069AD85B23CA0A84BF76A52AA470F</code> <code>DA804A1F9FBF34A6C944E419697AE7D2</code> <code>B9A4FD2D28BD44204E66FF5E6E717866</code> <code>9128D68EDE1D03B26020A1E9E2F38780</code> <code>FEA68AEB6297F7A282E164C9BA2DC531</code> <code>7A7541B26F726AB2B13E8192AFCE8A66</code> <code>4FCFC71FCD0B6A7F1A829ED70CB7F012</code> <code>6E0E15FCAFE07E103CA90992E00071C9</code> <code>96A2257B25FA51EE5F2F97255C15FADC</code> <code>E648D9051C03F0F5F5ABA532CA7A5340</code> <code>E5424E4831B296F361FE4C47ACEC49F0</code> <code>F00E8DA434A5FC4CFAB5D004D9867C9C</code><br> <code>A9195EC6</code></td>
|
||||
<td><code>FE50010076DC991F1256ADEA1130EF0A</code> <code>9A3F008BD3C9CC710BDD3345470C57A0</code> <code>EB055D0327777FFCD1557F6095667CC1</code> <code>88C571796D981B4A8C9B514BCE268EE6</code> <code>C98CC4E4FCA0E0D5F919AC57940EAE92</code> <code>D6F35A466C080DD403C436060169838F</code> <code>A40BD7C45E59C73581BB755F65DB4EB2</code> <code>EF80D81D16442F7C4B7FD390040A533E</code> <code>BA5DDA38D424329DE91F00AE4A304C4A</code> <code>14E0A415EBBD68769121EC2477BC75FB</code> <code>D3ED4B802A61A1557661BDFC69DD2FFE</code> <code>C724F2C46B8F01108B285A9AB5D61ABD</code> <code>0B0C341C3061324510E819B87A5FF977</code> <code>AC2F7A3C5A6582614A2F2E45A013A6A9</code> <code>2C1F80E6783CDFB39585A85E2112E577</code> <code>60745857F5DD95C1E7F8CA983FECD995</code> <code>1135B24485F3151CDDED424A44564AF0</code> <code>A29C89843D58794F015E11A6EB7A3F16</code> <code>43747E4A76256569A41DCD2603D7D4DB</code> <code>5CE4B1D95AEE257F93536B5D0103A7BC</code> <code>6D47A8247EE1EFD2FFEBC8DBEC00F4C5</code><br> <code>F5634ABE</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 = BD19EE3E32B7F2A3B21CE27F251253E106ACFE7401C24BAFC48AFF27D4CE65087D21DA335CC0B0C3E61C9968FFFF1DFDC3B15F976115D216753C1ECE895D93F2C24F5FA5DF76AF1C3BE8FEF67D1A70133BF587A93E823EC2F1F859899F9EDA79E004873F21492438EF308B467B9F872C188AE7ED0EEFEA51861D70497863092E5ECD0A440C1CBDC9C183B861C21E6E176645F001E551F29188E07ED84C6BBE7E3266F151D0F2C0CC00F867F821824BB81DF5C510F8E83AEE99D4A08A24209A69817E9F7DEBE86C1C0102BB27D2CA185D60CD31C283EC0AAC6FE7CC02BE53B92EE051F9FC8CC703184DD92303C0F8D7DB74C2F3BC705FCF33BD02B3A8EB4E6957</code></pre>
|
||||
<pre><code>auth_key = A0292E59EC147DB7F4F2AEBD8367F734C7E896F379D4C1C879BE81BA8049D12230EA9DC3020476946ED27249BFBAEE30F7659F8737654EBDC977AE1B6F71261942D40B1D6F8AE95B65432F75A2E86A515A88462C33DFDF866E5810B1068A3D3BF21D414355C8375666C8ECAF53573A6AF24061BE55E268F0350C9B86C19116ED668C2577A82BDC8D6E5453A25DD063DF646F96E0D0510920B6C88722B6203630210AF36301C65AFB466E5028AA4D9D4195950661899DAE59C2DC058FE2A6828E0C5FB4AD35A96733394DABFD50F9A0DEE4A11F2FBB0D526655496678639000165AE58F3C53DF0C1E52D37D7B2253A34FE5338AE084A69E0C2660D609E03DC3C5</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 74 0C 9C 0F 0D C3 66
|
||||
0010 | 60 00 00 00 34 F7 CB 3B AC 7E C6 49 66 2E CF 3C
|
||||
0020 | F3 BA 99 1B 9D 8D AB D5 6C 8D 9C F5 77 54 AE 5A
|
||||
0030 | 5C B3 05 75 9A 60 50 D0 A1 20 67 1F 5B 7A 78 E9
|
||||
0040 | DB D0 18 6D 6D B6 73 54</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 C0 A2 1F F6 2D F8 66
|
||||
0010 | 54 00 00 00 34 F7 CB 3B F4 8D 0E 7A 11 34 9A 03
|
||||
0020 | 3A AC A4 9E 64 75 1C C2 20 14 FE 46 29 11 BC 79
|
||||
0030 | D0 88 9C 60 4D E6 07 04 DD 5E A1 E0 33 AB BF D6
|
||||
0040 | C4 30 86 98 60 B8 D9 B2</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>01740C9C0F0DC366</code></td>
|
||||
<td><code>01C0A21FF62DF866</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>60000000</code> (96 in decimal)</td>
|
||||
<td><code>54000000</code> (84 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>AC7EC649662ECF3CF3BA991B9D8DABD5</code></td>
|
||||
<td><code>F48D0E7A11349A033AACA49E64751CC2</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>6C8D9CF57754AE5A5CB305759A6050D0</code></td>
|
||||
<td><code>2014FE462911BC79D0889C604DE60704</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce_hash1</td>
|
||||
<td>56, 16</td>
|
||||
<td><code>A120671F5B7A78E9DBD0186D6DB67354</code></td>
|
||||
<td><code>DD5EA1E033ABBFD6C430869860B8D9B2</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