|
|
|
@ -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 38 82 0A 00 39 41 A8 65
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 50 C9 33 C4 AD E5 B6 C3
|
|
|
|
|
0020 | B5 B5 5C 41 15 81 CB 21</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 18 89 06 00 62 49 A8 65
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE D9 31 E2 CD 8A 38 C2 63
|
|
|
|
|
0020 | 1B A0 BA C5 0B B1 24 D2</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>38820A003941A865</code></td>
|
|
|
|
|
<td><code>188906006249A865</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>50C933C4ADE5B6C3B5B55C411581CB21</code></td>
|
|
|
|
|
<td><code>D931E2CD8A38C2631BA0BAC50BB124D2</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 50 FA E1 39 41 A8 65
|
|
|
|
|
0010 | 5C 00 00 00 63 24 16 05 50 C9 33 C4 AD E5 B6 C3
|
|
|
|
|
0020 | B5 B5 5C 41 15 81 CB 21 FE CE EF E9 4A DA F6 67
|
|
|
|
|
0030 | EE 9B 81 67 AC 97 61 C8 08 19 98 AE D4 EB D1 8E
|
|
|
|
|
0040 | 23 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 B4 C3 8A 62 49 A8 65
|
|
|
|
|
0010 | 84 00 00 00 63 24 16 05 D9 31 E2 CD 8A 38 C2 63
|
|
|
|
|
0020 | 1B A0 BA C5 0B B1 24 D2 AD D3 FB 20 7B 9C 6D 78
|
|
|
|
|
0030 | 2E 45 E7 4C C4 68 64 E7 08 2A 6F 73 28 7C 4B 16
|
|
|
|
|
0040 | D5 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>0150FAE13941A865</code></td>
|
|
|
|
|
<td><code>01B4C38A6249A865</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>5C000000</code> (92 in decimal)</td>
|
|
|
|
|
<td><code>84000000</code> (132 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>50C933C4ADE5B6C3B5B55C411581CB21</code></td>
|
|
|
|
|
<td><code>D931E2CD8A38C2631BA0BAC50BB124D2</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>FECEEFE94ADAF667EE9B8167AC9761C8</code></td>
|
|
|
|
|
<td><code>ADD3FB207B9C6D782E45E74CC46864E7</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>081998AED4EBD18E23000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1844416276920897059</td>
|
|
|
|
|
<td><code>082A6F73287C4B16D5000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 3057789289729038037</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 = 1844416276920897059</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1844416276920897059 = 1173828283 * 1571282873</code></p>
|
|
|
|
|
<pre><code>p = 1173828283
|
|
|
|
|
q = 1571282873</code></pre>
|
|
|
|
|
<pre><code>pq = 3057789289729038037</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>3057789289729038037 = 1641849427 * 1862405431</code></p>
|
|
|
|
|
<pre><code>p = 1641849427
|
|
|
|
|
q = 1862405431</code></pre>
|
|
|
|
|
<!-- end pq -->
|
|
|
|
|
<h4><a class="anchor" href="#presenting-proof-of-work-server-authentication" id="presenting-proof-of-work-server-authentication" name="presenting-proof-of-work-server-authentication"><i class="anchor-icon"></i></a>Presenting proof of work; Server authentication</h4>
|
|
|
|
|
<h5><a class="anchor" href="#4-encrypted-data-payload-generation" id="4-encrypted-data-payload-generation" name="4-encrypted-data-payload-generation"><i class="anchor-icon"></i></a>4) <code>encrypted_data</code> payload generation</h5>
|
|
|
|
|
<p>First of all, generate an <code>encrypted_data</code> payload as follows:</p>
|
|
|
|
|
<!-- start p_q_inner_data_dc -->
|
|
|
|
|
<p>Generated payload (excluding transport headers/trailers):</p>
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 19 98 AE D4 EB D1 8E 23 00 00 00
|
|
|
|
|
0010 | 04 45 F7 32 BB 00 00 00 04 5D A7 DF B9 00 00 00
|
|
|
|
|
0020 | 50 C9 33 C4 AD E5 B6 C3 B5 B5 5C 41 15 81 CB 21
|
|
|
|
|
0030 | FE CE EF E9 4A DA F6 67 EE 9B 81 67 AC 97 61 C8
|
|
|
|
|
0040 | 81 3B 52 FD DC 32 6E D3 8C F0 23 8F 4E 61 F8 CD
|
|
|
|
|
0050 | 6A D5 42 4B 2A A6 C5 4F 86 77 88 7D 60 E2 B1 CA
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 2A 6F 73 28 7C 4B 16 D5 00 00 00
|
|
|
|
|
0010 | 04 61 DC A2 53 00 00 00 04 6F 02 0D 37 00 00 00
|
|
|
|
|
0020 | D9 31 E2 CD 8A 38 C2 63 1B A0 BA C5 0B B1 24 D2
|
|
|
|
|
0030 | AD D3 FB 20 7B 9C 6D 78 2E 45 E7 4C C4 68 64 E7
|
|
|
|
|
0040 | 1E 40 91 8F D3 14 D3 2C 3B 8B C5 67 4A 6F 33 68
|
|
|
|
|
0050 | 00 D1 A3 C7 17 5F 97 DD A7 F3 9C 44 8A E9 06 89
|
|
|
|
|
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 = 1571282873</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>081998AED4EBD18E23000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1844416276920897059</td>
|
|
|
|
|
<td><code>082A6F73287C4B16D5000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 3057789289729038037</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>0445F732BB000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1173828283</td>
|
|
|
|
|
<td><code>0461DCA253000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1641849427</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>045DA7DFB9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1571282873</td>
|
|
|
|
|
<td><code>046F020D37000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1862405431</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>50C933C4ADE5B6C3B5B55C411581CB21</code></td>
|
|
|
|
|
<td><code>D931E2CD8A38C2631BA0BAC50BB124D2</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>FECEEFE94ADAF667EE9B8167AC9761C8</code></td>
|
|
|
|
|
<td><code>ADD3FB207B9C6D782E45E74CC46864E7</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>813B52FDDC326ED38CF0238F4E61F8CD</code> <code>6AD5424B2AA6C54F8677887D60E2B1CA</code></td>
|
|
|
|
|
<td><code>1E40918FD314D32C3B8BC5674A6F3368</code> <code>00D1A3C7175F97DDA7F39C448AE90689</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1571282873</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 = 955FF5A9081998AED4EBD18E230000000445F732BB000000045DA7DFB900000050C933C4ADE5B6C3B5B55C411581CB21FECEEFE94ADAF667EE9B8167AC9761C8813B52FDDC326ED38CF0238F4E61F8CD6AD5424B2AA6C54F8677887D60E2B1CA02000000
|
|
|
|
|
random_padding_bytes = D41C27B55AC6C90986F05AA29498119E4924CB7AB29542F9CD5138F4B2F73F223852D71E9838F5ECDA53FE8955E97A4B8A53E6ED37EDCE837E68C48B8666C67D8B3E91A30E2F107D4792EF61B7CC792E5297FDA7B7C49F83C1DBA897</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A9082A6F73287C4B16D50000000461DCA253000000046F020D37000000D931E2CD8A38C2631BA0BAC50BB124D2ADD3FB207B9C6D782E45E74CC46864E71E40918FD314D32C3B8BC5674A6F336800D1A3C7175F97DDA7F39C448AE9068902000000
|
|
|
|
|
random_padding_bytes = 24503EAB5F8091B8BF416CFA4B3EB85F81698E119C2FDE782758FC5F34DFBB891448B9E98B7337DB093CD960CF12B181018937B320293A3D23BE2C6415B593FFF3D567F7F41B963B529961A3A7A8CCA741B0F51B705B82D36771DCD0</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 = 08089F6165330532285E349EC82A8C56B6B6B16FB17FA9EA72B5DDFC96F6E7C4B7DF7FB7F197DB819228CAB957D49AA5E7DAA4CAB4D0DDB1584958BA4C584269C24B752ED796CE59E9A496D1FA5D1756820468DD1430DFFD80CD86780F39A1DDBADD0685C221380B5CF56D4ED57F8DC868259FE5EC75F0204636DDA1F721875BF4788B9843200888C5536AF8954C18C6D6F54E34584A5AD152CA7C3C8A6BDF9E346C5546C7B1AE323BF8D598D8912EB776435F3E604D9511FA19EF75C33A509A328076AA98239510D00061FAC782C41577C330B303E4736A1B1D3E59F58A74EA3FEE697F02EFBFA7DA520A6FAC91F68883351C555F02A4744F5274982CDB9F29</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 09803EE06BE788DC986466A78F13E917BDBBBC63D1615CD41A2D4689F120B5D80381557F429EE83A9BF90818B0D4F3988FF7352DC59DECA6C3457672FBF176D652CD37319F5ACFF2EB79896676ADD5E3C10542CBDECAB1F4267F568BEE08919D27529F2A1A260FC84CB11BCCFD028531794B254DEB1CEC8E904E7FD573B749A429ECA4F84E2F06B29CCDD51F1BB14EF5A43A169FB9B18FC1FD9494C7062E74C731FAFC4DBB0830B29E7A80ACBBD2CDEA4567D545C6BCE2FF93AA4CA4F17A5ABFB3E4C93D3C18B026E8FD2D775A7D7D41C697C384004AB749346DBD856D2A7C86DD0D8B1066A872E0A4B2FA26D0F5CF4B2CCD7BAC25CE345F88BEF0007DC0DBBB</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 EC 53 03 00 3A 41 A8 65
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 50 C9 33 C4 AD E5 B6 C3
|
|
|
|
|
0020 | B5 B5 5C 41 15 81 CB 21 FE CE EF E9 4A DA F6 67
|
|
|
|
|
0030 | EE 9B 81 67 AC 97 61 C8 04 45 F7 32 BB 00 00 00
|
|
|
|
|
0040 | 04 5D A7 DF B9 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 08 08 9F 61 65 33 05 32 28 5E 34 9E
|
|
|
|
|
0060 | C8 2A 8C 56 B6 B6 B1 6F B1 7F A9 EA 72 B5 DD FC
|
|
|
|
|
0070 | 96 F6 E7 C4 B7 DF 7F B7 F1 97 DB 81 92 28 CA B9
|
|
|
|
|
0080 | 57 D4 9A A5 E7 DA A4 CA B4 D0 DD B1 58 49 58 BA
|
|
|
|
|
0090 | 4C 58 42 69 C2 4B 75 2E D7 96 CE 59 E9 A4 96 D1
|
|
|
|
|
00A0 | FA 5D 17 56 82 04 68 DD 14 30 DF FD 80 CD 86 78
|
|
|
|
|
00B0 | 0F 39 A1 DD BA DD 06 85 C2 21 38 0B 5C F5 6D 4E
|
|
|
|
|
00C0 | D5 7F 8D C8 68 25 9F E5 EC 75 F0 20 46 36 DD A1
|
|
|
|
|
00D0 | F7 21 87 5B F4 78 8B 98 43 20 08 88 C5 53 6A F8
|
|
|
|
|
00E0 | 95 4C 18 C6 D6 F5 4E 34 58 4A 5A D1 52 CA 7C 3C
|
|
|
|
|
00F0 | 8A 6B DF 9E 34 6C 55 46 C7 B1 AE 32 3B F8 D5 98
|
|
|
|
|
0100 | D8 91 2E B7 76 43 5F 3E 60 4D 95 11 FA 19 EF 75
|
|
|
|
|
0110 | C3 3A 50 9A 32 80 76 AA 98 23 95 10 D0 00 61 FA
|
|
|
|
|
0120 | C7 82 C4 15 77 C3 30 B3 03 E4 73 6A 1B 1D 3E 59
|
|
|
|
|
0130 | F5 8A 74 EA 3F EE 69 7F 02 EF BF A7 DA 52 0A 6F
|
|
|
|
|
0140 | AC 91 F6 88 83 35 1C 55 5F 02 A4 74 4F 52 74 98
|
|
|
|
|
0150 | 2C DB 9F 29</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 1C 89 06 00 62 49 A8 65
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 D9 31 E2 CD 8A 38 C2 63
|
|
|
|
|
0020 | 1B A0 BA C5 0B B1 24 D2 AD D3 FB 20 7B 9C 6D 78
|
|
|
|
|
0030 | 2E 45 E7 4C C4 68 64 E7 04 61 DC A2 53 00 00 00
|
|
|
|
|
0040 | 04 6F 02 0D 37 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 09 80 3E E0 6B E7 88 DC 98 64 66 A7
|
|
|
|
|
0060 | 8F 13 E9 17 BD BB BC 63 D1 61 5C D4 1A 2D 46 89
|
|
|
|
|
0070 | F1 20 B5 D8 03 81 55 7F 42 9E E8 3A 9B F9 08 18
|
|
|
|
|
0080 | B0 D4 F3 98 8F F7 35 2D C5 9D EC A6 C3 45 76 72
|
|
|
|
|
0090 | FB F1 76 D6 52 CD 37 31 9F 5A CF F2 EB 79 89 66
|
|
|
|
|
00A0 | 76 AD D5 E3 C1 05 42 CB DE CA B1 F4 26 7F 56 8B
|
|
|
|
|
00B0 | EE 08 91 9D 27 52 9F 2A 1A 26 0F C8 4C B1 1B CC
|
|
|
|
|
00C0 | FD 02 85 31 79 4B 25 4D EB 1C EC 8E 90 4E 7F D5
|
|
|
|
|
00D0 | 73 B7 49 A4 29 EC A4 F8 4E 2F 06 B2 9C CD D5 1F
|
|
|
|
|
00E0 | 1B B1 4E F5 A4 3A 16 9F B9 B1 8F C1 FD 94 94 C7
|
|
|
|
|
00F0 | 06 2E 74 C7 31 FA FC 4D BB 08 30 B2 9E 7A 80 AC
|
|
|
|
|
0100 | BB D2 CD EA 45 67 D5 45 C6 BC E2 FF 93 AA 4C A4
|
|
|
|
|
0110 | F1 7A 5A BF B3 E4 C9 3D 3C 18 B0 26 E8 FD 2D 77
|
|
|
|
|
0120 | 5A 7D 7D 41 C6 97 C3 84 00 4A B7 49 34 6D BD 85
|
|
|
|
|
0130 | 6D 2A 7C 86 DD 0D 8B 10 66 A8 72 E0 A4 B2 FA 26
|
|
|
|
|
0140 | D0 F5 CF 4B 2C CD 7B AC 25 CE 34 5F 88 BE F0 00
|
|
|
|
|
0150 | 7D C0 DB BB</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 = D41C27B55AC6C90986F05AA29498119E4924CB7AB29542F9CD5138F4B
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>EC5303003A41A865</code></td>
|
|
|
|
|
<td><code>1C8906006249A865</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 = D41C27B55AC6C90986F05AA29498119E4924CB7AB29542F9CD5138F4B
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>50C933C4ADE5B6C3B5B55C411581CB21</code></td>
|
|
|
|
|
<td><code>D931E2CD8A38C2631BA0BAC50BB124D2</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>FECEEFE94ADAF667EE9B8167AC9761C8</code></td>
|
|
|
|
|
<td><code>ADD3FB207B9C6D782E45E74CC46864E7</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>0445F732BB000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1173828283</td>
|
|
|
|
|
<td><code>0461DCA253000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1641849427</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>045DA7DFB9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1571282873</td>
|
|
|
|
|
<td><code>046F020D37000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1862405431</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 = D41C27B55AC6C90986F05AA29498119E4924CB7AB29542F9CD5138F4B
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE00010008089F6165330532285E349E</code> <code>C82A8C56B6B6B16FB17FA9EA72B5DDFC</code> <code>96F6E7C4B7DF7FB7F197DB819228CAB9</code> <code>57D49AA5E7DAA4CAB4D0DDB1584958BA</code> <code>4C584269C24B752ED796CE59E9A496D1</code> <code>FA5D1756820468DD1430DFFD80CD8678</code> <code>0F39A1DDBADD0685C221380B5CF56D4E</code> <code>D57F8DC868259FE5EC75F0204636DDA1</code> <code>F721875BF4788B9843200888C5536AF8</code> <code>954C18C6D6F54E34584A5AD152CA7C3C</code> <code>8A6BDF9E346C5546C7B1AE323BF8D598</code> <code>D8912EB776435F3E604D9511FA19EF75</code> <code>C33A509A328076AA98239510D00061FA</code> <code>C782C41577C330B303E4736A1B1D3E59</code> <code>F58A74EA3FEE697F02EFBFA7DA520A6F</code> <code>AC91F68883351C555F02A4744F527498</code><br> <code>2CDB9F29</code></td>
|
|
|
|
|
<td><code>FE00010009803EE06BE788DC986466A7</code> <code>8F13E917BDBBBC63D1615CD41A2D4689</code> <code>F120B5D80381557F429EE83A9BF90818</code> <code>B0D4F3988FF7352DC59DECA6C3457672</code> <code>FBF176D652CD37319F5ACFF2EB798966</code> <code>76ADD5E3C10542CBDECAB1F4267F568B</code> <code>EE08919D27529F2A1A260FC84CB11BCC</code> <code>FD028531794B254DEB1CEC8E904E7FD5</code> <code>73B749A429ECA4F84E2F06B29CCDD51F</code> <code>1BB14EF5A43A169FB9B18FC1FD9494C7</code> <code>062E74C731FAFC4DBB0830B29E7A80AC</code> <code>BBD2CDEA4567D545C6BCE2FF93AA4CA4</code> <code>F17A5ABFB3E4C93D3C18B026E8FD2D77</code> <code>5A7D7D41C697C384004AB749346DBD85</code> <code>6D2A7C86DD0D8B1066A872E0A4B2FA26</code> <code>D0F5CF4B2CCD7BAC25CE345F88BEF000</code><br> <code>7DC0DBBB</code></td>
|
|
|
|
|
<td>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = D41C27B55AC6C90986F05AA29498119E4924CB7AB29542F9CD5138F4B
|
|
|
|
|
<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 A0 DE 9B 3A 41 A8 65
|
|
|
|
|
0010 | 78 02 00 00 5C 07 E8 D0 50 C9 33 C4 AD E5 B6 C3
|
|
|
|
|
0020 | B5 B5 5C 41 15 81 CB 21 FE CE EF E9 4A DA F6 67
|
|
|
|
|
0030 | EE 9B 81 67 AC 97 61 C8 FE 50 02 00 5F 27 37 D5
|
|
|
|
|
0040 | 4E 1D E0 51 7F FB 50 46 D7 1F EE 25 B4 D7 9F 55
|
|
|
|
|
0050 | F8 81 1C A4 B6 78 17 0E A7 FA 33 30 9F 16 3B C8
|
|
|
|
|
0060 | B5 82 0C 50 43 0A 95 E2 49 64 EA 94 66 F3 91 8C
|
|
|
|
|
0070 | 63 BA 12 42 85 A4 9E F5 FB 3C CC 8C B3 84 42 31
|
|
|
|
|
0080 | 22 F7 41 54 D5 35 C8 29 69 3F F9 C0 5F D7 11 9B
|
|
|
|
|
0090 | BC C5 7E 05 AB 38 88 23 D0 25 9B 2A 68 CB 98 06
|
|
|
|
|
00A0 | EB 28 F1 51 F3 8E 1F 23 0E 4B 78 19 EA 0F 65 08
|
|
|
|
|
00B0 | E9 35 BD 29 16 8E FC 8E FB 01 A0 35 99 18 C2 51
|
|
|
|
|
00C0 | 14 92 5A C2 0B D8 FB 9C CE A9 1B D4 11 37 97 0C
|
|
|
|
|
00D0 | 64 95 7C FA 57 41 2C 74 63 B4 23 26 48 08 6B C7
|
|
|
|
|
00E0 | D8 AC BE 36 9C 70 F4 27 99 76 45 D3 9D F5 59 F8
|
|
|
|
|
00F0 | 66 9B FC 4D 33 FB A6 7B 93 04 7B BB 26 C4 DF F6
|
|
|
|
|
0100 | 08 9D AE A9 6E C4 76 A8 3D FC 76 71 79 FD 43 19
|
|
|
|
|
0110 | 4E C5 73 BE 10 35 07 63 82 AA A5 F0 DD 34 96 9E
|
|
|
|
|
0120 | 52 31 4D E7 51 35 8B 07 9E 54 8E BD 57 81 17 18
|
|
|
|
|
0130 | 90 A7 93 3E AA 1B 11 EE C1 26 77 0C 04 FC 69 EA
|
|
|
|
|
0140 | 5D 18 18 6F 43 AC C5 6B 94 BC E3 D7 FD 75 92 48
|
|
|
|
|
0150 | FA D1 2E 43 15 A2 EE AF 8C FF 12 71 4A 38 90 E8
|
|
|
|
|
0160 | 7E 40 D7 75 92 A8 7F D2 05 59 7D 06 9B 7A AE 90
|
|
|
|
|
0170 | 13 CC 6E 0E 0E 0B 04 FA 3A 80 F2 C4 0C 89 8C 1F
|
|
|
|
|
0180 | 5B E7 1A 19 B8 25 2D 70 98 8C 58 51 95 CA 7E 41
|
|
|
|
|
0190 | F9 80 66 C0 EB 36 CF AC B8 43 25 82 69 07 00 8B
|
|
|
|
|
01A0 | AC 0E 67 8E 2E 2B 1A 99 FC EC 47 D1 FC E6 0C D4
|
|
|
|
|
01B0 | 3F 97 7D 5A 98 B2 69 CA 70 D4 D1 C7 B9 56 FB DD
|
|
|
|
|
01C0 | A2 A6 B7 16 F6 28 26 0B C2 AF B1 A1 76 60 3C 66
|
|
|
|
|
01D0 | A1 F1 10 FC 91 4F 34 A0 05 53 E8 6C 79 67 83 E6
|
|
|
|
|
01E0 | 10 5D A6 E5 DE FE EE 1E D5 56 DB A9 75 1B 58 E6
|
|
|
|
|
01F0 | 11 E7 3D C8 2F 8F 78 30 CE 08 F1 43 40 62 FC 37
|
|
|
|
|
0200 | 6E 7B D4 5D 0F 21 8E BA D7 F5 09 00 FD F7 55 41
|
|
|
|
|
0210 | 45 80 94 00 F8 48 1A 01 9F DB F7 4C B1 72 EF BC
|
|
|
|
|
0220 | 79 A3 A4 B0 A8 16 74 23 F2 52 05 23 52 BB 00 DA
|
|
|
|
|
0230 | 1E D9 95 75 B1 9B A1 8C 1A 80 45 0D B3 4C 9D E5
|
|
|
|
|
0240 | 36 E0 35 22 F6 BD CA 4B 9F 89 9E 87 BE 02 62 25
|
|
|
|
|
0250 | 85 DE 27 ED 82 5D 4E 25 5B EC DA EF 9F 8F 10 93
|
|
|
|
|
0260 | 20 29 30 83 33 8B A2 37 AB 86 E4 F0 9D 03 DD 45
|
|
|
|
|
0270 | B8 F3 1F 0F E6 6B AD 92 36 E6 00 59 B0 BF 8C 38
|
|
|
|
|
0280 | 89 13 E9 A8 FA D3 0B 78 CB 97 43 43</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 3C 68 29 63 49 A8 65
|
|
|
|
|
0010 | A8 02 00 00 5C 07 E8 D0 D9 31 E2 CD 8A 38 C2 63
|
|
|
|
|
0020 | 1B A0 BA C5 0B B1 24 D2 AD D3 FB 20 7B 9C 6D 78
|
|
|
|
|
0030 | 2E 45 E7 4C C4 68 64 E7 FE 50 02 00 03 7B C1 F6
|
|
|
|
|
0040 | A9 B7 16 E7 AF 9A 55 D4 77 CF 5F 78 43 01 37 E2
|
|
|
|
|
0050 | 63 CA 90 8E 0F CB C2 4A D3 03 5D 7D 7E 41 83 F7
|
|
|
|
|
0060 | 49 EA F6 96 6D 67 84 EB A4 9E 27 24 7D 89 99 CF
|
|
|
|
|
0070 | C4 94 E8 F6 BA 9B DD FF 12 4F 1C 12 98 17 AF 50
|
|
|
|
|
0080 | BD B2 15 6D C2 CD C4 79 D3 D2 5A 8D FA AC 48 1B
|
|
|
|
|
0090 | ED A2 C8 05 9B 13 1F 34 50 96 9B AC 0B E3 5E 5E
|
|
|
|
|
00A0 | 4B 7F C5 62 7B 7B B6 C6 43 36 88 C0 0A 8D 92 C1
|
|
|
|
|
00B0 | FB 20 62 20 F5 C0 CF 07 AA A4 27 12 56 21 F4 53
|
|
|
|
|
00C0 | AC 73 61 D7 AC 97 29 45 A7 90 0E 73 60 43 51 5E
|
|
|
|
|
00D0 | 79 62 3D A4 E2 AF 6C 5F E6 CB A0 E9 D1 07 61 76
|
|
|
|
|
00E0 | 71 42 F9 70 29 D7 E5 E8 31 73 FB 02 2C 1F CC 7A
|
|
|
|
|
00F0 | 63 4A F5 A0 59 A5 44 39 66 4E 46 F9 C6 33 8F D0
|
|
|
|
|
0100 | 89 87 1C 45 80 6D EE 2C 3F FD 7F CE B3 71 E3 4C
|
|
|
|
|
0110 | 16 B1 27 DE C0 44 DA B8 5C 5E E4 21 EE 94 AC 12
|
|
|
|
|
0120 | 74 56 CE 98 CD B8 CC 16 59 B0 9D 6C F5 EB 15 C5
|
|
|
|
|
0130 | DE AB 9F 70 27 6C 05 5D 42 38 6E 43 F3 F7 3C B8
|
|
|
|
|
0140 | 41 E6 FB EC E5 63 8E 60 05 18 D6 4D F6 8E F8 78
|
|
|
|
|
0150 | D5 66 24 6F 33 63 88 48 9D 05 24 DC E2 08 1A D9
|
|
|
|
|
0160 | 65 23 7C 6F 7B 82 52 EB D4 FF D4 C1 2B 68 F6 06
|
|
|
|
|
0170 | 1F B4 CA 2A A6 3E 8D C3 A4 A1 05 9C 05 D9 19 B9
|
|
|
|
|
0180 | B0 4D 8F 11 70 F5 A7 99 29 80 BD 41 4E AF 17 B5
|
|
|
|
|
0190 | EC 86 FE 8C C8 DF DA 29 16 E4 A1 90 AF DE A2 0C
|
|
|
|
|
01A0 | A3 E7 49 BE 4C 24 E9 61 E2 F6 54 15 F8 1F A8 1B
|
|
|
|
|
01B0 | 9D 1E 1D 80 A6 A4 0E 57 53 68 9F 54 E2 DE F9 8C
|
|
|
|
|
01C0 | A7 CA BA 10 CE FD 0B 78 B3 68 11 03 8D 02 61 B9
|
|
|
|
|
01D0 | FA E6 CE 4A 1B 7E 9C C5 69 01 D6 4B C6 D9 1C C3
|
|
|
|
|
01E0 | A1 58 84 26 D4 44 9D CC C7 63 85 5A 14 49 03 DF
|
|
|
|
|
01F0 | 28 4A AB 04 7C 21 D1 F1 CA C7 A2 37 78 6F A1 18
|
|
|
|
|
0200 | B7 0F 11 89 3F 46 5F 82 2D FE C1 2D F6 6B 9A 2B
|
|
|
|
|
0210 | DE 02 06 3B AC D9 93 5B B4 4D 7F 9D 49 ED 90 2F
|
|
|
|
|
0220 | F0 51 B0 B0 C8 43 55 74 9A 10 BC E6 09 8C A1 BF
|
|
|
|
|
0230 | 18 72 60 64 9C BD 9A CC 97 B6 41 4A D6 93 5E 50
|
|
|
|
|
0240 | EF 48 BC 18 46 9E 8A C0 28 14 6F D6 AD 2B EF AE
|
|
|
|
|
0250 | DB 1A 86 FD 2A D2 BD 0D DE D0 5F D3 66 1F 5C 70
|
|
|
|
|
0260 | 19 DE E8 C4 57 4A C1 C1 E8 D4 95 06 55 C6 A2 7F
|
|
|
|
|
0270 | 51 D2 F8 58 D9 43 6B 0A D4 71 08 B2 70 7A F2 50
|
|
|
|
|
0280 | 34 49 A6 A5 00 4C B8 2E 4A 5C 8B 71</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 = D41C27B55AC6C90986F05AA29498119E4924CB7AB29542F9CD5138F4B
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>01A0DE9B3A41A865</code></td>
|
|
|
|
|
<td><code>013C68296349A865</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>78020000</code> (632 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 = D41C27B55AC6C90986F05AA29498119E4924CB7AB29542F9CD5138F4B
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>50C933C4ADE5B6C3B5B55C411581CB21</code></td>
|
|
|
|
|
<td><code>D931E2CD8A38C2631BA0BAC50BB124D2</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>FECEEFE94ADAF667EE9B8167AC9761C8</code></td>
|
|
|
|
|
<td><code>ADD3FB207B9C6D782E45E74CC46864E7</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE5002005F2737D54E1DE0517FFB5046</code> <code>D71FEE25B4D79F55F8811CA4B678170E</code> <code>A7FA33309F163BC8B5820C50430A95E2</code> <code>4964EA9466F3918C63BA124285A49EF5</code> <code>FB3CCC8CB384423122F74154D535C829</code> <code>693FF9C05FD7119BBCC57E05AB388823</code> <code>D0259B2A68CB9806EB28F151F38E1F23</code> <code>0E4B7819EA0F6508E935BD29168EFC8E</code> <code>FB01A0359918C25114925AC20BD8FB9C</code> <code>CEA91BD41137970C64957CFA57412C74</code> <code>63B4232648086BC7D8ACBE369C70F427</code> <code>997645D39DF559F8669BFC4D33FBA67B</code> <code>93047BBB26C4DFF6089DAEA96EC476A8</code> <code>3DFC767179FD43194EC573BE10350763</code> <code>82AAA5F0DD34969E52314DE751358B07</code> <code>9E548EBD5781171890A7933EAA1B11EE</code> <code>C126770C04FC69EA5D18186F43ACC56B</code> <code>94BCE3D7FD759248FAD12E4315A2EEAF</code> <code>8CFF12714A3890E87E40D77592A87FD2</code> <code>05597D069B7AAE9013CC6E0E0E0B04FA</code> <code>3A80F2C40C898C1F5BE71A19B8252D70</code> <code>988C585195CA7E41F98066C0EB36CFAC</code> <code>B84325826907008BAC0E678E2E2B1A99</code> <code>FCEC47D1FCE60CD43F977D5A98B269CA</code> <code>70D4D1C7B956FBDDA2A6B716F628260B</code> <code>C2AFB1A176603C66A1F110FC914F34A0</code> <code>0553E86C796783E6105DA6E5DEFEEE1E</code> <code>D556DBA9751B58E611E73DC82F8F7830</code> <code>CE08F1434062FC376E7BD45D0F218EBA</code> <code>D7F50900FDF7554145809400F8481A01</code> <code>9FDBF74CB172EFBC79A3A4B0A8167423</code> <code>F252052352BB00DA1ED99575B19BA18C</code> <code>1A80450DB34C9DE536E03522F6BDCA4B</code> <code>9F899E87BE02622585DE27ED825D4E25</code> <code>5BECDAEF9F8F109320293083338BA237</code> <code>AB86E4F09D03DD45B8F31F0FE66BAD92</code> <code>36E60059B0BF8C388913E9A8FAD30B78</code><br> <code>CB974343</code></td>
|
|
|
|
|
<td><code>FE500200037BC1F6A9B716E7AF9A55D4</code> <code>77CF5F78430137E263CA908E0FCBC24A</code> <code>D3035D7D7E4183F749EAF6966D6784EB</code> <code>A49E27247D8999CFC494E8F6BA9BDDFF</code> <code>124F1C129817AF50BDB2156DC2CDC479</code> <code>D3D25A8DFAAC481BEDA2C8059B131F34</code> <code>50969BAC0BE35E5E4B7FC5627B7BB6C6</code> <code>433688C00A8D92C1FB206220F5C0CF07</code> <code>AAA427125621F453AC7361D7AC972945</code> <code>A7900E736043515E79623DA4E2AF6C5F</code> <code>E6CBA0E9D10761767142F97029D7E5E8</code> <code>3173FB022C1FCC7A634AF5A059A54439</code> <code>664E46F9C6338FD089871C45806DEE2C</code> <code>3FFD7FCEB371E34C16B127DEC044DAB8</code> <code>5C5EE421EE94AC127456CE98CDB8CC16</code> <code>59B09D6CF5EB15C5DEAB9F70276C055D</code> <code>42386E43F3F73CB841E6FBECE5638E60</code> <code>0518D64DF68EF878D566246F33638848</code> <code>9D0524DCE2081AD965237C6F7B8252EB</code> <code>D4FFD4C12B68F6061FB4CA2AA63E8DC3</code> <code>A4A1059C05D919B9B04D8F1170F5A799</code> <code>2980BD414EAF17B5EC86FE8CC8DFDA29</code> <code>16E4A190AFDEA20CA3E749BE4C24E961</code> <code>E2F65415F81FA81B9D1E1D80A6A40E57</code> <code>53689F54E2DEF98CA7CABA10CEFD0B78</code> <code>B36811038D0261B9FAE6CE4A1B7E9CC5</code> <code>6901D64BC6D91CC3A1588426D4449DCC</code> <code>C763855A144903DF284AAB047C21D1F1</code> <code>CAC7A237786FA118B70F11893F465F82</code> <code>2DFEC12DF66B9A2BDE02063BACD9935B</code> <code>B44D7F9D49ED902FF051B0B0C8435574</code> <code>9A10BCE6098CA1BF187260649CBD9ACC</code> <code>97B6414AD6935E50EF48BC18469E8AC0</code> <code>28146FD6AD2BEFAEDB1A86FD2AD2BD0D</code> <code>DED05FD3661F5C7019DEE8C4574AC1C1</code> <code>E8D4950655C6A27F51D2F858D9436B0A</code> <code>D47108B2707AF2503449A6A5004CB82E</code><br> <code>4A5C8B71</code></td>
|
|
|
|
|
<td>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = D41C27B55AC6C90986F05AA29498119E4924CB7AB29542F9CD5138F4B
|
|
|
|
|
<!-- 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 = 5F2737D54E1DE0517FFB5046D71FEE25B4D79F55F8811CA4B678170EA7FA33309F163BC8B5820C50430A95E24964EA9466F3918C63BA124285A49EF5FB3CCC8CB384423122F74154D535C829693FF9C05FD7119BBCC57E05AB388823D0259B2A68CB9806EB28F151F38E1F230E4B7819EA0F6508E935BD29168EFC8EFB01A0359918C25114925AC20BD8FB9CCEA91BD41137970C64957CFA57412C7463B4232648086BC7D8ACBE369C70F427997645D39DF559F8669BFC4D33FBA67B93047BBB26C4DFF6089DAEA96EC476A83DFC767179FD43194EC573BE1035076382AAA5F0DD34969E52314DE751358B079E548EBD5781171890A7933EAA1B11EEC126770C04FC69EA5D18186F43ACC56B94BCE3D7FD759248FAD12E4315A2EEAF8CFF12714A3890E87E40D77592A87FD205597D069B7AAE9013CC6E0E0E0B04FA3A80F2C40C898C1F5BE71A19B8252D70988C585195CA7E41F98066C0EB36CFACB84325826907008BAC0E678E2E2B1A99FCEC47D1FCE60CD43F977D5A98B269CA70D4D1C7B956FBDDA2A6B716F628260BC2AFB1A176603C66A1F110FC914F34A00553E86C796783E6105DA6E5DEFEEE1ED556DBA9751B58E611E73DC82F8F7830CE08F1434062FC376E7BD45D0F218EBAD7F50900FDF7554145809400F8481A019FDBF74CB172EFBC79A3A4B0A8167423F252052352BB00DA1ED99575B19BA18C1A80450DB34C9DE536E03522F6BDCA4B9F899E87BE02622585DE27ED825D4E255BECDAEF9F8F109320293083338BA237AB86E4F09D03DD45B8F31F0FE66BAD9236E60059B0BF8C388913E9A8FAD30B78CB974343
|
|
|
|
|
tmp_aes_key = FCE0B35A21F44D030F77356DEDAB99EE7DFF47AC34ADB6424364127BEF70E0AA
|
|
|
|
|
tmp_aes_iv = 18017C774362086FD3D8059DE21E1F254713F049F8E13DA800D025FA813B52FD</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = 037BC1F6A9B716E7AF9A55D477CF5F78430137E263CA908E0FCBC24AD3035D7D7E4183F749EAF6966D6784EBA49E27247D8999CFC494E8F6BA9BDDFF124F1C129817AF50BDB2156DC2CDC479D3D25A8DFAAC481BEDA2C8059B131F3450969BAC0BE35E5E4B7FC5627B7BB6C6433688C00A8D92C1FB206220F5C0CF07AAA427125621F453AC7361D7AC972945A7900E736043515E79623DA4E2AF6C5FE6CBA0E9D10761767142F97029D7E5E83173FB022C1FCC7A634AF5A059A54439664E46F9C6338FD089871C45806DEE2C3FFD7FCEB371E34C16B127DEC044DAB85C5EE421EE94AC127456CE98CDB8CC1659B09D6CF5EB15C5DEAB9F70276C055D42386E43F3F73CB841E6FBECE5638E600518D64DF68EF878D566246F336388489D0524DCE2081AD965237C6F7B8252EBD4FFD4C12B68F6061FB4CA2AA63E8DC3A4A1059C05D919B9B04D8F1170F5A7992980BD414EAF17B5EC86FE8CC8DFDA2916E4A190AFDEA20CA3E749BE4C24E961E2F65415F81FA81B9D1E1D80A6A40E5753689F54E2DEF98CA7CABA10CEFD0B78B36811038D0261B9FAE6CE4A1B7E9CC56901D64BC6D91CC3A1588426D4449DCCC763855A144903DF284AAB047C21D1F1CAC7A237786FA118B70F11893F465F822DFEC12DF66B9A2BDE02063BACD9935BB44D7F9D49ED902FF051B0B0C84355749A10BCE6098CA1BF187260649CBD9ACC97B6414AD6935E50EF48BC18469E8AC028146FD6AD2BEFAEDB1A86FD2AD2BD0DDED05FD3661F5C7019DEE8C4574AC1C1E8D4950655C6A27F51D2F858D9436B0AD47108B2707AF2503449A6A5004CB82E4A5C8B71
|
|
|
|
|
tmp_aes_key = 873AEAC281F01185C530BB2596AA459908E09B522E3C379B7CD35A43375E9A1D
|
|
|
|
|
tmp_aes_iv = AB3A2342BE66E11F80C7443B553D3A04628F8264C0D282FE36F6C0031E40918F</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = 1F7C8A30D9E7041717B31FBAAC973CA6CD154752BA0D89B550C933C4ADE5B6C3B5B55C411581CB21FECEEFE94ADAF667EE9B8167AC9761C803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001009D7238956877A7B51C24895CB1BE674FCFCA14DD0F4DA09D6CF890BB5715D05949074C0B8611FE9A6C1A01D8FDF45215F783DD56B6D54F5020D8ECD08CE49055D21D47F6413D847243872661CF4CEB0A9E49F6DD15838F97227B7AE3F4D9552229BBB31893BF4A773E634EAB5D261E1CD04974B194F3700ECC41DA3A0C6C5955AB5D3E19DBA0AE358BFAE65BF01FF6FCB10C57919058A56B1E182D202C6CD7C0ED33542084B3E56DBCA32D1A0DA9830414D44DB9FDD66624C68C0E61FF1A3711498118918319F10EBD83B4AD518130643CA702EAF02E56BBA57427D00C339A3DCE30CCB4776AD01EF1448FD5ED36A5C212C88B03EC6276EA7DBBEE26C6C87BAA3A41A8655010F8139B52E4AE
|
|
|
|
|
answer = BA0D89B550C933C4ADE5B6C3B5B55C411581CB21FECEEFE94ADAF667EE9B8167AC9761C803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001009D7238956877A7B51C24895CB1BE674FCFCA14DD0F4DA09D6CF890BB5715D05949074C0B8611FE9A6C1A01D8FDF45215F783DD56B6D54F5020D8ECD08CE49055D21D47F6413D847243872661CF4CEB0A9E49F6DD15838F97227B7AE3F4D9552229BBB31893BF4A773E634EAB5D261E1CD04974B194F3700ECC41DA3A0C6C5955AB5D3E19DBA0AE358BFAE65BF01FF6FCB10C57919058A56B1E182D202C6CD7C0ED33542084B3E56DBCA32D1A0DA9830414D44DB9FDD66624C68C0E61FF1A3711498118918319F10EBD83B4AD518130643CA702EAF02E56BBA57427D00C339A3DCE30CCB4776AD01EF1448FD5ED36A5C212C88B03EC6276EA7DBBEE26C6C87BAA3A41A8655010F8139B52E4AE</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = 1CD7234C459FB90D4D6CF7C76BA4E0F326E01EDDBA0D89B5D931E2CD8A38C2631BA0BAC50BB124D2ADD3FB207B9C6D782E45E74CC46864E703000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010044A98C96013842CADC9FB9DEAB71BD4A004D695A3C1A59035903FBFC9AEECCC66D520D17374255211163C5BAC196E3327CD6AB3E89FA61B8CEE8672F2B9B5C1741FEB48CF3459C9BA92536028E2DD52CAF3786AA65E351050B1CD0469B8B2F1E3F71CA6138762DB238E57EABD14CE75FCEECADB493A458A23B7F91B71788003BD97D1B7F409C69857C63E31F7778F7156E85762FF876966699C51F2650C54DCD8C5108AA5C2891F4B8D19E5E66E91354AF1DD3F854208A99950920F6858D8058BD3470B3A5B4D3D0B2AB186E7CB0DEAE6ED923A8A9C5F4529A5D0F7F36C740FB0E37D1D26ED2EC7FE6B15489E4A1869BCDFA7DE1A2E6541894D6A18707CE7F856349A8657DE4F39D0953433D
|
|
|
|
|
answer = BA0D89B5D931E2CD8A38C2631BA0BAC50BB124D2ADD3FB207B9C6D782E45E74CC46864E703000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010044A98C96013842CADC9FB9DEAB71BD4A004D695A3C1A59035903FBFC9AEECCC66D520D17374255211163C5BAC196E3327CD6AB3E89FA61B8CEE8672F2B9B5C1741FEB48CF3459C9BA92536028E2DD52CAF3786AA65E351050B1CD0469B8B2F1E3F71CA6138762DB238E57EABD14CE75FCEECADB493A458A23B7F91B71788003BD97D1B7F409C69857C63E31F7778F7156E85762FF876966699C51F2650C54DCD8C5108AA5C2891F4B8D19E5E66E91354AF1DD3F854208A99950920F6858D8058BD3470B3A5B4D3D0B2AB186E7CB0DEAE6ED923A8A9C5F4529A5D0F7F36C740FB0E37D1D26ED2EC7FE6B15489E4A1869BCDFA7DE1A2E6541894D6A18707CE7F856349A8657DE4F39D0953433D</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 50 C9 33 C4 AD E5 B6 C3 B5 B5 5C 41
|
|
|
|
|
0010 | 15 81 CB 21 FE CE EF E9 4A DA F6 67 EE 9B 81 67
|
|
|
|
|
0020 | AC 97 61 C8 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 D9 31 E2 CD 8A 38 C2 63 1B A0 BA C5
|
|
|
|
|
0010 | 0B B1 24 D2 AD D3 FB 20 7B 9C 6D 78 2E 45 E7 4C
|
|
|
|
|
0020 | C4 68 64 E7 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 = BA0D89B550C933C4ADE5B6C3B5B55C411581CB21FECEEFE94ADAF667EE9B8167AC9761C
|
|
|
|
|
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 | 9D 72 38 95 68 77 A7 B5 1C 24 89 5C B1 BE 67 4F
|
|
|
|
|
0140 | CF CA 14 DD 0F 4D A0 9D 6C F8 90 BB 57 15 D0 59
|
|
|
|
|
0150 | 49 07 4C 0B 86 11 FE 9A 6C 1A 01 D8 FD F4 52 15
|
|
|
|
|
0160 | F7 83 DD 56 B6 D5 4F 50 20 D8 EC D0 8C E4 90 55
|
|
|
|
|
0170 | D2 1D 47 F6 41 3D 84 72 43 87 26 61 CF 4C EB 0A
|
|
|
|
|
0180 | 9E 49 F6 DD 15 83 8F 97 22 7B 7A E3 F4 D9 55 22
|
|
|
|
|
0190 | 29 BB B3 18 93 BF 4A 77 3E 63 4E AB 5D 26 1E 1C
|
|
|
|
|
01A0 | D0 49 74 B1 94 F3 70 0E CC 41 DA 3A 0C 6C 59 55
|
|
|
|
|
01B0 | AB 5D 3E 19 DB A0 AE 35 8B FA E6 5B F0 1F F6 FC
|
|
|
|
|
01C0 | B1 0C 57 91 90 58 A5 6B 1E 18 2D 20 2C 6C D7 C0
|
|
|
|
|
01D0 | ED 33 54 20 84 B3 E5 6D BC A3 2D 1A 0D A9 83 04
|
|
|
|
|
01E0 | 14 D4 4D B9 FD D6 66 24 C6 8C 0E 61 FF 1A 37 11
|
|
|
|
|
01F0 | 49 81 18 91 83 19 F1 0E BD 83 B4 AD 51 81 30 64
|
|
|
|
|
0200 | 3C A7 02 EA F0 2E 56 BB A5 74 27 D0 0C 33 9A 3D
|
|
|
|
|
0210 | CE 30 CC B4 77 6A D0 1E F1 44 8F D5 ED 36 A5 C2
|
|
|
|
|
0220 | 12 C8 8B 03 EC 62 76 EA 7D BB EE 26 C6 C8 7B AA
|
|
|
|
|
0230 | 3A 41 A8 65</code></pre>
|
|
|
|
|
0130 | 44 A9 8C 96 01 38 42 CA DC 9F B9 DE AB 71 BD 4A
|
|
|
|
|
0140 | 00 4D 69 5A 3C 1A 59 03 59 03 FB FC 9A EE CC C6
|
|
|
|
|
0150 | 6D 52 0D 17 37 42 55 21 11 63 C5 BA C1 96 E3 32
|
|
|
|
|
0160 | 7C D6 AB 3E 89 FA 61 B8 CE E8 67 2F 2B 9B 5C 17
|
|
|
|
|
0170 | 41 FE B4 8C F3 45 9C 9B A9 25 36 02 8E 2D D5 2C
|
|
|
|
|
0180 | AF 37 86 AA 65 E3 51 05 0B 1C D0 46 9B 8B 2F 1E
|
|
|
|
|
0190 | 3F 71 CA 61 38 76 2D B2 38 E5 7E AB D1 4C E7 5F
|
|
|
|
|
01A0 | CE EC AD B4 93 A4 58 A2 3B 7F 91 B7 17 88 00 3B
|
|
|
|
|
01B0 | D9 7D 1B 7F 40 9C 69 85 7C 63 E3 1F 77 78 F7 15
|
|
|
|
|
01C0 | 6E 85 76 2F F8 76 96 66 99 C5 1F 26 50 C5 4D CD
|
|
|
|
|
01D0 | 8C 51 08 AA 5C 28 91 F4 B8 D1 9E 5E 66 E9 13 54
|
|
|
|
|
01E0 | AF 1D D3 F8 54 20 8A 99 95 09 20 F6 85 8D 80 58
|
|
|
|
|
01F0 | BD 34 70 B3 A5 B4 D3 D0 B2 AB 18 6E 7C B0 DE AE
|
|
|
|
|
0200 | 6E D9 23 A8 A9 C5 F4 52 9A 5D 0F 7F 36 C7 40 FB
|
|
|
|
|
0210 | 0E 37 D1 D2 6E D2 EC 7F E6 B1 54 89 E4 A1 86 9B
|
|
|
|
|
0220 | CD FA 7D E1 A2 E6 54 18 94 D6 A1 87 07 CE 7F 85
|
|
|
|
|
0230 | 63 49 A8 65</code></pre>
|
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
|
<pre><code>server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;</code></pre>
|
|
|
|
|
<table class="table">
|
|
|
|
@ -570,13 +570,13 @@ answer = BA0D89B550C933C4ADE5B6C3B5B55C411581CB21FECEEFE94ADAF667EE9B8167AC9761C
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>50C933C4ADE5B6C3B5B55C411581CB21</code></td>
|
|
|
|
|
<td><code>D931E2CD8A38C2631BA0BAC50BB124D2</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>FECEEFE94ADAF667EE9B8167AC9761C8</code></td>
|
|
|
|
|
<td><code>ADD3FB207B9C6D782E45E74CC46864E7</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B550C933C4ADE5B6C3B5B55C411581CB21FECEEFE94ADAF667EE9B8167AC9761C
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE0001009D7238956877A7B51C24895C</code> <code>B1BE674FCFCA14DD0F4DA09D6CF890BB</code> <code>5715D05949074C0B8611FE9A6C1A01D8</code> <code>FDF45215F783DD56B6D54F5020D8ECD0</code> <code>8CE49055D21D47F6413D847243872661</code> <code>CF4CEB0A9E49F6DD15838F97227B7AE3</code> <code>F4D9552229BBB31893BF4A773E634EAB</code> <code>5D261E1CD04974B194F3700ECC41DA3A</code> <code>0C6C5955AB5D3E19DBA0AE358BFAE65B</code> <code>F01FF6FCB10C57919058A56B1E182D20</code> <code>2C6CD7C0ED33542084B3E56DBCA32D1A</code> <code>0DA9830414D44DB9FDD66624C68C0E61</code> <code>FF1A3711498118918319F10EBD83B4AD</code> <code>518130643CA702EAF02E56BBA57427D0</code> <code>0C339A3DCE30CCB4776AD01EF1448FD5</code> <code>ED36A5C212C88B03EC6276EA7DBBEE26</code><br> <code>C6C87BAA</code></td>
|
|
|
|
|
<td><code>FE00010044A98C96013842CADC9FB9DE</code> <code>AB71BD4A004D695A3C1A59035903FBFC</code> <code>9AEECCC66D520D17374255211163C5BA</code> <code>C196E3327CD6AB3E89FA61B8CEE8672F</code> <code>2B9B5C1741FEB48CF3459C9BA9253602</code> <code>8E2DD52CAF3786AA65E351050B1CD046</code> <code>9B8B2F1E3F71CA6138762DB238E57EAB</code> <code>D14CE75FCEECADB493A458A23B7F91B7</code> <code>1788003BD97D1B7F409C69857C63E31F</code> <code>7778F7156E85762FF876966699C51F26</code> <code>50C54DCD8C5108AA5C2891F4B8D19E5E</code> <code>66E91354AF1DD3F854208A99950920F6</code> <code>858D8058BD3470B3A5B4D3D0B2AB186E</code> <code>7CB0DEAE6ED923A8A9C5F4529A5D0F7F</code> <code>36C740FB0E37D1D26ED2EC7FE6B15489</code> <code>E4A1869BCDFA7DE1A2E6541894D6A187</code><br> <code>07CE7F85</code></td>
|
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>3A41A865</code> (1705525562 in decimal)</td>
|
|
|
|
|
<td><code>6349A865</code> (1705527651 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B550C933C4ADE5B6C3B5B55C411581CB21FECEEFE94ADAF667EE9B8167AC9761C
|
|
|
|
|
<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 = 8A3840F0DC6666A90077F545E9BFE309F1C291503FDA9DB9F7D9C3F3E2AC81A0C5E9AE776C12055DC5B35E5A689F441E52E30CDECF351B232BA788496AB82ED0AA74AC928DE21CC088AC573C55939082E5F2ED96330BAE75C2B131EFDCE08D45CD926A32C1AA2B86E5BD2D5A7085FA754ADAE942E3C0D6DC6A00CFCAD4E22FCC34473AF56D6723321DB9B7ED2EBDFA75C2332F60237FFAF98909C54108D484389BA5DAA35452E94F879833674F759FDBE4A2B382E6D139A9990ECDF2803601E2FAC13B395D7D6901D57E1E1905C48026A5C71AE13E957786339CC5E20DAB698A782F7C971F9842E60F5A727A3383DE454CA76E051F589577D6CEEC55A50E5368</code></pre>
|
|
|
|
|
<pre><code>b = FB94D8ED7FA8E1BAEB9891201DFDEA684BCA26534C00EB89677EA05019A585EFD899653C33888D4744F825BB5658C442A71CBF667999574756A06ECD977A57338138C50F9B6396CB12A8BD715D6E94B38E58D56FF8BF3FDA5BBA884DB1B4D4FFCA8F80C7A66A27DDECB3CDEF57D7FB5BAF56BB29EA193EB293DA0BCA224C5873EA4CED35079AB4145084D8CE16E49011012DA2B3036A1F06026826F73C70E49251FF6D3B6E6E52ACE73EC3234E85222B354D9D1A10DAAB7409763654BDF985D5DC552126713A655FA08EBF839991F6834A3CBBC8320431C526410699612792DBCBB395BC7B33BB898FD9F28A94202DA3CF81E2908B926844B3A34B05CEE382F3</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 = 59BC5E63BF9C753326C9D5E076C8E2B0C6C05FFD50A2E928C3E2946184D118693B7989DDE27C8D10CF6869CEFFF5AA1CE333DC057435B9B5B2A51BB655199423378918F4AF2F94E93551DAD3EE07A69ABE5D1BC56D29C2F12EE813AB915277CC97190D04B623708608DBB2E4C260765ABD91BC3835F7D658BA9F26CC7CEFEE3BA7E89CAFE79EC7048F93FC3B1DF4D625837F3BCA2F8F0527BA5E935F6B1B83B17F6FA5588CDD5E052CF2923B89E0C9E8705F990EEAE7804CBDCE10256B441D0E2FB42011D7690EAF935BB7442BE02D511E93C13B93C5C3AA02CF93D57DE26C1AE39C0B95E2B7D3758545F99C327DC6D871764F1CC76A3DFBC5768CE6ED21BB64</code></pre>
|
|
|
|
|
<pre><code>g_b = 5AFE83CCBACB2139ADD46F0E30D4C426488D86CFB5EED390D8AAECF6ECAB600F7FD25C0594069C158D4D2BCCE5C9B51F1DECC257B718CABB91242C981F8E2B33406A2CFF910BBE31C46698491B9295409162B3652CE927A4ABA2B95AE7129DF2E4C9F6F3846843AA2CFCD84C29AB5928DB5629B2DB3AA7556FF279AEDBBE5EDA6F3A46174A869DAFE6F2D9F53FCE489C409D3BF2BCDFB242E7DBA15F7AC9FA12B05CFA2442605016393330F27F991075898FB83963F8101C35932C387AA8377F06CAD5ECB57AB1C6883DB04D403BE1134198BB27104BFF62603377319F2DDFB25F5EE500B10B88BCB96920109233FFD9D7CE06B653D414BB99A9EAAA03D5CED8</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 50 C9 33 C4 AD E5 B6 C3 B5 B5 5C 41
|
|
|
|
|
0010 | 15 81 CB 21 FE CE EF E9 4A DA F6 67 EE 9B 81 67
|
|
|
|
|
0020 | AC 97 61 C8 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 59 BC 5E 63 BF 9C 75 33 26 C9 D5 E0 76 C8 E2 B0
|
|
|
|
|
0040 | C6 C0 5F FD 50 A2 E9 28 C3 E2 94 61 84 D1 18 69
|
|
|
|
|
0050 | 3B 79 89 DD E2 7C 8D 10 CF 68 69 CE FF F5 AA 1C
|
|
|
|
|
0060 | E3 33 DC 05 74 35 B9 B5 B2 A5 1B B6 55 19 94 23
|
|
|
|
|
0070 | 37 89 18 F4 AF 2F 94 E9 35 51 DA D3 EE 07 A6 9A
|
|
|
|
|
0080 | BE 5D 1B C5 6D 29 C2 F1 2E E8 13 AB 91 52 77 CC
|
|
|
|
|
0090 | 97 19 0D 04 B6 23 70 86 08 DB B2 E4 C2 60 76 5A
|
|
|
|
|
00A0 | BD 91 BC 38 35 F7 D6 58 BA 9F 26 CC 7C EF EE 3B
|
|
|
|
|
00B0 | A7 E8 9C AF E7 9E C7 04 8F 93 FC 3B 1D F4 D6 25
|
|
|
|
|
00C0 | 83 7F 3B CA 2F 8F 05 27 BA 5E 93 5F 6B 1B 83 B1
|
|
|
|
|
00D0 | 7F 6F A5 58 8C DD 5E 05 2C F2 92 3B 89 E0 C9 E8
|
|
|
|
|
00E0 | 70 5F 99 0E EA E7 80 4C BD CE 10 25 6B 44 1D 0E
|
|
|
|
|
00F0 | 2F B4 20 11 D7 69 0E AF 93 5B B7 44 2B E0 2D 51
|
|
|
|
|
0100 | 1E 93 C1 3B 93 C5 C3 AA 02 CF 93 D5 7D E2 6C 1A
|
|
|
|
|
0110 | E3 9C 0B 95 E2 B7 D3 75 85 45 F9 9C 32 7D C6 D8
|
|
|
|
|
0120 | 71 76 4F 1C C7 6A 3D FB C5 76 8C E6 ED 21 BB 64</code></pre>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 D9 31 E2 CD 8A 38 C2 63 1B A0 BA C5
|
|
|
|
|
0010 | 0B B1 24 D2 AD D3 FB 20 7B 9C 6D 78 2E 45 E7 4C
|
|
|
|
|
0020 | C4 68 64 E7 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 5A FE 83 CC BA CB 21 39 AD D4 6F 0E 30 D4 C4 26
|
|
|
|
|
0040 | 48 8D 86 CF B5 EE D3 90 D8 AA EC F6 EC AB 60 0F
|
|
|
|
|
0050 | 7F D2 5C 05 94 06 9C 15 8D 4D 2B CC E5 C9 B5 1F
|
|
|
|
|
0060 | 1D EC C2 57 B7 18 CA BB 91 24 2C 98 1F 8E 2B 33
|
|
|
|
|
0070 | 40 6A 2C FF 91 0B BE 31 C4 66 98 49 1B 92 95 40
|
|
|
|
|
0080 | 91 62 B3 65 2C E9 27 A4 AB A2 B9 5A E7 12 9D F2
|
|
|
|
|
0090 | E4 C9 F6 F3 84 68 43 AA 2C FC D8 4C 29 AB 59 28
|
|
|
|
|
00A0 | DB 56 29 B2 DB 3A A7 55 6F F2 79 AE DB BE 5E DA
|
|
|
|
|
00B0 | 6F 3A 46 17 4A 86 9D AF E6 F2 D9 F5 3F CE 48 9C
|
|
|
|
|
00C0 | 40 9D 3B F2 BC DF B2 42 E7 DB A1 5F 7A C9 FA 12
|
|
|
|
|
00D0 | B0 5C FA 24 42 60 50 16 39 33 30 F2 7F 99 10 75
|
|
|
|
|
00E0 | 89 8F B8 39 63 F8 10 1C 35 93 2C 38 7A A8 37 7F
|
|
|
|
|
00F0 | 06 CA D5 EC B5 7A B1 C6 88 3D B0 4D 40 3B E1 13
|
|
|
|
|
0100 | 41 98 BB 27 10 4B FF 62 60 33 77 31 9F 2D DF B2
|
|
|
|
|
0110 | 5F 5E E5 00 B1 0B 88 BC B9 69 20 10 92 33 FF D9
|
|
|
|
|
0120 | D7 CE 06 B6 53 D4 14 BB 99 A9 EA AA 03 D5 CE D8</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 = BA0D89B550C933C4ADE5B6C3B5B55C411581CB21FECEEFE94ADAF667EE9B8167AC9761C
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>50C933C4ADE5B6C3B5B55C411581CB21</code></td>
|
|
|
|
|
<td><code>D931E2CD8A38C2631BA0BAC50BB124D2</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>FECEEFE94ADAF667EE9B8167AC9761C8</code></td>
|
|
|
|
|
<td><code>ADD3FB207B9C6D782E45E74CC46864E7</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE00010059BC5E63BF9C753326C9D5E0</code> <code>76C8E2B0C6C05FFD50A2E928C3E29461</code> <code>84D118693B7989DDE27C8D10CF6869CE</code> <code>FFF5AA1CE333DC057435B9B5B2A51BB6</code> <code>55199423378918F4AF2F94E93551DAD3</code> <code>EE07A69ABE5D1BC56D29C2F12EE813AB</code> <code>915277CC97190D04B623708608DBB2E4</code> <code>C260765ABD91BC3835F7D658BA9F26CC</code> <code>7CEFEE3BA7E89CAFE79EC7048F93FC3B</code> <code>1DF4D625837F3BCA2F8F0527BA5E935F</code> <code>6B1B83B17F6FA5588CDD5E052CF2923B</code> <code>89E0C9E8705F990EEAE7804CBDCE1025</code> <code>6B441D0E2FB42011D7690EAF935BB744</code> <code>2BE02D511E93C13B93C5C3AA02CF93D5</code> <code>7DE26C1AE39C0B95E2B7D3758545F99C</code> <code>327DC6D871764F1CC76A3DFBC5768CE6</code><br> <code>ED21BB64</code></td>
|
|
|
|
|
<td><code>FE0001005AFE83CCBACB2139ADD46F0E</code> <code>30D4C426488D86CFB5EED390D8AAECF6</code> <code>ECAB600F7FD25C0594069C158D4D2BCC</code> <code>E5C9B51F1DECC257B718CABB91242C98</code> <code>1F8E2B33406A2CFF910BBE31C4669849</code> <code>1B9295409162B3652CE927A4ABA2B95A</code> <code>E7129DF2E4C9F6F3846843AA2CFCD84C</code> <code>29AB5928DB5629B2DB3AA7556FF279AE</code> <code>DBBE5EDA6F3A46174A869DAFE6F2D9F5</code> <code>3FCE489C409D3BF2BCDFB242E7DBA15F</code> <code>7AC9FA12B05CFA2442605016393330F2</code> <code>7F991075898FB83963F8101C35932C38</code> <code>7AA8377F06CAD5ECB57AB1C6883DB04D</code> <code>403BE1134198BB27104BFF6260337731</code> <code>9F2DDFB25F5EE500B10B88BCB9692010</code> <code>9233FFD9D7CE06B653D414BB99A9EAAA</code><br> <code>03D5CED8</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 = BA0D89B550C933C4ADE5B6C3B5B55C411581CB21FECEEFE94ADAF667EE9B8167AC9761C
|
|
|
|
|
<!-- 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 = 54B6436650C933C4ADE5B6C3B5B55C411581CB21FECEEFE94ADAF667EE9B8167AC9761C80000000000000000FE00010059BC5E63BF9C753326C9D5E076C8E2B0C6C05FFD50A2E928C3E2946184D118693B7989DDE27C8D10CF6869CEFFF5AA1CE333DC057435B9B5B2A51BB655199423378918F4AF2F94E93551DAD3EE07A69ABE5D1BC56D29C2F12EE813AB915277CC97190D04B623708608DBB2E4C260765ABD91BC3835F7D658BA9F26CC7CEFEE3BA7E89CAFE79EC7048F93FC3B1DF4D625837F3BCA2F8F0527BA5E935F6B1B83B17F6FA5588CDD5E052CF2923B89E0C9E8705F990EEAE7804CBDCE10256B441D0E2FB42011D7690EAF935BB7442BE02D511E93C13B93C5C3AA02CF93D57DE26C1AE39C0B95E2B7D3758545F99C327DC6D871764F1CC76A3DFBC5768CE6ED21BB64
|
|
|
|
|
padding = 6A867FA67771656D6C92FD59
|
|
|
|
|
tmp_aes_key = FCE0B35A21F44D030F77356DEDAB99EE7DFF47AC34ADB6424364127BEF70E0AA
|
|
|
|
|
tmp_aes_iv = 18017C774362086FD3D8059DE21E1F254713F049F8E13DA800D025FA813B52FD</code></pre>
|
|
|
|
|
<pre><code>data = 54B64366D931E2CD8A38C2631BA0BAC50BB124D2ADD3FB207B9C6D782E45E74CC46864E70000000000000000FE0001005AFE83CCBACB2139ADD46F0E30D4C426488D86CFB5EED390D8AAECF6ECAB600F7FD25C0594069C158D4D2BCCE5C9B51F1DECC257B718CABB91242C981F8E2B33406A2CFF910BBE31C46698491B9295409162B3652CE927A4ABA2B95AE7129DF2E4C9F6F3846843AA2CFCD84C29AB5928DB5629B2DB3AA7556FF279AEDBBE5EDA6F3A46174A869DAFE6F2D9F53FCE489C409D3BF2BCDFB242E7DBA15F7AC9FA12B05CFA2442605016393330F27F991075898FB83963F8101C35932C387AA8377F06CAD5ECB57AB1C6883DB04D403BE1134198BB27104BFF62603377319F2DDFB25F5EE500B10B88BCB96920109233FFD9D7CE06B653D414BB99A9EAAA03D5CED8
|
|
|
|
|
padding = 54D2BB588DD01761BBD25523
|
|
|
|
|
tmp_aes_key = 873AEAC281F01185C530BB2596AA459908E09B522E3C379B7CD35A43375E9A1D
|
|
|
|
|
tmp_aes_iv = AB3A2342BE66E11F80C7443B553D3A04628F8264C0D282FE36F6C0031E40918F</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 = FDDE3B612F5636DB66A70D975BD4FE92467E0AF40C3FDB9929A074686A0DFEB85F7FB17B7090C7995675BA0959DDF6A7786607BB783CD731B1C369DD6B1A3D6AE429A7BF6F312842CA91540E368913B40AFBA3F01A6068D62B53AB12832181DDD1F4E413679984FEA52C7F93B34009C7427D6BA4EFBB79538B046E38142DFEC6531F7B801C2C57D07B230C9FF279B7316B7918973C4E779705E9F92C5BCB5303C6D4E9472C554AA297C45CAB3E2F2DBBED740122EA46FB4FE300C84B9762C9CD0C506A6F7F0E30494405DFA9FD2A2F6B845C85FC2A25AACD42A88C2843BEDA0C995A0A36B68DBCF852498D4CC68FCBE220BACA68BC7358307D4E30FFED4503345593B299E4ACFAE15EC727E9EC4C9697BA25F352CCD6F1EFEE1B0A12D0F2DE4AF6653A35111AB8456CB3955470228D2C3FFB4646F1A0A7EF1DC21F5071B856F9CA55F75777734B7BBF1D21AF17535045</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 5C0479CAA1F2AEBA4586CE457147B6F6E0E82B76F48629CA40DE224ED1623F43C41F067CEB12A3A9DF4CCFEE9389D9B6F2797FE66B5CD0A20DA78CA52D6D32FD04040D9E98ACCAACD7BC6B393B6E744DFA7D6546ECBA819F8B6ECFCC1832103193780FAE82AB6E11F3F1706B21688D041AE90241873BABDFCEA9C2936DDECFC96D4216C945255D8CB4E172A63E2175B714E794EB92A0A084B8B0A9F3BBFF17D912706A1EDEF2D4BE2E512066AFA9ADE4CB0D530A0A8588A7E87E99010D6F8A85782876B7EE45C3A8C3DC8E601248BDF950CBEEA3C925BC37B47E1F3B40A7C3A91EC719846EF473C969520D8D962C3798FB562646AF1B35D97E572DB5CF8293E385A9450495FBCA19FEEDF9F029149B89C3BC62BEE540FFED18DEFF2D1F791E2B755234E8A6DE012FFC824A35F98522B73D6D9168F4397FB0A7B3303C1D81CD4BF2F2B53F5E9AA49BCC8E5AAEFDD65672</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 FE 0B 00 3A 41 A8 65
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 50 C9 33 C4 AD E5 B6 C3
|
|
|
|
|
0020 | B5 B5 5C 41 15 81 CB 21 FE CE EF E9 4A DA F6 67
|
|
|
|
|
0030 | EE 9B 81 67 AC 97 61 C8 FE 50 01 00 FD DE 3B 61
|
|
|
|
|
0040 | 2F 56 36 DB 66 A7 0D 97 5B D4 FE 92 46 7E 0A F4
|
|
|
|
|
0050 | 0C 3F DB 99 29 A0 74 68 6A 0D FE B8 5F 7F B1 7B
|
|
|
|
|
0060 | 70 90 C7 99 56 75 BA 09 59 DD F6 A7 78 66 07 BB
|
|
|
|
|
0070 | 78 3C D7 31 B1 C3 69 DD 6B 1A 3D 6A E4 29 A7 BF
|
|
|
|
|
0080 | 6F 31 28 42 CA 91 54 0E 36 89 13 B4 0A FB A3 F0
|
|
|
|
|
0090 | 1A 60 68 D6 2B 53 AB 12 83 21 81 DD D1 F4 E4 13
|
|
|
|
|
00A0 | 67 99 84 FE A5 2C 7F 93 B3 40 09 C7 42 7D 6B A4
|
|
|
|
|
00B0 | EF BB 79 53 8B 04 6E 38 14 2D FE C6 53 1F 7B 80
|
|
|
|
|
00C0 | 1C 2C 57 D0 7B 23 0C 9F F2 79 B7 31 6B 79 18 97
|
|
|
|
|
00D0 | 3C 4E 77 97 05 E9 F9 2C 5B CB 53 03 C6 D4 E9 47
|
|
|
|
|
00E0 | 2C 55 4A A2 97 C4 5C AB 3E 2F 2D BB ED 74 01 22
|
|
|
|
|
00F0 | EA 46 FB 4F E3 00 C8 4B 97 62 C9 CD 0C 50 6A 6F
|
|
|
|
|
0100 | 7F 0E 30 49 44 05 DF A9 FD 2A 2F 6B 84 5C 85 FC
|
|
|
|
|
0110 | 2A 25 AA CD 42 A8 8C 28 43 BE DA 0C 99 5A 0A 36
|
|
|
|
|
0120 | B6 8D BC F8 52 49 8D 4C C6 8F CB E2 20 BA CA 68
|
|
|
|
|
0130 | BC 73 58 30 7D 4E 30 FF ED 45 03 34 55 93 B2 99
|
|
|
|
|
0140 | E4 AC FA E1 5E C7 27 E9 EC 4C 96 97 BA 25 F3 52
|
|
|
|
|
0150 | CC D6 F1 EF EE 1B 0A 12 D0 F2 DE 4A F6 65 3A 35
|
|
|
|
|
0160 | 11 1A B8 45 6C B3 95 54 70 22 8D 2C 3F FB 46 46
|
|
|
|
|
0170 | F1 A0 A7 EF 1D C2 1F 50 71 B8 56 F9 CA 55 F7 57
|
|
|
|
|
0180 | 77 73 4B 7B BF 1D 21 AF 17 53 50 45</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 E8 37 0E 00 63 49 A8 65
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 D9 31 E2 CD 8A 38 C2 63
|
|
|
|
|
0020 | 1B A0 BA C5 0B B1 24 D2 AD D3 FB 20 7B 9C 6D 78
|
|
|
|
|
0030 | 2E 45 E7 4C C4 68 64 E7 FE 50 01 00 5C 04 79 CA
|
|
|
|
|
0040 | A1 F2 AE BA 45 86 CE 45 71 47 B6 F6 E0 E8 2B 76
|
|
|
|
|
0050 | F4 86 29 CA 40 DE 22 4E D1 62 3F 43 C4 1F 06 7C
|
|
|
|
|
0060 | EB 12 A3 A9 DF 4C CF EE 93 89 D9 B6 F2 79 7F E6
|
|
|
|
|
0070 | 6B 5C D0 A2 0D A7 8C A5 2D 6D 32 FD 04 04 0D 9E
|
|
|
|
|
0080 | 98 AC CA AC D7 BC 6B 39 3B 6E 74 4D FA 7D 65 46
|
|
|
|
|
0090 | EC BA 81 9F 8B 6E CF CC 18 32 10 31 93 78 0F AE
|
|
|
|
|
00A0 | 82 AB 6E 11 F3 F1 70 6B 21 68 8D 04 1A E9 02 41
|
|
|
|
|
00B0 | 87 3B AB DF CE A9 C2 93 6D DE CF C9 6D 42 16 C9
|
|
|
|
|
00C0 | 45 25 5D 8C B4 E1 72 A6 3E 21 75 B7 14 E7 94 EB
|
|
|
|
|
00D0 | 92 A0 A0 84 B8 B0 A9 F3 BB FF 17 D9 12 70 6A 1E
|
|
|
|
|
00E0 | DE F2 D4 BE 2E 51 20 66 AF A9 AD E4 CB 0D 53 0A
|
|
|
|
|
00F0 | 0A 85 88 A7 E8 7E 99 01 0D 6F 8A 85 78 28 76 B7
|
|
|
|
|
0100 | EE 45 C3 A8 C3 DC 8E 60 12 48 BD F9 50 CB EE A3
|
|
|
|
|
0110 | C9 25 BC 37 B4 7E 1F 3B 40 A7 C3 A9 1E C7 19 84
|
|
|
|
|
0120 | 6E F4 73 C9 69 52 0D 8D 96 2C 37 98 FB 56 26 46
|
|
|
|
|
0130 | AF 1B 35 D9 7E 57 2D B5 CF 82 93 E3 85 A9 45 04
|
|
|
|
|
0140 | 95 FB CA 19 FE ED F9 F0 29 14 9B 89 C3 BC 62 BE
|
|
|
|
|
0150 | E5 40 FF ED 18 DE FF 2D 1F 79 1E 2B 75 52 34 E8
|
|
|
|
|
0160 | A6 DE 01 2F FC 82 4A 35 F9 85 22 B7 3D 6D 91 68
|
|
|
|
|
0170 | F4 39 7F B0 A7 B3 30 3C 1D 81 CD 4B F2 F2 B5 3F
|
|
|
|
|
0180 | 5E 9A A4 9B CC 8E 5A AE FD D6 56 72</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>98FE0B003A41A865</code></td>
|
|
|
|
|
<td><code>E8370E006349A865</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>50C933C4ADE5B6C3B5B55C411581CB21</code></td>
|
|
|
|
|
<td><code>D931E2CD8A38C2631BA0BAC50BB124D2</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>FECEEFE94ADAF667EE9B8167AC9761C8</code></td>
|
|
|
|
|
<td><code>ADD3FB207B9C6D782E45E74CC46864E7</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE500100FDDE3B612F5636DB66A70D97</code> <code>5BD4FE92467E0AF40C3FDB9929A07468</code> <code>6A0DFEB85F7FB17B7090C7995675BA09</code> <code>59DDF6A7786607BB783CD731B1C369DD</code> <code>6B1A3D6AE429A7BF6F312842CA91540E</code> <code>368913B40AFBA3F01A6068D62B53AB12</code> <code>832181DDD1F4E413679984FEA52C7F93</code> <code>B34009C7427D6BA4EFBB79538B046E38</code> <code>142DFEC6531F7B801C2C57D07B230C9F</code> <code>F279B7316B7918973C4E779705E9F92C</code> <code>5BCB5303C6D4E9472C554AA297C45CAB</code> <code>3E2F2DBBED740122EA46FB4FE300C84B</code> <code>9762C9CD0C506A6F7F0E30494405DFA9</code> <code>FD2A2F6B845C85FC2A25AACD42A88C28</code> <code>43BEDA0C995A0A36B68DBCF852498D4C</code> <code>C68FCBE220BACA68BC7358307D4E30FF</code> <code>ED4503345593B299E4ACFAE15EC727E9</code> <code>EC4C9697BA25F352CCD6F1EFEE1B0A12</code> <code>D0F2DE4AF6653A35111AB8456CB39554</code> <code>70228D2C3FFB4646F1A0A7EF1DC21F50</code> <code>71B856F9CA55F75777734B7BBF1D21AF</code><br> <code>17535045</code></td>
|
|
|
|
|
<td><code>FE5001005C0479CAA1F2AEBA4586CE45</code> <code>7147B6F6E0E82B76F48629CA40DE224E</code> <code>D1623F43C41F067CEB12A3A9DF4CCFEE</code> <code>9389D9B6F2797FE66B5CD0A20DA78CA5</code> <code>2D6D32FD04040D9E98ACCAACD7BC6B39</code> <code>3B6E744DFA7D6546ECBA819F8B6ECFCC</code> <code>1832103193780FAE82AB6E11F3F1706B</code> <code>21688D041AE90241873BABDFCEA9C293</code> <code>6DDECFC96D4216C945255D8CB4E172A6</code> <code>3E2175B714E794EB92A0A084B8B0A9F3</code> <code>BBFF17D912706A1EDEF2D4BE2E512066</code> <code>AFA9ADE4CB0D530A0A8588A7E87E9901</code> <code>0D6F8A85782876B7EE45C3A8C3DC8E60</code> <code>1248BDF950CBEEA3C925BC37B47E1F3B</code> <code>40A7C3A91EC719846EF473C969520D8D</code> <code>962C3798FB562646AF1B35D97E572DB5</code> <code>CF8293E385A9450495FBCA19FEEDF9F0</code> <code>29149B89C3BC62BEE540FFED18DEFF2D</code> <code>1F791E2B755234E8A6DE012FFC824A35</code> <code>F98522B73D6D9168F4397FB0A7B3303C</code> <code>1D81CD4BF2F2B53F5E9AA49BCC8E5AAE</code><br> <code>FDD65672</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 = 4D26BD0566B8B667C5F700D2807B47C30EA5CA75C0AA3F669AF19A81C89993AEFBB9788FBAF6CC49C176E6BB39E8D55846F886A55ED6C500CC81DBAD5C36510FF20DC537CE9724780380EB55680C40054AA13815D52456C72667EDDCB0767FF2535A6225C787C07258C47358AD381B8ABC8F4AACE3BCD128C0017B14783B2ABFFBF01FDEF8E39B8EE57F9E5AD1EADA3A8D840E7B4841F250D0AD2B720A32EF7B2F451E725CDCDA6C42CCD36106A68F399CC3F293B0C19F08FC42D5AEE4002007EAC8A44A16463F64327A439F8831A83150C8742A0539AB3049904ECB7CA951FE9ED9252829829FF8721A2690E71DB00E60B777C03785796C2A8A3A7F2D37FAC8</code></pre>
|
|
|
|
|
<pre><code>auth_key = 7D2A13F3E72E119A0A89302E9FD40E357757E02E8C7FF0D4E6CA8153F28951C4A017C8237385221E629EDC35838CA2A284600907C60044056F64C144B5B6F07AEE1BB0C29D743FF2010E58E1E65D142AF4F86DC549200C39776D7663288BC1C16A52222767052424817AEB81AD2032B2B95F9CF8BE1532E950C09064328F5911AE5E781092CACD7993A4F987EC3B6E1D5B3A88B456B7FC0B6BD642222C0C42E712D7A9179F984F76CBF825459E0467298C9DBF781A7563955F404E0C8612D95FE852DC33A07EA4FEC73B128E6DCE8C18951C558AAFA1BBC890CE2D01C606505227FA71DA5EF1DB61FB8E31C602024284A6264C5CCDBD03DCE6B78AB130B37446</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 40 01 75 3B 41 A8 65
|
|
|
|
|
0010 | 9C 00 00 00 34 F7 CB 3B 50 C9 33 C4 AD E5 B6 C3
|
|
|
|
|
0020 | B5 B5 5C 41 15 81 CB 21 FE CE EF E9 4A DA F6 67
|
|
|
|
|
0030 | EE 9B 81 67 AC 97 61 C8 07 BC 70 E5 42 D1 25 6A
|
|
|
|
|
0040 | 17 46 A3 B4 99 70 F6 98</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 20 22 1D 64 49 A8 65
|
|
|
|
|
0010 | 9C 00 00 00 34 F7 CB 3B D9 31 E2 CD 8A 38 C2 63
|
|
|
|
|
0020 | 1B A0 BA C5 0B B1 24 D2 AD D3 FB 20 7B 9C 6D 78
|
|
|
|
|
0030 | 2E 45 E7 4C C4 68 64 E7 2D 23 7E 1C DF BB EA B0
|
|
|
|
|
0040 | DB E7 EA 77 58 44 CE 12</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,7 +817,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>014001753B41A865</code></td>
|
|
|
|
|
<td><code>0120221D6449A865</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>
|
|
|
|
@ -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>50C933C4ADE5B6C3B5B55C411581CB21</code></td>
|
|
|
|
|
<td><code>D931E2CD8A38C2631BA0BAC50BB124D2</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>FECEEFE94ADAF667EE9B8167AC9761C8</code></td>
|
|
|
|
|
<td><code>ADD3FB207B9C6D782E45E74CC46864E7</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>07BC70E542D1256A1746A3B49970F698</code></td>
|
|
|
|
|
<td><code>2D237E1CDFBBEAB0DBE7EA775844CE12</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>
|
|
|
|
|