|
|
|
@ -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 D0 D2 08 00 7E 11 98 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 43 30 42 F6 9F 2F 19 C9
|
|
|
|
|
0020 | 56 30 CF 74 74 FE 41 DE</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 9C DD 09 00 E9 16 98 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 87 51 47 D4 3D 52 0F 2C
|
|
|
|
|
0020 | E6 A9 C6 58 93 51 DE 4A</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>D0D208007E119866</code></td>
|
|
|
|
|
<td><code>9CDD0900E9169866</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>433042F69F2F19C95630CF7474FE41DE</code></td>
|
|
|
|
|
<td><code>875147D43D520F2CE6A9C6589351DE4A</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 44 49 98 7E 11 98 66
|
|
|
|
|
0010 | A4 00 00 00 63 24 16 05 43 30 42 F6 9F 2F 19 C9
|
|
|
|
|
0020 | 56 30 CF 74 74 FE 41 DE 00 CE D0 6F 7F E9 FB 9A
|
|
|
|
|
0030 | ED 1C BD B9 7B 65 2C C1 08 28 F8 4B BB 45 A0 22
|
|
|
|
|
0040 | AF 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 0C C6 5A E9 16 98 66
|
|
|
|
|
0010 | A8 00 00 00 63 24 16 05 87 51 47 D4 3D 52 0F 2C
|
|
|
|
|
0020 | E6 A9 C6 58 93 51 DE 4A 55 9B C4 34 A1 A8 62 79
|
|
|
|
|
0030 | DC 59 A2 D6 4E 03 D4 D9 08 15 14 A0 2B BC 2F 32
|
|
|
|
|
0040 | 81 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>014449987E119866</code></td>
|
|
|
|
|
<td><code>010CC65AE9169866</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>A4000000</code> (164 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>433042F69F2F19C95630CF7474FE41DE</code></td>
|
|
|
|
|
<td><code>875147D43D520F2CE6A9C6589351DE4A</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>00CED06F7FE9FB9AED1CBDB97B652CC1</code></td>
|
|
|
|
|
<td><code>559BC434A1A86279DC59A2D64E03D4D9</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>0828F84BBB45A022AF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2952192823440450223</td>
|
|
|
|
|
<td><code>081514A02BBC2F3281000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1519015084031947393</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 = 2952192823440450223</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2952192823440450223 = 1595174953 * 1850701591</code></p>
|
|
|
|
|
<pre><code>p = 1595174953
|
|
|
|
|
q = 1850701591</code></pre>
|
|
|
|
|
<pre><code>pq = 1519015084031947393</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1519015084031947393 = 1073734861 * 1414702213</code></p>
|
|
|
|
|
<pre><code>p = 1073734861
|
|
|
|
|
q = 1414702213</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 28 F8 4B BB 45 A0 22 AF 00 00 00
|
|
|
|
|
0010 | 04 5F 14 70 29 00 00 00 04 6E 4F 77 17 00 00 00
|
|
|
|
|
0020 | 43 30 42 F6 9F 2F 19 C9 56 30 CF 74 74 FE 41 DE
|
|
|
|
|
0030 | 00 CE D0 6F 7F E9 FB 9A ED 1C BD B9 7B 65 2C C1
|
|
|
|
|
0040 | EB B5 1A 75 FE 13 66 97 71 E6 EE C5 21 3B 22 8C
|
|
|
|
|
0050 | C1 C8 0D 49 83 5C 56 4D 0C 62 8E 7C 16 AA 71 FB
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 15 14 A0 2B BC 2F 32 81 00 00 00
|
|
|
|
|
0010 | 04 3F FF E4 CD 00 00 00 04 54 52 A4 85 00 00 00
|
|
|
|
|
0020 | 87 51 47 D4 3D 52 0F 2C E6 A9 C6 58 93 51 DE 4A
|
|
|
|
|
0030 | 55 9B C4 34 A1 A8 62 79 DC 59 A2 D6 4E 03 D4 D9
|
|
|
|
|
0040 | 43 B0 78 B3 C1 11 61 FA B7 03 FF AD AA 6A 7A 2E
|
|
|
|
|
0050 | 4F 98 8E 81 A2 85 E0 49 66 6C EE D2 58 22 9F 0E
|
|
|
|
|
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 = 1850701591</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>0828F84BBB45A022AF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2952192823440450223</td>
|
|
|
|
|
<td><code>081514A02BBC2F3281000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1519015084031947393</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>045F147029000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1595174953</td>
|
|
|
|
|
<td><code>043FFFE4CD000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1073734861</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>046E4F7717000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1850701591</td>
|
|
|
|
|
<td><code>045452A485000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1414702213</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>433042F69F2F19C95630CF7474FE41DE</code></td>
|
|
|
|
|
<td><code>875147D43D520F2CE6A9C6589351DE4A</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>00CED06F7FE9FB9AED1CBDB97B652CC1</code></td>
|
|
|
|
|
<td><code>559BC434A1A86279DC59A2D64E03D4D9</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>EBB51A75FE13669771E6EEC5213B228C</code> <code>C1C80D49835C564D0C628E7C16AA71FB</code></td>
|
|
|
|
|
<td><code>43B078B3C11161FAB703FFADAA6A7A2E</code> <code>4F988E81A285E049666CEED258229F0E</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1850701591</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 = 955FF5A90828F84BBB45A022AF000000045F147029000000046E4F7717000000433042F69F2F19C95630CF7474FE41DE00CED06F7FE9FB9AED1CBDB97B652CC1EBB51A75FE13669771E6EEC5213B228CC1C80D49835C564D0C628E7C16AA71FB02000000
|
|
|
|
|
random_padding_bytes = 00B4E58B743874D6E98D144A60C51579470EE61D0B401B456CD6C2FBC500B83D5CB21AF5CE7C711E442C540E716050F57F750E5159964C3A1CC450876A7497912223F8CF545371FFBCDC3F4CA6FE4EE3417B0D15EBADAD89611C4FA2</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A9081514A02BBC2F3281000000043FFFE4CD000000045452A485000000875147D43D520F2CE6A9C6589351DE4A559BC434A1A86279DC59A2D64E03D4D943B078B3C11161FAB703FFADAA6A7A2E4F988E81A285E049666CEED258229F0E02000000
|
|
|
|
|
random_padding_bytes = BA0E6C2A8C5767D265D9982FAE9BC933B1CFFD7B8571C5D7493EE9A9418562BB8F792EF4CF4AB5720B4547203FE1BBF6A509134294ECBB7885AA582C575730EFAEFE269EF6B06D23112774102BC389A91CD0EFE146562C078AC368D6</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 = E2101471B7F578D1D81020699154D4941C9C7936B2D44569582605549EA5CFB5F5E385AE04B5F39D550D736A315FFB8EC7D7882B45E92B835569C47078AACC5588FA5E2E3F06EE3E153B49646B9216212735506CCBEC1250FE0FD588B328D7FA98FC29369001DF1B92BDC238BADF0B595010D7D8B099A7A0041EEB785FD4E65CAAA6EED7DB0055210191F8838281E6F6397A79FEEC23F36D545EE6CCECE7A383499F9B3285BA885894B2BFADB26AF1C0CD4B291B834DE2D0D158EEDCFE9955F94C1AE4821FC5F5927DABB85DB60249055AB74B334E838F9A700D90C99167489A39B09BD8712D2FED0E317E9BB036AE79742EB4CBFD18B47851BCDED5216A9083</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 5F6650D0D7988ED3C32ADE7F9940FEF2C216C2D1B3EB5996125C0B92F97C2EB74C08FAA98D39942864910AF495EB735C7DDD0F5C957E05D8EA75A8E365B7D7ADBC788422DAF37B9807B5F84DAB5F9EFF046F276B3DAA18464DEBF9F5B0E90F87B844FF56021842889333B063E29D1BFE4BAD19C94D1E045E973A26A1AACDD96D51A32680169DB78E608C457E01A724FF68A5AA2C0BDFDA2631BF57EA175D5B05F157217D241092817DFC08EC65C1C78A7E3EACD3E62CBD55F800E9949D9E677941D1ADF6F6A61C781E90E33FC2E26E2C62DEF458E0505775495A562D766C315A92813DA0D0D87859C93704821EF10684A69D2DD337A5628B176809686ED5B3AF</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 D4 D2 08 00 7E 11 98 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 43 30 42 F6 9F 2F 19 C9
|
|
|
|
|
0020 | 56 30 CF 74 74 FE 41 DE 00 CE D0 6F 7F E9 FB 9A
|
|
|
|
|
0030 | ED 1C BD B9 7B 65 2C C1 04 5F 14 70 29 00 00 00
|
|
|
|
|
0040 | 04 6E 4F 77 17 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 E2 10 14 71 B7 F5 78 D1 D8 10 20 69
|
|
|
|
|
0060 | 91 54 D4 94 1C 9C 79 36 B2 D4 45 69 58 26 05 54
|
|
|
|
|
0070 | 9E A5 CF B5 F5 E3 85 AE 04 B5 F3 9D 55 0D 73 6A
|
|
|
|
|
0080 | 31 5F FB 8E C7 D7 88 2B 45 E9 2B 83 55 69 C4 70
|
|
|
|
|
0090 | 78 AA CC 55 88 FA 5E 2E 3F 06 EE 3E 15 3B 49 64
|
|
|
|
|
00A0 | 6B 92 16 21 27 35 50 6C CB EC 12 50 FE 0F D5 88
|
|
|
|
|
00B0 | B3 28 D7 FA 98 FC 29 36 90 01 DF 1B 92 BD C2 38
|
|
|
|
|
00C0 | BA DF 0B 59 50 10 D7 D8 B0 99 A7 A0 04 1E EB 78
|
|
|
|
|
00D0 | 5F D4 E6 5C AA A6 EE D7 DB 00 55 21 01 91 F8 83
|
|
|
|
|
00E0 | 82 81 E6 F6 39 7A 79 FE EC 23 F3 6D 54 5E E6 CC
|
|
|
|
|
00F0 | EC E7 A3 83 49 9F 9B 32 85 BA 88 58 94 B2 BF AD
|
|
|
|
|
0100 | B2 6A F1 C0 CD 4B 29 1B 83 4D E2 D0 D1 58 EE DC
|
|
|
|
|
0110 | FE 99 55 F9 4C 1A E4 82 1F C5 F5 92 7D AB B8 5D
|
|
|
|
|
0120 | B6 02 49 05 5A B7 4B 33 4E 83 8F 9A 70 0D 90 C9
|
|
|
|
|
0130 | 91 67 48 9A 39 B0 9B D8 71 2D 2F ED 0E 31 7E 9B
|
|
|
|
|
0140 | B0 36 AE 79 74 2E B4 CB FD 18 B4 78 51 BC DE D5
|
|
|
|
|
0150 | 21 6A 90 83</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 88 9C 0C 00 E9 16 98 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 87 51 47 D4 3D 52 0F 2C
|
|
|
|
|
0020 | E6 A9 C6 58 93 51 DE 4A 55 9B C4 34 A1 A8 62 79
|
|
|
|
|
0030 | DC 59 A2 D6 4E 03 D4 D9 04 3F FF E4 CD 00 00 00
|
|
|
|
|
0040 | 04 54 52 A4 85 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 5F 66 50 D0 D7 98 8E D3 C3 2A DE 7F
|
|
|
|
|
0060 | 99 40 FE F2 C2 16 C2 D1 B3 EB 59 96 12 5C 0B 92
|
|
|
|
|
0070 | F9 7C 2E B7 4C 08 FA A9 8D 39 94 28 64 91 0A F4
|
|
|
|
|
0080 | 95 EB 73 5C 7D DD 0F 5C 95 7E 05 D8 EA 75 A8 E3
|
|
|
|
|
0090 | 65 B7 D7 AD BC 78 84 22 DA F3 7B 98 07 B5 F8 4D
|
|
|
|
|
00A0 | AB 5F 9E FF 04 6F 27 6B 3D AA 18 46 4D EB F9 F5
|
|
|
|
|
00B0 | B0 E9 0F 87 B8 44 FF 56 02 18 42 88 93 33 B0 63
|
|
|
|
|
00C0 | E2 9D 1B FE 4B AD 19 C9 4D 1E 04 5E 97 3A 26 A1
|
|
|
|
|
00D0 | AA CD D9 6D 51 A3 26 80 16 9D B7 8E 60 8C 45 7E
|
|
|
|
|
00E0 | 01 A7 24 FF 68 A5 AA 2C 0B DF DA 26 31 BF 57 EA
|
|
|
|
|
00F0 | 17 5D 5B 05 F1 57 21 7D 24 10 92 81 7D FC 08 EC
|
|
|
|
|
0100 | 65 C1 C7 8A 7E 3E AC D3 E6 2C BD 55 F8 00 E9 94
|
|
|
|
|
0110 | 9D 9E 67 79 41 D1 AD F6 F6 A6 1C 78 1E 90 E3 3F
|
|
|
|
|
0120 | C2 E2 6E 2C 62 DE F4 58 E0 50 57 75 49 5A 56 2D
|
|
|
|
|
0130 | 76 6C 31 5A 92 81 3D A0 D0 D8 78 59 C9 37 04 82
|
|
|
|
|
0140 | 1E F1 06 84 A6 9D 2D D3 37 A5 62 8B 17 68 09 68
|
|
|
|
|
0150 | 6E D5 B3 AF</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 = 00B4E58B743874D6E98D144A60C51579470EE61D0B401B456CD6C2FBC
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>D4D208007E119866</code></td>
|
|
|
|
|
<td><code>889C0C00E9169866</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 = 00B4E58B743874D6E98D144A60C51579470EE61D0B401B456CD6C2FBC
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>433042F69F2F19C95630CF7474FE41DE</code></td>
|
|
|
|
|
<td><code>875147D43D520F2CE6A9C6589351DE4A</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>00CED06F7FE9FB9AED1CBDB97B652CC1</code></td>
|
|
|
|
|
<td><code>559BC434A1A86279DC59A2D64E03D4D9</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>045F147029000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1595174953</td>
|
|
|
|
|
<td><code>043FFFE4CD000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1073734861</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>046E4F7717000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1850701591</td>
|
|
|
|
|
<td><code>045452A485000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1414702213</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 = 00B4E58B743874D6E98D144A60C51579470EE61D0B401B456CD6C2FBC
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE000100E2101471B7F578D1D8102069</code> <code>9154D4941C9C7936B2D4456958260554</code> <code>9EA5CFB5F5E385AE04B5F39D550D736A</code> <code>315FFB8EC7D7882B45E92B835569C470</code> <code>78AACC5588FA5E2E3F06EE3E153B4964</code> <code>6B9216212735506CCBEC1250FE0FD588</code> <code>B328D7FA98FC29369001DF1B92BDC238</code> <code>BADF0B595010D7D8B099A7A0041EEB78</code> <code>5FD4E65CAAA6EED7DB0055210191F883</code> <code>8281E6F6397A79FEEC23F36D545EE6CC</code> <code>ECE7A383499F9B3285BA885894B2BFAD</code> <code>B26AF1C0CD4B291B834DE2D0D158EEDC</code> <code>FE9955F94C1AE4821FC5F5927DABB85D</code> <code>B60249055AB74B334E838F9A700D90C9</code> <code>9167489A39B09BD8712D2FED0E317E9B</code> <code>B036AE79742EB4CBFD18B47851BCDED5</code><br> <code>216A9083</code></td>
|
|
|
|
|
<td><code>FE0001005F6650D0D7988ED3C32ADE7F</code> <code>9940FEF2C216C2D1B3EB5996125C0B92</code> <code>F97C2EB74C08FAA98D39942864910AF4</code> <code>95EB735C7DDD0F5C957E05D8EA75A8E3</code> <code>65B7D7ADBC788422DAF37B9807B5F84D</code> <code>AB5F9EFF046F276B3DAA18464DEBF9F5</code> <code>B0E90F87B844FF56021842889333B063</code> <code>E29D1BFE4BAD19C94D1E045E973A26A1</code> <code>AACDD96D51A32680169DB78E608C457E</code> <code>01A724FF68A5AA2C0BDFDA2631BF57EA</code> <code>175D5B05F157217D241092817DFC08EC</code> <code>65C1C78A7E3EACD3E62CBD55F800E994</code> <code>9D9E677941D1ADF6F6A61C781E90E33F</code> <code>C2E26E2C62DEF458E0505775495A562D</code> <code>766C315A92813DA0D0D87859C9370482</code> <code>1EF10684A69D2DD337A5628B17680968</code><br> <code>6ED5B3AF</code></td>
|
|
|
|
|
<td>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = 00B4E58B743874D6E98D144A60C51579470EE61D0B401B456CD6C2FBC
|
|
|
|
|
<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 64 CF 53 7F 11 98 66
|
|
|
|
|
0010 | 78 02 00 00 5C 07 E8 D0 43 30 42 F6 9F 2F 19 C9
|
|
|
|
|
0020 | 56 30 CF 74 74 FE 41 DE 00 CE D0 6F 7F E9 FB 9A
|
|
|
|
|
0030 | ED 1C BD B9 7B 65 2C C1 FE 50 02 00 CD 24 28 CA
|
|
|
|
|
0040 | 3C BC 42 CC A7 73 0C 36 4D FE 98 E7 C2 9D 93 E3
|
|
|
|
|
0050 | 34 82 9A F7 E3 B1 67 01 39 C2 5E 93 AC 9F 96 51
|
|
|
|
|
0060 | 50 C6 07 6E 07 4F 66 42 A9 8E 72 DB 4D FD 7E D3
|
|
|
|
|
0070 | 56 F7 07 D8 CD 84 67 46 EC DB 33 E7 66 B1 88 95
|
|
|
|
|
0080 | 96 40 A6 1D 5A 9E 9B B3 86 C7 85 F9 7A F6 D1 5A
|
|
|
|
|
0090 | 57 FB 8B 07 DF 96 1F B6 76 4F CF D4 E7 4F D2 98
|
|
|
|
|
00A0 | 49 1D B7 38 23 9E 47 95 B6 10 0E 68 68 9E EE 03
|
|
|
|
|
00B0 | A4 7B D5 F3 18 5E 0F 73 A5 EE 4E CF 57 54 D4 1F
|
|
|
|
|
00C0 | 86 6C B0 FF 44 ED DC 96 12 F8 0C 69 61 2A 7E 8A
|
|
|
|
|
00D0 | 80 F4 99 78 9B 82 5C 8F 6E BA 46 BE C5 FC DC 67
|
|
|
|
|
00E0 | DC 83 A5 77 8C CB E5 2F BE 77 A9 F3 84 CB 3F EA
|
|
|
|
|
00F0 | F7 46 C5 DE 63 29 F8 3B 2A 76 15 12 4D 8E 03 BF
|
|
|
|
|
0100 | 38 0D 78 C7 8C A0 E3 E5 B8 8B 8F C7 FD 59 4E D2
|
|
|
|
|
0110 | C5 56 B5 DF 9C 42 E6 97 3C 7E 46 AE CA A9 EF A2
|
|
|
|
|
0120 | 7D B1 42 93 3A 59 8F 35 F6 1B 30 16 00 F9 B1 BC
|
|
|
|
|
0130 | BE 51 73 A5 7C A3 B2 F7 EF 4D 18 C4 E3 19 BA A3
|
|
|
|
|
0140 | AF 36 7D 6D FE 8A EE D8 62 A1 FD 9A A1 31 02 5B
|
|
|
|
|
0150 | 9A FD 60 97 B2 68 81 12 C6 24 A1 B4 CB FA 64 5F
|
|
|
|
|
0160 | A3 91 93 26 14 E3 BF 0D C0 17 90 C0 C4 AC 5F C4
|
|
|
|
|
0170 | 08 03 30 57 30 6B D0 49 B2 BD 05 8D 95 23 9F 31
|
|
|
|
|
0180 | BE 73 AF B9 96 B9 B9 0A F3 E5 0F 60 BC 66 48 03
|
|
|
|
|
0190 | A0 4E 0D C3 C4 32 EE A0 86 77 C2 A0 76 71 BC AD
|
|
|
|
|
01A0 | 52 AE 1A 1C EA 03 A4 34 34 89 A0 13 3F 38 6E 52
|
|
|
|
|
01B0 | 58 97 2C F3 9A C8 6C 69 8B F6 6F D8 39 2D EC 93
|
|
|
|
|
01C0 | 2E 6B 92 93 FB 5E A0 52 57 77 DB E4 17 F1 F3 EE
|
|
|
|
|
01D0 | 85 2A A0 1B 10 4E BF DC D7 05 EB 23 8B EC 14 3E
|
|
|
|
|
01E0 | A7 A1 86 20 BD 28 39 1A EE ED BF 77 E8 C4 BC DB
|
|
|
|
|
01F0 | E8 D4 24 07 28 F2 B8 B1 98 71 0D A9 42 14 20 44
|
|
|
|
|
0200 | C2 F9 69 C1 F4 A8 2B B4 F8 1F 93 EA EB B5 CD 14
|
|
|
|
|
0210 | 75 3A 79 01 02 D4 27 39 F3 AE B6 D6 C1 A3 51 41
|
|
|
|
|
0220 | 86 40 D4 DF 81 EB 6D 39 DB 8D EF 20 8B F7 0E 39
|
|
|
|
|
0230 | F9 F4 6F 01 2C C8 B1 66 13 A0 0D 63 80 15 4B 5D
|
|
|
|
|
0240 | 34 53 79 6F D8 E5 59 0E 53 A4 5B C0 42 CC 2A 05
|
|
|
|
|
0250 | CF B4 1F 30 7B D3 5E F9 23 2D F2 2A CB FF B8 D6
|
|
|
|
|
0260 | 2F 86 75 CE 42 06 F4 17 C5 F0 99 4C 18 71 EB 57
|
|
|
|
|
0270 | 63 5A 3E 6F 26 D2 9D 3D 4C 60 C6 CD A5 69 BC 5D
|
|
|
|
|
0280 | 8D 89 B5 01 55 E5 22 FD C0 94 A2 1A</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 54 CB 45 EA 16 98 66
|
|
|
|
|
0010 | E4 02 00 00 5C 07 E8 D0 87 51 47 D4 3D 52 0F 2C
|
|
|
|
|
0020 | E6 A9 C6 58 93 51 DE 4A 55 9B C4 34 A1 A8 62 79
|
|
|
|
|
0030 | DC 59 A2 D6 4E 03 D4 D9 FE 50 02 00 DF 6F 99 9A
|
|
|
|
|
0040 | F9 02 9D 33 4C 1E 62 B5 28 B0 F1 7F FB 58 B0 AD
|
|
|
|
|
0050 | 76 BA 12 9B 62 5F 3B 7C 73 0B 19 D1 21 8F 54 80
|
|
|
|
|
0060 | C9 61 EC EE EA 28 D3 C4 C5 C1 06 49 5B 27 7F AB
|
|
|
|
|
0070 | 5B E8 90 C8 B3 C3 06 C4 F8 69 7E 68 81 01 52 6E
|
|
|
|
|
0080 | 4B EC F4 1A 68 C4 03 23 84 94 D0 2D 8B AB A1 99
|
|
|
|
|
0090 | 53 50 65 40 D9 DE 22 1C 83 6E A7 08 1E D2 68 9F
|
|
|
|
|
00A0 | 67 89 60 B6 CD DD 85 12 14 12 99 F6 D9 3F 42 59
|
|
|
|
|
00B0 | 1F 41 41 23 50 BE 6D 10 26 68 ED D7 EF 88 93 DE
|
|
|
|
|
00C0 | 01 3B 9E 09 7D 30 CF 9A AD 05 0C FD EA 6D 12 A2
|
|
|
|
|
00D0 | F4 E8 EB C9 C3 94 FE BC 6E 5D 51 F7 85 82 22 8D
|
|
|
|
|
00E0 | 6D 1B C0 E6 10 CD 4F A2 0C 39 09 AC 2D 0B BB FD
|
|
|
|
|
00F0 | 5D B0 FC AB C7 9B 56 64 57 C6 AC 1D 4C 1C A0 B7
|
|
|
|
|
0100 | CF 3B 92 0A C7 F1 90 F7 4C 0A AE A9 B8 C7 68 BE
|
|
|
|
|
0110 | 0E 1D 4A 18 44 B5 02 26 21 23 E7 B1 CE 7A 9A A5
|
|
|
|
|
0120 | B7 55 F6 E9 41 1B F8 07 FF 6D 38 06 D1 A1 B8 12
|
|
|
|
|
0130 | 42 79 51 16 49 4B F5 36 57 15 EA 0B 3E AE 84 BF
|
|
|
|
|
0140 | 7F FC 85 BD 35 0C 7B B6 08 2E F3 AF D6 AF 4E B4
|
|
|
|
|
0150 | 3F C4 69 AD 4F 92 E0 86 AE 54 57 6F 3A F7 A9 0F
|
|
|
|
|
0160 | ED 1F 92 82 E6 FC 22 11 E9 B7 90 18 3C EB 58 94
|
|
|
|
|
0170 | FC BE 90 C3 72 99 E2 36 34 C4 5A B6 C9 02 3A 5D
|
|
|
|
|
0180 | 07 55 00 BE 27 D9 DA 5F CE BA 67 11 76 51 03 27
|
|
|
|
|
0190 | C7 C2 6B A0 F6 87 4E 19 59 FA 0B 62 EC 09 53 88
|
|
|
|
|
01A0 | 11 32 11 D1 C6 C5 22 A1 B8 63 16 FE 60 F3 1D 30
|
|
|
|
|
01B0 | F1 F9 32 76 A7 7A 07 EE 5D 51 56 65 E8 DC 35 93
|
|
|
|
|
01C0 | 1E 10 68 5E 07 D3 C9 57 9E F3 76 DA B0 7B 52 8D
|
|
|
|
|
01D0 | DE 65 C9 27 36 C3 94 AF 82 99 C5 06 D1 30 6D 1F
|
|
|
|
|
01E0 | 60 1F 7F B6 2F A6 08 25 C5 4B 4B B8 44 8C A7 6A
|
|
|
|
|
01F0 | 13 14 7D 80 67 C7 CC 0C AD E9 BF 0D 5E EA D4 0D
|
|
|
|
|
0200 | F7 B3 2C 4F 57 18 6F 36 90 D2 E8 61 8D 29 30 23
|
|
|
|
|
0210 | 3D 36 CF 79 54 1B 9F 40 E5 AC D1 CF C5 CC 94 72
|
|
|
|
|
0220 | A3 A2 63 0C AD 0A 26 38 F5 C1 DF 87 46 01 D1 BE
|
|
|
|
|
0230 | 5C 49 F4 A3 A7 09 1D 86 4C 95 B2 3A 79 A3 92 9A
|
|
|
|
|
0240 | DA 5B 08 D6 85 0C F6 BF D6 EB 43 AD F0 54 60 B6
|
|
|
|
|
0250 | C8 5D 48 76 7D 8F 12 12 29 A6 76 97 78 00 63 CA
|
|
|
|
|
0260 | D8 AB 2B 81 B4 BB 15 14 D3 88 4C D0 7B 50 96 1A
|
|
|
|
|
0270 | 1D F5 5D 21 88 FD 29 A4 99 05 E8 58 D0 06 B0 12
|
|
|
|
|
0280 | 47 F2 95 34 3F 81 C9 F0 3B B2 21 4E</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 = 00B4E58B743874D6E98D144A60C51579470EE61D0B401B456CD6C2FBC
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>0164CF537F119866</code></td>
|
|
|
|
|
<td><code>0154CB45EA169866</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>78020000</code> (632 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 = 00B4E58B743874D6E98D144A60C51579470EE61D0B401B456CD6C2FBC
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>433042F69F2F19C95630CF7474FE41DE</code></td>
|
|
|
|
|
<td><code>875147D43D520F2CE6A9C6589351DE4A</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>00CED06F7FE9FB9AED1CBDB97B652CC1</code></td>
|
|
|
|
|
<td><code>559BC434A1A86279DC59A2D64E03D4D9</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE500200CD2428CA3CBC42CCA7730C36</code> <code>4DFE98E7C29D93E334829AF7E3B16701</code> <code>39C25E93AC9F965150C6076E074F6642</code> <code>A98E72DB4DFD7ED356F707D8CD846746</code> <code>ECDB33E766B188959640A61D5A9E9BB3</code> <code>86C785F97AF6D15A57FB8B07DF961FB6</code> <code>764FCFD4E74FD298491DB738239E4795</code> <code>B6100E68689EEE03A47BD5F3185E0F73</code> <code>A5EE4ECF5754D41F866CB0FF44EDDC96</code> <code>12F80C69612A7E8A80F499789B825C8F</code> <code>6EBA46BEC5FCDC67DC83A5778CCBE52F</code> <code>BE77A9F384CB3FEAF746C5DE6329F83B</code> <code>2A7615124D8E03BF380D78C78CA0E3E5</code> <code>B88B8FC7FD594ED2C556B5DF9C42E697</code> <code>3C7E46AECAA9EFA27DB142933A598F35</code> <code>F61B301600F9B1BCBE5173A57CA3B2F7</code> <code>EF4D18C4E319BAA3AF367D6DFE8AEED8</code> <code>62A1FD9AA131025B9AFD6097B2688112</code> <code>C624A1B4CBFA645FA391932614E3BF0D</code> <code>C01790C0C4AC5FC408033057306BD049</code> <code>B2BD058D95239F31BE73AFB996B9B90A</code> <code>F3E50F60BC664803A04E0DC3C432EEA0</code> <code>8677C2A07671BCAD52AE1A1CEA03A434</code> <code>3489A0133F386E5258972CF39AC86C69</code> <code>8BF66FD8392DEC932E6B9293FB5EA052</code> <code>5777DBE417F1F3EE852AA01B104EBFDC</code> <code>D705EB238BEC143EA7A18620BD28391A</code> <code>EEEDBF77E8C4BCDBE8D4240728F2B8B1</code> <code>98710DA942142044C2F969C1F4A82BB4</code> <code>F81F93EAEBB5CD14753A790102D42739</code> <code>F3AEB6D6C1A351418640D4DF81EB6D39</code> <code>DB8DEF208BF70E39F9F46F012CC8B166</code> <code>13A00D6380154B5D3453796FD8E5590E</code> <code>53A45BC042CC2A05CFB41F307BD35EF9</code> <code>232DF22ACBFFB8D62F8675CE4206F417</code> <code>C5F0994C1871EB57635A3E6F26D29D3D</code> <code>4C60C6CDA569BC5D8D89B50155E522FD</code><br> <code>C094A21A</code></td>
|
|
|
|
|
<td><code>FE500200DF6F999AF9029D334C1E62B5</code> <code>28B0F17FFB58B0AD76BA129B625F3B7C</code> <code>730B19D1218F5480C961ECEEEA28D3C4</code> <code>C5C106495B277FAB5BE890C8B3C306C4</code> <code>F8697E688101526E4BECF41A68C40323</code> <code>8494D02D8BABA19953506540D9DE221C</code> <code>836EA7081ED2689F678960B6CDDD8512</code> <code>141299F6D93F42591F41412350BE6D10</code> <code>2668EDD7EF8893DE013B9E097D30CF9A</code> <code>AD050CFDEA6D12A2F4E8EBC9C394FEBC</code> <code>6E5D51F78582228D6D1BC0E610CD4FA2</code> <code>0C3909AC2D0BBBFD5DB0FCABC79B5664</code> <code>57C6AC1D4C1CA0B7CF3B920AC7F190F7</code> <code>4C0AAEA9B8C768BE0E1D4A1844B50226</code> <code>2123E7B1CE7A9AA5B755F6E9411BF807</code> <code>FF6D3806D1A1B81242795116494BF536</code> <code>5715EA0B3EAE84BF7FFC85BD350C7BB6</code> <code>082EF3AFD6AF4EB43FC469AD4F92E086</code> <code>AE54576F3AF7A90FED1F9282E6FC2211</code> <code>E9B790183CEB5894FCBE90C37299E236</code> <code>34C45AB6C9023A5D075500BE27D9DA5F</code> <code>CEBA671176510327C7C26BA0F6874E19</code> <code>59FA0B62EC095388113211D1C6C522A1</code> <code>B86316FE60F31D30F1F93276A77A07EE</code> <code>5D515665E8DC35931E10685E07D3C957</code> <code>9EF376DAB07B528DDE65C92736C394AF</code> <code>8299C506D1306D1F601F7FB62FA60825</code> <code>C54B4BB8448CA76A13147D8067C7CC0C</code> <code>ADE9BF0D5EEAD40DF7B32C4F57186F36</code> <code>90D2E8618D2930233D36CF79541B9F40</code> <code>E5ACD1CFC5CC9472A3A2630CAD0A2638</code> <code>F5C1DF874601D1BE5C49F4A3A7091D86</code> <code>4C95B23A79A3929ADA5B08D6850CF6BF</code> <code>D6EB43ADF05460B6C85D48767D8F1212</code> <code>29A67697780063CAD8AB2B81B4BB1514</code> <code>D3884CD07B50961A1DF55D2188FD29A4</code> <code>9905E858D006B01247F295343F81C9F0</code><br> <code>3BB2214E</code></td>
|
|
|
|
|
<td>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = 00B4E58B743874D6E98D144A60C51579470EE61D0B401B456CD6C2FBC
|
|
|
|
|
<!-- 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 = CD2428CA3CBC42CCA7730C364DFE98E7C29D93E334829AF7E3B1670139C25E93AC9F965150C6076E074F6642A98E72DB4DFD7ED356F707D8CD846746ECDB33E766B188959640A61D5A9E9BB386C785F97AF6D15A57FB8B07DF961FB6764FCFD4E74FD298491DB738239E4795B6100E68689EEE03A47BD5F3185E0F73A5EE4ECF5754D41F866CB0FF44EDDC9612F80C69612A7E8A80F499789B825C8F6EBA46BEC5FCDC67DC83A5778CCBE52FBE77A9F384CB3FEAF746C5DE6329F83B2A7615124D8E03BF380D78C78CA0E3E5B88B8FC7FD594ED2C556B5DF9C42E6973C7E46AECAA9EFA27DB142933A598F35F61B301600F9B1BCBE5173A57CA3B2F7EF4D18C4E319BAA3AF367D6DFE8AEED862A1FD9AA131025B9AFD6097B2688112C624A1B4CBFA645FA391932614E3BF0DC01790C0C4AC5FC408033057306BD049B2BD058D95239F31BE73AFB996B9B90AF3E50F60BC664803A04E0DC3C432EEA08677C2A07671BCAD52AE1A1CEA03A4343489A0133F386E5258972CF39AC86C698BF66FD8392DEC932E6B9293FB5EA0525777DBE417F1F3EE852AA01B104EBFDCD705EB238BEC143EA7A18620BD28391AEEEDBF77E8C4BCDBE8D4240728F2B8B198710DA942142044C2F969C1F4A82BB4F81F93EAEBB5CD14753A790102D42739F3AEB6D6C1A351418640D4DF81EB6D39DB8DEF208BF70E39F9F46F012CC8B16613A00D6380154B5D3453796FD8E5590E53A45BC042CC2A05CFB41F307BD35EF9232DF22ACBFFB8D62F8675CE4206F417C5F0994C1871EB57635A3E6F26D29D3D4C60C6CDA569BC5D8D89B50155E522FDC094A21A
|
|
|
|
|
tmp_aes_key = 7616F4BCEBB5512BF12F6CB68245AB6B85A800A6C66719222E53D9513A2FD742
|
|
|
|
|
tmp_aes_iv = 82AE22D863F4E16FC19325C8FE2AC7CC01D2C47171E0145EEF378B79EBB51A75</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = DF6F999AF9029D334C1E62B528B0F17FFB58B0AD76BA129B625F3B7C730B19D1218F5480C961ECEEEA28D3C4C5C106495B277FAB5BE890C8B3C306C4F8697E688101526E4BECF41A68C403238494D02D8BABA19953506540D9DE221C836EA7081ED2689F678960B6CDDD8512141299F6D93F42591F41412350BE6D102668EDD7EF8893DE013B9E097D30CF9AAD050CFDEA6D12A2F4E8EBC9C394FEBC6E5D51F78582228D6D1BC0E610CD4FA20C3909AC2D0BBBFD5DB0FCABC79B566457C6AC1D4C1CA0B7CF3B920AC7F190F74C0AAEA9B8C768BE0E1D4A1844B502262123E7B1CE7A9AA5B755F6E9411BF807FF6D3806D1A1B81242795116494BF5365715EA0B3EAE84BF7FFC85BD350C7BB6082EF3AFD6AF4EB43FC469AD4F92E086AE54576F3AF7A90FED1F9282E6FC2211E9B790183CEB5894FCBE90C37299E23634C45AB6C9023A5D075500BE27D9DA5FCEBA671176510327C7C26BA0F6874E1959FA0B62EC095388113211D1C6C522A1B86316FE60F31D30F1F93276A77A07EE5D515665E8DC35931E10685E07D3C9579EF376DAB07B528DDE65C92736C394AF8299C506D1306D1F601F7FB62FA60825C54B4BB8448CA76A13147D8067C7CC0CADE9BF0D5EEAD40DF7B32C4F57186F3690D2E8618D2930233D36CF79541B9F40E5ACD1CFC5CC9472A3A2630CAD0A2638F5C1DF874601D1BE5C49F4A3A7091D864C95B23A79A3929ADA5B08D6850CF6BFD6EB43ADF05460B6C85D48767D8F121229A67697780063CAD8AB2B81B4BB1514D3884CD07B50961A1DF55D2188FD29A49905E858D006B01247F295343F81C9F03BB2214E
|
|
|
|
|
tmp_aes_key = 665C5BF385AD7E705C53659CDC9488797EDE43ADCF41D9677F3855C39503844E
|
|
|
|
|
tmp_aes_iv = 7B05C24D32998307061DF0285067B79D753290EA29BBD9A6DBC947C043B078B3</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = D161373368D4E3DCE99BC0B63B2101BC4301537DBA0D89B5433042F69F2F19C95630CF7474FE41DE00CED06F7FE9FB9AED1CBDB97B652CC103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001001B986B7922D370598DA45B82F09368EB5629E909979DEDD0AD72E9D22D13E9A81B8F5EADE805376A27C665CEEA1308EB99E55D17D3368B1CA452A01E5CA730AA50A1D0BAE87F70321D15C1D57DBB3013D5B2C01D2B91AB8FB7376D6622BBD57AE3D26C735945BC7B9AD8B2ABE372859F89ED526EC8898F0C1BC4C76D862E2F59E851590DF470F6108286DE366960C602EB63FE6150463C0BF7AAB288BFAEEFE0E5427509E7F50C444E2EACCACF291E8D7F384953D42FB5948ADEA25EAC4FEB0794C402797665C173FC919E35F302DBF1D77A459093686514458132CC673B287C4DA4472464A378331DFE1258BEB8F2186B121E50798BAF4EF79409114F87ED217F119866A0201D4AD79C4634
|
|
|
|
|
answer = BA0D89B5433042F69F2F19C95630CF7474FE41DE00CED06F7FE9FB9AED1CBDB97B652CC103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001001B986B7922D370598DA45B82F09368EB5629E909979DEDD0AD72E9D22D13E9A81B8F5EADE805376A27C665CEEA1308EB99E55D17D3368B1CA452A01E5CA730AA50A1D0BAE87F70321D15C1D57DBB3013D5B2C01D2B91AB8FB7376D6622BBD57AE3D26C735945BC7B9AD8B2ABE372859F89ED526EC8898F0C1BC4C76D862E2F59E851590DF470F6108286DE366960C602EB63FE6150463C0BF7AAB288BFAEEFE0E5427509E7F50C444E2EACCACF291E8D7F384953D42FB5948ADEA25EAC4FEB0794C402797665C173FC919E35F302DBF1D77A459093686514458132CC673B287C4DA4472464A378331DFE1258BEB8F2186B121E50798BAF4EF79409114F87ED217F119866A0201D4AD79C4634</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = 39E497771B694165CE3FCC5DA0AF6DCE0FFFA34ABA0D89B5875147D43D520F2CE6A9C6589351DE4A559BC434A1A86279DC59A2D64E03D4D903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001009FEE30D53DF78108845A3D5013D9E27E55BB6953A4545A315642B005B0BB158C0C61088196003B36BA5A4A7BACF7F34E9B86539684EA2192A49CB5F1C9434E41C4894BDDBF65F6812213558E7A3953DE252CD682089B5102B9949CE28A7F6F8268A199A7D6A320CEA20D4000EEE9CC6BC9C2F80C290B9AD8FF5AAB52E5F442C9FCCB7C808F6A37190AE0463458E394024819A4B3D0A5CC534F079C0AC7994AB95EC099A410DBFBC8B128120F8A786F4E0DE13C52C7A7C741C68B2CEE606922579F4E554AD2973F08BB13A9C56918F82EE452094203CC226050F040C0E76CB80C2E0AD071F0EF0B75F30AEF61BE952DDF6FC718D0BD08336A3E75A3A8B85C6C88EA16986699791F231C87498D
|
|
|
|
|
answer = BA0D89B5875147D43D520F2CE6A9C6589351DE4A559BC434A1A86279DC59A2D64E03D4D903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001009FEE30D53DF78108845A3D5013D9E27E55BB6953A4545A315642B005B0BB158C0C61088196003B36BA5A4A7BACF7F34E9B86539684EA2192A49CB5F1C9434E41C4894BDDBF65F6812213558E7A3953DE252CD682089B5102B9949CE28A7F6F8268A199A7D6A320CEA20D4000EEE9CC6BC9C2F80C290B9AD8FF5AAB52E5F442C9FCCB7C808F6A37190AE0463458E394024819A4B3D0A5CC534F079C0AC7994AB95EC099A410DBFBC8B128120F8A786F4E0DE13C52C7A7C741C68B2CEE606922579F4E554AD2973F08BB13A9C56918F82EE452094203CC226050F040C0E76CB80C2E0AD071F0EF0B75F30AEF61BE952DDF6FC718D0BD08336A3E75A3A8B85C6C88EA16986699791F231C87498D</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 43 30 42 F6 9F 2F 19 C9 56 30 CF 74
|
|
|
|
|
0010 | 74 FE 41 DE 00 CE D0 6F 7F E9 FB 9A ED 1C BD B9
|
|
|
|
|
0020 | 7B 65 2C C1 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 87 51 47 D4 3D 52 0F 2C E6 A9 C6 58
|
|
|
|
|
0010 | 93 51 DE 4A 55 9B C4 34 A1 A8 62 79 DC 59 A2 D6
|
|
|
|
|
0020 | 4E 03 D4 D9 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 = BA0D89B5433042F69F2F19C95630CF7474FE41DE00CED06F7FE9FB9AED1CBDB97B652CC
|
|
|
|
|
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 | 1B 98 6B 79 22 D3 70 59 8D A4 5B 82 F0 93 68 EB
|
|
|
|
|
0140 | 56 29 E9 09 97 9D ED D0 AD 72 E9 D2 2D 13 E9 A8
|
|
|
|
|
0150 | 1B 8F 5E AD E8 05 37 6A 27 C6 65 CE EA 13 08 EB
|
|
|
|
|
0160 | 99 E5 5D 17 D3 36 8B 1C A4 52 A0 1E 5C A7 30 AA
|
|
|
|
|
0170 | 50 A1 D0 BA E8 7F 70 32 1D 15 C1 D5 7D BB 30 13
|
|
|
|
|
0180 | D5 B2 C0 1D 2B 91 AB 8F B7 37 6D 66 22 BB D5 7A
|
|
|
|
|
0190 | E3 D2 6C 73 59 45 BC 7B 9A D8 B2 AB E3 72 85 9F
|
|
|
|
|
01A0 | 89 ED 52 6E C8 89 8F 0C 1B C4 C7 6D 86 2E 2F 59
|
|
|
|
|
01B0 | E8 51 59 0D F4 70 F6 10 82 86 DE 36 69 60 C6 02
|
|
|
|
|
01C0 | EB 63 FE 61 50 46 3C 0B F7 AA B2 88 BF AE EF E0
|
|
|
|
|
01D0 | E5 42 75 09 E7 F5 0C 44 4E 2E AC CA CF 29 1E 8D
|
|
|
|
|
01E0 | 7F 38 49 53 D4 2F B5 94 8A DE A2 5E AC 4F EB 07
|
|
|
|
|
01F0 | 94 C4 02 79 76 65 C1 73 FC 91 9E 35 F3 02 DB F1
|
|
|
|
|
0200 | D7 7A 45 90 93 68 65 14 45 81 32 CC 67 3B 28 7C
|
|
|
|
|
0210 | 4D A4 47 24 64 A3 78 33 1D FE 12 58 BE B8 F2 18
|
|
|
|
|
0220 | 6B 12 1E 50 79 8B AF 4E F7 94 09 11 4F 87 ED 21
|
|
|
|
|
0230 | 7F 11 98 66</code></pre>
|
|
|
|
|
0130 | 9F EE 30 D5 3D F7 81 08 84 5A 3D 50 13 D9 E2 7E
|
|
|
|
|
0140 | 55 BB 69 53 A4 54 5A 31 56 42 B0 05 B0 BB 15 8C
|
|
|
|
|
0150 | 0C 61 08 81 96 00 3B 36 BA 5A 4A 7B AC F7 F3 4E
|
|
|
|
|
0160 | 9B 86 53 96 84 EA 21 92 A4 9C B5 F1 C9 43 4E 41
|
|
|
|
|
0170 | C4 89 4B DD BF 65 F6 81 22 13 55 8E 7A 39 53 DE
|
|
|
|
|
0180 | 25 2C D6 82 08 9B 51 02 B9 94 9C E2 8A 7F 6F 82
|
|
|
|
|
0190 | 68 A1 99 A7 D6 A3 20 CE A2 0D 40 00 EE E9 CC 6B
|
|
|
|
|
01A0 | C9 C2 F8 0C 29 0B 9A D8 FF 5A AB 52 E5 F4 42 C9
|
|
|
|
|
01B0 | FC CB 7C 80 8F 6A 37 19 0A E0 46 34 58 E3 94 02
|
|
|
|
|
01C0 | 48 19 A4 B3 D0 A5 CC 53 4F 07 9C 0A C7 99 4A B9
|
|
|
|
|
01D0 | 5E C0 99 A4 10 DB FB C8 B1 28 12 0F 8A 78 6F 4E
|
|
|
|
|
01E0 | 0D E1 3C 52 C7 A7 C7 41 C6 8B 2C EE 60 69 22 57
|
|
|
|
|
01F0 | 9F 4E 55 4A D2 97 3F 08 BB 13 A9 C5 69 18 F8 2E
|
|
|
|
|
0200 | E4 52 09 42 03 CC 22 60 50 F0 40 C0 E7 6C B8 0C
|
|
|
|
|
0210 | 2E 0A D0 71 F0 EF 0B 75 F3 0A EF 61 BE 95 2D DF
|
|
|
|
|
0220 | 6F C7 18 D0 BD 08 33 6A 3E 75 A3 A8 B8 5C 6C 88
|
|
|
|
|
0230 | EA 16 98 66</code></pre>
|
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
|
<pre><code>server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;</code></pre>
|
|
|
|
|
<table class="table">
|
|
|
|
@ -570,13 +570,13 @@ answer = BA0D89B5433042F69F2F19C95630CF7474FE41DE00CED06F7FE9FB9AED1CBDB97B652CC
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>433042F69F2F19C95630CF7474FE41DE</code></td>
|
|
|
|
|
<td><code>875147D43D520F2CE6A9C6589351DE4A</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>00CED06F7FE9FB9AED1CBDB97B652CC1</code></td>
|
|
|
|
|
<td><code>559BC434A1A86279DC59A2D64E03D4D9</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B5433042F69F2F19C95630CF7474FE41DE00CED06F7FE9FB9AED1CBDB97B652CC
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE0001001B986B7922D370598DA45B82</code> <code>F09368EB5629E909979DEDD0AD72E9D2</code> <code>2D13E9A81B8F5EADE805376A27C665CE</code> <code>EA1308EB99E55D17D3368B1CA452A01E</code> <code>5CA730AA50A1D0BAE87F70321D15C1D5</code> <code>7DBB3013D5B2C01D2B91AB8FB7376D66</code> <code>22BBD57AE3D26C735945BC7B9AD8B2AB</code> <code>E372859F89ED526EC8898F0C1BC4C76D</code> <code>862E2F59E851590DF470F6108286DE36</code> <code>6960C602EB63FE6150463C0BF7AAB288</code> <code>BFAEEFE0E5427509E7F50C444E2EACCA</code> <code>CF291E8D7F384953D42FB5948ADEA25E</code> <code>AC4FEB0794C402797665C173FC919E35</code> <code>F302DBF1D77A459093686514458132CC</code> <code>673B287C4DA4472464A378331DFE1258</code> <code>BEB8F2186B121E50798BAF4EF7940911</code><br> <code>4F87ED21</code></td>
|
|
|
|
|
<td><code>FE0001009FEE30D53DF78108845A3D50</code> <code>13D9E27E55BB6953A4545A315642B005</code> <code>B0BB158C0C61088196003B36BA5A4A7B</code> <code>ACF7F34E9B86539684EA2192A49CB5F1</code> <code>C9434E41C4894BDDBF65F6812213558E</code> <code>7A3953DE252CD682089B5102B9949CE2</code> <code>8A7F6F8268A199A7D6A320CEA20D4000</code> <code>EEE9CC6BC9C2F80C290B9AD8FF5AAB52</code> <code>E5F442C9FCCB7C808F6A37190AE04634</code> <code>58E394024819A4B3D0A5CC534F079C0A</code> <code>C7994AB95EC099A410DBFBC8B128120F</code> <code>8A786F4E0DE13C52C7A7C741C68B2CEE</code> <code>606922579F4E554AD2973F08BB13A9C5</code> <code>6918F82EE452094203CC226050F040C0</code> <code>E76CB80C2E0AD071F0EF0B75F30AEF61</code> <code>BE952DDF6FC718D0BD08336A3E75A3A8</code><br> <code>B85C6C88</code></td>
|
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>7F119866</code> (1721241983 in decimal)</td>
|
|
|
|
|
<td><code>EA169866</code> (1721243370 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B5433042F69F2F19C95630CF7474FE41DE00CED06F7FE9FB9AED1CBDB97B652CC
|
|
|
|
|
<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 = 5FD7BEF0C4C2AA3D4434E97D289F9837AFA5F7E9D5AF9B22F65043E50A3C6C506CA5407CBA59BEEC6B676E57AC5B5CE632E66F3592A4F87462B41706F73CE36162A8123570966981B741604380382F89B0FA762D9273488111144C5FA1C7357373F1AB92DEF2EF93970A42D8CC90FC59E882632E69D8C7F52AB767ADDE58630F3BBC24C960440454204FAE4DD1EBAD0843F9D7FAC4BA1DAC5074E61FB8623E82594901EF7A426EAB645D49FD77AD1A4BB17B77984AF53D528BECA167275AC1F6F6787B1C8689350144CB5BB7BAD907FA10B1A7A273080825BAF018111FFC97672121FC522C4AB8D2BF5E6FC4169B6A54334777DA62EB4FC9B05662CC24F4A6A2</code></pre>
|
|
|
|
|
<pre><code>b = DF3CA92440B635DF27C9EA9475D257B213B665362482515BCB2ECA71C2583B56527F707D6FF99F571386D9D16E36393CA474FD6A0C69D4F4FE84C2390ED3A67947FF121D41D5315B655F94FBBC5C08E4D1E8AD3D814EC723A3C8AA0E03BA34508977BC61EB3124A34336AAEB82E9D6418F6EF584097014B7C55078B2C74232491CAFBE7D28F9C95DC7DEDD7243C7FA0CB1E64F7D35DAC12137257B97829D69818C779E22BDBE296019A390F9163280946AD1E400841137414183FB99712A280EA16E0BD1788D358947FD76548D87192B17F8D8F34865E0A45A6E97DB0A9D44701E2758AE5DF94CA5F4EB3AA63294D4F58ED7E2718FDAF68D330D5C5704FD158F</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 = 7E6CD4AD1F8412055A88AA84B359C835947A5B0A386E4C7514877F32D24EF716B76B7AACB6223CD14F188CBFC58D704236E03952004057137A1D422280F666471E504BEFA49E95B688BADBE25C96376B516D4F087A880E0147743B878F2F0F5566258B86195EE32E4B34F5996151D2C64C4F0B13E2DAC88C95FEC342F532B84CEDB3B2A6A39096ACF0D8FA135664CE1657924748423D8E817C25C579068DFCA297D1DE1CD491ACE62013D9DF61E5E778E015672F159392DC7BD82872C3AB71D9DC137A242E2464A37B3BE20404C446CED2312E46EB06F53AE49402402BB0693FBB1E9AA76AAE22141EB150211EB93605137FC4BFCAA35C1D5517AFA6FB839699</code></pre>
|
|
|
|
|
<pre><code>g_b = 680E4A820ADCE87346A6C6A6D8CFDF8971422C9CFB977CE89C66B4E8041A1D9A7783844819B6DF8B154063644CF959B8A70CE0FB2D96396CFC9536CC03C708B07B32A1E57F90CF18FA723B66A3B58C105F878DF5797085989CD6E89A0D22BA26F412F0F622B91D3848A5B7569773D0A4E921C933A111C4067F5B9ADC4E6F34AF5F01545E71CD73D43A31A976BBE4F817A95161ABFC6E67527A4798E11808B8913EB928EE128DA015A371FE47D0DBB9243301CEE256E8518A06BB7EF4D9A0EDCFDBF96E4433F3F3F5DBC2452D2D312DBDB60214831EDAEA9F170782B1264B46DED924C44BF6AA38327731879EE84414C993349B19F64442A434EA9CF392452D22</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 43 30 42 F6 9F 2F 19 C9 56 30 CF 74
|
|
|
|
|
0010 | 74 FE 41 DE 00 CE D0 6F 7F E9 FB 9A ED 1C BD B9
|
|
|
|
|
0020 | 7B 65 2C C1 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 7E 6C D4 AD 1F 84 12 05 5A 88 AA 84 B3 59 C8 35
|
|
|
|
|
0040 | 94 7A 5B 0A 38 6E 4C 75 14 87 7F 32 D2 4E F7 16
|
|
|
|
|
0050 | B7 6B 7A AC B6 22 3C D1 4F 18 8C BF C5 8D 70 42
|
|
|
|
|
0060 | 36 E0 39 52 00 40 57 13 7A 1D 42 22 80 F6 66 47
|
|
|
|
|
0070 | 1E 50 4B EF A4 9E 95 B6 88 BA DB E2 5C 96 37 6B
|
|
|
|
|
0080 | 51 6D 4F 08 7A 88 0E 01 47 74 3B 87 8F 2F 0F 55
|
|
|
|
|
0090 | 66 25 8B 86 19 5E E3 2E 4B 34 F5 99 61 51 D2 C6
|
|
|
|
|
00A0 | 4C 4F 0B 13 E2 DA C8 8C 95 FE C3 42 F5 32 B8 4C
|
|
|
|
|
00B0 | ED B3 B2 A6 A3 90 96 AC F0 D8 FA 13 56 64 CE 16
|
|
|
|
|
00C0 | 57 92 47 48 42 3D 8E 81 7C 25 C5 79 06 8D FC A2
|
|
|
|
|
00D0 | 97 D1 DE 1C D4 91 AC E6 20 13 D9 DF 61 E5 E7 78
|
|
|
|
|
00E0 | E0 15 67 2F 15 93 92 DC 7B D8 28 72 C3 AB 71 D9
|
|
|
|
|
00F0 | DC 13 7A 24 2E 24 64 A3 7B 3B E2 04 04 C4 46 CE
|
|
|
|
|
0100 | D2 31 2E 46 EB 06 F5 3A E4 94 02 40 2B B0 69 3F
|
|
|
|
|
0110 | BB 1E 9A A7 6A AE 22 14 1E B1 50 21 1E B9 36 05
|
|
|
|
|
0120 | 13 7F C4 BF CA A3 5C 1D 55 17 AF A6 FB 83 96 99</code></pre>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 87 51 47 D4 3D 52 0F 2C E6 A9 C6 58
|
|
|
|
|
0010 | 93 51 DE 4A 55 9B C4 34 A1 A8 62 79 DC 59 A2 D6
|
|
|
|
|
0020 | 4E 03 D4 D9 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 68 0E 4A 82 0A DC E8 73 46 A6 C6 A6 D8 CF DF 89
|
|
|
|
|
0040 | 71 42 2C 9C FB 97 7C E8 9C 66 B4 E8 04 1A 1D 9A
|
|
|
|
|
0050 | 77 83 84 48 19 B6 DF 8B 15 40 63 64 4C F9 59 B8
|
|
|
|
|
0060 | A7 0C E0 FB 2D 96 39 6C FC 95 36 CC 03 C7 08 B0
|
|
|
|
|
0070 | 7B 32 A1 E5 7F 90 CF 18 FA 72 3B 66 A3 B5 8C 10
|
|
|
|
|
0080 | 5F 87 8D F5 79 70 85 98 9C D6 E8 9A 0D 22 BA 26
|
|
|
|
|
0090 | F4 12 F0 F6 22 B9 1D 38 48 A5 B7 56 97 73 D0 A4
|
|
|
|
|
00A0 | E9 21 C9 33 A1 11 C4 06 7F 5B 9A DC 4E 6F 34 AF
|
|
|
|
|
00B0 | 5F 01 54 5E 71 CD 73 D4 3A 31 A9 76 BB E4 F8 17
|
|
|
|
|
00C0 | A9 51 61 AB FC 6E 67 52 7A 47 98 E1 18 08 B8 91
|
|
|
|
|
00D0 | 3E B9 28 EE 12 8D A0 15 A3 71 FE 47 D0 DB B9 24
|
|
|
|
|
00E0 | 33 01 CE E2 56 E8 51 8A 06 BB 7E F4 D9 A0 ED CF
|
|
|
|
|
00F0 | DB F9 6E 44 33 F3 F3 F5 DB C2 45 2D 2D 31 2D BD
|
|
|
|
|
0100 | B6 02 14 83 1E DA EA 9F 17 07 82 B1 26 4B 46 DE
|
|
|
|
|
0110 | D9 24 C4 4B F6 AA 38 32 77 31 87 9E E8 44 14 C9
|
|
|
|
|
0120 | 93 34 9B 19 F6 44 42 A4 34 EA 9C F3 92 45 2D 22</code></pre>
|
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
|
<pre><code>client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;</code></pre>
|
|
|
|
|
<table class="table">
|
|
|
|
@ -658,19 +658,19 @@ answer = BA0D89B5433042F69F2F19C95630CF7474FE41DE00CED06F7FE9FB9AED1CBDB97B652CC
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>433042F69F2F19C95630CF7474FE41DE</code></td>
|
|
|
|
|
<td><code>875147D43D520F2CE6A9C6589351DE4A</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>00CED06F7FE9FB9AED1CBDB97B652CC1</code></td>
|
|
|
|
|
<td><code>559BC434A1A86279DC59A2D64E03D4D9</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE0001007E6CD4AD1F8412055A88AA84</code> <code>B359C835947A5B0A386E4C7514877F32</code> <code>D24EF716B76B7AACB6223CD14F188CBF</code> <code>C58D704236E03952004057137A1D4222</code> <code>80F666471E504BEFA49E95B688BADBE2</code> <code>5C96376B516D4F087A880E0147743B87</code> <code>8F2F0F5566258B86195EE32E4B34F599</code> <code>6151D2C64C4F0B13E2DAC88C95FEC342</code> <code>F532B84CEDB3B2A6A39096ACF0D8FA13</code> <code>5664CE1657924748423D8E817C25C579</code> <code>068DFCA297D1DE1CD491ACE62013D9DF</code> <code>61E5E778E015672F159392DC7BD82872</code> <code>C3AB71D9DC137A242E2464A37B3BE204</code> <code>04C446CED2312E46EB06F53AE4940240</code> <code>2BB0693FBB1E9AA76AAE22141EB15021</code> <code>1EB93605137FC4BFCAA35C1D5517AFA6</code><br> <code>FB839699</code></td>
|
|
|
|
|
<td><code>FE000100680E4A820ADCE87346A6C6A6</code> <code>D8CFDF8971422C9CFB977CE89C66B4E8</code> <code>041A1D9A7783844819B6DF8B15406364</code> <code>4CF959B8A70CE0FB2D96396CFC9536CC</code> <code>03C708B07B32A1E57F90CF18FA723B66</code> <code>A3B58C105F878DF5797085989CD6E89A</code> <code>0D22BA26F412F0F622B91D3848A5B756</code> <code>9773D0A4E921C933A111C4067F5B9ADC</code> <code>4E6F34AF5F01545E71CD73D43A31A976</code> <code>BBE4F817A95161ABFC6E67527A4798E1</code> <code>1808B8913EB928EE128DA015A371FE47</code> <code>D0DBB9243301CEE256E8518A06BB7EF4</code> <code>D9A0EDCFDBF96E4433F3F3F5DBC2452D</code> <code>2D312DBDB60214831EDAEA9F170782B1</code> <code>264B46DED924C44BF6AA38327731879E</code> <code>E84414C993349B19F64442A434EA9CF3</code><br> <code>92452D22</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 = BA0D89B5433042F69F2F19C95630CF7474FE41DE00CED06F7FE9FB9AED1CBDB97B652CC
|
|
|
|
|
<!-- 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 = 54B64366433042F69F2F19C95630CF7474FE41DE00CED06F7FE9FB9AED1CBDB97B652CC10000000000000000FE0001007E6CD4AD1F8412055A88AA84B359C835947A5B0A386E4C7514877F32D24EF716B76B7AACB6223CD14F188CBFC58D704236E03952004057137A1D422280F666471E504BEFA49E95B688BADBE25C96376B516D4F087A880E0147743B878F2F0F5566258B86195EE32E4B34F5996151D2C64C4F0B13E2DAC88C95FEC342F532B84CEDB3B2A6A39096ACF0D8FA135664CE1657924748423D8E817C25C579068DFCA297D1DE1CD491ACE62013D9DF61E5E778E015672F159392DC7BD82872C3AB71D9DC137A242E2464A37B3BE20404C446CED2312E46EB06F53AE49402402BB0693FBB1E9AA76AAE22141EB150211EB93605137FC4BFCAA35C1D5517AFA6FB839699
|
|
|
|
|
padding = 2F61B792F1F61500E81CAFB1
|
|
|
|
|
tmp_aes_key = 7616F4BCEBB5512BF12F6CB68245AB6B85A800A6C66719222E53D9513A2FD742
|
|
|
|
|
tmp_aes_iv = 82AE22D863F4E16FC19325C8FE2AC7CC01D2C47171E0145EEF378B79EBB51A75</code></pre>
|
|
|
|
|
<pre><code>data = 54B64366875147D43D520F2CE6A9C6589351DE4A559BC434A1A86279DC59A2D64E03D4D90000000000000000FE000100680E4A820ADCE87346A6C6A6D8CFDF8971422C9CFB977CE89C66B4E8041A1D9A7783844819B6DF8B154063644CF959B8A70CE0FB2D96396CFC9536CC03C708B07B32A1E57F90CF18FA723B66A3B58C105F878DF5797085989CD6E89A0D22BA26F412F0F622B91D3848A5B7569773D0A4E921C933A111C4067F5B9ADC4E6F34AF5F01545E71CD73D43A31A976BBE4F817A95161ABFC6E67527A4798E11808B8913EB928EE128DA015A371FE47D0DBB9243301CEE256E8518A06BB7EF4D9A0EDCFDBF96E4433F3F3F5DBC2452D2D312DBDB60214831EDAEA9F170782B1264B46DED924C44BF6AA38327731879EE84414C993349B19F64442A434EA9CF392452D22
|
|
|
|
|
padding = 936119E63C8C391D17234525
|
|
|
|
|
tmp_aes_key = 665C5BF385AD7E705C53659CDC9488797EDE43ADCF41D9677F3855C39503844E
|
|
|
|
|
tmp_aes_iv = 7B05C24D32998307061DF0285067B79D753290EA29BBD9A6DBC947C043B078B3</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 = 844968FE14D5262628581EDDEEA8644A21BB781F63F1610DC6F6FCA5A9ED9B3FF4D5D55C66FF0CDEE36254571FFCBDBDD5D8FBC7A117B269D6646F27A698084947D483787142AA7ECA6A65CF4D523FBD187E003EFFB3ED2E9652EA407C7A6D6EF6E19C0E6E8FAFE251F42604D76286123821B6D625AA0952EA3819BEF806406AA9520EBFDBEB0A92870C964D7540DEEEC5AA50FA6EEE523640C1FA8090F855EA3257F4110A8A194CCFF6FD5894CB809092AEA75A8AA3BCB1C1A6F5D9A52556FEA8AC387A21483CB9B14A3DDF47B73EECD080B4D7C74551F7C0FF29B58DC8BE6905BEF4A064A81E41B4FF28A6FF649A414CFE12B9E51AED820337BD1E6F6CB4B9D46697E31F4EAC4434EA49218EC4705CFE5ED5159D9C17B621BA80E28037A6876BB984321C01793CD3248BADA28A46934F897FCD6E29E95176D45EE07658762B0982C14B3FD9652B3EAB4A18F1E58DDA</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 838CB61F8CFC73B2D3B9B427A4443397439FB54E438D8CDCBF6DA99C459D538907992F59A0270515DB084C51C1D9DDE39AB3E4226AB7759E549F47485F80B52BA74BE85F65595B125508A70176FB582A2D5E17D9E71EAF29338C5A7DBDFADCA975F788062EF057FBCB25B8719C8D2276BE847944E579C6824BF35A0C5BE1BDFFC4F54D08F49B58832F95D1363BB08E01BF2EB5100C17F45F5930101D2B8AC8983178B149DC2AF350E18DD1CA5B8FE269899E2FA7DF5F3D150EA2467C3FDE85C717E277DBEB23E66099D958ACBFDBABEF3B47773FE15919AF5C44D84985722D18779279BDE8FED0CCFD3CFABAB7AC9633D8A8917C1664D8FCAC2A2977827F1D590DB66A8032EE1AF973745EEB98ED694EB34BED7A7524D710C813B9DBB729148512D62BDB9DF3E87B347645B925C791BB55C1513A0A861836E441DA97B6571636076225641B82B4AAB59BDE06B7B6494B</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 80 68 04 00 7F 11 98 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 43 30 42 F6 9F 2F 19 C9
|
|
|
|
|
0020 | 56 30 CF 74 74 FE 41 DE 00 CE D0 6F 7F E9 FB 9A
|
|
|
|
|
0030 | ED 1C BD B9 7B 65 2C C1 FE 50 01 00 84 49 68 FE
|
|
|
|
|
0040 | 14 D5 26 26 28 58 1E DD EE A8 64 4A 21 BB 78 1F
|
|
|
|
|
0050 | 63 F1 61 0D C6 F6 FC A5 A9 ED 9B 3F F4 D5 D5 5C
|
|
|
|
|
0060 | 66 FF 0C DE E3 62 54 57 1F FC BD BD D5 D8 FB C7
|
|
|
|
|
0070 | A1 17 B2 69 D6 64 6F 27 A6 98 08 49 47 D4 83 78
|
|
|
|
|
0080 | 71 42 AA 7E CA 6A 65 CF 4D 52 3F BD 18 7E 00 3E
|
|
|
|
|
0090 | FF B3 ED 2E 96 52 EA 40 7C 7A 6D 6E F6 E1 9C 0E
|
|
|
|
|
00A0 | 6E 8F AF E2 51 F4 26 04 D7 62 86 12 38 21 B6 D6
|
|
|
|
|
00B0 | 25 AA 09 52 EA 38 19 BE F8 06 40 6A A9 52 0E BF
|
|
|
|
|
00C0 | DB EB 0A 92 87 0C 96 4D 75 40 DE EE C5 AA 50 FA
|
|
|
|
|
00D0 | 6E EE 52 36 40 C1 FA 80 90 F8 55 EA 32 57 F4 11
|
|
|
|
|
00E0 | 0A 8A 19 4C CF F6 FD 58 94 CB 80 90 92 AE A7 5A
|
|
|
|
|
00F0 | 8A A3 BC B1 C1 A6 F5 D9 A5 25 56 FE A8 AC 38 7A
|
|
|
|
|
0100 | 21 48 3C B9 B1 4A 3D DF 47 B7 3E EC D0 80 B4 D7
|
|
|
|
|
0110 | C7 45 51 F7 C0 FF 29 B5 8D C8 BE 69 05 BE F4 A0
|
|
|
|
|
0120 | 64 A8 1E 41 B4 FF 28 A6 FF 64 9A 41 4C FE 12 B9
|
|
|
|
|
0130 | E5 1A ED 82 03 37 BD 1E 6F 6C B4 B9 D4 66 97 E3
|
|
|
|
|
0140 | 1F 4E AC 44 34 EA 49 21 8E C4 70 5C FE 5E D5 15
|
|
|
|
|
0150 | 9D 9C 17 B6 21 BA 80 E2 80 37 A6 87 6B B9 84 32
|
|
|
|
|
0160 | 1C 01 79 3C D3 24 8B AD A2 8A 46 93 4F 89 7F CD
|
|
|
|
|
0170 | 6E 29 E9 51 76 D4 5E E0 76 58 76 2B 09 82 C1 4B
|
|
|
|
|
0180 | 3F D9 65 2B 3E AB 4A 18 F1 E5 8D DA</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 C0 8C 0C 00 EA 16 98 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 87 51 47 D4 3D 52 0F 2C
|
|
|
|
|
0020 | E6 A9 C6 58 93 51 DE 4A 55 9B C4 34 A1 A8 62 79
|
|
|
|
|
0030 | DC 59 A2 D6 4E 03 D4 D9 FE 50 01 00 83 8C B6 1F
|
|
|
|
|
0040 | 8C FC 73 B2 D3 B9 B4 27 A4 44 33 97 43 9F B5 4E
|
|
|
|
|
0050 | 43 8D 8C DC BF 6D A9 9C 45 9D 53 89 07 99 2F 59
|
|
|
|
|
0060 | A0 27 05 15 DB 08 4C 51 C1 D9 DD E3 9A B3 E4 22
|
|
|
|
|
0070 | 6A B7 75 9E 54 9F 47 48 5F 80 B5 2B A7 4B E8 5F
|
|
|
|
|
0080 | 65 59 5B 12 55 08 A7 01 76 FB 58 2A 2D 5E 17 D9
|
|
|
|
|
0090 | E7 1E AF 29 33 8C 5A 7D BD FA DC A9 75 F7 88 06
|
|
|
|
|
00A0 | 2E F0 57 FB CB 25 B8 71 9C 8D 22 76 BE 84 79 44
|
|
|
|
|
00B0 | E5 79 C6 82 4B F3 5A 0C 5B E1 BD FF C4 F5 4D 08
|
|
|
|
|
00C0 | F4 9B 58 83 2F 95 D1 36 3B B0 8E 01 BF 2E B5 10
|
|
|
|
|
00D0 | 0C 17 F4 5F 59 30 10 1D 2B 8A C8 98 31 78 B1 49
|
|
|
|
|
00E0 | DC 2A F3 50 E1 8D D1 CA 5B 8F E2 69 89 9E 2F A7
|
|
|
|
|
00F0 | DF 5F 3D 15 0E A2 46 7C 3F DE 85 C7 17 E2 77 DB
|
|
|
|
|
0100 | EB 23 E6 60 99 D9 58 AC BF DB AB EF 3B 47 77 3F
|
|
|
|
|
0110 | E1 59 19 AF 5C 44 D8 49 85 72 2D 18 77 92 79 BD
|
|
|
|
|
0120 | E8 FE D0 CC FD 3C FA BA B7 AC 96 33 D8 A8 91 7C
|
|
|
|
|
0130 | 16 64 D8 FC AC 2A 29 77 82 7F 1D 59 0D B6 6A 80
|
|
|
|
|
0140 | 32 EE 1A F9 73 74 5E EB 98 ED 69 4E B3 4B ED 7A
|
|
|
|
|
0150 | 75 24 D7 10 C8 13 B9 DB B7 29 14 85 12 D6 2B DB
|
|
|
|
|
0160 | 9D F3 E8 7B 34 76 45 B9 25 C7 91 BB 55 C1 51 3A
|
|
|
|
|
0170 | 0A 86 18 36 E4 41 DA 97 B6 57 16 36 07 62 25 64
|
|
|
|
|
0180 | 1B 82 B4 AA B5 9B DE 06 B7 B6 49 4B</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>806804007F119866</code></td>
|
|
|
|
|
<td><code>C08C0C00EA169866</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>433042F69F2F19C95630CF7474FE41DE</code></td>
|
|
|
|
|
<td><code>875147D43D520F2CE6A9C6589351DE4A</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>00CED06F7FE9FB9AED1CBDB97B652CC1</code></td>
|
|
|
|
|
<td><code>559BC434A1A86279DC59A2D64E03D4D9</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE500100844968FE14D5262628581EDD</code> <code>EEA8644A21BB781F63F1610DC6F6FCA5</code> <code>A9ED9B3FF4D5D55C66FF0CDEE3625457</code> <code>1FFCBDBDD5D8FBC7A117B269D6646F27</code> <code>A698084947D483787142AA7ECA6A65CF</code> <code>4D523FBD187E003EFFB3ED2E9652EA40</code> <code>7C7A6D6EF6E19C0E6E8FAFE251F42604</code> <code>D76286123821B6D625AA0952EA3819BE</code> <code>F806406AA9520EBFDBEB0A92870C964D</code> <code>7540DEEEC5AA50FA6EEE523640C1FA80</code> <code>90F855EA3257F4110A8A194CCFF6FD58</code> <code>94CB809092AEA75A8AA3BCB1C1A6F5D9</code> <code>A52556FEA8AC387A21483CB9B14A3DDF</code> <code>47B73EECD080B4D7C74551F7C0FF29B5</code> <code>8DC8BE6905BEF4A064A81E41B4FF28A6</code> <code>FF649A414CFE12B9E51AED820337BD1E</code> <code>6F6CB4B9D46697E31F4EAC4434EA4921</code> <code>8EC4705CFE5ED5159D9C17B621BA80E2</code> <code>8037A6876BB984321C01793CD3248BAD</code> <code>A28A46934F897FCD6E29E95176D45EE0</code> <code>7658762B0982C14B3FD9652B3EAB4A18</code><br> <code>F1E58DDA</code></td>
|
|
|
|
|
<td><code>FE500100838CB61F8CFC73B2D3B9B427</code> <code>A4443397439FB54E438D8CDCBF6DA99C</code> <code>459D538907992F59A0270515DB084C51</code> <code>C1D9DDE39AB3E4226AB7759E549F4748</code> <code>5F80B52BA74BE85F65595B125508A701</code> <code>76FB582A2D5E17D9E71EAF29338C5A7D</code> <code>BDFADCA975F788062EF057FBCB25B871</code> <code>9C8D2276BE847944E579C6824BF35A0C</code> <code>5BE1BDFFC4F54D08F49B58832F95D136</code> <code>3BB08E01BF2EB5100C17F45F5930101D</code> <code>2B8AC8983178B149DC2AF350E18DD1CA</code> <code>5B8FE269899E2FA7DF5F3D150EA2467C</code> <code>3FDE85C717E277DBEB23E66099D958AC</code> <code>BFDBABEF3B47773FE15919AF5C44D849</code> <code>85722D18779279BDE8FED0CCFD3CFABA</code> <code>B7AC9633D8A8917C1664D8FCAC2A2977</code> <code>827F1D590DB66A8032EE1AF973745EEB</code> <code>98ED694EB34BED7A7524D710C813B9DB</code> <code>B729148512D62BDB9DF3E87B347645B9</code> <code>25C791BB55C1513A0A861836E441DA97</code> <code>B6571636076225641B82B4AAB59BDE06</code><br> <code>B7B6494B</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 = 425931C2B40155DDDF22F527432BABD35D7C066F18AD6F0DA9577C8065067166210773CB4AB56A75840D16083992201FB206CECFC5BF6B9C402B8FF8FEC8C82677BC6C64E99444946B1D795E52A832F009A5717F1880C96E5E990E7BC27FEFB8C5BC7B02045D87DB4A261BC91ADA18C8818FBB7C6F34B95385C1ECF1BEE7C8D607A6666CC5B1B376C8FEFAE9B73A66C47B5358D3F4F72F4D248FCC9F22BE3F06AEAB22C5CA3E73A84C16E5D7AD5C5EC188376C7D4AE8AE9D3A2981E2C6C99E426573B75BB583DB797FA1A675C7C9FF4CA9ABACB662974CADDC7D5CD6E51695846FE36E98FC12E2BAC8E9B58800EFB519615F9F84667F3273407002717676B0E7</code></pre>
|
|
|
|
|
<pre><code>auth_key = 2FD04B560BC77FB9F0257650E34E3F2DB3C7AF4E0084BE0DF217617C42D7B7E52464CFB8DBD25492EA98F6E7D2B0B837E545430EB7A5BE1039621459C05DBCCA3581D7E2BB64C8BD4B417C9F9D5EE2C185637DEFCC324C52B094DF4038A4D8BD58DA7090AF8496782541301E4E419A2807D50A2635CA5C2BA0CE15D53863FEDAB1E53A26EB9391C7CBC25AD3D8BA9E4E0BA843E5BACB9BEA92A890792379B60177785D23140F0C6FA2CA3E45F4AEF660BF02C3E4783FB6E6014664B1B989FF13A6C2EB4022007D6035520847261CB5AD2A27765D9F3F831522DC191AFB1E124F9EED5CF48E6207651B50EAFD35E07F93DE3E20F85D88A8129F21C5091041EDA5</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 68 F0 CD 7F 11 98 66
|
|
|
|
|
0010 | 88 00 00 00 34 F7 CB 3B 43 30 42 F6 9F 2F 19 C9
|
|
|
|
|
0020 | 56 30 CF 74 74 FE 41 DE 00 CE D0 6F 7F E9 FB 9A
|
|
|
|
|
0030 | ED 1C BD B9 7B 65 2C C1 2A 72 21 5F FB 02 E7 AF
|
|
|
|
|
0040 | D3 23 A3 D7 D3 18 3E C4</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 E0 79 EF EB 16 98 66
|
|
|
|
|
0010 | A8 00 00 00 34 F7 CB 3B 87 51 47 D4 3D 52 0F 2C
|
|
|
|
|
0020 | E6 A9 C6 58 93 51 DE 4A 55 9B C4 34 A1 A8 62 79
|
|
|
|
|
0030 | DC 59 A2 D6 4E 03 D4 D9 20 E9 EA 8C 4A D4 B4 41
|
|
|
|
|
0040 | 86 E8 B4 32 8E D7 C5 D7</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>0168F0CD7F119866</code></td>
|
|
|
|
|
<td><code>01E079EFEB169866</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>88000000</code> (136 in decimal)</td>
|
|
|
|
|
<td><code>A8000000</code> (168 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>433042F69F2F19C95630CF7474FE41DE</code></td>
|
|
|
|
|
<td><code>875147D43D520F2CE6A9C6589351DE4A</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>00CED06F7FE9FB9AED1CBDB97B652CC1</code></td>
|
|
|
|
|
<td><code>559BC434A1A86279DC59A2D64E03D4D9</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>2A72215FFB02E7AFD323A3D7D3183EC4</code></td>
|
|
|
|
|
<td><code>20E9EA8C4AD4B44186E8B4328ED7C5D7</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>
|
|
|
|
|