|
|
|
@ -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 B4 BF 0C 00 0B F6 AD 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE F0 AC A2 9E DD B1 89 60
|
|
|
|
|
0020 | 29 31 4F 12 DB 62 CD 21</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 70 57 09 00 4B 13 AE 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE FA 81 5B 46 A7 7A B0 4D
|
|
|
|
|
0020 | 0E 67 B0 BE C8 DA 3D 11</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>B4BF0C000BF6AD66</code></td>
|
|
|
|
|
<td><code>705709004B13AE66</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>F0ACA29EDDB1896029314F12DB62CD21</code></td>
|
|
|
|
|
<td><code>FA815B46A77AB04D0E67B0BEC8DA3D11</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 50 FF D1 0B F6 AD 66
|
|
|
|
|
0010 | A8 00 00 00 63 24 16 05 F0 AC A2 9E DD B1 89 60
|
|
|
|
|
0020 | 29 31 4F 12 DB 62 CD 21 83 76 EE 2E 1C 63 67 59
|
|
|
|
|
0030 | F4 6E 2E 73 0E 2E 6E C7 08 26 2A 73 7B 1A 84 6A
|
|
|
|
|
0040 | B9 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 F8 DF 69 4B 13 AE 66
|
|
|
|
|
0010 | 70 00 00 00 63 24 16 05 FA 81 5B 46 A7 7A B0 4D
|
|
|
|
|
0020 | 0E 67 B0 BE C8 DA 3D 11 E5 0A DA A7 22 70 7E CF
|
|
|
|
|
0030 | 7C 4F 57 81 E8 92 AA 35 08 19 23 2F 10 0B 7D 88
|
|
|
|
|
0040 | E3 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>0150FFD10BF6AD66</code></td>
|
|
|
|
|
<td><code>01F8DF694B13AE66</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>A8000000</code> (168 in decimal)</td>
|
|
|
|
|
<td><code>70000000</code> (112 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>F0ACA29EDDB1896029314F12DB62CD21</code></td>
|
|
|
|
|
<td><code>FA815B46A77AB04D0E67B0BEC8DA3D11</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>8376EE2E1C636759F46E2E730E2E6EC7</code></td>
|
|
|
|
|
<td><code>E50ADAA722707ECF7C4F5781E892AA35</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>08262A737B1A846AB9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2750137495026166457</td>
|
|
|
|
|
<td><code>0819232F100B7D88E3000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1811343221091829987</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 = 2750137495026166457</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2750137495026166457 = 1552845121 * 1771031417</code></p>
|
|
|
|
|
<pre><code>p = 1552845121
|
|
|
|
|
q = 1771031417</code></pre>
|
|
|
|
|
<pre><code>pq = 1811343221091829987</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1811343221091829987 = 1304209321 * 1388843947</code></p>
|
|
|
|
|
<pre><code>p = 1304209321
|
|
|
|
|
q = 1388843947</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 26 2A 73 7B 1A 84 6A B9 00 00 00
|
|
|
|
|
0010 | 04 5C 8E 89 41 00 00 00 04 69 8F CB 79 00 00 00
|
|
|
|
|
0020 | F0 AC A2 9E DD B1 89 60 29 31 4F 12 DB 62 CD 21
|
|
|
|
|
0030 | 83 76 EE 2E 1C 63 67 59 F4 6E 2E 73 0E 2E 6E C7
|
|
|
|
|
0040 | 6D F4 78 EF 94 4C E8 1C 45 EE 89 A8 3C F7 C0 BB
|
|
|
|
|
0050 | C2 EA F7 22 B7 02 E6 98 7D 0C 1E C1 48 2D 61 A0
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 19 23 2F 10 0B 7D 88 E3 00 00 00
|
|
|
|
|
0010 | 04 4D BC A7 A9 00 00 00 04 52 C8 13 AB 00 00 00
|
|
|
|
|
0020 | FA 81 5B 46 A7 7A B0 4D 0E 67 B0 BE C8 DA 3D 11
|
|
|
|
|
0030 | E5 0A DA A7 22 70 7E CF 7C 4F 57 81 E8 92 AA 35
|
|
|
|
|
0040 | 58 B0 64 81 FE EA BA 7A AD 98 DB A2 61 04 B4 54
|
|
|
|
|
0050 | 65 6B DC F2 F7 2E D2 4C 10 55 4E 40 43 4D 5C 29
|
|
|
|
|
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 = 1771031417</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>08262A737B1A846AB9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2750137495026166457</td>
|
|
|
|
|
<td><code>0819232F100B7D88E3000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1811343221091829987</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>045C8E8941000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1552845121</td>
|
|
|
|
|
<td><code>044DBCA7A9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1304209321</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>04698FCB79000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1771031417</td>
|
|
|
|
|
<td><code>0452C813AB000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1388843947</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>F0ACA29EDDB1896029314F12DB62CD21</code></td>
|
|
|
|
|
<td><code>FA815B46A77AB04D0E67B0BEC8DA3D11</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>8376EE2E1C636759F46E2E730E2E6EC7</code></td>
|
|
|
|
|
<td><code>E50ADAA722707ECF7C4F5781E892AA35</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>6DF478EF944CE81C45EE89A83CF7C0BB</code> <code>C2EAF722B702E6987D0C1EC1482D61A0</code></td>
|
|
|
|
|
<td><code>58B06481FEEABA7AAD98DBA26104B454</code> <code>656BDCF2F72ED24C10554E40434D5C29</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1771031417</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 = 955FF5A908262A737B1A846AB9000000045C8E894100000004698FCB79000000F0ACA29EDDB1896029314F12DB62CD218376EE2E1C636759F46E2E730E2E6EC76DF478EF944CE81C45EE89A83CF7C0BBC2EAF722B702E6987D0C1EC1482D61A002000000
|
|
|
|
|
random_padding_bytes = C1F2D2CDEF3854AE89B94056EFFB2698D5800FC9810C28426AB1E84921930053171ADAF0766CCB184C5CCDC510AD510376574A587BCBCA889B4A12BB5A0018325CC489B62FC1F26D08EAE2FC658FC3D253196A9AA976595C11CB68E7</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A90819232F100B7D88E3000000044DBCA7A90000000452C813AB000000FA815B46A77AB04D0E67B0BEC8DA3D11E50ADAA722707ECF7C4F5781E892AA3558B06481FEEABA7AAD98DBA26104B454656BDCF2F72ED24C10554E40434D5C2902000000
|
|
|
|
|
random_padding_bytes = 04C5C46443A6EF221BA78FF4666AE0721F5E50B8B927D6571C1D4892BA380EF6997CB7F446AB528FA50E568FC758FB15B753B0067236F6E0AA8297A3124DB8EFA15445A212782899AE86E6BE92B93480030B80519BB97F63BEA3F9D8</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 = 61795825E9E858533CA4821B1E5301DFC47AD6ECBCB491F6526F390698EFE9CE7023E6EFB80B736694F4F69644D8B048869DD23895F323E82AB98D4269B99957AB1DE53D0C976D96B55EC9B6C6A0D8F93710FD474CA788C2820937F8DD3F815E233A3819C3EABBB0EFB1BAD9D02206D683109D7F3EADA7FF15ADC9EE7303EDF7E72E60AD9EA19E628885ED3A754C4D06F07D389F00142CA3B25C5DC954B319D25D27CCB0AA0D108163E861AD08278F4B9B20A98DED9885954EF0731910A07CF82FD6A3047D99D18F9E3D7D422F72C2222C2743BA23251B0EC6548D767D8CB138F82952E05AD343C3D8BF959008D496137B6ED55969BBC2C71B96903947467D84</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 3EA103DF2447F70A03DD7BFA6D5FDC1A5E89C7F8A2492958BA44EFC5175D08338912E231636983AC3348199ACA758305A044E58DCA9A8385FD0CEDDCDB3B02B54BE9A335C4986672500D125439FBA23A2A05135E91E0C038C33F967379843963CDF720C484FECE85CF1E6B8E2662CA163A6C088D3A6E8B565363C863A1FD856BBE2AFFAE4AEF950270B6672EE3B17AB91800B792034BDB606B0BFEB46203A540B10C60862038151BE15CCD9262CEBE229E68389A28087E90556B1F65DBCEEACF9E921F42BA763E11B0EF10633F87D5497ADA937191EF8DBB833FF67F0AE5D653FDFD6BB484ECDCA802F370FCE50955A1C521E618C53478F31FA44813EDBA7F6B</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 48 92 0D 00 0C F6 AD 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 F0 AC A2 9E DD B1 89 60
|
|
|
|
|
0020 | 29 31 4F 12 DB 62 CD 21 83 76 EE 2E 1C 63 67 59
|
|
|
|
|
0030 | F4 6E 2E 73 0E 2E 6E C7 04 5C 8E 89 41 00 00 00
|
|
|
|
|
0040 | 04 69 8F CB 79 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 61 79 58 25 E9 E8 58 53 3C A4 82 1B
|
|
|
|
|
0060 | 1E 53 01 DF C4 7A D6 EC BC B4 91 F6 52 6F 39 06
|
|
|
|
|
0070 | 98 EF E9 CE 70 23 E6 EF B8 0B 73 66 94 F4 F6 96
|
|
|
|
|
0080 | 44 D8 B0 48 86 9D D2 38 95 F3 23 E8 2A B9 8D 42
|
|
|
|
|
0090 | 69 B9 99 57 AB 1D E5 3D 0C 97 6D 96 B5 5E C9 B6
|
|
|
|
|
00A0 | C6 A0 D8 F9 37 10 FD 47 4C A7 88 C2 82 09 37 F8
|
|
|
|
|
00B0 | DD 3F 81 5E 23 3A 38 19 C3 EA BB B0 EF B1 BA D9
|
|
|
|
|
00C0 | D0 22 06 D6 83 10 9D 7F 3E AD A7 FF 15 AD C9 EE
|
|
|
|
|
00D0 | 73 03 ED F7 E7 2E 60 AD 9E A1 9E 62 88 85 ED 3A
|
|
|
|
|
00E0 | 75 4C 4D 06 F0 7D 38 9F 00 14 2C A3 B2 5C 5D C9
|
|
|
|
|
00F0 | 54 B3 19 D2 5D 27 CC B0 AA 0D 10 81 63 E8 61 AD
|
|
|
|
|
0100 | 08 27 8F 4B 9B 20 A9 8D ED 98 85 95 4E F0 73 19
|
|
|
|
|
0110 | 10 A0 7C F8 2F D6 A3 04 7D 99 D1 8F 9E 3D 7D 42
|
|
|
|
|
0120 | 2F 72 C2 22 2C 27 43 BA 23 25 1B 0E C6 54 8D 76
|
|
|
|
|
0130 | 7D 8C B1 38 F8 29 52 E0 5A D3 43 C3 D8 BF 95 90
|
|
|
|
|
0140 | 08 D4 96 13 7B 6E D5 59 69 BB C2 C7 1B 96 90 39
|
|
|
|
|
0150 | 47 46 7D 84</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 74 57 09 00 4B 13 AE 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 FA 81 5B 46 A7 7A B0 4D
|
|
|
|
|
0020 | 0E 67 B0 BE C8 DA 3D 11 E5 0A DA A7 22 70 7E CF
|
|
|
|
|
0030 | 7C 4F 57 81 E8 92 AA 35 04 4D BC A7 A9 00 00 00
|
|
|
|
|
0040 | 04 52 C8 13 AB 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 3E A1 03 DF 24 47 F7 0A 03 DD 7B FA
|
|
|
|
|
0060 | 6D 5F DC 1A 5E 89 C7 F8 A2 49 29 58 BA 44 EF C5
|
|
|
|
|
0070 | 17 5D 08 33 89 12 E2 31 63 69 83 AC 33 48 19 9A
|
|
|
|
|
0080 | CA 75 83 05 A0 44 E5 8D CA 9A 83 85 FD 0C ED DC
|
|
|
|
|
0090 | DB 3B 02 B5 4B E9 A3 35 C4 98 66 72 50 0D 12 54
|
|
|
|
|
00A0 | 39 FB A2 3A 2A 05 13 5E 91 E0 C0 38 C3 3F 96 73
|
|
|
|
|
00B0 | 79 84 39 63 CD F7 20 C4 84 FE CE 85 CF 1E 6B 8E
|
|
|
|
|
00C0 | 26 62 CA 16 3A 6C 08 8D 3A 6E 8B 56 53 63 C8 63
|
|
|
|
|
00D0 | A1 FD 85 6B BE 2A FF AE 4A EF 95 02 70 B6 67 2E
|
|
|
|
|
00E0 | E3 B1 7A B9 18 00 B7 92 03 4B DB 60 6B 0B FE B4
|
|
|
|
|
00F0 | 62 03 A5 40 B1 0C 60 86 20 38 15 1B E1 5C CD 92
|
|
|
|
|
0100 | 62 CE BE 22 9E 68 38 9A 28 08 7E 90 55 6B 1F 65
|
|
|
|
|
0110 | DB CE EA CF 9E 92 1F 42 BA 76 3E 11 B0 EF 10 63
|
|
|
|
|
0120 | 3F 87 D5 49 7A DA 93 71 91 EF 8D BB 83 3F F6 7F
|
|
|
|
|
0130 | 0A E5 D6 53 FD FD 6B B4 84 EC DC A8 02 F3 70 FC
|
|
|
|
|
0140 | E5 09 55 A1 C5 21 E6 18 C5 34 78 F3 1F A4 48 13
|
|
|
|
|
0150 | ED BA 7F 6B</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 = C1F2D2CDEF3854AE89B94056EFFB2698D5800FC9810C28426AB1E8492
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>48920D000CF6AD66</code></td>
|
|
|
|
|
<td><code>745709004B13AE66</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 = C1F2D2CDEF3854AE89B94056EFFB2698D5800FC9810C28426AB1E8492
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>F0ACA29EDDB1896029314F12DB62CD21</code></td>
|
|
|
|
|
<td><code>FA815B46A77AB04D0E67B0BEC8DA3D11</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>8376EE2E1C636759F46E2E730E2E6EC7</code></td>
|
|
|
|
|
<td><code>E50ADAA722707ECF7C4F5781E892AA35</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>045C8E8941000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1552845121</td>
|
|
|
|
|
<td><code>044DBCA7A9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1304209321</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>04698FCB79000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1771031417</td>
|
|
|
|
|
<td><code>0452C813AB000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1388843947</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 = C1F2D2CDEF3854AE89B94056EFFB2698D5800FC9810C28426AB1E8492
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE00010061795825E9E858533CA4821B</code> <code>1E5301DFC47AD6ECBCB491F6526F3906</code> <code>98EFE9CE7023E6EFB80B736694F4F696</code> <code>44D8B048869DD23895F323E82AB98D42</code> <code>69B99957AB1DE53D0C976D96B55EC9B6</code> <code>C6A0D8F93710FD474CA788C2820937F8</code> <code>DD3F815E233A3819C3EABBB0EFB1BAD9</code> <code>D02206D683109D7F3EADA7FF15ADC9EE</code> <code>7303EDF7E72E60AD9EA19E628885ED3A</code> <code>754C4D06F07D389F00142CA3B25C5DC9</code> <code>54B319D25D27CCB0AA0D108163E861AD</code> <code>08278F4B9B20A98DED9885954EF07319</code> <code>10A07CF82FD6A3047D99D18F9E3D7D42</code> <code>2F72C2222C2743BA23251B0EC6548D76</code> <code>7D8CB138F82952E05AD343C3D8BF9590</code> <code>08D496137B6ED55969BBC2C71B969039</code><br> <code>47467D84</code></td>
|
|
|
|
|
<td><code>FE0001003EA103DF2447F70A03DD7BFA</code> <code>6D5FDC1A5E89C7F8A2492958BA44EFC5</code> <code>175D08338912E231636983AC3348199A</code> <code>CA758305A044E58DCA9A8385FD0CEDDC</code> <code>DB3B02B54BE9A335C4986672500D1254</code> <code>39FBA23A2A05135E91E0C038C33F9673</code> <code>79843963CDF720C484FECE85CF1E6B8E</code> <code>2662CA163A6C088D3A6E8B565363C863</code> <code>A1FD856BBE2AFFAE4AEF950270B6672E</code> <code>E3B17AB91800B792034BDB606B0BFEB4</code> <code>6203A540B10C60862038151BE15CCD92</code> <code>62CEBE229E68389A28087E90556B1F65</code> <code>DBCEEACF9E921F42BA763E11B0EF1063</code> <code>3F87D5497ADA937191EF8DBB833FF67F</code> <code>0AE5D653FDFD6BB484ECDCA802F370FC</code> <code>E50955A1C521E618C53478F31FA44813</code><br> <code>EDBA7F6B</code></td>
|
|
|
|
|
<td>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = C1F2D2CDEF3854AE89B94056EFFB2698D5800FC9810C28426AB1E8492
|
|
|
|
|
<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 A0 D3 92 0C F6 AD 66
|
|
|
|
|
0010 | D0 02 00 00 5C 07 E8 D0 F0 AC A2 9E DD B1 89 60
|
|
|
|
|
0020 | 29 31 4F 12 DB 62 CD 21 83 76 EE 2E 1C 63 67 59
|
|
|
|
|
0030 | F4 6E 2E 73 0E 2E 6E C7 FE 50 02 00 AD EF FE 96
|
|
|
|
|
0040 | 37 BB DF B6 39 ED FD CE 09 8D 22 3C 20 6C 55 04
|
|
|
|
|
0050 | A1 3A 67 FF E4 99 40 4D 4C B3 34 17 A2 75 3A A0
|
|
|
|
|
0060 | 70 2A 0F BE 62 33 35 33 F1 BB 27 A0 C3 C0 43 F9
|
|
|
|
|
0070 | 7F A6 7A 94 EE 3E A7 7C D7 19 17 14 5F 96 3C 43
|
|
|
|
|
0080 | EF CF B4 82 81 F9 6C 2A 77 8F 93 87 96 14 64 7D
|
|
|
|
|
0090 | 8B BF AC 2C B9 48 73 77 64 63 4B CA 6F 8A 4E 75
|
|
|
|
|
00A0 | AA 98 29 25 EF 60 AD CE AB 3A 29 EA D2 AD 4C 79
|
|
|
|
|
00B0 | AE C2 94 A2 0C FB D3 D0 A7 17 75 20 11 3E 6E F2
|
|
|
|
|
00C0 | 97 B9 4C FF 0C 12 0F A7 A2 3F 63 DF DD C0 78 D1
|
|
|
|
|
00D0 | DB 5E 45 25 CF AC E8 A0 0E 1C AF F9 3E 83 F8 49
|
|
|
|
|
00E0 | 2B 2D 79 F2 FC 82 E4 F6 0F 6A 49 4C E9 33 0B 40
|
|
|
|
|
00F0 | 9D 5B DB B2 A5 94 BA C1 13 40 14 02 4F 7E 94 99
|
|
|
|
|
0100 | 8E 6A 82 A5 8F 58 54 CF 73 B3 64 7C 33 A9 35 E7
|
|
|
|
|
0110 | 3C B1 BA CF B7 57 69 5D E7 E6 B6 C4 1D 58 EB AD
|
|
|
|
|
0120 | 47 27 B5 5C D0 26 42 68 58 E3 60 CC 4B FB 44 05
|
|
|
|
|
0130 | 3D D4 81 C8 B0 29 BA DF 19 03 0F 36 FF B6 7D B1
|
|
|
|
|
0140 | 26 D0 D2 19 6F A1 BA A3 F0 6E 47 47 56 4A 94 4C
|
|
|
|
|
0150 | 79 CC 7A 01 2F 61 1C 28 93 4E 61 61 54 99 F5 40
|
|
|
|
|
0160 | D9 D7 BE EE A8 A4 C1 F1 7E 4B D0 D8 74 B1 D8 BD
|
|
|
|
|
0170 | 1D E1 5F 70 FC 4E 4D D8 E8 5D 26 52 DA BE BE B8
|
|
|
|
|
0180 | 51 BB 37 2F D3 4C 76 86 C0 77 8E BF 06 0A 3D C7
|
|
|
|
|
0190 | EF 92 F9 60 DE F0 2D 64 05 6D AC 3D 31 A8 B5 95
|
|
|
|
|
01A0 | 09 51 39 03 5A 81 57 79 E0 BF B1 BF 19 D6 95 43
|
|
|
|
|
01B0 | F3 D6 F1 72 A8 DF 15 46 CD 69 58 FE 63 61 59 C5
|
|
|
|
|
01C0 | CD 10 48 13 B5 72 A5 9B 6B E0 AA C3 8A 26 49 B0
|
|
|
|
|
01D0 | 8F D6 BD A5 B1 AA 5C F0 42 C0 C5 7D 60 69 5B 35
|
|
|
|
|
01E0 | 22 E1 D8 41 CE 34 44 C9 30 FF D5 D6 9E A4 3F 76
|
|
|
|
|
01F0 | AB 87 03 7F 7E A9 29 FD F8 0D 36 28 4B C9 74 E5
|
|
|
|
|
0200 | 3A BF 5D 32 20 45 B5 56 96 4A BD 42 F1 BF 62 AA
|
|
|
|
|
0210 | 5D 78 43 EC 11 69 C7 AC 71 44 13 AB AA 4B B5 6A
|
|
|
|
|
0220 | EB 5C EE 9A 0C 98 B0 DD 38 5C BF D0 EA 68 8B 25
|
|
|
|
|
0230 | F2 4E 8F 1C 53 BE 8E FF B9 EC 43 E5 E0 35 0B B4
|
|
|
|
|
0240 | 69 56 D0 C7 FF 5F E1 F8 16 8A EA 5B A5 6B CA ED
|
|
|
|
|
0250 | CC B6 60 7C 6B 2E 6F ED B6 EA C9 34 3E 36 D6 4D
|
|
|
|
|
0260 | 10 60 CB 56 4B 2B 27 DA A4 37 27 37 79 C3 EA 45
|
|
|
|
|
0270 | 50 CA C5 66 C6 79 EA 07 01 3C C8 CD A4 E4 29 92
|
|
|
|
|
0280 | 11 02 C3 5D 5E 24 FB D1 94 41 C8 66</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 74 19 27 4C 13 AE 66
|
|
|
|
|
0010 | D8 02 00 00 5C 07 E8 D0 FA 81 5B 46 A7 7A B0 4D
|
|
|
|
|
0020 | 0E 67 B0 BE C8 DA 3D 11 E5 0A DA A7 22 70 7E CF
|
|
|
|
|
0030 | 7C 4F 57 81 E8 92 AA 35 FE 50 02 00 5C C2 27 63
|
|
|
|
|
0040 | D0 A4 8D 44 85 D1 B4 1E B6 3F BE F2 5F 3E 09 A7
|
|
|
|
|
0050 | 97 EE F4 D0 D5 46 4B A2 C6 07 49 95 6C D5 E3 B1
|
|
|
|
|
0060 | 2D 6B 59 F9 64 BA AE 64 B3 DA 25 9A 95 65 1A 3B
|
|
|
|
|
0070 | 8D 3C 2E AB 13 73 78 7E 5B 2A 35 40 D2 BB 22 3C
|
|
|
|
|
0080 | 0A 4B 77 03 82 CA 1D 41 40 04 27 59 9B 05 6E CE
|
|
|
|
|
0090 | 8F BB C7 00 C3 A7 84 DF B7 04 1E A9 1C 44 D3 50
|
|
|
|
|
00A0 | 78 06 4F 7C 02 1F E9 D5 FC 44 CC F8 FB DE 15 DF
|
|
|
|
|
00B0 | EC 4C 47 3A C8 65 83 EB 90 A2 07 1C 3A F4 E3 67
|
|
|
|
|
00C0 | F8 34 A0 CD E6 3C 53 59 39 26 A7 33 34 40 3A D8
|
|
|
|
|
00D0 | B5 F9 34 85 66 37 E2 35 10 B0 9F 5A F1 A6 D2 BC
|
|
|
|
|
00E0 | 05 4D 28 A4 B1 C4 3E 1C FC FE 0E 9B 28 2E DB 69
|
|
|
|
|
00F0 | BF D4 6F 6A AC 4D B4 26 71 38 CF 54 68 A6 4D 0A
|
|
|
|
|
0100 | 89 C3 86 9A 4F C9 3C 72 3E 50 4C 5B 82 A0 F1 11
|
|
|
|
|
0110 | 70 49 A1 BA 19 68 92 89 DA C1 62 48 7F F6 A2 AC
|
|
|
|
|
0120 | 37 20 8A BE CF DA 93 23 81 D8 10 73 9A 75 09 B5
|
|
|
|
|
0130 | FE CC 39 BA DD 41 78 86 2D B4 40 6B 03 C0 05 E3
|
|
|
|
|
0140 | 02 DE 53 A9 96 0A C0 40 A9 99 D9 D0 46 5D 31 D6
|
|
|
|
|
0150 | 4E 4D F4 F9 51 86 BE 99 B1 5B 2C D6 82 17 38 32
|
|
|
|
|
0160 | 34 99 10 23 8A 96 4E 8C D3 3A D8 A3 E8 9B BF 72
|
|
|
|
|
0170 | 9C 45 B8 EA C4 12 4C 71 4A 06 E0 DE 0F 51 13 5A
|
|
|
|
|
0180 | 79 72 2A 98 02 7A 50 99 33 E5 FB E0 BC 63 8B 49
|
|
|
|
|
0190 | 45 ED 75 9A DA 49 6D BA 80 45 0D 64 62 1B 59 34
|
|
|
|
|
01A0 | DC 08 EF E5 E6 4F EE 22 35 5E B4 5A E0 C7 DF 2A
|
|
|
|
|
01B0 | 68 5C AE FC 9A 7F E5 17 CC 3D 00 3B 77 8D 4C D7
|
|
|
|
|
01C0 | C7 A6 5F 74 BD 03 C8 12 2E A8 14 2D 75 A8 E1 44
|
|
|
|
|
01D0 | 60 3D CF D6 63 E1 23 3C 6C BC A3 32 37 FE F8 72
|
|
|
|
|
01E0 | 79 65 02 6F A7 2C 1E 2A 27 91 65 B4 A0 9B B5 A0
|
|
|
|
|
01F0 | 6A AF 14 90 98 2A 8C 18 09 80 52 D8 BF 22 10 40
|
|
|
|
|
0200 | 4C 28 C8 B7 C3 E2 76 69 F0 91 3B 6F 7F BE BF 6D
|
|
|
|
|
0210 | 57 FA 3C 42 0F F1 05 07 D6 6E 88 80 58 F8 0C B5
|
|
|
|
|
0220 | F8 57 B7 5B DF 01 4D 3F 27 BE 87 F9 00 A2 F3 D9
|
|
|
|
|
0230 | 20 9B 79 78 30 87 E0 BC 74 94 F1 CC 9D 1B 93 7B
|
|
|
|
|
0240 | ED E6 55 46 7E 61 5F 30 1C FB 94 05 F9 8F 39 79
|
|
|
|
|
0250 | 31 74 69 E7 B9 22 3E 5E AA 30 C4 90 0E E5 3F C0
|
|
|
|
|
0260 | BF E6 1B 0A 79 32 5F 1B FB 23 36 29 02 C9 88 DD
|
|
|
|
|
0270 | 30 56 B7 45 46 A6 DE 4C E8 B6 B8 7F 36 BE 8F 79
|
|
|
|
|
0280 | 19 EE 63 27 D7 E9 F8 0E 82 C4 08 39</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 = C1F2D2CDEF3854AE89B94056EFFB2698D5800FC9810C28426AB1E8492
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>01A0D3920CF6AD66</code></td>
|
|
|
|
|
<td><code>017419274C13AE66</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>D0020000</code> (720 in decimal)</td>
|
|
|
|
|
<td><code>D8020000</code> (728 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -482,19 +482,19 @@ random_padding_bytes = C1F2D2CDEF3854AE89B94056EFFB2698D5800FC9810C28426AB1E8492
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>F0ACA29EDDB1896029314F12DB62CD21</code></td>
|
|
|
|
|
<td><code>FA815B46A77AB04D0E67B0BEC8DA3D11</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>8376EE2E1C636759F46E2E730E2E6EC7</code></td>
|
|
|
|
|
<td><code>E50ADAA722707ECF7C4F5781E892AA35</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE500200ADEFFE9637BBDFB639EDFDCE</code> <code>098D223C206C5504A13A67FFE499404D</code> <code>4CB33417A2753AA0702A0FBE62333533</code> <code>F1BB27A0C3C043F97FA67A94EE3EA77C</code> <code>D71917145F963C43EFCFB48281F96C2A</code> <code>778F93879614647D8BBFAC2CB9487377</code> <code>64634BCA6F8A4E75AA982925EF60ADCE</code> <code>AB3A29EAD2AD4C79AEC294A20CFBD3D0</code> <code>A7177520113E6EF297B94CFF0C120FA7</code> <code>A23F63DFDDC078D1DB5E4525CFACE8A0</code> <code>0E1CAFF93E83F8492B2D79F2FC82E4F6</code> <code>0F6A494CE9330B409D5BDBB2A594BAC1</code> <code>134014024F7E94998E6A82A58F5854CF</code> <code>73B3647C33A935E73CB1BACFB757695D</code> <code>E7E6B6C41D58EBAD4727B55CD0264268</code> <code>58E360CC4BFB44053DD481C8B029BADF</code> <code>19030F36FFB67DB126D0D2196FA1BAA3</code> <code>F06E4747564A944C79CC7A012F611C28</code> <code>934E61615499F540D9D7BEEEA8A4C1F1</code> <code>7E4BD0D874B1D8BD1DE15F70FC4E4DD8</code> <code>E85D2652DABEBEB851BB372FD34C7686</code> <code>C0778EBF060A3DC7EF92F960DEF02D64</code> <code>056DAC3D31A8B595095139035A815779</code> <code>E0BFB1BF19D69543F3D6F172A8DF1546</code> <code>CD6958FE636159C5CD104813B572A59B</code> <code>6BE0AAC38A2649B08FD6BDA5B1AA5CF0</code> <code>42C0C57D60695B3522E1D841CE3444C9</code> <code>30FFD5D69EA43F76AB87037F7EA929FD</code> <code>F80D36284BC974E53ABF5D322045B556</code> <code>964ABD42F1BF62AA5D7843EC1169C7AC</code> <code>714413ABAA4BB56AEB5CEE9A0C98B0DD</code> <code>385CBFD0EA688B25F24E8F1C53BE8EFF</code> <code>B9EC43E5E0350BB46956D0C7FF5FE1F8</code> <code>168AEA5BA56BCAEDCCB6607C6B2E6FED</code> <code>B6EAC9343E36D64D1060CB564B2B27DA</code> <code>A437273779C3EA4550CAC566C679EA07</code> <code>013CC8CDA4E429921102C35D5E24FBD1</code><br> <code>9441C866</code></td>
|
|
|
|
|
<td><code>FE5002005CC22763D0A48D4485D1B41E</code> <code>B63FBEF25F3E09A797EEF4D0D5464BA2</code> <code>C60749956CD5E3B12D6B59F964BAAE64</code> <code>B3DA259A95651A3B8D3C2EAB1373787E</code> <code>5B2A3540D2BB223C0A4B770382CA1D41</code> <code>400427599B056ECE8FBBC700C3A784DF</code> <code>B7041EA91C44D35078064F7C021FE9D5</code> <code>FC44CCF8FBDE15DFEC4C473AC86583EB</code> <code>90A2071C3AF4E367F834A0CDE63C5359</code> <code>3926A73334403AD8B5F934856637E235</code> <code>10B09F5AF1A6D2BC054D28A4B1C43E1C</code> <code>FCFE0E9B282EDB69BFD46F6AAC4DB426</code> <code>7138CF5468A64D0A89C3869A4FC93C72</code> <code>3E504C5B82A0F1117049A1BA19689289</code> <code>DAC162487FF6A2AC37208ABECFDA9323</code> <code>81D810739A7509B5FECC39BADD417886</code> <code>2DB4406B03C005E302DE53A9960AC040</code> <code>A999D9D0465D31D64E4DF4F95186BE99</code> <code>B15B2CD682173832349910238A964E8C</code> <code>D33AD8A3E89BBF729C45B8EAC4124C71</code> <code>4A06E0DE0F51135A79722A98027A5099</code> <code>33E5FBE0BC638B4945ED759ADA496DBA</code> <code>80450D64621B5934DC08EFE5E64FEE22</code> <code>355EB45AE0C7DF2A685CAEFC9A7FE517</code> <code>CC3D003B778D4CD7C7A65F74BD03C812</code> <code>2EA8142D75A8E144603DCFD663E1233C</code> <code>6CBCA33237FEF8727965026FA72C1E2A</code> <code>279165B4A09BB5A06AAF1490982A8C18</code> <code>098052D8BF2210404C28C8B7C3E27669</code> <code>F0913B6F7FBEBF6D57FA3C420FF10507</code> <code>D66E888058F80CB5F857B75BDF014D3F</code> <code>27BE87F900A2F3D9209B79783087E0BC</code> <code>7494F1CC9D1B937BEDE655467E615F30</code> <code>1CFB9405F98F3979317469E7B9223E5E</code> <code>AA30C4900EE53FC0BFE61B0A79325F1B</code> <code>FB23362902C988DD3056B74546A6DE4C</code> <code>E8B6B87F36BE8F7919EE6327D7E9F80E</code><br> <code>82C40839</code></td>
|
|
|
|
|
<td>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = C1F2D2CDEF3854AE89B94056EFFB2698D5800FC9810C28426AB1E8492
|
|
|
|
|
<!-- 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 = ADEFFE9637BBDFB639EDFDCE098D223C206C5504A13A67FFE499404D4CB33417A2753AA0702A0FBE62333533F1BB27A0C3C043F97FA67A94EE3EA77CD71917145F963C43EFCFB48281F96C2A778F93879614647D8BBFAC2CB948737764634BCA6F8A4E75AA982925EF60ADCEAB3A29EAD2AD4C79AEC294A20CFBD3D0A7177520113E6EF297B94CFF0C120FA7A23F63DFDDC078D1DB5E4525CFACE8A00E1CAFF93E83F8492B2D79F2FC82E4F60F6A494CE9330B409D5BDBB2A594BAC1134014024F7E94998E6A82A58F5854CF73B3647C33A935E73CB1BACFB757695DE7E6B6C41D58EBAD4727B55CD026426858E360CC4BFB44053DD481C8B029BADF19030F36FFB67DB126D0D2196FA1BAA3F06E4747564A944C79CC7A012F611C28934E61615499F540D9D7BEEEA8A4C1F17E4BD0D874B1D8BD1DE15F70FC4E4DD8E85D2652DABEBEB851BB372FD34C7686C0778EBF060A3DC7EF92F960DEF02D64056DAC3D31A8B595095139035A815779E0BFB1BF19D69543F3D6F172A8DF1546CD6958FE636159C5CD104813B572A59B6BE0AAC38A2649B08FD6BDA5B1AA5CF042C0C57D60695B3522E1D841CE3444C930FFD5D69EA43F76AB87037F7EA929FDF80D36284BC974E53ABF5D322045B556964ABD42F1BF62AA5D7843EC1169C7AC714413ABAA4BB56AEB5CEE9A0C98B0DD385CBFD0EA688B25F24E8F1C53BE8EFFB9EC43E5E0350BB46956D0C7FF5FE1F8168AEA5BA56BCAEDCCB6607C6B2E6FEDB6EAC9343E36D64D1060CB564B2B27DAA437273779C3EA4550CAC566C679EA07013CC8CDA4E429921102C35D5E24FBD19441C866
|
|
|
|
|
tmp_aes_key = 8634B5B575895BB3222A82D51134822E39AF5B7980C38A8C69B2CC5A99BB75F8
|
|
|
|
|
tmp_aes_iv = D80196DAD8E089E3845420D104466664471C270AAD44A0C1D02D09226DF478EF</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = 5CC22763D0A48D4485D1B41EB63FBEF25F3E09A797EEF4D0D5464BA2C60749956CD5E3B12D6B59F964BAAE64B3DA259A95651A3B8D3C2EAB1373787E5B2A3540D2BB223C0A4B770382CA1D41400427599B056ECE8FBBC700C3A784DFB7041EA91C44D35078064F7C021FE9D5FC44CCF8FBDE15DFEC4C473AC86583EB90A2071C3AF4E367F834A0CDE63C53593926A73334403AD8B5F934856637E23510B09F5AF1A6D2BC054D28A4B1C43E1CFCFE0E9B282EDB69BFD46F6AAC4DB4267138CF5468A64D0A89C3869A4FC93C723E504C5B82A0F1117049A1BA19689289DAC162487FF6A2AC37208ABECFDA932381D810739A7509B5FECC39BADD4178862DB4406B03C005E302DE53A9960AC040A999D9D0465D31D64E4DF4F95186BE99B15B2CD682173832349910238A964E8CD33AD8A3E89BBF729C45B8EAC4124C714A06E0DE0F51135A79722A98027A509933E5FBE0BC638B4945ED759ADA496DBA80450D64621B5934DC08EFE5E64FEE22355EB45AE0C7DF2A685CAEFC9A7FE517CC3D003B778D4CD7C7A65F74BD03C8122EA8142D75A8E144603DCFD663E1233C6CBCA33237FEF8727965026FA72C1E2A279165B4A09BB5A06AAF1490982A8C18098052D8BF2210404C28C8B7C3E27669F0913B6F7FBEBF6D57FA3C420FF10507D66E888058F80CB5F857B75BDF014D3F27BE87F900A2F3D9209B79783087E0BC7494F1CC9D1B937BEDE655467E615F301CFB9405F98F3979317469E7B9223E5EAA30C4900EE53FC0BFE61B0A79325F1BFB23362902C988DD3056B74546A6DE4CE8B6B87F36BE8F7919EE6327D7E9F80E82C40839
|
|
|
|
|
tmp_aes_key = 2C3D78217FE608212E6780397D2A973F122F7CF405C3F3C3257C020D0F2E33E8
|
|
|
|
|
tmp_aes_iv = AA997469EFC62EFE8C738D37FF7ABD558C8C6684180857D8DCAAB08658B06481</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = 61EC5F0CF1AE9AAAC1F9B8C3BD98C9C6EF88FB20BA0D89B5F0ACA29EDDB1896029314F12DB62CD218376EE2E1C636759F46E2E730E2E6EC703000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010064742883AE847796873D5C9CBE20D6596437737F7D2CF2DCE49F3592EC16ED1316357BFC3E536D8DB852D879EA0F11AD292D86E56167788D53D562BFF6F8455871B81E0E15432CF99051EF92A4C1C9E0761FBADC22664B8594F116109818FD6801B2B385949FE0DAEF266CE093046759DB29BC4593F4821780170F8F04A7172F6BBDFDA4AC2482B14AAFAC815DA8F2C262C38009F6F3CABB6EFADED2022728DB909DC9B1803D36DA3487E17307BA3CD5F38CAA08147C8989ACE4041899A7ABE27AF8194F34BA64C4ADC714135571A26746A870CF283822C5D6BA0FEE962DEC61EACA32637FDD30ECB8C73EFAD5C9B307215379FF889299074D92B9D8F154F49B0CF6AD6695DC5A732F9B3982
|
|
|
|
|
answer = BA0D89B5F0ACA29EDDB1896029314F12DB62CD218376EE2E1C636759F46E2E730E2E6EC703000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010064742883AE847796873D5C9CBE20D6596437737F7D2CF2DCE49F3592EC16ED1316357BFC3E536D8DB852D879EA0F11AD292D86E56167788D53D562BFF6F8455871B81E0E15432CF99051EF92A4C1C9E0761FBADC22664B8594F116109818FD6801B2B385949FE0DAEF266CE093046759DB29BC4593F4821780170F8F04A7172F6BBDFDA4AC2482B14AAFAC815DA8F2C262C38009F6F3CABB6EFADED2022728DB909DC9B1803D36DA3487E17307BA3CD5F38CAA08147C8989ACE4041899A7ABE27AF8194F34BA64C4ADC714135571A26746A870CF283822C5D6BA0FEE962DEC61EACA32637FDD30ECB8C73EFAD5C9B307215379FF889299074D92B9D8F154F49B0CF6AD6695DC5A732F9B3982</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = C86EA29D37C29B76A0BFC6C742197280790A4CF9BA0D89B5FA815B46A77AB04D0E67B0BEC8DA3D11E50ADAA722707ECF7C4F5781E892AA3503000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100BFF554DB29BEDF9A3B731E229741820136144754C2F80F3FDE00472F8CEDEB15D2ECA4A3E4F67CA7CC8D117BE425027959FCA3150630107C7D7F510056154FC038DFA11F6B576A11F5D798B146A358481B29027897E2F50B78D33BB1454F0F014475407F4C70BF39F48FC49F762917624A28337E65E9078AAD4C605C1D12BDA885580AC5BA8032EF31CB787E811E45E038B2F54558886333B1A281E4B69D0B5328CD4C9D871FE31B161EFCB28FFFEE73ABC8D62BF6DC37488C73F39DC9DF486CDB2D5A209D8F5DD373C64B1C15266503304C632E0057BBCB3E13BD0C9A838E169255F10AB200804F36301769EA8188D796723D798B7538A9CD30B4C5FBDEC3E44C13AE6676CF9258EF1FD913
|
|
|
|
|
answer = BA0D89B5FA815B46A77AB04D0E67B0BEC8DA3D11E50ADAA722707ECF7C4F5781E892AA3503000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100BFF554DB29BEDF9A3B731E229741820136144754C2F80F3FDE00472F8CEDEB15D2ECA4A3E4F67CA7CC8D117BE425027959FCA3150630107C7D7F510056154FC038DFA11F6B576A11F5D798B146A358481B29027897E2F50B78D33BB1454F0F014475407F4C70BF39F48FC49F762917624A28337E65E9078AAD4C605C1D12BDA885580AC5BA8032EF31CB787E811E45E038B2F54558886333B1A281E4B69D0B5328CD4C9D871FE31B161EFCB28FFFEE73ABC8D62BF6DC37488C73F39DC9DF486CDB2D5A209D8F5DD373C64B1C15266503304C632E0057BBCB3E13BD0C9A838E169255F10AB200804F36301769EA8188D796723D798B7538A9CD30B4C5FBDEC3E44C13AE6676CF9258EF1FD913</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 F0 AC A2 9E DD B1 89 60 29 31 4F 12
|
|
|
|
|
0010 | DB 62 CD 21 83 76 EE 2E 1C 63 67 59 F4 6E 2E 73
|
|
|
|
|
0020 | 0E 2E 6E C7 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 FA 81 5B 46 A7 7A B0 4D 0E 67 B0 BE
|
|
|
|
|
0010 | C8 DA 3D 11 E5 0A DA A7 22 70 7E CF 7C 4F 57 81
|
|
|
|
|
0020 | E8 92 AA 35 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 = BA0D89B5F0ACA29EDDB1896029314F12DB62CD218376EE2E1C636759F46E2E730E2E6EC
|
|
|
|
|
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 | 64 74 28 83 AE 84 77 96 87 3D 5C 9C BE 20 D6 59
|
|
|
|
|
0140 | 64 37 73 7F 7D 2C F2 DC E4 9F 35 92 EC 16 ED 13
|
|
|
|
|
0150 | 16 35 7B FC 3E 53 6D 8D B8 52 D8 79 EA 0F 11 AD
|
|
|
|
|
0160 | 29 2D 86 E5 61 67 78 8D 53 D5 62 BF F6 F8 45 58
|
|
|
|
|
0170 | 71 B8 1E 0E 15 43 2C F9 90 51 EF 92 A4 C1 C9 E0
|
|
|
|
|
0180 | 76 1F BA DC 22 66 4B 85 94 F1 16 10 98 18 FD 68
|
|
|
|
|
0190 | 01 B2 B3 85 94 9F E0 DA EF 26 6C E0 93 04 67 59
|
|
|
|
|
01A0 | DB 29 BC 45 93 F4 82 17 80 17 0F 8F 04 A7 17 2F
|
|
|
|
|
01B0 | 6B BD FD A4 AC 24 82 B1 4A AF AC 81 5D A8 F2 C2
|
|
|
|
|
01C0 | 62 C3 80 09 F6 F3 CA BB 6E FA DE D2 02 27 28 DB
|
|
|
|
|
01D0 | 90 9D C9 B1 80 3D 36 DA 34 87 E1 73 07 BA 3C D5
|
|
|
|
|
01E0 | F3 8C AA 08 14 7C 89 89 AC E4 04 18 99 A7 AB E2
|
|
|
|
|
01F0 | 7A F8 19 4F 34 BA 64 C4 AD C7 14 13 55 71 A2 67
|
|
|
|
|
0200 | 46 A8 70 CF 28 38 22 C5 D6 BA 0F EE 96 2D EC 61
|
|
|
|
|
0210 | EA CA 32 63 7F DD 30 EC B8 C7 3E FA D5 C9 B3 07
|
|
|
|
|
0220 | 21 53 79 FF 88 92 99 07 4D 92 B9 D8 F1 54 F4 9B
|
|
|
|
|
0230 | 0C F6 AD 66</code></pre>
|
|
|
|
|
0130 | BF F5 54 DB 29 BE DF 9A 3B 73 1E 22 97 41 82 01
|
|
|
|
|
0140 | 36 14 47 54 C2 F8 0F 3F DE 00 47 2F 8C ED EB 15
|
|
|
|
|
0150 | D2 EC A4 A3 E4 F6 7C A7 CC 8D 11 7B E4 25 02 79
|
|
|
|
|
0160 | 59 FC A3 15 06 30 10 7C 7D 7F 51 00 56 15 4F C0
|
|
|
|
|
0170 | 38 DF A1 1F 6B 57 6A 11 F5 D7 98 B1 46 A3 58 48
|
|
|
|
|
0180 | 1B 29 02 78 97 E2 F5 0B 78 D3 3B B1 45 4F 0F 01
|
|
|
|
|
0190 | 44 75 40 7F 4C 70 BF 39 F4 8F C4 9F 76 29 17 62
|
|
|
|
|
01A0 | 4A 28 33 7E 65 E9 07 8A AD 4C 60 5C 1D 12 BD A8
|
|
|
|
|
01B0 | 85 58 0A C5 BA 80 32 EF 31 CB 78 7E 81 1E 45 E0
|
|
|
|
|
01C0 | 38 B2 F5 45 58 88 63 33 B1 A2 81 E4 B6 9D 0B 53
|
|
|
|
|
01D0 | 28 CD 4C 9D 87 1F E3 1B 16 1E FC B2 8F FF EE 73
|
|
|
|
|
01E0 | AB C8 D6 2B F6 DC 37 48 8C 73 F3 9D C9 DF 48 6C
|
|
|
|
|
01F0 | DB 2D 5A 20 9D 8F 5D D3 73 C6 4B 1C 15 26 65 03
|
|
|
|
|
0200 | 30 4C 63 2E 00 57 BB CB 3E 13 BD 0C 9A 83 8E 16
|
|
|
|
|
0210 | 92 55 F1 0A B2 00 80 4F 36 30 17 69 EA 81 88 D7
|
|
|
|
|
0220 | 96 72 3D 79 8B 75 38 A9 CD 30 B4 C5 FB DE C3 E4
|
|
|
|
|
0230 | 4C 13 AE 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 = BA0D89B5F0ACA29EDDB1896029314F12DB62CD218376EE2E1C636759F46E2E730E2E6EC
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>F0ACA29EDDB1896029314F12DB62CD21</code></td>
|
|
|
|
|
<td><code>FA815B46A77AB04D0E67B0BEC8DA3D11</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>8376EE2E1C636759F46E2E730E2E6EC7</code></td>
|
|
|
|
|
<td><code>E50ADAA722707ECF7C4F5781E892AA35</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B5F0ACA29EDDB1896029314F12DB62CD218376EE2E1C636759F46E2E730E2E6EC
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE00010064742883AE847796873D5C9C</code> <code>BE20D6596437737F7D2CF2DCE49F3592</code> <code>EC16ED1316357BFC3E536D8DB852D879</code> <code>EA0F11AD292D86E56167788D53D562BF</code> <code>F6F8455871B81E0E15432CF99051EF92</code> <code>A4C1C9E0761FBADC22664B8594F11610</code> <code>9818FD6801B2B385949FE0DAEF266CE0</code> <code>93046759DB29BC4593F4821780170F8F</code> <code>04A7172F6BBDFDA4AC2482B14AAFAC81</code> <code>5DA8F2C262C38009F6F3CABB6EFADED2</code> <code>022728DB909DC9B1803D36DA3487E173</code> <code>07BA3CD5F38CAA08147C8989ACE40418</code> <code>99A7ABE27AF8194F34BA64C4ADC71413</code> <code>5571A26746A870CF283822C5D6BA0FEE</code> <code>962DEC61EACA32637FDD30ECB8C73EFA</code> <code>D5C9B307215379FF889299074D92B9D8</code><br> <code>F154F49B</code></td>
|
|
|
|
|
<td><code>FE000100BFF554DB29BEDF9A3B731E22</code> <code>9741820136144754C2F80F3FDE00472F</code> <code>8CEDEB15D2ECA4A3E4F67CA7CC8D117B</code> <code>E425027959FCA3150630107C7D7F5100</code> <code>56154FC038DFA11F6B576A11F5D798B1</code> <code>46A358481B29027897E2F50B78D33BB1</code> <code>454F0F014475407F4C70BF39F48FC49F</code> <code>762917624A28337E65E9078AAD4C605C</code> <code>1D12BDA885580AC5BA8032EF31CB787E</code> <code>811E45E038B2F54558886333B1A281E4</code> <code>B69D0B5328CD4C9D871FE31B161EFCB2</code> <code>8FFFEE73ABC8D62BF6DC37488C73F39D</code> <code>C9DF486CDB2D5A209D8F5DD373C64B1C</code> <code>15266503304C632E0057BBCB3E13BD0C</code> <code>9A838E169255F10AB200804F36301769</code> <code>EA8188D796723D798B7538A9CD30B4C5</code><br> <code>FBDEC3E4</code></td>
|
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>0CF6AD66</code> (1722676748 in decimal)</td>
|
|
|
|
|
<td><code>4C13AE66</code> (1722684236 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B5F0ACA29EDDB1896029314F12DB62CD218376EE2E1C636759F46E2E730E2E6EC
|
|
|
|
|
<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 = 3A2498FB54437CFDDE53CA8594C530099D5764323CC4F3DD14B284C3A5B1F7046C3E64AA735FCD34AB6A974ACE2AB74D804945E141A9C52C2F2CB2A6BCD4E014AA1AE45254B00709FE3AB02EF94634607C178ECF777A9E11D4B70538133387C8EF5676125B97416A6B18916AED91C309EE10EBBDF4A3055E17100A9512D56C5D99FA1B840C5728AD92A39A539DCEDA500C040DCAF1735492B6977568FFB66C781258351793368C58824F1D168DD601116FBD6386696FB3852BE78599AA5CB934698B6EDE651A8277CB1DD2BA53F30C45E53EBB634D195B00EDD17B665ADF3F69DA1CF84952A1AAEC46AA7D9BD366C3C373446DAE905BDBDDBDA5D7C0BB04AF88</code></pre>
|
|
|
|
|
<pre><code>b = 1EE5D5896155974FC2722641992B9394688A0FE313E42E52BB1E730F5AB8C240466DC77DA0D965B0C0C2AEFCD32C46E55CED1A1FF5101B8C7E6782224D1CACC56D7B747C10BD8236CE795D8DDC7C82B8E8BF2C2257EB2572F809631BB8E0AFC63EEB6ED9BB351D5859F49D88413A37DEF7E6229DAC974423E2FFCAF9A0D25AA2B77DB6EA09F091F6BB0AF8761068645B15CA46D35197A659F22B86E35DCDE5F5AA74F5BFC344F67E21E78CD250DEB0DD2172E414D033988F0BA2BA88E190FFB2B531D516AAAF43296D03484F3BD85F3B545477060774548C4A733477F9B4622ADD3DDA40C75A5241F809C015387201EAE862B5D5F06529792F63E5539034AB71</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 = 90297F04CFBED9CE1BA3A89945D7B51226393CBCBC6F919FF6C75F90BCB7BC2D2F701122970F36778AF8E1BFF3A8EAD277B3268B7BAD14E5914649E6B0104BA2BBE0E8D2B08C947ECED000962F9BB67E95F3729383192B2071E9C06B5802FE474DDB3CE2936DCB1F557838B94C3003B984CD07FF5D1857E36A7322C53DF59EC2C975CB339AE2CE7578E14567A138A5089BE60C4C0090E8946E984199B5F62B0C5E2038CD4FD70D63B9408B79D7F75DBF2B35E170B274126695E035482C0108A85BDA10802DEEA7E863064B14499F6B2104D46DDDB41CE2239EE70C8E404B10C6CD00749D785BDFDC83BBAD39CBFE6917529EE5FDB438888D288975B86F7D24E7</code></pre>
|
|
|
|
|
<pre><code>g_b = BC3196739E6BCE72AE2924C380042A91D0F7E4B3E067FAA3DAFDAA0E819AAFE3291987DCA22319DB87A24953F54AC0B32A50ABD3685AF1E7E1B503F31E03130A49EE8314EA4ED32D626F3ED2F474E13FF0C8A88B749FBF67C3D9716ADDA99D1779BE79622E0D335A535CBF919D0F668B1FBF5F357D1295D1BB3B6AC85C4DFF3C057BAA0A272D881D6EC98D8654CC1D9FC1CD1953776853533EF49C523B430987FCDA0F5B2EFC983633A7F98B4D20EF4572F3039F95CAE6AE1FB384EB279981A017F24AC3421B4C5F284E4039ACE780BF8EFD43CFA17A5E1491E6526C8A35566E9CC4FF5DBEFB5094AA6F5061B1E8933B44A0AF4BA8CBAD9F0A97F6451D8DFA14</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 F0 AC A2 9E DD B1 89 60 29 31 4F 12
|
|
|
|
|
0010 | DB 62 CD 21 83 76 EE 2E 1C 63 67 59 F4 6E 2E 73
|
|
|
|
|
0020 | 0E 2E 6E C7 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 90 29 7F 04 CF BE D9 CE 1B A3 A8 99 45 D7 B5 12
|
|
|
|
|
0040 | 26 39 3C BC BC 6F 91 9F F6 C7 5F 90 BC B7 BC 2D
|
|
|
|
|
0050 | 2F 70 11 22 97 0F 36 77 8A F8 E1 BF F3 A8 EA D2
|
|
|
|
|
0060 | 77 B3 26 8B 7B AD 14 E5 91 46 49 E6 B0 10 4B A2
|
|
|
|
|
0070 | BB E0 E8 D2 B0 8C 94 7E CE D0 00 96 2F 9B B6 7E
|
|
|
|
|
0080 | 95 F3 72 93 83 19 2B 20 71 E9 C0 6B 58 02 FE 47
|
|
|
|
|
0090 | 4D DB 3C E2 93 6D CB 1F 55 78 38 B9 4C 30 03 B9
|
|
|
|
|
00A0 | 84 CD 07 FF 5D 18 57 E3 6A 73 22 C5 3D F5 9E C2
|
|
|
|
|
00B0 | C9 75 CB 33 9A E2 CE 75 78 E1 45 67 A1 38 A5 08
|
|
|
|
|
00C0 | 9B E6 0C 4C 00 90 E8 94 6E 98 41 99 B5 F6 2B 0C
|
|
|
|
|
00D0 | 5E 20 38 CD 4F D7 0D 63 B9 40 8B 79 D7 F7 5D BF
|
|
|
|
|
00E0 | 2B 35 E1 70 B2 74 12 66 95 E0 35 48 2C 01 08 A8
|
|
|
|
|
00F0 | 5B DA 10 80 2D EE A7 E8 63 06 4B 14 49 9F 6B 21
|
|
|
|
|
0100 | 04 D4 6D DD B4 1C E2 23 9E E7 0C 8E 40 4B 10 C6
|
|
|
|
|
0110 | CD 00 74 9D 78 5B DF DC 83 BB AD 39 CB FE 69 17
|
|
|
|
|
0120 | 52 9E E5 FD B4 38 88 8D 28 89 75 B8 6F 7D 24 E7</code></pre>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 FA 81 5B 46 A7 7A B0 4D 0E 67 B0 BE
|
|
|
|
|
0010 | C8 DA 3D 11 E5 0A DA A7 22 70 7E CF 7C 4F 57 81
|
|
|
|
|
0020 | E8 92 AA 35 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | BC 31 96 73 9E 6B CE 72 AE 29 24 C3 80 04 2A 91
|
|
|
|
|
0040 | D0 F7 E4 B3 E0 67 FA A3 DA FD AA 0E 81 9A AF E3
|
|
|
|
|
0050 | 29 19 87 DC A2 23 19 DB 87 A2 49 53 F5 4A C0 B3
|
|
|
|
|
0060 | 2A 50 AB D3 68 5A F1 E7 E1 B5 03 F3 1E 03 13 0A
|
|
|
|
|
0070 | 49 EE 83 14 EA 4E D3 2D 62 6F 3E D2 F4 74 E1 3F
|
|
|
|
|
0080 | F0 C8 A8 8B 74 9F BF 67 C3 D9 71 6A DD A9 9D 17
|
|
|
|
|
0090 | 79 BE 79 62 2E 0D 33 5A 53 5C BF 91 9D 0F 66 8B
|
|
|
|
|
00A0 | 1F BF 5F 35 7D 12 95 D1 BB 3B 6A C8 5C 4D FF 3C
|
|
|
|
|
00B0 | 05 7B AA 0A 27 2D 88 1D 6E C9 8D 86 54 CC 1D 9F
|
|
|
|
|
00C0 | C1 CD 19 53 77 68 53 53 3E F4 9C 52 3B 43 09 87
|
|
|
|
|
00D0 | FC DA 0F 5B 2E FC 98 36 33 A7 F9 8B 4D 20 EF 45
|
|
|
|
|
00E0 | 72 F3 03 9F 95 CA E6 AE 1F B3 84 EB 27 99 81 A0
|
|
|
|
|
00F0 | 17 F2 4A C3 42 1B 4C 5F 28 4E 40 39 AC E7 80 BF
|
|
|
|
|
0100 | 8E FD 43 CF A1 7A 5E 14 91 E6 52 6C 8A 35 56 6E
|
|
|
|
|
0110 | 9C C4 FF 5D BE FB 50 94 AA 6F 50 61 B1 E8 93 3B
|
|
|
|
|
0120 | 44 A0 AF 4B A8 CB AD 9F 0A 97 F6 45 1D 8D FA 14</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 = BA0D89B5F0ACA29EDDB1896029314F12DB62CD218376EE2E1C636759F46E2E730E2E6EC
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>F0ACA29EDDB1896029314F12DB62CD21</code></td>
|
|
|
|
|
<td><code>FA815B46A77AB04D0E67B0BEC8DA3D11</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>8376EE2E1C636759F46E2E730E2E6EC7</code></td>
|
|
|
|
|
<td><code>E50ADAA722707ECF7C4F5781E892AA35</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE00010090297F04CFBED9CE1BA3A899</code> <code>45D7B51226393CBCBC6F919FF6C75F90</code> <code>BCB7BC2D2F701122970F36778AF8E1BF</code> <code>F3A8EAD277B3268B7BAD14E5914649E6</code> <code>B0104BA2BBE0E8D2B08C947ECED00096</code> <code>2F9BB67E95F3729383192B2071E9C06B</code> <code>5802FE474DDB3CE2936DCB1F557838B9</code> <code>4C3003B984CD07FF5D1857E36A7322C5</code> <code>3DF59EC2C975CB339AE2CE7578E14567</code> <code>A138A5089BE60C4C0090E8946E984199</code> <code>B5F62B0C5E2038CD4FD70D63B9408B79</code> <code>D7F75DBF2B35E170B274126695E03548</code> <code>2C0108A85BDA10802DEEA7E863064B14</code> <code>499F6B2104D46DDDB41CE2239EE70C8E</code> <code>404B10C6CD00749D785BDFDC83BBAD39</code> <code>CBFE6917529EE5FDB438888D288975B8</code><br> <code>6F7D24E7</code></td>
|
|
|
|
|
<td><code>FE000100BC3196739E6BCE72AE2924C3</code> <code>80042A91D0F7E4B3E067FAA3DAFDAA0E</code> <code>819AAFE3291987DCA22319DB87A24953</code> <code>F54AC0B32A50ABD3685AF1E7E1B503F3</code> <code>1E03130A49EE8314EA4ED32D626F3ED2</code> <code>F474E13FF0C8A88B749FBF67C3D9716A</code> <code>DDA99D1779BE79622E0D335A535CBF91</code> <code>9D0F668B1FBF5F357D1295D1BB3B6AC8</code> <code>5C4DFF3C057BAA0A272D881D6EC98D86</code> <code>54CC1D9FC1CD1953776853533EF49C52</code> <code>3B430987FCDA0F5B2EFC983633A7F98B</code> <code>4D20EF4572F3039F95CAE6AE1FB384EB</code> <code>279981A017F24AC3421B4C5F284E4039</code> <code>ACE780BF8EFD43CFA17A5E1491E6526C</code> <code>8A35566E9CC4FF5DBEFB5094AA6F5061</code> <code>B1E8933B44A0AF4BA8CBAD9F0A97F645</code><br> <code>1D8DFA14</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 = BA0D89B5F0ACA29EDDB1896029314F12DB62CD218376EE2E1C636759F46E2E730E2E6EC
|
|
|
|
|
<!-- 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 = 54B64366F0ACA29EDDB1896029314F12DB62CD218376EE2E1C636759F46E2E730E2E6EC70000000000000000FE00010090297F04CFBED9CE1BA3A89945D7B51226393CBCBC6F919FF6C75F90BCB7BC2D2F701122970F36778AF8E1BFF3A8EAD277B3268B7BAD14E5914649E6B0104BA2BBE0E8D2B08C947ECED000962F9BB67E95F3729383192B2071E9C06B5802FE474DDB3CE2936DCB1F557838B94C3003B984CD07FF5D1857E36A7322C53DF59EC2C975CB339AE2CE7578E14567A138A5089BE60C4C0090E8946E984199B5F62B0C5E2038CD4FD70D63B9408B79D7F75DBF2B35E170B274126695E035482C0108A85BDA10802DEEA7E863064B14499F6B2104D46DDDB41CE2239EE70C8E404B10C6CD00749D785BDFDC83BBAD39CBFE6917529EE5FDB438888D288975B86F7D24E7
|
|
|
|
|
padding = C5DCECD2014C582EE6132DF6
|
|
|
|
|
tmp_aes_key = 8634B5B575895BB3222A82D51134822E39AF5B7980C38A8C69B2CC5A99BB75F8
|
|
|
|
|
tmp_aes_iv = D80196DAD8E089E3845420D104466664471C270AAD44A0C1D02D09226DF478EF</code></pre>
|
|
|
|
|
<pre><code>data = 54B64366FA815B46A77AB04D0E67B0BEC8DA3D11E50ADAA722707ECF7C4F5781E892AA350000000000000000FE000100BC3196739E6BCE72AE2924C380042A91D0F7E4B3E067FAA3DAFDAA0E819AAFE3291987DCA22319DB87A24953F54AC0B32A50ABD3685AF1E7E1B503F31E03130A49EE8314EA4ED32D626F3ED2F474E13FF0C8A88B749FBF67C3D9716ADDA99D1779BE79622E0D335A535CBF919D0F668B1FBF5F357D1295D1BB3B6AC85C4DFF3C057BAA0A272D881D6EC98D8654CC1D9FC1CD1953776853533EF49C523B430987FCDA0F5B2EFC983633A7F98B4D20EF4572F3039F95CAE6AE1FB384EB279981A017F24AC3421B4C5F284E4039ACE780BF8EFD43CFA17A5E1491E6526C8A35566E9CC4FF5DBEFB5094AA6F5061B1E8933B44A0AF4BA8CBAD9F0A97F6451D8DFA14
|
|
|
|
|
padding = 8BDB4666B1EA05756B902911
|
|
|
|
|
tmp_aes_key = 2C3D78217FE608212E6780397D2A973F122F7CF405C3F3C3257C020D0F2E33E8
|
|
|
|
|
tmp_aes_iv = AA997469EFC62EFE8C738D37FF7ABD558C8C6684180857D8DCAAB08658B06481</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 = 26BA265725E6B69D7BE65E8A8CA9CBD03B55C305666D8946477EE8C61C21DDAD5D6CF55B7C903FC2ABAFF0DDD480377C748F7C436B3857E44F3CA0834D373041F2930B97E6B104E73363C7DF08271EABF1362E2F0F6231FECF3C94F12EC0882B777DA19CC40035277A5CFD86285F99B9010B57A662526A9C1A1E68A5DD09BA98A98E4B5A99CDCBA44F944CB75363FC1B6586681182F7AAAC027A45A937C165B8E0ADFE94730C9D287E820E4A6CFFFDEE201E19FDA876DA20DAC5859325375767031C5EAFF6C83756EDA6674E6CA2A14994B85854FAF59EE7D1480CD78AB20767EC603FB9056262C1671D03D42408B3E9CA23BA948C263AC3211C96DA547FE030C069F129526C337C2C3E4B4A882BE11CC1271B09F20906AAAD9095C5F0B646FF673B8EA52D07399B48F5D21C54158BF8E11D66838743B7D9B8C7383A147BD4CB54C5F88B516A8B9938E5187DA0BA5B45</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 5E03A3E21D1AC6D7B408E23CE984A488DF42B0D0CA5F94242D10CC51CE6E0887E4CC1BCA6254BC2C3089E3671ABDC7F64D7636B257DDCA9CAF08E1698D3D21730DC888B8DB2144B2A786168F5F090D87A49E6B6A071598335C0788F87E31B0E58C531130D661D867262E286C528AA206D027259F4447BD66CA8FAFB8E8E07DEC522DB337CCBEE4797CB797FE8CD8537FC64B39349BEA573CBDD52E1EC7C67E9B75FF5990CC8FA73617CA4E36EEC3E93C200D38D003D0635DD8757A820F73CFF309E969C9BC7BBCF9E5CF190795CC482732EC82E8AEE3AEA226B883E42292104FE1B0D91DA457EC52AE02AAE509C7BEEECDB70F6CE82241852400AA2E4B56FA301C9EA90E57C3985F835904523BF8A7D4BBF735C179EFFBE0E990CA35B87F3F917E986EF047E021B28ECE1F2480AF5336675CCAD82B22D1D4FA25A974D7250B3542E609E0E64BE68C061F94B7B1CFF3ED</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 60 26 0E 00 0C F6 AD 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 F0 AC A2 9E DD B1 89 60
|
|
|
|
|
0020 | 29 31 4F 12 DB 62 CD 21 83 76 EE 2E 1C 63 67 59
|
|
|
|
|
0030 | F4 6E 2E 73 0E 2E 6E C7 FE 50 01 00 26 BA 26 57
|
|
|
|
|
0040 | 25 E6 B6 9D 7B E6 5E 8A 8C A9 CB D0 3B 55 C3 05
|
|
|
|
|
0050 | 66 6D 89 46 47 7E E8 C6 1C 21 DD AD 5D 6C F5 5B
|
|
|
|
|
0060 | 7C 90 3F C2 AB AF F0 DD D4 80 37 7C 74 8F 7C 43
|
|
|
|
|
0070 | 6B 38 57 E4 4F 3C A0 83 4D 37 30 41 F2 93 0B 97
|
|
|
|
|
0080 | E6 B1 04 E7 33 63 C7 DF 08 27 1E AB F1 36 2E 2F
|
|
|
|
|
0090 | 0F 62 31 FE CF 3C 94 F1 2E C0 88 2B 77 7D A1 9C
|
|
|
|
|
00A0 | C4 00 35 27 7A 5C FD 86 28 5F 99 B9 01 0B 57 A6
|
|
|
|
|
00B0 | 62 52 6A 9C 1A 1E 68 A5 DD 09 BA 98 A9 8E 4B 5A
|
|
|
|
|
00C0 | 99 CD CB A4 4F 94 4C B7 53 63 FC 1B 65 86 68 11
|
|
|
|
|
00D0 | 82 F7 AA AC 02 7A 45 A9 37 C1 65 B8 E0 AD FE 94
|
|
|
|
|
00E0 | 73 0C 9D 28 7E 82 0E 4A 6C FF FD EE 20 1E 19 FD
|
|
|
|
|
00F0 | A8 76 DA 20 DA C5 85 93 25 37 57 67 03 1C 5E AF
|
|
|
|
|
0100 | F6 C8 37 56 ED A6 67 4E 6C A2 A1 49 94 B8 58 54
|
|
|
|
|
0110 | FA F5 9E E7 D1 48 0C D7 8A B2 07 67 EC 60 3F B9
|
|
|
|
|
0120 | 05 62 62 C1 67 1D 03 D4 24 08 B3 E9 CA 23 BA 94
|
|
|
|
|
0130 | 8C 26 3A C3 21 1C 96 DA 54 7F E0 30 C0 69 F1 29
|
|
|
|
|
0140 | 52 6C 33 7C 2C 3E 4B 4A 88 2B E1 1C C1 27 1B 09
|
|
|
|
|
0150 | F2 09 06 AA AD 90 95 C5 F0 B6 46 FF 67 3B 8E A5
|
|
|
|
|
0160 | 2D 07 39 9B 48 F5 D2 1C 54 15 8B F8 E1 1D 66 83
|
|
|
|
|
0170 | 87 43 B7 D9 B8 C7 38 3A 14 7B D4 CB 54 C5 F8 8B
|
|
|
|
|
0180 | 51 6A 8B 99 38 E5 18 7D A0 BA 5B 45</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 BC EE 00 00 4C 13 AE 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 FA 81 5B 46 A7 7A B0 4D
|
|
|
|
|
0020 | 0E 67 B0 BE C8 DA 3D 11 E5 0A DA A7 22 70 7E CF
|
|
|
|
|
0030 | 7C 4F 57 81 E8 92 AA 35 FE 50 01 00 5E 03 A3 E2
|
|
|
|
|
0040 | 1D 1A C6 D7 B4 08 E2 3C E9 84 A4 88 DF 42 B0 D0
|
|
|
|
|
0050 | CA 5F 94 24 2D 10 CC 51 CE 6E 08 87 E4 CC 1B CA
|
|
|
|
|
0060 | 62 54 BC 2C 30 89 E3 67 1A BD C7 F6 4D 76 36 B2
|
|
|
|
|
0070 | 57 DD CA 9C AF 08 E1 69 8D 3D 21 73 0D C8 88 B8
|
|
|
|
|
0080 | DB 21 44 B2 A7 86 16 8F 5F 09 0D 87 A4 9E 6B 6A
|
|
|
|
|
0090 | 07 15 98 33 5C 07 88 F8 7E 31 B0 E5 8C 53 11 30
|
|
|
|
|
00A0 | D6 61 D8 67 26 2E 28 6C 52 8A A2 06 D0 27 25 9F
|
|
|
|
|
00B0 | 44 47 BD 66 CA 8F AF B8 E8 E0 7D EC 52 2D B3 37
|
|
|
|
|
00C0 | CC BE E4 79 7C B7 97 FE 8C D8 53 7F C6 4B 39 34
|
|
|
|
|
00D0 | 9B EA 57 3C BD D5 2E 1E C7 C6 7E 9B 75 FF 59 90
|
|
|
|
|
00E0 | CC 8F A7 36 17 CA 4E 36 EE C3 E9 3C 20 0D 38 D0
|
|
|
|
|
00F0 | 03 D0 63 5D D8 75 7A 82 0F 73 CF F3 09 E9 69 C9
|
|
|
|
|
0100 | BC 7B BC F9 E5 CF 19 07 95 CC 48 27 32 EC 82 E8
|
|
|
|
|
0110 | AE E3 AE A2 26 B8 83 E4 22 92 10 4F E1 B0 D9 1D
|
|
|
|
|
0120 | A4 57 EC 52 AE 02 AA E5 09 C7 BE EE CD B7 0F 6C
|
|
|
|
|
0130 | E8 22 41 85 24 00 AA 2E 4B 56 FA 30 1C 9E A9 0E
|
|
|
|
|
0140 | 57 C3 98 5F 83 59 04 52 3B F8 A7 D4 BB F7 35 C1
|
|
|
|
|
0150 | 79 EF FB E0 E9 90 CA 35 B8 7F 3F 91 7E 98 6E F0
|
|
|
|
|
0160 | 47 E0 21 B2 8E CE 1F 24 80 AF 53 36 67 5C CA D8
|
|
|
|
|
0170 | 2B 22 D1 D4 FA 25 A9 74 D7 25 0B 35 42 E6 09 E0
|
|
|
|
|
0180 | E6 4B E6 8C 06 1F 94 B7 B1 CF F3 ED</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>60260E000CF6AD66</code></td>
|
|
|
|
|
<td><code>BCEE00004C13AE66</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>F0ACA29EDDB1896029314F12DB62CD21</code></td>
|
|
|
|
|
<td><code>FA815B46A77AB04D0E67B0BEC8DA3D11</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>8376EE2E1C636759F46E2E730E2E6EC7</code></td>
|
|
|
|
|
<td><code>E50ADAA722707ECF7C4F5781E892AA35</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE50010026BA265725E6B69D7BE65E8A</code> <code>8CA9CBD03B55C305666D8946477EE8C6</code> <code>1C21DDAD5D6CF55B7C903FC2ABAFF0DD</code> <code>D480377C748F7C436B3857E44F3CA083</code> <code>4D373041F2930B97E6B104E73363C7DF</code> <code>08271EABF1362E2F0F6231FECF3C94F1</code> <code>2EC0882B777DA19CC40035277A5CFD86</code> <code>285F99B9010B57A662526A9C1A1E68A5</code> <code>DD09BA98A98E4B5A99CDCBA44F944CB7</code> <code>5363FC1B6586681182F7AAAC027A45A9</code> <code>37C165B8E0ADFE94730C9D287E820E4A</code> <code>6CFFFDEE201E19FDA876DA20DAC58593</code> <code>25375767031C5EAFF6C83756EDA6674E</code> <code>6CA2A14994B85854FAF59EE7D1480CD7</code> <code>8AB20767EC603FB9056262C1671D03D4</code> <code>2408B3E9CA23BA948C263AC3211C96DA</code> <code>547FE030C069F129526C337C2C3E4B4A</code> <code>882BE11CC1271B09F20906AAAD9095C5</code> <code>F0B646FF673B8EA52D07399B48F5D21C</code> <code>54158BF8E11D66838743B7D9B8C7383A</code> <code>147BD4CB54C5F88B516A8B9938E5187D</code><br> <code>A0BA5B45</code></td>
|
|
|
|
|
<td><code>FE5001005E03A3E21D1AC6D7B408E23C</code> <code>E984A488DF42B0D0CA5F94242D10CC51</code> <code>CE6E0887E4CC1BCA6254BC2C3089E367</code> <code>1ABDC7F64D7636B257DDCA9CAF08E169</code> <code>8D3D21730DC888B8DB2144B2A786168F</code> <code>5F090D87A49E6B6A071598335C0788F8</code> <code>7E31B0E58C531130D661D867262E286C</code> <code>528AA206D027259F4447BD66CA8FAFB8</code> <code>E8E07DEC522DB337CCBEE4797CB797FE</code> <code>8CD8537FC64B39349BEA573CBDD52E1E</code> <code>C7C67E9B75FF5990CC8FA73617CA4E36</code> <code>EEC3E93C200D38D003D0635DD8757A82</code> <code>0F73CFF309E969C9BC7BBCF9E5CF1907</code> <code>95CC482732EC82E8AEE3AEA226B883E4</code> <code>2292104FE1B0D91DA457EC52AE02AAE5</code> <code>09C7BEEECDB70F6CE82241852400AA2E</code> <code>4B56FA301C9EA90E57C3985F83590452</code> <code>3BF8A7D4BBF735C179EFFBE0E990CA35</code> <code>B87F3F917E986EF047E021B28ECE1F24</code> <code>80AF5336675CCAD82B22D1D4FA25A974</code> <code>D7250B3542E609E0E64BE68C061F94B7</code><br> <code>B1CFF3ED</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 = B3AB5D60CE414D8461090AADA560C4EC7A0B00EB5E3483D58C99E0819A1A202463BD92431CAD3FA9FAFFBAFBF0189476B9D9BA725118D7AA2E6D87B69B357D3DA80EB179261A511E56A6BFE81BC5489A8AC816BF545D1C757151336749E8119646925774EECD3C3F19989391F97EB8B310C69A13333464A153686EFD5F3D9490645791908F4A8FA646E17FBD4548CE04962DCFED11DE7DDCD11AF8AD7F62853D1862DAF878DE9988E55398B4E10105DB2B15408FE6475BB3356E87BEA0880E93E61BDA9C6C8CBB65C952B1D4E4442869C13F9045B2F305574D3E30BDA244C237C0BE4B648F0913D2CD87A15D2C0D872FC0C0DE7A62A1C226729BF96386E3C1EE</code></pre>
|
|
|
|
|
<pre><code>auth_key = 9F23536C0168344A992968CD1712082CEDD0449EA79728B873758EA99AD65F71DA9EF17A8EED3AE9322AC757C08E707208A7DB426501E8578C8AE9AAED8E135745ADEDB1EEC15D5C729D8C527F90D0D394D49E87D6D798894A171B944F11A4C114B1DE96A27700D5EED7FF018E6B20680E3C3A5CAB6487432AE23C172C59215E4A1FD357BE928AF5C63D4D612DD66C3A05644B129609751D3DEEB2E6C9E8924215F73FC79D8669939EA78B4B5C1C2C81045658DDF3F3A2E2D2527DBB55A5DD2318B347CF42D8662B1D3479CDB66E5AA50B4792EAEE910623D11D2982D4219952FEF7079E2B9DC4AAE4077055ECB9A5E4DBFFF9472595F91F17B2C18AE98B744E</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 68 66 36 0D F6 AD 66
|
|
|
|
|
0010 | 70 00 00 00 34 F7 CB 3B F0 AC A2 9E DD B1 89 60
|
|
|
|
|
0020 | 29 31 4F 12 DB 62 CD 21 83 76 EE 2E 1C 63 67 59
|
|
|
|
|
0030 | F4 6E 2E 73 0E 2E 6E C7 58 A6 42 1F 01 10 E8 FD
|
|
|
|
|
0040 | 11 8B BF 82 46 39 DA 85</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 54 D5 B6 4C 13 AE 66
|
|
|
|
|
0010 | 40 00 00 00 34 F7 CB 3B FA 81 5B 46 A7 7A B0 4D
|
|
|
|
|
0020 | 0E 67 B0 BE C8 DA 3D 11 E5 0A DA A7 22 70 7E CF
|
|
|
|
|
0030 | 7C 4F 57 81 E8 92 AA 35 E5 B4 C5 D4 48 96 26 7A
|
|
|
|
|
0040 | E8 37 48 87 CB C2 57 EB</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>016866360DF6AD66</code></td>
|
|
|
|
|
<td><code>0154D5B64C13AE66</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>70000000</code> (112 in decimal)</td>
|
|
|
|
|
<td><code>40000000</code> (64 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>F0ACA29EDDB1896029314F12DB62CD21</code></td>
|
|
|
|
|
<td><code>FA815B46A77AB04D0E67B0BEC8DA3D11</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>8376EE2E1C636759F46E2E730E2E6EC7</code></td>
|
|
|
|
|
<td><code>E50ADAA722707ECF7C4F5781E892AA35</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>58A6421F0110E8FD118BBF824639DA85</code></td>
|
|
|
|
|
<td><code>E5B4C5D44896267AE8374887CBC257EB</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>
|
|
|
|
|