|
|
|
@ -53,9 +53,9 @@
|
|
|
|
|
<h5><a class="anchor" href="#1-client-sends-query-to-server" id="1-client-sends-query-to-server" name="1-client-sends-query-to-server"><i class="anchor-icon"></i></a>1) Client sends query to server</h5>
|
|
|
|
|
<!-- start req_pq_multi -->
|
|
|
|
|
<p>Sent payload (excluding transport headers/trailers):</p>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 2C 9F 0E 00 DD F5 97 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 3C 1F 9C 91 82 5B 8A F9
|
|
|
|
|
0020 | CC B5 9F 7A A7 F7 5B 65</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 3C 76 0D 00 99 F8 97 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 14 48 2B 90 FA E8 E3 5C
|
|
|
|
|
0020 | E4 08 5A A7 53 2F 0F A8</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>2C9F0E00DDF59766</code></td>
|
|
|
|
|
<td><code>3C760D0099F89766</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>3C1F9C91825B8AF9CCB59F7AA7F75B65</code></td>
|
|
|
|
|
<td><code>14482B90FAE8E35CE4085AA7532F0FA8</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 2C 0C 9F DD F5 97 66
|
|
|
|
|
0010 | B8 00 00 00 63 24 16 05 3C 1F 9C 91 82 5B 8A F9
|
|
|
|
|
0020 | CC B5 9F 7A A7 F7 5B 65 C6 72 0A 3E AC A6 68 3F
|
|
|
|
|
0030 | 66 1D 8D 9C 0F 39 59 C6 08 20 53 B5 3C A8 5D EA
|
|
|
|
|
0040 | 71 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 44 4B DF 99 F8 97 66
|
|
|
|
|
0010 | A8 00 00 00 63 24 16 05 14 48 2B 90 FA E8 E3 5C
|
|
|
|
|
0020 | E4 08 5A A7 53 2F 0F A8 E8 BA 72 BA FB B7 A6 C5
|
|
|
|
|
0030 | DB 1D 85 74 D8 8F 6B 3A 08 1D 70 66 9E EC 19 9D
|
|
|
|
|
0040 | AD 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>012C0C9FDDF59766</code></td>
|
|
|
|
|
<td><code>01444BDF99F89766</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>B8000000</code> (184 in decimal)</td>
|
|
|
|
|
<td><code>A8000000</code> (168 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>3C1F9C91825B8AF9CCB59F7AA7F75B65</code></td>
|
|
|
|
|
<td><code>14482B90FAE8E35CE4085AA7532F0FA8</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>C6720A3EACA6683F661D8D9C0F3959C6</code></td>
|
|
|
|
|
<td><code>E8BA72BAFBB7A6C5DB1D8574D88F6B3A</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>082053B53CA85DEA71000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2329404704408070769</td>
|
|
|
|
|
<td><code>081D70669EEC199DAD000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2121308257243471277</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 = 2329404704408070769</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2329404704408070769 = 1230964717 * 1892340757</code></p>
|
|
|
|
|
<pre><code>p = 1230964717
|
|
|
|
|
q = 1892340757</code></pre>
|
|
|
|
|
<pre><code>pq = 2121308257243471277</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2121308257243471277 = 1377601429 * 1539856313</code></p>
|
|
|
|
|
<pre><code>p = 1377601429
|
|
|
|
|
q = 1539856313</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 20 53 B5 3C A8 5D EA 71 00 00 00
|
|
|
|
|
0010 | 04 49 5F 07 ED 00 00 00 04 70 CA D4 15 00 00 00
|
|
|
|
|
0020 | 3C 1F 9C 91 82 5B 8A F9 CC B5 9F 7A A7 F7 5B 65
|
|
|
|
|
0030 | C6 72 0A 3E AC A6 68 3F 66 1D 8D 9C 0F 39 59 C6
|
|
|
|
|
0040 | D8 2B 7C C7 FB A8 48 45 AA E4 4E D2 99 5F F8 22
|
|
|
|
|
0050 | 68 E1 48 8E DA B8 15 CD C4 7C F2 E1 C4 0E 1C 6A
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 1D 70 66 9E EC 19 9D AD 00 00 00
|
|
|
|
|
0010 | 04 52 1C 87 95 00 00 00 04 5B C8 57 B9 00 00 00
|
|
|
|
|
0020 | 14 48 2B 90 FA E8 E3 5C E4 08 5A A7 53 2F 0F A8
|
|
|
|
|
0030 | E8 BA 72 BA FB B7 A6 C5 DB 1D 85 74 D8 8F 6B 3A
|
|
|
|
|
0040 | F9 09 96 64 AE 22 08 63 52 25 1B B9 50 D4 97 14
|
|
|
|
|
0050 | 49 2D EB 71 D9 81 06 F4 BF 21 B1 A4 49 86 5D 28
|
|
|
|
|
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 = 1892340757</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>082053B53CA85DEA71000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2329404704408070769</td>
|
|
|
|
|
<td><code>081D70669EEC199DAD000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2121308257243471277</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>04495F07ED000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1230964717</td>
|
|
|
|
|
<td><code>04521C8795000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1377601429</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>0470CAD415000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1892340757</td>
|
|
|
|
|
<td><code>045BC857B9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1539856313</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>3C1F9C91825B8AF9CCB59F7AA7F75B65</code></td>
|
|
|
|
|
<td><code>14482B90FAE8E35CE4085AA7532F0FA8</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>C6720A3EACA6683F661D8D9C0F3959C6</code></td>
|
|
|
|
|
<td><code>E8BA72BAFBB7A6C5DB1D8574D88F6B3A</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>D82B7CC7FBA84845AAE44ED2995FF822</code> <code>68E1488EDAB815CDC47CF2E1C40E1C6A</code></td>
|
|
|
|
|
<td><code>F9099664AE22086352251BB950D49714</code> <code>492DEB71D98106F4BF21B1A449865D28</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1892340757</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 = 955FF5A9082053B53CA85DEA7100000004495F07ED0000000470CAD4150000003C1F9C91825B8AF9CCB59F7AA7F75B65C6720A3EACA6683F661D8D9C0F3959C6D82B7CC7FBA84845AAE44ED2995FF82268E1488EDAB815CDC47CF2E1C40E1C6A02000000
|
|
|
|
|
random_padding_bytes = 5896FE8F5CCE704BE31AF0159C33CFCCCF3B01E342DC3F9BA86DA1597E18ECE81C243BEDE9B9318CC4F5C86E745CB98C4124E20136E397D73A66298C2911D95C75D885F099C0A07BAE0CA3059FD6DDD6789F2E166DF612E26FF4BF1B</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A9081D70669EEC199DAD00000004521C8795000000045BC857B900000014482B90FAE8E35CE4085AA7532F0FA8E8BA72BAFBB7A6C5DB1D8574D88F6B3AF9099664AE22086352251BB950D49714492DEB71D98106F4BF21B1A449865D2802000000
|
|
|
|
|
random_padding_bytes = 7A881DD3A1A48086032513FB9E5E12D26EA2F2A1638117FABF0B10FF3C0AF8A3F54E5833BE879EA1DD7C77020707D1A8CA4AA49956107C8475B7B34901E29978191934994EF3ECC9CB05750945CF6111924260DA932052328617FD20</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 = 6BF19FA579AC5162BEC041F380C5972A3213ADDE2F922F32902E74F523368D70A56022AA83E7A7F1475F14A060C4EFDCB6D2AA35CE3F839D36A9F8DBC4F6C1F3CFD602AFD58128879F7E14F097C7CFA6F4CB56325395CC1168625EAFBFF7172FACFE6F42F2B97200BB38D25E7A9625149A9BECAF7B16CF7642D04FA527EFE9BB7DD9E8E7455BF311E85D3851297897AD034DDA505A7F5B05745A5047E3A1237856614EC99C8D588ECA8D920389CE5778C23B8210CCD7E9EFCA1A005EE63DC7FBE28360996E4A76A8A4E724248A92DD9785905AF1A849E2B8AD222FB61E2F8E0D9543C9EAB03079765A72A63C3205C095B289F2F96E9A3EE5F1829E84CF4A33D7</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 106D1395F405D025BFCD6B3CC73D7FC9D7C3B82AD5FFDF798172421059A949A512A74B4B885A8444B2AB9CB04AB50942045541C586C6F9509E651E2636729C8F4A060F81CD75574418B80D007E628E547698D2AAD2948C16C5EB2518FD2468A564663B9C521C811B2306D9009F63F6AA34F3E6B63130102702335C81ABCEC66AEAA317FCACB150A8D34B805204E26571ED2A4368DB061A2A2ACF5235CBE34C287331E2F0ACB2E007A6737098ECBC85C5C90B58E87EC0667EE69BBCE3658CE8B09F87575CD05A0C2E6DB57944112B438084006A06A4C24E59F31E13599867CFC4EDB06C0449A203D7E0D5BDF42E9C1D454F5C7067B18E8385822A1CE4DAFAE5C8</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 30 9F 0E 00 DD F5 97 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 3C 1F 9C 91 82 5B 8A F9
|
|
|
|
|
0020 | CC B5 9F 7A A7 F7 5B 65 C6 72 0A 3E AC A6 68 3F
|
|
|
|
|
0030 | 66 1D 8D 9C 0F 39 59 C6 04 49 5F 07 ED 00 00 00
|
|
|
|
|
0040 | 04 70 CA D4 15 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 6B F1 9F A5 79 AC 51 62 BE C0 41 F3
|
|
|
|
|
0060 | 80 C5 97 2A 32 13 AD DE 2F 92 2F 32 90 2E 74 F5
|
|
|
|
|
0070 | 23 36 8D 70 A5 60 22 AA 83 E7 A7 F1 47 5F 14 A0
|
|
|
|
|
0080 | 60 C4 EF DC B6 D2 AA 35 CE 3F 83 9D 36 A9 F8 DB
|
|
|
|
|
0090 | C4 F6 C1 F3 CF D6 02 AF D5 81 28 87 9F 7E 14 F0
|
|
|
|
|
00A0 | 97 C7 CF A6 F4 CB 56 32 53 95 CC 11 68 62 5E AF
|
|
|
|
|
00B0 | BF F7 17 2F AC FE 6F 42 F2 B9 72 00 BB 38 D2 5E
|
|
|
|
|
00C0 | 7A 96 25 14 9A 9B EC AF 7B 16 CF 76 42 D0 4F A5
|
|
|
|
|
00D0 | 27 EF E9 BB 7D D9 E8 E7 45 5B F3 11 E8 5D 38 51
|
|
|
|
|
00E0 | 29 78 97 AD 03 4D DA 50 5A 7F 5B 05 74 5A 50 47
|
|
|
|
|
00F0 | E3 A1 23 78 56 61 4E C9 9C 8D 58 8E CA 8D 92 03
|
|
|
|
|
0100 | 89 CE 57 78 C2 3B 82 10 CC D7 E9 EF CA 1A 00 5E
|
|
|
|
|
0110 | E6 3D C7 FB E2 83 60 99 6E 4A 76 A8 A4 E7 24 24
|
|
|
|
|
0120 | 8A 92 DD 97 85 90 5A F1 A8 49 E2 B8 AD 22 2F B6
|
|
|
|
|
0130 | 1E 2F 8E 0D 95 43 C9 EA B0 30 79 76 5A 72 A6 3C
|
|
|
|
|
0140 | 32 05 C0 95 B2 89 F2 F9 6E 9A 3E E5 F1 82 9E 84
|
|
|
|
|
0150 | CF 4A 33 D7</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 88 EA 0C 00 9A F8 97 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 14 48 2B 90 FA E8 E3 5C
|
|
|
|
|
0020 | E4 08 5A A7 53 2F 0F A8 E8 BA 72 BA FB B7 A6 C5
|
|
|
|
|
0030 | DB 1D 85 74 D8 8F 6B 3A 04 52 1C 87 95 00 00 00
|
|
|
|
|
0040 | 04 5B C8 57 B9 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 10 6D 13 95 F4 05 D0 25 BF CD 6B 3C
|
|
|
|
|
0060 | C7 3D 7F C9 D7 C3 B8 2A D5 FF DF 79 81 72 42 10
|
|
|
|
|
0070 | 59 A9 49 A5 12 A7 4B 4B 88 5A 84 44 B2 AB 9C B0
|
|
|
|
|
0080 | 4A B5 09 42 04 55 41 C5 86 C6 F9 50 9E 65 1E 26
|
|
|
|
|
0090 | 36 72 9C 8F 4A 06 0F 81 CD 75 57 44 18 B8 0D 00
|
|
|
|
|
00A0 | 7E 62 8E 54 76 98 D2 AA D2 94 8C 16 C5 EB 25 18
|
|
|
|
|
00B0 | FD 24 68 A5 64 66 3B 9C 52 1C 81 1B 23 06 D9 00
|
|
|
|
|
00C0 | 9F 63 F6 AA 34 F3 E6 B6 31 30 10 27 02 33 5C 81
|
|
|
|
|
00D0 | AB CE C6 6A EA A3 17 FC AC B1 50 A8 D3 4B 80 52
|
|
|
|
|
00E0 | 04 E2 65 71 ED 2A 43 68 DB 06 1A 2A 2A CF 52 35
|
|
|
|
|
00F0 | CB E3 4C 28 73 31 E2 F0 AC B2 E0 07 A6 73 70 98
|
|
|
|
|
0100 | EC BC 85 C5 C9 0B 58 E8 7E C0 66 7E E6 9B BC E3
|
|
|
|
|
0110 | 65 8C E8 B0 9F 87 57 5C D0 5A 0C 2E 6D B5 79 44
|
|
|
|
|
0120 | 11 2B 43 80 84 00 6A 06 A4 C2 4E 59 F3 1E 13 59
|
|
|
|
|
0130 | 98 67 CF C4 ED B0 6C 04 49 A2 03 D7 E0 D5 BD F4
|
|
|
|
|
0140 | 2E 9C 1D 45 4F 5C 70 67 B1 8E 83 85 82 2A 1C E4
|
|
|
|
|
0150 | DA FA E5 C8</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 = 5896FE8F5CCE704BE31AF0159C33CFCCCF3B01E342DC3F9BA86DA1597
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>309F0E00DDF59766</code></td>
|
|
|
|
|
<td><code>88EA0C009AF89766</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 = 5896FE8F5CCE704BE31AF0159C33CFCCCF3B01E342DC3F9BA86DA1597
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>3C1F9C91825B8AF9CCB59F7AA7F75B65</code></td>
|
|
|
|
|
<td><code>14482B90FAE8E35CE4085AA7532F0FA8</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>C6720A3EACA6683F661D8D9C0F3959C6</code></td>
|
|
|
|
|
<td><code>E8BA72BAFBB7A6C5DB1D8574D88F6B3A</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>04495F07ED000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1230964717</td>
|
|
|
|
|
<td><code>04521C8795000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1377601429</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>0470CAD415000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1892340757</td>
|
|
|
|
|
<td><code>045BC857B9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1539856313</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 = 5896FE8F5CCE704BE31AF0159C33CFCCCF3B01E342DC3F9BA86DA1597
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE0001006BF19FA579AC5162BEC041F3</code> <code>80C5972A3213ADDE2F922F32902E74F5</code> <code>23368D70A56022AA83E7A7F1475F14A0</code> <code>60C4EFDCB6D2AA35CE3F839D36A9F8DB</code> <code>C4F6C1F3CFD602AFD58128879F7E14F0</code> <code>97C7CFA6F4CB56325395CC1168625EAF</code> <code>BFF7172FACFE6F42F2B97200BB38D25E</code> <code>7A9625149A9BECAF7B16CF7642D04FA5</code> <code>27EFE9BB7DD9E8E7455BF311E85D3851</code> <code>297897AD034DDA505A7F5B05745A5047</code> <code>E3A1237856614EC99C8D588ECA8D9203</code> <code>89CE5778C23B8210CCD7E9EFCA1A005E</code> <code>E63DC7FBE28360996E4A76A8A4E72424</code> <code>8A92DD9785905AF1A849E2B8AD222FB6</code> <code>1E2F8E0D9543C9EAB03079765A72A63C</code> <code>3205C095B289F2F96E9A3EE5F1829E84</code><br> <code>CF4A33D7</code></td>
|
|
|
|
|
<td><code>FE000100106D1395F405D025BFCD6B3C</code> <code>C73D7FC9D7C3B82AD5FFDF7981724210</code> <code>59A949A512A74B4B885A8444B2AB9CB0</code> <code>4AB50942045541C586C6F9509E651E26</code> <code>36729C8F4A060F81CD75574418B80D00</code> <code>7E628E547698D2AAD2948C16C5EB2518</code> <code>FD2468A564663B9C521C811B2306D900</code> <code>9F63F6AA34F3E6B63130102702335C81</code> <code>ABCEC66AEAA317FCACB150A8D34B8052</code> <code>04E26571ED2A4368DB061A2A2ACF5235</code> <code>CBE34C287331E2F0ACB2E007A6737098</code> <code>ECBC85C5C90B58E87EC0667EE69BBCE3</code> <code>658CE8B09F87575CD05A0C2E6DB57944</code> <code>112B438084006A06A4C24E59F31E1359</code> <code>9867CFC4EDB06C0449A203D7E0D5BDF4</code> <code>2E9C1D454F5C7067B18E8385822A1CE4</code><br> <code>DAFAE5C8</code></td>
|
|
|
|
|
<td>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = 5896FE8F5CCE704BE31AF0159C33CFCCCF3B01E342DC3F9BA86DA1597
|
|
|
|
|
<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 84 20 7E DE F5 97 66
|
|
|
|
|
0010 | B4 02 00 00 5C 07 E8 D0 3C 1F 9C 91 82 5B 8A F9
|
|
|
|
|
0020 | CC B5 9F 7A A7 F7 5B 65 C6 72 0A 3E AC A6 68 3F
|
|
|
|
|
0030 | 66 1D 8D 9C 0F 39 59 C6 FE 50 02 00 DF 62 0E BF
|
|
|
|
|
0040 | 2D 29 4A 0B 94 0B 8B 8D 2F 6D 08 7C 1A 08 20 FB
|
|
|
|
|
0050 | FA 04 85 7E B3 31 F2 05 CC 10 4C 80 0A 5E FF 20
|
|
|
|
|
0060 | 5F 6A 69 5F 36 91 C6 AD C4 E9 30 42 A3 D9 09 5B
|
|
|
|
|
0070 | 74 37 83 4C 15 D2 84 1B 6C F5 52 AF B9 4B D3 59
|
|
|
|
|
0080 | C2 98 11 E7 07 27 0B 1B 99 DA BB C2 18 F8 11 54
|
|
|
|
|
0090 | 27 43 87 72 6F E8 0A F0 FA 61 A3 25 9B 54 B9 17
|
|
|
|
|
00A0 | 65 4B 83 92 33 3B CA 38 02 6D 46 CF 61 C9 60 9D
|
|
|
|
|
00B0 | 09 DC 0B 5F C1 B2 C2 F4 B8 DB E8 78 C4 7C 82 F2
|
|
|
|
|
00C0 | E8 93 54 FF 87 F4 C6 ED 37 27 24 2D 61 FE 54 B2
|
|
|
|
|
00D0 | 26 A4 B1 CE C6 6A 41 ED C7 7B AD 45 70 E9 D0 71
|
|
|
|
|
00E0 | 37 71 CE 49 A9 E2 EF 53 C9 35 1E 67 DB BE AD 31
|
|
|
|
|
00F0 | 5C CD F6 D3 74 01 A4 9A 0B 1B 99 FE 80 92 B5 C1
|
|
|
|
|
0100 | E5 2E 3A BD 25 03 C0 A5 26 EC D4 55 28 88 79 0D
|
|
|
|
|
0110 | 5B 35 C7 96 F3 16 5C 5D 1E 33 DB 55 E3 BC 15 C4
|
|
|
|
|
0120 | 21 BE C9 E3 53 2D 1E 3E 57 1F F6 E4 CC 7C DF 18
|
|
|
|
|
0130 | 3F AA 9C AA E0 A6 06 49 E8 F6 EF F7 9B A7 95 3D
|
|
|
|
|
0140 | 56 55 9E CA E7 6F 34 93 84 D7 8D 98 3D F8 C8 3B
|
|
|
|
|
0150 | 16 A7 F5 DB 45 8E 7C 0D 25 77 D1 7A 5E F1 40 85
|
|
|
|
|
0160 | EC 4D 7A 63 D8 B4 DD E3 8A 82 97 71 57 A6 C1 7D
|
|
|
|
|
0170 | 84 B0 60 21 0D 46 F9 60 EE F5 45 0D 98 96 38 F9
|
|
|
|
|
0180 | CE BB 6F AD 76 70 1D 6B ED DE 0A ED 2B 3D 31 7F
|
|
|
|
|
0190 | 99 96 94 D9 D9 B3 CE E6 14 CE 88 57 7B 1A DD 15
|
|
|
|
|
01A0 | E4 C3 BB AF 17 F2 E5 D2 66 B5 96 F3 1A 5F 37 C6
|
|
|
|
|
01B0 | 72 00 7A 10 BA 6C 5C 66 4D A9 F1 40 7B 46 68 51
|
|
|
|
|
01C0 | 61 1A 2E 4C 6F 64 9F 42 9D 7C 5E 81 93 15 CB 65
|
|
|
|
|
01D0 | A1 01 BE 3A 86 29 F3 B8 A4 1F DA 21 F6 38 D0 C2
|
|
|
|
|
01E0 | 2D 76 27 10 89 ED F0 D8 D8 9D 99 E3 50 D3 15 E5
|
|
|
|
|
01F0 | 84 23 F4 DE 61 E6 65 73 B1 06 B2 5B 4F 7B 29 AD
|
|
|
|
|
0200 | 11 C2 32 C8 38 DB B9 84 2A 38 F6 42 A3 2B E9 89
|
|
|
|
|
0210 | 41 83 0A B4 B9 EF D2 A5 4B A6 A0 71 40 69 58 83
|
|
|
|
|
0220 | 32 EA 22 B7 D3 81 6A F0 A2 4E 9A 8C 85 C2 7B 26
|
|
|
|
|
0230 | 4B 1B 8E F7 FE 88 E9 C9 12 41 49 55 BA 32 10 B9
|
|
|
|
|
0240 | CB 80 94 73 E9 78 E9 40 2A CA 53 FD 22 54 87 15
|
|
|
|
|
0250 | 71 25 09 9F DD CE 43 11 2C 1F B6 DE 52 03 3F E9
|
|
|
|
|
0260 | A7 06 F9 22 A3 AE A3 28 A1 99 BC 39 38 85 9E 5B
|
|
|
|
|
0270 | BE CB C6 D1 E6 74 FC 96 F5 FA DC 98 09 A3 D9 BD
|
|
|
|
|
0280 | 61 43 5A 7E 50 14 C5 44 8C EE EE 31</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 BC 30 94 9A F8 97 66
|
|
|
|
|
0010 | 94 02 00 00 5C 07 E8 D0 14 48 2B 90 FA E8 E3 5C
|
|
|
|
|
0020 | E4 08 5A A7 53 2F 0F A8 E8 BA 72 BA FB B7 A6 C5
|
|
|
|
|
0030 | DB 1D 85 74 D8 8F 6B 3A FE 50 02 00 AE DB 97 24
|
|
|
|
|
0040 | 1B DC 01 25 FC 04 D1 40 57 AB 83 7A EB 0F BA 29
|
|
|
|
|
0050 | 58 38 23 CC 3C AE 7B 94 6A 7C 48 74 CF 44 5A EB
|
|
|
|
|
0060 | 64 3D F6 B8 18 86 13 39 20 57 E8 3C FC FC 49 94
|
|
|
|
|
0070 | 62 B8 99 EF 03 05 46 FE B9 B8 DA 2B C4 83 28 E6
|
|
|
|
|
0080 | 08 13 35 D4 CC 0E D3 79 E6 C6 B2 D4 21 2F 69 EE
|
|
|
|
|
0090 | 94 3C 54 CD 7F E9 0A 02 63 55 C5 4B 42 1D F3 DC
|
|
|
|
|
00A0 | DD 83 C1 2F 97 CD AF 8D 61 3D 5E 03 34 52 BC 52
|
|
|
|
|
00B0 | 55 3C C1 0C C3 95 D9 25 A0 FA FB 6D BC 14 63 A2
|
|
|
|
|
00C0 | 31 81 F4 A9 9D D3 C9 D4 C7 17 2D 3E 29 48 B0 02
|
|
|
|
|
00D0 | CC DC 40 2C 8A BE AE AC 4C ED 04 5F DF 2C 48 46
|
|
|
|
|
00E0 | 67 E5 B4 AF BF A9 01 9A 12 2A 07 AC FE 72 41 5A
|
|
|
|
|
00F0 | 5C C7 1C 4D DF CB D4 62 04 D6 E3 96 4D 8F BA 67
|
|
|
|
|
0100 | B5 73 2D B1 58 60 11 E6 C1 4B 49 D2 E9 CC AB B1
|
|
|
|
|
0110 | 5D 2B 98 DE A5 81 4A 71 EF 76 5B 40 43 BA 03 0C
|
|
|
|
|
0120 | 48 B4 BF 67 C5 34 7C 1F 32 0C 19 98 57 90 56 00
|
|
|
|
|
0130 | EA 19 39 F8 52 55 5A A5 C6 FF 01 FC 7A BC B2 4F
|
|
|
|
|
0140 | CA 38 BD 53 AC 3C 91 8F 19 0B 48 3E B6 3C 31 4A
|
|
|
|
|
0150 | 17 BB 4B D7 D5 41 F7 62 F5 6F D6 14 E6 BB 54 66
|
|
|
|
|
0160 | 5F B2 3F F1 10 81 75 B3 A0 E3 F1 2C A3 39 10 44
|
|
|
|
|
0170 | 44 33 99 D3 AA FF 21 E8 C0 CD 1C C1 85 6D 94 E8
|
|
|
|
|
0180 | 25 3D 2E B0 F9 17 B2 30 F3 B2 24 34 DD D2 9C 6B
|
|
|
|
|
0190 | 1B 24 D5 34 10 97 C5 2D 10 D0 5D 4B F6 ED 78 00
|
|
|
|
|
01A0 | 93 24 CF E8 9F A3 DB 95 72 9C 57 2B 9C 49 76 FF
|
|
|
|
|
01B0 | 11 A3 96 94 26 46 C8 63 79 83 D2 07 CF DB B8 43
|
|
|
|
|
01C0 | 81 B9 14 E7 E9 32 36 01 C4 6B 32 22 C0 2A B4 24
|
|
|
|
|
01D0 | 7B 0A 65 5E CB 7E F7 57 D7 27 0A DB AF D0 4E BE
|
|
|
|
|
01E0 | D9 4F 60 15 14 30 6D BF 41 D1 6E CA BD 5C 5D 33
|
|
|
|
|
01F0 | 1D 78 04 27 3E DB 0B 8E 55 B5 98 18 AF BB AD 04
|
|
|
|
|
0200 | 0D C6 A8 D4 3B CB 8F 2D 23 70 2B 31 6A 39 21 40
|
|
|
|
|
0210 | 54 CB 48 DE 92 04 74 71 A5 20 44 75 8C 3F 51 6D
|
|
|
|
|
0220 | 71 22 40 6A 3B 2D 17 17 57 E9 B7 1E 2B 8E 5E 27
|
|
|
|
|
0230 | 34 AB 80 BD A0 ED 20 CE 63 D4 6C DB 3D 44 2C 8B
|
|
|
|
|
0240 | B3 56 28 28 25 27 9E E4 37 2C F5 67 21 28 86 99
|
|
|
|
|
0250 | 06 C1 CF DC C3 AA A8 38 D7 33 61 79 B3 7A 3A 43
|
|
|
|
|
0260 | 7B 67 9A 05 22 53 B6 B3 7E 6D EB 1F EF D8 91 72
|
|
|
|
|
0270 | E6 06 0A 57 78 C8 F5 04 1E 17 C6 B1 2A 35 F5 2D
|
|
|
|
|
0280 | 03 BA 1F F5 0F 8F AF 46 36 66 E2 FB</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 = 5896FE8F5CCE704BE31AF0159C33CFCCCF3B01E342DC3F9BA86DA1597
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>0184207EDEF59766</code></td>
|
|
|
|
|
<td><code>01BC30949AF89766</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>B4020000</code> (692 in decimal)</td>
|
|
|
|
|
<td><code>94020000</code> (660 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -482,19 +482,19 @@ random_padding_bytes = 5896FE8F5CCE704BE31AF0159C33CFCCCF3B01E342DC3F9BA86DA1597
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>3C1F9C91825B8AF9CCB59F7AA7F75B65</code></td>
|
|
|
|
|
<td><code>14482B90FAE8E35CE4085AA7532F0FA8</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>C6720A3EACA6683F661D8D9C0F3959C6</code></td>
|
|
|
|
|
<td><code>E8BA72BAFBB7A6C5DB1D8574D88F6B3A</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE500200DF620EBF2D294A0B940B8B8D</code> <code>2F6D087C1A0820FBFA04857EB331F205</code> <code>CC104C800A5EFF205F6A695F3691C6AD</code> <code>C4E93042A3D9095B7437834C15D2841B</code> <code>6CF552AFB94BD359C29811E707270B1B</code> <code>99DABBC218F81154274387726FE80AF0</code> <code>FA61A3259B54B917654B8392333BCA38</code> <code>026D46CF61C9609D09DC0B5FC1B2C2F4</code> <code>B8DBE878C47C82F2E89354FF87F4C6ED</code> <code>3727242D61FE54B226A4B1CEC66A41ED</code> <code>C77BAD4570E9D0713771CE49A9E2EF53</code> <code>C9351E67DBBEAD315CCDF6D37401A49A</code> <code>0B1B99FE8092B5C1E52E3ABD2503C0A5</code> <code>26ECD4552888790D5B35C796F3165C5D</code> <code>1E33DB55E3BC15C421BEC9E3532D1E3E</code> <code>571FF6E4CC7CDF183FAA9CAAE0A60649</code> <code>E8F6EFF79BA7953D56559ECAE76F3493</code> <code>84D78D983DF8C83B16A7F5DB458E7C0D</code> <code>2577D17A5EF14085EC4D7A63D8B4DDE3</code> <code>8A82977157A6C17D84B060210D46F960</code> <code>EEF5450D989638F9CEBB6FAD76701D6B</code> <code>EDDE0AED2B3D317F999694D9D9B3CEE6</code> <code>14CE88577B1ADD15E4C3BBAF17F2E5D2</code> <code>66B596F31A5F37C672007A10BA6C5C66</code> <code>4DA9F1407B466851611A2E4C6F649F42</code> <code>9D7C5E819315CB65A101BE3A8629F3B8</code> <code>A41FDA21F638D0C22D76271089EDF0D8</code> <code>D89D99E350D315E58423F4DE61E66573</code> <code>B106B25B4F7B29AD11C232C838DBB984</code> <code>2A38F642A32BE98941830AB4B9EFD2A5</code> <code>4BA6A0714069588332EA22B7D3816AF0</code> <code>A24E9A8C85C27B264B1B8EF7FE88E9C9</code> <code>12414955BA3210B9CB809473E978E940</code> <code>2ACA53FD225487157125099FDDCE4311</code> <code>2C1FB6DE52033FE9A706F922A3AEA328</code> <code>A199BC3938859E5BBECBC6D1E674FC96</code> <code>F5FADC9809A3D9BD61435A7E5014C544</code><br> <code>8CEEEE31</code></td>
|
|
|
|
|
<td><code>FE500200AEDB97241BDC0125FC04D140</code> <code>57AB837AEB0FBA29583823CC3CAE7B94</code> <code>6A7C4874CF445AEB643DF6B818861339</code> <code>2057E83CFCFC499462B899EF030546FE</code> <code>B9B8DA2BC48328E6081335D4CC0ED379</code> <code>E6C6B2D4212F69EE943C54CD7FE90A02</code> <code>6355C54B421DF3DCDD83C12F97CDAF8D</code> <code>613D5E033452BC52553CC10CC395D925</code> <code>A0FAFB6DBC1463A23181F4A99DD3C9D4</code> <code>C7172D3E2948B002CCDC402C8ABEAEAC</code> <code>4CED045FDF2C484667E5B4AFBFA9019A</code> <code>122A07ACFE72415A5CC71C4DDFCBD462</code> <code>04D6E3964D8FBA67B5732DB1586011E6</code> <code>C14B49D2E9CCABB15D2B98DEA5814A71</code> <code>EF765B4043BA030C48B4BF67C5347C1F</code> <code>320C199857905600EA1939F852555AA5</code> <code>C6FF01FC7ABCB24FCA38BD53AC3C918F</code> <code>190B483EB63C314A17BB4BD7D541F762</code> <code>F56FD614E6BB54665FB23FF1108175B3</code> <code>A0E3F12CA3391044443399D3AAFF21E8</code> <code>C0CD1CC1856D94E8253D2EB0F917B230</code> <code>F3B22434DDD29C6B1B24D5341097C52D</code> <code>10D05D4BF6ED78009324CFE89FA3DB95</code> <code>729C572B9C4976FF11A396942646C863</code> <code>7983D207CFDBB84381B914E7E9323601</code> <code>C46B3222C02AB4247B0A655ECB7EF757</code> <code>D7270ADBAFD04EBED94F601514306DBF</code> <code>41D16ECABD5C5D331D7804273EDB0B8E</code> <code>55B59818AFBBAD040DC6A8D43BCB8F2D</code> <code>23702B316A39214054CB48DE92047471</code> <code>A52044758C3F516D7122406A3B2D1717</code> <code>57E9B71E2B8E5E2734AB80BDA0ED20CE</code> <code>63D46CDB3D442C8BB356282825279EE4</code> <code>372CF5672128869906C1CFDCC3AAA838</code> <code>D7336179B37A3A437B679A052253B6B3</code> <code>7E6DEB1FEFD89172E6060A5778C8F504</code> <code>1E17C6B12A35F52D03BA1FF50F8FAF46</code><br> <code>3666E2FB</code></td>
|
|
|
|
|
<td>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = 5896FE8F5CCE704BE31AF0159C33CFCCCF3B01E342DC3F9BA86DA1597
|
|
|
|
|
<!-- 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 = DF620EBF2D294A0B940B8B8D2F6D087C1A0820FBFA04857EB331F205CC104C800A5EFF205F6A695F3691C6ADC4E93042A3D9095B7437834C15D2841B6CF552AFB94BD359C29811E707270B1B99DABBC218F81154274387726FE80AF0FA61A3259B54B917654B8392333BCA38026D46CF61C9609D09DC0B5FC1B2C2F4B8DBE878C47C82F2E89354FF87F4C6ED3727242D61FE54B226A4B1CEC66A41EDC77BAD4570E9D0713771CE49A9E2EF53C9351E67DBBEAD315CCDF6D37401A49A0B1B99FE8092B5C1E52E3ABD2503C0A526ECD4552888790D5B35C796F3165C5D1E33DB55E3BC15C421BEC9E3532D1E3E571FF6E4CC7CDF183FAA9CAAE0A60649E8F6EFF79BA7953D56559ECAE76F349384D78D983DF8C83B16A7F5DB458E7C0D2577D17A5EF14085EC4D7A63D8B4DDE38A82977157A6C17D84B060210D46F960EEF5450D989638F9CEBB6FAD76701D6BEDDE0AED2B3D317F999694D9D9B3CEE614CE88577B1ADD15E4C3BBAF17F2E5D266B596F31A5F37C672007A10BA6C5C664DA9F1407B466851611A2E4C6F649F429D7C5E819315CB65A101BE3A8629F3B8A41FDA21F638D0C22D76271089EDF0D8D89D99E350D315E58423F4DE61E66573B106B25B4F7B29AD11C232C838DBB9842A38F642A32BE98941830AB4B9EFD2A54BA6A0714069588332EA22B7D3816AF0A24E9A8C85C27B264B1B8EF7FE88E9C912414955BA3210B9CB809473E978E9402ACA53FD225487157125099FDDCE43112C1FB6DE52033FE9A706F922A3AEA328A199BC3938859E5BBECBC6D1E674FC96F5FADC9809A3D9BD61435A7E5014C5448CEEEE31
|
|
|
|
|
tmp_aes_key = 7147862BD7CAC01A5C9951FBE5A0B4FCF5966DF5825B7D5819DAD32B457949C5
|
|
|
|
|
tmp_aes_iv = DBF5DC1EF3E86A680C8F43FB1230D0739AB122B4441191E9119DF945D82B7CC7</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = AEDB97241BDC0125FC04D14057AB837AEB0FBA29583823CC3CAE7B946A7C4874CF445AEB643DF6B8188613392057E83CFCFC499462B899EF030546FEB9B8DA2BC48328E6081335D4CC0ED379E6C6B2D4212F69EE943C54CD7FE90A026355C54B421DF3DCDD83C12F97CDAF8D613D5E033452BC52553CC10CC395D925A0FAFB6DBC1463A23181F4A99DD3C9D4C7172D3E2948B002CCDC402C8ABEAEAC4CED045FDF2C484667E5B4AFBFA9019A122A07ACFE72415A5CC71C4DDFCBD46204D6E3964D8FBA67B5732DB1586011E6C14B49D2E9CCABB15D2B98DEA5814A71EF765B4043BA030C48B4BF67C5347C1F320C199857905600EA1939F852555AA5C6FF01FC7ABCB24FCA38BD53AC3C918F190B483EB63C314A17BB4BD7D541F762F56FD614E6BB54665FB23FF1108175B3A0E3F12CA3391044443399D3AAFF21E8C0CD1CC1856D94E8253D2EB0F917B230F3B22434DDD29C6B1B24D5341097C52D10D05D4BF6ED78009324CFE89FA3DB95729C572B9C4976FF11A396942646C8637983D207CFDBB84381B914E7E9323601C46B3222C02AB4247B0A655ECB7EF757D7270ADBAFD04EBED94F601514306DBF41D16ECABD5C5D331D7804273EDB0B8E55B59818AFBBAD040DC6A8D43BCB8F2D23702B316A39214054CB48DE92047471A52044758C3F516D7122406A3B2D171757E9B71E2B8E5E2734AB80BDA0ED20CE63D46CDB3D442C8BB356282825279EE4372CF5672128869906C1CFDCC3AAA838D7336179B37A3A437B679A052253B6B37E6DEB1FEFD89172E6060A5778C8F5041E17C6B12A35F52D03BA1FF50F8FAF463666E2FB
|
|
|
|
|
tmp_aes_key = 0D1AB98D8C2FE3AF83F67E85F0645D332B54D807D35779A8FB36B70042422BF8
|
|
|
|
|
tmp_aes_iv = 8E80A24FA6022D3165BA7BA0A9834DFFE4F0C061932BEC0859B04466F9099664</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = 7568EA7425D5C99741817620FF24C2CCE3D0E66BBA0D89B53C1F9C91825B8AF9CCB59F7AA7F75B65C6720A3EACA6683F661D8D9C0F3959C603000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100C4E4B51FFE042BA317EFFDE322208A747D3D8A14A9699DC4ADB30B553F575FFB780F87B74673048110E0B2BDB9B65FBA984B793619050C2944A85D28C241B33ACAF1A41FD038C4EE66B0D6B3B569E5E407315D867ABD66005F64FE2247E9EB8A54B15D22A431DE14B098C80FCCCD1037864DF24617112B9DD9A1E83C905DB8953067E82422E540A220705632B7B59314AC951A02B4AA61816A4437A2FE2D0814A11EA4B76329159739A3C5928CE78166FF3455D855635AA985C4F68F3C16ABC98AC49AEE7F353646C708BADE8EDCD89894E2FE4C1BAFBC47C371A51564565D4961C236E928E8F638597C3C200828A98A864DE2186312D2D30D6DBB2282AA021FDEF5976652A8CE1354B6FE80
|
|
|
|
|
answer = BA0D89B53C1F9C91825B8AF9CCB59F7AA7F75B65C6720A3EACA6683F661D8D9C0F3959C603000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100C4E4B51FFE042BA317EFFDE322208A747D3D8A14A9699DC4ADB30B553F575FFB780F87B74673048110E0B2BDB9B65FBA984B793619050C2944A85D28C241B33ACAF1A41FD038C4EE66B0D6B3B569E5E407315D867ABD66005F64FE2247E9EB8A54B15D22A431DE14B098C80FCCCD1037864DF24617112B9DD9A1E83C905DB8953067E82422E540A220705632B7B59314AC951A02B4AA61816A4437A2FE2D0814A11EA4B76329159739A3C5928CE78166FF3455D855635AA985C4F68F3C16ABC98AC49AEE7F353646C708BADE8EDCD89894E2FE4C1BAFBC47C371A51564565D4961C236E928E8F638597C3C200828A98A864DE2186312D2D30D6DBB2282AA021FDEF5976652A8CE1354B6FE80</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = 2FBD28F7EC0B0029CCBA947CF72CA0DDA4701368BA0D89B514482B90FAE8E35CE4085AA7532F0FA8E8BA72BAFBB7A6C5DB1D8574D88F6B3A03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010066528525A93B29EB2527FE4F1A27F1AD78788B2AF9B05C4E5B4D6A16CFD0063EFE2E4CA8311A974FD3898A659CC4B19506D516BF3784227C4827766E2729FF7C46EBE0FD20A539417EAC566BFB921B3CE1D91CCE578B64CDAB0ED07B41EEA85A168492B519B6B2A0E9DAFB60855788D1A8B0B930B4D20A16F8C51AFC30F84FC32CBE48B600DFFE9FC62149D2912667D045CCFC4B0375F23B0E91B1EC65C475CA8ABC4305B556190DFF146AE4DC004D1FBD8E85219A8073AFEAAD7DBA57191774E473A76374F38912691B231340AC104AC1C6BDA1DDF047848B8BB8AE0D6F21CA78350E7B55253BC1D7DE588DA0A935443703ACFDCAE572CD93F581EB4387F7859AF89766DF0F57024D2651EA
|
|
|
|
|
answer = BA0D89B514482B90FAE8E35CE4085AA7532F0FA8E8BA72BAFBB7A6C5DB1D8574D88F6B3A03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010066528525A93B29EB2527FE4F1A27F1AD78788B2AF9B05C4E5B4D6A16CFD0063EFE2E4CA8311A974FD3898A659CC4B19506D516BF3784227C4827766E2729FF7C46EBE0FD20A539417EAC566BFB921B3CE1D91CCE578B64CDAB0ED07B41EEA85A168492B519B6B2A0E9DAFB60855788D1A8B0B930B4D20A16F8C51AFC30F84FC32CBE48B600DFFE9FC62149D2912667D045CCFC4B0375F23B0E91B1EC65C475CA8ABC4305B556190DFF146AE4DC004D1FBD8E85219A8073AFEAAD7DBA57191774E473A76374F38912691B231340AC104AC1C6BDA1DDF047848B8BB8AE0D6F21CA78350E7B55253BC1D7DE588DA0A935443703ACFDCAE572CD93F581EB4387F7859AF89766DF0F57024D2651EA</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 3C 1F 9C 91 82 5B 8A F9 CC B5 9F 7A
|
|
|
|
|
0010 | A7 F7 5B 65 C6 72 0A 3E AC A6 68 3F 66 1D 8D 9C
|
|
|
|
|
0020 | 0F 39 59 C6 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 14 48 2B 90 FA E8 E3 5C E4 08 5A A7
|
|
|
|
|
0010 | 53 2F 0F A8 E8 BA 72 BA FB B7 A6 C5 DB 1D 85 74
|
|
|
|
|
0020 | D8 8F 6B 3A 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 = BA0D89B53C1F9C91825B8AF9CCB59F7AA7F75B65C6720A3EACA6683F661D8D9C0F3959C
|
|
|
|
|
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 | C4 E4 B5 1F FE 04 2B A3 17 EF FD E3 22 20 8A 74
|
|
|
|
|
0140 | 7D 3D 8A 14 A9 69 9D C4 AD B3 0B 55 3F 57 5F FB
|
|
|
|
|
0150 | 78 0F 87 B7 46 73 04 81 10 E0 B2 BD B9 B6 5F BA
|
|
|
|
|
0160 | 98 4B 79 36 19 05 0C 29 44 A8 5D 28 C2 41 B3 3A
|
|
|
|
|
0170 | CA F1 A4 1F D0 38 C4 EE 66 B0 D6 B3 B5 69 E5 E4
|
|
|
|
|
0180 | 07 31 5D 86 7A BD 66 00 5F 64 FE 22 47 E9 EB 8A
|
|
|
|
|
0190 | 54 B1 5D 22 A4 31 DE 14 B0 98 C8 0F CC CD 10 37
|
|
|
|
|
01A0 | 86 4D F2 46 17 11 2B 9D D9 A1 E8 3C 90 5D B8 95
|
|
|
|
|
01B0 | 30 67 E8 24 22 E5 40 A2 20 70 56 32 B7 B5 93 14
|
|
|
|
|
01C0 | AC 95 1A 02 B4 AA 61 81 6A 44 37 A2 FE 2D 08 14
|
|
|
|
|
01D0 | A1 1E A4 B7 63 29 15 97 39 A3 C5 92 8C E7 81 66
|
|
|
|
|
01E0 | FF 34 55 D8 55 63 5A A9 85 C4 F6 8F 3C 16 AB C9
|
|
|
|
|
01F0 | 8A C4 9A EE 7F 35 36 46 C7 08 BA DE 8E DC D8 98
|
|
|
|
|
0200 | 94 E2 FE 4C 1B AF BC 47 C3 71 A5 15 64 56 5D 49
|
|
|
|
|
0210 | 61 C2 36 E9 28 E8 F6 38 59 7C 3C 20 08 28 A9 8A
|
|
|
|
|
0220 | 86 4D E2 18 63 12 D2 D3 0D 6D BB 22 82 AA 02 1F
|
|
|
|
|
0230 | DE F5 97 66</code></pre>
|
|
|
|
|
0130 | 66 52 85 25 A9 3B 29 EB 25 27 FE 4F 1A 27 F1 AD
|
|
|
|
|
0140 | 78 78 8B 2A F9 B0 5C 4E 5B 4D 6A 16 CF D0 06 3E
|
|
|
|
|
0150 | FE 2E 4C A8 31 1A 97 4F D3 89 8A 65 9C C4 B1 95
|
|
|
|
|
0160 | 06 D5 16 BF 37 84 22 7C 48 27 76 6E 27 29 FF 7C
|
|
|
|
|
0170 | 46 EB E0 FD 20 A5 39 41 7E AC 56 6B FB 92 1B 3C
|
|
|
|
|
0180 | E1 D9 1C CE 57 8B 64 CD AB 0E D0 7B 41 EE A8 5A
|
|
|
|
|
0190 | 16 84 92 B5 19 B6 B2 A0 E9 DA FB 60 85 57 88 D1
|
|
|
|
|
01A0 | A8 B0 B9 30 B4 D2 0A 16 F8 C5 1A FC 30 F8 4F C3
|
|
|
|
|
01B0 | 2C BE 48 B6 00 DF FE 9F C6 21 49 D2 91 26 67 D0
|
|
|
|
|
01C0 | 45 CC FC 4B 03 75 F2 3B 0E 91 B1 EC 65 C4 75 CA
|
|
|
|
|
01D0 | 8A BC 43 05 B5 56 19 0D FF 14 6A E4 DC 00 4D 1F
|
|
|
|
|
01E0 | BD 8E 85 21 9A 80 73 AF EA AD 7D BA 57 19 17 74
|
|
|
|
|
01F0 | E4 73 A7 63 74 F3 89 12 69 1B 23 13 40 AC 10 4A
|
|
|
|
|
0200 | C1 C6 BD A1 DD F0 47 84 8B 8B B8 AE 0D 6F 21 CA
|
|
|
|
|
0210 | 78 35 0E 7B 55 25 3B C1 D7 DE 58 8D A0 A9 35 44
|
|
|
|
|
0220 | 37 03 AC FD CA E5 72 CD 93 F5 81 EB 43 87 F7 85
|
|
|
|
|
0230 | 9A F8 97 66</code></pre>
|
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
|
<pre><code>server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;</code></pre>
|
|
|
|
|
<table class="table">
|
|
|
|
@ -570,13 +570,13 @@ answer = BA0D89B53C1F9C91825B8AF9CCB59F7AA7F75B65C6720A3EACA6683F661D8D9C0F3959C
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>3C1F9C91825B8AF9CCB59F7AA7F75B65</code></td>
|
|
|
|
|
<td><code>14482B90FAE8E35CE4085AA7532F0FA8</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>C6720A3EACA6683F661D8D9C0F3959C6</code></td>
|
|
|
|
|
<td><code>E8BA72BAFBB7A6C5DB1D8574D88F6B3A</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B53C1F9C91825B8AF9CCB59F7AA7F75B65C6720A3EACA6683F661D8D9C0F3959C
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE000100C4E4B51FFE042BA317EFFDE3</code> <code>22208A747D3D8A14A9699DC4ADB30B55</code> <code>3F575FFB780F87B74673048110E0B2BD</code> <code>B9B65FBA984B793619050C2944A85D28</code> <code>C241B33ACAF1A41FD038C4EE66B0D6B3</code> <code>B569E5E407315D867ABD66005F64FE22</code> <code>47E9EB8A54B15D22A431DE14B098C80F</code> <code>CCCD1037864DF24617112B9DD9A1E83C</code> <code>905DB8953067E82422E540A220705632</code> <code>B7B59314AC951A02B4AA61816A4437A2</code> <code>FE2D0814A11EA4B76329159739A3C592</code> <code>8CE78166FF3455D855635AA985C4F68F</code> <code>3C16ABC98AC49AEE7F353646C708BADE</code> <code>8EDCD89894E2FE4C1BAFBC47C371A515</code> <code>64565D4961C236E928E8F638597C3C20</code> <code>0828A98A864DE2186312D2D30D6DBB22</code><br> <code>82AA021F</code></td>
|
|
|
|
|
<td><code>FE00010066528525A93B29EB2527FE4F</code> <code>1A27F1AD78788B2AF9B05C4E5B4D6A16</code> <code>CFD0063EFE2E4CA8311A974FD3898A65</code> <code>9CC4B19506D516BF3784227C4827766E</code> <code>2729FF7C46EBE0FD20A539417EAC566B</code> <code>FB921B3CE1D91CCE578B64CDAB0ED07B</code> <code>41EEA85A168492B519B6B2A0E9DAFB60</code> <code>855788D1A8B0B930B4D20A16F8C51AFC</code> <code>30F84FC32CBE48B600DFFE9FC62149D2</code> <code>912667D045CCFC4B0375F23B0E91B1EC</code> <code>65C475CA8ABC4305B556190DFF146AE4</code> <code>DC004D1FBD8E85219A8073AFEAAD7DBA</code> <code>57191774E473A76374F38912691B2313</code> <code>40AC104AC1C6BDA1DDF047848B8BB8AE</code> <code>0D6F21CA78350E7B55253BC1D7DE588D</code> <code>A0A935443703ACFDCAE572CD93F581EB</code><br> <code>4387F785</code></td>
|
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>DEF59766</code> (1721234910 in decimal)</td>
|
|
|
|
|
<td><code>9AF89766</code> (1721235610 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B53C1F9C91825B8AF9CCB59F7AA7F75B65C6720A3EACA6683F661D8D9C0F3959C
|
|
|
|
|
<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 = 02EF581F15BDF361B80A3139674DCC6A52131D28A8F5EEE06B2B54FAC00C32D18A591C72F83C8E128C207D90525B1026D9ACF66D880B0048E28FF30E01A7AC10B68DDD5D921C6EC59470AB9849A1857987C5D3F7FE4570776BC578D67F7F2EE743D8AE1E013571931B9915F502D272F510E57A88E6FC5A7AC53583B8BA1F144066DFA22C0A31B1FC52DE1E6D963E8945FBAA416C954E3D901E747558FAC9CFBAC4A73C624879096DEF0914D88DD1E53F741A2BCEE341D9BF6F9921180BF3B5A8CD8F41C9CA15DD76B17B9797549FD44B23C56BB101AEE3AFA84080DF3EFD4AF304C59902456E8A089C88971955327F857A510A03DA21F0687D2176F973E5BB66</code></pre>
|
|
|
|
|
<pre><code>b = F1AA65728283F290C0E0A2B1EFEE107F2FDEA6CCA3166BCD254BF3D00F46A9690A56389518BBEB1E88FB2E2D0FC5DDED0C5209D649E91B366ADDF426CA140B77C443705E9D1C13B207F8F1D318225E9B0C35319A4A7CD3D81824AEBFB27E45C9EA7E61045A044863EF54E5E8068A8E6D33F5CCD8BE24221909F24D3272E184A3BC96E6E44EE74DA78D4BC6A5F1CF10987386A57439E1F05C8B0317FB0F7139A4E3E24C8A6792638A37A2975CD3CBB7F6E5255CF304A14A2516F939F4EACFD8FD4E18DCAA02F2C6FB017B5DB56B308DEED41B0BB55481C168185DAB7F4B38B084528D272DA9EA08559620ADC3DB6A17583236B76DE76D7C84A91F36201574AF42</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 = 2E8E2A59D19D179F566C2817C04B606F96E4CBDBC4F8834D4FC289F64784ECDA387135E96278C70D1C01AC0C2155C9CD2E93FBE166A519ACE9C5F1E96AF95391E1CE29CB797B53A3AE45F6DCBD0BE3A18F944EAED60C0568B64E1E07BA0270F59DE3F0358AEBEDACC379FCBD1A06D33C1DC100C60C14427A51CB4542E502F0DF0619B1D909864DECDA867DFA37A0EE4F1491F4204D4184BD6BEB1583D9FB60B40A8226AD6F29644B114DB88F200EC586552C01EC21714C63AF447F5B51B6722079A235D3E28761E0934D8CA32C911AE52AD2394981690D76E1A7B8EA13C3E8D8CB03EF889C015995535FFFE48651EF050F4B237532E5427C570AF1E2DE71C500</code></pre>
|
|
|
|
|
<pre><code>g_b = 4D9AF0C3A92DBD05D49DCED6EEB260D5D38DF8DA0F18F969C083A51197CC61E85ACF92092A779BF9295AD191034E49FA1FD7B8E8E1E4E757D476E1BCBD0FABDC2807E94E3AAAF0D40D364B78E115104E1BB4CDD9371CEC96DBAA4382F878C7E8F6927E0EEE3A57CEA0508EDE1FE3564321C82916347A4E36730FE17C104113AB9060974BD0ACC65401CCAC258BA1B4FE621E9F359933237C0D2DEE76EA2584A80DF5121F9316E11E16CA427CFA19D61819C3976D9A1A60797EA92636781B0C9D127797EF53CB13EBD846B00BD215CE46B1A906AF97460490DFF9F368A109DD5BFAD6DA57375C0772D1830CDB3E2260E7A027BC122C92347E94E122F2A3E4A319</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 3C 1F 9C 91 82 5B 8A F9 CC B5 9F 7A
|
|
|
|
|
0010 | A7 F7 5B 65 C6 72 0A 3E AC A6 68 3F 66 1D 8D 9C
|
|
|
|
|
0020 | 0F 39 59 C6 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 2E 8E 2A 59 D1 9D 17 9F 56 6C 28 17 C0 4B 60 6F
|
|
|
|
|
0040 | 96 E4 CB DB C4 F8 83 4D 4F C2 89 F6 47 84 EC DA
|
|
|
|
|
0050 | 38 71 35 E9 62 78 C7 0D 1C 01 AC 0C 21 55 C9 CD
|
|
|
|
|
0060 | 2E 93 FB E1 66 A5 19 AC E9 C5 F1 E9 6A F9 53 91
|
|
|
|
|
0070 | E1 CE 29 CB 79 7B 53 A3 AE 45 F6 DC BD 0B E3 A1
|
|
|
|
|
0080 | 8F 94 4E AE D6 0C 05 68 B6 4E 1E 07 BA 02 70 F5
|
|
|
|
|
0090 | 9D E3 F0 35 8A EB ED AC C3 79 FC BD 1A 06 D3 3C
|
|
|
|
|
00A0 | 1D C1 00 C6 0C 14 42 7A 51 CB 45 42 E5 02 F0 DF
|
|
|
|
|
00B0 | 06 19 B1 D9 09 86 4D EC DA 86 7D FA 37 A0 EE 4F
|
|
|
|
|
00C0 | 14 91 F4 20 4D 41 84 BD 6B EB 15 83 D9 FB 60 B4
|
|
|
|
|
00D0 | 0A 82 26 AD 6F 29 64 4B 11 4D B8 8F 20 0E C5 86
|
|
|
|
|
00E0 | 55 2C 01 EC 21 71 4C 63 AF 44 7F 5B 51 B6 72 20
|
|
|
|
|
00F0 | 79 A2 35 D3 E2 87 61 E0 93 4D 8C A3 2C 91 1A E5
|
|
|
|
|
0100 | 2A D2 39 49 81 69 0D 76 E1 A7 B8 EA 13 C3 E8 D8
|
|
|
|
|
0110 | CB 03 EF 88 9C 01 59 95 53 5F FF E4 86 51 EF 05
|
|
|
|
|
0120 | 0F 4B 23 75 32 E5 42 7C 57 0A F1 E2 DE 71 C5 00</code></pre>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 14 48 2B 90 FA E8 E3 5C E4 08 5A A7
|
|
|
|
|
0010 | 53 2F 0F A8 E8 BA 72 BA FB B7 A6 C5 DB 1D 85 74
|
|
|
|
|
0020 | D8 8F 6B 3A 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 4D 9A F0 C3 A9 2D BD 05 D4 9D CE D6 EE B2 60 D5
|
|
|
|
|
0040 | D3 8D F8 DA 0F 18 F9 69 C0 83 A5 11 97 CC 61 E8
|
|
|
|
|
0050 | 5A CF 92 09 2A 77 9B F9 29 5A D1 91 03 4E 49 FA
|
|
|
|
|
0060 | 1F D7 B8 E8 E1 E4 E7 57 D4 76 E1 BC BD 0F AB DC
|
|
|
|
|
0070 | 28 07 E9 4E 3A AA F0 D4 0D 36 4B 78 E1 15 10 4E
|
|
|
|
|
0080 | 1B B4 CD D9 37 1C EC 96 DB AA 43 82 F8 78 C7 E8
|
|
|
|
|
0090 | F6 92 7E 0E EE 3A 57 CE A0 50 8E DE 1F E3 56 43
|
|
|
|
|
00A0 | 21 C8 29 16 34 7A 4E 36 73 0F E1 7C 10 41 13 AB
|
|
|
|
|
00B0 | 90 60 97 4B D0 AC C6 54 01 CC AC 25 8B A1 B4 FE
|
|
|
|
|
00C0 | 62 1E 9F 35 99 33 23 7C 0D 2D EE 76 EA 25 84 A8
|
|
|
|
|
00D0 | 0D F5 12 1F 93 16 E1 1E 16 CA 42 7C FA 19 D6 18
|
|
|
|
|
00E0 | 19 C3 97 6D 9A 1A 60 79 7E A9 26 36 78 1B 0C 9D
|
|
|
|
|
00F0 | 12 77 97 EF 53 CB 13 EB D8 46 B0 0B D2 15 CE 46
|
|
|
|
|
0100 | B1 A9 06 AF 97 46 04 90 DF F9 F3 68 A1 09 DD 5B
|
|
|
|
|
0110 | FA D6 DA 57 37 5C 07 72 D1 83 0C DB 3E 22 60 E7
|
|
|
|
|
0120 | A0 27 BC 12 2C 92 34 7E 94 E1 22 F2 A3 E4 A3 19</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 = BA0D89B53C1F9C91825B8AF9CCB59F7AA7F75B65C6720A3EACA6683F661D8D9C0F3959C
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>3C1F9C91825B8AF9CCB59F7AA7F75B65</code></td>
|
|
|
|
|
<td><code>14482B90FAE8E35CE4085AA7532F0FA8</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>C6720A3EACA6683F661D8D9C0F3959C6</code></td>
|
|
|
|
|
<td><code>E8BA72BAFBB7A6C5DB1D8574D88F6B3A</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE0001002E8E2A59D19D179F566C2817</code> <code>C04B606F96E4CBDBC4F8834D4FC289F6</code> <code>4784ECDA387135E96278C70D1C01AC0C</code> <code>2155C9CD2E93FBE166A519ACE9C5F1E9</code> <code>6AF95391E1CE29CB797B53A3AE45F6DC</code> <code>BD0BE3A18F944EAED60C0568B64E1E07</code> <code>BA0270F59DE3F0358AEBEDACC379FCBD</code> <code>1A06D33C1DC100C60C14427A51CB4542</code> <code>E502F0DF0619B1D909864DECDA867DFA</code> <code>37A0EE4F1491F4204D4184BD6BEB1583</code> <code>D9FB60B40A8226AD6F29644B114DB88F</code> <code>200EC586552C01EC21714C63AF447F5B</code> <code>51B6722079A235D3E28761E0934D8CA3</code> <code>2C911AE52AD2394981690D76E1A7B8EA</code> <code>13C3E8D8CB03EF889C015995535FFFE4</code> <code>8651EF050F4B237532E5427C570AF1E2</code><br> <code>DE71C500</code></td>
|
|
|
|
|
<td><code>FE0001004D9AF0C3A92DBD05D49DCED6</code> <code>EEB260D5D38DF8DA0F18F969C083A511</code> <code>97CC61E85ACF92092A779BF9295AD191</code> <code>034E49FA1FD7B8E8E1E4E757D476E1BC</code> <code>BD0FABDC2807E94E3AAAF0D40D364B78</code> <code>E115104E1BB4CDD9371CEC96DBAA4382</code> <code>F878C7E8F6927E0EEE3A57CEA0508EDE</code> <code>1FE3564321C82916347A4E36730FE17C</code> <code>104113AB9060974BD0ACC65401CCAC25</code> <code>8BA1B4FE621E9F359933237C0D2DEE76</code> <code>EA2584A80DF5121F9316E11E16CA427C</code> <code>FA19D61819C3976D9A1A60797EA92636</code> <code>781B0C9D127797EF53CB13EBD846B00B</code> <code>D215CE46B1A906AF97460490DFF9F368</code> <code>A109DD5BFAD6DA57375C0772D1830CDB</code> <code>3E2260E7A027BC122C92347E94E122F2</code><br> <code>A3E4A319</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 = BA0D89B53C1F9C91825B8AF9CCB59F7AA7F75B65C6720A3EACA6683F661D8D9C0F3959C
|
|
|
|
|
<!-- 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 = 54B643663C1F9C91825B8AF9CCB59F7AA7F75B65C6720A3EACA6683F661D8D9C0F3959C60000000000000000FE0001002E8E2A59D19D179F566C2817C04B606F96E4CBDBC4F8834D4FC289F64784ECDA387135E96278C70D1C01AC0C2155C9CD2E93FBE166A519ACE9C5F1E96AF95391E1CE29CB797B53A3AE45F6DCBD0BE3A18F944EAED60C0568B64E1E07BA0270F59DE3F0358AEBEDACC379FCBD1A06D33C1DC100C60C14427A51CB4542E502F0DF0619B1D909864DECDA867DFA37A0EE4F1491F4204D4184BD6BEB1583D9FB60B40A8226AD6F29644B114DB88F200EC586552C01EC21714C63AF447F5B51B6722079A235D3E28761E0934D8CA32C911AE52AD2394981690D76E1A7B8EA13C3E8D8CB03EF889C015995535FFFE48651EF050F4B237532E5427C570AF1E2DE71C500
|
|
|
|
|
padding = 80D1491B60B0CA090CD0FAE2
|
|
|
|
|
tmp_aes_key = 7147862BD7CAC01A5C9951FBE5A0B4FCF5966DF5825B7D5819DAD32B457949C5
|
|
|
|
|
tmp_aes_iv = DBF5DC1EF3E86A680C8F43FB1230D0739AB122B4441191E9119DF945D82B7CC7</code></pre>
|
|
|
|
|
<pre><code>data = 54B6436614482B90FAE8E35CE4085AA7532F0FA8E8BA72BAFBB7A6C5DB1D8574D88F6B3A0000000000000000FE0001004D9AF0C3A92DBD05D49DCED6EEB260D5D38DF8DA0F18F969C083A51197CC61E85ACF92092A779BF9295AD191034E49FA1FD7B8E8E1E4E757D476E1BCBD0FABDC2807E94E3AAAF0D40D364B78E115104E1BB4CDD9371CEC96DBAA4382F878C7E8F6927E0EEE3A57CEA0508EDE1FE3564321C82916347A4E36730FE17C104113AB9060974BD0ACC65401CCAC258BA1B4FE621E9F359933237C0D2DEE76EA2584A80DF5121F9316E11E16CA427CFA19D61819C3976D9A1A60797EA92636781B0C9D127797EF53CB13EBD846B00BD215CE46B1A906AF97460490DFF9F368A109DD5BFAD6DA57375C0772D1830CDB3E2260E7A027BC122C92347E94E122F2A3E4A319
|
|
|
|
|
padding = 0C14B6770150477FC8A1D763
|
|
|
|
|
tmp_aes_key = 0D1AB98D8C2FE3AF83F67E85F0645D332B54D807D35779A8FB36B70042422BF8
|
|
|
|
|
tmp_aes_iv = 8E80A24FA6022D3165BA7BA0A9834DFFE4F0C061932BEC0859B04466F9099664</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 = 9CBE1B6FBAD616B6D8C8D241DA793472965A4D4CA4DECE2D55722A5DC4552DEC3290A7CF56129185BD8A98877B837DBB4CA9F21D1C87B5A80A6F1D3B8355E385B16012B29836746FE1787335D2A2B9C476EE671DBD4D209A17F3D64C15EC46944FA0E16105AF2E629543CF6796E744F893ED3915B34602782F8FDAA06EC865CF8324DA8BBEF57DE7165EE89317CB654A70B1A4D9926D10488242E703B0F7A9AE1DBEE2BE79D69B8BB6F5F034449824773E36035D27DE023B025A922BFED812C915E3272497EEB998B7FC91244428030FD043BCB47997E84B6E0D4AD9FEECF0679195BDC4A30351023F6AE3EB567F97B48C6499F117FA9745EF46EAD331D0A609C994E6D3177452EBF9F2F966B60553B658C7630948D4BB41BF14913445CAF883269331D1D981DB4A422DF202A3321670C47E8DDB995ED32CC31CA49D7F936CA88219172F5111320CDB81BFF3A7C43240</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = B7B9874BF5A0342D8FB4A85528A61EB3F6FA78A6DF9B14A177B01E7E987C1E173CE6120713AAFD44F2E9239F5EB49AAD196E13A266E4D6BF208EA4FD1CBD08EF946115A49347BB92030A04C43FB26B58D96FFF3E59B6435B5FC707D1EE88C0430443C88FD4E41E1A9381F82EEE38BD3449295E9E478F10B4F13022F88E1D17E3D21DAA84B9A934535BD4E10ADF7491058277154FB2862213AD83E5B859809A745754A9CA01187A06AE81E7AA11ABC0949B0FA622E78F89613F74BA835A41E833E7943E47C0E43DAA15B771A3177F3F8034918AA01DB50247D81A2AB22B5822200FF7D14351373824A3145F769A1F1CC8351FA1F0FB825D1874C6E688A39C901003CF84C758D144959C81E50240D1DD934D45AEDDDD67CCBCBF4F3258401ECE04D40BA39BD658EC90E40BA3D27C8A7EAB7831588A982201DD02E96471C131739A574208ACA00133A1738D1106B84C8A09</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 74 73 03 00 DE F5 97 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 3C 1F 9C 91 82 5B 8A F9
|
|
|
|
|
0020 | CC B5 9F 7A A7 F7 5B 65 C6 72 0A 3E AC A6 68 3F
|
|
|
|
|
0030 | 66 1D 8D 9C 0F 39 59 C6 FE 50 01 00 9C BE 1B 6F
|
|
|
|
|
0040 | BA D6 16 B6 D8 C8 D2 41 DA 79 34 72 96 5A 4D 4C
|
|
|
|
|
0050 | A4 DE CE 2D 55 72 2A 5D C4 55 2D EC 32 90 A7 CF
|
|
|
|
|
0060 | 56 12 91 85 BD 8A 98 87 7B 83 7D BB 4C A9 F2 1D
|
|
|
|
|
0070 | 1C 87 B5 A8 0A 6F 1D 3B 83 55 E3 85 B1 60 12 B2
|
|
|
|
|
0080 | 98 36 74 6F E1 78 73 35 D2 A2 B9 C4 76 EE 67 1D
|
|
|
|
|
0090 | BD 4D 20 9A 17 F3 D6 4C 15 EC 46 94 4F A0 E1 61
|
|
|
|
|
00A0 | 05 AF 2E 62 95 43 CF 67 96 E7 44 F8 93 ED 39 15
|
|
|
|
|
00B0 | B3 46 02 78 2F 8F DA A0 6E C8 65 CF 83 24 DA 8B
|
|
|
|
|
00C0 | BE F5 7D E7 16 5E E8 93 17 CB 65 4A 70 B1 A4 D9
|
|
|
|
|
00D0 | 92 6D 10 48 82 42 E7 03 B0 F7 A9 AE 1D BE E2 BE
|
|
|
|
|
00E0 | 79 D6 9B 8B B6 F5 F0 34 44 98 24 77 3E 36 03 5D
|
|
|
|
|
00F0 | 27 DE 02 3B 02 5A 92 2B FE D8 12 C9 15 E3 27 24
|
|
|
|
|
0100 | 97 EE B9 98 B7 FC 91 24 44 28 03 0F D0 43 BC B4
|
|
|
|
|
0110 | 79 97 E8 4B 6E 0D 4A D9 FE EC F0 67 91 95 BD C4
|
|
|
|
|
0120 | A3 03 51 02 3F 6A E3 EB 56 7F 97 B4 8C 64 99 F1
|
|
|
|
|
0130 | 17 FA 97 45 EF 46 EA D3 31 D0 A6 09 C9 94 E6 D3
|
|
|
|
|
0140 | 17 74 52 EB F9 F2 F9 66 B6 05 53 B6 58 C7 63 09
|
|
|
|
|
0150 | 48 D4 BB 41 BF 14 91 34 45 CA F8 83 26 93 31 D1
|
|
|
|
|
0160 | D9 81 DB 4A 42 2D F2 02 A3 32 16 70 C4 7E 8D DB
|
|
|
|
|
0170 | 99 5E D3 2C C3 1C A4 9D 7F 93 6C A8 82 19 17 2F
|
|
|
|
|
0180 | 51 11 32 0C DB 81 BF F3 A7 C4 32 40</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 E8 46 0C 00 9B F8 97 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 14 48 2B 90 FA E8 E3 5C
|
|
|
|
|
0020 | E4 08 5A A7 53 2F 0F A8 E8 BA 72 BA FB B7 A6 C5
|
|
|
|
|
0030 | DB 1D 85 74 D8 8F 6B 3A FE 50 01 00 B7 B9 87 4B
|
|
|
|
|
0040 | F5 A0 34 2D 8F B4 A8 55 28 A6 1E B3 F6 FA 78 A6
|
|
|
|
|
0050 | DF 9B 14 A1 77 B0 1E 7E 98 7C 1E 17 3C E6 12 07
|
|
|
|
|
0060 | 13 AA FD 44 F2 E9 23 9F 5E B4 9A AD 19 6E 13 A2
|
|
|
|
|
0070 | 66 E4 D6 BF 20 8E A4 FD 1C BD 08 EF 94 61 15 A4
|
|
|
|
|
0080 | 93 47 BB 92 03 0A 04 C4 3F B2 6B 58 D9 6F FF 3E
|
|
|
|
|
0090 | 59 B6 43 5B 5F C7 07 D1 EE 88 C0 43 04 43 C8 8F
|
|
|
|
|
00A0 | D4 E4 1E 1A 93 81 F8 2E EE 38 BD 34 49 29 5E 9E
|
|
|
|
|
00B0 | 47 8F 10 B4 F1 30 22 F8 8E 1D 17 E3 D2 1D AA 84
|
|
|
|
|
00C0 | B9 A9 34 53 5B D4 E1 0A DF 74 91 05 82 77 15 4F
|
|
|
|
|
00D0 | B2 86 22 13 AD 83 E5 B8 59 80 9A 74 57 54 A9 CA
|
|
|
|
|
00E0 | 01 18 7A 06 AE 81 E7 AA 11 AB C0 94 9B 0F A6 22
|
|
|
|
|
00F0 | E7 8F 89 61 3F 74 BA 83 5A 41 E8 33 E7 94 3E 47
|
|
|
|
|
0100 | C0 E4 3D AA 15 B7 71 A3 17 7F 3F 80 34 91 8A A0
|
|
|
|
|
0110 | 1D B5 02 47 D8 1A 2A B2 2B 58 22 20 0F F7 D1 43
|
|
|
|
|
0120 | 51 37 38 24 A3 14 5F 76 9A 1F 1C C8 35 1F A1 F0
|
|
|
|
|
0130 | FB 82 5D 18 74 C6 E6 88 A3 9C 90 10 03 CF 84 C7
|
|
|
|
|
0140 | 58 D1 44 95 9C 81 E5 02 40 D1 DD 93 4D 45 AE DD
|
|
|
|
|
0150 | DD 67 CC BC BF 4F 32 58 40 1E CE 04 D4 0B A3 9B
|
|
|
|
|
0160 | D6 58 EC 90 E4 0B A3 D2 7C 8A 7E AB 78 31 58 8A
|
|
|
|
|
0170 | 98 22 01 DD 02 E9 64 71 C1 31 73 9A 57 42 08 AC
|
|
|
|
|
0180 | A0 01 33 A1 73 8D 11 06 B8 4C 8A 09</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>74730300DEF59766</code></td>
|
|
|
|
|
<td><code>E8460C009BF89766</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>3C1F9C91825B8AF9CCB59F7AA7F75B65</code></td>
|
|
|
|
|
<td><code>14482B90FAE8E35CE4085AA7532F0FA8</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>C6720A3EACA6683F661D8D9C0F3959C6</code></td>
|
|
|
|
|
<td><code>E8BA72BAFBB7A6C5DB1D8574D88F6B3A</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE5001009CBE1B6FBAD616B6D8C8D241</code> <code>DA793472965A4D4CA4DECE2D55722A5D</code> <code>C4552DEC3290A7CF56129185BD8A9887</code> <code>7B837DBB4CA9F21D1C87B5A80A6F1D3B</code> <code>8355E385B16012B29836746FE1787335</code> <code>D2A2B9C476EE671DBD4D209A17F3D64C</code> <code>15EC46944FA0E16105AF2E629543CF67</code> <code>96E744F893ED3915B34602782F8FDAA0</code> <code>6EC865CF8324DA8BBEF57DE7165EE893</code> <code>17CB654A70B1A4D9926D10488242E703</code> <code>B0F7A9AE1DBEE2BE79D69B8BB6F5F034</code> <code>449824773E36035D27DE023B025A922B</code> <code>FED812C915E3272497EEB998B7FC9124</code> <code>4428030FD043BCB47997E84B6E0D4AD9</code> <code>FEECF0679195BDC4A30351023F6AE3EB</code> <code>567F97B48C6499F117FA9745EF46EAD3</code> <code>31D0A609C994E6D3177452EBF9F2F966</code> <code>B60553B658C7630948D4BB41BF149134</code> <code>45CAF883269331D1D981DB4A422DF202</code> <code>A3321670C47E8DDB995ED32CC31CA49D</code> <code>7F936CA88219172F5111320CDB81BFF3</code><br> <code>A7C43240</code></td>
|
|
|
|
|
<td><code>FE500100B7B9874BF5A0342D8FB4A855</code> <code>28A61EB3F6FA78A6DF9B14A177B01E7E</code> <code>987C1E173CE6120713AAFD44F2E9239F</code> <code>5EB49AAD196E13A266E4D6BF208EA4FD</code> <code>1CBD08EF946115A49347BB92030A04C4</code> <code>3FB26B58D96FFF3E59B6435B5FC707D1</code> <code>EE88C0430443C88FD4E41E1A9381F82E</code> <code>EE38BD3449295E9E478F10B4F13022F8</code> <code>8E1D17E3D21DAA84B9A934535BD4E10A</code> <code>DF7491058277154FB2862213AD83E5B8</code> <code>59809A745754A9CA01187A06AE81E7AA</code> <code>11ABC0949B0FA622E78F89613F74BA83</code> <code>5A41E833E7943E47C0E43DAA15B771A3</code> <code>177F3F8034918AA01DB50247D81A2AB2</code> <code>2B5822200FF7D14351373824A3145F76</code> <code>9A1F1CC8351FA1F0FB825D1874C6E688</code> <code>A39C901003CF84C758D144959C81E502</code> <code>40D1DD934D45AEDDDD67CCBCBF4F3258</code> <code>401ECE04D40BA39BD658EC90E40BA3D2</code> <code>7C8A7EAB7831588A982201DD02E96471</code> <code>C131739A574208ACA00133A1738D1106</code><br> <code>B84C8A09</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 = 7FE442146F6CBBC4AF6DD012AC13ED1115523DBAC3EA0572844C0E2D808C132495B763AF8E655EBED8EFA5F5AA0C52DFD70FAD40E0E066705DE25BDD04A9841852115A5DC8460953FE9DFB296705D86FB1B2321768C398466DC71A353A01D7B82A4B0D5FE8BA600D8D1D82326FF92235D44CBF7A7B5C354312017BA4A739350180405AAE49E748CE73421B3B6033A95E0DF6F79C439EFF01C5946A81D9534A00CB27390D5801EFC505718521409FCF5DEF37BCF5AB6DB0836E1E3B8BF0D1E85022CD6D3B68CD58AAA269B449F20FE041E09B4B373074E1DC323A9998E996BBF9D968414199C09367FB5A98DC117C324D25F3A00741393029F43D242E4A94FCF8</code></pre>
|
|
|
|
|
<pre><code>auth_key = 1D5CF4EEF0CEB1BF14A2CBCC3E9DF593C6D863BABB8984191CA8DA219ECFAB20C4B6C7CA6D7F83D7530B486DB4492EF140697676DBC5E3F2AD515240F988E8DDCD8A10277D219983009EC1212BD194D11C611DA4882E95369E4036A28607E8439C04BFFC9499E9C7286EE6DADAE51677288B1AF8934C67897C8164B69777BBBA89E7017FD93B47FB823011AD5AF635D96683D80D16076D4266BC700E6EE661AE85961F1DD071C2305DE9BA4659B7CC9BEA0ACBA41B360717DA28CB6F08774C3CFB4B75E828998CDE737574D062531AAB00AA2C243A70F8D5F3BED2AD01D79F8C76766ABD0C5283CABA6F385777BD383F8BC19D6C23FCF6D6EF43B10B4C372DAB</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 5C E3 B6 DF F5 97 66
|
|
|
|
|
0010 | 74 00 00 00 34 F7 CB 3B 3C 1F 9C 91 82 5B 8A F9
|
|
|
|
|
0020 | CC B5 9F 7A A7 F7 5B 65 C6 72 0A 3E AC A6 68 3F
|
|
|
|
|
0030 | 66 1D 8D 9C 0F 39 59 C6 AF EB CB 80 4A D6 BD 93
|
|
|
|
|
0040 | 48 CE 90 E2 1C F2 FC B7</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 48 15 BD 9B F8 97 66
|
|
|
|
|
0010 | A4 00 00 00 34 F7 CB 3B 14 48 2B 90 FA E8 E3 5C
|
|
|
|
|
0020 | E4 08 5A A7 53 2F 0F A8 E8 BA 72 BA FB B7 A6 C5
|
|
|
|
|
0030 | DB 1D 85 74 D8 8F 6B 3A 19 44 CC 6D 4B 8B 8C 1B
|
|
|
|
|
0040 | D0 DE 7E 89 D6 89 E7 DC</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>015CE3B6DFF59766</code></td>
|
|
|
|
|
<td><code>014815BD9BF89766</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>74000000</code> (116 in decimal)</td>
|
|
|
|
|
<td><code>A4000000</code> (164 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>3C1F9C91825B8AF9CCB59F7AA7F75B65</code></td>
|
|
|
|
|
<td><code>14482B90FAE8E35CE4085AA7532F0FA8</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>C6720A3EACA6683F661D8D9C0F3959C6</code></td>
|
|
|
|
|
<td><code>E8BA72BAFBB7A6C5DB1D8574D88F6B3A</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>AFEBCB804AD6BD9348CE90E21CF2FCB7</code></td>
|
|
|
|
|
<td><code>1944CC6D4B8B8C1BD0DE7E89D689E7DC</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>
|
|
|
|
|