|
|
|
@ -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 6C 49 09 00 95 3A 10 65
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 90 D8 79 C3 24 02 82 E2
|
|
|
|
|
0020 | 1D BC B0 AF 74 2D C8 51</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 5C 07 05 00 0B 41 11 65
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 34 C2 2C 89 AC BA 6B D3
|
|
|
|
|
0020 | EF 3D 6A 35 D4 6B FF 0C</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>6C490900953A1065</code></td>
|
|
|
|
|
<td><code>5C0705000B411165</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>90D879C3240282E21DBCB0AF742DC851</code></td>
|
|
|
|
|
<td><code>34C22C89ACBA6BD3EF3D6A35D46BFF0C</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 B8 58 75 95 3A 10 65
|
|
|
|
|
0010 | 90 00 00 00 63 24 16 05 90 D8 79 C3 24 02 82 E2
|
|
|
|
|
0020 | 1D BC B0 AF 74 2D C8 51 16 54 35 C2 45 F3 8B 9E
|
|
|
|
|
0030 | 79 9A 87 47 25 06 FC B1 08 1B 7F F2 E1 1A A5 F9
|
|
|
|
|
0040 | B9 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 B8 5D 93 0B 41 11 65
|
|
|
|
|
0010 | A8 00 00 00 63 24 16 05 34 C2 2C 89 AC BA 6B D3
|
|
|
|
|
0020 | EF 3D 6A 35 D4 6B FF 0C 26 62 50 C7 7D 07 AE AA
|
|
|
|
|
0030 | 41 9A CB FB E4 FF 04 56 08 24 36 75 30 78 66 68
|
|
|
|
|
0040 | 7B 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>01B85875953A1065</code></td>
|
|
|
|
|
<td><code>01B85D930B411165</code></td>
|
|
|
|
|
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_length</td>
|
|
|
|
|
<td>16, 4</td>
|
|
|
|
|
<td><code>90000000</code> (144 in decimal)</td>
|
|
|
|
|
<td><code>A8000000</code> (168 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>90D879C3240282E21DBCB0AF742DC851</code></td>
|
|
|
|
|
<td><code>34C22C89ACBA6BD3EF3D6A35D46BFF0C</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>165435C245F38B9E799A87472506FCB1</code></td>
|
|
|
|
|
<td><code>266250C77D07AEAA419ACBFBE4FF0456</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>081B7FF2E11AA5F9B9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1981569409694955961</td>
|
|
|
|
|
<td><code>08243675307866687B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2609401885146638459</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--q" id="3-client-decomposes-pq-into-prime-factors-such-that-p--q" name="3-client-decomposes-pq-into-prime-factors-such-that-p--q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p < q.</h5>
|
|
|
|
|
<!-- start pq -->
|
|
|
|
|
<pre><code>pq = 1981569409694955961</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1981569409694955961 = 1242379883 * 1594978667</code></p>
|
|
|
|
|
<pre><code>p = 1242379883
|
|
|
|
|
q = 1594978667</code></pre>
|
|
|
|
|
<pre><code>pq = 2609401885146638459</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2609401885146638459 = 1345418807 * 1939471837</code></p>
|
|
|
|
|
<pre><code>p = 1345418807
|
|
|
|
|
q = 1939471837</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 1B 7F F2 E1 1A A5 F9 B9 00 00 00
|
|
|
|
|
0010 | 04 4A 0D 36 6B 00 00 00 04 5F 11 71 6B 00 00 00
|
|
|
|
|
0020 | 90 D8 79 C3 24 02 82 E2 1D BC B0 AF 74 2D C8 51
|
|
|
|
|
0030 | 16 54 35 C2 45 F3 8B 9E 79 9A 87 47 25 06 FC B1
|
|
|
|
|
0040 | 89 27 C1 C1 FF 91 6F F1 94 1F 0E 8C 5B 20 77 A6
|
|
|
|
|
0050 | 59 16 8F 0D 64 B8 9B 29 68 E4 25 2B C7 A7 07 4D
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 24 36 75 30 78 66 68 7B 00 00 00
|
|
|
|
|
0010 | 04 50 31 76 37 00 00 00 04 73 99 FD DD 00 00 00
|
|
|
|
|
0020 | 34 C2 2C 89 AC BA 6B D3 EF 3D 6A 35 D4 6B FF 0C
|
|
|
|
|
0030 | 26 62 50 C7 7D 07 AE AA 41 9A CB FB E4 FF 04 56
|
|
|
|
|
0040 | A0 C1 F2 BE 20 70 FD 46 30 D2 CA 01 DF D6 94 7D
|
|
|
|
|
0050 | 9D E0 B6 DF DE 01 5A 06 4F EF 9D F2 98 6B 99 EF
|
|
|
|
|
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 = 1594978667</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>081B7FF2E11AA5F9B9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1981569409694955961</td>
|
|
|
|
|
<td><code>08243675307866687B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2609401885146638459</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>044A0D366B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1242379883</td>
|
|
|
|
|
<td><code>0450317637000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1345418807</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>045F11716B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1594978667</td>
|
|
|
|
|
<td><code>047399FDDD000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1939471837</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>90D879C3240282E21DBCB0AF742DC851</code></td>
|
|
|
|
|
<td><code>34C22C89ACBA6BD3EF3D6A35D46BFF0C</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>165435C245F38B9E799A87472506FCB1</code></td>
|
|
|
|
|
<td><code>266250C77D07AEAA419ACBFBE4FF0456</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>8927C1C1FF916FF1941F0E8C5B2077A6</code> <code>59168F0D64B89B2968E4252BC7A7074D</code></td>
|
|
|
|
|
<td><code>A0C1F2BE2070FD4630D2CA01DFD6947D</code> <code>9DE0B6DFDE015A064FEF9DF2986B99EF</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1594978667</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 = 955FF5A9081B7FF2E11AA5F9B9000000044A0D366B000000045F11716B00000090D879C3240282E21DBCB0AF742DC851165435C245F38B9E799A87472506FCB18927C1C1FF916FF1941F0E8C5B2077A659168F0D64B89B2968E4252BC7A7074D02000000
|
|
|
|
|
random_padding_bytes = A85F68D2D1B18E28ADCE2DA2C802450BE49E3C336C38C81AF8160D92C7F44E87BCDF78EFE47E9E8923DC64A3CDA271B9DD4BDA1732A4BD291658A8312DEDA773BDDF718367293E3B20C61E78B5B52A85EC8FA325DFA2C3614CE0E329</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A908243675307866687B0000000450317637000000047399FDDD00000034C22C89ACBA6BD3EF3D6A35D46BFF0C266250C77D07AEAA419ACBFBE4FF0456A0C1F2BE2070FD4630D2CA01DFD6947D9DE0B6DFDE015A064FEF9DF2986B99EF02000000
|
|
|
|
|
random_padding_bytes = C712BC7B338B2B1D7E704A6F020D0433709717EF06D09DA7767EFE121B2C176C60630118C7A2777C5A751DA518C78B39F64A1C96604A6E00BDF43394349E0E6042B37C2A7C68DE7DC9598DA991F26CFFED15E24C613A3EF33307B213</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 = 31DE4E3367F55268D6C95CADB59F1199EDB10241BD1EAEAEACFD4A6209CFB7C3229F2207DE25D33FF7F0B6DFE3FC2FF59D0894DB4B0723CD5DB1A9F28E26484C85C06DEAE6060E55AF1E3280B1A788EA66DB221ACC11184EF99AE09F47806E45A0A84B8AD1310C76AD7FDA3FDE5155374CBD4BA7E01788EECBA55DC79D92179A39AD3759E8C111016DADBD0B47FA74800E650F408626D205A3AF5BA498C8527A1B643F6346D3D909DC73EF3960AC60D8F0A7B01D204A7F098F85339F4FFCEF81C33B2E9C891AC2812BDAF654B876492C01EC13E1292ACB307278EC24176A0F475835DB1A0A33D24E4499E65D7C1F9FE345F47D6353B7A39C7B516D4A38E71677</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 8991C17AAE66F37DEFA99E6CCD81A852A03FCF2D02F9663D60DAC341152C6D9DFDA462B0737D6254568A2F6A97E397E13DDADF19CDAEFC27A9373B67101A957405C0259B529EC5BDFEEC34116465A23A49C98388E5B4322257DD269B1D569A57C753A75F202BD3F4D1C6831FA83C8243F65B750AE8A2FD598CEDF9AFE8EDBA1EC7A8438E2F710C972ABA00FC8CD0FAA585B1B1C06C2A4EA5DFD1144E0C5E1E252FFACE01693ED3548305ABBE584EEEAE32B86DB378E65C43C3FB02D5593ADE49E8DBD8DDB9647FB1D5FD66BCD96A9BF989334675664EB0C257ED996BC3FF1002282CD8BF645AB3FFD724028E618106E9CDE7FB1015B56C89CC77E77E0295AFDF</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 70 49 09 00 95 3A 10 65
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 90 D8 79 C3 24 02 82 E2
|
|
|
|
|
0020 | 1D BC B0 AF 74 2D C8 51 16 54 35 C2 45 F3 8B 9E
|
|
|
|
|
0030 | 79 9A 87 47 25 06 FC B1 04 4A 0D 36 6B 00 00 00
|
|
|
|
|
0040 | 04 5F 11 71 6B 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 31 DE 4E 33 67 F5 52 68 D6 C9 5C AD
|
|
|
|
|
0060 | B5 9F 11 99 ED B1 02 41 BD 1E AE AE AC FD 4A 62
|
|
|
|
|
0070 | 09 CF B7 C3 22 9F 22 07 DE 25 D3 3F F7 F0 B6 DF
|
|
|
|
|
0080 | E3 FC 2F F5 9D 08 94 DB 4B 07 23 CD 5D B1 A9 F2
|
|
|
|
|
0090 | 8E 26 48 4C 85 C0 6D EA E6 06 0E 55 AF 1E 32 80
|
|
|
|
|
00A0 | B1 A7 88 EA 66 DB 22 1A CC 11 18 4E F9 9A E0 9F
|
|
|
|
|
00B0 | 47 80 6E 45 A0 A8 4B 8A D1 31 0C 76 AD 7F DA 3F
|
|
|
|
|
00C0 | DE 51 55 37 4C BD 4B A7 E0 17 88 EE CB A5 5D C7
|
|
|
|
|
00D0 | 9D 92 17 9A 39 AD 37 59 E8 C1 11 01 6D AD BD 0B
|
|
|
|
|
00E0 | 47 FA 74 80 0E 65 0F 40 86 26 D2 05 A3 AF 5B A4
|
|
|
|
|
00F0 | 98 C8 52 7A 1B 64 3F 63 46 D3 D9 09 DC 73 EF 39
|
|
|
|
|
0100 | 60 AC 60 D8 F0 A7 B0 1D 20 4A 7F 09 8F 85 33 9F
|
|
|
|
|
0110 | 4F FC EF 81 C3 3B 2E 9C 89 1A C2 81 2B DA F6 54
|
|
|
|
|
0120 | B8 76 49 2C 01 EC 13 E1 29 2A CB 30 72 78 EC 24
|
|
|
|
|
0130 | 17 6A 0F 47 58 35 DB 1A 0A 33 D2 4E 44 99 E6 5D
|
|
|
|
|
0140 | 7C 1F 9F E3 45 F4 7D 63 53 B7 A3 9C 7B 51 6D 4A
|
|
|
|
|
0150 | 38 E7 16 77</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 C0 46 05 00 0B 41 11 65
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 34 C2 2C 89 AC BA 6B D3
|
|
|
|
|
0020 | EF 3D 6A 35 D4 6B FF 0C 26 62 50 C7 7D 07 AE AA
|
|
|
|
|
0030 | 41 9A CB FB E4 FF 04 56 04 50 31 76 37 00 00 00
|
|
|
|
|
0040 | 04 73 99 FD DD 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 89 91 C1 7A AE 66 F3 7D EF A9 9E 6C
|
|
|
|
|
0060 | CD 81 A8 52 A0 3F CF 2D 02 F9 66 3D 60 DA C3 41
|
|
|
|
|
0070 | 15 2C 6D 9D FD A4 62 B0 73 7D 62 54 56 8A 2F 6A
|
|
|
|
|
0080 | 97 E3 97 E1 3D DA DF 19 CD AE FC 27 A9 37 3B 67
|
|
|
|
|
0090 | 10 1A 95 74 05 C0 25 9B 52 9E C5 BD FE EC 34 11
|
|
|
|
|
00A0 | 64 65 A2 3A 49 C9 83 88 E5 B4 32 22 57 DD 26 9B
|
|
|
|
|
00B0 | 1D 56 9A 57 C7 53 A7 5F 20 2B D3 F4 D1 C6 83 1F
|
|
|
|
|
00C0 | A8 3C 82 43 F6 5B 75 0A E8 A2 FD 59 8C ED F9 AF
|
|
|
|
|
00D0 | E8 ED BA 1E C7 A8 43 8E 2F 71 0C 97 2A BA 00 FC
|
|
|
|
|
00E0 | 8C D0 FA A5 85 B1 B1 C0 6C 2A 4E A5 DF D1 14 4E
|
|
|
|
|
00F0 | 0C 5E 1E 25 2F FA CE 01 69 3E D3 54 83 05 AB BE
|
|
|
|
|
0100 | 58 4E EE AE 32 B8 6D B3 78 E6 5C 43 C3 FB 02 D5
|
|
|
|
|
0110 | 59 3A DE 49 E8 DB D8 DD B9 64 7F B1 D5 FD 66 BC
|
|
|
|
|
0120 | D9 6A 9B F9 89 33 46 75 66 4E B0 C2 57 ED 99 6B
|
|
|
|
|
0130 | C3 FF 10 02 28 2C D8 BF 64 5A B3 FF D7 24 02 8E
|
|
|
|
|
0140 | 61 81 06 E9 CD E7 FB 10 15 B5 6C 89 CC 77 E7 7E
|
|
|
|
|
0150 | 02 95 AF DF</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 = A85F68D2D1B18E28ADCE2DA2C802450BE49E3C336C38C81AF8160D92C
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>70490900953A1065</code></td>
|
|
|
|
|
<td><code>C04605000B411165</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 = A85F68D2D1B18E28ADCE2DA2C802450BE49E3C336C38C81AF8160D92C
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>90D879C3240282E21DBCB0AF742DC851</code></td>
|
|
|
|
|
<td><code>34C22C89ACBA6BD3EF3D6A35D46BFF0C</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>165435C245F38B9E799A87472506FCB1</code></td>
|
|
|
|
|
<td><code>266250C77D07AEAA419ACBFBE4FF0456</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>044A0D366B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1242379883</td>
|
|
|
|
|
<td><code>0450317637000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1345418807</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>045F11716B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1594978667</td>
|
|
|
|
|
<td><code>047399FDDD000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1939471837</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 = A85F68D2D1B18E28ADCE2DA2C802450BE49E3C336C38C81AF8160D92C
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE00010031DE4E3367F55268D6C95CAD</code> <code>B59F1199EDB10241BD1EAEAEACFD4A62</code> <code>09CFB7C3229F2207DE25D33FF7F0B6DF</code> <code>E3FC2FF59D0894DB4B0723CD5DB1A9F2</code> <code>8E26484C85C06DEAE6060E55AF1E3280</code> <code>B1A788EA66DB221ACC11184EF99AE09F</code> <code>47806E45A0A84B8AD1310C76AD7FDA3F</code> <code>DE5155374CBD4BA7E01788EECBA55DC7</code> <code>9D92179A39AD3759E8C111016DADBD0B</code> <code>47FA74800E650F408626D205A3AF5BA4</code> <code>98C8527A1B643F6346D3D909DC73EF39</code> <code>60AC60D8F0A7B01D204A7F098F85339F</code> <code>4FFCEF81C33B2E9C891AC2812BDAF654</code> <code>B876492C01EC13E1292ACB307278EC24</code> <code>176A0F475835DB1A0A33D24E4499E65D</code> <code>7C1F9FE345F47D6353B7A39C7B516D4A</code><br> <code>38E71677</code></td>
|
|
|
|
|
<td><code>FE0001008991C17AAE66F37DEFA99E6C</code> <code>CD81A852A03FCF2D02F9663D60DAC341</code> <code>152C6D9DFDA462B0737D6254568A2F6A</code> <code>97E397E13DDADF19CDAEFC27A9373B67</code> <code>101A957405C0259B529EC5BDFEEC3411</code> <code>6465A23A49C98388E5B4322257DD269B</code> <code>1D569A57C753A75F202BD3F4D1C6831F</code> <code>A83C8243F65B750AE8A2FD598CEDF9AF</code> <code>E8EDBA1EC7A8438E2F710C972ABA00FC</code> <code>8CD0FAA585B1B1C06C2A4EA5DFD1144E</code> <code>0C5E1E252FFACE01693ED3548305ABBE</code> <code>584EEEAE32B86DB378E65C43C3FB02D5</code> <code>593ADE49E8DBD8DDB9647FB1D5FD66BC</code> <code>D96A9BF989334675664EB0C257ED996B</code> <code>C3FF1002282CD8BF645AB3FFD724028E</code> <code>618106E9CDE7FB1015B56C89CC77E77E</code><br> <code>0295AFDF</code></td>
|
|
|
|
|
<td>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = A85F68D2D1B18E28ADCE2DA2C802450BE49E3C336C38C81AF8160D92C
|
|
|
|
|
<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 D0 41 28 96 3A 10 65
|
|
|
|
|
0010 | 80 02 00 00 5C 07 E8 D0 90 D8 79 C3 24 02 82 E2
|
|
|
|
|
0020 | 1D BC B0 AF 74 2D C8 51 16 54 35 C2 45 F3 8B 9E
|
|
|
|
|
0030 | 79 9A 87 47 25 06 FC B1 FE 50 02 00 3B CE 33 4A
|
|
|
|
|
0040 | 6D 6B 40 17 58 C7 66 8A 8C 54 F8 8D 27 07 24 27
|
|
|
|
|
0050 | BA 14 71 E4 1D 46 7E 69 2F 91 2E 55 FD E1 B0 78
|
|
|
|
|
0060 | 8C EE 73 37 FC C2 F1 8C 19 3D 93 BE 7D D9 AB 21
|
|
|
|
|
0070 | 85 98 A9 05 EC 51 53 66 6B 67 1D 6D DF 81 27 88
|
|
|
|
|
0080 | 23 A9 83 11 56 3C CC 31 F2 8D CB 6B 79 71 56 D8
|
|
|
|
|
0090 | 32 15 A2 F6 6D 23 D1 6E 0B 86 12 6D 21 55 62 3B
|
|
|
|
|
00A0 | 0B 0B AC 41 DC 34 2C 84 89 A4 25 C8 F8 19 04 88
|
|
|
|
|
00B0 | 7A D1 10 39 8B AD 09 78 49 DA 30 72 6C CE EB 1B
|
|
|
|
|
00C0 | 20 B9 47 6C 11 A3 19 1A EB 78 81 35 3A 66 C3 0A
|
|
|
|
|
00D0 | 7F 47 88 18 A5 72 89 45 6F 5B 54 68 2E AF 02 7D
|
|
|
|
|
00E0 | F0 75 39 04 94 C9 7E 57 2E 3C 27 4E 28 51 8D D0
|
|
|
|
|
00F0 | A4 38 F1 CA D0 75 C9 5A 66 82 15 97 B2 0C 85 CE
|
|
|
|
|
0100 | 21 5E 08 DF 25 AC E5 48 51 55 E4 80 0C E4 79 9D
|
|
|
|
|
0110 | 4E 72 26 24 36 DD 22 1C 75 AB CB 1E DA 75 74 48
|
|
|
|
|
0120 | BC 32 F1 70 7C 45 70 0B 13 77 AF 54 3D CE 87 0A
|
|
|
|
|
0130 | FE 85 50 F3 12 E7 E3 5C DA E7 9B 80 B3 73 46 E9
|
|
|
|
|
0140 | F4 60 A9 31 D1 91 54 6D 6F A7 B6 92 9D C3 E1 4E
|
|
|
|
|
0150 | 1C B8 EE 14 B6 CC 3E EA B6 2C 23 20 E5 B7 45 32
|
|
|
|
|
0160 | 21 E6 92 0D 98 D0 6B 1A F2 C8 49 27 12 C3 4C 05
|
|
|
|
|
0170 | FE 44 1C B0 54 F0 91 F0 A7 DA 9E 2E 15 95 FB B0
|
|
|
|
|
0180 | BE 34 AE D8 43 BE DA 43 E7 3E 55 BC 2E AB F2 EA
|
|
|
|
|
0190 | 0F 30 90 96 54 3D BA 47 2B 70 E9 3F A7 30 79 7E
|
|
|
|
|
01A0 | 2E 88 8F 94 9F E2 B9 69 9A 34 2A 52 E1 4F E0 B4
|
|
|
|
|
01B0 | 97 0F EE 24 F6 FC 87 26 72 38 23 82 F9 B2 A3 4A
|
|
|
|
|
01C0 | 33 A4 12 4B 2F 41 2A B5 78 ED 6A F0 7D 52 13 21
|
|
|
|
|
01D0 | 82 E7 FE D2 F0 0C A6 D6 CF D2 F6 1C 88 A0 11 2E
|
|
|
|
|
01E0 | 62 7D D3 48 99 6F 66 63 58 13 E4 AD 1F C4 6C C7
|
|
|
|
|
01F0 | 1C EB D1 7E 7D 07 DF 78 7F 16 9A AF 90 B2 09 E2
|
|
|
|
|
0200 | 9F 97 56 3A B7 70 82 5B FB B2 03 38 3B D9 BF 6A
|
|
|
|
|
0210 | B2 F2 8C 3B 12 23 00 6D 0A F3 62 D1 7C E8 42 DE
|
|
|
|
|
0220 | 63 F3 66 15 13 6C BE D8 D8 2C B9 F8 73 85 53 DD
|
|
|
|
|
0230 | 3F 47 A6 98 BF 47 F3 F4 AC CB CD 47 30 AE 1A 3D
|
|
|
|
|
0240 | 70 8A 33 9A B3 3A BA 0D B2 75 E1 F1 B3 80 69 D7
|
|
|
|
|
0250 | E6 A7 C1 DE 89 71 BC 7D 0E 7B 81 33 6F 97 C8 7D
|
|
|
|
|
0260 | 97 8C 6F 0F 79 DA 37 FE 0B 8A DF 77 2E 28 1F FB
|
|
|
|
|
0270 | 74 FE 0F E4 5B 2D 72 37 EF 3F 6C A8 27 2B 77 F0
|
|
|
|
|
0280 | BF 8B EA 11 44 1D C6 A2 EB D3 CB 7E</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 50 C4 45 0C 41 11 65
|
|
|
|
|
0010 | E4 02 00 00 5C 07 E8 D0 34 C2 2C 89 AC BA 6B D3
|
|
|
|
|
0020 | EF 3D 6A 35 D4 6B FF 0C 26 62 50 C7 7D 07 AE AA
|
|
|
|
|
0030 | 41 9A CB FB E4 FF 04 56 FE 50 02 00 34 64 78 87
|
|
|
|
|
0040 | 5C 41 19 83 CD B2 DB 66 F4 07 31 18 27 07 26 CB
|
|
|
|
|
0050 | 42 3E D3 30 96 B2 2D A7 06 C9 4D AE 7E 7D 06 BC
|
|
|
|
|
0060 | 19 D2 02 4F 0A D7 6D 67 FF 79 57 8C B7 0E 3E E0
|
|
|
|
|
0070 | 5A B1 9A BF 7E 9C FC 8C 4C EC 66 F3 6A 5F 6C 5A
|
|
|
|
|
0080 | 49 67 4B F2 3D A7 3D EB D8 C7 1C 46 E9 8D 88 9D
|
|
|
|
|
0090 | 34 49 45 7F AF F8 D5 08 46 1D D8 C8 36 BC D1 02
|
|
|
|
|
00A0 | 6F 14 55 5E 5D 2A 14 FD 8D 2E 31 D8 73 FD BA 2C
|
|
|
|
|
00B0 | 3F 1D 23 26 52 6C 75 2C 84 F8 48 00 12 CD 4C 53
|
|
|
|
|
00C0 | AE 2C 74 D1 1B D5 68 AE E0 2E DD 22 F3 27 69 ED
|
|
|
|
|
00D0 | E5 0F 59 14 F3 34 CB BB C3 FF 44 9C 3F CC 68 18
|
|
|
|
|
00E0 | 49 3C 0A 61 B7 73 90 91 68 93 B0 E6 44 8D DE E8
|
|
|
|
|
00F0 | 82 F4 7C 00 85 CF 31 5B 3E 83 28 17 82 17 A6 B5
|
|
|
|
|
0100 | 6D C8 62 7B 1B 64 DA 3B 15 BC 5F 2F 6C 12 33 9E
|
|
|
|
|
0110 | 34 3F 3E 35 3B 64 74 55 FA ED 6F 88 A3 25 D0 9C
|
|
|
|
|
0120 | A4 5F 0B A1 77 4C A0 68 45 C8 31 DB 78 7E 7C 3D
|
|
|
|
|
0130 | E2 5F 20 5E CF 47 BE 67 35 13 3F AB 74 A0 DB 84
|
|
|
|
|
0140 | 87 21 F9 2A 37 A2 89 9C 43 FF F3 9A EA AC D7 C7
|
|
|
|
|
0150 | 4F 09 96 6F F8 82 A8 B7 3C 98 7F 9F 36 40 30 E6
|
|
|
|
|
0160 | 66 23 33 F5 E5 4D 9D 44 A0 C3 5A F4 BB 49 B2 0C
|
|
|
|
|
0170 | 41 44 72 96 73 7C 5F 13 3D BA DB 68 A5 35 D2 85
|
|
|
|
|
0180 | 4E 4D CF 5E 70 74 5F 51 B6 0F CA D3 6D 84 F8 8A
|
|
|
|
|
0190 | C9 4D 86 AB D5 A2 DA 6D 74 EA 04 44 11 5D AD F3
|
|
|
|
|
01A0 | 83 13 4F CA B6 D7 92 AC 68 AC B2 CC 6A 59 AE BB
|
|
|
|
|
01B0 | 3E 5C 0D 63 78 41 A8 05 BC 02 B5 6B 01 02 15 10
|
|
|
|
|
01C0 | 3A 0E C8 69 69 BB B9 2E 3B 9B C3 C6 4E F8 12 1E
|
|
|
|
|
01D0 | 5F 55 24 F0 1C D5 A3 4A 6F 28 B4 D1 0B 5A 92 01
|
|
|
|
|
01E0 | FA 94 29 A2 7F CC 4F 1F 0B 2D D7 A6 12 21 B9 4B
|
|
|
|
|
01F0 | 89 52 B0 53 FB B3 4C 83 72 DE E7 EA 67 28 AA 69
|
|
|
|
|
0200 | 8F F6 F1 9A DC C3 D8 74 3D B8 5E 0E FB 7E BA EF
|
|
|
|
|
0210 | 77 56 2C 6B 6C 3A A0 AF 96 8B 1B 01 6D 2C B8 7A
|
|
|
|
|
0220 | 55 81 1C 20 6F E7 64 44 98 4E E7 DF DA 43 3D 0E
|
|
|
|
|
0230 | 9A D9 3D F3 99 A4 79 90 BA 4A C3 54 C3 30 C4 F8
|
|
|
|
|
0240 | 57 60 6F 6A 20 AD A6 65 2F 2B 9D 45 47 EB E7 33
|
|
|
|
|
0250 | C4 D0 0F EC 77 1A A4 13 96 C0 E8 36 53 4B 36 AC
|
|
|
|
|
0260 | 46 B6 C7 FD F6 4F F0 0E E9 A5 F2 93 5C 95 C2 92
|
|
|
|
|
0270 | 41 F4 1A AC AA 0A 14 3C 1D E9 D9 D3 4C 36 8F E2
|
|
|
|
|
0280 | AA DC 15 2C 47 F7 7E A4 11 AE F3 97</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 = A85F68D2D1B18E28ADCE2DA2C802450BE49E3C336C38C81AF8160D92C
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>01D04128963A1065</code></td>
|
|
|
|
|
<td><code>0150C4450C411165</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>80020000</code> (640 in decimal)</td>
|
|
|
|
|
<td><code>E4020000</code> (740 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -482,19 +482,19 @@ random_padding_bytes = A85F68D2D1B18E28ADCE2DA2C802450BE49E3C336C38C81AF8160D92C
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>90D879C3240282E21DBCB0AF742DC851</code></td>
|
|
|
|
|
<td><code>34C22C89ACBA6BD3EF3D6A35D46BFF0C</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>165435C245F38B9E799A87472506FCB1</code></td>
|
|
|
|
|
<td><code>266250C77D07AEAA419ACBFBE4FF0456</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE5002003BCE334A6D6B401758C7668A</code> <code>8C54F88D27072427BA1471E41D467E69</code> <code>2F912E55FDE1B0788CEE7337FCC2F18C</code> <code>193D93BE7DD9AB218598A905EC515366</code> <code>6B671D6DDF81278823A98311563CCC31</code> <code>F28DCB6B797156D83215A2F66D23D16E</code> <code>0B86126D2155623B0B0BAC41DC342C84</code> <code>89A425C8F81904887AD110398BAD0978</code> <code>49DA30726CCEEB1B20B9476C11A3191A</code> <code>EB7881353A66C30A7F478818A5728945</code> <code>6F5B54682EAF027DF075390494C97E57</code> <code>2E3C274E28518DD0A438F1CAD075C95A</code> <code>66821597B20C85CE215E08DF25ACE548</code> <code>5155E4800CE4799D4E72262436DD221C</code> <code>75ABCB1EDA757448BC32F1707C45700B</code> <code>1377AF543DCE870AFE8550F312E7E35C</code> <code>DAE79B80B37346E9F460A931D191546D</code> <code>6FA7B6929DC3E14E1CB8EE14B6CC3EEA</code> <code>B62C2320E5B7453221E6920D98D06B1A</code> <code>F2C8492712C34C05FE441CB054F091F0</code> <code>A7DA9E2E1595FBB0BE34AED843BEDA43</code> <code>E73E55BC2EABF2EA0F309096543DBA47</code> <code>2B70E93FA730797E2E888F949FE2B969</code> <code>9A342A52E14FE0B4970FEE24F6FC8726</code> <code>72382382F9B2A34A33A4124B2F412AB5</code> <code>78ED6AF07D52132182E7FED2F00CA6D6</code> <code>CFD2F61C88A0112E627DD348996F6663</code> <code>5813E4AD1FC46CC71CEBD17E7D07DF78</code> <code>7F169AAF90B209E29F97563AB770825B</code> <code>FBB203383BD9BF6AB2F28C3B1223006D</code> <code>0AF362D17CE842DE63F36615136CBED8</code> <code>D82CB9F8738553DD3F47A698BF47F3F4</code> <code>ACCBCD4730AE1A3D708A339AB33ABA0D</code> <code>B275E1F1B38069D7E6A7C1DE8971BC7D</code> <code>0E7B81336F97C87D978C6F0F79DA37FE</code> <code>0B8ADF772E281FFB74FE0FE45B2D7237</code> <code>EF3F6CA8272B77F0BF8BEA11441DC6A2</code><br> <code>EBD3CB7E</code></td>
|
|
|
|
|
<td><code>FE500200346478875C411983CDB2DB66</code> <code>F4073118270726CB423ED33096B22DA7</code> <code>06C94DAE7E7D06BC19D2024F0AD76D67</code> <code>FF79578CB70E3EE05AB19ABF7E9CFC8C</code> <code>4CEC66F36A5F6C5A49674BF23DA73DEB</code> <code>D8C71C46E98D889D3449457FAFF8D508</code> <code>461DD8C836BCD1026F14555E5D2A14FD</code> <code>8D2E31D873FDBA2C3F1D2326526C752C</code> <code>84F8480012CD4C53AE2C74D11BD568AE</code> <code>E02EDD22F32769EDE50F5914F334CBBB</code> <code>C3FF449C3FCC6818493C0A61B7739091</code> <code>6893B0E6448DDEE882F47C0085CF315B</code> <code>3E8328178217A6B56DC8627B1B64DA3B</code> <code>15BC5F2F6C12339E343F3E353B647455</code> <code>FAED6F88A325D09CA45F0BA1774CA068</code> <code>45C831DB787E7C3DE25F205ECF47BE67</code> <code>35133FAB74A0DB848721F92A37A2899C</code> <code>43FFF39AEAACD7C74F09966FF882A8B7</code> <code>3C987F9F364030E6662333F5E54D9D44</code> <code>A0C35AF4BB49B20C41447296737C5F13</code> <code>3DBADB68A535D2854E4DCF5E70745F51</code> <code>B60FCAD36D84F88AC94D86ABD5A2DA6D</code> <code>74EA0444115DADF383134FCAB6D792AC</code> <code>68ACB2CC6A59AEBB3E5C0D637841A805</code> <code>BC02B56B010215103A0EC86969BBB92E</code> <code>3B9BC3C64EF8121E5F5524F01CD5A34A</code> <code>6F28B4D10B5A9201FA9429A27FCC4F1F</code> <code>0B2DD7A61221B94B8952B053FBB34C83</code> <code>72DEE7EA6728AA698FF6F19ADCC3D874</code> <code>3DB85E0EFB7EBAEF77562C6B6C3AA0AF</code> <code>968B1B016D2CB87A55811C206FE76444</code> <code>984EE7DFDA433D0E9AD93DF399A47990</code> <code>BA4AC354C330C4F857606F6A20ADA665</code> <code>2F2B9D4547EBE733C4D00FEC771AA413</code> <code>96C0E836534B36AC46B6C7FDF64FF00E</code> <code>E9A5F2935C95C29241F41AACAA0A143C</code> <code>1DE9D9D34C368FE2AADC152C47F77EA4</code><br> <code>11AEF397</code></td>
|
|
|
|
|
<td>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = A85F68D2D1B18E28ADCE2DA2C802450BE49E3C336C38C81AF8160D92C
|
|
|
|
|
<!-- 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 = 3BCE334A6D6B401758C7668A8C54F88D27072427BA1471E41D467E692F912E55FDE1B0788CEE7337FCC2F18C193D93BE7DD9AB218598A905EC5153666B671D6DDF81278823A98311563CCC31F28DCB6B797156D83215A2F66D23D16E0B86126D2155623B0B0BAC41DC342C8489A425C8F81904887AD110398BAD097849DA30726CCEEB1B20B9476C11A3191AEB7881353A66C30A7F478818A57289456F5B54682EAF027DF075390494C97E572E3C274E28518DD0A438F1CAD075C95A66821597B20C85CE215E08DF25ACE5485155E4800CE4799D4E72262436DD221C75ABCB1EDA757448BC32F1707C45700B1377AF543DCE870AFE8550F312E7E35CDAE79B80B37346E9F460A931D191546D6FA7B6929DC3E14E1CB8EE14B6CC3EEAB62C2320E5B7453221E6920D98D06B1AF2C8492712C34C05FE441CB054F091F0A7DA9E2E1595FBB0BE34AED843BEDA43E73E55BC2EABF2EA0F309096543DBA472B70E93FA730797E2E888F949FE2B9699A342A52E14FE0B4970FEE24F6FC872672382382F9B2A34A33A4124B2F412AB578ED6AF07D52132182E7FED2F00CA6D6CFD2F61C88A0112E627DD348996F66635813E4AD1FC46CC71CEBD17E7D07DF787F169AAF90B209E29F97563AB770825BFBB203383BD9BF6AB2F28C3B1223006D0AF362D17CE842DE63F36615136CBED8D82CB9F8738553DD3F47A698BF47F3F4ACCBCD4730AE1A3D708A339AB33ABA0DB275E1F1B38069D7E6A7C1DE8971BC7D0E7B81336F97C87D978C6F0F79DA37FE0B8ADF772E281FFB74FE0FE45B2D7237EF3F6CA8272B77F0BF8BEA11441DC6A2EBD3CB7E
|
|
|
|
|
tmp_aes_key = 55A9985F8284A35716B50AB1971D0119D8FFEA9F85FDD21EE6C8D6F52549CD2A
|
|
|
|
|
tmp_aes_iv = D9B936BE6EF6B695EF3BA29435EFBE988D0F4A18661881B156254F5D8927C1C1</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = 346478875C411983CDB2DB66F4073118270726CB423ED33096B22DA706C94DAE7E7D06BC19D2024F0AD76D67FF79578CB70E3EE05AB19ABF7E9CFC8C4CEC66F36A5F6C5A49674BF23DA73DEBD8C71C46E98D889D3449457FAFF8D508461DD8C836BCD1026F14555E5D2A14FD8D2E31D873FDBA2C3F1D2326526C752C84F8480012CD4C53AE2C74D11BD568AEE02EDD22F32769EDE50F5914F334CBBBC3FF449C3FCC6818493C0A61B77390916893B0E6448DDEE882F47C0085CF315B3E8328178217A6B56DC8627B1B64DA3B15BC5F2F6C12339E343F3E353B647455FAED6F88A325D09CA45F0BA1774CA06845C831DB787E7C3DE25F205ECF47BE6735133FAB74A0DB848721F92A37A2899C43FFF39AEAACD7C74F09966FF882A8B73C987F9F364030E6662333F5E54D9D44A0C35AF4BB49B20C41447296737C5F133DBADB68A535D2854E4DCF5E70745F51B60FCAD36D84F88AC94D86ABD5A2DA6D74EA0444115DADF383134FCAB6D792AC68ACB2CC6A59AEBB3E5C0D637841A805BC02B56B010215103A0EC86969BBB92E3B9BC3C64EF8121E5F5524F01CD5A34A6F28B4D10B5A9201FA9429A27FCC4F1F0B2DD7A61221B94B8952B053FBB34C8372DEE7EA6728AA698FF6F19ADCC3D8743DB85E0EFB7EBAEF77562C6B6C3AA0AF968B1B016D2CB87A55811C206FE76444984EE7DFDA433D0E9AD93DF399A47990BA4AC354C330C4F857606F6A20ADA6652F2B9D4547EBE733C4D00FEC771AA41396C0E836534B36AC46B6C7FDF64FF00EE9A5F2935C95C29241F41AACAA0A143C1DE9D9D34C368FE2AADC152C47F77EA411AEF397
|
|
|
|
|
tmp_aes_key = AA7453D784E26EB677CAE594948AB16D87B538F3695191A5F909D44F770BDA29
|
|
|
|
|
tmp_aes_iv = D2F7F7EB6E5B5EE336691DF103B18261409EF09E5FE0CE68AD670CD1A0C1F2BE</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = A456A9ED2EDEFE67BD716F30970491BB4012F3E4BA0D89B590D879C3240282E21DBCB0AF742DC851165435C245F38B9E799A87472506FCB103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000277583A38986984EE8EFAD19AC8EABE28D629B784C85B49AAB9727E613ECAD321BF22FCE14087CE5EFBBD7E8E3EF2883FB5C33279BA4D41D6D0B58EEE228919188A4A43BD82766E0A8D14975F27F220F7096574AE568519305B611CAE87E4F9E440F4825EEA4238956EFE8E65C90F39B91BAD7A4F2A20A55DA1D833435A8D5380A48DF67C32883A79D348D995EAC71BA7F4D475B2D065ED6CAA116680306D7128E1FE5006B850F3745E3170C53BDF381482D03D036083ABC4B248BB7392F9181851CC52B9914F52F2871AA1A6509DCDFBC9E28EB68080A3F037BE7FA2D7D4A9B39568DCEE6E124840FE317F1BCDBACCB49824BBE7175BEB09CDBA903C4A3959963A10654F82E5293C7D25BB
|
|
|
|
|
answer = BA0D89B590D879C3240282E21DBCB0AF742DC851165435C245F38B9E799A87472506FCB103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000277583A38986984EE8EFAD19AC8EABE28D629B784C85B49AAB9727E613ECAD321BF22FCE14087CE5EFBBD7E8E3EF2883FB5C33279BA4D41D6D0B58EEE228919188A4A43BD82766E0A8D14975F27F220F7096574AE568519305B611CAE87E4F9E440F4825EEA4238956EFE8E65C90F39B91BAD7A4F2A20A55DA1D833435A8D5380A48DF67C32883A79D348D995EAC71BA7F4D475B2D065ED6CAA116680306D7128E1FE5006B850F3745E3170C53BDF381482D03D036083ABC4B248BB7392F9181851CC52B9914F52F2871AA1A6509DCDFBC9E28EB68080A3F037BE7FA2D7D4A9B39568DCEE6E124840FE317F1BCDBACCB49824BBE7175BEB09CDBA903C4A3959963A10654F82E5293C7D25BB</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = F5CFCC2ED46BCC80428670664FA3A36867B60934BA0D89B534C22C89ACBA6BD3EF3D6A35D46BFF0C266250C77D07AEAA419ACBFBE4FF045603000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001003E6267D5F9DBC2B800419EDBA021F9C554484A97B7021704CF3A259BE7DCB43055365A9391B7DA3BB3C08A2FB71D1C7063B66336767A6DB9442F5C6CFFDD85EEE0BB10C5B7BA1C293E268B1E321329DCB60B3716E39BC1EA61B7372D6D08EE590C5AA830760C7A9AF1071528EBE16B57D74CBBB518278E658ECAA8731D17A188CBC2514D3F3077702476F28BDE33BA98CC2A418B6764FB89DE416F9491AB31BD7E11F8B68443980127D8D82B86D1AE7CAFE6138935ED5C1A9E1E2F11D9B90A65F075FE9731288246D4A20B5E0DE6E32C40849FD086004B5E756F88C8F2C402EC445D5D05551B02E5A6A2F60E6AD3EA5CF42D0996AEE8C8A577436D4CB8A61E2A0C41116543AB9473B5DF6F46
|
|
|
|
|
answer = BA0D89B534C22C89ACBA6BD3EF3D6A35D46BFF0C266250C77D07AEAA419ACBFBE4FF045603000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001003E6267D5F9DBC2B800419EDBA021F9C554484A97B7021704CF3A259BE7DCB43055365A9391B7DA3BB3C08A2FB71D1C7063B66336767A6DB9442F5C6CFFDD85EEE0BB10C5B7BA1C293E268B1E321329DCB60B3716E39BC1EA61B7372D6D08EE590C5AA830760C7A9AF1071528EBE16B57D74CBBB518278E658ECAA8731D17A188CBC2514D3F3077702476F28BDE33BA98CC2A418B6764FB89DE416F9491AB31BD7E11F8B68443980127D8D82B86D1AE7CAFE6138935ED5C1A9E1E2F11D9B90A65F075FE9731288246D4A20B5E0DE6E32C40849FD086004B5E756F88C8F2C402EC445D5D05551B02E5A6A2F60E6AD3EA5CF42D0996AEE8C8A577436D4CB8A61E2A0C41116543AB9473B5DF6F46</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 90 D8 79 C3 24 02 82 E2 1D BC B0 AF
|
|
|
|
|
0010 | 74 2D C8 51 16 54 35 C2 45 F3 8B 9E 79 9A 87 47
|
|
|
|
|
0020 | 25 06 FC B1 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 34 C2 2C 89 AC BA 6B D3 EF 3D 6A 35
|
|
|
|
|
0010 | D4 6B FF 0C 26 62 50 C7 7D 07 AE AA 41 9A CB FB
|
|
|
|
|
0020 | E4 FF 04 56 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 = BA0D89B590D879C3240282E21DBCB0AF742DC851165435C245F38B9E799A87472506FCB
|
|
|
|
|
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 | 02 77 58 3A 38 98 69 84 EE 8E FA D1 9A C8 EA BE
|
|
|
|
|
0140 | 28 D6 29 B7 84 C8 5B 49 AA B9 72 7E 61 3E CA D3
|
|
|
|
|
0150 | 21 BF 22 FC E1 40 87 CE 5E FB BD 7E 8E 3E F2 88
|
|
|
|
|
0160 | 3F B5 C3 32 79 BA 4D 41 D6 D0 B5 8E EE 22 89 19
|
|
|
|
|
0170 | 18 8A 4A 43 BD 82 76 6E 0A 8D 14 97 5F 27 F2 20
|
|
|
|
|
0180 | F7 09 65 74 AE 56 85 19 30 5B 61 1C AE 87 E4 F9
|
|
|
|
|
0190 | E4 40 F4 82 5E EA 42 38 95 6E FE 8E 65 C9 0F 39
|
|
|
|
|
01A0 | B9 1B AD 7A 4F 2A 20 A5 5D A1 D8 33 43 5A 8D 53
|
|
|
|
|
01B0 | 80 A4 8D F6 7C 32 88 3A 79 D3 48 D9 95 EA C7 1B
|
|
|
|
|
01C0 | A7 F4 D4 75 B2 D0 65 ED 6C AA 11 66 80 30 6D 71
|
|
|
|
|
01D0 | 28 E1 FE 50 06 B8 50 F3 74 5E 31 70 C5 3B DF 38
|
|
|
|
|
01E0 | 14 82 D0 3D 03 60 83 AB C4 B2 48 BB 73 92 F9 18
|
|
|
|
|
01F0 | 18 51 CC 52 B9 91 4F 52 F2 87 1A A1 A6 50 9D CD
|
|
|
|
|
0200 | FB C9 E2 8E B6 80 80 A3 F0 37 BE 7F A2 D7 D4 A9
|
|
|
|
|
0210 | B3 95 68 DC EE 6E 12 48 40 FE 31 7F 1B CD BA CC
|
|
|
|
|
0220 | B4 98 24 BB E7 17 5B EB 09 CD BA 90 3C 4A 39 59
|
|
|
|
|
0230 | 96 3A 10 65</code></pre>
|
|
|
|
|
0130 | 3E 62 67 D5 F9 DB C2 B8 00 41 9E DB A0 21 F9 C5
|
|
|
|
|
0140 | 54 48 4A 97 B7 02 17 04 CF 3A 25 9B E7 DC B4 30
|
|
|
|
|
0150 | 55 36 5A 93 91 B7 DA 3B B3 C0 8A 2F B7 1D 1C 70
|
|
|
|
|
0160 | 63 B6 63 36 76 7A 6D B9 44 2F 5C 6C FF DD 85 EE
|
|
|
|
|
0170 | E0 BB 10 C5 B7 BA 1C 29 3E 26 8B 1E 32 13 29 DC
|
|
|
|
|
0180 | B6 0B 37 16 E3 9B C1 EA 61 B7 37 2D 6D 08 EE 59
|
|
|
|
|
0190 | 0C 5A A8 30 76 0C 7A 9A F1 07 15 28 EB E1 6B 57
|
|
|
|
|
01A0 | D7 4C BB B5 18 27 8E 65 8E CA A8 73 1D 17 A1 88
|
|
|
|
|
01B0 | CB C2 51 4D 3F 30 77 70 24 76 F2 8B DE 33 BA 98
|
|
|
|
|
01C0 | CC 2A 41 8B 67 64 FB 89 DE 41 6F 94 91 AB 31 BD
|
|
|
|
|
01D0 | 7E 11 F8 B6 84 43 98 01 27 D8 D8 2B 86 D1 AE 7C
|
|
|
|
|
01E0 | AF E6 13 89 35 ED 5C 1A 9E 1E 2F 11 D9 B9 0A 65
|
|
|
|
|
01F0 | F0 75 FE 97 31 28 82 46 D4 A2 0B 5E 0D E6 E3 2C
|
|
|
|
|
0200 | 40 84 9F D0 86 00 4B 5E 75 6F 88 C8 F2 C4 02 EC
|
|
|
|
|
0210 | 44 5D 5D 05 55 1B 02 E5 A6 A2 F6 0E 6A D3 EA 5C
|
|
|
|
|
0220 | F4 2D 09 96 AE E8 C8 A5 77 43 6D 4C B8 A6 1E 2A
|
|
|
|
|
0230 | 0C 41 11 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 = BA0D89B590D879C3240282E21DBCB0AF742DC851165435C245F38B9E799A87472506FCB
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>90D879C3240282E21DBCB0AF742DC851</code></td>
|
|
|
|
|
<td><code>34C22C89ACBA6BD3EF3D6A35D46BFF0C</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>165435C245F38B9E799A87472506FCB1</code></td>
|
|
|
|
|
<td><code>266250C77D07AEAA419ACBFBE4FF0456</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B590D879C3240282E21DBCB0AF742DC851165435C245F38B9E799A87472506FCB
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE0001000277583A38986984EE8EFAD1</code> <code>9AC8EABE28D629B784C85B49AAB9727E</code> <code>613ECAD321BF22FCE14087CE5EFBBD7E</code> <code>8E3EF2883FB5C33279BA4D41D6D0B58E</code> <code>EE228919188A4A43BD82766E0A8D1497</code> <code>5F27F220F7096574AE568519305B611C</code> <code>AE87E4F9E440F4825EEA4238956EFE8E</code> <code>65C90F39B91BAD7A4F2A20A55DA1D833</code> <code>435A8D5380A48DF67C32883A79D348D9</code> <code>95EAC71BA7F4D475B2D065ED6CAA1166</code> <code>80306D7128E1FE5006B850F3745E3170</code> <code>C53BDF381482D03D036083ABC4B248BB</code> <code>7392F9181851CC52B9914F52F2871AA1</code> <code>A6509DCDFBC9E28EB68080A3F037BE7F</code> <code>A2D7D4A9B39568DCEE6E124840FE317F</code> <code>1BCDBACCB49824BBE7175BEB09CDBA90</code><br> <code>3C4A3959</code></td>
|
|
|
|
|
<td><code>FE0001003E6267D5F9DBC2B800419EDB</code> <code>A021F9C554484A97B7021704CF3A259B</code> <code>E7DCB43055365A9391B7DA3BB3C08A2F</code> <code>B71D1C7063B66336767A6DB9442F5C6C</code> <code>FFDD85EEE0BB10C5B7BA1C293E268B1E</code> <code>321329DCB60B3716E39BC1EA61B7372D</code> <code>6D08EE590C5AA830760C7A9AF1071528</code> <code>EBE16B57D74CBBB518278E658ECAA873</code> <code>1D17A188CBC2514D3F3077702476F28B</code> <code>DE33BA98CC2A418B6764FB89DE416F94</code> <code>91AB31BD7E11F8B68443980127D8D82B</code> <code>86D1AE7CAFE6138935ED5C1A9E1E2F11</code> <code>D9B90A65F075FE9731288246D4A20B5E</code> <code>0DE6E32C40849FD086004B5E756F88C8</code> <code>F2C402EC445D5D05551B02E5A6A2F60E</code> <code>6AD3EA5CF42D0996AEE8C8A577436D4C</code><br> <code>B8A61E2A</code></td>
|
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>963A1065</code> (1695562390 in decimal)</td>
|
|
|
|
|
<td><code>0C411165</code> (1695629580 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B590D879C3240282E21DBCB0AF742DC851165435C245F38B9E799A87472506FCB
|
|
|
|
|
<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 = F8EB7302D4860E5CE913EABC32F61A15D7CC9710FF71F09810BEDBE1A8E4886933987293CA77CB03A93197F82CDEC85B139EEF672E5A39ED4ABFF1DE836B6247EB5EA8C5B3CAFB295039297F60DD6F38B328599826E9065597A6F5034AEF7B19136229B5DBA9C4571A8C56548928765DC566C8CF15033C478FFFC58FA54AF9329E4BCA96A1D21EA175A8F81F6B27ED6FAECD77E031431469D5AEBC8EBD023F938ADF912B3C5DA57618552F29FE8FCDFBED7535699B8C57D3038E01D678CF6E4AB1FD45D3A55F4BEFD585F534F852AF230362A0BEC6E51DA9D96D0E68AD6ED2D2DCA3375561DB712BBA4F2E6326535B0AB0B923E5E4129C7585BBEBFD84CA8DA8</code></pre>
|
|
|
|
|
<pre><code>b = C6CC309B564F0A61173B8DB0336401649137EA5CD86EAE70F1DB8299871307568F09259B4641169FB0CAECA7B8061786A6206BE39F0F7FF4234FDF90D09047E59AD1ABBE37A956ACCA1E4E42B750E1BA8F15FE68679653A1DFB8AD0E637FFA8D8ECC1F7EDD6B61A8B20B545933A362993031BADCC37EB0A198F1E172ACBF76D59C9BDB2FFB5687826885EEBF075FC8312D910811C0AC6C2AE051A307D6563FAA6371CA658F4153B00004CE77612E9FD2656385BD0A403DC08B1A2446FA3F1AB44AE00321D88F6D418F8AD5DF48D387F5D09DDC5E5AB43716C8FE0F2002663593A5AB60A313257F94A6313048513C386E204636E934ABD681CCF39E49034282F6</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 = 5B9EEDE718549509D4AE97240F852170D9F8B55709E34C81FFB193E4AB58440211D6FF787DA481571E4AB24E196A994D47E03A3FBE2E8D3954F643A27443F67D3D05E3E35F5D56941C07FCF1326677A90A35CD9D4571B7A87121BCAB4B3125739D96EA70903515495BECEC90AA9F4988163EB9503C20041F0D03E93EB9583FA4423300FACE40E317D884520A2604DCDA6408DB7BCFA7F56EE4CF8FBF47039A15074EB60093BA75AB15066C1CBF478E52E7C37553216BA3A03488DCF7135C037D1D0CB31A9D5F29302EF34D683D106307318E364ED24BB564AE16D5EE8D6D3C07BA2BAA24696948003F5D1A42F13FDC34615A2A308074D6A5E8B53ADDF0F1B3C5</code></pre>
|
|
|
|
|
<pre><code>g_b = 9C7E6D8AB1F2D6A152FF64381701D8DCF795AD805B1454C8F19C0E06170D8EF8E2C4E93542382A47A8A7AD02D00113E82016519E6922E05E36131F386E3EE3AE9265B776C686FA3D9BD7FA774E72EA08321283694D989AC707A3590E1E4969F394735B82F367373F0DEA7A609A354E2BF4C4EF160AAEDF04AA7A6E074D07ABE095817ACC0476002EDBC1CAA7F2556A47842CD955DDD6D1D974F5536E18F609FE988FFF85A7DBCBC475252FE84B6FCCE22835FC0DE54E009801EEA5281D2F69BAF80A375FE333CBDB52A1E7F2376EEE1952A4042ED9D6621CC5B97A2A2F1BDAAED4C20B692BE35339461406058FFF91FFD5EA545220AF9949EA478E7337B42F70</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 90 D8 79 C3 24 02 82 E2 1D BC B0 AF
|
|
|
|
|
0010 | 74 2D C8 51 16 54 35 C2 45 F3 8B 9E 79 9A 87 47
|
|
|
|
|
0020 | 25 06 FC B1 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 5B 9E ED E7 18 54 95 09 D4 AE 97 24 0F 85 21 70
|
|
|
|
|
0040 | D9 F8 B5 57 09 E3 4C 81 FF B1 93 E4 AB 58 44 02
|
|
|
|
|
0050 | 11 D6 FF 78 7D A4 81 57 1E 4A B2 4E 19 6A 99 4D
|
|
|
|
|
0060 | 47 E0 3A 3F BE 2E 8D 39 54 F6 43 A2 74 43 F6 7D
|
|
|
|
|
0070 | 3D 05 E3 E3 5F 5D 56 94 1C 07 FC F1 32 66 77 A9
|
|
|
|
|
0080 | 0A 35 CD 9D 45 71 B7 A8 71 21 BC AB 4B 31 25 73
|
|
|
|
|
0090 | 9D 96 EA 70 90 35 15 49 5B EC EC 90 AA 9F 49 88
|
|
|
|
|
00A0 | 16 3E B9 50 3C 20 04 1F 0D 03 E9 3E B9 58 3F A4
|
|
|
|
|
00B0 | 42 33 00 FA CE 40 E3 17 D8 84 52 0A 26 04 DC DA
|
|
|
|
|
00C0 | 64 08 DB 7B CF A7 F5 6E E4 CF 8F BF 47 03 9A 15
|
|
|
|
|
00D0 | 07 4E B6 00 93 BA 75 AB 15 06 6C 1C BF 47 8E 52
|
|
|
|
|
00E0 | E7 C3 75 53 21 6B A3 A0 34 88 DC F7 13 5C 03 7D
|
|
|
|
|
00F0 | 1D 0C B3 1A 9D 5F 29 30 2E F3 4D 68 3D 10 63 07
|
|
|
|
|
0100 | 31 8E 36 4E D2 4B B5 64 AE 16 D5 EE 8D 6D 3C 07
|
|
|
|
|
0110 | BA 2B AA 24 69 69 48 00 3F 5D 1A 42 F1 3F DC 34
|
|
|
|
|
0120 | 61 5A 2A 30 80 74 D6 A5 E8 B5 3A DD F0 F1 B3 C5</code></pre>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 34 C2 2C 89 AC BA 6B D3 EF 3D 6A 35
|
|
|
|
|
0010 | D4 6B FF 0C 26 62 50 C7 7D 07 AE AA 41 9A CB FB
|
|
|
|
|
0020 | E4 FF 04 56 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 9C 7E 6D 8A B1 F2 D6 A1 52 FF 64 38 17 01 D8 DC
|
|
|
|
|
0040 | F7 95 AD 80 5B 14 54 C8 F1 9C 0E 06 17 0D 8E F8
|
|
|
|
|
0050 | E2 C4 E9 35 42 38 2A 47 A8 A7 AD 02 D0 01 13 E8
|
|
|
|
|
0060 | 20 16 51 9E 69 22 E0 5E 36 13 1F 38 6E 3E E3 AE
|
|
|
|
|
0070 | 92 65 B7 76 C6 86 FA 3D 9B D7 FA 77 4E 72 EA 08
|
|
|
|
|
0080 | 32 12 83 69 4D 98 9A C7 07 A3 59 0E 1E 49 69 F3
|
|
|
|
|
0090 | 94 73 5B 82 F3 67 37 3F 0D EA 7A 60 9A 35 4E 2B
|
|
|
|
|
00A0 | F4 C4 EF 16 0A AE DF 04 AA 7A 6E 07 4D 07 AB E0
|
|
|
|
|
00B0 | 95 81 7A CC 04 76 00 2E DB C1 CA A7 F2 55 6A 47
|
|
|
|
|
00C0 | 84 2C D9 55 DD D6 D1 D9 74 F5 53 6E 18 F6 09 FE
|
|
|
|
|
00D0 | 98 8F FF 85 A7 DB CB C4 75 25 2F E8 4B 6F CC E2
|
|
|
|
|
00E0 | 28 35 FC 0D E5 4E 00 98 01 EE A5 28 1D 2F 69 BA
|
|
|
|
|
00F0 | F8 0A 37 5F E3 33 CB DB 52 A1 E7 F2 37 6E EE 19
|
|
|
|
|
0100 | 52 A4 04 2E D9 D6 62 1C C5 B9 7A 2A 2F 1B DA AE
|
|
|
|
|
0110 | D4 C2 0B 69 2B E3 53 39 46 14 06 05 8F FF 91 FF
|
|
|
|
|
0120 | D5 EA 54 52 20 AF 99 49 EA 47 8E 73 37 B4 2F 70</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 = BA0D89B590D879C3240282E21DBCB0AF742DC851165435C245F38B9E799A87472506FCB
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>90D879C3240282E21DBCB0AF742DC851</code></td>
|
|
|
|
|
<td><code>34C22C89ACBA6BD3EF3D6A35D46BFF0C</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>165435C245F38B9E799A87472506FCB1</code></td>
|
|
|
|
|
<td><code>266250C77D07AEAA419ACBFBE4FF0456</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE0001005B9EEDE718549509D4AE9724</code> <code>0F852170D9F8B55709E34C81FFB193E4</code> <code>AB58440211D6FF787DA481571E4AB24E</code> <code>196A994D47E03A3FBE2E8D3954F643A2</code> <code>7443F67D3D05E3E35F5D56941C07FCF1</code> <code>326677A90A35CD9D4571B7A87121BCAB</code> <code>4B3125739D96EA70903515495BECEC90</code> <code>AA9F4988163EB9503C20041F0D03E93E</code> <code>B9583FA4423300FACE40E317D884520A</code> <code>2604DCDA6408DB7BCFA7F56EE4CF8FBF</code> <code>47039A15074EB60093BA75AB15066C1C</code> <code>BF478E52E7C37553216BA3A03488DCF7</code> <code>135C037D1D0CB31A9D5F29302EF34D68</code> <code>3D106307318E364ED24BB564AE16D5EE</code> <code>8D6D3C07BA2BAA24696948003F5D1A42</code> <code>F13FDC34615A2A308074D6A5E8B53ADD</code><br> <code>F0F1B3C5</code></td>
|
|
|
|
|
<td><code>FE0001009C7E6D8AB1F2D6A152FF6438</code> <code>1701D8DCF795AD805B1454C8F19C0E06</code> <code>170D8EF8E2C4E93542382A47A8A7AD02</code> <code>D00113E82016519E6922E05E36131F38</code> <code>6E3EE3AE9265B776C686FA3D9BD7FA77</code> <code>4E72EA08321283694D989AC707A3590E</code> <code>1E4969F394735B82F367373F0DEA7A60</code> <code>9A354E2BF4C4EF160AAEDF04AA7A6E07</code> <code>4D07ABE095817ACC0476002EDBC1CAA7</code> <code>F2556A47842CD955DDD6D1D974F5536E</code> <code>18F609FE988FFF85A7DBCBC475252FE8</code> <code>4B6FCCE22835FC0DE54E009801EEA528</code> <code>1D2F69BAF80A375FE333CBDB52A1E7F2</code> <code>376EEE1952A4042ED9D6621CC5B97A2A</code> <code>2F1BDAAED4C20B692BE3533946140605</code> <code>8FFF91FFD5EA545220AF9949EA478E73</code><br> <code>37B42F70</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 = BA0D89B590D879C3240282E21DBCB0AF742DC851165435C245F38B9E799A87472506FCB
|
|
|
|
|
<!-- 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 = 54B6436690D879C3240282E21DBCB0AF742DC851165435C245F38B9E799A87472506FCB10000000000000000FE0001005B9EEDE718549509D4AE97240F852170D9F8B55709E34C81FFB193E4AB58440211D6FF787DA481571E4AB24E196A994D47E03A3FBE2E8D3954F643A27443F67D3D05E3E35F5D56941C07FCF1326677A90A35CD9D4571B7A87121BCAB4B3125739D96EA70903515495BECEC90AA9F4988163EB9503C20041F0D03E93EB9583FA4423300FACE40E317D884520A2604DCDA6408DB7BCFA7F56EE4CF8FBF47039A15074EB60093BA75AB15066C1CBF478E52E7C37553216BA3A03488DCF7135C037D1D0CB31A9D5F29302EF34D683D106307318E364ED24BB564AE16D5EE8D6D3C07BA2BAA24696948003F5D1A42F13FDC34615A2A308074D6A5E8B53ADDF0F1B3C5
|
|
|
|
|
padding = 965602849F3F36382258F356
|
|
|
|
|
tmp_aes_key = 55A9985F8284A35716B50AB1971D0119D8FFEA9F85FDD21EE6C8D6F52549CD2A
|
|
|
|
|
tmp_aes_iv = D9B936BE6EF6B695EF3BA29435EFBE988D0F4A18661881B156254F5D8927C1C1</code></pre>
|
|
|
|
|
<pre><code>data = 54B6436634C22C89ACBA6BD3EF3D6A35D46BFF0C266250C77D07AEAA419ACBFBE4FF04560000000000000000FE0001009C7E6D8AB1F2D6A152FF64381701D8DCF795AD805B1454C8F19C0E06170D8EF8E2C4E93542382A47A8A7AD02D00113E82016519E6922E05E36131F386E3EE3AE9265B776C686FA3D9BD7FA774E72EA08321283694D989AC707A3590E1E4969F394735B82F367373F0DEA7A609A354E2BF4C4EF160AAEDF04AA7A6E074D07ABE095817ACC0476002EDBC1CAA7F2556A47842CD955DDD6D1D974F5536E18F609FE988FFF85A7DBCBC475252FE84B6FCCE22835FC0DE54E009801EEA5281D2F69BAF80A375FE333CBDB52A1E7F2376EEE1952A4042ED9D6621CC5B97A2A2F1BDAAED4C20B692BE35339461406058FFF91FFD5EA545220AF9949EA478E7337B42F70
|
|
|
|
|
padding = D3501167F7D3CEA15A1714B7
|
|
|
|
|
tmp_aes_key = AA7453D784E26EB677CAE594948AB16D87B538F3695191A5F909D44F770BDA29
|
|
|
|
|
tmp_aes_iv = D2F7F7EB6E5B5EE336691DF103B18261409EF09E5FE0CE68AD670CD1A0C1F2BE</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 = 3E6C1410D2CFBC60D8413FEDC5056722FBD79D4323C68777E89990CE60C4E565814E7B2AC4CAE9300D94360BBA82CEE3C91041845941DDA1814C7431ED1A97D9B7B7B38A9E93D8E573E9D6D1697B6B6C51BFF5DF1C1DA156C105AFCA96D4A32FB8B8F4CE21020640E384C3E014529A67B76117BB26FA92175ED7C5184D831CBC1EA7A2E5A9E826B939BF5D59356C75240D3203C8412FB38C5B37EC043D2409575F4AC68E7EC94402D7E8F95BEBBC76730F644AF039E917DFF87DBD151A28EF3435FCD7BCD6E1E204639ACE95C0A07CF71A7657EC4FD5EC1DFE9F70DE686EBD31B455F9218FD2F41EF0ECDC8791F72B12650173876231C31E5085571D6CBA86C105AAC5D4C22D41F3A727DBD49A4375D5F3A0876265CCF388E2775CCFAC6EFBBEF49ED2C2634A85F59D1DDBFED413909D7A45853B4A243F26CAE1A28B5F8C7D4CAE90204AC4F8C06AF01BAAC661A7B088</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = BCD27AC9B4EEA7D20770BC5C7645AFBA6D8E90C221D615328C3CA284DFBA9F08D3C66C791CADF35E0C48C903EA69B3EC0ADDAC9286D9BC6098CE8E452C592C4074B88A626313DC63F8BC7C59A86DB67748A0002F8B536EA7260ADF739580F9DAF3C102CBEDE0815F51ED341AC32C90138F5A14B516F4DFF19188EE80C40E5E1C7798171BCA162B6956E004513B1DA3A61811844ED17AF43DD166793AB0FB41C248BB0AB580EA4FE8F4D5B06BCF3F65A2656AED06BA4090BF63FB4E70E5E340E34E945488789080D8316953C1B6F6158E05D18D0A7DF99D52ABF30DCA5DAEB17087ED35AFB49502FD3897EC56A23881167771FE3724AA5D6E02E1506DFBEC679DD6E21FE325C2AFB3FECCD31684632C638168BD1EC55E90D82A0244B13C2F6CCD1A89BC28AA95DA7014DC8261F3C81F0DC9465A5B5F0BF5D2B8009DCD71276D113665CA299D8EF38A20F6FCFAF5322D72</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 F0 71 06 00 96 3A 10 65
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 90 D8 79 C3 24 02 82 E2
|
|
|
|
|
0020 | 1D BC B0 AF 74 2D C8 51 16 54 35 C2 45 F3 8B 9E
|
|
|
|
|
0030 | 79 9A 87 47 25 06 FC B1 FE 50 01 00 3E 6C 14 10
|
|
|
|
|
0040 | D2 CF BC 60 D8 41 3F ED C5 05 67 22 FB D7 9D 43
|
|
|
|
|
0050 | 23 C6 87 77 E8 99 90 CE 60 C4 E5 65 81 4E 7B 2A
|
|
|
|
|
0060 | C4 CA E9 30 0D 94 36 0B BA 82 CE E3 C9 10 41 84
|
|
|
|
|
0070 | 59 41 DD A1 81 4C 74 31 ED 1A 97 D9 B7 B7 B3 8A
|
|
|
|
|
0080 | 9E 93 D8 E5 73 E9 D6 D1 69 7B 6B 6C 51 BF F5 DF
|
|
|
|
|
0090 | 1C 1D A1 56 C1 05 AF CA 96 D4 A3 2F B8 B8 F4 CE
|
|
|
|
|
00A0 | 21 02 06 40 E3 84 C3 E0 14 52 9A 67 B7 61 17 BB
|
|
|
|
|
00B0 | 26 FA 92 17 5E D7 C5 18 4D 83 1C BC 1E A7 A2 E5
|
|
|
|
|
00C0 | A9 E8 26 B9 39 BF 5D 59 35 6C 75 24 0D 32 03 C8
|
|
|
|
|
00D0 | 41 2F B3 8C 5B 37 EC 04 3D 24 09 57 5F 4A C6 8E
|
|
|
|
|
00E0 | 7E C9 44 02 D7 E8 F9 5B EB BC 76 73 0F 64 4A F0
|
|
|
|
|
00F0 | 39 E9 17 DF F8 7D BD 15 1A 28 EF 34 35 FC D7 BC
|
|
|
|
|
0100 | D6 E1 E2 04 63 9A CE 95 C0 A0 7C F7 1A 76 57 EC
|
|
|
|
|
0110 | 4F D5 EC 1D FE 9F 70 DE 68 6E BD 31 B4 55 F9 21
|
|
|
|
|
0120 | 8F D2 F4 1E F0 EC DC 87 91 F7 2B 12 65 01 73 87
|
|
|
|
|
0130 | 62 31 C3 1E 50 85 57 1D 6C BA 86 C1 05 AA C5 D4
|
|
|
|
|
0140 | C2 2D 41 F3 A7 27 DB D4 9A 43 75 D5 F3 A0 87 62
|
|
|
|
|
0150 | 65 CC F3 88 E2 77 5C CF AC 6E FB BE F4 9E D2 C2
|
|
|
|
|
0160 | 63 4A 85 F5 9D 1D DB FE D4 13 90 9D 7A 45 85 3B
|
|
|
|
|
0170 | 4A 24 3F 26 CA E1 A2 8B 5F 8C 7D 4C AE 90 20 4A
|
|
|
|
|
0180 | C4 F8 C0 6A F0 1B AA C6 61 A7 B0 88</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 E8 31 0C 00 0C 41 11 65
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 34 C2 2C 89 AC BA 6B D3
|
|
|
|
|
0020 | EF 3D 6A 35 D4 6B FF 0C 26 62 50 C7 7D 07 AE AA
|
|
|
|
|
0030 | 41 9A CB FB E4 FF 04 56 FE 50 01 00 BC D2 7A C9
|
|
|
|
|
0040 | B4 EE A7 D2 07 70 BC 5C 76 45 AF BA 6D 8E 90 C2
|
|
|
|
|
0050 | 21 D6 15 32 8C 3C A2 84 DF BA 9F 08 D3 C6 6C 79
|
|
|
|
|
0060 | 1C AD F3 5E 0C 48 C9 03 EA 69 B3 EC 0A DD AC 92
|
|
|
|
|
0070 | 86 D9 BC 60 98 CE 8E 45 2C 59 2C 40 74 B8 8A 62
|
|
|
|
|
0080 | 63 13 DC 63 F8 BC 7C 59 A8 6D B6 77 48 A0 00 2F
|
|
|
|
|
0090 | 8B 53 6E A7 26 0A DF 73 95 80 F9 DA F3 C1 02 CB
|
|
|
|
|
00A0 | ED E0 81 5F 51 ED 34 1A C3 2C 90 13 8F 5A 14 B5
|
|
|
|
|
00B0 | 16 F4 DF F1 91 88 EE 80 C4 0E 5E 1C 77 98 17 1B
|
|
|
|
|
00C0 | CA 16 2B 69 56 E0 04 51 3B 1D A3 A6 18 11 84 4E
|
|
|
|
|
00D0 | D1 7A F4 3D D1 66 79 3A B0 FB 41 C2 48 BB 0A B5
|
|
|
|
|
00E0 | 80 EA 4F E8 F4 D5 B0 6B CF 3F 65 A2 65 6A ED 06
|
|
|
|
|
00F0 | BA 40 90 BF 63 FB 4E 70 E5 E3 40 E3 4E 94 54 88
|
|
|
|
|
0100 | 78 90 80 D8 31 69 53 C1 B6 F6 15 8E 05 D1 8D 0A
|
|
|
|
|
0110 | 7D F9 9D 52 AB F3 0D CA 5D AE B1 70 87 ED 35 AF
|
|
|
|
|
0120 | B4 95 02 FD 38 97 EC 56 A2 38 81 16 77 71 FE 37
|
|
|
|
|
0130 | 24 AA 5D 6E 02 E1 50 6D FB EC 67 9D D6 E2 1F E3
|
|
|
|
|
0140 | 25 C2 AF B3 FE CC D3 16 84 63 2C 63 81 68 BD 1E
|
|
|
|
|
0150 | C5 5E 90 D8 2A 02 44 B1 3C 2F 6C CD 1A 89 BC 28
|
|
|
|
|
0160 | AA 95 DA 70 14 DC 82 61 F3 C8 1F 0D C9 46 5A 5B
|
|
|
|
|
0170 | 5F 0B F5 D2 B8 00 9D CD 71 27 6D 11 36 65 CA 29
|
|
|
|
|
0180 | 9D 8E F3 8A 20 F6 FC FA F5 32 2D 72</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>F0710600963A1065</code></td>
|
|
|
|
|
<td><code>E8310C000C411165</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>90D879C3240282E21DBCB0AF742DC851</code></td>
|
|
|
|
|
<td><code>34C22C89ACBA6BD3EF3D6A35D46BFF0C</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>165435C245F38B9E799A87472506FCB1</code></td>
|
|
|
|
|
<td><code>266250C77D07AEAA419ACBFBE4FF0456</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE5001003E6C1410D2CFBC60D8413FED</code> <code>C5056722FBD79D4323C68777E89990CE</code> <code>60C4E565814E7B2AC4CAE9300D94360B</code> <code>BA82CEE3C91041845941DDA1814C7431</code> <code>ED1A97D9B7B7B38A9E93D8E573E9D6D1</code> <code>697B6B6C51BFF5DF1C1DA156C105AFCA</code> <code>96D4A32FB8B8F4CE21020640E384C3E0</code> <code>14529A67B76117BB26FA92175ED7C518</code> <code>4D831CBC1EA7A2E5A9E826B939BF5D59</code> <code>356C75240D3203C8412FB38C5B37EC04</code> <code>3D2409575F4AC68E7EC94402D7E8F95B</code> <code>EBBC76730F644AF039E917DFF87DBD15</code> <code>1A28EF3435FCD7BCD6E1E204639ACE95</code> <code>C0A07CF71A7657EC4FD5EC1DFE9F70DE</code> <code>686EBD31B455F9218FD2F41EF0ECDC87</code> <code>91F72B12650173876231C31E5085571D</code> <code>6CBA86C105AAC5D4C22D41F3A727DBD4</code> <code>9A4375D5F3A0876265CCF388E2775CCF</code> <code>AC6EFBBEF49ED2C2634A85F59D1DDBFE</code> <code>D413909D7A45853B4A243F26CAE1A28B</code> <code>5F8C7D4CAE90204AC4F8C06AF01BAAC6</code><br> <code>61A7B088</code></td>
|
|
|
|
|
<td><code>FE500100BCD27AC9B4EEA7D20770BC5C</code> <code>7645AFBA6D8E90C221D615328C3CA284</code> <code>DFBA9F08D3C66C791CADF35E0C48C903</code> <code>EA69B3EC0ADDAC9286D9BC6098CE8E45</code> <code>2C592C4074B88A626313DC63F8BC7C59</code> <code>A86DB67748A0002F8B536EA7260ADF73</code> <code>9580F9DAF3C102CBEDE0815F51ED341A</code> <code>C32C90138F5A14B516F4DFF19188EE80</code> <code>C40E5E1C7798171BCA162B6956E00451</code> <code>3B1DA3A61811844ED17AF43DD166793A</code> <code>B0FB41C248BB0AB580EA4FE8F4D5B06B</code> <code>CF3F65A2656AED06BA4090BF63FB4E70</code> <code>E5E340E34E945488789080D8316953C1</code> <code>B6F6158E05D18D0A7DF99D52ABF30DCA</code> <code>5DAEB17087ED35AFB49502FD3897EC56</code> <code>A23881167771FE3724AA5D6E02E1506D</code> <code>FBEC679DD6E21FE325C2AFB3FECCD316</code> <code>84632C638168BD1EC55E90D82A0244B1</code> <code>3C2F6CCD1A89BC28AA95DA7014DC8261</code> <code>F3C81F0DC9465A5B5F0BF5D2B8009DCD</code> <code>71276D113665CA299D8EF38A20F6FCFA</code><br> <code>F5322D72</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 = 2D677781FDBE200EDE57BA9259A3CF69C60F906252443641F3BC01E4031EE390547283D363E098B133C81BCF32B68B26F71092629E478936E1E61D9A8CFB36C57B8867CE45A1DD151378A1D046229B756B5FC7951FE2904560045ADF0100401FFD63FBB58E993EC07DF7A76EEE122CB70BA8481F4EC1A69E57F576EFB370CF0BE7542E41D4DF219C103C4C422256DD68E26F3B7230172CABDB796E1EC49F5D29DC18970E938FAA926A00328648CD863A9E214DE4B1DB5975E2874729347261862A30A4614D109D7B0DC91827D0E0E98C5A76020CDC97D692C6D1A23BD827530EC20463A37B0FA1A5B39799CDCFD81EA2DE868C4B6A3F8B20800F2529D5D31841</code></pre>
|
|
|
|
|
<pre><code>auth_key = 90254FDDFDD4EFAF152BF303A36287399DC8790CE00B605BC4016664B9685698B4B02800C3BC6C815B8D15D16A699F5B1DB105059697AF3B20889076C126CD62D668B7FFE60162C979CE81A61612528618319B5EBE89C597357EBBA82B1DEF30791AB16BEBA547596C0E76F1B35AEA2C0007DF833E76F628979C548260AA8BB005DC1351C90A8CE3C8F44BF68974FDBDF946C25AE3B61AA4C304AE308A9C5D7F8AD014381DCFFDDBE66D1A72E262CA93B8DA6994025D20466EABEC8B5F5D5E591B85A5663259FB8EFD94321F55A646127B5A9BB56FA6AD2F8AF4835B60F6258D73AC9A03FEABBBE397E137C8F8313BA290F04B36A301F43FC9FABF93BABC6DD0</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 F8 E7 71 96 3A 10 65
|
|
|
|
|
0010 | 98 00 00 00 34 F7 CB 3B 90 D8 79 C3 24 02 82 E2
|
|
|
|
|
0020 | 1D BC B0 AF 74 2D C8 51 16 54 35 C2 45 F3 8B 9E
|
|
|
|
|
0030 | 79 9A 87 47 25 06 FC B1 1E BC 55 BE 18 54 A7 5A
|
|
|
|
|
0040 | 58 8E A2 A0 43 FC 05 54</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 68 7A 8E 0C 41 11 65
|
|
|
|
|
0010 | 68 00 00 00 34 F7 CB 3B 34 C2 2C 89 AC BA 6B D3
|
|
|
|
|
0020 | EF 3D 6A 35 D4 6B FF 0C 26 62 50 C7 7D 07 AE AA
|
|
|
|
|
0030 | 41 9A CB FB E4 FF 04 56 52 6F 76 13 78 69 2A CD
|
|
|
|
|
0040 | C9 67 7D 8B 28 28 39 F0</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>01F8E771963A1065</code></td>
|
|
|
|
|
<td><code>01687A8E0C411165</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>98000000</code> (152 in decimal)</td>
|
|
|
|
|
<td><code>68000000</code> (104 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>90D879C3240282E21DBCB0AF742DC851</code></td>
|
|
|
|
|
<td><code>34C22C89ACBA6BD3EF3D6A35D46BFF0C</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>165435C245F38B9E799A87472506FCB1</code></td>
|
|
|
|
|
<td><code>266250C77D07AEAA419ACBFBE4FF0456</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>1EBC55BE1854A75A588EA2A043FC0554</code></td>
|
|
|
|
|
<td><code>526F761378692ACDC9677D8B282839F0</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>
|
|
|
|
|