mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2025-01-21 00:17:06 +01:00
Update content of files
This commit is contained in:
parent
8bd217da7c
commit
78b18d87cf
1 changed files with 206 additions and 206 deletions
|
@ -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 2C 08 0F 00 D9 BA 70 65
|
||||
0010 | 14 00 00 00 F1 8E 7E BE 8C 08 57 AA 2E 27 2A 56
|
||||
0020 | 04 13 E8 05 64 5D EF 49</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 74 5F 02 00 46 E5 70 65
|
||||
0010 | 14 00 00 00 F1 8E 7E BE 0A 95 A3 0D D1 75 4A BF
|
||||
0020 | 28 3B CE 96 F3 B3 EB 42</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>2C080F00D9BA7065</code></td>
|
||||
<td><code>745F020046E57065</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>8C0857AA2E272A560413E805645DEF49</code></td>
|
||||
<td><code>0A95A30DD1754ABF283BCE96F3B3EB42</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 28 3D 66 D9 BA 70 65
|
||||
0010 | A8 00 00 00 63 24 16 05 8C 08 57 AA 2E 27 2A 56
|
||||
0020 | 04 13 E8 05 64 5D EF 49 B5 9D 25 38 AE 48 79 78
|
||||
0030 | F7 F4 B2 24 D3 82 08 D2 08 10 27 B3 FE 7D 03 77
|
||||
0040 | DF 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 94 7D A2 46 E5 70 65
|
||||
0010 | 54 00 00 00 63 24 16 05 0A 95 A3 0D D1 75 4A BF
|
||||
0020 | 28 3B CE 96 F3 B3 EB 42 14 B7 7C B9 1E FB E6 D3
|
||||
0030 | F5 CF 06 3E 93 8C 11 B7 08 1C 18 DE 9B 76 56 E9
|
||||
0040 | AD 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>01283D66D9BA7065</code></td>
|
||||
<td><code>01947DA246E57065</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>54000000</code> (84 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -150,19 +150,19 @@
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>8C0857AA2E272A560413E805645DEF49</code></td>
|
||||
<td><code>0A95A30DD1754ABF283BCE96F3B3EB42</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>B59D2538AE487978F7F4B224D38208D2</code></td>
|
||||
<td><code>14B77CB91EFBE6D3F5CF063E938C11B7</code></td>
|
||||
<td>Server-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pq</td>
|
||||
<td>56, 12</td>
|
||||
<td><code>081027B3FE7D0377DF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1164096934299006943</td>
|
||||
<td><code>081C18DE9B7656E9AD000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2024612791789742509</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 = 1164096934299006943</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1164096934299006943 = 1033809769 * 1126026247</code></p>
|
||||
<pre><code>p = 1033809769
|
||||
q = 1126026247</code></pre>
|
||||
<pre><code>pq = 2024612791789742509</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2024612791789742509 = 1071870773 * 1888859033</code></p>
|
||||
<pre><code>p = 1071870773
|
||||
q = 1888859033</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 10 27 B3 FE 7D 03 77 DF 00 00 00
|
||||
0010 | 04 3D 9E AF 69 00 00 00 04 43 1D CC 07 00 00 00
|
||||
0020 | 8C 08 57 AA 2E 27 2A 56 04 13 E8 05 64 5D EF 49
|
||||
0030 | B5 9D 25 38 AE 48 79 78 F7 F4 B2 24 D3 82 08 D2
|
||||
0040 | 4A 86 DA 13 B5 C2 A3 1B 4F 72 3B 48 3F CA CE 69
|
||||
0050 | 1C 88 2A 77 01 72 91 6D AE AD 0C 68 E6 E6 4D B6
|
||||
<pre><code>0000 | 95 5F F5 A9 08 1C 18 DE 9B 76 56 E9 AD 00 00 00
|
||||
0010 | 04 3F E3 73 35 00 00 00 04 70 95 B3 99 00 00 00
|
||||
0020 | 0A 95 A3 0D D1 75 4A BF 28 3B CE 96 F3 B3 EB 42
|
||||
0030 | 14 B7 7C B9 1E FB E6 D3 F5 CF 06 3E 93 8C 11 B7
|
||||
0040 | B4 35 80 BF E4 FC 5A 8D 68 30 18 B4 12 26 6D 99
|
||||
0050 | 62 6F 04 7B 3C 57 0B C2 CE E5 69 91 45 E8 78 0B
|
||||
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 = 1126026247</code></pre>
|
|||
<tr>
|
||||
<td>pq</td>
|
||||
<td>4, 12</td>
|
||||
<td><code>081027B3FE7D0377DF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1164096934299006943</td>
|
||||
<td><code>081C18DE9B7656E9AD000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2024612791789742509</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>043D9EAF69000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1033809769</td>
|
||||
<td><code>043FE37335000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1071870773</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>04431DCC07000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1126026247</td>
|
||||
<td><code>047095B399000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1888859033</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>8C0857AA2E272A560413E805645DEF49</code></td>
|
||||
<td><code>0A95A30DD1754ABF283BCE96F3B3EB42</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>48, 16</td>
|
||||
<td><code>B59D2538AE487978F7F4B224D38208D2</code></td>
|
||||
<td><code>14B77CB91EFBE6D3F5CF063E938C11B7</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce</td>
|
||||
<td>64, 32</td>
|
||||
<td><code>4A86DA13B5C2A31B4F723B483FCACE69</code> <code>1C882A770172916DAEAD0C68E6E64DB6</code></td>
|
||||
<td><code>B43580BFE4FC5A8D683018B412266D99</code> <code>626F047B3C570BC2CEE5699145E8780B</code></td>
|
||||
<td>Client-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -291,39 +291,39 @@ q = 1126026247</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 = 955FF5A9081027B3FE7D0377DF000000043D9EAF6900000004431DCC070000008C0857AA2E272A560413E805645DEF49B59D2538AE487978F7F4B224D38208D24A86DA13B5C2A31B4F723B483FCACE691C882A770172916DAEAD0C68E6E64DB602000000
|
||||
random_padding_bytes = C68C9B857D0A036C3DC519E08DF98D07995A10FCA0663CA30F360CE48478B49CF6DA417C914DE0E6FCD8D4D8A95B0B33E0F9BD31FF38C3156E6DEE36330868ADAE220F86FC6D95170B4DB2BF6967C865EB4870DDBA59E284FF761A11</code></pre>
|
||||
<pre><code>data = 955FF5A9081C18DE9B7656E9AD000000043FE37335000000047095B3990000000A95A30DD1754ABF283BCE96F3B3EB4214B77CB91EFBE6D3F5CF063E938C11B7B43580BFE4FC5A8D683018B412266D99626F047B3C570BC2CEE5699145E8780B02000000
|
||||
random_padding_bytes = DEF43E9633F3C629CCDB795626418EC6E43810811311F9D038ACCE99AF060EDDF11A098AD4758A294E5366B5E0589387F4696C92E1C4A57F5F30877C7C3C1444DBE0E4F3AA1A0094AA605D830A6A225ED7EB9702729C54A29D11F333</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 = 492CE78F83CA6A61FF81F0F010DAC442CD1D47CD7D1BC72127378CE3B8BEFF5EE0CFBDA122C64EA25F7DF09BC71891441412D1A414AAEDB32BE57D34C102A5D6C7780D883E7A1F70344DBB7B309E6940EE857C4370BDE1BD7BF86FE75D479A1694BE236B44E5A5204DCFB1D85FA4384DC6BFA1E1A3D6A580458C9DA238E0660532470B54E8F5627726495698FEBA681B1FAB46AA003F2E01116FE0D666189A3B56DBEBFE3CACA4267F46A0819FE8E6C275DC07EA7562F28F7702563FFD6E1DA6ED17BCBC16005EB76D1A5862DB7B06D761B778BF211BAD88E32A80C4E7573E2FCFCC5A84FA7B8377F3893E2899ABDD473214F7C0249C4CA88BA1F3665C8F9F28</code></pre>
|
||||
<pre><code>encrypted_data = 211A7F48B2502585FDD2FF0908E06F547EC7A78373635DD8EBEF7D4791133E7BCD5380BF1324F78544718922D6981E98B494CA72DA974B0AFFEAF3703FF6B52B16747175F69FF81DC83AA37F2730915FF2AD834A575768080B921DAE23E0B5A7F07E7B1D605EB991473B702BBCF184A8F9D757F85C215195DCF089422572FEF35B9375F449EDDE40E487C6974AF39699ACB7569C311871003E921683360FF316E5792ABEC630D64FA5D684831801A329EA1A192ED520776DC55D918E454B12CAE4D9D67300B5A1D743DA9DF32AD9E61B051BB11CAB7B5AE8A680B757AD64F5529A1BFC85B0EC08872E4BD3A7FCF5239610423EDBEF1BFFFA53FC1C105ED89479</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 30 08 0F 00 D9 BA 70 65
|
||||
0010 | 40 01 00 00 BE E4 12 D7 8C 08 57 AA 2E 27 2A 56
|
||||
0020 | 04 13 E8 05 64 5D EF 49 B5 9D 25 38 AE 48 79 78
|
||||
0030 | F7 F4 B2 24 D3 82 08 D2 04 3D 9E AF 69 00 00 00
|
||||
0040 | 04 43 1D CC 07 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 49 2C E7 8F 83 CA 6A 61 FF 81 F0 F0
|
||||
0060 | 10 DA C4 42 CD 1D 47 CD 7D 1B C7 21 27 37 8C E3
|
||||
0070 | B8 BE FF 5E E0 CF BD A1 22 C6 4E A2 5F 7D F0 9B
|
||||
0080 | C7 18 91 44 14 12 D1 A4 14 AA ED B3 2B E5 7D 34
|
||||
0090 | C1 02 A5 D6 C7 78 0D 88 3E 7A 1F 70 34 4D BB 7B
|
||||
00A0 | 30 9E 69 40 EE 85 7C 43 70 BD E1 BD 7B F8 6F E7
|
||||
00B0 | 5D 47 9A 16 94 BE 23 6B 44 E5 A5 20 4D CF B1 D8
|
||||
00C0 | 5F A4 38 4D C6 BF A1 E1 A3 D6 A5 80 45 8C 9D A2
|
||||
00D0 | 38 E0 66 05 32 47 0B 54 E8 F5 62 77 26 49 56 98
|
||||
00E0 | FE BA 68 1B 1F AB 46 AA 00 3F 2E 01 11 6F E0 D6
|
||||
00F0 | 66 18 9A 3B 56 DB EB FE 3C AC A4 26 7F 46 A0 81
|
||||
0100 | 9F E8 E6 C2 75 DC 07 EA 75 62 F2 8F 77 02 56 3F
|
||||
0110 | FD 6E 1D A6 ED 17 BC BC 16 00 5E B7 6D 1A 58 62
|
||||
0120 | DB 7B 06 D7 61 B7 78 BF 21 1B AD 88 E3 2A 80 C4
|
||||
0130 | E7 57 3E 2F CF CC 5A 84 FA 7B 83 77 F3 89 3E 28
|
||||
0140 | 99 AB DD 47 32 14 F7 C0 24 9C 4C A8 8B A1 F3 66
|
||||
0150 | 5C 8F 9F 28</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 44 A8 0B 00 46 E5 70 65
|
||||
0010 | 40 01 00 00 BE E4 12 D7 0A 95 A3 0D D1 75 4A BF
|
||||
0020 | 28 3B CE 96 F3 B3 EB 42 14 B7 7C B9 1E FB E6 D3
|
||||
0030 | F5 CF 06 3E 93 8C 11 B7 04 3F E3 73 35 00 00 00
|
||||
0040 | 04 70 95 B3 99 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 21 1A 7F 48 B2 50 25 85 FD D2 FF 09
|
||||
0060 | 08 E0 6F 54 7E C7 A7 83 73 63 5D D8 EB EF 7D 47
|
||||
0070 | 91 13 3E 7B CD 53 80 BF 13 24 F7 85 44 71 89 22
|
||||
0080 | D6 98 1E 98 B4 94 CA 72 DA 97 4B 0A FF EA F3 70
|
||||
0090 | 3F F6 B5 2B 16 74 71 75 F6 9F F8 1D C8 3A A3 7F
|
||||
00A0 | 27 30 91 5F F2 AD 83 4A 57 57 68 08 0B 92 1D AE
|
||||
00B0 | 23 E0 B5 A7 F0 7E 7B 1D 60 5E B9 91 47 3B 70 2B
|
||||
00C0 | BC F1 84 A8 F9 D7 57 F8 5C 21 51 95 DC F0 89 42
|
||||
00D0 | 25 72 FE F3 5B 93 75 F4 49 ED DE 40 E4 87 C6 97
|
||||
00E0 | 4A F3 96 99 AC B7 56 9C 31 18 71 00 3E 92 16 83
|
||||
00F0 | 36 0F F3 16 E5 79 2A BE C6 30 D6 4F A5 D6 84 83
|
||||
0100 | 18 01 A3 29 EA 1A 19 2E D5 20 77 6D C5 5D 91 8E
|
||||
0110 | 45 4B 12 CA E4 D9 D6 73 00 B5 A1 D7 43 DA 9D F3
|
||||
0120 | 2A D9 E6 1B 05 1B B1 1C AB 7B 5A E8 A6 80 B7 57
|
||||
0130 | AD 64 F5 52 9A 1B FC 85 B0 EC 08 87 2E 4B D3 A7
|
||||
0140 | FC F5 23 96 10 42 3E DB EF 1B FF FA 53 FC 1C 10
|
||||
0150 | 5E D8 94 79</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 = C68C9B857D0A036C3DC519E08DF98D07995A10FCA0663CA30F360CE48
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>30080F00D9BA7065</code></td>
|
||||
<td><code>44A80B0046E57065</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 = C68C9B857D0A036C3DC519E08DF98D07995A10FCA0663CA30F360CE48
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>8C0857AA2E272A560413E805645DEF49</code></td>
|
||||
<td><code>0A95A30DD1754ABF283BCE96F3B3EB42</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>B59D2538AE487978F7F4B224D38208D2</code></td>
|
||||
<td><code>14B77CB91EFBE6D3F5CF063E938C11B7</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p</td>
|
||||
<td>56, 8</td>
|
||||
<td><code>043D9EAF69000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1033809769</td>
|
||||
<td><code>043FE37335000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1071870773</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>04431DCC07000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1126026247</td>
|
||||
<td><code>047095B399000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1888859033</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 = C68C9B857D0A036C3DC519E08DF98D07995A10FCA0663CA30F360CE48
|
|||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>80, 260</td>
|
||||
<td><code>FE000100492CE78F83CA6A61FF81F0F0</code> <code>10DAC442CD1D47CD7D1BC72127378CE3</code> <code>B8BEFF5EE0CFBDA122C64EA25F7DF09B</code> <code>C71891441412D1A414AAEDB32BE57D34</code> <code>C102A5D6C7780D883E7A1F70344DBB7B</code> <code>309E6940EE857C4370BDE1BD7BF86FE7</code> <code>5D479A1694BE236B44E5A5204DCFB1D8</code> <code>5FA4384DC6BFA1E1A3D6A580458C9DA2</code> <code>38E0660532470B54E8F5627726495698</code> <code>FEBA681B1FAB46AA003F2E01116FE0D6</code> <code>66189A3B56DBEBFE3CACA4267F46A081</code> <code>9FE8E6C275DC07EA7562F28F7702563F</code> <code>FD6E1DA6ED17BCBC16005EB76D1A5862</code> <code>DB7B06D761B778BF211BAD88E32A80C4</code> <code>E7573E2FCFCC5A84FA7B8377F3893E28</code> <code>99ABDD473214F7C0249C4CA88BA1F366</code><br> <code>5C8F9F28</code></td>
|
||||
<td><code>FE000100211A7F48B2502585FDD2FF09</code> <code>08E06F547EC7A78373635DD8EBEF7D47</code> <code>91133E7BCD5380BF1324F78544718922</code> <code>D6981E98B494CA72DA974B0AFFEAF370</code> <code>3FF6B52B16747175F69FF81DC83AA37F</code> <code>2730915FF2AD834A575768080B921DAE</code> <code>23E0B5A7F07E7B1D605EB991473B702B</code> <code>BCF184A8F9D757F85C215195DCF08942</code> <code>2572FEF35B9375F449EDDE40E487C697</code> <code>4AF39699ACB7569C311871003E921683</code> <code>360FF316E5792ABEC630D64FA5D68483</code> <code>1801A329EA1A192ED520776DC55D918E</code> <code>454B12CAE4D9D67300B5A1D743DA9DF3</code> <code>2AD9E61B051BB11CAB7B5AE8A680B757</code> <code>AD64F5529A1BFC85B0EC08872E4BD3A7</code> <code>FCF5239610423EDBEF1BFFFA53FC1C10</code><br> <code>5ED89479</code></td>
|
||||
<td>Value generated above</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -402,47 +402,47 @@ random_padding_bytes = C68C9B857D0A036C3DC519E08DF98D07995A10FCA0663CA30F360CE48
|
|||
<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 04 A6 FB D9 BA 70 65
|
||||
0010 | B0 02 00 00 5C 07 E8 D0 8C 08 57 AA 2E 27 2A 56
|
||||
0020 | 04 13 E8 05 64 5D EF 49 B5 9D 25 38 AE 48 79 78
|
||||
0030 | F7 F4 B2 24 D3 82 08 D2 FE 50 02 00 CD 43 28 4C
|
||||
0040 | 99 C4 85 6A 4E FE B9 30 63 80 1D C6 E1 16 5F 4A
|
||||
0050 | 64 0A 3E 3D 2A DC 77 EA 1C 2F 9F 94 27 D6 E2 6E
|
||||
0060 | E8 5C 19 15 C6 58 1A 61 D3 51 10 DA 34 C5 5B 21
|
||||
0070 | 90 D8 A0 A9 00 D6 4B F0 71 7D A5 71 8D EA 96 99
|
||||
0080 | D1 89 25 F6 1B 0F 5C 12 35 07 5D BB C5 C8 DC 68
|
||||
0090 | 61 F2 87 60 46 29 04 43 42 F1 02 82 4E 91 21 8C
|
||||
00A0 | FD 9C 18 03 06 07 C9 18 8A 23 2C B5 80 E0 D7 36
|
||||
00B0 | 10 E5 D4 E2 12 EB 6A 32 53 58 53 6C E4 5F D4 A3
|
||||
00C0 | 2D 15 FD 21 9C 0E 1E 1E FF 00 D5 8E 2C AE 99 B5
|
||||
00D0 | AF C0 D1 F5 58 A3 66 2B 01 29 BF FD F9 94 BD 90
|
||||
00E0 | 16 79 79 40 C4 17 B0 32 A3 D0 FA 5F 1E 02 64 6F
|
||||
00F0 | CA CF 6C A3 35 B0 8B 26 9C D7 68 66 05 A9 77 EA
|
||||
0100 | 06 A9 EE AC 1B 22 09 BE FD 3E B3 5B C8 02 C2 0A
|
||||
0110 | 2F 68 2E 61 B0 25 3A 74 64 56 CB 55 16 29 55 5D
|
||||
0120 | 15 A6 D3 C3 13 08 8B 56 E1 C8 3A 6F D3 CF F4 F4
|
||||
0130 | 62 A7 18 5A E1 2D 91 6B 1B 21 0B A4 EE 0B E5 9F
|
||||
0140 | 33 E0 BB AF E1 27 D3 CA 15 CE 57 CD 8C A4 B3 7B
|
||||
0150 | 37 8D D3 74 F2 A1 79 4E 9F 56 83 9B 3B 4B 1F C2
|
||||
0160 | 86 5C 41 72 03 74 39 06 22 A1 ED A4 79 7B 4F EB
|
||||
0170 | D2 A2 67 D1 AC AB 37 94 BB D4 B1 A4 F9 F0 CE E9
|
||||
0180 | 64 83 2D D9 74 D7 CC 27 99 2D 2F 21 79 D0 B0 37
|
||||
0190 | 9A DB F7 E9 74 42 74 24 5B E7 D8 7C 87 F4 6C 15
|
||||
01A0 | DF 95 89 57 D3 BD 96 67 61 95 74 30 70 64 DF BE
|
||||
01B0 | 7F AA AA E3 AC CC 09 D6 18 3A D5 E9 39 B0 1C FF
|
||||
01C0 | 9A C9 FE DF E3 76 61 9F 1A C5 E1 28 68 48 B5 F3
|
||||
01D0 | F1 03 65 50 93 F2 28 81 D9 57 14 6E 95 D1 42 B2
|
||||
01E0 | A3 81 1E 7E 37 12 2A 81 44 CB 1E 59 36 EE AD 91
|
||||
01F0 | A9 F4 A8 88 C2 A3 84 9E 92 DF 22 7F 5B DC 65 89
|
||||
0200 | A1 4B BF 47 25 5B F1 C3 3D 4E D8 D2 80 F4 77 47
|
||||
0210 | 78 8A 8C 03 7F D9 24 9D 91 F7 5C 59 A3 D9 9B E1
|
||||
0220 | DC 70 96 40 1C FD AE CE 28 D6 D0 1E 31 91 42 85
|
||||
0230 | EE 44 26 36 6E 4A 10 61 6A 07 F2 BE AE 96 8F 46
|
||||
0240 | D7 08 62 F9 55 FC B2 D7 46 93 E5 2F 06 B1 CC 3D
|
||||
0250 | 66 93 42 CC 05 35 D7 13 52 A9 F2 7B F9 07 82 1E
|
||||
0260 | 83 CA EC 9A 64 11 A7 E1 1C 75 AB C7 F7 7A AE 8D
|
||||
0270 | 2D DE 1C 0A F5 52 DC 4F 85 35 03 68 85 59 B4 1C
|
||||
0280 | 7F 63 46 B7 2E 9C 8E 61 A5 6E 5F A8</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 08 1B 63 47 E5 70 65
|
||||
0010 | C0 02 00 00 5C 07 E8 D0 0A 95 A3 0D D1 75 4A BF
|
||||
0020 | 28 3B CE 96 F3 B3 EB 42 14 B7 7C B9 1E FB E6 D3
|
||||
0030 | F5 CF 06 3E 93 8C 11 B7 FE 50 02 00 7C E4 65 BC
|
||||
0040 | 91 5E B0 CD 93 47 2D 2C 20 35 63 D7 64 25 D5 AC
|
||||
0050 | B9 FB 41 50 17 47 DD 7F B0 CC BB 12 97 AE 28 12
|
||||
0060 | D1 5D 3A 67 E0 AF DD D7 D7 78 35 2D AD 8C 74 82
|
||||
0070 | 3A 39 A5 66 94 A5 31 1A 04 1B C9 6F 52 49 B9 BC
|
||||
0080 | 63 31 F0 FF 90 02 13 C9 BE 6C 88 D2 B1 61 94 CA
|
||||
0090 | CD A2 A1 A7 30 EE ED 93 77 42 D4 7A CB 3F 6F 15
|
||||
00A0 | 74 75 ED 09 3A 1D 50 98 F7 9E ED C5 14 61 AB EC
|
||||
00B0 | BA 88 D1 19 A1 E7 BA F7 C2 59 3E DE CE 66 69 38
|
||||
00C0 | 8F 80 D3 F5 C2 99 C3 90 D3 AD E1 3F E4 22 23 1B
|
||||
00D0 | 71 6D 3E 1C 69 91 5B 70 17 CD 6E 14 A8 5B 86 58
|
||||
00E0 | C4 34 4A 23 8E 5F C8 73 EE 64 CE 68 D6 FB AF 07
|
||||
00F0 | C8 2D E0 EC E4 D8 9C 9E 26 68 B6 FA B1 BA D5 A2
|
||||
0100 | 63 DD 6D 17 14 94 6B C8 42 7A 8F 82 A1 D4 61 D7
|
||||
0110 | 9E 78 BE 3A 22 0D BF 54 84 3E B8 E2 27 80 E5 34
|
||||
0120 | C7 67 87 18 E9 BA 00 19 A9 D7 06 B5 E9 04 A8 C6
|
||||
0130 | 5C 57 25 67 D4 7F CB 94 9F 93 B4 FA E7 AB 5D 6E
|
||||
0140 | 6B 91 DE E1 7C BB 40 20 40 92 23 C8 67 FD 77 B3
|
||||
0150 | 36 59 96 49 1B 26 6A 9C FC 9D BA 86 5D 8E 20 60
|
||||
0160 | 37 0F AF 5C 66 DD 7F F9 8C BE E4 EB 76 CB C6 63
|
||||
0170 | 80 9B 41 36 82 BE FC 21 03 22 05 E0 82 23 50 AA
|
||||
0180 | 06 69 0E 89 C0 66 1F 3F B5 88 A6 18 61 48 48 12
|
||||
0190 | A9 96 B8 24 78 71 DF 17 24 EE 98 DA D1 3F 3F AC
|
||||
01A0 | D6 FB 1A 28 56 01 B0 92 61 8A BB 19 0F 2B 8D 8A
|
||||
01B0 | 40 52 68 5B 6F 4A 3C DE F0 01 0F BE 49 97 52 6D
|
||||
01C0 | 50 B9 14 5F 05 0A 0C 02 54 28 BA 27 4B 85 55 8E
|
||||
01D0 | 10 CE 85 6C 61 89 04 2E A8 D1 E8 22 64 FB F1 06
|
||||
01E0 | C2 5D F5 94 08 CE 45 B9 AE F2 A9 E4 FA 23 84 FE
|
||||
01F0 | 48 85 EB F7 4E 44 D1 7B 2E 3B 58 B4 6B F6 AB 02
|
||||
0200 | E8 9F 5A 56 F8 FB 54 89 C6 11 AA 12 42 49 7B 4D
|
||||
0210 | 13 AD DD 3D 30 C3 8F FF A1 AA 62 FC 03 50 28 8D
|
||||
0220 | 29 93 14 A3 48 BB 53 17 AD F6 59 1D A5 02 5F CC
|
||||
0230 | A3 5C FA A0 D4 BF B4 0A 9B 31 0A BB 10 E8 0B 97
|
||||
0240 | 4D AC 3C 3A 62 87 C2 47 1B D9 7D 68 D2 B7 46 9D
|
||||
0250 | 02 85 E8 1E 47 3B 46 0B C3 53 8E 2A E5 25 51 42
|
||||
0260 | EA 8D 13 A7 64 C7 40 F9 3C 5A 5F A6 4E 9C 0A F0
|
||||
0270 | A4 2D 7C 27 DF FC 86 A2 92 57 B8 6E E4 D8 CC 77
|
||||
0280 | 90 E0 E8 03 F3 48 49 6F A1 AA BB B0</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 = C68C9B857D0A036C3DC519E08DF98D07995A10FCA0663CA30F360CE48
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>0104A6FBD9BA7065</code></td>
|
||||
<td><code>01081B6347E57065</code></td>
|
||||
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>message_length</td>
|
||||
<td>16, 4</td>
|
||||
<td><code>B0020000</code> (688 in decimal)</td>
|
||||
<td><code>C0020000</code> (704 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -482,19 +482,19 @@ random_padding_bytes = C68C9B857D0A036C3DC519E08DF98D07995A10FCA0663CA30F360CE48
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>8C0857AA2E272A560413E805645DEF49</code></td>
|
||||
<td><code>0A95A30DD1754ABF283BCE96F3B3EB42</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>B59D2538AE487978F7F4B224D38208D2</code></td>
|
||||
<td><code>14B77CB91EFBE6D3F5CF063E938C11B7</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_answer</td>
|
||||
<td>56, 596</td>
|
||||
<td><code>FE500200CD43284C99C4856A4EFEB930</code> <code>63801DC6E1165F4A640A3E3D2ADC77EA</code> <code>1C2F9F9427D6E26EE85C1915C6581A61</code> <code>D35110DA34C55B2190D8A0A900D64BF0</code> <code>717DA5718DEA9699D18925F61B0F5C12</code> <code>35075DBBC5C8DC6861F2876046290443</code> <code>42F102824E91218CFD9C18030607C918</code> <code>8A232CB580E0D73610E5D4E212EB6A32</code> <code>5358536CE45FD4A32D15FD219C0E1E1E</code> <code>FF00D58E2CAE99B5AFC0D1F558A3662B</code> <code>0129BFFDF994BD9016797940C417B032</code> <code>A3D0FA5F1E02646FCACF6CA335B08B26</code> <code>9CD7686605A977EA06A9EEAC1B2209BE</code> <code>FD3EB35BC802C20A2F682E61B0253A74</code> <code>6456CB551629555D15A6D3C313088B56</code> <code>E1C83A6FD3CFF4F462A7185AE12D916B</code> <code>1B210BA4EE0BE59F33E0BBAFE127D3CA</code> <code>15CE57CD8CA4B37B378DD374F2A1794E</code> <code>9F56839B3B4B1FC2865C417203743906</code> <code>22A1EDA4797B4FEBD2A267D1ACAB3794</code> <code>BBD4B1A4F9F0CEE964832DD974D7CC27</code> <code>992D2F2179D0B0379ADBF7E974427424</code> <code>5BE7D87C87F46C15DF958957D3BD9667</code> <code>619574307064DFBE7FAAAAE3ACCC09D6</code> <code>183AD5E939B01CFF9AC9FEDFE376619F</code> <code>1AC5E1286848B5F3F103655093F22881</code> <code>D957146E95D142B2A3811E7E37122A81</code> <code>44CB1E5936EEAD91A9F4A888C2A3849E</code> <code>92DF227F5BDC6589A14BBF47255BF1C3</code> <code>3D4ED8D280F47747788A8C037FD9249D</code> <code>91F75C59A3D99BE1DC7096401CFDAECE</code> <code>28D6D01E31914285EE4426366E4A1061</code> <code>6A07F2BEAE968F46D70862F955FCB2D7</code> <code>4693E52F06B1CC3D669342CC0535D713</code> <code>52A9F27BF907821E83CAEC9A6411A7E1</code> <code>1C75ABC7F77AAE8D2DDE1C0AF552DC4F</code> <code>853503688559B41C7F6346B72E9C8E61</code><br> <code>A56E5FA8</code></td>
|
||||
<td><code>FE5002007CE465BC915EB0CD93472D2C</code> <code>203563D76425D5ACB9FB41501747DD7F</code> <code>B0CCBB1297AE2812D15D3A67E0AFDDD7</code> <code>D778352DAD8C74823A39A56694A5311A</code> <code>041BC96F5249B9BC6331F0FF900213C9</code> <code>BE6C88D2B16194CACDA2A1A730EEED93</code> <code>7742D47ACB3F6F157475ED093A1D5098</code> <code>F79EEDC51461ABECBA88D119A1E7BAF7</code> <code>C2593EDECE6669388F80D3F5C299C390</code> <code>D3ADE13FE422231B716D3E1C69915B70</code> <code>17CD6E14A85B8658C4344A238E5FC873</code> <code>EE64CE68D6FBAF07C82DE0ECE4D89C9E</code> <code>2668B6FAB1BAD5A263DD6D1714946BC8</code> <code>427A8F82A1D461D79E78BE3A220DBF54</code> <code>843EB8E22780E534C7678718E9BA0019</code> <code>A9D706B5E904A8C65C572567D47FCB94</code> <code>9F93B4FAE7AB5D6E6B91DEE17CBB4020</code> <code>409223C867FD77B3365996491B266A9C</code> <code>FC9DBA865D8E2060370FAF5C66DD7FF9</code> <code>8CBEE4EB76CBC663809B413682BEFC21</code> <code>032205E0822350AA06690E89C0661F3F</code> <code>B588A61861484812A996B8247871DF17</code> <code>24EE98DAD13F3FACD6FB1A285601B092</code> <code>618ABB190F2B8D8A4052685B6F4A3CDE</code> <code>F0010FBE4997526D50B9145F050A0C02</code> <code>5428BA274B85558E10CE856C6189042E</code> <code>A8D1E82264FBF106C25DF59408CE45B9</code> <code>AEF2A9E4FA2384FE4885EBF74E44D17B</code> <code>2E3B58B46BF6AB02E89F5A56F8FB5489</code> <code>C611AA1242497B4D13ADDD3D30C38FFF</code> <code>A1AA62FC0350288D299314A348BB5317</code> <code>ADF6591DA5025FCCA35CFAA0D4BFB40A</code> <code>9B310ABB10E80B974DAC3C3A6287C247</code> <code>1BD97D68D2B7469D0285E81E473B460B</code> <code>C3538E2AE5255142EA8D13A764C740F9</code> <code>3C5A5FA64E9C0AF0A42D7C27DFFC86A2</code> <code>9257B86EE4D8CC7790E0E803F348496F</code><br> <code>A1AABBB0</code></td>
|
||||
<td>See below</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -502,20 +502,20 @@ random_padding_bytes = C68C9B857D0A036C3DC519E08DF98D07995A10FCA0663CA30F360CE48
|
|||
<!-- 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 = CD43284C99C4856A4EFEB93063801DC6E1165F4A640A3E3D2ADC77EA1C2F9F9427D6E26EE85C1915C6581A61D35110DA34C55B2190D8A0A900D64BF0717DA5718DEA9699D18925F61B0F5C1235075DBBC5C8DC6861F287604629044342F102824E91218CFD9C18030607C9188A232CB580E0D73610E5D4E212EB6A325358536CE45FD4A32D15FD219C0E1E1EFF00D58E2CAE99B5AFC0D1F558A3662B0129BFFDF994BD9016797940C417B032A3D0FA5F1E02646FCACF6CA335B08B269CD7686605A977EA06A9EEAC1B2209BEFD3EB35BC802C20A2F682E61B0253A746456CB551629555D15A6D3C313088B56E1C83A6FD3CFF4F462A7185AE12D916B1B210BA4EE0BE59F33E0BBAFE127D3CA15CE57CD8CA4B37B378DD374F2A1794E9F56839B3B4B1FC2865C41720374390622A1EDA4797B4FEBD2A267D1ACAB3794BBD4B1A4F9F0CEE964832DD974D7CC27992D2F2179D0B0379ADBF7E9744274245BE7D87C87F46C15DF958957D3BD9667619574307064DFBE7FAAAAE3ACCC09D6183AD5E939B01CFF9AC9FEDFE376619F1AC5E1286848B5F3F103655093F22881D957146E95D142B2A3811E7E37122A8144CB1E5936EEAD91A9F4A888C2A3849E92DF227F5BDC6589A14BBF47255BF1C33D4ED8D280F47747788A8C037FD9249D91F75C59A3D99BE1DC7096401CFDAECE28D6D01E31914285EE4426366E4A10616A07F2BEAE968F46D70862F955FCB2D74693E52F06B1CC3D669342CC0535D71352A9F27BF907821E83CAEC9A6411A7E11C75ABC7F77AAE8D2DDE1C0AF552DC4F853503688559B41C7F6346B72E9C8E61A56E5FA8
|
||||
tmp_aes_key = E72ED0F8639D01697E28103761678428DD27A841FE88E8661CE40117CA929698
|
||||
tmp_aes_iv = 5121E58CBC411F1BC521208D884CF6A566D0EE9A98CD65C09A9ABFEC4A86DA13</code></pre>
|
||||
<pre><code>encrypted_answer = 7CE465BC915EB0CD93472D2C203563D76425D5ACB9FB41501747DD7FB0CCBB1297AE2812D15D3A67E0AFDDD7D778352DAD8C74823A39A56694A5311A041BC96F5249B9BC6331F0FF900213C9BE6C88D2B16194CACDA2A1A730EEED937742D47ACB3F6F157475ED093A1D5098F79EEDC51461ABECBA88D119A1E7BAF7C2593EDECE6669388F80D3F5C299C390D3ADE13FE422231B716D3E1C69915B7017CD6E14A85B8658C4344A238E5FC873EE64CE68D6FBAF07C82DE0ECE4D89C9E2668B6FAB1BAD5A263DD6D1714946BC8427A8F82A1D461D79E78BE3A220DBF54843EB8E22780E534C7678718E9BA0019A9D706B5E904A8C65C572567D47FCB949F93B4FAE7AB5D6E6B91DEE17CBB4020409223C867FD77B3365996491B266A9CFC9DBA865D8E2060370FAF5C66DD7FF98CBEE4EB76CBC663809B413682BEFC21032205E0822350AA06690E89C0661F3FB588A61861484812A996B8247871DF1724EE98DAD13F3FACD6FB1A285601B092618ABB190F2B8D8A4052685B6F4A3CDEF0010FBE4997526D50B9145F050A0C025428BA274B85558E10CE856C6189042EA8D1E82264FBF106C25DF59408CE45B9AEF2A9E4FA2384FE4885EBF74E44D17B2E3B58B46BF6AB02E89F5A56F8FB5489C611AA1242497B4D13ADDD3D30C38FFFA1AA62FC0350288D299314A348BB5317ADF6591DA5025FCCA35CFAA0D4BFB40A9B310ABB10E80B974DAC3C3A6287C2471BD97D68D2B7469D0285E81E473B460BC3538E2AE5255142EA8D13A764C740F93C5A5FA64E9C0AF0A42D7C27DFFC86A29257B86EE4D8CC7790E0E803F348496FA1AABBB0
|
||||
tmp_aes_key = 2328CFB62740758C72875FFA9F28954B0F484F3F8F08BA1D9777B83D72EAE49F
|
||||
tmp_aes_iv = B245F332C793EA0B889E6B792A56842E15EF79E8ACCA8AA4589FC64DB43580BF</code></pre>
|
||||
<!-- end server_DH_inner_data_input -->
|
||||
<p>Yielding:</p>
|
||||
<!-- start server_DH_inner_data_output -->
|
||||
<pre><code>answer_with_hash = 39C14CB490051C2633CEA09D075C9D4CA64F6CE4BA0D89B58C0857AA2E272A560413E805645DEF49B59D2538AE487978F7F4B224D38208D203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001003CFA36C9475A852E62BF4EA6E1F0F6F950DAED6020304F8FB2297BFB6190FE150419E21F159DAD1981125C0346F2CF8DE6517FAA67E121AEDFEB6F2E3D684BA2EDECE72F9BA5779A4E2E0C419AF3D777C317C70C0A88E6490C41A48943C69BBC68F5BE5F788B00860C023F9C27440BA6D58C8590F60776BBC8FBEAD351A1D695BBE4A3C38E1002A5B61C304B87B40BB1E8FC9B5AA5181CA598D39C3CA0B534FAB93AB744197B1DD5F918F50DC09BC94630EB000CCDFF1F6F0636B9F3598B5F35BE8E06D2FFC80112B98973FC178AC6AB5B186FD3B9406E1ACAE8C86CA99574EF9B8A3DCD857B9C856072800DE97CCF81707FFE564396A8CD9B17B97359DE2100D9BA70651FFC5DAD646562E2
|
||||
answer = BA0D89B58C0857AA2E272A560413E805645DEF49B59D2538AE487978F7F4B224D38208D203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001003CFA36C9475A852E62BF4EA6E1F0F6F950DAED6020304F8FB2297BFB6190FE150419E21F159DAD1981125C0346F2CF8DE6517FAA67E121AEDFEB6F2E3D684BA2EDECE72F9BA5779A4E2E0C419AF3D777C317C70C0A88E6490C41A48943C69BBC68F5BE5F788B00860C023F9C27440BA6D58C8590F60776BBC8FBEAD351A1D695BBE4A3C38E1002A5B61C304B87B40BB1E8FC9B5AA5181CA598D39C3CA0B534FAB93AB744197B1DD5F918F50DC09BC94630EB000CCDFF1F6F0636B9F3598B5F35BE8E06D2FFC80112B98973FC178AC6AB5B186FD3B9406E1ACAE8C86CA99574EF9B8A3DCD857B9C856072800DE97CCF81707FFE564396A8CD9B17B97359DE2100D9BA70651FFC5DAD646562E2</code></pre>
|
||||
<pre><code>answer_with_hash = 046C206B00FE2C32D4702997F69F6D333230EBD4BA0D89B50A95A30DD1754ABF283BCE96F3B3EB4214B77CB91EFBE6D3F5CF063E938C11B703000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100568755DD212BB5081F78AB938D3E0A63F12D552D0F83FD9794E027AC2590D514CD86BEF1B089E2F78311BB7DA0573C13DF3CE3FE0794F5D6F414D53C8F45F4549251DF16123793B80F11322C5DCE6007E4C62FA7713776BEEEC5DC9E48307495146854F60B3BB7052ABC300C46E57B212E59D6F6C2D2FF704D98888D71CAF958813BED9D916E439AD02A9FA70678454E0C92885E3193FCA553181EE515721688AFAFF9E7527B467B45A0A45A6F3BB0A8616646B6D5B7C71406C3D7AE232E7A5F78B0CDF39A9EC8E3651733A351C6EECA792C58A02C6AC2077714CDB322A50CAD2F28FF307F658DABF2EDA874E65D5A7361F6D779D52F87B08DA77D0D82DAFAE647E5706584CA5D5CFB33E47E
|
||||
answer = BA0D89B50A95A30DD1754ABF283BCE96F3B3EB4214B77CB91EFBE6D3F5CF063E938C11B703000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100568755DD212BB5081F78AB938D3E0A63F12D552D0F83FD9794E027AC2590D514CD86BEF1B089E2F78311BB7DA0573C13DF3CE3FE0794F5D6F414D53C8F45F4549251DF16123793B80F11322C5DCE6007E4C62FA7713776BEEEC5DC9E48307495146854F60B3BB7052ABC300C46E57B212E59D6F6C2D2FF704D98888D71CAF958813BED9D916E439AD02A9FA70678454E0C92885E3193FCA553181EE515721688AFAFF9E7527B467B45A0A45A6F3BB0A8616646B6D5B7C71406C3D7AE232E7A5F78B0CDF39A9EC8E3651733A351C6EECA792C58A02C6AC2077714CDB322A50CAD2F28FF307F658DABF2EDA874E65D5A7361F6D779D52F87B08DA77D0D82DAFAE647E5706584CA5D5CFB33E47E</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 8C 08 57 AA 2E 27 2A 56 04 13 E8 05
|
||||
0010 | 64 5D EF 49 B5 9D 25 38 AE 48 79 78 F7 F4 B2 24
|
||||
0020 | D3 82 08 D2 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
||||
<pre><code>0000 | BA 0D 89 B5 0A 95 A3 0D D1 75 4A BF 28 3B CE 96
|
||||
0010 | F3 B3 EB 42 14 B7 7C B9 1E FB E6 D3 F5 CF 06 3E
|
||||
0020 | 93 8C 11 B7 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 = BA0D89B58C0857AA2E272A560413E805645DEF49B59D2538AE487978F7F4B224D38208D
|
|||
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 | 3C FA 36 C9 47 5A 85 2E 62 BF 4E A6 E1 F0 F6 F9
|
||||
0140 | 50 DA ED 60 20 30 4F 8F B2 29 7B FB 61 90 FE 15
|
||||
0150 | 04 19 E2 1F 15 9D AD 19 81 12 5C 03 46 F2 CF 8D
|
||||
0160 | E6 51 7F AA 67 E1 21 AE DF EB 6F 2E 3D 68 4B A2
|
||||
0170 | ED EC E7 2F 9B A5 77 9A 4E 2E 0C 41 9A F3 D7 77
|
||||
0180 | C3 17 C7 0C 0A 88 E6 49 0C 41 A4 89 43 C6 9B BC
|
||||
0190 | 68 F5 BE 5F 78 8B 00 86 0C 02 3F 9C 27 44 0B A6
|
||||
01A0 | D5 8C 85 90 F6 07 76 BB C8 FB EA D3 51 A1 D6 95
|
||||
01B0 | BB E4 A3 C3 8E 10 02 A5 B6 1C 30 4B 87 B4 0B B1
|
||||
01C0 | E8 FC 9B 5A A5 18 1C A5 98 D3 9C 3C A0 B5 34 FA
|
||||
01D0 | B9 3A B7 44 19 7B 1D D5 F9 18 F5 0D C0 9B C9 46
|
||||
01E0 | 30 EB 00 0C CD FF 1F 6F 06 36 B9 F3 59 8B 5F 35
|
||||
01F0 | BE 8E 06 D2 FF C8 01 12 B9 89 73 FC 17 8A C6 AB
|
||||
0200 | 5B 18 6F D3 B9 40 6E 1A CA E8 C8 6C A9 95 74 EF
|
||||
0210 | 9B 8A 3D CD 85 7B 9C 85 60 72 80 0D E9 7C CF 81
|
||||
0220 | 70 7F FE 56 43 96 A8 CD 9B 17 B9 73 59 DE 21 00
|
||||
0230 | D9 BA 70 65</code></pre>
|
||||
0130 | 56 87 55 DD 21 2B B5 08 1F 78 AB 93 8D 3E 0A 63
|
||||
0140 | F1 2D 55 2D 0F 83 FD 97 94 E0 27 AC 25 90 D5 14
|
||||
0150 | CD 86 BE F1 B0 89 E2 F7 83 11 BB 7D A0 57 3C 13
|
||||
0160 | DF 3C E3 FE 07 94 F5 D6 F4 14 D5 3C 8F 45 F4 54
|
||||
0170 | 92 51 DF 16 12 37 93 B8 0F 11 32 2C 5D CE 60 07
|
||||
0180 | E4 C6 2F A7 71 37 76 BE EE C5 DC 9E 48 30 74 95
|
||||
0190 | 14 68 54 F6 0B 3B B7 05 2A BC 30 0C 46 E5 7B 21
|
||||
01A0 | 2E 59 D6 F6 C2 D2 FF 70 4D 98 88 8D 71 CA F9 58
|
||||
01B0 | 81 3B ED 9D 91 6E 43 9A D0 2A 9F A7 06 78 45 4E
|
||||
01C0 | 0C 92 88 5E 31 93 FC A5 53 18 1E E5 15 72 16 88
|
||||
01D0 | AF AF F9 E7 52 7B 46 7B 45 A0 A4 5A 6F 3B B0 A8
|
||||
01E0 | 61 66 46 B6 D5 B7 C7 14 06 C3 D7 AE 23 2E 7A 5F
|
||||
01F0 | 78 B0 CD F3 9A 9E C8 E3 65 17 33 A3 51 C6 EE CA
|
||||
0200 | 79 2C 58 A0 2C 6A C2 07 77 14 CD B3 22 A5 0C AD
|
||||
0210 | 2F 28 FF 30 7F 65 8D AB F2 ED A8 74 E6 5D 5A 73
|
||||
0220 | 61 F6 D7 79 D5 2F 87 B0 8D A7 7D 0D 82 DA FA E6
|
||||
0230 | 47 E5 70 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 = BA0D89B58C0857AA2E272A560413E805645DEF49B59D2538AE487978F7F4B224D38208D
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>8C0857AA2E272A560413E805645DEF49</code></td>
|
||||
<td><code>0A95A30DD1754ABF283BCE96F3B3EB42</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>B59D2538AE487978F7F4B224D38208D2</code></td>
|
||||
<td><code>14B77CB91EFBE6D3F5CF063E938C11B7</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -594,13 +594,13 @@ answer = BA0D89B58C0857AA2E272A560413E805645DEF49B59D2538AE487978F7F4B224D38208D
|
|||
<tr>
|
||||
<td>g_a</td>
|
||||
<td>300, 260</td>
|
||||
<td><code>FE0001003CFA36C9475A852E62BF4EA6</code> <code>E1F0F6F950DAED6020304F8FB2297BFB</code> <code>6190FE150419E21F159DAD1981125C03</code> <code>46F2CF8DE6517FAA67E121AEDFEB6F2E</code> <code>3D684BA2EDECE72F9BA5779A4E2E0C41</code> <code>9AF3D777C317C70C0A88E6490C41A489</code> <code>43C69BBC68F5BE5F788B00860C023F9C</code> <code>27440BA6D58C8590F60776BBC8FBEAD3</code> <code>51A1D695BBE4A3C38E1002A5B61C304B</code> <code>87B40BB1E8FC9B5AA5181CA598D39C3C</code> <code>A0B534FAB93AB744197B1DD5F918F50D</code> <code>C09BC94630EB000CCDFF1F6F0636B9F3</code> <code>598B5F35BE8E06D2FFC80112B98973FC</code> <code>178AC6AB5B186FD3B9406E1ACAE8C86C</code> <code>A99574EF9B8A3DCD857B9C856072800D</code> <code>E97CCF81707FFE564396A8CD9B17B973</code><br> <code>59DE2100</code></td>
|
||||
<td><code>FE000100568755DD212BB5081F78AB93</code> <code>8D3E0A63F12D552D0F83FD9794E027AC</code> <code>2590D514CD86BEF1B089E2F78311BB7D</code> <code>A0573C13DF3CE3FE0794F5D6F414D53C</code> <code>8F45F4549251DF16123793B80F11322C</code> <code>5DCE6007E4C62FA7713776BEEEC5DC9E</code> <code>48307495146854F60B3BB7052ABC300C</code> <code>46E57B212E59D6F6C2D2FF704D98888D</code> <code>71CAF958813BED9D916E439AD02A9FA7</code> <code>0678454E0C92885E3193FCA553181EE5</code> <code>15721688AFAFF9E7527B467B45A0A45A</code> <code>6F3BB0A8616646B6D5B7C71406C3D7AE</code> <code>232E7A5F78B0CDF39A9EC8E3651733A3</code> <code>51C6EECA792C58A02C6AC2077714CDB3</code> <code>22A50CAD2F28FF307F658DABF2EDA874</code> <code>E65D5A7361F6D779D52F87B08DA77D0D</code><br> <code>82DAFAE6</code></td>
|
||||
<td><code>g_a</code> diffie-hellman parameter</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_time</td>
|
||||
<td>560, 4</td>
|
||||
<td><code>D9BA7065</code> (1701886681 in decimal)</td>
|
||||
<td><code>47E57065</code> (1701897543 in decimal)</td>
|
||||
<td>Server time</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -609,34 +609,34 @@ answer = BA0D89B58C0857AA2E272A560413E805645DEF49B59D2538AE487978F7F4B224D38208D
|
|||
<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 = FF46A644DE3E1D0D15B1DF588E6E6CC4D8184D09043800C9EDA91F7D31EDA2D395040FFED3C210B11491B67D184D0F116AE510348D0CC0C666348DCA2943BF020D490E88CF7D6C50C6DBCEA7E61039FDE2D5A42890B96F3CB8CC9B803093999954FDEE3A5338A1AE55BF6C27E71C3799C6DF5CBC0369C181C794D13516E6A5B9CAE21189112A1D15C3722C168BA482DE131346C05DC38F61208044FAC7B6200696D125ABF4500AAE31D91A9EE4D9C9FEEDA6CCA9C946C16558962FFA47AD97258DDD4AFB4224C7347E542C7F72533DF161163C9112BC707AA7056165B4E029C534CD17EED194C1A6108A3A8B6DD0C2742D4FC5010795A79E2EA9239F82461C40</code></pre>
|
||||
<pre><code>b = 9033A9A81291FB69C8DE4F177AFF575EE3A18859009E9A9A5FA3DE161B05494A3578967746425F8A4499CF2088104E2E1DABDED50EB4E84F1CAB7D6F2412AC86F9CE0EC1F41DA233CFA6104F4D1B0992FF9BDDC12E1164CC59DAA74850792A1EFD145DC7975FC9D7DD2CF58613EEB482553A896C6E2B44A9A0D74C356BD5441C3E655FDCE84C5EADF7CC7CE418B67AABFE7513960742D1D43EE4CB57EDDE8D0A04DA31D4D715582194A055EC1F7869291C2C8AE5F335918B611EEB905C03084C47B355A7C0228533DABBC6C98FEB97B28A9200A3649F0BFB049632BC8278F0EEAAF39DA2DACA23C23B963F9ED61076A20B0E94B545E058CECF374053ED0CC1B4</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 = 259EBAEE7B5CD665A541B4BB0DF361E70084D27C85D10478BBD4191F5087EA2AB82C77E3797F21FFA2881CCA27CA3BEEBB7D98E642AE4B2F14525E886FB3BBA8FDF557FF02096B0AEBC48D19819C7B80E3F608B19CA178667396D1558D0ECB241B35913CF87FED52EAD65FA26D0F41DEF42FD4CBB5C044044C38274C4461579B168BAA5836EF39DE5087413125ABE21D1B2D3FD849F5B3C1429633315578F21188268DDD8C7CF825ED1AB28D5D3CF7CC673D2392EDE26CE3A1A22A1C309C533AFC35139FF3FAD9048BF24BB41308DC862731E4A602C0F75914EE118217F5EE12E20BF93D6BF31B37B937526C955830C017138FC004CA5DF48D0F288E8CDF4C80</code></pre>
|
||||
<pre><code>g_b = B58BB862D3E785E98B302A637B5C17DD2F96979B87B93A6A28EC84162007ED36643D42EBF3ECD230CEF3AC57C1E56DB0102392F189B29A9D1EFF5EEE439C6251256A6B174D9182C03490DA9E0EC92AA6524909083CAA8BDBE7F3B34D13E5F6E9C1A4839D68D0A3B480FBB0279AF1A6B1E6BE422BC356A4D01DFBBE25A868295CADF41E1DACFCCC15FACC872AA0A14B2430509A6D33ADD1150BC839AD21854CF348F29D33BF6D86ED5BDB01ED51144150CE17983668E451DC2A0CA1040932095751D609B10F3F634626B5EA0FA6FE1F6E02372B4697A87910A4834A460ECB7F661D25CC139C5913A8E54618C7FC410D41525E5DCAA534D920C74CBD8D8D8663D5</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 8C 08 57 AA 2E 27 2A 56 04 13 E8 05
|
||||
0010 | 64 5D EF 49 B5 9D 25 38 AE 48 79 78 F7 F4 B2 24
|
||||
0020 | D3 82 08 D2 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | 25 9E BA EE 7B 5C D6 65 A5 41 B4 BB 0D F3 61 E7
|
||||
0040 | 00 84 D2 7C 85 D1 04 78 BB D4 19 1F 50 87 EA 2A
|
||||
0050 | B8 2C 77 E3 79 7F 21 FF A2 88 1C CA 27 CA 3B EE
|
||||
0060 | BB 7D 98 E6 42 AE 4B 2F 14 52 5E 88 6F B3 BB A8
|
||||
0070 | FD F5 57 FF 02 09 6B 0A EB C4 8D 19 81 9C 7B 80
|
||||
0080 | E3 F6 08 B1 9C A1 78 66 73 96 D1 55 8D 0E CB 24
|
||||
0090 | 1B 35 91 3C F8 7F ED 52 EA D6 5F A2 6D 0F 41 DE
|
||||
00A0 | F4 2F D4 CB B5 C0 44 04 4C 38 27 4C 44 61 57 9B
|
||||
00B0 | 16 8B AA 58 36 EF 39 DE 50 87 41 31 25 AB E2 1D
|
||||
00C0 | 1B 2D 3F D8 49 F5 B3 C1 42 96 33 31 55 78 F2 11
|
||||
00D0 | 88 26 8D DD 8C 7C F8 25 ED 1A B2 8D 5D 3C F7 CC
|
||||
00E0 | 67 3D 23 92 ED E2 6C E3 A1 A2 2A 1C 30 9C 53 3A
|
||||
00F0 | FC 35 13 9F F3 FA D9 04 8B F2 4B B4 13 08 DC 86
|
||||
0100 | 27 31 E4 A6 02 C0 F7 59 14 EE 11 82 17 F5 EE 12
|
||||
0110 | E2 0B F9 3D 6B F3 1B 37 B9 37 52 6C 95 58 30 C0
|
||||
0120 | 17 13 8F C0 04 CA 5D F4 8D 0F 28 8E 8C DF 4C 80</code></pre>
|
||||
<pre><code>0000 | 54 B6 43 66 0A 95 A3 0D D1 75 4A BF 28 3B CE 96
|
||||
0010 | F3 B3 EB 42 14 B7 7C B9 1E FB E6 D3 F5 CF 06 3E
|
||||
0020 | 93 8C 11 B7 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | B5 8B B8 62 D3 E7 85 E9 8B 30 2A 63 7B 5C 17 DD
|
||||
0040 | 2F 96 97 9B 87 B9 3A 6A 28 EC 84 16 20 07 ED 36
|
||||
0050 | 64 3D 42 EB F3 EC D2 30 CE F3 AC 57 C1 E5 6D B0
|
||||
0060 | 10 23 92 F1 89 B2 9A 9D 1E FF 5E EE 43 9C 62 51
|
||||
0070 | 25 6A 6B 17 4D 91 82 C0 34 90 DA 9E 0E C9 2A A6
|
||||
0080 | 52 49 09 08 3C AA 8B DB E7 F3 B3 4D 13 E5 F6 E9
|
||||
0090 | C1 A4 83 9D 68 D0 A3 B4 80 FB B0 27 9A F1 A6 B1
|
||||
00A0 | E6 BE 42 2B C3 56 A4 D0 1D FB BE 25 A8 68 29 5C
|
||||
00B0 | AD F4 1E 1D AC FC CC 15 FA CC 87 2A A0 A1 4B 24
|
||||
00C0 | 30 50 9A 6D 33 AD D1 15 0B C8 39 AD 21 85 4C F3
|
||||
00D0 | 48 F2 9D 33 BF 6D 86 ED 5B DB 01 ED 51 14 41 50
|
||||
00E0 | CE 17 98 36 68 E4 51 DC 2A 0C A1 04 09 32 09 57
|
||||
00F0 | 51 D6 09 B1 0F 3F 63 46 26 B5 EA 0F A6 FE 1F 6E
|
||||
0100 | 02 37 2B 46 97 A8 79 10 A4 83 4A 46 0E CB 7F 66
|
||||
0110 | 1D 25 CC 13 9C 59 13 A8 E5 46 18 C7 FC 41 0D 41
|
||||
0120 | 52 5E 5D CA A5 34 D9 20 C7 4C BD 8D 8D 86 63 D5</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 = BA0D89B58C0857AA2E272A560413E805645DEF49B59D2538AE487978F7F4B224D38208D
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>8C0857AA2E272A560413E805645DEF49</code></td>
|
||||
<td><code>0A95A30DD1754ABF283BCE96F3B3EB42</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>B59D2538AE487978F7F4B224D38208D2</code></td>
|
||||
<td><code>14B77CB91EFBE6D3F5CF063E938C11B7</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>g_b</td>
|
||||
<td>36, 260</td>
|
||||
<td><code>FE000100259EBAEE7B5CD665A541B4BB</code> <code>0DF361E70084D27C85D10478BBD4191F</code> <code>5087EA2AB82C77E3797F21FFA2881CCA</code> <code>27CA3BEEBB7D98E642AE4B2F14525E88</code> <code>6FB3BBA8FDF557FF02096B0AEBC48D19</code> <code>819C7B80E3F608B19CA178667396D155</code> <code>8D0ECB241B35913CF87FED52EAD65FA2</code> <code>6D0F41DEF42FD4CBB5C044044C38274C</code> <code>4461579B168BAA5836EF39DE50874131</code> <code>25ABE21D1B2D3FD849F5B3C142963331</code> <code>5578F21188268DDD8C7CF825ED1AB28D</code> <code>5D3CF7CC673D2392EDE26CE3A1A22A1C</code> <code>309C533AFC35139FF3FAD9048BF24BB4</code> <code>1308DC862731E4A602C0F75914EE1182</code> <code>17F5EE12E20BF93D6BF31B37B937526C</code> <code>955830C017138FC004CA5DF48D0F288E</code><br> <code>8CDF4C80</code></td>
|
||||
<td><code>FE000100B58BB862D3E785E98B302A63</code> <code>7B5C17DD2F96979B87B93A6A28EC8416</code> <code>2007ED36643D42EBF3ECD230CEF3AC57</code> <code>C1E56DB0102392F189B29A9D1EFF5EEE</code> <code>439C6251256A6B174D9182C03490DA9E</code> <code>0EC92AA6524909083CAA8BDBE7F3B34D</code> <code>13E5F6E9C1A4839D68D0A3B480FBB027</code> <code>9AF1A6B1E6BE422BC356A4D01DFBBE25</code> <code>A868295CADF41E1DACFCCC15FACC872A</code> <code>A0A14B2430509A6D33ADD1150BC839AD</code> <code>21854CF348F29D33BF6D86ED5BDB01ED</code> <code>51144150CE17983668E451DC2A0CA104</code> <code>0932095751D609B10F3F634626B5EA0F</code> <code>A6FE1F6E02372B4697A87910A4834A46</code> <code>0ECB7F661D25CC139C5913A8E54618C7</code> <code>FC410D41525E5DCAA534D920C74CBD8D</code><br> <code>8D8663D5</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 = BA0D89B58C0857AA2E272A560413E805645DEF49B59D2538AE487978F7F4B224D38208D
|
|||
<!-- 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 = 54B643668C0857AA2E272A560413E805645DEF49B59D2538AE487978F7F4B224D38208D20000000000000000FE000100259EBAEE7B5CD665A541B4BB0DF361E70084D27C85D10478BBD4191F5087EA2AB82C77E3797F21FFA2881CCA27CA3BEEBB7D98E642AE4B2F14525E886FB3BBA8FDF557FF02096B0AEBC48D19819C7B80E3F608B19CA178667396D1558D0ECB241B35913CF87FED52EAD65FA26D0F41DEF42FD4CBB5C044044C38274C4461579B168BAA5836EF39DE5087413125ABE21D1B2D3FD849F5B3C1429633315578F21188268DDD8C7CF825ED1AB28D5D3CF7CC673D2392EDE26CE3A1A22A1C309C533AFC35139FF3FAD9048BF24BB41308DC862731E4A602C0F75914EE118217F5EE12E20BF93D6BF31B37B937526C955830C017138FC004CA5DF48D0F288E8CDF4C80
|
||||
padding = C8E365AD21C981C0509DCDDE
|
||||
tmp_aes_key = E72ED0F8639D01697E28103761678428DD27A841FE88E8661CE40117CA929698
|
||||
tmp_aes_iv = 5121E58CBC411F1BC521208D884CF6A566D0EE9A98CD65C09A9ABFEC4A86DA13</code></pre>
|
||||
<pre><code>data = 54B643660A95A30DD1754ABF283BCE96F3B3EB4214B77CB91EFBE6D3F5CF063E938C11B70000000000000000FE000100B58BB862D3E785E98B302A637B5C17DD2F96979B87B93A6A28EC84162007ED36643D42EBF3ECD230CEF3AC57C1E56DB0102392F189B29A9D1EFF5EEE439C6251256A6B174D9182C03490DA9E0EC92AA6524909083CAA8BDBE7F3B34D13E5F6E9C1A4839D68D0A3B480FBB0279AF1A6B1E6BE422BC356A4D01DFBBE25A868295CADF41E1DACFCCC15FACC872AA0A14B2430509A6D33ADD1150BC839AD21854CF348F29D33BF6D86ED5BDB01ED51144150CE17983668E451DC2A0CA1040932095751D609B10F3F634626B5EA0FA6FE1F6E02372B4697A87910A4834A460ECB7F661D25CC139C5913A8E54618C7FC410D41525E5DCAA534D920C74CBD8D8D8663D5
|
||||
padding = C9204C19F21688A1A9847BE8
|
||||
tmp_aes_key = 2328CFB62740758C72875FFA9F28954B0F484F3F8F08BA1D9777B83D72EAE49F
|
||||
tmp_aes_iv = B245F332C793EA0B889E6B792A56842E15EF79E8ACCA8AA4589FC64DB43580BF</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 = E314D213DB6C3AB5686B84B871A81F4B0A47033B197C1D9FC1EED30045282D6BA1C36542DD9B8568CE734666CC866346FD7048E59239D6EC4E5886D9BEC7D43D01261435D4964C34BF2723222E288F76118FB0D2B114B15C7009AF6BCD6ADFA8C93F287E9E7F6CADB3E84283126EB9DB7ADD024BAF1E002BC4A3165206A1DA3D6172948B9CDE769234C19975528E3FF5192D076B8BBCCAD01B8D5C072C98D6483D255BAE0CD360ED66D169E4B4BE4B0418CBED8E8816CCE74BE787DE3076A7608700AD34CA7AD33B84B75180CA5E4607DF6B22FD910CDD18062FA38107A76105EA010C9DC2A1D0664711FDDB312095F0B86A901838AC91B6C04B70A9840880276D10B403A263E106441C20DF78C1F856CA246FB8EF7621BD2604C2533B1E727375D2E87F8FF0212957A975DFDE6DF836AD459118F4E7CA93BD8C71863284361A0A784BBB05206337B4AC59888838A485</code></pre>
|
||||
<pre><code>encrypted_data = D874C3A771BE5DC70A8D423F8A392667BBAA03B18144023E3CDA8C58435DFFAA68EB22C0506A55EA8692CB1F651F03FE633A1897E072952B54683FF338BCDBBBCFB362B40B72CA7B9FA52D7A31960ECADE9437895500024F1DCB1A7C7350B1A320ED6E6B57345A22AE0BC3ED46664C9D6684D0DA4BFFB168C98AA0936C59354B9AC8B93578CB707FAFB64F75A80E0D8DC3B4E0B25A9837EDC4689A35C8EF8FDD78BEAEE01DA389F91DE89CA4827F0C794098065A0881DFF2FE2A914663A67D37FCDFDE1A783E468D86577010923CA99085495685FEC1D88A7F73C34F54DFB1A89931C46A166BFF7CF13DAA7D17E3688029624DA4EEA9113264590FEED35C505A345BD47451237A666CEE49E4A2FA740A1F54E463B63D5E5F2C4899AB3994A5493E36BF21ED968D7AD1B45CC22CA533B947E410BE0419CCCF08639FE72A207A88495BB6EAB0B39AF09B878D1B7EE94E0C</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 34 08 0F 00 D9 BA 70 65
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 8C 08 57 AA 2E 27 2A 56
|
||||
0020 | 04 13 E8 05 64 5D EF 49 B5 9D 25 38 AE 48 79 78
|
||||
0030 | F7 F4 B2 24 D3 82 08 D2 FE 50 01 00 E3 14 D2 13
|
||||
0040 | DB 6C 3A B5 68 6B 84 B8 71 A8 1F 4B 0A 47 03 3B
|
||||
0050 | 19 7C 1D 9F C1 EE D3 00 45 28 2D 6B A1 C3 65 42
|
||||
0060 | DD 9B 85 68 CE 73 46 66 CC 86 63 46 FD 70 48 E5
|
||||
0070 | 92 39 D6 EC 4E 58 86 D9 BE C7 D4 3D 01 26 14 35
|
||||
0080 | D4 96 4C 34 BF 27 23 22 2E 28 8F 76 11 8F B0 D2
|
||||
0090 | B1 14 B1 5C 70 09 AF 6B CD 6A DF A8 C9 3F 28 7E
|
||||
00A0 | 9E 7F 6C AD B3 E8 42 83 12 6E B9 DB 7A DD 02 4B
|
||||
00B0 | AF 1E 00 2B C4 A3 16 52 06 A1 DA 3D 61 72 94 8B
|
||||
00C0 | 9C DE 76 92 34 C1 99 75 52 8E 3F F5 19 2D 07 6B
|
||||
00D0 | 8B BC CA D0 1B 8D 5C 07 2C 98 D6 48 3D 25 5B AE
|
||||
00E0 | 0C D3 60 ED 66 D1 69 E4 B4 BE 4B 04 18 CB ED 8E
|
||||
00F0 | 88 16 CC E7 4B E7 87 DE 30 76 A7 60 87 00 AD 34
|
||||
0100 | CA 7A D3 3B 84 B7 51 80 CA 5E 46 07 DF 6B 22 FD
|
||||
0110 | 91 0C DD 18 06 2F A3 81 07 A7 61 05 EA 01 0C 9D
|
||||
0120 | C2 A1 D0 66 47 11 FD DB 31 20 95 F0 B8 6A 90 18
|
||||
0130 | 38 AC 91 B6 C0 4B 70 A9 84 08 80 27 6D 10 B4 03
|
||||
0140 | A2 63 E1 06 44 1C 20 DF 78 C1 F8 56 CA 24 6F B8
|
||||
0150 | EF 76 21 BD 26 04 C2 53 3B 1E 72 73 75 D2 E8 7F
|
||||
0160 | 8F F0 21 29 57 A9 75 DF DE 6D F8 36 AD 45 91 18
|
||||
0170 | F4 E7 CA 93 BD 8C 71 86 32 84 36 1A 0A 78 4B BB
|
||||
0180 | 05 20 63 37 B4 AC 59 88 88 38 A4 85</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 F0 C4 00 00 47 E5 70 65
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 0A 95 A3 0D D1 75 4A BF
|
||||
0020 | 28 3B CE 96 F3 B3 EB 42 14 B7 7C B9 1E FB E6 D3
|
||||
0030 | F5 CF 06 3E 93 8C 11 B7 FE 50 01 00 D8 74 C3 A7
|
||||
0040 | 71 BE 5D C7 0A 8D 42 3F 8A 39 26 67 BB AA 03 B1
|
||||
0050 | 81 44 02 3E 3C DA 8C 58 43 5D FF AA 68 EB 22 C0
|
||||
0060 | 50 6A 55 EA 86 92 CB 1F 65 1F 03 FE 63 3A 18 97
|
||||
0070 | E0 72 95 2B 54 68 3F F3 38 BC DB BB CF B3 62 B4
|
||||
0080 | 0B 72 CA 7B 9F A5 2D 7A 31 96 0E CA DE 94 37 89
|
||||
0090 | 55 00 02 4F 1D CB 1A 7C 73 50 B1 A3 20 ED 6E 6B
|
||||
00A0 | 57 34 5A 22 AE 0B C3 ED 46 66 4C 9D 66 84 D0 DA
|
||||
00B0 | 4B FF B1 68 C9 8A A0 93 6C 59 35 4B 9A C8 B9 35
|
||||
00C0 | 78 CB 70 7F AF B6 4F 75 A8 0E 0D 8D C3 B4 E0 B2
|
||||
00D0 | 5A 98 37 ED C4 68 9A 35 C8 EF 8F DD 78 BE AE E0
|
||||
00E0 | 1D A3 89 F9 1D E8 9C A4 82 7F 0C 79 40 98 06 5A
|
||||
00F0 | 08 81 DF F2 FE 2A 91 46 63 A6 7D 37 FC DF DE 1A
|
||||
0100 | 78 3E 46 8D 86 57 70 10 92 3C A9 90 85 49 56 85
|
||||
0110 | FE C1 D8 8A 7F 73 C3 4F 54 DF B1 A8 99 31 C4 6A
|
||||
0120 | 16 6B FF 7C F1 3D AA 7D 17 E3 68 80 29 62 4D A4
|
||||
0130 | EE A9 11 32 64 59 0F EE D3 5C 50 5A 34 5B D4 74
|
||||
0140 | 51 23 7A 66 6C EE 49 E4 A2 FA 74 0A 1F 54 E4 63
|
||||
0150 | B6 3D 5E 5F 2C 48 99 AB 39 94 A5 49 3E 36 BF 21
|
||||
0160 | ED 96 8D 7A D1 B4 5C C2 2C A5 33 B9 47 E4 10 BE
|
||||
0170 | 04 19 CC CF 08 63 9F E7 2A 20 7A 88 49 5B B6 EA
|
||||
0180 | B0 B3 9A F0 9B 87 8D 1B 7E E9 4E 0C</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>34080F00D9BA7065</code></td>
|
||||
<td><code>F0C4000047E57065</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>8C0857AA2E272A560413E805645DEF49</code></td>
|
||||
<td><code>0A95A30DD1754ABF283BCE96F3B3EB42</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>B59D2538AE487978F7F4B224D38208D2</code></td>
|
||||
<td><code>14B77CB91EFBE6D3F5CF063E938C11B7</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>56, 340</td>
|
||||
<td><code>FE500100E314D213DB6C3AB5686B84B8</code> <code>71A81F4B0A47033B197C1D9FC1EED300</code> <code>45282D6BA1C36542DD9B8568CE734666</code> <code>CC866346FD7048E59239D6EC4E5886D9</code> <code>BEC7D43D01261435D4964C34BF272322</code> <code>2E288F76118FB0D2B114B15C7009AF6B</code> <code>CD6ADFA8C93F287E9E7F6CADB3E84283</code> <code>126EB9DB7ADD024BAF1E002BC4A31652</code> <code>06A1DA3D6172948B9CDE769234C19975</code> <code>528E3FF5192D076B8BBCCAD01B8D5C07</code> <code>2C98D6483D255BAE0CD360ED66D169E4</code> <code>B4BE4B0418CBED8E8816CCE74BE787DE</code> <code>3076A7608700AD34CA7AD33B84B75180</code> <code>CA5E4607DF6B22FD910CDD18062FA381</code> <code>07A76105EA010C9DC2A1D0664711FDDB</code> <code>312095F0B86A901838AC91B6C04B70A9</code> <code>840880276D10B403A263E106441C20DF</code> <code>78C1F856CA246FB8EF7621BD2604C253</code> <code>3B1E727375D2E87F8FF0212957A975DF</code> <code>DE6DF836AD459118F4E7CA93BD8C7186</code> <code>3284361A0A784BBB05206337B4AC5988</code><br> <code>8838A485</code></td>
|
||||
<td><code>FE500100D874C3A771BE5DC70A8D423F</code> <code>8A392667BBAA03B18144023E3CDA8C58</code> <code>435DFFAA68EB22C0506A55EA8692CB1F</code> <code>651F03FE633A1897E072952B54683FF3</code> <code>38BCDBBBCFB362B40B72CA7B9FA52D7A</code> <code>31960ECADE9437895500024F1DCB1A7C</code> <code>7350B1A320ED6E6B57345A22AE0BC3ED</code> <code>46664C9D6684D0DA4BFFB168C98AA093</code> <code>6C59354B9AC8B93578CB707FAFB64F75</code> <code>A80E0D8DC3B4E0B25A9837EDC4689A35</code> <code>C8EF8FDD78BEAEE01DA389F91DE89CA4</code> <code>827F0C794098065A0881DFF2FE2A9146</code> <code>63A67D37FCDFDE1A783E468D86577010</code> <code>923CA99085495685FEC1D88A7F73C34F</code> <code>54DFB1A89931C46A166BFF7CF13DAA7D</code> <code>17E3688029624DA4EEA9113264590FEE</code> <code>D35C505A345BD47451237A666CEE49E4</code> <code>A2FA740A1F54E463B63D5E5F2C4899AB</code> <code>3994A5493E36BF21ED968D7AD1B45CC2</code> <code>2CA533B947E410BE0419CCCF08639FE7</code> <code>2A207A88495BB6EAB0B39AF09B878D1B</code><br> <code>7EE94E0C</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 = 28CE00BA00B8208DACFC41AE516D18623B91B8328BD604A7A693574D488EFEF342847733B99CDCAB4F2370EE9EDB14032E2EE2D8620A8C42337D8F285E922EDD26FA091737827CAB1CAF2B74D7BA6E0DD917998E7BFE5F0BF288378B78A146ADB177AD59A193E70CF8FED7E27DFD800B80953288B7AD090C1A64E8890F23CE0A8350A8EE4BE5086B3F618F82B50E221BD58F4AABFF36F1BFBC20689DD18B627AD216A474DFAAE639DBD09F822AB19CD681FE28D98276C0E0CA6307EA2BADB5F072F463B23E94921F017DD92BA894431AA37FCDB5EB01726081AEE18F08DF2CEBEE2261F96229AE97F671F6A27E9CA81DEAFB0CA8FF9A7038B98EEBAD83DB6A15</code></pre>
|
||||
<pre><code>auth_key = BEF72B1A5FD2E0C6A22B264A130572011FC90012F8B29BD1ED755B7F1BEA352CC190D6044E2E7553473849BC1B52389FE0548EA7E678F0070ECF54831639954F5AFBA8A7B5CE0C9E7FB3B0551B1C83A543DE5F99B316DCD8C6CE211975DD3DED84899944EE4643E9D11E1F2C123DE0162FC2C47EFBC5736DB15C134E98581C6EE1A7C93CFEC52DAC6548D4F62706E28F4268BE2BCF9BD343D1F5EB882F246390008E4CEFD3B713A0CD683ACDBA5361B92402AD6E3A6EE91C40915E5C33CC1B7295FF00479CDC5821951B896A6D984FFD03746FE1679EDC1F188B71D620810DD22656E1CB0B8ED287AF8805BDCA2D44092309FA4831760121986B314FF620EA0C</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 BC 13 D1 DA BA 70 65
|
||||
0010 | 38 00 00 00 34 F7 CB 3B 8C 08 57 AA 2E 27 2A 56
|
||||
0020 | 04 13 E8 05 64 5D EF 49 B5 9D 25 38 AE 48 79 78
|
||||
0030 | F7 F4 B2 24 D3 82 08 D2 44 B9 74 84 35 A0 EF 63
|
||||
0040 | 5F 86 0E 16 F5 B6 FC F8</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 D8 70 AC 47 E5 70 65
|
||||
0010 | 58 00 00 00 34 F7 CB 3B 0A 95 A3 0D D1 75 4A BF
|
||||
0020 | 28 3B CE 96 F3 B3 EB 42 14 B7 7C B9 1E FB E6 D3
|
||||
0030 | F5 CF 06 3E 93 8C 11 B7 CD 07 4D D7 BF 66 CE 04
|
||||
0040 | 2E 10 24 B3 D8 7E AC 36</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>01BC13D1DABA7065</code></td>
|
||||
<td><code>01D870AC47E57065</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>38000000</code> (56 in decimal)</td>
|
||||
<td><code>58000000</code> (88 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>8C0857AA2E272A560413E805645DEF49</code></td>
|
||||
<td><code>0A95A30DD1754ABF283BCE96F3B3EB42</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>B59D2538AE487978F7F4B224D38208D2</code></td>
|
||||
<td><code>14B77CB91EFBE6D3F5CF063E938C11B7</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce_hash1</td>
|
||||
<td>56, 16</td>
|
||||
<td><code>44B9748435A0EF635F860E16F5B6FCF8</code></td>
|
||||
<td><code>CD074DD7BF66CE042E1024B3D87EAC36</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