mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-11-28 19:23:11 +01:00
Update content of files
This commit is contained in:
parent
00171f4e5a
commit
c33b5274a0
2 changed files with 208 additions and 208 deletions
|
@ -114,12 +114,12 @@
|
|||
<tr>
|
||||
<td><strong>saved_from_msg_id</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.4?<a href="/type/int">int</a></td>
|
||||
<td>Only for messages forwarded to <a href="/api/saved-messages">saved messages »</a>, ID of the message that was forwarded from the original user/channel</td>
|
||||
<td>Only for messages forwarded to <a href="/api/saved-messages">saved messages »</a>, contains the original ID of the forwarded message.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>saved_from_id</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.8?<a href="/type/Peer">Peer</a></td>
|
||||
<td> </td>
|
||||
<td>Only for messages forwarded to <a href="/api/saved-messages">saved messages »</a>, contains the original dialog's peer.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>saved_from_name</strong></td>
|
||||
|
|
|
@ -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 64 F7 0D 00 FC C0 AB 65
|
||||
0010 | 14 00 00 00 F1 8E 7E BE 15 A0 84 B3 B9 CA 2A 17
|
||||
0020 | F0 39 25 F4 4B 78 FE 68</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 B8 92 06 00 E0 C8 AB 65
|
||||
0010 | 14 00 00 00 F1 8E 7E BE FB 6C 67 30 A2 09 CF B4
|
||||
0020 | D9 9B 31 0D 48 CA 7F EC</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>64F70D00FCC0AB65</code></td>
|
||||
<td><code>B8920600E0C8AB65</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>15A084B3B9CA2A17F03925F44B78FE68</code></td>
|
||||
<td><code>FB6C6730A209CFB4D99B310D48CA7FEC</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 C4 6F BE FC C0 AB 65
|
||||
0010 | B8 00 00 00 63 24 16 05 15 A0 84 B3 B9 CA 2A 17
|
||||
0020 | F0 39 25 F4 4B 78 FE 68 D6 70 1F CD 21 2C EB 87
|
||||
0030 | C9 66 E5 31 8F 55 64 A8 08 14 60 E7 D3 FA 72 77
|
||||
0040 | 91 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 E4 56 EC E0 C8 AB 65
|
||||
0010 | B0 00 00 00 63 24 16 05 FB 6C 67 30 A2 09 CF B4
|
||||
0020 | D9 9B 31 0D 48 CA 7F EC 48 08 2D 3E 05 DF D9 54
|
||||
0030 | B9 8C E6 56 43 8A 88 00 08 23 36 C6 E0 E2 33 26
|
||||
0040 | F3 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>01C46FBEFCC0AB65</code></td>
|
||||
<td><code>01E456ECE0C8AB65</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>B8000000</code> (184 in decimal)</td>
|
||||
<td><code>B0000000</code> (176 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -150,19 +150,19 @@
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>15A084B3B9CA2A17F03925F44B78FE68</code></td>
|
||||
<td><code>FB6C6730A209CFB4D99B310D48CA7FEC</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>D6701FCD212CEB87C966E5318F5564A8</code></td>
|
||||
<td><code>48082D3E05DFD954B98CE656438A8800</code></td>
|
||||
<td>Server-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pq</td>
|
||||
<td>56, 12</td>
|
||||
<td><code>081460E7D3FA727791000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1468428376148703121</td>
|
||||
<td><code>082336C6E0E23326F3000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2537434109239830259</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 = 1468428376148703121</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1468428376148703121 = 1008949199 * 1455403679</code></p>
|
||||
<pre><code>p = 1008949199
|
||||
q = 1455403679</code></pre>
|
||||
<pre><code>pq = 2537434109239830259</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2537434109239830259 = 1348056659 * 1882290401</code></p>
|
||||
<pre><code>p = 1348056659
|
||||
q = 1882290401</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 14 60 E7 D3 FA 72 77 91 00 00 00
|
||||
0010 | 04 3C 23 57 CF 00 00 00 04 56 BF B2 9F 00 00 00
|
||||
0020 | 15 A0 84 B3 B9 CA 2A 17 F0 39 25 F4 4B 78 FE 68
|
||||
0030 | D6 70 1F CD 21 2C EB 87 C9 66 E5 31 8F 55 64 A8
|
||||
0040 | 84 5F AD 32 D1 0A 4C 79 67 DA 49 A8 9F BE 50 8A
|
||||
0050 | D2 4A A3 15 09 92 B4 99 B3 B2 C7 2C DC 0F 36 4C
|
||||
<pre><code>0000 | 95 5F F5 A9 08 23 36 C6 E0 E2 33 26 F3 00 00 00
|
||||
0010 | 04 50 59 B6 53 00 00 00 04 70 31 78 E1 00 00 00
|
||||
0020 | FB 6C 67 30 A2 09 CF B4 D9 9B 31 0D 48 CA 7F EC
|
||||
0030 | 48 08 2D 3E 05 DF D9 54 B9 8C E6 56 43 8A 88 00
|
||||
0040 | 2A 9D 4F F9 67 66 46 22 11 35 F9 26 8D A4 CA FA
|
||||
0050 | A1 81 C5 87 8C 47 34 60 9D 85 8E CF FB 29 B9 6A
|
||||
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 = 1455403679</code></pre>
|
|||
<tr>
|
||||
<td>pq</td>
|
||||
<td>4, 12</td>
|
||||
<td><code>081460E7D3FA727791000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1468428376148703121</td>
|
||||
<td><code>082336C6E0E23326F3000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2537434109239830259</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>043C2357CF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1008949199</td>
|
||||
<td><code>045059B653000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1348056659</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>0456BFB29F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1455403679</td>
|
||||
<td><code>04703178E1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1882290401</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>15A084B3B9CA2A17F03925F44B78FE68</code></td>
|
||||
<td><code>FB6C6730A209CFB4D99B310D48CA7FEC</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>48, 16</td>
|
||||
<td><code>D6701FCD212CEB87C966E5318F5564A8</code></td>
|
||||
<td><code>48082D3E05DFD954B98CE656438A8800</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce</td>
|
||||
<td>64, 32</td>
|
||||
<td><code>845FAD32D10A4C7967DA49A89FBE508A</code> <code>D24AA3150992B499B3B2C72CDC0F364C</code></td>
|
||||
<td><code>2A9D4FF9676646221135F9268DA4CAFA</code> <code>A181C5878C4734609D858ECFFB29B96A</code></td>
|
||||
<td>Client-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -291,39 +291,39 @@ q = 1455403679</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 = 955FF5A9081460E7D3FA727791000000043C2357CF0000000456BFB29F00000015A084B3B9CA2A17F03925F44B78FE68D6701FCD212CEB87C966E5318F5564A8845FAD32D10A4C7967DA49A89FBE508AD24AA3150992B499B3B2C72CDC0F364C02000000
|
||||
random_padding_bytes = 5C3E7244F0896A34C58F66FC548B7A2D0A4153B5E703A8FF11FBF623B7E2F9BA25E3539490DA77CEB9AB45A44F9D7D3CB5DE7C0F69F0D5819112F5CACF06C964AE5D8BC3C727AC39A058681B8E80AAB76BF06CD90FCBC2B7CFBF8135</code></pre>
|
||||
<pre><code>data = 955FF5A9082336C6E0E23326F3000000045059B65300000004703178E1000000FB6C6730A209CFB4D99B310D48CA7FEC48082D3E05DFD954B98CE656438A88002A9D4FF9676646221135F9268DA4CAFAA181C5878C4734609D858ECFFB29B96A02000000
|
||||
random_padding_bytes = CD346AD4AD38B8C438E8A868A0F1D5F306FB360A76DF2579C80256F6E4758D0A2DC3C846AA6F3B47533291C046553EB42DE83E50D1AB68368CB8C45C7FD2C307FAADBC4A7A29898625E558FB4EA52D139D11FECEF23C8EE826FD8451</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 = 8AEC7230B35085FA65678B7F89AB27414B5D3CBCE86D14A84557C24E36FD27B35FC5B4FF3C1C9013D4882024A44625EBCE779EBA82BDB479002343980775165EDD6D9ABF090C01240B16055BD66C66F0CA508F850D9690783339B61833845E9AB1E2170A8017620BCE98C5B43644F629E6DBA1CF612C77D5133DB227649592A419F6616EACE0E3F24D8C094800C3A06F98D2B9F2BB4151A23E3F21DBED9E89E5C2A7070692FAF4646876560723286276209A796A3429A0035FA82828B3A7BA4B4123FE10AE7CD92EC3C0CE8173046A28462491998012A0BD094B4162F9A9720E1995D08AF2FB19864BD27A9E6F4D0EF68C4F6190857238C8C7DB9F058CCD17D0</code></pre>
|
||||
<pre><code>encrypted_data = 252C4634765441727FA848CB542B01A8E894E1F6E00D57825C41AB0671803F15DB27934EEC7BAAF81BD231EA5F46824E963CB43DAEE3751FAB065A89B46FC39639A2CF5083B91457D1266F0E7B8205FC0498B2CE92B119A335362C1D993EC848D1ECDCB3E9B1DABB6306134E32128BF60B6DE34D5B48E1FFCEE1F3E10E6646FE40F05ADF3E7C357ABB1C958B110F3346DB06BD05682BA6AD73121496EC64C2B98DEF4A7195E009BB8D8DCBC14853A4EF512E14CBC9CF6173156884F30993622F3FF7D909B44CA7B54937FDD5E2DCB7945E8D6FCB87A082D7E212D122A7FC14FAA16F42FE25C2B52F0E9D0E9D73285A55001110C40E1844E2800881850653D87E</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 68 F7 0D 00 FC C0 AB 65
|
||||
0010 | 40 01 00 00 BE E4 12 D7 15 A0 84 B3 B9 CA 2A 17
|
||||
0020 | F0 39 25 F4 4B 78 FE 68 D6 70 1F CD 21 2C EB 87
|
||||
0030 | C9 66 E5 31 8F 55 64 A8 04 3C 23 57 CF 00 00 00
|
||||
0040 | 04 56 BF B2 9F 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 8A EC 72 30 B3 50 85 FA 65 67 8B 7F
|
||||
0060 | 89 AB 27 41 4B 5D 3C BC E8 6D 14 A8 45 57 C2 4E
|
||||
0070 | 36 FD 27 B3 5F C5 B4 FF 3C 1C 90 13 D4 88 20 24
|
||||
0080 | A4 46 25 EB CE 77 9E BA 82 BD B4 79 00 23 43 98
|
||||
0090 | 07 75 16 5E DD 6D 9A BF 09 0C 01 24 0B 16 05 5B
|
||||
00A0 | D6 6C 66 F0 CA 50 8F 85 0D 96 90 78 33 39 B6 18
|
||||
00B0 | 33 84 5E 9A B1 E2 17 0A 80 17 62 0B CE 98 C5 B4
|
||||
00C0 | 36 44 F6 29 E6 DB A1 CF 61 2C 77 D5 13 3D B2 27
|
||||
00D0 | 64 95 92 A4 19 F6 61 6E AC E0 E3 F2 4D 8C 09 48
|
||||
00E0 | 00 C3 A0 6F 98 D2 B9 F2 BB 41 51 A2 3E 3F 21 DB
|
||||
00F0 | ED 9E 89 E5 C2 A7 07 06 92 FA F4 64 68 76 56 07
|
||||
0100 | 23 28 62 76 20 9A 79 6A 34 29 A0 03 5F A8 28 28
|
||||
0110 | B3 A7 BA 4B 41 23 FE 10 AE 7C D9 2E C3 C0 CE 81
|
||||
0120 | 73 04 6A 28 46 24 91 99 80 12 A0 BD 09 4B 41 62
|
||||
0130 | F9 A9 72 0E 19 95 D0 8A F2 FB 19 86 4B D2 7A 9E
|
||||
0140 | 6F 4D 0E F6 8C 4F 61 90 85 72 38 C8 C7 DB 9F 05
|
||||
0150 | 8C CD 17 D0</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 E8 5F 07 00 E0 C8 AB 65
|
||||
0010 | 40 01 00 00 BE E4 12 D7 FB 6C 67 30 A2 09 CF B4
|
||||
0020 | D9 9B 31 0D 48 CA 7F EC 48 08 2D 3E 05 DF D9 54
|
||||
0030 | B9 8C E6 56 43 8A 88 00 04 50 59 B6 53 00 00 00
|
||||
0040 | 04 70 31 78 E1 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 25 2C 46 34 76 54 41 72 7F A8 48 CB
|
||||
0060 | 54 2B 01 A8 E8 94 E1 F6 E0 0D 57 82 5C 41 AB 06
|
||||
0070 | 71 80 3F 15 DB 27 93 4E EC 7B AA F8 1B D2 31 EA
|
||||
0080 | 5F 46 82 4E 96 3C B4 3D AE E3 75 1F AB 06 5A 89
|
||||
0090 | B4 6F C3 96 39 A2 CF 50 83 B9 14 57 D1 26 6F 0E
|
||||
00A0 | 7B 82 05 FC 04 98 B2 CE 92 B1 19 A3 35 36 2C 1D
|
||||
00B0 | 99 3E C8 48 D1 EC DC B3 E9 B1 DA BB 63 06 13 4E
|
||||
00C0 | 32 12 8B F6 0B 6D E3 4D 5B 48 E1 FF CE E1 F3 E1
|
||||
00D0 | 0E 66 46 FE 40 F0 5A DF 3E 7C 35 7A BB 1C 95 8B
|
||||
00E0 | 11 0F 33 46 DB 06 BD 05 68 2B A6 AD 73 12 14 96
|
||||
00F0 | EC 64 C2 B9 8D EF 4A 71 95 E0 09 BB 8D 8D CB C1
|
||||
0100 | 48 53 A4 EF 51 2E 14 CB C9 CF 61 73 15 68 84 F3
|
||||
0110 | 09 93 62 2F 3F F7 D9 09 B4 4C A7 B5 49 37 FD D5
|
||||
0120 | E2 DC B7 94 5E 8D 6F CB 87 A0 82 D7 E2 12 D1 22
|
||||
0130 | A7 FC 14 FA A1 6F 42 FE 25 C2 B5 2F 0E 9D 0E 9D
|
||||
0140 | 73 28 5A 55 00 11 10 C4 0E 18 44 E2 80 08 81 85
|
||||
0150 | 06 53 D8 7E</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 = 5C3E7244F0896A34C58F66FC548B7A2D0A4153B5E703A8FF11FBF623B
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>68F70D00FCC0AB65</code></td>
|
||||
<td><code>E85F0700E0C8AB65</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 = 5C3E7244F0896A34C58F66FC548B7A2D0A4153B5E703A8FF11FBF623B
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>15A084B3B9CA2A17F03925F44B78FE68</code></td>
|
||||
<td><code>FB6C6730A209CFB4D99B310D48CA7FEC</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>D6701FCD212CEB87C966E5318F5564A8</code></td>
|
||||
<td><code>48082D3E05DFD954B98CE656438A8800</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p</td>
|
||||
<td>56, 8</td>
|
||||
<td><code>043C2357CF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1008949199</td>
|
||||
<td><code>045059B653000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1348056659</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>0456BFB29F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1455403679</td>
|
||||
<td><code>04703178E1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1882290401</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 = 5C3E7244F0896A34C58F66FC548B7A2D0A4153B5E703A8FF11FBF623B
|
|||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>80, 260</td>
|
||||
<td><code>FE0001008AEC7230B35085FA65678B7F</code> <code>89AB27414B5D3CBCE86D14A84557C24E</code> <code>36FD27B35FC5B4FF3C1C9013D4882024</code> <code>A44625EBCE779EBA82BDB47900234398</code> <code>0775165EDD6D9ABF090C01240B16055B</code> <code>D66C66F0CA508F850D9690783339B618</code> <code>33845E9AB1E2170A8017620BCE98C5B4</code> <code>3644F629E6DBA1CF612C77D5133DB227</code> <code>649592A419F6616EACE0E3F24D8C0948</code> <code>00C3A06F98D2B9F2BB4151A23E3F21DB</code> <code>ED9E89E5C2A7070692FAF46468765607</code> <code>23286276209A796A3429A0035FA82828</code> <code>B3A7BA4B4123FE10AE7CD92EC3C0CE81</code> <code>73046A28462491998012A0BD094B4162</code> <code>F9A9720E1995D08AF2FB19864BD27A9E</code> <code>6F4D0EF68C4F6190857238C8C7DB9F05</code><br> <code>8CCD17D0</code></td>
|
||||
<td><code>FE000100252C4634765441727FA848CB</code> <code>542B01A8E894E1F6E00D57825C41AB06</code> <code>71803F15DB27934EEC7BAAF81BD231EA</code> <code>5F46824E963CB43DAEE3751FAB065A89</code> <code>B46FC39639A2CF5083B91457D1266F0E</code> <code>7B8205FC0498B2CE92B119A335362C1D</code> <code>993EC848D1ECDCB3E9B1DABB6306134E</code> <code>32128BF60B6DE34D5B48E1FFCEE1F3E1</code> <code>0E6646FE40F05ADF3E7C357ABB1C958B</code> <code>110F3346DB06BD05682BA6AD73121496</code> <code>EC64C2B98DEF4A7195E009BB8D8DCBC1</code> <code>4853A4EF512E14CBC9CF6173156884F3</code> <code>0993622F3FF7D909B44CA7B54937FDD5</code> <code>E2DCB7945E8D6FCB87A082D7E212D122</code> <code>A7FC14FAA16F42FE25C2B52F0E9D0E9D</code> <code>73285A55001110C40E1844E280088185</code><br> <code>0653D87E</code></td>
|
||||
<td>Value generated above</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -402,47 +402,47 @@ random_padding_bytes = 5C3E7244F0896A34C58F66FC548B7A2D0A4153B5E703A8FF11FBF623B
|
|||
<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 E0 9A 64 FD C0 AB 65
|
||||
0010 | 9C 02 00 00 5C 07 E8 D0 15 A0 84 B3 B9 CA 2A 17
|
||||
0020 | F0 39 25 F4 4B 78 FE 68 D6 70 1F CD 21 2C EB 87
|
||||
0030 | C9 66 E5 31 8F 55 64 A8 FE 50 02 00 FE F6 27 AC
|
||||
0040 | 3A 88 02 7B C6 58 3F 95 D8 2E 61 00 66 A8 7B 83
|
||||
0050 | 96 14 EE 34 3C D8 D3 7F 2B 2C 81 FC 96 45 61 BA
|
||||
0060 | 16 4F 44 E4 B3 C3 9A 6C C7 4C 6E 2F 26 87 C2 E5
|
||||
0070 | 87 26 58 E4 30 17 34 B3 81 4D 42 0C 68 4D 94 C0
|
||||
0080 | B9 3C 4B 33 5D BB 34 62 66 CD AD 20 B3 EE C9 1A
|
||||
0090 | E4 9B 59 E1 30 EA B8 77 FD 03 C0 7B A7 86 DA 8E
|
||||
00A0 | FF 7B DD CB 77 3E 0C 4C 1C 7C 66 FE 5C 5A 39 D3
|
||||
00B0 | 2A 76 40 0D 71 FB D2 A0 9D 5B FD F3 B3 97 6F 17
|
||||
00C0 | C1 DA 7F D7 73 49 CB D9 7E BC 52 17 18 15 41 F4
|
||||
00D0 | 3D 8D ED B3 02 7D C3 98 96 23 DC F8 49 FF 39 18
|
||||
00E0 | 32 F4 09 90 3E 76 20 EB BF 76 75 CE FA 13 CE C9
|
||||
00F0 | 05 70 BB 0E E1 96 C5 BB 67 DB 16 9D B9 02 C1 19
|
||||
0100 | 2F 67 D9 A7 4B 1B 97 82 FF 02 FD 4D B7 8C 76 11
|
||||
0110 | 7D 66 39 A6 ED 87 F5 DE B3 7E D4 92 96 F2 C9 4E
|
||||
0120 | A8 35 D0 98 8A 27 07 49 C3 E6 D1 D0 B0 BE 88 F3
|
||||
0130 | 98 5D 68 3E 48 F2 E2 AC 76 48 17 5E E7 2B EA 1B
|
||||
0140 | 52 64 1C 23 EC 8E EF BD 60 25 51 6E 91 CC E2 0C
|
||||
0150 | 25 CB 51 59 B5 C9 D9 CA 19 A1 5D D4 A4 4F 42 29
|
||||
0160 | 46 B7 58 EC 4C 96 8B DE 08 32 E2 38 9D 5B 9F 3C
|
||||
0170 | 3A C5 20 AC 58 75 37 47 71 7F 72 76 A7 DF 3F F8
|
||||
0180 | 41 A7 AB D1 85 24 A3 15 0F 53 74 71 F7 3A 98 18
|
||||
0190 | 09 7E 82 D9 64 5A 9C E3 8F 85 8D 51 0F FC 79 CE
|
||||
01A0 | 11 D9 61 73 C2 2D DE 2B 0A E4 90 B8 CC 7B 10 BC
|
||||
01B0 | C7 BB 88 79 02 78 72 E7 24 DC C6 48 DD F7 AE 6F
|
||||
01C0 | 14 C3 22 9E 7D 61 14 63 E5 13 D3 8B E9 13 D0 D5
|
||||
01D0 | 0E 9D 43 93 37 C0 FD 8D 71 C9 EF 70 C6 02 A4 71
|
||||
01E0 | 73 D6 99 30 82 16 C7 C4 4C 40 61 5B F8 E9 80 6A
|
||||
01F0 | 5D FA 56 F4 52 9A D7 0E 78 4C 19 04 A9 48 8A 01
|
||||
0200 | 9A 6C 7A B7 D8 22 A9 A6 92 6A 19 16 89 13 02 C1
|
||||
0210 | 82 7C E5 4E 9D 88 29 EE 07 9D 19 73 0D FE BA 21
|
||||
0220 | 8D 31 7E B4 F2 2A 24 18 EF 93 43 DA 75 13 1F C6
|
||||
0230 | F3 7A 80 D5 EE B9 33 09 71 12 44 AE 3A 1D 4C A1
|
||||
0240 | 90 6F 10 B4 F0 6C 8F 9B F5 47 A6 FE A9 A8 D0 CC
|
||||
0250 | 91 0B 15 E7 DA 9A 0A CF 0C 2E 79 34 F7 A7 DB A8
|
||||
0260 | EF FE 4D 13 5D BD 20 7C 60 9B FC 3B AC 89 BA 94
|
||||
0270 | 9D DF 75 48 79 71 2F 6B 97 C5 0A 54 F5 60 D0 A7
|
||||
0280 | 5D A8 A0 78 A0 39 F2 1B CA 12 9F CB</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 08 1A 7F E1 C8 AB 65
|
||||
0010 | 78 02 00 00 5C 07 E8 D0 FB 6C 67 30 A2 09 CF B4
|
||||
0020 | D9 9B 31 0D 48 CA 7F EC 48 08 2D 3E 05 DF D9 54
|
||||
0030 | B9 8C E6 56 43 8A 88 00 FE 50 02 00 14 35 00 42
|
||||
0040 | D3 61 5E 00 17 76 EB 73 01 70 96 30 2C 4E 83 7C
|
||||
0050 | 75 05 77 67 15 2D 99 A3 A0 74 A9 7D DC AE AF E1
|
||||
0060 | A4 33 D6 C4 CC 28 96 39 70 B6 AA 2F A0 A5 7D F9
|
||||
0070 | 6D 13 09 96 F1 F8 A5 89 03 6E 72 68 BF 01 D8 03
|
||||
0080 | 8F 2C E2 AF 16 3A D7 C9 6F A5 B8 9A 10 67 E4 7B
|
||||
0090 | D0 ED 3B EC F6 89 37 1C 63 2D E7 4C E6 B4 5D 53
|
||||
00A0 | 00 FA 72 59 DC BF 22 A0 3B 52 FE 42 A7 77 DA A8
|
||||
00B0 | DF B2 7E B7 E8 E3 CB 12 55 E7 BF A1 19 B8 FD E3
|
||||
00C0 | 6A D0 A0 61 B3 1B 12 CA B7 6E A4 27 2E F3 B5 B6
|
||||
00D0 | 68 07 C3 E1 37 68 D0 50 BD 8F 1E 0B F0 23 5D CC
|
||||
00E0 | 9D 05 3E BD 31 E7 FA 58 E1 52 2D 94 49 6D E2 17
|
||||
00F0 | B9 71 61 81 24 34 DE 4D 20 20 8D 05 DE E4 AF A5
|
||||
0100 | A7 36 11 D4 5C 08 02 D7 00 52 34 96 A4 84 F7 8C
|
||||
0110 | 01 C8 DE F1 A7 13 C8 62 22 11 A4 EB A7 FB 9D 03
|
||||
0120 | 86 82 AD 80 67 8A D0 C8 31 C3 29 2E 00 8E 5D F9
|
||||
0130 | 5C 30 DF 9B 68 0F 85 99 1A 92 B3 C4 0F 52 B1 9E
|
||||
0140 | A4 08 E4 5D 2F DE 9D B6 A3 0A 67 EE A4 B5 76 E8
|
||||
0150 | 69 98 4C 8C 82 EB 84 A1 94 25 4D 66 FD 2F 25 C1
|
||||
0160 | 9A 27 88 A4 C8 07 A8 A9 C6 85 9B CD 3F E0 19 1D
|
||||
0170 | 44 24 35 F2 D2 64 F6 7E A4 4A CE 2C D9 73 8E B1
|
||||
0180 | C4 7E AE FE 0C 49 7B 98 2D 1E 3F 4E DE C3 10 F9
|
||||
0190 | D4 E6 A8 FD 90 D9 5D B3 D6 FA 9F CA DF B3 AB 88
|
||||
01A0 | C4 47 24 92 A9 2D 84 65 A3 D1 A5 3A 67 21 6F E0
|
||||
01B0 | CE F6 23 54 50 E5 D9 6F 7B 8D 62 CB 62 FE 6B 31
|
||||
01C0 | A3 19 52 08 0B 38 C4 C6 80 71 D2 4E 26 D4 11 42
|
||||
01D0 | 20 3E F0 10 97 A0 3A BC B9 70 79 D4 88 41 29 E5
|
||||
01E0 | C9 65 FD 9C F9 BB 54 CB E2 BF E7 4F 5B 5A D5 CD
|
||||
01F0 | E5 2C ED 8C 64 8E EB 87 B3 7C 20 2A 8D 7F 4C 90
|
||||
0200 | 08 F5 6F 58 9E D1 CA 14 FC AA 45 AF A2 78 C6 F6
|
||||
0210 | E0 5A 09 D8 C5 FD 17 D9 C7 1B B5 0E F2 8A 28 37
|
||||
0220 | C4 32 C0 D4 B4 65 32 57 63 FA EC 7B 08 82 5D 8A
|
||||
0230 | 38 11 01 71 F4 E9 0C E4 98 6C AE FC 9A 8E 6D 06
|
||||
0240 | 01 50 22 0F AD BF 5F 98 23 4F 39 4C C2 54 C4 A8
|
||||
0250 | BB 77 23 80 57 F2 AB D3 6D 9C 0A 9C E8 44 0D 9E
|
||||
0260 | 34 FE 83 E2 86 96 F0 EB 13 DB 81 BB B4 57 10 0C
|
||||
0270 | A8 39 60 DC A8 3D 3E FB 03 74 47 C2 6A 80 24 EB
|
||||
0280 | 26 21 68 05 27 35 EA 06 7A CC B6 0B</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 = 5C3E7244F0896A34C58F66FC548B7A2D0A4153B5E703A8FF11FBF623B
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>01E09A64FDC0AB65</code></td>
|
||||
<td><code>01081A7FE1C8AB65</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>9C020000</code> (668 in decimal)</td>
|
||||
<td><code>78020000</code> (632 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -482,19 +482,19 @@ random_padding_bytes = 5C3E7244F0896A34C58F66FC548B7A2D0A4153B5E703A8FF11FBF623B
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>15A084B3B9CA2A17F03925F44B78FE68</code></td>
|
||||
<td><code>FB6C6730A209CFB4D99B310D48CA7FEC</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>D6701FCD212CEB87C966E5318F5564A8</code></td>
|
||||
<td><code>48082D3E05DFD954B98CE656438A8800</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_answer</td>
|
||||
<td>56, 596</td>
|
||||
<td><code>FE500200FEF627AC3A88027BC6583F95</code> <code>D82E610066A87B839614EE343CD8D37F</code> <code>2B2C81FC964561BA164F44E4B3C39A6C</code> <code>C74C6E2F2687C2E5872658E4301734B3</code> <code>814D420C684D94C0B93C4B335DBB3462</code> <code>66CDAD20B3EEC91AE49B59E130EAB877</code> <code>FD03C07BA786DA8EFF7BDDCB773E0C4C</code> <code>1C7C66FE5C5A39D32A76400D71FBD2A0</code> <code>9D5BFDF3B3976F17C1DA7FD77349CBD9</code> <code>7EBC5217181541F43D8DEDB3027DC398</code> <code>9623DCF849FF391832F409903E7620EB</code> <code>BF7675CEFA13CEC90570BB0EE196C5BB</code> <code>67DB169DB902C1192F67D9A74B1B9782</code> <code>FF02FD4DB78C76117D6639A6ED87F5DE</code> <code>B37ED49296F2C94EA835D0988A270749</code> <code>C3E6D1D0B0BE88F3985D683E48F2E2AC</code> <code>7648175EE72BEA1B52641C23EC8EEFBD</code> <code>6025516E91CCE20C25CB5159B5C9D9CA</code> <code>19A15DD4A44F422946B758EC4C968BDE</code> <code>0832E2389D5B9F3C3AC520AC58753747</code> <code>717F7276A7DF3FF841A7ABD18524A315</code> <code>0F537471F73A9818097E82D9645A9CE3</code> <code>8F858D510FFC79CE11D96173C22DDE2B</code> <code>0AE490B8CC7B10BCC7BB8879027872E7</code> <code>24DCC648DDF7AE6F14C3229E7D611463</code> <code>E513D38BE913D0D50E9D439337C0FD8D</code> <code>71C9EF70C602A47173D699308216C7C4</code> <code>4C40615BF8E9806A5DFA56F4529AD70E</code> <code>784C1904A9488A019A6C7AB7D822A9A6</code> <code>926A1916891302C1827CE54E9D8829EE</code> <code>079D19730DFEBA218D317EB4F22A2418</code> <code>EF9343DA75131FC6F37A80D5EEB93309</code> <code>711244AE3A1D4CA1906F10B4F06C8F9B</code> <code>F547A6FEA9A8D0CC910B15E7DA9A0ACF</code> <code>0C2E7934F7A7DBA8EFFE4D135DBD207C</code> <code>609BFC3BAC89BA949DDF754879712F6B</code> <code>97C50A54F560D0A75DA8A078A039F21B</code><br> <code>CA129FCB</code></td>
|
||||
<td><code>FE50020014350042D3615E001776EB73</code> <code>017096302C4E837C75057767152D99A3</code> <code>A074A97DDCAEAFE1A433D6C4CC289639</code> <code>70B6AA2FA0A57DF96D130996F1F8A589</code> <code>036E7268BF01D8038F2CE2AF163AD7C9</code> <code>6FA5B89A1067E47BD0ED3BECF689371C</code> <code>632DE74CE6B45D5300FA7259DCBF22A0</code> <code>3B52FE42A777DAA8DFB27EB7E8E3CB12</code> <code>55E7BFA119B8FDE36AD0A061B31B12CA</code> <code>B76EA4272EF3B5B66807C3E13768D050</code> <code>BD8F1E0BF0235DCC9D053EBD31E7FA58</code> <code>E1522D94496DE217B97161812434DE4D</code> <code>20208D05DEE4AFA5A73611D45C0802D7</code> <code>00523496A484F78C01C8DEF1A713C862</code> <code>2211A4EBA7FB9D038682AD80678AD0C8</code> <code>31C3292E008E5DF95C30DF9B680F8599</code> <code>1A92B3C40F52B19EA408E45D2FDE9DB6</code> <code>A30A67EEA4B576E869984C8C82EB84A1</code> <code>94254D66FD2F25C19A2788A4C807A8A9</code> <code>C6859BCD3FE0191D442435F2D264F67E</code> <code>A44ACE2CD9738EB1C47EAEFE0C497B98</code> <code>2D1E3F4EDEC310F9D4E6A8FD90D95DB3</code> <code>D6FA9FCADFB3AB88C4472492A92D8465</code> <code>A3D1A53A67216FE0CEF6235450E5D96F</code> <code>7B8D62CB62FE6B31A31952080B38C4C6</code> <code>8071D24E26D41142203EF01097A03ABC</code> <code>B97079D4884129E5C965FD9CF9BB54CB</code> <code>E2BFE74F5B5AD5CDE52CED8C648EEB87</code> <code>B37C202A8D7F4C9008F56F589ED1CA14</code> <code>FCAA45AFA278C6F6E05A09D8C5FD17D9</code> <code>C71BB50EF28A2837C432C0D4B4653257</code> <code>63FAEC7B08825D8A38110171F4E90CE4</code> <code>986CAEFC9A8E6D060150220FADBF5F98</code> <code>234F394CC254C4A8BB77238057F2ABD3</code> <code>6D9C0A9CE8440D9E34FE83E28696F0EB</code> <code>13DB81BBB457100CA83960DCA83D3EFB</code> <code>037447C26A8024EB262168052735EA06</code><br> <code>7ACCB60B</code></td>
|
||||
<td>See below</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -502,20 +502,20 @@ random_padding_bytes = 5C3E7244F0896A34C58F66FC548B7A2D0A4153B5E703A8FF11FBF623B
|
|||
<!-- 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 = FEF627AC3A88027BC6583F95D82E610066A87B839614EE343CD8D37F2B2C81FC964561BA164F44E4B3C39A6CC74C6E2F2687C2E5872658E4301734B3814D420C684D94C0B93C4B335DBB346266CDAD20B3EEC91AE49B59E130EAB877FD03C07BA786DA8EFF7BDDCB773E0C4C1C7C66FE5C5A39D32A76400D71FBD2A09D5BFDF3B3976F17C1DA7FD77349CBD97EBC5217181541F43D8DEDB3027DC3989623DCF849FF391832F409903E7620EBBF7675CEFA13CEC90570BB0EE196C5BB67DB169DB902C1192F67D9A74B1B9782FF02FD4DB78C76117D6639A6ED87F5DEB37ED49296F2C94EA835D0988A270749C3E6D1D0B0BE88F3985D683E48F2E2AC7648175EE72BEA1B52641C23EC8EEFBD6025516E91CCE20C25CB5159B5C9D9CA19A15DD4A44F422946B758EC4C968BDE0832E2389D5B9F3C3AC520AC58753747717F7276A7DF3FF841A7ABD18524A3150F537471F73A9818097E82D9645A9CE38F858D510FFC79CE11D96173C22DDE2B0AE490B8CC7B10BCC7BB8879027872E724DCC648DDF7AE6F14C3229E7D611463E513D38BE913D0D50E9D439337C0FD8D71C9EF70C602A47173D699308216C7C44C40615BF8E9806A5DFA56F4529AD70E784C1904A9488A019A6C7AB7D822A9A6926A1916891302C1827CE54E9D8829EE079D19730DFEBA218D317EB4F22A2418EF9343DA75131FC6F37A80D5EEB93309711244AE3A1D4CA1906F10B4F06C8F9BF547A6FEA9A8D0CC910B15E7DA9A0ACF0C2E7934F7A7DBA8EFFE4D135DBD207C609BFC3BAC89BA949DDF754879712F6B97C50A54F560D0A75DA8A078A039F21BCA129FCB
|
||||
tmp_aes_key = D32E4A7F18252AE2B0406B84633E1117833ED75BDA40011D1E1700E3E08A8AE7
|
||||
tmp_aes_iv = 4FFC40D969D49934ED3740FF66D9179947A5E1D85C4C7F15555920C1845FAD32</code></pre>
|
||||
<pre><code>encrypted_answer = 14350042D3615E001776EB73017096302C4E837C75057767152D99A3A074A97DDCAEAFE1A433D6C4CC28963970B6AA2FA0A57DF96D130996F1F8A589036E7268BF01D8038F2CE2AF163AD7C96FA5B89A1067E47BD0ED3BECF689371C632DE74CE6B45D5300FA7259DCBF22A03B52FE42A777DAA8DFB27EB7E8E3CB1255E7BFA119B8FDE36AD0A061B31B12CAB76EA4272EF3B5B66807C3E13768D050BD8F1E0BF0235DCC9D053EBD31E7FA58E1522D94496DE217B97161812434DE4D20208D05DEE4AFA5A73611D45C0802D700523496A484F78C01C8DEF1A713C8622211A4EBA7FB9D038682AD80678AD0C831C3292E008E5DF95C30DF9B680F85991A92B3C40F52B19EA408E45D2FDE9DB6A30A67EEA4B576E869984C8C82EB84A194254D66FD2F25C19A2788A4C807A8A9C6859BCD3FE0191D442435F2D264F67EA44ACE2CD9738EB1C47EAEFE0C497B982D1E3F4EDEC310F9D4E6A8FD90D95DB3D6FA9FCADFB3AB88C4472492A92D8465A3D1A53A67216FE0CEF6235450E5D96F7B8D62CB62FE6B31A31952080B38C4C68071D24E26D41142203EF01097A03ABCB97079D4884129E5C965FD9CF9BB54CBE2BFE74F5B5AD5CDE52CED8C648EEB87B37C202A8D7F4C9008F56F589ED1CA14FCAA45AFA278C6F6E05A09D8C5FD17D9C71BB50EF28A2837C432C0D4B465325763FAEC7B08825D8A38110171F4E90CE4986CAEFC9A8E6D060150220FADBF5F98234F394CC254C4A8BB77238057F2ABD36D9C0A9CE8440D9E34FE83E28696F0EB13DB81BBB457100CA83960DCA83D3EFB037447C26A8024EB262168052735EA067ACCB60B
|
||||
tmp_aes_key = 939A48A4F8097727F06DDF7AAC298444991F6804620AC0E12890D2F8750F0BF1
|
||||
tmp_aes_iv = 2CCC8FF240E00E900DDD34DC87C89B2F9383AEEEF45322E44F4119962A9D4FF9</code></pre>
|
||||
<!-- end server_DH_inner_data_input -->
|
||||
<p>Yielding:</p>
|
||||
<!-- start server_DH_inner_data_output -->
|
||||
<pre><code>answer_with_hash = ADDDF2FEB5E14F93EE8D3A5181F9D89A39E4439CBA0D89B515A084B3B9CA2A17F03925F44B78FE68D6701FCD212CEB87C966E5318F5564A803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001009828B2E4CAEC188BB94216F5E2DB632A17630A21FD00C67465E741D26137C8E2B757F349D8DD1B62B601642ACB9E3B390ABF153D3A11615A128ED1D79379D763C14D2DF5CEF99C96945C51290C1FD82C4B482078863B2BC7022C7886C21C0F1D24814C768321C05934303E50AE22CBC83F2A3994BBC3C72E77BF10CDB695CBD86655D1BC0A083551E59D0FBFCFA13825A182105A78DA35AF5A15C064275B6E6729049C84209B898675C9110ADCD1CBB2AAB333C05D3E9F70D05FEE7C54EFCE927E1B40A719D04D15C7E950EB885E60AAAE990231719DBDDD84C65B2F3A606FE1F78DEA7C8FAD25C1CD7876EB6F5A46270B82D549E31EDD3C2DC2F82970A4999CFDC0AB657607B7374780E1C0
|
||||
answer = BA0D89B515A084B3B9CA2A17F03925F44B78FE68D6701FCD212CEB87C966E5318F5564A803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001009828B2E4CAEC188BB94216F5E2DB632A17630A21FD00C67465E741D26137C8E2B757F349D8DD1B62B601642ACB9E3B390ABF153D3A11615A128ED1D79379D763C14D2DF5CEF99C96945C51290C1FD82C4B482078863B2BC7022C7886C21C0F1D24814C768321C05934303E50AE22CBC83F2A3994BBC3C72E77BF10CDB695CBD86655D1BC0A083551E59D0FBFCFA13825A182105A78DA35AF5A15C064275B6E6729049C84209B898675C9110ADCD1CBB2AAB333C05D3E9F70D05FEE7C54EFCE927E1B40A719D04D15C7E950EB885E60AAAE990231719DBDDD84C65B2F3A606FE1F78DEA7C8FAD25C1CD7876EB6F5A46270B82D549E31EDD3C2DC2F82970A4999CFDC0AB657607B7374780E1C0</code></pre>
|
||||
<pre><code>answer_with_hash = AF6DBFB2611362E8C2947C7F6A311346D4786AE8BA0D89B5FB6C6730A209CFB4D99B310D48CA7FEC48082D3E05DFD954B98CE656438A880003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010049743B49768F04B6845C3DB77A4E8319CA4DDDBA4A97EA63AFB0DD54AFF8D5552B5BC9534F28EEBD7FC2566E7C05ACE4F1ED5276E5E46EC842B3B6ABA708D50A31D423C3A1E48D1D290D13A7069D73414966418A0B5FFA05F7D2D3478EA313C292664A21C30E417DCE4B1B0E0D325BFB6FF685D1DFC36DBA550A41BC8FAAF81B376BEB41651B7EBAE3E49D004553D3D5252E4539A87FA449F33D211F2FEF3390CDC86FF3C8F0FD89BB963854324EC93D8997E867D8AFF4C445380A9DD5544C07F7850E552B350245D03FB4AAA015DFE1C2261695BD2A999226D102094BEF244C38200A05D1BDF586D40E00381C4069DBFCFB80F1BD10C2F710FDD53D614E79B4E1C8AB65081762C7B45FA64D
|
||||
answer = BA0D89B5FB6C6730A209CFB4D99B310D48CA7FEC48082D3E05DFD954B98CE656438A880003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010049743B49768F04B6845C3DB77A4E8319CA4DDDBA4A97EA63AFB0DD54AFF8D5552B5BC9534F28EEBD7FC2566E7C05ACE4F1ED5276E5E46EC842B3B6ABA708D50A31D423C3A1E48D1D290D13A7069D73414966418A0B5FFA05F7D2D3478EA313C292664A21C30E417DCE4B1B0E0D325BFB6FF685D1DFC36DBA550A41BC8FAAF81B376BEB41651B7EBAE3E49D004553D3D5252E4539A87FA449F33D211F2FEF3390CDC86FF3C8F0FD89BB963854324EC93D8997E867D8AFF4C445380A9DD5544C07F7850E552B350245D03FB4AAA015DFE1C2261695BD2A999226D102094BEF244C38200A05D1BDF586D40E00381C4069DBFCFB80F1BD10C2F710FDD53D614E79B4E1C8AB65081762C7B45FA64D</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 15 A0 84 B3 B9 CA 2A 17 F0 39 25 F4
|
||||
0010 | 4B 78 FE 68 D6 70 1F CD 21 2C EB 87 C9 66 E5 31
|
||||
0020 | 8F 55 64 A8 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
||||
<pre><code>0000 | BA 0D 89 B5 FB 6C 67 30 A2 09 CF B4 D9 9B 31 0D
|
||||
0010 | 48 CA 7F EC 48 08 2D 3E 05 DF D9 54 B9 8C E6 56
|
||||
0020 | 43 8A 88 00 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 = BA0D89B515A084B3B9CA2A17F03925F44B78FE68D6701FCD212CEB87C966E5318F5564A
|
|||
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 | 98 28 B2 E4 CA EC 18 8B B9 42 16 F5 E2 DB 63 2A
|
||||
0140 | 17 63 0A 21 FD 00 C6 74 65 E7 41 D2 61 37 C8 E2
|
||||
0150 | B7 57 F3 49 D8 DD 1B 62 B6 01 64 2A CB 9E 3B 39
|
||||
0160 | 0A BF 15 3D 3A 11 61 5A 12 8E D1 D7 93 79 D7 63
|
||||
0170 | C1 4D 2D F5 CE F9 9C 96 94 5C 51 29 0C 1F D8 2C
|
||||
0180 | 4B 48 20 78 86 3B 2B C7 02 2C 78 86 C2 1C 0F 1D
|
||||
0190 | 24 81 4C 76 83 21 C0 59 34 30 3E 50 AE 22 CB C8
|
||||
01A0 | 3F 2A 39 94 BB C3 C7 2E 77 BF 10 CD B6 95 CB D8
|
||||
01B0 | 66 55 D1 BC 0A 08 35 51 E5 9D 0F BF CF A1 38 25
|
||||
01C0 | A1 82 10 5A 78 DA 35 AF 5A 15 C0 64 27 5B 6E 67
|
||||
01D0 | 29 04 9C 84 20 9B 89 86 75 C9 11 0A DC D1 CB B2
|
||||
01E0 | AA B3 33 C0 5D 3E 9F 70 D0 5F EE 7C 54 EF CE 92
|
||||
01F0 | 7E 1B 40 A7 19 D0 4D 15 C7 E9 50 EB 88 5E 60 AA
|
||||
0200 | AE 99 02 31 71 9D BD DD 84 C6 5B 2F 3A 60 6F E1
|
||||
0210 | F7 8D EA 7C 8F AD 25 C1 CD 78 76 EB 6F 5A 46 27
|
||||
0220 | 0B 82 D5 49 E3 1E DD 3C 2D C2 F8 29 70 A4 99 9C
|
||||
0230 | FD C0 AB 65</code></pre>
|
||||
0130 | 49 74 3B 49 76 8F 04 B6 84 5C 3D B7 7A 4E 83 19
|
||||
0140 | CA 4D DD BA 4A 97 EA 63 AF B0 DD 54 AF F8 D5 55
|
||||
0150 | 2B 5B C9 53 4F 28 EE BD 7F C2 56 6E 7C 05 AC E4
|
||||
0160 | F1 ED 52 76 E5 E4 6E C8 42 B3 B6 AB A7 08 D5 0A
|
||||
0170 | 31 D4 23 C3 A1 E4 8D 1D 29 0D 13 A7 06 9D 73 41
|
||||
0180 | 49 66 41 8A 0B 5F FA 05 F7 D2 D3 47 8E A3 13 C2
|
||||
0190 | 92 66 4A 21 C3 0E 41 7D CE 4B 1B 0E 0D 32 5B FB
|
||||
01A0 | 6F F6 85 D1 DF C3 6D BA 55 0A 41 BC 8F AA F8 1B
|
||||
01B0 | 37 6B EB 41 65 1B 7E BA E3 E4 9D 00 45 53 D3 D5
|
||||
01C0 | 25 2E 45 39 A8 7F A4 49 F3 3D 21 1F 2F EF 33 90
|
||||
01D0 | CD C8 6F F3 C8 F0 FD 89 BB 96 38 54 32 4E C9 3D
|
||||
01E0 | 89 97 E8 67 D8 AF F4 C4 45 38 0A 9D D5 54 4C 07
|
||||
01F0 | F7 85 0E 55 2B 35 02 45 D0 3F B4 AA A0 15 DF E1
|
||||
0200 | C2 26 16 95 BD 2A 99 92 26 D1 02 09 4B EF 24 4C
|
||||
0210 | 38 20 0A 05 D1 BD F5 86 D4 0E 00 38 1C 40 69 DB
|
||||
0220 | FC FB 80 F1 BD 10 C2 F7 10 FD D5 3D 61 4E 79 B4
|
||||
0230 | E1 C8 AB 65</code></pre>
|
||||
<p>Payload (de)serialization:</p>
|
||||
<pre><code>server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;</code></pre>
|
||||
<table class="table">
|
||||
|
@ -570,13 +570,13 @@ answer = BA0D89B515A084B3B9CA2A17F03925F44B78FE68D6701FCD212CEB87C966E5318F5564A
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>15A084B3B9CA2A17F03925F44B78FE68</code></td>
|
||||
<td><code>FB6C6730A209CFB4D99B310D48CA7FEC</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>D6701FCD212CEB87C966E5318F5564A8</code></td>
|
||||
<td><code>48082D3E05DFD954B98CE656438A8800</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -594,13 +594,13 @@ answer = BA0D89B515A084B3B9CA2A17F03925F44B78FE68D6701FCD212CEB87C966E5318F5564A
|
|||
<tr>
|
||||
<td>g_a</td>
|
||||
<td>300, 260</td>
|
||||
<td><code>FE0001009828B2E4CAEC188BB94216F5</code> <code>E2DB632A17630A21FD00C67465E741D2</code> <code>6137C8E2B757F349D8DD1B62B601642A</code> <code>CB9E3B390ABF153D3A11615A128ED1D7</code> <code>9379D763C14D2DF5CEF99C96945C5129</code> <code>0C1FD82C4B482078863B2BC7022C7886</code> <code>C21C0F1D24814C768321C05934303E50</code> <code>AE22CBC83F2A3994BBC3C72E77BF10CD</code> <code>B695CBD86655D1BC0A083551E59D0FBF</code> <code>CFA13825A182105A78DA35AF5A15C064</code> <code>275B6E6729049C84209B898675C9110A</code> <code>DCD1CBB2AAB333C05D3E9F70D05FEE7C</code> <code>54EFCE927E1B40A719D04D15C7E950EB</code> <code>885E60AAAE990231719DBDDD84C65B2F</code> <code>3A606FE1F78DEA7C8FAD25C1CD7876EB</code> <code>6F5A46270B82D549E31EDD3C2DC2F829</code><br> <code>70A4999C</code></td>
|
||||
<td><code>FE00010049743B49768F04B6845C3DB7</code> <code>7A4E8319CA4DDDBA4A97EA63AFB0DD54</code> <code>AFF8D5552B5BC9534F28EEBD7FC2566E</code> <code>7C05ACE4F1ED5276E5E46EC842B3B6AB</code> <code>A708D50A31D423C3A1E48D1D290D13A7</code> <code>069D73414966418A0B5FFA05F7D2D347</code> <code>8EA313C292664A21C30E417DCE4B1B0E</code> <code>0D325BFB6FF685D1DFC36DBA550A41BC</code> <code>8FAAF81B376BEB41651B7EBAE3E49D00</code> <code>4553D3D5252E4539A87FA449F33D211F</code> <code>2FEF3390CDC86FF3C8F0FD89BB963854</code> <code>324EC93D8997E867D8AFF4C445380A9D</code> <code>D5544C07F7850E552B350245D03FB4AA</code> <code>A015DFE1C2261695BD2A999226D10209</code> <code>4BEF244C38200A05D1BDF586D40E0038</code> <code>1C4069DBFCFB80F1BD10C2F710FDD53D</code><br> <code>614E79B4</code></td>
|
||||
<td><code>g_a</code> diffie-hellman parameter</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_time</td>
|
||||
<td>560, 4</td>
|
||||
<td><code>FDC0AB65</code> (1705754877 in decimal)</td>
|
||||
<td><code>E1C8AB65</code> (1705756897 in decimal)</td>
|
||||
<td>Server time</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -609,34 +609,34 @@ answer = BA0D89B515A084B3B9CA2A17F03925F44B78FE68D6701FCD212CEB87C966E5318F5564A
|
|||
<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 = A521C97B9D210812C56055C62FE8C3CE7FC97A75E51D4428F78F7D5F7325FCE03FF70D99039502FB75059DC40E36CF4F4D7A073937CC6DBC86AB864E7B3F26EFE833F766856033931BC41F031507DD571FCFEBB28F1B3DF1577A90C25B95C56894AAB64C681961AC68AFA9AADF03752D0E26EADD645A02D7895B64846EB83B3DDD458D856870CD8C0765B985C1ED50D5D802DDE67B159C899898A9B738D17802F3D50B83A868738D8502BBE33B8D7FBC3348E3E444352816FD84D300A2A8E2117CAC0EAEC654235183187D85548791BF25ABFD1AC97EAB7FA685F67A57E7BBE47B96A99B8F34B8EB523C18AEE074EABACB6FA9A28A41F4F961F41D86B19F4EC1</code></pre>
|
||||
<pre><code>b = AAD47B1DA97968D0050F9F7757700FABA551B3BFCD4628A1BDBA2EE5CE811C84C46667CB570FDA558FC050D33D150B88E44C1E3416CF3D44E95FAB68B2C61DADBD74862A3E1304CAE0F02F7995D8C4BBEA9F4527681F172FD724A04B97FF7EA84B47C2A0121B09F16391EB3906D8988E3F1BEA7534DD29540688303AA81D5F722C7CF9021703943F3E47CAEACABED8795935AAD8999701F0662C9CC3F046BBD030AC6FE5972B6A4BFC40E707A526D0A426462C5CE3E1D3295AC6924DE4E72CA00997FFCB89AB931D0C7EE9BCC52F1EA67F322F01E3DBA4E66F7DDE3844FF15CCB310300BAA837F1632E0F81B0ADFB57F08755215782D467C4CD4BEE97228D9DF</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 = A0BB357C5A5FBC4EC9D8B2171C030CB68A693A8024CD9E3630BAE4CE000A14A5DBF8A40DFB322678A797ED3D591032D0A1C529BE4E76B7EBD5436E7BF7539A9AB5A5FE9DD62F37CAE704EFE0C10DD608E5D9554F7B2F7198E99CE29A9A86CCE0FBB1491EBA269DEB6AA20C5CB2134E75E5C70A7C0E7D47EE16F87189D135EDAE37EAD992063C11AEA4AC660CF3EBE61B6C21ADAAC2A9317120A6F4D1DA65978FA74BF94CC65A0CA2479D064906E78575049E7654D346CA576C6778F478CDB48FCA2FD9202E6E5F95FEF623A206207AFB41619C419357B49F4F8825B37EF7E74811FBA22BDF45730F423793C5049514363232F3358BC5F60A416BDCE7D7BBFB49</code></pre>
|
||||
<pre><code>g_b = 4895872FF27C396A60C98CDBCB5469C0948242EEBE99A0ED4573CC10C668AE4A1B660538498D554434308DF026482083ECA6D67201663EB55F2C076C43CCE5079AF08E574D566F294DEA2421D1BF1513624572E0EFDBF8A10B981C6515FB9D6D4EEF01AB489380DEBAAC59E4BD35BA74AA59E752A5FC4670C9715A9EA6846D0E3D7B0208F7BE18DC5CA600873F455BB080F23F45AFA715750A0F76730A0DD2A6DDC94A15FF51E0A3E7F28C32D784931F2ECDBAE8CD27EA54AC2C99AF8ADACDC377F219139893B27AB6C25653E17F34950C60B419F20D8C768FD9A1777198BF3E1B9C7806CB207FE33C090BB286FE67BD80A57496B0BA02959A6E57AE329C9A39</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 15 A0 84 B3 B9 CA 2A 17 F0 39 25 F4
|
||||
0010 | 4B 78 FE 68 D6 70 1F CD 21 2C EB 87 C9 66 E5 31
|
||||
0020 | 8F 55 64 A8 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | A0 BB 35 7C 5A 5F BC 4E C9 D8 B2 17 1C 03 0C B6
|
||||
0040 | 8A 69 3A 80 24 CD 9E 36 30 BA E4 CE 00 0A 14 A5
|
||||
0050 | DB F8 A4 0D FB 32 26 78 A7 97 ED 3D 59 10 32 D0
|
||||
0060 | A1 C5 29 BE 4E 76 B7 EB D5 43 6E 7B F7 53 9A 9A
|
||||
0070 | B5 A5 FE 9D D6 2F 37 CA E7 04 EF E0 C1 0D D6 08
|
||||
0080 | E5 D9 55 4F 7B 2F 71 98 E9 9C E2 9A 9A 86 CC E0
|
||||
0090 | FB B1 49 1E BA 26 9D EB 6A A2 0C 5C B2 13 4E 75
|
||||
00A0 | E5 C7 0A 7C 0E 7D 47 EE 16 F8 71 89 D1 35 ED AE
|
||||
00B0 | 37 EA D9 92 06 3C 11 AE A4 AC 66 0C F3 EB E6 1B
|
||||
00C0 | 6C 21 AD AA C2 A9 31 71 20 A6 F4 D1 DA 65 97 8F
|
||||
00D0 | A7 4B F9 4C C6 5A 0C A2 47 9D 06 49 06 E7 85 75
|
||||
00E0 | 04 9E 76 54 D3 46 CA 57 6C 67 78 F4 78 CD B4 8F
|
||||
00F0 | CA 2F D9 20 2E 6E 5F 95 FE F6 23 A2 06 20 7A FB
|
||||
0100 | 41 61 9C 41 93 57 B4 9F 4F 88 25 B3 7E F7 E7 48
|
||||
0110 | 11 FB A2 2B DF 45 73 0F 42 37 93 C5 04 95 14 36
|
||||
0120 | 32 32 F3 35 8B C5 F6 0A 41 6B DC E7 D7 BB FB 49</code></pre>
|
||||
<pre><code>0000 | 54 B6 43 66 FB 6C 67 30 A2 09 CF B4 D9 9B 31 0D
|
||||
0010 | 48 CA 7F EC 48 08 2D 3E 05 DF D9 54 B9 8C E6 56
|
||||
0020 | 43 8A 88 00 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | 48 95 87 2F F2 7C 39 6A 60 C9 8C DB CB 54 69 C0
|
||||
0040 | 94 82 42 EE BE 99 A0 ED 45 73 CC 10 C6 68 AE 4A
|
||||
0050 | 1B 66 05 38 49 8D 55 44 34 30 8D F0 26 48 20 83
|
||||
0060 | EC A6 D6 72 01 66 3E B5 5F 2C 07 6C 43 CC E5 07
|
||||
0070 | 9A F0 8E 57 4D 56 6F 29 4D EA 24 21 D1 BF 15 13
|
||||
0080 | 62 45 72 E0 EF DB F8 A1 0B 98 1C 65 15 FB 9D 6D
|
||||
0090 | 4E EF 01 AB 48 93 80 DE BA AC 59 E4 BD 35 BA 74
|
||||
00A0 | AA 59 E7 52 A5 FC 46 70 C9 71 5A 9E A6 84 6D 0E
|
||||
00B0 | 3D 7B 02 08 F7 BE 18 DC 5C A6 00 87 3F 45 5B B0
|
||||
00C0 | 80 F2 3F 45 AF A7 15 75 0A 0F 76 73 0A 0D D2 A6
|
||||
00D0 | DD C9 4A 15 FF 51 E0 A3 E7 F2 8C 32 D7 84 93 1F
|
||||
00E0 | 2E CD BA E8 CD 27 EA 54 AC 2C 99 AF 8A DA CD C3
|
||||
00F0 | 77 F2 19 13 98 93 B2 7A B6 C2 56 53 E1 7F 34 95
|
||||
0100 | 0C 60 B4 19 F2 0D 8C 76 8F D9 A1 77 71 98 BF 3E
|
||||
0110 | 1B 9C 78 06 CB 20 7F E3 3C 09 0B B2 86 FE 67 BD
|
||||
0120 | 80 A5 74 96 B0 BA 02 95 9A 6E 57 AE 32 9C 9A 39</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 = BA0D89B515A084B3B9CA2A17F03925F44B78FE68D6701FCD212CEB87C966E5318F5564A
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>15A084B3B9CA2A17F03925F44B78FE68</code></td>
|
||||
<td><code>FB6C6730A209CFB4D99B310D48CA7FEC</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>D6701FCD212CEB87C966E5318F5564A8</code></td>
|
||||
<td><code>48082D3E05DFD954B98CE656438A8800</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>g_b</td>
|
||||
<td>36, 260</td>
|
||||
<td><code>FE000100A0BB357C5A5FBC4EC9D8B217</code> <code>1C030CB68A693A8024CD9E3630BAE4CE</code> <code>000A14A5DBF8A40DFB322678A797ED3D</code> <code>591032D0A1C529BE4E76B7EBD5436E7B</code> <code>F7539A9AB5A5FE9DD62F37CAE704EFE0</code> <code>C10DD608E5D9554F7B2F7198E99CE29A</code> <code>9A86CCE0FBB1491EBA269DEB6AA20C5C</code> <code>B2134E75E5C70A7C0E7D47EE16F87189</code> <code>D135EDAE37EAD992063C11AEA4AC660C</code> <code>F3EBE61B6C21ADAAC2A9317120A6F4D1</code> <code>DA65978FA74BF94CC65A0CA2479D0649</code> <code>06E78575049E7654D346CA576C6778F4</code> <code>78CDB48FCA2FD9202E6E5F95FEF623A2</code> <code>06207AFB41619C419357B49F4F8825B3</code> <code>7EF7E74811FBA22BDF45730F423793C5</code> <code>049514363232F3358BC5F60A416BDCE7</code><br> <code>D7BBFB49</code></td>
|
||||
<td><code>FE0001004895872FF27C396A60C98CDB</code> <code>CB5469C0948242EEBE99A0ED4573CC10</code> <code>C668AE4A1B660538498D554434308DF0</code> <code>26482083ECA6D67201663EB55F2C076C</code> <code>43CCE5079AF08E574D566F294DEA2421</code> <code>D1BF1513624572E0EFDBF8A10B981C65</code> <code>15FB9D6D4EEF01AB489380DEBAAC59E4</code> <code>BD35BA74AA59E752A5FC4670C9715A9E</code> <code>A6846D0E3D7B0208F7BE18DC5CA60087</code> <code>3F455BB080F23F45AFA715750A0F7673</code> <code>0A0DD2A6DDC94A15FF51E0A3E7F28C32</code> <code>D784931F2ECDBAE8CD27EA54AC2C99AF</code> <code>8ADACDC377F219139893B27AB6C25653</code> <code>E17F34950C60B419F20D8C768FD9A177</code> <code>7198BF3E1B9C7806CB207FE33C090BB2</code> <code>86FE67BD80A57496B0BA02959A6E57AE</code><br> <code>329C9A39</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 = BA0D89B515A084B3B9CA2A17F03925F44B78FE68D6701FCD212CEB87C966E5318F5564A
|
|||
<!-- 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 = 54B6436615A084B3B9CA2A17F03925F44B78FE68D6701FCD212CEB87C966E5318F5564A80000000000000000FE000100A0BB357C5A5FBC4EC9D8B2171C030CB68A693A8024CD9E3630BAE4CE000A14A5DBF8A40DFB322678A797ED3D591032D0A1C529BE4E76B7EBD5436E7BF7539A9AB5A5FE9DD62F37CAE704EFE0C10DD608E5D9554F7B2F7198E99CE29A9A86CCE0FBB1491EBA269DEB6AA20C5CB2134E75E5C70A7C0E7D47EE16F87189D135EDAE37EAD992063C11AEA4AC660CF3EBE61B6C21ADAAC2A9317120A6F4D1DA65978FA74BF94CC65A0CA2479D064906E78575049E7654D346CA576C6778F478CDB48FCA2FD9202E6E5F95FEF623A206207AFB41619C419357B49F4F8825B37EF7E74811FBA22BDF45730F423793C5049514363232F3358BC5F60A416BDCE7D7BBFB49
|
||||
padding = C320374A97C7BB863CFF9F97
|
||||
tmp_aes_key = D32E4A7F18252AE2B0406B84633E1117833ED75BDA40011D1E1700E3E08A8AE7
|
||||
tmp_aes_iv = 4FFC40D969D49934ED3740FF66D9179947A5E1D85C4C7F15555920C1845FAD32</code></pre>
|
||||
<pre><code>data = 54B64366FB6C6730A209CFB4D99B310D48CA7FEC48082D3E05DFD954B98CE656438A88000000000000000000FE0001004895872FF27C396A60C98CDBCB5469C0948242EEBE99A0ED4573CC10C668AE4A1B660538498D554434308DF026482083ECA6D67201663EB55F2C076C43CCE5079AF08E574D566F294DEA2421D1BF1513624572E0EFDBF8A10B981C6515FB9D6D4EEF01AB489380DEBAAC59E4BD35BA74AA59E752A5FC4670C9715A9EA6846D0E3D7B0208F7BE18DC5CA600873F455BB080F23F45AFA715750A0F76730A0DD2A6DDC94A15FF51E0A3E7F28C32D784931F2ECDBAE8CD27EA54AC2C99AF8ADACDC377F219139893B27AB6C25653E17F34950C60B419F20D8C768FD9A1777198BF3E1B9C7806CB207FE33C090BB286FE67BD80A57496B0BA02959A6E57AE329C9A39
|
||||
padding = 135F6FBA425997B3BB0A66C0
|
||||
tmp_aes_key = 939A48A4F8097727F06DDF7AAC298444991F6804620AC0E12890D2F8750F0BF1
|
||||
tmp_aes_iv = 2CCC8FF240E00E900DDD34DC87C89B2F9383AEEEF45322E44F4119962A9D4FF9</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 = 79CA5B557095AD847C53D6308A38B62FC9A6F2356C07F298D21C9B0DB4002D90C4C0FB9C72626F9F146B4E3A81F59ED5CC6A0B4F59BC7411CDCA6BDA8C27B6C3B6DB548F076BB6CCB6791DB116E6368C7328BA21212121446CE754EC118CF380ED0CB0D798418CE54D7F68FCAE7AF146F4F8DF31F98794FF6EE06C35DE10A86518434A9F83CDC05FD5B151A50F63AD87D8529D7AA032498AF9C17C6F02E7EE1E8733F5752186880FA475F2977C7F00E1D8384E20613971F98EFD81A3C6BFB3B8F97969FB39D172527961341BBFDC9D2895306365A52F2CB9087C122E53990800BD596E05AA25A5642996AFB43061178A580F21E3C47080418B4CF0B6B10FC0C78595D486B3A3DD401D1BF37257C2584BFD5D71A708B138A6E22F853E522696AA6D1A8532461ABAEA7935A975E3C978A7A00C792CB3ADF688D0B1480C6C016B04CD1BC36546CD9ACABAA0C84DB571749B</code></pre>
|
||||
<pre><code>encrypted_data = 93AB2AF96F1A51915CD4B1F89EED07819E10DDDE3F936D67F2D0E559120DDD56F674775964F5F13243BCF3923BC790E25711DA6EAD8A1BEFC56161532A5EE70D64C00E37D7E5785772A3B7E1AC93EE2D556D48179627B63A2E0C3EF3FEF70DF5FE4351883628E67C6147F276B532A1F3A198FAD209A7472E244EFCB6FBC0CB42C836FA5C12C4499355A3099202AC4FCBAE417B99BF00C6FF3A51FEE64C571A37555F2AAEE90A09C16D77A9E68D728D596CEB84F52C8861AE54EB623B1E91103E0E92495F2C0422E21039E3AFCCB7FDD6425620E51A67206EC9249679019E90579E1DEEDC791AA6FB6FD07D8E6043C34A0DDF7C31192355A97B4119103F2C8B7FDB8BE7AE1277C183DA28C48DCE3E55E6772A7B20585D3D6BDDC81B03A8D5E070CBB568C958A56626CD21A03947CCDDCF1FBCD522C6A60DBB9DD3AE138F2DC112DED74DEE63BE214435753B58100E534E</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 48 CD 0E 00 FD C0 AB 65
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 15 A0 84 B3 B9 CA 2A 17
|
||||
0020 | F0 39 25 F4 4B 78 FE 68 D6 70 1F CD 21 2C EB 87
|
||||
0030 | C9 66 E5 31 8F 55 64 A8 FE 50 01 00 79 CA 5B 55
|
||||
0040 | 70 95 AD 84 7C 53 D6 30 8A 38 B6 2F C9 A6 F2 35
|
||||
0050 | 6C 07 F2 98 D2 1C 9B 0D B4 00 2D 90 C4 C0 FB 9C
|
||||
0060 | 72 62 6F 9F 14 6B 4E 3A 81 F5 9E D5 CC 6A 0B 4F
|
||||
0070 | 59 BC 74 11 CD CA 6B DA 8C 27 B6 C3 B6 DB 54 8F
|
||||
0080 | 07 6B B6 CC B6 79 1D B1 16 E6 36 8C 73 28 BA 21
|
||||
0090 | 21 21 21 44 6C E7 54 EC 11 8C F3 80 ED 0C B0 D7
|
||||
00A0 | 98 41 8C E5 4D 7F 68 FC AE 7A F1 46 F4 F8 DF 31
|
||||
00B0 | F9 87 94 FF 6E E0 6C 35 DE 10 A8 65 18 43 4A 9F
|
||||
00C0 | 83 CD C0 5F D5 B1 51 A5 0F 63 AD 87 D8 52 9D 7A
|
||||
00D0 | A0 32 49 8A F9 C1 7C 6F 02 E7 EE 1E 87 33 F5 75
|
||||
00E0 | 21 86 88 0F A4 75 F2 97 7C 7F 00 E1 D8 38 4E 20
|
||||
00F0 | 61 39 71 F9 8E FD 81 A3 C6 BF B3 B8 F9 79 69 FB
|
||||
0100 | 39 D1 72 52 79 61 34 1B BF DC 9D 28 95 30 63 65
|
||||
0110 | A5 2F 2C B9 08 7C 12 2E 53 99 08 00 BD 59 6E 05
|
||||
0120 | AA 25 A5 64 29 96 AF B4 30 61 17 8A 58 0F 21 E3
|
||||
0130 | C4 70 80 41 8B 4C F0 B6 B1 0F C0 C7 85 95 D4 86
|
||||
0140 | B3 A3 DD 40 1D 1B F3 72 57 C2 58 4B FD 5D 71 A7
|
||||
0150 | 08 B1 38 A6 E2 2F 85 3E 52 26 96 AA 6D 1A 85 32
|
||||
0160 | 46 1A BA EA 79 35 A9 75 E3 C9 78 A7 A0 0C 79 2C
|
||||
0170 | B3 AD F6 88 D0 B1 48 0C 6C 01 6B 04 CD 1B C3 65
|
||||
0180 | 46 CD 9A CA BA A0 C8 4D B5 71 74 9B</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 B0 FE 05 00 E1 C8 AB 65
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 FB 6C 67 30 A2 09 CF B4
|
||||
0020 | D9 9B 31 0D 48 CA 7F EC 48 08 2D 3E 05 DF D9 54
|
||||
0030 | B9 8C E6 56 43 8A 88 00 FE 50 01 00 93 AB 2A F9
|
||||
0040 | 6F 1A 51 91 5C D4 B1 F8 9E ED 07 81 9E 10 DD DE
|
||||
0050 | 3F 93 6D 67 F2 D0 E5 59 12 0D DD 56 F6 74 77 59
|
||||
0060 | 64 F5 F1 32 43 BC F3 92 3B C7 90 E2 57 11 DA 6E
|
||||
0070 | AD 8A 1B EF C5 61 61 53 2A 5E E7 0D 64 C0 0E 37
|
||||
0080 | D7 E5 78 57 72 A3 B7 E1 AC 93 EE 2D 55 6D 48 17
|
||||
0090 | 96 27 B6 3A 2E 0C 3E F3 FE F7 0D F5 FE 43 51 88
|
||||
00A0 | 36 28 E6 7C 61 47 F2 76 B5 32 A1 F3 A1 98 FA D2
|
||||
00B0 | 09 A7 47 2E 24 4E FC B6 FB C0 CB 42 C8 36 FA 5C
|
||||
00C0 | 12 C4 49 93 55 A3 09 92 02 AC 4F CB AE 41 7B 99
|
||||
00D0 | BF 00 C6 FF 3A 51 FE E6 4C 57 1A 37 55 5F 2A AE
|
||||
00E0 | E9 0A 09 C1 6D 77 A9 E6 8D 72 8D 59 6C EB 84 F5
|
||||
00F0 | 2C 88 61 AE 54 EB 62 3B 1E 91 10 3E 0E 92 49 5F
|
||||
0100 | 2C 04 22 E2 10 39 E3 AF CC B7 FD D6 42 56 20 E5
|
||||
0110 | 1A 67 20 6E C9 24 96 79 01 9E 90 57 9E 1D EE DC
|
||||
0120 | 79 1A A6 FB 6F D0 7D 8E 60 43 C3 4A 0D DF 7C 31
|
||||
0130 | 19 23 55 A9 7B 41 19 10 3F 2C 8B 7F DB 8B E7 AE
|
||||
0140 | 12 77 C1 83 DA 28 C4 8D CE 3E 55 E6 77 2A 7B 20
|
||||
0150 | 58 5D 3D 6B DD C8 1B 03 A8 D5 E0 70 CB B5 68 C9
|
||||
0160 | 58 A5 66 26 CD 21 A0 39 47 CC DD CF 1F BC D5 22
|
||||
0170 | C6 A6 0D BB 9D D3 AE 13 8F 2D C1 12 DE D7 4D EE
|
||||
0180 | 63 BE 21 44 35 75 3B 58 10 0E 53 4E</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>48CD0E00FDC0AB65</code></td>
|
||||
<td><code>B0FE0500E1C8AB65</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>15A084B3B9CA2A17F03925F44B78FE68</code></td>
|
||||
<td><code>FB6C6730A209CFB4D99B310D48CA7FEC</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>D6701FCD212CEB87C966E5318F5564A8</code></td>
|
||||
<td><code>48082D3E05DFD954B98CE656438A8800</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>56, 340</td>
|
||||
<td><code>FE50010079CA5B557095AD847C53D630</code> <code>8A38B62FC9A6F2356C07F298D21C9B0D</code> <code>B4002D90C4C0FB9C72626F9F146B4E3A</code> <code>81F59ED5CC6A0B4F59BC7411CDCA6BDA</code> <code>8C27B6C3B6DB548F076BB6CCB6791DB1</code> <code>16E6368C7328BA21212121446CE754EC</code> <code>118CF380ED0CB0D798418CE54D7F68FC</code> <code>AE7AF146F4F8DF31F98794FF6EE06C35</code> <code>DE10A86518434A9F83CDC05FD5B151A5</code> <code>0F63AD87D8529D7AA032498AF9C17C6F</code> <code>02E7EE1E8733F5752186880FA475F297</code> <code>7C7F00E1D8384E20613971F98EFD81A3</code> <code>C6BFB3B8F97969FB39D172527961341B</code> <code>BFDC9D2895306365A52F2CB9087C122E</code> <code>53990800BD596E05AA25A5642996AFB4</code> <code>3061178A580F21E3C47080418B4CF0B6</code> <code>B10FC0C78595D486B3A3DD401D1BF372</code> <code>57C2584BFD5D71A708B138A6E22F853E</code> <code>522696AA6D1A8532461ABAEA7935A975</code> <code>E3C978A7A00C792CB3ADF688D0B1480C</code> <code>6C016B04CD1BC36546CD9ACABAA0C84D</code><br> <code>B571749B</code></td>
|
||||
<td><code>FE50010093AB2AF96F1A51915CD4B1F8</code> <code>9EED07819E10DDDE3F936D67F2D0E559</code> <code>120DDD56F674775964F5F13243BCF392</code> <code>3BC790E25711DA6EAD8A1BEFC5616153</code> <code>2A5EE70D64C00E37D7E5785772A3B7E1</code> <code>AC93EE2D556D48179627B63A2E0C3EF3</code> <code>FEF70DF5FE4351883628E67C6147F276</code> <code>B532A1F3A198FAD209A7472E244EFCB6</code> <code>FBC0CB42C836FA5C12C4499355A30992</code> <code>02AC4FCBAE417B99BF00C6FF3A51FEE6</code> <code>4C571A37555F2AAEE90A09C16D77A9E6</code> <code>8D728D596CEB84F52C8861AE54EB623B</code> <code>1E91103E0E92495F2C0422E21039E3AF</code> <code>CCB7FDD6425620E51A67206EC9249679</code> <code>019E90579E1DEEDC791AA6FB6FD07D8E</code> <code>6043C34A0DDF7C31192355A97B411910</code> <code>3F2C8B7FDB8BE7AE1277C183DA28C48D</code> <code>CE3E55E6772A7B20585D3D6BDDC81B03</code> <code>A8D5E070CBB568C958A56626CD21A039</code> <code>47CCDDCF1FBCD522C6A60DBB9DD3AE13</code> <code>8F2DC112DED74DEE63BE214435753B58</code><br> <code>100E534E</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 = 77379866D71627E6C3635361F9681B03C9EE8A7AAB9552EF513A13315EABC18A118ED649614AE1F01DAB8F71D83341309C5999AD4889E5D9F3E911AAAD00D9DDC24273D7B97DD92151F969242F347C8F9D5DE44E8D7E87A69C2AE1757F5ECD20AAFC586EDD34C89AC8D5B8F7C9EB33A0C7F06A69632BCEB8DE03E336E5AF0332D4B1F52BA73FBE7A3A6FE8C2268C10B9357E5474A7CCEB0E39FE3B4A92900CD09AF3C307D8FA90CB9DA2AD35643FB0335BD0B7E6D30D1038741EB632E6A97B692A1F76F418AF74337D05539B59DF1D4E16B7E0C87240595DDFD26037CDB7E70DB4B6C5CAE532F49BC6974F6F46FD3CBDCD90EBB6795FD9A43421BCDF893D5C46</code></pre>
|
||||
<pre><code>auth_key = 72CC5EB1A5E336C6ECA831CF9B76A2FA522B83C9AD9BA596CAF69848F17A50A70222D281CACBAB6B489E41A9837B54D081892A4A0018E865D6AEC0255B4C75B2119966D6D390099DE3098FFA7B65A0745A069E1DC5128DEFBD592AF2D36576229C9921809F38BBAC62DF4A43FD0F1C5944CB63ECC87D704DEC1F5E04204D7D02A7C3A2087836FB830B19F5A4CFFCAA5405F702C3D0189136085180DD87253FBA4292E83BA79A70EFA97A05963384A69F7A578D60B04102B38DD80F9AE56D7239072341AAEA0B54858E3C630A8B6FDA4F427B2CDEADD5F275F77AAE62E5029285470B77A882D08C58F3D54FE3C97996F391BC1EDAB6EED8424360A3592DDFA78C</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 C0 A6 F6 FD C0 AB 65
|
||||
0010 | 70 00 00 00 34 F7 CB 3B 15 A0 84 B3 B9 CA 2A 17
|
||||
0020 | F0 39 25 F4 4B 78 FE 68 D6 70 1F CD 21 2C EB 87
|
||||
0030 | C9 66 E5 31 8F 55 64 A8 67 7F 48 3B B8 9F D2 06
|
||||
0040 | B2 44 A2 D1 AC 38 CB 31</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 94 29 17 E2 C8 AB 65
|
||||
0010 | B0 00 00 00 34 F7 CB 3B FB 6C 67 30 A2 09 CF B4
|
||||
0020 | D9 9B 31 0D 48 CA 7F EC 48 08 2D 3E 05 DF D9 54
|
||||
0030 | B9 8C E6 56 43 8A 88 00 9B 1A 8F 9A 8D 23 BD C1
|
||||
0040 | FE 2E 7C 9F 01 DA 7C 8B</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>01C0A6F6FDC0AB65</code></td>
|
||||
<td><code>01942917E2C8AB65</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>B0000000</code> (176 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>15A084B3B9CA2A17F03925F44B78FE68</code></td>
|
||||
<td><code>FB6C6730A209CFB4D99B310D48CA7FEC</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>D6701FCD212CEB87C966E5318F5564A8</code></td>
|
||||
<td><code>48082D3E05DFD954B98CE656438A8800</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce_hash1</td>
|
||||
<td>56, 16</td>
|
||||
<td><code>677F483BB89FD206B244A2D1AC38CB31</code></td>
|
||||
<td><code>9B1A8F9A8D23BDC1FE2E7C9F01DA7C8B</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>
|
||||
|
|
Loading…
Reference in a new issue