|
|
|
@ -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 BC 76 09 00 FE 0F 98 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE E1 90 78 1B 9B 7E 8F E6
|
|
|
|
|
0020 | E0 F1 12 C1 4F 9D 21 82</code></pre>
|
|
|
|
|
<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>
|
|
|
|
|
<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>BC760900FE0F9866</code></td>
|
|
|
|
|
<td><code>D0D208007E119866</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>E190781B9B7E8FE6E0F112C14F9D2182</code></td>
|
|
|
|
|
<td><code>433042F69F2F19C95630CF7474FE41DE</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 A4 A9 8D FE 0F 98 66
|
|
|
|
|
0010 | B8 00 00 00 63 24 16 05 E1 90 78 1B 9B 7E 8F E6
|
|
|
|
|
0020 | E0 F1 12 C1 4F 9D 21 82 EF 3B AC 77 3D 05 90 7F
|
|
|
|
|
0030 | 94 DB F3 E8 E7 D1 7A 28 08 19 44 5F 21 89 A8 6F
|
|
|
|
|
0040 | 19 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 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
|
|
|
|
|
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>01A4A98DFE0F9866</code></td>
|
|
|
|
|
<td><code>014449987E119866</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>B8000000</code> (184 in decimal)</td>
|
|
|
|
|
<td><code>A4000000</code> (164 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>E190781B9B7E8FE6E0F112C14F9D2182</code></td>
|
|
|
|
|
<td><code>433042F69F2F19C95630CF7474FE41DE</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>EF3BAC773D05907F94DBF3E8E7D17A28</code></td>
|
|
|
|
|
<td><code>00CED06F7FE9FB9AED1CBDB97B652CC1</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>0819445F2189A86F19000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1820684747012599577</td>
|
|
|
|
|
<td><code>0828F84BBB45A022AF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2952192823440450223</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 = 1820684747012599577</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1820684747012599577 = 1328775719 * 1370197183</code></p>
|
|
|
|
|
<pre><code>p = 1328775719
|
|
|
|
|
q = 1370197183</code></pre>
|
|
|
|
|
<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>
|
|
|
|
|
<!-- 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 19 44 5F 21 89 A8 6F 19 00 00 00
|
|
|
|
|
0010 | 04 4F 33 82 27 00 00 00 04 51 AB 8C BF 00 00 00
|
|
|
|
|
0020 | E1 90 78 1B 9B 7E 8F E6 E0 F1 12 C1 4F 9D 21 82
|
|
|
|
|
0030 | EF 3B AC 77 3D 05 90 7F 94 DB F3 E8 E7 D1 7A 28
|
|
|
|
|
0040 | C2 FA C5 BA D6 EC BC CA 15 EC 9D F6 74 02 6D C8
|
|
|
|
|
0050 | B5 77 9C 08 0C 82 48 DE 99 A1 60 D4 FD 1A 5B 23
|
|
|
|
|
<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
|
|
|
|
|
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 = 1370197183</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>0819445F2189A86F19000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1820684747012599577</td>
|
|
|
|
|
<td><code>0828F84BBB45A022AF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2952192823440450223</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>044F338227000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1328775719</td>
|
|
|
|
|
<td><code>045F147029000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1595174953</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>0451AB8CBF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1370197183</td>
|
|
|
|
|
<td><code>046E4F7717000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1850701591</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>E190781B9B7E8FE6E0F112C14F9D2182</code></td>
|
|
|
|
|
<td><code>433042F69F2F19C95630CF7474FE41DE</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>EF3BAC773D05907F94DBF3E8E7D17A28</code></td>
|
|
|
|
|
<td><code>00CED06F7FE9FB9AED1CBDB97B652CC1</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>C2FAC5BAD6ECBCCA15EC9DF674026DC8</code> <code>B5779C080C8248DE99A160D4FD1A5B23</code></td>
|
|
|
|
|
<td><code>EBB51A75FE13669771E6EEC5213B228C</code> <code>C1C80D49835C564D0C628E7C16AA71FB</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1370197183</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 = 955FF5A90819445F2189A86F19000000044F3382270000000451AB8CBF000000E190781B9B7E8FE6E0F112C14F9D2182EF3BAC773D05907F94DBF3E8E7D17A28C2FAC5BAD6ECBCCA15EC9DF674026DC8B5779C080C8248DE99A160D4FD1A5B2302000000
|
|
|
|
|
random_padding_bytes = 684BA7FF81FA9C42327226762CA190014DFBD253A3D2BFDFACC4C88C0C0F7672E64A4415CE2DC80B413043CEB1019577E12DA834EFB6361A3D24EAF3B7E21426ADEA4D878A19631C0864E57353031C57E4FA9A2ACAEE27649D248F8A</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A90828F84BBB45A022AF000000045F147029000000046E4F7717000000433042F69F2F19C95630CF7474FE41DE00CED06F7FE9FB9AED1CBDB97B652CC1EBB51A75FE13669771E6EEC5213B228CC1C80D49835C564D0C628E7C16AA71FB02000000
|
|
|
|
|
random_padding_bytes = 00B4E58B743874D6E98D144A60C51579470EE61D0B401B456CD6C2FBC500B83D5CB21AF5CE7C711E442C540E716050F57F750E5159964C3A1CC450876A7497912223F8CF545371FFBCDC3F4CA6FE4EE3417B0D15EBADAD89611C4FA2</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 = A17FB6AD4FF7A325CAE22C23AC96ADF80FC934023F586EBF8D6C42A90869BFDD432748865BDD7C7F126126B17D90B0074EE354AF090B8EAF273358CCAACD09D56586B8C96A9337C57C7A651A4FEA13A6FDD69CD214089A4DB83523D15BF5F43E2C2680E530CBF0F56CB0F0C4AECC9AF25A98E86D526E2EB5239BCC1D828866B13B00F67862FDDCA5058D974C8838764B9A057918D2F6D5A8967926B2323BF974054F08E3417A44619CADC8E40D59D5BFBDDB91EF689F4945946DFE2243BA76B921D6552AE2D5C35D75FC4DA8C06F5531827ED4B9DEBBA9BA4784D6CE19002E75AB7699EB282872C70BD40155A4E4874A68A324E76E7A8B36274BF8BE90F66E9E</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = E2101471B7F578D1D81020699154D4941C9C7936B2D44569582605549EA5CFB5F5E385AE04B5F39D550D736A315FFB8EC7D7882B45E92B835569C47078AACC5588FA5E2E3F06EE3E153B49646B9216212735506CCBEC1250FE0FD588B328D7FA98FC29369001DF1B92BDC238BADF0B595010D7D8B099A7A0041EEB785FD4E65CAAA6EED7DB0055210191F8838281E6F6397A79FEEC23F36D545EE6CCECE7A383499F9B3285BA885894B2BFADB26AF1C0CD4B291B834DE2D0D158EEDCFE9955F94C1AE4821FC5F5927DABB85DB60249055AB74B334E838F9A700D90C99167489A39B09BD8712D2FED0E317E9BB036AE79742EB4CBFD18B47851BCDED5216A9083</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 C0 76 09 00 FE 0F 98 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 E1 90 78 1B 9B 7E 8F E6
|
|
|
|
|
0020 | E0 F1 12 C1 4F 9D 21 82 EF 3B AC 77 3D 05 90 7F
|
|
|
|
|
0030 | 94 DB F3 E8 E7 D1 7A 28 04 4F 33 82 27 00 00 00
|
|
|
|
|
0040 | 04 51 AB 8C BF 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 A1 7F B6 AD 4F F7 A3 25 CA E2 2C 23
|
|
|
|
|
0060 | AC 96 AD F8 0F C9 34 02 3F 58 6E BF 8D 6C 42 A9
|
|
|
|
|
0070 | 08 69 BF DD 43 27 48 86 5B DD 7C 7F 12 61 26 B1
|
|
|
|
|
0080 | 7D 90 B0 07 4E E3 54 AF 09 0B 8E AF 27 33 58 CC
|
|
|
|
|
0090 | AA CD 09 D5 65 86 B8 C9 6A 93 37 C5 7C 7A 65 1A
|
|
|
|
|
00A0 | 4F EA 13 A6 FD D6 9C D2 14 08 9A 4D B8 35 23 D1
|
|
|
|
|
00B0 | 5B F5 F4 3E 2C 26 80 E5 30 CB F0 F5 6C B0 F0 C4
|
|
|
|
|
00C0 | AE CC 9A F2 5A 98 E8 6D 52 6E 2E B5 23 9B CC 1D
|
|
|
|
|
00D0 | 82 88 66 B1 3B 00 F6 78 62 FD DC A5 05 8D 97 4C
|
|
|
|
|
00E0 | 88 38 76 4B 9A 05 79 18 D2 F6 D5 A8 96 79 26 B2
|
|
|
|
|
00F0 | 32 3B F9 74 05 4F 08 E3 41 7A 44 61 9C AD C8 E4
|
|
|
|
|
0100 | 0D 59 D5 BF BD DB 91 EF 68 9F 49 45 94 6D FE 22
|
|
|
|
|
0110 | 43 BA 76 B9 21 D6 55 2A E2 D5 C3 5D 75 FC 4D A8
|
|
|
|
|
0120 | C0 6F 55 31 82 7E D4 B9 DE BB A9 BA 47 84 D6 CE
|
|
|
|
|
0130 | 19 00 2E 75 AB 76 99 EB 28 28 72 C7 0B D4 01 55
|
|
|
|
|
0140 | A4 E4 87 4A 68 A3 24 E7 6E 7A 8B 36 27 4B F8 BE
|
|
|
|
|
0150 | 90 F6 6E 9E</code></pre>
|
|
|
|
|
<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>
|
|
|
|
|
<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 = 684BA7FF81FA9C42327226762CA190014DFBD253A3D2BFDFACC4C88C0
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>C0760900FE0F9866</code></td>
|
|
|
|
|
<td><code>D4D208007E119866</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 = 684BA7FF81FA9C42327226762CA190014DFBD253A3D2BFDFACC4C88C0
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>E190781B9B7E8FE6E0F112C14F9D2182</code></td>
|
|
|
|
|
<td><code>433042F69F2F19C95630CF7474FE41DE</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>EF3BAC773D05907F94DBF3E8E7D17A28</code></td>
|
|
|
|
|
<td><code>00CED06F7FE9FB9AED1CBDB97B652CC1</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>044F338227000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1328775719</td>
|
|
|
|
|
<td><code>045F147029000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1595174953</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>0451AB8CBF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1370197183</td>
|
|
|
|
|
<td><code>046E4F7717000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1850701591</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 = 684BA7FF81FA9C42327226762CA190014DFBD253A3D2BFDFACC4C88C0
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE000100A17FB6AD4FF7A325CAE22C23</code> <code>AC96ADF80FC934023F586EBF8D6C42A9</code> <code>0869BFDD432748865BDD7C7F126126B1</code> <code>7D90B0074EE354AF090B8EAF273358CC</code> <code>AACD09D56586B8C96A9337C57C7A651A</code> <code>4FEA13A6FDD69CD214089A4DB83523D1</code> <code>5BF5F43E2C2680E530CBF0F56CB0F0C4</code> <code>AECC9AF25A98E86D526E2EB5239BCC1D</code> <code>828866B13B00F67862FDDCA5058D974C</code> <code>8838764B9A057918D2F6D5A8967926B2</code> <code>323BF974054F08E3417A44619CADC8E4</code> <code>0D59D5BFBDDB91EF689F4945946DFE22</code> <code>43BA76B921D6552AE2D5C35D75FC4DA8</code> <code>C06F5531827ED4B9DEBBA9BA4784D6CE</code> <code>19002E75AB7699EB282872C70BD40155</code> <code>A4E4874A68A324E76E7A8B36274BF8BE</code><br> <code>90F66E9E</code></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>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = 684BA7FF81FA9C42327226762CA190014DFBD253A3D2BFDFACC4C88C0
|
|
|
|
|
<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 EC AE 56 FF 0F 98 66
|
|
|
|
|
0010 | BC 02 00 00 5C 07 E8 D0 E1 90 78 1B 9B 7E 8F E6
|
|
|
|
|
0020 | E0 F1 12 C1 4F 9D 21 82 EF 3B AC 77 3D 05 90 7F
|
|
|
|
|
0030 | 94 DB F3 E8 E7 D1 7A 28 FE 50 02 00 71 74 82 0D
|
|
|
|
|
0040 | E8 63 F0 64 41 26 CE EB C0 4C 4C 90 0E 37 5F DB
|
|
|
|
|
0050 | 64 1D F1 98 64 3B 0D D5 BB 6E F1 64 0B B4 CB 10
|
|
|
|
|
0060 | 72 1A B5 3F 8E 43 97 6E C9 1A BB A6 38 79 B0 9E
|
|
|
|
|
0070 | D2 31 07 BD 71 01 07 B2 AE 08 DB F6 00 12 F1 BC
|
|
|
|
|
0080 | F6 EA 5F D0 76 F6 C6 66 2E 30 B4 DA F0 03 DA 66
|
|
|
|
|
0090 | 35 6E 8F 60 82 F9 AE 19 E7 50 D9 09 2D 69 92 18
|
|
|
|
|
00A0 | 92 6D 53 ED 9F 86 E8 4B 1F A7 FA 8D D9 BC 1D 50
|
|
|
|
|
00B0 | 21 0D FB AD CF D0 AC A2 CA 4B 3B 78 22 25 28 AE
|
|
|
|
|
00C0 | 70 20 5C 38 07 1D B6 C8 10 50 B9 B1 1F C4 B8 7D
|
|
|
|
|
00D0 | 22 32 D0 F3 EA C5 B4 91 24 CA 5B 4E 7B 26 83 50
|
|
|
|
|
00E0 | 76 65 C3 2C B2 5B 55 6D C2 51 1F B6 27 DE 62 09
|
|
|
|
|
00F0 | 3A 51 40 3D D4 9E 15 0A 4C 18 03 7B BB 3E BB 7A
|
|
|
|
|
0100 | BF 2A 9D 58 7D 29 C9 A4 6D F8 19 5B 00 98 85 D9
|
|
|
|
|
0110 | BE FC D2 B0 CF 1C CD BC 7B E9 2D 43 87 79 CE BE
|
|
|
|
|
0120 | 4D AF E7 CF 78 AA B9 A8 A9 21 CC 23 67 A0 49 2F
|
|
|
|
|
0130 | 31 39 CF 6E 10 DC 06 AE 16 A4 6C 6F B6 2B 99 04
|
|
|
|
|
0140 | AB DF 17 88 86 D1 BA 19 12 14 97 C0 51 06 B9 1C
|
|
|
|
|
0150 | 66 26 1B 0A B3 41 9F FE 99 5D 0C C6 F1 7D 34 E6
|
|
|
|
|
0160 | 8E 92 A6 42 C1 F1 FA A3 B4 EF 14 CB A4 59 44 4E
|
|
|
|
|
0170 | EA E8 90 5F 39 8C 4A 34 DC 2F 22 BB 50 56 EC 65
|
|
|
|
|
0180 | 16 79 BE 76 CE DA 63 0A 96 41 FC 0B ED 51 99 A4
|
|
|
|
|
0190 | 95 11 85 10 FA 63 64 8E 6B BE 24 36 BA 46 61 5B
|
|
|
|
|
01A0 | 24 34 A3 8C 33 DE 74 A8 D5 45 9E 52 4B 01 85 EB
|
|
|
|
|
01B0 | 53 32 1F D0 08 4E C0 02 A4 EF 89 E3 D8 54 CE 0A
|
|
|
|
|
01C0 | 01 92 F3 9E 71 9E 00 30 61 58 13 D9 3D 52 43 15
|
|
|
|
|
01D0 | FC C3 45 FE 64 FF 02 8D C7 B3 FB 21 51 0D 0A EE
|
|
|
|
|
01E0 | 21 AE 8B 1A 64 A7 74 65 B6 1C B5 68 A4 2B 37 B2
|
|
|
|
|
01F0 | EB C5 24 A7 90 29 24 F9 0B 6A A9 F3 6A 14 D9 71
|
|
|
|
|
0200 | 78 A5 2F AD D0 52 96 E1 FB 19 48 19 C8 B0 CE 31
|
|
|
|
|
0210 | BC 84 16 CB AC 99 B3 9C C1 35 1B 91 05 0E EC B9
|
|
|
|
|
0220 | 85 7F D0 10 D0 DC 64 4E 9D 13 27 3C 0F 4D 1C 6E
|
|
|
|
|
0230 | A5 43 74 83 6B E8 15 DB DD DC F5 62 42 15 6C CC
|
|
|
|
|
0240 | 14 76 A7 B8 31 FC 4E 26 E0 1F 87 51 07 FD DA 64
|
|
|
|
|
0250 | B3 00 EB 0A A6 8E B9 AD 2D 4C B8 CD AC 36 B9 19
|
|
|
|
|
0260 | AA D2 9F 21 4A FD 8C 1E F0 AE 51 F1 CC 8F E5 57
|
|
|
|
|
0270 | ED 1D 33 AF C5 7E 86 58 CC C3 84 62 6A 21 9E A6
|
|
|
|
|
0280 | 65 8C 84 F9 10 FA 9A 66 37 90 CD 48</code></pre>
|
|
|
|
|
<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>
|
|
|
|
|
<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 = 684BA7FF81FA9C42327226762CA190014DFBD253A3D2BFDFACC4C88C0
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>01ECAE56FF0F9866</code></td>
|
|
|
|
|
<td><code>0164CF537F119866</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>BC020000</code> (700 in decimal)</td>
|
|
|
|
|
<td><code>78020000</code> (632 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -482,19 +482,19 @@ random_padding_bytes = 684BA7FF81FA9C42327226762CA190014DFBD253A3D2BFDFACC4C88C0
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>E190781B9B7E8FE6E0F112C14F9D2182</code></td>
|
|
|
|
|
<td><code>433042F69F2F19C95630CF7474FE41DE</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>EF3BAC773D05907F94DBF3E8E7D17A28</code></td>
|
|
|
|
|
<td><code>00CED06F7FE9FB9AED1CBDB97B652CC1</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE5002007174820DE863F0644126CEEB</code> <code>C04C4C900E375FDB641DF198643B0DD5</code> <code>BB6EF1640BB4CB10721AB53F8E43976E</code> <code>C91ABBA63879B09ED23107BD710107B2</code> <code>AE08DBF60012F1BCF6EA5FD076F6C666</code> <code>2E30B4DAF003DA66356E8F6082F9AE19</code> <code>E750D9092D699218926D53ED9F86E84B</code> <code>1FA7FA8DD9BC1D50210DFBADCFD0ACA2</code> <code>CA4B3B78222528AE70205C38071DB6C8</code> <code>1050B9B11FC4B87D2232D0F3EAC5B491</code> <code>24CA5B4E7B2683507665C32CB25B556D</code> <code>C2511FB627DE62093A51403DD49E150A</code> <code>4C18037BBB3EBB7ABF2A9D587D29C9A4</code> <code>6DF8195B009885D9BEFCD2B0CF1CCDBC</code> <code>7BE92D438779CEBE4DAFE7CF78AAB9A8</code> <code>A921CC2367A0492F3139CF6E10DC06AE</code> <code>16A46C6FB62B9904ABDF178886D1BA19</code> <code>121497C05106B91C66261B0AB3419FFE</code> <code>995D0CC6F17D34E68E92A642C1F1FAA3</code> <code>B4EF14CBA459444EEAE8905F398C4A34</code> <code>DC2F22BB5056EC651679BE76CEDA630A</code> <code>9641FC0BED5199A495118510FA63648E</code> <code>6BBE2436BA46615B2434A38C33DE74A8</code> <code>D5459E524B0185EB53321FD0084EC002</code> <code>A4EF89E3D854CE0A0192F39E719E0030</code> <code>615813D93D524315FCC345FE64FF028D</code> <code>C7B3FB21510D0AEE21AE8B1A64A77465</code> <code>B61CB568A42B37B2EBC524A7902924F9</code> <code>0B6AA9F36A14D97178A52FADD05296E1</code> <code>FB194819C8B0CE31BC8416CBAC99B39C</code> <code>C1351B91050EECB9857FD010D0DC644E</code> <code>9D13273C0F4D1C6EA54374836BE815DB</code> <code>DDDCF56242156CCC1476A7B831FC4E26</code> <code>E01F875107FDDA64B300EB0AA68EB9AD</code> <code>2D4CB8CDAC36B919AAD29F214AFD8C1E</code> <code>F0AE51F1CC8FE557ED1D33AFC57E8658</code> <code>CCC384626A219EA6658C84F910FA9A66</code><br> <code>3790CD48</code></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>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = 684BA7FF81FA9C42327226762CA190014DFBD253A3D2BFDFACC4C88C0
|
|
|
|
|
<!-- 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 = 7174820DE863F0644126CEEBC04C4C900E375FDB641DF198643B0DD5BB6EF1640BB4CB10721AB53F8E43976EC91ABBA63879B09ED23107BD710107B2AE08DBF60012F1BCF6EA5FD076F6C6662E30B4DAF003DA66356E8F6082F9AE19E750D9092D699218926D53ED9F86E84B1FA7FA8DD9BC1D50210DFBADCFD0ACA2CA4B3B78222528AE70205C38071DB6C81050B9B11FC4B87D2232D0F3EAC5B49124CA5B4E7B2683507665C32CB25B556DC2511FB627DE62093A51403DD49E150A4C18037BBB3EBB7ABF2A9D587D29C9A46DF8195B009885D9BEFCD2B0CF1CCDBC7BE92D438779CEBE4DAFE7CF78AAB9A8A921CC2367A0492F3139CF6E10DC06AE16A46C6FB62B9904ABDF178886D1BA19121497C05106B91C66261B0AB3419FFE995D0CC6F17D34E68E92A642C1F1FAA3B4EF14CBA459444EEAE8905F398C4A34DC2F22BB5056EC651679BE76CEDA630A9641FC0BED5199A495118510FA63648E6BBE2436BA46615B2434A38C33DE74A8D5459E524B0185EB53321FD0084EC002A4EF89E3D854CE0A0192F39E719E0030615813D93D524315FCC345FE64FF028DC7B3FB21510D0AEE21AE8B1A64A77465B61CB568A42B37B2EBC524A7902924F90B6AA9F36A14D97178A52FADD05296E1FB194819C8B0CE31BC8416CBAC99B39CC1351B91050EECB9857FD010D0DC644E9D13273C0F4D1C6EA54374836BE815DBDDDCF56242156CCC1476A7B831FC4E26E01F875107FDDA64B300EB0AA68EB9AD2D4CB8CDAC36B919AAD29F214AFD8C1EF0AE51F1CC8FE557ED1D33AFC57E8658CCC384626A219EA6658C84F910FA9A663790CD48
|
|
|
|
|
tmp_aes_key = 5918547CCFD1EF0C14957551261817A7189DB4F68DBDD59459A8260347A6E18B
|
|
|
|
|
tmp_aes_iv = 67444E972D9578EB08FC833ABCE9B4F7058A68DFCBD1DCDCFF42776CC2FAC5BA</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = CD2428CA3CBC42CCA7730C364DFE98E7C29D93E334829AF7E3B1670139C25E93AC9F965150C6076E074F6642A98E72DB4DFD7ED356F707D8CD846746ECDB33E766B188959640A61D5A9E9BB386C785F97AF6D15A57FB8B07DF961FB6764FCFD4E74FD298491DB738239E4795B6100E68689EEE03A47BD5F3185E0F73A5EE4ECF5754D41F866CB0FF44EDDC9612F80C69612A7E8A80F499789B825C8F6EBA46BEC5FCDC67DC83A5778CCBE52FBE77A9F384CB3FEAF746C5DE6329F83B2A7615124D8E03BF380D78C78CA0E3E5B88B8FC7FD594ED2C556B5DF9C42E6973C7E46AECAA9EFA27DB142933A598F35F61B301600F9B1BCBE5173A57CA3B2F7EF4D18C4E319BAA3AF367D6DFE8AEED862A1FD9AA131025B9AFD6097B2688112C624A1B4CBFA645FA391932614E3BF0DC01790C0C4AC5FC408033057306BD049B2BD058D95239F31BE73AFB996B9B90AF3E50F60BC664803A04E0DC3C432EEA08677C2A07671BCAD52AE1A1CEA03A4343489A0133F386E5258972CF39AC86C698BF66FD8392DEC932E6B9293FB5EA0525777DBE417F1F3EE852AA01B104EBFDCD705EB238BEC143EA7A18620BD28391AEEEDBF77E8C4BCDBE8D4240728F2B8B198710DA942142044C2F969C1F4A82BB4F81F93EAEBB5CD14753A790102D42739F3AEB6D6C1A351418640D4DF81EB6D39DB8DEF208BF70E39F9F46F012CC8B16613A00D6380154B5D3453796FD8E5590E53A45BC042CC2A05CFB41F307BD35EF9232DF22ACBFFB8D62F8675CE4206F417C5F0994C1871EB57635A3E6F26D29D3D4C60C6CDA569BC5D8D89B50155E522FDC094A21A
|
|
|
|
|
tmp_aes_key = 7616F4BCEBB5512BF12F6CB68245AB6B85A800A6C66719222E53D9513A2FD742
|
|
|
|
|
tmp_aes_iv = 82AE22D863F4E16FC19325C8FE2AC7CC01D2C47171E0145EEF378B79EBB51A75</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = 8A4CA773F160B3913790E97EDCAB373FD5BF7231BA0D89B5E190781B9B7E8FE6E0F112C14F9D2182EF3BAC773D05907F94DBF3E8E7D17A2803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010040CDCB94DF9F87C25399B060DA1A80A0DCC5C0DC3603FD584E16449FC8360C9FBA5C322DC77DD6FC30B19EAACDB94DFA2155D097359BBEB082760C0FAF9A899188E01F91233D58E59C6E4D17F954D6C83160395FFC52F4407CEBA1EF0A7FB30AC7E81B236807957715BF30DF6C76B15C8CD97F6AFFBCF778C754E2A573427EEED5F7FDAD856F4A972E823DB0073A506E73D3B654B52F130DCB31565AC54EFFF6CCD03BE4ADC2249E62B0430981C87EEDCFA9798A45C9ACED35A4DA86FF5B581D7C85B1AB4CB71F1590664B77AEBE63CBF8CD035481CF31E7D2CA5BAF231554DF175145AAD6DB53BB9F7A740D0C17398852DD1151391222810B2C388B2729B96FFF0F9866044EF86BAA4C7C28
|
|
|
|
|
answer = BA0D89B5E190781B9B7E8FE6E0F112C14F9D2182EF3BAC773D05907F94DBF3E8E7D17A2803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010040CDCB94DF9F87C25399B060DA1A80A0DCC5C0DC3603FD584E16449FC8360C9FBA5C322DC77DD6FC30B19EAACDB94DFA2155D097359BBEB082760C0FAF9A899188E01F91233D58E59C6E4D17F954D6C83160395FFC52F4407CEBA1EF0A7FB30AC7E81B236807957715BF30DF6C76B15C8CD97F6AFFBCF778C754E2A573427EEED5F7FDAD856F4A972E823DB0073A506E73D3B654B52F130DCB31565AC54EFFF6CCD03BE4ADC2249E62B0430981C87EEDCFA9798A45C9ACED35A4DA86FF5B581D7C85B1AB4CB71F1590664B77AEBE63CBF8CD035481CF31E7D2CA5BAF231554DF175145AAD6DB53BB9F7A740D0C17398852DD1151391222810B2C388B2729B96FFF0F9866044EF86BAA4C7C28</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = D161373368D4E3DCE99BC0B63B2101BC4301537DBA0D89B5433042F69F2F19C95630CF7474FE41DE00CED06F7FE9FB9AED1CBDB97B652CC103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001001B986B7922D370598DA45B82F09368EB5629E909979DEDD0AD72E9D22D13E9A81B8F5EADE805376A27C665CEEA1308EB99E55D17D3368B1CA452A01E5CA730AA50A1D0BAE87F70321D15C1D57DBB3013D5B2C01D2B91AB8FB7376D6622BBD57AE3D26C735945BC7B9AD8B2ABE372859F89ED526EC8898F0C1BC4C76D862E2F59E851590DF470F6108286DE366960C602EB63FE6150463C0BF7AAB288BFAEEFE0E5427509E7F50C444E2EACCACF291E8D7F384953D42FB5948ADEA25EAC4FEB0794C402797665C173FC919E35F302DBF1D77A459093686514458132CC673B287C4DA4472464A378331DFE1258BEB8F2186B121E50798BAF4EF79409114F87ED217F119866A0201D4AD79C4634
|
|
|
|
|
answer = BA0D89B5433042F69F2F19C95630CF7474FE41DE00CED06F7FE9FB9AED1CBDB97B652CC103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001001B986B7922D370598DA45B82F09368EB5629E909979DEDD0AD72E9D22D13E9A81B8F5EADE805376A27C665CEEA1308EB99E55D17D3368B1CA452A01E5CA730AA50A1D0BAE87F70321D15C1D57DBB3013D5B2C01D2B91AB8FB7376D6622BBD57AE3D26C735945BC7B9AD8B2ABE372859F89ED526EC8898F0C1BC4C76D862E2F59E851590DF470F6108286DE366960C602EB63FE6150463C0BF7AAB288BFAEEFE0E5427509E7F50C444E2EACCACF291E8D7F384953D42FB5948ADEA25EAC4FEB0794C402797665C173FC919E35F302DBF1D77A459093686514458132CC673B287C4DA4472464A378331DFE1258BEB8F2186B121E50798BAF4EF79409114F87ED217F119866A0201D4AD79C4634</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 E1 90 78 1B 9B 7E 8F E6 E0 F1 12 C1
|
|
|
|
|
0010 | 4F 9D 21 82 EF 3B AC 77 3D 05 90 7F 94 DB F3 E8
|
|
|
|
|
0020 | E7 D1 7A 28 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<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
|
|
|
|
|
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 = BA0D89B5E190781B9B7E8FE6E0F112C14F9D2182EF3BAC773D05907F94DBF3E8E7D17A2
|
|
|
|
|
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 | 40 CD CB 94 DF 9F 87 C2 53 99 B0 60 DA 1A 80 A0
|
|
|
|
|
0140 | DC C5 C0 DC 36 03 FD 58 4E 16 44 9F C8 36 0C 9F
|
|
|
|
|
0150 | BA 5C 32 2D C7 7D D6 FC 30 B1 9E AA CD B9 4D FA
|
|
|
|
|
0160 | 21 55 D0 97 35 9B BE B0 82 76 0C 0F AF 9A 89 91
|
|
|
|
|
0170 | 88 E0 1F 91 23 3D 58 E5 9C 6E 4D 17 F9 54 D6 C8
|
|
|
|
|
0180 | 31 60 39 5F FC 52 F4 40 7C EB A1 EF 0A 7F B3 0A
|
|
|
|
|
0190 | C7 E8 1B 23 68 07 95 77 15 BF 30 DF 6C 76 B1 5C
|
|
|
|
|
01A0 | 8C D9 7F 6A FF BC F7 78 C7 54 E2 A5 73 42 7E EE
|
|
|
|
|
01B0 | D5 F7 FD AD 85 6F 4A 97 2E 82 3D B0 07 3A 50 6E
|
|
|
|
|
01C0 | 73 D3 B6 54 B5 2F 13 0D CB 31 56 5A C5 4E FF F6
|
|
|
|
|
01D0 | CC D0 3B E4 AD C2 24 9E 62 B0 43 09 81 C8 7E ED
|
|
|
|
|
01E0 | CF A9 79 8A 45 C9 AC ED 35 A4 DA 86 FF 5B 58 1D
|
|
|
|
|
01F0 | 7C 85 B1 AB 4C B7 1F 15 90 66 4B 77 AE BE 63 CB
|
|
|
|
|
0200 | F8 CD 03 54 81 CF 31 E7 D2 CA 5B AF 23 15 54 DF
|
|
|
|
|
0210 | 17 51 45 AA D6 DB 53 BB 9F 7A 74 0D 0C 17 39 88
|
|
|
|
|
0220 | 52 DD 11 51 39 12 22 81 0B 2C 38 8B 27 29 B9 6F
|
|
|
|
|
0230 | FF 0F 98 66</code></pre>
|
|
|
|
|
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>
|
|
|
|
|
<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 = BA0D89B5E190781B9B7E8FE6E0F112C14F9D2182EF3BAC773D05907F94DBF3E8E7D17A2
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>E190781B9B7E8FE6E0F112C14F9D2182</code></td>
|
|
|
|
|
<td><code>433042F69F2F19C95630CF7474FE41DE</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>EF3BAC773D05907F94DBF3E8E7D17A28</code></td>
|
|
|
|
|
<td><code>00CED06F7FE9FB9AED1CBDB97B652CC1</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B5E190781B9B7E8FE6E0F112C14F9D2182EF3BAC773D05907F94DBF3E8E7D17A2
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE00010040CDCB94DF9F87C25399B060</code> <code>DA1A80A0DCC5C0DC3603FD584E16449F</code> <code>C8360C9FBA5C322DC77DD6FC30B19EAA</code> <code>CDB94DFA2155D097359BBEB082760C0F</code> <code>AF9A899188E01F91233D58E59C6E4D17</code> <code>F954D6C83160395FFC52F4407CEBA1EF</code> <code>0A7FB30AC7E81B236807957715BF30DF</code> <code>6C76B15C8CD97F6AFFBCF778C754E2A5</code> <code>73427EEED5F7FDAD856F4A972E823DB0</code> <code>073A506E73D3B654B52F130DCB31565A</code> <code>C54EFFF6CCD03BE4ADC2249E62B04309</code> <code>81C87EEDCFA9798A45C9ACED35A4DA86</code> <code>FF5B581D7C85B1AB4CB71F1590664B77</code> <code>AEBE63CBF8CD035481CF31E7D2CA5BAF</code> <code>231554DF175145AAD6DB53BB9F7A740D</code> <code>0C17398852DD1151391222810B2C388B</code><br> <code>2729B96F</code></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>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>FF0F9866</code> (1721241599 in decimal)</td>
|
|
|
|
|
<td><code>7F119866</code> (1721241983 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B5E190781B9B7E8FE6E0F112C14F9D2182EF3BAC773D05907F94DBF3E8E7D17A2
|
|
|
|
|
<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 = 0424D9CE284E44D63399229B4B168E9245B1DBB446A4ADE4E2DF145EFA8A0BB6B23FDECD90B92BC8626D63E06F5E5BA8B14D227413A80AB2D20F9FEC7A98BD2F858B706018597326773C8C16496778F80BC3BBF229D6AA902F3C44318B7C6DD9CFE899E36A8292E42F9E454E6302373E80BD1B8DA7C063A25167212EAE03A7D95949E6BF288E74F7C95A3399CFB2131344D4F1143A1D8A24562DCCF88957D8DB58F0C178F9AD58B67BC39F9D5BE70267EDB7E67199868348B97152C7BE97879FCF42C8CE3C4B05FF9D706D9E536CEE9FCED96F9E7ADAF3E11F2F2B8C5FF1382F42067ACC7EFB570936FD37F88087584A6EF16E5CB05E64C6A725391BDA3B512D</code></pre>
|
|
|
|
|
<pre><code>b = 5FD7BEF0C4C2AA3D4434E97D289F9837AFA5F7E9D5AF9B22F65043E50A3C6C506CA5407CBA59BEEC6B676E57AC5B5CE632E66F3592A4F87462B41706F73CE36162A8123570966981B741604380382F89B0FA762D9273488111144C5FA1C7357373F1AB92DEF2EF93970A42D8CC90FC59E882632E69D8C7F52AB767ADDE58630F3BBC24C960440454204FAE4DD1EBAD0843F9D7FAC4BA1DAC5074E61FB8623E82594901EF7A426EAB645D49FD77AD1A4BB17B77984AF53D528BECA167275AC1F6F6787B1C8689350144CB5BB7BAD907FA10B1A7A273080825BAF018111FFC97672121FC522C4AB8D2BF5E6FC4169B6A54334777DA62EB4FC9B05662CC24F4A6A2</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 = 061876A7301C91A243E316B62928FBFE60B4EAD143BF496A11C5CABCC222DBE3237EA4F35033D42BAC96831F32E3E8DBA8D3BF4E32FAC43AA992DE16C3AA497E70AC43ED623DDD01D269F4486A81624232776A792612961A0A496C42F527835555C838CD4FCDB83583667DC7166D1F94C251273426A5615B9237A96A112792EF218E42C386BF8DA906E398564B82440CB2A0F41A6BA22B4E7B8A1A35F82414D9B322164280937C7EF1C71AF0B3DF086E22E928F40DE3CEC3E7CACB822E4FFFFCE9D6C71B37F8F7247C95BBA5F09A1C70FF90AA315D814091DC5EF663DF0F81495FED577CEEBD9FD36E77153FBE5EE8FE638709E3360F4BF8D31A9DD21F047E12</code></pre>
|
|
|
|
|
<pre><code>g_b = 7E6CD4AD1F8412055A88AA84B359C835947A5B0A386E4C7514877F32D24EF716B76B7AACB6223CD14F188CBFC58D704236E03952004057137A1D422280F666471E504BEFA49E95B688BADBE25C96376B516D4F087A880E0147743B878F2F0F5566258B86195EE32E4B34F5996151D2C64C4F0B13E2DAC88C95FEC342F532B84CEDB3B2A6A39096ACF0D8FA135664CE1657924748423D8E817C25C579068DFCA297D1DE1CD491ACE62013D9DF61E5E778E015672F159392DC7BD82872C3AB71D9DC137A242E2464A37B3BE20404C446CED2312E46EB06F53AE49402402BB0693FBB1E9AA76AAE22141EB150211EB93605137FC4BFCAA35C1D5517AFA6FB839699</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 E1 90 78 1B 9B 7E 8F E6 E0 F1 12 C1
|
|
|
|
|
0010 | 4F 9D 21 82 EF 3B AC 77 3D 05 90 7F 94 DB F3 E8
|
|
|
|
|
0020 | E7 D1 7A 28 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 06 18 76 A7 30 1C 91 A2 43 E3 16 B6 29 28 FB FE
|
|
|
|
|
0040 | 60 B4 EA D1 43 BF 49 6A 11 C5 CA BC C2 22 DB E3
|
|
|
|
|
0050 | 23 7E A4 F3 50 33 D4 2B AC 96 83 1F 32 E3 E8 DB
|
|
|
|
|
0060 | A8 D3 BF 4E 32 FA C4 3A A9 92 DE 16 C3 AA 49 7E
|
|
|
|
|
0070 | 70 AC 43 ED 62 3D DD 01 D2 69 F4 48 6A 81 62 42
|
|
|
|
|
0080 | 32 77 6A 79 26 12 96 1A 0A 49 6C 42 F5 27 83 55
|
|
|
|
|
0090 | 55 C8 38 CD 4F CD B8 35 83 66 7D C7 16 6D 1F 94
|
|
|
|
|
00A0 | C2 51 27 34 26 A5 61 5B 92 37 A9 6A 11 27 92 EF
|
|
|
|
|
00B0 | 21 8E 42 C3 86 BF 8D A9 06 E3 98 56 4B 82 44 0C
|
|
|
|
|
00C0 | B2 A0 F4 1A 6B A2 2B 4E 7B 8A 1A 35 F8 24 14 D9
|
|
|
|
|
00D0 | B3 22 16 42 80 93 7C 7E F1 C7 1A F0 B3 DF 08 6E
|
|
|
|
|
00E0 | 22 E9 28 F4 0D E3 CE C3 E7 CA CB 82 2E 4F FF FC
|
|
|
|
|
00F0 | E9 D6 C7 1B 37 F8 F7 24 7C 95 BB A5 F0 9A 1C 70
|
|
|
|
|
0100 | FF 90 AA 31 5D 81 40 91 DC 5E F6 63 DF 0F 81 49
|
|
|
|
|
0110 | 5F ED 57 7C EE BD 9F D3 6E 77 15 3F BE 5E E8 FE
|
|
|
|
|
0120 | 63 87 09 E3 36 0F 4B F8 D3 1A 9D D2 1F 04 7E 12</code></pre>
|
|
|
|
|
<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>
|
|
|
|
|
<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 = BA0D89B5E190781B9B7E8FE6E0F112C14F9D2182EF3BAC773D05907F94DBF3E8E7D17A2
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>E190781B9B7E8FE6E0F112C14F9D2182</code></td>
|
|
|
|
|
<td><code>433042F69F2F19C95630CF7474FE41DE</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>EF3BAC773D05907F94DBF3E8E7D17A28</code></td>
|
|
|
|
|
<td><code>00CED06F7FE9FB9AED1CBDB97B652CC1</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE000100061876A7301C91A243E316B6</code> <code>2928FBFE60B4EAD143BF496A11C5CABC</code> <code>C222DBE3237EA4F35033D42BAC96831F</code> <code>32E3E8DBA8D3BF4E32FAC43AA992DE16</code> <code>C3AA497E70AC43ED623DDD01D269F448</code> <code>6A81624232776A792612961A0A496C42</code> <code>F527835555C838CD4FCDB83583667DC7</code> <code>166D1F94C251273426A5615B9237A96A</code> <code>112792EF218E42C386BF8DA906E39856</code> <code>4B82440CB2A0F41A6BA22B4E7B8A1A35</code> <code>F82414D9B322164280937C7EF1C71AF0</code> <code>B3DF086E22E928F40DE3CEC3E7CACB82</code> <code>2E4FFFFCE9D6C71B37F8F7247C95BBA5</code> <code>F09A1C70FF90AA315D814091DC5EF663</code> <code>DF0F81495FED577CEEBD9FD36E77153F</code> <code>BE5EE8FE638709E3360F4BF8D31A9DD2</code><br> <code>1F047E12</code></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>Single-byte prefix denoting length, a 256-byte (2048-bit) string, and zero bytes of padding</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -684,47 +684,47 @@ answer = BA0D89B5E190781B9B7E8FE6E0F112C14F9D2182EF3BAC773D05907F94DBF3E8E7D17A2
|
|
|
|
|
<!-- 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 = 54B64366E190781B9B7E8FE6E0F112C14F9D2182EF3BAC773D05907F94DBF3E8E7D17A280000000000000000FE000100061876A7301C91A243E316B62928FBFE60B4EAD143BF496A11C5CABCC222DBE3237EA4F35033D42BAC96831F32E3E8DBA8D3BF4E32FAC43AA992DE16C3AA497E70AC43ED623DDD01D269F4486A81624232776A792612961A0A496C42F527835555C838CD4FCDB83583667DC7166D1F94C251273426A5615B9237A96A112792EF218E42C386BF8DA906E398564B82440CB2A0F41A6BA22B4E7B8A1A35F82414D9B322164280937C7EF1C71AF0B3DF086E22E928F40DE3CEC3E7CACB822E4FFFFCE9D6C71B37F8F7247C95BBA5F09A1C70FF90AA315D814091DC5EF663DF0F81495FED577CEEBD9FD36E77153FBE5EE8FE638709E3360F4BF8D31A9DD21F047E12
|
|
|
|
|
padding = 9DB0621E0A237DE31C0CF4E6
|
|
|
|
|
tmp_aes_key = 5918547CCFD1EF0C14957551261817A7189DB4F68DBDD59459A8260347A6E18B
|
|
|
|
|
tmp_aes_iv = 67444E972D9578EB08FC833ABCE9B4F7058A68DFCBD1DCDCFF42776CC2FAC5BA</code></pre>
|
|
|
|
|
<pre><code>data = 54B64366433042F69F2F19C95630CF7474FE41DE00CED06F7FE9FB9AED1CBDB97B652CC10000000000000000FE0001007E6CD4AD1F8412055A88AA84B359C835947A5B0A386E4C7514877F32D24EF716B76B7AACB6223CD14F188CBFC58D704236E03952004057137A1D422280F666471E504BEFA49E95B688BADBE25C96376B516D4F087A880E0147743B878F2F0F5566258B86195EE32E4B34F5996151D2C64C4F0B13E2DAC88C95FEC342F532B84CEDB3B2A6A39096ACF0D8FA135664CE1657924748423D8E817C25C579068DFCA297D1DE1CD491ACE62013D9DF61E5E778E015672F159392DC7BD82872C3AB71D9DC137A242E2464A37B3BE20404C446CED2312E46EB06F53AE49402402BB0693FBB1E9AA76AAE22141EB150211EB93605137FC4BFCAA35C1D5517AFA6FB839699
|
|
|
|
|
padding = 2F61B792F1F61500E81CAFB1
|
|
|
|
|
tmp_aes_key = 7616F4BCEBB5512BF12F6CB68245AB6B85A800A6C66719222E53D9513A2FD742
|
|
|
|
|
tmp_aes_iv = 82AE22D863F4E16FC19325C8FE2AC7CC01D2C47171E0145EEF378B79EBB51A75</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 = 05A842D8F2426610AD02F44D86D2384CB5C7D529897448DA22AF65AE9410359E1C4934467FBD099B78FBC96406204CD1012434C8333C1C76BFE6BB1C5F6DF6E24C0E7FB03EA1AEE6E258A2C5753B039C7EF806824685F8E3C4DFC704FBCA2BB7F7C340CF490EC717C97F063ED15C87BA25DCD4DE71C4813EBF7684A801DFB8B293B704D0082ED65C14D6082A6117A8E16882E2CE59389E77B679D5772C547519C2311FBDC3AB2FE827FAD88DAAC3B4F890A5277F13ABBC78816DC847C41801DCBEEE9CCFF5DD8BFBA3B62CCB8039C8F757EB1DFDE0F19F875CE76CF2E87726D7A2EEFE9238B9C43539C3094AB5BAB3D312D8C9FB5E64B70CE5AE084861F70BBF5B4475CE900B3B04B42B81D9315285E933B59C2C8103529EC0528C451D65C3BA870D1B73EE2243C01F7610F3F72D3BE331D835F3C84001417EF5FDDD9186AB4EEE2D836EAF1438CC12069F5B7EB937A8</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 844968FE14D5262628581EDDEEA8644A21BB781F63F1610DC6F6FCA5A9ED9B3FF4D5D55C66FF0CDEE36254571FFCBDBDD5D8FBC7A117B269D6646F27A698084947D483787142AA7ECA6A65CF4D523FBD187E003EFFB3ED2E9652EA407C7A6D6EF6E19C0E6E8FAFE251F42604D76286123821B6D625AA0952EA3819BEF806406AA9520EBFDBEB0A92870C964D7540DEEEC5AA50FA6EEE523640C1FA8090F855EA3257F4110A8A194CCFF6FD5894CB809092AEA75A8AA3BCB1C1A6F5D9A52556FEA8AC387A21483CB9B14A3DDF47B73EECD080B4D7C74551F7C0FF29B58DC8BE6905BEF4A064A81E41B4FF28A6FF649A414CFE12B9E51AED820337BD1E6F6CB4B9D46697E31F4EAC4434EA49218EC4705CFE5ED5159D9C17B621BA80E28037A6876BB984321C01793CD3248BADA28A46934F897FCD6E29E95176D45EE07658762B0982C14B3FD9652B3EAB4A18F1E58DDA</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 A4 08 05 00 FF 0F 98 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 E1 90 78 1B 9B 7E 8F E6
|
|
|
|
|
0020 | E0 F1 12 C1 4F 9D 21 82 EF 3B AC 77 3D 05 90 7F
|
|
|
|
|
0030 | 94 DB F3 E8 E7 D1 7A 28 FE 50 01 00 05 A8 42 D8
|
|
|
|
|
0040 | F2 42 66 10 AD 02 F4 4D 86 D2 38 4C B5 C7 D5 29
|
|
|
|
|
0050 | 89 74 48 DA 22 AF 65 AE 94 10 35 9E 1C 49 34 46
|
|
|
|
|
0060 | 7F BD 09 9B 78 FB C9 64 06 20 4C D1 01 24 34 C8
|
|
|
|
|
0070 | 33 3C 1C 76 BF E6 BB 1C 5F 6D F6 E2 4C 0E 7F B0
|
|
|
|
|
0080 | 3E A1 AE E6 E2 58 A2 C5 75 3B 03 9C 7E F8 06 82
|
|
|
|
|
0090 | 46 85 F8 E3 C4 DF C7 04 FB CA 2B B7 F7 C3 40 CF
|
|
|
|
|
00A0 | 49 0E C7 17 C9 7F 06 3E D1 5C 87 BA 25 DC D4 DE
|
|
|
|
|
00B0 | 71 C4 81 3E BF 76 84 A8 01 DF B8 B2 93 B7 04 D0
|
|
|
|
|
00C0 | 08 2E D6 5C 14 D6 08 2A 61 17 A8 E1 68 82 E2 CE
|
|
|
|
|
00D0 | 59 38 9E 77 B6 79 D5 77 2C 54 75 19 C2 31 1F BD
|
|
|
|
|
00E0 | C3 AB 2F E8 27 FA D8 8D AA C3 B4 F8 90 A5 27 7F
|
|
|
|
|
00F0 | 13 AB BC 78 81 6D C8 47 C4 18 01 DC BE EE 9C CF
|
|
|
|
|
0100 | F5 DD 8B FB A3 B6 2C CB 80 39 C8 F7 57 EB 1D FD
|
|
|
|
|
0110 | E0 F1 9F 87 5C E7 6C F2 E8 77 26 D7 A2 EE FE 92
|
|
|
|
|
0120 | 38 B9 C4 35 39 C3 09 4A B5 BA B3 D3 12 D8 C9 FB
|
|
|
|
|
0130 | 5E 64 B7 0C E5 AE 08 48 61 F7 0B BF 5B 44 75 CE
|
|
|
|
|
0140 | 90 0B 3B 04 B4 2B 81 D9 31 52 85 E9 33 B5 9C 2C
|
|
|
|
|
0150 | 81 03 52 9E C0 52 8C 45 1D 65 C3 BA 87 0D 1B 73
|
|
|
|
|
0160 | EE 22 43 C0 1F 76 10 F3 F7 2D 3B E3 31 D8 35 F3
|
|
|
|
|
0170 | C8 40 01 41 7E F5 FD DD 91 86 AB 4E EE 2D 83 6E
|
|
|
|
|
0180 | AF 14 38 CC 12 06 9F 5B 7E B9 37 A8</code></pre>
|
|
|
|
|
<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>
|
|
|
|
|
<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>A4080500FF0F9866</code></td>
|
|
|
|
|
<td><code>806804007F119866</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>E190781B9B7E8FE6E0F112C14F9D2182</code></td>
|
|
|
|
|
<td><code>433042F69F2F19C95630CF7474FE41DE</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>EF3BAC773D05907F94DBF3E8E7D17A28</code></td>
|
|
|
|
|
<td><code>00CED06F7FE9FB9AED1CBDB97B652CC1</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE50010005A842D8F2426610AD02F44D</code> <code>86D2384CB5C7D529897448DA22AF65AE</code> <code>9410359E1C4934467FBD099B78FBC964</code> <code>06204CD1012434C8333C1C76BFE6BB1C</code> <code>5F6DF6E24C0E7FB03EA1AEE6E258A2C5</code> <code>753B039C7EF806824685F8E3C4DFC704</code> <code>FBCA2BB7F7C340CF490EC717C97F063E</code> <code>D15C87BA25DCD4DE71C4813EBF7684A8</code> <code>01DFB8B293B704D0082ED65C14D6082A</code> <code>6117A8E16882E2CE59389E77B679D577</code> <code>2C547519C2311FBDC3AB2FE827FAD88D</code> <code>AAC3B4F890A5277F13ABBC78816DC847</code> <code>C41801DCBEEE9CCFF5DD8BFBA3B62CCB</code> <code>8039C8F757EB1DFDE0F19F875CE76CF2</code> <code>E87726D7A2EEFE9238B9C43539C3094A</code> <code>B5BAB3D312D8C9FB5E64B70CE5AE0848</code> <code>61F70BBF5B4475CE900B3B04B42B81D9</code> <code>315285E933B59C2C8103529EC0528C45</code> <code>1D65C3BA870D1B73EE2243C01F7610F3</code> <code>F72D3BE331D835F3C84001417EF5FDDD</code> <code>9186AB4EEE2D836EAF1438CC12069F5B</code><br> <code>7EB937A8</code></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>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 = 143E2FAC9B15F6EB83F861D8A9F8E1994CF662FF087632503B54697DB9AA8D577206E60460BAA78049E0636E72C1814F39D6CF1F9DFF3991D1170B5505AB5279943BC5D5F0C47105BFD889B1C08ECF0AA4625466EE8FD038E9233564DF751C7B51E523B8D7D33705393C62DE2C72086753C435220B6FE1B0896DA513F32235A068B827A19746CAFC467A1078203E8AA2A9F23419AC04E003F3A9F3DDA1BB6A9CEAF12AB61BB9A2BC0C50727D0C6BAABD4A27A997FF63E60ED7C9CCB1AB1B19781FA31077AB97CFA8E74929292D5233135EEBB2BFC5B91A27D68090956A62B45870A890A0B65294B588F99E0A9BCD645CA6997E8010A89466582A7D559CDBA807</code></pre>
|
|
|
|
|
<pre><code>auth_key = 425931C2B40155DDDF22F527432BABD35D7C066F18AD6F0DA9577C8065067166210773CB4AB56A75840D16083992201FB206CECFC5BF6B9C402B8FF8FEC8C82677BC6C64E99444946B1D795E52A832F009A5717F1880C96E5E990E7BC27FEFB8C5BC7B02045D87DB4A261BC91ADA18C8818FBB7C6F34B95385C1ECF1BEE7C8D607A6666CC5B1B376C8FEFAE9B73A66C47B5358D3F4F72F4D248FCC9F22BE3F06AEAB22C5CA3E73A84C16E5D7AD5C5EC188376C7D4AE8AE9D3A2981E2C6C99E426573B75BB583DB797FA1A675C7C9FF4CA9ABACB662974CADDC7D5CD6E51695846FE36E98FC12E2BAC8E9B58800EFB519615F9F84667F3273407002717676B0E7</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 7C 38 DC FF 0F 98 66
|
|
|
|
|
0010 | 34 00 00 00 34 F7 CB 3B E1 90 78 1B 9B 7E 8F E6
|
|
|
|
|
0020 | E0 F1 12 C1 4F 9D 21 82 EF 3B AC 77 3D 05 90 7F
|
|
|
|
|
0030 | 94 DB F3 E8 E7 D1 7A 28 9E 5F 3E D7 C4 FF 02 E3
|
|
|
|
|
0040 | A1 0A 26 15 E3 D9 C8 83</code></pre>
|
|
|
|
|
<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>
|
|
|
|
|
<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>017C38DCFF0F9866</code></td>
|
|
|
|
|
<td><code>0168F0CD7F119866</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>88000000</code> (136 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>E190781B9B7E8FE6E0F112C14F9D2182</code></td>
|
|
|
|
|
<td><code>433042F69F2F19C95630CF7474FE41DE</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>EF3BAC773D05907F94DBF3E8E7D17A28</code></td>
|
|
|
|
|
<td><code>00CED06F7FE9FB9AED1CBDB97B652CC1</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>9E5F3ED7C4FF02E3A10A2615E3D9C883</code></td>
|
|
|
|
|
<td><code>2A72215FFB02E7AFD323A3D7D3183EC4</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>
|
|
|
|
|