|
|
|
@ -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 A0 E6 0A 00 1A C6 96 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE D4 C3 9F 0A 0C E2 40 8D
|
|
|
|
|
0020 | 53 7C 91 DC 35 9D 63 20</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 BC 40 0C 00 79 C9 96 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 24 E5 EC 8F 78 78 D3 00
|
|
|
|
|
0020 | 29 35 AF 06 12 85 0C BC</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>A0E60A001AC69666</code></td>
|
|
|
|
|
<td><code>BC400C0079C99666</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>D4C39F0A0CE2408D537C91DC359D6320</code></td>
|
|
|
|
|
<td><code>24E5EC8F7878D3002935AF0612850CBC</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 9C 3E 33 1A C6 96 66
|
|
|
|
|
0010 | B0 00 00 00 63 24 16 05 D4 C3 9F 0A 0C E2 40 8D
|
|
|
|
|
0020 | 53 7C 91 DC 35 9D 63 20 18 3C C8 76 B0 24 21 5D
|
|
|
|
|
0030 | 4B 9F F4 29 66 91 0A 96 08 2B 91 A1 69 85 24 38
|
|
|
|
|
0040 | F7 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 FC 92 CE 79 C9 96 66
|
|
|
|
|
0010 | B0 00 00 00 63 24 16 05 24 E5 EC 8F 78 78 D3 00
|
|
|
|
|
0020 | 29 35 AF 06 12 85 0C BC 4F 96 A4 2F 94 06 10 78
|
|
|
|
|
0030 | 84 FA A9 F9 69 30 65 C6 08 1A 23 D2 33 31 C7 F1
|
|
|
|
|
0040 | 37 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,7 +132,7 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>019C3E331AC69666</code></td>
|
|
|
|
|
<td><code>01FC92CE79C99666</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>
|
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>D4C39F0A0CE2408D537C91DC359D6320</code></td>
|
|
|
|
|
<td><code>24E5EC8F7878D3002935AF0612850CBC</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>183CC876B024215D4B9FF42966910A96</code></td>
|
|
|
|
|
<td><code>4F96A42F9406107884FAA9F9693065C6</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>082B91A169852438F7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 3139467889831327991</td>
|
|
|
|
|
<td><code>081A23D23331C7F137000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1883580186491351351</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 = 3139467889831327991</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>3139467889831327991 = 1701286669 * 1845349139</code></p>
|
|
|
|
|
<pre><code>p = 1701286669
|
|
|
|
|
q = 1845349139</code></pre>
|
|
|
|
|
<pre><code>pq = 1883580186491351351</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1883580186491351351 = 1128765499 * 1668708149</code></p>
|
|
|
|
|
<pre><code>p = 1128765499
|
|
|
|
|
q = 1668708149</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 2B 91 A1 69 85 24 38 F7 00 00 00
|
|
|
|
|
0010 | 04 65 67 93 0D 00 00 00 04 6D FD CB 13 00 00 00
|
|
|
|
|
0020 | D4 C3 9F 0A 0C E2 40 8D 53 7C 91 DC 35 9D 63 20
|
|
|
|
|
0030 | 18 3C C8 76 B0 24 21 5D 4B 9F F4 29 66 91 0A 96
|
|
|
|
|
0040 | EA EC 6E 0F 35 9A 7D 85 A8 C2 E4 9E 62 26 45 46
|
|
|
|
|
0050 | 3F C5 65 5B A2 A5 C8 A6 1D 7E FA 7C 7D 92 3A 1B
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 1A 23 D2 33 31 C7 F1 37 00 00 00
|
|
|
|
|
0010 | 04 43 47 98 3B 00 00 00 04 63 76 77 35 00 00 00
|
|
|
|
|
0020 | 24 E5 EC 8F 78 78 D3 00 29 35 AF 06 12 85 0C BC
|
|
|
|
|
0030 | 4F 96 A4 2F 94 06 10 78 84 FA A9 F9 69 30 65 C6
|
|
|
|
|
0040 | 93 94 96 C1 D9 D5 74 29 39 BC A4 3C 8C B2 F9 FB
|
|
|
|
|
0050 | 6F 33 13 7D 3F DC 05 3E 8F 3D B9 60 23 5C 0B 48
|
|
|
|
|
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 = 1845349139</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>082B91A169852438F7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 3139467889831327991</td>
|
|
|
|
|
<td><code>081A23D23331C7F137000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1883580186491351351</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>046567930D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1701286669</td>
|
|
|
|
|
<td><code>044347983B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1128765499</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>046DFDCB13000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1845349139</td>
|
|
|
|
|
<td><code>0463767735000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1668708149</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>D4C39F0A0CE2408D537C91DC359D6320</code></td>
|
|
|
|
|
<td><code>24E5EC8F7878D3002935AF0612850CBC</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>183CC876B024215D4B9FF42966910A96</code></td>
|
|
|
|
|
<td><code>4F96A42F9406107884FAA9F9693065C6</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>EAEC6E0F359A7D85A8C2E49E62264546</code> <code>3FC5655BA2A5C8A61D7EFA7C7D923A1B</code></td>
|
|
|
|
|
<td><code>939496C1D9D5742939BCA43C8CB2F9FB</code> <code>6F33137D3FDC053E8F3DB960235C0B48</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1845349139</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 = 955FF5A9082B91A169852438F7000000046567930D000000046DFDCB13000000D4C39F0A0CE2408D537C91DC359D6320183CC876B024215D4B9FF42966910A96EAEC6E0F359A7D85A8C2E49E622645463FC5655BA2A5C8A61D7EFA7C7D923A1B02000000
|
|
|
|
|
random_padding_bytes = 28524709F59B991A34F3DB5C8CAB65EEA45C50C8306CFDC4CDD3636AEE797DE073ED07FBC36726BBBB70C31E413E8344357DD0933194F75FA7A4D19DE35E28A1526097F18C2D85BFC55C15AA810C898A623CC17CD1C7487A1DC5EB25</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A9081A23D23331C7F137000000044347983B000000046376773500000024E5EC8F7878D3002935AF0612850CBC4F96A42F9406107884FAA9F9693065C6939496C1D9D5742939BCA43C8CB2F9FB6F33137D3FDC053E8F3DB960235C0B4802000000
|
|
|
|
|
random_padding_bytes = 33CC1AC933811C9F2595F588D7116DAB038CAE4FC5F54EA41AD37BD4AEC1D3BE930F1248D18533299D9D1E5C2D6024E657C3BA150891EB1BE352890C8556F61FDB056B9A03CDBAB10859A4C8074277B7AC5BF85662125486FE07772E</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 = 4B38FF50DA4D395306A59D8A3B60FCCE3DBF6A26CDD26C3E2CE17468D2C2A3F663C3C68D8B5DA5386E2D65F9CC68763B95EC91186CA7EB55FD9D76A3C5896A411C2AF646377D4909D2F651EEBE970ADD15F72BA4BD471AD64D65A12A589332676741103F0BA68529C38CAEA17D710529B486EEEECEEE6AD06D2C9BF477553B987A06D17B73BAB5254E9EE037FBFEB622D9E323466DED1811DFE02088ACAF91EAB8A5DF7B485C4E135BD596E267402DA32A0F2EDF7A1D146922068F1ED68810ED5F4983354A204A1E38C4F70EAD52B28C05BA11DF6E925D66E15CAEF18E38E9C9739C135BE8B4300601ABAE2E8BC9115B9F1F03FD173524C8CE0DC4A9ECEB6144</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 9A9805F60AC0B64DB4A482F66A7B7A4FD719BD95604CD075B34259F9E592352F8EBD2BB6E500273E92951E3D0E8DAB326E30CCCDB7B2359F54881818082105C6BF236C1D86F0E92742CBD9B94E2D38BDAD4937869F2C6F37513DE8A9198085972363CC162FA2A63811F40DB3AE05D88BF059FB0DDA2F6E1E2ECD86C5C9E7FC1046A3CD665A701A14BB1276B6E5E0666BD8CBB9DC26E90D87479CF6A5B2F244368DDF8A61F149FD76C76CDE3B24823F4423AB4A755EE4DCDE8DD84670E46F8E0756E48CA91189C3D480A716FC5ABDE0FE5EAD6280CF56C7F5237A8F2ADB95F7E67A5B4B10E17777E557961FE857E780EDA6B742594CD667E99DF298C36B67E7CD</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 80 CD 0D 00 1A C6 96 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 D4 C3 9F 0A 0C E2 40 8D
|
|
|
|
|
0020 | 53 7C 91 DC 35 9D 63 20 18 3C C8 76 B0 24 21 5D
|
|
|
|
|
0030 | 4B 9F F4 29 66 91 0A 96 04 65 67 93 0D 00 00 00
|
|
|
|
|
0040 | 04 6D FD CB 13 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 4B 38 FF 50 DA 4D 39 53 06 A5 9D 8A
|
|
|
|
|
0060 | 3B 60 FC CE 3D BF 6A 26 CD D2 6C 3E 2C E1 74 68
|
|
|
|
|
0070 | D2 C2 A3 F6 63 C3 C6 8D 8B 5D A5 38 6E 2D 65 F9
|
|
|
|
|
0080 | CC 68 76 3B 95 EC 91 18 6C A7 EB 55 FD 9D 76 A3
|
|
|
|
|
0090 | C5 89 6A 41 1C 2A F6 46 37 7D 49 09 D2 F6 51 EE
|
|
|
|
|
00A0 | BE 97 0A DD 15 F7 2B A4 BD 47 1A D6 4D 65 A1 2A
|
|
|
|
|
00B0 | 58 93 32 67 67 41 10 3F 0B A6 85 29 C3 8C AE A1
|
|
|
|
|
00C0 | 7D 71 05 29 B4 86 EE EE CE EE 6A D0 6D 2C 9B F4
|
|
|
|
|
00D0 | 77 55 3B 98 7A 06 D1 7B 73 BA B5 25 4E 9E E0 37
|
|
|
|
|
00E0 | FB FE B6 22 D9 E3 23 46 6D ED 18 11 DF E0 20 88
|
|
|
|
|
00F0 | AC AF 91 EA B8 A5 DF 7B 48 5C 4E 13 5B D5 96 E2
|
|
|
|
|
0100 | 67 40 2D A3 2A 0F 2E DF 7A 1D 14 69 22 06 8F 1E
|
|
|
|
|
0110 | D6 88 10 ED 5F 49 83 35 4A 20 4A 1E 38 C4 F7 0E
|
|
|
|
|
0120 | AD 52 B2 8C 05 BA 11 DF 6E 92 5D 66 E1 5C AE F1
|
|
|
|
|
0130 | 8E 38 E9 C9 73 9C 13 5B E8 B4 30 06 01 AB AE 2E
|
|
|
|
|
0140 | 8B C9 11 5B 9F 1F 03 FD 17 35 24 C8 CE 0D C4 A9
|
|
|
|
|
0150 | EC EB 61 44</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 C0 40 0C 00 79 C9 96 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 24 E5 EC 8F 78 78 D3 00
|
|
|
|
|
0020 | 29 35 AF 06 12 85 0C BC 4F 96 A4 2F 94 06 10 78
|
|
|
|
|
0030 | 84 FA A9 F9 69 30 65 C6 04 43 47 98 3B 00 00 00
|
|
|
|
|
0040 | 04 63 76 77 35 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 9A 98 05 F6 0A C0 B6 4D B4 A4 82 F6
|
|
|
|
|
0060 | 6A 7B 7A 4F D7 19 BD 95 60 4C D0 75 B3 42 59 F9
|
|
|
|
|
0070 | E5 92 35 2F 8E BD 2B B6 E5 00 27 3E 92 95 1E 3D
|
|
|
|
|
0080 | 0E 8D AB 32 6E 30 CC CD B7 B2 35 9F 54 88 18 18
|
|
|
|
|
0090 | 08 21 05 C6 BF 23 6C 1D 86 F0 E9 27 42 CB D9 B9
|
|
|
|
|
00A0 | 4E 2D 38 BD AD 49 37 86 9F 2C 6F 37 51 3D E8 A9
|
|
|
|
|
00B0 | 19 80 85 97 23 63 CC 16 2F A2 A6 38 11 F4 0D B3
|
|
|
|
|
00C0 | AE 05 D8 8B F0 59 FB 0D DA 2F 6E 1E 2E CD 86 C5
|
|
|
|
|
00D0 | C9 E7 FC 10 46 A3 CD 66 5A 70 1A 14 BB 12 76 B6
|
|
|
|
|
00E0 | E5 E0 66 6B D8 CB B9 DC 26 E9 0D 87 47 9C F6 A5
|
|
|
|
|
00F0 | B2 F2 44 36 8D DF 8A 61 F1 49 FD 76 C7 6C DE 3B
|
|
|
|
|
0100 | 24 82 3F 44 23 AB 4A 75 5E E4 DC DE 8D D8 46 70
|
|
|
|
|
0110 | E4 6F 8E 07 56 E4 8C A9 11 89 C3 D4 80 A7 16 FC
|
|
|
|
|
0120 | 5A BD E0 FE 5E AD 62 80 CF 56 C7 F5 23 7A 8F 2A
|
|
|
|
|
0130 | DB 95 F7 E6 7A 5B 4B 10 E1 77 77 E5 57 96 1F E8
|
|
|
|
|
0140 | 57 E7 80 ED A6 B7 42 59 4C D6 67 E9 9D F2 98 C3
|
|
|
|
|
0150 | 6B 67 E7 CD</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 = 28524709F59B991A34F3DB5C8CAB65EEA45C50C8306CFDC4CDD3636AE
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>80CD0D001AC69666</code></td>
|
|
|
|
|
<td><code>C0400C0079C99666</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 = 28524709F59B991A34F3DB5C8CAB65EEA45C50C8306CFDC4CDD3636AE
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>D4C39F0A0CE2408D537C91DC359D6320</code></td>
|
|
|
|
|
<td><code>24E5EC8F7878D3002935AF0612850CBC</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>183CC876B024215D4B9FF42966910A96</code></td>
|
|
|
|
|
<td><code>4F96A42F9406107884FAA9F9693065C6</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>046567930D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1701286669</td>
|
|
|
|
|
<td><code>044347983B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1128765499</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>046DFDCB13000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1845349139</td>
|
|
|
|
|
<td><code>0463767735000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1668708149</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 = 28524709F59B991A34F3DB5C8CAB65EEA45C50C8306CFDC4CDD3636AE
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE0001004B38FF50DA4D395306A59D8A</code> <code>3B60FCCE3DBF6A26CDD26C3E2CE17468</code> <code>D2C2A3F663C3C68D8B5DA5386E2D65F9</code> <code>CC68763B95EC91186CA7EB55FD9D76A3</code> <code>C5896A411C2AF646377D4909D2F651EE</code> <code>BE970ADD15F72BA4BD471AD64D65A12A</code> <code>589332676741103F0BA68529C38CAEA1</code> <code>7D710529B486EEEECEEE6AD06D2C9BF4</code> <code>77553B987A06D17B73BAB5254E9EE037</code> <code>FBFEB622D9E323466DED1811DFE02088</code> <code>ACAF91EAB8A5DF7B485C4E135BD596E2</code> <code>67402DA32A0F2EDF7A1D146922068F1E</code> <code>D68810ED5F4983354A204A1E38C4F70E</code> <code>AD52B28C05BA11DF6E925D66E15CAEF1</code> <code>8E38E9C9739C135BE8B4300601ABAE2E</code> <code>8BC9115B9F1F03FD173524C8CE0DC4A9</code><br> <code>ECEB6144</code></td>
|
|
|
|
|
<td><code>FE0001009A9805F60AC0B64DB4A482F6</code> <code>6A7B7A4FD719BD95604CD075B34259F9</code> <code>E592352F8EBD2BB6E500273E92951E3D</code> <code>0E8DAB326E30CCCDB7B2359F54881818</code> <code>082105C6BF236C1D86F0E92742CBD9B9</code> <code>4E2D38BDAD4937869F2C6F37513DE8A9</code> <code>198085972363CC162FA2A63811F40DB3</code> <code>AE05D88BF059FB0DDA2F6E1E2ECD86C5</code> <code>C9E7FC1046A3CD665A701A14BB1276B6</code> <code>E5E0666BD8CBB9DC26E90D87479CF6A5</code> <code>B2F244368DDF8A61F149FD76C76CDE3B</code> <code>24823F4423AB4A755EE4DCDE8DD84670</code> <code>E46F8E0756E48CA91189C3D480A716FC</code> <code>5ABDE0FE5EAD6280CF56C7F5237A8F2A</code> <code>DB95F7E67A5B4B10E17777E557961FE8</code> <code>57E780EDA6B742594CD667E99DF298C3</code><br> <code>6B67E7CD</code></td>
|
|
|
|
|
<td>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = 28524709F59B991A34F3DB5C8CAB65EEA45C50C8306CFDC4CDD3636AE
|
|
|
|
|
<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 24 6F F8 1A C6 96 66
|
|
|
|
|
0010 | 8C 02 00 00 5C 07 E8 D0 D4 C3 9F 0A 0C E2 40 8D
|
|
|
|
|
0020 | 53 7C 91 DC 35 9D 63 20 18 3C C8 76 B0 24 21 5D
|
|
|
|
|
0030 | 4B 9F F4 29 66 91 0A 96 FE 50 02 00 0E 34 09 E7
|
|
|
|
|
0040 | 8B E3 D8 C2 48 AA 68 AF 02 C3 28 EA 93 C9 31 D5
|
|
|
|
|
0050 | 51 51 F0 54 5A 5E 21 CF D0 17 83 F5 95 51 61 91
|
|
|
|
|
0060 | B1 27 44 F9 49 D9 26 F2 7C 06 47 5D 55 16 4D 62
|
|
|
|
|
0070 | 4C 93 F4 24 63 83 9A E4 EC BA 31 77 AB B1 87 31
|
|
|
|
|
0080 | E8 B7 79 01 7C F0 26 6B 04 26 38 3C 6F 6B 5E 4F
|
|
|
|
|
0090 | 8C 8F D2 9A F9 16 08 79 25 6F CC 20 C8 39 A4 62
|
|
|
|
|
00A0 | 63 8B 28 6C 65 20 4D 48 AA 84 84 E3 8F 9E E3 46
|
|
|
|
|
00B0 | 9D 63 19 AA 44 D0 2C 76 B8 BE 02 FA 26 CC 76 5E
|
|
|
|
|
00C0 | BA 86 E5 EE 55 F8 07 28 4F 9E AE DA E0 99 CE 15
|
|
|
|
|
00D0 | D1 CD 73 7F 31 8B 44 F1 B3 22 D9 7B 38 66 34 F9
|
|
|
|
|
00E0 | 79 D4 76 EE 6A D2 49 EA C7 A2 03 F9 08 8B 90 B0
|
|
|
|
|
00F0 | 23 5B A4 7B 11 EC 7D DD 71 F5 45 93 44 0B A7 A3
|
|
|
|
|
0100 | 36 AB 39 FC EC F6 0C D4 CE 5E 04 82 7A 80 CA C2
|
|
|
|
|
0110 | E4 79 15 39 93 E6 06 58 6D 8D BD 94 2D 54 70 0D
|
|
|
|
|
0120 | 4A 0B B0 F6 15 C2 C3 1A D2 02 29 12 4D 31 43 9B
|
|
|
|
|
0130 | 5E 5D 7E 43 09 78 71 80 56 F4 A0 3C 02 D1 94 C3
|
|
|
|
|
0140 | 10 49 19 FD 98 DE 07 5B 67 17 1A C7 E3 65 C4 2E
|
|
|
|
|
0150 | 05 0C 92 D0 F0 18 1C 93 B1 CA 3F 31 DC D6 AF 8B
|
|
|
|
|
0160 | C7 4D 18 53 0D 19 98 93 B5 96 F6 F8 59 37 1C 3B
|
|
|
|
|
0170 | 4A F4 4D 22 67 72 C6 12 27 0D 9E 39 AB AA 50 7A
|
|
|
|
|
0180 | F5 C7 ED 46 3A CD 44 C9 15 7D 7E 2E 93 C0 EA D9
|
|
|
|
|
0190 | B0 97 97 7F 37 BC BD 42 10 37 03 47 3A 5E 83 68
|
|
|
|
|
01A0 | 5A FE F6 6B 83 E3 C0 0B 9C 85 A9 BC C0 47 41 1F
|
|
|
|
|
01B0 | EB 12 BB B0 8A B7 20 D0 71 E9 A1 8A 91 5F 9C B2
|
|
|
|
|
01C0 | 6A AF 91 3A BB B6 74 63 6C 40 D0 D3 8E EC 4A 52
|
|
|
|
|
01D0 | D7 07 DE 7C AA 7D F6 2E 02 A3 02 34 08 DF 9D E7
|
|
|
|
|
01E0 | 07 B8 BF BA DC 08 EE 8C F8 73 71 09 2A 06 C4 8A
|
|
|
|
|
01F0 | 74 FC 01 B4 9D 10 F8 E2 41 C1 D6 52 B8 3C 60 4D
|
|
|
|
|
0200 | C3 49 01 AA D7 CA 52 3B 34 FE 08 1D C3 E6 80 BB
|
|
|
|
|
0210 | 19 B0 AB 01 E4 00 60 CB 4F 57 24 5A 45 C4 AC 8A
|
|
|
|
|
0220 | 49 25 46 50 76 B8 37 04 DD 8D 0C 97 1E A9 77 87
|
|
|
|
|
0230 | 8C 73 B4 06 50 28 4D A3 7B 2E BA F3 24 D5 FD 94
|
|
|
|
|
0240 | C8 AE 8A 7D 24 14 DD 53 CF 24 E3 99 56 91 22 8C
|
|
|
|
|
0250 | 4F 64 D6 46 DF 2B 81 C0 B8 57 7E 58 FB BE 83 A5
|
|
|
|
|
0260 | DC C0 71 0D DD D8 A6 D2 8C 3E 31 7E 6A 36 52 F4
|
|
|
|
|
0270 | D5 60 CD 7F 11 8B 1C B1 CA D4 8E 05 B9 C5 2B 41
|
|
|
|
|
0280 | 17 16 47 E6 19 85 EB 46 0C 0D FB 13</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 68 02 99 7A C9 96 66
|
|
|
|
|
0010 | C8 02 00 00 5C 07 E8 D0 24 E5 EC 8F 78 78 D3 00
|
|
|
|
|
0020 | 29 35 AF 06 12 85 0C BC 4F 96 A4 2F 94 06 10 78
|
|
|
|
|
0030 | 84 FA A9 F9 69 30 65 C6 FE 50 02 00 06 C6 58 5F
|
|
|
|
|
0040 | DE 86 93 32 3C 6A 3B 68 39 82 93 0D 3F 3A 07 CA
|
|
|
|
|
0050 | 36 65 A5 05 12 D7 5A F0 4D EE 7A 3A 0B 4D 87 EB
|
|
|
|
|
0060 | 30 12 96 9F 13 27 0B 77 DD 63 9E 9F 43 1F BB 8F
|
|
|
|
|
0070 | 1D A0 36 99 E4 FE DA C3 0A C4 85 09 90 99 73 86
|
|
|
|
|
0080 | 60 7D AD DC 79 C6 FC 1E 17 96 9C AC 06 90 4D AB
|
|
|
|
|
0090 | A1 96 80 5D 02 C5 EB ED 27 80 B4 13 F4 1C 8A C2
|
|
|
|
|
00A0 | AC 7C 7B 72 7B B6 E2 F0 EB F7 BF E3 8E 4F 92 2A
|
|
|
|
|
00B0 | 89 1A A4 51 8F 33 E3 DF B8 69 53 4E 03 93 82 77
|
|
|
|
|
00C0 | 1A 94 86 70 E2 39 D1 DB 7A 6B B3 A2 22 F7 8F CF
|
|
|
|
|
00D0 | 65 4E 1B 98 45 D5 38 BE 3B 45 D8 D2 C0 E4 E0 BC
|
|
|
|
|
00E0 | BF CE 0F 37 3E AA D1 A6 DC 13 4C 33 66 E5 06 E9
|
|
|
|
|
00F0 | 23 D9 AA BE A5 3A C3 CE 4B CC F3 A6 7B 08 64 A6
|
|
|
|
|
0100 | 6D BA C6 99 FA 6D B4 58 44 96 5B 1F CD 6F 0D D0
|
|
|
|
|
0110 | 09 1B DA 60 36 3A 03 82 B8 DB 28 95 81 54 0B E9
|
|
|
|
|
0120 | 74 41 4C 9C 12 53 E7 FC 56 34 43 3D B5 CC A4 20
|
|
|
|
|
0130 | AF 6C FB DD 98 5A D1 90 53 97 AF 59 89 DA F0 F8
|
|
|
|
|
0140 | 08 F4 16 E3 6D 7A 96 6F E1 DE 1E 38 9B 81 B6 C1
|
|
|
|
|
0150 | C3 53 B4 2A 80 2B 6F 85 D7 F6 BE 6C 1D D3 D2 AA
|
|
|
|
|
0160 | 81 29 97 0D 14 F9 85 AB 51 72 7A 75 5E 7B D1 F0
|
|
|
|
|
0170 | BA CB 41 7F 96 44 C2 31 B6 B0 C5 C7 0B EE D2 24
|
|
|
|
|
0180 | 17 B3 E8 9C 80 CC 8C C4 14 BC 32 36 95 ED 7D 71
|
|
|
|
|
0190 | FF 20 B6 4E 9E 42 B2 7A F5 03 0C 73 9F A1 57 AD
|
|
|
|
|
01A0 | 32 21 93 A0 D1 B9 51 D7 D9 57 D7 0C C6 50 34 2D
|
|
|
|
|
01B0 | B4 03 87 05 16 5E 64 BA DC D7 15 57 42 2A 98 55
|
|
|
|
|
01C0 | 61 BD EB A5 A0 70 9C 35 0E F9 82 ED E4 5D 28 58
|
|
|
|
|
01D0 | 4B 27 C2 06 27 3B AE 0F E6 18 EA 94 9E 36 AC DA
|
|
|
|
|
01E0 | 3F D1 A5 1F A5 F2 BE 00 11 79 B5 77 79 8E 14 71
|
|
|
|
|
01F0 | 5A 14 EC C8 18 4A DA C6 3C 71 E2 3B AF 93 BB 8E
|
|
|
|
|
0200 | 13 17 02 8C 3E 46 26 2E AD AA 22 F6 5F A4 09 D0
|
|
|
|
|
0210 | 0C BD EC E6 CF D8 9E 09 20 52 B8 5E F4 B3 30 E6
|
|
|
|
|
0220 | 68 45 30 4B DB 34 76 2F 9E 8B 8C 0B 24 D6 3C 15
|
|
|
|
|
0230 | 6D EA 26 BB 1D D4 33 D7 88 7C BB DF 19 F4 C2 11
|
|
|
|
|
0240 | 2F 21 D0 12 2A E0 A4 F1 D8 CD 96 4E 02 5E B9 37
|
|
|
|
|
0250 | E1 36 8C 29 06 AF 6D E2 38 65 80 A8 AB 01 16 74
|
|
|
|
|
0260 | 1B 98 A3 86 F1 42 0A DC 2B 75 B3 19 84 27 B0 8E
|
|
|
|
|
0270 | 45 B9 43 A5 E3 91 9D FB F2 F1 94 58 A2 06 23 3A
|
|
|
|
|
0280 | 1A 3B 5B 44 F8 34 A3 29 80 B7 EF 83</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 = 28524709F59B991A34F3DB5C8CAB65EEA45C50C8306CFDC4CDD3636AE
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>01246FF81AC69666</code></td>
|
|
|
|
|
<td><code>016802997AC99666</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>8C020000</code> (652 in decimal)</td>
|
|
|
|
|
<td><code>C8020000</code> (712 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -482,19 +482,19 @@ random_padding_bytes = 28524709F59B991A34F3DB5C8CAB65EEA45C50C8306CFDC4CDD3636AE
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>D4C39F0A0CE2408D537C91DC359D6320</code></td>
|
|
|
|
|
<td><code>24E5EC8F7878D3002935AF0612850CBC</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>183CC876B024215D4B9FF42966910A96</code></td>
|
|
|
|
|
<td><code>4F96A42F9406107884FAA9F9693065C6</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE5002000E3409E78BE3D8C248AA68AF</code> <code>02C328EA93C931D55151F0545A5E21CF</code> <code>D01783F595516191B12744F949D926F2</code> <code>7C06475D55164D624C93F42463839AE4</code> <code>ECBA3177ABB18731E8B779017CF0266B</code> <code>0426383C6F6B5E4F8C8FD29AF9160879</code> <code>256FCC20C839A462638B286C65204D48</code> <code>AA8484E38F9EE3469D6319AA44D02C76</code> <code>B8BE02FA26CC765EBA86E5EE55F80728</code> <code>4F9EAEDAE099CE15D1CD737F318B44F1</code> <code>B322D97B386634F979D476EE6AD249EA</code> <code>C7A203F9088B90B0235BA47B11EC7DDD</code> <code>71F54593440BA7A336AB39FCECF60CD4</code> <code>CE5E04827A80CAC2E479153993E60658</code> <code>6D8DBD942D54700D4A0BB0F615C2C31A</code> <code>D20229124D31439B5E5D7E4309787180</code> <code>56F4A03C02D194C3104919FD98DE075B</code> <code>67171AC7E365C42E050C92D0F0181C93</code> <code>B1CA3F31DCD6AF8BC74D18530D199893</code> <code>B596F6F859371C3B4AF44D226772C612</code> <code>270D9E39ABAA507AF5C7ED463ACD44C9</code> <code>157D7E2E93C0EAD9B097977F37BCBD42</code> <code>103703473A5E83685AFEF66B83E3C00B</code> <code>9C85A9BCC047411FEB12BBB08AB720D0</code> <code>71E9A18A915F9CB26AAF913ABBB67463</code> <code>6C40D0D38EEC4A52D707DE7CAA7DF62E</code> <code>02A3023408DF9DE707B8BFBADC08EE8C</code> <code>F87371092A06C48A74FC01B49D10F8E2</code> <code>41C1D652B83C604DC34901AAD7CA523B</code> <code>34FE081DC3E680BB19B0AB01E40060CB</code> <code>4F57245A45C4AC8A4925465076B83704</code> <code>DD8D0C971EA977878C73B40650284DA3</code> <code>7B2EBAF324D5FD94C8AE8A7D2414DD53</code> <code>CF24E3995691228C4F64D646DF2B81C0</code> <code>B8577E58FBBE83A5DCC0710DDDD8A6D2</code> <code>8C3E317E6A3652F4D560CD7F118B1CB1</code> <code>CAD48E05B9C52B41171647E61985EB46</code><br> <code>0C0DFB13</code></td>
|
|
|
|
|
<td><code>FE50020006C6585FDE8693323C6A3B68</code> <code>3982930D3F3A07CA3665A50512D75AF0</code> <code>4DEE7A3A0B4D87EB3012969F13270B77</code> <code>DD639E9F431FBB8F1DA03699E4FEDAC3</code> <code>0AC4850990997386607DADDC79C6FC1E</code> <code>17969CAC06904DABA196805D02C5EBED</code> <code>2780B413F41C8AC2AC7C7B727BB6E2F0</code> <code>EBF7BFE38E4F922A891AA4518F33E3DF</code> <code>B869534E039382771A948670E239D1DB</code> <code>7A6BB3A222F78FCF654E1B9845D538BE</code> <code>3B45D8D2C0E4E0BCBFCE0F373EAAD1A6</code> <code>DC134C3366E506E923D9AABEA53AC3CE</code> <code>4BCCF3A67B0864A66DBAC699FA6DB458</code> <code>44965B1FCD6F0DD0091BDA60363A0382</code> <code>B8DB289581540BE974414C9C1253E7FC</code> <code>5634433DB5CCA420AF6CFBDD985AD190</code> <code>5397AF5989DAF0F808F416E36D7A966F</code> <code>E1DE1E389B81B6C1C353B42A802B6F85</code> <code>D7F6BE6C1DD3D2AA8129970D14F985AB</code> <code>51727A755E7BD1F0BACB417F9644C231</code> <code>B6B0C5C70BEED22417B3E89C80CC8CC4</code> <code>14BC323695ED7D71FF20B64E9E42B27A</code> <code>F5030C739FA157AD322193A0D1B951D7</code> <code>D957D70CC650342DB4038705165E64BA</code> <code>DCD71557422A985561BDEBA5A0709C35</code> <code>0EF982EDE45D28584B27C206273BAE0F</code> <code>E618EA949E36ACDA3FD1A51FA5F2BE00</code> <code>1179B577798E14715A14ECC8184ADAC6</code> <code>3C71E23BAF93BB8E1317028C3E46262E</code> <code>ADAA22F65FA409D00CBDECE6CFD89E09</code> <code>2052B85EF4B330E66845304BDB34762F</code> <code>9E8B8C0B24D63C156DEA26BB1DD433D7</code> <code>887CBBDF19F4C2112F21D0122AE0A4F1</code> <code>D8CD964E025EB937E1368C2906AF6DE2</code> <code>386580A8AB0116741B98A386F1420ADC</code> <code>2B75B3198427B08E45B943A5E3919DFB</code> <code>F2F19458A206233A1A3B5B44F834A329</code><br> <code>80B7EF83</code></td>
|
|
|
|
|
<td>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = 28524709F59B991A34F3DB5C8CAB65EEA45C50C8306CFDC4CDD3636AE
|
|
|
|
|
<!-- 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 = 0E3409E78BE3D8C248AA68AF02C328EA93C931D55151F0545A5E21CFD01783F595516191B12744F949D926F27C06475D55164D624C93F42463839AE4ECBA3177ABB18731E8B779017CF0266B0426383C6F6B5E4F8C8FD29AF9160879256FCC20C839A462638B286C65204D48AA8484E38F9EE3469D6319AA44D02C76B8BE02FA26CC765EBA86E5EE55F807284F9EAEDAE099CE15D1CD737F318B44F1B322D97B386634F979D476EE6AD249EAC7A203F9088B90B0235BA47B11EC7DDD71F54593440BA7A336AB39FCECF60CD4CE5E04827A80CAC2E479153993E606586D8DBD942D54700D4A0BB0F615C2C31AD20229124D31439B5E5D7E430978718056F4A03C02D194C3104919FD98DE075B67171AC7E365C42E050C92D0F0181C93B1CA3F31DCD6AF8BC74D18530D199893B596F6F859371C3B4AF44D226772C612270D9E39ABAA507AF5C7ED463ACD44C9157D7E2E93C0EAD9B097977F37BCBD42103703473A5E83685AFEF66B83E3C00B9C85A9BCC047411FEB12BBB08AB720D071E9A18A915F9CB26AAF913ABBB674636C40D0D38EEC4A52D707DE7CAA7DF62E02A3023408DF9DE707B8BFBADC08EE8CF87371092A06C48A74FC01B49D10F8E241C1D652B83C604DC34901AAD7CA523B34FE081DC3E680BB19B0AB01E40060CB4F57245A45C4AC8A4925465076B83704DD8D0C971EA977878C73B40650284DA37B2EBAF324D5FD94C8AE8A7D2414DD53CF24E3995691228C4F64D646DF2B81C0B8577E58FBBE83A5DCC0710DDDD8A6D28C3E317E6A3652F4D560CD7F118B1CB1CAD48E05B9C52B41171647E61985EB460C0DFB13
|
|
|
|
|
tmp_aes_key = 669395D66EE9A717398173BA8A55287C6503F4AF4D43DF48D39E9FD0CD07E914
|
|
|
|
|
tmp_aes_iv = 70991BA30BC241AD98B9D948961E747E214FB81262811620640D2FE8EAEC6E0F</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = 06C6585FDE8693323C6A3B683982930D3F3A07CA3665A50512D75AF04DEE7A3A0B4D87EB3012969F13270B77DD639E9F431FBB8F1DA03699E4FEDAC30AC4850990997386607DADDC79C6FC1E17969CAC06904DABA196805D02C5EBED2780B413F41C8AC2AC7C7B727BB6E2F0EBF7BFE38E4F922A891AA4518F33E3DFB869534E039382771A948670E239D1DB7A6BB3A222F78FCF654E1B9845D538BE3B45D8D2C0E4E0BCBFCE0F373EAAD1A6DC134C3366E506E923D9AABEA53AC3CE4BCCF3A67B0864A66DBAC699FA6DB45844965B1FCD6F0DD0091BDA60363A0382B8DB289581540BE974414C9C1253E7FC5634433DB5CCA420AF6CFBDD985AD1905397AF5989DAF0F808F416E36D7A966FE1DE1E389B81B6C1C353B42A802B6F85D7F6BE6C1DD3D2AA8129970D14F985AB51727A755E7BD1F0BACB417F9644C231B6B0C5C70BEED22417B3E89C80CC8CC414BC323695ED7D71FF20B64E9E42B27AF5030C739FA157AD322193A0D1B951D7D957D70CC650342DB4038705165E64BADCD71557422A985561BDEBA5A0709C350EF982EDE45D28584B27C206273BAE0FE618EA949E36ACDA3FD1A51FA5F2BE001179B577798E14715A14ECC8184ADAC63C71E23BAF93BB8E1317028C3E46262EADAA22F65FA409D00CBDECE6CFD89E092052B85EF4B330E66845304BDB34762F9E8B8C0B24D63C156DEA26BB1DD433D7887CBBDF19F4C2112F21D0122AE0A4F1D8CD964E025EB937E1368C2906AF6DE2386580A8AB0116741B98A386F1420ADC2B75B3198427B08E45B943A5E3919DFBF2F19458A206233A1A3B5B44F834A32980B7EF83
|
|
|
|
|
tmp_aes_key = CBA34A0CA23CAE390443B17C123E1B2BCF07DCAC91C9376B31C61A33C610D388
|
|
|
|
|
tmp_aes_iv = 850ACE6466B4ECEA638E5E2A95460BF82F296AB589EE07EABFBC7821939496C1</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = B2EF299D3C22059967EA491E42A19A0751B0AE43BA0D89B5D4C39F0A0CE2408D537C91DC359D6320183CC876B024215D4B9FF42966910A9603000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001004EF8630BECB9D22E81C42CAE129FA54458A37EC29BADB42E35114DA6E36A03B05BF11A930C604A2519223BA1580E550821E1E7F77563415E49EF8577FAC89C7821100496DC739FA6EE7B2486B1C80DA38E0038FE0B646EFDC49830F3C933406B6B47C06415C2A57222A89C3CC66C2A0EA763C4B97221782EEEB6E80EA341735F948E96DA22B00D13994819686B2975D20E56B7CBD0B7F2C5420103CDE77CEA4AF9597B7EDCB9C3BD4EC87480A4B123A9BC0B146CB280D66715060B52171CFB7F7E3CABF43D28758395C71C13D7C18E74BD5533BB1F354383592F8B6C4579F7170A5C6FA3DE4E52422DF6A3430D1B4FAAB0B2295CC911BE568FB0CAC7F2E2991C1AC69666BBA14826842A81F6
|
|
|
|
|
answer = BA0D89B5D4C39F0A0CE2408D537C91DC359D6320183CC876B024215D4B9FF42966910A9603000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001004EF8630BECB9D22E81C42CAE129FA54458A37EC29BADB42E35114DA6E36A03B05BF11A930C604A2519223BA1580E550821E1E7F77563415E49EF8577FAC89C7821100496DC739FA6EE7B2486B1C80DA38E0038FE0B646EFDC49830F3C933406B6B47C06415C2A57222A89C3CC66C2A0EA763C4B97221782EEEB6E80EA341735F948E96DA22B00D13994819686B2975D20E56B7CBD0B7F2C5420103CDE77CEA4AF9597B7EDCB9C3BD4EC87480A4B123A9BC0B146CB280D66715060B52171CFB7F7E3CABF43D28758395C71C13D7C18E74BD5533BB1F354383592F8B6C4579F7170A5C6FA3DE4E52422DF6A3430D1B4FAAB0B2295CC911BE568FB0CAC7F2E2991C1AC69666BBA14826842A81F6</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = B88F80FCC66ACC005F1B21B5AA2ED052669C99D0BA0D89B524E5EC8F7878D3002935AF0612850CBC4F96A42F9406107884FAA9F9693065C603000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100311E6FF1D5E5D0B8D264D0D4BA18A3706DFAF5E65E338121370BB5E3FCD91B0E5567B87BBB19BDBFF61CF62946182917DB05761FF2956FEF66D20C35CE6C5B4F535A55BDEDC960AEE8223E92B6A8A2CF98E8331FCAAE6894327A938B0EB2B208820C01689139E4EA44B42B5CD77DFE3130C0D69D70D3874F03DD15AF9835586DBFBCB07AD227C9230145B0C712B77C8440A312DC72C4A7A81D4345D12FCAE8302C5D0C218805C7B378794AFB9D9AC8F5CB7DFB2DDED5653411660763CE6501BD457C9DD4347DCFB4E311EEBC6730445B18E48DCE013A509B5F9E497766B9BBF5E500341626ECF8CCA084249D4AFE4CD2DD090C6071294588E8FC54BA5813F8F47AC99666F9248DEF2E7EDBA0
|
|
|
|
|
answer = BA0D89B524E5EC8F7878D3002935AF0612850CBC4F96A42F9406107884FAA9F9693065C603000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100311E6FF1D5E5D0B8D264D0D4BA18A3706DFAF5E65E338121370BB5E3FCD91B0E5567B87BBB19BDBFF61CF62946182917DB05761FF2956FEF66D20C35CE6C5B4F535A55BDEDC960AEE8223E92B6A8A2CF98E8331FCAAE6894327A938B0EB2B208820C01689139E4EA44B42B5CD77DFE3130C0D69D70D3874F03DD15AF9835586DBFBCB07AD227C9230145B0C712B77C8440A312DC72C4A7A81D4345D12FCAE8302C5D0C218805C7B378794AFB9D9AC8F5CB7DFB2DDED5653411660763CE6501BD457C9DD4347DCFB4E311EEBC6730445B18E48DCE013A509B5F9E497766B9BBF5E500341626ECF8CCA084249D4AFE4CD2DD090C6071294588E8FC54BA5813F8F47AC99666F9248DEF2E7EDBA0</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 D4 C3 9F 0A 0C E2 40 8D 53 7C 91 DC
|
|
|
|
|
0010 | 35 9D 63 20 18 3C C8 76 B0 24 21 5D 4B 9F F4 29
|
|
|
|
|
0020 | 66 91 0A 96 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 24 E5 EC 8F 78 78 D3 00 29 35 AF 06
|
|
|
|
|
0010 | 12 85 0C BC 4F 96 A4 2F 94 06 10 78 84 FA A9 F9
|
|
|
|
|
0020 | 69 30 65 C6 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 = BA0D89B5D4C39F0A0CE2408D537C91DC359D6320183CC876B024215D4B9FF42966910A9
|
|
|
|
|
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 | 4E F8 63 0B EC B9 D2 2E 81 C4 2C AE 12 9F A5 44
|
|
|
|
|
0140 | 58 A3 7E C2 9B AD B4 2E 35 11 4D A6 E3 6A 03 B0
|
|
|
|
|
0150 | 5B F1 1A 93 0C 60 4A 25 19 22 3B A1 58 0E 55 08
|
|
|
|
|
0160 | 21 E1 E7 F7 75 63 41 5E 49 EF 85 77 FA C8 9C 78
|
|
|
|
|
0170 | 21 10 04 96 DC 73 9F A6 EE 7B 24 86 B1 C8 0D A3
|
|
|
|
|
0180 | 8E 00 38 FE 0B 64 6E FD C4 98 30 F3 C9 33 40 6B
|
|
|
|
|
0190 | 6B 47 C0 64 15 C2 A5 72 22 A8 9C 3C C6 6C 2A 0E
|
|
|
|
|
01A0 | A7 63 C4 B9 72 21 78 2E EE B6 E8 0E A3 41 73 5F
|
|
|
|
|
01B0 | 94 8E 96 DA 22 B0 0D 13 99 48 19 68 6B 29 75 D2
|
|
|
|
|
01C0 | 0E 56 B7 CB D0 B7 F2 C5 42 01 03 CD E7 7C EA 4A
|
|
|
|
|
01D0 | F9 59 7B 7E DC B9 C3 BD 4E C8 74 80 A4 B1 23 A9
|
|
|
|
|
01E0 | BC 0B 14 6C B2 80 D6 67 15 06 0B 52 17 1C FB 7F
|
|
|
|
|
01F0 | 7E 3C AB F4 3D 28 75 83 95 C7 1C 13 D7 C1 8E 74
|
|
|
|
|
0200 | BD 55 33 BB 1F 35 43 83 59 2F 8B 6C 45 79 F7 17
|
|
|
|
|
0210 | 0A 5C 6F A3 DE 4E 52 42 2D F6 A3 43 0D 1B 4F AA
|
|
|
|
|
0220 | B0 B2 29 5C C9 11 BE 56 8F B0 CA C7 F2 E2 99 1C
|
|
|
|
|
0230 | 1A C6 96 66</code></pre>
|
|
|
|
|
0130 | 31 1E 6F F1 D5 E5 D0 B8 D2 64 D0 D4 BA 18 A3 70
|
|
|
|
|
0140 | 6D FA F5 E6 5E 33 81 21 37 0B B5 E3 FC D9 1B 0E
|
|
|
|
|
0150 | 55 67 B8 7B BB 19 BD BF F6 1C F6 29 46 18 29 17
|
|
|
|
|
0160 | DB 05 76 1F F2 95 6F EF 66 D2 0C 35 CE 6C 5B 4F
|
|
|
|
|
0170 | 53 5A 55 BD ED C9 60 AE E8 22 3E 92 B6 A8 A2 CF
|
|
|
|
|
0180 | 98 E8 33 1F CA AE 68 94 32 7A 93 8B 0E B2 B2 08
|
|
|
|
|
0190 | 82 0C 01 68 91 39 E4 EA 44 B4 2B 5C D7 7D FE 31
|
|
|
|
|
01A0 | 30 C0 D6 9D 70 D3 87 4F 03 DD 15 AF 98 35 58 6D
|
|
|
|
|
01B0 | BF BC B0 7A D2 27 C9 23 01 45 B0 C7 12 B7 7C 84
|
|
|
|
|
01C0 | 40 A3 12 DC 72 C4 A7 A8 1D 43 45 D1 2F CA E8 30
|
|
|
|
|
01D0 | 2C 5D 0C 21 88 05 C7 B3 78 79 4A FB 9D 9A C8 F5
|
|
|
|
|
01E0 | CB 7D FB 2D DE D5 65 34 11 66 07 63 CE 65 01 BD
|
|
|
|
|
01F0 | 45 7C 9D D4 34 7D CF B4 E3 11 EE BC 67 30 44 5B
|
|
|
|
|
0200 | 18 E4 8D CE 01 3A 50 9B 5F 9E 49 77 66 B9 BB F5
|
|
|
|
|
0210 | E5 00 34 16 26 EC F8 CC A0 84 24 9D 4A FE 4C D2
|
|
|
|
|
0220 | DD 09 0C 60 71 29 45 88 E8 FC 54 BA 58 13 F8 F4
|
|
|
|
|
0230 | 7A C9 96 66</code></pre>
|
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
|
<pre><code>server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;</code></pre>
|
|
|
|
|
<table class="table">
|
|
|
|
@ -570,13 +570,13 @@ answer = BA0D89B5D4C39F0A0CE2408D537C91DC359D6320183CC876B024215D4B9FF42966910A9
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>D4C39F0A0CE2408D537C91DC359D6320</code></td>
|
|
|
|
|
<td><code>24E5EC8F7878D3002935AF0612850CBC</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>183CC876B024215D4B9FF42966910A96</code></td>
|
|
|
|
|
<td><code>4F96A42F9406107884FAA9F9693065C6</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B5D4C39F0A0CE2408D537C91DC359D6320183CC876B024215D4B9FF42966910A9
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE0001004EF8630BECB9D22E81C42CAE</code> <code>129FA54458A37EC29BADB42E35114DA6</code> <code>E36A03B05BF11A930C604A2519223BA1</code> <code>580E550821E1E7F77563415E49EF8577</code> <code>FAC89C7821100496DC739FA6EE7B2486</code> <code>B1C80DA38E0038FE0B646EFDC49830F3</code> <code>C933406B6B47C06415C2A57222A89C3C</code> <code>C66C2A0EA763C4B97221782EEEB6E80E</code> <code>A341735F948E96DA22B00D1399481968</code> <code>6B2975D20E56B7CBD0B7F2C5420103CD</code> <code>E77CEA4AF9597B7EDCB9C3BD4EC87480</code> <code>A4B123A9BC0B146CB280D66715060B52</code> <code>171CFB7F7E3CABF43D28758395C71C13</code> <code>D7C18E74BD5533BB1F354383592F8B6C</code> <code>4579F7170A5C6FA3DE4E52422DF6A343</code> <code>0D1B4FAAB0B2295CC911BE568FB0CAC7</code><br> <code>F2E2991C</code></td>
|
|
|
|
|
<td><code>FE000100311E6FF1D5E5D0B8D264D0D4</code> <code>BA18A3706DFAF5E65E338121370BB5E3</code> <code>FCD91B0E5567B87BBB19BDBFF61CF629</code> <code>46182917DB05761FF2956FEF66D20C35</code> <code>CE6C5B4F535A55BDEDC960AEE8223E92</code> <code>B6A8A2CF98E8331FCAAE6894327A938B</code> <code>0EB2B208820C01689139E4EA44B42B5C</code> <code>D77DFE3130C0D69D70D3874F03DD15AF</code> <code>9835586DBFBCB07AD227C9230145B0C7</code> <code>12B77C8440A312DC72C4A7A81D4345D1</code> <code>2FCAE8302C5D0C218805C7B378794AFB</code> <code>9D9AC8F5CB7DFB2DDED5653411660763</code> <code>CE6501BD457C9DD4347DCFB4E311EEBC</code> <code>6730445B18E48DCE013A509B5F9E4977</code> <code>66B9BBF5E500341626ECF8CCA084249D</code> <code>4AFE4CD2DD090C6071294588E8FC54BA</code><br> <code>5813F8F4</code></td>
|
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>1AC69666</code> (1721157146 in decimal)</td>
|
|
|
|
|
<td><code>7AC99666</code> (1721158010 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B5D4C39F0A0CE2408D537C91DC359D6320183CC876B024215D4B9FF42966910A9
|
|
|
|
|
<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 = 2FA1FA533C2F8B12055F6E7A04E8DF4468333A7C0C0C2754F7E6E1C9D2CB657F5AF49D21184D4CAC5581A3D46FCBE6355338A5ABF720F91F4C3DE96E862C75A93F18B7A0AE28BE311C57E78F8F2A5F4DF98D59D86E4D4D02D7EF3BCFAFF6B35FA66984D70424EE7340EA41B8EA1A19C13F2947DF9CDBA325944FE6E9CD2BD3081C6A2204AFEEDC675D72BCC9E3C42941283048EA5751631A6D8FED525F686CF468BB8A1B6112B3996C1557896AF78F6FDBDDBC3BE69E2D886D8D60A0C9FDC04E28D27053DF7E83DFCA510EE929233BA3EDC0F54940F1AE06B260FBAD93A8B89515560E6A622F8ACABD8602303F2F379348D6ADD3F466CE4343BAC7A767DD8CA6</code></pre>
|
|
|
|
|
<pre><code>b = 7BAD48934102CE89B353C72C67EFB241BB8ABE9004BB389E8C7CE46C581D0F55F36768CCD5A79683087837BBBAAB72372E4CEBE10A9FD4C6AC4F5C4252FFBA05FFC90AB80E0824C6A7510D90A3C753FC87EEBEFF8002E2492A5EFDE70FD50C25801712000A78B6B3735E466B090C9D27619C0B0A256A2427EC3BDC4EB0D6D325064B77941F7D7A9DFF476EDDD57A666DB5D6199BCE6BC2031FCAAEA929C30C68E0E2F563C6EFEF6715C824372C4305C0AEAA64E65608B2B889B81EABC47F6A908852E28B642EBD57374F83B7FE9594CCF9EB4C58DA5663815C107BCA7D607403DA5A68053B92DB44BC6DD2AF71EA337A7FACAE47F529E8E506EFD90DEA8F5F29</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 = 6285A925AFD0126C873715D1E0F1E728B28CC816381BD32642E0D41EDC88E929BBCEA49D45E3D1B5B9B237D189EA4A7F13228F1ED508BD0DB548687E31BC6D1199AD292C747F09C190AB0224B7F110A15F82848B2D6EB855B70DD0BF7CC1559A6254B4ABFCF6F234BC11BA7508425CC368BB22A0D3C055981C3D932057B7B6B09426FE6DF1B7387590DFFC7CE1CFECFAFBF2A211E34077788F9B0D84CB89E556B31AA8A2848F950E8FE0504020696364D946989D3BF85BF349EC1E7C92A9A872910844DA4F3065EBB324D3D65274B489A44F18ACDA84CFB4CD30B8FD9E81DC5D9D2F69EF1305F10CB8F52B2B2E58863D01A70D3A055066990CD2CD129A1C5DEC</code></pre>
|
|
|
|
|
<pre><code>g_b = 87603BA669EDAA7EDA5771820DE64E1261C258C0C5F22910AF325C2017DEA674BE11E3E394EEAA874FB948043A12269B927881A6D6BA817015C79F51C2140C78DF11F069B5CF5C72DE7D04E8A9CD44277DA70AB4688CBF5DA9866D5A099163EE81EAD2CD9AA9AF00E3BB69944826E607E59A78435620D084EF1D0A457087A98F5080F8AAE69CBA110CC83B31B9FC18E7154959FB1B2F3850EE0F09182D74ECCA03D18667BC625C0BD6B2E8F9FA6F4D6F4133D5720F98077DF4F6363083FF80860D53E33570AEFC575393B09557F93E83D76A120D0B0682C62CDC20FD88D67D0EE92DA0FB05C7BC22C8CE5234C77C1E4BCCEA67388675309DF2DF8370611A0622</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 D4 C3 9F 0A 0C E2 40 8D 53 7C 91 DC
|
|
|
|
|
0010 | 35 9D 63 20 18 3C C8 76 B0 24 21 5D 4B 9F F4 29
|
|
|
|
|
0020 | 66 91 0A 96 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 62 85 A9 25 AF D0 12 6C 87 37 15 D1 E0 F1 E7 28
|
|
|
|
|
0040 | B2 8C C8 16 38 1B D3 26 42 E0 D4 1E DC 88 E9 29
|
|
|
|
|
0050 | BB CE A4 9D 45 E3 D1 B5 B9 B2 37 D1 89 EA 4A 7F
|
|
|
|
|
0060 | 13 22 8F 1E D5 08 BD 0D B5 48 68 7E 31 BC 6D 11
|
|
|
|
|
0070 | 99 AD 29 2C 74 7F 09 C1 90 AB 02 24 B7 F1 10 A1
|
|
|
|
|
0080 | 5F 82 84 8B 2D 6E B8 55 B7 0D D0 BF 7C C1 55 9A
|
|
|
|
|
0090 | 62 54 B4 AB FC F6 F2 34 BC 11 BA 75 08 42 5C C3
|
|
|
|
|
00A0 | 68 BB 22 A0 D3 C0 55 98 1C 3D 93 20 57 B7 B6 B0
|
|
|
|
|
00B0 | 94 26 FE 6D F1 B7 38 75 90 DF FC 7C E1 CF EC FA
|
|
|
|
|
00C0 | FB F2 A2 11 E3 40 77 78 8F 9B 0D 84 CB 89 E5 56
|
|
|
|
|
00D0 | B3 1A A8 A2 84 8F 95 0E 8F E0 50 40 20 69 63 64
|
|
|
|
|
00E0 | D9 46 98 9D 3B F8 5B F3 49 EC 1E 7C 92 A9 A8 72
|
|
|
|
|
00F0 | 91 08 44 DA 4F 30 65 EB B3 24 D3 D6 52 74 B4 89
|
|
|
|
|
0100 | A4 4F 18 AC DA 84 CF B4 CD 30 B8 FD 9E 81 DC 5D
|
|
|
|
|
0110 | 9D 2F 69 EF 13 05 F1 0C B8 F5 2B 2B 2E 58 86 3D
|
|
|
|
|
0120 | 01 A7 0D 3A 05 50 66 99 0C D2 CD 12 9A 1C 5D EC</code></pre>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 24 E5 EC 8F 78 78 D3 00 29 35 AF 06
|
|
|
|
|
0010 | 12 85 0C BC 4F 96 A4 2F 94 06 10 78 84 FA A9 F9
|
|
|
|
|
0020 | 69 30 65 C6 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 87 60 3B A6 69 ED AA 7E DA 57 71 82 0D E6 4E 12
|
|
|
|
|
0040 | 61 C2 58 C0 C5 F2 29 10 AF 32 5C 20 17 DE A6 74
|
|
|
|
|
0050 | BE 11 E3 E3 94 EE AA 87 4F B9 48 04 3A 12 26 9B
|
|
|
|
|
0060 | 92 78 81 A6 D6 BA 81 70 15 C7 9F 51 C2 14 0C 78
|
|
|
|
|
0070 | DF 11 F0 69 B5 CF 5C 72 DE 7D 04 E8 A9 CD 44 27
|
|
|
|
|
0080 | 7D A7 0A B4 68 8C BF 5D A9 86 6D 5A 09 91 63 EE
|
|
|
|
|
0090 | 81 EA D2 CD 9A A9 AF 00 E3 BB 69 94 48 26 E6 07
|
|
|
|
|
00A0 | E5 9A 78 43 56 20 D0 84 EF 1D 0A 45 70 87 A9 8F
|
|
|
|
|
00B0 | 50 80 F8 AA E6 9C BA 11 0C C8 3B 31 B9 FC 18 E7
|
|
|
|
|
00C0 | 15 49 59 FB 1B 2F 38 50 EE 0F 09 18 2D 74 EC CA
|
|
|
|
|
00D0 | 03 D1 86 67 BC 62 5C 0B D6 B2 E8 F9 FA 6F 4D 6F
|
|
|
|
|
00E0 | 41 33 D5 72 0F 98 07 7D F4 F6 36 30 83 FF 80 86
|
|
|
|
|
00F0 | 0D 53 E3 35 70 AE FC 57 53 93 B0 95 57 F9 3E 83
|
|
|
|
|
0100 | D7 6A 12 0D 0B 06 82 C6 2C DC 20 FD 88 D6 7D 0E
|
|
|
|
|
0110 | E9 2D A0 FB 05 C7 BC 22 C8 CE 52 34 C7 7C 1E 4B
|
|
|
|
|
0120 | CC EA 67 38 86 75 30 9D F2 DF 83 70 61 1A 06 22</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 = BA0D89B5D4C39F0A0CE2408D537C91DC359D6320183CC876B024215D4B9FF42966910A9
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>D4C39F0A0CE2408D537C91DC359D6320</code></td>
|
|
|
|
|
<td><code>24E5EC8F7878D3002935AF0612850CBC</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>183CC876B024215D4B9FF42966910A96</code></td>
|
|
|
|
|
<td><code>4F96A42F9406107884FAA9F9693065C6</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE0001006285A925AFD0126C873715D1</code> <code>E0F1E728B28CC816381BD32642E0D41E</code> <code>DC88E929BBCEA49D45E3D1B5B9B237D1</code> <code>89EA4A7F13228F1ED508BD0DB548687E</code> <code>31BC6D1199AD292C747F09C190AB0224</code> <code>B7F110A15F82848B2D6EB855B70DD0BF</code> <code>7CC1559A6254B4ABFCF6F234BC11BA75</code> <code>08425CC368BB22A0D3C055981C3D9320</code> <code>57B7B6B09426FE6DF1B7387590DFFC7C</code> <code>E1CFECFAFBF2A211E34077788F9B0D84</code> <code>CB89E556B31AA8A2848F950E8FE05040</code> <code>20696364D946989D3BF85BF349EC1E7C</code> <code>92A9A872910844DA4F3065EBB324D3D6</code> <code>5274B489A44F18ACDA84CFB4CD30B8FD</code> <code>9E81DC5D9D2F69EF1305F10CB8F52B2B</code> <code>2E58863D01A70D3A055066990CD2CD12</code><br> <code>9A1C5DEC</code></td>
|
|
|
|
|
<td><code>FE00010087603BA669EDAA7EDA577182</code> <code>0DE64E1261C258C0C5F22910AF325C20</code> <code>17DEA674BE11E3E394EEAA874FB94804</code> <code>3A12269B927881A6D6BA817015C79F51</code> <code>C2140C78DF11F069B5CF5C72DE7D04E8</code> <code>A9CD44277DA70AB4688CBF5DA9866D5A</code> <code>099163EE81EAD2CD9AA9AF00E3BB6994</code> <code>4826E607E59A78435620D084EF1D0A45</code> <code>7087A98F5080F8AAE69CBA110CC83B31</code> <code>B9FC18E7154959FB1B2F3850EE0F0918</code> <code>2D74ECCA03D18667BC625C0BD6B2E8F9</code> <code>FA6F4D6F4133D5720F98077DF4F63630</code> <code>83FF80860D53E33570AEFC575393B095</code> <code>57F93E83D76A120D0B0682C62CDC20FD</code> <code>88D67D0EE92DA0FB05C7BC22C8CE5234</code> <code>C77C1E4BCCEA67388675309DF2DF8370</code><br> <code>611A0622</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 = BA0D89B5D4C39F0A0CE2408D537C91DC359D6320183CC876B024215D4B9FF42966910A9
|
|
|
|
|
<!-- 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 = 54B64366D4C39F0A0CE2408D537C91DC359D6320183CC876B024215D4B9FF42966910A960000000000000000FE0001006285A925AFD0126C873715D1E0F1E728B28CC816381BD32642E0D41EDC88E929BBCEA49D45E3D1B5B9B237D189EA4A7F13228F1ED508BD0DB548687E31BC6D1199AD292C747F09C190AB0224B7F110A15F82848B2D6EB855B70DD0BF7CC1559A6254B4ABFCF6F234BC11BA7508425CC368BB22A0D3C055981C3D932057B7B6B09426FE6DF1B7387590DFFC7CE1CFECFAFBF2A211E34077788F9B0D84CB89E556B31AA8A2848F950E8FE0504020696364D946989D3BF85BF349EC1E7C92A9A872910844DA4F3065EBB324D3D65274B489A44F18ACDA84CFB4CD30B8FD9E81DC5D9D2F69EF1305F10CB8F52B2B2E58863D01A70D3A055066990CD2CD129A1C5DEC
|
|
|
|
|
padding = 1956BD3D088DF02756EB7157
|
|
|
|
|
tmp_aes_key = 669395D66EE9A717398173BA8A55287C6503F4AF4D43DF48D39E9FD0CD07E914
|
|
|
|
|
tmp_aes_iv = 70991BA30BC241AD98B9D948961E747E214FB81262811620640D2FE8EAEC6E0F</code></pre>
|
|
|
|
|
<pre><code>data = 54B6436624E5EC8F7878D3002935AF0612850CBC4F96A42F9406107884FAA9F9693065C60000000000000000FE00010087603BA669EDAA7EDA5771820DE64E1261C258C0C5F22910AF325C2017DEA674BE11E3E394EEAA874FB948043A12269B927881A6D6BA817015C79F51C2140C78DF11F069B5CF5C72DE7D04E8A9CD44277DA70AB4688CBF5DA9866D5A099163EE81EAD2CD9AA9AF00E3BB69944826E607E59A78435620D084EF1D0A457087A98F5080F8AAE69CBA110CC83B31B9FC18E7154959FB1B2F3850EE0F09182D74ECCA03D18667BC625C0BD6B2E8F9FA6F4D6F4133D5720F98077DF4F6363083FF80860D53E33570AEFC575393B09557F93E83D76A120D0B0682C62CDC20FD88D67D0EE92DA0FB05C7BC22C8CE5234C77C1E4BCCEA67388675309DF2DF8370611A0622
|
|
|
|
|
padding = 32C51D103308D12E9CCCFAF0
|
|
|
|
|
tmp_aes_key = CBA34A0CA23CAE390443B17C123E1B2BCF07DCAC91C9376B31C61A33C610D388
|
|
|
|
|
tmp_aes_iv = 850ACE6466B4ECEA638E5E2A95460BF82F296AB589EE07EABFBC7821939496C1</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 = 6ABCD1667E5FAE53230E0CD58630827E1824C9107BEE371D40CA38A867779A41FDB4D997E88A3DC17F12E76096A1B4190D312C273F5FC600F37C75DD827F1A1901ADB4C72C0FE2D64A7DDF8E01F10A0F949547AB40A6B4634D83AF7B69C3D8F3EEE6D851A723CF8894D9B6D1751335B85F83183C0F784BC14B7EA8C469C6929A77B1EF44AB2F8356AE0B7348DDD5EDF89FB9EB0373A287C18DE6277F03447A95DCAE30DA4CEF8D2E6C9EBE910E5D80ACC47AA3C300A2C4B69F1818036E7AD41978098A33F2208FEA45273B6C256F1C2CB501F92F19AC3F4D1E2BDFD11081D9C6BFA43F7F503D8F85359A0D5400D8E5EDBA3D15755573A8110484B1C05A380B4B6A004D4C76B4D8ADE8F8F748B8CF49AB56E3F4FAEEFC49DF4516D54A579F32C5C6C6E1065982F108FB17B2475FBB4853C6906CB9C26E49174F5DAFEC5DCF0E189B72AB12C0F2127E256097F6A2546D06</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 862919CE4F2082655DC74AD048BF070105F99A5C60443A39EDF17DC04EDA48D02D2A1CE5DA95F6DFE47F442D730B283AE1A9A5C9348F743E50D58EACADC15206F72A3E1FFCFDABC326F0919B7AA1AA540ED837220E16F59B651CE68D023629D3C87B74C30F612A828424E567CCC10D2E3ABEAEB41E54513FBD1EDC30F6740FBA1DFF5C615270BEDBF6358F4E516439C6BC60ADBFCB7A9C45C6BA8D42E71596A557EE469AB3FA2DB465A9FA3FDFD0402E4EC3968828AB0DF197198CCB10010A8B27463B388135401BBF2DA00CB54053A2120CCEBE6847813688D3CA49BBEE67FC60F43A77797A9CB33B68D5DA0452982999642FCDBA997ACBEB7B69C7AC91B23D7733D842B622ADF59E9073D1271734534A94E4EBE43ED9C082BC73E723E8852B1AC73DA03EB3139EDE1C20D50AEEFE3DA08A6221EF18B1520016579D6E8B94BE682D2534B4C252E550C274C169A0BE7C</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 14 E5 0D 00 1A C6 96 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 D4 C3 9F 0A 0C E2 40 8D
|
|
|
|
|
0020 | 53 7C 91 DC 35 9D 63 20 18 3C C8 76 B0 24 21 5D
|
|
|
|
|
0030 | 4B 9F F4 29 66 91 0A 96 FE 50 01 00 6A BC D1 66
|
|
|
|
|
0040 | 7E 5F AE 53 23 0E 0C D5 86 30 82 7E 18 24 C9 10
|
|
|
|
|
0050 | 7B EE 37 1D 40 CA 38 A8 67 77 9A 41 FD B4 D9 97
|
|
|
|
|
0060 | E8 8A 3D C1 7F 12 E7 60 96 A1 B4 19 0D 31 2C 27
|
|
|
|
|
0070 | 3F 5F C6 00 F3 7C 75 DD 82 7F 1A 19 01 AD B4 C7
|
|
|
|
|
0080 | 2C 0F E2 D6 4A 7D DF 8E 01 F1 0A 0F 94 95 47 AB
|
|
|
|
|
0090 | 40 A6 B4 63 4D 83 AF 7B 69 C3 D8 F3 EE E6 D8 51
|
|
|
|
|
00A0 | A7 23 CF 88 94 D9 B6 D1 75 13 35 B8 5F 83 18 3C
|
|
|
|
|
00B0 | 0F 78 4B C1 4B 7E A8 C4 69 C6 92 9A 77 B1 EF 44
|
|
|
|
|
00C0 | AB 2F 83 56 AE 0B 73 48 DD D5 ED F8 9F B9 EB 03
|
|
|
|
|
00D0 | 73 A2 87 C1 8D E6 27 7F 03 44 7A 95 DC AE 30 DA
|
|
|
|
|
00E0 | 4C EF 8D 2E 6C 9E BE 91 0E 5D 80 AC C4 7A A3 C3
|
|
|
|
|
00F0 | 00 A2 C4 B6 9F 18 18 03 6E 7A D4 19 78 09 8A 33
|
|
|
|
|
0100 | F2 20 8F EA 45 27 3B 6C 25 6F 1C 2C B5 01 F9 2F
|
|
|
|
|
0110 | 19 AC 3F 4D 1E 2B DF D1 10 81 D9 C6 BF A4 3F 7F
|
|
|
|
|
0120 | 50 3D 8F 85 35 9A 0D 54 00 D8 E5 ED BA 3D 15 75
|
|
|
|
|
0130 | 55 73 A8 11 04 84 B1 C0 5A 38 0B 4B 6A 00 4D 4C
|
|
|
|
|
0140 | 76 B4 D8 AD E8 F8 F7 48 B8 CF 49 AB 56 E3 F4 FA
|
|
|
|
|
0150 | EE FC 49 DF 45 16 D5 4A 57 9F 32 C5 C6 C6 E1 06
|
|
|
|
|
0160 | 59 82 F1 08 FB 17 B2 47 5F BB 48 53 C6 90 6C B9
|
|
|
|
|
0170 | C2 6E 49 17 4F 5D AF EC 5D CF 0E 18 9B 72 AB 12
|
|
|
|
|
0180 | C0 F2 12 7E 25 60 97 F6 A2 54 6D 06</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 98 68 0D 00 7A C9 96 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 24 E5 EC 8F 78 78 D3 00
|
|
|
|
|
0020 | 29 35 AF 06 12 85 0C BC 4F 96 A4 2F 94 06 10 78
|
|
|
|
|
0030 | 84 FA A9 F9 69 30 65 C6 FE 50 01 00 86 29 19 CE
|
|
|
|
|
0040 | 4F 20 82 65 5D C7 4A D0 48 BF 07 01 05 F9 9A 5C
|
|
|
|
|
0050 | 60 44 3A 39 ED F1 7D C0 4E DA 48 D0 2D 2A 1C E5
|
|
|
|
|
0060 | DA 95 F6 DF E4 7F 44 2D 73 0B 28 3A E1 A9 A5 C9
|
|
|
|
|
0070 | 34 8F 74 3E 50 D5 8E AC AD C1 52 06 F7 2A 3E 1F
|
|
|
|
|
0080 | FC FD AB C3 26 F0 91 9B 7A A1 AA 54 0E D8 37 22
|
|
|
|
|
0090 | 0E 16 F5 9B 65 1C E6 8D 02 36 29 D3 C8 7B 74 C3
|
|
|
|
|
00A0 | 0F 61 2A 82 84 24 E5 67 CC C1 0D 2E 3A BE AE B4
|
|
|
|
|
00B0 | 1E 54 51 3F BD 1E DC 30 F6 74 0F BA 1D FF 5C 61
|
|
|
|
|
00C0 | 52 70 BE DB F6 35 8F 4E 51 64 39 C6 BC 60 AD BF
|
|
|
|
|
00D0 | CB 7A 9C 45 C6 BA 8D 42 E7 15 96 A5 57 EE 46 9A
|
|
|
|
|
00E0 | B3 FA 2D B4 65 A9 FA 3F DF D0 40 2E 4E C3 96 88
|
|
|
|
|
00F0 | 28 AB 0D F1 97 19 8C CB 10 01 0A 8B 27 46 3B 38
|
|
|
|
|
0100 | 81 35 40 1B BF 2D A0 0C B5 40 53 A2 12 0C CE BE
|
|
|
|
|
0110 | 68 47 81 36 88 D3 CA 49 BB EE 67 FC 60 F4 3A 77
|
|
|
|
|
0120 | 79 7A 9C B3 3B 68 D5 DA 04 52 98 29 99 64 2F CD
|
|
|
|
|
0130 | BA 99 7A CB EB 7B 69 C7 AC 91 B2 3D 77 33 D8 42
|
|
|
|
|
0140 | B6 22 AD F5 9E 90 73 D1 27 17 34 53 4A 94 E4 EB
|
|
|
|
|
0150 | E4 3E D9 C0 82 BC 73 E7 23 E8 85 2B 1A C7 3D A0
|
|
|
|
|
0160 | 3E B3 13 9E DE 1C 20 D5 0A EE FE 3D A0 8A 62 21
|
|
|
|
|
0170 | EF 18 B1 52 00 16 57 9D 6E 8B 94 BE 68 2D 25 34
|
|
|
|
|
0180 | B4 C2 52 E5 50 C2 74 C1 69 A0 BE 7C</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>14E50D001AC69666</code></td>
|
|
|
|
|
<td><code>98680D007AC99666</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>D4C39F0A0CE2408D537C91DC359D6320</code></td>
|
|
|
|
|
<td><code>24E5EC8F7878D3002935AF0612850CBC</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>183CC876B024215D4B9FF42966910A96</code></td>
|
|
|
|
|
<td><code>4F96A42F9406107884FAA9F9693065C6</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE5001006ABCD1667E5FAE53230E0CD5</code> <code>8630827E1824C9107BEE371D40CA38A8</code> <code>67779A41FDB4D997E88A3DC17F12E760</code> <code>96A1B4190D312C273F5FC600F37C75DD</code> <code>827F1A1901ADB4C72C0FE2D64A7DDF8E</code> <code>01F10A0F949547AB40A6B4634D83AF7B</code> <code>69C3D8F3EEE6D851A723CF8894D9B6D1</code> <code>751335B85F83183C0F784BC14B7EA8C4</code> <code>69C6929A77B1EF44AB2F8356AE0B7348</code> <code>DDD5EDF89FB9EB0373A287C18DE6277F</code> <code>03447A95DCAE30DA4CEF8D2E6C9EBE91</code> <code>0E5D80ACC47AA3C300A2C4B69F181803</code> <code>6E7AD41978098A33F2208FEA45273B6C</code> <code>256F1C2CB501F92F19AC3F4D1E2BDFD1</code> <code>1081D9C6BFA43F7F503D8F85359A0D54</code> <code>00D8E5EDBA3D15755573A8110484B1C0</code> <code>5A380B4B6A004D4C76B4D8ADE8F8F748</code> <code>B8CF49AB56E3F4FAEEFC49DF4516D54A</code> <code>579F32C5C6C6E1065982F108FB17B247</code> <code>5FBB4853C6906CB9C26E49174F5DAFEC</code> <code>5DCF0E189B72AB12C0F2127E256097F6</code><br> <code>A2546D06</code></td>
|
|
|
|
|
<td><code>FE500100862919CE4F2082655DC74AD0</code> <code>48BF070105F99A5C60443A39EDF17DC0</code> <code>4EDA48D02D2A1CE5DA95F6DFE47F442D</code> <code>730B283AE1A9A5C9348F743E50D58EAC</code> <code>ADC15206F72A3E1FFCFDABC326F0919B</code> <code>7AA1AA540ED837220E16F59B651CE68D</code> <code>023629D3C87B74C30F612A828424E567</code> <code>CCC10D2E3ABEAEB41E54513FBD1EDC30</code> <code>F6740FBA1DFF5C615270BEDBF6358F4E</code> <code>516439C6BC60ADBFCB7A9C45C6BA8D42</code> <code>E71596A557EE469AB3FA2DB465A9FA3F</code> <code>DFD0402E4EC3968828AB0DF197198CCB</code> <code>10010A8B27463B388135401BBF2DA00C</code> <code>B54053A2120CCEBE6847813688D3CA49</code> <code>BBEE67FC60F43A77797A9CB33B68D5DA</code> <code>0452982999642FCDBA997ACBEB7B69C7</code> <code>AC91B23D7733D842B622ADF59E9073D1</code> <code>271734534A94E4EBE43ED9C082BC73E7</code> <code>23E8852B1AC73DA03EB3139EDE1C20D5</code> <code>0AEEFE3DA08A6221EF18B1520016579D</code> <code>6E8B94BE682D2534B4C252E550C274C1</code><br> <code>69A0BE7C</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 = 5062AB3AAB8D2FD719664CC8F051AB3D8FA92C7A3540472829E33A70A7291C49128728D1B79B646616C20A9A2E9D65996B313A6AA5CEA6F01170BBBC797CF6FF072E21AEFA803DBDD3A74D3A1EC007A9277CA52F7B06FFD202EC15F7F752A3C0A56B9C0F58578751367C2E3D6CD963FDF67DBBCAC7F9F49957B9DC7FABA17246ED68D81B2E30E9905C507A1F61157EDB8DD3B3051F02BE953AA3D66F8C46F6BF414A4CAEE9FF7558BD6EDC9AF1524EBB150B00F53AEDA0DF4B5FDE664E3D2B643344A8FE377CDCDE26A3315535773A262E087AB348F9148B7EA16D8AE5947006B8846DF051DD1BF5EE18FCAEC3EF26E699F6351F02984F5C212E4E9B7B6C4D31</code></pre>
|
|
|
|
|
<pre><code>auth_key = 19E337BEE69A3DC8D9C80E17582C23DEA7F61473290E71A731F93EF1B21D442B94EB1431852DE8BF9066245F5840E9E175197B1B73601993008FC43E017C8CB5ADD6F90DCE3DD0A4C3AAD04CB140CDD99FF8C70F8A876DA54DC7AC91B42450DECF8245E2ABEA235903F71D5B41488798909C2B102B53AFAFBD05BDAD6C56419AD5928860F288C515187E6F442FB7DD9A63A97189CB8673C2C2DEBBB87D7C3EC7F796030013A8F4716B91FD2B6B14F880150DAD08FC166EC39AE877BCB56FC0E4F4C89886E7FEBB465B33F823618BC3C1A06EFDFC69121307AB44CE034D385A11C0E459AFD82BB38C69FDB633A37A5D698D6CA2B082AA67A4093B845AF04C29F3</code></pre>
|
|
|
|
|
<!-- end auth_key -->
|
|
|
|
|
<h5><a class="anchor" href="#9-final-server-reply" id="9-final-server-reply" name="9-final-server-reply"><i class="anchor-icon"></i></a>9) Final server reply</h5>
|
|
|
|
|
<p>The server verifies and confirms that auth_key_hash is unique: since it's unique, it replies with the following:</p>
|
|
|
|
|
<!-- start dh_gen_ok -->
|
|
|
|
|
<p>Received payload (excluding transport headers/trailers):</p>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 A4 4A 62 1C C6 96 66
|
|
|
|
|
0010 | 84 00 00 00 34 F7 CB 3B D4 C3 9F 0A 0C E2 40 8D
|
|
|
|
|
0020 | 53 7C 91 DC 35 9D 63 20 18 3C C8 76 B0 24 21 5D
|
|
|
|
|
0030 | 4B 9F F4 29 66 91 0A 96 6C 3D 1A 01 48 70 8B C3
|
|
|
|
|
0040 | F3 9D 84 92 BC EF 03 B7</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 FC ED 25 7B C9 96 66
|
|
|
|
|
0010 | 84 00 00 00 34 F7 CB 3B 24 E5 EC 8F 78 78 D3 00
|
|
|
|
|
0020 | 29 35 AF 06 12 85 0C BC 4F 96 A4 2F 94 06 10 78
|
|
|
|
|
0030 | 84 FA A9 F9 69 30 65 C6 9B 7C A5 9C 50 F6 67 FD
|
|
|
|
|
0040 | 2E 29 1A 1A 2F 14 53 97</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,7 +817,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>01A44A621CC69666</code></td>
|
|
|
|
|
<td><code>01FCED257BC99666</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>
|
|
|
|
@ -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>D4C39F0A0CE2408D537C91DC359D6320</code></td>
|
|
|
|
|
<td><code>24E5EC8F7878D3002935AF0612850CBC</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>183CC876B024215D4B9FF42966910A96</code></td>
|
|
|
|
|
<td><code>4F96A42F9406107884FAA9F9693065C6</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>6C3D1A0148708BC3F39D8492BCEF03B7</code></td>
|
|
|
|
|
<td><code>9B7CA59C50F667FD2E291A1A2F145397</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>
|
|
|
|
|