|
|
|
@ -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 1C 68 0C 00 97 35 99 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE C8 F3 B5 E5 D1 E1 8A E5
|
|
|
|
|
0020 | 62 0C 86 F3 D3 B8 7E 04</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 50 14 0A 00 7C 4D 99 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 97 F2 BF 9D 89 B6 71 73
|
|
|
|
|
0020 | 7F 89 9F BA 14 AD 4F 31</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>1C680C0097359966</code></td>
|
|
|
|
|
<td><code>50140A007C4D9966</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>C8F3B5E5D1E18AE5620C86F3D3B87E04</code></td>
|
|
|
|
|
<td><code>97F2BF9D89B671737F899FBA14AD4F31</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 84 21 15 98 35 99 66
|
|
|
|
|
0010 | 54 00 00 00 63 24 16 05 C8 F3 B5 E5 D1 E1 8A E5
|
|
|
|
|
0020 | 62 0C 86 F3 D3 B8 7E 04 5A 53 37 05 01 23 D9 C6
|
|
|
|
|
0030 | 09 E0 A6 E7 E7 60 9D 5C 08 1D A8 72 53 E5 51 E8
|
|
|
|
|
0040 | 61 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 98 5B 6C 7C 4D 99 66
|
|
|
|
|
0010 | A8 00 00 00 63 24 16 05 97 F2 BF 9D 89 B6 71 73
|
|
|
|
|
0020 | 7F 89 9F BA 14 AD 4F 31 2E 16 F7 C4 E6 84 CF A8
|
|
|
|
|
0030 | 88 C7 B2 FA BD 72 61 68 08 27 0F 8B 7E 2C 69 A9
|
|
|
|
|
0040 | 51 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>0184211598359966</code></td>
|
|
|
|
|
<td><code>01985B6C7C4D9966</code></td>
|
|
|
|
|
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_length</td>
|
|
|
|
|
<td>16, 4</td>
|
|
|
|
|
<td><code>54000000</code> (84 in decimal)</td>
|
|
|
|
|
<td><code>A8000000</code> (168 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>C8F3B5E5D1E18AE5620C86F3D3B87E04</code></td>
|
|
|
|
|
<td><code>97F2BF9D89B671737F899FBA14AD4F31</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>5A5337050123D9C609E0A6E7E7609D5C</code></td>
|
|
|
|
|
<td><code>2E16F7C4E684CFA888C7B2FABD726168</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>081DA87253E551E861000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2137083727842502753</td>
|
|
|
|
|
<td><code>08270F8B7E2C69A951000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2814621666157111633</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 = 2137083727842502753</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2137083727842502753 = 1315428619 * 1624629187</code></p>
|
|
|
|
|
<pre><code>p = 1315428619
|
|
|
|
|
q = 1624629187</code></pre>
|
|
|
|
|
<pre><code>pq = 2814621666157111633</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2814621666157111633 = 1416441211 * 1987108003</code></p>
|
|
|
|
|
<pre><code>p = 1416441211
|
|
|
|
|
q = 1987108003</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 1D A8 72 53 E5 51 E8 61 00 00 00
|
|
|
|
|
0010 | 04 4E 67 D9 0B 00 00 00 04 60 D5 DF C3 00 00 00
|
|
|
|
|
0020 | C8 F3 B5 E5 D1 E1 8A E5 62 0C 86 F3 D3 B8 7E 04
|
|
|
|
|
0030 | 5A 53 37 05 01 23 D9 C6 09 E0 A6 E7 E7 60 9D 5C
|
|
|
|
|
0040 | 50 1C A9 81 B3 5E 6D B1 23 C1 15 94 8C E8 AE 3B
|
|
|
|
|
0050 | DE F2 DA 3A 71 A6 F8 A8 7D 17 60 68 3F 23 1D C3
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 27 0F 8B 7E 2C 69 A9 51 00 00 00
|
|
|
|
|
0010 | 04 54 6D 2D 7B 00 00 00 04 76 70 DC A3 00 00 00
|
|
|
|
|
0020 | 97 F2 BF 9D 89 B6 71 73 7F 89 9F BA 14 AD 4F 31
|
|
|
|
|
0030 | 2E 16 F7 C4 E6 84 CF A8 88 C7 B2 FA BD 72 61 68
|
|
|
|
|
0040 | F7 8E 08 9A 93 73 12 EC 51 3A 2B F7 1E 2F 9F BA
|
|
|
|
|
0050 | 64 CE BC BD 40 07 E9 39 69 25 20 BA 05 A4 50 3E
|
|
|
|
|
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 = 1624629187</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>081DA87253E551E861000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2137083727842502753</td>
|
|
|
|
|
<td><code>08270F8B7E2C69A951000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2814621666157111633</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>044E67D90B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1315428619</td>
|
|
|
|
|
<td><code>04546D2D7B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1416441211</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>0460D5DFC3000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1624629187</td>
|
|
|
|
|
<td><code>047670DCA3000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1987108003</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>C8F3B5E5D1E18AE5620C86F3D3B87E04</code></td>
|
|
|
|
|
<td><code>97F2BF9D89B671737F899FBA14AD4F31</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>5A5337050123D9C609E0A6E7E7609D5C</code></td>
|
|
|
|
|
<td><code>2E16F7C4E684CFA888C7B2FABD726168</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>501CA981B35E6DB123C115948CE8AE3B</code> <code>DEF2DA3A71A6F8A87D1760683F231DC3</code></td>
|
|
|
|
|
<td><code>F78E089A937312EC513A2BF71E2F9FBA</code> <code>64CEBCBD4007E939692520BA05A4503E</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1624629187</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 = 955FF5A9081DA87253E551E861000000044E67D90B0000000460D5DFC3000000C8F3B5E5D1E18AE5620C86F3D3B87E045A5337050123D9C609E0A6E7E7609D5C501CA981B35E6DB123C115948CE8AE3BDEF2DA3A71A6F8A87D1760683F231DC302000000
|
|
|
|
|
random_padding_bytes = D234E4F4F806B759AF1209AD9FB84A64F2FFD8E58D4ECF57FDC43CF54D0DA7C9E5833AA741E1B7DAE72F32A94CAEA84876773AE086B1A35D6C84E3DAB0A529E495354A50AC2D5D54800B7368C36C9B2EEAAB5E4765F1EDB173DD85CC</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A908270F8B7E2C69A95100000004546D2D7B000000047670DCA300000097F2BF9D89B671737F899FBA14AD4F312E16F7C4E684CFA888C7B2FABD726168F78E089A937312EC513A2BF71E2F9FBA64CEBCBD4007E939692520BA05A4503E02000000
|
|
|
|
|
random_padding_bytes = 118AB3EBEEE52168275927B3F294313C3D7F3FE085E32C82B3642E4309904AE7F881639A0C0A1DD992EB57C24AB17059A4D98A3A909BBA1F08F6DC77D072BDE595E842FE86227AAC4200DE680A3EFE9FCC4138AFFACD89B766E30326</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 = 40AE9D77BA6C56218BF76863057E2C63F00A27B64F8E54B075DF60DDADEA36B03BAB674D398480BB1B7F63F0B2E8E7BC31E99C11DD28D96BDAA660672AB9063BAE6F45625935E1E31C52475F408AB63F216004AA08CC8E9BA9D18C8D78FEFC7775174DF4F9994950A39C6FE7F3D620CD44E3EF49ADD39DF00783D68C5EDE7B92053BF979A497BC6C9A06E6DDEAE06234319883E38B43BEBD615EB8353D64E0D9BDC31832C5E7BAF100A69867DD34EE47AFECB7A0B2D9883E346CB65D7DB59B777888D42CDD3A21E8D17359A35B12209FA426937521C5892CA42A16F784F745DB5BFE1C551007B91D7F1716410F326FEE22060A0EEAD5DF95B321DC106B21E798</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = CBA173F75B564ACD149EAF633986902664B75610FDDFFFE3F50D24935490B51FFEBD0AD62A7049D933A89ED39F3239C6109AABF2C1A9AF012B6BE0A2DE30B1BCEF8E2284A99054E0B414358F2E1E2EF7820A2C2AD953C5B61D54EDF2E1515E8898EE661218177EA95D895BC54B0052586AEBFE1E2F394B2057F171324ED4A6A0E99D52F87B270E57134FFCB10CB007BECEA0665CB8007497658FD91BB1D0E90E352333BA561D76D52FC94C8F1990E4C63AB306721F1E144EA3D4475623A9B1A4E702039DF1B4059303A0EAA0BACFCFF1166C830AE1B38EE3C714B6702B0DAB6310F2915AD5D443A9DA0D997BC4FC939CA781EA7C258C7D7889AB5A5F8E55AC50</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 14 EF 0A 00 98 35 99 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 C8 F3 B5 E5 D1 E1 8A E5
|
|
|
|
|
0020 | 62 0C 86 F3 D3 B8 7E 04 5A 53 37 05 01 23 D9 C6
|
|
|
|
|
0030 | 09 E0 A6 E7 E7 60 9D 5C 04 4E 67 D9 0B 00 00 00
|
|
|
|
|
0040 | 04 60 D5 DF C3 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 40 AE 9D 77 BA 6C 56 21 8B F7 68 63
|
|
|
|
|
0060 | 05 7E 2C 63 F0 0A 27 B6 4F 8E 54 B0 75 DF 60 DD
|
|
|
|
|
0070 | AD EA 36 B0 3B AB 67 4D 39 84 80 BB 1B 7F 63 F0
|
|
|
|
|
0080 | B2 E8 E7 BC 31 E9 9C 11 DD 28 D9 6B DA A6 60 67
|
|
|
|
|
0090 | 2A B9 06 3B AE 6F 45 62 59 35 E1 E3 1C 52 47 5F
|
|
|
|
|
00A0 | 40 8A B6 3F 21 60 04 AA 08 CC 8E 9B A9 D1 8C 8D
|
|
|
|
|
00B0 | 78 FE FC 77 75 17 4D F4 F9 99 49 50 A3 9C 6F E7
|
|
|
|
|
00C0 | F3 D6 20 CD 44 E3 EF 49 AD D3 9D F0 07 83 D6 8C
|
|
|
|
|
00D0 | 5E DE 7B 92 05 3B F9 79 A4 97 BC 6C 9A 06 E6 DD
|
|
|
|
|
00E0 | EA E0 62 34 31 98 83 E3 8B 43 BE BD 61 5E B8 35
|
|
|
|
|
00F0 | 3D 64 E0 D9 BD C3 18 32 C5 E7 BA F1 00 A6 98 67
|
|
|
|
|
0100 | DD 34 EE 47 AF EC B7 A0 B2 D9 88 3E 34 6C B6 5D
|
|
|
|
|
0110 | 7D B5 9B 77 78 88 D4 2C DD 3A 21 E8 D1 73 59 A3
|
|
|
|
|
0120 | 5B 12 20 9F A4 26 93 75 21 C5 89 2C A4 2A 16 F7
|
|
|
|
|
0130 | 84 F7 45 DB 5B FE 1C 55 10 07 B9 1D 7F 17 16 41
|
|
|
|
|
0140 | 0F 32 6F EE 22 06 0A 0E EA D5 DF 95 B3 21 DC 10
|
|
|
|
|
0150 | 6B 21 E7 98</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 BC 0D 0C 00 7C 4D 99 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 97 F2 BF 9D 89 B6 71 73
|
|
|
|
|
0020 | 7F 89 9F BA 14 AD 4F 31 2E 16 F7 C4 E6 84 CF A8
|
|
|
|
|
0030 | 88 C7 B2 FA BD 72 61 68 04 54 6D 2D 7B 00 00 00
|
|
|
|
|
0040 | 04 76 70 DC A3 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 CB A1 73 F7 5B 56 4A CD 14 9E AF 63
|
|
|
|
|
0060 | 39 86 90 26 64 B7 56 10 FD DF FF E3 F5 0D 24 93
|
|
|
|
|
0070 | 54 90 B5 1F FE BD 0A D6 2A 70 49 D9 33 A8 9E D3
|
|
|
|
|
0080 | 9F 32 39 C6 10 9A AB F2 C1 A9 AF 01 2B 6B E0 A2
|
|
|
|
|
0090 | DE 30 B1 BC EF 8E 22 84 A9 90 54 E0 B4 14 35 8F
|
|
|
|
|
00A0 | 2E 1E 2E F7 82 0A 2C 2A D9 53 C5 B6 1D 54 ED F2
|
|
|
|
|
00B0 | E1 51 5E 88 98 EE 66 12 18 17 7E A9 5D 89 5B C5
|
|
|
|
|
00C0 | 4B 00 52 58 6A EB FE 1E 2F 39 4B 20 57 F1 71 32
|
|
|
|
|
00D0 | 4E D4 A6 A0 E9 9D 52 F8 7B 27 0E 57 13 4F FC B1
|
|
|
|
|
00E0 | 0C B0 07 BE CE A0 66 5C B8 00 74 97 65 8F D9 1B
|
|
|
|
|
00F0 | B1 D0 E9 0E 35 23 33 BA 56 1D 76 D5 2F C9 4C 8F
|
|
|
|
|
0100 | 19 90 E4 C6 3A B3 06 72 1F 1E 14 4E A3 D4 47 56
|
|
|
|
|
0110 | 23 A9 B1 A4 E7 02 03 9D F1 B4 05 93 03 A0 EA A0
|
|
|
|
|
0120 | BA CF CF F1 16 6C 83 0A E1 B3 8E E3 C7 14 B6 70
|
|
|
|
|
0130 | 2B 0D AB 63 10 F2 91 5A D5 D4 43 A9 DA 0D 99 7B
|
|
|
|
|
0140 | C4 FC 93 9C A7 81 EA 7C 25 8C 7D 78 89 AB 5A 5F
|
|
|
|
|
0150 | 8E 55 AC 50</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 = D234E4F4F806B759AF1209AD9FB84A64F2FFD8E58D4ECF57FDC43CF54
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>14EF0A0098359966</code></td>
|
|
|
|
|
<td><code>BC0D0C007C4D9966</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 = D234E4F4F806B759AF1209AD9FB84A64F2FFD8E58D4ECF57FDC43CF54
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>C8F3B5E5D1E18AE5620C86F3D3B87E04</code></td>
|
|
|
|
|
<td><code>97F2BF9D89B671737F899FBA14AD4F31</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>5A5337050123D9C609E0A6E7E7609D5C</code></td>
|
|
|
|
|
<td><code>2E16F7C4E684CFA888C7B2FABD726168</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>044E67D90B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1315428619</td>
|
|
|
|
|
<td><code>04546D2D7B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1416441211</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>0460D5DFC3000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1624629187</td>
|
|
|
|
|
<td><code>047670DCA3000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1987108003</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 = D234E4F4F806B759AF1209AD9FB84A64F2FFD8E58D4ECF57FDC43CF54
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE00010040AE9D77BA6C56218BF76863</code> <code>057E2C63F00A27B64F8E54B075DF60DD</code> <code>ADEA36B03BAB674D398480BB1B7F63F0</code> <code>B2E8E7BC31E99C11DD28D96BDAA66067</code> <code>2AB9063BAE6F45625935E1E31C52475F</code> <code>408AB63F216004AA08CC8E9BA9D18C8D</code> <code>78FEFC7775174DF4F9994950A39C6FE7</code> <code>F3D620CD44E3EF49ADD39DF00783D68C</code> <code>5EDE7B92053BF979A497BC6C9A06E6DD</code> <code>EAE06234319883E38B43BEBD615EB835</code> <code>3D64E0D9BDC31832C5E7BAF100A69867</code> <code>DD34EE47AFECB7A0B2D9883E346CB65D</code> <code>7DB59B777888D42CDD3A21E8D17359A3</code> <code>5B12209FA426937521C5892CA42A16F7</code> <code>84F745DB5BFE1C551007B91D7F171641</code> <code>0F326FEE22060A0EEAD5DF95B321DC10</code><br> <code>6B21E798</code></td>
|
|
|
|
|
<td><code>FE000100CBA173F75B564ACD149EAF63</code> <code>3986902664B75610FDDFFFE3F50D2493</code> <code>5490B51FFEBD0AD62A7049D933A89ED3</code> <code>9F3239C6109AABF2C1A9AF012B6BE0A2</code> <code>DE30B1BCEF8E2284A99054E0B414358F</code> <code>2E1E2EF7820A2C2AD953C5B61D54EDF2</code> <code>E1515E8898EE661218177EA95D895BC5</code> <code>4B0052586AEBFE1E2F394B2057F17132</code> <code>4ED4A6A0E99D52F87B270E57134FFCB1</code> <code>0CB007BECEA0665CB8007497658FD91B</code> <code>B1D0E90E352333BA561D76D52FC94C8F</code> <code>1990E4C63AB306721F1E144EA3D44756</code> <code>23A9B1A4E702039DF1B4059303A0EAA0</code> <code>BACFCFF1166C830AE1B38EE3C714B670</code> <code>2B0DAB6310F2915AD5D443A9DA0D997B</code> <code>C4FC939CA781EA7C258C7D7889AB5A5F</code><br> <code>8E55AC50</code></td>
|
|
|
|
|
<td>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = D234E4F4F806B759AF1209AD9FB84A64F2FFD8E58D4ECF57FDC43CF54
|
|
|
|
|
<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 FC 70 D9 98 35 99 66
|
|
|
|
|
0010 | 80 02 00 00 5C 07 E8 D0 C8 F3 B5 E5 D1 E1 8A E5
|
|
|
|
|
0020 | 62 0C 86 F3 D3 B8 7E 04 5A 53 37 05 01 23 D9 C6
|
|
|
|
|
0030 | 09 E0 A6 E7 E7 60 9D 5C FE 50 02 00 D5 30 2E 38
|
|
|
|
|
0040 | C1 E7 C5 43 69 C7 0F 17 73 7D 89 52 1B F7 9E 8A
|
|
|
|
|
0050 | F4 4C 33 34 B8 A6 52 E5 4D CA C5 E1 11 29 CE 57
|
|
|
|
|
0060 | FE CA 87 DF 47 9E FF 70 60 9A C1 C6 B2 56 0C 16
|
|
|
|
|
0070 | F1 03 04 3B 33 AA 16 0D 98 C6 20 BB D9 14 4E 14
|
|
|
|
|
0080 | C1 61 0B CF 87 79 07 26 69 56 2A 4A 64 1D EF C9
|
|
|
|
|
0090 | 5B 70 FA D3 00 06 87 FA 20 FC 5A 4B F6 B2 8C 31
|
|
|
|
|
00A0 | 69 41 83 D0 92 86 39 23 56 89 8D 93 F6 AD 85 37
|
|
|
|
|
00B0 | F3 2C B8 E3 29 95 55 58 16 A4 06 89 7F DF 17 2E
|
|
|
|
|
00C0 | 06 DC 07 C2 99 96 5F 83 89 6B 5D 5C C4 7D A7 AE
|
|
|
|
|
00D0 | 06 9A 16 71 2E CA E1 21 B6 09 18 AE DD BE 07 7F
|
|
|
|
|
00E0 | 4E 82 26 A3 C5 25 0E 88 91 A6 CF 30 1D 83 C6 20
|
|
|
|
|
00F0 | BC 66 10 A5 A2 6A 10 1E 90 D9 81 FD F8 10 21 F6
|
|
|
|
|
0100 | 29 14 A7 44 76 48 28 77 97 E2 78 64 9C CF 1C 60
|
|
|
|
|
0110 | 99 44 B9 B3 D0 59 A3 E9 D8 15 8E 8A 2F 3C E2 84
|
|
|
|
|
0120 | 1E 50 8C DF A9 3C 14 F8 E0 71 58 C3 60 E9 E9 4B
|
|
|
|
|
0130 | 3C DB 18 0E B8 76 09 D6 55 A5 38 D7 05 3C 70 BF
|
|
|
|
|
0140 | BE 3D 1D DD 97 94 20 52 0D 37 05 93 71 D4 B8 9D
|
|
|
|
|
0150 | C9 22 D1 77 C8 F5 77 D3 ED EA 35 CF 09 7C 99 B5
|
|
|
|
|
0160 | E9 AD 7A A5 9C B7 4C 33 66 A9 8A D9 D8 2E 6D 11
|
|
|
|
|
0170 | 57 CB 91 06 1C 44 EA BB D4 2E 2E B9 B8 22 41 FC
|
|
|
|
|
0180 | BE CD 70 73 74 08 9D BF 09 5D F2 93 0F 71 E8 ED
|
|
|
|
|
0190 | 5F EE B0 31 79 75 B2 90 02 ED 39 99 59 14 7E FC
|
|
|
|
|
01A0 | AB 0B 75 4B 45 87 BA 69 79 F3 DA AF F0 1E 9C 9D
|
|
|
|
|
01B0 | E9 32 45 48 A2 9A 60 58 5A D8 B8 3E B0 B7 52 23
|
|
|
|
|
01C0 | CC 07 5F CA 76 F6 3A FA 15 60 5F E4 2A 7D FE 72
|
|
|
|
|
01D0 | EC 5E 59 02 D3 71 1F 67 CD 8E CB F7 E4 29 F3 4C
|
|
|
|
|
01E0 | C6 8E E2 03 13 A1 A6 98 36 A4 6D 46 13 75 62 7F
|
|
|
|
|
01F0 | 02 17 3A 6E 6E 41 73 E3 40 56 39 D3 31 04 52 3D
|
|
|
|
|
0200 | 8B 8A 9B 37 B2 D8 65 89 4D 9E E7 B2 02 9B 74 3B
|
|
|
|
|
0210 | 3A 2C 7A B2 C5 90 E3 2C 4A A3 A5 C6 5A DD 40 24
|
|
|
|
|
0220 | EA B6 E2 1B A4 A9 38 F4 D1 41 C4 32 77 E3 D0 B0
|
|
|
|
|
0230 | 63 B0 DA DC 8C 93 D5 C2 33 D1 F5 42 07 D4 9B 74
|
|
|
|
|
0240 | 6B D7 8D 68 7D FB AA 27 7D 7A F0 29 3A B5 03 3F
|
|
|
|
|
0250 | 5A 65 37 83 6D D0 AF 34 DC F7 9B 13 18 DD ED 42
|
|
|
|
|
0260 | 7E BC 45 76 75 32 06 1E D4 66 5B 6D E6 E7 49 F9
|
|
|
|
|
0270 | D0 81 71 7E 27 BB FD 06 D3 F1 08 88 48 58 B0 FD
|
|
|
|
|
0280 | 3F 9B 35 3B 6C 75 34 B6 83 CB 12 79</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 C4 FA 32 7D 4D 99 66
|
|
|
|
|
0010 | BC 02 00 00 5C 07 E8 D0 97 F2 BF 9D 89 B6 71 73
|
|
|
|
|
0020 | 7F 89 9F BA 14 AD 4F 31 2E 16 F7 C4 E6 84 CF A8
|
|
|
|
|
0030 | 88 C7 B2 FA BD 72 61 68 FE 50 02 00 BA 0B 42 41
|
|
|
|
|
0040 | 30 A5 B8 5D D9 20 8E 3A 3E 31 DA 71 D2 23 C1 8B
|
|
|
|
|
0050 | EC 36 7E 7B 41 D0 D7 60 EC 5D 8C 92 D8 0D BC A0
|
|
|
|
|
0060 | A8 4C E9 E7 79 42 AD C3 8C C6 99 2C A0 9E 1F A8
|
|
|
|
|
0070 | A6 68 8A 41 38 89 79 EB DA 1F 03 84 A4 9C 9F F6
|
|
|
|
|
0080 | 92 46 37 A2 81 69 A1 97 68 5E 19 14 25 B0 12 BD
|
|
|
|
|
0090 | C8 DE F1 D8 6F E4 AB 77 C8 2C 2F 78 0E F2 22 29
|
|
|
|
|
00A0 | 01 C4 B6 B9 01 32 C1 FC 9D 34 8D 0B 36 D0 63 9B
|
|
|
|
|
00B0 | 69 6A DD 48 D4 66 D3 33 35 DA 14 AB 76 79 93 78
|
|
|
|
|
00C0 | 49 2D 47 3C 21 5B AA 89 F2 E6 36 60 9E 12 4E 87
|
|
|
|
|
00D0 | 74 10 9A EA 37 09 E2 53 AD FC 51 A5 09 BA 26 06
|
|
|
|
|
00E0 | 37 AE F8 11 F1 31 C0 2B 02 46 60 C8 7A 12 C1 84
|
|
|
|
|
00F0 | 51 D0 7A 60 60 2B 03 5B 56 03 3A 4A 19 0D 83 A6
|
|
|
|
|
0100 | E9 AF A5 CE 5E B8 76 C7 22 71 0E E7 C3 CE A4 A9
|
|
|
|
|
0110 | 70 03 35 3A 11 86 85 69 AD 65 B8 16 DD 71 E9 C2
|
|
|
|
|
0120 | 75 44 51 F6 04 57 33 F8 85 F9 F8 41 3E 4E EB 65
|
|
|
|
|
0130 | 1F 57 4F 07 3E 31 7E 82 95 CA 89 29 43 24 7E BA
|
|
|
|
|
0140 | 47 67 01 82 59 44 26 BF D2 B9 CA 7F 33 E6 FF 0D
|
|
|
|
|
0150 | 82 EF AC 53 12 68 64 D0 FB DD C3 33 46 70 CF D6
|
|
|
|
|
0160 | 08 62 34 84 D7 CF BD A4 63 CA 23 0B E8 3C ED CC
|
|
|
|
|
0170 | F5 F8 FD 70 D9 3B 69 89 27 10 17 C0 A2 3E DB A6
|
|
|
|
|
0180 | 40 7C 33 17 EF D5 7B C7 F3 D9 C2 97 BF 3C 2F 47
|
|
|
|
|
0190 | 60 FB 03 12 0D 78 8F 08 E1 0F 24 AF 22 97 B2 D6
|
|
|
|
|
01A0 | DC 6C 1A 6A 6C 8E 94 48 71 06 E1 45 EC DB AF 99
|
|
|
|
|
01B0 | 70 09 39 33 2A 3B A7 73 E7 C1 7A 01 41 D2 E2 32
|
|
|
|
|
01C0 | B9 EA FC 47 9D 8A 9F 65 70 ED 56 B8 D3 38 82 06
|
|
|
|
|
01D0 | 94 CF 7A E6 CF 8B 10 C0 CF 25 FC 77 8C 30 14 9E
|
|
|
|
|
01E0 | 45 75 9E 25 10 8F C2 60 3F 7E AF 43 21 33 A7 74
|
|
|
|
|
01F0 | 8F B9 D1 E7 11 B2 4B C2 72 F9 60 3B 24 C6 F0 00
|
|
|
|
|
0200 | 27 1C 61 E0 34 0B C1 2F 7F 0C C7 46 F7 0F 88 79
|
|
|
|
|
0210 | 52 1E 97 9E CB 28 8B D1 50 69 89 97 25 F0 9E E2
|
|
|
|
|
0220 | 96 20 0B A1 0B 35 C2 D9 99 EB 33 04 9C 8E 1B 59
|
|
|
|
|
0230 | 96 BA 03 3A FC B1 52 FE 8F 6B 82 60 01 FB C8 A2
|
|
|
|
|
0240 | 6E 13 4E 7A E0 A6 BC 44 7B 97 0F 0F CC FC F0 80
|
|
|
|
|
0250 | 2D 7C BB 7E A6 CD 99 7D 5C AA 4B 34 58 89 8A 81
|
|
|
|
|
0260 | 83 59 12 2C 8D C5 60 74 16 86 8E CF F5 48 43 B3
|
|
|
|
|
0270 | 8C B5 73 D7 70 3A 14 32 C6 85 9E F1 12 DE 54 DE
|
|
|
|
|
0280 | 73 CD 05 0C 11 51 DD 7C 5E AD D0 EA</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 = D234E4F4F806B759AF1209AD9FB84A64F2FFD8E58D4ECF57FDC43CF54
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>01FC70D998359966</code></td>
|
|
|
|
|
<td><code>01C4FA327D4D9966</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>BC020000</code> (700 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -482,19 +482,19 @@ random_padding_bytes = D234E4F4F806B759AF1209AD9FB84A64F2FFD8E58D4ECF57FDC43CF54
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>C8F3B5E5D1E18AE5620C86F3D3B87E04</code></td>
|
|
|
|
|
<td><code>97F2BF9D89B671737F899FBA14AD4F31</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>5A5337050123D9C609E0A6E7E7609D5C</code></td>
|
|
|
|
|
<td><code>2E16F7C4E684CFA888C7B2FABD726168</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE500200D5302E38C1E7C54369C70F17</code> <code>737D89521BF79E8AF44C3334B8A652E5</code> <code>4DCAC5E11129CE57FECA87DF479EFF70</code> <code>609AC1C6B2560C16F103043B33AA160D</code> <code>98C620BBD9144E14C1610BCF87790726</code> <code>69562A4A641DEFC95B70FAD3000687FA</code> <code>20FC5A4BF6B28C31694183D092863923</code> <code>56898D93F6AD8537F32CB8E329955558</code> <code>16A406897FDF172E06DC07C299965F83</code> <code>896B5D5CC47DA7AE069A16712ECAE121</code> <code>B60918AEDDBE077F4E8226A3C5250E88</code> <code>91A6CF301D83C620BC6610A5A26A101E</code> <code>90D981FDF81021F62914A74476482877</code> <code>97E278649CCF1C609944B9B3D059A3E9</code> <code>D8158E8A2F3CE2841E508CDFA93C14F8</code> <code>E07158C360E9E94B3CDB180EB87609D6</code> <code>55A538D7053C70BFBE3D1DDD97942052</code> <code>0D37059371D4B89DC922D177C8F577D3</code> <code>EDEA35CF097C99B5E9AD7AA59CB74C33</code> <code>66A98AD9D82E6D1157CB91061C44EABB</code> <code>D42E2EB9B82241FCBECD707374089DBF</code> <code>095DF2930F71E8ED5FEEB0317975B290</code> <code>02ED399959147EFCAB0B754B4587BA69</code> <code>79F3DAAFF01E9C9DE9324548A29A6058</code> <code>5AD8B83EB0B75223CC075FCA76F63AFA</code> <code>15605FE42A7DFE72EC5E5902D3711F67</code> <code>CD8ECBF7E429F34CC68EE20313A1A698</code> <code>36A46D461375627F02173A6E6E4173E3</code> <code>405639D33104523D8B8A9B37B2D86589</code> <code>4D9EE7B2029B743B3A2C7AB2C590E32C</code> <code>4AA3A5C65ADD4024EAB6E21BA4A938F4</code> <code>D141C43277E3D0B063B0DADC8C93D5C2</code> <code>33D1F54207D49B746BD78D687DFBAA27</code> <code>7D7AF0293AB5033F5A6537836DD0AF34</code> <code>DCF79B1318DDED427EBC45767532061E</code> <code>D4665B6DE6E749F9D081717E27BBFD06</code> <code>D3F108884858B0FD3F9B353B6C7534B6</code><br> <code>83CB1279</code></td>
|
|
|
|
|
<td><code>FE500200BA0B424130A5B85DD9208E3A</code> <code>3E31DA71D223C18BEC367E7B41D0D760</code> <code>EC5D8C92D80DBCA0A84CE9E77942ADC3</code> <code>8CC6992CA09E1FA8A6688A41388979EB</code> <code>DA1F0384A49C9FF6924637A28169A197</code> <code>685E191425B012BDC8DEF1D86FE4AB77</code> <code>C82C2F780EF2222901C4B6B90132C1FC</code> <code>9D348D0B36D0639B696ADD48D466D333</code> <code>35DA14AB76799378492D473C215BAA89</code> <code>F2E636609E124E8774109AEA3709E253</code> <code>ADFC51A509BA260637AEF811F131C02B</code> <code>024660C87A12C18451D07A60602B035B</code> <code>56033A4A190D83A6E9AFA5CE5EB876C7</code> <code>22710EE7C3CEA4A97003353A11868569</code> <code>AD65B816DD71E9C2754451F6045733F8</code> <code>85F9F8413E4EEB651F574F073E317E82</code> <code>95CA892943247EBA47670182594426BF</code> <code>D2B9CA7F33E6FF0D82EFAC53126864D0</code> <code>FBDDC3334670CFD608623484D7CFBDA4</code> <code>63CA230BE83CEDCCF5F8FD70D93B6989</code> <code>271017C0A23EDBA6407C3317EFD57BC7</code> <code>F3D9C297BF3C2F4760FB03120D788F08</code> <code>E10F24AF2297B2D6DC6C1A6A6C8E9448</code> <code>7106E145ECDBAF99700939332A3BA773</code> <code>E7C17A0141D2E232B9EAFC479D8A9F65</code> <code>70ED56B8D338820694CF7AE6CF8B10C0</code> <code>CF25FC778C30149E45759E25108FC260</code> <code>3F7EAF432133A7748FB9D1E711B24BC2</code> <code>72F9603B24C6F000271C61E0340BC12F</code> <code>7F0CC746F70F8879521E979ECB288BD1</code> <code>5069899725F09EE296200BA10B35C2D9</code> <code>99EB33049C8E1B5996BA033AFCB152FE</code> <code>8F6B826001FBC8A26E134E7AE0A6BC44</code> <code>7B970F0FCCFCF0802D7CBB7EA6CD997D</code> <code>5CAA4B3458898A818359122C8DC56074</code> <code>16868ECFF54843B38CB573D7703A1432</code> <code>C6859EF112DE54DE73CD050C1151DD7C</code><br> <code>5EADD0EA</code></td>
|
|
|
|
|
<td>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = D234E4F4F806B759AF1209AD9FB84A64F2FFD8E58D4ECF57FDC43CF54
|
|
|
|
|
<!-- 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 = D5302E38C1E7C54369C70F17737D89521BF79E8AF44C3334B8A652E54DCAC5E11129CE57FECA87DF479EFF70609AC1C6B2560C16F103043B33AA160D98C620BBD9144E14C1610BCF8779072669562A4A641DEFC95B70FAD3000687FA20FC5A4BF6B28C31694183D09286392356898D93F6AD8537F32CB8E32995555816A406897FDF172E06DC07C299965F83896B5D5CC47DA7AE069A16712ECAE121B60918AEDDBE077F4E8226A3C5250E8891A6CF301D83C620BC6610A5A26A101E90D981FDF81021F62914A7447648287797E278649CCF1C609944B9B3D059A3E9D8158E8A2F3CE2841E508CDFA93C14F8E07158C360E9E94B3CDB180EB87609D655A538D7053C70BFBE3D1DDD979420520D37059371D4B89DC922D177C8F577D3EDEA35CF097C99B5E9AD7AA59CB74C3366A98AD9D82E6D1157CB91061C44EABBD42E2EB9B82241FCBECD707374089DBF095DF2930F71E8ED5FEEB0317975B29002ED399959147EFCAB0B754B4587BA6979F3DAAFF01E9C9DE9324548A29A60585AD8B83EB0B75223CC075FCA76F63AFA15605FE42A7DFE72EC5E5902D3711F67CD8ECBF7E429F34CC68EE20313A1A69836A46D461375627F02173A6E6E4173E3405639D33104523D8B8A9B37B2D865894D9EE7B2029B743B3A2C7AB2C590E32C4AA3A5C65ADD4024EAB6E21BA4A938F4D141C43277E3D0B063B0DADC8C93D5C233D1F54207D49B746BD78D687DFBAA277D7AF0293AB5033F5A6537836DD0AF34DCF79B1318DDED427EBC45767532061ED4665B6DE6E749F9D081717E27BBFD06D3F108884858B0FD3F9B353B6C7534B683CB1279
|
|
|
|
|
tmp_aes_key = 9311A3560EBA4F1AC8F10B61C3B4D908A4097225C24928C0F67178FEB7E728C8
|
|
|
|
|
tmp_aes_iv = 9654BCFF9F182F35DDB4EBC383B3181B640364ACDB66FC10032CC576501CA981</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = BA0B424130A5B85DD9208E3A3E31DA71D223C18BEC367E7B41D0D760EC5D8C92D80DBCA0A84CE9E77942ADC38CC6992CA09E1FA8A6688A41388979EBDA1F0384A49C9FF6924637A28169A197685E191425B012BDC8DEF1D86FE4AB77C82C2F780EF2222901C4B6B90132C1FC9D348D0B36D0639B696ADD48D466D33335DA14AB76799378492D473C215BAA89F2E636609E124E8774109AEA3709E253ADFC51A509BA260637AEF811F131C02B024660C87A12C18451D07A60602B035B56033A4A190D83A6E9AFA5CE5EB876C722710EE7C3CEA4A97003353A11868569AD65B816DD71E9C2754451F6045733F885F9F8413E4EEB651F574F073E317E8295CA892943247EBA47670182594426BFD2B9CA7F33E6FF0D82EFAC53126864D0FBDDC3334670CFD608623484D7CFBDA463CA230BE83CEDCCF5F8FD70D93B6989271017C0A23EDBA6407C3317EFD57BC7F3D9C297BF3C2F4760FB03120D788F08E10F24AF2297B2D6DC6C1A6A6C8E94487106E145ECDBAF99700939332A3BA773E7C17A0141D2E232B9EAFC479D8A9F6570ED56B8D338820694CF7AE6CF8B10C0CF25FC778C30149E45759E25108FC2603F7EAF432133A7748FB9D1E711B24BC272F9603B24C6F000271C61E0340BC12F7F0CC746F70F8879521E979ECB288BD15069899725F09EE296200BA10B35C2D999EB33049C8E1B5996BA033AFCB152FE8F6B826001FBC8A26E134E7AE0A6BC447B970F0FCCFCF0802D7CBB7EA6CD997D5CAA4B3458898A818359122C8DC5607416868ECFF54843B38CB573D7703A1432C6859EF112DE54DE73CD050C1151DD7C5EADD0EA
|
|
|
|
|
tmp_aes_key = ECB80E870717032F7CD29BBD7D1A4CFD284797E9A4986262B46A5AB4B9D19DD9
|
|
|
|
|
tmp_aes_iv = BF221FC35073EEB56CC626DF73D8B4EE7FDE5E937AC3B992E3DB72FCF78E089A</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = 3119B348BE57F0DD1E97804676264A29ED78A9D7BA0D89B5C8F3B5E5D1E18AE5620C86F3D3B87E045A5337050123D9C609E0A6E7E7609D5C03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010005DC2D2AF2A2729AE421C84C118642B9F6E35FC51FC6F7AF365030430FB346A7E35F8D3420F9000C5327A7C07DC09005485481F311358D9255548CE69739CBA4F6A103903EFF484D873AE9745DF02DC55F932C946533ACCAF69D608A2C55548189BDCD455A2E447F875904C34E3A479DE79ACB32801196717D9EEAA1D88B9C1E8795C7A47E2A10403982E950CBE2E6ECCAEC3A7B41217F45C6DBD5EDCA0104E9B42FB063DE6203A8C98B04F363AAD618BD251E7091A24957BE94F955272EDE2405F24A47F26DCE9F86F140ADDB0863C5CF827F767608E5F613815164BEF796D504FE18218908ECC9B8A6B1E720EC9E91DE1BB64A1D16E2A0A20C8D77044D4A47983599664C8D5C621398CAAB
|
|
|
|
|
answer = BA0D89B5C8F3B5E5D1E18AE5620C86F3D3B87E045A5337050123D9C609E0A6E7E7609D5C03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010005DC2D2AF2A2729AE421C84C118642B9F6E35FC51FC6F7AF365030430FB346A7E35F8D3420F9000C5327A7C07DC09005485481F311358D9255548CE69739CBA4F6A103903EFF484D873AE9745DF02DC55F932C946533ACCAF69D608A2C55548189BDCD455A2E447F875904C34E3A479DE79ACB32801196717D9EEAA1D88B9C1E8795C7A47E2A10403982E950CBE2E6ECCAEC3A7B41217F45C6DBD5EDCA0104E9B42FB063DE6203A8C98B04F363AAD618BD251E7091A24957BE94F955272EDE2405F24A47F26DCE9F86F140ADDB0863C5CF827F767608E5F613815164BEF796D504FE18218908ECC9B8A6B1E720EC9E91DE1BB64A1D16E2A0A20C8D77044D4A47983599664C8D5C621398CAAB</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = D7D85A7CA5FF5388C2FB3245444E0D326A0C0636BA0D89B597F2BF9D89B671737F899FBA14AD4F312E16F7C4E684CFA888C7B2FABD72616803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010092B4CA666A757C27521E5CC00018B009EDEFE6E9BC5F1AB9B2A78DB56E74FB2D7B7650D3CCD6754DAFA6B62EDFB13364B528B05C63BE08314D8BF0C3CC00EA678A11B613D0E1D4425FE6BF51CB541E16E57CB69F05CE34F4104ADB8914E134B5695BD4386EE05BB00A01F66DD07B234E4444CBBB01736204CE1E47BADB9A7BACCC864CF73923F58710266B0C2D0895703A967486DA429086A7C585F894E1636D3EAFC3BBC3FCA4740483AF06E2F4F3D5B09BE9F643978869F01AD95C12B4D9F1828948D8BF459273B0583D06D429A63EFE0483D21E4E36275EB1F549AF1583CEE711C37666B2F41D0174626615D2476936D94B11D923BC12A8F27E38394A4C437D4D9966C69174E18704FC83
|
|
|
|
|
answer = BA0D89B597F2BF9D89B671737F899FBA14AD4F312E16F7C4E684CFA888C7B2FABD72616803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010092B4CA666A757C27521E5CC00018B009EDEFE6E9BC5F1AB9B2A78DB56E74FB2D7B7650D3CCD6754DAFA6B62EDFB13364B528B05C63BE08314D8BF0C3CC00EA678A11B613D0E1D4425FE6BF51CB541E16E57CB69F05CE34F4104ADB8914E134B5695BD4386EE05BB00A01F66DD07B234E4444CBBB01736204CE1E47BADB9A7BACCC864CF73923F58710266B0C2D0895703A967486DA429086A7C585F894E1636D3EAFC3BBC3FCA4740483AF06E2F4F3D5B09BE9F643978869F01AD95C12B4D9F1828948D8BF459273B0583D06D429A63EFE0483D21E4E36275EB1F549AF1583CEE711C37666B2F41D0174626615D2476936D94B11D923BC12A8F27E38394A4C437D4D9966C69174E18704FC83</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 C8 F3 B5 E5 D1 E1 8A E5 62 0C 86 F3
|
|
|
|
|
0010 | D3 B8 7E 04 5A 53 37 05 01 23 D9 C6 09 E0 A6 E7
|
|
|
|
|
0020 | E7 60 9D 5C 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 97 F2 BF 9D 89 B6 71 73 7F 89 9F BA
|
|
|
|
|
0010 | 14 AD 4F 31 2E 16 F7 C4 E6 84 CF A8 88 C7 B2 FA
|
|
|
|
|
0020 | BD 72 61 68 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 = BA0D89B5C8F3B5E5D1E18AE5620C86F3D3B87E045A5337050123D9C609E0A6E7E7609D5
|
|
|
|
|
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 | 05 DC 2D 2A F2 A2 72 9A E4 21 C8 4C 11 86 42 B9
|
|
|
|
|
0140 | F6 E3 5F C5 1F C6 F7 AF 36 50 30 43 0F B3 46 A7
|
|
|
|
|
0150 | E3 5F 8D 34 20 F9 00 0C 53 27 A7 C0 7D C0 90 05
|
|
|
|
|
0160 | 48 54 81 F3 11 35 8D 92 55 54 8C E6 97 39 CB A4
|
|
|
|
|
0170 | F6 A1 03 90 3E FF 48 4D 87 3A E9 74 5D F0 2D C5
|
|
|
|
|
0180 | 5F 93 2C 94 65 33 AC CA F6 9D 60 8A 2C 55 54 81
|
|
|
|
|
0190 | 89 BD CD 45 5A 2E 44 7F 87 59 04 C3 4E 3A 47 9D
|
|
|
|
|
01A0 | E7 9A CB 32 80 11 96 71 7D 9E EA A1 D8 8B 9C 1E
|
|
|
|
|
01B0 | 87 95 C7 A4 7E 2A 10 40 39 82 E9 50 CB E2 E6 EC
|
|
|
|
|
01C0 | CA EC 3A 7B 41 21 7F 45 C6 DB D5 ED CA 01 04 E9
|
|
|
|
|
01D0 | B4 2F B0 63 DE 62 03 A8 C9 8B 04 F3 63 AA D6 18
|
|
|
|
|
01E0 | BD 25 1E 70 91 A2 49 57 BE 94 F9 55 27 2E DE 24
|
|
|
|
|
01F0 | 05 F2 4A 47 F2 6D CE 9F 86 F1 40 AD DB 08 63 C5
|
|
|
|
|
0200 | CF 82 7F 76 76 08 E5 F6 13 81 51 64 BE F7 96 D5
|
|
|
|
|
0210 | 04 FE 18 21 89 08 EC C9 B8 A6 B1 E7 20 EC 9E 91
|
|
|
|
|
0220 | DE 1B B6 4A 1D 16 E2 A0 A2 0C 8D 77 04 4D 4A 47
|
|
|
|
|
0230 | 98 35 99 66</code></pre>
|
|
|
|
|
0130 | 92 B4 CA 66 6A 75 7C 27 52 1E 5C C0 00 18 B0 09
|
|
|
|
|
0140 | ED EF E6 E9 BC 5F 1A B9 B2 A7 8D B5 6E 74 FB 2D
|
|
|
|
|
0150 | 7B 76 50 D3 CC D6 75 4D AF A6 B6 2E DF B1 33 64
|
|
|
|
|
0160 | B5 28 B0 5C 63 BE 08 31 4D 8B F0 C3 CC 00 EA 67
|
|
|
|
|
0170 | 8A 11 B6 13 D0 E1 D4 42 5F E6 BF 51 CB 54 1E 16
|
|
|
|
|
0180 | E5 7C B6 9F 05 CE 34 F4 10 4A DB 89 14 E1 34 B5
|
|
|
|
|
0190 | 69 5B D4 38 6E E0 5B B0 0A 01 F6 6D D0 7B 23 4E
|
|
|
|
|
01A0 | 44 44 CB BB 01 73 62 04 CE 1E 47 BA DB 9A 7B AC
|
|
|
|
|
01B0 | CC 86 4C F7 39 23 F5 87 10 26 6B 0C 2D 08 95 70
|
|
|
|
|
01C0 | 3A 96 74 86 DA 42 90 86 A7 C5 85 F8 94 E1 63 6D
|
|
|
|
|
01D0 | 3E AF C3 BB C3 FC A4 74 04 83 AF 06 E2 F4 F3 D5
|
|
|
|
|
01E0 | B0 9B E9 F6 43 97 88 69 F0 1A D9 5C 12 B4 D9 F1
|
|
|
|
|
01F0 | 82 89 48 D8 BF 45 92 73 B0 58 3D 06 D4 29 A6 3E
|
|
|
|
|
0200 | FE 04 83 D2 1E 4E 36 27 5E B1 F5 49 AF 15 83 CE
|
|
|
|
|
0210 | E7 11 C3 76 66 B2 F4 1D 01 74 62 66 15 D2 47 69
|
|
|
|
|
0220 | 36 D9 4B 11 D9 23 BC 12 A8 F2 7E 38 39 4A 4C 43
|
|
|
|
|
0230 | 7D 4D 99 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 = BA0D89B5C8F3B5E5D1E18AE5620C86F3D3B87E045A5337050123D9C609E0A6E7E7609D5
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>C8F3B5E5D1E18AE5620C86F3D3B87E04</code></td>
|
|
|
|
|
<td><code>97F2BF9D89B671737F899FBA14AD4F31</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>5A5337050123D9C609E0A6E7E7609D5C</code></td>
|
|
|
|
|
<td><code>2E16F7C4E684CFA888C7B2FABD726168</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B5C8F3B5E5D1E18AE5620C86F3D3B87E045A5337050123D9C609E0A6E7E7609D5
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE00010005DC2D2AF2A2729AE421C84C</code> <code>118642B9F6E35FC51FC6F7AF36503043</code> <code>0FB346A7E35F8D3420F9000C5327A7C0</code> <code>7DC09005485481F311358D9255548CE6</code> <code>9739CBA4F6A103903EFF484D873AE974</code> <code>5DF02DC55F932C946533ACCAF69D608A</code> <code>2C55548189BDCD455A2E447F875904C3</code> <code>4E3A479DE79ACB32801196717D9EEAA1</code> <code>D88B9C1E8795C7A47E2A10403982E950</code> <code>CBE2E6ECCAEC3A7B41217F45C6DBD5ED</code> <code>CA0104E9B42FB063DE6203A8C98B04F3</code> <code>63AAD618BD251E7091A24957BE94F955</code> <code>272EDE2405F24A47F26DCE9F86F140AD</code> <code>DB0863C5CF827F767608E5F613815164</code> <code>BEF796D504FE18218908ECC9B8A6B1E7</code> <code>20EC9E91DE1BB64A1D16E2A0A20C8D77</code><br> <code>044D4A47</code></td>
|
|
|
|
|
<td><code>FE00010092B4CA666A757C27521E5CC0</code> <code>0018B009EDEFE6E9BC5F1AB9B2A78DB5</code> <code>6E74FB2D7B7650D3CCD6754DAFA6B62E</code> <code>DFB13364B528B05C63BE08314D8BF0C3</code> <code>CC00EA678A11B613D0E1D4425FE6BF51</code> <code>CB541E16E57CB69F05CE34F4104ADB89</code> <code>14E134B5695BD4386EE05BB00A01F66D</code> <code>D07B234E4444CBBB01736204CE1E47BA</code> <code>DB9A7BACCC864CF73923F58710266B0C</code> <code>2D0895703A967486DA429086A7C585F8</code> <code>94E1636D3EAFC3BBC3FCA4740483AF06</code> <code>E2F4F3D5B09BE9F643978869F01AD95C</code> <code>12B4D9F1828948D8BF459273B0583D06</code> <code>D429A63EFE0483D21E4E36275EB1F549</code> <code>AF1583CEE711C37666B2F41D01746266</code> <code>15D2476936D94B11D923BC12A8F27E38</code><br> <code>394A4C43</code></td>
|
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>98359966</code> (1721316760 in decimal)</td>
|
|
|
|
|
<td><code>7D4D9966</code> (1721322877 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B5C8F3B5E5D1E18AE5620C86F3D3B87E045A5337050123D9C609E0A6E7E7609D5
|
|
|
|
|
<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 = D212BC5F0094BEFDEF0122852071EFE77C58908D3DB52868DC575E0F86B739EFCAF57DEC91DB996BA0953199B8BB93A053C448B871E66DB42A98952032331FDEAFE45C19B167B84D1F86B7F56A27599D8B3A31F01859742FC4ED4EF04A10DC1AB38F43E3BA7DA461900A5D202BF2B48ED64BA5D15DE499E568938E5DDE6D372798DB81A4CB2AE8D705ACCC7AAE37F90FCB3023E78854BF0696D183F3FC865A9BA9E4A889A535A63086C274764030D2F15A24C5D04D314A6565DC0602C50C59A83FF2C2ED67051B065D840E08EB9DC4AEBDAD6E7CE8C5E40A8EB93BD90B440E0EC57D551E74F8A16777EC88361DAF6C61EB5E31EA21D89DCA2852FFBCB2D16F4E</code></pre>
|
|
|
|
|
<pre><code>b = 667F6B8A44CC344BF2801435D3998D99149593EC47780EB620943CE898E204D41C5ADAAE889FE36478A27B5D49488DDEECB2765E444145B40E72BD091497298AC70BB2D32B95CF98F6818A5132EAC8E67DE5C2A14443C1BE90E70521A6742722694486E8E135266FED71D48C53343652FFFADD7136E3102CA727EF80C9D246C884AE749B95276ECE212CF6A90D01DF5C9C51C54E4D9C1FC2213CF9B656C3B5BE85F70564578B0F0A626BD859E5BDA49463A1BFB6C67DD8D2DF63E96CC3B7908D281692A05DF8C311A07C0735C69A5CB3DDE8E143BD1CA2416D0545B328500B7CFBFA2EC9176AAE07A2A6A152535EB8EA94E84BD18F80528B285EF6A4A80DB3D8</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 = 53BBF51BFC41A8273396B461F399681EFD22AAF17CC4130FB0C972F0751FC5688495D36B65A7FEA60754C772DA1DF9B74C968CC446C4139E183F56CE5B3BC04BD29FC1253B0A3E128ED06BFFC85D61A6417C2A34250632643D8F2C913AD52ED30540FFF47E09F3F52FE35682F254DF51EC35F3C3BAF3D14CA7AE79813430969EE6DFBC69D2C66F723C9ECE6D2000A8CBD4E4CB2720968AF2C2E65BD31DA95B589722BAE7D3E814E7358D06A5D33EC08C7068329643B59A3B6030FA8A261BC8526A036ED2340FD008702E0BFAA5B21AD09E645891B295B87CE1B173866181EFC4AB59175466199553DD1630633F4370EE5277997A5044A32E119668A7B4E3CA05</code></pre>
|
|
|
|
|
<pre><code>g_b = 02372725774934BD5658CB8C072382F31AC554E44B66241F3E634C0C30CB4595E3BEEC7096EA25345B85DB86A79A9A07E000CBF4502A5A702E2F9D747C339CD451808B0B9B5AAEE02DBF7A2C54E95BC8E68FC9565197BF25A58A5C01980A753DFE1CE1A54BA7A18036974B13054A84E1A9DF403F6F79B18BF5CA8F74053D962F82CB6587A656C305BA857A4992210CA23366FB6F28E2A632209E7810907DE4E65DD3BA4C1570335C3524E4C35728E2C4891670B5C4E2D4DC75F8D4DA29B69CA9C119CF411E04E16A2A52DA64A3C2EEF6EAF496C00FEC62427F3C2B9360695A7F67B4CC362182BBBA69316BF17084448C41718E2BAC9DCA8F8379A35676745E98</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 C8 F3 B5 E5 D1 E1 8A E5 62 0C 86 F3
|
|
|
|
|
0010 | D3 B8 7E 04 5A 53 37 05 01 23 D9 C6 09 E0 A6 E7
|
|
|
|
|
0020 | E7 60 9D 5C 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 53 BB F5 1B FC 41 A8 27 33 96 B4 61 F3 99 68 1E
|
|
|
|
|
0040 | FD 22 AA F1 7C C4 13 0F B0 C9 72 F0 75 1F C5 68
|
|
|
|
|
0050 | 84 95 D3 6B 65 A7 FE A6 07 54 C7 72 DA 1D F9 B7
|
|
|
|
|
0060 | 4C 96 8C C4 46 C4 13 9E 18 3F 56 CE 5B 3B C0 4B
|
|
|
|
|
0070 | D2 9F C1 25 3B 0A 3E 12 8E D0 6B FF C8 5D 61 A6
|
|
|
|
|
0080 | 41 7C 2A 34 25 06 32 64 3D 8F 2C 91 3A D5 2E D3
|
|
|
|
|
0090 | 05 40 FF F4 7E 09 F3 F5 2F E3 56 82 F2 54 DF 51
|
|
|
|
|
00A0 | EC 35 F3 C3 BA F3 D1 4C A7 AE 79 81 34 30 96 9E
|
|
|
|
|
00B0 | E6 DF BC 69 D2 C6 6F 72 3C 9E CE 6D 20 00 A8 CB
|
|
|
|
|
00C0 | D4 E4 CB 27 20 96 8A F2 C2 E6 5B D3 1D A9 5B 58
|
|
|
|
|
00D0 | 97 22 BA E7 D3 E8 14 E7 35 8D 06 A5 D3 3E C0 8C
|
|
|
|
|
00E0 | 70 68 32 96 43 B5 9A 3B 60 30 FA 8A 26 1B C8 52
|
|
|
|
|
00F0 | 6A 03 6E D2 34 0F D0 08 70 2E 0B FA A5 B2 1A D0
|
|
|
|
|
0100 | 9E 64 58 91 B2 95 B8 7C E1 B1 73 86 61 81 EF C4
|
|
|
|
|
0110 | AB 59 17 54 66 19 95 53 DD 16 30 63 3F 43 70 EE
|
|
|
|
|
0120 | 52 77 99 7A 50 44 A3 2E 11 96 68 A7 B4 E3 CA 05</code></pre>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 97 F2 BF 9D 89 B6 71 73 7F 89 9F BA
|
|
|
|
|
0010 | 14 AD 4F 31 2E 16 F7 C4 E6 84 CF A8 88 C7 B2 FA
|
|
|
|
|
0020 | BD 72 61 68 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 02 37 27 25 77 49 34 BD 56 58 CB 8C 07 23 82 F3
|
|
|
|
|
0040 | 1A C5 54 E4 4B 66 24 1F 3E 63 4C 0C 30 CB 45 95
|
|
|
|
|
0050 | E3 BE EC 70 96 EA 25 34 5B 85 DB 86 A7 9A 9A 07
|
|
|
|
|
0060 | E0 00 CB F4 50 2A 5A 70 2E 2F 9D 74 7C 33 9C D4
|
|
|
|
|
0070 | 51 80 8B 0B 9B 5A AE E0 2D BF 7A 2C 54 E9 5B C8
|
|
|
|
|
0080 | E6 8F C9 56 51 97 BF 25 A5 8A 5C 01 98 0A 75 3D
|
|
|
|
|
0090 | FE 1C E1 A5 4B A7 A1 80 36 97 4B 13 05 4A 84 E1
|
|
|
|
|
00A0 | A9 DF 40 3F 6F 79 B1 8B F5 CA 8F 74 05 3D 96 2F
|
|
|
|
|
00B0 | 82 CB 65 87 A6 56 C3 05 BA 85 7A 49 92 21 0C A2
|
|
|
|
|
00C0 | 33 66 FB 6F 28 E2 A6 32 20 9E 78 10 90 7D E4 E6
|
|
|
|
|
00D0 | 5D D3 BA 4C 15 70 33 5C 35 24 E4 C3 57 28 E2 C4
|
|
|
|
|
00E0 | 89 16 70 B5 C4 E2 D4 DC 75 F8 D4 DA 29 B6 9C A9
|
|
|
|
|
00F0 | C1 19 CF 41 1E 04 E1 6A 2A 52 DA 64 A3 C2 EE F6
|
|
|
|
|
0100 | EA F4 96 C0 0F EC 62 42 7F 3C 2B 93 60 69 5A 7F
|
|
|
|
|
0110 | 67 B4 CC 36 21 82 BB BA 69 31 6B F1 70 84 44 8C
|
|
|
|
|
0120 | 41 71 8E 2B AC 9D CA 8F 83 79 A3 56 76 74 5E 98</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 = BA0D89B5C8F3B5E5D1E18AE5620C86F3D3B87E045A5337050123D9C609E0A6E7E7609D5
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>C8F3B5E5D1E18AE5620C86F3D3B87E04</code></td>
|
|
|
|
|
<td><code>97F2BF9D89B671737F899FBA14AD4F31</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>5A5337050123D9C609E0A6E7E7609D5C</code></td>
|
|
|
|
|
<td><code>2E16F7C4E684CFA888C7B2FABD726168</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE00010053BBF51BFC41A8273396B461</code> <code>F399681EFD22AAF17CC4130FB0C972F0</code> <code>751FC5688495D36B65A7FEA60754C772</code> <code>DA1DF9B74C968CC446C4139E183F56CE</code> <code>5B3BC04BD29FC1253B0A3E128ED06BFF</code> <code>C85D61A6417C2A34250632643D8F2C91</code> <code>3AD52ED30540FFF47E09F3F52FE35682</code> <code>F254DF51EC35F3C3BAF3D14CA7AE7981</code> <code>3430969EE6DFBC69D2C66F723C9ECE6D</code> <code>2000A8CBD4E4CB2720968AF2C2E65BD3</code> <code>1DA95B589722BAE7D3E814E7358D06A5</code> <code>D33EC08C7068329643B59A3B6030FA8A</code> <code>261BC8526A036ED2340FD008702E0BFA</code> <code>A5B21AD09E645891B295B87CE1B17386</code> <code>6181EFC4AB59175466199553DD163063</code> <code>3F4370EE5277997A5044A32E119668A7</code><br> <code>B4E3CA05</code></td>
|
|
|
|
|
<td><code>FE00010002372725774934BD5658CB8C</code> <code>072382F31AC554E44B66241F3E634C0C</code> <code>30CB4595E3BEEC7096EA25345B85DB86</code> <code>A79A9A07E000CBF4502A5A702E2F9D74</code> <code>7C339CD451808B0B9B5AAEE02DBF7A2C</code> <code>54E95BC8E68FC9565197BF25A58A5C01</code> <code>980A753DFE1CE1A54BA7A18036974B13</code> <code>054A84E1A9DF403F6F79B18BF5CA8F74</code> <code>053D962F82CB6587A656C305BA857A49</code> <code>92210CA23366FB6F28E2A632209E7810</code> <code>907DE4E65DD3BA4C1570335C3524E4C3</code> <code>5728E2C4891670B5C4E2D4DC75F8D4DA</code> <code>29B69CA9C119CF411E04E16A2A52DA64</code> <code>A3C2EEF6EAF496C00FEC62427F3C2B93</code> <code>60695A7F67B4CC362182BBBA69316BF1</code> <code>7084448C41718E2BAC9DCA8F8379A356</code><br> <code>76745E98</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 = BA0D89B5C8F3B5E5D1E18AE5620C86F3D3B87E045A5337050123D9C609E0A6E7E7609D5
|
|
|
|
|
<!-- 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 = 54B64366C8F3B5E5D1E18AE5620C86F3D3B87E045A5337050123D9C609E0A6E7E7609D5C0000000000000000FE00010053BBF51BFC41A8273396B461F399681EFD22AAF17CC4130FB0C972F0751FC5688495D36B65A7FEA60754C772DA1DF9B74C968CC446C4139E183F56CE5B3BC04BD29FC1253B0A3E128ED06BFFC85D61A6417C2A34250632643D8F2C913AD52ED30540FFF47E09F3F52FE35682F254DF51EC35F3C3BAF3D14CA7AE79813430969EE6DFBC69D2C66F723C9ECE6D2000A8CBD4E4CB2720968AF2C2E65BD31DA95B589722BAE7D3E814E7358D06A5D33EC08C7068329643B59A3B6030FA8A261BC8526A036ED2340FD008702E0BFAA5B21AD09E645891B295B87CE1B173866181EFC4AB59175466199553DD1630633F4370EE5277997A5044A32E119668A7B4E3CA05
|
|
|
|
|
padding = 80D6A3E093B83E0D0AB654FA
|
|
|
|
|
tmp_aes_key = 9311A3560EBA4F1AC8F10B61C3B4D908A4097225C24928C0F67178FEB7E728C8
|
|
|
|
|
tmp_aes_iv = 9654BCFF9F182F35DDB4EBC383B3181B640364ACDB66FC10032CC576501CA981</code></pre>
|
|
|
|
|
<pre><code>data = 54B6436697F2BF9D89B671737F899FBA14AD4F312E16F7C4E684CFA888C7B2FABD7261680000000000000000FE00010002372725774934BD5658CB8C072382F31AC554E44B66241F3E634C0C30CB4595E3BEEC7096EA25345B85DB86A79A9A07E000CBF4502A5A702E2F9D747C339CD451808B0B9B5AAEE02DBF7A2C54E95BC8E68FC9565197BF25A58A5C01980A753DFE1CE1A54BA7A18036974B13054A84E1A9DF403F6F79B18BF5CA8F74053D962F82CB6587A656C305BA857A4992210CA23366FB6F28E2A632209E7810907DE4E65DD3BA4C1570335C3524E4C35728E2C4891670B5C4E2D4DC75F8D4DA29B69CA9C119CF411E04E16A2A52DA64A3C2EEF6EAF496C00FEC62427F3C2B9360695A7F67B4CC362182BBBA69316BF17084448C41718E2BAC9DCA8F8379A35676745E98
|
|
|
|
|
padding = B4E912B6D330FB401C13795F
|
|
|
|
|
tmp_aes_key = ECB80E870717032F7CD29BBD7D1A4CFD284797E9A4986262B46A5AB4B9D19DD9
|
|
|
|
|
tmp_aes_iv = BF221FC35073EEB56CC626DF73D8B4EE7FDE5E937AC3B992E3DB72FCF78E089A</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 = 08E8E6B96B2D5E5109C95F8B172FA57F005FCA5D73CD6C314919E1FBCE9237A7DE3962C3FD69C12299C1E2FB0FFFC1E7CB7EB691D66934C4E12D92DAC0561A0AF10D651B1518585BECA3B60C896762A434A5EB6D8ED0CEA8C885485EB0BF654A30D9978BB2EBCD5BB9C55DA9AE968A18A34F72355CE1A5BAD01B20BE212270939BF227E4B1F81F382541434F897DCDB4A2E7922689BE70E3358315FA412A4F322493AF96FAFF1B3FAD69A08D14C335B778B3D6A8A7F1ACF98811731B736A145E275675771FDBC2BA58140ACF76EDBAA794941345F1A16129BDF1DEF06BE74B604FDDEAA1068D52EEF009B726834D53B0935ECE48D3A6E0955D20407CA82993B883D611F1CA40BD8C906B0B75FCF0AEE6CBD3E9C0E6341DB2C9444023D7750BA29F48A5E40015D75F2165C1FDADFF4E91D6567BD009D001D27A83848B413DEF6A23A44140683FCFE20353C977E67353F4</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 04D63A08E7B438BBC154EDBB6A5B3D40B5717B886E32AE8C8CF886325CD02CCDCB8566B4DBF1F24CCA8CBDCCEDFCAC34A42E93356A972E741354AEE77462108E7D5BF17F5F696F764A3A508882C2832E12B751BC16B35DE39DC24FE03D99E0257F356287D9BFBCCE02F4B3021C7FEB922832669CF1EF18B8D21442F0E6F927FFCD578BFAF1CBBDCC838E37C251EDD6F2353BF32D5D535EB1599DB97C648C5225F8B191704E6DA5A15E2BD658CF73092B8C47CCFD592B03ADC2B826EF7C7B142E302C48D5F700BD4284A99712F01B73BE0FA9845ADC61CF496D898D068D69E7445514F05FC12CE45750090885AF654CD9CE7766E3953BD5B653124A1767A51BF37A197D58EF186A5059CA89D5F2A047E03841F5D61007D43B813695F6A468C3D0550A1A84EB5D03774A65B7183DFE0F0AFA8E880D366E8D35B09A9BC8EE6953738CD36DFC9080DC7B7C045B71DE72116F</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 D4 74 0B 00 99 35 99 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 C8 F3 B5 E5 D1 E1 8A E5
|
|
|
|
|
0020 | 62 0C 86 F3 D3 B8 7E 04 5A 53 37 05 01 23 D9 C6
|
|
|
|
|
0030 | 09 E0 A6 E7 E7 60 9D 5C FE 50 01 00 08 E8 E6 B9
|
|
|
|
|
0040 | 6B 2D 5E 51 09 C9 5F 8B 17 2F A5 7F 00 5F CA 5D
|
|
|
|
|
0050 | 73 CD 6C 31 49 19 E1 FB CE 92 37 A7 DE 39 62 C3
|
|
|
|
|
0060 | FD 69 C1 22 99 C1 E2 FB 0F FF C1 E7 CB 7E B6 91
|
|
|
|
|
0070 | D6 69 34 C4 E1 2D 92 DA C0 56 1A 0A F1 0D 65 1B
|
|
|
|
|
0080 | 15 18 58 5B EC A3 B6 0C 89 67 62 A4 34 A5 EB 6D
|
|
|
|
|
0090 | 8E D0 CE A8 C8 85 48 5E B0 BF 65 4A 30 D9 97 8B
|
|
|
|
|
00A0 | B2 EB CD 5B B9 C5 5D A9 AE 96 8A 18 A3 4F 72 35
|
|
|
|
|
00B0 | 5C E1 A5 BA D0 1B 20 BE 21 22 70 93 9B F2 27 E4
|
|
|
|
|
00C0 | B1 F8 1F 38 25 41 43 4F 89 7D CD B4 A2 E7 92 26
|
|
|
|
|
00D0 | 89 BE 70 E3 35 83 15 FA 41 2A 4F 32 24 93 AF 96
|
|
|
|
|
00E0 | FA FF 1B 3F AD 69 A0 8D 14 C3 35 B7 78 B3 D6 A8
|
|
|
|
|
00F0 | A7 F1 AC F9 88 11 73 1B 73 6A 14 5E 27 56 75 77
|
|
|
|
|
0100 | 1F DB C2 BA 58 14 0A CF 76 ED BA A7 94 94 13 45
|
|
|
|
|
0110 | F1 A1 61 29 BD F1 DE F0 6B E7 4B 60 4F DD EA A1
|
|
|
|
|
0120 | 06 8D 52 EE F0 09 B7 26 83 4D 53 B0 93 5E CE 48
|
|
|
|
|
0130 | D3 A6 E0 95 5D 20 40 7C A8 29 93 B8 83 D6 11 F1
|
|
|
|
|
0140 | CA 40 BD 8C 90 6B 0B 75 FC F0 AE E6 CB D3 E9 C0
|
|
|
|
|
0150 | E6 34 1D B2 C9 44 40 23 D7 75 0B A2 9F 48 A5 E4
|
|
|
|
|
0160 | 00 15 D7 5F 21 65 C1 FD AD FF 4E 91 D6 56 7B D0
|
|
|
|
|
0170 | 09 D0 01 D2 7A 83 84 8B 41 3D EF 6A 23 A4 41 40
|
|
|
|
|
0180 | 68 3F CF E2 03 53 C9 77 E6 73 53 F4</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 48 8A 09 00 7D 4D 99 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 97 F2 BF 9D 89 B6 71 73
|
|
|
|
|
0020 | 7F 89 9F BA 14 AD 4F 31 2E 16 F7 C4 E6 84 CF A8
|
|
|
|
|
0030 | 88 C7 B2 FA BD 72 61 68 FE 50 01 00 04 D6 3A 08
|
|
|
|
|
0040 | E7 B4 38 BB C1 54 ED BB 6A 5B 3D 40 B5 71 7B 88
|
|
|
|
|
0050 | 6E 32 AE 8C 8C F8 86 32 5C D0 2C CD CB 85 66 B4
|
|
|
|
|
0060 | DB F1 F2 4C CA 8C BD CC ED FC AC 34 A4 2E 93 35
|
|
|
|
|
0070 | 6A 97 2E 74 13 54 AE E7 74 62 10 8E 7D 5B F1 7F
|
|
|
|
|
0080 | 5F 69 6F 76 4A 3A 50 88 82 C2 83 2E 12 B7 51 BC
|
|
|
|
|
0090 | 16 B3 5D E3 9D C2 4F E0 3D 99 E0 25 7F 35 62 87
|
|
|
|
|
00A0 | D9 BF BC CE 02 F4 B3 02 1C 7F EB 92 28 32 66 9C
|
|
|
|
|
00B0 | F1 EF 18 B8 D2 14 42 F0 E6 F9 27 FF CD 57 8B FA
|
|
|
|
|
00C0 | F1 CB BD CC 83 8E 37 C2 51 ED D6 F2 35 3B F3 2D
|
|
|
|
|
00D0 | 5D 53 5E B1 59 9D B9 7C 64 8C 52 25 F8 B1 91 70
|
|
|
|
|
00E0 | 4E 6D A5 A1 5E 2B D6 58 CF 73 09 2B 8C 47 CC FD
|
|
|
|
|
00F0 | 59 2B 03 AD C2 B8 26 EF 7C 7B 14 2E 30 2C 48 D5
|
|
|
|
|
0100 | F7 00 BD 42 84 A9 97 12 F0 1B 73 BE 0F A9 84 5A
|
|
|
|
|
0110 | DC 61 CF 49 6D 89 8D 06 8D 69 E7 44 55 14 F0 5F
|
|
|
|
|
0120 | C1 2C E4 57 50 09 08 85 AF 65 4C D9 CE 77 66 E3
|
|
|
|
|
0130 | 95 3B D5 B6 53 12 4A 17 67 A5 1B F3 7A 19 7D 58
|
|
|
|
|
0140 | EF 18 6A 50 59 CA 89 D5 F2 A0 47 E0 38 41 F5 D6
|
|
|
|
|
0150 | 10 07 D4 3B 81 36 95 F6 A4 68 C3 D0 55 0A 1A 84
|
|
|
|
|
0160 | EB 5D 03 77 4A 65 B7 18 3D FE 0F 0A FA 8E 88 0D
|
|
|
|
|
0170 | 36 6E 8D 35 B0 9A 9B C8 EE 69 53 73 8C D3 6D FC
|
|
|
|
|
0180 | 90 80 DC 7B 7C 04 5B 71 DE 72 11 6F</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>D4740B0099359966</code></td>
|
|
|
|
|
<td><code>488A09007D4D9966</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>C8F3B5E5D1E18AE5620C86F3D3B87E04</code></td>
|
|
|
|
|
<td><code>97F2BF9D89B671737F899FBA14AD4F31</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>5A5337050123D9C609E0A6E7E7609D5C</code></td>
|
|
|
|
|
<td><code>2E16F7C4E684CFA888C7B2FABD726168</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE50010008E8E6B96B2D5E5109C95F8B</code> <code>172FA57F005FCA5D73CD6C314919E1FB</code> <code>CE9237A7DE3962C3FD69C12299C1E2FB</code> <code>0FFFC1E7CB7EB691D66934C4E12D92DA</code> <code>C0561A0AF10D651B1518585BECA3B60C</code> <code>896762A434A5EB6D8ED0CEA8C885485E</code> <code>B0BF654A30D9978BB2EBCD5BB9C55DA9</code> <code>AE968A18A34F72355CE1A5BAD01B20BE</code> <code>212270939BF227E4B1F81F382541434F</code> <code>897DCDB4A2E7922689BE70E3358315FA</code> <code>412A4F322493AF96FAFF1B3FAD69A08D</code> <code>14C335B778B3D6A8A7F1ACF98811731B</code> <code>736A145E275675771FDBC2BA58140ACF</code> <code>76EDBAA794941345F1A16129BDF1DEF0</code> <code>6BE74B604FDDEAA1068D52EEF009B726</code> <code>834D53B0935ECE48D3A6E0955D20407C</code> <code>A82993B883D611F1CA40BD8C906B0B75</code> <code>FCF0AEE6CBD3E9C0E6341DB2C9444023</code> <code>D7750BA29F48A5E40015D75F2165C1FD</code> <code>ADFF4E91D6567BD009D001D27A83848B</code> <code>413DEF6A23A44140683FCFE20353C977</code><br> <code>E67353F4</code></td>
|
|
|
|
|
<td><code>FE50010004D63A08E7B438BBC154EDBB</code> <code>6A5B3D40B5717B886E32AE8C8CF88632</code> <code>5CD02CCDCB8566B4DBF1F24CCA8CBDCC</code> <code>EDFCAC34A42E93356A972E741354AEE7</code> <code>7462108E7D5BF17F5F696F764A3A5088</code> <code>82C2832E12B751BC16B35DE39DC24FE0</code> <code>3D99E0257F356287D9BFBCCE02F4B302</code> <code>1C7FEB922832669CF1EF18B8D21442F0</code> <code>E6F927FFCD578BFAF1CBBDCC838E37C2</code> <code>51EDD6F2353BF32D5D535EB1599DB97C</code> <code>648C5225F8B191704E6DA5A15E2BD658</code> <code>CF73092B8C47CCFD592B03ADC2B826EF</code> <code>7C7B142E302C48D5F700BD4284A99712</code> <code>F01B73BE0FA9845ADC61CF496D898D06</code> <code>8D69E7445514F05FC12CE45750090885</code> <code>AF654CD9CE7766E3953BD5B653124A17</code> <code>67A51BF37A197D58EF186A5059CA89D5</code> <code>F2A047E03841F5D61007D43B813695F6</code> <code>A468C3D0550A1A84EB5D03774A65B718</code> <code>3DFE0F0AFA8E880D366E8D35B09A9BC8</code> <code>EE6953738CD36DFC9080DC7B7C045B71</code><br> <code>DE72116F</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 = 6BA30E6411867F15A7CA2468D3477F52EF311F72ABCB8CA41C42ED50C767D32B1B1491E017DC5B3B2A11644D2DC99BC3E5312E99C2B009A5616F5CF0A6C420F3E4143E649BDEF676BE5FD7D988EFC4A600B2C6ED873F7CDAC273CF56DFD5A53255D4AAA47D41633EE03D4CC1FF7115B30786EB7708296A3E88687F2A425EBCF296DEB30C66B63F850BE0CC128D1D7EF2F29D2A0DED7432FA4FE8B5B3FBB48131BFEF27D1D331A992E18DACD8F92058800F6E33CF6B390D9EC81FCABD74C30B25105EFF3B5583F9211790C4C4843DF36FBD055A074947FB5DE5C87B9BDE12122A5CDE1372E9E2617817D14FBC534E07D37BB738DEABF6B3281E65FCEF12BD5B52</code></pre>
|
|
|
|
|
<pre><code>auth_key = 04BD9C00CB29B13ABBA826E2B9C3FCEC8EB727ADB5B8B0A03CB9817379B44B6F0B1B51C2DF4CBCAA7823C91D7371D40730E26AE80FA9FCB9AC372F3A24EB9FA18F38CAB717B961A6E3789FF7EBD65E9F5B7F59AD8A329D62A11C441943E50A5C77A35D27348B192153173AB39C47D9E3591F1EE1948E64CFFD5D67615818061FBD2232E41FC24B3529D034E6B683B112094D2D0BCE167D4E200A057C2A59A834C4C5805A46D17141692886BBBEE7C3EB91D5595425E2B5A1DA7C325210DB9EF3D5DDB610538804BCD1F674CBAA30E6B4241EA29EA0BF01470F4D0E49739EE22E49925AF18E88660326391686076D4F02AD7668D40310CDCB0BC49C31BA9209BA</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 44 91 34 9A 35 99 66
|
|
|
|
|
0010 | B0 00 00 00 34 F7 CB 3B C8 F3 B5 E5 D1 E1 8A E5
|
|
|
|
|
0020 | 62 0C 86 F3 D3 B8 7E 04 5A 53 37 05 01 23 D9 C6
|
|
|
|
|
0030 | 09 E0 A6 E7 E7 60 9D 5C 80 80 F6 F1 0E E0 B3 06
|
|
|
|
|
0040 | F1 29 37 C3 E3 00 AE FB</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 E0 D4 C6 7D 4D 99 66
|
|
|
|
|
0010 | AC 00 00 00 34 F7 CB 3B 97 F2 BF 9D 89 B6 71 73
|
|
|
|
|
0020 | 7F 89 9F BA 14 AD 4F 31 2E 16 F7 C4 E6 84 CF A8
|
|
|
|
|
0030 | 88 C7 B2 FA BD 72 61 68 B3 3A 17 55 AB 59 60 2B
|
|
|
|
|
0040 | 4A CB 13 9F F5 73 AA 12</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>014491349A359966</code></td>
|
|
|
|
|
<td><code>01E0D4C67D4D9966</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>B0000000</code> (176 in decimal)</td>
|
|
|
|
|
<td><code>AC000000</code> (172 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>C8F3B5E5D1E18AE5620C86F3D3B87E04</code></td>
|
|
|
|
|
<td><code>97F2BF9D89B671737F899FBA14AD4F31</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>5A5337050123D9C609E0A6E7E7609D5C</code></td>
|
|
|
|
|
<td><code>2E16F7C4E684CFA888C7B2FABD726168</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>8080F6F10EE0B306F12937C3E300AEFB</code></td>
|
|
|
|
|
<td><code>B33A1755AB59602B4ACB139FF573AA12</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>
|
|
|
|
|