mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-12-28 23:38:26 +01:00
Update content of files
This commit is contained in:
parent
0df4774c0c
commit
878054e54b
2 changed files with 208 additions and 208 deletions
|
@ -110,7 +110,7 @@ Client developers are required to comply with the <a href="/mtproto/security_gui
|
|||
MTProto v1.0 (<a href="/mtproto_v1">described here</a> for reference) is deprecated and is currently being phased out. </p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" href="#brief-component-summary" id="brief-component-summary" name="brief-component-summary"><i class="anchor-icon"></i></a>Brief Component Summary</h3>
|
||||
<h4><a class="anchor" href="#high-level-component-rpc-query-languageapi" id="high-level-component-rpc-query-languageapi" name="high-level-component-rpc-query-languageapi"><i class="anchor-icon"></i></a>High-Level Component (RPC Query Language/API)</h4>
|
||||
<h4><a class="anchor" href="#high-level-component-rpc-query-language-api" id="high-level-component-rpc-query-language-api" name="high-level-component-rpc-query-language-api"><i class="anchor-icon"></i></a>High-Level Component (RPC Query Language/API)</h4>
|
||||
<p>From the standpoint of the high-level component, the client and the server exchange <em>messages</em> inside a <em>session</em>. The session is attached to the client device (the application, to be more exact) rather than a specific WebSocket/http/https/tcp connection. In addition, each session is attached to a <em>user key ID</em> by which authorization is actually accomplished.</p>
|
||||
<p>Several connections to a server may be open; messages may be sent in either direction through any of the connections (a response to a query is not necessarily returned through the same connection that carried the original query, although most often, that is the case; however, in no case can a message be returned through a connection belonging to a different session). When the UDP protocol is used, a response might be returned by a different IP address than the one to which the query had been sent.</p>
|
||||
<p>There are several types of messages:</p>
|
||||
|
@ -167,7 +167,7 @@ Multiple transport protocols are defined:</p>
|
|||
<h3><a class="anchor" href="#recap" id="recap" name="recap"><i class="anchor-icon"></i></a>Recap</h3>
|
||||
<p>To recap, using the <a href="https://en.wikipedia.org/wiki/OSI_model#Layer_architecture">ISO/OSI stack as comparison</a>: </p>
|
||||
<ul>
|
||||
<li>Layer 7 (Application): <a href="#high-level-component-rpc-query-languageapi">High-level RPC API</a></li>
|
||||
<li>Layer 7 (Application): <a href="#high-level-component-rpc-query-language-api">High-level RPC API</a></li>
|
||||
<li>Layer 6 (Presentation): <a href="/mtproto/TL">Type Language</a></li>
|
||||
<li>Layer 5 (Session): <a href="https://core.telegram.org/mtproto/description#session">MTProto session</a></li>
|
||||
<li>Layer 4 (Transport):<ul>
|
||||
|
|
|
@ -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 A4 55 01 00 ED 11 BD 64
|
||||
0010 | 14 00 00 00 F1 8E 7E BE 7A 1F FF 53 21 A4 04 32
|
||||
0020 | 84 F5 F3 02 41 19 D9 50</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 D4 A8 0E 00 2E 14 BD 64
|
||||
0010 | 14 00 00 00 F1 8E 7E BE 8E 5F 16 4A 0C 6B 62 63
|
||||
0020 | 47 92 D9 A2 43 3E AC 5C</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>A4550100ED11BD64</code></td>
|
||||
<td><code>D4A80E002E14BD64</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>7A1FFF5321A4043284F5F3024119D950</code></td>
|
||||
<td><code>8E5F164A0C6B62634792D9A2433EAC5C</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 A0 BF 74 ED 11 BD 64
|
||||
0010 | C0 00 00 00 63 24 16 05 7A 1F FF 53 21 A4 04 32
|
||||
0020 | 84 F5 F3 02 41 19 D9 50 AE CF 0E 9B D3 89 17 4E
|
||||
0030 | 9A E7 5D CB 0D 3C 7D C6 08 28 99 20 60 6C 46 1C
|
||||
0040 | 09 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 E0 CB D7 2E 14 BD 64
|
||||
0010 | A0 00 00 00 63 24 16 05 8E 5F 16 4A 0C 6B 62 63
|
||||
0020 | 47 92 D9 A2 43 3E AC 5C FE 23 5C 20 EB 66 2B E4
|
||||
0030 | 8E D2 C1 3C 79 3D 50 9C 08 1C 80 7A AA 22 BE D9
|
||||
0040 | E5 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>01A0BF74ED11BD64</code></td>
|
||||
<td><code>01E0CBD72E14BD64</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>C0000000</code> (192 in decimal)</td>
|
||||
<td><code>A0000000</code> (160 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -150,19 +150,19 @@
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>7A1FFF5321A4043284F5F3024119D950</code></td>
|
||||
<td><code>8E5F164A0C6B62634792D9A2433EAC5C</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>AECF0E9BD389174E9AE75DCB0D3C7DC6</code></td>
|
||||
<td><code>FE235C20EB662BE48ED2C13C793D509C</code></td>
|
||||
<td>Server-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pq</td>
|
||||
<td>56, 12</td>
|
||||
<td><code>08289920606C461C09000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2925405031459331081</td>
|
||||
<td><code>081C807AAA22BED9E5000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2053776301226908133</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--q" id="3-client-decomposes-pq-into-prime-factors-such-that-p--q" name="3-client-decomposes-pq-into-prime-factors-such-that-p--q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p < q.</h5>
|
||||
<!-- start pq -->
|
||||
<pre><code>pq = 2925405031459331081</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2925405031459331081 = 1643114519 * 1780402399</code></p>
|
||||
<pre><code>p = 1643114519
|
||||
q = 1780402399</code></pre>
|
||||
<pre><code>pq = 2053776301226908133</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2053776301226908133 = 1121131069 * 1831878857</code></p>
|
||||
<pre><code>p = 1121131069
|
||||
q = 1831878857</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 28 99 20 60 6C 46 1C 09 00 00 00
|
||||
0010 | 04 61 EF F0 17 00 00 00 04 6A 1E C8 DF 00 00 00
|
||||
0020 | 7A 1F FF 53 21 A4 04 32 84 F5 F3 02 41 19 D9 50
|
||||
0030 | AE CF 0E 9B D3 89 17 4E 9A E7 5D CB 0D 3C 7D C6
|
||||
0040 | 6C A1 C6 89 07 5B 8C 46 00 AE 53 8F C7 FC 25 EB
|
||||
0050 | 2F A6 AE B2 7C 98 DA 61 16 37 33 04 59 E7 26 2B
|
||||
<pre><code>0000 | 95 5F F5 A9 08 1C 80 7A AA 22 BE D9 E5 00 00 00
|
||||
0010 | 04 42 D3 1A 3D 00 00 00 04 6D 30 40 C9 00 00 00
|
||||
0020 | 8E 5F 16 4A 0C 6B 62 63 47 92 D9 A2 43 3E AC 5C
|
||||
0030 | FE 23 5C 20 EB 66 2B E4 8E D2 C1 3C 79 3D 50 9C
|
||||
0040 | 24 62 30 E0 F7 4C 3B 30 6D 14 55 BE 80 8E 51 15
|
||||
0050 | C3 83 B4 53 C1 05 90 F5 F1 BC 06 A3 92 F4 53 AE
|
||||
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 = 1780402399</code></pre>
|
|||
<tr>
|
||||
<td>pq</td>
|
||||
<td>4, 12</td>
|
||||
<td><code>08289920606C461C09000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2925405031459331081</td>
|
||||
<td><code>081C807AAA22BED9E5000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2053776301226908133</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>0461EFF017000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1643114519</td>
|
||||
<td><code>0442D31A3D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1121131069</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>046A1EC8DF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1780402399</td>
|
||||
<td><code>046D3040C9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1831878857</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>7A1FFF5321A4043284F5F3024119D950</code></td>
|
||||
<td><code>8E5F164A0C6B62634792D9A2433EAC5C</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>48, 16</td>
|
||||
<td><code>AECF0E9BD389174E9AE75DCB0D3C7DC6</code></td>
|
||||
<td><code>FE235C20EB662BE48ED2C13C793D509C</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce</td>
|
||||
<td>64, 32</td>
|
||||
<td><code>6CA1C689075B8C4600AE538FC7FC25EB</code> <code>2FA6AEB27C98DA611637330459E7262B</code></td>
|
||||
<td><code>246230E0F74C3B306D1455BE808E5115</code> <code>C383B453C10590F5F1BC06A392F453AE</code></td>
|
||||
<td>Client-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -291,39 +291,39 @@ q = 1780402399</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 = 955FF5A908289920606C461C090000000461EFF017000000046A1EC8DF0000007A1FFF5321A4043284F5F3024119D950AECF0E9BD389174E9AE75DCB0D3C7DC66CA1C689075B8C4600AE538FC7FC25EB2FA6AEB27C98DA611637330459E7262B02000000
|
||||
random_padding_bytes = 735163AEA2B383D2EBD0AC816B28F8917E1839FC97142A60B876B633E3C2EF33429907DDB72AA767140458683AC22A999BD10FB9ECE9C27A6FEB746AF79344E71C65A3586F245E2B9989A7485B9D8CE41EF11909767BFCF0649835B6</code></pre>
|
||||
<pre><code>data = 955FF5A9081C807AAA22BED9E50000000442D31A3D000000046D3040C90000008E5F164A0C6B62634792D9A2433EAC5CFE235C20EB662BE48ED2C13C793D509C246230E0F74C3B306D1455BE808E5115C383B453C10590F5F1BC06A392F453AE02000000
|
||||
random_padding_bytes = D8C2D66723BF8F092A2418648093840A780CA68C813B7C9483DA6DE69CF837169BA442C0DDD6D6C78996180264C84FDA86DB11FFC9B0BB468838AE2B66D7E30074BBF5F03F447D742FA3D3FB8C2386424811E3DDC176FB862128FAFA</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 = 8A2A79C21D9784430CEF751E4A40E5D5164F7FB8359E8AC36124DD9B62F67C90F461D7430A775B4F7CE86695EC96184E27A068E467F15DADB39811EE6B2D4FF09214E8464D15AFA5B041AD2C63A5DC4998483C0B8613F861F6418CB5747037186FCDB931024825C624468745C211F6411E1FAD46AF894557658CE235E1E2D0CFFE775BBC4B67420ABB5E39D0C4D662A9D40A5C0DEA36AC79B95187C0C4116D05C1F5C103735ADA2F61ECB182FAB923B941D2129268DF31C6C9648AD8EE23E64A6CE497C385EC5C29B55BCB4D6535DFED8120F0DF56465AA0DC5B47DC4459C9C586E373A527594CA7B276652791C513E36AED4110E5CF2A925AAC1F5B4C6D57F9</code></pre>
|
||||
<pre><code>encrypted_data = 5BC3252F8978A35583A450936F32CADF16E7D245869BB3B882FB7A9B8117836F046C6C5F59ECC9038A5FCB8BAB8F13ACE5159E1CC09E2155C86C9E436AB17E3830EADAB050CD1370AA016A84B50BCA8E65BB7B982CC74641387B38AB81368F256ECAE971CB023BEB33609FD05949E5F0FE53B40AADD403A024FC2F3FBC0F23C2E0682F44BB9A922C3E932BB40694E10CFF6EF9C155522C77C6C920E7296E6616DD4D060F026DBB94559CF84CB92C9B465C8FE3211E2E884ED7A7E6EA49B88DD04CCB61017EF276CE28AD0B8A3EC2843DDC58133D07F7B4AACF7BD0B1AFC8C6DA8C044B80210E384A0B0E4D52F602288B68520F57A40D4D177D16B4BDEA5A7342</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 64 71 04 00 ED 11 BD 64
|
||||
0010 | 40 01 00 00 BE E4 12 D7 7A 1F FF 53 21 A4 04 32
|
||||
0020 | 84 F5 F3 02 41 19 D9 50 AE CF 0E 9B D3 89 17 4E
|
||||
0030 | 9A E7 5D CB 0D 3C 7D C6 04 61 EF F0 17 00 00 00
|
||||
0040 | 04 6A 1E C8 DF 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 8A 2A 79 C2 1D 97 84 43 0C EF 75 1E
|
||||
0060 | 4A 40 E5 D5 16 4F 7F B8 35 9E 8A C3 61 24 DD 9B
|
||||
0070 | 62 F6 7C 90 F4 61 D7 43 0A 77 5B 4F 7C E8 66 95
|
||||
0080 | EC 96 18 4E 27 A0 68 E4 67 F1 5D AD B3 98 11 EE
|
||||
0090 | 6B 2D 4F F0 92 14 E8 46 4D 15 AF A5 B0 41 AD 2C
|
||||
00A0 | 63 A5 DC 49 98 48 3C 0B 86 13 F8 61 F6 41 8C B5
|
||||
00B0 | 74 70 37 18 6F CD B9 31 02 48 25 C6 24 46 87 45
|
||||
00C0 | C2 11 F6 41 1E 1F AD 46 AF 89 45 57 65 8C E2 35
|
||||
00D0 | E1 E2 D0 CF FE 77 5B BC 4B 67 42 0A BB 5E 39 D0
|
||||
00E0 | C4 D6 62 A9 D4 0A 5C 0D EA 36 AC 79 B9 51 87 C0
|
||||
00F0 | C4 11 6D 05 C1 F5 C1 03 73 5A DA 2F 61 EC B1 82
|
||||
0100 | FA B9 23 B9 41 D2 12 92 68 DF 31 C6 C9 64 8A D8
|
||||
0110 | EE 23 E6 4A 6C E4 97 C3 85 EC 5C 29 B5 5B CB 4D
|
||||
0120 | 65 35 DF ED 81 20 F0 DF 56 46 5A A0 DC 5B 47 DC
|
||||
0130 | 44 59 C9 C5 86 E3 73 A5 27 59 4C A7 B2 76 65 27
|
||||
0140 | 91 C5 13 E3 6A ED 41 10 E5 CF 2A 92 5A AC 1F 5B
|
||||
0150 | 4C 6D 57 F9</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 D8 A8 0E 00 2E 14 BD 64
|
||||
0010 | 40 01 00 00 BE E4 12 D7 8E 5F 16 4A 0C 6B 62 63
|
||||
0020 | 47 92 D9 A2 43 3E AC 5C FE 23 5C 20 EB 66 2B E4
|
||||
0030 | 8E D2 C1 3C 79 3D 50 9C 04 42 D3 1A 3D 00 00 00
|
||||
0040 | 04 6D 30 40 C9 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 5B C3 25 2F 89 78 A3 55 83 A4 50 93
|
||||
0060 | 6F 32 CA DF 16 E7 D2 45 86 9B B3 B8 82 FB 7A 9B
|
||||
0070 | 81 17 83 6F 04 6C 6C 5F 59 EC C9 03 8A 5F CB 8B
|
||||
0080 | AB 8F 13 AC E5 15 9E 1C C0 9E 21 55 C8 6C 9E 43
|
||||
0090 | 6A B1 7E 38 30 EA DA B0 50 CD 13 70 AA 01 6A 84
|
||||
00A0 | B5 0B CA 8E 65 BB 7B 98 2C C7 46 41 38 7B 38 AB
|
||||
00B0 | 81 36 8F 25 6E CA E9 71 CB 02 3B EB 33 60 9F D0
|
||||
00C0 | 59 49 E5 F0 FE 53 B4 0A AD D4 03 A0 24 FC 2F 3F
|
||||
00D0 | BC 0F 23 C2 E0 68 2F 44 BB 9A 92 2C 3E 93 2B B4
|
||||
00E0 | 06 94 E1 0C FF 6E F9 C1 55 52 2C 77 C6 C9 20 E7
|
||||
00F0 | 29 6E 66 16 DD 4D 06 0F 02 6D BB 94 55 9C F8 4C
|
||||
0100 | B9 2C 9B 46 5C 8F E3 21 1E 2E 88 4E D7 A7 E6 EA
|
||||
0110 | 49 B8 8D D0 4C CB 61 01 7E F2 76 CE 28 AD 0B 8A
|
||||
0120 | 3E C2 84 3D DC 58 13 3D 07 F7 B4 AA CF 7B D0 B1
|
||||
0130 | AF C8 C6 DA 8C 04 4B 80 21 0E 38 4A 0B 0E 4D 52
|
||||
0140 | F6 02 28 8B 68 52 0F 57 A4 0D 4D 17 7D 16 B4 BD
|
||||
0150 | EA 5A 73 42</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 = 735163AEA2B383D2EBD0AC816B28F8917E1839FC97142A60B876B633E
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>64710400ED11BD64</code></td>
|
||||
<td><code>D8A80E002E14BD64</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 = 735163AEA2B383D2EBD0AC816B28F8917E1839FC97142A60B876B633E
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>7A1FFF5321A4043284F5F3024119D950</code></td>
|
||||
<td><code>8E5F164A0C6B62634792D9A2433EAC5C</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>AECF0E9BD389174E9AE75DCB0D3C7DC6</code></td>
|
||||
<td><code>FE235C20EB662BE48ED2C13C793D509C</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p</td>
|
||||
<td>56, 8</td>
|
||||
<td><code>0461EFF017000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1643114519</td>
|
||||
<td><code>0442D31A3D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1121131069</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>046A1EC8DF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1780402399</td>
|
||||
<td><code>046D3040C9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1831878857</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 = 735163AEA2B383D2EBD0AC816B28F8917E1839FC97142A60B876B633E
|
|||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>80, 260</td>
|
||||
<td><code>FE0001008A2A79C21D9784430CEF751E</code> <code>4A40E5D5164F7FB8359E8AC36124DD9B</code> <code>62F67C90F461D7430A775B4F7CE86695</code> <code>EC96184E27A068E467F15DADB39811EE</code> <code>6B2D4FF09214E8464D15AFA5B041AD2C</code> <code>63A5DC4998483C0B8613F861F6418CB5</code> <code>747037186FCDB931024825C624468745</code> <code>C211F6411E1FAD46AF894557658CE235</code> <code>E1E2D0CFFE775BBC4B67420ABB5E39D0</code> <code>C4D662A9D40A5C0DEA36AC79B95187C0</code> <code>C4116D05C1F5C103735ADA2F61ECB182</code> <code>FAB923B941D2129268DF31C6C9648AD8</code> <code>EE23E64A6CE497C385EC5C29B55BCB4D</code> <code>6535DFED8120F0DF56465AA0DC5B47DC</code> <code>4459C9C586E373A527594CA7B2766527</code> <code>91C513E36AED4110E5CF2A925AAC1F5B</code><br> <code>4C6D57F9</code></td>
|
||||
<td><code>FE0001005BC3252F8978A35583A45093</code> <code>6F32CADF16E7D245869BB3B882FB7A9B</code> <code>8117836F046C6C5F59ECC9038A5FCB8B</code> <code>AB8F13ACE5159E1CC09E2155C86C9E43</code> <code>6AB17E3830EADAB050CD1370AA016A84</code> <code>B50BCA8E65BB7B982CC74641387B38AB</code> <code>81368F256ECAE971CB023BEB33609FD0</code> <code>5949E5F0FE53B40AADD403A024FC2F3F</code> <code>BC0F23C2E0682F44BB9A922C3E932BB4</code> <code>0694E10CFF6EF9C155522C77C6C920E7</code> <code>296E6616DD4D060F026DBB94559CF84C</code> <code>B92C9B465C8FE3211E2E884ED7A7E6EA</code> <code>49B88DD04CCB61017EF276CE28AD0B8A</code> <code>3EC2843DDC58133D07F7B4AACF7BD0B1</code> <code>AFC8C6DA8C044B80210E384A0B0E4D52</code> <code>F602288B68520F57A40D4D177D16B4BD</code><br> <code>EA5A7342</code></td>
|
||||
<td>Value generated above</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -402,47 +402,47 @@ random_padding_bytes = 735163AEA2B383D2EBD0AC816B28F8917E1839FC97142A60B876B633E
|
|||
<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 C4 B1 0B EE 11 BD 64
|
||||
0010 | A4 02 00 00 5C 07 E8 D0 7A 1F FF 53 21 A4 04 32
|
||||
0020 | 84 F5 F3 02 41 19 D9 50 AE CF 0E 9B D3 89 17 4E
|
||||
0030 | 9A E7 5D CB 0D 3C 7D C6 FE 50 02 00 A3 88 64 8C
|
||||
0040 | D5 DA 2B 14 23 28 E2 B5 A9 A7 88 4B AD 7E 83 96
|
||||
0050 | 68 D1 29 3E E3 13 51 F6 2C 68 2A 7F 57 E1 73 6E
|
||||
0060 | 0B 9B 54 6C FE 89 6B 13 22 5E 79 25 6F 4F 22 94
|
||||
0070 | EF 95 DE 2D 1C C0 02 3B 2C E2 37 6E 39 C7 67 43
|
||||
0080 | F2 B9 AB 75 22 B6 DE 54 F5 6F E3 EC 90 29 74 D1
|
||||
0090 | B8 24 D1 D9 D2 BF 23 FC F3 08 66 40 D3 E6 9B F1
|
||||
00A0 | 38 16 BE 72 DE 36 71 FE 80 D6 1C 6C 3A D3 37 08
|
||||
00B0 | F6 FF 83 DE 4C E6 D7 32 B6 D4 1B 31 DC B6 F3 03
|
||||
00C0 | 7A 58 29 84 C3 DF 6B 8B BE BA 87 16 C4 51 F2 62
|
||||
00D0 | 33 C5 D9 1B F7 A8 5E 2E A7 C3 E1 A5 40 F0 59 C3
|
||||
00E0 | F4 9A 56 31 AD 04 92 27 CD 5C 23 4E 86 15 5D 2B
|
||||
00F0 | 9A C4 5B 5C CE 99 5C 85 4B 88 05 CF 4C 83 3B BF
|
||||
0100 | FA E0 49 B7 28 F8 AB CD 8B 2B 85 94 1A 42 58 91
|
||||
0110 | 5D AD A8 E0 2F B2 6B A7 7A 1E B9 D4 FC 64 C3 B5
|
||||
0120 | 06 71 DA A1 07 F2 BB 3A B7 2B 2F 4E 13 BA 2D 40
|
||||
0130 | 4A AD 55 38 DC 16 49 39 E8 BD 33 A8 53 39 01 C0
|
||||
0140 | 5A C8 E2 0B 70 B7 B8 7A 88 11 A7 87 38 FF 02 77
|
||||
0150 | B1 57 85 33 0C 35 1E F6 97 96 8F 1F 8C E7 54 CC
|
||||
0160 | DD 86 12 7E D1 67 83 5C 9B AF 23 D7 8E 4C 49 E1
|
||||
0170 | 81 75 1D 49 BD 84 2B 8C 85 85 60 FB 1D A0 D4 24
|
||||
0180 | 43 1F 40 39 1B C1 16 31 E1 08 5D A2 B0 36 13 43
|
||||
0190 | 69 AD 9C A1 9D 6F 51 30 FA BA 5A EA F4 FD B2 0B
|
||||
01A0 | 19 DB 3F 95 1F 02 15 A3 64 C2 0F 09 2D 70 1F 3D
|
||||
01B0 | D0 9D 24 26 38 00 AA A4 66 61 23 EB 55 C9 CB B1
|
||||
01C0 | C3 6D AB 84 3A D2 A9 88 BE 11 97 73 EE 76 0D 7E
|
||||
01D0 | 9F 2C 9A A4 BB AD 38 44 19 7C 43 1B FE EC 91 33
|
||||
01E0 | 92 08 D4 1D A5 BA 2B EE 45 43 DC FE A6 84 9E 24
|
||||
01F0 | CC E5 CB 90 13 2A CC 47 5B EF 84 2A 61 CD DF 76
|
||||
0200 | E8 BF B9 DB 30 60 D8 85 04 0C 41 FD 20 A9 F6 CC
|
||||
0210 | 72 A0 9E 8D F3 C5 FC 54 42 59 79 69 06 04 8F 83
|
||||
0220 | A0 C0 BA B4 B8 EA 6E 42 1E 5B 4A 2F 3C 1E A1 9E
|
||||
0230 | DA 72 0D 98 3C A2 D3 10 0A 43 89 06 40 E3 18 08
|
||||
0240 | 39 2F 37 5C 60 2C C4 7F 39 A8 DD EE 81 1A 7D 28
|
||||
0250 | 6D 9D 6D A8 F6 87 FA DC 9F 81 E5 2C 9D 42 13 78
|
||||
0260 | 86 78 D4 47 73 30 AA 0A 6B 04 DC 05 D7 DF 5A 8D
|
||||
0270 | 6E FC 75 52 70 AC BC 90 D2 DA 36 73 BA 1A 2F 4A
|
||||
0280 | F5 ED 02 86 87 73 17 0E 8B 5A 63 C6</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 AC 30 79 2F 14 BD 64
|
||||
0010 | A8 02 00 00 5C 07 E8 D0 8E 5F 16 4A 0C 6B 62 63
|
||||
0020 | 47 92 D9 A2 43 3E AC 5C FE 23 5C 20 EB 66 2B E4
|
||||
0030 | 8E D2 C1 3C 79 3D 50 9C FE 50 02 00 9A D5 42 1A
|
||||
0040 | 13 6A 4C F5 E7 E2 56 F9 DF ED 61 C1 70 66 5F F7
|
||||
0050 | 0E D7 48 AE 53 2C A3 1F 6D 77 21 AB 8A D3 E5 B0
|
||||
0060 | D1 C3 D1 BE EF 5D FE DB F3 FE 8C C6 CC C3 77 7C
|
||||
0070 | 2D 02 7C D4 41 A2 0B DC 85 BE 70 75 D3 C4 AB 1C
|
||||
0080 | 99 92 7D 63 89 4B DB 4F B2 23 48 EF D2 DD 0B 95
|
||||
0090 | 17 B5 7E 21 C6 57 9C 1F D6 BC A0 DD DD 7F 17 8E
|
||||
00A0 | B1 5F AC 08 79 A7 5B AB 6A 4A C1 38 DA 5A C9 5B
|
||||
00B0 | 88 91 5F 03 98 1C EE BC 75 DC A7 C9 8B 12 72 84
|
||||
00C0 | F1 AE BF 79 B0 F7 2B 80 FF 49 39 CA 8D 68 20 AA
|
||||
00D0 | E5 7C 45 39 28 CF 26 3C BC E8 51 E8 C0 30 63 C6
|
||||
00E0 | A4 8C 4D 46 B9 0D F9 2D 68 20 5D 5E FC C8 20 67
|
||||
00F0 | 78 81 00 52 28 B2 3E EE B2 D5 CF 70 27 D9 3D BC
|
||||
0100 | D4 A5 18 4C CE 5A 33 90 4E 33 5A 00 9A 39 3F 1D
|
||||
0110 | 4B A1 D3 1D 21 1E 55 D8 11 D0 9E 48 B4 63 3E B8
|
||||
0120 | DE 26 BD DB 33 47 94 FD 6C 7B E7 F7 1C 42 73 F0
|
||||
0130 | 00 DE 89 56 2B 30 08 1A 5C E0 BC AC 99 9C EF E2
|
||||
0140 | 3A 64 01 CF B1 32 09 D4 31 E6 BF 8B AD B2 D5 C5
|
||||
0150 | 2C CE 21 0E 8F 2D 5E 01 82 4B DF B6 69 38 EA F7
|
||||
0160 | FE B7 D6 12 BB 7D F4 A2 54 E8 A6 F9 FF D7 A8 70
|
||||
0170 | 5F A0 11 32 8F EC 82 1D 88 22 2B F3 18 9D DA 79
|
||||
0180 | A2 8E A8 13 46 50 31 B3 25 44 44 A4 48 ED 57 0B
|
||||
0190 | B9 0E 73 03 2B 81 48 5B E1 19 22 BD 1C 23 46 B5
|
||||
01A0 | C5 21 0E F5 B0 44 DA 4C A5 88 08 F5 E8 C5 AA 5E
|
||||
01B0 | 32 C8 9C C3 9F 3B 8F E8 09 2C B4 F1 0F 3D 4D 08
|
||||
01C0 | FD 7D 21 D2 49 AB 1D 8F ED FD 89 7D 27 38 3B 00
|
||||
01D0 | 0D 01 C9 14 CF D8 58 7D B8 AF A3 0F 99 FA 7C 87
|
||||
01E0 | 16 EB 79 F0 71 0B 72 AE B5 97 73 A1 FB 66 ED 24
|
||||
01F0 | 3C 0D 3F 48 38 AE 5A 09 ED F6 A9 A9 08 6E 86 B3
|
||||
0200 | 36 29 E3 32 28 E8 1D FE 6E 21 CC E3 E7 32 6A 0B
|
||||
0210 | 1E 9B A4 D4 49 F6 2B 4F C5 84 5F 96 52 9E F6 A9
|
||||
0220 | 94 22 53 0F 18 DC 65 6B 8D 85 57 28 4C 9C AD DA
|
||||
0230 | 57 CD 68 F6 A2 97 6D C6 A9 C1 3F 8A 70 13 51 7A
|
||||
0240 | F5 7F 96 7E 21 A7 40 41 E8 2A B8 21 EC 63 3B 8F
|
||||
0250 | DA CA 0F D0 D2 CC 58 0B FA 5B 3D 9C 66 8B DC 22
|
||||
0260 | 12 95 8F A2 44 C4 40 77 23 56 D9 ED 1C 25 33 E0
|
||||
0270 | 9D 26 E7 60 F7 E9 48 4E D1 2D 3D 25 C6 83 A8 41
|
||||
0280 | 97 3C D7 0D BA 12 C1 91 6B 74 E8 81</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 = 735163AEA2B383D2EBD0AC816B28F8917E1839FC97142A60B876B633E
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>01C4B10BEE11BD64</code></td>
|
||||
<td><code>01AC30792F14BD64</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>A4020000</code> (676 in decimal)</td>
|
||||
<td><code>A8020000</code> (680 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -482,19 +482,19 @@ random_padding_bytes = 735163AEA2B383D2EBD0AC816B28F8917E1839FC97142A60B876B633E
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>7A1FFF5321A4043284F5F3024119D950</code></td>
|
||||
<td><code>8E5F164A0C6B62634792D9A2433EAC5C</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>AECF0E9BD389174E9AE75DCB0D3C7DC6</code></td>
|
||||
<td><code>FE235C20EB662BE48ED2C13C793D509C</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_answer</td>
|
||||
<td>56, 596</td>
|
||||
<td><code>FE500200A388648CD5DA2B142328E2B5</code> <code>A9A7884BAD7E839668D1293EE31351F6</code> <code>2C682A7F57E1736E0B9B546CFE896B13</code> <code>225E79256F4F2294EF95DE2D1CC0023B</code> <code>2CE2376E39C76743F2B9AB7522B6DE54</code> <code>F56FE3EC902974D1B824D1D9D2BF23FC</code> <code>F3086640D3E69BF13816BE72DE3671FE</code> <code>80D61C6C3AD33708F6FF83DE4CE6D732</code> <code>B6D41B31DCB6F3037A582984C3DF6B8B</code> <code>BEBA8716C451F26233C5D91BF7A85E2E</code> <code>A7C3E1A540F059C3F49A5631AD049227</code> <code>CD5C234E86155D2B9AC45B5CCE995C85</code> <code>4B8805CF4C833BBFFAE049B728F8ABCD</code> <code>8B2B85941A4258915DADA8E02FB26BA7</code> <code>7A1EB9D4FC64C3B50671DAA107F2BB3A</code> <code>B72B2F4E13BA2D404AAD5538DC164939</code> <code>E8BD33A8533901C05AC8E20B70B7B87A</code> <code>8811A78738FF0277B15785330C351EF6</code> <code>97968F1F8CE754CCDD86127ED167835C</code> <code>9BAF23D78E4C49E181751D49BD842B8C</code> <code>858560FB1DA0D424431F40391BC11631</code> <code>E1085DA2B036134369AD9CA19D6F5130</code> <code>FABA5AEAF4FDB20B19DB3F951F0215A3</code> <code>64C20F092D701F3DD09D24263800AAA4</code> <code>666123EB55C9CBB1C36DAB843AD2A988</code> <code>BE119773EE760D7E9F2C9AA4BBAD3844</code> <code>197C431BFEEC91339208D41DA5BA2BEE</code> <code>4543DCFEA6849E24CCE5CB90132ACC47</code> <code>5BEF842A61CDDF76E8BFB9DB3060D885</code> <code>040C41FD20A9F6CC72A09E8DF3C5FC54</code> <code>4259796906048F83A0C0BAB4B8EA6E42</code> <code>1E5B4A2F3C1EA19EDA720D983CA2D310</code> <code>0A43890640E31808392F375C602CC47F</code> <code>39A8DDEE811A7D286D9D6DA8F687FADC</code> <code>9F81E52C9D4213788678D4477330AA0A</code> <code>6B04DC05D7DF5A8D6EFC755270ACBC90</code> <code>D2DA3673BA1A2F4AF5ED02868773170E</code><br> <code>8B5A63C6</code></td>
|
||||
<td><code>FE5002009AD5421A136A4CF5E7E256F9</code> <code>DFED61C170665FF70ED748AE532CA31F</code> <code>6D7721AB8AD3E5B0D1C3D1BEEF5DFEDB</code> <code>F3FE8CC6CCC3777C2D027CD441A20BDC</code> <code>85BE7075D3C4AB1C99927D63894BDB4F</code> <code>B22348EFD2DD0B9517B57E21C6579C1F</code> <code>D6BCA0DDDD7F178EB15FAC0879A75BAB</code> <code>6A4AC138DA5AC95B88915F03981CEEBC</code> <code>75DCA7C98B127284F1AEBF79B0F72B80</code> <code>FF4939CA8D6820AAE57C453928CF263C</code> <code>BCE851E8C03063C6A48C4D46B90DF92D</code> <code>68205D5EFCC820677881005228B23EEE</code> <code>B2D5CF7027D93DBCD4A5184CCE5A3390</code> <code>4E335A009A393F1D4BA1D31D211E55D8</code> <code>11D09E48B4633EB8DE26BDDB334794FD</code> <code>6C7BE7F71C4273F000DE89562B30081A</code> <code>5CE0BCAC999CEFE23A6401CFB13209D4</code> <code>31E6BF8BADB2D5C52CCE210E8F2D5E01</code> <code>824BDFB66938EAF7FEB7D612BB7DF4A2</code> <code>54E8A6F9FFD7A8705FA011328FEC821D</code> <code>88222BF3189DDA79A28EA813465031B3</code> <code>254444A448ED570BB90E73032B81485B</code> <code>E11922BD1C2346B5C5210EF5B044DA4C</code> <code>A58808F5E8C5AA5E32C89CC39F3B8FE8</code> <code>092CB4F10F3D4D08FD7D21D249AB1D8F</code> <code>EDFD897D27383B000D01C914CFD8587D</code> <code>B8AFA30F99FA7C8716EB79F0710B72AE</code> <code>B59773A1FB66ED243C0D3F4838AE5A09</code> <code>EDF6A9A9086E86B33629E33228E81DFE</code> <code>6E21CCE3E7326A0B1E9BA4D449F62B4F</code> <code>C5845F96529EF6A99422530F18DC656B</code> <code>8D8557284C9CADDA57CD68F6A2976DC6</code> <code>A9C13F8A7013517AF57F967E21A74041</code> <code>E82AB821EC633B8FDACA0FD0D2CC580B</code> <code>FA5B3D9C668BDC2212958FA244C44077</code> <code>2356D9ED1C2533E09D26E760F7E9484E</code> <code>D12D3D25C683A841973CD70DBA12C191</code><br> <code>6B74E881</code></td>
|
||||
<td>See below</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -502,20 +502,20 @@ random_padding_bytes = 735163AEA2B383D2EBD0AC816B28F8917E1839FC97142A60B876B633E
|
|||
<!-- 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 = A388648CD5DA2B142328E2B5A9A7884BAD7E839668D1293EE31351F62C682A7F57E1736E0B9B546CFE896B13225E79256F4F2294EF95DE2D1CC0023B2CE2376E39C76743F2B9AB7522B6DE54F56FE3EC902974D1B824D1D9D2BF23FCF3086640D3E69BF13816BE72DE3671FE80D61C6C3AD33708F6FF83DE4CE6D732B6D41B31DCB6F3037A582984C3DF6B8BBEBA8716C451F26233C5D91BF7A85E2EA7C3E1A540F059C3F49A5631AD049227CD5C234E86155D2B9AC45B5CCE995C854B8805CF4C833BBFFAE049B728F8ABCD8B2B85941A4258915DADA8E02FB26BA77A1EB9D4FC64C3B50671DAA107F2BB3AB72B2F4E13BA2D404AAD5538DC164939E8BD33A8533901C05AC8E20B70B7B87A8811A78738FF0277B15785330C351EF697968F1F8CE754CCDD86127ED167835C9BAF23D78E4C49E181751D49BD842B8C858560FB1DA0D424431F40391BC11631E1085DA2B036134369AD9CA19D6F5130FABA5AEAF4FDB20B19DB3F951F0215A364C20F092D701F3DD09D24263800AAA4666123EB55C9CBB1C36DAB843AD2A988BE119773EE760D7E9F2C9AA4BBAD3844197C431BFEEC91339208D41DA5BA2BEE4543DCFEA6849E24CCE5CB90132ACC475BEF842A61CDDF76E8BFB9DB3060D885040C41FD20A9F6CC72A09E8DF3C5FC544259796906048F83A0C0BAB4B8EA6E421E5B4A2F3C1EA19EDA720D983CA2D3100A43890640E31808392F375C602CC47F39A8DDEE811A7D286D9D6DA8F687FADC9F81E52C9D4213788678D4477330AA0A6B04DC05D7DF5A8D6EFC755270ACBC90D2DA3673BA1A2F4AF5ED02868773170E8B5A63C6
|
||||
tmp_aes_key = 85AA00CFCCA8B6329A0C9D212D490203901D497207ADA2F2C1B6E79C73805245
|
||||
tmp_aes_iv = 42A87B37C91087D651A5B460CD41CEDAADCA9BF58C11BCCFD4C568256CA1C689</code></pre>
|
||||
<pre><code>encrypted_answer = 9AD5421A136A4CF5E7E256F9DFED61C170665FF70ED748AE532CA31F6D7721AB8AD3E5B0D1C3D1BEEF5DFEDBF3FE8CC6CCC3777C2D027CD441A20BDC85BE7075D3C4AB1C99927D63894BDB4FB22348EFD2DD0B9517B57E21C6579C1FD6BCA0DDDD7F178EB15FAC0879A75BAB6A4AC138DA5AC95B88915F03981CEEBC75DCA7C98B127284F1AEBF79B0F72B80FF4939CA8D6820AAE57C453928CF263CBCE851E8C03063C6A48C4D46B90DF92D68205D5EFCC820677881005228B23EEEB2D5CF7027D93DBCD4A5184CCE5A33904E335A009A393F1D4BA1D31D211E55D811D09E48B4633EB8DE26BDDB334794FD6C7BE7F71C4273F000DE89562B30081A5CE0BCAC999CEFE23A6401CFB13209D431E6BF8BADB2D5C52CCE210E8F2D5E01824BDFB66938EAF7FEB7D612BB7DF4A254E8A6F9FFD7A8705FA011328FEC821D88222BF3189DDA79A28EA813465031B3254444A448ED570BB90E73032B81485BE11922BD1C2346B5C5210EF5B044DA4CA58808F5E8C5AA5E32C89CC39F3B8FE8092CB4F10F3D4D08FD7D21D249AB1D8FEDFD897D27383B000D01C914CFD8587DB8AFA30F99FA7C8716EB79F0710B72AEB59773A1FB66ED243C0D3F4838AE5A09EDF6A9A9086E86B33629E33228E81DFE6E21CCE3E7326A0B1E9BA4D449F62B4FC5845F96529EF6A99422530F18DC656B8D8557284C9CADDA57CD68F6A2976DC6A9C13F8A7013517AF57F967E21A74041E82AB821EC633B8FDACA0FD0D2CC580BFA5B3D9C668BDC2212958FA244C440772356D9ED1C2533E09D26E760F7E9484ED12D3D25C683A841973CD70DBA12C1916B74E881
|
||||
tmp_aes_key = ED0582A5A37DC51D44A48A3DB9BDE1BDA036E0883025EA375501EDB2CD8E19F0
|
||||
tmp_aes_iv = D5646AAAEABD85D919B9FABFB922A5F55031EECBF9A4E95A9F28C2DA246230E0</code></pre>
|
||||
<!-- end server_DH_inner_data_input -->
|
||||
<p>Yielding:</p>
|
||||
<!-- start server_DH_inner_data_output -->
|
||||
<pre><code>answer_with_hash = 31B3FAE5374F2B33BECE4463CD329053F28C37A6BA0D89B57A1FFF5321A4043284F5F3024119D950AECF0E9BD389174E9AE75DCB0D3C7DC603000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010058E1620D6674A2157FDB3E6673F00386E2344EEFABCE42C02CCD18FE7956945231BCFB649AD7DFBF69A59E39F0EAB71ED41D4EFE0B50E2AA83AA7FE0DAD6F0EC201870018B03E43D0A3D935B68B6C2094C63067674814889A48D693CCC539F1E7903466ECB3B483530D5AA25C6513AF4645AAAD8CCB05754915078058B4632C74C7ED016E8F7B6F3B0652F709DF778AD295D0814E1EBCDE34533426807A9EA10155E0B11938223B501A6BAE2E1B1F468E2626A2351BACAC6C7B4191F9C58982A2F8D9F42669762212CB5F8876BDE5C93D63E7337D1927B213474AD9F00476A65D0B500ACB9A7A35C83AB0BC5B83A2BDABC959F8D649AE2E5B77997DEF7A9652BEE11BD644BB9F4E72D93B8BA
|
||||
answer = BA0D89B57A1FFF5321A4043284F5F3024119D950AECF0E9BD389174E9AE75DCB0D3C7DC603000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010058E1620D6674A2157FDB3E6673F00386E2344EEFABCE42C02CCD18FE7956945231BCFB649AD7DFBF69A59E39F0EAB71ED41D4EFE0B50E2AA83AA7FE0DAD6F0EC201870018B03E43D0A3D935B68B6C2094C63067674814889A48D693CCC539F1E7903466ECB3B483530D5AA25C6513AF4645AAAD8CCB05754915078058B4632C74C7ED016E8F7B6F3B0652F709DF778AD295D0814E1EBCDE34533426807A9EA10155E0B11938223B501A6BAE2E1B1F468E2626A2351BACAC6C7B4191F9C58982A2F8D9F42669762212CB5F8876BDE5C93D63E7337D1927B213474AD9F00476A65D0B500ACB9A7A35C83AB0BC5B83A2BDABC959F8D649AE2E5B77997DEF7A9652BEE11BD644BB9F4E72D93B8BA</code></pre>
|
||||
<pre><code>answer_with_hash = 25489064474896343C19122637D8FE5A7A846D64BA0D89B58E5F164A0C6B62634792D9A2433EAC5CFE235C20EB662BE48ED2C13C793D509C03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100B64E75C04088ED0DF30F06C46CDDB48E9E93516BB5A95ED45853D0D5E6391335F5EAE0C95773DCBB2CFDAD9991B4A361DB987C20B61D2A82DFE890ED723E61A46AD3ABA8A69D0AE919F38FA2F452A49B60A8740F4A0F14E0C8FDB8453CE75A0A9D3D22ACEA3E56D95D5E0657FB91C89AE9F9939A0F884D09FE9DC6D0AD3C704318ABD27B95F8C92E2C726D0DA4F406CBF3FBC18BD3D0ECF1AB6163D0DCD25FA8339B298283AEDBA4B322CB4CD384D27088DA94418FC8438A6AFE9758E660D9EF600B34ABC521D4994F0D34ADBC2E969AD59B73C4F1F53BCA585F7195B4746ACB70DC66ABA8B47B65518E4EB0EE2B4F06CB98AA72B51751178D456EBC3C3573982F14BD6493F6FBEFB93195F7
|
||||
answer = BA0D89B58E5F164A0C6B62634792D9A2433EAC5CFE235C20EB662BE48ED2C13C793D509C03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100B64E75C04088ED0DF30F06C46CDDB48E9E93516BB5A95ED45853D0D5E6391335F5EAE0C95773DCBB2CFDAD9991B4A361DB987C20B61D2A82DFE890ED723E61A46AD3ABA8A69D0AE919F38FA2F452A49B60A8740F4A0F14E0C8FDB8453CE75A0A9D3D22ACEA3E56D95D5E0657FB91C89AE9F9939A0F884D09FE9DC6D0AD3C704318ABD27B95F8C92E2C726D0DA4F406CBF3FBC18BD3D0ECF1AB6163D0DCD25FA8339B298283AEDBA4B322CB4CD384D27088DA94418FC8438A6AFE9758E660D9EF600B34ABC521D4994F0D34ADBC2E969AD59B73C4F1F53BCA585F7195B4746ACB70DC66ABA8B47B65518E4EB0EE2B4F06CB98AA72B51751178D456EBC3C3573982F14BD6493F6FBEFB93195F7</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 7A 1F FF 53 21 A4 04 32 84 F5 F3 02
|
||||
0010 | 41 19 D9 50 AE CF 0E 9B D3 89 17 4E 9A E7 5D CB
|
||||
0020 | 0D 3C 7D C6 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
||||
<pre><code>0000 | BA 0D 89 B5 8E 5F 16 4A 0C 6B 62 63 47 92 D9 A2
|
||||
0010 | 43 3E AC 5C FE 23 5C 20 EB 66 2B E4 8E D2 C1 3C
|
||||
0020 | 79 3D 50 9C 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 = BA0D89B57A1FFF5321A4043284F5F3024119D950AECF0E9BD389174E9AE75DCB0D3C7DC
|
|||
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 | 58 E1 62 0D 66 74 A2 15 7F DB 3E 66 73 F0 03 86
|
||||
0140 | E2 34 4E EF AB CE 42 C0 2C CD 18 FE 79 56 94 52
|
||||
0150 | 31 BC FB 64 9A D7 DF BF 69 A5 9E 39 F0 EA B7 1E
|
||||
0160 | D4 1D 4E FE 0B 50 E2 AA 83 AA 7F E0 DA D6 F0 EC
|
||||
0170 | 20 18 70 01 8B 03 E4 3D 0A 3D 93 5B 68 B6 C2 09
|
||||
0180 | 4C 63 06 76 74 81 48 89 A4 8D 69 3C CC 53 9F 1E
|
||||
0190 | 79 03 46 6E CB 3B 48 35 30 D5 AA 25 C6 51 3A F4
|
||||
01A0 | 64 5A AA D8 CC B0 57 54 91 50 78 05 8B 46 32 C7
|
||||
01B0 | 4C 7E D0 16 E8 F7 B6 F3 B0 65 2F 70 9D F7 78 AD
|
||||
01C0 | 29 5D 08 14 E1 EB CD E3 45 33 42 68 07 A9 EA 10
|
||||
01D0 | 15 5E 0B 11 93 82 23 B5 01 A6 BA E2 E1 B1 F4 68
|
||||
01E0 | E2 62 6A 23 51 BA CA C6 C7 B4 19 1F 9C 58 98 2A
|
||||
01F0 | 2F 8D 9F 42 66 97 62 21 2C B5 F8 87 6B DE 5C 93
|
||||
0200 | D6 3E 73 37 D1 92 7B 21 34 74 AD 9F 00 47 6A 65
|
||||
0210 | D0 B5 00 AC B9 A7 A3 5C 83 AB 0B C5 B8 3A 2B DA
|
||||
0220 | BC 95 9F 8D 64 9A E2 E5 B7 79 97 DE F7 A9 65 2B
|
||||
0230 | EE 11 BD 64</code></pre>
|
||||
0130 | B6 4E 75 C0 40 88 ED 0D F3 0F 06 C4 6C DD B4 8E
|
||||
0140 | 9E 93 51 6B B5 A9 5E D4 58 53 D0 D5 E6 39 13 35
|
||||
0150 | F5 EA E0 C9 57 73 DC BB 2C FD AD 99 91 B4 A3 61
|
||||
0160 | DB 98 7C 20 B6 1D 2A 82 DF E8 90 ED 72 3E 61 A4
|
||||
0170 | 6A D3 AB A8 A6 9D 0A E9 19 F3 8F A2 F4 52 A4 9B
|
||||
0180 | 60 A8 74 0F 4A 0F 14 E0 C8 FD B8 45 3C E7 5A 0A
|
||||
0190 | 9D 3D 22 AC EA 3E 56 D9 5D 5E 06 57 FB 91 C8 9A
|
||||
01A0 | E9 F9 93 9A 0F 88 4D 09 FE 9D C6 D0 AD 3C 70 43
|
||||
01B0 | 18 AB D2 7B 95 F8 C9 2E 2C 72 6D 0D A4 F4 06 CB
|
||||
01C0 | F3 FB C1 8B D3 D0 EC F1 AB 61 63 D0 DC D2 5F A8
|
||||
01D0 | 33 9B 29 82 83 AE DB A4 B3 22 CB 4C D3 84 D2 70
|
||||
01E0 | 88 DA 94 41 8F C8 43 8A 6A FE 97 58 E6 60 D9 EF
|
||||
01F0 | 60 0B 34 AB C5 21 D4 99 4F 0D 34 AD BC 2E 96 9A
|
||||
0200 | D5 9B 73 C4 F1 F5 3B CA 58 5F 71 95 B4 74 6A CB
|
||||
0210 | 70 DC 66 AB A8 B4 7B 65 51 8E 4E B0 EE 2B 4F 06
|
||||
0220 | CB 98 AA 72 B5 17 51 17 8D 45 6E BC 3C 35 73 98
|
||||
0230 | 2F 14 BD 64</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 = BA0D89B57A1FFF5321A4043284F5F3024119D950AECF0E9BD389174E9AE75DCB0D3C7DC
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>7A1FFF5321A4043284F5F3024119D950</code></td>
|
||||
<td><code>8E5F164A0C6B62634792D9A2433EAC5C</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>AECF0E9BD389174E9AE75DCB0D3C7DC6</code></td>
|
||||
<td><code>FE235C20EB662BE48ED2C13C793D509C</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -594,13 +594,13 @@ answer = BA0D89B57A1FFF5321A4043284F5F3024119D950AECF0E9BD389174E9AE75DCB0D3C7DC
|
|||
<tr>
|
||||
<td>g_a</td>
|
||||
<td>300, 260</td>
|
||||
<td><code>FE00010058E1620D6674A2157FDB3E66</code> <code>73F00386E2344EEFABCE42C02CCD18FE</code> <code>7956945231BCFB649AD7DFBF69A59E39</code> <code>F0EAB71ED41D4EFE0B50E2AA83AA7FE0</code> <code>DAD6F0EC201870018B03E43D0A3D935B</code> <code>68B6C2094C63067674814889A48D693C</code> <code>CC539F1E7903466ECB3B483530D5AA25</code> <code>C6513AF4645AAAD8CCB0575491507805</code> <code>8B4632C74C7ED016E8F7B6F3B0652F70</code> <code>9DF778AD295D0814E1EBCDE345334268</code> <code>07A9EA10155E0B11938223B501A6BAE2</code> <code>E1B1F468E2626A2351BACAC6C7B4191F</code> <code>9C58982A2F8D9F42669762212CB5F887</code> <code>6BDE5C93D63E7337D1927B213474AD9F</code> <code>00476A65D0B500ACB9A7A35C83AB0BC5</code> <code>B83A2BDABC959F8D649AE2E5B77997DE</code><br> <code>F7A9652B</code></td>
|
||||
<td><code>FE000100B64E75C04088ED0DF30F06C4</code> <code>6CDDB48E9E93516BB5A95ED45853D0D5</code> <code>E6391335F5EAE0C95773DCBB2CFDAD99</code> <code>91B4A361DB987C20B61D2A82DFE890ED</code> <code>723E61A46AD3ABA8A69D0AE919F38FA2</code> <code>F452A49B60A8740F4A0F14E0C8FDB845</code> <code>3CE75A0A9D3D22ACEA3E56D95D5E0657</code> <code>FB91C89AE9F9939A0F884D09FE9DC6D0</code> <code>AD3C704318ABD27B95F8C92E2C726D0D</code> <code>A4F406CBF3FBC18BD3D0ECF1AB6163D0</code> <code>DCD25FA8339B298283AEDBA4B322CB4C</code> <code>D384D27088DA94418FC8438A6AFE9758</code> <code>E660D9EF600B34ABC521D4994F0D34AD</code> <code>BC2E969AD59B73C4F1F53BCA585F7195</code> <code>B4746ACB70DC66ABA8B47B65518E4EB0</code> <code>EE2B4F06CB98AA72B51751178D456EBC</code><br> <code>3C357398</code></td>
|
||||
<td><code>g_a</code> diffie-hellman parameter</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_time</td>
|
||||
<td>560, 4</td>
|
||||
<td><code>EE11BD64</code> (1690112494 in decimal)</td>
|
||||
<td><code>2F14BD64</code> (1690113071 in decimal)</td>
|
||||
<td>Server time</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -609,34 +609,34 @@ answer = BA0D89B57A1FFF5321A4043284F5F3024119D950AECF0E9BD389174E9AE75DCB0D3C7DC
|
|||
<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 = B3C37A78F0E2CF3DFD73058C307D5AFA60E8B7E1AB475A6D99655AB4C6357EF1DF004922FBCABDD23699358BEA3B90E08C8D9F1629D207C5A1783D3A04957514EAA13B6C32B406CD9FAF3BB68AE78E79F05AF658E042CBA669315BA3EAC969FE41C0EB1A48AE93A5B8903DD25B3C0512CEA54052EA3124A6E11FA2D09B2070D0FC35A04EC6A0FEA49DB3D8942678744332724A5AD2BB7C773AFFACF7A1E6471B671A5246DC06DD4E5D0CD59F849151A72E13C11FB8C223C219377281C2AB4B8636D4F70AF43DB553C28DF9800E22A09287024A4B7485AD4908364EF504A85BF61DAC712BD5E53FF9DF6031043A5183BD28A7753715A423C391ABA768EA5CF0EC</code></pre>
|
||||
<pre><code>b = 56C1449E5A2F720CBCADBB68EF35C1D815E9301191135A1419A9077B842C0341B2A182B29F1F79AB536792624D7B1C3BF4349ADCFA372F62666D9A63A1217C4CE21CB3D65D2125ABC96370300FE20FCFBE685207ABB301CE27F336D3A89544D3BCF5BB638785C5630712A22D2BEAE305804324847D01B831120B71F728338DB2A60F1905B2382FF5EA7AE58BB53CE8D9D0D73495977A7BF865989F17202E41DD6734581497AB0EA6597D82698145043F13BB626FA45CA73371BAF8F9B55D43D78AB6332B44FE461149B85311D7164BE672E41F5CC59D4447CB9B8F850C0B69479FFEADC7CF32D0DCA9153312EA33A5089C8FFA47D3876FCD1447C9F2358CCF83</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 = AA82DBBD312351768B5F124ADFB02652BEE2FAF1F8FFC91AA6B0345E298872140BF61EFEC9CD11766ED91EF01F344035594C892977E472381070EBC0B7C7892928EA191C7540DE70A25AB8926787C0204DB502269A22DF61B19CD106CBD7AFEB48CB5DD797A1FFD2BBE9EA1BF799122792F96B5D1F10E5E7DD0A5F5C8AA09A3AA56B15CCA0F4D3CDBD9FB4ADD433FC63864D14131172AABD7F7835D0419525EC50BBB849F90EDDB0A979603B7DD896AEB4F5D52F4FDA5893250285C2CDFB60480F3D09BBD5D32DB68A565AABAE4042AA10173EF78DE1445897282AD6CE3F8CBFDF8F0D7A9F95EB171BFC8A3A009DAA20FAE28E5C0C165D2E4305DD7450E19CA5</code></pre>
|
||||
<pre><code>g_b = B2AD360A45789F4112258889A9715D4418EEE7C974812D2A84D5AD9914ED70EB24B15A22E4AE92BC94DCBC69B7CCC29E42DA828565A5E737393E572278B691D63464ACF501742F232E6A51B2CCE5F239DF9D2B6D79B10D6E471A0D6671843562820BA231CC9D9FAAE0656146F3A52577F7A2CC93E67AF54F1B3BF8B86A5D51E6B020671649675A4CA718A9F312FB65E52B0BAF8E41357D7F981B21F22F3279D656D409C45ABAD9D827EDB0D0888CDF68177AB4AFC91814640B3FC9A53502BAF163436E17B6A81F78183643668B767E89D396FFA8E8C93074BE51DC1AB533A4080A9ADC265FF04BF40D2696C24A28508D467AAB8A553521DC6D6B270E403CF988</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 7A 1F FF 53 21 A4 04 32 84 F5 F3 02
|
||||
0010 | 41 19 D9 50 AE CF 0E 9B D3 89 17 4E 9A E7 5D CB
|
||||
0020 | 0D 3C 7D C6 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | AA 82 DB BD 31 23 51 76 8B 5F 12 4A DF B0 26 52
|
||||
0040 | BE E2 FA F1 F8 FF C9 1A A6 B0 34 5E 29 88 72 14
|
||||
0050 | 0B F6 1E FE C9 CD 11 76 6E D9 1E F0 1F 34 40 35
|
||||
0060 | 59 4C 89 29 77 E4 72 38 10 70 EB C0 B7 C7 89 29
|
||||
0070 | 28 EA 19 1C 75 40 DE 70 A2 5A B8 92 67 87 C0 20
|
||||
0080 | 4D B5 02 26 9A 22 DF 61 B1 9C D1 06 CB D7 AF EB
|
||||
0090 | 48 CB 5D D7 97 A1 FF D2 BB E9 EA 1B F7 99 12 27
|
||||
00A0 | 92 F9 6B 5D 1F 10 E5 E7 DD 0A 5F 5C 8A A0 9A 3A
|
||||
00B0 | A5 6B 15 CC A0 F4 D3 CD BD 9F B4 AD D4 33 FC 63
|
||||
00C0 | 86 4D 14 13 11 72 AA BD 7F 78 35 D0 41 95 25 EC
|
||||
00D0 | 50 BB B8 49 F9 0E DD B0 A9 79 60 3B 7D D8 96 AE
|
||||
00E0 | B4 F5 D5 2F 4F DA 58 93 25 02 85 C2 CD FB 60 48
|
||||
00F0 | 0F 3D 09 BB D5 D3 2D B6 8A 56 5A AB AE 40 42 AA
|
||||
0100 | 10 17 3E F7 8D E1 44 58 97 28 2A D6 CE 3F 8C BF
|
||||
0110 | DF 8F 0D 7A 9F 95 EB 17 1B FC 8A 3A 00 9D AA 20
|
||||
0120 | FA E2 8E 5C 0C 16 5D 2E 43 05 DD 74 50 E1 9C A5</code></pre>
|
||||
<pre><code>0000 | 54 B6 43 66 8E 5F 16 4A 0C 6B 62 63 47 92 D9 A2
|
||||
0010 | 43 3E AC 5C FE 23 5C 20 EB 66 2B E4 8E D2 C1 3C
|
||||
0020 | 79 3D 50 9C 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | B2 AD 36 0A 45 78 9F 41 12 25 88 89 A9 71 5D 44
|
||||
0040 | 18 EE E7 C9 74 81 2D 2A 84 D5 AD 99 14 ED 70 EB
|
||||
0050 | 24 B1 5A 22 E4 AE 92 BC 94 DC BC 69 B7 CC C2 9E
|
||||
0060 | 42 DA 82 85 65 A5 E7 37 39 3E 57 22 78 B6 91 D6
|
||||
0070 | 34 64 AC F5 01 74 2F 23 2E 6A 51 B2 CC E5 F2 39
|
||||
0080 | DF 9D 2B 6D 79 B1 0D 6E 47 1A 0D 66 71 84 35 62
|
||||
0090 | 82 0B A2 31 CC 9D 9F AA E0 65 61 46 F3 A5 25 77
|
||||
00A0 | F7 A2 CC 93 E6 7A F5 4F 1B 3B F8 B8 6A 5D 51 E6
|
||||
00B0 | B0 20 67 16 49 67 5A 4C A7 18 A9 F3 12 FB 65 E5
|
||||
00C0 | 2B 0B AF 8E 41 35 7D 7F 98 1B 21 F2 2F 32 79 D6
|
||||
00D0 | 56 D4 09 C4 5A BA D9 D8 27 ED B0 D0 88 8C DF 68
|
||||
00E0 | 17 7A B4 AF C9 18 14 64 0B 3F C9 A5 35 02 BA F1
|
||||
00F0 | 63 43 6E 17 B6 A8 1F 78 18 36 43 66 8B 76 7E 89
|
||||
0100 | D3 96 FF A8 E8 C9 30 74 BE 51 DC 1A B5 33 A4 08
|
||||
0110 | 0A 9A DC 26 5F F0 4B F4 0D 26 96 C2 4A 28 50 8D
|
||||
0120 | 46 7A AB 8A 55 35 21 DC 6D 6B 27 0E 40 3C F9 88</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 = BA0D89B57A1FFF5321A4043284F5F3024119D950AECF0E9BD389174E9AE75DCB0D3C7DC
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>7A1FFF5321A4043284F5F3024119D950</code></td>
|
||||
<td><code>8E5F164A0C6B62634792D9A2433EAC5C</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>AECF0E9BD389174E9AE75DCB0D3C7DC6</code></td>
|
||||
<td><code>FE235C20EB662BE48ED2C13C793D509C</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>g_b</td>
|
||||
<td>36, 260</td>
|
||||
<td><code>FE000100AA82DBBD312351768B5F124A</code> <code>DFB02652BEE2FAF1F8FFC91AA6B0345E</code> <code>298872140BF61EFEC9CD11766ED91EF0</code> <code>1F344035594C892977E472381070EBC0</code> <code>B7C7892928EA191C7540DE70A25AB892</code> <code>6787C0204DB502269A22DF61B19CD106</code> <code>CBD7AFEB48CB5DD797A1FFD2BBE9EA1B</code> <code>F799122792F96B5D1F10E5E7DD0A5F5C</code> <code>8AA09A3AA56B15CCA0F4D3CDBD9FB4AD</code> <code>D433FC63864D14131172AABD7F7835D0</code> <code>419525EC50BBB849F90EDDB0A979603B</code> <code>7DD896AEB4F5D52F4FDA5893250285C2</code> <code>CDFB60480F3D09BBD5D32DB68A565AAB</code> <code>AE4042AA10173EF78DE1445897282AD6</code> <code>CE3F8CBFDF8F0D7A9F95EB171BFC8A3A</code> <code>009DAA20FAE28E5C0C165D2E4305DD74</code><br> <code>50E19CA5</code></td>
|
||||
<td><code>FE000100B2AD360A45789F4112258889</code> <code>A9715D4418EEE7C974812D2A84D5AD99</code> <code>14ED70EB24B15A22E4AE92BC94DCBC69</code> <code>B7CCC29E42DA828565A5E737393E5722</code> <code>78B691D63464ACF501742F232E6A51B2</code> <code>CCE5F239DF9D2B6D79B10D6E471A0D66</code> <code>71843562820BA231CC9D9FAAE0656146</code> <code>F3A52577F7A2CC93E67AF54F1B3BF8B8</code> <code>6A5D51E6B020671649675A4CA718A9F3</code> <code>12FB65E52B0BAF8E41357D7F981B21F2</code> <code>2F3279D656D409C45ABAD9D827EDB0D0</code> <code>888CDF68177AB4AFC91814640B3FC9A5</code> <code>3502BAF163436E17B6A81F7818364366</code> <code>8B767E89D396FFA8E8C93074BE51DC1A</code> <code>B533A4080A9ADC265FF04BF40D2696C2</code> <code>4A28508D467AAB8A553521DC6D6B270E</code><br> <code>403CF988</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 = BA0D89B57A1FFF5321A4043284F5F3024119D950AECF0E9BD389174E9AE75DCB0D3C7DC
|
|||
<!-- 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 = 54B643667A1FFF5321A4043284F5F3024119D950AECF0E9BD389174E9AE75DCB0D3C7DC60000000000000000FE000100AA82DBBD312351768B5F124ADFB02652BEE2FAF1F8FFC91AA6B0345E298872140BF61EFEC9CD11766ED91EF01F344035594C892977E472381070EBC0B7C7892928EA191C7540DE70A25AB8926787C0204DB502269A22DF61B19CD106CBD7AFEB48CB5DD797A1FFD2BBE9EA1BF799122792F96B5D1F10E5E7DD0A5F5C8AA09A3AA56B15CCA0F4D3CDBD9FB4ADD433FC63864D14131172AABD7F7835D0419525EC50BBB849F90EDDB0A979603B7DD896AEB4F5D52F4FDA5893250285C2CDFB60480F3D09BBD5D32DB68A565AABAE4042AA10173EF78DE1445897282AD6CE3F8CBFDF8F0D7A9F95EB171BFC8A3A009DAA20FAE28E5C0C165D2E4305DD7450E19CA5
|
||||
padding = 5BF0DB8A6C0EB02EAD86C9FD
|
||||
tmp_aes_key = 85AA00CFCCA8B6329A0C9D212D490203901D497207ADA2F2C1B6E79C73805245
|
||||
tmp_aes_iv = 42A87B37C91087D651A5B460CD41CEDAADCA9BF58C11BCCFD4C568256CA1C689</code></pre>
|
||||
<pre><code>data = 54B643668E5F164A0C6B62634792D9A2433EAC5CFE235C20EB662BE48ED2C13C793D509C0000000000000000FE000100B2AD360A45789F4112258889A9715D4418EEE7C974812D2A84D5AD9914ED70EB24B15A22E4AE92BC94DCBC69B7CCC29E42DA828565A5E737393E572278B691D63464ACF501742F232E6A51B2CCE5F239DF9D2B6D79B10D6E471A0D6671843562820BA231CC9D9FAAE0656146F3A52577F7A2CC93E67AF54F1B3BF8B86A5D51E6B020671649675A4CA718A9F312FB65E52B0BAF8E41357D7F981B21F22F3279D656D409C45ABAD9D827EDB0D0888CDF68177AB4AFC91814640B3FC9A53502BAF163436E17B6A81F78183643668B767E89D396FFA8E8C93074BE51DC1AB533A4080A9ADC265FF04BF40D2696C24A28508D467AAB8A553521DC6D6B270E403CF988
|
||||
padding = 0807464CD9FF2CD3EFEB67DE
|
||||
tmp_aes_key = ED0582A5A37DC51D44A48A3DB9BDE1BDA036E0883025EA375501EDB2CD8E19F0
|
||||
tmp_aes_iv = D5646AAAEABD85D919B9FABFB922A5F55031EECBF9A4E95A9F28C2DA246230E0</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 = E2E97CCBFC703FEB7A5C71C49B7649000C524EAA6DEBD9AE571B812FE10630D72AA1B5962057DEAD590AC00B0FF26851972BE0877D958E5245E6E091BDD648F2E06774BDECA6B32D6A75CF3C6A818245108EA00B1C54A537E1360A627515B9B4C66C2F653004DE0B00BB6A66D66F5A2A8784F1B4E15E9363CE3B711322F96EF48768899CFDC7D7DE0161A0C9BD98743AD2933871F030830B19AB065CCAB55D395415D7C7E34ADDA5D24A46B579434E95649925E67578134010F2C4B9952FC14BBDE42536DE735AA16C775AD6821BCB2624A20D9144E560ACB228E7ABB33AEFA254C6E0AEBDE86DE109B8CC92E484D0FD3922EC0E767ACF5AC5FD8F2A8C6825590BECD9A89580EDACCFF7BB4540D1EFD6F19C4C2432C7C8316F33CB180BE33E2B2E3DE65A4C2B02FAD0CE83D4894E283E2588C4B49AF451156B119AF45811F6FE8C26C0FB7B9D8B7FC811D78FEE70FA42</code></pre>
|
||||
<pre><code>encrypted_data = F884E111EAC9F52C28528E2FC28B3DF3599A8CF8337F2BFE2B85B3FB9D6F9E1AA70AD08F2BB3A7E6F670195F088B6E5ADCBD58BA8A560A974F3B083B20905F11D13BFF45A9DFACE5F79345363139C12F0A498D796D9B4E40E30EA9BAC8C0E3C2BCC717576D36EE5CBECFDBB9AD9C9B09003B65F02600B78268ED3A9EB5A5B70CDC97C87F1BD800F5A17762D55F19404621E1C8A0CB1E95828301ECDBC509472E0AB94DFDD80E060D660F3BF253FB3E8530267384123F01FBB090A2F56CB5D1EB40AE2D160805504C0B8C5F6DADA393F5E809E841AF42FE8EC4B1FE213AA6FAF27EFF98C7A9135A5CF9753ABBBBCE017B064A1AC29F82DDE8D8F8CD4296B6710DCA9812F643CE99EB55BC7EEA7F383903373B547938C07557CDE4D1307BB790781D0E3C0947282A2B13684D213A08818FA5DDA63C44F5BECA9687187DD9DC4FB19A91BE96CB946B9CDF5EFFE984415983</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 7C F4 09 00 EE 11 BD 64
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 7A 1F FF 53 21 A4 04 32
|
||||
0020 | 84 F5 F3 02 41 19 D9 50 AE CF 0E 9B D3 89 17 4E
|
||||
0030 | 9A E7 5D CB 0D 3C 7D C6 FE 50 01 00 E2 E9 7C CB
|
||||
0040 | FC 70 3F EB 7A 5C 71 C4 9B 76 49 00 0C 52 4E AA
|
||||
0050 | 6D EB D9 AE 57 1B 81 2F E1 06 30 D7 2A A1 B5 96
|
||||
0060 | 20 57 DE AD 59 0A C0 0B 0F F2 68 51 97 2B E0 87
|
||||
0070 | 7D 95 8E 52 45 E6 E0 91 BD D6 48 F2 E0 67 74 BD
|
||||
0080 | EC A6 B3 2D 6A 75 CF 3C 6A 81 82 45 10 8E A0 0B
|
||||
0090 | 1C 54 A5 37 E1 36 0A 62 75 15 B9 B4 C6 6C 2F 65
|
||||
00A0 | 30 04 DE 0B 00 BB 6A 66 D6 6F 5A 2A 87 84 F1 B4
|
||||
00B0 | E1 5E 93 63 CE 3B 71 13 22 F9 6E F4 87 68 89 9C
|
||||
00C0 | FD C7 D7 DE 01 61 A0 C9 BD 98 74 3A D2 93 38 71
|
||||
00D0 | F0 30 83 0B 19 AB 06 5C CA B5 5D 39 54 15 D7 C7
|
||||
00E0 | E3 4A DD A5 D2 4A 46 B5 79 43 4E 95 64 99 25 E6
|
||||
00F0 | 75 78 13 40 10 F2 C4 B9 95 2F C1 4B BD E4 25 36
|
||||
0100 | DE 73 5A A1 6C 77 5A D6 82 1B CB 26 24 A2 0D 91
|
||||
0110 | 44 E5 60 AC B2 28 E7 AB B3 3A EF A2 54 C6 E0 AE
|
||||
0120 | BD E8 6D E1 09 B8 CC 92 E4 84 D0 FD 39 22 EC 0E
|
||||
0130 | 76 7A CF 5A C5 FD 8F 2A 8C 68 25 59 0B EC D9 A8
|
||||
0140 | 95 80 ED AC CF F7 BB 45 40 D1 EF D6 F1 9C 4C 24
|
||||
0150 | 32 C7 C8 31 6F 33 CB 18 0B E3 3E 2B 2E 3D E6 5A
|
||||
0160 | 4C 2B 02 FA D0 CE 83 D4 89 4E 28 3E 25 88 C4 B4
|
||||
0170 | 9A F4 51 15 6B 11 9A F4 58 11 F6 FE 8C 26 C0 FB
|
||||
0180 | 7B 9D 8B 7F C8 11 D7 8F EE 70 FA 42</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 E4 51 02 00 2F 14 BD 64
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 8E 5F 16 4A 0C 6B 62 63
|
||||
0020 | 47 92 D9 A2 43 3E AC 5C FE 23 5C 20 EB 66 2B E4
|
||||
0030 | 8E D2 C1 3C 79 3D 50 9C FE 50 01 00 F8 84 E1 11
|
||||
0040 | EA C9 F5 2C 28 52 8E 2F C2 8B 3D F3 59 9A 8C F8
|
||||
0050 | 33 7F 2B FE 2B 85 B3 FB 9D 6F 9E 1A A7 0A D0 8F
|
||||
0060 | 2B B3 A7 E6 F6 70 19 5F 08 8B 6E 5A DC BD 58 BA
|
||||
0070 | 8A 56 0A 97 4F 3B 08 3B 20 90 5F 11 D1 3B FF 45
|
||||
0080 | A9 DF AC E5 F7 93 45 36 31 39 C1 2F 0A 49 8D 79
|
||||
0090 | 6D 9B 4E 40 E3 0E A9 BA C8 C0 E3 C2 BC C7 17 57
|
||||
00A0 | 6D 36 EE 5C BE CF DB B9 AD 9C 9B 09 00 3B 65 F0
|
||||
00B0 | 26 00 B7 82 68 ED 3A 9E B5 A5 B7 0C DC 97 C8 7F
|
||||
00C0 | 1B D8 00 F5 A1 77 62 D5 5F 19 40 46 21 E1 C8 A0
|
||||
00D0 | CB 1E 95 82 83 01 EC DB C5 09 47 2E 0A B9 4D FD
|
||||
00E0 | D8 0E 06 0D 66 0F 3B F2 53 FB 3E 85 30 26 73 84
|
||||
00F0 | 12 3F 01 FB B0 90 A2 F5 6C B5 D1 EB 40 AE 2D 16
|
||||
0100 | 08 05 50 4C 0B 8C 5F 6D AD A3 93 F5 E8 09 E8 41
|
||||
0110 | AF 42 FE 8E C4 B1 FE 21 3A A6 FA F2 7E FF 98 C7
|
||||
0120 | A9 13 5A 5C F9 75 3A BB BB CE 01 7B 06 4A 1A C2
|
||||
0130 | 9F 82 DD E8 D8 F8 CD 42 96 B6 71 0D CA 98 12 F6
|
||||
0140 | 43 CE 99 EB 55 BC 7E EA 7F 38 39 03 37 3B 54 79
|
||||
0150 | 38 C0 75 57 CD E4 D1 30 7B B7 90 78 1D 0E 3C 09
|
||||
0160 | 47 28 2A 2B 13 68 4D 21 3A 08 81 8F A5 DD A6 3C
|
||||
0170 | 44 F5 BE CA 96 87 18 7D D9 DC 4F B1 9A 91 BE 96
|
||||
0180 | CB 94 6B 9C DF 5E FF E9 84 41 59 83</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>7CF40900EE11BD64</code></td>
|
||||
<td><code>E45102002F14BD64</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>7A1FFF5321A4043284F5F3024119D950</code></td>
|
||||
<td><code>8E5F164A0C6B62634792D9A2433EAC5C</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>AECF0E9BD389174E9AE75DCB0D3C7DC6</code></td>
|
||||
<td><code>FE235C20EB662BE48ED2C13C793D509C</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>56, 340</td>
|
||||
<td><code>FE500100E2E97CCBFC703FEB7A5C71C4</code> <code>9B7649000C524EAA6DEBD9AE571B812F</code> <code>E10630D72AA1B5962057DEAD590AC00B</code> <code>0FF26851972BE0877D958E5245E6E091</code> <code>BDD648F2E06774BDECA6B32D6A75CF3C</code> <code>6A818245108EA00B1C54A537E1360A62</code> <code>7515B9B4C66C2F653004DE0B00BB6A66</code> <code>D66F5A2A8784F1B4E15E9363CE3B7113</code> <code>22F96EF48768899CFDC7D7DE0161A0C9</code> <code>BD98743AD2933871F030830B19AB065C</code> <code>CAB55D395415D7C7E34ADDA5D24A46B5</code> <code>79434E95649925E67578134010F2C4B9</code> <code>952FC14BBDE42536DE735AA16C775AD6</code> <code>821BCB2624A20D9144E560ACB228E7AB</code> <code>B33AEFA254C6E0AEBDE86DE109B8CC92</code> <code>E484D0FD3922EC0E767ACF5AC5FD8F2A</code> <code>8C6825590BECD9A89580EDACCFF7BB45</code> <code>40D1EFD6F19C4C2432C7C8316F33CB18</code> <code>0BE33E2B2E3DE65A4C2B02FAD0CE83D4</code> <code>894E283E2588C4B49AF451156B119AF4</code> <code>5811F6FE8C26C0FB7B9D8B7FC811D78F</code><br> <code>EE70FA42</code></td>
|
||||
<td><code>FE500100F884E111EAC9F52C28528E2F</code> <code>C28B3DF3599A8CF8337F2BFE2B85B3FB</code> <code>9D6F9E1AA70AD08F2BB3A7E6F670195F</code> <code>088B6E5ADCBD58BA8A560A974F3B083B</code> <code>20905F11D13BFF45A9DFACE5F7934536</code> <code>3139C12F0A498D796D9B4E40E30EA9BA</code> <code>C8C0E3C2BCC717576D36EE5CBECFDBB9</code> <code>AD9C9B09003B65F02600B78268ED3A9E</code> <code>B5A5B70CDC97C87F1BD800F5A17762D5</code> <code>5F19404621E1C8A0CB1E95828301ECDB</code> <code>C509472E0AB94DFDD80E060D660F3BF2</code> <code>53FB3E8530267384123F01FBB090A2F5</code> <code>6CB5D1EB40AE2D160805504C0B8C5F6D</code> <code>ADA393F5E809E841AF42FE8EC4B1FE21</code> <code>3AA6FAF27EFF98C7A9135A5CF9753ABB</code> <code>BBCE017B064A1AC29F82DDE8D8F8CD42</code> <code>96B6710DCA9812F643CE99EB55BC7EEA</code> <code>7F383903373B547938C07557CDE4D130</code> <code>7BB790781D0E3C0947282A2B13684D21</code> <code>3A08818FA5DDA63C44F5BECA9687187D</code> <code>D9DC4FB19A91BE96CB946B9CDF5EFFE9</code><br> <code>84415983</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 = 60C3EBE25C20992BC7E3AB95617D651DA3D04909117333817FE270070722B1D732F5BEEFCEDFA92E6B2E7619829B2DC6E843BED0E26EB0C21963A64F61B7C0E8BBBCA739634630C704CEF0DEB334EC3839E14B65AA525508151896944036827ED12E17F702B7BC6ECA0C16F8346C5824780ADF27C167C482EE15753FF6C6CAE89F278C394E33C983125CD61A64E2016442C3A4448DF3652189A9BBB24D0860620968BD8BFFC9A3096BBB25997DB160FC5FA57FD53FB72E4466C813AAEF820109AB7BB5E02821738471B9E1AD8E2B3985E1EA592AC3B35D9A0C90289D3149D944ADBB17C53DC758D5DF1C527F33E69DC45005FB8A04C2434E2CB30053C2C6A892</code></pre>
|
||||
<pre><code>auth_key = 6CD4B349BC834B131D48FFD16564728AC22339AB1CE3A24C7424A6E91534775FAB4758AB0E780E522FCDA9412917348F9B6A6F7FE6CE11A623DE9D124E76C03BAE2850BBEB0150D1DA953103361B1E9EC4B53864AF2D6B63F80D18C815D333CB6BD2E6B2620A56FC95334E1119D2808DC99D9E97AE7726B4926593E8EDE3E28E531690392A56FBFFC06D5D9A13AAF98A8DD78DF0EFA46C532DC688C52F34E3968C6F44BDF19AE934A34F6B506E292768BFC716FEFC117F8A1B6F069AF7BC249275142FD83301E27699764B0656669636CC054CF9B70A5154A3ED818DA7A6208DC35501248D7A23D519836A8E53DB8ADC481C603131C0D0B8C740D83D87B1C48C</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 18 26 55 EE 11 BD 64
|
||||
0010 | 34 00 00 00 34 F7 CB 3B 7A 1F FF 53 21 A4 04 32
|
||||
0020 | 84 F5 F3 02 41 19 D9 50 AE CF 0E 9B D3 89 17 4E
|
||||
0030 | 9A E7 5D CB 0D 3C 7D C6 BA 1A A4 97 1D 49 9B B8
|
||||
0040 | 57 5C 32 8B 33 9D 8E 0A</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 E4 FB C3 2F 14 BD 64
|
||||
0010 | A8 00 00 00 34 F7 CB 3B 8E 5F 16 4A 0C 6B 62 63
|
||||
0020 | 47 92 D9 A2 43 3E AC 5C FE 23 5C 20 EB 66 2B E4
|
||||
0030 | 8E D2 C1 3C 79 3D 50 9C AD CC 2D 0E 37 33 E7 FC
|
||||
0040 | EE 4D ED 0E 31 E6 84 A8</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>01182655EE11BD64</code></td>
|
||||
<td><code>01E4FBC32F14BD64</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>34000000</code> (52 in decimal)</td>
|
||||
<td><code>A8000000</code> (168 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>7A1FFF5321A4043284F5F3024119D950</code></td>
|
||||
<td><code>8E5F164A0C6B62634792D9A2433EAC5C</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>AECF0E9BD389174E9AE75DCB0D3C7DC6</code></td>
|
||||
<td><code>FE235C20EB662BE48ED2C13C793D509C</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce_hash1</td>
|
||||
<td>56, 16</td>
|
||||
<td><code>BA1AA4971D499BB8575C328B339D8E0A</code></td>
|
||||
<td><code>ADCC2D0E3733E7FCEE4DED0E31E684A8</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