|
|
|
@ -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 54 F3 0C 00 47 E1 53 65
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE C1 14 9F E5 F9 AE 1D E6
|
|
|
|
|
0020 | F9 70 7B F1 87 27 3F E6</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 3C 06 03 00 A7 E3 53 65
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 87 54 F2 3A B4 CF 8B 0A
|
|
|
|
|
0020 | 3C 1A 5F 51 8A B8 E7 94</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>54F30C0047E15365</code></td>
|
|
|
|
|
<td><code>3C060300A7E35365</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>C1149FE5F9AE1DE6F9707BF187273FE6</code></td>
|
|
|
|
|
<td><code>8754F23AB4CF8B0A3C1A5F518AB8E794</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 EC 08 F5 47 E1 53 65
|
|
|
|
|
0010 | 98 00 00 00 63 24 16 05 C1 14 9F E5 F9 AE 1D E6
|
|
|
|
|
0020 | F9 70 7B F1 87 27 3F E6 AE 0B D3 44 AD A9 1E A2
|
|
|
|
|
0030 | E6 CF DD 57 46 53 37 E4 08 22 B7 00 AC DB 1A 68
|
|
|
|
|
0040 | 0B 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 F4 4B 4C A7 E3 53 65
|
|
|
|
|
0010 | 80 00 00 00 63 24 16 05 87 54 F2 3A B4 CF 8B 0A
|
|
|
|
|
0020 | 3C 1A 5F 51 8A B8 E7 94 71 35 4E 3E 4E 79 EA 40
|
|
|
|
|
0030 | FF 69 78 AC 3E 15 77 69 08 29 52 0D D9 C5 1D 69
|
|
|
|
|
0040 | 4F 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>01EC08F547E15365</code></td>
|
|
|
|
|
<td><code>01F44B4CA7E35365</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>98000000</code> (152 in decimal)</td>
|
|
|
|
|
<td><code>80000000</code> (128 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>C1149FE5F9AE1DE6F9707BF187273FE6</code></td>
|
|
|
|
|
<td><code>8754F23AB4CF8B0A3C1A5F518AB8E794</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>AE0BD344ADA91EA2E6CFDD57465337E4</code></td>
|
|
|
|
|
<td><code>71354E3E4E79EA40FF6978AC3E157769</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>0822B700ACDB1A680B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2501468860437915659</td>
|
|
|
|
|
<td><code>0829520DD9C51D694F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2977457532611422543</td>
|
|
|
|
|
<td>Single-byte prefix denoting length, an 8-byte string, and three bytes of padding</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -208,22 +208,22 @@
|
|
|
|
|
<h4><a class="anchor" href="#proof-of-work" id="proof-of-work" name="proof-of-work"><i class="anchor-icon"></i></a>Proof of work</h4>
|
|
|
|
|
<h5><a class="anchor" href="#3-client-decomposes-pq-into-prime-factors-such-that-p--q" id="3-client-decomposes-pq-into-prime-factors-such-that-p--q" name="3-client-decomposes-pq-into-prime-factors-such-that-p--q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p < q.</h5>
|
|
|
|
|
<!-- start pq -->
|
|
|
|
|
<pre><code>pq = 2501468860437915659</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2501468860437915659 = 1290516503 * 1938347053</code></p>
|
|
|
|
|
<pre><code>p = 1290516503
|
|
|
|
|
q = 1938347053</code></pre>
|
|
|
|
|
<pre><code>pq = 2977457532611422543</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2977457532611422543 = 1615862537 * 1842642839</code></p>
|
|
|
|
|
<pre><code>p = 1615862537
|
|
|
|
|
q = 1842642839</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 22 B7 00 AC DB 1A 68 0B 00 00 00
|
|
|
|
|
0010 | 04 4C EB B8 17 00 00 00 04 73 88 D4 2D 00 00 00
|
|
|
|
|
0020 | C1 14 9F E5 F9 AE 1D E6 F9 70 7B F1 87 27 3F E6
|
|
|
|
|
0030 | AE 0B D3 44 AD A9 1E A2 E6 CF DD 57 46 53 37 E4
|
|
|
|
|
0040 | 81 ED 7C DB 88 87 9E F6 36 F2 3A F4 28 35 1A 58
|
|
|
|
|
0050 | 4C 01 28 2A B6 BC E8 DE 66 B8 1A 9A A8 9A D0 3F
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 29 52 0D D9 C5 1D 69 4F 00 00 00
|
|
|
|
|
0010 | 04 60 50 1B 09 00 00 00 04 6D D4 7F 97 00 00 00
|
|
|
|
|
0020 | 87 54 F2 3A B4 CF 8B 0A 3C 1A 5F 51 8A B8 E7 94
|
|
|
|
|
0030 | 71 35 4E 3E 4E 79 EA 40 FF 69 78 AC 3E 15 77 69
|
|
|
|
|
0040 | 0F 0D 2B E2 18 FC AE 41 EB 36 96 6E 36 E7 D9 6D
|
|
|
|
|
0050 | E1 80 E7 41 84 A6 E9 CF 1D 70 2C 59 54 E2 DF A0
|
|
|
|
|
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 = 1938347053</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>0822B700ACDB1A680B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2501468860437915659</td>
|
|
|
|
|
<td><code>0829520DD9C51D694F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2977457532611422543</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>044CEBB817000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1290516503</td>
|
|
|
|
|
<td><code>0460501B09000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1615862537</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>047388D42D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1938347053</td>
|
|
|
|
|
<td><code>046DD47F97000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1842642839</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>C1149FE5F9AE1DE6F9707BF187273FE6</code></td>
|
|
|
|
|
<td><code>8754F23AB4CF8B0A3C1A5F518AB8E794</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>AE0BD344ADA91EA2E6CFDD57465337E4</code></td>
|
|
|
|
|
<td><code>71354E3E4E79EA40FF6978AC3E157769</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>81ED7CDB88879EF636F23AF428351A58</code> <code>4C01282AB6BCE8DE66B81A9AA89AD03F</code></td>
|
|
|
|
|
<td><code>0F0D2BE218FCAE41EB36966E36E7D96D</code> <code>E180E74184A6E9CF1D702C5954E2DFA0</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1938347053</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 = 955FF5A90822B700ACDB1A680B000000044CEBB817000000047388D42D000000C1149FE5F9AE1DE6F9707BF187273FE6AE0BD344ADA91EA2E6CFDD57465337E481ED7CDB88879EF636F23AF428351A584C01282AB6BCE8DE66B81A9AA89AD03F02000000
|
|
|
|
|
random_padding_bytes = 8CF8CE4E191AF022190ECD0D6D03F2CA22AB992DAE5289644A79084907E66BE4964E608E2AFD37C358466313DCD99347BBF0A5D4DBBF3947A8FBC38CA3E26634206E073776AB164067EE3D8CAFBB3965A9D0CAE2473749727132EA6F</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A90829520DD9C51D694F0000000460501B09000000046DD47F970000008754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E1577690F0D2BE218FCAE41EB36966E36E7D96DE180E74184A6E9CF1D702C5954E2DFA002000000
|
|
|
|
|
random_padding_bytes = 3C38DC7F98BD7A9156B1A7D60D372FCB8FF2B4E45C1B0614F736E3BD3F0006A060FED8C7399A4BEE95BE25C2DD9E9EA9960FA2C367D219A36FB7BD1B4D12A0DBD9DCED0348DCE0ABE7C09B5E86A5CEBAFDC6281ED38A537B5D9772A1</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 = 5D827F84130191D774B0646DBA7A0122D4EA18D1E83606E00629767D2DAE50E77EE357CD081C675CD29E42139D033024F0E04AF7911FB43C93FDBB2578AAB5DB345FF08657C8D693B404A11E2C985C7B289F036F2C260B0C2DA8C6FFD649AFD52A4BEACCEBC232590F75285222CA8A26A3574CEB122D77C645B43D88DE64474B0CC06162539D8D1334CA34B3325B70AC5F361D34EDAE3737005FD248E354EEE9860BBCB24E0476F99543B363584AAC31A0C95C4763C103DC42D2D09DBA540591D988EB6DFD3D3D84CBFACFBF29E63FE95F7F4CDCFDC4F934F131446CA25B4F76C1F589121E814208E1DAC2DA74CA44EA0124E22CC3752508706ABFAFE85B6921</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 48C017F4BBC9DF6717A695D2F76B9515B6A08DE23C9ECB2661AA22D6717B005E6345B7E48FF3837A30285841F8A4B236532E2E48F56486F934ADCA245370C4E00F0FDAF2CA001F0BB6F92BF8532D35B1EBD062B743F902BBCA9AEE371F749682B9A5EFAFEB5B03B21C00DED5EF54B1B287A592911FC984D1A6C45E26BB26A0A6D194887F3A5EB829AE9D32297782632EE1ABECF61DDDBBD70341E32E98AE3032DCCDCDA817EA7C035046267DE0A715673C8353CC95594520BD850654A0DABF78F842C075DD652955B870A301F6F48A158D453A96D66FD2490E5DC648506DBA6223E69CDF35A5C4D1D51A574BE1A716DA24872FFEE84F5BB8E8293B8501B2C8BF</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 D8 6C 04 00 48 E1 53 65
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 C1 14 9F E5 F9 AE 1D E6
|
|
|
|
|
0020 | F9 70 7B F1 87 27 3F E6 AE 0B D3 44 AD A9 1E A2
|
|
|
|
|
0030 | E6 CF DD 57 46 53 37 E4 04 4C EB B8 17 00 00 00
|
|
|
|
|
0040 | 04 73 88 D4 2D 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 5D 82 7F 84 13 01 91 D7 74 B0 64 6D
|
|
|
|
|
0060 | BA 7A 01 22 D4 EA 18 D1 E8 36 06 E0 06 29 76 7D
|
|
|
|
|
0070 | 2D AE 50 E7 7E E3 57 CD 08 1C 67 5C D2 9E 42 13
|
|
|
|
|
0080 | 9D 03 30 24 F0 E0 4A F7 91 1F B4 3C 93 FD BB 25
|
|
|
|
|
0090 | 78 AA B5 DB 34 5F F0 86 57 C8 D6 93 B4 04 A1 1E
|
|
|
|
|
00A0 | 2C 98 5C 7B 28 9F 03 6F 2C 26 0B 0C 2D A8 C6 FF
|
|
|
|
|
00B0 | D6 49 AF D5 2A 4B EA CC EB C2 32 59 0F 75 28 52
|
|
|
|
|
00C0 | 22 CA 8A 26 A3 57 4C EB 12 2D 77 C6 45 B4 3D 88
|
|
|
|
|
00D0 | DE 64 47 4B 0C C0 61 62 53 9D 8D 13 34 CA 34 B3
|
|
|
|
|
00E0 | 32 5B 70 AC 5F 36 1D 34 ED AE 37 37 00 5F D2 48
|
|
|
|
|
00F0 | E3 54 EE E9 86 0B BC B2 4E 04 76 F9 95 43 B3 63
|
|
|
|
|
0100 | 58 4A AC 31 A0 C9 5C 47 63 C1 03 DC 42 D2 D0 9D
|
|
|
|
|
0110 | BA 54 05 91 D9 88 EB 6D FD 3D 3D 84 CB FA CF BF
|
|
|
|
|
0120 | 29 E6 3F E9 5F 7F 4C DC FD C4 F9 34 F1 31 44 6C
|
|
|
|
|
0130 | A2 5B 4F 76 C1 F5 89 12 1E 81 42 08 E1 DA C2 DA
|
|
|
|
|
0140 | 74 CA 44 EA 01 24 E2 2C C3 75 25 08 70 6A BF AF
|
|
|
|
|
0150 | E8 5B 69 21</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 40 06 03 00 A7 E3 53 65
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 87 54 F2 3A B4 CF 8B 0A
|
|
|
|
|
0020 | 3C 1A 5F 51 8A B8 E7 94 71 35 4E 3E 4E 79 EA 40
|
|
|
|
|
0030 | FF 69 78 AC 3E 15 77 69 04 60 50 1B 09 00 00 00
|
|
|
|
|
0040 | 04 6D D4 7F 97 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 48 C0 17 F4 BB C9 DF 67 17 A6 95 D2
|
|
|
|
|
0060 | F7 6B 95 15 B6 A0 8D E2 3C 9E CB 26 61 AA 22 D6
|
|
|
|
|
0070 | 71 7B 00 5E 63 45 B7 E4 8F F3 83 7A 30 28 58 41
|
|
|
|
|
0080 | F8 A4 B2 36 53 2E 2E 48 F5 64 86 F9 34 AD CA 24
|
|
|
|
|
0090 | 53 70 C4 E0 0F 0F DA F2 CA 00 1F 0B B6 F9 2B F8
|
|
|
|
|
00A0 | 53 2D 35 B1 EB D0 62 B7 43 F9 02 BB CA 9A EE 37
|
|
|
|
|
00B0 | 1F 74 96 82 B9 A5 EF AF EB 5B 03 B2 1C 00 DE D5
|
|
|
|
|
00C0 | EF 54 B1 B2 87 A5 92 91 1F C9 84 D1 A6 C4 5E 26
|
|
|
|
|
00D0 | BB 26 A0 A6 D1 94 88 7F 3A 5E B8 29 AE 9D 32 29
|
|
|
|
|
00E0 | 77 82 63 2E E1 AB EC F6 1D DD BB D7 03 41 E3 2E
|
|
|
|
|
00F0 | 98 AE 30 32 DC CD CD A8 17 EA 7C 03 50 46 26 7D
|
|
|
|
|
0100 | E0 A7 15 67 3C 83 53 CC 95 59 45 20 BD 85 06 54
|
|
|
|
|
0110 | A0 DA BF 78 F8 42 C0 75 DD 65 29 55 B8 70 A3 01
|
|
|
|
|
0120 | F6 F4 8A 15 8D 45 3A 96 D6 6F D2 49 0E 5D C6 48
|
|
|
|
|
0130 | 50 6D BA 62 23 E6 9C DF 35 A5 C4 D1 D5 1A 57 4B
|
|
|
|
|
0140 | E1 A7 16 DA 24 87 2F FE E8 4F 5B B8 E8 29 3B 85
|
|
|
|
|
0150 | 01 B2 C8 BF</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 = 8CF8CE4E191AF022190ECD0D6D03F2CA22AB992DAE5289644A7908490
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>D86C040048E15365</code></td>
|
|
|
|
|
<td><code>40060300A7E35365</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 = 8CF8CE4E191AF022190ECD0D6D03F2CA22AB992DAE5289644A7908490
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>C1149FE5F9AE1DE6F9707BF187273FE6</code></td>
|
|
|
|
|
<td><code>8754F23AB4CF8B0A3C1A5F518AB8E794</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>AE0BD344ADA91EA2E6CFDD57465337E4</code></td>
|
|
|
|
|
<td><code>71354E3E4E79EA40FF6978AC3E157769</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>044CEBB817000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1290516503</td>
|
|
|
|
|
<td><code>0460501B09000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1615862537</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>047388D42D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1938347053</td>
|
|
|
|
|
<td><code>046DD47F97000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1842642839</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 = 8CF8CE4E191AF022190ECD0D6D03F2CA22AB992DAE5289644A7908490
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE0001005D827F84130191D774B0646D</code> <code>BA7A0122D4EA18D1E83606E00629767D</code> <code>2DAE50E77EE357CD081C675CD29E4213</code> <code>9D033024F0E04AF7911FB43C93FDBB25</code> <code>78AAB5DB345FF08657C8D693B404A11E</code> <code>2C985C7B289F036F2C260B0C2DA8C6FF</code> <code>D649AFD52A4BEACCEBC232590F752852</code> <code>22CA8A26A3574CEB122D77C645B43D88</code> <code>DE64474B0CC06162539D8D1334CA34B3</code> <code>325B70AC5F361D34EDAE3737005FD248</code> <code>E354EEE9860BBCB24E0476F99543B363</code> <code>584AAC31A0C95C4763C103DC42D2D09D</code> <code>BA540591D988EB6DFD3D3D84CBFACFBF</code> <code>29E63FE95F7F4CDCFDC4F934F131446C</code> <code>A25B4F76C1F589121E814208E1DAC2DA</code> <code>74CA44EA0124E22CC3752508706ABFAF</code><br> <code>E85B6921</code></td>
|
|
|
|
|
<td><code>FE00010048C017F4BBC9DF6717A695D2</code> <code>F76B9515B6A08DE23C9ECB2661AA22D6</code> <code>717B005E6345B7E48FF3837A30285841</code> <code>F8A4B236532E2E48F56486F934ADCA24</code> <code>5370C4E00F0FDAF2CA001F0BB6F92BF8</code> <code>532D35B1EBD062B743F902BBCA9AEE37</code> <code>1F749682B9A5EFAFEB5B03B21C00DED5</code> <code>EF54B1B287A592911FC984D1A6C45E26</code> <code>BB26A0A6D194887F3A5EB829AE9D3229</code> <code>7782632EE1ABECF61DDDBBD70341E32E</code> <code>98AE3032DCCDCDA817EA7C035046267D</code> <code>E0A715673C8353CC95594520BD850654</code> <code>A0DABF78F842C075DD652955B870A301</code> <code>F6F48A158D453A96D66FD2490E5DC648</code> <code>506DBA6223E69CDF35A5C4D1D51A574B</code> <code>E1A716DA24872FFEE84F5BB8E8293B85</code><br> <code>01B2C8BF</code></td>
|
|
|
|
|
<td>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = 8CF8CE4E191AF022190ECD0D6D03F2CA22AB992DAE5289644A7908490
|
|
|
|
|
<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 60 9B 86 48 E1 53 65
|
|
|
|
|
0010 | 78 02 00 00 5C 07 E8 D0 C1 14 9F E5 F9 AE 1D E6
|
|
|
|
|
0020 | F9 70 7B F1 87 27 3F E6 AE 0B D3 44 AD A9 1E A2
|
|
|
|
|
0030 | E6 CF DD 57 46 53 37 E4 FE 50 02 00 CE 79 5D 8E
|
|
|
|
|
0040 | 47 ED A0 6D 17 94 24 36 D0 80 9E ED 52 EA D1 4E
|
|
|
|
|
0050 | 51 1D 35 A2 D6 D7 4C 17 4F E4 E4 42 9A ED DE B8
|
|
|
|
|
0060 | FD 86 3C 6C 4F D2 7B 64 BA C8 13 8E 79 46 0F 1E
|
|
|
|
|
0070 | 8D F1 5E D0 0A BA B4 08 D6 CD D6 61 AF A6 21 22
|
|
|
|
|
0080 | 2A 42 C9 00 0E 37 BA E2 DA 68 06 37 D9 03 D3 65
|
|
|
|
|
0090 | 37 77 78 6C 56 57 40 27 00 E6 6F A7 2B 69 C6 EB
|
|
|
|
|
00A0 | F1 6B E1 B8 30 AB 37 1C 7E 29 CA 0C 61 A8 A5 E4
|
|
|
|
|
00B0 | 78 4A FD 8E 15 F3 E7 86 1F 80 4C CB E0 6B 6F 65
|
|
|
|
|
00C0 | 1D 7C 17 6D 16 E2 2E 48 1D C4 08 56 7B DC 2F A9
|
|
|
|
|
00D0 | 3B 79 D8 9D D4 40 AD 63 CD 28 1C 1F A5 C7 9A DE
|
|
|
|
|
00E0 | 75 02 24 F8 94 2D D2 92 A0 AF DF FC 7C 09 CC BE
|
|
|
|
|
00F0 | EA 92 03 E6 F1 12 7D 8C B6 13 DB D1 C0 53 4E 31
|
|
|
|
|
0100 | 7F 14 A9 02 75 0D 27 51 FC E4 36 D7 18 70 F6 4D
|
|
|
|
|
0110 | 69 51 E2 EB 25 84 CC 81 D3 33 09 7F 89 21 69 31
|
|
|
|
|
0120 | B9 44 B7 DE 19 92 13 4D 4E 67 D5 9F CE F8 96 74
|
|
|
|
|
0130 | 6A A7 1D 09 94 D2 43 05 14 C3 5E 50 56 C7 69 C1
|
|
|
|
|
0140 | BE 4F 77 BD E9 9E B3 AC 4F 0E E6 15 56 60 F9 02
|
|
|
|
|
0150 | 54 64 7E DF D7 0B 8E 05 67 42 CC D5 FF 0B F1 AF
|
|
|
|
|
0160 | 0A 8F B5 91 D3 99 01 A6 C7 87 E0 48 2C 94 81 A0
|
|
|
|
|
0170 | 19 0D DF E0 AB 87 49 CD 0B E9 6D 0D D9 48 C6 F4
|
|
|
|
|
0180 | 33 D6 86 D7 41 3F 9C 25 51 AB 56 77 9D DE 4A 88
|
|
|
|
|
0190 | 86 B3 DB 82 25 76 E8 F3 D0 9F 18 EF 95 45 1A 53
|
|
|
|
|
01A0 | 09 7C 60 41 2A 07 26 87 C5 60 76 10 AA 44 E6 1F
|
|
|
|
|
01B0 | 72 D6 CE 47 4C 8B A7 CE A0 22 4A 2D DB D5 16 08
|
|
|
|
|
01C0 | D3 6D 17 5D C2 1A 5C A4 53 F1 AA 73 64 BF 47 10
|
|
|
|
|
01D0 | 71 9B 2E E9 B8 A5 13 E3 10 94 67 7A BC B2 8F 47
|
|
|
|
|
01E0 | C5 23 1D 3E 26 34 8E 98 4C BB FC EC A0 F8 C2 ED
|
|
|
|
|
01F0 | 8A 77 A2 2D 77 06 68 E8 9D E3 64 B0 0F 1F 13 83
|
|
|
|
|
0200 | F7 1C 8C 84 3D 45 2E F6 E5 C7 1D C3 4D 13 37 E5
|
|
|
|
|
0210 | A5 78 75 72 0C 8C E8 7E 94 C0 2D AF 42 97 D0 B3
|
|
|
|
|
0220 | C9 7C 21 70 97 5E F1 EB BE E0 59 65 61 9A 51 6D
|
|
|
|
|
0230 | 78 5F 3F EA 37 26 D0 46 35 E9 E4 2A 98 2E 75 26
|
|
|
|
|
0240 | 61 AC 7E B0 44 49 90 5A FA BA B5 E7 7B 34 09 CA
|
|
|
|
|
0250 | BE 19 9B B0 75 43 A0 89 56 EF 4C F8 1F 43 7D 00
|
|
|
|
|
0260 | DA 91 27 F2 80 AB DF 09 22 8B EB 66 B1 83 1D 75
|
|
|
|
|
0270 | 2A 90 13 C5 98 7B 4B 2F 46 DB B3 8D FD 5C C0 80
|
|
|
|
|
0280 | 1E D5 D1 5A 67 87 84 A5 04 07 D0 F0</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 FC 65 FF A7 E3 53 65
|
|
|
|
|
0010 | B4 02 00 00 5C 07 E8 D0 87 54 F2 3A B4 CF 8B 0A
|
|
|
|
|
0020 | 3C 1A 5F 51 8A B8 E7 94 71 35 4E 3E 4E 79 EA 40
|
|
|
|
|
0030 | FF 69 78 AC 3E 15 77 69 FE 50 02 00 EC 30 0C AA
|
|
|
|
|
0040 | B8 20 19 C7 32 46 AC B1 BD 36 4D A4 1B 0C 87 86
|
|
|
|
|
0050 | 89 2D 4C 6E C9 2D 11 74 CD 1D 42 4A 5E 22 08 39
|
|
|
|
|
0060 | 86 4A 49 AF 37 77 EF BB 42 8C 8D D5 5E 7F 91 72
|
|
|
|
|
0070 | 18 39 05 99 0C 76 42 B1 41 24 3E B6 09 11 59 50
|
|
|
|
|
0080 | 4D 54 26 72 E2 5D 2C D5 10 8B F6 22 F5 16 14 C0
|
|
|
|
|
0090 | 90 50 D0 1C 89 9D 1E B9 CB 8C 30 A8 C7 76 CF E2
|
|
|
|
|
00A0 | 05 95 87 58 07 32 48 E7 D2 15 48 F9 A1 D4 02 99
|
|
|
|
|
00B0 | 9A A7 09 75 DC EF 08 10 B8 68 4F 2D 34 A7 BA 70
|
|
|
|
|
00C0 | 66 C7 10 E7 31 E5 5E 98 36 95 96 22 90 94 67 99
|
|
|
|
|
00D0 | CC 14 15 39 31 65 AA EA DC 40 6F 9E 01 B5 25 85
|
|
|
|
|
00E0 | 2A DC BA 3D D4 FB D9 68 79 4B D3 58 E9 9E F3 39
|
|
|
|
|
00F0 | 3B 2D 3B FD B5 BD D7 8B C3 37 4D DA 4C 4F 3D 25
|
|
|
|
|
0100 | 1A 04 6D 2C 0A 0D DE C4 27 75 90 BF DD 39 15 33
|
|
|
|
|
0110 | 53 CE 2D B1 EA FF CF 95 88 5F 75 42 67 7E 47 1D
|
|
|
|
|
0120 | 12 21 C1 00 A5 9A 23 EC 5E 74 61 62 21 3E BC F2
|
|
|
|
|
0130 | 46 79 F2 F5 3F D4 E8 B3 41 CC 90 C8 38 8B 32 A0
|
|
|
|
|
0140 | 0F 9D F8 54 59 A4 71 18 12 AC 1C 64 13 DA 79 93
|
|
|
|
|
0150 | D5 10 4E 72 BD CD 11 56 41 BF EF 70 ED 9B 8A 1D
|
|
|
|
|
0160 | E8 A2 09 81 4A A1 3D 13 95 87 5C 3C BE DF 4E B2
|
|
|
|
|
0170 | 2D 09 B5 8F 24 D2 E5 17 DE 75 44 B7 CB 8E 8A 30
|
|
|
|
|
0180 | 4D 1C 11 4D 5B B2 F1 FA B6 AE 3A 0A 86 E9 1A 0D
|
|
|
|
|
0190 | AE 70 4B CB 04 0A 37 22 66 6B 35 32 E0 55 4D CF
|
|
|
|
|
01A0 | 64 DB FC B3 DB EC 8A 35 07 CC 64 48 36 2C D3 64
|
|
|
|
|
01B0 | AE 56 45 BE FD 99 AB CF 32 72 88 F8 B9 91 04 A3
|
|
|
|
|
01C0 | 3C 1C CD 07 19 F2 2A 2A C7 2A 45 5E A0 44 5B D5
|
|
|
|
|
01D0 | 11 19 13 42 2D 19 09 C1 5F 34 98 71 A7 D1 F1 88
|
|
|
|
|
01E0 | 71 B1 01 21 68 6B 9E 1C 93 32 1C BE F1 FD D7 D0
|
|
|
|
|
01F0 | 5B 65 6C 0D 79 E3 E7 58 71 61 2D EB 0A 01 C9 98
|
|
|
|
|
0200 | C7 A9 94 F4 25 C6 19 47 E3 26 F7 97 AB AF B7 75
|
|
|
|
|
0210 | AD E7 58 A8 08 A9 C4 76 59 60 27 8F 8E 33 E7 D0
|
|
|
|
|
0220 | ED 33 AE 40 BE CB B3 86 9D 59 E9 53 BB 19 71 3A
|
|
|
|
|
0230 | F0 92 A4 12 C0 DB 06 52 FF 29 FA 4E 91 43 39 34
|
|
|
|
|
0240 | 2B 23 9B 65 AF 8F EF 34 FD 6F D3 C6 20 42 87 B7
|
|
|
|
|
0250 | DF 95 D5 DC E1 12 CB C1 E4 1D A2 2B 48 76 AA B0
|
|
|
|
|
0260 | 94 00 46 C1 35 B2 FF 3C 12 46 D6 B2 D9 3E D2 0C
|
|
|
|
|
0270 | ED D1 10 C2 AF B4 14 62 35 F6 A8 9D 4D 41 BC 7E
|
|
|
|
|
0280 | 63 B0 4E 3E 9F 62 79 2F B5 D5 67 B3</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 = 8CF8CE4E191AF022190ECD0D6D03F2CA22AB992DAE5289644A7908490
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>01609B8648E15365</code></td>
|
|
|
|
|
<td><code>01FC65FFA7E35365</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>78020000</code> (632 in decimal)</td>
|
|
|
|
|
<td><code>B4020000</code> (692 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -482,19 +482,19 @@ random_padding_bytes = 8CF8CE4E191AF022190ECD0D6D03F2CA22AB992DAE5289644A7908490
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>C1149FE5F9AE1DE6F9707BF187273FE6</code></td>
|
|
|
|
|
<td><code>8754F23AB4CF8B0A3C1A5F518AB8E794</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>AE0BD344ADA91EA2E6CFDD57465337E4</code></td>
|
|
|
|
|
<td><code>71354E3E4E79EA40FF6978AC3E157769</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE500200CE795D8E47EDA06D17942436</code> <code>D0809EED52EAD14E511D35A2D6D74C17</code> <code>4FE4E4429AEDDEB8FD863C6C4FD27B64</code> <code>BAC8138E79460F1E8DF15ED00ABAB408</code> <code>D6CDD661AFA621222A42C9000E37BAE2</code> <code>DA680637D903D3653777786C56574027</code> <code>00E66FA72B69C6EBF16BE1B830AB371C</code> <code>7E29CA0C61A8A5E4784AFD8E15F3E786</code> <code>1F804CCBE06B6F651D7C176D16E22E48</code> <code>1DC408567BDC2FA93B79D89DD440AD63</code> <code>CD281C1FA5C79ADE750224F8942DD292</code> <code>A0AFDFFC7C09CCBEEA9203E6F1127D8C</code> <code>B613DBD1C0534E317F14A902750D2751</code> <code>FCE436D71870F64D6951E2EB2584CC81</code> <code>D333097F89216931B944B7DE1992134D</code> <code>4E67D59FCEF896746AA71D0994D24305</code> <code>14C35E5056C769C1BE4F77BDE99EB3AC</code> <code>4F0EE6155660F90254647EDFD70B8E05</code> <code>6742CCD5FF0BF1AF0A8FB591D39901A6</code> <code>C787E0482C9481A0190DDFE0AB8749CD</code> <code>0BE96D0DD948C6F433D686D7413F9C25</code> <code>51AB56779DDE4A8886B3DB822576E8F3</code> <code>D09F18EF95451A53097C60412A072687</code> <code>C5607610AA44E61F72D6CE474C8BA7CE</code> <code>A0224A2DDBD51608D36D175DC21A5CA4</code> <code>53F1AA7364BF4710719B2EE9B8A513E3</code> <code>1094677ABCB28F47C5231D3E26348E98</code> <code>4CBBFCECA0F8C2ED8A77A22D770668E8</code> <code>9DE364B00F1F1383F71C8C843D452EF6</code> <code>E5C71DC34D1337E5A57875720C8CE87E</code> <code>94C02DAF4297D0B3C97C2170975EF1EB</code> <code>BEE05965619A516D785F3FEA3726D046</code> <code>35E9E42A982E752661AC7EB04449905A</code> <code>FABAB5E77B3409CABE199BB07543A089</code> <code>56EF4CF81F437D00DA9127F280ABDF09</code> <code>228BEB66B1831D752A9013C5987B4B2F</code> <code>46DBB38DFD5CC0801ED5D15A678784A5</code><br> <code>0407D0F0</code></td>
|
|
|
|
|
<td><code>FE500200EC300CAAB82019C73246ACB1</code> <code>BD364DA41B0C8786892D4C6EC92D1174</code> <code>CD1D424A5E220839864A49AF3777EFBB</code> <code>428C8DD55E7F9172183905990C7642B1</code> <code>41243EB6091159504D542672E25D2CD5</code> <code>108BF622F51614C09050D01C899D1EB9</code> <code>CB8C30A8C776CFE205958758073248E7</code> <code>D21548F9A1D402999AA70975DCEF0810</code> <code>B8684F2D34A7BA7066C710E731E55E98</code> <code>3695962290946799CC1415393165AAEA</code> <code>DC406F9E01B525852ADCBA3DD4FBD968</code> <code>794BD358E99EF3393B2D3BFDB5BDD78B</code> <code>C3374DDA4C4F3D251A046D2C0A0DDEC4</code> <code>277590BFDD39153353CE2DB1EAFFCF95</code> <code>885F7542677E471D1221C100A59A23EC</code> <code>5E746162213EBCF24679F2F53FD4E8B3</code> <code>41CC90C8388B32A00F9DF85459A47118</code> <code>12AC1C6413DA7993D5104E72BDCD1156</code> <code>41BFEF70ED9B8A1DE8A209814AA13D13</code> <code>95875C3CBEDF4EB22D09B58F24D2E517</code> <code>DE7544B7CB8E8A304D1C114D5BB2F1FA</code> <code>B6AE3A0A86E91A0DAE704BCB040A3722</code> <code>666B3532E0554DCF64DBFCB3DBEC8A35</code> <code>07CC6448362CD364AE5645BEFD99ABCF</code> <code>327288F8B99104A33C1CCD0719F22A2A</code> <code>C72A455EA0445BD5111913422D1909C1</code> <code>5F349871A7D1F18871B10121686B9E1C</code> <code>93321CBEF1FDD7D05B656C0D79E3E758</code> <code>71612DEB0A01C998C7A994F425C61947</code> <code>E326F797ABAFB775ADE758A808A9C476</code> <code>5960278F8E33E7D0ED33AE40BECBB386</code> <code>9D59E953BB19713AF092A412C0DB0652</code> <code>FF29FA4E914339342B239B65AF8FEF34</code> <code>FD6FD3C6204287B7DF95D5DCE112CBC1</code> <code>E41DA22B4876AAB0940046C135B2FF3C</code> <code>1246D6B2D93ED20CEDD110C2AFB41462</code> <code>35F6A89D4D41BC7E63B04E3E9F62792F</code><br> <code>B5D567B3</code></td>
|
|
|
|
|
<td>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = 8CF8CE4E191AF022190ECD0D6D03F2CA22AB992DAE5289644A7908490
|
|
|
|
|
<!-- 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 = CE795D8E47EDA06D17942436D0809EED52EAD14E511D35A2D6D74C174FE4E4429AEDDEB8FD863C6C4FD27B64BAC8138E79460F1E8DF15ED00ABAB408D6CDD661AFA621222A42C9000E37BAE2DA680637D903D3653777786C5657402700E66FA72B69C6EBF16BE1B830AB371C7E29CA0C61A8A5E4784AFD8E15F3E7861F804CCBE06B6F651D7C176D16E22E481DC408567BDC2FA93B79D89DD440AD63CD281C1FA5C79ADE750224F8942DD292A0AFDFFC7C09CCBEEA9203E6F1127D8CB613DBD1C0534E317F14A902750D2751FCE436D71870F64D6951E2EB2584CC81D333097F89216931B944B7DE1992134D4E67D59FCEF896746AA71D0994D2430514C35E5056C769C1BE4F77BDE99EB3AC4F0EE6155660F90254647EDFD70B8E056742CCD5FF0BF1AF0A8FB591D39901A6C787E0482C9481A0190DDFE0AB8749CD0BE96D0DD948C6F433D686D7413F9C2551AB56779DDE4A8886B3DB822576E8F3D09F18EF95451A53097C60412A072687C5607610AA44E61F72D6CE474C8BA7CEA0224A2DDBD51608D36D175DC21A5CA453F1AA7364BF4710719B2EE9B8A513E31094677ABCB28F47C5231D3E26348E984CBBFCECA0F8C2ED8A77A22D770668E89DE364B00F1F1383F71C8C843D452EF6E5C71DC34D1337E5A57875720C8CE87E94C02DAF4297D0B3C97C2170975EF1EBBEE05965619A516D785F3FEA3726D04635E9E42A982E752661AC7EB04449905AFABAB5E77B3409CABE199BB07543A08956EF4CF81F437D00DA9127F280ABDF09228BEB66B1831D752A9013C5987B4B2F46DBB38DFD5CC0801ED5D15A678784A50407D0F0
|
|
|
|
|
tmp_aes_key = AAB528F14E8ECAD99290F5AC3CA8B323046841A628252C83652DDD78C02F4C8C
|
|
|
|
|
tmp_aes_iv = 87AC534B08733D154F4A15EF6B70605F622ED308764630B0C6DE2E4F81ED7CDB</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = EC300CAAB82019C73246ACB1BD364DA41B0C8786892D4C6EC92D1174CD1D424A5E220839864A49AF3777EFBB428C8DD55E7F9172183905990C7642B141243EB6091159504D542672E25D2CD5108BF622F51614C09050D01C899D1EB9CB8C30A8C776CFE205958758073248E7D21548F9A1D402999AA70975DCEF0810B8684F2D34A7BA7066C710E731E55E983695962290946799CC1415393165AAEADC406F9E01B525852ADCBA3DD4FBD968794BD358E99EF3393B2D3BFDB5BDD78BC3374DDA4C4F3D251A046D2C0A0DDEC4277590BFDD39153353CE2DB1EAFFCF95885F7542677E471D1221C100A59A23EC5E746162213EBCF24679F2F53FD4E8B341CC90C8388B32A00F9DF85459A4711812AC1C6413DA7993D5104E72BDCD115641BFEF70ED9B8A1DE8A209814AA13D1395875C3CBEDF4EB22D09B58F24D2E517DE7544B7CB8E8A304D1C114D5BB2F1FAB6AE3A0A86E91A0DAE704BCB040A3722666B3532E0554DCF64DBFCB3DBEC8A3507CC6448362CD364AE5645BEFD99ABCF327288F8B99104A33C1CCD0719F22A2AC72A455EA0445BD5111913422D1909C15F349871A7D1F18871B10121686B9E1C93321CBEF1FDD7D05B656C0D79E3E75871612DEB0A01C998C7A994F425C61947E326F797ABAFB775ADE758A808A9C4765960278F8E33E7D0ED33AE40BECBB3869D59E953BB19713AF092A412C0DB0652FF29FA4E914339342B239B65AF8FEF34FD6FD3C6204287B7DF95D5DCE112CBC1E41DA22B4876AAB0940046C135B2FF3C1246D6B2D93ED20CEDD110C2AFB4146235F6A89D4D41BC7E63B04E3E9F62792FB5D567B3
|
|
|
|
|
tmp_aes_key = 18BFF5E15D497FE20AE89092E2AF5E584F1274BC4BC69B1B5B963C844D43E90F
|
|
|
|
|
tmp_aes_iv = 14D91E3D5A21F5C5055DDD1E6FB9F9295FA21AFD94BD2DAB211D7BB40F0D2BE2</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = D7D69FAB8E635139666E8D49D62B0FF05008FBADBA0D89B5C1149FE5F9AE1DE6F9707BF187273FE6AE0BD344ADA91EA2E6CFDD57465337E403000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001004966BEB0A959683CE296167319A09A8A5B7F9C77245C9CF0B377BEFDAD9EB6FD23B87493E56D60C12B77F787B008B108AE4C0B25F47948D5258EB8E416DD489429296583DDB6BF8A82FB4245AAB880C94FB99FA869005D43C5F2E69208DF8DBAE15AF63B377EB732CA630B7C5713737EC472DEA4CDBD70E8E532692382843A3398A0C4300B54554C1770282A9FD8741DD88A0A0D94A29D64FE69A8F3FB9062B8F17E05A3FC64453778151D45484EFF2B220E8C741704029134CA0C1888DC62EE80801E5C0F0E4A1B6CB40938B7D701AA73CB9AD3737B1F01B064449F14E5B0FF2E44341722555FE60C4DCF3C229534804F872CF490ED922CDA61242A44CDC9D348E15365AA4A0B46C1AB881E
|
|
|
|
|
answer = BA0D89B5C1149FE5F9AE1DE6F9707BF187273FE6AE0BD344ADA91EA2E6CFDD57465337E403000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001004966BEB0A959683CE296167319A09A8A5B7F9C77245C9CF0B377BEFDAD9EB6FD23B87493E56D60C12B77F787B008B108AE4C0B25F47948D5258EB8E416DD489429296583DDB6BF8A82FB4245AAB880C94FB99FA869005D43C5F2E69208DF8DBAE15AF63B377EB732CA630B7C5713737EC472DEA4CDBD70E8E532692382843A3398A0C4300B54554C1770282A9FD8741DD88A0A0D94A29D64FE69A8F3FB9062B8F17E05A3FC64453778151D45484EFF2B220E8C741704029134CA0C1888DC62EE80801E5C0F0E4A1B6CB40938B7D701AA73CB9AD3737B1F01B064449F14E5B0FF2E44341722555FE60C4DCF3C229534804F872CF490ED922CDA61242A44CDC9D348E15365AA4A0B46C1AB881E</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = EDF6E5D5B7B267DD24A8E9942989E5A9A2641503BA0D89B58754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E15776903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001006C6A8EBE0DAEDDED3B621DC52ACEEB0B0054D34234E0C7566408C59789A80A053970CC73EBBFDAFDBCEABAF17B920ABF7486E92A78B501C806B12B91AC3096EF649AE5CFA6C7035B02F2ADAC98628D0FF317D59E475B77363D28997F66C595B0D66EC1506EEADCCB92325A22893981CED27E0006861345CFBE9D36C91E177B7C5F1AF31695582D2350EAE97972D4138C6FF57A68E954A0F34E88D7CEE2C4BB8DF826E0BCE8194FCE35809C9A3D86DBAA1F77F841F55E5DD98D74761C13B8B316354521DE8E6484B3B45F212FA0AD3F408E527AD6286454F4B11E7FA51830B89DE2B97F6AD09ED33AEC9EE80E65988B399F83A8E7A58F148966F259C8E34E41E2A7E3536595D817C24AB5E551
|
|
|
|
|
answer = BA0D89B58754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E15776903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001006C6A8EBE0DAEDDED3B621DC52ACEEB0B0054D34234E0C7566408C59789A80A053970CC73EBBFDAFDBCEABAF17B920ABF7486E92A78B501C806B12B91AC3096EF649AE5CFA6C7035B02F2ADAC98628D0FF317D59E475B77363D28997F66C595B0D66EC1506EEADCCB92325A22893981CED27E0006861345CFBE9D36C91E177B7C5F1AF31695582D2350EAE97972D4138C6FF57A68E954A0F34E88D7CEE2C4BB8DF826E0BCE8194FCE35809C9A3D86DBAA1F77F841F55E5DD98D74761C13B8B316354521DE8E6484B3B45F212FA0AD3F408E527AD6286454F4B11E7FA51830B89DE2B97F6AD09ED33AEC9EE80E65988B399F83A8E7A58F148966F259C8E34E41E2A7E3536595D817C24AB5E551</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 C1 14 9F E5 F9 AE 1D E6 F9 70 7B F1
|
|
|
|
|
0010 | 87 27 3F E6 AE 0B D3 44 AD A9 1E A2 E6 CF DD 57
|
|
|
|
|
0020 | 46 53 37 E4 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 87 54 F2 3A B4 CF 8B 0A 3C 1A 5F 51
|
|
|
|
|
0010 | 8A B8 E7 94 71 35 4E 3E 4E 79 EA 40 FF 69 78 AC
|
|
|
|
|
0020 | 3E 15 77 69 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 = BA0D89B5C1149FE5F9AE1DE6F9707BF187273FE6AE0BD344ADA91EA2E6CFDD57465337E
|
|
|
|
|
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 | 49 66 BE B0 A9 59 68 3C E2 96 16 73 19 A0 9A 8A
|
|
|
|
|
0140 | 5B 7F 9C 77 24 5C 9C F0 B3 77 BE FD AD 9E B6 FD
|
|
|
|
|
0150 | 23 B8 74 93 E5 6D 60 C1 2B 77 F7 87 B0 08 B1 08
|
|
|
|
|
0160 | AE 4C 0B 25 F4 79 48 D5 25 8E B8 E4 16 DD 48 94
|
|
|
|
|
0170 | 29 29 65 83 DD B6 BF 8A 82 FB 42 45 AA B8 80 C9
|
|
|
|
|
0180 | 4F B9 9F A8 69 00 5D 43 C5 F2 E6 92 08 DF 8D BA
|
|
|
|
|
0190 | E1 5A F6 3B 37 7E B7 32 CA 63 0B 7C 57 13 73 7E
|
|
|
|
|
01A0 | C4 72 DE A4 CD BD 70 E8 E5 32 69 23 82 84 3A 33
|
|
|
|
|
01B0 | 98 A0 C4 30 0B 54 55 4C 17 70 28 2A 9F D8 74 1D
|
|
|
|
|
01C0 | D8 8A 0A 0D 94 A2 9D 64 FE 69 A8 F3 FB 90 62 B8
|
|
|
|
|
01D0 | F1 7E 05 A3 FC 64 45 37 78 15 1D 45 48 4E FF 2B
|
|
|
|
|
01E0 | 22 0E 8C 74 17 04 02 91 34 CA 0C 18 88 DC 62 EE
|
|
|
|
|
01F0 | 80 80 1E 5C 0F 0E 4A 1B 6C B4 09 38 B7 D7 01 AA
|
|
|
|
|
0200 | 73 CB 9A D3 73 7B 1F 01 B0 64 44 9F 14 E5 B0 FF
|
|
|
|
|
0210 | 2E 44 34 17 22 55 5F E6 0C 4D CF 3C 22 95 34 80
|
|
|
|
|
0220 | 4F 87 2C F4 90 ED 92 2C DA 61 24 2A 44 CD C9 D3
|
|
|
|
|
0230 | 48 E1 53 65</code></pre>
|
|
|
|
|
0130 | 6C 6A 8E BE 0D AE DD ED 3B 62 1D C5 2A CE EB 0B
|
|
|
|
|
0140 | 00 54 D3 42 34 E0 C7 56 64 08 C5 97 89 A8 0A 05
|
|
|
|
|
0150 | 39 70 CC 73 EB BF DA FD BC EA BA F1 7B 92 0A BF
|
|
|
|
|
0160 | 74 86 E9 2A 78 B5 01 C8 06 B1 2B 91 AC 30 96 EF
|
|
|
|
|
0170 | 64 9A E5 CF A6 C7 03 5B 02 F2 AD AC 98 62 8D 0F
|
|
|
|
|
0180 | F3 17 D5 9E 47 5B 77 36 3D 28 99 7F 66 C5 95 B0
|
|
|
|
|
0190 | D6 6E C1 50 6E EA DC CB 92 32 5A 22 89 39 81 CE
|
|
|
|
|
01A0 | D2 7E 00 06 86 13 45 CF BE 9D 36 C9 1E 17 7B 7C
|
|
|
|
|
01B0 | 5F 1A F3 16 95 58 2D 23 50 EA E9 79 72 D4 13 8C
|
|
|
|
|
01C0 | 6F F5 7A 68 E9 54 A0 F3 4E 88 D7 CE E2 C4 BB 8D
|
|
|
|
|
01D0 | F8 26 E0 BC E8 19 4F CE 35 80 9C 9A 3D 86 DB AA
|
|
|
|
|
01E0 | 1F 77 F8 41 F5 5E 5D D9 8D 74 76 1C 13 B8 B3 16
|
|
|
|
|
01F0 | 35 45 21 DE 8E 64 84 B3 B4 5F 21 2F A0 AD 3F 40
|
|
|
|
|
0200 | 8E 52 7A D6 28 64 54 F4 B1 1E 7F A5 18 30 B8 9D
|
|
|
|
|
0210 | E2 B9 7F 6A D0 9E D3 3A EC 9E E8 0E 65 98 8B 39
|
|
|
|
|
0220 | 9F 83 A8 E7 A5 8F 14 89 66 F2 59 C8 E3 4E 41 E2
|
|
|
|
|
0230 | A7 E3 53 65</code></pre>
|
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
|
<pre><code>server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;</code></pre>
|
|
|
|
|
<table class="table">
|
|
|
|
@ -570,13 +570,13 @@ answer = BA0D89B5C1149FE5F9AE1DE6F9707BF187273FE6AE0BD344ADA91EA2E6CFDD57465337E
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>C1149FE5F9AE1DE6F9707BF187273FE6</code></td>
|
|
|
|
|
<td><code>8754F23AB4CF8B0A3C1A5F518AB8E794</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>AE0BD344ADA91EA2E6CFDD57465337E4</code></td>
|
|
|
|
|
<td><code>71354E3E4E79EA40FF6978AC3E157769</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B5C1149FE5F9AE1DE6F9707BF187273FE6AE0BD344ADA91EA2E6CFDD57465337E
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE0001004966BEB0A959683CE2961673</code> <code>19A09A8A5B7F9C77245C9CF0B377BEFD</code> <code>AD9EB6FD23B87493E56D60C12B77F787</code> <code>B008B108AE4C0B25F47948D5258EB8E4</code> <code>16DD489429296583DDB6BF8A82FB4245</code> <code>AAB880C94FB99FA869005D43C5F2E692</code> <code>08DF8DBAE15AF63B377EB732CA630B7C</code> <code>5713737EC472DEA4CDBD70E8E5326923</code> <code>82843A3398A0C4300B54554C1770282A</code> <code>9FD8741DD88A0A0D94A29D64FE69A8F3</code> <code>FB9062B8F17E05A3FC64453778151D45</code> <code>484EFF2B220E8C741704029134CA0C18</code> <code>88DC62EE80801E5C0F0E4A1B6CB40938</code> <code>B7D701AA73CB9AD3737B1F01B064449F</code> <code>14E5B0FF2E44341722555FE60C4DCF3C</code> <code>229534804F872CF490ED922CDA61242A</code><br> <code>44CDC9D3</code></td>
|
|
|
|
|
<td><code>FE0001006C6A8EBE0DAEDDED3B621DC5</code> <code>2ACEEB0B0054D34234E0C7566408C597</code> <code>89A80A053970CC73EBBFDAFDBCEABAF1</code> <code>7B920ABF7486E92A78B501C806B12B91</code> <code>AC3096EF649AE5CFA6C7035B02F2ADAC</code> <code>98628D0FF317D59E475B77363D28997F</code> <code>66C595B0D66EC1506EEADCCB92325A22</code> <code>893981CED27E0006861345CFBE9D36C9</code> <code>1E177B7C5F1AF31695582D2350EAE979</code> <code>72D4138C6FF57A68E954A0F34E88D7CE</code> <code>E2C4BB8DF826E0BCE8194FCE35809C9A</code> <code>3D86DBAA1F77F841F55E5DD98D74761C</code> <code>13B8B316354521DE8E6484B3B45F212F</code> <code>A0AD3F408E527AD6286454F4B11E7FA5</code> <code>1830B89DE2B97F6AD09ED33AEC9EE80E</code> <code>65988B399F83A8E7A58F148966F259C8</code><br> <code>E34E41E2</code></td>
|
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>48E15365</code> (1699995976 in decimal)</td>
|
|
|
|
|
<td><code>A7E35365</code> (1699996583 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B5C1149FE5F9AE1DE6F9707BF187273FE6AE0BD344ADA91EA2E6CFDD57465337E
|
|
|
|
|
<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 = D983DD33FEB0575878CD78B06E0C60B17F0A85CC0BFFE09FD674DD8780375D9680AB34F285326193C8F82D4FB78E35DE6B822C38950E58D2671745D3F2E6FF699BE3275FA2E1F03B2C3908D2DF742D89B56C3303A2F01F0E80974379AF6EFDCD5F9A3F648D331E104D434BB1482D034F87CD5CDCE626479327F2E05B17E3FE6CC844F528BA4B6F28DFB965A09B6A6A5C050028B777FA4EBBC0582684754A3D0D626626FC1C0C3A082A362A2561B58C2AF9DA08119FAE985A3CBA321CCF21CB8D7048053FF8EC472819D5F4BB677B86D91F973BC1CF8C981A8E0FD80539A1FC76841C93793929529047EC817AEE8D7929372898D92EF452AC6E1D8DDA57EFB1DD</code></pre>
|
|
|
|
|
<pre><code>b = 525206EF8F2EB255A6766F5E808BA653C8C0A3BFA58E572E9EFC7F6DC4465855B1DB49D31D64EA233677DD39609B45B7788972B7C36720CA7D43090E3B3DFCE354A77B83A8FDD623F36CE06FA751DCBBF8869CD0C932EE2D1B2E183657605FBD624A68746C95DB1D0185CA9D8855E24D32B9D99D6B29CF1948974AFF7C9F8DA948603DC451E98A4A6D28216996841B326CE1F215882D1987D85D944BF42EC10B6633C7454B62DF67D7103C2576E1F4B42BC17539A470A8B2E14E7A2DCD9DFAE3959B2304E4D653FED74A1E7B6C81727686E394278DE1E7D588E8E6F27465B5AE655F21E2403181D02F338B237E58FF59DD3C0AE0BF6FE8B35F159BD1CACD60DA</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 = 540F41842CFA15D55F55280D42038B546367D978B5308533451537E87064A529555821A506A7E3B4C124F31B5C98EA680B90CB897F01559AA8F016784A5317D6C1921BF8A4A8AF1A0F68C67BD255EC109D64F816993D3D5482C4757E2D23F7DB5D836BCF6BDDE20403F0C1DCA32C085F64E3567BB89688A2F8FCC60886CCD68106BCF51CED5CFF6B988CD25A1FFB447677262C1CADFBD3DF40DBA762902220514E3C937EF6852D6C92792DCAE36F32E9A398A659AB22AEF8FAA588DC3C2E4CA73017C175A6F1FCA75FBDC9B44594D73A4E02F37D4D3FAC8F1A919920D9C2AD644305D6BD6E421C1ED7B0B9C7EF0B06C04133530664F9C0CFD7C77C905BC44536</code></pre>
|
|
|
|
|
<pre><code>g_b = 89EEA25E4698E4AA56CC3BBF4398CA8A8C46402A51ECF96CA737074047E0A835BE831839026ED65C714B74B113B258DFA74E472DB4B1A7C5AA41B369A361F92399B8D741BF4146593022CEA4E3E9DFE7900A5A2289BD8A546E586BF430E1411AFFA9C63C60AF79326F7D515B5FA4424BA06B67B4AD3DE23C8F4FC113079E030357BA3AA97A836C3A744C478CACAE1C62D795B6705972C816F18822699490D7F4A3C63BF6E3D43F370D405B075C2F333F1AEF1CA63BEDC373FD4C6509C837A65805BAE993B07F0CE563A8DE703389059245ACC381837821589EFC64439A225D7646DDE471D4D8167B9BF21A2B2AB06839CC595848B5D671BB78AA0C241A4B4AFC</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 C1 14 9F E5 F9 AE 1D E6 F9 70 7B F1
|
|
|
|
|
0010 | 87 27 3F E6 AE 0B D3 44 AD A9 1E A2 E6 CF DD 57
|
|
|
|
|
0020 | 46 53 37 E4 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 54 0F 41 84 2C FA 15 D5 5F 55 28 0D 42 03 8B 54
|
|
|
|
|
0040 | 63 67 D9 78 B5 30 85 33 45 15 37 E8 70 64 A5 29
|
|
|
|
|
0050 | 55 58 21 A5 06 A7 E3 B4 C1 24 F3 1B 5C 98 EA 68
|
|
|
|
|
0060 | 0B 90 CB 89 7F 01 55 9A A8 F0 16 78 4A 53 17 D6
|
|
|
|
|
0070 | C1 92 1B F8 A4 A8 AF 1A 0F 68 C6 7B D2 55 EC 10
|
|
|
|
|
0080 | 9D 64 F8 16 99 3D 3D 54 82 C4 75 7E 2D 23 F7 DB
|
|
|
|
|
0090 | 5D 83 6B CF 6B DD E2 04 03 F0 C1 DC A3 2C 08 5F
|
|
|
|
|
00A0 | 64 E3 56 7B B8 96 88 A2 F8 FC C6 08 86 CC D6 81
|
|
|
|
|
00B0 | 06 BC F5 1C ED 5C FF 6B 98 8C D2 5A 1F FB 44 76
|
|
|
|
|
00C0 | 77 26 2C 1C AD FB D3 DF 40 DB A7 62 90 22 20 51
|
|
|
|
|
00D0 | 4E 3C 93 7E F6 85 2D 6C 92 79 2D CA E3 6F 32 E9
|
|
|
|
|
00E0 | A3 98 A6 59 AB 22 AE F8 FA A5 88 DC 3C 2E 4C A7
|
|
|
|
|
00F0 | 30 17 C1 75 A6 F1 FC A7 5F BD C9 B4 45 94 D7 3A
|
|
|
|
|
0100 | 4E 02 F3 7D 4D 3F AC 8F 1A 91 99 20 D9 C2 AD 64
|
|
|
|
|
0110 | 43 05 D6 BD 6E 42 1C 1E D7 B0 B9 C7 EF 0B 06 C0
|
|
|
|
|
0120 | 41 33 53 06 64 F9 C0 CF D7 C7 7C 90 5B C4 45 36</code></pre>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 87 54 F2 3A B4 CF 8B 0A 3C 1A 5F 51
|
|
|
|
|
0010 | 8A B8 E7 94 71 35 4E 3E 4E 79 EA 40 FF 69 78 AC
|
|
|
|
|
0020 | 3E 15 77 69 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 89 EE A2 5E 46 98 E4 AA 56 CC 3B BF 43 98 CA 8A
|
|
|
|
|
0040 | 8C 46 40 2A 51 EC F9 6C A7 37 07 40 47 E0 A8 35
|
|
|
|
|
0050 | BE 83 18 39 02 6E D6 5C 71 4B 74 B1 13 B2 58 DF
|
|
|
|
|
0060 | A7 4E 47 2D B4 B1 A7 C5 AA 41 B3 69 A3 61 F9 23
|
|
|
|
|
0070 | 99 B8 D7 41 BF 41 46 59 30 22 CE A4 E3 E9 DF E7
|
|
|
|
|
0080 | 90 0A 5A 22 89 BD 8A 54 6E 58 6B F4 30 E1 41 1A
|
|
|
|
|
0090 | FF A9 C6 3C 60 AF 79 32 6F 7D 51 5B 5F A4 42 4B
|
|
|
|
|
00A0 | A0 6B 67 B4 AD 3D E2 3C 8F 4F C1 13 07 9E 03 03
|
|
|
|
|
00B0 | 57 BA 3A A9 7A 83 6C 3A 74 4C 47 8C AC AE 1C 62
|
|
|
|
|
00C0 | D7 95 B6 70 59 72 C8 16 F1 88 22 69 94 90 D7 F4
|
|
|
|
|
00D0 | A3 C6 3B F6 E3 D4 3F 37 0D 40 5B 07 5C 2F 33 3F
|
|
|
|
|
00E0 | 1A EF 1C A6 3B ED C3 73 FD 4C 65 09 C8 37 A6 58
|
|
|
|
|
00F0 | 05 BA E9 93 B0 7F 0C E5 63 A8 DE 70 33 89 05 92
|
|
|
|
|
0100 | 45 AC C3 81 83 78 21 58 9E FC 64 43 9A 22 5D 76
|
|
|
|
|
0110 | 46 DD E4 71 D4 D8 16 7B 9B F2 1A 2B 2A B0 68 39
|
|
|
|
|
0120 | CC 59 58 48 B5 D6 71 BB 78 AA 0C 24 1A 4B 4A FC</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 = BA0D89B5C1149FE5F9AE1DE6F9707BF187273FE6AE0BD344ADA91EA2E6CFDD57465337E
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>C1149FE5F9AE1DE6F9707BF187273FE6</code></td>
|
|
|
|
|
<td><code>8754F23AB4CF8B0A3C1A5F518AB8E794</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>AE0BD344ADA91EA2E6CFDD57465337E4</code></td>
|
|
|
|
|
<td><code>71354E3E4E79EA40FF6978AC3E157769</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE000100540F41842CFA15D55F55280D</code> <code>42038B546367D978B5308533451537E8</code> <code>7064A529555821A506A7E3B4C124F31B</code> <code>5C98EA680B90CB897F01559AA8F01678</code> <code>4A5317D6C1921BF8A4A8AF1A0F68C67B</code> <code>D255EC109D64F816993D3D5482C4757E</code> <code>2D23F7DB5D836BCF6BDDE20403F0C1DC</code> <code>A32C085F64E3567BB89688A2F8FCC608</code> <code>86CCD68106BCF51CED5CFF6B988CD25A</code> <code>1FFB447677262C1CADFBD3DF40DBA762</code> <code>902220514E3C937EF6852D6C92792DCA</code> <code>E36F32E9A398A659AB22AEF8FAA588DC</code> <code>3C2E4CA73017C175A6F1FCA75FBDC9B4</code> <code>4594D73A4E02F37D4D3FAC8F1A919920</code> <code>D9C2AD644305D6BD6E421C1ED7B0B9C7</code> <code>EF0B06C04133530664F9C0CFD7C77C90</code><br> <code>5BC44536</code></td>
|
|
|
|
|
<td><code>FE00010089EEA25E4698E4AA56CC3BBF</code> <code>4398CA8A8C46402A51ECF96CA7370740</code> <code>47E0A835BE831839026ED65C714B74B1</code> <code>13B258DFA74E472DB4B1A7C5AA41B369</code> <code>A361F92399B8D741BF4146593022CEA4</code> <code>E3E9DFE7900A5A2289BD8A546E586BF4</code> <code>30E1411AFFA9C63C60AF79326F7D515B</code> <code>5FA4424BA06B67B4AD3DE23C8F4FC113</code> <code>079E030357BA3AA97A836C3A744C478C</code> <code>ACAE1C62D795B6705972C816F1882269</code> <code>9490D7F4A3C63BF6E3D43F370D405B07</code> <code>5C2F333F1AEF1CA63BEDC373FD4C6509</code> <code>C837A65805BAE993B07F0CE563A8DE70</code> <code>3389059245ACC381837821589EFC6443</code> <code>9A225D7646DDE471D4D8167B9BF21A2B</code> <code>2AB06839CC595848B5D671BB78AA0C24</code><br> <code>1A4B4AFC</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 = BA0D89B5C1149FE5F9AE1DE6F9707BF187273FE6AE0BD344ADA91EA2E6CFDD57465337E
|
|
|
|
|
<!-- 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 = 54B64366C1149FE5F9AE1DE6F9707BF187273FE6AE0BD344ADA91EA2E6CFDD57465337E40000000000000000FE000100540F41842CFA15D55F55280D42038B546367D978B5308533451537E87064A529555821A506A7E3B4C124F31B5C98EA680B90CB897F01559AA8F016784A5317D6C1921BF8A4A8AF1A0F68C67BD255EC109D64F816993D3D5482C4757E2D23F7DB5D836BCF6BDDE20403F0C1DCA32C085F64E3567BB89688A2F8FCC60886CCD68106BCF51CED5CFF6B988CD25A1FFB447677262C1CADFBD3DF40DBA762902220514E3C937EF6852D6C92792DCAE36F32E9A398A659AB22AEF8FAA588DC3C2E4CA73017C175A6F1FCA75FBDC9B44594D73A4E02F37D4D3FAC8F1A919920D9C2AD644305D6BD6E421C1ED7B0B9C7EF0B06C04133530664F9C0CFD7C77C905BC44536
|
|
|
|
|
padding = B94DF620FF1C81E31C1DB4B1
|
|
|
|
|
tmp_aes_key = AAB528F14E8ECAD99290F5AC3CA8B323046841A628252C83652DDD78C02F4C8C
|
|
|
|
|
tmp_aes_iv = 87AC534B08733D154F4A15EF6B70605F622ED308764630B0C6DE2E4F81ED7CDB</code></pre>
|
|
|
|
|
<pre><code>data = 54B643668754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E1577690000000000000000FE00010089EEA25E4698E4AA56CC3BBF4398CA8A8C46402A51ECF96CA737074047E0A835BE831839026ED65C714B74B113B258DFA74E472DB4B1A7C5AA41B369A361F92399B8D741BF4146593022CEA4E3E9DFE7900A5A2289BD8A546E586BF430E1411AFFA9C63C60AF79326F7D515B5FA4424BA06B67B4AD3DE23C8F4FC113079E030357BA3AA97A836C3A744C478CACAE1C62D795B6705972C816F18822699490D7F4A3C63BF6E3D43F370D405B075C2F333F1AEF1CA63BEDC373FD4C6509C837A65805BAE993B07F0CE563A8DE703389059245ACC381837821589EFC64439A225D7646DDE471D4D8167B9BF21A2B2AB06839CC595848B5D671BB78AA0C241A4B4AFC
|
|
|
|
|
padding = BF530E565913D52672F80775
|
|
|
|
|
tmp_aes_key = 18BFF5E15D497FE20AE89092E2AF5E584F1274BC4BC69B1B5B963C844D43E90F
|
|
|
|
|
tmp_aes_iv = 14D91E3D5A21F5C5055DDD1E6FB9F9295FA21AFD94BD2DAB211D7BB40F0D2BE2</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 = 8754EE73F5E3BB3DC2AB18A45513DDD702754C66965FA712F2E3E87DC39E4554FDC8AB738A512601964247B45BFF72EB2C8C9907A24C0C4A74BB876602989F25BFF98B6A6665057048669B151642E77B36C7546EECB4AF944FCCD7281AA3543852FBC2DBCBB8392CCDBB0C436E5DB2097B912C5578367C498AA57BA8FBF9DE273646CD003488D43417FA1578EFC7253C991432400BA9F5A345669744EBD9D45CE1A14538CADE1375854EDF235B6DF8550CCCF387F250BFB457456AFA7BB435021B73D9583BB210242DA377C4E8875128D3A745CFCBDA7F79651879112788ECE2CF7238F091638250E3DC866D52F1BC648EA4C13AA42CC6CDE0796A7F90D7CED764A804C573271DE7070036ED7E8CFCFA38FC5B0EB113B6215E37E9A918AAC8BBB0E065C2A7C8D6C0912EFC9717327E0F299D2E19F8DBECE013FBAA41E6C7CD57A7661C0878CA6E712F84BA3E28867E2D</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 2AA22937AAEE091A898926996CD6AF9F50030F64766F53943B6C834779643971582012CD4AC08D29D3CF34C57E6B598469E4852173E0071237CF35207691567826987E8856CAC4485F04B87B50DF10C089C524CC25E3718BC20D8E661A61BBC888BB0EC244DF2C766B462453FC576820D6C0DC253FF1873DC20B70344C22E71A86AB9FBE5DDCDC25E2FD37EAC43E4CC6F89206D26103CA8D877776F9494D9D54473E7A1A7ED815633AD3107B27933759D7FD93868C96F4EE36A268547C1E36F016E331AA5E1F2EBDDC5D381F5149AAD73B37EA375030BF1E7E537C30AA7F4BC16B9E394A1EE14A39A2233F69F69E1177C298B5CFA8216A3DB2E09A7B98C3DE609D0ECA405796BBFBED9EDF4C8CC048957AAE7EF2634F25B2656DD6DA6E0B31246E78A44605FEEACE9296843DD86AA46290337B48F3058E989C443887664B3A9CC28A333C8031AB776D893C2A5B67D115</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 58 F3 06 00 49 E1 53 65
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 C1 14 9F E5 F9 AE 1D E6
|
|
|
|
|
0020 | F9 70 7B F1 87 27 3F E6 AE 0B D3 44 AD A9 1E A2
|
|
|
|
|
0030 | E6 CF DD 57 46 53 37 E4 FE 50 01 00 87 54 EE 73
|
|
|
|
|
0040 | F5 E3 BB 3D C2 AB 18 A4 55 13 DD D7 02 75 4C 66
|
|
|
|
|
0050 | 96 5F A7 12 F2 E3 E8 7D C3 9E 45 54 FD C8 AB 73
|
|
|
|
|
0060 | 8A 51 26 01 96 42 47 B4 5B FF 72 EB 2C 8C 99 07
|
|
|
|
|
0070 | A2 4C 0C 4A 74 BB 87 66 02 98 9F 25 BF F9 8B 6A
|
|
|
|
|
0080 | 66 65 05 70 48 66 9B 15 16 42 E7 7B 36 C7 54 6E
|
|
|
|
|
0090 | EC B4 AF 94 4F CC D7 28 1A A3 54 38 52 FB C2 DB
|
|
|
|
|
00A0 | CB B8 39 2C CD BB 0C 43 6E 5D B2 09 7B 91 2C 55
|
|
|
|
|
00B0 | 78 36 7C 49 8A A5 7B A8 FB F9 DE 27 36 46 CD 00
|
|
|
|
|
00C0 | 34 88 D4 34 17 FA 15 78 EF C7 25 3C 99 14 32 40
|
|
|
|
|
00D0 | 0B A9 F5 A3 45 66 97 44 EB D9 D4 5C E1 A1 45 38
|
|
|
|
|
00E0 | CA DE 13 75 85 4E DF 23 5B 6D F8 55 0C CC F3 87
|
|
|
|
|
00F0 | F2 50 BF B4 57 45 6A FA 7B B4 35 02 1B 73 D9 58
|
|
|
|
|
0100 | 3B B2 10 24 2D A3 77 C4 E8 87 51 28 D3 A7 45 CF
|
|
|
|
|
0110 | CB DA 7F 79 65 18 79 11 27 88 EC E2 CF 72 38 F0
|
|
|
|
|
0120 | 91 63 82 50 E3 DC 86 6D 52 F1 BC 64 8E A4 C1 3A
|
|
|
|
|
0130 | A4 2C C6 CD E0 79 6A 7F 90 D7 CE D7 64 A8 04 C5
|
|
|
|
|
0140 | 73 27 1D E7 07 00 36 ED 7E 8C FC FA 38 FC 5B 0E
|
|
|
|
|
0150 | B1 13 B6 21 5E 37 E9 A9 18 AA C8 BB B0 E0 65 C2
|
|
|
|
|
0160 | A7 C8 D6 C0 91 2E FC 97 17 32 7E 0F 29 9D 2E 19
|
|
|
|
|
0170 | F8 DB EC E0 13 FB AA 41 E6 C7 CD 57 A7 66 1C 08
|
|
|
|
|
0180 | 78 CA 6E 71 2F 84 BA 3E 28 86 7E 2D</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 70 CC 03 00 A7 E3 53 65
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 87 54 F2 3A B4 CF 8B 0A
|
|
|
|
|
0020 | 3C 1A 5F 51 8A B8 E7 94 71 35 4E 3E 4E 79 EA 40
|
|
|
|
|
0030 | FF 69 78 AC 3E 15 77 69 FE 50 01 00 2A A2 29 37
|
|
|
|
|
0040 | AA EE 09 1A 89 89 26 99 6C D6 AF 9F 50 03 0F 64
|
|
|
|
|
0050 | 76 6F 53 94 3B 6C 83 47 79 64 39 71 58 20 12 CD
|
|
|
|
|
0060 | 4A C0 8D 29 D3 CF 34 C5 7E 6B 59 84 69 E4 85 21
|
|
|
|
|
0070 | 73 E0 07 12 37 CF 35 20 76 91 56 78 26 98 7E 88
|
|
|
|
|
0080 | 56 CA C4 48 5F 04 B8 7B 50 DF 10 C0 89 C5 24 CC
|
|
|
|
|
0090 | 25 E3 71 8B C2 0D 8E 66 1A 61 BB C8 88 BB 0E C2
|
|
|
|
|
00A0 | 44 DF 2C 76 6B 46 24 53 FC 57 68 20 D6 C0 DC 25
|
|
|
|
|
00B0 | 3F F1 87 3D C2 0B 70 34 4C 22 E7 1A 86 AB 9F BE
|
|
|
|
|
00C0 | 5D DC DC 25 E2 FD 37 EA C4 3E 4C C6 F8 92 06 D2
|
|
|
|
|
00D0 | 61 03 CA 8D 87 77 76 F9 49 4D 9D 54 47 3E 7A 1A
|
|
|
|
|
00E0 | 7E D8 15 63 3A D3 10 7B 27 93 37 59 D7 FD 93 86
|
|
|
|
|
00F0 | 8C 96 F4 EE 36 A2 68 54 7C 1E 36 F0 16 E3 31 AA
|
|
|
|
|
0100 | 5E 1F 2E BD DC 5D 38 1F 51 49 AA D7 3B 37 EA 37
|
|
|
|
|
0110 | 50 30 BF 1E 7E 53 7C 30 AA 7F 4B C1 6B 9E 39 4A
|
|
|
|
|
0120 | 1E E1 4A 39 A2 23 3F 69 F6 9E 11 77 C2 98 B5 CF
|
|
|
|
|
0130 | A8 21 6A 3D B2 E0 9A 7B 98 C3 DE 60 9D 0E CA 40
|
|
|
|
|
0140 | 57 96 BB FB ED 9E DF 4C 8C C0 48 95 7A AE 7E F2
|
|
|
|
|
0150 | 63 4F 25 B2 65 6D D6 DA 6E 0B 31 24 6E 78 A4 46
|
|
|
|
|
0160 | 05 FE EA CE 92 96 84 3D D8 6A A4 62 90 33 7B 48
|
|
|
|
|
0170 | F3 05 8E 98 9C 44 38 87 66 4B 3A 9C C2 8A 33 3C
|
|
|
|
|
0180 | 80 31 AB 77 6D 89 3C 2A 5B 67 D1 15</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>58F3060049E15365</code></td>
|
|
|
|
|
<td><code>70CC0300A7E35365</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>C1149FE5F9AE1DE6F9707BF187273FE6</code></td>
|
|
|
|
|
<td><code>8754F23AB4CF8B0A3C1A5F518AB8E794</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>AE0BD344ADA91EA2E6CFDD57465337E4</code></td>
|
|
|
|
|
<td><code>71354E3E4E79EA40FF6978AC3E157769</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE5001008754EE73F5E3BB3DC2AB18A4</code> <code>5513DDD702754C66965FA712F2E3E87D</code> <code>C39E4554FDC8AB738A512601964247B4</code> <code>5BFF72EB2C8C9907A24C0C4A74BB8766</code> <code>02989F25BFF98B6A6665057048669B15</code> <code>1642E77B36C7546EECB4AF944FCCD728</code> <code>1AA3543852FBC2DBCBB8392CCDBB0C43</code> <code>6E5DB2097B912C5578367C498AA57BA8</code> <code>FBF9DE273646CD003488D43417FA1578</code> <code>EFC7253C991432400BA9F5A345669744</code> <code>EBD9D45CE1A14538CADE1375854EDF23</code> <code>5B6DF8550CCCF387F250BFB457456AFA</code> <code>7BB435021B73D9583BB210242DA377C4</code> <code>E8875128D3A745CFCBDA7F7965187911</code> <code>2788ECE2CF7238F091638250E3DC866D</code> <code>52F1BC648EA4C13AA42CC6CDE0796A7F</code> <code>90D7CED764A804C573271DE7070036ED</code> <code>7E8CFCFA38FC5B0EB113B6215E37E9A9</code> <code>18AAC8BBB0E065C2A7C8D6C0912EFC97</code> <code>17327E0F299D2E19F8DBECE013FBAA41</code> <code>E6C7CD57A7661C0878CA6E712F84BA3E</code><br> <code>28867E2D</code></td>
|
|
|
|
|
<td><code>FE5001002AA22937AAEE091A89892699</code> <code>6CD6AF9F50030F64766F53943B6C8347</code> <code>79643971582012CD4AC08D29D3CF34C5</code> <code>7E6B598469E4852173E0071237CF3520</code> <code>7691567826987E8856CAC4485F04B87B</code> <code>50DF10C089C524CC25E3718BC20D8E66</code> <code>1A61BBC888BB0EC244DF2C766B462453</code> <code>FC576820D6C0DC253FF1873DC20B7034</code> <code>4C22E71A86AB9FBE5DDCDC25E2FD37EA</code> <code>C43E4CC6F89206D26103CA8D877776F9</code> <code>494D9D54473E7A1A7ED815633AD3107B</code> <code>27933759D7FD93868C96F4EE36A26854</code> <code>7C1E36F016E331AA5E1F2EBDDC5D381F</code> <code>5149AAD73B37EA375030BF1E7E537C30</code> <code>AA7F4BC16B9E394A1EE14A39A2233F69</code> <code>F69E1177C298B5CFA8216A3DB2E09A7B</code> <code>98C3DE609D0ECA405796BBFBED9EDF4C</code> <code>8CC048957AAE7EF2634F25B2656DD6DA</code> <code>6E0B31246E78A44605FEEACE9296843D</code> <code>D86AA46290337B48F3058E989C443887</code> <code>664B3A9CC28A333C8031AB776D893C2A</code><br> <code>5B67D115</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 = 2515112E2E96F7875445D5392ECC5C0A6BD132BB670689F8E1A7868BD66098C71AB5E5ADE9837840E70C641FD8C6C6509D60D2444B570BE02429CA2FF4E71DC0DEBBEBDA8BEF55B4803138CA2252F67C7F0037A9BC527B09D04D6A92C537B48D4FC1FA6800A0F5B29B418A2837EEAED7F737CF5AFE5F30EE083D1128C0B07EB27192521DBE3A4DC7787AB9F6D5B97DEA3EDA83C2D6CEBAF7BDED24A2B3C86AFF6302910CC41D18E4CDD38B1E80A51390ED997A3636CA925940835DBD0EEA2C3591E4B070F22BC994802130DBAC1B1841BF8551B449A79CA44AFD0B802CA9CF1A1562E3A107164A6209893972B64370F0F8FDF6FB4B4A96EE2EB420CF4C268645</code></pre>
|
|
|
|
|
<pre><code>auth_key = 2814F03C98D79F97E37918AA54005773E19CF04FA1DEDF6CEF5A28B649CB335AA5C899A91EA062083CC0755E26F6AED4878C7E55CE33C8DFDC9F9A5729BD0B256BDDC6F5A568A709CB2E1ECB5DF262CC552AFF9DA9114C9EB01BAAC2A640CB801EE4630BCD5AD80983641B9911B0511958373DF15DFE156D6FA4991CCECBB01C42C10AAC4801F2DFF1725BA2A582388940D45958F742B0FF09CFE60BEB0971B1BF8CCD438A8F1BB77B2DD8A7325133C890B9905625404DB5A34B6838E6DBD001DEA92F6C9010A8AFC37888038D4DA8A3476E129ED2948ECE2A394943BA060CBA4BD790D6219CCE39547E49BD7920FA79C53D3530CDFE24875C6ECD300D1D5020</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 2C 10 51 49 E1 53 65
|
|
|
|
|
0010 | A0 00 00 00 34 F7 CB 3B C1 14 9F E5 F9 AE 1D E6
|
|
|
|
|
0020 | F9 70 7B F1 87 27 3F E6 AE 0B D3 44 AD A9 1E A2
|
|
|
|
|
0030 | E6 CF DD 57 46 53 37 E4 1C D4 E4 26 F1 55 06 E1
|
|
|
|
|
0040 | 5A 63 BB 3F D5 C1 AE 5A</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 E0 C4 5B A8 E3 53 65
|
|
|
|
|
0010 | 38 00 00 00 34 F7 CB 3B 87 54 F2 3A B4 CF 8B 0A
|
|
|
|
|
0020 | 3C 1A 5F 51 8A B8 E7 94 71 35 4E 3E 4E 79 EA 40
|
|
|
|
|
0030 | FF 69 78 AC 3E 15 77 69 16 C8 ED 7B 97 0A 71 7A
|
|
|
|
|
0040 | F6 E4 86 DB 8C 8D 3A C4</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>012C105149E15365</code></td>
|
|
|
|
|
<td><code>01E0C45BA8E35365</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>A0000000</code> (160 in decimal)</td>
|
|
|
|
|
<td><code>38000000</code> (56 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>C1149FE5F9AE1DE6F9707BF187273FE6</code></td>
|
|
|
|
|
<td><code>8754F23AB4CF8B0A3C1A5F518AB8E794</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>AE0BD344ADA91EA2E6CFDD57465337E4</code></td>
|
|
|
|
|
<td><code>71354E3E4E79EA40FF6978AC3E157769</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>1CD4E426F15506E15A63BB3FD5C1AE5A</code></td>
|
|
|
|
|
<td><code>16C8ED7B970A717AF6E486DB8C8D3AC4</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>
|
|
|
|
|