|
|
|
@ -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 C0 DA 04 00 7E 62 1C 65
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 17 2F 85 E7 17 61 F3 BB
|
|
|
|
|
0020 | 2C BD BE 71 2D 1E AF E5</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 8C EA 08 00 29 B8 1D 65
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 7F 1F 22 C6 09 72 3B CD
|
|
|
|
|
0020 | 45 F7 08 F0 F9 9E 90 BF</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>C0DA04007E621C65</code></td>
|
|
|
|
|
<td><code>8CEA080029B81D65</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>172F85E71761F3BB2CBDBE712D1EAFE5</code></td>
|
|
|
|
|
<td><code>7F1F22C609723BCD45F708F0F99E90BF</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 90 20 72 7E 62 1C 65
|
|
|
|
|
0010 | 54 00 00 00 63 24 16 05 17 2F 85 E7 17 61 F3 BB
|
|
|
|
|
0020 | 2C BD BE 71 2D 1E AF E5 88 17 DB E8 74 20 77 FA
|
|
|
|
|
0030 | 5F 1C 0C 1C 6F F0 58 BD 08 15 17 74 9F 74 DE 35
|
|
|
|
|
0040 | 09 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 80 2F D3 29 B8 1D 65
|
|
|
|
|
0010 | C0 00 00 00 63 24 16 05 7F 1F 22 C6 09 72 3B CD
|
|
|
|
|
0020 | 45 F7 08 F0 F9 9E 90 BF E9 B1 0D 87 09 A3 90 0E
|
|
|
|
|
0030 | F8 89 83 60 10 85 61 ED 08 1C 13 ED 04 D1 CE F9
|
|
|
|
|
0040 | A9 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>019020727E621C65</code></td>
|
|
|
|
|
<td><code>01802FD329B81D65</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>54000000</code> (84 in decimal)</td>
|
|
|
|
|
<td><code>C0000000</code> (192 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>172F85E71761F3BB2CBDBE712D1EAFE5</code></td>
|
|
|
|
|
<td><code>7F1F22C609723BCD45F708F0F99E90BF</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>8817DBE8742077FA5F1C0C1C6FF058BD</code></td>
|
|
|
|
|
<td><code>E9B10D8709A3900EF8898360108561ED</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>081517749F74DE3509000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1519811627470173449</td>
|
|
|
|
|
<td><code>081C13ED04D1CEF9A9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2023221262575139241</td>
|
|
|
|
|
<td>Single-byte prefix denoting length, an 8-byte string, and three bytes of padding</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -208,22 +208,22 @@
|
|
|
|
|
<h4><a class="anchor" href="#proof-of-work" id="proof-of-work" name="proof-of-work"><i class="anchor-icon"></i></a>Proof of work</h4>
|
|
|
|
|
<h5><a class="anchor" href="#3-client-decomposes-pq-into-prime-factors-such-that-p--q" id="3-client-decomposes-pq-into-prime-factors-such-that-p--q" name="3-client-decomposes-pq-into-prime-factors-such-that-p--q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p < q.</h5>
|
|
|
|
|
<!-- start pq -->
|
|
|
|
|
<pre><code>pq = 1519811627470173449</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1519811627470173449 = 1196775271 * 1269922319</code></p>
|
|
|
|
|
<pre><code>p = 1196775271
|
|
|
|
|
q = 1269922319</code></pre>
|
|
|
|
|
<pre><code>pq = 2023221262575139241</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2023221262575139241 = 1405962143 * 1439029687</code></p>
|
|
|
|
|
<pre><code>p = 1405962143
|
|
|
|
|
q = 1439029687</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 15 17 74 9F 74 DE 35 09 00 00 00
|
|
|
|
|
0010 | 04 47 55 57 67 00 00 00 04 4B B1 7A 0F 00 00 00
|
|
|
|
|
0020 | 17 2F 85 E7 17 61 F3 BB 2C BD BE 71 2D 1E AF E5
|
|
|
|
|
0030 | 88 17 DB E8 74 20 77 FA 5F 1C 0C 1C 6F F0 58 BD
|
|
|
|
|
0040 | 36 56 DB B3 F8 48 32 A4 08 55 5E 45 40 3D 6C CB
|
|
|
|
|
0050 | E3 53 04 AD 6C 76 CC FA BB E7 E9 E8 98 35 C3 C1
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 1C 13 ED 04 D1 CE F9 A9 00 00 00
|
|
|
|
|
0010 | 04 53 CD 47 9F 00 00 00 04 55 C5 D9 B7 00 00 00
|
|
|
|
|
0020 | 7F 1F 22 C6 09 72 3B CD 45 F7 08 F0 F9 9E 90 BF
|
|
|
|
|
0030 | E9 B1 0D 87 09 A3 90 0E F8 89 83 60 10 85 61 ED
|
|
|
|
|
0040 | 2D 8F D1 E4 9C 89 5A 19 12 2C 25 AB 16 ED 92 27
|
|
|
|
|
0050 | 37 99 E3 97 1F 29 89 FE 2B 11 1B C8 E9 E0 7A D1
|
|
|
|
|
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 = 1269922319</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>081517749F74DE3509000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1519811627470173449</td>
|
|
|
|
|
<td><code>081C13ED04D1CEF9A9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2023221262575139241</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>0447555767000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1196775271</td>
|
|
|
|
|
<td><code>0453CD479F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1405962143</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>044BB17A0F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1269922319</td>
|
|
|
|
|
<td><code>0455C5D9B7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1439029687</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>172F85E71761F3BB2CBDBE712D1EAFE5</code></td>
|
|
|
|
|
<td><code>7F1F22C609723BCD45F708F0F99E90BF</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>8817DBE8742077FA5F1C0C1C6FF058BD</code></td>
|
|
|
|
|
<td><code>E9B10D8709A3900EF8898360108561ED</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>3656DBB3F84832A408555E45403D6CCB</code> <code>E35304AD6C76CCFABBE7E9E89835C3C1</code></td>
|
|
|
|
|
<td><code>2D8FD1E49C895A19122C25AB16ED9227</code> <code>3799E3971F2989FE2B111BC8E9E07AD1</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1269922319</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 = 955FF5A9081517749F74DE35090000000447555767000000044BB17A0F000000172F85E71761F3BB2CBDBE712D1EAFE58817DBE8742077FA5F1C0C1C6FF058BD3656DBB3F84832A408555E45403D6CCBE35304AD6C76CCFABBE7E9E89835C3C102000000
|
|
|
|
|
random_padding_bytes = 8053F00D9FE8DDFF7E3B727D6C3FC737B3C161C7B610EDDBF518944EEF2E6528718990D3F4C1CEF03DA6279DE5CB391A82C1E7019E5F74C26726BAD616B74C5046C642427C828189F291CFAE5D27736C67F819053E285E7D6C233380</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A9081C13ED04D1CEF9A90000000453CD479F0000000455C5D9B70000007F1F22C609723BCD45F708F0F99E90BFE9B10D8709A3900EF8898360108561ED2D8FD1E49C895A19122C25AB16ED92273799E3971F2989FE2B111BC8E9E07AD102000000
|
|
|
|
|
random_padding_bytes = 9C0F7EBDEB68050357DE05126F2231A5EB6FAD7E5592E14F68C1BD2C7D7924BD85B4919F55FCCE528F22CD56873FC460951188FF0ACAD4195CD194059C4F04D168423BF8876B7010E9FBE8BF5486723FF71EE405A1BB755348E67389</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 = 9B64DCF6A1329BA6F9606B85898519BEEAC516D67B2CE01818B59ABA4857664D3B239FE4725D6BC3A8FADDCE726E0D74C86DBB45C2A84E81426D903F43D272DCB3C956ADDC1F070EFEC12BF2A6963CE675BE36A674F4763447AD1D8711119B87A60D3673739245FE3CDF745B5034E9967FAE70A98FFB49514EE9AF73FC82FE4B07FAB67E380937253028BA451C6CAC485FC04E8808BC90A18B38BAF246AC7F65ED6F014540A006285FF792CCF7B0E02580EE8486FDD2EADD4B98B8F806885C3DF0B1396D72FC14BD32F2520394853DA3CBE69582D4A5A04732E1BB456D8F010DF336D2F5C6CFC4540035E49639FEDFA9C31FAD6B44A6BC750B95319EAAEE19CA</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 67FF69473A3411D0A9357ECB6954EDDB142250313042B4C5D50A8053C2F09546D0B2783F72FD53135FAB86284E112E1F6952F459B413287A49EB74D2E0F1F458216FF6CE8F4134C0E1DC30A51588735A9FCCB4A7C84BFECD95CC47A025CA587AF6E5C5FFC80550DE595FB894B41CE24556D4BB16AC635E851217F74060C828E966998FC06194DBC3D10EDA36291CC2359BF41A908AEAACC94FD8DADFA9DEB4F45BFD5869CD14B8175900824C71F64160C8545083303673D3FE6B58B87B8E34A80FA457835B4AA10F7E26867DFE8F126851D4CBF2587551E40FA50006D74B77858AE3E2C591FAC39E67EB04D84B8663A277A944C6A9998EB0D37900900D2E945C</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 C4 DA 04 00 7E 62 1C 65
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 17 2F 85 E7 17 61 F3 BB
|
|
|
|
|
0020 | 2C BD BE 71 2D 1E AF E5 88 17 DB E8 74 20 77 FA
|
|
|
|
|
0030 | 5F 1C 0C 1C 6F F0 58 BD 04 47 55 57 67 00 00 00
|
|
|
|
|
0040 | 04 4B B1 7A 0F 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 9B 64 DC F6 A1 32 9B A6 F9 60 6B 85
|
|
|
|
|
0060 | 89 85 19 BE EA C5 16 D6 7B 2C E0 18 18 B5 9A BA
|
|
|
|
|
0070 | 48 57 66 4D 3B 23 9F E4 72 5D 6B C3 A8 FA DD CE
|
|
|
|
|
0080 | 72 6E 0D 74 C8 6D BB 45 C2 A8 4E 81 42 6D 90 3F
|
|
|
|
|
0090 | 43 D2 72 DC B3 C9 56 AD DC 1F 07 0E FE C1 2B F2
|
|
|
|
|
00A0 | A6 96 3C E6 75 BE 36 A6 74 F4 76 34 47 AD 1D 87
|
|
|
|
|
00B0 | 11 11 9B 87 A6 0D 36 73 73 92 45 FE 3C DF 74 5B
|
|
|
|
|
00C0 | 50 34 E9 96 7F AE 70 A9 8F FB 49 51 4E E9 AF 73
|
|
|
|
|
00D0 | FC 82 FE 4B 07 FA B6 7E 38 09 37 25 30 28 BA 45
|
|
|
|
|
00E0 | 1C 6C AC 48 5F C0 4E 88 08 BC 90 A1 8B 38 BA F2
|
|
|
|
|
00F0 | 46 AC 7F 65 ED 6F 01 45 40 A0 06 28 5F F7 92 CC
|
|
|
|
|
0100 | F7 B0 E0 25 80 EE 84 86 FD D2 EA DD 4B 98 B8 F8
|
|
|
|
|
0110 | 06 88 5C 3D F0 B1 39 6D 72 FC 14 BD 32 F2 52 03
|
|
|
|
|
0120 | 94 85 3D A3 CB E6 95 82 D4 A5 A0 47 32 E1 BB 45
|
|
|
|
|
0130 | 6D 8F 01 0D F3 36 D2 F5 C6 CF C4 54 00 35 E4 96
|
|
|
|
|
0140 | 39 FE DF A9 C3 1F AD 6B 44 A6 BC 75 0B 95 31 9E
|
|
|
|
|
0150 | AA EE 19 CA</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 90 EA 08 00 29 B8 1D 65
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 7F 1F 22 C6 09 72 3B CD
|
|
|
|
|
0020 | 45 F7 08 F0 F9 9E 90 BF E9 B1 0D 87 09 A3 90 0E
|
|
|
|
|
0030 | F8 89 83 60 10 85 61 ED 04 53 CD 47 9F 00 00 00
|
|
|
|
|
0040 | 04 55 C5 D9 B7 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 67 FF 69 47 3A 34 11 D0 A9 35 7E CB
|
|
|
|
|
0060 | 69 54 ED DB 14 22 50 31 30 42 B4 C5 D5 0A 80 53
|
|
|
|
|
0070 | C2 F0 95 46 D0 B2 78 3F 72 FD 53 13 5F AB 86 28
|
|
|
|
|
0080 | 4E 11 2E 1F 69 52 F4 59 B4 13 28 7A 49 EB 74 D2
|
|
|
|
|
0090 | E0 F1 F4 58 21 6F F6 CE 8F 41 34 C0 E1 DC 30 A5
|
|
|
|
|
00A0 | 15 88 73 5A 9F CC B4 A7 C8 4B FE CD 95 CC 47 A0
|
|
|
|
|
00B0 | 25 CA 58 7A F6 E5 C5 FF C8 05 50 DE 59 5F B8 94
|
|
|
|
|
00C0 | B4 1C E2 45 56 D4 BB 16 AC 63 5E 85 12 17 F7 40
|
|
|
|
|
00D0 | 60 C8 28 E9 66 99 8F C0 61 94 DB C3 D1 0E DA 36
|
|
|
|
|
00E0 | 29 1C C2 35 9B F4 1A 90 8A EA AC C9 4F D8 DA DF
|
|
|
|
|
00F0 | A9 DE B4 F4 5B FD 58 69 CD 14 B8 17 59 00 82 4C
|
|
|
|
|
0100 | 71 F6 41 60 C8 54 50 83 30 36 73 D3 FE 6B 58 B8
|
|
|
|
|
0110 | 7B 8E 34 A8 0F A4 57 83 5B 4A A1 0F 7E 26 86 7D
|
|
|
|
|
0120 | FE 8F 12 68 51 D4 CB F2 58 75 51 E4 0F A5 00 06
|
|
|
|
|
0130 | D7 4B 77 85 8A E3 E2 C5 91 FA C3 9E 67 EB 04 D8
|
|
|
|
|
0140 | 4B 86 63 A2 77 A9 44 C6 A9 99 8E B0 D3 79 00 90
|
|
|
|
|
0150 | 0D 2E 94 5C</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 = 8053F00D9FE8DDFF7E3B727D6C3FC737B3C161C7B610EDDBF518944EE
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>C4DA04007E621C65</code></td>
|
|
|
|
|
<td><code>90EA080029B81D65</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 = 8053F00D9FE8DDFF7E3B727D6C3FC737B3C161C7B610EDDBF518944EE
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>172F85E71761F3BB2CBDBE712D1EAFE5</code></td>
|
|
|
|
|
<td><code>7F1F22C609723BCD45F708F0F99E90BF</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>8817DBE8742077FA5F1C0C1C6FF058BD</code></td>
|
|
|
|
|
<td><code>E9B10D8709A3900EF8898360108561ED</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>0447555767000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1196775271</td>
|
|
|
|
|
<td><code>0453CD479F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1405962143</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>044BB17A0F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1269922319</td>
|
|
|
|
|
<td><code>0455C5D9B7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1439029687</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 = 8053F00D9FE8DDFF7E3B727D6C3FC737B3C161C7B610EDDBF518944EE
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE0001009B64DCF6A1329BA6F9606B85</code> <code>898519BEEAC516D67B2CE01818B59ABA</code> <code>4857664D3B239FE4725D6BC3A8FADDCE</code> <code>726E0D74C86DBB45C2A84E81426D903F</code> <code>43D272DCB3C956ADDC1F070EFEC12BF2</code> <code>A6963CE675BE36A674F4763447AD1D87</code> <code>11119B87A60D3673739245FE3CDF745B</code> <code>5034E9967FAE70A98FFB49514EE9AF73</code> <code>FC82FE4B07FAB67E380937253028BA45</code> <code>1C6CAC485FC04E8808BC90A18B38BAF2</code> <code>46AC7F65ED6F014540A006285FF792CC</code> <code>F7B0E02580EE8486FDD2EADD4B98B8F8</code> <code>06885C3DF0B1396D72FC14BD32F25203</code> <code>94853DA3CBE69582D4A5A04732E1BB45</code> <code>6D8F010DF336D2F5C6CFC4540035E496</code> <code>39FEDFA9C31FAD6B44A6BC750B95319E</code><br> <code>AAEE19CA</code></td>
|
|
|
|
|
<td><code>FE00010067FF69473A3411D0A9357ECB</code> <code>6954EDDB142250313042B4C5D50A8053</code> <code>C2F09546D0B2783F72FD53135FAB8628</code> <code>4E112E1F6952F459B413287A49EB74D2</code> <code>E0F1F458216FF6CE8F4134C0E1DC30A5</code> <code>1588735A9FCCB4A7C84BFECD95CC47A0</code> <code>25CA587AF6E5C5FFC80550DE595FB894</code> <code>B41CE24556D4BB16AC635E851217F740</code> <code>60C828E966998FC06194DBC3D10EDA36</code> <code>291CC2359BF41A908AEAACC94FD8DADF</code> <code>A9DEB4F45BFD5869CD14B8175900824C</code> <code>71F64160C8545083303673D3FE6B58B8</code> <code>7B8E34A80FA457835B4AA10F7E26867D</code> <code>FE8F126851D4CBF2587551E40FA50006</code> <code>D74B77858AE3E2C591FAC39E67EB04D8</code> <code>4B8663A277A944C6A9998EB0D3790090</code><br> <code>0D2E945C</code></td>
|
|
|
|
|
<td>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = 8053F00D9FE8DDFF7E3B727D6C3FC737B3C161C7B610EDDBF518944EE
|
|
|
|
|
<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 AC 6C FB 7E 62 1C 65
|
|
|
|
|
0010 | CC 02 00 00 5C 07 E8 D0 17 2F 85 E7 17 61 F3 BB
|
|
|
|
|
0020 | 2C BD BE 71 2D 1E AF E5 88 17 DB E8 74 20 77 FA
|
|
|
|
|
0030 | 5F 1C 0C 1C 6F F0 58 BD FE 50 02 00 61 3E F9 94
|
|
|
|
|
0040 | 16 A0 64 93 A8 62 CC 34 AC 4D AD 0C A6 34 F4 16
|
|
|
|
|
0050 | 8F 80 A8 71 85 75 FF 51 42 CE 9F 15 73 C3 25 1D
|
|
|
|
|
0060 | 6C F2 12 80 80 5A CF 10 22 A9 B4 D1 C2 69 7C F0
|
|
|
|
|
0070 | B8 EF A3 AD E1 05 EF 95 23 3C 16 91 66 ED EC 2F
|
|
|
|
|
0080 | 7B 93 0F 2C 63 84 90 0A D8 E0 1A E9 08 18 D0 D7
|
|
|
|
|
0090 | CF 3B 4A AC AB A8 AF 05 EA 87 9E 93 F3 45 B3 DF
|
|
|
|
|
00A0 | 65 3D F0 23 F8 E8 4D 6C 29 8F EC 7D 91 A0 31 1B
|
|
|
|
|
00B0 | 2E 5F 7A 29 3A B3 47 8B D5 1D C1 8A 00 E3 1E 82
|
|
|
|
|
00C0 | 6A 49 5F D4 F7 A7 45 5E 4E E5 FE 85 27 23 E2 B5
|
|
|
|
|
00D0 | 87 7D E2 4F CA A5 C9 E6 4A 85 8B 46 04 27 D4 05
|
|
|
|
|
00E0 | 5A D3 45 81 14 01 FE D3 9A 21 DC 6A 9D EC B7 96
|
|
|
|
|
00F0 | 30 2B BB A6 87 75 1C 8E 88 84 76 31 C0 A5 9D FF
|
|
|
|
|
0100 | DB FC 71 9D 07 10 5C 50 BE FC E8 9B BD 61 CC EF
|
|
|
|
|
0110 | 86 B1 92 BF 80 CF D4 2B B1 83 49 D2 55 58 A4 11
|
|
|
|
|
0120 | 08 D6 C7 EB D2 03 DA 4B 14 E3 8C AF C8 0B 97 07
|
|
|
|
|
0130 | 1E C8 EA BB EB 5C CA CD 33 60 39 85 07 29 BD 21
|
|
|
|
|
0140 | E4 A1 D3 65 9D F3 FD 38 1E 79 EE A0 EC 71 1A 0D
|
|
|
|
|
0150 | 15 AE B0 D9 A2 69 C3 00 AA 65 E4 1C E5 9C AB 46
|
|
|
|
|
0160 | 04 DF 24 5D 26 FC 86 13 D1 56 23 75 D1 78 B7 E7
|
|
|
|
|
0170 | 27 49 C1 C1 71 75 F8 E8 2D ED 77 FA 42 68 E1 23
|
|
|
|
|
0180 | AB 08 B6 66 1D 94 F7 39 40 45 62 3D 5C BA 6B B9
|
|
|
|
|
0190 | 3D 82 74 FF 1F 73 E5 49 0A B7 AF 0E 38 3B D9 FC
|
|
|
|
|
01A0 | E4 68 69 39 25 27 B6 32 C7 95 0B 9B 95 94 D8 F7
|
|
|
|
|
01B0 | 3E 4E FE EB 5E 32 24 2B 55 60 24 43 41 89 4F 2F
|
|
|
|
|
01C0 | 7E 8D 57 63 AE 60 48 61 FB 2E 79 EC 34 5F 70 2B
|
|
|
|
|
01D0 | 3A 30 DE F4 1F 81 C6 18 22 18 3A 9C C0 F1 61 87
|
|
|
|
|
01E0 | 48 06 DB 55 F7 23 A9 5D 52 A7 6B 71 ED 38 AF AF
|
|
|
|
|
01F0 | 12 92 5D 6C DB D5 4C 41 D8 93 62 1C 60 BB 34 89
|
|
|
|
|
0200 | 41 47 9A F3 13 A5 95 41 EC 86 9B E8 A4 70 48 8E
|
|
|
|
|
0210 | 19 97 7B 70 B4 7D 74 8C 35 55 82 1F C7 E8 13 4E
|
|
|
|
|
0220 | 30 44 FA 7F 74 AC 2D 49 60 EE 4E E0 23 49 DD C3
|
|
|
|
|
0230 | 4B CF C2 0A 43 21 BC 08 2F C1 47 66 69 FA B5 4B
|
|
|
|
|
0240 | B8 F5 EB 07 A9 8A D7 3B A0 4A EE 46 C6 F3 76 8C
|
|
|
|
|
0250 | B0 B6 BB 7D A6 DD 5C ED 7E 72 E1 10 32 1A 31 C0
|
|
|
|
|
0260 | F9 77 5D 4B 4D 89 77 09 C0 78 3E FA 26 9D 19 5C
|
|
|
|
|
0270 | 41 C1 F8 A9 6F 78 75 D2 01 41 F2 3B 3B E5 3C F4
|
|
|
|
|
0280 | 40 23 D2 8B AF EA BA CC 7E 70 1B 08</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 D4 B2 90 2A B8 1D 65
|
|
|
|
|
0010 | A4 02 00 00 5C 07 E8 D0 7F 1F 22 C6 09 72 3B CD
|
|
|
|
|
0020 | 45 F7 08 F0 F9 9E 90 BF E9 B1 0D 87 09 A3 90 0E
|
|
|
|
|
0030 | F8 89 83 60 10 85 61 ED FE 50 02 00 13 3E AF 1E
|
|
|
|
|
0040 | B2 03 87 D4 32 F5 85 DD 9E CA A4 B8 F3 72 3F 6C
|
|
|
|
|
0050 | 99 20 66 79 13 23 BC E6 53 FE 5A D1 9B CF C2 4D
|
|
|
|
|
0060 | 23 0F CA 24 7C 68 6A 14 90 1C B9 59 B1 2A DD 3B
|
|
|
|
|
0070 | BD F6 27 F1 F5 D5 8A 0F FE 5F 54 F0 3C 27 B5 42
|
|
|
|
|
0080 | 01 CC E7 69 8C 7E 9F D1 CD 6D 62 EC F0 BD 50 B6
|
|
|
|
|
0090 | FE 01 E5 CE E9 B2 6F 4A B8 A0 C6 AD DD DC 2B F0
|
|
|
|
|
00A0 | 32 72 0C 30 5E 70 01 50 01 16 62 F1 76 F6 DF 72
|
|
|
|
|
00B0 | 2A 59 3B 3E 12 81 73 9D 06 32 4A F4 81 01 6C 75
|
|
|
|
|
00C0 | 77 F9 EB B7 E5 59 33 0D 19 71 E5 01 51 5E 42 71
|
|
|
|
|
00D0 | 8B 7F CD 88 3B B2 AF 6A 90 B2 A0 E6 8F 8A DD 50
|
|
|
|
|
00E0 | D1 7C A9 D3 BE 30 06 17 4C C4 EC CE F8 F9 FA 0F
|
|
|
|
|
00F0 | 53 9D BC DC F0 A0 C6 48 DA 8C 76 29 07 1C 6C 8A
|
|
|
|
|
0100 | B0 74 CC 20 65 1E AC B5 DC 34 B4 1F F9 90 7B 59
|
|
|
|
|
0110 | 6A 5F E1 58 F0 87 D4 96 47 F9 E8 01 C8 BF 74 6D
|
|
|
|
|
0120 | AB D3 A4 2A 9A F5 33 E3 29 2D 0D 5C 72 13 A0 33
|
|
|
|
|
0130 | 1B C7 89 E0 23 F3 4C 0B 00 6C 13 C6 D5 3E 6E FD
|
|
|
|
|
0140 | 3F 04 AD 13 FA 04 89 32 A4 DA 95 AC DD 8E 93 48
|
|
|
|
|
0150 | A6 57 F3 EF 7A B0 97 B8 59 46 D7 EA C4 4F 9D 76
|
|
|
|
|
0160 | 1E CC 3E D1 6C 03 2F D4 63 4E FA 4F F9 A4 D2 24
|
|
|
|
|
0170 | DF 86 FE 2D C7 96 3B 39 7D 87 B9 48 99 85 DD 92
|
|
|
|
|
0180 | A6 37 20 8B B1 E4 A5 27 47 47 31 27 60 F8 F1 9F
|
|
|
|
|
0190 | DF BB F1 FA AC 65 C2 99 E4 94 A5 8F D3 6E 8B 2D
|
|
|
|
|
01A0 | 98 2C EE CD A5 84 ED 63 FB 07 A7 BC 9A B6 F8 82
|
|
|
|
|
01B0 | D5 F5 00 7B 75 BD 1C 0C 36 DC D6 0D 12 A4 9B 72
|
|
|
|
|
01C0 | B0 8A DE A3 44 9D B5 C2 CB F8 06 D2 F2 DE B6 32
|
|
|
|
|
01D0 | F6 31 FB 38 ED 32 55 B9 89 CC 4C 0D B5 1E 1A 27
|
|
|
|
|
01E0 | 45 EE 68 22 12 5C 53 97 32 AC 28 92 F7 03 A6 3E
|
|
|
|
|
01F0 | 9C 75 73 89 54 C7 A2 0E 75 28 47 87 EF A5 68 E4
|
|
|
|
|
0200 | D6 C8 96 C8 18 D8 51 0B 79 16 32 D1 D7 A8 D8 90
|
|
|
|
|
0210 | 6F A1 81 52 66 14 08 32 57 34 5C 9D FF E9 3C AF
|
|
|
|
|
0220 | B5 B0 33 99 86 F6 B3 82 F4 E3 75 8D 22 53 10 A6
|
|
|
|
|
0230 | 16 A2 35 D1 4F 4C 47 35 CD 7C 6A F5 C2 73 56 B3
|
|
|
|
|
0240 | E0 45 57 43 D3 E2 D7 06 52 62 5F 72 D9 12 C5 2A
|
|
|
|
|
0250 | C3 A2 F0 26 5C 0A 75 BB 5D 30 9A A5 B0 43 D9 D5
|
|
|
|
|
0260 | CD B2 86 19 1F F3 4E 84 0F B6 CD 33 1F 0F 52 9E
|
|
|
|
|
0270 | 0B C5 1F AC 89 8B 3F 92 F5 B9 82 35 11 EF 1C E2
|
|
|
|
|
0280 | EA EC F1 20 7B 88 FB FB 96 92 4A 47</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 = 8053F00D9FE8DDFF7E3B727D6C3FC737B3C161C7B610EDDBF518944EE
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>01AC6CFB7E621C65</code></td>
|
|
|
|
|
<td><code>01D4B2902AB81D65</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>CC020000</code> (716 in decimal)</td>
|
|
|
|
|
<td><code>A4020000</code> (676 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -482,19 +482,19 @@ random_padding_bytes = 8053F00D9FE8DDFF7E3B727D6C3FC737B3C161C7B610EDDBF518944EE
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>172F85E71761F3BB2CBDBE712D1EAFE5</code></td>
|
|
|
|
|
<td><code>7F1F22C609723BCD45F708F0F99E90BF</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>8817DBE8742077FA5F1C0C1C6FF058BD</code></td>
|
|
|
|
|
<td><code>E9B10D8709A3900EF8898360108561ED</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE500200613EF99416A06493A862CC34</code> <code>AC4DAD0CA634F4168F80A8718575FF51</code> <code>42CE9F1573C3251D6CF21280805ACF10</code> <code>22A9B4D1C2697CF0B8EFA3ADE105EF95</code> <code>233C169166EDEC2F7B930F2C6384900A</code> <code>D8E01AE90818D0D7CF3B4AACABA8AF05</code> <code>EA879E93F345B3DF653DF023F8E84D6C</code> <code>298FEC7D91A0311B2E5F7A293AB3478B</code> <code>D51DC18A00E31E826A495FD4F7A7455E</code> <code>4EE5FE852723E2B5877DE24FCAA5C9E6</code> <code>4A858B460427D4055AD345811401FED3</code> <code>9A21DC6A9DECB796302BBBA687751C8E</code> <code>88847631C0A59DFFDBFC719D07105C50</code> <code>BEFCE89BBD61CCEF86B192BF80CFD42B</code> <code>B18349D25558A41108D6C7EBD203DA4B</code> <code>14E38CAFC80B97071EC8EABBEB5CCACD</code> <code>336039850729BD21E4A1D3659DF3FD38</code> <code>1E79EEA0EC711A0D15AEB0D9A269C300</code> <code>AA65E41CE59CAB4604DF245D26FC8613</code> <code>D1562375D178B7E72749C1C17175F8E8</code> <code>2DED77FA4268E123AB08B6661D94F739</code> <code>4045623D5CBA6BB93D8274FF1F73E549</code> <code>0AB7AF0E383BD9FCE46869392527B632</code> <code>C7950B9B9594D8F73E4EFEEB5E32242B</code> <code>5560244341894F2F7E8D5763AE604861</code> <code>FB2E79EC345F702B3A30DEF41F81C618</code> <code>22183A9CC0F161874806DB55F723A95D</code> <code>52A76B71ED38AFAF12925D6CDBD54C41</code> <code>D893621C60BB348941479AF313A59541</code> <code>EC869BE8A470488E19977B70B47D748C</code> <code>3555821FC7E8134E3044FA7F74AC2D49</code> <code>60EE4EE02349DDC34BCFC20A4321BC08</code> <code>2FC1476669FAB54BB8F5EB07A98AD73B</code> <code>A04AEE46C6F3768CB0B6BB7DA6DD5CED</code> <code>7E72E110321A31C0F9775D4B4D897709</code> <code>C0783EFA269D195C41C1F8A96F7875D2</code> <code>0141F23B3BE53CF44023D28BAFEABACC</code><br> <code>7E701B08</code></td>
|
|
|
|
|
<td><code>FE500200133EAF1EB20387D432F585DD</code> <code>9ECAA4B8F3723F6C992066791323BCE6</code> <code>53FE5AD19BCFC24D230FCA247C686A14</code> <code>901CB959B12ADD3BBDF627F1F5D58A0F</code> <code>FE5F54F03C27B54201CCE7698C7E9FD1</code> <code>CD6D62ECF0BD50B6FE01E5CEE9B26F4A</code> <code>B8A0C6ADDDDC2BF032720C305E700150</code> <code>011662F176F6DF722A593B3E1281739D</code> <code>06324AF481016C7577F9EBB7E559330D</code> <code>1971E501515E42718B7FCD883BB2AF6A</code> <code>90B2A0E68F8ADD50D17CA9D3BE300617</code> <code>4CC4ECCEF8F9FA0F539DBCDCF0A0C648</code> <code>DA8C7629071C6C8AB074CC20651EACB5</code> <code>DC34B41FF9907B596A5FE158F087D496</code> <code>47F9E801C8BF746DABD3A42A9AF533E3</code> <code>292D0D5C7213A0331BC789E023F34C0B</code> <code>006C13C6D53E6EFD3F04AD13FA048932</code> <code>A4DA95ACDD8E9348A657F3EF7AB097B8</code> <code>5946D7EAC44F9D761ECC3ED16C032FD4</code> <code>634EFA4FF9A4D224DF86FE2DC7963B39</code> <code>7D87B9489985DD92A637208BB1E4A527</code> <code>4747312760F8F19FDFBBF1FAAC65C299</code> <code>E494A58FD36E8B2D982CEECDA584ED63</code> <code>FB07A7BC9AB6F882D5F5007B75BD1C0C</code> <code>36DCD60D12A49B72B08ADEA3449DB5C2</code> <code>CBF806D2F2DEB632F631FB38ED3255B9</code> <code>89CC4C0DB51E1A2745EE6822125C5397</code> <code>32AC2892F703A63E9C75738954C7A20E</code> <code>75284787EFA568E4D6C896C818D8510B</code> <code>791632D1D7A8D8906FA1815266140832</code> <code>57345C9DFFE93CAFB5B0339986F6B382</code> <code>F4E3758D225310A616A235D14F4C4735</code> <code>CD7C6AF5C27356B3E0455743D3E2D706</code> <code>52625F72D912C52AC3A2F0265C0A75BB</code> <code>5D309AA5B043D9D5CDB286191FF34E84</code> <code>0FB6CD331F0F529E0BC51FAC898B3F92</code> <code>F5B9823511EF1CE2EAECF1207B88FBFB</code><br> <code>96924A47</code></td>
|
|
|
|
|
<td>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = 8053F00D9FE8DDFF7E3B727D6C3FC737B3C161C7B610EDDBF518944EE
|
|
|
|
|
<!-- 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 = 613EF99416A06493A862CC34AC4DAD0CA634F4168F80A8718575FF5142CE9F1573C3251D6CF21280805ACF1022A9B4D1C2697CF0B8EFA3ADE105EF95233C169166EDEC2F7B930F2C6384900AD8E01AE90818D0D7CF3B4AACABA8AF05EA879E93F345B3DF653DF023F8E84D6C298FEC7D91A0311B2E5F7A293AB3478BD51DC18A00E31E826A495FD4F7A7455E4EE5FE852723E2B5877DE24FCAA5C9E64A858B460427D4055AD345811401FED39A21DC6A9DECB796302BBBA687751C8E88847631C0A59DFFDBFC719D07105C50BEFCE89BBD61CCEF86B192BF80CFD42BB18349D25558A41108D6C7EBD203DA4B14E38CAFC80B97071EC8EABBEB5CCACD336039850729BD21E4A1D3659DF3FD381E79EEA0EC711A0D15AEB0D9A269C300AA65E41CE59CAB4604DF245D26FC8613D1562375D178B7E72749C1C17175F8E82DED77FA4268E123AB08B6661D94F7394045623D5CBA6BB93D8274FF1F73E5490AB7AF0E383BD9FCE46869392527B632C7950B9B9594D8F73E4EFEEB5E32242B5560244341894F2F7E8D5763AE604861FB2E79EC345F702B3A30DEF41F81C61822183A9CC0F161874806DB55F723A95D52A76B71ED38AFAF12925D6CDBD54C41D893621C60BB348941479AF313A59541EC869BE8A470488E19977B70B47D748C3555821FC7E8134E3044FA7F74AC2D4960EE4EE02349DDC34BCFC20A4321BC082FC1476669FAB54BB8F5EB07A98AD73BA04AEE46C6F3768CB0B6BB7DA6DD5CED7E72E110321A31C0F9775D4B4D897709C0783EFA269D195C41C1F8A96F7875D20141F23B3BE53CF44023D28BAFEABACC7E701B08
|
|
|
|
|
tmp_aes_key = 27E43D018B2EF8AF3395B27B19DF173DD09438278E712FB63CDDEBBEAE0CBE6C
|
|
|
|
|
tmp_aes_iv = EA31E588F2C4D371DD73B81C016BC9B12BDF9B29AB42D106FD2CCED63656DBB3</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = 133EAF1EB20387D432F585DD9ECAA4B8F3723F6C992066791323BCE653FE5AD19BCFC24D230FCA247C686A14901CB959B12ADD3BBDF627F1F5D58A0FFE5F54F03C27B54201CCE7698C7E9FD1CD6D62ECF0BD50B6FE01E5CEE9B26F4AB8A0C6ADDDDC2BF032720C305E700150011662F176F6DF722A593B3E1281739D06324AF481016C7577F9EBB7E559330D1971E501515E42718B7FCD883BB2AF6A90B2A0E68F8ADD50D17CA9D3BE3006174CC4ECCEF8F9FA0F539DBCDCF0A0C648DA8C7629071C6C8AB074CC20651EACB5DC34B41FF9907B596A5FE158F087D49647F9E801C8BF746DABD3A42A9AF533E3292D0D5C7213A0331BC789E023F34C0B006C13C6D53E6EFD3F04AD13FA048932A4DA95ACDD8E9348A657F3EF7AB097B85946D7EAC44F9D761ECC3ED16C032FD4634EFA4FF9A4D224DF86FE2DC7963B397D87B9489985DD92A637208BB1E4A5274747312760F8F19FDFBBF1FAAC65C299E494A58FD36E8B2D982CEECDA584ED63FB07A7BC9AB6F882D5F5007B75BD1C0C36DCD60D12A49B72B08ADEA3449DB5C2CBF806D2F2DEB632F631FB38ED3255B989CC4C0DB51E1A2745EE6822125C539732AC2892F703A63E9C75738954C7A20E75284787EFA568E4D6C896C818D8510B791632D1D7A8D8906FA181526614083257345C9DFFE93CAFB5B0339986F6B382F4E3758D225310A616A235D14F4C4735CD7C6AF5C27356B3E0455743D3E2D70652625F72D912C52AC3A2F0265C0A75BB5D309AA5B043D9D5CDB286191FF34E840FB6CD331F0F529E0BC51FAC898B3F92F5B9823511EF1CE2EAECF1207B88FBFB96924A47
|
|
|
|
|
tmp_aes_key = 5E753C94B9FCA27B05005EAD0F3E8318501C3242E1FDE09E523ED033E1D9F393
|
|
|
|
|
tmp_aes_iv = CB5D109B5A14C5077CE6ED86B2B19E46DFA3EC4AD2E3E14B921E71AA2D8FD1E4</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = CEDFCC7073A25B1887B35BCB78F39E386AA06D63BA0D89B5172F85E71761F3BB2CBDBE712D1EAFE58817DBE8742077FA5F1C0C1C6FF058BD03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001008DC5651CB12C9F356AB2D51621AEA73B50365C5F8B5E1C9CFFD296864FCD931229EBB650607C26795A923E81CEC067A22712D1D35F5D9D99013F3B3E39A6C3C9CE38F95F53299F56F9C6792594848AA5C803D1607ACEA125619CB5624D3BE2A47C904B3FA402AE8691B8038676326CF6ED55C1E42229621F09E6B6EA0138FF63C03C185112A6C735BFF2D7C62595F570721CCDB915AFE67D16BAF8ADF660F8F15C6BC9C8C6C23B74C28DDF5626CA97B6007EB475F1D30FA5D37D5EC17830B66C8BE78FD5DFA136B98ADAE360ED6FD3082E3B6205B811102977A298620E965B8FBC5756CD76D738AADCF2CB69D3D0D4E4294F64CD70993FCCEF275191A92D00B47E621C65614B3887B7E3A96A
|
|
|
|
|
answer = BA0D89B5172F85E71761F3BB2CBDBE712D1EAFE58817DBE8742077FA5F1C0C1C6FF058BD03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001008DC5651CB12C9F356AB2D51621AEA73B50365C5F8B5E1C9CFFD296864FCD931229EBB650607C26795A923E81CEC067A22712D1D35F5D9D99013F3B3E39A6C3C9CE38F95F53299F56F9C6792594848AA5C803D1607ACEA125619CB5624D3BE2A47C904B3FA402AE8691B8038676326CF6ED55C1E42229621F09E6B6EA0138FF63C03C185112A6C735BFF2D7C62595F570721CCDB915AFE67D16BAF8ADF660F8F15C6BC9C8C6C23B74C28DDF5626CA97B6007EB475F1D30FA5D37D5EC17830B66C8BE78FD5DFA136B98ADAE360ED6FD3082E3B6205B811102977A298620E965B8FBC5756CD76D738AADCF2CB69D3D0D4E4294F64CD70993FCCEF275191A92D00B47E621C65614B3887B7E3A96A</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = 5AE7003DFE5470A8F4F0E9677AE7C88B22684AD2BA0D89B57F1F22C609723BCD45F708F0F99E90BFE9B10D8709A3900EF8898360108561ED03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010058B8300D1BDC9FC3D40215E54A5D85EFFDE73FA7BF8045FEEA78B52806A2B816B3EE1C11CFCE4F9AC6CDC15EE00DFFEC00E54DC16A3391FEBCDB1E45F7FB8732B074DDB3298470C3989CEF21A1F38EFB850A85885EB1391FE40EC8183745F490C4476F1F07167DE5B487A666A10A4FB3DFC14B08676307328D4B496E98B16730A1AD6509BDFC8188E5DDC7A56EAF72DB4F1377FC22C593C7CAC466AFA49084899309513B04B5E64737244D4EA62B8362F4242A3F749CFA24D1ABDCCC8E3E21C0B296301885925A64E009C149A6518DC6336431F6689140CB1110585A2B51BF2C88E59BDDFFA457100D0F0BE00CCBE2C1C5D53141B18C52B6FCFF716BF6AE8D522AB81D65E58BD6003A5C0B42
|
|
|
|
|
answer = BA0D89B57F1F22C609723BCD45F708F0F99E90BFE9B10D8709A3900EF8898360108561ED03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010058B8300D1BDC9FC3D40215E54A5D85EFFDE73FA7BF8045FEEA78B52806A2B816B3EE1C11CFCE4F9AC6CDC15EE00DFFEC00E54DC16A3391FEBCDB1E45F7FB8732B074DDB3298470C3989CEF21A1F38EFB850A85885EB1391FE40EC8183745F490C4476F1F07167DE5B487A666A10A4FB3DFC14B08676307328D4B496E98B16730A1AD6509BDFC8188E5DDC7A56EAF72DB4F1377FC22C593C7CAC466AFA49084899309513B04B5E64737244D4EA62B8362F4242A3F749CFA24D1ABDCCC8E3E21C0B296301885925A64E009C149A6518DC6336431F6689140CB1110585A2B51BF2C88E59BDDFFA457100D0F0BE00CCBE2C1C5D53141B18C52B6FCFF716BF6AE8D522AB81D65E58BD6003A5C0B42</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 17 2F 85 E7 17 61 F3 BB 2C BD BE 71
|
|
|
|
|
0010 | 2D 1E AF E5 88 17 DB E8 74 20 77 FA 5F 1C 0C 1C
|
|
|
|
|
0020 | 6F F0 58 BD 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 7F 1F 22 C6 09 72 3B CD 45 F7 08 F0
|
|
|
|
|
0010 | F9 9E 90 BF E9 B1 0D 87 09 A3 90 0E F8 89 83 60
|
|
|
|
|
0020 | 10 85 61 ED 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 = BA0D89B5172F85E71761F3BB2CBDBE712D1EAFE58817DBE8742077FA5F1C0C1C6FF058B
|
|
|
|
|
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 | 8D C5 65 1C B1 2C 9F 35 6A B2 D5 16 21 AE A7 3B
|
|
|
|
|
0140 | 50 36 5C 5F 8B 5E 1C 9C FF D2 96 86 4F CD 93 12
|
|
|
|
|
0150 | 29 EB B6 50 60 7C 26 79 5A 92 3E 81 CE C0 67 A2
|
|
|
|
|
0160 | 27 12 D1 D3 5F 5D 9D 99 01 3F 3B 3E 39 A6 C3 C9
|
|
|
|
|
0170 | CE 38 F9 5F 53 29 9F 56 F9 C6 79 25 94 84 8A A5
|
|
|
|
|
0180 | C8 03 D1 60 7A CE A1 25 61 9C B5 62 4D 3B E2 A4
|
|
|
|
|
0190 | 7C 90 4B 3F A4 02 AE 86 91 B8 03 86 76 32 6C F6
|
|
|
|
|
01A0 | ED 55 C1 E4 22 29 62 1F 09 E6 B6 EA 01 38 FF 63
|
|
|
|
|
01B0 | C0 3C 18 51 12 A6 C7 35 BF F2 D7 C6 25 95 F5 70
|
|
|
|
|
01C0 | 72 1C CD B9 15 AF E6 7D 16 BA F8 AD F6 60 F8 F1
|
|
|
|
|
01D0 | 5C 6B C9 C8 C6 C2 3B 74 C2 8D DF 56 26 CA 97 B6
|
|
|
|
|
01E0 | 00 7E B4 75 F1 D3 0F A5 D3 7D 5E C1 78 30 B6 6C
|
|
|
|
|
01F0 | 8B E7 8F D5 DF A1 36 B9 8A DA E3 60 ED 6F D3 08
|
|
|
|
|
0200 | 2E 3B 62 05 B8 11 10 29 77 A2 98 62 0E 96 5B 8F
|
|
|
|
|
0210 | BC 57 56 CD 76 D7 38 AA DC F2 CB 69 D3 D0 D4 E4
|
|
|
|
|
0220 | 29 4F 64 CD 70 99 3F CC EF 27 51 91 A9 2D 00 B4
|
|
|
|
|
0230 | 7E 62 1C 65</code></pre>
|
|
|
|
|
0130 | 58 B8 30 0D 1B DC 9F C3 D4 02 15 E5 4A 5D 85 EF
|
|
|
|
|
0140 | FD E7 3F A7 BF 80 45 FE EA 78 B5 28 06 A2 B8 16
|
|
|
|
|
0150 | B3 EE 1C 11 CF CE 4F 9A C6 CD C1 5E E0 0D FF EC
|
|
|
|
|
0160 | 00 E5 4D C1 6A 33 91 FE BC DB 1E 45 F7 FB 87 32
|
|
|
|
|
0170 | B0 74 DD B3 29 84 70 C3 98 9C EF 21 A1 F3 8E FB
|
|
|
|
|
0180 | 85 0A 85 88 5E B1 39 1F E4 0E C8 18 37 45 F4 90
|
|
|
|
|
0190 | C4 47 6F 1F 07 16 7D E5 B4 87 A6 66 A1 0A 4F B3
|
|
|
|
|
01A0 | DF C1 4B 08 67 63 07 32 8D 4B 49 6E 98 B1 67 30
|
|
|
|
|
01B0 | A1 AD 65 09 BD FC 81 88 E5 DD C7 A5 6E AF 72 DB
|
|
|
|
|
01C0 | 4F 13 77 FC 22 C5 93 C7 CA C4 66 AF A4 90 84 89
|
|
|
|
|
01D0 | 93 09 51 3B 04 B5 E6 47 37 24 4D 4E A6 2B 83 62
|
|
|
|
|
01E0 | F4 24 2A 3F 74 9C FA 24 D1 AB DC CC 8E 3E 21 C0
|
|
|
|
|
01F0 | B2 96 30 18 85 92 5A 64 E0 09 C1 49 A6 51 8D C6
|
|
|
|
|
0200 | 33 64 31 F6 68 91 40 CB 11 10 58 5A 2B 51 BF 2C
|
|
|
|
|
0210 | 88 E5 9B DD FF A4 57 10 0D 0F 0B E0 0C CB E2 C1
|
|
|
|
|
0220 | C5 D5 31 41 B1 8C 52 B6 FC FF 71 6B F6 AE 8D 52
|
|
|
|
|
0230 | 2A B8 1D 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 = BA0D89B5172F85E71761F3BB2CBDBE712D1EAFE58817DBE8742077FA5F1C0C1C6FF058B
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>172F85E71761F3BB2CBDBE712D1EAFE5</code></td>
|
|
|
|
|
<td><code>7F1F22C609723BCD45F708F0F99E90BF</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>8817DBE8742077FA5F1C0C1C6FF058BD</code></td>
|
|
|
|
|
<td><code>E9B10D8709A3900EF8898360108561ED</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B5172F85E71761F3BB2CBDBE712D1EAFE58817DBE8742077FA5F1C0C1C6FF058B
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE0001008DC5651CB12C9F356AB2D516</code> <code>21AEA73B50365C5F8B5E1C9CFFD29686</code> <code>4FCD931229EBB650607C26795A923E81</code> <code>CEC067A22712D1D35F5D9D99013F3B3E</code> <code>39A6C3C9CE38F95F53299F56F9C67925</code> <code>94848AA5C803D1607ACEA125619CB562</code> <code>4D3BE2A47C904B3FA402AE8691B80386</code> <code>76326CF6ED55C1E42229621F09E6B6EA</code> <code>0138FF63C03C185112A6C735BFF2D7C6</code> <code>2595F570721CCDB915AFE67D16BAF8AD</code> <code>F660F8F15C6BC9C8C6C23B74C28DDF56</code> <code>26CA97B6007EB475F1D30FA5D37D5EC1</code> <code>7830B66C8BE78FD5DFA136B98ADAE360</code> <code>ED6FD3082E3B6205B811102977A29862</code> <code>0E965B8FBC5756CD76D738AADCF2CB69</code> <code>D3D0D4E4294F64CD70993FCCEF275191</code><br> <code>A92D00B4</code></td>
|
|
|
|
|
<td><code>FE00010058B8300D1BDC9FC3D40215E5</code> <code>4A5D85EFFDE73FA7BF8045FEEA78B528</code> <code>06A2B816B3EE1C11CFCE4F9AC6CDC15E</code> <code>E00DFFEC00E54DC16A3391FEBCDB1E45</code> <code>F7FB8732B074DDB3298470C3989CEF21</code> <code>A1F38EFB850A85885EB1391FE40EC818</code> <code>3745F490C4476F1F07167DE5B487A666</code> <code>A10A4FB3DFC14B08676307328D4B496E</code> <code>98B16730A1AD6509BDFC8188E5DDC7A5</code> <code>6EAF72DB4F1377FC22C593C7CAC466AF</code> <code>A49084899309513B04B5E64737244D4E</code> <code>A62B8362F4242A3F749CFA24D1ABDCCC</code> <code>8E3E21C0B296301885925A64E009C149</code> <code>A6518DC6336431F6689140CB1110585A</code> <code>2B51BF2C88E59BDDFFA457100D0F0BE0</code> <code>0CCBE2C1C5D53141B18C52B6FCFF716B</code><br> <code>F6AE8D52</code></td>
|
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>7E621C65</code> (1696359038 in decimal)</td>
|
|
|
|
|
<td><code>2AB81D65</code> (1696446506 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B5172F85E71761F3BB2CBDBE712D1EAFE58817DBE8742077FA5F1C0C1C6FF058B
|
|
|
|
|
<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 = F226B4AB8313660386E985D25151773C42B73164114F9FC139B99799B052283CDCEA6EFCA93D07DA68897D2E5A6AA14AB38C57146984A9EE1F127265E7234E16C9C76EFD83CB5AA6A59FD26AC3146F7E3953EB56FA62207228CBB41774F49DFFC05C4D97A644D09999AAEB1A7A4A7167B83B82DD1877B95EACCC758D7779A98F3CEF3C781AE8BFB7B72B2E2AEBEC53651898396AFA006010DCC456A8703120852B0F460199AC160A52A083D4061DBBA105566E9478AE5B9CC2EF8A032A8358AC55B840C4F9A7DC70469A39F887E93489A72E2B492C5E88B94738900A6EF9CEF83A05F7410B720793BEA9C49440CB9543E081D2098C9F79FB1832DDF76F0AA0E1</code></pre>
|
|
|
|
|
<pre><code>b = 6F419AA374D937DF6A21C3686EAF6202514745E51CC8F33C3EF3C25601A6E237C5019C505B9B3B4BF41360FFAAF5E759569A4892AA078F2EBED5BA69A7A0358B40D75C5226A16B28875E892700DD6D34C6C38FC1B56DE68C3F19C333AC9B93901A010B9F5C2E6CA452E525EB1AFFFB89D2B33AF5F83569616D6EB9F0D817D3ECA9A5721EB5A8A21469B761EAE6D2034BA6F4272E368598034F263744E5060997704708969D13A0BDEAA9F7930F8A6540FB73A50503BE6519D26DC63C6B2B673F8ED12D0D8E0B1E1A22A52B8187F6EDB945A347FF39F5F38FACA525DAF830FEE43E9B2212E58D4388117D93DBBDEE1D1FEBC04964D708F2C3E65DED28376868AC</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 = 239C05827B2E75E7EA297C4E957EB25C0C4A2DD8BC20E36B17D3AE69943522CF0D09EC0720487AEFA88CCCC66ADA24887120D3F325E29C0200E63C38872FD9D514981EB2B18287413EB912FEA618766F1805984748BF59FBDB5E35A35B379960576AAE3B852DBD4D36C34EC9ADC15118CBF4EE83238D7BFEDF4DE0A408AC74F63273261D4678615D5A5ADF950D4FF9E2D441119976C79C56BD5343AC6C04697D115A5917AE29488EC9C8F10B7AC4836FDC36304464905392FA6FBADAB5E684D43616E03BDDF68C230A18A34642301EA7ACB0165C97B88E08BE2BADC95E75D4FC2F54C9ABE9B0F1C2BC2BBFD97AE9B44F186C498B3E6967DAC1E1E4AA5A8F3866</code></pre>
|
|
|
|
|
<pre><code>g_b = 457C07E8E8B47AA78DBB462D58E210659C6992D653E1CAB0C85813F0575409C4821B045DF82EC483A333906EDC4FDD9C3E834C2874EEA12A2D0D60405E4C404EA069A8609C635FD103E6A7301B4E274D815BA8E9EBA1A2A7C38D4A255BEF8DA45A83495AB59AA781226D2929E511C73B0454407674B7F4132A387DA023EB7D09D7F30A95765ACB2D87424AF23F52F72871AC281F1053B224F9942B551A59E086E1A6983847C99F1D2502F576B3314AC2CC081659B62F0742C14C1E3181B6EB0863115B9E88A1E6B73CB30C56B3464CED6A5503D9E8209F8DE3B5267C977A036FE75FCF4F1F5D6CF576B19F347858863CAB8CF5E14F9B06F8CD00052829635AAE</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 17 2F 85 E7 17 61 F3 BB 2C BD BE 71
|
|
|
|
|
0010 | 2D 1E AF E5 88 17 DB E8 74 20 77 FA 5F 1C 0C 1C
|
|
|
|
|
0020 | 6F F0 58 BD 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 23 9C 05 82 7B 2E 75 E7 EA 29 7C 4E 95 7E B2 5C
|
|
|
|
|
0040 | 0C 4A 2D D8 BC 20 E3 6B 17 D3 AE 69 94 35 22 CF
|
|
|
|
|
0050 | 0D 09 EC 07 20 48 7A EF A8 8C CC C6 6A DA 24 88
|
|
|
|
|
0060 | 71 20 D3 F3 25 E2 9C 02 00 E6 3C 38 87 2F D9 D5
|
|
|
|
|
0070 | 14 98 1E B2 B1 82 87 41 3E B9 12 FE A6 18 76 6F
|
|
|
|
|
0080 | 18 05 98 47 48 BF 59 FB DB 5E 35 A3 5B 37 99 60
|
|
|
|
|
0090 | 57 6A AE 3B 85 2D BD 4D 36 C3 4E C9 AD C1 51 18
|
|
|
|
|
00A0 | CB F4 EE 83 23 8D 7B FE DF 4D E0 A4 08 AC 74 F6
|
|
|
|
|
00B0 | 32 73 26 1D 46 78 61 5D 5A 5A DF 95 0D 4F F9 E2
|
|
|
|
|
00C0 | D4 41 11 99 76 C7 9C 56 BD 53 43 AC 6C 04 69 7D
|
|
|
|
|
00D0 | 11 5A 59 17 AE 29 48 8E C9 C8 F1 0B 7A C4 83 6F
|
|
|
|
|
00E0 | DC 36 30 44 64 90 53 92 FA 6F BA DA B5 E6 84 D4
|
|
|
|
|
00F0 | 36 16 E0 3B DD F6 8C 23 0A 18 A3 46 42 30 1E A7
|
|
|
|
|
0100 | AC B0 16 5C 97 B8 8E 08 BE 2B AD C9 5E 75 D4 FC
|
|
|
|
|
0110 | 2F 54 C9 AB E9 B0 F1 C2 BC 2B BF D9 7A E9 B4 4F
|
|
|
|
|
0120 | 18 6C 49 8B 3E 69 67 DA C1 E1 E4 AA 5A 8F 38 66</code></pre>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 7F 1F 22 C6 09 72 3B CD 45 F7 08 F0
|
|
|
|
|
0010 | F9 9E 90 BF E9 B1 0D 87 09 A3 90 0E F8 89 83 60
|
|
|
|
|
0020 | 10 85 61 ED 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 45 7C 07 E8 E8 B4 7A A7 8D BB 46 2D 58 E2 10 65
|
|
|
|
|
0040 | 9C 69 92 D6 53 E1 CA B0 C8 58 13 F0 57 54 09 C4
|
|
|
|
|
0050 | 82 1B 04 5D F8 2E C4 83 A3 33 90 6E DC 4F DD 9C
|
|
|
|
|
0060 | 3E 83 4C 28 74 EE A1 2A 2D 0D 60 40 5E 4C 40 4E
|
|
|
|
|
0070 | A0 69 A8 60 9C 63 5F D1 03 E6 A7 30 1B 4E 27 4D
|
|
|
|
|
0080 | 81 5B A8 E9 EB A1 A2 A7 C3 8D 4A 25 5B EF 8D A4
|
|
|
|
|
0090 | 5A 83 49 5A B5 9A A7 81 22 6D 29 29 E5 11 C7 3B
|
|
|
|
|
00A0 | 04 54 40 76 74 B7 F4 13 2A 38 7D A0 23 EB 7D 09
|
|
|
|
|
00B0 | D7 F3 0A 95 76 5A CB 2D 87 42 4A F2 3F 52 F7 28
|
|
|
|
|
00C0 | 71 AC 28 1F 10 53 B2 24 F9 94 2B 55 1A 59 E0 86
|
|
|
|
|
00D0 | E1 A6 98 38 47 C9 9F 1D 25 02 F5 76 B3 31 4A C2
|
|
|
|
|
00E0 | CC 08 16 59 B6 2F 07 42 C1 4C 1E 31 81 B6 EB 08
|
|
|
|
|
00F0 | 63 11 5B 9E 88 A1 E6 B7 3C B3 0C 56 B3 46 4C ED
|
|
|
|
|
0100 | 6A 55 03 D9 E8 20 9F 8D E3 B5 26 7C 97 7A 03 6F
|
|
|
|
|
0110 | E7 5F CF 4F 1F 5D 6C F5 76 B1 9F 34 78 58 86 3C
|
|
|
|
|
0120 | AB 8C F5 E1 4F 9B 06 F8 CD 00 05 28 29 63 5A AE</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 = BA0D89B5172F85E71761F3BB2CBDBE712D1EAFE58817DBE8742077FA5F1C0C1C6FF058B
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>172F85E71761F3BB2CBDBE712D1EAFE5</code></td>
|
|
|
|
|
<td><code>7F1F22C609723BCD45F708F0F99E90BF</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>8817DBE8742077FA5F1C0C1C6FF058BD</code></td>
|
|
|
|
|
<td><code>E9B10D8709A3900EF8898360108561ED</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE000100239C05827B2E75E7EA297C4E</code> <code>957EB25C0C4A2DD8BC20E36B17D3AE69</code> <code>943522CF0D09EC0720487AEFA88CCCC6</code> <code>6ADA24887120D3F325E29C0200E63C38</code> <code>872FD9D514981EB2B18287413EB912FE</code> <code>A618766F1805984748BF59FBDB5E35A3</code> <code>5B379960576AAE3B852DBD4D36C34EC9</code> <code>ADC15118CBF4EE83238D7BFEDF4DE0A4</code> <code>08AC74F63273261D4678615D5A5ADF95</code> <code>0D4FF9E2D441119976C79C56BD5343AC</code> <code>6C04697D115A5917AE29488EC9C8F10B</code> <code>7AC4836FDC36304464905392FA6FBADA</code> <code>B5E684D43616E03BDDF68C230A18A346</code> <code>42301EA7ACB0165C97B88E08BE2BADC9</code> <code>5E75D4FC2F54C9ABE9B0F1C2BC2BBFD9</code> <code>7AE9B44F186C498B3E6967DAC1E1E4AA</code><br> <code>5A8F3866</code></td>
|
|
|
|
|
<td><code>FE000100457C07E8E8B47AA78DBB462D</code> <code>58E210659C6992D653E1CAB0C85813F0</code> <code>575409C4821B045DF82EC483A333906E</code> <code>DC4FDD9C3E834C2874EEA12A2D0D6040</code> <code>5E4C404EA069A8609C635FD103E6A730</code> <code>1B4E274D815BA8E9EBA1A2A7C38D4A25</code> <code>5BEF8DA45A83495AB59AA781226D2929</code> <code>E511C73B0454407674B7F4132A387DA0</code> <code>23EB7D09D7F30A95765ACB2D87424AF2</code> <code>3F52F72871AC281F1053B224F9942B55</code> <code>1A59E086E1A6983847C99F1D2502F576</code> <code>B3314AC2CC081659B62F0742C14C1E31</code> <code>81B6EB0863115B9E88A1E6B73CB30C56</code> <code>B3464CED6A5503D9E8209F8DE3B5267C</code> <code>977A036FE75FCF4F1F5D6CF576B19F34</code> <code>7858863CAB8CF5E14F9B06F8CD000528</code><br> <code>29635AAE</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 = BA0D89B5172F85E71761F3BB2CBDBE712D1EAFE58817DBE8742077FA5F1C0C1C6FF058B
|
|
|
|
|
<!-- 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 = 54B64366172F85E71761F3BB2CBDBE712D1EAFE58817DBE8742077FA5F1C0C1C6FF058BD0000000000000000FE000100239C05827B2E75E7EA297C4E957EB25C0C4A2DD8BC20E36B17D3AE69943522CF0D09EC0720487AEFA88CCCC66ADA24887120D3F325E29C0200E63C38872FD9D514981EB2B18287413EB912FEA618766F1805984748BF59FBDB5E35A35B379960576AAE3B852DBD4D36C34EC9ADC15118CBF4EE83238D7BFEDF4DE0A408AC74F63273261D4678615D5A5ADF950D4FF9E2D441119976C79C56BD5343AC6C04697D115A5917AE29488EC9C8F10B7AC4836FDC36304464905392FA6FBADAB5E684D43616E03BDDF68C230A18A34642301EA7ACB0165C97B88E08BE2BADC95E75D4FC2F54C9ABE9B0F1C2BC2BBFD97AE9B44F186C498B3E6967DAC1E1E4AA5A8F3866
|
|
|
|
|
padding = F71920395D1DC608B1E457B5
|
|
|
|
|
tmp_aes_key = 27E43D018B2EF8AF3395B27B19DF173DD09438278E712FB63CDDEBBEAE0CBE6C
|
|
|
|
|
tmp_aes_iv = EA31E588F2C4D371DD73B81C016BC9B12BDF9B29AB42D106FD2CCED63656DBB3</code></pre>
|
|
|
|
|
<pre><code>data = 54B643667F1F22C609723BCD45F708F0F99E90BFE9B10D8709A3900EF8898360108561ED0000000000000000FE000100457C07E8E8B47AA78DBB462D58E210659C6992D653E1CAB0C85813F0575409C4821B045DF82EC483A333906EDC4FDD9C3E834C2874EEA12A2D0D60405E4C404EA069A8609C635FD103E6A7301B4E274D815BA8E9EBA1A2A7C38D4A255BEF8DA45A83495AB59AA781226D2929E511C73B0454407674B7F4132A387DA023EB7D09D7F30A95765ACB2D87424AF23F52F72871AC281F1053B224F9942B551A59E086E1A6983847C99F1D2502F576B3314AC2CC081659B62F0742C14C1E3181B6EB0863115B9E88A1E6B73CB30C56B3464CED6A5503D9E8209F8DE3B5267C977A036FE75FCF4F1F5D6CF576B19F347858863CAB8CF5E14F9B06F8CD00052829635AAE
|
|
|
|
|
padding = CBB1235D6135B0C1C710035D
|
|
|
|
|
tmp_aes_key = 5E753C94B9FCA27B05005EAD0F3E8318501C3242E1FDE09E523ED033E1D9F393
|
|
|
|
|
tmp_aes_iv = CB5D109B5A14C5077CE6ED86B2B19E46DFA3EC4AD2E3E14B921E71AA2D8FD1E4</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 = 3E0F2FF2F1AD61511CEE9C91A06607A63F2C2AC4D9EB416C9AF137C66E9F0BB8C8ACAFA9D30695842206A873099F3935F812B570669EDAB1775DCA7811F49B41ABABC932ED325C804726BEAAABC52C40A39A97E75171B75CFB13ECF58BED2E14D411EAA7CB098FA49DBA15FFAE05E2E35963BA622862BADE2CB1A1608A5E9ACCF8B02F6FAA4DC092A25051533302B6FF9A3939C0FCD92AB0237A499C9112BA91BF2801C0987F54760BF3422A68C435AE5E75AEC837015A41587EAF32E715A7C767FC19F94AA21444FB3A6BAC1B6B8CD0A9118374C7D96B3A31740655A162777BF6487E160E6C8C0EAD25DA521414BF1A1C002F69C8A5C6BD2557389EB9BC94ED34CD7D6C657D2B1000853746B113C01581E05ED400156C55ED44EF01B19E2137A9B39018403EA767D212284F89E08946C43B80270BDD852FDC41BCDE540F491B03C80AF0BCE8F1905A709CAB8D96B2BA</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = ECBEEFEA34777EECDE225661931EC3F084FFE74E4E348612FA29746391AD6F817BC7971C777DB5C938D6C827AEFF03A17E7FE9610A22BAA689983E95EF4BF221F75CD6EA799161EBCF01B33925B7662FED6A962EE91152A5C25272EF8470B397B5B2813154E3CF59D84EF783396129B31FE5050B5F54FB2CEFBB5A2992060495E44037C6C3A81CCE5C7724B58F99B30CBBCB52335BB4AF2116CCF75A030995DA6B559A37640697C4AEA13EBF421EE7A2FB6958010006E695C4BABF1F8DB57D0E0FD7B79216C405AA354828F326C4E13A5E4AF0FE26640AC3A1FA08DCD94E76EA53D5E8FCA55475A3DA337E398C249ED8403433815DF29EABBD22CD2B6C6850EDE9B7E2E7D0559597E86E0E11F3B381CFAF0809A81081D89D2AB7D3762CF4BE6E69D073EC4BA0685C42A6F14FFADD77284D691FEE0E0EA1831CB3BF22E56E55D27FDECEB2932CF54AB5A5F1BCF7870114</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 08 B2 05 00 7E 62 1C 65
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 17 2F 85 E7 17 61 F3 BB
|
|
|
|
|
0020 | 2C BD BE 71 2D 1E AF E5 88 17 DB E8 74 20 77 FA
|
|
|
|
|
0030 | 5F 1C 0C 1C 6F F0 58 BD FE 50 01 00 3E 0F 2F F2
|
|
|
|
|
0040 | F1 AD 61 51 1C EE 9C 91 A0 66 07 A6 3F 2C 2A C4
|
|
|
|
|
0050 | D9 EB 41 6C 9A F1 37 C6 6E 9F 0B B8 C8 AC AF A9
|
|
|
|
|
0060 | D3 06 95 84 22 06 A8 73 09 9F 39 35 F8 12 B5 70
|
|
|
|
|
0070 | 66 9E DA B1 77 5D CA 78 11 F4 9B 41 AB AB C9 32
|
|
|
|
|
0080 | ED 32 5C 80 47 26 BE AA AB C5 2C 40 A3 9A 97 E7
|
|
|
|
|
0090 | 51 71 B7 5C FB 13 EC F5 8B ED 2E 14 D4 11 EA A7
|
|
|
|
|
00A0 | CB 09 8F A4 9D BA 15 FF AE 05 E2 E3 59 63 BA 62
|
|
|
|
|
00B0 | 28 62 BA DE 2C B1 A1 60 8A 5E 9A CC F8 B0 2F 6F
|
|
|
|
|
00C0 | AA 4D C0 92 A2 50 51 53 33 02 B6 FF 9A 39 39 C0
|
|
|
|
|
00D0 | FC D9 2A B0 23 7A 49 9C 91 12 BA 91 BF 28 01 C0
|
|
|
|
|
00E0 | 98 7F 54 76 0B F3 42 2A 68 C4 35 AE 5E 75 AE C8
|
|
|
|
|
00F0 | 37 01 5A 41 58 7E AF 32 E7 15 A7 C7 67 FC 19 F9
|
|
|
|
|
0100 | 4A A2 14 44 FB 3A 6B AC 1B 6B 8C D0 A9 11 83 74
|
|
|
|
|
0110 | C7 D9 6B 3A 31 74 06 55 A1 62 77 7B F6 48 7E 16
|
|
|
|
|
0120 | 0E 6C 8C 0E AD 25 DA 52 14 14 BF 1A 1C 00 2F 69
|
|
|
|
|
0130 | C8 A5 C6 BD 25 57 38 9E B9 BC 94 ED 34 CD 7D 6C
|
|
|
|
|
0140 | 65 7D 2B 10 00 85 37 46 B1 13 C0 15 81 E0 5E D4
|
|
|
|
|
0150 | 00 15 6C 55 ED 44 EF 01 B1 9E 21 37 A9 B3 90 18
|
|
|
|
|
0160 | 40 3E A7 67 D2 12 28 4F 89 E0 89 46 C4 3B 80 27
|
|
|
|
|
0170 | 0B DD 85 2F DC 41 BC DE 54 0F 49 1B 03 C8 0A F0
|
|
|
|
|
0180 | BC E8 F1 90 5A 70 9C AB 8D 96 B2 BA</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 14 4B 0A 00 2A B8 1D 65
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 7F 1F 22 C6 09 72 3B CD
|
|
|
|
|
0020 | 45 F7 08 F0 F9 9E 90 BF E9 B1 0D 87 09 A3 90 0E
|
|
|
|
|
0030 | F8 89 83 60 10 85 61 ED FE 50 01 00 EC BE EF EA
|
|
|
|
|
0040 | 34 77 7E EC DE 22 56 61 93 1E C3 F0 84 FF E7 4E
|
|
|
|
|
0050 | 4E 34 86 12 FA 29 74 63 91 AD 6F 81 7B C7 97 1C
|
|
|
|
|
0060 | 77 7D B5 C9 38 D6 C8 27 AE FF 03 A1 7E 7F E9 61
|
|
|
|
|
0070 | 0A 22 BA A6 89 98 3E 95 EF 4B F2 21 F7 5C D6 EA
|
|
|
|
|
0080 | 79 91 61 EB CF 01 B3 39 25 B7 66 2F ED 6A 96 2E
|
|
|
|
|
0090 | E9 11 52 A5 C2 52 72 EF 84 70 B3 97 B5 B2 81 31
|
|
|
|
|
00A0 | 54 E3 CF 59 D8 4E F7 83 39 61 29 B3 1F E5 05 0B
|
|
|
|
|
00B0 | 5F 54 FB 2C EF BB 5A 29 92 06 04 95 E4 40 37 C6
|
|
|
|
|
00C0 | C3 A8 1C CE 5C 77 24 B5 8F 99 B3 0C BB CB 52 33
|
|
|
|
|
00D0 | 5B B4 AF 21 16 CC F7 5A 03 09 95 DA 6B 55 9A 37
|
|
|
|
|
00E0 | 64 06 97 C4 AE A1 3E BF 42 1E E7 A2 FB 69 58 01
|
|
|
|
|
00F0 | 00 06 E6 95 C4 BA BF 1F 8D B5 7D 0E 0F D7 B7 92
|
|
|
|
|
0100 | 16 C4 05 AA 35 48 28 F3 26 C4 E1 3A 5E 4A F0 FE
|
|
|
|
|
0110 | 26 64 0A C3 A1 FA 08 DC D9 4E 76 EA 53 D5 E8 FC
|
|
|
|
|
0120 | A5 54 75 A3 DA 33 7E 39 8C 24 9E D8 40 34 33 81
|
|
|
|
|
0130 | 5D F2 9E AB BD 22 CD 2B 6C 68 50 ED E9 B7 E2 E7
|
|
|
|
|
0140 | D0 55 95 97 E8 6E 0E 11 F3 B3 81 CF AF 08 09 A8
|
|
|
|
|
0150 | 10 81 D8 9D 2A B7 D3 76 2C F4 BE 6E 69 D0 73 EC
|
|
|
|
|
0160 | 4B A0 68 5C 42 A6 F1 4F FA DD 77 28 4D 69 1F EE
|
|
|
|
|
0170 | 0E 0E A1 83 1C B3 BF 22 E5 6E 55 D2 7F DE CE B2
|
|
|
|
|
0180 | 93 2C F5 4A B5 A5 F1 BC F7 87 01 14</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>08B205007E621C65</code></td>
|
|
|
|
|
<td><code>144B0A002AB81D65</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>172F85E71761F3BB2CBDBE712D1EAFE5</code></td>
|
|
|
|
|
<td><code>7F1F22C609723BCD45F708F0F99E90BF</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>8817DBE8742077FA5F1C0C1C6FF058BD</code></td>
|
|
|
|
|
<td><code>E9B10D8709A3900EF8898360108561ED</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE5001003E0F2FF2F1AD61511CEE9C91</code> <code>A06607A63F2C2AC4D9EB416C9AF137C6</code> <code>6E9F0BB8C8ACAFA9D30695842206A873</code> <code>099F3935F812B570669EDAB1775DCA78</code> <code>11F49B41ABABC932ED325C804726BEAA</code> <code>ABC52C40A39A97E75171B75CFB13ECF5</code> <code>8BED2E14D411EAA7CB098FA49DBA15FF</code> <code>AE05E2E35963BA622862BADE2CB1A160</code> <code>8A5E9ACCF8B02F6FAA4DC092A2505153</code> <code>3302B6FF9A3939C0FCD92AB0237A499C</code> <code>9112BA91BF2801C0987F54760BF3422A</code> <code>68C435AE5E75AEC837015A41587EAF32</code> <code>E715A7C767FC19F94AA21444FB3A6BAC</code> <code>1B6B8CD0A9118374C7D96B3A31740655</code> <code>A162777BF6487E160E6C8C0EAD25DA52</code> <code>1414BF1A1C002F69C8A5C6BD2557389E</code> <code>B9BC94ED34CD7D6C657D2B1000853746</code> <code>B113C01581E05ED400156C55ED44EF01</code> <code>B19E2137A9B39018403EA767D212284F</code> <code>89E08946C43B80270BDD852FDC41BCDE</code> <code>540F491B03C80AF0BCE8F1905A709CAB</code><br> <code>8D96B2BA</code></td>
|
|
|
|
|
<td><code>FE500100ECBEEFEA34777EECDE225661</code> <code>931EC3F084FFE74E4E348612FA297463</code> <code>91AD6F817BC7971C777DB5C938D6C827</code> <code>AEFF03A17E7FE9610A22BAA689983E95</code> <code>EF4BF221F75CD6EA799161EBCF01B339</code> <code>25B7662FED6A962EE91152A5C25272EF</code> <code>8470B397B5B2813154E3CF59D84EF783</code> <code>396129B31FE5050B5F54FB2CEFBB5A29</code> <code>92060495E44037C6C3A81CCE5C7724B5</code> <code>8F99B30CBBCB52335BB4AF2116CCF75A</code> <code>030995DA6B559A37640697C4AEA13EBF</code> <code>421EE7A2FB6958010006E695C4BABF1F</code> <code>8DB57D0E0FD7B79216C405AA354828F3</code> <code>26C4E13A5E4AF0FE26640AC3A1FA08DC</code> <code>D94E76EA53D5E8FCA55475A3DA337E39</code> <code>8C249ED8403433815DF29EABBD22CD2B</code> <code>6C6850EDE9B7E2E7D0559597E86E0E11</code> <code>F3B381CFAF0809A81081D89D2AB7D376</code> <code>2CF4BE6E69D073EC4BA0685C42A6F14F</code> <code>FADD77284D691FEE0E0EA1831CB3BF22</code> <code>E56E55D27FDECEB2932CF54AB5A5F1BC</code><br> <code>F7870114</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 = 12B3496D5E5E73291DB22E1E140DC8C9D2B569ABA651275EAFAE0E56B5865BC50C5A3456B950816E5705E1CBB079E0EFF02462FEFBC3B681DE961B60FCD1B3539F889CC64B94DA5EE3439BF17CD8623714CAEF251BAE413C25B1733BECB79E9D1A45171F40ED5736A56364728C9F91C701F26A7E2BA4F2522CD4AA5CC4E066744EB7F7BF0DED165B8BE91E2AF6029D4B9298672356DA5BE13F233C2CF4C99CB772AECCE8C9B9E76DA2C55778B7DF0F15DF01125EAAF6C79A465A6B156887D2B4E8CFCA64ACE735729EA480BFD042D5AD5CBE205084B08144F7BC2F4DC51792A387843652EC5BDFE8E4F481A90647D11FA850C37838FBB3D2FA149621415E006C</code></pre>
|
|
|
|
|
<pre><code>auth_key = 9B401BB89E06A821512D93BD1A3B72F5BBD9841319188D50E005843E348E9FF0AF4DA34BBDFA53D6B76C227D091F05DCE9CDE747B33E80D5B76274E76DCF899EF39DA109DDB8878BAC492CAC0B2FB354CBEA1C0C7BFC3ECEF670C59DB71A57ACDC6CEBD7C34D0484EBF870589863BE1C10454F49F0F197C98BE03805987F2B16C30B67E532BF5CB34805C68A3B46DDD13E4681D767DA7CDD5CC256B39CB70976EE10692447ED8AA8257F22D9F97C1953AFC06EF133E789C43E46245779BEC34861234301F64F2F65BCF8D8C45C66C63E3B3ECD6FE05AE27C0126CC026BAAADE1C86A70035BF0F67AC58530864985638E7615B3E660AC918C664E93263446582B</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 64 D1 47 7F 62 1C 65
|
|
|
|
|
0010 | 7C 00 00 00 34 F7 CB 3B 17 2F 85 E7 17 61 F3 BB
|
|
|
|
|
0020 | 2C BD BE 71 2D 1E AF E5 88 17 DB E8 74 20 77 FA
|
|
|
|
|
0030 | 5F 1C 0C 1C 6F F0 58 BD FF D0 9D 43 DE EA B2 E7
|
|
|
|
|
0040 | A4 1B 02 9F 38 2B 10 3A</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 0C 57 D9 2A B8 1D 65
|
|
|
|
|
0010 | 8C 00 00 00 34 F7 CB 3B 7F 1F 22 C6 09 72 3B CD
|
|
|
|
|
0020 | 45 F7 08 F0 F9 9E 90 BF E9 B1 0D 87 09 A3 90 0E
|
|
|
|
|
0030 | F8 89 83 60 10 85 61 ED 4A AD EB C0 80 E4 31 08
|
|
|
|
|
0040 | A6 52 66 DB F5 CE 55 F1</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>0164D1477F621C65</code></td>
|
|
|
|
|
<td><code>010C57D92AB81D65</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>7C000000</code> (124 in decimal)</td>
|
|
|
|
|
<td><code>8C000000</code> (140 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>172F85E71761F3BB2CBDBE712D1EAFE5</code></td>
|
|
|
|
|
<td><code>7F1F22C609723BCD45F708F0F99E90BF</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>8817DBE8742077FA5F1C0C1C6FF058BD</code></td>
|
|
|
|
|
<td><code>E9B10D8709A3900EF8898360108561ED</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>FFD09D43DEEAB2E7A41B029F382B103A</code></td>
|
|
|
|
|
<td><code>4AADEBC080E43108A65266DBF5CE55F1</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>
|
|
|
|
|