|
|
|
@ -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 18 5A 0E 00 DB 3A 88 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE A8 F4 80 B7 39 AF 24 DC
|
|
|
|
|
0020 | 39 2C 2B 09 BA 14 02 07</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 0C 06 0B 00 A6 40 88 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE AF A3 70 A4 FE 31 46 9B
|
|
|
|
|
0020 | 77 38 37 EF BA CC 4A D1</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>185A0E00DB3A8866</code></td>
|
|
|
|
|
<td><code>0C060B00A6408866</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>A8F480B739AF24DC392C2B09BA140207</code></td>
|
|
|
|
|
<td><code>AFA370A4FE31469B773837EFBACC4AD1</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 58 EA 10 DC 3A 88 66
|
|
|
|
|
0010 | 68 00 00 00 63 24 16 05 A8 F4 80 B7 39 AF 24 DC
|
|
|
|
|
0020 | 39 2C 2B 09 BA 14 02 07 D2 2B 8C 0A 59 AD 58 90
|
|
|
|
|
0030 | D7 D6 23 C5 FD B3 E2 7E 08 16 A7 E5 88 B3 27 9C
|
|
|
|
|
0040 | 33 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 7C 5F 90 A6 40 88 66
|
|
|
|
|
0010 | 58 00 00 00 63 24 16 05 AF A3 70 A4 FE 31 46 9B
|
|
|
|
|
0020 | 77 38 37 EF BA CC 4A D1 4E A9 BD B5 C9 43 F4 66
|
|
|
|
|
0030 | CF AC 16 F5 FE 55 C4 6B 08 1E 9D 60 7F 4E DC DE
|
|
|
|
|
0040 | A1 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>0158EA10DC3A8866</code></td>
|
|
|
|
|
<td><code>017C5F90A6408866</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>68000000</code> (104 in decimal)</td>
|
|
|
|
|
<td><code>58000000</code> (88 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>A8F480B739AF24DC392C2B09BA140207</code></td>
|
|
|
|
|
<td><code>AFA370A4FE31469B773837EFBACC4AD1</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>D22B8C0A59AD5890D7D623C5FDB3E27E</code></td>
|
|
|
|
|
<td><code>4EA9BDB5C943F466CFAC16F5FE55C46B</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>0816A7E588B3279C33000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1632525765229124659</td>
|
|
|
|
|
<td><code>081E9D607F4EDCDEA1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2206025492381621921</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 = 1632525765229124659</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1632525765229124659 = 1165991117 * 1400118527</code></p>
|
|
|
|
|
<pre><code>p = 1165991117
|
|
|
|
|
q = 1400118527</code></pre>
|
|
|
|
|
<pre><code>pq = 2206025492381621921</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2206025492381621921 = 1139452757 * 1936039453</code></p>
|
|
|
|
|
<pre><code>p = 1139452757
|
|
|
|
|
q = 1936039453</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 A7 E5 88 B3 27 9C 33 00 00 00
|
|
|
|
|
0010 | 04 45 7F 9C CD 00 00 00 04 53 74 1C FF 00 00 00
|
|
|
|
|
0020 | A8 F4 80 B7 39 AF 24 DC 39 2C 2B 09 BA 14 02 07
|
|
|
|
|
0030 | D2 2B 8C 0A 59 AD 58 90 D7 D6 23 C5 FD B3 E2 7E
|
|
|
|
|
0040 | 84 7F 52 3C 2F A2 10 6F 55 AD 16 13 87 B0 CC FF
|
|
|
|
|
0050 | 78 DD 4B 68 E9 3E 47 1B 02 8F 9B 41 EA 4B ED 8D
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 1E 9D 60 7F 4E DC DE A1 00 00 00
|
|
|
|
|
0010 | 04 43 EA AB 55 00 00 00 04 73 65 9E 1D 00 00 00
|
|
|
|
|
0020 | AF A3 70 A4 FE 31 46 9B 77 38 37 EF BA CC 4A D1
|
|
|
|
|
0030 | 4E A9 BD B5 C9 43 F4 66 CF AC 16 F5 FE 55 C4 6B
|
|
|
|
|
0040 | EA 41 D4 82 C0 17 9A 5C 68 CC F6 AC 0C 69 12 D7
|
|
|
|
|
0050 | C6 0E 96 48 0C 5C 33 02 AF C8 05 76 97 53 C7 BB
|
|
|
|
|
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 = 1400118527</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>0816A7E588B3279C33000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1632525765229124659</td>
|
|
|
|
|
<td><code>081E9D607F4EDCDEA1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2206025492381621921</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>04457F9CCD000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1165991117</td>
|
|
|
|
|
<td><code>0443EAAB55000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1139452757</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>0453741CFF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1400118527</td>
|
|
|
|
|
<td><code>0473659E1D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1936039453</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>A8F480B739AF24DC392C2B09BA140207</code></td>
|
|
|
|
|
<td><code>AFA370A4FE31469B773837EFBACC4AD1</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>D22B8C0A59AD5890D7D623C5FDB3E27E</code></td>
|
|
|
|
|
<td><code>4EA9BDB5C943F466CFAC16F5FE55C46B</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>847F523C2FA2106F55AD161387B0CCFF</code> <code>78DD4B68E93E471B028F9B41EA4BED8D</code></td>
|
|
|
|
|
<td><code>EA41D482C0179A5C68CCF6AC0C6912D7</code> <code>C60E96480C5C3302AFC805769753C7BB</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1400118527</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 = 955FF5A90816A7E588B3279C3300000004457F9CCD0000000453741CFF000000A8F480B739AF24DC392C2B09BA140207D22B8C0A59AD5890D7D623C5FDB3E27E847F523C2FA2106F55AD161387B0CCFF78DD4B68E93E471B028F9B41EA4BED8D02000000
|
|
|
|
|
random_padding_bytes = F36C78DAC681938CD0BA0B1F36143DB5F679EE69586414E554EF1A978F6FB34001B20021F4D2AF94C1E2C4C4EA3F0ED7FA1FB1EA6DB2E7902BDA6DCE3C5DECD3F94969E36418B6DE31BCB04C907F8C8B33624B5AB8AE2F4D8D6CDB19</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A9081E9D607F4EDCDEA10000000443EAAB550000000473659E1D000000AFA370A4FE31469B773837EFBACC4AD14EA9BDB5C943F466CFAC16F5FE55C46BEA41D482C0179A5C68CCF6AC0C6912D7C60E96480C5C3302AFC805769753C7BB02000000
|
|
|
|
|
random_padding_bytes = 59916879694158B4F6140AA84A2935F46F25DDA5EAF4846004E0E79AB4F8AE278881BC07A457331142EEF71EC4BB7F118B8B0A9A402EC717FF399F2DFFBBFFECE261C2560F4A2B8BFA1DDDD29EFD180E7181FE30BC426B9EC759DB45</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 = B935F07BF640CB2C2D112C470A2EECED657FBA19E87DC8A813FB98568A4B07078D78A8C226D4A11E77CA7DE4FC72FCAB88084D2FB13C3D36261E4434213CAC2185208A01BF89ECA4E47965AF550A4B342EA629088E1A6D7575873963B93D54F0C024AC8CD58D260573365E854632261EA61DF26F32C3BE6BFB81D1802F3B6DA575BA39037DFF8688F856ED6FD88B0FDCD47E5B55F8CA694623C0E05C95303974EF692CEE3FF3EF880A05F1B2006BACBDF41836876C04E4DD9C4468AA70EE0952DD6BE0AF40D247BA06C58E75D0BDDDBF609CF9C29C99D82B9B247957EF1F3904E6F5CE0E11E574CD185AD920379CECD6981A1115BB720DAECDB72F8EAE038216</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 10255A06E95189164DDA7CD6285904EC15738E774F9A1CD54C4DE711F9603B6732CF00F4C23D3980241F6BE2BDF8C2ABF3B8C705518F9C31B4A07157304D0D98D5631B647550F7A4389DA2F79074B4666204479C69C138A207C552D0C6891002EC08D8F77C5CE36F38BC26CABEC3AA69BED4F1383D41C77E705E4C8AC7A810F46A536664B52F35A5C37CBAF64D4B91976F53EFD0F1C2155D35B53F738956529416557C4BEC0ADB65412FA2B8E765776DEDBE5C8B9D7810C8D1B455A0090FB4DAB520812C37BF6E62190CC1EC493882FC7D6A0547405EADC11C9BB931C31DF7A5D9B07D960937EDEE71769BA559B2FF19A18E90360705C1DF3539B86116D9BEE6</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 1C F5 07 00 DC 3A 88 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 A8 F4 80 B7 39 AF 24 DC
|
|
|
|
|
0020 | 39 2C 2B 09 BA 14 02 07 D2 2B 8C 0A 59 AD 58 90
|
|
|
|
|
0030 | D7 D6 23 C5 FD B3 E2 7E 04 45 7F 9C CD 00 00 00
|
|
|
|
|
0040 | 04 53 74 1C FF 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 B9 35 F0 7B F6 40 CB 2C 2D 11 2C 47
|
|
|
|
|
0060 | 0A 2E EC ED 65 7F BA 19 E8 7D C8 A8 13 FB 98 56
|
|
|
|
|
0070 | 8A 4B 07 07 8D 78 A8 C2 26 D4 A1 1E 77 CA 7D E4
|
|
|
|
|
0080 | FC 72 FC AB 88 08 4D 2F B1 3C 3D 36 26 1E 44 34
|
|
|
|
|
0090 | 21 3C AC 21 85 20 8A 01 BF 89 EC A4 E4 79 65 AF
|
|
|
|
|
00A0 | 55 0A 4B 34 2E A6 29 08 8E 1A 6D 75 75 87 39 63
|
|
|
|
|
00B0 | B9 3D 54 F0 C0 24 AC 8C D5 8D 26 05 73 36 5E 85
|
|
|
|
|
00C0 | 46 32 26 1E A6 1D F2 6F 32 C3 BE 6B FB 81 D1 80
|
|
|
|
|
00D0 | 2F 3B 6D A5 75 BA 39 03 7D FF 86 88 F8 56 ED 6F
|
|
|
|
|
00E0 | D8 8B 0F DC D4 7E 5B 55 F8 CA 69 46 23 C0 E0 5C
|
|
|
|
|
00F0 | 95 30 39 74 EF 69 2C EE 3F F3 EF 88 0A 05 F1 B2
|
|
|
|
|
0100 | 00 6B AC BD F4 18 36 87 6C 04 E4 DD 9C 44 68 AA
|
|
|
|
|
0110 | 70 EE 09 52 DD 6B E0 AF 40 D2 47 BA 06 C5 8E 75
|
|
|
|
|
0120 | D0 BD DD BF 60 9C F9 C2 9C 99 D8 2B 9B 24 79 57
|
|
|
|
|
0130 | EF 1F 39 04 E6 F5 CE 0E 11 E5 74 CD 18 5A D9 20
|
|
|
|
|
0140 | 37 9C EC D6 98 1A 11 15 BB 72 0D AE CD B7 2F 8E
|
|
|
|
|
0150 | AE 03 82 16</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 74 3E 0E 00 A6 40 88 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 AF A3 70 A4 FE 31 46 9B
|
|
|
|
|
0020 | 77 38 37 EF BA CC 4A D1 4E A9 BD B5 C9 43 F4 66
|
|
|
|
|
0030 | CF AC 16 F5 FE 55 C4 6B 04 43 EA AB 55 00 00 00
|
|
|
|
|
0040 | 04 73 65 9E 1D 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 10 25 5A 06 E9 51 89 16 4D DA 7C D6
|
|
|
|
|
0060 | 28 59 04 EC 15 73 8E 77 4F 9A 1C D5 4C 4D E7 11
|
|
|
|
|
0070 | F9 60 3B 67 32 CF 00 F4 C2 3D 39 80 24 1F 6B E2
|
|
|
|
|
0080 | BD F8 C2 AB F3 B8 C7 05 51 8F 9C 31 B4 A0 71 57
|
|
|
|
|
0090 | 30 4D 0D 98 D5 63 1B 64 75 50 F7 A4 38 9D A2 F7
|
|
|
|
|
00A0 | 90 74 B4 66 62 04 47 9C 69 C1 38 A2 07 C5 52 D0
|
|
|
|
|
00B0 | C6 89 10 02 EC 08 D8 F7 7C 5C E3 6F 38 BC 26 CA
|
|
|
|
|
00C0 | BE C3 AA 69 BE D4 F1 38 3D 41 C7 7E 70 5E 4C 8A
|
|
|
|
|
00D0 | C7 A8 10 F4 6A 53 66 64 B5 2F 35 A5 C3 7C BA F6
|
|
|
|
|
00E0 | 4D 4B 91 97 6F 53 EF D0 F1 C2 15 5D 35 B5 3F 73
|
|
|
|
|
00F0 | 89 56 52 94 16 55 7C 4B EC 0A DB 65 41 2F A2 B8
|
|
|
|
|
0100 | E7 65 77 6D ED BE 5C 8B 9D 78 10 C8 D1 B4 55 A0
|
|
|
|
|
0110 | 09 0F B4 DA B5 20 81 2C 37 BF 6E 62 19 0C C1 EC
|
|
|
|
|
0120 | 49 38 82 FC 7D 6A 05 47 40 5E AD C1 1C 9B B9 31
|
|
|
|
|
0130 | C3 1D F7 A5 D9 B0 7D 96 09 37 ED EE 71 76 9B A5
|
|
|
|
|
0140 | 59 B2 FF 19 A1 8E 90 36 07 05 C1 DF 35 39 B8 61
|
|
|
|
|
0150 | 16 D9 BE E6</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 = F36C78DAC681938CD0BA0B1F36143DB5F679EE69586414E554EF1A978
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>1CF50700DC3A8866</code></td>
|
|
|
|
|
<td><code>743E0E00A6408866</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 = F36C78DAC681938CD0BA0B1F36143DB5F679EE69586414E554EF1A978
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>A8F480B739AF24DC392C2B09BA140207</code></td>
|
|
|
|
|
<td><code>AFA370A4FE31469B773837EFBACC4AD1</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>D22B8C0A59AD5890D7D623C5FDB3E27E</code></td>
|
|
|
|
|
<td><code>4EA9BDB5C943F466CFAC16F5FE55C46B</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>04457F9CCD000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1165991117</td>
|
|
|
|
|
<td><code>0443EAAB55000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1139452757</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>0453741CFF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1400118527</td>
|
|
|
|
|
<td><code>0473659E1D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1936039453</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 = F36C78DAC681938CD0BA0B1F36143DB5F679EE69586414E554EF1A978
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE000100B935F07BF640CB2C2D112C47</code> <code>0A2EECED657FBA19E87DC8A813FB9856</code> <code>8A4B07078D78A8C226D4A11E77CA7DE4</code> <code>FC72FCAB88084D2FB13C3D36261E4434</code> <code>213CAC2185208A01BF89ECA4E47965AF</code> <code>550A4B342EA629088E1A6D7575873963</code> <code>B93D54F0C024AC8CD58D260573365E85</code> <code>4632261EA61DF26F32C3BE6BFB81D180</code> <code>2F3B6DA575BA39037DFF8688F856ED6F</code> <code>D88B0FDCD47E5B55F8CA694623C0E05C</code> <code>95303974EF692CEE3FF3EF880A05F1B2</code> <code>006BACBDF41836876C04E4DD9C4468AA</code> <code>70EE0952DD6BE0AF40D247BA06C58E75</code> <code>D0BDDDBF609CF9C29C99D82B9B247957</code> <code>EF1F3904E6F5CE0E11E574CD185AD920</code> <code>379CECD6981A1115BB720DAECDB72F8E</code><br> <code>AE038216</code></td>
|
|
|
|
|
<td><code>FE00010010255A06E95189164DDA7CD6</code> <code>285904EC15738E774F9A1CD54C4DE711</code> <code>F9603B6732CF00F4C23D3980241F6BE2</code> <code>BDF8C2ABF3B8C705518F9C31B4A07157</code> <code>304D0D98D5631B647550F7A4389DA2F7</code> <code>9074B4666204479C69C138A207C552D0</code> <code>C6891002EC08D8F77C5CE36F38BC26CA</code> <code>BEC3AA69BED4F1383D41C77E705E4C8A</code> <code>C7A810F46A536664B52F35A5C37CBAF6</code> <code>4D4B91976F53EFD0F1C2155D35B53F73</code> <code>8956529416557C4BEC0ADB65412FA2B8</code> <code>E765776DEDBE5C8B9D7810C8D1B455A0</code> <code>090FB4DAB520812C37BF6E62190CC1EC</code> <code>493882FC7D6A0547405EADC11C9BB931</code> <code>C31DF7A5D9B07D960937EDEE71769BA5</code> <code>59B2FF19A18E90360705C1DF3539B861</code><br> <code>16D9BEE6</code></td>
|
|
|
|
|
<td>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = F36C78DAC681938CD0BA0B1F36143DB5F679EE69586414E554EF1A978
|
|
|
|
|
<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 94 EA E4 DC 3A 88 66
|
|
|
|
|
0010 | B8 02 00 00 5C 07 E8 D0 A8 F4 80 B7 39 AF 24 DC
|
|
|
|
|
0020 | 39 2C 2B 09 BA 14 02 07 D2 2B 8C 0A 59 AD 58 90
|
|
|
|
|
0030 | D7 D6 23 C5 FD B3 E2 7E FE 50 02 00 42 6E 17 8E
|
|
|
|
|
0040 | 22 90 2F B5 61 4A 76 E3 DC 90 5D 42 93 8A 76 60
|
|
|
|
|
0050 | DC 15 8B AB 4C 87 70 77 1A AD BE 7E 12 9D 92 E7
|
|
|
|
|
0060 | 19 76 6B 59 B1 41 23 A2 54 48 74 AA 6C 35 57 83
|
|
|
|
|
0070 | 40 E9 FE A2 9A 1E D1 B6 A4 D1 1B FD 0A 2A 89 30
|
|
|
|
|
0080 | 9A 66 48 06 00 F5 EF 2B 6A 63 83 00 C0 67 FF 25
|
|
|
|
|
0090 | 98 18 AE 91 7F 98 C6 7B BE 06 36 46 15 7D 3F 31
|
|
|
|
|
00A0 | A8 22 E5 9B 6B 81 B0 EB 73 76 DC 29 50 D5 83 95
|
|
|
|
|
00B0 | D1 4B DC 6E 6E 2A 27 CD C6 B9 1B 93 01 4C F8 EA
|
|
|
|
|
00C0 | 22 25 AC C6 5B CA 90 4C DC 2F E4 AA 8A 50 49 F0
|
|
|
|
|
00D0 | 83 5F 15 A4 94 11 29 43 71 81 CF DA 22 0E A9 B4
|
|
|
|
|
00E0 | E5 C7 12 73 C8 5A 05 DF CD B9 BC 80 F6 75 6F F3
|
|
|
|
|
00F0 | AD 03 11 6D 4C 74 A2 EF 46 97 25 1E F5 2A DA EE
|
|
|
|
|
0100 | 51 77 A8 6A 8D C1 31 D3 CA 5C 9A A1 6C BF 4B 3A
|
|
|
|
|
0110 | 2B E8 D6 55 26 B7 AC 53 4F 24 2D 4C 93 87 E6 1F
|
|
|
|
|
0120 | 34 63 7B 61 18 A2 2E FD C3 C1 9F 3F D0 CD 14 63
|
|
|
|
|
0130 | E3 F2 40 B4 75 08 31 E5 3D 5A B1 9E 42 AE 16 E1
|
|
|
|
|
0140 | 0E F7 A0 6E C4 15 CB 20 B2 52 21 FB E4 5F 2B D0
|
|
|
|
|
0150 | 63 3E 2D C3 31 65 B9 A6 EE 04 C6 7C F1 32 A6 32
|
|
|
|
|
0160 | 1E E0 22 12 CD 07 DC 57 7F 14 34 FF 0B 57 7D 15
|
|
|
|
|
0170 | 55 B0 46 A5 2F 99 AF 8F AF A7 DF 21 CB E3 BD 6E
|
|
|
|
|
0180 | 8C 6E 91 6D DE 2D 2D 02 BC 63 25 26 92 9A B2 59
|
|
|
|
|
0190 | 3F 8A 97 F0 97 86 82 86 BB 85 25 BE FE 05 CD A8
|
|
|
|
|
01A0 | 46 9D 21 4C 47 8F 53 29 08 D5 3A E0 72 A2 02 84
|
|
|
|
|
01B0 | 6A AB 09 F9 06 DD 38 D5 07 57 2D FF C9 3D 74 18
|
|
|
|
|
01C0 | 14 D2 F7 01 F5 05 4E CD 46 84 C3 8A DC 24 95 33
|
|
|
|
|
01D0 | CD 33 FC 87 AA 06 BD AD 4C 9C F4 E1 6C 24 F3 C5
|
|
|
|
|
01E0 | 43 32 6F BB 15 F5 CC 8A 45 BD 06 55 37 E4 B4 6F
|
|
|
|
|
01F0 | FF D0 3A 9C 90 51 6C B7 CB EE DE 43 71 AF 94 5E
|
|
|
|
|
0200 | BA DF B7 2C E3 8B 4C 87 4B E2 FA A6 80 AA F0 67
|
|
|
|
|
0210 | DA 3A 5D 06 0A 9C 7F 5A F6 20 93 AD 3D 32 8A 31
|
|
|
|
|
0220 | 41 AB 75 83 BA 28 F3 E7 A5 DA 66 09 1C DF 80 0D
|
|
|
|
|
0230 | 32 43 28 6E EC 08 AE 96 DE 97 94 1C 51 41 2C 3D
|
|
|
|
|
0240 | 9A CC 4F 25 E9 23 64 28 C9 98 17 B0 AE CE 80 61
|
|
|
|
|
0250 | B7 B0 D6 B4 B3 09 6B 8A 65 17 CF C0 17 11 3A 8B
|
|
|
|
|
0260 | F3 16 95 03 5C 12 39 EE 74 0F B5 DD 35 78 40 95
|
|
|
|
|
0270 | 54 44 D9 2C 16 72 41 57 09 A4 1F EB E2 78 79 4C
|
|
|
|
|
0280 | 0D 32 0B 18 80 77 28 08 94 F6 E1 C0</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 C0 93 4D A7 40 88 66
|
|
|
|
|
0010 | EC 02 00 00 5C 07 E8 D0 AF A3 70 A4 FE 31 46 9B
|
|
|
|
|
0020 | 77 38 37 EF BA CC 4A D1 4E A9 BD B5 C9 43 F4 66
|
|
|
|
|
0030 | CF AC 16 F5 FE 55 C4 6B FE 50 02 00 F8 8E 57 A9
|
|
|
|
|
0040 | DA 06 BB 5D AE 7C BA 84 5F 60 33 CB A1 16 93 FC
|
|
|
|
|
0050 | F3 19 8E CD A7 35 93 9B 20 F3 86 A0 3A C5 20 98
|
|
|
|
|
0060 | 0D 70 D8 0E 6B 9B C8 53 D6 27 F1 6E F1 EF 01 32
|
|
|
|
|
0070 | 32 01 72 BD 27 11 AE 26 32 6A 07 D2 2E 44 73 DB
|
|
|
|
|
0080 | 9E AA A3 E8 02 93 B0 31 8B 82 67 9A E2 C8 FA E7
|
|
|
|
|
0090 | 10 52 94 DB 6B 13 C7 90 EA 55 45 9C 57 F2 9B 37
|
|
|
|
|
00A0 | 92 1D DC 15 33 5B 0E 94 39 21 70 95 1F 0E 04 22
|
|
|
|
|
00B0 | 38 88 4C 14 02 69 35 9B A0 5C 83 3A 32 D8 67 9C
|
|
|
|
|
00C0 | BD B9 F9 A5 D0 E3 BB E6 F6 27 9F 44 86 42 0A 8A
|
|
|
|
|
00D0 | 18 48 63 68 08 C9 48 FF D4 1A 03 44 36 49 31 A4
|
|
|
|
|
00E0 | 69 6C 0F F2 7C EC 8D 60 8E E9 BD 8F 69 86 06 D4
|
|
|
|
|
00F0 | 6F C5 35 B8 EF FD C2 54 9A 8C A0 D1 0F 72 96 A1
|
|
|
|
|
0100 | 81 52 E3 F5 07 3A 90 D3 52 08 2B 6C 8B CF C1 DE
|
|
|
|
|
0110 | C9 9A 7D 35 CE 49 41 0A 1A 43 25 47 8E 50 49 FE
|
|
|
|
|
0120 | 66 25 80 AB A2 35 BF 12 B6 28 4E 90 FF 92 16 1B
|
|
|
|
|
0130 | 68 3C E0 27 0D FD 79 2F 70 66 1E E7 99 87 4E 15
|
|
|
|
|
0140 | 1F 33 79 50 E4 A8 41 8D 87 B1 04 B7 74 20 A0 F9
|
|
|
|
|
0150 | 6E 53 41 EA 20 8D B6 FD 89 90 4C 2A 28 A8 66 3A
|
|
|
|
|
0160 | 75 F4 04 A8 4F 1E 02 3E 04 1F 4D AE 1E A0 C4 F5
|
|
|
|
|
0170 | FD EE 5C 8D CF 69 09 ED E7 BB 2B 85 C8 7B CA 85
|
|
|
|
|
0180 | 70 10 A6 45 7D 5B 79 EB E7 42 24 22 79 D0 78 6C
|
|
|
|
|
0190 | 8D 85 F7 4C E1 76 B2 FE B9 85 AC A7 98 B3 FF EB
|
|
|
|
|
01A0 | 16 B0 34 FF 2E F4 48 40 66 C5 35 6D B9 7A 1C F3
|
|
|
|
|
01B0 | 1E CB B5 AB 8A 70 6E 75 AA 24 72 CD FF 8E 88 2A
|
|
|
|
|
01C0 | 1C 3F E1 6F 5F EC 5D 3E A5 22 3B 43 AF DB C7 38
|
|
|
|
|
01D0 | 3D B0 B4 EB 65 CD 54 49 52 4A A5 BC 3B 4A 8C E8
|
|
|
|
|
01E0 | 3A DB CF 39 28 D8 12 AA C7 64 B1 4A 40 0D B9 3B
|
|
|
|
|
01F0 | AB FE 63 84 10 E3 25 30 DF DB EF 84 67 50 64 8E
|
|
|
|
|
0200 | 48 78 6C 7E 67 CC C7 0B 6E 99 D2 8B 0D B7 09 36
|
|
|
|
|
0210 | 37 A0 17 18 52 0E F7 57 D6 D2 0D 4F A2 79 F4 66
|
|
|
|
|
0220 | AF F9 14 DE 9F 8D F7 FF 86 CE CA 1C 7A CB 45 A8
|
|
|
|
|
0230 | EC 29 74 76 46 2A 1C E6 7D 7E F6 E2 DF 63 E6 59
|
|
|
|
|
0240 | 74 59 BC C2 75 16 3A A5 DD 07 26 C9 58 EC 8D 46
|
|
|
|
|
0250 | 2A 83 BD EC C5 6D 80 B7 2A B4 1D 02 AF 94 AE DF
|
|
|
|
|
0260 | 73 AF 83 E4 AA 70 61 74 98 8C 40 43 E7 FF E2 EA
|
|
|
|
|
0270 | 20 DF 6C 22 BD 87 37 A2 D3 90 F6 FC 74 8C F9 18
|
|
|
|
|
0280 | D9 73 C3 BE 96 2A 53 80 89 7A 34 F8</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 = F36C78DAC681938CD0BA0B1F36143DB5F679EE69586414E554EF1A978
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>0194EAE4DC3A8866</code></td>
|
|
|
|
|
<td><code>01C0934DA7408866</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>B8020000</code> (696 in decimal)</td>
|
|
|
|
|
<td><code>EC020000</code> (748 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -482,19 +482,19 @@ random_padding_bytes = F36C78DAC681938CD0BA0B1F36143DB5F679EE69586414E554EF1A978
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>A8F480B739AF24DC392C2B09BA140207</code></td>
|
|
|
|
|
<td><code>AFA370A4FE31469B773837EFBACC4AD1</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>D22B8C0A59AD5890D7D623C5FDB3E27E</code></td>
|
|
|
|
|
<td><code>4EA9BDB5C943F466CFAC16F5FE55C46B</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE500200426E178E22902FB5614A76E3</code> <code>DC905D42938A7660DC158BAB4C877077</code> <code>1AADBE7E129D92E719766B59B14123A2</code> <code>544874AA6C35578340E9FEA29A1ED1B6</code> <code>A4D11BFD0A2A89309A66480600F5EF2B</code> <code>6A638300C067FF259818AE917F98C67B</code> <code>BE063646157D3F31A822E59B6B81B0EB</code> <code>7376DC2950D58395D14BDC6E6E2A27CD</code> <code>C6B91B93014CF8EA2225ACC65BCA904C</code> <code>DC2FE4AA8A5049F0835F15A494112943</code> <code>7181CFDA220EA9B4E5C71273C85A05DF</code> <code>CDB9BC80F6756FF3AD03116D4C74A2EF</code> <code>4697251EF52ADAEE5177A86A8DC131D3</code> <code>CA5C9AA16CBF4B3A2BE8D65526B7AC53</code> <code>4F242D4C9387E61F34637B6118A22EFD</code> <code>C3C19F3FD0CD1463E3F240B4750831E5</code> <code>3D5AB19E42AE16E10EF7A06EC415CB20</code> <code>B25221FBE45F2BD0633E2DC33165B9A6</code> <code>EE04C67CF132A6321EE02212CD07DC57</code> <code>7F1434FF0B577D1555B046A52F99AF8F</code> <code>AFA7DF21CBE3BD6E8C6E916DDE2D2D02</code> <code>BC632526929AB2593F8A97F097868286</code> <code>BB8525BEFE05CDA8469D214C478F5329</code> <code>08D53AE072A202846AAB09F906DD38D5</code> <code>07572DFFC93D741814D2F701F5054ECD</code> <code>4684C38ADC249533CD33FC87AA06BDAD</code> <code>4C9CF4E16C24F3C543326FBB15F5CC8A</code> <code>45BD065537E4B46FFFD03A9C90516CB7</code> <code>CBEEDE4371AF945EBADFB72CE38B4C87</code> <code>4BE2FAA680AAF067DA3A5D060A9C7F5A</code> <code>F62093AD3D328A3141AB7583BA28F3E7</code> <code>A5DA66091CDF800D3243286EEC08AE96</code> <code>DE97941C51412C3D9ACC4F25E9236428</code> <code>C99817B0AECE8061B7B0D6B4B3096B8A</code> <code>6517CFC017113A8BF31695035C1239EE</code> <code>740FB5DD357840955444D92C16724157</code> <code>09A41FEBE278794C0D320B1880772808</code><br> <code>94F6E1C0</code></td>
|
|
|
|
|
<td><code>FE500200F88E57A9DA06BB5DAE7CBA84</code> <code>5F6033CBA11693FCF3198ECDA735939B</code> <code>20F386A03AC520980D70D80E6B9BC853</code> <code>D627F16EF1EF0132320172BD2711AE26</code> <code>326A07D22E4473DB9EAAA3E80293B031</code> <code>8B82679AE2C8FAE7105294DB6B13C790</code> <code>EA55459C57F29B37921DDC15335B0E94</code> <code>392170951F0E042238884C140269359B</code> <code>A05C833A32D8679CBDB9F9A5D0E3BBE6</code> <code>F6279F4486420A8A1848636808C948FF</code> <code>D41A0344364931A4696C0FF27CEC8D60</code> <code>8EE9BD8F698606D46FC535B8EFFDC254</code> <code>9A8CA0D10F7296A18152E3F5073A90D3</code> <code>52082B6C8BCFC1DEC99A7D35CE49410A</code> <code>1A4325478E5049FE662580ABA235BF12</code> <code>B6284E90FF92161B683CE0270DFD792F</code> <code>70661EE799874E151F337950E4A8418D</code> <code>87B104B77420A0F96E5341EA208DB6FD</code> <code>89904C2A28A8663A75F404A84F1E023E</code> <code>041F4DAE1EA0C4F5FDEE5C8DCF6909ED</code> <code>E7BB2B85C87BCA857010A6457D5B79EB</code> <code>E742242279D0786C8D85F74CE176B2FE</code> <code>B985ACA798B3FFEB16B034FF2EF44840</code> <code>66C5356DB97A1CF31ECBB5AB8A706E75</code> <code>AA2472CDFF8E882A1C3FE16F5FEC5D3E</code> <code>A5223B43AFDBC7383DB0B4EB65CD5449</code> <code>524AA5BC3B4A8CE83ADBCF3928D812AA</code> <code>C764B14A400DB93BABFE638410E32530</code> <code>DFDBEF846750648E48786C7E67CCC70B</code> <code>6E99D28B0DB7093637A01718520EF757</code> <code>D6D20D4FA279F466AFF914DE9F8DF7FF</code> <code>86CECA1C7ACB45A8EC297476462A1CE6</code> <code>7D7EF6E2DF63E6597459BCC275163AA5</code> <code>DD0726C958EC8D462A83BDECC56D80B7</code> <code>2AB41D02AF94AEDF73AF83E4AA706174</code> <code>988C4043E7FFE2EA20DF6C22BD8737A2</code> <code>D390F6FC748CF918D973C3BE962A5380</code><br> <code>897A34F8</code></td>
|
|
|
|
|
<td>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = F36C78DAC681938CD0BA0B1F36143DB5F679EE69586414E554EF1A978
|
|
|
|
|
<!-- 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 = 426E178E22902FB5614A76E3DC905D42938A7660DC158BAB4C8770771AADBE7E129D92E719766B59B14123A2544874AA6C35578340E9FEA29A1ED1B6A4D11BFD0A2A89309A66480600F5EF2B6A638300C067FF259818AE917F98C67BBE063646157D3F31A822E59B6B81B0EB7376DC2950D58395D14BDC6E6E2A27CDC6B91B93014CF8EA2225ACC65BCA904CDC2FE4AA8A5049F0835F15A4941129437181CFDA220EA9B4E5C71273C85A05DFCDB9BC80F6756FF3AD03116D4C74A2EF4697251EF52ADAEE5177A86A8DC131D3CA5C9AA16CBF4B3A2BE8D65526B7AC534F242D4C9387E61F34637B6118A22EFDC3C19F3FD0CD1463E3F240B4750831E53D5AB19E42AE16E10EF7A06EC415CB20B25221FBE45F2BD0633E2DC33165B9A6EE04C67CF132A6321EE02212CD07DC577F1434FF0B577D1555B046A52F99AF8FAFA7DF21CBE3BD6E8C6E916DDE2D2D02BC632526929AB2593F8A97F097868286BB8525BEFE05CDA8469D214C478F532908D53AE072A202846AAB09F906DD38D507572DFFC93D741814D2F701F5054ECD4684C38ADC249533CD33FC87AA06BDAD4C9CF4E16C24F3C543326FBB15F5CC8A45BD065537E4B46FFFD03A9C90516CB7CBEEDE4371AF945EBADFB72CE38B4C874BE2FAA680AAF067DA3A5D060A9C7F5AF62093AD3D328A3141AB7583BA28F3E7A5DA66091CDF800D3243286EEC08AE96DE97941C51412C3D9ACC4F25E9236428C99817B0AECE8061B7B0D6B4B3096B8A6517CFC017113A8BF31695035C1239EE740FB5DD357840955444D92C1672415709A41FEBE278794C0D320B188077280894F6E1C0
|
|
|
|
|
tmp_aes_key = 42399E0DC08B83C9C20217EC98E69268437D8AD8E975FA6AA59A7C471C631840
|
|
|
|
|
tmp_aes_iv = C57F717B633C595F44189FD35CA951249D64FAC426AA6356C020DFFC847F523C</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = F88E57A9DA06BB5DAE7CBA845F6033CBA11693FCF3198ECDA735939B20F386A03AC520980D70D80E6B9BC853D627F16EF1EF0132320172BD2711AE26326A07D22E4473DB9EAAA3E80293B0318B82679AE2C8FAE7105294DB6B13C790EA55459C57F29B37921DDC15335B0E94392170951F0E042238884C140269359BA05C833A32D8679CBDB9F9A5D0E3BBE6F6279F4486420A8A1848636808C948FFD41A0344364931A4696C0FF27CEC8D608EE9BD8F698606D46FC535B8EFFDC2549A8CA0D10F7296A18152E3F5073A90D352082B6C8BCFC1DEC99A7D35CE49410A1A4325478E5049FE662580ABA235BF12B6284E90FF92161B683CE0270DFD792F70661EE799874E151F337950E4A8418D87B104B77420A0F96E5341EA208DB6FD89904C2A28A8663A75F404A84F1E023E041F4DAE1EA0C4F5FDEE5C8DCF6909EDE7BB2B85C87BCA857010A6457D5B79EBE742242279D0786C8D85F74CE176B2FEB985ACA798B3FFEB16B034FF2EF4484066C5356DB97A1CF31ECBB5AB8A706E75AA2472CDFF8E882A1C3FE16F5FEC5D3EA5223B43AFDBC7383DB0B4EB65CD5449524AA5BC3B4A8CE83ADBCF3928D812AAC764B14A400DB93BABFE638410E32530DFDBEF846750648E48786C7E67CCC70B6E99D28B0DB7093637A01718520EF757D6D20D4FA279F466AFF914DE9F8DF7FF86CECA1C7ACB45A8EC297476462A1CE67D7EF6E2DF63E6597459BCC275163AA5DD0726C958EC8D462A83BDECC56D80B72AB41D02AF94AEDF73AF83E4AA706174988C4043E7FFE2EA20DF6C22BD8737A2D390F6FC748CF918D973C3BE962A5380897A34F8
|
|
|
|
|
tmp_aes_key = 994C8CDB14BD79852644A3A0AC2F17F0BBA74739B50510F89FB24C1AF3359C62
|
|
|
|
|
tmp_aes_iv = 6F34827F604727F0E58EDA63622F7EB017970D8045601D2BF57D24B8EA41D482</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = 39775B6232D4C2F4382E5803183279EA622540EFBA0D89B5A8F480B739AF24DC392C2B09BA140207D22B8C0A59AD5890D7D623C5FDB3E27E03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010047D812AECDF80839F08C2D76E2D34568296A585B271BE25B2123A0EDD7092A28BA93EF5708E327CA2CA59711F9495FA944393B15B6295314A2427487124FAC422549250C3629AB5463D5344C94ABD3E61EBF102EF7E1C7B9A00C2781B4BD224E126A49268F8E322E89A04E69A1ED964AA2577C7A30D345C828321B360DDCCBC46F14BA6E5A0E5ACC63D0D851725F99D8C99B9EF116E522AF5B277F21B01D06CED3727B9249F3902C595AB19E2AEDCF566317A9215F35B859CA79584B3982EB73FB69A2035668C0BBBD5D1F56CB93A7F625D14C9B955834821031E300EE6520FE79B9194460B17C4706E5558B2BE16E2EEA73C6A237CF8598AF283FCC2564D0B7DC3A88669E0FCAE80AE7D45F
|
|
|
|
|
answer = BA0D89B5A8F480B739AF24DC392C2B09BA140207D22B8C0A59AD5890D7D623C5FDB3E27E03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010047D812AECDF80839F08C2D76E2D34568296A585B271BE25B2123A0EDD7092A28BA93EF5708E327CA2CA59711F9495FA944393B15B6295314A2427487124FAC422549250C3629AB5463D5344C94ABD3E61EBF102EF7E1C7B9A00C2781B4BD224E126A49268F8E322E89A04E69A1ED964AA2577C7A30D345C828321B360DDCCBC46F14BA6E5A0E5ACC63D0D851725F99D8C99B9EF116E522AF5B277F21B01D06CED3727B9249F3902C595AB19E2AEDCF566317A9215F35B859CA79584B3982EB73FB69A2035668C0BBBD5D1F56CB93A7F625D14C9B955834821031E300EE6520FE79B9194460B17C4706E5558B2BE16E2EEA73C6A237CF8598AF283FCC2564D0B7DC3A88669E0FCAE80AE7D45F</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = E675AB25FF60478B378CCC246F32A45B204CA9D5BA0D89B5AFA370A4FE31469B773837EFBACC4AD14EA9BDB5C943F466CFAC16F5FE55C46B03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010044E9DAF43C286D6D9B3E67B91A23FE3BB1548AB83AD3337B6A7C839C9521EF3E31008E8B18973A57E9DF25B7201B67BA1C30BDD8ED752C09233B284956F13896F56B9DF98F1F048838CB38036659804C9B14F0F952BF93AA13841F76485810FF431D190FB911F855BB64F8E7BCC406B74806D11F7319D75326A0882745E5FE2301FF35ACF23D7885FBA194A29FF18D0C366949B3957FC3D0ED701F1A2015D583C0AEF32D912EE8C7C42E77E6536EB4451EBCF1BC80921C149B2298EC0C9F86690DEE19B4BD0798B11D31B488B38F356539B4605036ADFEF5F6CAE450AC0878CB75364FEAAA7196B475B93F953EB20BBDF2432E1BDF48EDC71A19F6EB55D2440DA7408866C9DD81F3289BFB77
|
|
|
|
|
answer = BA0D89B5AFA370A4FE31469B773837EFBACC4AD14EA9BDB5C943F466CFAC16F5FE55C46B03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010044E9DAF43C286D6D9B3E67B91A23FE3BB1548AB83AD3337B6A7C839C9521EF3E31008E8B18973A57E9DF25B7201B67BA1C30BDD8ED752C09233B284956F13896F56B9DF98F1F048838CB38036659804C9B14F0F952BF93AA13841F76485810FF431D190FB911F855BB64F8E7BCC406B74806D11F7319D75326A0882745E5FE2301FF35ACF23D7885FBA194A29FF18D0C366949B3957FC3D0ED701F1A2015D583C0AEF32D912EE8C7C42E77E6536EB4451EBCF1BC80921C149B2298EC0C9F86690DEE19B4BD0798B11D31B488B38F356539B4605036ADFEF5F6CAE450AC0878CB75364FEAAA7196B475B93F953EB20BBDF2432E1BDF48EDC71A19F6EB55D2440DA7408866C9DD81F3289BFB77</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 A8 F4 80 B7 39 AF 24 DC 39 2C 2B 09
|
|
|
|
|
0010 | BA 14 02 07 D2 2B 8C 0A 59 AD 58 90 D7 D6 23 C5
|
|
|
|
|
0020 | FD B3 E2 7E 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 AF A3 70 A4 FE 31 46 9B 77 38 37 EF
|
|
|
|
|
0010 | BA CC 4A D1 4E A9 BD B5 C9 43 F4 66 CF AC 16 F5
|
|
|
|
|
0020 | FE 55 C4 6B 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 = BA0D89B5A8F480B739AF24DC392C2B09BA140207D22B8C0A59AD5890D7D623C5FDB3E27
|
|
|
|
|
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 | 47 D8 12 AE CD F8 08 39 F0 8C 2D 76 E2 D3 45 68
|
|
|
|
|
0140 | 29 6A 58 5B 27 1B E2 5B 21 23 A0 ED D7 09 2A 28
|
|
|
|
|
0150 | BA 93 EF 57 08 E3 27 CA 2C A5 97 11 F9 49 5F A9
|
|
|
|
|
0160 | 44 39 3B 15 B6 29 53 14 A2 42 74 87 12 4F AC 42
|
|
|
|
|
0170 | 25 49 25 0C 36 29 AB 54 63 D5 34 4C 94 AB D3 E6
|
|
|
|
|
0180 | 1E BF 10 2E F7 E1 C7 B9 A0 0C 27 81 B4 BD 22 4E
|
|
|
|
|
0190 | 12 6A 49 26 8F 8E 32 2E 89 A0 4E 69 A1 ED 96 4A
|
|
|
|
|
01A0 | A2 57 7C 7A 30 D3 45 C8 28 32 1B 36 0D DC CB C4
|
|
|
|
|
01B0 | 6F 14 BA 6E 5A 0E 5A CC 63 D0 D8 51 72 5F 99 D8
|
|
|
|
|
01C0 | C9 9B 9E F1 16 E5 22 AF 5B 27 7F 21 B0 1D 06 CE
|
|
|
|
|
01D0 | D3 72 7B 92 49 F3 90 2C 59 5A B1 9E 2A ED CF 56
|
|
|
|
|
01E0 | 63 17 A9 21 5F 35 B8 59 CA 79 58 4B 39 82 EB 73
|
|
|
|
|
01F0 | FB 69 A2 03 56 68 C0 BB BD 5D 1F 56 CB 93 A7 F6
|
|
|
|
|
0200 | 25 D1 4C 9B 95 58 34 82 10 31 E3 00 EE 65 20 FE
|
|
|
|
|
0210 | 79 B9 19 44 60 B1 7C 47 06 E5 55 8B 2B E1 6E 2E
|
|
|
|
|
0220 | EA 73 C6 A2 37 CF 85 98 AF 28 3F CC 25 64 D0 B7
|
|
|
|
|
0230 | DC 3A 88 66</code></pre>
|
|
|
|
|
0130 | 44 E9 DA F4 3C 28 6D 6D 9B 3E 67 B9 1A 23 FE 3B
|
|
|
|
|
0140 | B1 54 8A B8 3A D3 33 7B 6A 7C 83 9C 95 21 EF 3E
|
|
|
|
|
0150 | 31 00 8E 8B 18 97 3A 57 E9 DF 25 B7 20 1B 67 BA
|
|
|
|
|
0160 | 1C 30 BD D8 ED 75 2C 09 23 3B 28 49 56 F1 38 96
|
|
|
|
|
0170 | F5 6B 9D F9 8F 1F 04 88 38 CB 38 03 66 59 80 4C
|
|
|
|
|
0180 | 9B 14 F0 F9 52 BF 93 AA 13 84 1F 76 48 58 10 FF
|
|
|
|
|
0190 | 43 1D 19 0F B9 11 F8 55 BB 64 F8 E7 BC C4 06 B7
|
|
|
|
|
01A0 | 48 06 D1 1F 73 19 D7 53 26 A0 88 27 45 E5 FE 23
|
|
|
|
|
01B0 | 01 FF 35 AC F2 3D 78 85 FB A1 94 A2 9F F1 8D 0C
|
|
|
|
|
01C0 | 36 69 49 B3 95 7F C3 D0 ED 70 1F 1A 20 15 D5 83
|
|
|
|
|
01D0 | C0 AE F3 2D 91 2E E8 C7 C4 2E 77 E6 53 6E B4 45
|
|
|
|
|
01E0 | 1E BC F1 BC 80 92 1C 14 9B 22 98 EC 0C 9F 86 69
|
|
|
|
|
01F0 | 0D EE 19 B4 BD 07 98 B1 1D 31 B4 88 B3 8F 35 65
|
|
|
|
|
0200 | 39 B4 60 50 36 AD FE F5 F6 CA E4 50 AC 08 78 CB
|
|
|
|
|
0210 | 75 36 4F EA AA 71 96 B4 75 B9 3F 95 3E B2 0B BD
|
|
|
|
|
0220 | F2 43 2E 1B DF 48 ED C7 1A 19 F6 EB 55 D2 44 0D
|
|
|
|
|
0230 | A7 40 88 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 = BA0D89B5A8F480B739AF24DC392C2B09BA140207D22B8C0A59AD5890D7D623C5FDB3E27
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>A8F480B739AF24DC392C2B09BA140207</code></td>
|
|
|
|
|
<td><code>AFA370A4FE31469B773837EFBACC4AD1</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>D22B8C0A59AD5890D7D623C5FDB3E27E</code></td>
|
|
|
|
|
<td><code>4EA9BDB5C943F466CFAC16F5FE55C46B</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B5A8F480B739AF24DC392C2B09BA140207D22B8C0A59AD5890D7D623C5FDB3E27
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE00010047D812AECDF80839F08C2D76</code> <code>E2D34568296A585B271BE25B2123A0ED</code> <code>D7092A28BA93EF5708E327CA2CA59711</code> <code>F9495FA944393B15B6295314A2427487</code> <code>124FAC422549250C3629AB5463D5344C</code> <code>94ABD3E61EBF102EF7E1C7B9A00C2781</code> <code>B4BD224E126A49268F8E322E89A04E69</code> <code>A1ED964AA2577C7A30D345C828321B36</code> <code>0DDCCBC46F14BA6E5A0E5ACC63D0D851</code> <code>725F99D8C99B9EF116E522AF5B277F21</code> <code>B01D06CED3727B9249F3902C595AB19E</code> <code>2AEDCF566317A9215F35B859CA79584B</code> <code>3982EB73FB69A2035668C0BBBD5D1F56</code> <code>CB93A7F625D14C9B955834821031E300</code> <code>EE6520FE79B9194460B17C4706E5558B</code> <code>2BE16E2EEA73C6A237CF8598AF283FCC</code><br> <code>2564D0B7</code></td>
|
|
|
|
|
<td><code>FE00010044E9DAF43C286D6D9B3E67B9</code> <code>1A23FE3BB1548AB83AD3337B6A7C839C</code> <code>9521EF3E31008E8B18973A57E9DF25B7</code> <code>201B67BA1C30BDD8ED752C09233B2849</code> <code>56F13896F56B9DF98F1F048838CB3803</code> <code>6659804C9B14F0F952BF93AA13841F76</code> <code>485810FF431D190FB911F855BB64F8E7</code> <code>BCC406B74806D11F7319D75326A08827</code> <code>45E5FE2301FF35ACF23D7885FBA194A2</code> <code>9FF18D0C366949B3957FC3D0ED701F1A</code> <code>2015D583C0AEF32D912EE8C7C42E77E6</code> <code>536EB4451EBCF1BC80921C149B2298EC</code> <code>0C9F86690DEE19B4BD0798B11D31B488</code> <code>B38F356539B4605036ADFEF5F6CAE450</code> <code>AC0878CB75364FEAAA7196B475B93F95</code> <code>3EB20BBDF2432E1BDF48EDC71A19F6EB</code><br> <code>55D2440D</code></td>
|
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>DC3A8866</code> (1720203996 in decimal)</td>
|
|
|
|
|
<td><code>A7408866</code> (1720205479 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B5A8F480B739AF24DC392C2B09BA140207D22B8C0A59AD5890D7D623C5FDB3E27
|
|
|
|
|
<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 = 8149841F0753CAE82484A377B7E164F48F7249FAF0626EAA59639BBBFDE8F0BED3C009AFE647DD91F02DF8B9CA4A7CEDC1E3459EE46C84949830EA7C24280DBAFDDFA93318DF4ADDE90B507F5024C5F30DAA31EA30268C35D9D412DA3EC2F0D0AEA7465C78B8B32C88E0503D809AD623B31396F0846412B40065BEE4624D2A97F3351EEE21D82B4BAF6287AEEA4E1E9EC9E4CA41A6F3A514BABBA70656D0047AE8BA125D37D4C56E1ACF6C56C6A699017F00169028B8D67705B8754D7251320298F8F25D71F1D528AD671F5CA6FDF58BCF03D399DFDDFB9A0ED614D1771BB096F5B9AAA565EE9F55B95D012A579BC1502D45FD6185824A0E6F2E278BBC4F12DC</code></pre>
|
|
|
|
|
<pre><code>b = D3AD7CDAD9E59262FED48F057A4428A0E56558F68EFE903B1B9CB2011D3C52C5625BB781614FC536D22143B3577EC7956DB67F3D9DB75282936E5D0F08FBCA25F4370DDE8952AD768FD9EA5C51B99F0BBFF3AD182242D3675427EAEBD9E94A67A9CC86BA4A20E2034821240234670A4BF3051F19CCCC5B3544E225777724BBF50379A71DC9F7FCB39F4E98BD75D30BE149A9138E510A282B51D511992BE91B30F7075673E644462D4AF1FC1474B8EBE296D5878378CBD10EB752301A114FC95AE9FB2C48AC0EB1EE7E464F2551C48ED5EF6E143CAB01B1DD160622DD97ADF8C789F5BE99E6CD075C12047CDBE8344398DE80C15721B1CF05BD4C9208194DDE6C</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 = 51CF738CC8C6AAE1989C4AF33919C34F99EDB542CC6B68CD93C9C0D3D91C53A893A56C254F77353DDA42D3BA663D52BEEBE6BD2453498832D3E6DB44A167167E3736C87F730971E11DDDCD4F3B3A5A8E0023282E037D482D8D326D04CC6A104036D7BEBBC8B734059C62B5F3F25B98075030D5438E28494AF706CDAC346AFC9A77DAE40E0BECBBFBF689BEA9E72912F0067D03ADB06A496E5920973D20EEEC5C8B6B0FEEA1D94DCA8E864ABBB7E462FA7A46A085F916BAD17D0B3010D06D722F7016BE4F46657B8E185843C78947E656D4B11BEDAC364B896606E45171FA5CC724A04F94278623632FF811AEB3A285CC9FB660103D2C172766D5DF89F7DC6D3B</code></pre>
|
|
|
|
|
<pre><code>g_b = 056B646B1F5E4FFDC4F64B45E102AAEBE9E1448DC9E11C38D780463C49E00898DD86C69751CEE28FAAAC243E9BA005E44BFF8E7FB395942D8799E49E27D50D512AF041FB40C989D73A676C49210B0AF166138A6CC030C7FE0E914BE990A254F0924150A60DA77D23614F3B9694CF148C33B4F1F605499FB1B7F3143E3DB6A76BA209FF92A3964F6636BE41527C42458676BD79E4D81A13C48496AD5AB5B444B6716BB70EEEA36235F4E5D25268836B04CA2CE82C2E273B17A08BF93C742CEA3A7921D770A54CEE65968D52EAA1E370DBB1267881F895AA173B7123794EFB24B31D60F1686D1569649DCBAE4769E1538736BA2DA0F50E5311EE0604D0667997F8</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 A8 F4 80 B7 39 AF 24 DC 39 2C 2B 09
|
|
|
|
|
0010 | BA 14 02 07 D2 2B 8C 0A 59 AD 58 90 D7 D6 23 C5
|
|
|
|
|
0020 | FD B3 E2 7E 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 51 CF 73 8C C8 C6 AA E1 98 9C 4A F3 39 19 C3 4F
|
|
|
|
|
0040 | 99 ED B5 42 CC 6B 68 CD 93 C9 C0 D3 D9 1C 53 A8
|
|
|
|
|
0050 | 93 A5 6C 25 4F 77 35 3D DA 42 D3 BA 66 3D 52 BE
|
|
|
|
|
0060 | EB E6 BD 24 53 49 88 32 D3 E6 DB 44 A1 67 16 7E
|
|
|
|
|
0070 | 37 36 C8 7F 73 09 71 E1 1D DD CD 4F 3B 3A 5A 8E
|
|
|
|
|
0080 | 00 23 28 2E 03 7D 48 2D 8D 32 6D 04 CC 6A 10 40
|
|
|
|
|
0090 | 36 D7 BE BB C8 B7 34 05 9C 62 B5 F3 F2 5B 98 07
|
|
|
|
|
00A0 | 50 30 D5 43 8E 28 49 4A F7 06 CD AC 34 6A FC 9A
|
|
|
|
|
00B0 | 77 DA E4 0E 0B EC BB FB F6 89 BE A9 E7 29 12 F0
|
|
|
|
|
00C0 | 06 7D 03 AD B0 6A 49 6E 59 20 97 3D 20 EE EC 5C
|
|
|
|
|
00D0 | 8B 6B 0F EE A1 D9 4D CA 8E 86 4A BB B7 E4 62 FA
|
|
|
|
|
00E0 | 7A 46 A0 85 F9 16 BA D1 7D 0B 30 10 D0 6D 72 2F
|
|
|
|
|
00F0 | 70 16 BE 4F 46 65 7B 8E 18 58 43 C7 89 47 E6 56
|
|
|
|
|
0100 | D4 B1 1B ED AC 36 4B 89 66 06 E4 51 71 FA 5C C7
|
|
|
|
|
0110 | 24 A0 4F 94 27 86 23 63 2F F8 11 AE B3 A2 85 CC
|
|
|
|
|
0120 | 9F B6 60 10 3D 2C 17 27 66 D5 DF 89 F7 DC 6D 3B</code></pre>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 AF A3 70 A4 FE 31 46 9B 77 38 37 EF
|
|
|
|
|
0010 | BA CC 4A D1 4E A9 BD B5 C9 43 F4 66 CF AC 16 F5
|
|
|
|
|
0020 | FE 55 C4 6B 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 05 6B 64 6B 1F 5E 4F FD C4 F6 4B 45 E1 02 AA EB
|
|
|
|
|
0040 | E9 E1 44 8D C9 E1 1C 38 D7 80 46 3C 49 E0 08 98
|
|
|
|
|
0050 | DD 86 C6 97 51 CE E2 8F AA AC 24 3E 9B A0 05 E4
|
|
|
|
|
0060 | 4B FF 8E 7F B3 95 94 2D 87 99 E4 9E 27 D5 0D 51
|
|
|
|
|
0070 | 2A F0 41 FB 40 C9 89 D7 3A 67 6C 49 21 0B 0A F1
|
|
|
|
|
0080 | 66 13 8A 6C C0 30 C7 FE 0E 91 4B E9 90 A2 54 F0
|
|
|
|
|
0090 | 92 41 50 A6 0D A7 7D 23 61 4F 3B 96 94 CF 14 8C
|
|
|
|
|
00A0 | 33 B4 F1 F6 05 49 9F B1 B7 F3 14 3E 3D B6 A7 6B
|
|
|
|
|
00B0 | A2 09 FF 92 A3 96 4F 66 36 BE 41 52 7C 42 45 86
|
|
|
|
|
00C0 | 76 BD 79 E4 D8 1A 13 C4 84 96 AD 5A B5 B4 44 B6
|
|
|
|
|
00D0 | 71 6B B7 0E EE A3 62 35 F4 E5 D2 52 68 83 6B 04
|
|
|
|
|
00E0 | CA 2C E8 2C 2E 27 3B 17 A0 8B F9 3C 74 2C EA 3A
|
|
|
|
|
00F0 | 79 21 D7 70 A5 4C EE 65 96 8D 52 EA A1 E3 70 DB
|
|
|
|
|
0100 | B1 26 78 81 F8 95 AA 17 3B 71 23 79 4E FB 24 B3
|
|
|
|
|
0110 | 1D 60 F1 68 6D 15 69 64 9D CB AE 47 69 E1 53 87
|
|
|
|
|
0120 | 36 BA 2D A0 F5 0E 53 11 EE 06 04 D0 66 79 97 F8</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 = BA0D89B5A8F480B739AF24DC392C2B09BA140207D22B8C0A59AD5890D7D623C5FDB3E27
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>A8F480B739AF24DC392C2B09BA140207</code></td>
|
|
|
|
|
<td><code>AFA370A4FE31469B773837EFBACC4AD1</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>D22B8C0A59AD5890D7D623C5FDB3E27E</code></td>
|
|
|
|
|
<td><code>4EA9BDB5C943F466CFAC16F5FE55C46B</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE00010051CF738CC8C6AAE1989C4AF3</code> <code>3919C34F99EDB542CC6B68CD93C9C0D3</code> <code>D91C53A893A56C254F77353DDA42D3BA</code> <code>663D52BEEBE6BD2453498832D3E6DB44</code> <code>A167167E3736C87F730971E11DDDCD4F</code> <code>3B3A5A8E0023282E037D482D8D326D04</code> <code>CC6A104036D7BEBBC8B734059C62B5F3</code> <code>F25B98075030D5438E28494AF706CDAC</code> <code>346AFC9A77DAE40E0BECBBFBF689BEA9</code> <code>E72912F0067D03ADB06A496E5920973D</code> <code>20EEEC5C8B6B0FEEA1D94DCA8E864ABB</code> <code>B7E462FA7A46A085F916BAD17D0B3010</code> <code>D06D722F7016BE4F46657B8E185843C7</code> <code>8947E656D4B11BEDAC364B896606E451</code> <code>71FA5CC724A04F94278623632FF811AE</code> <code>B3A285CC9FB660103D2C172766D5DF89</code><br> <code>F7DC6D3B</code></td>
|
|
|
|
|
<td><code>FE000100056B646B1F5E4FFDC4F64B45</code> <code>E102AAEBE9E1448DC9E11C38D780463C</code> <code>49E00898DD86C69751CEE28FAAAC243E</code> <code>9BA005E44BFF8E7FB395942D8799E49E</code> <code>27D50D512AF041FB40C989D73A676C49</code> <code>210B0AF166138A6CC030C7FE0E914BE9</code> <code>90A254F0924150A60DA77D23614F3B96</code> <code>94CF148C33B4F1F605499FB1B7F3143E</code> <code>3DB6A76BA209FF92A3964F6636BE4152</code> <code>7C42458676BD79E4D81A13C48496AD5A</code> <code>B5B444B6716BB70EEEA36235F4E5D252</code> <code>68836B04CA2CE82C2E273B17A08BF93C</code> <code>742CEA3A7921D770A54CEE65968D52EA</code> <code>A1E370DBB1267881F895AA173B712379</code> <code>4EFB24B31D60F1686D1569649DCBAE47</code> <code>69E1538736BA2DA0F50E5311EE0604D0</code><br> <code>667997F8</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 = BA0D89B5A8F480B739AF24DC392C2B09BA140207D22B8C0A59AD5890D7D623C5FDB3E27
|
|
|
|
|
<!-- 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 = 54B64366A8F480B739AF24DC392C2B09BA140207D22B8C0A59AD5890D7D623C5FDB3E27E0000000000000000FE00010051CF738CC8C6AAE1989C4AF33919C34F99EDB542CC6B68CD93C9C0D3D91C53A893A56C254F77353DDA42D3BA663D52BEEBE6BD2453498832D3E6DB44A167167E3736C87F730971E11DDDCD4F3B3A5A8E0023282E037D482D8D326D04CC6A104036D7BEBBC8B734059C62B5F3F25B98075030D5438E28494AF706CDAC346AFC9A77DAE40E0BECBBFBF689BEA9E72912F0067D03ADB06A496E5920973D20EEEC5C8B6B0FEEA1D94DCA8E864ABBB7E462FA7A46A085F916BAD17D0B3010D06D722F7016BE4F46657B8E185843C78947E656D4B11BEDAC364B896606E45171FA5CC724A04F94278623632FF811AEB3A285CC9FB660103D2C172766D5DF89F7DC6D3B
|
|
|
|
|
padding = 91BE64FD49CE67D4436F9817
|
|
|
|
|
tmp_aes_key = 42399E0DC08B83C9C20217EC98E69268437D8AD8E975FA6AA59A7C471C631840
|
|
|
|
|
tmp_aes_iv = C57F717B633C595F44189FD35CA951249D64FAC426AA6356C020DFFC847F523C</code></pre>
|
|
|
|
|
<pre><code>data = 54B64366AFA370A4FE31469B773837EFBACC4AD14EA9BDB5C943F466CFAC16F5FE55C46B0000000000000000FE000100056B646B1F5E4FFDC4F64B45E102AAEBE9E1448DC9E11C38D780463C49E00898DD86C69751CEE28FAAAC243E9BA005E44BFF8E7FB395942D8799E49E27D50D512AF041FB40C989D73A676C49210B0AF166138A6CC030C7FE0E914BE990A254F0924150A60DA77D23614F3B9694CF148C33B4F1F605499FB1B7F3143E3DB6A76BA209FF92A3964F6636BE41527C42458676BD79E4D81A13C48496AD5AB5B444B6716BB70EEEA36235F4E5D25268836B04CA2CE82C2E273B17A08BF93C742CEA3A7921D770A54CEE65968D52EAA1E370DBB1267881F895AA173B7123794EFB24B31D60F1686D1569649DCBAE4769E1538736BA2DA0F50E5311EE0604D0667997F8
|
|
|
|
|
padding = E2F754D7B03235FB90F69DB2
|
|
|
|
|
tmp_aes_key = 994C8CDB14BD79852644A3A0AC2F17F0BBA74739B50510F89FB24C1AF3359C62
|
|
|
|
|
tmp_aes_iv = 6F34827F604727F0E58EDA63622F7EB017970D8045601D2BF57D24B8EA41D482</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 = D23BCB061637C7033E5195A5820A01C5BE10A765D935A1691F87A8C81B94AC8CFB665383407F5B3EF9F0286454A8A8B647913B0D5672935C8C069287FADA4F5DFC066CA7918EC1CF63D969B7F6C8579E6177986F909D20B5883D897658CE08D16B9793F565ACFA31A937CA636ADABB454856272EC0160C67A703906F495B1E256C0A240F4868272D0A407FD2963FD9D92C3105B3CDE1F048C787FD48D9B1293C6EE5A15CE9DEDD77AADA146F8F3B8F2A3A7DA291D6DE90F0EC5824ECFE8310C51059FA24BB02893933F50CFE9D401F45A8B0B10673F32F0021817DF5612DA0529181C68FC48D37EC94A2B9BE4F4DF4A72747093D79B6CFD6C0A7824BE4973A4AD4D892930EB7A20CB7006114B3CE2EED87042BE0B99CAAD0002B6BEEAE5135602C2B5900809E04053B3CB25811766B72847EAE74463B82C295A3A5464752DB9FE5B910836DE1C823D7A72F5151C2573C</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 3FC2D37E869E29FF182A2AB7D7CC4B3EA02DA5C3B54BCF01FE08B452827031A2B68B78460CB1F9CEEC2BB7F4E1D228F518FCC86DA73F93830E18DD67DE9B88DDD3DF5C53E26D2840BC828D1810DAA65EE0C3803395B424B82CA3CEC2579AA553A147A54BDC7380088B2C739626C147AAADB80DF409197BBDDC581FE9199CCAE39F96C7BCF00A7652240C9565BDEE9049DCC315903B703FC19F84F944738271CED509E34DBABCA15D973D991263BCE7210E82B5FEA947EA1109E4A1D8E051417D540D0853133559B3FEE79FBC2AE8D2E092E2EFC9CD690113B5899174C126963958A7CFD5B731E8DFEB94B6E1625393FC3CFE4345B1B02C7A31655BC86B9693BC5DEE75204E2F49B9569744CD6727E997EDBEF2B6C88F48443B319095BA8F5E26433B08761FD4D2EB08C742072C4C3F04C3AED3B9BA17A78FDFF52623DE7EFEC1E8DC01B81D6CC155544ABCF5F5030E10</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 94 76 0A 00 DC 3A 88 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 A8 F4 80 B7 39 AF 24 DC
|
|
|
|
|
0020 | 39 2C 2B 09 BA 14 02 07 D2 2B 8C 0A 59 AD 58 90
|
|
|
|
|
0030 | D7 D6 23 C5 FD B3 E2 7E FE 50 01 00 D2 3B CB 06
|
|
|
|
|
0040 | 16 37 C7 03 3E 51 95 A5 82 0A 01 C5 BE 10 A7 65
|
|
|
|
|
0050 | D9 35 A1 69 1F 87 A8 C8 1B 94 AC 8C FB 66 53 83
|
|
|
|
|
0060 | 40 7F 5B 3E F9 F0 28 64 54 A8 A8 B6 47 91 3B 0D
|
|
|
|
|
0070 | 56 72 93 5C 8C 06 92 87 FA DA 4F 5D FC 06 6C A7
|
|
|
|
|
0080 | 91 8E C1 CF 63 D9 69 B7 F6 C8 57 9E 61 77 98 6F
|
|
|
|
|
0090 | 90 9D 20 B5 88 3D 89 76 58 CE 08 D1 6B 97 93 F5
|
|
|
|
|
00A0 | 65 AC FA 31 A9 37 CA 63 6A DA BB 45 48 56 27 2E
|
|
|
|
|
00B0 | C0 16 0C 67 A7 03 90 6F 49 5B 1E 25 6C 0A 24 0F
|
|
|
|
|
00C0 | 48 68 27 2D 0A 40 7F D2 96 3F D9 D9 2C 31 05 B3
|
|
|
|
|
00D0 | CD E1 F0 48 C7 87 FD 48 D9 B1 29 3C 6E E5 A1 5C
|
|
|
|
|
00E0 | E9 DE DD 77 AA DA 14 6F 8F 3B 8F 2A 3A 7D A2 91
|
|
|
|
|
00F0 | D6 DE 90 F0 EC 58 24 EC FE 83 10 C5 10 59 FA 24
|
|
|
|
|
0100 | BB 02 89 39 33 F5 0C FE 9D 40 1F 45 A8 B0 B1 06
|
|
|
|
|
0110 | 73 F3 2F 00 21 81 7D F5 61 2D A0 52 91 81 C6 8F
|
|
|
|
|
0120 | C4 8D 37 EC 94 A2 B9 BE 4F 4D F4 A7 27 47 09 3D
|
|
|
|
|
0130 | 79 B6 CF D6 C0 A7 82 4B E4 97 3A 4A D4 D8 92 93
|
|
|
|
|
0140 | 0E B7 A2 0C B7 00 61 14 B3 CE 2E ED 87 04 2B E0
|
|
|
|
|
0150 | B9 9C AA D0 00 2B 6B EE AE 51 35 60 2C 2B 59 00
|
|
|
|
|
0160 | 80 9E 04 05 3B 3C B2 58 11 76 6B 72 84 7E AE 74
|
|
|
|
|
0170 | 46 3B 82 C2 95 A3 A5 46 47 52 DB 9F E5 B9 10 83
|
|
|
|
|
0180 | 6D E1 C8 23 D7 A7 2F 51 51 C2 57 3C</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 30 78 08 00 A7 40 88 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 AF A3 70 A4 FE 31 46 9B
|
|
|
|
|
0020 | 77 38 37 EF BA CC 4A D1 4E A9 BD B5 C9 43 F4 66
|
|
|
|
|
0030 | CF AC 16 F5 FE 55 C4 6B FE 50 01 00 3F C2 D3 7E
|
|
|
|
|
0040 | 86 9E 29 FF 18 2A 2A B7 D7 CC 4B 3E A0 2D A5 C3
|
|
|
|
|
0050 | B5 4B CF 01 FE 08 B4 52 82 70 31 A2 B6 8B 78 46
|
|
|
|
|
0060 | 0C B1 F9 CE EC 2B B7 F4 E1 D2 28 F5 18 FC C8 6D
|
|
|
|
|
0070 | A7 3F 93 83 0E 18 DD 67 DE 9B 88 DD D3 DF 5C 53
|
|
|
|
|
0080 | E2 6D 28 40 BC 82 8D 18 10 DA A6 5E E0 C3 80 33
|
|
|
|
|
0090 | 95 B4 24 B8 2C A3 CE C2 57 9A A5 53 A1 47 A5 4B
|
|
|
|
|
00A0 | DC 73 80 08 8B 2C 73 96 26 C1 47 AA AD B8 0D F4
|
|
|
|
|
00B0 | 09 19 7B BD DC 58 1F E9 19 9C CA E3 9F 96 C7 BC
|
|
|
|
|
00C0 | F0 0A 76 52 24 0C 95 65 BD EE 90 49 DC C3 15 90
|
|
|
|
|
00D0 | 3B 70 3F C1 9F 84 F9 44 73 82 71 CE D5 09 E3 4D
|
|
|
|
|
00E0 | BA BC A1 5D 97 3D 99 12 63 BC E7 21 0E 82 B5 FE
|
|
|
|
|
00F0 | A9 47 EA 11 09 E4 A1 D8 E0 51 41 7D 54 0D 08 53
|
|
|
|
|
0100 | 13 35 59 B3 FE E7 9F BC 2A E8 D2 E0 92 E2 EF C9
|
|
|
|
|
0110 | CD 69 01 13 B5 89 91 74 C1 26 96 39 58 A7 CF D5
|
|
|
|
|
0120 | B7 31 E8 DF EB 94 B6 E1 62 53 93 FC 3C FE 43 45
|
|
|
|
|
0130 | B1 B0 2C 7A 31 65 5B C8 6B 96 93 BC 5D EE 75 20
|
|
|
|
|
0140 | 4E 2F 49 B9 56 97 44 CD 67 27 E9 97 ED BE F2 B6
|
|
|
|
|
0150 | C8 8F 48 44 3B 31 90 95 BA 8F 5E 26 43 3B 08 76
|
|
|
|
|
0160 | 1F D4 D2 EB 08 C7 42 07 2C 4C 3F 04 C3 AE D3 B9
|
|
|
|
|
0170 | BA 17 A7 8F DF F5 26 23 DE 7E FE C1 E8 DC 01 B8
|
|
|
|
|
0180 | 1D 6C C1 55 54 4A BC F5 F5 03 0E 10</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>94760A00DC3A8866</code></td>
|
|
|
|
|
<td><code>30780800A7408866</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>A8F480B739AF24DC392C2B09BA140207</code></td>
|
|
|
|
|
<td><code>AFA370A4FE31469B773837EFBACC4AD1</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>D22B8C0A59AD5890D7D623C5FDB3E27E</code></td>
|
|
|
|
|
<td><code>4EA9BDB5C943F466CFAC16F5FE55C46B</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE500100D23BCB061637C7033E5195A5</code> <code>820A01C5BE10A765D935A1691F87A8C8</code> <code>1B94AC8CFB665383407F5B3EF9F02864</code> <code>54A8A8B647913B0D5672935C8C069287</code> <code>FADA4F5DFC066CA7918EC1CF63D969B7</code> <code>F6C8579E6177986F909D20B5883D8976</code> <code>58CE08D16B9793F565ACFA31A937CA63</code> <code>6ADABB454856272EC0160C67A703906F</code> <code>495B1E256C0A240F4868272D0A407FD2</code> <code>963FD9D92C3105B3CDE1F048C787FD48</code> <code>D9B1293C6EE5A15CE9DEDD77AADA146F</code> <code>8F3B8F2A3A7DA291D6DE90F0EC5824EC</code> <code>FE8310C51059FA24BB02893933F50CFE</code> <code>9D401F45A8B0B10673F32F0021817DF5</code> <code>612DA0529181C68FC48D37EC94A2B9BE</code> <code>4F4DF4A72747093D79B6CFD6C0A7824B</code> <code>E4973A4AD4D892930EB7A20CB7006114</code> <code>B3CE2EED87042BE0B99CAAD0002B6BEE</code> <code>AE5135602C2B5900809E04053B3CB258</code> <code>11766B72847EAE74463B82C295A3A546</code> <code>4752DB9FE5B910836DE1C823D7A72F51</code><br> <code>51C2573C</code></td>
|
|
|
|
|
<td><code>FE5001003FC2D37E869E29FF182A2AB7</code> <code>D7CC4B3EA02DA5C3B54BCF01FE08B452</code> <code>827031A2B68B78460CB1F9CEEC2BB7F4</code> <code>E1D228F518FCC86DA73F93830E18DD67</code> <code>DE9B88DDD3DF5C53E26D2840BC828D18</code> <code>10DAA65EE0C3803395B424B82CA3CEC2</code> <code>579AA553A147A54BDC7380088B2C7396</code> <code>26C147AAADB80DF409197BBDDC581FE9</code> <code>199CCAE39F96C7BCF00A7652240C9565</code> <code>BDEE9049DCC315903B703FC19F84F944</code> <code>738271CED509E34DBABCA15D973D9912</code> <code>63BCE7210E82B5FEA947EA1109E4A1D8</code> <code>E051417D540D0853133559B3FEE79FBC</code> <code>2AE8D2E092E2EFC9CD690113B5899174</code> <code>C126963958A7CFD5B731E8DFEB94B6E1</code> <code>625393FC3CFE4345B1B02C7A31655BC8</code> <code>6B9693BC5DEE75204E2F49B9569744CD</code> <code>6727E997EDBEF2B6C88F48443B319095</code> <code>BA8F5E26433B08761FD4D2EB08C74207</code> <code>2C4C3F04C3AED3B9BA17A78FDFF52623</code> <code>DE7EFEC1E8DC01B81D6CC155544ABCF5</code><br> <code>F5030E10</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 = 918B4A3165A42D7A66B543D2BBA2DE1ACA28AB97562AF601939980EE8D14D9E7CFD9646EBD653D99E5B4467A763A95066DA60CFF7D2B19E7AD5AB1B907EA2A84CCF484CB62895222CD0536868E8244E61599CB24D43E8B390AC7ABC64234522340556F723880990A6FB68797052ABFA986B7415BCD5378A7C95708ECA7AA2A92E52CF210193B46E2816A8BF409C4A0E6B2A2B12C1343E82343E8B0B67278616562111CC6F7CADFEC35A929100E0142842F5095DCC7290D7AECA8AA28C5BA46189437226E18A59A39812125CE62F6277B53CAC2EF785074AB0A0D4DE7600695899600B67DB3DE1A51D8FEA3332D7A96D3873748BBF5B1927F9E88D6C031D598BF</code></pre>
|
|
|
|
|
<pre><code>auth_key = 15AEAD3578DC7E1F842D2A7D9E415C91E7C13E769BF72B4822887D4554F7B0C10F1EFC3E5AB0A24939A4E0D9DCB5F17E7AC95A3D7AD626DF3AA4D6FCD43C932F04D969153A817EAD22BD7AD761D8DB33657EB4B519A65B4A9F5403D1C3A78FB1391383227799F61584309C6F27BB246749F294ED8F556D3F0F3FFB7567FAD2C913251892F8FD7A34158E9A024EF7E6B149371AF4B8C94A6A4228C0C8BC156837DF01D1852EEB271466DFB02DAECC251FA6CD5B4D7B6124432C792EB9E5B9EC164FD466996386C602BE92F920730260C277BADBA451BCD9A424EE44B0EA9F4FDFD85ACF72BB467CE0BADA3351CEA199173AA360F19B84F6DFD26A3313D7661D1D</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 0C AF 1F DE 3A 88 66
|
|
|
|
|
0010 | 3C 00 00 00 34 F7 CB 3B A8 F4 80 B7 39 AF 24 DC
|
|
|
|
|
0020 | 39 2C 2B 09 BA 14 02 07 D2 2B 8C 0A 59 AD 58 90
|
|
|
|
|
0030 | D7 D6 23 C5 FD B3 E2 7E A3 4B 78 38 18 EC 5B 3C
|
|
|
|
|
0040 | 51 E2 80 31 A2 A2 5B F5</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 08 D0 D7 A8 40 88 66
|
|
|
|
|
0010 | 54 00 00 00 34 F7 CB 3B AF A3 70 A4 FE 31 46 9B
|
|
|
|
|
0020 | 77 38 37 EF BA CC 4A D1 4E A9 BD B5 C9 43 F4 66
|
|
|
|
|
0030 | CF AC 16 F5 FE 55 C4 6B 29 16 7E 17 26 A9 45 22
|
|
|
|
|
0040 | 53 60 85 E9 26 3B 88 CD</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>010CAF1FDE3A8866</code></td>
|
|
|
|
|
<td><code>0108D0D7A8408866</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>3C000000</code> (60 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>A8F480B739AF24DC392C2B09BA140207</code></td>
|
|
|
|
|
<td><code>AFA370A4FE31469B773837EFBACC4AD1</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>D22B8C0A59AD5890D7D623C5FDB3E27E</code></td>
|
|
|
|
|
<td><code>4EA9BDB5C943F466CFAC16F5FE55C46B</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>A34B783818EC5B3C51E28031A2A25BF5</code></td>
|
|
|
|
|
<td><code>29167E1726A94522536085E9263B88CD</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>
|
|
|
|
|