|
|
|
@ -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 D0 05 0D 00 5B 8F 52 65
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 65 6E 13 93 58 19 E7 6E
|
|
|
|
|
0020 | EC 8A 35 66 9A 28 E6 54</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 64 7F 0C 00 B8 90 52 65
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 26 BD 66 FA AC 98 75 CF
|
|
|
|
|
0020 | CE 27 A5 E6 95 9E E5 87</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>D0050D005B8F5265</code></td>
|
|
|
|
|
<td><code>647F0C00B8905265</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>656E13935819E76EEC8A35669A28E654</code></td>
|
|
|
|
|
<td><code>26BD66FAAC9875CFCE27A5E6959EE587</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 60 7C A8 5B 8F 52 65
|
|
|
|
|
0010 | 64 00 00 00 63 24 16 05 65 6E 13 93 58 19 E7 6E
|
|
|
|
|
0020 | EC 8A 35 66 9A 28 E6 54 56 D3 89 64 15 00 3D F7
|
|
|
|
|
0030 | AC 4F 3A 54 16 E5 C3 67 08 16 88 14 FD D6 F0 77
|
|
|
|
|
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 28 E8 29 B8 90 52 65
|
|
|
|
|
0010 | 54 00 00 00 63 24 16 05 26 BD 66 FA AC 98 75 CF
|
|
|
|
|
0020 | CE 27 A5 E6 95 9E E5 87 B2 1E 98 5D 3E C9 B7 EC
|
|
|
|
|
0030 | D5 D4 83 29 13 BE 69 12 08 17 BE 00 0F E7 15 EC
|
|
|
|
|
0040 | C9 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>01607CA85B8F5265</code></td>
|
|
|
|
|
<td><code>0128E829B8905265</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>64000000</code> (100 in decimal)</td>
|
|
|
|
|
<td><code>54000000</code> (84 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>656E13935819E76EEC8A35669A28E654</code></td>
|
|
|
|
|
<td><code>26BD66FAAC9875CFCE27A5E6959EE587</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>56D3896415003DF7AC4F3A5416E5C367</code></td>
|
|
|
|
|
<td><code>B21E985D3EC9B7ECD5D4832913BE6912</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>08168814FDD6F07771000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1623570746132428657</td>
|
|
|
|
|
<td><code>0817BE000FE715ECC9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1710804976748850377</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 = 1623570746132428657</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1623570746132428657 = 1269825343 * 1278577999</code></p>
|
|
|
|
|
<pre><code>p = 1269825343
|
|
|
|
|
q = 1278577999</code></pre>
|
|
|
|
|
<pre><code>pq = 1710804976748850377</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1710804976748850377 = 1147566131 * 1490811667</code></p>
|
|
|
|
|
<pre><code>p = 1147566131
|
|
|
|
|
q = 1490811667</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 16 88 14 FD D6 F0 77 71 00 00 00
|
|
|
|
|
0010 | 04 4B AF FF 3F 00 00 00 04 4C 35 8D 4F 00 00 00
|
|
|
|
|
0020 | 65 6E 13 93 58 19 E7 6E EC 8A 35 66 9A 28 E6 54
|
|
|
|
|
0030 | 56 D3 89 64 15 00 3D F7 AC 4F 3A 54 16 E5 C3 67
|
|
|
|
|
0040 | 66 7F E7 5D 9B 22 6F 1D 4B A4 B5 A6 52 81 DB 97
|
|
|
|
|
0050 | E3 D4 52 8C C0 0F 8B 8F 60 47 C1 F7 C7 88 F3 E4
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 17 BE 00 0F E7 15 EC C9 00 00 00
|
|
|
|
|
0010 | 04 44 66 78 33 00 00 00 04 58 DB FB 13 00 00 00
|
|
|
|
|
0020 | 26 BD 66 FA AC 98 75 CF CE 27 A5 E6 95 9E E5 87
|
|
|
|
|
0030 | B2 1E 98 5D 3E C9 B7 EC D5 D4 83 29 13 BE 69 12
|
|
|
|
|
0040 | D5 E3 E5 8D 12 5A 7D 82 04 FA C5 DF CE 2F 6D 1B
|
|
|
|
|
0050 | BB 81 12 0C 8F 48 C9 16 B5 FB 55 EF 10 DA 1E 13
|
|
|
|
|
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 = 1278577999</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>08168814FDD6F07771000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1623570746132428657</td>
|
|
|
|
|
<td><code>0817BE000FE715ECC9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1710804976748850377</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>044BAFFF3F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1269825343</td>
|
|
|
|
|
<td><code>0444667833000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1147566131</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>044C358D4F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1278577999</td>
|
|
|
|
|
<td><code>0458DBFB13000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1490811667</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>656E13935819E76EEC8A35669A28E654</code></td>
|
|
|
|
|
<td><code>26BD66FAAC9875CFCE27A5E6959EE587</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>56D3896415003DF7AC4F3A5416E5C367</code></td>
|
|
|
|
|
<td><code>B21E985D3EC9B7ECD5D4832913BE6912</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>667FE75D9B226F1D4BA4B5A65281DB97</code> <code>E3D4528CC00F8B8F6047C1F7C788F3E4</code></td>
|
|
|
|
|
<td><code>D5E3E58D125A7D8204FAC5DFCE2F6D1B</code> <code>BB81120C8F48C916B5FB55EF10DA1E13</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1278577999</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 = 955FF5A908168814FDD6F07771000000044BAFFF3F000000044C358D4F000000656E13935819E76EEC8A35669A28E65456D3896415003DF7AC4F3A5416E5C367667FE75D9B226F1D4BA4B5A65281DB97E3D4528CC00F8B8F6047C1F7C788F3E402000000
|
|
|
|
|
random_padding_bytes = D63275026745B2326813D072BB92325F3FA5212E7EBE16D1DCE659DD4A2666BF62FDE6A368FE109BD7AFBE8123B703CA45A7FD3F8B7775E231E1B30CD9DC4D78DE76FCB33AC90072E23B0654E9C10B345D7485CC208CD0B5F38E7F50</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A90817BE000FE715ECC900000004446678330000000458DBFB1300000026BD66FAAC9875CFCE27A5E6959EE587B21E985D3EC9B7ECD5D4832913BE6912D5E3E58D125A7D8204FAC5DFCE2F6D1BBB81120C8F48C916B5FB55EF10DA1E1302000000
|
|
|
|
|
random_padding_bytes = 4294371FBDE2286C0BE7C7D2E19DC02EBBB2B7084337D957AE220B9BF9549FA36E5330C5E087DA1865E2334BE0DB8BDCCA8272B1A668A492665C71AE04CBBA6DC95614E8A01B173FF9CB943051B717F02B5786794D45AE92D7B90589</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 = A9B83CD944FAC581E90026025C1C3CF9A798202704D3B854AD6D6EB454FC4D76D254F2EFDF451F486F0E74E7A88CCE167B121116E945BE809246D829DAD260581674848E66A3B2879019AE6E8D6441955332B5105C142A5EE56223701142FC756E3C256B81800EE474B4F8DFE9A7FF281685674B21BB8AEBA322B9041AC5602787DDA8A26EDA02700A6C4E1EA1BC94EC4A42726096C2CA036EE24A84FD5A5CCF8026D0C1DAE7E6A504FC5DC54498AFFE2955A4E7CE195B2ED81E938A2F313C7CE27A775DF59BF5EDA337B773CD049D5910C02DF2CE386CB26CAFB79E466503CEBF77C4F854D9B592E4369B1A9ACBB03F9F3589929C514A45CCFB456A3995C6AC</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = B2386EF5D858F165C6531D7F4C66DE3724DBB740BCCA82E3FEF64582E4DDD7D637C42793B010600F8D8B880412BA8F09129B3AD20F76659A8932B418C90FC409290A0973821E7004822BD20D8B1DF50C755D6095847F8F79266D96C1D6C6A0D52C871A5F1D5F310A97F71FD211CC6293EA28AE9239BCA18FB51ECF3C950F3467415B35E97CC3CA849275955B63077911E564673955A0E58E0698323F9B9496612911E0D607C3C1AFB174A0B7B6619B969505CEFD45F42705B2439397B572CCEB16B47CD817D67B6C137B079CDFC09AF4FCC53E30DC4B7375FF6E9BA2738DE09B20500D0695084F89EDCC8D689C160ACAAF89AF406DA09AD8BF1765B5CE2B603F</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 68 02 0F 00 5B 8F 52 65
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 65 6E 13 93 58 19 E7 6E
|
|
|
|
|
0020 | EC 8A 35 66 9A 28 E6 54 56 D3 89 64 15 00 3D F7
|
|
|
|
|
0030 | AC 4F 3A 54 16 E5 C3 67 04 4B AF FF 3F 00 00 00
|
|
|
|
|
0040 | 04 4C 35 8D 4F 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 A9 B8 3C D9 44 FA C5 81 E9 00 26 02
|
|
|
|
|
0060 | 5C 1C 3C F9 A7 98 20 27 04 D3 B8 54 AD 6D 6E B4
|
|
|
|
|
0070 | 54 FC 4D 76 D2 54 F2 EF DF 45 1F 48 6F 0E 74 E7
|
|
|
|
|
0080 | A8 8C CE 16 7B 12 11 16 E9 45 BE 80 92 46 D8 29
|
|
|
|
|
0090 | DA D2 60 58 16 74 84 8E 66 A3 B2 87 90 19 AE 6E
|
|
|
|
|
00A0 | 8D 64 41 95 53 32 B5 10 5C 14 2A 5E E5 62 23 70
|
|
|
|
|
00B0 | 11 42 FC 75 6E 3C 25 6B 81 80 0E E4 74 B4 F8 DF
|
|
|
|
|
00C0 | E9 A7 FF 28 16 85 67 4B 21 BB 8A EB A3 22 B9 04
|
|
|
|
|
00D0 | 1A C5 60 27 87 DD A8 A2 6E DA 02 70 0A 6C 4E 1E
|
|
|
|
|
00E0 | A1 BC 94 EC 4A 42 72 60 96 C2 CA 03 6E E2 4A 84
|
|
|
|
|
00F0 | FD 5A 5C CF 80 26 D0 C1 DA E7 E6 A5 04 FC 5D C5
|
|
|
|
|
0100 | 44 98 AF FE 29 55 A4 E7 CE 19 5B 2E D8 1E 93 8A
|
|
|
|
|
0110 | 2F 31 3C 7C E2 7A 77 5D F5 9B F5 ED A3 37 B7 73
|
|
|
|
|
0120 | CD 04 9D 59 10 C0 2D F2 CE 38 6C B2 6C AF B7 9E
|
|
|
|
|
0130 | 46 65 03 CE BF 77 C4 F8 54 D9 B5 92 E4 36 9B 1A
|
|
|
|
|
0140 | 9A CB B0 3F 9F 35 89 92 9C 51 4A 45 CC FB 45 6A
|
|
|
|
|
0150 | 39 95 C6 AC</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 68 7F 0C 00 B8 90 52 65
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 26 BD 66 FA AC 98 75 CF
|
|
|
|
|
0020 | CE 27 A5 E6 95 9E E5 87 B2 1E 98 5D 3E C9 B7 EC
|
|
|
|
|
0030 | D5 D4 83 29 13 BE 69 12 04 44 66 78 33 00 00 00
|
|
|
|
|
0040 | 04 58 DB FB 13 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 B2 38 6E F5 D8 58 F1 65 C6 53 1D 7F
|
|
|
|
|
0060 | 4C 66 DE 37 24 DB B7 40 BC CA 82 E3 FE F6 45 82
|
|
|
|
|
0070 | E4 DD D7 D6 37 C4 27 93 B0 10 60 0F 8D 8B 88 04
|
|
|
|
|
0080 | 12 BA 8F 09 12 9B 3A D2 0F 76 65 9A 89 32 B4 18
|
|
|
|
|
0090 | C9 0F C4 09 29 0A 09 73 82 1E 70 04 82 2B D2 0D
|
|
|
|
|
00A0 | 8B 1D F5 0C 75 5D 60 95 84 7F 8F 79 26 6D 96 C1
|
|
|
|
|
00B0 | D6 C6 A0 D5 2C 87 1A 5F 1D 5F 31 0A 97 F7 1F D2
|
|
|
|
|
00C0 | 11 CC 62 93 EA 28 AE 92 39 BC A1 8F B5 1E CF 3C
|
|
|
|
|
00D0 | 95 0F 34 67 41 5B 35 E9 7C C3 CA 84 92 75 95 5B
|
|
|
|
|
00E0 | 63 07 79 11 E5 64 67 39 55 A0 E5 8E 06 98 32 3F
|
|
|
|
|
00F0 | 9B 94 96 61 29 11 E0 D6 07 C3 C1 AF B1 74 A0 B7
|
|
|
|
|
0100 | B6 61 9B 96 95 05 CE FD 45 F4 27 05 B2 43 93 97
|
|
|
|
|
0110 | B5 72 CC EB 16 B4 7C D8 17 D6 7B 6C 13 7B 07 9C
|
|
|
|
|
0120 | DF C0 9A F4 FC C5 3E 30 DC 4B 73 75 FF 6E 9B A2
|
|
|
|
|
0130 | 73 8D E0 9B 20 50 0D 06 95 08 4F 89 ED CC 8D 68
|
|
|
|
|
0140 | 9C 16 0A CA AF 89 AF 40 6D A0 9A D8 BF 17 65 B5
|
|
|
|
|
0150 | CE 2B 60 3F</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 = D63275026745B2326813D072BB92325F3FA5212E7EBE16D1DCE659DD4
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>68020F005B8F5265</code></td>
|
|
|
|
|
<td><code>687F0C00B8905265</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 = D63275026745B2326813D072BB92325F3FA5212E7EBE16D1DCE659DD4
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>656E13935819E76EEC8A35669A28E654</code></td>
|
|
|
|
|
<td><code>26BD66FAAC9875CFCE27A5E6959EE587</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>56D3896415003DF7AC4F3A5416E5C367</code></td>
|
|
|
|
|
<td><code>B21E985D3EC9B7ECD5D4832913BE6912</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>044BAFFF3F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1269825343</td>
|
|
|
|
|
<td><code>0444667833000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1147566131</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>044C358D4F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1278577999</td>
|
|
|
|
|
<td><code>0458DBFB13000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1490811667</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 = D63275026745B2326813D072BB92325F3FA5212E7EBE16D1DCE659DD4
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE000100A9B83CD944FAC581E9002602</code> <code>5C1C3CF9A798202704D3B854AD6D6EB4</code> <code>54FC4D76D254F2EFDF451F486F0E74E7</code> <code>A88CCE167B121116E945BE809246D829</code> <code>DAD260581674848E66A3B2879019AE6E</code> <code>8D6441955332B5105C142A5EE5622370</code> <code>1142FC756E3C256B81800EE474B4F8DF</code> <code>E9A7FF281685674B21BB8AEBA322B904</code> <code>1AC5602787DDA8A26EDA02700A6C4E1E</code> <code>A1BC94EC4A42726096C2CA036EE24A84</code> <code>FD5A5CCF8026D0C1DAE7E6A504FC5DC5</code> <code>4498AFFE2955A4E7CE195B2ED81E938A</code> <code>2F313C7CE27A775DF59BF5EDA337B773</code> <code>CD049D5910C02DF2CE386CB26CAFB79E</code> <code>466503CEBF77C4F854D9B592E4369B1A</code> <code>9ACBB03F9F3589929C514A45CCFB456A</code><br> <code>3995C6AC</code></td>
|
|
|
|
|
<td><code>FE000100B2386EF5D858F165C6531D7F</code> <code>4C66DE3724DBB740BCCA82E3FEF64582</code> <code>E4DDD7D637C42793B010600F8D8B8804</code> <code>12BA8F09129B3AD20F76659A8932B418</code> <code>C90FC409290A0973821E7004822BD20D</code> <code>8B1DF50C755D6095847F8F79266D96C1</code> <code>D6C6A0D52C871A5F1D5F310A97F71FD2</code> <code>11CC6293EA28AE9239BCA18FB51ECF3C</code> <code>950F3467415B35E97CC3CA849275955B</code> <code>63077911E564673955A0E58E0698323F</code> <code>9B9496612911E0D607C3C1AFB174A0B7</code> <code>B6619B969505CEFD45F42705B2439397</code> <code>B572CCEB16B47CD817D67B6C137B079C</code> <code>DFC09AF4FCC53E30DC4B7375FF6E9BA2</code> <code>738DE09B20500D0695084F89EDCC8D68</code> <code>9C160ACAAF89AF406DA09AD8BF1765B5</code><br> <code>CE2B603F</code></td>
|
|
|
|
|
<td>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = D63275026745B2326813D072BB92325F3FA5212E7EBE16D1DCE659DD4
|
|
|
|
|
<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 8C 46 60 5C 8F 52 65
|
|
|
|
|
0010 | 7C 02 00 00 5C 07 E8 D0 65 6E 13 93 58 19 E7 6E
|
|
|
|
|
0020 | EC 8A 35 66 9A 28 E6 54 56 D3 89 64 15 00 3D F7
|
|
|
|
|
0030 | AC 4F 3A 54 16 E5 C3 67 FE 50 02 00 12 C6 41 64
|
|
|
|
|
0040 | 40 86 EF 6D B1 38 A9 A3 E5 36 43 53 5C E5 92 8C
|
|
|
|
|
0050 | C1 69 93 9E 62 A3 0C 96 69 74 AE DD A0 77 3D D1
|
|
|
|
|
0060 | E8 1D 60 50 7B C8 25 EA E5 2D 94 EF 0B CC F0 2F
|
|
|
|
|
0070 | 30 C4 4D 62 88 A5 BC 10 0C 0B A1 BF 23 94 25 F8
|
|
|
|
|
0080 | 0F 18 F3 9D A7 B3 44 30 DA 30 95 E8 E5 4A 8E 60
|
|
|
|
|
0090 | E0 3D 95 DF 42 C6 53 A7 B7 39 C1 D1 21 8B 10 49
|
|
|
|
|
00A0 | 0D 61 09 C2 9E EF 76 5F B8 83 FD C4 B5 1E 4C 03
|
|
|
|
|
00B0 | BD 09 AC 7F 5F F1 B6 A7 10 18 73 43 35 89 B8 60
|
|
|
|
|
00C0 | 2C 67 16 02 87 3E 9F 97 AD A0 EC 34 80 76 65 F8
|
|
|
|
|
00D0 | C7 5E 38 2F 29 B5 A4 D0 20 37 5E 87 3B 79 E7 F5
|
|
|
|
|
00E0 | 05 1B 0F 2B C6 5D C4 16 21 63 3B 8D 85 76 FD 7B
|
|
|
|
|
00F0 | 73 67 9A 70 D6 4A 39 E9 E1 01 CA 36 36 91 6C B1
|
|
|
|
|
0100 | 61 E5 30 8C AE A3 1E 38 C5 71 3A 44 3D 8A 2E 53
|
|
|
|
|
0110 | C5 86 06 E9 29 69 E3 B3 30 A6 0B 22 86 6E E6 77
|
|
|
|
|
0120 | E3 5D D4 73 A1 6F 3A CF 5D 60 B9 32 98 67 53 E3
|
|
|
|
|
0130 | 92 5F E0 58 0F 61 17 B5 02 B6 43 E6 EA F7 E9 30
|
|
|
|
|
0140 | C7 F9 B8 0B C3 9D BC 5A 52 FE 7D D3 28 25 3A 7E
|
|
|
|
|
0150 | E6 AC 27 E1 CE F5 FB 21 59 6C 76 9A 51 E3 16 96
|
|
|
|
|
0160 | 2D D3 02 4A AD 2D 71 AE 11 1F 88 E8 D0 27 75 88
|
|
|
|
|
0170 | 02 13 B2 1A D5 88 65 46 23 EA 12 B1 03 62 6A F7
|
|
|
|
|
0180 | C9 D6 7A 5A F5 0C F2 3E 2C 69 5C BB 98 DB CE 9B
|
|
|
|
|
0190 | 35 BC DD D6 31 4F A6 96 C8 33 D6 5C 10 1D C4 22
|
|
|
|
|
01A0 | 0E F0 B7 A8 F7 67 79 8E 62 AF CF 65 94 93 21 52
|
|
|
|
|
01B0 | F4 62 5B 2E 51 AA A1 7C AD 70 EE 12 D3 CC 91 B6
|
|
|
|
|
01C0 | BA F6 F4 45 BF E4 1F 87 04 87 C4 F8 6F 6E E1 7D
|
|
|
|
|
01D0 | 30 DE DE FD BD 14 B3 C7 23 C1 11 EE 06 2A 60 8D
|
|
|
|
|
01E0 | BB 9A 80 3F D4 19 3C F6 B9 E7 E7 74 61 4F 58 A4
|
|
|
|
|
01F0 | 31 F9 08 46 9B A8 EB BD A3 DA F0 6B ED A4 7D 16
|
|
|
|
|
0200 | CD F4 11 23 29 54 BE 13 CD 24 08 44 7B 93 D5 2B
|
|
|
|
|
0210 | DA 65 6D 75 3A C9 7E 7A 7A 05 5C 91 18 6F AF AF
|
|
|
|
|
0220 | 57 4C 7A 11 D8 3E EF 1E ED 4D 98 61 36 A4 D5 5D
|
|
|
|
|
0230 | C0 85 49 CB 0C 57 91 AF 1D 28 87 F6 EB 70 33 DE
|
|
|
|
|
0240 | 87 17 07 98 8B CC 75 D4 D0 D6 AA 87 1F 2F 3C 67
|
|
|
|
|
0250 | 08 07 27 83 70 28 FD 94 17 50 ED DF A0 58 2F 10
|
|
|
|
|
0260 | BC F7 6A 97 4A 2F 45 55 51 D8 B3 FF 9A B2 AA 66
|
|
|
|
|
0270 | 61 20 6E D0 71 1B 1B 3A 7C E1 73 B3 F6 86 CB 02
|
|
|
|
|
0280 | B6 FA A4 FE EB 2E 50 D0 72 3D 11 F1</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 5C 2C EB B8 90 52 65
|
|
|
|
|
0010 | A4 02 00 00 5C 07 E8 D0 26 BD 66 FA AC 98 75 CF
|
|
|
|
|
0020 | CE 27 A5 E6 95 9E E5 87 B2 1E 98 5D 3E C9 B7 EC
|
|
|
|
|
0030 | D5 D4 83 29 13 BE 69 12 FE 50 02 00 C4 9A 1A 4B
|
|
|
|
|
0040 | 9A 7C 7D DA A3 B4 8D B8 B7 9E 2E C0 DE E0 5E 11
|
|
|
|
|
0050 | 89 9C 5B BF 70 F4 DC 7B 51 35 29 7B 4E C8 A9 34
|
|
|
|
|
0060 | 34 2A 02 D5 00 70 1F 98 32 0C D5 02 3E F2 5A F5
|
|
|
|
|
0070 | BB B1 01 32 EE 84 30 37 2B 15 63 AC 68 E1 C5 C8
|
|
|
|
|
0080 | 5B C7 25 EB 40 F6 5B 01 0B C4 AE AC C9 FB 14 D2
|
|
|
|
|
0090 | 41 EB B4 59 B5 32 64 FC ED B0 7C EF D3 5A 94 2C
|
|
|
|
|
00A0 | B1 A8 DB 78 75 EE F3 22 7E 71 14 26 B8 42 5F B9
|
|
|
|
|
00B0 | 52 0B E8 ED 2C 22 C6 81 80 1E 12 A5 88 6A 09 99
|
|
|
|
|
00C0 | 0A E7 DF 80 07 5A C4 A5 3A 43 42 22 B8 12 0F E0
|
|
|
|
|
00D0 | E1 CB 3A DC 32 3B 9F 50 14 4D B3 17 89 B2 DC D9
|
|
|
|
|
00E0 | 84 A9 55 5C EA 15 7F 0D 84 A2 B8 E1 65 F1 2C 08
|
|
|
|
|
00F0 | E4 8E 8F 50 68 7A 10 5E BB 14 B3 DC E2 33 9E B7
|
|
|
|
|
0100 | 70 6E BF 44 A0 42 7D 7A 31 70 E3 D9 63 BE 7B 95
|
|
|
|
|
0110 | 3F F5 8A AF A5 E1 0C 7A FC CE 58 9B 3F 38 33 7F
|
|
|
|
|
0120 | 1F E0 B2 56 B6 D0 54 61 22 52 00 34 7D EE E3 83
|
|
|
|
|
0130 | 86 40 AC BE 66 A6 80 40 71 2C FD F0 43 41 73 41
|
|
|
|
|
0140 | AF FA 31 05 9A 46 C1 13 99 1A 3E 24 66 28 02 3D
|
|
|
|
|
0150 | 3A C4 0E DD 49 C6 EA 7A A3 CF 84 B4 F3 C1 CC 70
|
|
|
|
|
0160 | 7C 5C B3 78 3D 99 78 09 7E D5 4F 8A B3 D6 C2 1D
|
|
|
|
|
0170 | 14 97 72 D1 9F BF 37 2D 31 65 7E 70 99 48 F2 8B
|
|
|
|
|
0180 | D0 5C A8 10 BA FF 64 EB D7 95 DD 86 E0 15 A8 6F
|
|
|
|
|
0190 | A4 D8 AE 7F 41 D7 06 CF 66 0B 2F 91 D3 9A 1E 73
|
|
|
|
|
01A0 | F8 A7 5D F3 C8 9D 18 B4 9A D7 1E F5 12 68 BA E0
|
|
|
|
|
01B0 | 09 FD D5 D7 F1 A5 DC BC 4D 16 55 9B 32 63 C6 38
|
|
|
|
|
01C0 | E4 CE 45 89 7C E3 93 F2 52 CB F2 34 D0 94 C2 97
|
|
|
|
|
01D0 | 53 05 26 14 F8 FB 6F A1 36 B4 BB 62 8B 14 A7 2D
|
|
|
|
|
01E0 | F1 E3 05 D2 F7 FC AF 35 3E 22 8B 79 C6 08 E8 64
|
|
|
|
|
01F0 | 31 8A EB 61 2D 0B 5A DE AD CD 30 C4 15 E1 55 76
|
|
|
|
|
0200 | F3 3A 30 A7 19 A9 8D B0 B1 38 A1 0B AD 88 F8 D2
|
|
|
|
|
0210 | 03 75 DF 18 D6 78 5F 0A E0 D3 BD 3E 71 55 5F 73
|
|
|
|
|
0220 | AC D7 7E 0F E0 07 1E D0 44 55 4E 5C 71 EE 9A 24
|
|
|
|
|
0230 | 01 CA 14 39 F3 E6 D2 BC F2 0D 86 C3 23 40 40 CF
|
|
|
|
|
0240 | 19 88 67 06 13 D6 66 D6 37 C4 63 4E 8B DF 49 BA
|
|
|
|
|
0250 | 0C CE 90 AC 91 53 55 1E 62 35 03 86 49 30 0E D6
|
|
|
|
|
0260 | 70 26 2E 47 75 DB 4B D3 6F 10 8D 16 3C 23 04 88
|
|
|
|
|
0270 | 81 1E 4E 2F 36 F9 2E 92 90 49 30 4D EA C7 25 9E
|
|
|
|
|
0280 | D6 C7 86 84 99 E1 E2 BA F5 BF 6A 34</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 = D63275026745B2326813D072BB92325F3FA5212E7EBE16D1DCE659DD4
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>018C46605C8F5265</code></td>
|
|
|
|
|
<td><code>015C2CEBB8905265</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>7C020000</code> (636 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 = D63275026745B2326813D072BB92325F3FA5212E7EBE16D1DCE659DD4
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>656E13935819E76EEC8A35669A28E654</code></td>
|
|
|
|
|
<td><code>26BD66FAAC9875CFCE27A5E6959EE587</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>56D3896415003DF7AC4F3A5416E5C367</code></td>
|
|
|
|
|
<td><code>B21E985D3EC9B7ECD5D4832913BE6912</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE50020012C641644086EF6DB138A9A3</code> <code>E53643535CE5928CC169939E62A30C96</code> <code>6974AEDDA0773DD1E81D60507BC825EA</code> <code>E52D94EF0BCCF02F30C44D6288A5BC10</code> <code>0C0BA1BF239425F80F18F39DA7B34430</code> <code>DA3095E8E54A8E60E03D95DF42C653A7</code> <code>B739C1D1218B10490D6109C29EEF765F</code> <code>B883FDC4B51E4C03BD09AC7F5FF1B6A7</code> <code>101873433589B8602C671602873E9F97</code> <code>ADA0EC34807665F8C75E382F29B5A4D0</code> <code>20375E873B79E7F5051B0F2BC65DC416</code> <code>21633B8D8576FD7B73679A70D64A39E9</code> <code>E101CA3636916CB161E5308CAEA31E38</code> <code>C5713A443D8A2E53C58606E92969E3B3</code> <code>30A60B22866EE677E35DD473A16F3ACF</code> <code>5D60B932986753E3925FE0580F6117B5</code> <code>02B643E6EAF7E930C7F9B80BC39DBC5A</code> <code>52FE7DD328253A7EE6AC27E1CEF5FB21</code> <code>596C769A51E316962DD3024AAD2D71AE</code> <code>111F88E8D02775880213B21AD5886546</code> <code>23EA12B103626AF7C9D67A5AF50CF23E</code> <code>2C695CBB98DBCE9B35BCDDD6314FA696</code> <code>C833D65C101DC4220EF0B7A8F767798E</code> <code>62AFCF6594932152F4625B2E51AAA17C</code> <code>AD70EE12D3CC91B6BAF6F445BFE41F87</code> <code>0487C4F86F6EE17D30DEDEFDBD14B3C7</code> <code>23C111EE062A608DBB9A803FD4193CF6</code> <code>B9E7E774614F58A431F908469BA8EBBD</code> <code>A3DAF06BEDA47D16CDF411232954BE13</code> <code>CD2408447B93D52BDA656D753AC97E7A</code> <code>7A055C91186FAFAF574C7A11D83EEF1E</code> <code>ED4D986136A4D55DC08549CB0C5791AF</code> <code>1D2887F6EB7033DE871707988BCC75D4</code> <code>D0D6AA871F2F3C67080727837028FD94</code> <code>1750EDDFA0582F10BCF76A974A2F4555</code> <code>51D8B3FF9AB2AA6661206ED0711B1B3A</code> <code>7CE173B3F686CB02B6FAA4FEEB2E50D0</code><br> <code>723D11F1</code></td>
|
|
|
|
|
<td><code>FE500200C49A1A4B9A7C7DDAA3B48DB8</code> <code>B79E2EC0DEE05E11899C5BBF70F4DC7B</code> <code>5135297B4EC8A934342A02D500701F98</code> <code>320CD5023EF25AF5BBB10132EE843037</code> <code>2B1563AC68E1C5C85BC725EB40F65B01</code> <code>0BC4AEACC9FB14D241EBB459B53264FC</code> <code>EDB07CEFD35A942CB1A8DB7875EEF322</code> <code>7E711426B8425FB9520BE8ED2C22C681</code> <code>801E12A5886A09990AE7DF80075AC4A5</code> <code>3A434222B8120FE0E1CB3ADC323B9F50</code> <code>144DB31789B2DCD984A9555CEA157F0D</code> <code>84A2B8E165F12C08E48E8F50687A105E</code> <code>BB14B3DCE2339EB7706EBF44A0427D7A</code> <code>3170E3D963BE7B953FF58AAFA5E10C7A</code> <code>FCCE589B3F38337F1FE0B256B6D05461</code> <code>225200347DEEE3838640ACBE66A68040</code> <code>712CFDF043417341AFFA31059A46C113</code> <code>991A3E246628023D3AC40EDD49C6EA7A</code> <code>A3CF84B4F3C1CC707C5CB3783D997809</code> <code>7ED54F8AB3D6C21D149772D19FBF372D</code> <code>31657E709948F28BD05CA810BAFF64EB</code> <code>D795DD86E015A86FA4D8AE7F41D706CF</code> <code>660B2F91D39A1E73F8A75DF3C89D18B4</code> <code>9AD71EF51268BAE009FDD5D7F1A5DCBC</code> <code>4D16559B3263C638E4CE45897CE393F2</code> <code>52CBF234D094C29753052614F8FB6FA1</code> <code>36B4BB628B14A72DF1E305D2F7FCAF35</code> <code>3E228B79C608E864318AEB612D0B5ADE</code> <code>ADCD30C415E15576F33A30A719A98DB0</code> <code>B138A10BAD88F8D20375DF18D6785F0A</code> <code>E0D3BD3E71555F73ACD77E0FE0071ED0</code> <code>44554E5C71EE9A2401CA1439F3E6D2BC</code> <code>F20D86C3234040CF1988670613D666D6</code> <code>37C4634E8BDF49BA0CCE90AC9153551E</code> <code>6235038649300ED670262E4775DB4BD3</code> <code>6F108D163C230488811E4E2F36F92E92</code> <code>9049304DEAC7259ED6C7868499E1E2BA</code><br> <code>F5BF6A34</code></td>
|
|
|
|
|
<td>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = D63275026745B2326813D072BB92325F3FA5212E7EBE16D1DCE659DD4
|
|
|
|
|
<!-- 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 = 12C641644086EF6DB138A9A3E53643535CE5928CC169939E62A30C966974AEDDA0773DD1E81D60507BC825EAE52D94EF0BCCF02F30C44D6288A5BC100C0BA1BF239425F80F18F39DA7B34430DA3095E8E54A8E60E03D95DF42C653A7B739C1D1218B10490D6109C29EEF765FB883FDC4B51E4C03BD09AC7F5FF1B6A7101873433589B8602C671602873E9F97ADA0EC34807665F8C75E382F29B5A4D020375E873B79E7F5051B0F2BC65DC41621633B8D8576FD7B73679A70D64A39E9E101CA3636916CB161E5308CAEA31E38C5713A443D8A2E53C58606E92969E3B330A60B22866EE677E35DD473A16F3ACF5D60B932986753E3925FE0580F6117B502B643E6EAF7E930C7F9B80BC39DBC5A52FE7DD328253A7EE6AC27E1CEF5FB21596C769A51E316962DD3024AAD2D71AE111F88E8D02775880213B21AD588654623EA12B103626AF7C9D67A5AF50CF23E2C695CBB98DBCE9B35BCDDD6314FA696C833D65C101DC4220EF0B7A8F767798E62AFCF6594932152F4625B2E51AAA17CAD70EE12D3CC91B6BAF6F445BFE41F870487C4F86F6EE17D30DEDEFDBD14B3C723C111EE062A608DBB9A803FD4193CF6B9E7E774614F58A431F908469BA8EBBDA3DAF06BEDA47D16CDF411232954BE13CD2408447B93D52BDA656D753AC97E7A7A055C91186FAFAF574C7A11D83EEF1EED4D986136A4D55DC08549CB0C5791AF1D2887F6EB7033DE871707988BCC75D4D0D6AA871F2F3C67080727837028FD941750EDDFA0582F10BCF76A974A2F455551D8B3FF9AB2AA6661206ED0711B1B3A7CE173B3F686CB02B6FAA4FEEB2E50D0723D11F1
|
|
|
|
|
tmp_aes_key = 022F9B4E9EADB601A8BC7F9636B1721B7C9E3BBB72927FDC43B052899A31552D
|
|
|
|
|
tmp_aes_iv = 05777D67BA5E51E589DA36B406F2D216280E1341DDF4CA79320CBA1B667FE75D</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = C49A1A4B9A7C7DDAA3B48DB8B79E2EC0DEE05E11899C5BBF70F4DC7B5135297B4EC8A934342A02D500701F98320CD5023EF25AF5BBB10132EE8430372B1563AC68E1C5C85BC725EB40F65B010BC4AEACC9FB14D241EBB459B53264FCEDB07CEFD35A942CB1A8DB7875EEF3227E711426B8425FB9520BE8ED2C22C681801E12A5886A09990AE7DF80075AC4A53A434222B8120FE0E1CB3ADC323B9F50144DB31789B2DCD984A9555CEA157F0D84A2B8E165F12C08E48E8F50687A105EBB14B3DCE2339EB7706EBF44A0427D7A3170E3D963BE7B953FF58AAFA5E10C7AFCCE589B3F38337F1FE0B256B6D05461225200347DEEE3838640ACBE66A68040712CFDF043417341AFFA31059A46C113991A3E246628023D3AC40EDD49C6EA7AA3CF84B4F3C1CC707C5CB3783D9978097ED54F8AB3D6C21D149772D19FBF372D31657E709948F28BD05CA810BAFF64EBD795DD86E015A86FA4D8AE7F41D706CF660B2F91D39A1E73F8A75DF3C89D18B49AD71EF51268BAE009FDD5D7F1A5DCBC4D16559B3263C638E4CE45897CE393F252CBF234D094C29753052614F8FB6FA136B4BB628B14A72DF1E305D2F7FCAF353E228B79C608E864318AEB612D0B5ADEADCD30C415E15576F33A30A719A98DB0B138A10BAD88F8D20375DF18D6785F0AE0D3BD3E71555F73ACD77E0FE0071ED044554E5C71EE9A2401CA1439F3E6D2BCF20D86C3234040CF1988670613D666D637C4634E8BDF49BA0CCE90AC9153551E6235038649300ED670262E4775DB4BD36F108D163C230488811E4E2F36F92E929049304DEAC7259ED6C7868499E1E2BAF5BF6A34
|
|
|
|
|
tmp_aes_key = 50467B2FCB4A132671FAD6A516EE22B77DE5E0D984276C02F0C486AE4CEE52E2
|
|
|
|
|
tmp_aes_iv = CDB0881CC08413E78791861E094E1A279D07459F407D4683DC6558D4D5E3E58D</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = 627A90E4BC623A2607BFE4764C720B91A41E4944BA0D89B5656E13935819E76EEC8A35669A28E65456D3896415003DF7AC4F3A5416E5C36703000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010046851FF32F9D73F99456F20FF27E9C37C331734FB197FE0C1EF4F3FB6B4F965D2A972F17A5A84A7DFFC5DFAC4EA8189341CD812417F42DDBB3CAC6FCF2FAC093438A6421BA4535AD3F926D8C3B84413D6B4C9A00A9CBF549A7AE67F6EE34F036125696A650B5D51345875966327FB16A985EF05BF4F0DB84C3D604A9FD447C1120DB1DCB967C689FD6D25E9053FD8B496D6D41C194B0133B3A3D47BD4DCC3FEB9C887E82F3AAAC7C584D3F84474F8CA6D18872599800FE575B56E7A12404C39DFFBFD81276630B08768DAA55D2C94B6DE54D391FB43556303963A107F60E89747B8C605258810FBA58E2E57229EBC93016A5550F071EA305BD29858B41F380A05C8F5265D73EEB989A98383C
|
|
|
|
|
answer = BA0D89B5656E13935819E76EEC8A35669A28E65456D3896415003DF7AC4F3A5416E5C36703000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010046851FF32F9D73F99456F20FF27E9C37C331734FB197FE0C1EF4F3FB6B4F965D2A972F17A5A84A7DFFC5DFAC4EA8189341CD812417F42DDBB3CAC6FCF2FAC093438A6421BA4535AD3F926D8C3B84413D6B4C9A00A9CBF549A7AE67F6EE34F036125696A650B5D51345875966327FB16A985EF05BF4F0DB84C3D604A9FD447C1120DB1DCB967C689FD6D25E9053FD8B496D6D41C194B0133B3A3D47BD4DCC3FEB9C887E82F3AAAC7C584D3F84474F8CA6D18872599800FE575B56E7A12404C39DFFBFD81276630B08768DAA55D2C94B6DE54D391FB43556303963A107F60E89747B8C605258810FBA58E2E57229EBC93016A5550F071EA305BD29858B41F380A05C8F5265D73EEB989A98383C</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = 230CDAD37181F11AD3684C399ED527B269CB1221BA0D89B526BD66FAAC9875CFCE27A5E6959EE587B21E985D3EC9B7ECD5D4832913BE691203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001002BF6F2C80188A19712DFEE1B962274142091C35FA6DD61F3BDF525ACDD5F18B0E1DBCFF01E2A06A6813FE60A0447123375B11275911F82448E0F1A878A3C893B3129A40E4A6AC8C4BA6342FD40F00BC36E0234C70D98C0AD46DE23A3882F2B5846DD20CB6A16C61FF3411DC356A46222DCBFE188720D9F1D3834E313DC2331B10CEF42AD4BFBED3FB7C97DFE1DE36B17E99452947B185575ADCADB76ED7AD49B671D46F475568E7D5B72FFC8222F6A8D8E02D3D77AF64F64EC2B1EF5FB64D02FA56E46AB823CBC295F321E79051F58F6F3E38B4A63559CFEDF91456B37591BD2453A67C82C8214BA160091B8AE07E0A7C7C90533A810E76E58438FB3CFECC4D4B8905265B7AC84D45DF41E91
|
|
|
|
|
answer = BA0D89B526BD66FAAC9875CFCE27A5E6959EE587B21E985D3EC9B7ECD5D4832913BE691203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001002BF6F2C80188A19712DFEE1B962274142091C35FA6DD61F3BDF525ACDD5F18B0E1DBCFF01E2A06A6813FE60A0447123375B11275911F82448E0F1A878A3C893B3129A40E4A6AC8C4BA6342FD40F00BC36E0234C70D98C0AD46DE23A3882F2B5846DD20CB6A16C61FF3411DC356A46222DCBFE188720D9F1D3834E313DC2331B10CEF42AD4BFBED3FB7C97DFE1DE36B17E99452947B185575ADCADB76ED7AD49B671D46F475568E7D5B72FFC8222F6A8D8E02D3D77AF64F64EC2B1EF5FB64D02FA56E46AB823CBC295F321E79051F58F6F3E38B4A63559CFEDF91456B37591BD2453A67C82C8214BA160091B8AE07E0A7C7C90533A810E76E58438FB3CFECC4D4B8905265B7AC84D45DF41E91</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 65 6E 13 93 58 19 E7 6E EC 8A 35 66
|
|
|
|
|
0010 | 9A 28 E6 54 56 D3 89 64 15 00 3D F7 AC 4F 3A 54
|
|
|
|
|
0020 | 16 E5 C3 67 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 26 BD 66 FA AC 98 75 CF CE 27 A5 E6
|
|
|
|
|
0010 | 95 9E E5 87 B2 1E 98 5D 3E C9 B7 EC D5 D4 83 29
|
|
|
|
|
0020 | 13 BE 69 12 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 = BA0D89B5656E13935819E76EEC8A35669A28E65456D3896415003DF7AC4F3A5416E5C36
|
|
|
|
|
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 | 46 85 1F F3 2F 9D 73 F9 94 56 F2 0F F2 7E 9C 37
|
|
|
|
|
0140 | C3 31 73 4F B1 97 FE 0C 1E F4 F3 FB 6B 4F 96 5D
|
|
|
|
|
0150 | 2A 97 2F 17 A5 A8 4A 7D FF C5 DF AC 4E A8 18 93
|
|
|
|
|
0160 | 41 CD 81 24 17 F4 2D DB B3 CA C6 FC F2 FA C0 93
|
|
|
|
|
0170 | 43 8A 64 21 BA 45 35 AD 3F 92 6D 8C 3B 84 41 3D
|
|
|
|
|
0180 | 6B 4C 9A 00 A9 CB F5 49 A7 AE 67 F6 EE 34 F0 36
|
|
|
|
|
0190 | 12 56 96 A6 50 B5 D5 13 45 87 59 66 32 7F B1 6A
|
|
|
|
|
01A0 | 98 5E F0 5B F4 F0 DB 84 C3 D6 04 A9 FD 44 7C 11
|
|
|
|
|
01B0 | 20 DB 1D CB 96 7C 68 9F D6 D2 5E 90 53 FD 8B 49
|
|
|
|
|
01C0 | 6D 6D 41 C1 94 B0 13 3B 3A 3D 47 BD 4D CC 3F EB
|
|
|
|
|
01D0 | 9C 88 7E 82 F3 AA AC 7C 58 4D 3F 84 47 4F 8C A6
|
|
|
|
|
01E0 | D1 88 72 59 98 00 FE 57 5B 56 E7 A1 24 04 C3 9D
|
|
|
|
|
01F0 | FF BF D8 12 76 63 0B 08 76 8D AA 55 D2 C9 4B 6D
|
|
|
|
|
0200 | E5 4D 39 1F B4 35 56 30 39 63 A1 07 F6 0E 89 74
|
|
|
|
|
0210 | 7B 8C 60 52 58 81 0F BA 58 E2 E5 72 29 EB C9 30
|
|
|
|
|
0220 | 16 A5 55 0F 07 1E A3 05 BD 29 85 8B 41 F3 80 A0
|
|
|
|
|
0230 | 5C 8F 52 65</code></pre>
|
|
|
|
|
0130 | 2B F6 F2 C8 01 88 A1 97 12 DF EE 1B 96 22 74 14
|
|
|
|
|
0140 | 20 91 C3 5F A6 DD 61 F3 BD F5 25 AC DD 5F 18 B0
|
|
|
|
|
0150 | E1 DB CF F0 1E 2A 06 A6 81 3F E6 0A 04 47 12 33
|
|
|
|
|
0160 | 75 B1 12 75 91 1F 82 44 8E 0F 1A 87 8A 3C 89 3B
|
|
|
|
|
0170 | 31 29 A4 0E 4A 6A C8 C4 BA 63 42 FD 40 F0 0B C3
|
|
|
|
|
0180 | 6E 02 34 C7 0D 98 C0 AD 46 DE 23 A3 88 2F 2B 58
|
|
|
|
|
0190 | 46 DD 20 CB 6A 16 C6 1F F3 41 1D C3 56 A4 62 22
|
|
|
|
|
01A0 | DC BF E1 88 72 0D 9F 1D 38 34 E3 13 DC 23 31 B1
|
|
|
|
|
01B0 | 0C EF 42 AD 4B FB ED 3F B7 C9 7D FE 1D E3 6B 17
|
|
|
|
|
01C0 | E9 94 52 94 7B 18 55 75 AD CA DB 76 ED 7A D4 9B
|
|
|
|
|
01D0 | 67 1D 46 F4 75 56 8E 7D 5B 72 FF C8 22 2F 6A 8D
|
|
|
|
|
01E0 | 8E 02 D3 D7 7A F6 4F 64 EC 2B 1E F5 FB 64 D0 2F
|
|
|
|
|
01F0 | A5 6E 46 AB 82 3C BC 29 5F 32 1E 79 05 1F 58 F6
|
|
|
|
|
0200 | F3 E3 8B 4A 63 55 9C FE DF 91 45 6B 37 59 1B D2
|
|
|
|
|
0210 | 45 3A 67 C8 2C 82 14 BA 16 00 91 B8 AE 07 E0 A7
|
|
|
|
|
0220 | C7 C9 05 33 A8 10 E7 6E 58 43 8F B3 CF EC C4 D4
|
|
|
|
|
0230 | B8 90 52 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 = BA0D89B5656E13935819E76EEC8A35669A28E65456D3896415003DF7AC4F3A5416E5C36
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>656E13935819E76EEC8A35669A28E654</code></td>
|
|
|
|
|
<td><code>26BD66FAAC9875CFCE27A5E6959EE587</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>56D3896415003DF7AC4F3A5416E5C367</code></td>
|
|
|
|
|
<td><code>B21E985D3EC9B7ECD5D4832913BE6912</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B5656E13935819E76EEC8A35669A28E65456D3896415003DF7AC4F3A5416E5C36
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE00010046851FF32F9D73F99456F20F</code> <code>F27E9C37C331734FB197FE0C1EF4F3FB</code> <code>6B4F965D2A972F17A5A84A7DFFC5DFAC</code> <code>4EA8189341CD812417F42DDBB3CAC6FC</code> <code>F2FAC093438A6421BA4535AD3F926D8C</code> <code>3B84413D6B4C9A00A9CBF549A7AE67F6</code> <code>EE34F036125696A650B5D51345875966</code> <code>327FB16A985EF05BF4F0DB84C3D604A9</code> <code>FD447C1120DB1DCB967C689FD6D25E90</code> <code>53FD8B496D6D41C194B0133B3A3D47BD</code> <code>4DCC3FEB9C887E82F3AAAC7C584D3F84</code> <code>474F8CA6D18872599800FE575B56E7A1</code> <code>2404C39DFFBFD81276630B08768DAA55</code> <code>D2C94B6DE54D391FB43556303963A107</code> <code>F60E89747B8C605258810FBA58E2E572</code> <code>29EBC93016A5550F071EA305BD29858B</code><br> <code>41F380A0</code></td>
|
|
|
|
|
<td><code>FE0001002BF6F2C80188A19712DFEE1B</code> <code>962274142091C35FA6DD61F3BDF525AC</code> <code>DD5F18B0E1DBCFF01E2A06A6813FE60A</code> <code>0447123375B11275911F82448E0F1A87</code> <code>8A3C893B3129A40E4A6AC8C4BA6342FD</code> <code>40F00BC36E0234C70D98C0AD46DE23A3</code> <code>882F2B5846DD20CB6A16C61FF3411DC3</code> <code>56A46222DCBFE188720D9F1D3834E313</code> <code>DC2331B10CEF42AD4BFBED3FB7C97DFE</code> <code>1DE36B17E99452947B185575ADCADB76</code> <code>ED7AD49B671D46F475568E7D5B72FFC8</code> <code>222F6A8D8E02D3D77AF64F64EC2B1EF5</code> <code>FB64D02FA56E46AB823CBC295F321E79</code> <code>051F58F6F3E38B4A63559CFEDF91456B</code> <code>37591BD2453A67C82C8214BA160091B8</code> <code>AE07E0A7C7C90533A810E76E58438FB3</code><br> <code>CFECC4D4</code></td>
|
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>5C8F5265</code> (1699909468 in decimal)</td>
|
|
|
|
|
<td><code>B8905265</code> (1699909816 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B5656E13935819E76EEC8A35669A28E65456D3896415003DF7AC4F3A5416E5C36
|
|
|
|
|
<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 = A9C62D5F5DF7D5064C52FA9E15A724EF2111A658FE6C4A45DB02313C58899C1806E1655A819D0C7B6454213481C93C734637E240990272B41E0B25896954F60DE3734C08792E0AFBE0B92C49E4A77CC0B819EE5721108753247769FE7E2DE396B76A43A1D9A1B2014F045D042914780820CB3A44E6FD685C8B177C776CE1B8203FDF4CE2D0D9BB559EF4E52EA7D08BA71FC3EB44BA964931ADD84BF952AADE5A76E28CC40005A322C92C19722035108EEEDC7963E471F807161383B9210ECC78EE3C3654C94AC23B2905FB5E33260B2A660C898DC9EB0F1C7B91D05E71AC61B8E334D530F70ED468FAF312A3A0FD1720499F3EA2703CB240438FA32BFE9AB9DF</code></pre>
|
|
|
|
|
<pre><code>b = 40B667AA49BC731928F4D56C0293F550A41772B17B014881E9DBD659B92B3883475A2D46BB1F990CDC24CB20A12B034E011CFC924E7B85763278B70D5CD5CDD8630C3707411ECD5C52628B7819C4608930CB1D7AF3F9AABEBCC2BB31378C2D61C820B3E8EEED18535D4C534B2A63605BBD471BC741D0811803C3077835A6F4A3DE33569B0935DC79E106DC49B26FB16BB23B1B78BE228FDB2517B9D4EBDF3551D0C55F771151D454EF2367C3BE4132F8B7613CC05F00C82483E21FB843FCC935366C9AEBB0B731A433994421580446765409F6358A06E6F826DFFCB04FA5AF579CF8AC3EAB7AA018412F1A7A5761C98C7D4B83845E28D59DD81634593BFC9D3F</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 = B91B0D25B5EA73D684D49657008F57D98228B1F4DDBA5D58B61A9AF10676742354B201B209626A19CF2A118E997EF1AF5E60B000FEE007C4F0C621C02375233F9F5E527FF95B448B2456AF0665D7DE0D4219AE06ED3CD24EFB1C77D178534D2BFC24F1AAC069CF1E9B94615CC5A4076ADE695C87EC9B8532A68A0E79FBDF5440231B9DD434DC5E512EC72F2765078A9AB48C118437AF0716C18B02331D131025609BC9F317DB5871CAC35C18DC4B782347B217AD5C9A42E6CFB50C4F6C1643F90FE27589D229343D942F72A7FFE56213037A55C6AD780ED47942006E699AA1D28FA5003D7349B3F77A2DE1289EE7711CB9C609C77DAEEBC261DE438B0914B367</code></pre>
|
|
|
|
|
<pre><code>g_b = 3F705A3D16081D2D5303D14160C241DB036755D0409830E7F78CF64E3B9C4D71F514AE2AFBD5C90FC47A9E3C85C430BC00D8777BB8FA35C84744E2B099D08F65757D743E7FB1A48D17AE7124B90AD7DCECF60A2D63B8A7D39CC22249D5D5036BE48B0A88054DA0DF4DE45F3B658570C5B087FEE1AFEE50C915748C0DABD8E23180082315F06A36328E07598184A94D956ABD0316D3D1234A0337315BA7F0AC51A3ED1E2B3B6FD2737FA8FD014B63CC1D132188C735D044FD5981147EDCE292AC11160A58AC38CF56590AB8EA4C02B3D747BD6E9CDEFAA01438D7B6D0746D56830EE2933F5C3D2354204B9ACE7BCCF9566F894B2BFD514BFA62136D361B86A468</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 65 6E 13 93 58 19 E7 6E EC 8A 35 66
|
|
|
|
|
0010 | 9A 28 E6 54 56 D3 89 64 15 00 3D F7 AC 4F 3A 54
|
|
|
|
|
0020 | 16 E5 C3 67 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | B9 1B 0D 25 B5 EA 73 D6 84 D4 96 57 00 8F 57 D9
|
|
|
|
|
0040 | 82 28 B1 F4 DD BA 5D 58 B6 1A 9A F1 06 76 74 23
|
|
|
|
|
0050 | 54 B2 01 B2 09 62 6A 19 CF 2A 11 8E 99 7E F1 AF
|
|
|
|
|
0060 | 5E 60 B0 00 FE E0 07 C4 F0 C6 21 C0 23 75 23 3F
|
|
|
|
|
0070 | 9F 5E 52 7F F9 5B 44 8B 24 56 AF 06 65 D7 DE 0D
|
|
|
|
|
0080 | 42 19 AE 06 ED 3C D2 4E FB 1C 77 D1 78 53 4D 2B
|
|
|
|
|
0090 | FC 24 F1 AA C0 69 CF 1E 9B 94 61 5C C5 A4 07 6A
|
|
|
|
|
00A0 | DE 69 5C 87 EC 9B 85 32 A6 8A 0E 79 FB DF 54 40
|
|
|
|
|
00B0 | 23 1B 9D D4 34 DC 5E 51 2E C7 2F 27 65 07 8A 9A
|
|
|
|
|
00C0 | B4 8C 11 84 37 AF 07 16 C1 8B 02 33 1D 13 10 25
|
|
|
|
|
00D0 | 60 9B C9 F3 17 DB 58 71 CA C3 5C 18 DC 4B 78 23
|
|
|
|
|
00E0 | 47 B2 17 AD 5C 9A 42 E6 CF B5 0C 4F 6C 16 43 F9
|
|
|
|
|
00F0 | 0F E2 75 89 D2 29 34 3D 94 2F 72 A7 FF E5 62 13
|
|
|
|
|
0100 | 03 7A 55 C6 AD 78 0E D4 79 42 00 6E 69 9A A1 D2
|
|
|
|
|
0110 | 8F A5 00 3D 73 49 B3 F7 7A 2D E1 28 9E E7 71 1C
|
|
|
|
|
0120 | B9 C6 09 C7 7D AE EB C2 61 DE 43 8B 09 14 B3 67</code></pre>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 26 BD 66 FA AC 98 75 CF CE 27 A5 E6
|
|
|
|
|
0010 | 95 9E E5 87 B2 1E 98 5D 3E C9 B7 EC D5 D4 83 29
|
|
|
|
|
0020 | 13 BE 69 12 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 3F 70 5A 3D 16 08 1D 2D 53 03 D1 41 60 C2 41 DB
|
|
|
|
|
0040 | 03 67 55 D0 40 98 30 E7 F7 8C F6 4E 3B 9C 4D 71
|
|
|
|
|
0050 | F5 14 AE 2A FB D5 C9 0F C4 7A 9E 3C 85 C4 30 BC
|
|
|
|
|
0060 | 00 D8 77 7B B8 FA 35 C8 47 44 E2 B0 99 D0 8F 65
|
|
|
|
|
0070 | 75 7D 74 3E 7F B1 A4 8D 17 AE 71 24 B9 0A D7 DC
|
|
|
|
|
0080 | EC F6 0A 2D 63 B8 A7 D3 9C C2 22 49 D5 D5 03 6B
|
|
|
|
|
0090 | E4 8B 0A 88 05 4D A0 DF 4D E4 5F 3B 65 85 70 C5
|
|
|
|
|
00A0 | B0 87 FE E1 AF EE 50 C9 15 74 8C 0D AB D8 E2 31
|
|
|
|
|
00B0 | 80 08 23 15 F0 6A 36 32 8E 07 59 81 84 A9 4D 95
|
|
|
|
|
00C0 | 6A BD 03 16 D3 D1 23 4A 03 37 31 5B A7 F0 AC 51
|
|
|
|
|
00D0 | A3 ED 1E 2B 3B 6F D2 73 7F A8 FD 01 4B 63 CC 1D
|
|
|
|
|
00E0 | 13 21 88 C7 35 D0 44 FD 59 81 14 7E DC E2 92 AC
|
|
|
|
|
00F0 | 11 16 0A 58 AC 38 CF 56 59 0A B8 EA 4C 02 B3 D7
|
|
|
|
|
0100 | 47 BD 6E 9C DE FA A0 14 38 D7 B6 D0 74 6D 56 83
|
|
|
|
|
0110 | 0E E2 93 3F 5C 3D 23 54 20 4B 9A CE 7B CC F9 56
|
|
|
|
|
0120 | 6F 89 4B 2B FD 51 4B FA 62 13 6D 36 1B 86 A4 68</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 = BA0D89B5656E13935819E76EEC8A35669A28E65456D3896415003DF7AC4F3A5416E5C36
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>656E13935819E76EEC8A35669A28E654</code></td>
|
|
|
|
|
<td><code>26BD66FAAC9875CFCE27A5E6959EE587</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>56D3896415003DF7AC4F3A5416E5C367</code></td>
|
|
|
|
|
<td><code>B21E985D3EC9B7ECD5D4832913BE6912</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE000100B91B0D25B5EA73D684D49657</code> <code>008F57D98228B1F4DDBA5D58B61A9AF1</code> <code>0676742354B201B209626A19CF2A118E</code> <code>997EF1AF5E60B000FEE007C4F0C621C0</code> <code>2375233F9F5E527FF95B448B2456AF06</code> <code>65D7DE0D4219AE06ED3CD24EFB1C77D1</code> <code>78534D2BFC24F1AAC069CF1E9B94615C</code> <code>C5A4076ADE695C87EC9B8532A68A0E79</code> <code>FBDF5440231B9DD434DC5E512EC72F27</code> <code>65078A9AB48C118437AF0716C18B0233</code> <code>1D131025609BC9F317DB5871CAC35C18</code> <code>DC4B782347B217AD5C9A42E6CFB50C4F</code> <code>6C1643F90FE27589D229343D942F72A7</code> <code>FFE56213037A55C6AD780ED47942006E</code> <code>699AA1D28FA5003D7349B3F77A2DE128</code> <code>9EE7711CB9C609C77DAEEBC261DE438B</code><br> <code>0914B367</code></td>
|
|
|
|
|
<td><code>FE0001003F705A3D16081D2D5303D141</code> <code>60C241DB036755D0409830E7F78CF64E</code> <code>3B9C4D71F514AE2AFBD5C90FC47A9E3C</code> <code>85C430BC00D8777BB8FA35C84744E2B0</code> <code>99D08F65757D743E7FB1A48D17AE7124</code> <code>B90AD7DCECF60A2D63B8A7D39CC22249</code> <code>D5D5036BE48B0A88054DA0DF4DE45F3B</code> <code>658570C5B087FEE1AFEE50C915748C0D</code> <code>ABD8E23180082315F06A36328E075981</code> <code>84A94D956ABD0316D3D1234A0337315B</code> <code>A7F0AC51A3ED1E2B3B6FD2737FA8FD01</code> <code>4B63CC1D132188C735D044FD5981147E</code> <code>DCE292AC11160A58AC38CF56590AB8EA</code> <code>4C02B3D747BD6E9CDEFAA01438D7B6D0</code> <code>746D56830EE2933F5C3D2354204B9ACE</code> <code>7BCCF9566F894B2BFD514BFA62136D36</code><br> <code>1B86A468</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 = BA0D89B5656E13935819E76EEC8A35669A28E65456D3896415003DF7AC4F3A5416E5C36
|
|
|
|
|
<!-- 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 = 54B64366656E13935819E76EEC8A35669A28E65456D3896415003DF7AC4F3A5416E5C3670000000000000000FE000100B91B0D25B5EA73D684D49657008F57D98228B1F4DDBA5D58B61A9AF10676742354B201B209626A19CF2A118E997EF1AF5E60B000FEE007C4F0C621C02375233F9F5E527FF95B448B2456AF0665D7DE0D4219AE06ED3CD24EFB1C77D178534D2BFC24F1AAC069CF1E9B94615CC5A4076ADE695C87EC9B8532A68A0E79FBDF5440231B9DD434DC5E512EC72F2765078A9AB48C118437AF0716C18B02331D131025609BC9F317DB5871CAC35C18DC4B782347B217AD5C9A42E6CFB50C4F6C1643F90FE27589D229343D942F72A7FFE56213037A55C6AD780ED47942006E699AA1D28FA5003D7349B3F77A2DE1289EE7711CB9C609C77DAEEBC261DE438B0914B367
|
|
|
|
|
padding = 9A4EA5C48D611C758093013A
|
|
|
|
|
tmp_aes_key = 022F9B4E9EADB601A8BC7F9636B1721B7C9E3BBB72927FDC43B052899A31552D
|
|
|
|
|
tmp_aes_iv = 05777D67BA5E51E589DA36B406F2D216280E1341DDF4CA79320CBA1B667FE75D</code></pre>
|
|
|
|
|
<pre><code>data = 54B6436626BD66FAAC9875CFCE27A5E6959EE587B21E985D3EC9B7ECD5D4832913BE69120000000000000000FE0001003F705A3D16081D2D5303D14160C241DB036755D0409830E7F78CF64E3B9C4D71F514AE2AFBD5C90FC47A9E3C85C430BC00D8777BB8FA35C84744E2B099D08F65757D743E7FB1A48D17AE7124B90AD7DCECF60A2D63B8A7D39CC22249D5D5036BE48B0A88054DA0DF4DE45F3B658570C5B087FEE1AFEE50C915748C0DABD8E23180082315F06A36328E07598184A94D956ABD0316D3D1234A0337315BA7F0AC51A3ED1E2B3B6FD2737FA8FD014B63CC1D132188C735D044FD5981147EDCE292AC11160A58AC38CF56590AB8EA4C02B3D747BD6E9CDEFAA01438D7B6D0746D56830EE2933F5C3D2354204B9ACE7BCCF9566F894B2BFD514BFA62136D361B86A468
|
|
|
|
|
padding = F453381991D9D60D2636535B
|
|
|
|
|
tmp_aes_key = 50467B2FCB4A132671FAD6A516EE22B77DE5E0D984276C02F0C486AE4CEE52E2
|
|
|
|
|
tmp_aes_iv = CDB0881CC08413E78791861E094E1A279D07459F407D4683DC6558D4D5E3E58D</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 = BC6ACD1D5ADB27D38AD88BE5E673F7EB44A2D42C2E52ED51699E6942B46D4964A42A1DAC0FE2BF5B2784D19A11BC87EF2B5C8C2237E1021447CFA992A672542FB497687C8F7F7E185858B9AA2A77982134AE8ECDA99ECF1203AD98843EE872CA251CC615271F657A7ED332C14D50094E5CCADF2644DFDCF8C6248529BBC76D8CD73AA9AE0C54DCB0DC0F132B64188189F81A2F74B429EE61EFFCF12F7C4DD27A594F4C3B93DE9AF23E6E997F01AF85102CEF173DC7A8957ED2B93442F3EE7F2FCB424B8B8AA9BA30C4A5CA3B0964500318605853CE74B5F6D33820B677BA34D91EFB2A0E28B2F4FCB7B5ACADD4F8C354BAA68DA6242BFC1AD5DBB883FE5E8738DEE2B47D58A8ED91BE2801202481839A7702003555632657AEFEA53AE9B2C30107196214626CA3C19861131B8C1D0C776DA4BBCA727B0A341C2903096E05CE6DE0DA2E1CA62D0EAAB92F5B504A8C1F20</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 18D4986E3CD13B8C752189BF1973C9C65C282CADAFC2AE00B67828E7E68E0BC0145394B83E088A60DC091CE3215E9AE480F28E4ACDD7541D7754BE14E88F7FCF5EB0B0BC467ACBFC2652513637737F789393953C825DC57D7DD01F5366A7E94B374827A3E7742B385E5F6F3DB1AA9D92096A388DF45D1D1BAA96FD18F0D117BEF5EF80E0A9CA376700C841928808A26D7FF82D2DC5FAF3ABDA288ED2F91F54EFDECDDBCFCC326AF365CCFA20EAE06908F5FE99232657B5C11E6565E20E9A30DFA80F05AEA2E2EA072614D870A576A803376F06B09B855E9CC54492D46676B660FDDC05A32C2AA83B992BAE143C10447D246A12D786CD71CC5DB15166AEBAF302B271F3429C592CD9DE0109FAB82DBBA2DA3BB05CCD84BEE607A719158B2A8ECB17A943661EF2DCAEF0BABD58924A57DC4FFEAEEB71D59142567A78214301087ACC21800728D2CEF04380452C5539AED4</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 F0 72 02 00 5C 8F 52 65
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 65 6E 13 93 58 19 E7 6E
|
|
|
|
|
0020 | EC 8A 35 66 9A 28 E6 54 56 D3 89 64 15 00 3D F7
|
|
|
|
|
0030 | AC 4F 3A 54 16 E5 C3 67 FE 50 01 00 BC 6A CD 1D
|
|
|
|
|
0040 | 5A DB 27 D3 8A D8 8B E5 E6 73 F7 EB 44 A2 D4 2C
|
|
|
|
|
0050 | 2E 52 ED 51 69 9E 69 42 B4 6D 49 64 A4 2A 1D AC
|
|
|
|
|
0060 | 0F E2 BF 5B 27 84 D1 9A 11 BC 87 EF 2B 5C 8C 22
|
|
|
|
|
0070 | 37 E1 02 14 47 CF A9 92 A6 72 54 2F B4 97 68 7C
|
|
|
|
|
0080 | 8F 7F 7E 18 58 58 B9 AA 2A 77 98 21 34 AE 8E CD
|
|
|
|
|
0090 | A9 9E CF 12 03 AD 98 84 3E E8 72 CA 25 1C C6 15
|
|
|
|
|
00A0 | 27 1F 65 7A 7E D3 32 C1 4D 50 09 4E 5C CA DF 26
|
|
|
|
|
00B0 | 44 DF DC F8 C6 24 85 29 BB C7 6D 8C D7 3A A9 AE
|
|
|
|
|
00C0 | 0C 54 DC B0 DC 0F 13 2B 64 18 81 89 F8 1A 2F 74
|
|
|
|
|
00D0 | B4 29 EE 61 EF FC F1 2F 7C 4D D2 7A 59 4F 4C 3B
|
|
|
|
|
00E0 | 93 DE 9A F2 3E 6E 99 7F 01 AF 85 10 2C EF 17 3D
|
|
|
|
|
00F0 | C7 A8 95 7E D2 B9 34 42 F3 EE 7F 2F CB 42 4B 8B
|
|
|
|
|
0100 | 8A A9 BA 30 C4 A5 CA 3B 09 64 50 03 18 60 58 53
|
|
|
|
|
0110 | CE 74 B5 F6 D3 38 20 B6 77 BA 34 D9 1E FB 2A 0E
|
|
|
|
|
0120 | 28 B2 F4 FC B7 B5 AC AD D4 F8 C3 54 BA A6 8D A6
|
|
|
|
|
0130 | 24 2B FC 1A D5 DB B8 83 FE 5E 87 38 DE E2 B4 7D
|
|
|
|
|
0140 | 58 A8 ED 91 BE 28 01 20 24 81 83 9A 77 02 00 35
|
|
|
|
|
0150 | 55 63 26 57 AE FE A5 3A E9 B2 C3 01 07 19 62 14
|
|
|
|
|
0160 | 62 6C A3 C1 98 61 13 1B 8C 1D 0C 77 6D A4 BB CA
|
|
|
|
|
0170 | 72 7B 0A 34 1C 29 03 09 6E 05 CE 6D E0 DA 2E 1C
|
|
|
|
|
0180 | A6 2D 0E AA B9 2F 5B 50 4A 8C 1F 20</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 18 3A 0C 00 B9 90 52 65
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 26 BD 66 FA AC 98 75 CF
|
|
|
|
|
0020 | CE 27 A5 E6 95 9E E5 87 B2 1E 98 5D 3E C9 B7 EC
|
|
|
|
|
0030 | D5 D4 83 29 13 BE 69 12 FE 50 01 00 18 D4 98 6E
|
|
|
|
|
0040 | 3C D1 3B 8C 75 21 89 BF 19 73 C9 C6 5C 28 2C AD
|
|
|
|
|
0050 | AF C2 AE 00 B6 78 28 E7 E6 8E 0B C0 14 53 94 B8
|
|
|
|
|
0060 | 3E 08 8A 60 DC 09 1C E3 21 5E 9A E4 80 F2 8E 4A
|
|
|
|
|
0070 | CD D7 54 1D 77 54 BE 14 E8 8F 7F CF 5E B0 B0 BC
|
|
|
|
|
0080 | 46 7A CB FC 26 52 51 36 37 73 7F 78 93 93 95 3C
|
|
|
|
|
0090 | 82 5D C5 7D 7D D0 1F 53 66 A7 E9 4B 37 48 27 A3
|
|
|
|
|
00A0 | E7 74 2B 38 5E 5F 6F 3D B1 AA 9D 92 09 6A 38 8D
|
|
|
|
|
00B0 | F4 5D 1D 1B AA 96 FD 18 F0 D1 17 BE F5 EF 80 E0
|
|
|
|
|
00C0 | A9 CA 37 67 00 C8 41 92 88 08 A2 6D 7F F8 2D 2D
|
|
|
|
|
00D0 | C5 FA F3 AB DA 28 8E D2 F9 1F 54 EF DE CD DB CF
|
|
|
|
|
00E0 | CC 32 6A F3 65 CC FA 20 EA E0 69 08 F5 FE 99 23
|
|
|
|
|
00F0 | 26 57 B5 C1 1E 65 65 E2 0E 9A 30 DF A8 0F 05 AE
|
|
|
|
|
0100 | A2 E2 EA 07 26 14 D8 70 A5 76 A8 03 37 6F 06 B0
|
|
|
|
|
0110 | 9B 85 5E 9C C5 44 92 D4 66 76 B6 60 FD DC 05 A3
|
|
|
|
|
0120 | 2C 2A A8 3B 99 2B AE 14 3C 10 44 7D 24 6A 12 D7
|
|
|
|
|
0130 | 86 CD 71 CC 5D B1 51 66 AE BA F3 02 B2 71 F3 42
|
|
|
|
|
0140 | 9C 59 2C D9 DE 01 09 FA B8 2D BB A2 DA 3B B0 5C
|
|
|
|
|
0150 | CD 84 BE E6 07 A7 19 15 8B 2A 8E CB 17 A9 43 66
|
|
|
|
|
0160 | 1E F2 DC AE F0 BA BD 58 92 4A 57 DC 4F FE AE EB
|
|
|
|
|
0170 | 71 D5 91 42 56 7A 78 21 43 01 08 7A CC 21 80 07
|
|
|
|
|
0180 | 28 D2 CE F0 43 80 45 2C 55 39 AE D4</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>F07202005C8F5265</code></td>
|
|
|
|
|
<td><code>183A0C00B9905265</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>656E13935819E76EEC8A35669A28E654</code></td>
|
|
|
|
|
<td><code>26BD66FAAC9875CFCE27A5E6959EE587</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>56D3896415003DF7AC4F3A5416E5C367</code></td>
|
|
|
|
|
<td><code>B21E985D3EC9B7ECD5D4832913BE6912</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE500100BC6ACD1D5ADB27D38AD88BE5</code> <code>E673F7EB44A2D42C2E52ED51699E6942</code> <code>B46D4964A42A1DAC0FE2BF5B2784D19A</code> <code>11BC87EF2B5C8C2237E1021447CFA992</code> <code>A672542FB497687C8F7F7E185858B9AA</code> <code>2A77982134AE8ECDA99ECF1203AD9884</code> <code>3EE872CA251CC615271F657A7ED332C1</code> <code>4D50094E5CCADF2644DFDCF8C6248529</code> <code>BBC76D8CD73AA9AE0C54DCB0DC0F132B</code> <code>64188189F81A2F74B429EE61EFFCF12F</code> <code>7C4DD27A594F4C3B93DE9AF23E6E997F</code> <code>01AF85102CEF173DC7A8957ED2B93442</code> <code>F3EE7F2FCB424B8B8AA9BA30C4A5CA3B</code> <code>0964500318605853CE74B5F6D33820B6</code> <code>77BA34D91EFB2A0E28B2F4FCB7B5ACAD</code> <code>D4F8C354BAA68DA6242BFC1AD5DBB883</code> <code>FE5E8738DEE2B47D58A8ED91BE280120</code> <code>2481839A7702003555632657AEFEA53A</code> <code>E9B2C30107196214626CA3C19861131B</code> <code>8C1D0C776DA4BBCA727B0A341C290309</code> <code>6E05CE6DE0DA2E1CA62D0EAAB92F5B50</code><br> <code>4A8C1F20</code></td>
|
|
|
|
|
<td><code>FE50010018D4986E3CD13B8C752189BF</code> <code>1973C9C65C282CADAFC2AE00B67828E7</code> <code>E68E0BC0145394B83E088A60DC091CE3</code> <code>215E9AE480F28E4ACDD7541D7754BE14</code> <code>E88F7FCF5EB0B0BC467ACBFC26525136</code> <code>37737F789393953C825DC57D7DD01F53</code> <code>66A7E94B374827A3E7742B385E5F6F3D</code> <code>B1AA9D92096A388DF45D1D1BAA96FD18</code> <code>F0D117BEF5EF80E0A9CA376700C84192</code> <code>8808A26D7FF82D2DC5FAF3ABDA288ED2</code> <code>F91F54EFDECDDBCFCC326AF365CCFA20</code> <code>EAE06908F5FE99232657B5C11E6565E2</code> <code>0E9A30DFA80F05AEA2E2EA072614D870</code> <code>A576A803376F06B09B855E9CC54492D4</code> <code>6676B660FDDC05A32C2AA83B992BAE14</code> <code>3C10447D246A12D786CD71CC5DB15166</code> <code>AEBAF302B271F3429C592CD9DE0109FA</code> <code>B82DBBA2DA3BB05CCD84BEE607A71915</code> <code>8B2A8ECB17A943661EF2DCAEF0BABD58</code> <code>924A57DC4FFEAEEB71D59142567A7821</code> <code>4301087ACC21800728D2CEF04380452C</code><br> <code>5539AED4</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 = A19E77A54D431E58632A6C3CDC1BF97A8425DD8DD2FFB47A88F5E6D6824F896A327728403DF5D41EA36BA5A74D0BEEC6FEF187D8587643D3C596786D4C9B36B904DE484F6F798E99518D3430A9A790C74474429DB518349B289998FE91BDFAB9DF3A8AE27C2D119B48F90AE85D7854CA9DBBFFE82A3C60E6D4FB570755F95504C03777DCDBC3F344E2E5A06C6EDD18598CB1AA14B42202ABB1469425B489CA86CF71B82E6E99EA31224645016E290B734F90CAFA72CEB8FF5E187D0BA3658B72799B48EC9469D9B1EA0260EC1EE22409F8A5D14B7A9920FC33F035578CB75EB107DFA816F9EC2F77D4F6EE76DB884CB8A0EA61D20828E3962918340BFAF5F318</code></pre>
|
|
|
|
|
<pre><code>auth_key = 933DB694728888FBFFE10255BBDA639C075D20570E9C123BFECBD57D43B34E9B4A69E81E65D5C1C0D77DD1EF229B73BD28CB11B8B963CEB39072C960F7608BCDBDD66B3838B6E04BFE5EBC1AF31563B407053F63EC61B00DF7889E65ACF7610EE1CEA93C15EED67327D123536303E7551BCED1E0D1F670700C9734DB7FAB759317CF53FCBAF872D31C8ED4B86101DFD1B4AE6F6823BB31EE77AD4F2B7BE6C1B89361C8B59938D57C8DCB2E2F5C7E75187D73AE872C38383F7DD2C870F6B5303FE9E519F38A5FA42E94358349EC59A4D9F30A7206A698981505A90561B1C069A32FC646EA08175EB203BDC3DD2A88CB020E80090CF69FCA6FD57E5A30436BC764</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 E4 B7 B7 5C 8F 52 65
|
|
|
|
|
0010 | 40 00 00 00 34 F7 CB 3B 65 6E 13 93 58 19 E7 6E
|
|
|
|
|
0020 | EC 8A 35 66 9A 28 E6 54 56 D3 89 64 15 00 3D F7
|
|
|
|
|
0030 | AC 4F 3A 54 16 E5 C3 67 9B 95 A7 41 1F 0B 6B 3E
|
|
|
|
|
0040 | 0D 4C 61 C4 67 B7 8B 84</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 48 59 45 B9 90 52 65
|
|
|
|
|
0010 | 54 00 00 00 34 F7 CB 3B 26 BD 66 FA AC 98 75 CF
|
|
|
|
|
0020 | CE 27 A5 E6 95 9E E5 87 B2 1E 98 5D 3E C9 B7 EC
|
|
|
|
|
0030 | D5 D4 83 29 13 BE 69 12 42 EB 2B 95 75 30 C2 95
|
|
|
|
|
0040 | BC 81 F3 59 99 60 46 85</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>01E4B7B75C8F5265</code></td>
|
|
|
|
|
<td><code>01485945B9905265</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>40000000</code> (64 in decimal)</td>
|
|
|
|
|
<td><code>54000000</code> (84 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -835,19 +835,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>656E13935819E76EEC8A35669A28E654</code></td>
|
|
|
|
|
<td><code>26BD66FAAC9875CFCE27A5E6959EE587</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>56D3896415003DF7AC4F3A5416E5C367</code></td>
|
|
|
|
|
<td><code>B21E985D3EC9B7ECD5D4832913BE6912</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>9B95A7411F0B6B3E0D4C61C467B78B84</code></td>
|
|
|
|
|
<td><code>42EB2B957530C295BC81F35999604685</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>
|
|
|
|
|