|
|
|
@ -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 58 30 09 00 63 9E 7C 65
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 48 74 C5 FF 34 54 3B DD
|
|
|
|
|
0020 | F8 88 01 BE 34 4A 3C 4D</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 98 08 06 00 98 A2 7C 65
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE B3 E1 D2 FA 3E 92 73 28
|
|
|
|
|
0020 | 94 C0 7D AE C7 C7 8E 10</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>58300900639E7C65</code></td>
|
|
|
|
|
<td><code>9808060098A27C65</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>4874C5FF34543BDDF88801BE344A3C4D</code></td>
|
|
|
|
|
<td><code>B3E1D2FA3E92732894C07DAEC7C78E10</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 E8 74 D1 63 9E 7C 65
|
|
|
|
|
0010 | CC 00 00 00 63 24 16 05 48 74 C5 FF 34 54 3B DD
|
|
|
|
|
0020 | F8 88 01 BE 34 4A 3C 4D 69 08 BA 9B 24 01 96 62
|
|
|
|
|
0030 | 11 6F B5 4B DC 8A D3 61 08 14 5B FB 90 DC C8 80
|
|
|
|
|
0040 | B7 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 58 27 E7 98 A2 7C 65
|
|
|
|
|
0010 | 70 00 00 00 63 24 16 05 B3 E1 D2 FA 3E 92 73 28
|
|
|
|
|
0020 | 94 C0 7D AE C7 C7 8E 10 C6 DB 85 F8 40 93 C7 5A
|
|
|
|
|
0030 | FE 46 DC 80 3D D1 2C C0 08 19 CD D4 06 35 4D 32
|
|
|
|
|
0040 | 8B 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>01E874D1639E7C65</code></td>
|
|
|
|
|
<td><code>015827E798A27C65</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>CC000000</code> (204 in decimal)</td>
|
|
|
|
|
<td><code>70000000</code> (112 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>4874C5FF34543BDDF88801BE344A3C4D</code></td>
|
|
|
|
|
<td><code>B3E1D2FA3E92732894C07DAEC7C78E10</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>6908BA9B24019662116FB54BDC8AD361</code></td>
|
|
|
|
|
<td><code>C6DB85F84093C75AFE46DC803DD12CC0</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>08145BFB90DCC880B7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1467042703237218487</td>
|
|
|
|
|
<td><code>0819CDD406354D328B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1859375344303026827</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 = 1467042703237218487</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1467042703237218487 = 1177597013 * 1245793499</code></p>
|
|
|
|
|
<pre><code>p = 1177597013
|
|
|
|
|
q = 1245793499</code></pre>
|
|
|
|
|
<pre><code>pq = 1859375344303026827</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1859375344303026827 = 1111389791 * 1673018197</code></p>
|
|
|
|
|
<pre><code>p = 1111389791
|
|
|
|
|
q = 1673018197</code></pre>
|
|
|
|
|
<!-- end pq -->
|
|
|
|
|
<h4><a class="anchor" href="#presenting-proof-of-work-server-authentication" id="presenting-proof-of-work-server-authentication" name="presenting-proof-of-work-server-authentication"><i class="anchor-icon"></i></a>Presenting proof of work; Server authentication</h4>
|
|
|
|
|
<h5><a class="anchor" href="#4-encrypted-data-payload-generation" id="4-encrypted-data-payload-generation" name="4-encrypted-data-payload-generation"><i class="anchor-icon"></i></a>4) <code>encrypted_data</code> payload generation</h5>
|
|
|
|
|
<p>First of all, generate an <code>encrypted_data</code> payload as follows:</p>
|
|
|
|
|
<!-- start p_q_inner_data_dc -->
|
|
|
|
|
<p>Generated payload (excluding transport headers/trailers):</p>
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 14 5B FB 90 DC C8 80 B7 00 00 00
|
|
|
|
|
0010 | 04 46 30 B4 55 00 00 00 04 4A 41 4C DB 00 00 00
|
|
|
|
|
0020 | 48 74 C5 FF 34 54 3B DD F8 88 01 BE 34 4A 3C 4D
|
|
|
|
|
0030 | 69 08 BA 9B 24 01 96 62 11 6F B5 4B DC 8A D3 61
|
|
|
|
|
0040 | FB D1 99 C5 22 9B ED 61 AB 48 A8 87 E3 8A 1B 0C
|
|
|
|
|
0050 | 1A 6C 15 D7 D4 BF 10 D8 D4 4D D8 07 DB F5 4F 8D
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 19 CD D4 06 35 4D 32 8B 00 00 00
|
|
|
|
|
0010 | 04 42 3E 76 5F 00 00 00 04 63 B8 3B 55 00 00 00
|
|
|
|
|
0020 | B3 E1 D2 FA 3E 92 73 28 94 C0 7D AE C7 C7 8E 10
|
|
|
|
|
0030 | C6 DB 85 F8 40 93 C7 5A FE 46 DC 80 3D D1 2C C0
|
|
|
|
|
0040 | 79 CC 58 58 47 1C FD A6 B4 97 F9 E2 BF 04 0F 49
|
|
|
|
|
0050 | 3B 00 12 A9 F2 8F 14 78 FE 58 D6 2E 83 65 98 F8
|
|
|
|
|
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 = 1245793499</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>08145BFB90DCC880B7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1467042703237218487</td>
|
|
|
|
|
<td><code>0819CDD406354D328B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1859375344303026827</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>044630B455000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1177597013</td>
|
|
|
|
|
<td><code>04423E765F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1111389791</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>044A414CDB000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1245793499</td>
|
|
|
|
|
<td><code>0463B83B55000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1673018197</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>4874C5FF34543BDDF88801BE344A3C4D</code></td>
|
|
|
|
|
<td><code>B3E1D2FA3E92732894C07DAEC7C78E10</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>6908BA9B24019662116FB54BDC8AD361</code></td>
|
|
|
|
|
<td><code>C6DB85F84093C75AFE46DC803DD12CC0</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>FBD199C5229BED61AB48A887E38A1B0C</code> <code>1A6C15D7D4BF10D8D44DD807DBF54F8D</code></td>
|
|
|
|
|
<td><code>79CC5858471CFDA6B497F9E2BF040F49</code> <code>3B0012A9F28F1478FE58D62E836598F8</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1245793499</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 = 955FF5A908145BFB90DCC880B7000000044630B455000000044A414CDB0000004874C5FF34543BDDF88801BE344A3C4D6908BA9B24019662116FB54BDC8AD361FBD199C5229BED61AB48A887E38A1B0C1A6C15D7D4BF10D8D44DD807DBF54F8D02000000
|
|
|
|
|
random_padding_bytes = 0A19ECA57E3223E5F0F5091A57965F3BF705C668F1A079E6FFC6F38B0BDA876F3DEC701AA97E846E1D24124E3B18870DE8324914A4322CDF11912A40DD999778F6C682B1B74686F8A24EA4D0B3319E06CCC87D315F8FEF8AA56D0081</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A90819CDD406354D328B00000004423E765F0000000463B83B55000000B3E1D2FA3E92732894C07DAEC7C78E10C6DB85F84093C75AFE46DC803DD12CC079CC5858471CFDA6B497F9E2BF040F493B0012A9F28F1478FE58D62E836598F802000000
|
|
|
|
|
random_padding_bytes = E7F74A6D71E32CEACFCC8D2EFF77E4E1166730349B66B0E1EF5CC7DDA92BE7CF04ED61C63727BA6C03AA642F432168F37A15CDCD18F6FB8D63DD590F91E372A5ABF39F7127E969F53067113DBE11EF6096BF8FEA696C1789052A57B4</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 = 748798283453DD7DD0144E227464802F49763EFCCC6F2D1B374A189964F62D6932AA905B245BFD89492CD41905ED4EFD18EFFDF58729C144EEFFA6C65B0BD29D7834FEB4593B85762E715184A57793C78C6160237C653279F518272674C2DF420B440D8F1475C0CB61B168589D78620C224B76A94B2BB01F16EEDD8CA95757FED3947314496B03ED60523EB40F72EB17E75CB678B0ED55D4CD4631828045545ADC29FFC777FAC4D11AD4082A9C0BDE6832A240F62E1A823FF32A0C2B7C9213D40FB281890C443CC0F46C88F7440377AC7830FA2969A64975C8A183E42BC0041BE0620C4D20F473BE101DD90252D4BAF98294E05BE106EDC26C37359413A065B0</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 91F39BFC3BAEEA8E3319DA8C9CBF6660DFEB69CFB8CF2F3A9B46E93540B622E1D9BB1837F228E1DD5971EFD7361154569FF96E87E3171AECA82F034625DB87D02A9910071C70BD12D09F2129ED7FF1B51F64ED41EAFBACEB73A2AE005E6708DAD8220CC1C0D603A79F6F9E3B1DA51A718C50CE7925E6FCFA9E5DEF35CF6AEE8F36A6EE7DC8E822B4F40D57D5BE138FB2FDEE9FCEF955CA2F8337BF861FE133A2677CC4384B29C13B3BBA3EBC810C592793727B4089A9F9503617401D27C174A0CFF51B56E461DB414F62C95A080D7C970A52BA7AAB88B2517AA08EC6E0CD3604A1D50CB09F37397DCB0ED324267CAC3AEBCB7D9FD5BF1A9B9675CA448930AB5C</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 5C 30 09 00 63 9E 7C 65
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 48 74 C5 FF 34 54 3B DD
|
|
|
|
|
0020 | F8 88 01 BE 34 4A 3C 4D 69 08 BA 9B 24 01 96 62
|
|
|
|
|
0030 | 11 6F B5 4B DC 8A D3 61 04 46 30 B4 55 00 00 00
|
|
|
|
|
0040 | 04 4A 41 4C DB 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 74 87 98 28 34 53 DD 7D D0 14 4E 22
|
|
|
|
|
0060 | 74 64 80 2F 49 76 3E FC CC 6F 2D 1B 37 4A 18 99
|
|
|
|
|
0070 | 64 F6 2D 69 32 AA 90 5B 24 5B FD 89 49 2C D4 19
|
|
|
|
|
0080 | 05 ED 4E FD 18 EF FD F5 87 29 C1 44 EE FF A6 C6
|
|
|
|
|
0090 | 5B 0B D2 9D 78 34 FE B4 59 3B 85 76 2E 71 51 84
|
|
|
|
|
00A0 | A5 77 93 C7 8C 61 60 23 7C 65 32 79 F5 18 27 26
|
|
|
|
|
00B0 | 74 C2 DF 42 0B 44 0D 8F 14 75 C0 CB 61 B1 68 58
|
|
|
|
|
00C0 | 9D 78 62 0C 22 4B 76 A9 4B 2B B0 1F 16 EE DD 8C
|
|
|
|
|
00D0 | A9 57 57 FE D3 94 73 14 49 6B 03 ED 60 52 3E B4
|
|
|
|
|
00E0 | 0F 72 EB 17 E7 5C B6 78 B0 ED 55 D4 CD 46 31 82
|
|
|
|
|
00F0 | 80 45 54 5A DC 29 FF C7 77 FA C4 D1 1A D4 08 2A
|
|
|
|
|
0100 | 9C 0B DE 68 32 A2 40 F6 2E 1A 82 3F F3 2A 0C 2B
|
|
|
|
|
0110 | 7C 92 13 D4 0F B2 81 89 0C 44 3C C0 F4 6C 88 F7
|
|
|
|
|
0120 | 44 03 77 AC 78 30 FA 29 69 A6 49 75 C8 A1 83 E4
|
|
|
|
|
0130 | 2B C0 04 1B E0 62 0C 4D 20 F4 73 BE 10 1D D9 02
|
|
|
|
|
0140 | 52 D4 BA F9 82 94 E0 5B E1 06 ED C2 6C 37 35 94
|
|
|
|
|
0150 | 13 A0 65 B0</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 EC DB 07 00 99 A2 7C 65
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 B3 E1 D2 FA 3E 92 73 28
|
|
|
|
|
0020 | 94 C0 7D AE C7 C7 8E 10 C6 DB 85 F8 40 93 C7 5A
|
|
|
|
|
0030 | FE 46 DC 80 3D D1 2C C0 04 42 3E 76 5F 00 00 00
|
|
|
|
|
0040 | 04 63 B8 3B 55 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 91 F3 9B FC 3B AE EA 8E 33 19 DA 8C
|
|
|
|
|
0060 | 9C BF 66 60 DF EB 69 CF B8 CF 2F 3A 9B 46 E9 35
|
|
|
|
|
0070 | 40 B6 22 E1 D9 BB 18 37 F2 28 E1 DD 59 71 EF D7
|
|
|
|
|
0080 | 36 11 54 56 9F F9 6E 87 E3 17 1A EC A8 2F 03 46
|
|
|
|
|
0090 | 25 DB 87 D0 2A 99 10 07 1C 70 BD 12 D0 9F 21 29
|
|
|
|
|
00A0 | ED 7F F1 B5 1F 64 ED 41 EA FB AC EB 73 A2 AE 00
|
|
|
|
|
00B0 | 5E 67 08 DA D8 22 0C C1 C0 D6 03 A7 9F 6F 9E 3B
|
|
|
|
|
00C0 | 1D A5 1A 71 8C 50 CE 79 25 E6 FC FA 9E 5D EF 35
|
|
|
|
|
00D0 | CF 6A EE 8F 36 A6 EE 7D C8 E8 22 B4 F4 0D 57 D5
|
|
|
|
|
00E0 | BE 13 8F B2 FD EE 9F CE F9 55 CA 2F 83 37 BF 86
|
|
|
|
|
00F0 | 1F E1 33 A2 67 7C C4 38 4B 29 C1 3B 3B BA 3E BC
|
|
|
|
|
0100 | 81 0C 59 27 93 72 7B 40 89 A9 F9 50 36 17 40 1D
|
|
|
|
|
0110 | 27 C1 74 A0 CF F5 1B 56 E4 61 DB 41 4F 62 C9 5A
|
|
|
|
|
0120 | 08 0D 7C 97 0A 52 BA 7A AB 88 B2 51 7A A0 8E C6
|
|
|
|
|
0130 | E0 CD 36 04 A1 D5 0C B0 9F 37 39 7D CB 0E D3 24
|
|
|
|
|
0140 | 26 7C AC 3A EB CB 7D 9F D5 BF 1A 9B 96 75 CA 44
|
|
|
|
|
0150 | 89 30 AB 5C</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 = 0A19ECA57E3223E5F0F5091A57965F3BF705C668F1A079E6FFC6F38B0
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>5C300900639E7C65</code></td>
|
|
|
|
|
<td><code>ECDB070099A27C65</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 = 0A19ECA57E3223E5F0F5091A57965F3BF705C668F1A079E6FFC6F38B0
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>4874C5FF34543BDDF88801BE344A3C4D</code></td>
|
|
|
|
|
<td><code>B3E1D2FA3E92732894C07DAEC7C78E10</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>6908BA9B24019662116FB54BDC8AD361</code></td>
|
|
|
|
|
<td><code>C6DB85F84093C75AFE46DC803DD12CC0</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>044630B455000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1177597013</td>
|
|
|
|
|
<td><code>04423E765F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1111389791</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>044A414CDB000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1245793499</td>
|
|
|
|
|
<td><code>0463B83B55000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1673018197</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 = 0A19ECA57E3223E5F0F5091A57965F3BF705C668F1A079E6FFC6F38B0
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE000100748798283453DD7DD0144E22</code> <code>7464802F49763EFCCC6F2D1B374A1899</code> <code>64F62D6932AA905B245BFD89492CD419</code> <code>05ED4EFD18EFFDF58729C144EEFFA6C6</code> <code>5B0BD29D7834FEB4593B85762E715184</code> <code>A57793C78C6160237C653279F5182726</code> <code>74C2DF420B440D8F1475C0CB61B16858</code> <code>9D78620C224B76A94B2BB01F16EEDD8C</code> <code>A95757FED3947314496B03ED60523EB4</code> <code>0F72EB17E75CB678B0ED55D4CD463182</code> <code>8045545ADC29FFC777FAC4D11AD4082A</code> <code>9C0BDE6832A240F62E1A823FF32A0C2B</code> <code>7C9213D40FB281890C443CC0F46C88F7</code> <code>440377AC7830FA2969A64975C8A183E4</code> <code>2BC0041BE0620C4D20F473BE101DD902</code> <code>52D4BAF98294E05BE106EDC26C373594</code><br> <code>13A065B0</code></td>
|
|
|
|
|
<td><code>FE00010091F39BFC3BAEEA8E3319DA8C</code> <code>9CBF6660DFEB69CFB8CF2F3A9B46E935</code> <code>40B622E1D9BB1837F228E1DD5971EFD7</code> <code>361154569FF96E87E3171AECA82F0346</code> <code>25DB87D02A9910071C70BD12D09F2129</code> <code>ED7FF1B51F64ED41EAFBACEB73A2AE00</code> <code>5E6708DAD8220CC1C0D603A79F6F9E3B</code> <code>1DA51A718C50CE7925E6FCFA9E5DEF35</code> <code>CF6AEE8F36A6EE7DC8E822B4F40D57D5</code> <code>BE138FB2FDEE9FCEF955CA2F8337BF86</code> <code>1FE133A2677CC4384B29C13B3BBA3EBC</code> <code>810C592793727B4089A9F9503617401D</code> <code>27C174A0CFF51B56E461DB414F62C95A</code> <code>080D7C970A52BA7AAB88B2517AA08EC6</code> <code>E0CD3604A1D50CB09F37397DCB0ED324</code> <code>267CAC3AEBCB7D9FD5BF1A9B9675CA44</code><br> <code>8930AB5C</code></td>
|
|
|
|
|
<td>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = 0A19ECA57E3223E5F0F5091A57965F3BF705C668F1A079E6FFC6F38B0
|
|
|
|
|
<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 98 02 85 64 9E 7C 65
|
|
|
|
|
0010 | 94 02 00 00 5C 07 E8 D0 48 74 C5 FF 34 54 3B DD
|
|
|
|
|
0020 | F8 88 01 BE 34 4A 3C 4D 69 08 BA 9B 24 01 96 62
|
|
|
|
|
0030 | 11 6F B5 4B DC 8A D3 61 FE 50 02 00 D7 3B 28 3E
|
|
|
|
|
0040 | B3 CF DE 2D 06 45 24 F9 B5 03 CC 85 2D 1D 46 07
|
|
|
|
|
0050 | 7C 55 91 6F ED C6 76 55 7C EB 47 96 AE 9C 5F 2A
|
|
|
|
|
0060 | DD 74 6E 0D D4 4D 7F 64 0C F6 52 D5 70 43 71 93
|
|
|
|
|
0070 | 87 F8 78 2E 8B 69 65 02 5D 03 FE 47 17 50 F1 14
|
|
|
|
|
0080 | 64 9F 5B F0 A2 A2 31 EA 28 99 64 B0 E0 A9 9B 37
|
|
|
|
|
0090 | CD 59 EF 9D 41 81 BB 5A 63 A4 57 C5 2A 5D 9A 78
|
|
|
|
|
00A0 | 4C 79 B5 88 CB 14 F1 CA CC D9 C1 E5 2D EB 71 B6
|
|
|
|
|
00B0 | FC F8 C4 C3 8E 76 4D 90 52 6C 4E 13 72 8F B2 96
|
|
|
|
|
00C0 | DB 6B BA 50 5E 1C D2 9A EE EF 10 1A D2 C7 99 AF
|
|
|
|
|
00D0 | 46 D6 7F 89 FA EC 5A 88 BD 1E 7C 00 4A 44 40 D8
|
|
|
|
|
00E0 | B9 25 A6 C2 A3 EE 56 CF 43 6E 97 FB 5A 2C 31 AD
|
|
|
|
|
00F0 | F4 48 1D 7D 68 15 14 F8 9F 0E B4 15 1F C7 0D 6D
|
|
|
|
|
0100 | F1 64 1B B0 58 44 40 04 0E CC 73 13 C5 98 2C 11
|
|
|
|
|
0110 | B0 EF 8E E4 62 56 F4 36 28 BF 53 65 B0 D8 C4 F3
|
|
|
|
|
0120 | 80 F8 BC C1 E1 31 93 B5 01 92 0C 73 F3 D4 1E 8D
|
|
|
|
|
0130 | 9A 2B 84 8E D3 86 7C 3D 9F 5E DC 71 1A B8 57 C7
|
|
|
|
|
0140 | 90 C1 CC 4A 48 72 CB 7A 4A E8 9A 1A F3 7E 56 24
|
|
|
|
|
0150 | 7E E7 B7 73 7A 0C EB 11 1F C6 48 9F B7 40 E8 EE
|
|
|
|
|
0160 | 10 15 A0 5A BA 5D 3A B7 E0 62 3A 7D CB 80 64 56
|
|
|
|
|
0170 | 40 3B F8 DA 6F 0A 2A 3B 20 FC C5 B5 8A D1 05 DD
|
|
|
|
|
0180 | C6 1E 1A 18 F7 30 D9 5B 94 EC 20 44 1B E2 71 DB
|
|
|
|
|
0190 | 51 DC 78 8F C3 C5 E5 E5 B4 76 79 9C CD CE E8 55
|
|
|
|
|
01A0 | F2 C8 C5 3B 5D E8 72 8F 52 2A 04 47 F8 07 18 0A
|
|
|
|
|
01B0 | C8 FD 8D A0 5C 90 5F A7 3C 72 05 B8 6B 9C F3 6C
|
|
|
|
|
01C0 | CC 90 C9 FD 7E 26 B6 50 68 51 4F 31 98 36 1A 15
|
|
|
|
|
01D0 | 42 9C 3E 9B 18 1F 7A 36 2C 56 E4 4C 9A 3A C1 A9
|
|
|
|
|
01E0 | 62 A6 4F C3 92 4F C3 80 9A DF 0F F8 05 B3 30 AE
|
|
|
|
|
01F0 | D6 46 94 68 8B 10 9B 39 4D D7 64 37 99 36 31 9E
|
|
|
|
|
0200 | 4A 2C F9 E3 62 F9 0A BE 8E 77 CD F1 00 67 21 F9
|
|
|
|
|
0210 | CC 90 1B 82 CF C2 6A 9B 34 B9 46 BD B4 C2 F3 B4
|
|
|
|
|
0220 | 98 45 F0 0E 28 EF 2F 31 10 AE 6B 4F 44 34 98 2B
|
|
|
|
|
0230 | 4E 19 83 3A 1A BE 7C 1E A8 A8 12 CC D4 9B 81 2B
|
|
|
|
|
0240 | 19 EA 70 F2 82 62 FD A7 DB 77 E9 E4 4B C8 FB BC
|
|
|
|
|
0250 | 6D 36 39 AE C9 25 C2 6A B9 BD 92 1D 68 6F 82 D0
|
|
|
|
|
0260 | 25 61 76 3E B5 EB CE 34 EA 10 F1 C9 E5 77 C7 22
|
|
|
|
|
0270 | A2 91 56 D0 84 0E E8 DB B9 7F B3 71 44 E6 EA 9B
|
|
|
|
|
0280 | 4C 9F DD FE 60 2F A3 E1 D6 BC C5 AE</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 78 F1 98 99 A2 7C 65
|
|
|
|
|
0010 | 94 02 00 00 5C 07 E8 D0 B3 E1 D2 FA 3E 92 73 28
|
|
|
|
|
0020 | 94 C0 7D AE C7 C7 8E 10 C6 DB 85 F8 40 93 C7 5A
|
|
|
|
|
0030 | FE 46 DC 80 3D D1 2C C0 FE 50 02 00 FA 52 6D CF
|
|
|
|
|
0040 | 96 01 7C 62 13 A1 84 AA 95 17 BA B3 9A 4C B4 C6
|
|
|
|
|
0050 | D2 FF 14 C2 BB 59 53 6E D1 B6 5C 06 13 45 11 E0
|
|
|
|
|
0060 | BB 18 0B 50 48 62 24 0D 4A 7D B3 92 82 41 E2 6F
|
|
|
|
|
0070 | 07 2E 30 E0 CF 96 87 44 C0 65 0C 51 42 46 79 1E
|
|
|
|
|
0080 | AB 89 E7 8D 5A 92 79 3B 79 2A E9 ED 60 BD CB A0
|
|
|
|
|
0090 | 01 61 E9 63 2C 49 7E 31 D5 39 E3 84 14 17 F6 13
|
|
|
|
|
00A0 | 40 F7 B8 CA 98 13 34 93 20 C1 E7 91 F2 6F D5 E7
|
|
|
|
|
00B0 | C0 7B 53 89 DE CF DB 88 F8 7B FB F6 F9 FD 62 4E
|
|
|
|
|
00C0 | A6 5F 47 7B 2C C9 CD 43 EF E1 50 41 D3 65 C0 3C
|
|
|
|
|
00D0 | 01 73 5A 82 22 27 AA 02 C1 7C 04 19 7B A4 32 91
|
|
|
|
|
00E0 | 05 E9 76 7D 12 E9 C9 C4 8A 55 23 21 A8 C0 42 6D
|
|
|
|
|
00F0 | FB 08 CC 47 B7 D5 EE 04 7A AD CD 34 E4 3D 17 4C
|
|
|
|
|
0100 | 42 AD 33 28 87 C5 EA 93 77 55 2A 9E 2A 20 AD 06
|
|
|
|
|
0110 | 8B 61 EB F3 CC 57 A3 FB F7 E2 98 3C 22 23 66 8E
|
|
|
|
|
0120 | 63 77 20 8F C7 3B 7E DB 9A CE F2 62 76 15 FC 43
|
|
|
|
|
0130 | FE B5 6C 94 81 58 B2 40 24 64 A9 3F 32 41 B8 18
|
|
|
|
|
0140 | 8D 7B 7E 59 95 03 0B 7B 1C 4D F0 77 4A 0F 8A 0D
|
|
|
|
|
0150 | D8 E5 F4 4D 03 32 72 D8 F3 73 00 CB 11 3F 39 B8
|
|
|
|
|
0160 | 20 3A 55 12 CF 94 8A 25 45 DB AF 9F 26 A5 B0 A1
|
|
|
|
|
0170 | A8 CB BB C0 42 ED 52 14 DF 23 11 2B DC 11 9D B4
|
|
|
|
|
0180 | 87 53 74 A1 22 91 A0 BA A4 CF 0A 96 81 A7 AC 73
|
|
|
|
|
0190 | AD 5C 67 C1 C4 C7 6E DF 15 11 6D 13 50 61 EF F2
|
|
|
|
|
01A0 | C5 D9 26 2A 9E 9C DA 47 13 B0 58 1F D0 AB 3B E2
|
|
|
|
|
01B0 | 88 69 4C F5 16 43 C7 63 DD 23 33 4D DD D8 F0 F0
|
|
|
|
|
01C0 | FC 2C 22 C7 74 B2 9B 4F AE ED 11 94 37 E8 D6 31
|
|
|
|
|
01D0 | 68 9E 35 83 7D 3D C1 A9 34 54 E7 B0 9C 12 E4 95
|
|
|
|
|
01E0 | 7F 6A 3A 0D 85 A5 D0 6D 1A E3 F5 3D 90 F1 A4 B3
|
|
|
|
|
01F0 | EC DB EB 35 0D FC E4 8F 45 54 DC DC 9C 9E 53 63
|
|
|
|
|
0200 | 65 E7 EB A0 6B 77 9C 40 31 24 A0 1B B5 55 49 6A
|
|
|
|
|
0210 | CB 32 47 D8 DB 93 C7 46 10 DB 93 EF 6C A8 7B 84
|
|
|
|
|
0220 | 63 87 DC A8 4A 33 26 44 DD 0B 0F 05 45 F6 04 26
|
|
|
|
|
0230 | 47 DE E3 7E 5F DC 2C 33 82 E3 DC 52 1E 40 7D 43
|
|
|
|
|
0240 | DE 42 55 51 8D 65 54 05 9E C6 1D 6C 0C AB E7 D1
|
|
|
|
|
0250 | D2 22 46 B8 4B 84 6D 4A 4B 61 E7 16 73 3E CB E2
|
|
|
|
|
0260 | CB FF FD 77 CC DF 49 2F B4 7F 47 CE A7 D9 0C 3A
|
|
|
|
|
0270 | CF B1 99 76 E4 4B F2 2A 4D 6F A7 65 9D 91 E1 14
|
|
|
|
|
0280 | F5 3C 36 05 1F 5C B3 E5 18 6F 74 B5</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,7 +464,7 @@ random_padding_bytes = 0A19ECA57E3223E5F0F5091A57965F3BF705C668F1A079E6FFC6F38B0
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>01980285649E7C65</code></td>
|
|
|
|
|
<td><code>0178F19899A27C65</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>
|
|
|
|
@ -482,19 +482,19 @@ random_padding_bytes = 0A19ECA57E3223E5F0F5091A57965F3BF705C668F1A079E6FFC6F38B0
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>4874C5FF34543BDDF88801BE344A3C4D</code></td>
|
|
|
|
|
<td><code>B3E1D2FA3E92732894C07DAEC7C78E10</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>6908BA9B24019662116FB54BDC8AD361</code></td>
|
|
|
|
|
<td><code>C6DB85F84093C75AFE46DC803DD12CC0</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE500200D73B283EB3CFDE2D064524F9</code> <code>B503CC852D1D46077C55916FEDC67655</code> <code>7CEB4796AE9C5F2ADD746E0DD44D7F64</code> <code>0CF652D57043719387F8782E8B696502</code> <code>5D03FE471750F114649F5BF0A2A231EA</code> <code>289964B0E0A99B37CD59EF9D4181BB5A</code> <code>63A457C52A5D9A784C79B588CB14F1CA</code> <code>CCD9C1E52DEB71B6FCF8C4C38E764D90</code> <code>526C4E13728FB296DB6BBA505E1CD29A</code> <code>EEEF101AD2C799AF46D67F89FAEC5A88</code> <code>BD1E7C004A4440D8B925A6C2A3EE56CF</code> <code>436E97FB5A2C31ADF4481D7D681514F8</code> <code>9F0EB4151FC70D6DF1641BB058444004</code> <code>0ECC7313C5982C11B0EF8EE46256F436</code> <code>28BF5365B0D8C4F380F8BCC1E13193B5</code> <code>01920C73F3D41E8D9A2B848ED3867C3D</code> <code>9F5EDC711AB857C790C1CC4A4872CB7A</code> <code>4AE89A1AF37E56247EE7B7737A0CEB11</code> <code>1FC6489FB740E8EE1015A05ABA5D3AB7</code> <code>E0623A7DCB806456403BF8DA6F0A2A3B</code> <code>20FCC5B58AD105DDC61E1A18F730D95B</code> <code>94EC20441BE271DB51DC788FC3C5E5E5</code> <code>B476799CCDCEE855F2C8C53B5DE8728F</code> <code>522A0447F807180AC8FD8DA05C905FA7</code> <code>3C7205B86B9CF36CCC90C9FD7E26B650</code> <code>68514F3198361A15429C3E9B181F7A36</code> <code>2C56E44C9A3AC1A962A64FC3924FC380</code> <code>9ADF0FF805B330AED64694688B109B39</code> <code>4DD764379936319E4A2CF9E362F90ABE</code> <code>8E77CDF1006721F9CC901B82CFC26A9B</code> <code>34B946BDB4C2F3B49845F00E28EF2F31</code> <code>10AE6B4F4434982B4E19833A1ABE7C1E</code> <code>A8A812CCD49B812B19EA70F28262FDA7</code> <code>DB77E9E44BC8FBBC6D3639AEC925C26A</code> <code>B9BD921D686F82D02561763EB5EBCE34</code> <code>EA10F1C9E577C722A29156D0840EE8DB</code> <code>B97FB37144E6EA9B4C9FDDFE602FA3E1</code><br> <code>D6BCC5AE</code></td>
|
|
|
|
|
<td><code>FE500200FA526DCF96017C6213A184AA</code> <code>9517BAB39A4CB4C6D2FF14C2BB59536E</code> <code>D1B65C06134511E0BB180B504862240D</code> <code>4A7DB3928241E26F072E30E0CF968744</code> <code>C0650C514246791EAB89E78D5A92793B</code> <code>792AE9ED60BDCBA00161E9632C497E31</code> <code>D539E3841417F61340F7B8CA98133493</code> <code>20C1E791F26FD5E7C07B5389DECFDB88</code> <code>F87BFBF6F9FD624EA65F477B2CC9CD43</code> <code>EFE15041D365C03C01735A822227AA02</code> <code>C17C04197BA4329105E9767D12E9C9C4</code> <code>8A552321A8C0426DFB08CC47B7D5EE04</code> <code>7AADCD34E43D174C42AD332887C5EA93</code> <code>77552A9E2A20AD068B61EBF3CC57A3FB</code> <code>F7E2983C2223668E6377208FC73B7EDB</code> <code>9ACEF2627615FC43FEB56C948158B240</code> <code>2464A93F3241B8188D7B7E5995030B7B</code> <code>1C4DF0774A0F8A0DD8E5F44D033272D8</code> <code>F37300CB113F39B8203A5512CF948A25</code> <code>45DBAF9F26A5B0A1A8CBBBC042ED5214</code> <code>DF23112BDC119DB4875374A12291A0BA</code> <code>A4CF0A9681A7AC73AD5C67C1C4C76EDF</code> <code>15116D135061EFF2C5D9262A9E9CDA47</code> <code>13B0581FD0AB3BE288694CF51643C763</code> <code>DD23334DDDD8F0F0FC2C22C774B29B4F</code> <code>AEED119437E8D631689E35837D3DC1A9</code> <code>3454E7B09C12E4957F6A3A0D85A5D06D</code> <code>1AE3F53D90F1A4B3ECDBEB350DFCE48F</code> <code>4554DCDC9C9E536365E7EBA06B779C40</code> <code>3124A01BB555496ACB3247D8DB93C746</code> <code>10DB93EF6CA87B846387DCA84A332644</code> <code>DD0B0F0545F6042647DEE37E5FDC2C33</code> <code>82E3DC521E407D43DE4255518D655405</code> <code>9EC61D6C0CABE7D1D22246B84B846D4A</code> <code>4B61E716733ECBE2CBFFFD77CCDF492F</code> <code>B47F47CEA7D90C3ACFB19976E44BF22A</code> <code>4D6FA7659D91E114F53C36051F5CB3E5</code><br> <code>186F74B5</code></td>
|
|
|
|
|
<td>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = 0A19ECA57E3223E5F0F5091A57965F3BF705C668F1A079E6FFC6F38B0
|
|
|
|
|
<!-- 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 = D73B283EB3CFDE2D064524F9B503CC852D1D46077C55916FEDC676557CEB4796AE9C5F2ADD746E0DD44D7F640CF652D57043719387F8782E8B6965025D03FE471750F114649F5BF0A2A231EA289964B0E0A99B37CD59EF9D4181BB5A63A457C52A5D9A784C79B588CB14F1CACCD9C1E52DEB71B6FCF8C4C38E764D90526C4E13728FB296DB6BBA505E1CD29AEEEF101AD2C799AF46D67F89FAEC5A88BD1E7C004A4440D8B925A6C2A3EE56CF436E97FB5A2C31ADF4481D7D681514F89F0EB4151FC70D6DF1641BB0584440040ECC7313C5982C11B0EF8EE46256F43628BF5365B0D8C4F380F8BCC1E13193B501920C73F3D41E8D9A2B848ED3867C3D9F5EDC711AB857C790C1CC4A4872CB7A4AE89A1AF37E56247EE7B7737A0CEB111FC6489FB740E8EE1015A05ABA5D3AB7E0623A7DCB806456403BF8DA6F0A2A3B20FCC5B58AD105DDC61E1A18F730D95B94EC20441BE271DB51DC788FC3C5E5E5B476799CCDCEE855F2C8C53B5DE8728F522A0447F807180AC8FD8DA05C905FA73C7205B86B9CF36CCC90C9FD7E26B65068514F3198361A15429C3E9B181F7A362C56E44C9A3AC1A962A64FC3924FC3809ADF0FF805B330AED64694688B109B394DD764379936319E4A2CF9E362F90ABE8E77CDF1006721F9CC901B82CFC26A9B34B946BDB4C2F3B49845F00E28EF2F3110AE6B4F4434982B4E19833A1ABE7C1EA8A812CCD49B812B19EA70F28262FDA7DB77E9E44BC8FBBC6D3639AEC925C26AB9BD921D686F82D02561763EB5EBCE34EA10F1C9E577C722A29156D0840EE8DBB97FB37144E6EA9B4C9FDDFE602FA3E1D6BCC5AE
|
|
|
|
|
tmp_aes_key = 9CE6361406319F2D525560C55CB735571D2B83E497907255400D1088EA914CE8
|
|
|
|
|
tmp_aes_iv = E7467B94F4DAE2F7303285B9632C08FB25DA82E4947553BF6B4E8EF3FBD199C5</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = FA526DCF96017C6213A184AA9517BAB39A4CB4C6D2FF14C2BB59536ED1B65C06134511E0BB180B504862240D4A7DB3928241E26F072E30E0CF968744C0650C514246791EAB89E78D5A92793B792AE9ED60BDCBA00161E9632C497E31D539E3841417F61340F7B8CA9813349320C1E791F26FD5E7C07B5389DECFDB88F87BFBF6F9FD624EA65F477B2CC9CD43EFE15041D365C03C01735A822227AA02C17C04197BA4329105E9767D12E9C9C48A552321A8C0426DFB08CC47B7D5EE047AADCD34E43D174C42AD332887C5EA9377552A9E2A20AD068B61EBF3CC57A3FBF7E2983C2223668E6377208FC73B7EDB9ACEF2627615FC43FEB56C948158B2402464A93F3241B8188D7B7E5995030B7B1C4DF0774A0F8A0DD8E5F44D033272D8F37300CB113F39B8203A5512CF948A2545DBAF9F26A5B0A1A8CBBBC042ED5214DF23112BDC119DB4875374A12291A0BAA4CF0A9681A7AC73AD5C67C1C4C76EDF15116D135061EFF2C5D9262A9E9CDA4713B0581FD0AB3BE288694CF51643C763DD23334DDDD8F0F0FC2C22C774B29B4FAEED119437E8D631689E35837D3DC1A93454E7B09C12E4957F6A3A0D85A5D06D1AE3F53D90F1A4B3ECDBEB350DFCE48F4554DCDC9C9E536365E7EBA06B779C403124A01BB555496ACB3247D8DB93C74610DB93EF6CA87B846387DCA84A332644DD0B0F0545F6042647DEE37E5FDC2C3382E3DC521E407D43DE4255518D6554059EC61D6C0CABE7D1D22246B84B846D4A4B61E716733ECBE2CBFFFD77CCDF492FB47F47CEA7D90C3ACFB19976E44BF22A4D6FA7659D91E114F53C36051F5CB3E5186F74B5
|
|
|
|
|
tmp_aes_key = 656C62150D07208FBFD43F699694392BEA12420FB0FCF97F38EB133362C8D42B
|
|
|
|
|
tmp_aes_iv = C4C17A57E0E1B321E7B09EED0E7F2DF2B7309129E23AFF664C4B867D79CC5858</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = 340E573FDF32F4F4440A6DB2B6B34FA93C342BCFBA0D89B54874C5FF34543BDDF88801BE344A3C4D6908BA9B24019662116FB54BDC8AD36103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000EA484A94BF797DA07474DF3DF95998F55BD22010BDDE5EB156EF45EA7EB07FA4555D1AC2CD228143E1A78CD22049CE54EF402C2606E98A31D64DF3EBE64ACF018D3BA9CC6D38644ECC08906DF3DF4C8201E536A6987A3E31C66F5C706E97B3DE957532B6616E484F3F3D2472F35638931559B1165D240FAF2B89B794CC985EF9D36A1260C66A0B1C545B71A2A2C31BE164FC5BE7BA79A9A64882DB14983F07D7763614AB3B751235402FAC6A1F7B0397210CC85E307BCBE0893D0FA0859A65D5AF658385FAF4409F68FA49F2754DFC232ECF013B1A94D8DD78E047478ECFE23AD5CCE6367E0D4F583FC94D71E16F6142B6EA69C960491E5704B87705FFCEFFF649E7C657B260CA48B6053D7
|
|
|
|
|
answer = BA0D89B54874C5FF34543BDDF88801BE344A3C4D6908BA9B24019662116FB54BDC8AD36103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001000EA484A94BF797DA07474DF3DF95998F55BD22010BDDE5EB156EF45EA7EB07FA4555D1AC2CD228143E1A78CD22049CE54EF402C2606E98A31D64DF3EBE64ACF018D3BA9CC6D38644ECC08906DF3DF4C8201E536A6987A3E31C66F5C706E97B3DE957532B6616E484F3F3D2472F35638931559B1165D240FAF2B89B794CC985EF9D36A1260C66A0B1C545B71A2A2C31BE164FC5BE7BA79A9A64882DB14983F07D7763614AB3B751235402FAC6A1F7B0397210CC85E307BCBE0893D0FA0859A65D5AF658385FAF4409F68FA49F2754DFC232ECF013B1A94D8DD78E047478ECFE23AD5CCE6367E0D4F583FC94D71E16F6142B6EA69C960491E5704B87705FFCEFFF649E7C657B260CA48B6053D7</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = 30FED3225CBB23C8BF99F7D2F6D006F5A08607E9BA0D89B5B3E1D2FA3E92732894C07DAEC7C78E10C6DB85F84093C75AFE46DC803DD12CC003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100AF8F35A4FCDE6EF5B128119981505BD6A6E483D9FB0A9B58047554E3DB6FA879AC78376E267A114A555D08925411A86C808D6A6CD60B9C028F12A125E766F4F190CDD1DAA106E8510FCD14BD7645A92D10BB72982AD4B7969B89B43BDF26B9187456338D29990B02FFDA9EDA582A29455E1FC169159ADB87B802AE6551EAADDC7F852DC8D54FAE5E309FC939A17308D48614795EDEE4E42E3F72290AA3B28C981A8C17F7E01133A8E93FEF9CBC96BC798C1904349F30DD4C6D49C11FBB19FB52664B672D0271E6A3FB36446BC99AE0E7FF27ECEEC6E5E144CB5ED8AEE22369B2CCCA9A0E9D6D9ADC2CA0527899AA1DE3B505709C5D4653CFA7A88863873CF21B99A27C6582A3BBE184C40C68
|
|
|
|
|
answer = BA0D89B5B3E1D2FA3E92732894C07DAEC7C78E10C6DB85F84093C75AFE46DC803DD12CC003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100AF8F35A4FCDE6EF5B128119981505BD6A6E483D9FB0A9B58047554E3DB6FA879AC78376E267A114A555D08925411A86C808D6A6CD60B9C028F12A125E766F4F190CDD1DAA106E8510FCD14BD7645A92D10BB72982AD4B7969B89B43BDF26B9187456338D29990B02FFDA9EDA582A29455E1FC169159ADB87B802AE6551EAADDC7F852DC8D54FAE5E309FC939A17308D48614795EDEE4E42E3F72290AA3B28C981A8C17F7E01133A8E93FEF9CBC96BC798C1904349F30DD4C6D49C11FBB19FB52664B672D0271E6A3FB36446BC99AE0E7FF27ECEEC6E5E144CB5ED8AEE22369B2CCCA9A0E9D6D9ADC2CA0527899AA1DE3B505709C5D4653CFA7A88863873CF21B99A27C6582A3BBE184C40C68</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 48 74 C5 FF 34 54 3B DD F8 88 01 BE
|
|
|
|
|
0010 | 34 4A 3C 4D 69 08 BA 9B 24 01 96 62 11 6F B5 4B
|
|
|
|
|
0020 | DC 8A D3 61 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 B3 E1 D2 FA 3E 92 73 28 94 C0 7D AE
|
|
|
|
|
0010 | C7 C7 8E 10 C6 DB 85 F8 40 93 C7 5A FE 46 DC 80
|
|
|
|
|
0020 | 3D D1 2C C0 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 = BA0D89B54874C5FF34543BDDF88801BE344A3C4D6908BA9B24019662116FB54BDC8AD36
|
|
|
|
|
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 | 0E A4 84 A9 4B F7 97 DA 07 47 4D F3 DF 95 99 8F
|
|
|
|
|
0140 | 55 BD 22 01 0B DD E5 EB 15 6E F4 5E A7 EB 07 FA
|
|
|
|
|
0150 | 45 55 D1 AC 2C D2 28 14 3E 1A 78 CD 22 04 9C E5
|
|
|
|
|
0160 | 4E F4 02 C2 60 6E 98 A3 1D 64 DF 3E BE 64 AC F0
|
|
|
|
|
0170 | 18 D3 BA 9C C6 D3 86 44 EC C0 89 06 DF 3D F4 C8
|
|
|
|
|
0180 | 20 1E 53 6A 69 87 A3 E3 1C 66 F5 C7 06 E9 7B 3D
|
|
|
|
|
0190 | E9 57 53 2B 66 16 E4 84 F3 F3 D2 47 2F 35 63 89
|
|
|
|
|
01A0 | 31 55 9B 11 65 D2 40 FA F2 B8 9B 79 4C C9 85 EF
|
|
|
|
|
01B0 | 9D 36 A1 26 0C 66 A0 B1 C5 45 B7 1A 2A 2C 31 BE
|
|
|
|
|
01C0 | 16 4F C5 BE 7B A7 9A 9A 64 88 2D B1 49 83 F0 7D
|
|
|
|
|
01D0 | 77 63 61 4A B3 B7 51 23 54 02 FA C6 A1 F7 B0 39
|
|
|
|
|
01E0 | 72 10 CC 85 E3 07 BC BE 08 93 D0 FA 08 59 A6 5D
|
|
|
|
|
01F0 | 5A F6 58 38 5F AF 44 09 F6 8F A4 9F 27 54 DF C2
|
|
|
|
|
0200 | 32 EC F0 13 B1 A9 4D 8D D7 8E 04 74 78 EC FE 23
|
|
|
|
|
0210 | AD 5C CE 63 67 E0 D4 F5 83 FC 94 D7 1E 16 F6 14
|
|
|
|
|
0220 | 2B 6E A6 9C 96 04 91 E5 70 4B 87 70 5F FC EF FF
|
|
|
|
|
0230 | 64 9E 7C 65</code></pre>
|
|
|
|
|
0130 | AF 8F 35 A4 FC DE 6E F5 B1 28 11 99 81 50 5B D6
|
|
|
|
|
0140 | A6 E4 83 D9 FB 0A 9B 58 04 75 54 E3 DB 6F A8 79
|
|
|
|
|
0150 | AC 78 37 6E 26 7A 11 4A 55 5D 08 92 54 11 A8 6C
|
|
|
|
|
0160 | 80 8D 6A 6C D6 0B 9C 02 8F 12 A1 25 E7 66 F4 F1
|
|
|
|
|
0170 | 90 CD D1 DA A1 06 E8 51 0F CD 14 BD 76 45 A9 2D
|
|
|
|
|
0180 | 10 BB 72 98 2A D4 B7 96 9B 89 B4 3B DF 26 B9 18
|
|
|
|
|
0190 | 74 56 33 8D 29 99 0B 02 FF DA 9E DA 58 2A 29 45
|
|
|
|
|
01A0 | 5E 1F C1 69 15 9A DB 87 B8 02 AE 65 51 EA AD DC
|
|
|
|
|
01B0 | 7F 85 2D C8 D5 4F AE 5E 30 9F C9 39 A1 73 08 D4
|
|
|
|
|
01C0 | 86 14 79 5E DE E4 E4 2E 3F 72 29 0A A3 B2 8C 98
|
|
|
|
|
01D0 | 1A 8C 17 F7 E0 11 33 A8 E9 3F EF 9C BC 96 BC 79
|
|
|
|
|
01E0 | 8C 19 04 34 9F 30 DD 4C 6D 49 C1 1F BB 19 FB 52
|
|
|
|
|
01F0 | 66 4B 67 2D 02 71 E6 A3 FB 36 44 6B C9 9A E0 E7
|
|
|
|
|
0200 | FF 27 EC EE C6 E5 E1 44 CB 5E D8 AE E2 23 69 B2
|
|
|
|
|
0210 | CC CA 9A 0E 9D 6D 9A DC 2C A0 52 78 99 AA 1D E3
|
|
|
|
|
0220 | B5 05 70 9C 5D 46 53 CF A7 A8 88 63 87 3C F2 1B
|
|
|
|
|
0230 | 99 A2 7C 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 = BA0D89B54874C5FF34543BDDF88801BE344A3C4D6908BA9B24019662116FB54BDC8AD36
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>4874C5FF34543BDDF88801BE344A3C4D</code></td>
|
|
|
|
|
<td><code>B3E1D2FA3E92732894C07DAEC7C78E10</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>6908BA9B24019662116FB54BDC8AD361</code></td>
|
|
|
|
|
<td><code>C6DB85F84093C75AFE46DC803DD12CC0</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B54874C5FF34543BDDF88801BE344A3C4D6908BA9B24019662116FB54BDC8AD36
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE0001000EA484A94BF797DA07474DF3</code> <code>DF95998F55BD22010BDDE5EB156EF45E</code> <code>A7EB07FA4555D1AC2CD228143E1A78CD</code> <code>22049CE54EF402C2606E98A31D64DF3E</code> <code>BE64ACF018D3BA9CC6D38644ECC08906</code> <code>DF3DF4C8201E536A6987A3E31C66F5C7</code> <code>06E97B3DE957532B6616E484F3F3D247</code> <code>2F35638931559B1165D240FAF2B89B79</code> <code>4CC985EF9D36A1260C66A0B1C545B71A</code> <code>2A2C31BE164FC5BE7BA79A9A64882DB1</code> <code>4983F07D7763614AB3B751235402FAC6</code> <code>A1F7B0397210CC85E307BCBE0893D0FA</code> <code>0859A65D5AF658385FAF4409F68FA49F</code> <code>2754DFC232ECF013B1A94D8DD78E0474</code> <code>78ECFE23AD5CCE6367E0D4F583FC94D7</code> <code>1E16F6142B6EA69C960491E5704B8770</code><br> <code>5FFCEFFF</code></td>
|
|
|
|
|
<td><code>FE000100AF8F35A4FCDE6EF5B1281199</code> <code>81505BD6A6E483D9FB0A9B58047554E3</code> <code>DB6FA879AC78376E267A114A555D0892</code> <code>5411A86C808D6A6CD60B9C028F12A125</code> <code>E766F4F190CDD1DAA106E8510FCD14BD</code> <code>7645A92D10BB72982AD4B7969B89B43B</code> <code>DF26B9187456338D29990B02FFDA9EDA</code> <code>582A29455E1FC169159ADB87B802AE65</code> <code>51EAADDC7F852DC8D54FAE5E309FC939</code> <code>A17308D48614795EDEE4E42E3F72290A</code> <code>A3B28C981A8C17F7E01133A8E93FEF9C</code> <code>BC96BC798C1904349F30DD4C6D49C11F</code> <code>BB19FB52664B672D0271E6A3FB36446B</code> <code>C99AE0E7FF27ECEEC6E5E144CB5ED8AE</code> <code>E22369B2CCCA9A0E9D6D9ADC2CA05278</code> <code>99AA1DE3B505709C5D4653CFA7A88863</code><br> <code>873CF21B</code></td>
|
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>649E7C65</code> (1702665828 in decimal)</td>
|
|
|
|
|
<td><code>99A27C65</code> (1702666905 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B54874C5FF34543BDDF88801BE344A3C4D6908BA9B24019662116FB54BDC8AD36
|
|
|
|
|
<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 = 9E5FF1153F0B7EC139D9359F285F149FF808308BB98286A885FA4E464FB8BD9C92675A276028B616385ADF67D16721E2C5AC34CC0BDCBE34F943CB624408D332064A93221B1DA6F5A768DA079E546D5495A6E3C9DB9A013462AE5905AA5D1BD56E2FBE21858AFABBB86F0FA4EB502D84F4F02A676E31773B182EC72B98AC785CA30C793F7B18CA618FCC8A0899F8551A2D326588AAC25BCE6D613A32104445CFE0EC966C96ACD6E61912785E257B4E0B691C8DC0612045D385FAC8DC9106102CEF22686FE0F7D2A35AF73FA08E1474175866EA57928D558048FEBFCA3AFFCE20B20CF5580DB784DEDE46C596B6CBB62BD1A9A73D32EF1B2816E7FEEE78178FE0</code></pre>
|
|
|
|
|
<pre><code>b = BF735A674C1785CDA8F4A2E948A49F1CED4742664A186D1C924305359720B0F72352D1E00AE8ACB4FA1F24335D674EF301EC7E8A0D91048CFB35546767C494C97A27C0BFE25EB8BE16A376C7306C0AA3A4F218A28560E65D1A5FEA7CDE94EB4046F8D59817B5137B67BCB22A1464BDA650F23B356137E248FC1091C88ED887031609D36E55064F2AC833F0C79E07613F26C8C6D81060B8885A1FA970A286E03BA018A4677E62A8AE113D595BF63C985E8C2BC51FDA0B0ACD50C3BE5EBEB443F8118AC32C0CD409BE7945C391A3AC313B70697AE31BF3F7EF0EA686ADD92458B384A3596DF9D304EE05FA2E1F7E9365D05B7BD177021A3424447297CD6C3F1460</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 = 71FB756CFAF7A584EDDA8D39DB97C5E66BD02F06AC965A3EED930FA42750B519C123B5DFD386F1082A6D8A2F3FD0A1E4160366427BDAE338D7F307C2BFA669ECC1C64086959E35DC80F80992DCEA9D90923E7C4389F3E63FFBA695E9C4733E049752126A6884768D3B8EA739B89225D816485081311BDE1C2EDBCC9DD33C764491094E9EB56F5B6826494977D4ADF6E0586DA8B4F2DB9CC068A220265A5095D0DCE7794CD3DE7CA944A0A2A005093C2F0B5C6DFD80C519ABAE557285545F3B109F00791BFC8A9B77E5BF85D393C668F38C41442F60D3C6A66918FC96D976DC4FB8F061521DF0EE418A72374437917E5F94C23CC4CB4D1F5C60220B99CA387FC1</code></pre>
|
|
|
|
|
<pre><code>g_b = A77CC850CB4E75C9C9EC93FACE302E7F633CF8AAC0CBD87103ADD8B9C93968E3D229BB29F55D128B0F48F89A854D7EA6F6CBBCDADC7134A06856E35A8BF05805897B90C379CC2413687FA73D8E2207B4EEB61A18D9B07E1E240CB81D320316317CFEEBB6F6D3CAA402718316CDA433643E04A39351EEBBDDB9D370544ECDE7392B70418468FA082BF919B519B681F0AACD4587B987754992A5093BB4187FDE9FB00124A7FD0E7D2E41E5BA84030011E2EDD340000B47DA718FA5A211056F83FBEB5E15A2156DFD0B57FF5DCD55FE84B7F337EDF168B27A143692C5AF49D8894C95E1ECD80B8C2BFAE54E788E933A882570C00F6917F6ADC47D4229BF9D879882</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 48 74 C5 FF 34 54 3B DD F8 88 01 BE
|
|
|
|
|
0010 | 34 4A 3C 4D 69 08 BA 9B 24 01 96 62 11 6F B5 4B
|
|
|
|
|
0020 | DC 8A D3 61 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 71 FB 75 6C FA F7 A5 84 ED DA 8D 39 DB 97 C5 E6
|
|
|
|
|
0040 | 6B D0 2F 06 AC 96 5A 3E ED 93 0F A4 27 50 B5 19
|
|
|
|
|
0050 | C1 23 B5 DF D3 86 F1 08 2A 6D 8A 2F 3F D0 A1 E4
|
|
|
|
|
0060 | 16 03 66 42 7B DA E3 38 D7 F3 07 C2 BF A6 69 EC
|
|
|
|
|
0070 | C1 C6 40 86 95 9E 35 DC 80 F8 09 92 DC EA 9D 90
|
|
|
|
|
0080 | 92 3E 7C 43 89 F3 E6 3F FB A6 95 E9 C4 73 3E 04
|
|
|
|
|
0090 | 97 52 12 6A 68 84 76 8D 3B 8E A7 39 B8 92 25 D8
|
|
|
|
|
00A0 | 16 48 50 81 31 1B DE 1C 2E DB CC 9D D3 3C 76 44
|
|
|
|
|
00B0 | 91 09 4E 9E B5 6F 5B 68 26 49 49 77 D4 AD F6 E0
|
|
|
|
|
00C0 | 58 6D A8 B4 F2 DB 9C C0 68 A2 20 26 5A 50 95 D0
|
|
|
|
|
00D0 | DC E7 79 4C D3 DE 7C A9 44 A0 A2 A0 05 09 3C 2F
|
|
|
|
|
00E0 | 0B 5C 6D FD 80 C5 19 AB AE 55 72 85 54 5F 3B 10
|
|
|
|
|
00F0 | 9F 00 79 1B FC 8A 9B 77 E5 BF 85 D3 93 C6 68 F3
|
|
|
|
|
0100 | 8C 41 44 2F 60 D3 C6 A6 69 18 FC 96 D9 76 DC 4F
|
|
|
|
|
0110 | B8 F0 61 52 1D F0 EE 41 8A 72 37 44 37 91 7E 5F
|
|
|
|
|
0120 | 94 C2 3C C4 CB 4D 1F 5C 60 22 0B 99 CA 38 7F C1</code></pre>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 B3 E1 D2 FA 3E 92 73 28 94 C0 7D AE
|
|
|
|
|
0010 | C7 C7 8E 10 C6 DB 85 F8 40 93 C7 5A FE 46 DC 80
|
|
|
|
|
0020 | 3D D1 2C C0 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | A7 7C C8 50 CB 4E 75 C9 C9 EC 93 FA CE 30 2E 7F
|
|
|
|
|
0040 | 63 3C F8 AA C0 CB D8 71 03 AD D8 B9 C9 39 68 E3
|
|
|
|
|
0050 | D2 29 BB 29 F5 5D 12 8B 0F 48 F8 9A 85 4D 7E A6
|
|
|
|
|
0060 | F6 CB BC DA DC 71 34 A0 68 56 E3 5A 8B F0 58 05
|
|
|
|
|
0070 | 89 7B 90 C3 79 CC 24 13 68 7F A7 3D 8E 22 07 B4
|
|
|
|
|
0080 | EE B6 1A 18 D9 B0 7E 1E 24 0C B8 1D 32 03 16 31
|
|
|
|
|
0090 | 7C FE EB B6 F6 D3 CA A4 02 71 83 16 CD A4 33 64
|
|
|
|
|
00A0 | 3E 04 A3 93 51 EE BB DD B9 D3 70 54 4E CD E7 39
|
|
|
|
|
00B0 | 2B 70 41 84 68 FA 08 2B F9 19 B5 19 B6 81 F0 AA
|
|
|
|
|
00C0 | CD 45 87 B9 87 75 49 92 A5 09 3B B4 18 7F DE 9F
|
|
|
|
|
00D0 | B0 01 24 A7 FD 0E 7D 2E 41 E5 BA 84 03 00 11 E2
|
|
|
|
|
00E0 | ED D3 40 00 0B 47 DA 71 8F A5 A2 11 05 6F 83 FB
|
|
|
|
|
00F0 | EB 5E 15 A2 15 6D FD 0B 57 FF 5D CD 55 FE 84 B7
|
|
|
|
|
0100 | F3 37 ED F1 68 B2 7A 14 36 92 C5 AF 49 D8 89 4C
|
|
|
|
|
0110 | 95 E1 EC D8 0B 8C 2B FA E5 4E 78 8E 93 3A 88 25
|
|
|
|
|
0120 | 70 C0 0F 69 17 F6 AD C4 7D 42 29 BF 9D 87 98 82</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 = BA0D89B54874C5FF34543BDDF88801BE344A3C4D6908BA9B24019662116FB54BDC8AD36
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>4874C5FF34543BDDF88801BE344A3C4D</code></td>
|
|
|
|
|
<td><code>B3E1D2FA3E92732894C07DAEC7C78E10</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>6908BA9B24019662116FB54BDC8AD361</code></td>
|
|
|
|
|
<td><code>C6DB85F84093C75AFE46DC803DD12CC0</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE00010071FB756CFAF7A584EDDA8D39</code> <code>DB97C5E66BD02F06AC965A3EED930FA4</code> <code>2750B519C123B5DFD386F1082A6D8A2F</code> <code>3FD0A1E4160366427BDAE338D7F307C2</code> <code>BFA669ECC1C64086959E35DC80F80992</code> <code>DCEA9D90923E7C4389F3E63FFBA695E9</code> <code>C4733E049752126A6884768D3B8EA739</code> <code>B89225D816485081311BDE1C2EDBCC9D</code> <code>D33C764491094E9EB56F5B6826494977</code> <code>D4ADF6E0586DA8B4F2DB9CC068A22026</code> <code>5A5095D0DCE7794CD3DE7CA944A0A2A0</code> <code>05093C2F0B5C6DFD80C519ABAE557285</code> <code>545F3B109F00791BFC8A9B77E5BF85D3</code> <code>93C668F38C41442F60D3C6A66918FC96</code> <code>D976DC4FB8F061521DF0EE418A723744</code> <code>37917E5F94C23CC4CB4D1F5C60220B99</code><br> <code>CA387FC1</code></td>
|
|
|
|
|
<td><code>FE000100A77CC850CB4E75C9C9EC93FA</code> <code>CE302E7F633CF8AAC0CBD87103ADD8B9</code> <code>C93968E3D229BB29F55D128B0F48F89A</code> <code>854D7EA6F6CBBCDADC7134A06856E35A</code> <code>8BF05805897B90C379CC2413687FA73D</code> <code>8E2207B4EEB61A18D9B07E1E240CB81D</code> <code>320316317CFEEBB6F6D3CAA402718316</code> <code>CDA433643E04A39351EEBBDDB9D37054</code> <code>4ECDE7392B70418468FA082BF919B519</code> <code>B681F0AACD4587B987754992A5093BB4</code> <code>187FDE9FB00124A7FD0E7D2E41E5BA84</code> <code>030011E2EDD340000B47DA718FA5A211</code> <code>056F83FBEB5E15A2156DFD0B57FF5DCD</code> <code>55FE84B7F337EDF168B27A143692C5AF</code> <code>49D8894C95E1ECD80B8C2BFAE54E788E</code> <code>933A882570C00F6917F6ADC47D4229BF</code><br> <code>9D879882</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 = BA0D89B54874C5FF34543BDDF88801BE344A3C4D6908BA9B24019662116FB54BDC8AD36
|
|
|
|
|
<!-- 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 = 54B643664874C5FF34543BDDF88801BE344A3C4D6908BA9B24019662116FB54BDC8AD3610000000000000000FE00010071FB756CFAF7A584EDDA8D39DB97C5E66BD02F06AC965A3EED930FA42750B519C123B5DFD386F1082A6D8A2F3FD0A1E4160366427BDAE338D7F307C2BFA669ECC1C64086959E35DC80F80992DCEA9D90923E7C4389F3E63FFBA695E9C4733E049752126A6884768D3B8EA739B89225D816485081311BDE1C2EDBCC9DD33C764491094E9EB56F5B6826494977D4ADF6E0586DA8B4F2DB9CC068A220265A5095D0DCE7794CD3DE7CA944A0A2A005093C2F0B5C6DFD80C519ABAE557285545F3B109F00791BFC8A9B77E5BF85D393C668F38C41442F60D3C6A66918FC96D976DC4FB8F061521DF0EE418A72374437917E5F94C23CC4CB4D1F5C60220B99CA387FC1
|
|
|
|
|
padding = DD88AE924BC862C760A8293A
|
|
|
|
|
tmp_aes_key = 9CE6361406319F2D525560C55CB735571D2B83E497907255400D1088EA914CE8
|
|
|
|
|
tmp_aes_iv = E7467B94F4DAE2F7303285B9632C08FB25DA82E4947553BF6B4E8EF3FBD199C5</code></pre>
|
|
|
|
|
<pre><code>data = 54B64366B3E1D2FA3E92732894C07DAEC7C78E10C6DB85F84093C75AFE46DC803DD12CC00000000000000000FE000100A77CC850CB4E75C9C9EC93FACE302E7F633CF8AAC0CBD87103ADD8B9C93968E3D229BB29F55D128B0F48F89A854D7EA6F6CBBCDADC7134A06856E35A8BF05805897B90C379CC2413687FA73D8E2207B4EEB61A18D9B07E1E240CB81D320316317CFEEBB6F6D3CAA402718316CDA433643E04A39351EEBBDDB9D370544ECDE7392B70418468FA082BF919B519B681F0AACD4587B987754992A5093BB4187FDE9FB00124A7FD0E7D2E41E5BA84030011E2EDD340000B47DA718FA5A211056F83FBEB5E15A2156DFD0B57FF5DCD55FE84B7F337EDF168B27A143692C5AF49D8894C95E1ECD80B8C2BFAE54E788E933A882570C00F6917F6ADC47D4229BF9D879882
|
|
|
|
|
padding = 3A56FDEE8A10FEC869B26703
|
|
|
|
|
tmp_aes_key = 656C62150D07208FBFD43F699694392BEA12420FB0FCF97F38EB133362C8D42B
|
|
|
|
|
tmp_aes_iv = C4C17A57E0E1B321E7B09EED0E7F2DF2B7309129E23AFF664C4B867D79CC5858</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 = 1CB72DD52537694C6C8994E7F9FC52A2DD1C4C0BC6BE8DE9D9EBD6A4A61EFA254DC5F30E8BD4DF76DC9887855314400799895C5C677E852FBA3B0394C006AB1FF771DD6672E61432649C704F82BFB4E55A8A6D39B4FFC1EC995A7ADF1FF663B6FC50E30A1C3A075C59B9857A00CB1A62B8D666B9F9AC913CDDB7531FFAB56E987D56A31383B1263D0D938C8073F452C9C4E8BD8FC2221DFA9C4EC2B2D6E6910EA9B15CB6D989B7F8262FB751C5122F199F6C9F442ED2925900EC41C0D5F5632599123684E2F0471D671E80A920555A009C654F6739D4D7653C8927C077A3FCF54A83C0C2CA03C980A8308089FDE43E838EE4FD0653EAA20E716EECADC44C64FCE8889A8E1C6FECAE3839CAEDC6128FB26307DF55CDAD88A847F4F72203393EDA597374DF7166FD89320B827B937A7CBCAA7889894C752F07BFF1D01E49A16CAB9B309AF0A01878742CA0ED84C2C267E7</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 715E52FCAB18C07336B830E67CE609178B1355B3401CD4D2333CBF7DC6C48492233C39246D1EECB57972E8198F26640E90E47E30D2CFF2F5E89C0D5D0DCA775CE61561930A79DD60C9F80E04D6F07DCBE424602EBE59851790087543D47E9E6B8378493E80428B5BD2ECA810C18FFFEE5FBCE42C0C51D234D8AE825AC47909499DA142A5938EC5EA1A3B3B1D4110AE7B009BA74D637B3A1B8B9E4B0F67B58691BB73519B87078D33FE6525033853BC78EB6AC332FFB52BC7FAED3CC75BF548BE1A8CF6286093DED305E58C14204AC2A6989149899EF575F35E4C8C962EABDDE1F9B9E957B6A9F92289958DD57206A3C9642E4DBD622475FC6EF14AE52E51F64C011EE0B247696841C9748462C4BDAB7958F217CE191D581E82B6A5967FFC1D8CE543427F9FA95304F2519C5535C6EFFBC3F75C4F540A0F1ACCA49C8E0964356F9A47A9DB674D632EBD59902133C5CB12</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 1C C9 06 00 64 9E 7C 65
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 48 74 C5 FF 34 54 3B DD
|
|
|
|
|
0020 | F8 88 01 BE 34 4A 3C 4D 69 08 BA 9B 24 01 96 62
|
|
|
|
|
0030 | 11 6F B5 4B DC 8A D3 61 FE 50 01 00 1C B7 2D D5
|
|
|
|
|
0040 | 25 37 69 4C 6C 89 94 E7 F9 FC 52 A2 DD 1C 4C 0B
|
|
|
|
|
0050 | C6 BE 8D E9 D9 EB D6 A4 A6 1E FA 25 4D C5 F3 0E
|
|
|
|
|
0060 | 8B D4 DF 76 DC 98 87 85 53 14 40 07 99 89 5C 5C
|
|
|
|
|
0070 | 67 7E 85 2F BA 3B 03 94 C0 06 AB 1F F7 71 DD 66
|
|
|
|
|
0080 | 72 E6 14 32 64 9C 70 4F 82 BF B4 E5 5A 8A 6D 39
|
|
|
|
|
0090 | B4 FF C1 EC 99 5A 7A DF 1F F6 63 B6 FC 50 E3 0A
|
|
|
|
|
00A0 | 1C 3A 07 5C 59 B9 85 7A 00 CB 1A 62 B8 D6 66 B9
|
|
|
|
|
00B0 | F9 AC 91 3C DD B7 53 1F FA B5 6E 98 7D 56 A3 13
|
|
|
|
|
00C0 | 83 B1 26 3D 0D 93 8C 80 73 F4 52 C9 C4 E8 BD 8F
|
|
|
|
|
00D0 | C2 22 1D FA 9C 4E C2 B2 D6 E6 91 0E A9 B1 5C B6
|
|
|
|
|
00E0 | D9 89 B7 F8 26 2F B7 51 C5 12 2F 19 9F 6C 9F 44
|
|
|
|
|
00F0 | 2E D2 92 59 00 EC 41 C0 D5 F5 63 25 99 12 36 84
|
|
|
|
|
0100 | E2 F0 47 1D 67 1E 80 A9 20 55 5A 00 9C 65 4F 67
|
|
|
|
|
0110 | 39 D4 D7 65 3C 89 27 C0 77 A3 FC F5 4A 83 C0 C2
|
|
|
|
|
0120 | CA 03 C9 80 A8 30 80 89 FD E4 3E 83 8E E4 FD 06
|
|
|
|
|
0130 | 53 EA A2 0E 71 6E EC AD C4 4C 64 FC E8 88 9A 8E
|
|
|
|
|
0140 | 1C 6F EC AE 38 39 CA ED C6 12 8F B2 63 07 DF 55
|
|
|
|
|
0150 | CD AD 88 A8 47 F4 F7 22 03 39 3E DA 59 73 74 DF
|
|
|
|
|
0160 | 71 66 FD 89 32 0B 82 7B 93 7A 7C BC AA 78 89 89
|
|
|
|
|
0170 | 4C 75 2F 07 BF F1 D0 1E 49 A1 6C AB 9B 30 9A F0
|
|
|
|
|
0180 | A0 18 78 74 2C A0 ED 84 C2 C2 67 E7</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 F0 DB 07 00 99 A2 7C 65
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 B3 E1 D2 FA 3E 92 73 28
|
|
|
|
|
0020 | 94 C0 7D AE C7 C7 8E 10 C6 DB 85 F8 40 93 C7 5A
|
|
|
|
|
0030 | FE 46 DC 80 3D D1 2C C0 FE 50 01 00 71 5E 52 FC
|
|
|
|
|
0040 | AB 18 C0 73 36 B8 30 E6 7C E6 09 17 8B 13 55 B3
|
|
|
|
|
0050 | 40 1C D4 D2 33 3C BF 7D C6 C4 84 92 23 3C 39 24
|
|
|
|
|
0060 | 6D 1E EC B5 79 72 E8 19 8F 26 64 0E 90 E4 7E 30
|
|
|
|
|
0070 | D2 CF F2 F5 E8 9C 0D 5D 0D CA 77 5C E6 15 61 93
|
|
|
|
|
0080 | 0A 79 DD 60 C9 F8 0E 04 D6 F0 7D CB E4 24 60 2E
|
|
|
|
|
0090 | BE 59 85 17 90 08 75 43 D4 7E 9E 6B 83 78 49 3E
|
|
|
|
|
00A0 | 80 42 8B 5B D2 EC A8 10 C1 8F FF EE 5F BC E4 2C
|
|
|
|
|
00B0 | 0C 51 D2 34 D8 AE 82 5A C4 79 09 49 9D A1 42 A5
|
|
|
|
|
00C0 | 93 8E C5 EA 1A 3B 3B 1D 41 10 AE 7B 00 9B A7 4D
|
|
|
|
|
00D0 | 63 7B 3A 1B 8B 9E 4B 0F 67 B5 86 91 BB 73 51 9B
|
|
|
|
|
00E0 | 87 07 8D 33 FE 65 25 03 38 53 BC 78 EB 6A C3 32
|
|
|
|
|
00F0 | FF B5 2B C7 FA ED 3C C7 5B F5 48 BE 1A 8C F6 28
|
|
|
|
|
0100 | 60 93 DE D3 05 E5 8C 14 20 4A C2 A6 98 91 49 89
|
|
|
|
|
0110 | 9E F5 75 F3 5E 4C 8C 96 2E AB DD E1 F9 B9 E9 57
|
|
|
|
|
0120 | B6 A9 F9 22 89 95 8D D5 72 06 A3 C9 64 2E 4D BD
|
|
|
|
|
0130 | 62 24 75 FC 6E F1 4A E5 2E 51 F6 4C 01 1E E0 B2
|
|
|
|
|
0140 | 47 69 68 41 C9 74 84 62 C4 BD AB 79 58 F2 17 CE
|
|
|
|
|
0150 | 19 1D 58 1E 82 B6 A5 96 7F FC 1D 8C E5 43 42 7F
|
|
|
|
|
0160 | 9F A9 53 04 F2 51 9C 55 35 C6 EF FB C3 F7 5C 4F
|
|
|
|
|
0170 | 54 0A 0F 1A CC A4 9C 8E 09 64 35 6F 9A 47 A9 DB
|
|
|
|
|
0180 | 67 4D 63 2E BD 59 90 21 33 C5 CB 12</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>1CC90600649E7C65</code></td>
|
|
|
|
|
<td><code>F0DB070099A27C65</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>4874C5FF34543BDDF88801BE344A3C4D</code></td>
|
|
|
|
|
<td><code>B3E1D2FA3E92732894C07DAEC7C78E10</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>6908BA9B24019662116FB54BDC8AD361</code></td>
|
|
|
|
|
<td><code>C6DB85F84093C75AFE46DC803DD12CC0</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE5001001CB72DD52537694C6C8994E7</code> <code>F9FC52A2DD1C4C0BC6BE8DE9D9EBD6A4</code> <code>A61EFA254DC5F30E8BD4DF76DC988785</code> <code>5314400799895C5C677E852FBA3B0394</code> <code>C006AB1FF771DD6672E61432649C704F</code> <code>82BFB4E55A8A6D39B4FFC1EC995A7ADF</code> <code>1FF663B6FC50E30A1C3A075C59B9857A</code> <code>00CB1A62B8D666B9F9AC913CDDB7531F</code> <code>FAB56E987D56A31383B1263D0D938C80</code> <code>73F452C9C4E8BD8FC2221DFA9C4EC2B2</code> <code>D6E6910EA9B15CB6D989B7F8262FB751</code> <code>C5122F199F6C9F442ED2925900EC41C0</code> <code>D5F5632599123684E2F0471D671E80A9</code> <code>20555A009C654F6739D4D7653C8927C0</code> <code>77A3FCF54A83C0C2CA03C980A8308089</code> <code>FDE43E838EE4FD0653EAA20E716EECAD</code> <code>C44C64FCE8889A8E1C6FECAE3839CAED</code> <code>C6128FB26307DF55CDAD88A847F4F722</code> <code>03393EDA597374DF7166FD89320B827B</code> <code>937A7CBCAA7889894C752F07BFF1D01E</code> <code>49A16CAB9B309AF0A01878742CA0ED84</code><br> <code>C2C267E7</code></td>
|
|
|
|
|
<td><code>FE500100715E52FCAB18C07336B830E6</code> <code>7CE609178B1355B3401CD4D2333CBF7D</code> <code>C6C48492233C39246D1EECB57972E819</code> <code>8F26640E90E47E30D2CFF2F5E89C0D5D</code> <code>0DCA775CE61561930A79DD60C9F80E04</code> <code>D6F07DCBE424602EBE59851790087543</code> <code>D47E9E6B8378493E80428B5BD2ECA810</code> <code>C18FFFEE5FBCE42C0C51D234D8AE825A</code> <code>C47909499DA142A5938EC5EA1A3B3B1D</code> <code>4110AE7B009BA74D637B3A1B8B9E4B0F</code> <code>67B58691BB73519B87078D33FE652503</code> <code>3853BC78EB6AC332FFB52BC7FAED3CC7</code> <code>5BF548BE1A8CF6286093DED305E58C14</code> <code>204AC2A6989149899EF575F35E4C8C96</code> <code>2EABDDE1F9B9E957B6A9F92289958DD5</code> <code>7206A3C9642E4DBD622475FC6EF14AE5</code> <code>2E51F64C011EE0B247696841C9748462</code> <code>C4BDAB7958F217CE191D581E82B6A596</code> <code>7FFC1D8CE543427F9FA95304F2519C55</code> <code>35C6EFFBC3F75C4F540A0F1ACCA49C8E</code> <code>0964356F9A47A9DB674D632EBD599021</code><br> <code>33C5CB12</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 = AD7C95D885083E3FAF05A0AFECD150B4AEA9DBAE2FF587E3F443ECE81B1F12861D441FFB5E376798D98B272CDCE517E4F800119BA47E59C4C19FAA3F1DB6002E52ED39519DF618E05BDB618F6D6590AF9FEF6C4F73E9C42416A0FC7506DF09838AFD1DEE176B48E8720540351B9B4A83BF1BE5283A6317956CEDAD15D2D08F572F6F6353238C193751A084687B3693DEFD5A080BDE82FB3A5141F047BB07979238462B57EEEA4AD6EAEEAA179DB943631DFD0485E4A4A8C386166AD1DAB516D3C8732A253950A528F0C4588BA4537A3BD3433156E53450B30A6A87F69664B4AFF67FC312E27F5A7954BC93F59AE99D0153B7D60DF00F912E625914BF8CE481B4</code></pre>
|
|
|
|
|
<pre><code>auth_key = 82F078D27C28B9158A05764D13C3E3C63DAB7591A0D34EA72CDCD05BD61ACA24E1B9E9A8252A45AEF6A73A2E84B4B49D3FF70837C721C856B84B2D1101A9DA81CEE6691A08DF704D8ECC77CCF7561FA1DFBF19C8494BC2226493F39795552759088AB848CD7A280A576447456D7A3C8CB858514663C281F22FAEEED73C5BB45DB447455C47CE868FFCC5B9918F877616B340CB92576EC70D7AA0EC220CE68BD24BC06BBF9BB525917048950DE7601D45D38299AAF06DDE09420571739E36C87430271B78EBC89AC9325195B3E42CA243364B2644991EFE43EA9211D3E0C398980E4295D6F590726DF09C1EDD3D7E8CCCD7896EF55CAF8CD35EC0D49418971D71</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 1C 10 D1 64 9E 7C 65
|
|
|
|
|
0010 | 34 00 00 00 34 F7 CB 3B 48 74 C5 FF 34 54 3B DD
|
|
|
|
|
0020 | F8 88 01 BE 34 4A 3C 4D 69 08 BA 9B 24 01 96 62
|
|
|
|
|
0030 | 11 6F B5 4B DC 8A D3 61 F2 F4 CE A6 48 64 FA 0A
|
|
|
|
|
0040 | F7 F9 4B C4 11 AC 58 E0</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 10 32 E2 99 A2 7C 65
|
|
|
|
|
0010 | 5C 00 00 00 34 F7 CB 3B B3 E1 D2 FA 3E 92 73 28
|
|
|
|
|
0020 | 94 C0 7D AE C7 C7 8E 10 C6 DB 85 F8 40 93 C7 5A
|
|
|
|
|
0030 | FE 46 DC 80 3D D1 2C C0 4A F5 6C 57 08 4D 0D 18
|
|
|
|
|
0040 | 1A 22 40 E1 C2 0C E0 89</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>011C10D1649E7C65</code></td>
|
|
|
|
|
<td><code>011032E299A27C65</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>34000000</code> (52 in decimal)</td>
|
|
|
|
|
<td><code>5C000000</code> (92 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>4874C5FF34543BDDF88801BE344A3C4D</code></td>
|
|
|
|
|
<td><code>B3E1D2FA3E92732894C07DAEC7C78E10</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>6908BA9B24019662116FB54BDC8AD361</code></td>
|
|
|
|
|
<td><code>C6DB85F84093C75AFE46DC803DD12CC0</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>F2F4CEA64864FA0AF7F94BC411AC58E0</code></td>
|
|
|
|
|
<td><code>4AF56C57084D0D181A2240E1C20CE089</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>
|
|
|
|
|