|
|
|
@ -53,9 +53,9 @@
|
|
|
|
|
<h5><a class="anchor" href="#1-client-sends-query-to-server" id="1-client-sends-query-to-server" name="1-client-sends-query-to-server"><i class="anchor-icon"></i></a>1) Client sends query to server</h5>
|
|
|
|
|
<!-- start req_pq_multi -->
|
|
|
|
|
<p>Sent payload (excluding transport headers/trailers):</p>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 D0 C8 05 00 83 62 AF 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 9A 35 B3 4B AD 37 DF 53
|
|
|
|
|
0020 | 8D 3F E4 B7 DC 8C 94 D7</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 54 C9 0D 00 3B 7B AF 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 0C 8B 97 29 D1 0E 24 DA
|
|
|
|
|
0020 | 2E 2A 82 94 7D 87 A7 02</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>D0C805008362AF66</code></td>
|
|
|
|
|
<td><code>54C90D003B7BAF66</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>9A35B34BAD37DF538D3FE4B7DC8C94D7</code></td>
|
|
|
|
|
<td><code>0C8B9729D10E24DA2E2A82947D87A702</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 D8 2A D9 83 62 AF 66
|
|
|
|
|
0010 | 88 00 00 00 63 24 16 05 9A 35 B3 4B AD 37 DF 53
|
|
|
|
|
0020 | 8D 3F E4 B7 DC 8C 94 D7 FC F3 12 95 0D 42 D9 8F
|
|
|
|
|
0030 | 97 8F 0D F9 3C CE CD 0D 08 16 52 EC 42 45 C3 94
|
|
|
|
|
0040 | 17 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 BC 2E 40 3B 7B AF 66
|
|
|
|
|
0010 | A4 00 00 00 63 24 16 05 0C 8B 97 29 D1 0E 24 DA
|
|
|
|
|
0020 | 2E 2A 82 94 7D 87 A7 02 8F 79 03 D9 A0 6A B5 40
|
|
|
|
|
0030 | 65 EF 6D 1F FD 21 3F 95 08 18 84 0B CB 33 E3 FF
|
|
|
|
|
0040 | D7 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>01D82AD98362AF66</code></td>
|
|
|
|
|
<td><code>01BC2E403B7BAF66</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>88000000</code> (136 in decimal)</td>
|
|
|
|
|
<td><code>A4000000</code> (164 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>9A35B34BAD37DF538D3FE4B7DC8C94D7</code></td>
|
|
|
|
|
<td><code>0C8B9729D10E24DA2E2A82947D87A702</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>FCF312950D42D98F978F0DF93CCECD0D</code></td>
|
|
|
|
|
<td><code>8F7903D9A06AB54065EF6D1FFD213F95</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>081652EC4245C39417000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1608607786307130391</td>
|
|
|
|
|
<td><code>0818840BCB33E3FFD7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1766549921212923863</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 = 1608607786307130391</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1608607786307130391 = 1026890237 * 1566484643</code></p>
|
|
|
|
|
<pre><code>p = 1026890237
|
|
|
|
|
q = 1566484643</code></pre>
|
|
|
|
|
<pre><code>pq = 1766549921212923863</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1766549921212923863 = 1298143453 * 1360827971</code></p>
|
|
|
|
|
<pre><code>p = 1298143453
|
|
|
|
|
q = 1360827971</code></pre>
|
|
|
|
|
<!-- end pq -->
|
|
|
|
|
<h4><a class="anchor" href="#presenting-proof-of-work-server-authentication" id="presenting-proof-of-work-server-authentication" name="presenting-proof-of-work-server-authentication"><i class="anchor-icon"></i></a>Presenting proof of work; Server authentication</h4>
|
|
|
|
|
<h5><a class="anchor" href="#4-encrypted-data-payload-generation" id="4-encrypted-data-payload-generation" name="4-encrypted-data-payload-generation"><i class="anchor-icon"></i></a>4) <code>encrypted_data</code> payload generation</h5>
|
|
|
|
|
<p>First of all, generate an <code>encrypted_data</code> payload as follows:</p>
|
|
|
|
|
<!-- start p_q_inner_data_dc -->
|
|
|
|
|
<p>Generated payload (excluding transport headers/trailers):</p>
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 16 52 EC 42 45 C3 94 17 00 00 00
|
|
|
|
|
0010 | 04 3D 35 19 FD 00 00 00 04 5D 5E A8 A3 00 00 00
|
|
|
|
|
0020 | 9A 35 B3 4B AD 37 DF 53 8D 3F E4 B7 DC 8C 94 D7
|
|
|
|
|
0030 | FC F3 12 95 0D 42 D9 8F 97 8F 0D F9 3C CE CD 0D
|
|
|
|
|
0040 | 64 DE E6 08 6B D1 2D 2F 2F 98 BD 03 BA 95 2F 73
|
|
|
|
|
0050 | 17 64 D2 DA BE 11 15 9D 7F 79 DE 4F 20 7E 90 95
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 18 84 0B CB 33 E3 FF D7 00 00 00
|
|
|
|
|
0010 | 04 4D 60 18 DD 00 00 00 04 51 1C 96 43 00 00 00
|
|
|
|
|
0020 | 0C 8B 97 29 D1 0E 24 DA 2E 2A 82 94 7D 87 A7 02
|
|
|
|
|
0030 | 8F 79 03 D9 A0 6A B5 40 65 EF 6D 1F FD 21 3F 95
|
|
|
|
|
0040 | DB DA 0F 9B 25 8D FE 56 B7 D1 96 7B 66 70 06 2D
|
|
|
|
|
0050 | 35 DF D8 B6 83 80 19 2D 4B 50 59 F5 D4 9B 11 47
|
|
|
|
|
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 = 1566484643</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>081652EC4245C39417000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1608607786307130391</td>
|
|
|
|
|
<td><code>0818840BCB33E3FFD7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1766549921212923863</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>043D3519FD000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1026890237</td>
|
|
|
|
|
<td><code>044D6018DD000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1298143453</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>045D5EA8A3000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1566484643</td>
|
|
|
|
|
<td><code>04511C9643000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1360827971</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>9A35B34BAD37DF538D3FE4B7DC8C94D7</code></td>
|
|
|
|
|
<td><code>0C8B9729D10E24DA2E2A82947D87A702</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>FCF312950D42D98F978F0DF93CCECD0D</code></td>
|
|
|
|
|
<td><code>8F7903D9A06AB54065EF6D1FFD213F95</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>64DEE6086BD12D2F2F98BD03BA952F73</code> <code>1764D2DABE11159D7F79DE4F207E9095</code></td>
|
|
|
|
|
<td><code>DBDA0F9B258DFE56B7D1967B6670062D</code> <code>35DFD8B68380192D4B5059F5D49B1147</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1566484643</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 = 955FF5A9081652EC4245C39417000000043D3519FD000000045D5EA8A30000009A35B34BAD37DF538D3FE4B7DC8C94D7FCF312950D42D98F978F0DF93CCECD0D64DEE6086BD12D2F2F98BD03BA952F731764D2DABE11159D7F79DE4F207E909502000000
|
|
|
|
|
random_padding_bytes = 8A67E36645FBD128F8E52F34286EF152CB04D2F5D331C9F12258B89097D5D09A37D9100D0111B5150284DA53304C37B2474F3770FF6D35CA6AB70457C2EB908CE6713F6996CA19390DDFC09BEE1F52B55A695C124AFDE6AD132A3114</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A90818840BCB33E3FFD7000000044D6018DD00000004511C96430000000C8B9729D10E24DA2E2A82947D87A7028F7903D9A06AB54065EF6D1FFD213F95DBDA0F9B258DFE56B7D1967B6670062D35DFD8B68380192D4B5059F5D49B114702000000
|
|
|
|
|
random_padding_bytes = 932F1C1F619879E98806B58070A983803E31F2B52D31BF331758962DE487AF5996B1E3BABE7B66DE8822D5B551EF5D53E4A70631EE8C075E2AFE7FACB88832753F42E5C7ECDC3F5C1399EAEF417443D0760EC6BF66BAFB055C8703AD</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 = 0F998343F41D78FA23AD6BA99DDF7C1912501694F4D9C8FD74841C5CA825621ED1BF7C57567FC5BAA8476FAD07F5481C40D531BECFC52FEDD440099249C37B3BF81750F1D99A7B348449067C5C74D7B05D4BDBFD80ABB830036D32B23E57B3AFA22E3A423DE9DE638815956A8DB44D695DA8413C004BF7179404713C473A8C6BEEDFB8E5A58A185E2FE13EC0103936D752518E0290F080A20B3C03D067F026BEAF64010EAC9A69AD9744231F96BD8D73C2A7431C65BB7CC1A8312366BE6A45A943DDF0DBE99DB2B980373500F1738F0B1D63CA1195071CA4ABADFFA20F239B81387FCB54BE197075FE4D7CD0A706A91B226A12E2FB5EAA9D401375E2CF4800C1</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 09DDE14D47A66368DDB052A21A93F5CA7E32B0A9D197CB0539859419561612F4DDC777E700177085E3BD8022ED822479333EDBEB8F358FCF05857710F5F8D2787C36E1680AA8724D23D98CB492880B01277FC59E458887E4B0D41FB45CAE9C191D4887C37FC8294B9ED3C1EE8C6A591FA14F23DFC7D0A111DC2578E61F346813C7283D870B4BF0D6C9D023E9AC364E041E70F42EEEA390BC0E5E12982BD289F0D27F932A4D90FD712A636B2D5A2F7DA33EF0E20964445D5C28589383CFF0AD6E6867A45CD7D2C8458C28586D1C44AC6BB04F5D5ED03327D0CB4BF0671AE5B95CF108D5ADB9D89FF456F5FB5B57D68F48D4776655FFA6FAA1EE77A87220775D01</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 CC BA 07 00 83 62 AF 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 9A 35 B3 4B AD 37 DF 53
|
|
|
|
|
0020 | 8D 3F E4 B7 DC 8C 94 D7 FC F3 12 95 0D 42 D9 8F
|
|
|
|
|
0030 | 97 8F 0D F9 3C CE CD 0D 04 3D 35 19 FD 00 00 00
|
|
|
|
|
0040 | 04 5D 5E A8 A3 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 0F 99 83 43 F4 1D 78 FA 23 AD 6B A9
|
|
|
|
|
0060 | 9D DF 7C 19 12 50 16 94 F4 D9 C8 FD 74 84 1C 5C
|
|
|
|
|
0070 | A8 25 62 1E D1 BF 7C 57 56 7F C5 BA A8 47 6F AD
|
|
|
|
|
0080 | 07 F5 48 1C 40 D5 31 BE CF C5 2F ED D4 40 09 92
|
|
|
|
|
0090 | 49 C3 7B 3B F8 17 50 F1 D9 9A 7B 34 84 49 06 7C
|
|
|
|
|
00A0 | 5C 74 D7 B0 5D 4B DB FD 80 AB B8 30 03 6D 32 B2
|
|
|
|
|
00B0 | 3E 57 B3 AF A2 2E 3A 42 3D E9 DE 63 88 15 95 6A
|
|
|
|
|
00C0 | 8D B4 4D 69 5D A8 41 3C 00 4B F7 17 94 04 71 3C
|
|
|
|
|
00D0 | 47 3A 8C 6B EE DF B8 E5 A5 8A 18 5E 2F E1 3E C0
|
|
|
|
|
00E0 | 10 39 36 D7 52 51 8E 02 90 F0 80 A2 0B 3C 03 D0
|
|
|
|
|
00F0 | 67 F0 26 BE AF 64 01 0E AC 9A 69 AD 97 44 23 1F
|
|
|
|
|
0100 | 96 BD 8D 73 C2 A7 43 1C 65 BB 7C C1 A8 31 23 66
|
|
|
|
|
0110 | BE 6A 45 A9 43 DD F0 DB E9 9D B2 B9 80 37 35 00
|
|
|
|
|
0120 | F1 73 8F 0B 1D 63 CA 11 95 07 1C A4 AB AD FF A2
|
|
|
|
|
0130 | 0F 23 9B 81 38 7F CB 54 BE 19 70 75 FE 4D 7C D0
|
|
|
|
|
0140 | A7 06 A9 1B 22 6A 12 E2 FB 5E AA 9D 40 13 75 E2
|
|
|
|
|
0150 | CF 48 00 C1</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 58 C9 0D 00 3B 7B AF 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 0C 8B 97 29 D1 0E 24 DA
|
|
|
|
|
0020 | 2E 2A 82 94 7D 87 A7 02 8F 79 03 D9 A0 6A B5 40
|
|
|
|
|
0030 | 65 EF 6D 1F FD 21 3F 95 04 4D 60 18 DD 00 00 00
|
|
|
|
|
0040 | 04 51 1C 96 43 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 09 DD E1 4D 47 A6 63 68 DD B0 52 A2
|
|
|
|
|
0060 | 1A 93 F5 CA 7E 32 B0 A9 D1 97 CB 05 39 85 94 19
|
|
|
|
|
0070 | 56 16 12 F4 DD C7 77 E7 00 17 70 85 E3 BD 80 22
|
|
|
|
|
0080 | ED 82 24 79 33 3E DB EB 8F 35 8F CF 05 85 77 10
|
|
|
|
|
0090 | F5 F8 D2 78 7C 36 E1 68 0A A8 72 4D 23 D9 8C B4
|
|
|
|
|
00A0 | 92 88 0B 01 27 7F C5 9E 45 88 87 E4 B0 D4 1F B4
|
|
|
|
|
00B0 | 5C AE 9C 19 1D 48 87 C3 7F C8 29 4B 9E D3 C1 EE
|
|
|
|
|
00C0 | 8C 6A 59 1F A1 4F 23 DF C7 D0 A1 11 DC 25 78 E6
|
|
|
|
|
00D0 | 1F 34 68 13 C7 28 3D 87 0B 4B F0 D6 C9 D0 23 E9
|
|
|
|
|
00E0 | AC 36 4E 04 1E 70 F4 2E EE A3 90 BC 0E 5E 12 98
|
|
|
|
|
00F0 | 2B D2 89 F0 D2 7F 93 2A 4D 90 FD 71 2A 63 6B 2D
|
|
|
|
|
0100 | 5A 2F 7D A3 3E F0 E2 09 64 44 5D 5C 28 58 93 83
|
|
|
|
|
0110 | CF F0 AD 6E 68 67 A4 5C D7 D2 C8 45 8C 28 58 6D
|
|
|
|
|
0120 | 1C 44 AC 6B B0 4F 5D 5E D0 33 27 D0 CB 4B F0 67
|
|
|
|
|
0130 | 1A E5 B9 5C F1 08 D5 AD B9 D8 9F F4 56 F5 FB 5B
|
|
|
|
|
0140 | 57 D6 8F 48 D4 77 66 55 FF A6 FA A1 EE 77 A8 72
|
|
|
|
|
0150 | 20 77 5D 01</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 = 8A67E36645FBD128F8E52F34286EF152CB04D2F5D331C9F12258B8909
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>CCBA07008362AF66</code></td>
|
|
|
|
|
<td><code>58C90D003B7BAF66</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 = 8A67E36645FBD128F8E52F34286EF152CB04D2F5D331C9F12258B8909
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>9A35B34BAD37DF538D3FE4B7DC8C94D7</code></td>
|
|
|
|
|
<td><code>0C8B9729D10E24DA2E2A82947D87A702</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>FCF312950D42D98F978F0DF93CCECD0D</code></td>
|
|
|
|
|
<td><code>8F7903D9A06AB54065EF6D1FFD213F95</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>043D3519FD000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1026890237</td>
|
|
|
|
|
<td><code>044D6018DD000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1298143453</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>045D5EA8A3000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1566484643</td>
|
|
|
|
|
<td><code>04511C9643000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1360827971</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 = 8A67E36645FBD128F8E52F34286EF152CB04D2F5D331C9F12258B8909
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE0001000F998343F41D78FA23AD6BA9</code> <code>9DDF7C1912501694F4D9C8FD74841C5C</code> <code>A825621ED1BF7C57567FC5BAA8476FAD</code> <code>07F5481C40D531BECFC52FEDD4400992</code> <code>49C37B3BF81750F1D99A7B348449067C</code> <code>5C74D7B05D4BDBFD80ABB830036D32B2</code> <code>3E57B3AFA22E3A423DE9DE638815956A</code> <code>8DB44D695DA8413C004BF7179404713C</code> <code>473A8C6BEEDFB8E5A58A185E2FE13EC0</code> <code>103936D752518E0290F080A20B3C03D0</code> <code>67F026BEAF64010EAC9A69AD9744231F</code> <code>96BD8D73C2A7431C65BB7CC1A8312366</code> <code>BE6A45A943DDF0DBE99DB2B980373500</code> <code>F1738F0B1D63CA1195071CA4ABADFFA2</code> <code>0F239B81387FCB54BE197075FE4D7CD0</code> <code>A706A91B226A12E2FB5EAA9D401375E2</code><br> <code>CF4800C1</code></td>
|
|
|
|
|
<td><code>FE00010009DDE14D47A66368DDB052A2</code> <code>1A93F5CA7E32B0A9D197CB0539859419</code> <code>561612F4DDC777E700177085E3BD8022</code> <code>ED822479333EDBEB8F358FCF05857710</code> <code>F5F8D2787C36E1680AA8724D23D98CB4</code> <code>92880B01277FC59E458887E4B0D41FB4</code> <code>5CAE9C191D4887C37FC8294B9ED3C1EE</code> <code>8C6A591FA14F23DFC7D0A111DC2578E6</code> <code>1F346813C7283D870B4BF0D6C9D023E9</code> <code>AC364E041E70F42EEEA390BC0E5E1298</code> <code>2BD289F0D27F932A4D90FD712A636B2D</code> <code>5A2F7DA33EF0E20964445D5C28589383</code> <code>CFF0AD6E6867A45CD7D2C8458C28586D</code> <code>1C44AC6BB04F5D5ED03327D0CB4BF067</code> <code>1AE5B95CF108D5ADB9D89FF456F5FB5B</code> <code>57D68F48D4776655FFA6FAA1EE77A872</code><br> <code>20775D01</code></td>
|
|
|
|
|
<td>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = 8A67E36645FBD128F8E52F34286EF152CB04D2F5D331C9F12258B8909
|
|
|
|
|
<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 2C D4 80 84 62 AF 66
|
|
|
|
|
0010 | B0 02 00 00 5C 07 E8 D0 9A 35 B3 4B AD 37 DF 53
|
|
|
|
|
0020 | 8D 3F E4 B7 DC 8C 94 D7 FC F3 12 95 0D 42 D9 8F
|
|
|
|
|
0030 | 97 8F 0D F9 3C CE CD 0D FE 50 02 00 76 59 D3 CA
|
|
|
|
|
0040 | ED AC 06 88 21 96 6A 4E 0F AC 9A F2 47 6E 26 85
|
|
|
|
|
0050 | 58 04 6D ED 9D 77 5B 41 E5 54 9E 34 1E A2 FB E9
|
|
|
|
|
0060 | 06 D8 F6 A9 FF CE E5 F7 F9 3E 2C AF D4 9D 0F 3E
|
|
|
|
|
0070 | A7 F8 0C A5 99 B9 05 9B 06 3D 1F D2 E8 0A 03 2E
|
|
|
|
|
0080 | 19 4F D3 85 E0 3D 49 7A 41 0E B0 8A E6 91 72 AC
|
|
|
|
|
0090 | 3E 30 81 D3 4D 4E E0 BD BC C1 A6 01 2C 74 65 42
|
|
|
|
|
00A0 | EF 08 A2 08 1B 3C A9 BC 7B 59 A1 CD 2C AC DD 4A
|
|
|
|
|
00B0 | 50 97 3E D0 4E A6 12 28 FA E5 1B 86 A6 73 69 1E
|
|
|
|
|
00C0 | 50 D2 99 3B 51 B9 8E 5C 93 55 C1 F6 30 28 87 C6
|
|
|
|
|
00D0 | 48 FD A6 1F B4 1D 77 29 16 C6 02 E2 BB 9A 3F 31
|
|
|
|
|
00E0 | A9 9B D0 54 53 69 F5 FB 60 DB BA B0 64 1E 30 48
|
|
|
|
|
00F0 | C6 88 11 FB C1 8D A9 14 AE AF 26 30 AC 40 FC 0A
|
|
|
|
|
0100 | 89 30 86 75 BA 8E 97 D0 9D 5D D9 22 1A E5 76 05
|
|
|
|
|
0110 | 88 78 F5 9F EA 77 5D B7 FA 7A 63 0C 17 01 62 FE
|
|
|
|
|
0120 | F2 53 FC 7B DA 3A EB 8A AE 08 77 86 CF 44 13 42
|
|
|
|
|
0130 | 91 01 9E 65 0A 2A C9 B8 B4 9B D7 F0 C5 B8 2B 39
|
|
|
|
|
0140 | 52 B5 1F 47 9A 97 38 37 DE F2 CA 9F 54 29 E6 47
|
|
|
|
|
0150 | F0 AA 67 9C CC 17 3A CE 58 CC ED 56 9F 81 56 9B
|
|
|
|
|
0160 | 91 24 F8 D0 68 DC AF 37 36 DD E3 B1 63 22 49 27
|
|
|
|
|
0170 | 66 7D CE 1E BE 62 38 2B 60 B0 54 CD 05 CD 2E 63
|
|
|
|
|
0180 | 79 BA DD 5B 0E 26 82 8E F6 51 06 6B 0E 4D A8 64
|
|
|
|
|
0190 | EE F0 CC 81 28 21 49 0F 24 E1 26 6E AB 83 1C F4
|
|
|
|
|
01A0 | 92 CD 63 29 36 CD 37 DA 3C 09 F5 C3 0D 0E 0A 3F
|
|
|
|
|
01B0 | 91 3D 27 E6 B9 55 F9 52 19 B4 24 B1 E7 52 83 FB
|
|
|
|
|
01C0 | 75 7F 05 41 09 E8 50 FD 1D B9 71 0A 25 3B 2F 76
|
|
|
|
|
01D0 | 97 9E D4 8C 67 D8 2A E2 CD DC 85 3D 32 E4 15 9A
|
|
|
|
|
01E0 | A2 D1 94 0E 64 47 B1 EE 3D 82 7D CD 96 8A C7 8B
|
|
|
|
|
01F0 | 30 16 54 AD 77 3F FE 52 7B 27 E1 3B E3 D4 AE 65
|
|
|
|
|
0200 | 19 7A 70 9A 3A B5 EC 52 28 DB FB DF 6A 7A 77 60
|
|
|
|
|
0210 | 34 DB 76 01 6C 12 5D F5 5E FB A7 CA F1 C3 0B 1D
|
|
|
|
|
0220 | 6A 83 21 26 B6 82 99 D2 72 47 AB F6 8F D4 E8 E8
|
|
|
|
|
0230 | CE 1E 47 A3 AA 95 5B 4E C1 9A 78 F3 26 48 34 0B
|
|
|
|
|
0240 | 5A 30 59 88 66 CA C8 50 27 77 46 03 D1 FD FB 40
|
|
|
|
|
0250 | 95 9F 34 3B 1B 83 65 46 5E B9 68 4F F7 15 47 2C
|
|
|
|
|
0260 | FC 93 55 20 D1 F4 D2 CE 86 1B 5C CD 98 F6 92 D4
|
|
|
|
|
0270 | B2 E9 FD F7 6B 11 DC 78 C6 59 A7 54 C7 F1 EF 32
|
|
|
|
|
0280 | 3A 76 DF 25 C8 A7 0A 6B D0 23 51 B6</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 E8 1D E0 3B 7B AF 66
|
|
|
|
|
0010 | 7C 02 00 00 5C 07 E8 D0 0C 8B 97 29 D1 0E 24 DA
|
|
|
|
|
0020 | 2E 2A 82 94 7D 87 A7 02 8F 79 03 D9 A0 6A B5 40
|
|
|
|
|
0030 | 65 EF 6D 1F FD 21 3F 95 FE 50 02 00 AA 78 A4 75
|
|
|
|
|
0040 | A2 FE F7 01 6D CA AA AD F7 E0 BB F4 3B F4 4E 3E
|
|
|
|
|
0050 | E1 F8 CD 7C CF E7 AF 1D A6 7E 59 C1 BB C4 FB 6A
|
|
|
|
|
0060 | 2F 08 13 8C 1B 80 91 1A 1A 97 C9 DF 68 25 AB 6A
|
|
|
|
|
0070 | 07 E3 10 04 CC 8C 94 06 7C BC 3C 6C 84 6B 41 73
|
|
|
|
|
0080 | 27 B4 19 4A E6 7B 61 51 26 56 15 E5 88 34 B1 15
|
|
|
|
|
0090 | D4 9C 7D 18 A3 22 39 0E F8 21 AA 38 F0 6C 69 DC
|
|
|
|
|
00A0 | 03 9B 3C 35 C9 97 30 CF 27 75 39 B5 2E 52 AC 65
|
|
|
|
|
00B0 | 63 04 96 83 6C 63 97 10 B4 EE 8D CB E6 C8 90 99
|
|
|
|
|
00C0 | D5 4E B1 A1 21 4F 20 96 EA F5 35 26 A6 22 08 54
|
|
|
|
|
00D0 | 68 56 5E EA A3 F4 0C 7A 1B 56 E3 F5 F5 DD 53 6F
|
|
|
|
|
00E0 | 34 64 E9 91 A1 31 88 12 25 7B 16 E6 BC C6 57 BD
|
|
|
|
|
00F0 | 5C 06 18 31 2B F4 2E 15 98 7C C4 CC 34 0F 96 3B
|
|
|
|
|
0100 | 0E E2 7F 0D 32 17 22 56 23 C8 A9 2E 75 A9 DA 12
|
|
|
|
|
0110 | 13 C8 1D 23 37 1D 90 7B 32 21 8C C0 87 64 3B 36
|
|
|
|
|
0120 | 36 10 5F D2 98 0C 2A 5D 80 D3 CA B7 F8 69 C0 E6
|
|
|
|
|
0130 | C9 73 DF DF 8C C7 24 78 6E 46 24 C2 E0 3A CF 45
|
|
|
|
|
0140 | 24 68 F2 87 D2 8B 63 A3 BF 8C A8 1E E6 A0 7A 91
|
|
|
|
|
0150 | 47 F6 44 6B C4 D3 09 D8 EF 88 03 66 DE BD C7 87
|
|
|
|
|
0160 | 4E D9 BD 26 EE D9 1A D8 8E 3C D8 F7 3C C1 6D C1
|
|
|
|
|
0170 | A4 87 A8 CD E3 B2 1C BA 71 C0 C0 92 12 C3 9D 40
|
|
|
|
|
0180 | 28 A3 8A E6 F2 5E 12 B7 3D E1 00 96 E1 0B DD 23
|
|
|
|
|
0190 | 8E C8 9F 24 11 13 C8 14 CF 83 3E 68 80 71 A1 83
|
|
|
|
|
01A0 | 32 FA 47 09 55 AB 17 DE 6E 7B 83 AA E5 DC 9C 42
|
|
|
|
|
01B0 | 38 DD D6 0D AD B3 7A E8 85 88 E6 F4 68 0E D1 62
|
|
|
|
|
01C0 | 35 AB 20 55 2D 6E 42 54 DB 9E 4E E0 6F C8 AF 6F
|
|
|
|
|
01D0 | D5 90 C6 00 86 0E 5F A4 09 8D A1 64 F3 F0 F6 3F
|
|
|
|
|
01E0 | DE CC E4 86 7C 43 9D CF 2C 29 56 D3 D7 AE E3 6B
|
|
|
|
|
01F0 | DD B8 32 28 FD AB 7B 9A 56 86 FE 81 20 0B EC AB
|
|
|
|
|
0200 | A3 E5 7A FC EC 1D EF EE A8 F7 0A D0 31 FD B4 E2
|
|
|
|
|
0210 | F8 86 3B 30 EC 4A ED 69 F9 5E D2 15 86 42 6F A3
|
|
|
|
|
0220 | 39 6D 59 06 29 2D 97 51 3F 59 23 A7 B5 F8 8F 8F
|
|
|
|
|
0230 | 99 B6 88 2F E9 E6 92 49 BC CF 4A 6E 3C C9 03 72
|
|
|
|
|
0240 | 3B A4 6F 88 70 4A 65 5D D2 22 23 00 50 EB C6 DD
|
|
|
|
|
0250 | 06 02 62 A4 06 48 78 D0 FA CB 9E 45 3A 88 D8 17
|
|
|
|
|
0260 | B7 6B B9 43 F4 3D 80 3A 96 06 2B 39 60 E1 6E 46
|
|
|
|
|
0270 | B4 5B E2 97 CE 18 9B 46 C8 37 0E EA FC 18 C2 76
|
|
|
|
|
0280 | 7B 3B 97 4B 85 47 0D A9 0F 29 57 FB</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 = 8A67E36645FBD128F8E52F34286EF152CB04D2F5D331C9F12258B8909
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>012CD4808462AF66</code></td>
|
|
|
|
|
<td><code>01E81DE03B7BAF66</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>B0020000</code> (688 in decimal)</td>
|
|
|
|
|
<td><code>7C020000</code> (636 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -482,19 +482,19 @@ random_padding_bytes = 8A67E36645FBD128F8E52F34286EF152CB04D2F5D331C9F12258B8909
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>9A35B34BAD37DF538D3FE4B7DC8C94D7</code></td>
|
|
|
|
|
<td><code>0C8B9729D10E24DA2E2A82947D87A702</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>FCF312950D42D98F978F0DF93CCECD0D</code></td>
|
|
|
|
|
<td><code>8F7903D9A06AB54065EF6D1FFD213F95</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE5002007659D3CAEDAC068821966A4E</code> <code>0FAC9AF2476E268558046DED9D775B41</code> <code>E5549E341EA2FBE906D8F6A9FFCEE5F7</code> <code>F93E2CAFD49D0F3EA7F80CA599B9059B</code> <code>063D1FD2E80A032E194FD385E03D497A</code> <code>410EB08AE69172AC3E3081D34D4EE0BD</code> <code>BCC1A6012C746542EF08A2081B3CA9BC</code> <code>7B59A1CD2CACDD4A50973ED04EA61228</code> <code>FAE51B86A673691E50D2993B51B98E5C</code> <code>9355C1F6302887C648FDA61FB41D7729</code> <code>16C602E2BB9A3F31A99BD0545369F5FB</code> <code>60DBBAB0641E3048C68811FBC18DA914</code> <code>AEAF2630AC40FC0A89308675BA8E97D0</code> <code>9D5DD9221AE576058878F59FEA775DB7</code> <code>FA7A630C170162FEF253FC7BDA3AEB8A</code> <code>AE087786CF44134291019E650A2AC9B8</code> <code>B49BD7F0C5B82B3952B51F479A973837</code> <code>DEF2CA9F5429E647F0AA679CCC173ACE</code> <code>58CCED569F81569B9124F8D068DCAF37</code> <code>36DDE3B163224927667DCE1EBE62382B</code> <code>60B054CD05CD2E6379BADD5B0E26828E</code> <code>F651066B0E4DA864EEF0CC812821490F</code> <code>24E1266EAB831CF492CD632936CD37DA</code> <code>3C09F5C30D0E0A3F913D27E6B955F952</code> <code>19B424B1E75283FB757F054109E850FD</code> <code>1DB9710A253B2F76979ED48C67D82AE2</code> <code>CDDC853D32E4159AA2D1940E6447B1EE</code> <code>3D827DCD968AC78B301654AD773FFE52</code> <code>7B27E13BE3D4AE65197A709A3AB5EC52</code> <code>28DBFBDF6A7A776034DB76016C125DF5</code> <code>5EFBA7CAF1C30B1D6A832126B68299D2</code> <code>7247ABF68FD4E8E8CE1E47A3AA955B4E</code> <code>C19A78F32648340B5A30598866CAC850</code> <code>27774603D1FDFB40959F343B1B836546</code> <code>5EB9684FF715472CFC935520D1F4D2CE</code> <code>861B5CCD98F692D4B2E9FDF76B11DC78</code> <code>C659A754C7F1EF323A76DF25C8A70A6B</code><br> <code>D02351B6</code></td>
|
|
|
|
|
<td><code>FE500200AA78A475A2FEF7016DCAAAAD</code> <code>F7E0BBF43BF44E3EE1F8CD7CCFE7AF1D</code> <code>A67E59C1BBC4FB6A2F08138C1B80911A</code> <code>1A97C9DF6825AB6A07E31004CC8C9406</code> <code>7CBC3C6C846B417327B4194AE67B6151</code> <code>265615E58834B115D49C7D18A322390E</code> <code>F821AA38F06C69DC039B3C35C99730CF</code> <code>277539B52E52AC65630496836C639710</code> <code>B4EE8DCBE6C89099D54EB1A1214F2096</code> <code>EAF53526A622085468565EEAA3F40C7A</code> <code>1B56E3F5F5DD536F3464E991A1318812</code> <code>257B16E6BCC657BD5C0618312BF42E15</code> <code>987CC4CC340F963B0EE27F0D32172256</code> <code>23C8A92E75A9DA1213C81D23371D907B</code> <code>32218CC087643B3636105FD2980C2A5D</code> <code>80D3CAB7F869C0E6C973DFDF8CC72478</code> <code>6E4624C2E03ACF452468F287D28B63A3</code> <code>BF8CA81EE6A07A9147F6446BC4D309D8</code> <code>EF880366DEBDC7874ED9BD26EED91AD8</code> <code>8E3CD8F73CC16DC1A487A8CDE3B21CBA</code> <code>71C0C09212C39D4028A38AE6F25E12B7</code> <code>3DE10096E10BDD238EC89F241113C814</code> <code>CF833E688071A18332FA470955AB17DE</code> <code>6E7B83AAE5DC9C4238DDD60DADB37AE8</code> <code>8588E6F4680ED16235AB20552D6E4254</code> <code>DB9E4EE06FC8AF6FD590C600860E5FA4</code> <code>098DA164F3F0F63FDECCE4867C439DCF</code> <code>2C2956D3D7AEE36BDDB83228FDAB7B9A</code> <code>5686FE81200BECABA3E57AFCEC1DEFEE</code> <code>A8F70AD031FDB4E2F8863B30EC4AED69</code> <code>F95ED21586426FA3396D5906292D9751</code> <code>3F5923A7B5F88F8F99B6882FE9E69249</code> <code>BCCF4A6E3CC903723BA46F88704A655D</code> <code>D222230050EBC6DD060262A4064878D0</code> <code>FACB9E453A88D817B76BB943F43D803A</code> <code>96062B3960E16E46B45BE297CE189B46</code> <code>C8370EEAFC18C2767B3B974B85470DA9</code><br> <code>0F2957FB</code></td>
|
|
|
|
|
<td>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = 8A67E36645FBD128F8E52F34286EF152CB04D2F5D331C9F12258B8909
|
|
|
|
|
<!-- 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 = 7659D3CAEDAC068821966A4E0FAC9AF2476E268558046DED9D775B41E5549E341EA2FBE906D8F6A9FFCEE5F7F93E2CAFD49D0F3EA7F80CA599B9059B063D1FD2E80A032E194FD385E03D497A410EB08AE69172AC3E3081D34D4EE0BDBCC1A6012C746542EF08A2081B3CA9BC7B59A1CD2CACDD4A50973ED04EA61228FAE51B86A673691E50D2993B51B98E5C9355C1F6302887C648FDA61FB41D772916C602E2BB9A3F31A99BD0545369F5FB60DBBAB0641E3048C68811FBC18DA914AEAF2630AC40FC0A89308675BA8E97D09D5DD9221AE576058878F59FEA775DB7FA7A630C170162FEF253FC7BDA3AEB8AAE087786CF44134291019E650A2AC9B8B49BD7F0C5B82B3952B51F479A973837DEF2CA9F5429E647F0AA679CCC173ACE58CCED569F81569B9124F8D068DCAF3736DDE3B163224927667DCE1EBE62382B60B054CD05CD2E6379BADD5B0E26828EF651066B0E4DA864EEF0CC812821490F24E1266EAB831CF492CD632936CD37DA3C09F5C30D0E0A3F913D27E6B955F95219B424B1E75283FB757F054109E850FD1DB9710A253B2F76979ED48C67D82AE2CDDC853D32E4159AA2D1940E6447B1EE3D827DCD968AC78B301654AD773FFE527B27E13BE3D4AE65197A709A3AB5EC5228DBFBDF6A7A776034DB76016C125DF55EFBA7CAF1C30B1D6A832126B68299D27247ABF68FD4E8E8CE1E47A3AA955B4EC19A78F32648340B5A30598866CAC85027774603D1FDFB40959F343B1B8365465EB9684FF715472CFC935520D1F4D2CE861B5CCD98F692D4B2E9FDF76B11DC78C659A754C7F1EF323A76DF25C8A70A6BD02351B6
|
|
|
|
|
tmp_aes_key = EB319ECE328BC38718F88B7D916EF0F8FD0052C119B5BB051B20F6CAE9630513
|
|
|
|
|
tmp_aes_iv = 15B0D222C642234E5A618C381028C6A629D40B49517B6A4E9748DEA064DEE608</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = AA78A475A2FEF7016DCAAAADF7E0BBF43BF44E3EE1F8CD7CCFE7AF1DA67E59C1BBC4FB6A2F08138C1B80911A1A97C9DF6825AB6A07E31004CC8C94067CBC3C6C846B417327B4194AE67B6151265615E58834B115D49C7D18A322390EF821AA38F06C69DC039B3C35C99730CF277539B52E52AC65630496836C639710B4EE8DCBE6C89099D54EB1A1214F2096EAF53526A622085468565EEAA3F40C7A1B56E3F5F5DD536F3464E991A1318812257B16E6BCC657BD5C0618312BF42E15987CC4CC340F963B0EE27F0D3217225623C8A92E75A9DA1213C81D23371D907B32218CC087643B3636105FD2980C2A5D80D3CAB7F869C0E6C973DFDF8CC724786E4624C2E03ACF452468F287D28B63A3BF8CA81EE6A07A9147F6446BC4D309D8EF880366DEBDC7874ED9BD26EED91AD88E3CD8F73CC16DC1A487A8CDE3B21CBA71C0C09212C39D4028A38AE6F25E12B73DE10096E10BDD238EC89F241113C814CF833E688071A18332FA470955AB17DE6E7B83AAE5DC9C4238DDD60DADB37AE88588E6F4680ED16235AB20552D6E4254DB9E4EE06FC8AF6FD590C600860E5FA4098DA164F3F0F63FDECCE4867C439DCF2C2956D3D7AEE36BDDB83228FDAB7B9A5686FE81200BECABA3E57AFCEC1DEFEEA8F70AD031FDB4E2F8863B30EC4AED69F95ED21586426FA3396D5906292D97513F5923A7B5F88F8F99B6882FE9E69249BCCF4A6E3CC903723BA46F88704A655DD222230050EBC6DD060262A4064878D0FACB9E453A88D817B76BB943F43D803A96062B3960E16E46B45BE297CE189B46C8370EEAFC18C2767B3B974B85470DA90F2957FB
|
|
|
|
|
tmp_aes_key = AAD003163D6CCA076FD3EB43E7CFCD608E3C4BE391C2237AA565A6D643A24E4A
|
|
|
|
|
tmp_aes_iv = 09FCFBADA190995AF91BB0DBAD953656AD72CE255D9F37BA781835C2DBDA0F9B</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = F609C430A1FAF37C7CA4FB42AE530B9F4DBC4871BA0D89B59A35B34BAD37DF538D3FE4B7DC8C94D7FCF312950D42D98F978F0DF93CCECD0D03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010052044CAC8AAA760ED5C6E0C834522C4981D774F8524865DF6ACA8A448442928AF9CFA2B03F14AC4D5BD9B634E03F78D7BF2D26BF3776C81E68B7648678DB7C160DB0632EC8E8FFE822F91457F9076537B41E5079C2B14510A66C0DD89678017A845DB30885B425631196C51FCAFAA158417DE07BD8991351EFC3C0F5D38AEDE97D3F6E550491F6F569E316E4F6A2B9CAACD871E00E8C44211B68ED77EA2513A94BBF21FA4FE88E0A2FC794999D109ADD40B396ECC0F2C0CCB5A17E9362E29D5D2F6BE895C706D75370C1B23A8BFBE4E29E5E2B6C1E8120C629747ADE29AE34ECB207315627A90AF4A3810224541015005E416B8C3BE698365C3645C2717753438462AF66549A2CCE74B33B70
|
|
|
|
|
answer = BA0D89B59A35B34BAD37DF538D3FE4B7DC8C94D7FCF312950D42D98F978F0DF93CCECD0D03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010052044CAC8AAA760ED5C6E0C834522C4981D774F8524865DF6ACA8A448442928AF9CFA2B03F14AC4D5BD9B634E03F78D7BF2D26BF3776C81E68B7648678DB7C160DB0632EC8E8FFE822F91457F9076537B41E5079C2B14510A66C0DD89678017A845DB30885B425631196C51FCAFAA158417DE07BD8991351EFC3C0F5D38AEDE97D3F6E550491F6F569E316E4F6A2B9CAACD871E00E8C44211B68ED77EA2513A94BBF21FA4FE88E0A2FC794999D109ADD40B396ECC0F2C0CCB5A17E9362E29D5D2F6BE895C706D75370C1B23A8BFBE4E29E5E2B6C1E8120C629747ADE29AE34ECB207315627A90AF4A3810224541015005E416B8C3BE698365C3645C2717753438462AF66549A2CCE74B33B70</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = 81414859560CCEC97FD66643D3A2D16A2B90564EBA0D89B50C8B9729D10E24DA2E2A82947D87A7028F7903D9A06AB54065EF6D1FFD213F9503000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010039EDC9D09F31340EC8D0D10222C04EBB33A25F1B1A2EA8B8E222DCE68DAED0E2A079A8D1F3F5227C328E01D3085F68D923C65703EC5F9B14CD29CA5F86F41BBF2C7A25E0454D6AC87E9897B3F44806249A2BBA7885887B6017A3EFE2E9AFEB287B34B54F626A6CAE04BC28B69F10E4162E81599C387367B0DDB21DEF8ECA4F8B3FD14B16508ED57846CAED7EC8A18DF8FA500F8C3D86CECB1F8C799C757C04CC26BA9290BFDDF4805AF1ED58512861064EEC74CAD1861FE3AA4D33D11FADBB3ADAF0FD2B2E9FF93DA20D2DE53D35B4807F15C73486B9ECB7A734FDB6AD315244C378F4DC0816F20791007C98F69D5312294069C6DE3468563E41A1BAF07C13C53B7BAF6638DA26584A281A79
|
|
|
|
|
answer = BA0D89B50C8B9729D10E24DA2E2A82947D87A7028F7903D9A06AB54065EF6D1FFD213F9503000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010039EDC9D09F31340EC8D0D10222C04EBB33A25F1B1A2EA8B8E222DCE68DAED0E2A079A8D1F3F5227C328E01D3085F68D923C65703EC5F9B14CD29CA5F86F41BBF2C7A25E0454D6AC87E9897B3F44806249A2BBA7885887B6017A3EFE2E9AFEB287B34B54F626A6CAE04BC28B69F10E4162E81599C387367B0DDB21DEF8ECA4F8B3FD14B16508ED57846CAED7EC8A18DF8FA500F8C3D86CECB1F8C799C757C04CC26BA9290BFDDF4805AF1ED58512861064EEC74CAD1861FE3AA4D33D11FADBB3ADAF0FD2B2E9FF93DA20D2DE53D35B4807F15C73486B9ECB7A734FDB6AD315244C378F4DC0816F20791007C98F69D5312294069C6DE3468563E41A1BAF07C13C53B7BAF6638DA26584A281A79</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 9A 35 B3 4B AD 37 DF 53 8D 3F E4 B7
|
|
|
|
|
0010 | DC 8C 94 D7 FC F3 12 95 0D 42 D9 8F 97 8F 0D F9
|
|
|
|
|
0020 | 3C CE CD 0D 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 0C 8B 97 29 D1 0E 24 DA 2E 2A 82 94
|
|
|
|
|
0010 | 7D 87 A7 02 8F 79 03 D9 A0 6A B5 40 65 EF 6D 1F
|
|
|
|
|
0020 | FD 21 3F 95 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 = BA0D89B59A35B34BAD37DF538D3FE4B7DC8C94D7FCF312950D42D98F978F0DF93CCECD0
|
|
|
|
|
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 | 52 04 4C AC 8A AA 76 0E D5 C6 E0 C8 34 52 2C 49
|
|
|
|
|
0140 | 81 D7 74 F8 52 48 65 DF 6A CA 8A 44 84 42 92 8A
|
|
|
|
|
0150 | F9 CF A2 B0 3F 14 AC 4D 5B D9 B6 34 E0 3F 78 D7
|
|
|
|
|
0160 | BF 2D 26 BF 37 76 C8 1E 68 B7 64 86 78 DB 7C 16
|
|
|
|
|
0170 | 0D B0 63 2E C8 E8 FF E8 22 F9 14 57 F9 07 65 37
|
|
|
|
|
0180 | B4 1E 50 79 C2 B1 45 10 A6 6C 0D D8 96 78 01 7A
|
|
|
|
|
0190 | 84 5D B3 08 85 B4 25 63 11 96 C5 1F CA FA A1 58
|
|
|
|
|
01A0 | 41 7D E0 7B D8 99 13 51 EF C3 C0 F5 D3 8A ED E9
|
|
|
|
|
01B0 | 7D 3F 6E 55 04 91 F6 F5 69 E3 16 E4 F6 A2 B9 CA
|
|
|
|
|
01C0 | AC D8 71 E0 0E 8C 44 21 1B 68 ED 77 EA 25 13 A9
|
|
|
|
|
01D0 | 4B BF 21 FA 4F E8 8E 0A 2F C7 94 99 9D 10 9A DD
|
|
|
|
|
01E0 | 40 B3 96 EC C0 F2 C0 CC B5 A1 7E 93 62 E2 9D 5D
|
|
|
|
|
01F0 | 2F 6B E8 95 C7 06 D7 53 70 C1 B2 3A 8B FB E4 E2
|
|
|
|
|
0200 | 9E 5E 2B 6C 1E 81 20 C6 29 74 7A DE 29 AE 34 EC
|
|
|
|
|
0210 | B2 07 31 56 27 A9 0A F4 A3 81 02 24 54 10 15 00
|
|
|
|
|
0220 | 5E 41 6B 8C 3B E6 98 36 5C 36 45 C2 71 77 53 43
|
|
|
|
|
0230 | 84 62 AF 66</code></pre>
|
|
|
|
|
0130 | 39 ED C9 D0 9F 31 34 0E C8 D0 D1 02 22 C0 4E BB
|
|
|
|
|
0140 | 33 A2 5F 1B 1A 2E A8 B8 E2 22 DC E6 8D AE D0 E2
|
|
|
|
|
0150 | A0 79 A8 D1 F3 F5 22 7C 32 8E 01 D3 08 5F 68 D9
|
|
|
|
|
0160 | 23 C6 57 03 EC 5F 9B 14 CD 29 CA 5F 86 F4 1B BF
|
|
|
|
|
0170 | 2C 7A 25 E0 45 4D 6A C8 7E 98 97 B3 F4 48 06 24
|
|
|
|
|
0180 | 9A 2B BA 78 85 88 7B 60 17 A3 EF E2 E9 AF EB 28
|
|
|
|
|
0190 | 7B 34 B5 4F 62 6A 6C AE 04 BC 28 B6 9F 10 E4 16
|
|
|
|
|
01A0 | 2E 81 59 9C 38 73 67 B0 DD B2 1D EF 8E CA 4F 8B
|
|
|
|
|
01B0 | 3F D1 4B 16 50 8E D5 78 46 CA ED 7E C8 A1 8D F8
|
|
|
|
|
01C0 | FA 50 0F 8C 3D 86 CE CB 1F 8C 79 9C 75 7C 04 CC
|
|
|
|
|
01D0 | 26 BA 92 90 BF DD F4 80 5A F1 ED 58 51 28 61 06
|
|
|
|
|
01E0 | 4E EC 74 CA D1 86 1F E3 AA 4D 33 D1 1F AD BB 3A
|
|
|
|
|
01F0 | DA F0 FD 2B 2E 9F F9 3D A2 0D 2D E5 3D 35 B4 80
|
|
|
|
|
0200 | 7F 15 C7 34 86 B9 EC B7 A7 34 FD B6 AD 31 52 44
|
|
|
|
|
0210 | C3 78 F4 DC 08 16 F2 07 91 00 7C 98 F6 9D 53 12
|
|
|
|
|
0220 | 29 40 69 C6 DE 34 68 56 3E 41 A1 BA F0 7C 13 C5
|
|
|
|
|
0230 | 3B 7B AF 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 = BA0D89B59A35B34BAD37DF538D3FE4B7DC8C94D7FCF312950D42D98F978F0DF93CCECD0
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>9A35B34BAD37DF538D3FE4B7DC8C94D7</code></td>
|
|
|
|
|
<td><code>0C8B9729D10E24DA2E2A82947D87A702</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>FCF312950D42D98F978F0DF93CCECD0D</code></td>
|
|
|
|
|
<td><code>8F7903D9A06AB54065EF6D1FFD213F95</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B59A35B34BAD37DF538D3FE4B7DC8C94D7FCF312950D42D98F978F0DF93CCECD0
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE00010052044CAC8AAA760ED5C6E0C8</code> <code>34522C4981D774F8524865DF6ACA8A44</code> <code>8442928AF9CFA2B03F14AC4D5BD9B634</code> <code>E03F78D7BF2D26BF3776C81E68B76486</code> <code>78DB7C160DB0632EC8E8FFE822F91457</code> <code>F9076537B41E5079C2B14510A66C0DD8</code> <code>9678017A845DB30885B425631196C51F</code> <code>CAFAA158417DE07BD8991351EFC3C0F5</code> <code>D38AEDE97D3F6E550491F6F569E316E4</code> <code>F6A2B9CAACD871E00E8C44211B68ED77</code> <code>EA2513A94BBF21FA4FE88E0A2FC79499</code> <code>9D109ADD40B396ECC0F2C0CCB5A17E93</code> <code>62E29D5D2F6BE895C706D75370C1B23A</code> <code>8BFBE4E29E5E2B6C1E8120C629747ADE</code> <code>29AE34ECB207315627A90AF4A3810224</code> <code>541015005E416B8C3BE698365C3645C2</code><br> <code>71775343</code></td>
|
|
|
|
|
<td><code>FE00010039EDC9D09F31340EC8D0D102</code> <code>22C04EBB33A25F1B1A2EA8B8E222DCE6</code> <code>8DAED0E2A079A8D1F3F5227C328E01D3</code> <code>085F68D923C65703EC5F9B14CD29CA5F</code> <code>86F41BBF2C7A25E0454D6AC87E9897B3</code> <code>F44806249A2BBA7885887B6017A3EFE2</code> <code>E9AFEB287B34B54F626A6CAE04BC28B6</code> <code>9F10E4162E81599C387367B0DDB21DEF</code> <code>8ECA4F8B3FD14B16508ED57846CAED7E</code> <code>C8A18DF8FA500F8C3D86CECB1F8C799C</code> <code>757C04CC26BA9290BFDDF4805AF1ED58</code> <code>512861064EEC74CAD1861FE3AA4D33D1</code> <code>1FADBB3ADAF0FD2B2E9FF93DA20D2DE5</code> <code>3D35B4807F15C73486B9ECB7A734FDB6</code> <code>AD315244C378F4DC0816F20791007C98</code> <code>F69D5312294069C6DE3468563E41A1BA</code><br> <code>F07C13C5</code></td>
|
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>8462AF66</code> (1722770052 in decimal)</td>
|
|
|
|
|
<td><code>3B7BAF66</code> (1722776379 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B59A35B34BAD37DF538D3FE4B7DC8C94D7FCF312950D42D98F978F0DF93CCECD0
|
|
|
|
|
<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 = B2FE521A6BFCF46E214F7FC47FCE5618946538CC60C0A4ED059D50CCAB539EBD96DB494D85CDB5DA7E9BFB36CEFC7ABDA126E1412F4BE0B2401AF82569B811AD415F1336A92F85935DDC8B96E0883563E23F3346893BD42F2EC63E7EDAD2C96FEBAF5D9917A70C6F00FA3FDCE10DA47AD3DF6BED8A868DC455B29ACE23D7DBA83FB31DF0B164E25A0DD8B36510B460D5E7DEE921BD5E9F0BF588F61D0FC2551A024F8E722BB8692E26CECFB110FCE7B8A010C77F92F9E6635ED3E408FD3D60A6A6669EE76FABFE615AD78989036AE418D4F89C67F9615D6304C24510BDE92A27E5D07074E216ED9C9E2D42C8FEAAE57DD795B39D9F358587F09ED2C7A658EF75</code></pre>
|
|
|
|
|
<pre><code>b = F425236A63E56A882541D76E35995D3BE518CECEF5B80AC1810FE526252D829ABEEFDD3EF30A77EE94AD185E006FE653B91A7FFEB4C996E2DA060FECAABFCC7F621FBEA18D21570812CA2928F44D414DED8A36D708313B8295EEB0C0A5877495A105663295C895B8AE31CCE9A550D64289C308FE7329E1F43B95DA7F2A47844A5BAF7A6E253CF0A124090ACCA4432327A54E29EEBFCBF3C83337F6F1A00F6C0AE0176DA1BF5389C9306A638AF5FA4E38ABA33F0E45106538447181F2A9A8D8524B0C38D177287B9B6760159E74EF10101B71A09C2C22428D8E351A009179A777B71C14EEA9D97D1D2FCAF5458C7AC9C693926675ABA944FD3B786F155AAB5311</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 = 38D29FCE5290891BBEF14981C17D14ED5B7816D736E7F35139D6B0F0E8D8EB0DFB8D6FFDD765C8A4D791F61205B3C3E853C97CAD8C7082410B6D4482216C126D95B525078F3BEEEED64E2E9F884C9269E52FB2CD9297B1F5A09C5A50F87BA4F7FA671B2B27A4F786CA2FB3ECC847120D4794D892FCC1C5CF77149A20CA115B449692F042E0721BFEEB0F99B9030E17F9E0606858E7C79485A4F20142FBBA2BE653A87F9C7B260F9BB0A4EFB0D7FC118874409E063EBF7917997F41C765CC5AFE88A3304FB11CE753ED063EEC2780C0954E5C75F6A826F743484CDC02A22353F20E19ECA314AD53197A41C649FC89D37A504FA1239C0F43082A5C089B1A53B25D</code></pre>
|
|
|
|
|
<pre><code>g_b = 88B31B68126E9FDEC8205D9EDF8D32B43165287303840DA161EE493C43B6446084FC8BB64F63EA953FCC42D5A121A1C4BB8D6332C940C793ABD50A12E531DF170C01B44BD0A0ED70593B157B6C5DE08228F6B486838E4EC6FD7727A04D859C7DD68F7CC4BE79B48BFB402A3DEC8B6343EF028C04CE732C1347678B049804DAE58F3179FACEB0475B867E5858FEB976207448FB9B2F8FBF095854A5D39B0ABB80C7849D1E1AA500009008A597BBDAF04B4300A15214A0B1730DEF3A4BA3A876A226EE582F3B91F1793E3881B7084A42871FE5E0F44E99989F1B93EA13EC28E12215A24744F1851C3F3A331068BB004CFD8D69A1BB50D4BC2A0407946D51B65DB2</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 9A 35 B3 4B AD 37 DF 53 8D 3F E4 B7
|
|
|
|
|
0010 | DC 8C 94 D7 FC F3 12 95 0D 42 D9 8F 97 8F 0D F9
|
|
|
|
|
0020 | 3C CE CD 0D 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 38 D2 9F CE 52 90 89 1B BE F1 49 81 C1 7D 14 ED
|
|
|
|
|
0040 | 5B 78 16 D7 36 E7 F3 51 39 D6 B0 F0 E8 D8 EB 0D
|
|
|
|
|
0050 | FB 8D 6F FD D7 65 C8 A4 D7 91 F6 12 05 B3 C3 E8
|
|
|
|
|
0060 | 53 C9 7C AD 8C 70 82 41 0B 6D 44 82 21 6C 12 6D
|
|
|
|
|
0070 | 95 B5 25 07 8F 3B EE EE D6 4E 2E 9F 88 4C 92 69
|
|
|
|
|
0080 | E5 2F B2 CD 92 97 B1 F5 A0 9C 5A 50 F8 7B A4 F7
|
|
|
|
|
0090 | FA 67 1B 2B 27 A4 F7 86 CA 2F B3 EC C8 47 12 0D
|
|
|
|
|
00A0 | 47 94 D8 92 FC C1 C5 CF 77 14 9A 20 CA 11 5B 44
|
|
|
|
|
00B0 | 96 92 F0 42 E0 72 1B FE EB 0F 99 B9 03 0E 17 F9
|
|
|
|
|
00C0 | E0 60 68 58 E7 C7 94 85 A4 F2 01 42 FB BA 2B E6
|
|
|
|
|
00D0 | 53 A8 7F 9C 7B 26 0F 9B B0 A4 EF B0 D7 FC 11 88
|
|
|
|
|
00E0 | 74 40 9E 06 3E BF 79 17 99 7F 41 C7 65 CC 5A FE
|
|
|
|
|
00F0 | 88 A3 30 4F B1 1C E7 53 ED 06 3E EC 27 80 C0 95
|
|
|
|
|
0100 | 4E 5C 75 F6 A8 26 F7 43 48 4C DC 02 A2 23 53 F2
|
|
|
|
|
0110 | 0E 19 EC A3 14 AD 53 19 7A 41 C6 49 FC 89 D3 7A
|
|
|
|
|
0120 | 50 4F A1 23 9C 0F 43 08 2A 5C 08 9B 1A 53 B2 5D</code></pre>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 0C 8B 97 29 D1 0E 24 DA 2E 2A 82 94
|
|
|
|
|
0010 | 7D 87 A7 02 8F 79 03 D9 A0 6A B5 40 65 EF 6D 1F
|
|
|
|
|
0020 | FD 21 3F 95 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 88 B3 1B 68 12 6E 9F DE C8 20 5D 9E DF 8D 32 B4
|
|
|
|
|
0040 | 31 65 28 73 03 84 0D A1 61 EE 49 3C 43 B6 44 60
|
|
|
|
|
0050 | 84 FC 8B B6 4F 63 EA 95 3F CC 42 D5 A1 21 A1 C4
|
|
|
|
|
0060 | BB 8D 63 32 C9 40 C7 93 AB D5 0A 12 E5 31 DF 17
|
|
|
|
|
0070 | 0C 01 B4 4B D0 A0 ED 70 59 3B 15 7B 6C 5D E0 82
|
|
|
|
|
0080 | 28 F6 B4 86 83 8E 4E C6 FD 77 27 A0 4D 85 9C 7D
|
|
|
|
|
0090 | D6 8F 7C C4 BE 79 B4 8B FB 40 2A 3D EC 8B 63 43
|
|
|
|
|
00A0 | EF 02 8C 04 CE 73 2C 13 47 67 8B 04 98 04 DA E5
|
|
|
|
|
00B0 | 8F 31 79 FA CE B0 47 5B 86 7E 58 58 FE B9 76 20
|
|
|
|
|
00C0 | 74 48 FB 9B 2F 8F BF 09 58 54 A5 D3 9B 0A BB 80
|
|
|
|
|
00D0 | C7 84 9D 1E 1A A5 00 00 90 08 A5 97 BB DA F0 4B
|
|
|
|
|
00E0 | 43 00 A1 52 14 A0 B1 73 0D EF 3A 4B A3 A8 76 A2
|
|
|
|
|
00F0 | 26 EE 58 2F 3B 91 F1 79 3E 38 81 B7 08 4A 42 87
|
|
|
|
|
0100 | 1F E5 E0 F4 4E 99 98 9F 1B 93 EA 13 EC 28 E1 22
|
|
|
|
|
0110 | 15 A2 47 44 F1 85 1C 3F 3A 33 10 68 BB 00 4C FD
|
|
|
|
|
0120 | 8D 69 A1 BB 50 D4 BC 2A 04 07 94 6D 51 B6 5D B2</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 = BA0D89B59A35B34BAD37DF538D3FE4B7DC8C94D7FCF312950D42D98F978F0DF93CCECD0
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>9A35B34BAD37DF538D3FE4B7DC8C94D7</code></td>
|
|
|
|
|
<td><code>0C8B9729D10E24DA2E2A82947D87A702</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>FCF312950D42D98F978F0DF93CCECD0D</code></td>
|
|
|
|
|
<td><code>8F7903D9A06AB54065EF6D1FFD213F95</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE00010038D29FCE5290891BBEF14981</code> <code>C17D14ED5B7816D736E7F35139D6B0F0</code> <code>E8D8EB0DFB8D6FFDD765C8A4D791F612</code> <code>05B3C3E853C97CAD8C7082410B6D4482</code> <code>216C126D95B525078F3BEEEED64E2E9F</code> <code>884C9269E52FB2CD9297B1F5A09C5A50</code> <code>F87BA4F7FA671B2B27A4F786CA2FB3EC</code> <code>C847120D4794D892FCC1C5CF77149A20</code> <code>CA115B449692F042E0721BFEEB0F99B9</code> <code>030E17F9E0606858E7C79485A4F20142</code> <code>FBBA2BE653A87F9C7B260F9BB0A4EFB0</code> <code>D7FC118874409E063EBF7917997F41C7</code> <code>65CC5AFE88A3304FB11CE753ED063EEC</code> <code>2780C0954E5C75F6A826F743484CDC02</code> <code>A22353F20E19ECA314AD53197A41C649</code> <code>FC89D37A504FA1239C0F43082A5C089B</code><br> <code>1A53B25D</code></td>
|
|
|
|
|
<td><code>FE00010088B31B68126E9FDEC8205D9E</code> <code>DF8D32B43165287303840DA161EE493C</code> <code>43B6446084FC8BB64F63EA953FCC42D5</code> <code>A121A1C4BB8D6332C940C793ABD50A12</code> <code>E531DF170C01B44BD0A0ED70593B157B</code> <code>6C5DE08228F6B486838E4EC6FD7727A0</code> <code>4D859C7DD68F7CC4BE79B48BFB402A3D</code> <code>EC8B6343EF028C04CE732C1347678B04</code> <code>9804DAE58F3179FACEB0475B867E5858</code> <code>FEB976207448FB9B2F8FBF095854A5D3</code> <code>9B0ABB80C7849D1E1AA500009008A597</code> <code>BBDAF04B4300A15214A0B1730DEF3A4B</code> <code>A3A876A226EE582F3B91F1793E3881B7</code> <code>084A42871FE5E0F44E99989F1B93EA13</code> <code>EC28E12215A24744F1851C3F3A331068</code> <code>BB004CFD8D69A1BB50D4BC2A0407946D</code><br> <code>51B65DB2</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 = BA0D89B59A35B34BAD37DF538D3FE4B7DC8C94D7FCF312950D42D98F978F0DF93CCECD0
|
|
|
|
|
<!-- 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 = 54B643669A35B34BAD37DF538D3FE4B7DC8C94D7FCF312950D42D98F978F0DF93CCECD0D0000000000000000FE00010038D29FCE5290891BBEF14981C17D14ED5B7816D736E7F35139D6B0F0E8D8EB0DFB8D6FFDD765C8A4D791F61205B3C3E853C97CAD8C7082410B6D4482216C126D95B525078F3BEEEED64E2E9F884C9269E52FB2CD9297B1F5A09C5A50F87BA4F7FA671B2B27A4F786CA2FB3ECC847120D4794D892FCC1C5CF77149A20CA115B449692F042E0721BFEEB0F99B9030E17F9E0606858E7C79485A4F20142FBBA2BE653A87F9C7B260F9BB0A4EFB0D7FC118874409E063EBF7917997F41C765CC5AFE88A3304FB11CE753ED063EEC2780C0954E5C75F6A826F743484CDC02A22353F20E19ECA314AD53197A41C649FC89D37A504FA1239C0F43082A5C089B1A53B25D
|
|
|
|
|
padding = 265C58AA0D538FAFCBDC1894
|
|
|
|
|
tmp_aes_key = EB319ECE328BC38718F88B7D916EF0F8FD0052C119B5BB051B20F6CAE9630513
|
|
|
|
|
tmp_aes_iv = 15B0D222C642234E5A618C381028C6A629D40B49517B6A4E9748DEA064DEE608</code></pre>
|
|
|
|
|
<pre><code>data = 54B643660C8B9729D10E24DA2E2A82947D87A7028F7903D9A06AB54065EF6D1FFD213F950000000000000000FE00010088B31B68126E9FDEC8205D9EDF8D32B43165287303840DA161EE493C43B6446084FC8BB64F63EA953FCC42D5A121A1C4BB8D6332C940C793ABD50A12E531DF170C01B44BD0A0ED70593B157B6C5DE08228F6B486838E4EC6FD7727A04D859C7DD68F7CC4BE79B48BFB402A3DEC8B6343EF028C04CE732C1347678B049804DAE58F3179FACEB0475B867E5858FEB976207448FB9B2F8FBF095854A5D39B0ABB80C7849D1E1AA500009008A597BBDAF04B4300A15214A0B1730DEF3A4BA3A876A226EE582F3B91F1793E3881B7084A42871FE5E0F44E99989F1B93EA13EC28E12215A24744F1851C3F3A331068BB004CFD8D69A1BB50D4BC2A0407946D51B65DB2
|
|
|
|
|
padding = E8B81AC9A52634CC7B507DA8
|
|
|
|
|
tmp_aes_key = AAD003163D6CCA076FD3EB43E7CFCD608E3C4BE391C2237AA565A6D643A24E4A
|
|
|
|
|
tmp_aes_iv = 09FCFBADA190995AF91BB0DBAD953656AD72CE255D9F37BA781835C2DBDA0F9B</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 = DAED234295F32CE16D9A890D3BB3EBB0089477B3E56389BF9ABAC8BF9D623F4BEB358FF69016728C71C8EC39C8ED3502CF04BEA04F42BFCF0A47EF3FD1001AECCD29A9CD5AF88870AB777937DC5F001377E902097356936DB5DF4BBDFFDB5C76DB57245A203A6E8ADAF72E03F499209576532A145997970CC0872B23D148FC4B9D6BD4A16680C616AA82E5C9C9F3D00EA3DF9E1EA8187E1ADBBECC73250F1D39CD77339B442062FC58D0E7E4FB72CD1245EFBE46EB2A4CE662D09F308E7CB09A2518E3BD3C645C4B57F776AE7409CD625C6D6564082AEC095AD2201B760C1610235198DBF2B58B79A64B7ADAADD2FABD8D4F8AFF274C6FB64228EA45C5D3EED2D0B9A122E32259EB511C4532673DF4D4DF7BE8F7C7B8C36080E2E3B959614B6EE7827F502113028E0FEA3821EEF7FBDA8BC7B30AFF1D18AF330C34D9D42046E4DCDC267172530BE1AF9239DC544B8E9C</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = D9626BA9A9ADE28701D757960D11E73AD335351D53A293E4B971E0FD400658D3657DC012A3118ACCB2C8D457951524AD67357FF26C87394CF2FB11015F23AC468BAE04CC2C76619AE51C0BD9D42ED8E1727673E3CAFCF43F223C94FD1C2059FEACAD0C8FA50D3A3BE14FDEF41E5A9DB8A0A285674690CB31F9E3F6F1888375E57FCB329152EB6397E1E3396DFC96FCA872A4F3F23F0FB1EDC792CE0C753294CA57665D8330DB9BF19B63AF9CAF43BB5B877406E20F5FB50C8A50FBB062A1768ACDC03171DF157F52295B208255AD2CCE371B0B3C8C3ABF20525CDB79335230FCCFDD7D4D1F9EFCF139598B9DF56FE687BBCC969FE1309EEF490283B71EB2469D6CA21F0B26AF9184EB8DCFE31E872A29DECADAD62BCE074BD626B20C13DCB6AF436AAE8C9CCEB299865109EDB3461C960D6A554AC61AD7812BE5E9463149E0A0415888F8A113983BA03A14192BE48937</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 78 CB 07 00 84 62 AF 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 9A 35 B3 4B AD 37 DF 53
|
|
|
|
|
0020 | 8D 3F E4 B7 DC 8C 94 D7 FC F3 12 95 0D 42 D9 8F
|
|
|
|
|
0030 | 97 8F 0D F9 3C CE CD 0D FE 50 01 00 DA ED 23 42
|
|
|
|
|
0040 | 95 F3 2C E1 6D 9A 89 0D 3B B3 EB B0 08 94 77 B3
|
|
|
|
|
0050 | E5 63 89 BF 9A BA C8 BF 9D 62 3F 4B EB 35 8F F6
|
|
|
|
|
0060 | 90 16 72 8C 71 C8 EC 39 C8 ED 35 02 CF 04 BE A0
|
|
|
|
|
0070 | 4F 42 BF CF 0A 47 EF 3F D1 00 1A EC CD 29 A9 CD
|
|
|
|
|
0080 | 5A F8 88 70 AB 77 79 37 DC 5F 00 13 77 E9 02 09
|
|
|
|
|
0090 | 73 56 93 6D B5 DF 4B BD FF DB 5C 76 DB 57 24 5A
|
|
|
|
|
00A0 | 20 3A 6E 8A DA F7 2E 03 F4 99 20 95 76 53 2A 14
|
|
|
|
|
00B0 | 59 97 97 0C C0 87 2B 23 D1 48 FC 4B 9D 6B D4 A1
|
|
|
|
|
00C0 | 66 80 C6 16 AA 82 E5 C9 C9 F3 D0 0E A3 DF 9E 1E
|
|
|
|
|
00D0 | A8 18 7E 1A DB BE CC 73 25 0F 1D 39 CD 77 33 9B
|
|
|
|
|
00E0 | 44 20 62 FC 58 D0 E7 E4 FB 72 CD 12 45 EF BE 46
|
|
|
|
|
00F0 | EB 2A 4C E6 62 D0 9F 30 8E 7C B0 9A 25 18 E3 BD
|
|
|
|
|
0100 | 3C 64 5C 4B 57 F7 76 AE 74 09 CD 62 5C 6D 65 64
|
|
|
|
|
0110 | 08 2A EC 09 5A D2 20 1B 76 0C 16 10 23 51 98 DB
|
|
|
|
|
0120 | F2 B5 8B 79 A6 4B 7A DA AD D2 FA BD 8D 4F 8A FF
|
|
|
|
|
0130 | 27 4C 6F B6 42 28 EA 45 C5 D3 EE D2 D0 B9 A1 22
|
|
|
|
|
0140 | E3 22 59 EB 51 1C 45 32 67 3D F4 D4 DF 7B E8 F7
|
|
|
|
|
0150 | C7 B8 C3 60 80 E2 E3 B9 59 61 4B 6E E7 82 7F 50
|
|
|
|
|
0160 | 21 13 02 8E 0F EA 38 21 EE F7 FB DA 8B C7 B3 0A
|
|
|
|
|
0170 | FF 1D 18 AF 33 0C 34 D9 D4 20 46 E4 DC DC 26 71
|
|
|
|
|
0180 | 72 53 0B E1 AF 92 39 DC 54 4B 8E 9C</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 34 73 06 00 3C 7B AF 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 0C 8B 97 29 D1 0E 24 DA
|
|
|
|
|
0020 | 2E 2A 82 94 7D 87 A7 02 8F 79 03 D9 A0 6A B5 40
|
|
|
|
|
0030 | 65 EF 6D 1F FD 21 3F 95 FE 50 01 00 D9 62 6B A9
|
|
|
|
|
0040 | A9 AD E2 87 01 D7 57 96 0D 11 E7 3A D3 35 35 1D
|
|
|
|
|
0050 | 53 A2 93 E4 B9 71 E0 FD 40 06 58 D3 65 7D C0 12
|
|
|
|
|
0060 | A3 11 8A CC B2 C8 D4 57 95 15 24 AD 67 35 7F F2
|
|
|
|
|
0070 | 6C 87 39 4C F2 FB 11 01 5F 23 AC 46 8B AE 04 CC
|
|
|
|
|
0080 | 2C 76 61 9A E5 1C 0B D9 D4 2E D8 E1 72 76 73 E3
|
|
|
|
|
0090 | CA FC F4 3F 22 3C 94 FD 1C 20 59 FE AC AD 0C 8F
|
|
|
|
|
00A0 | A5 0D 3A 3B E1 4F DE F4 1E 5A 9D B8 A0 A2 85 67
|
|
|
|
|
00B0 | 46 90 CB 31 F9 E3 F6 F1 88 83 75 E5 7F CB 32 91
|
|
|
|
|
00C0 | 52 EB 63 97 E1 E3 39 6D FC 96 FC A8 72 A4 F3 F2
|
|
|
|
|
00D0 | 3F 0F B1 ED C7 92 CE 0C 75 32 94 CA 57 66 5D 83
|
|
|
|
|
00E0 | 30 DB 9B F1 9B 63 AF 9C AF 43 BB 5B 87 74 06 E2
|
|
|
|
|
00F0 | 0F 5F B5 0C 8A 50 FB B0 62 A1 76 8A CD C0 31 71
|
|
|
|
|
0100 | DF 15 7F 52 29 5B 20 82 55 AD 2C CE 37 1B 0B 3C
|
|
|
|
|
0110 | 8C 3A BF 20 52 5C DB 79 33 52 30 FC CF DD 7D 4D
|
|
|
|
|
0120 | 1F 9E FC F1 39 59 8B 9D F5 6F E6 87 BB CC 96 9F
|
|
|
|
|
0130 | E1 30 9E EF 49 02 83 B7 1E B2 46 9D 6C A2 1F 0B
|
|
|
|
|
0140 | 26 AF 91 84 EB 8D CF E3 1E 87 2A 29 DE CA DA D6
|
|
|
|
|
0150 | 2B CE 07 4B D6 26 B2 0C 13 DC B6 AF 43 6A AE 8C
|
|
|
|
|
0160 | 9C CE B2 99 86 51 09 ED B3 46 1C 96 0D 6A 55 4A
|
|
|
|
|
0170 | C6 1A D7 81 2B E5 E9 46 31 49 E0 A0 41 58 88 F8
|
|
|
|
|
0180 | A1 13 98 3B A0 3A 14 19 2B E4 89 37</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>78CB07008462AF66</code></td>
|
|
|
|
|
<td><code>347306003C7BAF66</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>9A35B34BAD37DF538D3FE4B7DC8C94D7</code></td>
|
|
|
|
|
<td><code>0C8B9729D10E24DA2E2A82947D87A702</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>FCF312950D42D98F978F0DF93CCECD0D</code></td>
|
|
|
|
|
<td><code>8F7903D9A06AB54065EF6D1FFD213F95</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE500100DAED234295F32CE16D9A890D</code> <code>3BB3EBB0089477B3E56389BF9ABAC8BF</code> <code>9D623F4BEB358FF69016728C71C8EC39</code> <code>C8ED3502CF04BEA04F42BFCF0A47EF3F</code> <code>D1001AECCD29A9CD5AF88870AB777937</code> <code>DC5F001377E902097356936DB5DF4BBD</code> <code>FFDB5C76DB57245A203A6E8ADAF72E03</code> <code>F499209576532A145997970CC0872B23</code> <code>D148FC4B9D6BD4A16680C616AA82E5C9</code> <code>C9F3D00EA3DF9E1EA8187E1ADBBECC73</code> <code>250F1D39CD77339B442062FC58D0E7E4</code> <code>FB72CD1245EFBE46EB2A4CE662D09F30</code> <code>8E7CB09A2518E3BD3C645C4B57F776AE</code> <code>7409CD625C6D6564082AEC095AD2201B</code> <code>760C1610235198DBF2B58B79A64B7ADA</code> <code>ADD2FABD8D4F8AFF274C6FB64228EA45</code> <code>C5D3EED2D0B9A122E32259EB511C4532</code> <code>673DF4D4DF7BE8F7C7B8C36080E2E3B9</code> <code>59614B6EE7827F502113028E0FEA3821</code> <code>EEF7FBDA8BC7B30AFF1D18AF330C34D9</code> <code>D42046E4DCDC267172530BE1AF9239DC</code><br> <code>544B8E9C</code></td>
|
|
|
|
|
<td><code>FE500100D9626BA9A9ADE28701D75796</code> <code>0D11E73AD335351D53A293E4B971E0FD</code> <code>400658D3657DC012A3118ACCB2C8D457</code> <code>951524AD67357FF26C87394CF2FB1101</code> <code>5F23AC468BAE04CC2C76619AE51C0BD9</code> <code>D42ED8E1727673E3CAFCF43F223C94FD</code> <code>1C2059FEACAD0C8FA50D3A3BE14FDEF4</code> <code>1E5A9DB8A0A285674690CB31F9E3F6F1</code> <code>888375E57FCB329152EB6397E1E3396D</code> <code>FC96FCA872A4F3F23F0FB1EDC792CE0C</code> <code>753294CA57665D8330DB9BF19B63AF9C</code> <code>AF43BB5B877406E20F5FB50C8A50FBB0</code> <code>62A1768ACDC03171DF157F52295B2082</code> <code>55AD2CCE371B0B3C8C3ABF20525CDB79</code> <code>335230FCCFDD7D4D1F9EFCF139598B9D</code> <code>F56FE687BBCC969FE1309EEF490283B7</code> <code>1EB2469D6CA21F0B26AF9184EB8DCFE3</code> <code>1E872A29DECADAD62BCE074BD626B20C</code> <code>13DCB6AF436AAE8C9CCEB299865109ED</code> <code>B3461C960D6A554AC61AD7812BE5E946</code> <code>3149E0A0415888F8A113983BA03A1419</code><br> <code>2BE48937</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 = 0AF0963E0967E2440FCBC0FDB90EA6E2D9F2B82B9D86CA2F567C9B0594306F83691A9406A154B2012DBA785C49C198382197532FEDAAF30F50AD448AB47249C04B09077575D03B9B747CF08315B73FF186EE4F5F76447A8A72B3B7A07B5E549EB7640611A53297BE576ACF9ADF1B506EB91DF1906ACE4948DFA4600CD4376E537BADDC249860A04C951ADB1E2C23698AEEB7E059F1B2624B641D2544980AF36627DB121D7F89F534FC0EDDF6B7E2ADDD5AB01BB6A6D87DC2C71BC9B94C92D4C27CEA3645ADE63CCFCEA9DEDA2983F08CAC8D304E0B7B0959CBC9697ABDD0CA4C42FAD9A4DEB8953F94DB29DAD00D061441164BACE9381A241E5DE0D1D8AA078A</code></pre>
|
|
|
|
|
<pre><code>auth_key = 49827CA79F47864261F384C64C168EA0CADCE8AD89F59DB961E36ABC7963171EF789FFDDD9F4CAAD6A236120D99375CA156E061964F15B453DFE1B369F25420DE8495083EC757BAEFB3ACE9E056315ADC61B2AC0BE3B0469B384E9C82E8D048042C84B25DCDF792289B388505FDD1DAA0AAF7E125DED8E6913DC299DD5F04EB7C0D1D3BD1078CD52297210F896885ABF4D2DE5D9FC08AF0A58FC0755984C6C2C3815A68D9BE731C51626DF46B8D3BBAC5B18080AA5610F9DCB79B727B4E079780DBB8A7CD5E0525AD00CC606D1E374900C20AB5AC2F8673FEF3A512D78D5367D74869306C240041DFE0A96622AE72B40910B12B278B607FF66636B14D0C76A87</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 A4 F4 01 85 62 AF 66
|
|
|
|
|
0010 | 90 00 00 00 34 F7 CB 3B 9A 35 B3 4B AD 37 DF 53
|
|
|
|
|
0020 | 8D 3F E4 B7 DC 8C 94 D7 FC F3 12 95 0D 42 D9 8F
|
|
|
|
|
0030 | 97 8F 0D F9 3C CE CD 0D 9A 1B 8B ED 6E 22 DB FA
|
|
|
|
|
0040 | 13 A6 C1 FB 72 72 A0 4A</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 5C 31 FB 3C 7B AF 66
|
|
|
|
|
0010 | 50 00 00 00 34 F7 CB 3B 0C 8B 97 29 D1 0E 24 DA
|
|
|
|
|
0020 | 2E 2A 82 94 7D 87 A7 02 8F 79 03 D9 A0 6A B5 40
|
|
|
|
|
0030 | 65 EF 6D 1F FD 21 3F 95 B1 A2 31 B6 CA 82 63 D5
|
|
|
|
|
0040 | E8 21 4D F7 F0 15 0C AA</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>01A4F4018562AF66</code></td>
|
|
|
|
|
<td><code>015C31FB3C7BAF66</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>90000000</code> (144 in decimal)</td>
|
|
|
|
|
<td><code>50000000</code> (80 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>9A35B34BAD37DF538D3FE4B7DC8C94D7</code></td>
|
|
|
|
|
<td><code>0C8B9729D10E24DA2E2A82947D87A702</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>FCF312950D42D98F978F0DF93CCECD0D</code></td>
|
|
|
|
|
<td><code>8F7903D9A06AB54065EF6D1FFD213F95</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>9A1B8BED6E22DBFA13A6C1FB7272A04A</code></td>
|
|
|
|
|
<td><code>B1A231B6CA8263D5E8214DF7F0150CAA</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>
|
|
|
|
|