|
|
|
@ -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 F0 DB 05 00 55 89 92 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 89 FB 77 7C 8C 42 40 7D
|
|
|
|
|
0020 | 30 CB 64 E1 07 48 47 79</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 8C 76 09 00 65 B5 92 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 0D F5 56 34 D0 15 BE D7
|
|
|
|
|
0020 | 7B AD 5D CB 16 D3 AB BA</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>F0DB050055899266</code></td>
|
|
|
|
|
<td><code>8C76090065B59266</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>89FB777C8C42407D30CB64E107484779</code></td>
|
|
|
|
|
<td><code>0DF55634D015BED77BAD5DCB16D3ABBA</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 1C 95 AB 55 89 92 66
|
|
|
|
|
0010 | 60 00 00 00 63 24 16 05 89 FB 77 7C 8C 42 40 7D
|
|
|
|
|
0020 | 30 CB 64 E1 07 48 47 79 CF CE B2 41 BE 2A 24 10
|
|
|
|
|
0030 | 2B 70 B4 7F DF CF 82 A1 08 0E A0 DF 9B DC CA A2
|
|
|
|
|
0040 | 4D 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 44 22 00 66 B5 92 66
|
|
|
|
|
0010 | 6C 00 00 00 63 24 16 05 0D F5 56 34 D0 15 BE D7
|
|
|
|
|
0020 | 7B AD 5D CB 16 D3 AB BA 28 AC 44 D1 B5 66 09 89
|
|
|
|
|
0030 | 4E 08 DB 79 0A 60 23 0B 08 27 A1 90 98 14 2B 03
|
|
|
|
|
0040 | 79 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>011C95AB55899266</code></td>
|
|
|
|
|
<td><code>0144220066B59266</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>60000000</code> (96 in decimal)</td>
|
|
|
|
|
<td><code>6C000000</code> (108 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>89FB777C8C42407D30CB64E107484779</code></td>
|
|
|
|
|
<td><code>0DF55634D015BED77BAD5DCB16D3ABBA</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>CFCEB241BE2A24102B70B47FDFCF82A1</code></td>
|
|
|
|
|
<td><code>28AC44D1B56609894E08DB790A60230B</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>080EA0DF9BDCCAA24D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1054088173321888333</td>
|
|
|
|
|
<td><code>0827A19098142B0379000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2855722621577397113</td>
|
|
|
|
|
<td>Single-byte prefix denoting length, an 8-byte string, and three bytes of padding</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -208,22 +208,22 @@
|
|
|
|
|
<h4><a class="anchor" href="#proof-of-work" id="proof-of-work" name="proof-of-work"><i class="anchor-icon"></i></a>Proof of work</h4>
|
|
|
|
|
<h5><a class="anchor" href="#3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q" id="3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q" name="3-client-decomposes-pq-into-prime-factors-such-that-p-lt-q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p < q.</h5>
|
|
|
|
|
<!-- start pq -->
|
|
|
|
|
<pre><code>pq = 1054088173321888333</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1054088173321888333 = 1019213933 * 1034216801</code></p>
|
|
|
|
|
<pre><code>p = 1019213933
|
|
|
|
|
q = 1034216801</code></pre>
|
|
|
|
|
<pre><code>pq = 2855722621577397113</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2855722621577397113 = 1676538949 * 1703344037</code></p>
|
|
|
|
|
<pre><code>p = 1676538949
|
|
|
|
|
q = 1703344037</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 0E A0 DF 9B DC CA A2 4D 00 00 00
|
|
|
|
|
0010 | 04 3C BF F8 6D 00 00 00 04 3D A4 E5 61 00 00 00
|
|
|
|
|
0020 | 89 FB 77 7C 8C 42 40 7D 30 CB 64 E1 07 48 47 79
|
|
|
|
|
0030 | CF CE B2 41 BE 2A 24 10 2B 70 B4 7F DF CF 82 A1
|
|
|
|
|
0040 | 71 93 D8 0C 98 86 4F C9 59 7D D6 07 15 42 F1 D9
|
|
|
|
|
0050 | 1E 7F B6 E4 BE 10 C4 13 8B 17 0F 20 F4 E0 CE 61
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 27 A1 90 98 14 2B 03 79 00 00 00
|
|
|
|
|
0010 | 04 63 ED F4 45 00 00 00 04 65 86 F7 A5 00 00 00
|
|
|
|
|
0020 | 0D F5 56 34 D0 15 BE D7 7B AD 5D CB 16 D3 AB BA
|
|
|
|
|
0030 | 28 AC 44 D1 B5 66 09 89 4E 08 DB 79 0A 60 23 0B
|
|
|
|
|
0040 | 7C CE 6C 10 57 1C 8B 3A 6A DE A9 F2 7C 43 20 D2
|
|
|
|
|
0050 | 03 13 03 A9 B3 AF 3E C6 EE 17 41 B9 CD 2E 3A 63
|
|
|
|
|
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 = 1034216801</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>080EA0DF9BDCCAA24D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1054088173321888333</td>
|
|
|
|
|
<td><code>0827A19098142B0379000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2855722621577397113</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>043CBFF86D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1019213933</td>
|
|
|
|
|
<td><code>0463EDF445000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1676538949</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>043DA4E561000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1034216801</td>
|
|
|
|
|
<td><code>046586F7A5000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1703344037</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>89FB777C8C42407D30CB64E107484779</code></td>
|
|
|
|
|
<td><code>0DF55634D015BED77BAD5DCB16D3ABBA</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>CFCEB241BE2A24102B70B47FDFCF82A1</code></td>
|
|
|
|
|
<td><code>28AC44D1B56609894E08DB790A60230B</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>7193D80C98864FC9597DD6071542F1D9</code> <code>1E7FB6E4BE10C4138B170F20F4E0CE61</code></td>
|
|
|
|
|
<td><code>7CCE6C10571C8B3A6ADEA9F27C4320D2</code> <code>031303A9B3AF3EC6EE1741B9CD2E3A63</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1034216801</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 = 955FF5A9080EA0DF9BDCCAA24D000000043CBFF86D000000043DA4E56100000089FB777C8C42407D30CB64E107484779CFCEB241BE2A24102B70B47FDFCF82A17193D80C98864FC9597DD6071542F1D91E7FB6E4BE10C4138B170F20F4E0CE6102000000
|
|
|
|
|
random_padding_bytes = 912288A010D91C996D072A907529ECC2B7DC94F0DF3674AAE20ED9CF419A7589DE8083883B0CB4554793D5DC02B5B8FA8580AFBE3C05860D2369176D7E10A678E1FECCE1AF01DBA044EAAF4406EFFB7BB1260C24A696FF5FF6087190</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A90827A19098142B03790000000463EDF445000000046586F7A50000000DF55634D015BED77BAD5DCB16D3ABBA28AC44D1B56609894E08DB790A60230B7CCE6C10571C8B3A6ADEA9F27C4320D2031303A9B3AF3EC6EE1741B9CD2E3A6302000000
|
|
|
|
|
random_padding_bytes = FAEEF667A5D1DC66AABF2BC22FBDFD47A564DA25A10AB703FC9B30D4218E7EDF97A9C600B718FEB73DC8353248BD1E4E1B5F7EC3319B456B5C8BCD67C3EE85858584AF5D557570B485B141C44EC78FBFFB7267E29C9E0A1A33B15925</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 = 1AA4FAEDD65C9C0F8757D8487EDBB3A798113F39F9AAA8AF99C94FF02E79FC01E0FD5028F4D1017CEE4907E57D7FFDD165120B6B2A39A9CFD04EE819F3FD1227A160F7E1BEA95D6AB015D5729074499C2837974EF325BCFD40ACEA0B255F1FD779BDB58878548912F31F827124305A95A634D5BD35261ABC1852ACE87B3CF0D584C639142B6BB192B3F0DBF707521C487B7BBF471881D3E120F2FAADC30B7A357C573822078C0CCA9AA0A22F38C7089935FA057B1E0CA12549586C99C60C363CA90C04E6DFDDCF6D4B0900091B9D4E73D86074C06DC1E1A6887B547E40E90884BAB7BE857A6040D2C3F3C396CE0D926730C9B858C3BF3693904761BEBF14BEAE</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 518D88BABCAB39A5F1B1C470135689C22A9DEABC66E800322E93E092A0C19B790573FC157C3D2A63E3C7C2F5B248B837C8CD2B27F11A7288F7C023B21218BA519ED271E7CBE5570B28887FEC00654A86E2A0B548127B2149F0BD06E5CB80D481D9E43F5B3CB22B638683356948854DE035FF820DF114D99A0754E80E73331DCD15076079BEE1F635AFD3CCEFA2B1D036D08A4E3350B2C458529EEB33DF48E486B8D7A673DDCD4C1FD9099D3FF6E8B5128CCBCA79DCD5899422FC66BCDD3E6AD4FD8227981ADC8AA1284E0327776E1E183F965ED5BB7A5F630BE9659C7F406085D8247AF0C6FDBFD4EE1601714C8E230A4E0AC2B7C44B0C2E57B69E09F4287200</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 0C 80 07 00 55 89 92 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 89 FB 77 7C 8C 42 40 7D
|
|
|
|
|
0020 | 30 CB 64 E1 07 48 47 79 CF CE B2 41 BE 2A 24 10
|
|
|
|
|
0030 | 2B 70 B4 7F DF CF 82 A1 04 3C BF F8 6D 00 00 00
|
|
|
|
|
0040 | 04 3D A4 E5 61 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 1A A4 FA ED D6 5C 9C 0F 87 57 D8 48
|
|
|
|
|
0060 | 7E DB B3 A7 98 11 3F 39 F9 AA A8 AF 99 C9 4F F0
|
|
|
|
|
0070 | 2E 79 FC 01 E0 FD 50 28 F4 D1 01 7C EE 49 07 E5
|
|
|
|
|
0080 | 7D 7F FD D1 65 12 0B 6B 2A 39 A9 CF D0 4E E8 19
|
|
|
|
|
0090 | F3 FD 12 27 A1 60 F7 E1 BE A9 5D 6A B0 15 D5 72
|
|
|
|
|
00A0 | 90 74 49 9C 28 37 97 4E F3 25 BC FD 40 AC EA 0B
|
|
|
|
|
00B0 | 25 5F 1F D7 79 BD B5 88 78 54 89 12 F3 1F 82 71
|
|
|
|
|
00C0 | 24 30 5A 95 A6 34 D5 BD 35 26 1A BC 18 52 AC E8
|
|
|
|
|
00D0 | 7B 3C F0 D5 84 C6 39 14 2B 6B B1 92 B3 F0 DB F7
|
|
|
|
|
00E0 | 07 52 1C 48 7B 7B BF 47 18 81 D3 E1 20 F2 FA AD
|
|
|
|
|
00F0 | C3 0B 7A 35 7C 57 38 22 07 8C 0C CA 9A A0 A2 2F
|
|
|
|
|
0100 | 38 C7 08 99 35 FA 05 7B 1E 0C A1 25 49 58 6C 99
|
|
|
|
|
0110 | C6 0C 36 3C A9 0C 04 E6 DF DD CF 6D 4B 09 00 09
|
|
|
|
|
0120 | 1B 9D 4E 73 D8 60 74 C0 6D C1 E1 A6 88 7B 54 7E
|
|
|
|
|
0130 | 40 E9 08 84 BA B7 BE 85 7A 60 40 D2 C3 F3 C3 96
|
|
|
|
|
0140 | CE 0D 92 67 30 C9 B8 58 C3 BF 36 93 90 47 61 BE
|
|
|
|
|
0150 | BF 14 BE AE</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 40 22 08 00 66 B5 92 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 0D F5 56 34 D0 15 BE D7
|
|
|
|
|
0020 | 7B AD 5D CB 16 D3 AB BA 28 AC 44 D1 B5 66 09 89
|
|
|
|
|
0030 | 4E 08 DB 79 0A 60 23 0B 04 63 ED F4 45 00 00 00
|
|
|
|
|
0040 | 04 65 86 F7 A5 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 51 8D 88 BA BC AB 39 A5 F1 B1 C4 70
|
|
|
|
|
0060 | 13 56 89 C2 2A 9D EA BC 66 E8 00 32 2E 93 E0 92
|
|
|
|
|
0070 | A0 C1 9B 79 05 73 FC 15 7C 3D 2A 63 E3 C7 C2 F5
|
|
|
|
|
0080 | B2 48 B8 37 C8 CD 2B 27 F1 1A 72 88 F7 C0 23 B2
|
|
|
|
|
0090 | 12 18 BA 51 9E D2 71 E7 CB E5 57 0B 28 88 7F EC
|
|
|
|
|
00A0 | 00 65 4A 86 E2 A0 B5 48 12 7B 21 49 F0 BD 06 E5
|
|
|
|
|
00B0 | CB 80 D4 81 D9 E4 3F 5B 3C B2 2B 63 86 83 35 69
|
|
|
|
|
00C0 | 48 85 4D E0 35 FF 82 0D F1 14 D9 9A 07 54 E8 0E
|
|
|
|
|
00D0 | 73 33 1D CD 15 07 60 79 BE E1 F6 35 AF D3 CC EF
|
|
|
|
|
00E0 | A2 B1 D0 36 D0 8A 4E 33 50 B2 C4 58 52 9E EB 33
|
|
|
|
|
00F0 | DF 48 E4 86 B8 D7 A6 73 DD CD 4C 1F D9 09 9D 3F
|
|
|
|
|
0100 | F6 E8 B5 12 8C CB CA 79 DC D5 89 94 22 FC 66 BC
|
|
|
|
|
0110 | DD 3E 6A D4 FD 82 27 98 1A DC 8A A1 28 4E 03 27
|
|
|
|
|
0120 | 77 6E 1E 18 3F 96 5E D5 BB 7A 5F 63 0B E9 65 9C
|
|
|
|
|
0130 | 7F 40 60 85 D8 24 7A F0 C6 FD BF D4 EE 16 01 71
|
|
|
|
|
0140 | 4C 8E 23 0A 4E 0A C2 B7 C4 4B 0C 2E 57 B6 9E 09
|
|
|
|
|
0150 | F4 28 72 00</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 = 912288A010D91C996D072A907529ECC2B7DC94F0DF3674AAE20ED9CF4
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>0C80070055899266</code></td>
|
|
|
|
|
<td><code>4022080066B59266</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 = 912288A010D91C996D072A907529ECC2B7DC94F0DF3674AAE20ED9CF4
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>89FB777C8C42407D30CB64E107484779</code></td>
|
|
|
|
|
<td><code>0DF55634D015BED77BAD5DCB16D3ABBA</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>CFCEB241BE2A24102B70B47FDFCF82A1</code></td>
|
|
|
|
|
<td><code>28AC44D1B56609894E08DB790A60230B</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>043CBFF86D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1019213933</td>
|
|
|
|
|
<td><code>0463EDF445000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1676538949</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>043DA4E561000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1034216801</td>
|
|
|
|
|
<td><code>046586F7A5000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1703344037</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 = 912288A010D91C996D072A907529ECC2B7DC94F0DF3674AAE20ED9CF4
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE0001001AA4FAEDD65C9C0F8757D848</code> <code>7EDBB3A798113F39F9AAA8AF99C94FF0</code> <code>2E79FC01E0FD5028F4D1017CEE4907E5</code> <code>7D7FFDD165120B6B2A39A9CFD04EE819</code> <code>F3FD1227A160F7E1BEA95D6AB015D572</code> <code>9074499C2837974EF325BCFD40ACEA0B</code> <code>255F1FD779BDB58878548912F31F8271</code> <code>24305A95A634D5BD35261ABC1852ACE8</code> <code>7B3CF0D584C639142B6BB192B3F0DBF7</code> <code>07521C487B7BBF471881D3E120F2FAAD</code> <code>C30B7A357C573822078C0CCA9AA0A22F</code> <code>38C7089935FA057B1E0CA12549586C99</code> <code>C60C363CA90C04E6DFDDCF6D4B090009</code> <code>1B9D4E73D86074C06DC1E1A6887B547E</code> <code>40E90884BAB7BE857A6040D2C3F3C396</code> <code>CE0D926730C9B858C3BF3693904761BE</code><br> <code>BF14BEAE</code></td>
|
|
|
|
|
<td><code>FE000100518D88BABCAB39A5F1B1C470</code> <code>135689C22A9DEABC66E800322E93E092</code> <code>A0C19B790573FC157C3D2A63E3C7C2F5</code> <code>B248B837C8CD2B27F11A7288F7C023B2</code> <code>1218BA519ED271E7CBE5570B28887FEC</code> <code>00654A86E2A0B548127B2149F0BD06E5</code> <code>CB80D481D9E43F5B3CB22B6386833569</code> <code>48854DE035FF820DF114D99A0754E80E</code> <code>73331DCD15076079BEE1F635AFD3CCEF</code> <code>A2B1D036D08A4E3350B2C458529EEB33</code> <code>DF48E486B8D7A673DDCD4C1FD9099D3F</code> <code>F6E8B5128CCBCA79DCD5899422FC66BC</code> <code>DD3E6AD4FD8227981ADC8AA1284E0327</code> <code>776E1E183F965ED5BB7A5F630BE9659C</code> <code>7F406085D8247AF0C6FDBFD4EE160171</code> <code>4C8E230A4E0AC2B7C44B0C2E57B69E09</code><br> <code>F4287200</code></td>
|
|
|
|
|
<td>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = 912288A010D91C996D072A907529ECC2B7DC94F0DF3674AAE20ED9CF4
|
|
|
|
|
<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 6C 36 73 56 89 92 66
|
|
|
|
|
0010 | 80 02 00 00 5C 07 E8 D0 89 FB 77 7C 8C 42 40 7D
|
|
|
|
|
0020 | 30 CB 64 E1 07 48 47 79 CF CE B2 41 BE 2A 24 10
|
|
|
|
|
0030 | 2B 70 B4 7F DF CF 82 A1 FE 50 02 00 97 1C 84 90
|
|
|
|
|
0040 | 0D 5B 8F 74 CB 63 37 9E 33 E1 AE CC 74 4D 24 8C
|
|
|
|
|
0050 | 9E 20 58 2B 52 BB 10 79 6E E6 81 8F EC 26 0A 79
|
|
|
|
|
0060 | 12 31 04 FD C7 06 19 DD EA 97 35 01 55 C4 76 FE
|
|
|
|
|
0070 | 85 5C DA 48 5A 41 9B C7 3E 2E 65 71 6A 97 DF 68
|
|
|
|
|
0080 | 14 D5 43 DC 1B 0E 93 FC 62 FF 99 C6 56 7E C7 E2
|
|
|
|
|
0090 | 28 FF 14 7F F1 C8 79 62 E6 7D A0 33 99 47 00 53
|
|
|
|
|
00A0 | 80 E1 67 3F 9C 71 71 9A 2C 15 DF 98 04 E6 63 70
|
|
|
|
|
00B0 | 92 A1 E2 A0 A4 DE 9C 7E BD 4A 79 D6 41 84 EC 2F
|
|
|
|
|
00C0 | 1D E5 D4 9D B6 2F 55 E2 DA 6E 21 57 DA 57 C5 0E
|
|
|
|
|
00D0 | 83 B4 A0 8A 4A C2 08 3B CA E8 AB C6 00 04 A3 7F
|
|
|
|
|
00E0 | A9 45 EF 09 51 DA 61 0A DC 0A 09 A4 F5 53 E7 63
|
|
|
|
|
00F0 | 41 64 CB 02 90 A2 E6 63 8A C3 22 6D BE 3A 36 CC
|
|
|
|
|
0100 | EC 26 32 08 DB 86 79 FB 1C 54 E1 82 BB DF BA B7
|
|
|
|
|
0110 | 89 05 FE 95 A1 89 AC 0C 35 2C 63 75 1A F3 A8 ED
|
|
|
|
|
0120 | 78 90 20 BE 4B CB 43 82 25 3C 4A D6 99 D7 CA CA
|
|
|
|
|
0130 | 4E D9 34 B0 B8 24 4D 92 65 C4 DB 02 2E 54 60 7C
|
|
|
|
|
0140 | 79 7A 3A AE 99 E1 0A 9F A2 D4 DB 77 31 AA BF E2
|
|
|
|
|
0150 | 7A 77 9F CE 95 75 CB EB 8A F8 78 CC 65 4E 22 39
|
|
|
|
|
0160 | 87 88 B9 35 F9 B8 4A FE 3E 5F 27 C3 BC 97 F5 0B
|
|
|
|
|
0170 | F0 91 AB FD 26 16 3A F6 E8 66 15 B2 4B E1 47 E0
|
|
|
|
|
0180 | 71 BB 4A D3 20 9F 9F B4 28 2D 4C 2B 9A D0 E6 2C
|
|
|
|
|
0190 | 38 7E 38 7C B3 DB 16 42 26 A8 EC 09 08 63 E7 AD
|
|
|
|
|
01A0 | 4C 9E 12 C0 DE 42 30 47 6C 07 7A 12 AE F0 89 63
|
|
|
|
|
01B0 | 40 17 B7 0A 64 C7 C7 03 3D 99 1A 31 0B E8 14 36
|
|
|
|
|
01C0 | 55 5D 95 AD A4 13 1A B5 FF 0A CB E3 E7 37 6C 94
|
|
|
|
|
01D0 | 27 09 D3 CB 99 B8 85 2C 29 C5 EA EA AE 57 E0 49
|
|
|
|
|
01E0 | D8 DA 4B 47 5F 3E 14 5F 5F 2B E8 27 8E 5C E0 7F
|
|
|
|
|
01F0 | EA 7D CE 3A 31 15 80 17 72 68 F2 DB BB B2 CA F5
|
|
|
|
|
0200 | 97 E8 35 EA 4C 36 18 C2 8D 80 2F B9 36 C0 90 28
|
|
|
|
|
0210 | BF 0E 2D 2F 8E 5D C6 DE D3 96 AE BA 1C 88 51 E8
|
|
|
|
|
0220 | 53 FF DD BD AE 1D D8 AB 52 21 24 05 34 F6 CD 6A
|
|
|
|
|
0230 | 77 71 66 CF ED FC 56 13 D4 94 A6 29 BF F5 B1 B2
|
|
|
|
|
0240 | A5 E0 14 66 7A 7C EB 5C 35 D9 EF DC BA 01 80 1D
|
|
|
|
|
0250 | AD 84 41 F9 38 0A D7 4C 81 97 25 28 E8 8E 0C BE
|
|
|
|
|
0260 | 35 4F 8D 29 6D F2 20 B4 8D 84 4F C4 03 D5 86 5B
|
|
|
|
|
0270 | EC 7C A6 5F 5E 56 2B 81 C9 F1 67 8E 9F 9B 7F 7C
|
|
|
|
|
0280 | 1B BD C5 AF 6E 2F AE D9 C8 A1 0D 4F</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 8C 43 D2 66 B5 92 66
|
|
|
|
|
0010 | DC 02 00 00 5C 07 E8 D0 0D F5 56 34 D0 15 BE D7
|
|
|
|
|
0020 | 7B AD 5D CB 16 D3 AB BA 28 AC 44 D1 B5 66 09 89
|
|
|
|
|
0030 | 4E 08 DB 79 0A 60 23 0B FE 50 02 00 3E C9 E9 0B
|
|
|
|
|
0040 | 6B 4D 9F EC 16 27 B2 C5 E3 B3 E6 26 BC 1C 56 5A
|
|
|
|
|
0050 | C4 7F 81 A0 E6 C6 24 E3 28 40 DF 3F D2 2E 2B F3
|
|
|
|
|
0060 | D0 52 F0 36 A9 C2 14 B1 2D 32 0A 2B EF 7A CD B0
|
|
|
|
|
0070 | 43 A9 70 2E E5 57 A5 5C D4 69 0A 2D 04 59 4E 55
|
|
|
|
|
0080 | 3F 70 72 E1 6E FD A2 2C 09 17 D1 CF 7C CB E0 B3
|
|
|
|
|
0090 | 80 1A 84 88 40 FE 50 0C 7B 17 FA 83 AF FF 5E 3C
|
|
|
|
|
00A0 | B0 EB A4 5D DC B6 DF 0F 96 3B D6 F5 5D DA 4B 40
|
|
|
|
|
00B0 | C5 A7 E1 AD 08 97 24 70 E2 05 34 FE 5F A9 D1 79
|
|
|
|
|
00C0 | DF 0F D4 1F 2B 04 12 ED 8A 1A 9D D2 A1 2B C8 9C
|
|
|
|
|
00D0 | 3F 72 01 CD 9A 75 E4 C3 A7 0F 6B 87 7E E9 58 EA
|
|
|
|
|
00E0 | C1 DB 9C 4A 29 5A 7E CA 94 73 FE 65 C3 83 49 6E
|
|
|
|
|
00F0 | 71 08 8E 3A CE 94 77 0B 13 C7 36 24 D5 F1 CF F9
|
|
|
|
|
0100 | 05 63 65 DC 03 38 21 37 F3 1C 16 15 CB 8C 96 99
|
|
|
|
|
0110 | 7F F3 24 63 18 32 6A 40 1C 60 E2 5D 64 43 00 2A
|
|
|
|
|
0120 | 65 63 7F C9 BA 0C 18 8E D4 B8 E2 D5 A6 3A 30 0F
|
|
|
|
|
0130 | E6 AC 11 8B F3 9C 1F CE 20 01 8D A5 B1 56 FB 11
|
|
|
|
|
0140 | EE E0 5B 5C 00 0F D3 0B AF FA 23 19 97 EE F9 B2
|
|
|
|
|
0150 | 02 41 50 92 08 5B 03 E4 AC 89 9B C6 6C 12 60 05
|
|
|
|
|
0160 | C7 70 57 20 D3 E8 DF D2 59 D3 BA 4A 20 3F C7 39
|
|
|
|
|
0170 | 47 27 5B E0 58 FF BA 15 5B E4 69 CF 2B 8B D9 B9
|
|
|
|
|
0180 | F0 3F 02 8D 00 D2 5D CD 70 B5 18 E1 08 66 69 52
|
|
|
|
|
0190 | 1E 88 23 55 54 6F 76 30 74 24 41 DE 58 50 C2 57
|
|
|
|
|
01A0 | 24 40 AF D8 24 BC F5 6C F2 BB A1 9E 40 0E 5D 8E
|
|
|
|
|
01B0 | 49 59 89 3B 12 76 84 41 75 3E BF 70 30 D1 C7 1D
|
|
|
|
|
01C0 | A1 2C 1C 29 A3 DF B4 1C 30 77 0C 00 DF E7 28 C1
|
|
|
|
|
01D0 | 93 4C 7B AF 5A 8C 70 2D 0E 62 E9 B5 58 44 A8 01
|
|
|
|
|
01E0 | B9 B7 0C C6 AC 9B BB 43 B4 92 B2 B4 A7 21 30 29
|
|
|
|
|
01F0 | 4F 56 A4 C5 84 30 6B 3B F0 18 D5 FB F6 75 1C 42
|
|
|
|
|
0200 | 25 12 E7 F6 E2 A7 44 42 01 23 B2 28 A5 BE 36 4C
|
|
|
|
|
0210 | 9D AF 49 A6 EF 33 47 59 A4 3D 17 8A 0A 28 C1 09
|
|
|
|
|
0220 | 2D 5C F3 B3 B7 FE A0 57 B9 7A 2E A0 61 4F E3 0D
|
|
|
|
|
0230 | 11 EC 93 FA 8A 27 EF 91 DB 39 92 13 63 8D CB 2A
|
|
|
|
|
0240 | 72 3B F8 77 C0 80 8B ED 6B D3 B0 66 D8 56 44 93
|
|
|
|
|
0250 | 2C 35 96 86 A0 70 A8 95 3A C6 13 BF C4 D3 9E 98
|
|
|
|
|
0260 | 22 C5 37 89 31 AA 89 BE 94 57 27 D1 54 5F FE C8
|
|
|
|
|
0270 | A0 C9 14 D6 4B FC F0 1C ED 58 EA 2E DE 08 2F 1C
|
|
|
|
|
0280 | 75 CA E0 54 34 C1 D1 66 D5 06 F1 98</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 = 912288A010D91C996D072A907529ECC2B7DC94F0DF3674AAE20ED9CF4
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>016C367356899266</code></td>
|
|
|
|
|
<td><code>018C43D266B59266</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>80020000</code> (640 in decimal)</td>
|
|
|
|
|
<td><code>DC020000</code> (732 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -482,19 +482,19 @@ random_padding_bytes = 912288A010D91C996D072A907529ECC2B7DC94F0DF3674AAE20ED9CF4
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>89FB777C8C42407D30CB64E107484779</code></td>
|
|
|
|
|
<td><code>0DF55634D015BED77BAD5DCB16D3ABBA</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>CFCEB241BE2A24102B70B47FDFCF82A1</code></td>
|
|
|
|
|
<td><code>28AC44D1B56609894E08DB790A60230B</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE500200971C84900D5B8F74CB63379E</code> <code>33E1AECC744D248C9E20582B52BB1079</code> <code>6EE6818FEC260A79123104FDC70619DD</code> <code>EA97350155C476FE855CDA485A419BC7</code> <code>3E2E65716A97DF6814D543DC1B0E93FC</code> <code>62FF99C6567EC7E228FF147FF1C87962</code> <code>E67DA0339947005380E1673F9C71719A</code> <code>2C15DF9804E6637092A1E2A0A4DE9C7E</code> <code>BD4A79D64184EC2F1DE5D49DB62F55E2</code> <code>DA6E2157DA57C50E83B4A08A4AC2083B</code> <code>CAE8ABC60004A37FA945EF0951DA610A</code> <code>DC0A09A4F553E7634164CB0290A2E663</code> <code>8AC3226DBE3A36CCEC263208DB8679FB</code> <code>1C54E182BBDFBAB78905FE95A189AC0C</code> <code>352C63751AF3A8ED789020BE4BCB4382</code> <code>253C4AD699D7CACA4ED934B0B8244D92</code> <code>65C4DB022E54607C797A3AAE99E10A9F</code> <code>A2D4DB7731AABFE27A779FCE9575CBEB</code> <code>8AF878CC654E22398788B935F9B84AFE</code> <code>3E5F27C3BC97F50BF091ABFD26163AF6</code> <code>E86615B24BE147E071BB4AD3209F9FB4</code> <code>282D4C2B9AD0E62C387E387CB3DB1642</code> <code>26A8EC090863E7AD4C9E12C0DE423047</code> <code>6C077A12AEF089634017B70A64C7C703</code> <code>3D991A310BE81436555D95ADA4131AB5</code> <code>FF0ACBE3E7376C942709D3CB99B8852C</code> <code>29C5EAEAAE57E049D8DA4B475F3E145F</code> <code>5F2BE8278E5CE07FEA7DCE3A31158017</code> <code>7268F2DBBBB2CAF597E835EA4C3618C2</code> <code>8D802FB936C09028BF0E2D2F8E5DC6DE</code> <code>D396AEBA1C8851E853FFDDBDAE1DD8AB</code> <code>5221240534F6CD6A777166CFEDFC5613</code> <code>D494A629BFF5B1B2A5E014667A7CEB5C</code> <code>35D9EFDCBA01801DAD8441F9380AD74C</code> <code>81972528E88E0CBE354F8D296DF220B4</code> <code>8D844FC403D5865BEC7CA65F5E562B81</code> <code>C9F1678E9F9B7F7C1BBDC5AF6E2FAED9</code><br> <code>C8A10D4F</code></td>
|
|
|
|
|
<td><code>FE5002003EC9E90B6B4D9FEC1627B2C5</code> <code>E3B3E626BC1C565AC47F81A0E6C624E3</code> <code>2840DF3FD22E2BF3D052F036A9C214B1</code> <code>2D320A2BEF7ACDB043A9702EE557A55C</code> <code>D4690A2D04594E553F7072E16EFDA22C</code> <code>0917D1CF7CCBE0B3801A848840FE500C</code> <code>7B17FA83AFFF5E3CB0EBA45DDCB6DF0F</code> <code>963BD6F55DDA4B40C5A7E1AD08972470</code> <code>E20534FE5FA9D179DF0FD41F2B0412ED</code> <code>8A1A9DD2A12BC89C3F7201CD9A75E4C3</code> <code>A70F6B877EE958EAC1DB9C4A295A7ECA</code> <code>9473FE65C383496E71088E3ACE94770B</code> <code>13C73624D5F1CFF9056365DC03382137</code> <code>F31C1615CB8C96997FF3246318326A40</code> <code>1C60E25D6443002A65637FC9BA0C188E</code> <code>D4B8E2D5A63A300FE6AC118BF39C1FCE</code> <code>20018DA5B156FB11EEE05B5C000FD30B</code> <code>AFFA231997EEF9B202415092085B03E4</code> <code>AC899BC66C126005C7705720D3E8DFD2</code> <code>59D3BA4A203FC73947275BE058FFBA15</code> <code>5BE469CF2B8BD9B9F03F028D00D25DCD</code> <code>70B518E1086669521E882355546F7630</code> <code>742441DE5850C2572440AFD824BCF56C</code> <code>F2BBA19E400E5D8E4959893B12768441</code> <code>753EBF7030D1C71DA12C1C29A3DFB41C</code> <code>30770C00DFE728C1934C7BAF5A8C702D</code> <code>0E62E9B55844A801B9B70CC6AC9BBB43</code> <code>B492B2B4A72130294F56A4C584306B3B</code> <code>F018D5FBF6751C422512E7F6E2A74442</code> <code>0123B228A5BE364C9DAF49A6EF334759</code> <code>A43D178A0A28C1092D5CF3B3B7FEA057</code> <code>B97A2EA0614FE30D11EC93FA8A27EF91</code> <code>DB399213638DCB2A723BF877C0808BED</code> <code>6BD3B066D85644932C359686A070A895</code> <code>3AC613BFC4D39E9822C5378931AA89BE</code> <code>945727D1545FFEC8A0C914D64BFCF01C</code> <code>ED58EA2EDE082F1C75CAE05434C1D166</code><br> <code>D506F198</code></td>
|
|
|
|
|
<td>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = 912288A010D91C996D072A907529ECC2B7DC94F0DF3674AAE20ED9CF4
|
|
|
|
|
<!-- 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 = 971C84900D5B8F74CB63379E33E1AECC744D248C9E20582B52BB10796EE6818FEC260A79123104FDC70619DDEA97350155C476FE855CDA485A419BC73E2E65716A97DF6814D543DC1B0E93FC62FF99C6567EC7E228FF147FF1C87962E67DA0339947005380E1673F9C71719A2C15DF9804E6637092A1E2A0A4DE9C7EBD4A79D64184EC2F1DE5D49DB62F55E2DA6E2157DA57C50E83B4A08A4AC2083BCAE8ABC60004A37FA945EF0951DA610ADC0A09A4F553E7634164CB0290A2E6638AC3226DBE3A36CCEC263208DB8679FB1C54E182BBDFBAB78905FE95A189AC0C352C63751AF3A8ED789020BE4BCB4382253C4AD699D7CACA4ED934B0B8244D9265C4DB022E54607C797A3AAE99E10A9FA2D4DB7731AABFE27A779FCE9575CBEB8AF878CC654E22398788B935F9B84AFE3E5F27C3BC97F50BF091ABFD26163AF6E86615B24BE147E071BB4AD3209F9FB4282D4C2B9AD0E62C387E387CB3DB164226A8EC090863E7AD4C9E12C0DE4230476C077A12AEF089634017B70A64C7C7033D991A310BE81436555D95ADA4131AB5FF0ACBE3E7376C942709D3CB99B8852C29C5EAEAAE57E049D8DA4B475F3E145F5F2BE8278E5CE07FEA7DCE3A311580177268F2DBBBB2CAF597E835EA4C3618C28D802FB936C09028BF0E2D2F8E5DC6DED396AEBA1C8851E853FFDDBDAE1DD8AB5221240534F6CD6A777166CFEDFC5613D494A629BFF5B1B2A5E014667A7CEB5C35D9EFDCBA01801DAD8441F9380AD74C81972528E88E0CBE354F8D296DF220B48D844FC403D5865BEC7CA65F5E562B81C9F1678E9F9B7F7C1BBDC5AF6E2FAED9C8A10D4F
|
|
|
|
|
tmp_aes_key = 0B78A8FFFA9DF8EB51C21002E1B2EBC36F7DD211CD0153AB95298528F5A56870
|
|
|
|
|
tmp_aes_iv = C9BCF089C6327CFEB86807530A1F99B92248E8C1659368BF793710347193D80C</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = 3EC9E90B6B4D9FEC1627B2C5E3B3E626BC1C565AC47F81A0E6C624E32840DF3FD22E2BF3D052F036A9C214B12D320A2BEF7ACDB043A9702EE557A55CD4690A2D04594E553F7072E16EFDA22C0917D1CF7CCBE0B3801A848840FE500C7B17FA83AFFF5E3CB0EBA45DDCB6DF0F963BD6F55DDA4B40C5A7E1AD08972470E20534FE5FA9D179DF0FD41F2B0412ED8A1A9DD2A12BC89C3F7201CD9A75E4C3A70F6B877EE958EAC1DB9C4A295A7ECA9473FE65C383496E71088E3ACE94770B13C73624D5F1CFF9056365DC03382137F31C1615CB8C96997FF3246318326A401C60E25D6443002A65637FC9BA0C188ED4B8E2D5A63A300FE6AC118BF39C1FCE20018DA5B156FB11EEE05B5C000FD30BAFFA231997EEF9B202415092085B03E4AC899BC66C126005C7705720D3E8DFD259D3BA4A203FC73947275BE058FFBA155BE469CF2B8BD9B9F03F028D00D25DCD70B518E1086669521E882355546F7630742441DE5850C2572440AFD824BCF56CF2BBA19E400E5D8E4959893B12768441753EBF7030D1C71DA12C1C29A3DFB41C30770C00DFE728C1934C7BAF5A8C702D0E62E9B55844A801B9B70CC6AC9BBB43B492B2B4A72130294F56A4C584306B3BF018D5FBF6751C422512E7F6E2A744420123B228A5BE364C9DAF49A6EF334759A43D178A0A28C1092D5CF3B3B7FEA057B97A2EA0614FE30D11EC93FA8A27EF91DB399213638DCB2A723BF877C0808BED6BD3B066D85644932C359686A070A8953AC613BFC4D39E9822C5378931AA89BE945727D1545FFEC8A0C914D64BFCF01CED58EA2EDE082F1C75CAE05434C1D166D506F198
|
|
|
|
|
tmp_aes_key = E154AA8A1DBEDF05F4ACA24419D69DB951D847893A94587963D417EC8246DCA6
|
|
|
|
|
tmp_aes_iv = 9045432B6D986C1F1845D8237206542E1D8F89B0D4C1645BC577B96A7CCE6C10</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = 830B0BC7FFD6913023162DE5171C716029BCE767BA0D89B589FB777C8C42407D30CB64E107484779CFCEB241BE2A24102B70B47FDFCF82A103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010080EA09C18969A018BD7E16D7526FA674638EA13EBA011E2949177008769CC6F8B085E78A2B504B11A8509140570141ADBE3ECA169CAF7AEAD03A6C0068D6371E46F4701862EF1DC7F9439FD67541609DC098BA40FC6737DC2CCA80C878E6DE03AAC041C99AFFE447107F13B8D6880A21587C33501BAFEAA376764365E30B91ED9A90BD8C1BFB163D98721101DC117906561FEFC9555C2BEAA4812CD2318EB25451A4C71D8C86D60B8B962949914E3868C3917F78C28175E8530CA30A4F12C2234CED17E0686094CF53180E9DD292D9E5E9A3A8809A7921B12F22EB2368709015F14CB72C8EEB6CBBC2412737B406BEF36C5B9ED114EC34CBE2E8172EDC85912D568992665158C25E3AE57165
|
|
|
|
|
answer = BA0D89B589FB777C8C42407D30CB64E107484779CFCEB241BE2A24102B70B47FDFCF82A103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010080EA09C18969A018BD7E16D7526FA674638EA13EBA011E2949177008769CC6F8B085E78A2B504B11A8509140570141ADBE3ECA169CAF7AEAD03A6C0068D6371E46F4701862EF1DC7F9439FD67541609DC098BA40FC6737DC2CCA80C878E6DE03AAC041C99AFFE447107F13B8D6880A21587C33501BAFEAA376764365E30B91ED9A90BD8C1BFB163D98721101DC117906561FEFC9555C2BEAA4812CD2318EB25451A4C71D8C86D60B8B962949914E3868C3917F78C28175E8530CA30A4F12C2234CED17E0686094CF53180E9DD292D9E5E9A3A8809A7921B12F22EB2368709015F14CB72C8EEB6CBBC2412737B406BEF36C5B9ED114EC34CBE2E8172EDC85912D568992665158C25E3AE57165</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = 7436663F53A8FD1049B69B29B7D6A73C6FA22E69BA0D89B50DF55634D015BED77BAD5DCB16D3ABBA28AC44D1B56609894E08DB790A60230B03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010059C7340E73A4F8199AC7777457858177AF9D83F22DDCB849F3D5565AA550C6D481A6EB706A172243BBE5E4AD38B98778B853C18158C1F0DD487D17371B99B1B467874A0BB339D3FA0FC72280C86AF7EA3F6E4C9700C9AC8963A227B15B5918AD260E9198216305FEF1E3894E433B6472C526E089AD84671C45F7A140E824F70E6CD70154EECE9DC8EC5A4739537930A54BE7514B343FB7D96A842B11DB524F991E71081FD945068C058562A78A4B7828FBB44BEC541C7D1C1F63EE6CC079E8E6BFB0A4FD661EBB88BDF8E9EF009326C7ECBCBD28436BA51CFE3F81FBCBACE3D6E549D4E857C6BBFDBDAA93EC758D61228070828D07934B5305822450D70912FF66B5926685EE6516EEDF69E2
|
|
|
|
|
answer = BA0D89B50DF55634D015BED77BAD5DCB16D3ABBA28AC44D1B56609894E08DB790A60230B03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010059C7340E73A4F8199AC7777457858177AF9D83F22DDCB849F3D5565AA550C6D481A6EB706A172243BBE5E4AD38B98778B853C18158C1F0DD487D17371B99B1B467874A0BB339D3FA0FC72280C86AF7EA3F6E4C9700C9AC8963A227B15B5918AD260E9198216305FEF1E3894E433B6472C526E089AD84671C45F7A140E824F70E6CD70154EECE9DC8EC5A4739537930A54BE7514B343FB7D96A842B11DB524F991E71081FD945068C058562A78A4B7828FBB44BEC541C7D1C1F63EE6CC079E8E6BFB0A4FD661EBB88BDF8E9EF009326C7ECBCBD28436BA51CFE3F81FBCBACE3D6E549D4E857C6BBFDBDAA93EC758D61228070828D07934B5305822450D70912FF66B5926685EE6516EEDF69E2</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 89 FB 77 7C 8C 42 40 7D 30 CB 64 E1
|
|
|
|
|
0010 | 07 48 47 79 CF CE B2 41 BE 2A 24 10 2B 70 B4 7F
|
|
|
|
|
0020 | DF CF 82 A1 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 0D F5 56 34 D0 15 BE D7 7B AD 5D CB
|
|
|
|
|
0010 | 16 D3 AB BA 28 AC 44 D1 B5 66 09 89 4E 08 DB 79
|
|
|
|
|
0020 | 0A 60 23 0B 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 = BA0D89B589FB777C8C42407D30CB64E107484779CFCEB241BE2A24102B70B47FDFCF82A
|
|
|
|
|
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 | 80 EA 09 C1 89 69 A0 18 BD 7E 16 D7 52 6F A6 74
|
|
|
|
|
0140 | 63 8E A1 3E BA 01 1E 29 49 17 70 08 76 9C C6 F8
|
|
|
|
|
0150 | B0 85 E7 8A 2B 50 4B 11 A8 50 91 40 57 01 41 AD
|
|
|
|
|
0160 | BE 3E CA 16 9C AF 7A EA D0 3A 6C 00 68 D6 37 1E
|
|
|
|
|
0170 | 46 F4 70 18 62 EF 1D C7 F9 43 9F D6 75 41 60 9D
|
|
|
|
|
0180 | C0 98 BA 40 FC 67 37 DC 2C CA 80 C8 78 E6 DE 03
|
|
|
|
|
0190 | AA C0 41 C9 9A FF E4 47 10 7F 13 B8 D6 88 0A 21
|
|
|
|
|
01A0 | 58 7C 33 50 1B AF EA A3 76 76 43 65 E3 0B 91 ED
|
|
|
|
|
01B0 | 9A 90 BD 8C 1B FB 16 3D 98 72 11 01 DC 11 79 06
|
|
|
|
|
01C0 | 56 1F EF C9 55 5C 2B EA A4 81 2C D2 31 8E B2 54
|
|
|
|
|
01D0 | 51 A4 C7 1D 8C 86 D6 0B 8B 96 29 49 91 4E 38 68
|
|
|
|
|
01E0 | C3 91 7F 78 C2 81 75 E8 53 0C A3 0A 4F 12 C2 23
|
|
|
|
|
01F0 | 4C ED 17 E0 68 60 94 CF 53 18 0E 9D D2 92 D9 E5
|
|
|
|
|
0200 | E9 A3 A8 80 9A 79 21 B1 2F 22 EB 23 68 70 90 15
|
|
|
|
|
0210 | F1 4C B7 2C 8E EB 6C BB C2 41 27 37 B4 06 BE F3
|
|
|
|
|
0220 | 6C 5B 9E D1 14 EC 34 CB E2 E8 17 2E DC 85 91 2D
|
|
|
|
|
0230 | 56 89 92 66</code></pre>
|
|
|
|
|
0130 | 59 C7 34 0E 73 A4 F8 19 9A C7 77 74 57 85 81 77
|
|
|
|
|
0140 | AF 9D 83 F2 2D DC B8 49 F3 D5 56 5A A5 50 C6 D4
|
|
|
|
|
0150 | 81 A6 EB 70 6A 17 22 43 BB E5 E4 AD 38 B9 87 78
|
|
|
|
|
0160 | B8 53 C1 81 58 C1 F0 DD 48 7D 17 37 1B 99 B1 B4
|
|
|
|
|
0170 | 67 87 4A 0B B3 39 D3 FA 0F C7 22 80 C8 6A F7 EA
|
|
|
|
|
0180 | 3F 6E 4C 97 00 C9 AC 89 63 A2 27 B1 5B 59 18 AD
|
|
|
|
|
0190 | 26 0E 91 98 21 63 05 FE F1 E3 89 4E 43 3B 64 72
|
|
|
|
|
01A0 | C5 26 E0 89 AD 84 67 1C 45 F7 A1 40 E8 24 F7 0E
|
|
|
|
|
01B0 | 6C D7 01 54 EE CE 9D C8 EC 5A 47 39 53 79 30 A5
|
|
|
|
|
01C0 | 4B E7 51 4B 34 3F B7 D9 6A 84 2B 11 DB 52 4F 99
|
|
|
|
|
01D0 | 1E 71 08 1F D9 45 06 8C 05 85 62 A7 8A 4B 78 28
|
|
|
|
|
01E0 | FB B4 4B EC 54 1C 7D 1C 1F 63 EE 6C C0 79 E8 E6
|
|
|
|
|
01F0 | BF B0 A4 FD 66 1E BB 88 BD F8 E9 EF 00 93 26 C7
|
|
|
|
|
0200 | EC BC BD 28 43 6B A5 1C FE 3F 81 FB CB AC E3 D6
|
|
|
|
|
0210 | E5 49 D4 E8 57 C6 BB FD BD AA 93 EC 75 8D 61 22
|
|
|
|
|
0220 | 80 70 82 8D 07 93 4B 53 05 82 24 50 D7 09 12 FF
|
|
|
|
|
0230 | 66 B5 92 66</code></pre>
|
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
|
<pre><code>server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;</code></pre>
|
|
|
|
|
<table class="table">
|
|
|
|
@ -570,13 +570,13 @@ answer = BA0D89B589FB777C8C42407D30CB64E107484779CFCEB241BE2A24102B70B47FDFCF82A
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>89FB777C8C42407D30CB64E107484779</code></td>
|
|
|
|
|
<td><code>0DF55634D015BED77BAD5DCB16D3ABBA</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>CFCEB241BE2A24102B70B47FDFCF82A1</code></td>
|
|
|
|
|
<td><code>28AC44D1B56609894E08DB790A60230B</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B589FB777C8C42407D30CB64E107484779CFCEB241BE2A24102B70B47FDFCF82A
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE00010080EA09C18969A018BD7E16D7</code> <code>526FA674638EA13EBA011E2949177008</code> <code>769CC6F8B085E78A2B504B11A8509140</code> <code>570141ADBE3ECA169CAF7AEAD03A6C00</code> <code>68D6371E46F4701862EF1DC7F9439FD6</code> <code>7541609DC098BA40FC6737DC2CCA80C8</code> <code>78E6DE03AAC041C99AFFE447107F13B8</code> <code>D6880A21587C33501BAFEAA376764365</code> <code>E30B91ED9A90BD8C1BFB163D98721101</code> <code>DC117906561FEFC9555C2BEAA4812CD2</code> <code>318EB25451A4C71D8C86D60B8B962949</code> <code>914E3868C3917F78C28175E8530CA30A</code> <code>4F12C2234CED17E0686094CF53180E9D</code> <code>D292D9E5E9A3A8809A7921B12F22EB23</code> <code>68709015F14CB72C8EEB6CBBC2412737</code> <code>B406BEF36C5B9ED114EC34CBE2E8172E</code><br> <code>DC85912D</code></td>
|
|
|
|
|
<td><code>FE00010059C7340E73A4F8199AC77774</code> <code>57858177AF9D83F22DDCB849F3D5565A</code> <code>A550C6D481A6EB706A172243BBE5E4AD</code> <code>38B98778B853C18158C1F0DD487D1737</code> <code>1B99B1B467874A0BB339D3FA0FC72280</code> <code>C86AF7EA3F6E4C9700C9AC8963A227B1</code> <code>5B5918AD260E9198216305FEF1E3894E</code> <code>433B6472C526E089AD84671C45F7A140</code> <code>E824F70E6CD70154EECE9DC8EC5A4739</code> <code>537930A54BE7514B343FB7D96A842B11</code> <code>DB524F991E71081FD945068C058562A7</code> <code>8A4B7828FBB44BEC541C7D1C1F63EE6C</code> <code>C079E8E6BFB0A4FD661EBB88BDF8E9EF</code> <code>009326C7ECBCBD28436BA51CFE3F81FB</code> <code>CBACE3D6E549D4E857C6BBFDBDAA93EC</code> <code>758D61228070828D07934B5305822450</code><br> <code>D70912FF</code></td>
|
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>56899266</code> (1720879446 in decimal)</td>
|
|
|
|
|
<td><code>66B59266</code> (1720890726 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B589FB777C8C42407D30CB64E107484779CFCEB241BE2A24102B70B47FDFCF82A
|
|
|
|
|
<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 = 2C967D389A9DC0FFD5E5AF86F53025F672F9058EFD8DB8BD4B6F08675B41291503221553014520A39BC417524C15E5CE36BED97629E141CB12B42A22AF434865257C82004544919B7E42B980D8058FEB3C938D9D972D020C02FED6F0154D3A5E9508789ECC8A23E2782E62936518EBFE1694DCB44F115A9C118C94E29E1427461275A0853F72D26282A35D37E13BDE26926170B39ADD28795FCD8A82B74CC2B48374679C2676E48EDEAA44E95CB25CD55FE4897C0867C42D657D0BF5BB56509E51995A3D452761B9892B19B09A35E5540DD90613E238AAC7C0EB7E43DA766CD19244906EB188959F5CF9B9DCB5D584B7C706ADC4943C0EF23B9A5BBBD6BD4A91</code></pre>
|
|
|
|
|
<pre><code>b = 8E195FAE6EE454BD9EA18950C2B59DF8066748A0896703890AA7A7E40CAF36A64848C040B03C2F87413487BC091073EE55AD48073CEE3B4EEA4D1891BD2AD87DA01800DF40AC89A2183CA21E4C77D9B011427E876506658A1F00250E49417C11F41953FC1B4A8F5135910E3C75AF409D1B7F436112890EB7DB9D747115BA65797D1619C4608ADA8994FAE914E505B7ACE89C46877F749D48AFBF731401BD13DB5DDEDB6753AEEB1D8D667271F17A6EF8CC2EE6CC9C701BE17B3C4E7E4BCF9F3F7B69FCE6492E64811F2A12BF03AF673C6544E9FE7DC1037E3CA6FF1D8EAB066E8D8330EEC186EA07C275CC89D525C785C24CA3AC93ABBF41A5CEE6A03DF0E603</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 = 5D5AAD010D5FC12D7E96AEB202658D19A283038686D85355590C215354386F5CE698BB43A0892D41F0C165C8AED2918C56B5533E20EEE13DF95A02D173303FCCEA845FB41AC08EE3D7666481F9A51A7655A422D10556E55D1C61EF00E17D1F04AF9D6617D8A9F6787108128FBC924D2C313B88CC560B32B4E0DD6553B54117FB877381D5C982B47C4C449FF05ABF587526A653BB671D4B4A944398ADEF1C87894A1718199897869F1E68A2F05F79577F3DC8C7502F54E6555426A465D5B3F83B6FB4E03831BE7675B0E93B1B9587885826DCB7C67A9530D29161CA4F2042F51369375F3A5B8092EC2D7FDACEA57B93F6CD9666FCFE0FAD8EE5E5CA4C8D8BB04C</code></pre>
|
|
|
|
|
<pre><code>g_b = C329A54AA5E6B71448C2EC4ADC46442A3761376C9AE7CF80A0D33AD12E732E6C4435884156647C08AA2DDDB04BD3F3358DE679AB572A9574BB3C33693EE675906F9C9478DFD1C7A7D906C0D41E27B0DB1DBCF97D12ADD8B6592EFD0C95F0AA247EDD9E2159F49372214A296C8CBC7E3FF21CF2DA4740A7F72390B084E45A09FAF174CE2C5A74ACC568ACDBB855C41DDCFA5EAD95DB51A7F12A8A7F65394E91F5E8F70807A634F24D5B01FA7C0706F571CDEAF317B0F1AAA8BE43E7A8D6826867466F72DEA6BDE26E2AF844794E32B339C0951077F2BB0A80B0FBB9CF487E8514A4C8C8BF567DBBF4B96574247BBF981C99F98A618B346804B688F149F6DE8EB1</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 89 FB 77 7C 8C 42 40 7D 30 CB 64 E1
|
|
|
|
|
0010 | 07 48 47 79 CF CE B2 41 BE 2A 24 10 2B 70 B4 7F
|
|
|
|
|
0020 | DF CF 82 A1 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 5D 5A AD 01 0D 5F C1 2D 7E 96 AE B2 02 65 8D 19
|
|
|
|
|
0040 | A2 83 03 86 86 D8 53 55 59 0C 21 53 54 38 6F 5C
|
|
|
|
|
0050 | E6 98 BB 43 A0 89 2D 41 F0 C1 65 C8 AE D2 91 8C
|
|
|
|
|
0060 | 56 B5 53 3E 20 EE E1 3D F9 5A 02 D1 73 30 3F CC
|
|
|
|
|
0070 | EA 84 5F B4 1A C0 8E E3 D7 66 64 81 F9 A5 1A 76
|
|
|
|
|
0080 | 55 A4 22 D1 05 56 E5 5D 1C 61 EF 00 E1 7D 1F 04
|
|
|
|
|
0090 | AF 9D 66 17 D8 A9 F6 78 71 08 12 8F BC 92 4D 2C
|
|
|
|
|
00A0 | 31 3B 88 CC 56 0B 32 B4 E0 DD 65 53 B5 41 17 FB
|
|
|
|
|
00B0 | 87 73 81 D5 C9 82 B4 7C 4C 44 9F F0 5A BF 58 75
|
|
|
|
|
00C0 | 26 A6 53 BB 67 1D 4B 4A 94 43 98 AD EF 1C 87 89
|
|
|
|
|
00D0 | 4A 17 18 19 98 97 86 9F 1E 68 A2 F0 5F 79 57 7F
|
|
|
|
|
00E0 | 3D C8 C7 50 2F 54 E6 55 54 26 A4 65 D5 B3 F8 3B
|
|
|
|
|
00F0 | 6F B4 E0 38 31 BE 76 75 B0 E9 3B 1B 95 87 88 58
|
|
|
|
|
0100 | 26 DC B7 C6 7A 95 30 D2 91 61 CA 4F 20 42 F5 13
|
|
|
|
|
0110 | 69 37 5F 3A 5B 80 92 EC 2D 7F DA CE A5 7B 93 F6
|
|
|
|
|
0120 | CD 96 66 FC FE 0F AD 8E E5 E5 CA 4C 8D 8B B0 4C</code></pre>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 0D F5 56 34 D0 15 BE D7 7B AD 5D CB
|
|
|
|
|
0010 | 16 D3 AB BA 28 AC 44 D1 B5 66 09 89 4E 08 DB 79
|
|
|
|
|
0020 | 0A 60 23 0B 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | C3 29 A5 4A A5 E6 B7 14 48 C2 EC 4A DC 46 44 2A
|
|
|
|
|
0040 | 37 61 37 6C 9A E7 CF 80 A0 D3 3A D1 2E 73 2E 6C
|
|
|
|
|
0050 | 44 35 88 41 56 64 7C 08 AA 2D DD B0 4B D3 F3 35
|
|
|
|
|
0060 | 8D E6 79 AB 57 2A 95 74 BB 3C 33 69 3E E6 75 90
|
|
|
|
|
0070 | 6F 9C 94 78 DF D1 C7 A7 D9 06 C0 D4 1E 27 B0 DB
|
|
|
|
|
0080 | 1D BC F9 7D 12 AD D8 B6 59 2E FD 0C 95 F0 AA 24
|
|
|
|
|
0090 | 7E DD 9E 21 59 F4 93 72 21 4A 29 6C 8C BC 7E 3F
|
|
|
|
|
00A0 | F2 1C F2 DA 47 40 A7 F7 23 90 B0 84 E4 5A 09 FA
|
|
|
|
|
00B0 | F1 74 CE 2C 5A 74 AC C5 68 AC DB B8 55 C4 1D DC
|
|
|
|
|
00C0 | FA 5E AD 95 DB 51 A7 F1 2A 8A 7F 65 39 4E 91 F5
|
|
|
|
|
00D0 | E8 F7 08 07 A6 34 F2 4D 5B 01 FA 7C 07 06 F5 71
|
|
|
|
|
00E0 | CD EA F3 17 B0 F1 AA A8 BE 43 E7 A8 D6 82 68 67
|
|
|
|
|
00F0 | 46 6F 72 DE A6 BD E2 6E 2A F8 44 79 4E 32 B3 39
|
|
|
|
|
0100 | C0 95 10 77 F2 BB 0A 80 B0 FB B9 CF 48 7E 85 14
|
|
|
|
|
0110 | A4 C8 C8 BF 56 7D BB F4 B9 65 74 24 7B BF 98 1C
|
|
|
|
|
0120 | 99 F9 8A 61 8B 34 68 04 B6 88 F1 49 F6 DE 8E B1</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 = BA0D89B589FB777C8C42407D30CB64E107484779CFCEB241BE2A24102B70B47FDFCF82A
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>89FB777C8C42407D30CB64E107484779</code></td>
|
|
|
|
|
<td><code>0DF55634D015BED77BAD5DCB16D3ABBA</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>CFCEB241BE2A24102B70B47FDFCF82A1</code></td>
|
|
|
|
|
<td><code>28AC44D1B56609894E08DB790A60230B</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE0001005D5AAD010D5FC12D7E96AEB2</code> <code>02658D19A283038686D85355590C2153</code> <code>54386F5CE698BB43A0892D41F0C165C8</code> <code>AED2918C56B5533E20EEE13DF95A02D1</code> <code>73303FCCEA845FB41AC08EE3D7666481</code> <code>F9A51A7655A422D10556E55D1C61EF00</code> <code>E17D1F04AF9D6617D8A9F6787108128F</code> <code>BC924D2C313B88CC560B32B4E0DD6553</code> <code>B54117FB877381D5C982B47C4C449FF0</code> <code>5ABF587526A653BB671D4B4A944398AD</code> <code>EF1C87894A1718199897869F1E68A2F0</code> <code>5F79577F3DC8C7502F54E6555426A465</code> <code>D5B3F83B6FB4E03831BE7675B0E93B1B</code> <code>9587885826DCB7C67A9530D29161CA4F</code> <code>2042F51369375F3A5B8092EC2D7FDACE</code> <code>A57B93F6CD9666FCFE0FAD8EE5E5CA4C</code><br> <code>8D8BB04C</code></td>
|
|
|
|
|
<td><code>FE000100C329A54AA5E6B71448C2EC4A</code> <code>DC46442A3761376C9AE7CF80A0D33AD1</code> <code>2E732E6C4435884156647C08AA2DDDB0</code> <code>4BD3F3358DE679AB572A9574BB3C3369</code> <code>3EE675906F9C9478DFD1C7A7D906C0D4</code> <code>1E27B0DB1DBCF97D12ADD8B6592EFD0C</code> <code>95F0AA247EDD9E2159F49372214A296C</code> <code>8CBC7E3FF21CF2DA4740A7F72390B084</code> <code>E45A09FAF174CE2C5A74ACC568ACDBB8</code> <code>55C41DDCFA5EAD95DB51A7F12A8A7F65</code> <code>394E91F5E8F70807A634F24D5B01FA7C</code> <code>0706F571CDEAF317B0F1AAA8BE43E7A8</code> <code>D6826867466F72DEA6BDE26E2AF84479</code> <code>4E32B339C0951077F2BB0A80B0FBB9CF</code> <code>487E8514A4C8C8BF567DBBF4B9657424</code> <code>7BBF981C99F98A618B346804B688F149</code><br> <code>F6DE8EB1</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 = BA0D89B589FB777C8C42407D30CB64E107484779CFCEB241BE2A24102B70B47FDFCF82A
|
|
|
|
|
<!-- 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 = 54B6436689FB777C8C42407D30CB64E107484779CFCEB241BE2A24102B70B47FDFCF82A10000000000000000FE0001005D5AAD010D5FC12D7E96AEB202658D19A283038686D85355590C215354386F5CE698BB43A0892D41F0C165C8AED2918C56B5533E20EEE13DF95A02D173303FCCEA845FB41AC08EE3D7666481F9A51A7655A422D10556E55D1C61EF00E17D1F04AF9D6617D8A9F6787108128FBC924D2C313B88CC560B32B4E0DD6553B54117FB877381D5C982B47C4C449FF05ABF587526A653BB671D4B4A944398ADEF1C87894A1718199897869F1E68A2F05F79577F3DC8C7502F54E6555426A465D5B3F83B6FB4E03831BE7675B0E93B1B9587885826DCB7C67A9530D29161CA4F2042F51369375F3A5B8092EC2D7FDACEA57B93F6CD9666FCFE0FAD8EE5E5CA4C8D8BB04C
|
|
|
|
|
padding = 5DCDFC1FF9AE84B97B04863C
|
|
|
|
|
tmp_aes_key = 0B78A8FFFA9DF8EB51C21002E1B2EBC36F7DD211CD0153AB95298528F5A56870
|
|
|
|
|
tmp_aes_iv = C9BCF089C6327CFEB86807530A1F99B92248E8C1659368BF793710347193D80C</code></pre>
|
|
|
|
|
<pre><code>data = 54B643660DF55634D015BED77BAD5DCB16D3ABBA28AC44D1B56609894E08DB790A60230B0000000000000000FE000100C329A54AA5E6B71448C2EC4ADC46442A3761376C9AE7CF80A0D33AD12E732E6C4435884156647C08AA2DDDB04BD3F3358DE679AB572A9574BB3C33693EE675906F9C9478DFD1C7A7D906C0D41E27B0DB1DBCF97D12ADD8B6592EFD0C95F0AA247EDD9E2159F49372214A296C8CBC7E3FF21CF2DA4740A7F72390B084E45A09FAF174CE2C5A74ACC568ACDBB855C41DDCFA5EAD95DB51A7F12A8A7F65394E91F5E8F70807A634F24D5B01FA7C0706F571CDEAF317B0F1AAA8BE43E7A8D6826867466F72DEA6BDE26E2AF844794E32B339C0951077F2BB0A80B0FBB9CF487E8514A4C8C8BF567DBBF4B96574247BBF981C99F98A618B346804B688F149F6DE8EB1
|
|
|
|
|
padding = 7389490A97CA08AA4F83897E
|
|
|
|
|
tmp_aes_key = E154AA8A1DBEDF05F4ACA24419D69DB951D847893A94587963D417EC8246DCA6
|
|
|
|
|
tmp_aes_iv = 9045432B6D986C1F1845D8237206542E1D8F89B0D4C1645BC577B96A7CCE6C10</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 = C690E8F62D1534D9E763F9D39D62DED16A30C94170FEDA3DB489672D3A5B6A38278184B15A3E2D1BA8BF1E11762B0110F99782B9866015071342B380B1BFCF36B09C965005E2B8D376576EB9D499664B9BF00EB81DCD15BB17F81C516EB08B7421E5F020C42110B28263C579FC5230DBAF33DF912D2A1E1166C1F4AFB6C6A1502B666FF4171D42877520764D6F1181F0FCBE1B5FD56EF8134024714AA0C029EC66C44EA1EE91B17894F62FE8A1271A1697C7B3F73AD17D7B60DBB95401BCF1FEC8B31218B7F47319838CECDE703550CCA22E9CBCBFCE355B04A3C8788C14F3B767B191D0B59984E8CAB1C9456A923271900CB52F5F586A4C47216BDB48097C7E528272684A45C46DE7B9D11ADF86897E883D025A4F0240AD3545544904F594FE0E4F2C3E66944BB53CE819D076C79C3F586E85E49932D38F36681F90BBEABDF87CDB61A6E5BDD7BF33E03D5C5F8D886E</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = E16DAD36B1DD4541AE93119CC5210E0EFA98149E4A4FF1498184616064623CE3CCA2D7B56D030631E2CF4E3798A18FDDB393B06E8A7FA6E961F6A738074092DCDA45BE2136AF1BA1264951C27D17592FD34051B621C4817563C93BBD3297617826F38928D0F4544E05A95B588BFBE994C8BB006BD18FE66E2BE497F4C05E4803341B13BB705092ACE39D38FBFC5C194D88FC867CB379C6081B2BCDC9E0686856AE7125F09A8A2C81E76513518E6D7F3BA005485A6BF23F95AC43E447B8AFC83B8B6325DD99FD31B59BE295A13D97032441C266E2252A26C32A045B9E810C66ABF604397370235932783B53503CB6E876445183A096587A175088C6A3E6DF75016FBC5108D01A373428672092266E78EAFD3FD28347727AAFE3A660F188651B077B7A7A8C1CBE7E61BFB8E6ED979A7CFB179D1DD55257ABC8007892B8374F2DC6AB391AF9C02D3EAD119C8F6A483A1613</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 40 7D 08 00 56 89 92 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 89 FB 77 7C 8C 42 40 7D
|
|
|
|
|
0020 | 30 CB 64 E1 07 48 47 79 CF CE B2 41 BE 2A 24 10
|
|
|
|
|
0030 | 2B 70 B4 7F DF CF 82 A1 FE 50 01 00 C6 90 E8 F6
|
|
|
|
|
0040 | 2D 15 34 D9 E7 63 F9 D3 9D 62 DE D1 6A 30 C9 41
|
|
|
|
|
0050 | 70 FE DA 3D B4 89 67 2D 3A 5B 6A 38 27 81 84 B1
|
|
|
|
|
0060 | 5A 3E 2D 1B A8 BF 1E 11 76 2B 01 10 F9 97 82 B9
|
|
|
|
|
0070 | 86 60 15 07 13 42 B3 80 B1 BF CF 36 B0 9C 96 50
|
|
|
|
|
0080 | 05 E2 B8 D3 76 57 6E B9 D4 99 66 4B 9B F0 0E B8
|
|
|
|
|
0090 | 1D CD 15 BB 17 F8 1C 51 6E B0 8B 74 21 E5 F0 20
|
|
|
|
|
00A0 | C4 21 10 B2 82 63 C5 79 FC 52 30 DB AF 33 DF 91
|
|
|
|
|
00B0 | 2D 2A 1E 11 66 C1 F4 AF B6 C6 A1 50 2B 66 6F F4
|
|
|
|
|
00C0 | 17 1D 42 87 75 20 76 4D 6F 11 81 F0 FC BE 1B 5F
|
|
|
|
|
00D0 | D5 6E F8 13 40 24 71 4A A0 C0 29 EC 66 C4 4E A1
|
|
|
|
|
00E0 | EE 91 B1 78 94 F6 2F E8 A1 27 1A 16 97 C7 B3 F7
|
|
|
|
|
00F0 | 3A D1 7D 7B 60 DB B9 54 01 BC F1 FE C8 B3 12 18
|
|
|
|
|
0100 | B7 F4 73 19 83 8C EC DE 70 35 50 CC A2 2E 9C BC
|
|
|
|
|
0110 | BF CE 35 5B 04 A3 C8 78 8C 14 F3 B7 67 B1 91 D0
|
|
|
|
|
0120 | B5 99 84 E8 CA B1 C9 45 6A 92 32 71 90 0C B5 2F
|
|
|
|
|
0130 | 5F 58 6A 4C 47 21 6B DB 48 09 7C 7E 52 82 72 68
|
|
|
|
|
0140 | 4A 45 C4 6D E7 B9 D1 1A DF 86 89 7E 88 3D 02 5A
|
|
|
|
|
0150 | 4F 02 40 AD 35 45 54 49 04 F5 94 FE 0E 4F 2C 3E
|
|
|
|
|
0160 | 66 94 4B B5 3C E8 19 D0 76 C7 9C 3F 58 6E 85 E4
|
|
|
|
|
0170 | 99 32 D3 8F 36 68 1F 90 BB EA BD F8 7C DB 61 A6
|
|
|
|
|
0180 | E5 BD D7 BF 33 E0 3D 5C 5F 8D 88 6E</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 98 BA 09 00 66 B5 92 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 0D F5 56 34 D0 15 BE D7
|
|
|
|
|
0020 | 7B AD 5D CB 16 D3 AB BA 28 AC 44 D1 B5 66 09 89
|
|
|
|
|
0030 | 4E 08 DB 79 0A 60 23 0B FE 50 01 00 E1 6D AD 36
|
|
|
|
|
0040 | B1 DD 45 41 AE 93 11 9C C5 21 0E 0E FA 98 14 9E
|
|
|
|
|
0050 | 4A 4F F1 49 81 84 61 60 64 62 3C E3 CC A2 D7 B5
|
|
|
|
|
0060 | 6D 03 06 31 E2 CF 4E 37 98 A1 8F DD B3 93 B0 6E
|
|
|
|
|
0070 | 8A 7F A6 E9 61 F6 A7 38 07 40 92 DC DA 45 BE 21
|
|
|
|
|
0080 | 36 AF 1B A1 26 49 51 C2 7D 17 59 2F D3 40 51 B6
|
|
|
|
|
0090 | 21 C4 81 75 63 C9 3B BD 32 97 61 78 26 F3 89 28
|
|
|
|
|
00A0 | D0 F4 54 4E 05 A9 5B 58 8B FB E9 94 C8 BB 00 6B
|
|
|
|
|
00B0 | D1 8F E6 6E 2B E4 97 F4 C0 5E 48 03 34 1B 13 BB
|
|
|
|
|
00C0 | 70 50 92 AC E3 9D 38 FB FC 5C 19 4D 88 FC 86 7C
|
|
|
|
|
00D0 | B3 79 C6 08 1B 2B CD C9 E0 68 68 56 AE 71 25 F0
|
|
|
|
|
00E0 | 9A 8A 2C 81 E7 65 13 51 8E 6D 7F 3B A0 05 48 5A
|
|
|
|
|
00F0 | 6B F2 3F 95 AC 43 E4 47 B8 AF C8 3B 8B 63 25 DD
|
|
|
|
|
0100 | 99 FD 31 B5 9B E2 95 A1 3D 97 03 24 41 C2 66 E2
|
|
|
|
|
0110 | 25 2A 26 C3 2A 04 5B 9E 81 0C 66 AB F6 04 39 73
|
|
|
|
|
0120 | 70 23 59 32 78 3B 53 50 3C B6 E8 76 44 51 83 A0
|
|
|
|
|
0130 | 96 58 7A 17 50 88 C6 A3 E6 DF 75 01 6F BC 51 08
|
|
|
|
|
0140 | D0 1A 37 34 28 67 20 92 26 6E 78 EA FD 3F D2 83
|
|
|
|
|
0150 | 47 72 7A AF E3 A6 60 F1 88 65 1B 07 7B 7A 7A 8C
|
|
|
|
|
0160 | 1C BE 7E 61 BF B8 E6 ED 97 9A 7C FB 17 9D 1D D5
|
|
|
|
|
0170 | 52 57 AB C8 00 78 92 B8 37 4F 2D C6 AB 39 1A F9
|
|
|
|
|
0180 | C0 2D 3E AD 11 9C 8F 6A 48 3A 16 13</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>407D080056899266</code></td>
|
|
|
|
|
<td><code>98BA090066B59266</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>89FB777C8C42407D30CB64E107484779</code></td>
|
|
|
|
|
<td><code>0DF55634D015BED77BAD5DCB16D3ABBA</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>CFCEB241BE2A24102B70B47FDFCF82A1</code></td>
|
|
|
|
|
<td><code>28AC44D1B56609894E08DB790A60230B</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE500100C690E8F62D1534D9E763F9D3</code> <code>9D62DED16A30C94170FEDA3DB489672D</code> <code>3A5B6A38278184B15A3E2D1BA8BF1E11</code> <code>762B0110F99782B9866015071342B380</code> <code>B1BFCF36B09C965005E2B8D376576EB9</code> <code>D499664B9BF00EB81DCD15BB17F81C51</code> <code>6EB08B7421E5F020C42110B28263C579</code> <code>FC5230DBAF33DF912D2A1E1166C1F4AF</code> <code>B6C6A1502B666FF4171D42877520764D</code> <code>6F1181F0FCBE1B5FD56EF8134024714A</code> <code>A0C029EC66C44EA1EE91B17894F62FE8</code> <code>A1271A1697C7B3F73AD17D7B60DBB954</code> <code>01BCF1FEC8B31218B7F47319838CECDE</code> <code>703550CCA22E9CBCBFCE355B04A3C878</code> <code>8C14F3B767B191D0B59984E8CAB1C945</code> <code>6A923271900CB52F5F586A4C47216BDB</code> <code>48097C7E528272684A45C46DE7B9D11A</code> <code>DF86897E883D025A4F0240AD35455449</code> <code>04F594FE0E4F2C3E66944BB53CE819D0</code> <code>76C79C3F586E85E49932D38F36681F90</code> <code>BBEABDF87CDB61A6E5BDD7BF33E03D5C</code><br> <code>5F8D886E</code></td>
|
|
|
|
|
<td><code>FE500100E16DAD36B1DD4541AE93119C</code> <code>C5210E0EFA98149E4A4FF14981846160</code> <code>64623CE3CCA2D7B56D030631E2CF4E37</code> <code>98A18FDDB393B06E8A7FA6E961F6A738</code> <code>074092DCDA45BE2136AF1BA1264951C2</code> <code>7D17592FD34051B621C4817563C93BBD</code> <code>3297617826F38928D0F4544E05A95B58</code> <code>8BFBE994C8BB006BD18FE66E2BE497F4</code> <code>C05E4803341B13BB705092ACE39D38FB</code> <code>FC5C194D88FC867CB379C6081B2BCDC9</code> <code>E0686856AE7125F09A8A2C81E7651351</code> <code>8E6D7F3BA005485A6BF23F95AC43E447</code> <code>B8AFC83B8B6325DD99FD31B59BE295A1</code> <code>3D97032441C266E2252A26C32A045B9E</code> <code>810C66ABF604397370235932783B5350</code> <code>3CB6E876445183A096587A175088C6A3</code> <code>E6DF75016FBC5108D01A373428672092</code> <code>266E78EAFD3FD28347727AAFE3A660F1</code> <code>88651B077B7A7A8C1CBE7E61BFB8E6ED</code> <code>979A7CFB179D1DD55257ABC8007892B8</code> <code>374F2DC6AB391AF9C02D3EAD119C8F6A</code><br> <code>483A1613</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 = 1F20F0C978261ABA5ACCABC0A9A47072C0FA3CA7E9A4B85D7C0D6A3801DA7AFCC1B497BA74EF3E90B59824CB3A03647AA6285BCB347CE972B519DC1C10F9C14EAAE4F240A00CBAD279007C476A207E1FE157AE36303B20A676950805212017F1F10721D54ADB9CBAF8D2E6B41B7CD630668F702D18238C6929F9936930E2094898B2ED9272CE69B49332BB3CEA82B735C2ECB3489191E20662DB8586380C6803C70A6DF2A15A2BD3C4A1CA46B66DA6F0A9753ADEFA958F2F5DB55D8F1699848FE8BE422DE08CA5B49A56E4BEE2BA6BF5CC9D14F8B25DD09C7A941BCFDA2835837971C4274245EC827A77DA8D8489940580DC72683E09F9D424E9D56406BFA7B8</code></pre>
|
|
|
|
|
<pre><code>auth_key = BC5F8685473CEC47AA45796B2312EC8E356216BA2EF8567718BA39524570D83ECEA990050DA8241538574A0EFD0271B565EC174F1AE51AE18D514A277C17BE898AF1927FDE97E21ADAABC992F0153A0FDCE38A0D17DACEBB716FC8B9AB5FECB69FF1C2AE25BF5AD2AD1B99B2261229AF9234B6353E5F27EAD71814CC62B8859DC8B2F4B6312DCCDBCA3A10C51C9C5DBD9D1F626760F69A191AF4E18F0D153BACA8BF5790F580AEE77EAFB301946620616EDAA63F93CE87E0214F23FCF88EE5234557D46316189FF7A9B9320CA27B6DC3B743BBA9FE5156A0BDDFA1C87A146E06EF159234EE6838B6101FF5C18E347EC12477CB32DC9910B8ACD52909F065DEFF</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 CC 67 37 57 89 92 66
|
|
|
|
|
0010 | 48 00 00 00 34 F7 CB 3B 89 FB 77 7C 8C 42 40 7D
|
|
|
|
|
0020 | 30 CB 64 E1 07 48 47 79 CF CE B2 41 BE 2A 24 10
|
|
|
|
|
0030 | 2B 70 B4 7F DF CF 82 A1 D3 50 57 B8 25 CF 3A C7
|
|
|
|
|
0040 | FD 14 CE A9 66 79 E6 47</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 D4 F7 DF 67 B5 92 66
|
|
|
|
|
0010 | 3C 00 00 00 34 F7 CB 3B 0D F5 56 34 D0 15 BE D7
|
|
|
|
|
0020 | 7B AD 5D CB 16 D3 AB BA 28 AC 44 D1 B5 66 09 89
|
|
|
|
|
0030 | 4E 08 DB 79 0A 60 23 0B 92 8A 41 2C C2 1E 5C 4E
|
|
|
|
|
0040 | 5F 1B 98 7B AD 30 82 DD</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>01CC673757899266</code></td>
|
|
|
|
|
<td><code>01D4F7DF67B59266</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>48000000</code> (72 in decimal)</td>
|
|
|
|
|
<td><code>3C000000</code> (60 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>89FB777C8C42407D30CB64E107484779</code></td>
|
|
|
|
|
<td><code>0DF55634D015BED77BAD5DCB16D3ABBA</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>CFCEB241BE2A24102B70B47FDFCF82A1</code></td>
|
|
|
|
|
<td><code>28AC44D1B56609894E08DB790A60230B</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>D35057B825CF3AC7FD14CEA96679E647</code></td>
|
|
|
|
|
<td><code>928A412CC21E5C4E5F1B987BAD3082DD</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>
|
|
|
|
|