|
|
|
@ -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 18 78 03 00 C8 32 87 65
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 7E 79 38 C1 4A B7 30 24
|
|
|
|
|
0020 | C3 94 DB C0 E8 0A 6B 5D</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 54 1C 09 00 09 4F 87 65
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE A1 D0 50 58 4C B7 93 A7
|
|
|
|
|
0020 | 9A 25 1D C4 34 D9 E6 C6</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>18780300C8328765</code></td>
|
|
|
|
|
<td><code>541C0900094F8765</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>7E7938C14AB73024C394DBC0E80A6B5D</code></td>
|
|
|
|
|
<td><code>A1D050584CB793A79A251DC434D9E6C6</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 FC A6 AD C8 32 87 65
|
|
|
|
|
0010 | 78 00 00 00 63 24 16 05 7E 79 38 C1 4A B7 30 24
|
|
|
|
|
0020 | C3 94 DB C0 E8 0A 6B 5D DD F3 95 25 25 82 2D BE
|
|
|
|
|
0030 | 37 BB F1 5E 0D C8 A8 60 08 28 E2 34 CE A3 7B CB
|
|
|
|
|
0040 | 47 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 98 97 00 0A 4F 87 65
|
|
|
|
|
0010 | 64 00 00 00 63 24 16 05 A1 D0 50 58 4C B7 93 A7
|
|
|
|
|
0020 | 9A 25 1D C4 34 D9 E6 C6 69 FF A0 EA 0B C5 AC 08
|
|
|
|
|
0030 | F3 47 27 D8 7F 16 88 3C 08 1D 5A 9F 5F 40 CF 9C
|
|
|
|
|
0040 | 09 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>01FCA6ADC8328765</code></td>
|
|
|
|
|
<td><code>019897000A4F8765</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>78000000</code> (120 in decimal)</td>
|
|
|
|
|
<td><code>64000000</code> (100 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>7E7938C14AB73024C394DBC0E80A6B5D</code></td>
|
|
|
|
|
<td><code>A1D050584CB793A79A251DC434D9E6C6</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>DDF3952525822DBE37BBF15E0DC8A860</code></td>
|
|
|
|
|
<td><code>69FFA0EA0BC5AC08F34727D87F16883C</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>0828E234CEA37BCB47000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2945975168364432199</td>
|
|
|
|
|
<td><code>081D5A9F5F40CF9C09000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2115178206461926409</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 = 2945975168364432199</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2945975168364432199 = 1479472661 * 1991233259</code></p>
|
|
|
|
|
<pre><code>p = 1479472661
|
|
|
|
|
q = 1991233259</code></pre>
|
|
|
|
|
<pre><code>pq = 2115178206461926409</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2115178206461926409 = 1264823717 * 1672310677</code></p>
|
|
|
|
|
<pre><code>p = 1264823717
|
|
|
|
|
q = 1672310677</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 E2 34 CE A3 7B CB 47 00 00 00
|
|
|
|
|
0010 | 04 58 2E F6 15 00 00 00 04 76 AF CE EB 00 00 00
|
|
|
|
|
0020 | 7E 79 38 C1 4A B7 30 24 C3 94 DB C0 E8 0A 6B 5D
|
|
|
|
|
0030 | DD F3 95 25 25 82 2D BE 37 BB F1 5E 0D C8 A8 60
|
|
|
|
|
0040 | EA 18 94 A9 03 E6 FE 90 28 FD BF 7A 08 F3 00 DC
|
|
|
|
|
0050 | B4 24 11 F7 B2 1F AB CF 35 F9 54 5C 32 AB 3D 74
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 1D 5A 9F 5F 40 CF 9C 09 00 00 00
|
|
|
|
|
0010 | 04 4B 63 AD A5 00 00 00 04 63 AD 6F 95 00 00 00
|
|
|
|
|
0020 | A1 D0 50 58 4C B7 93 A7 9A 25 1D C4 34 D9 E6 C6
|
|
|
|
|
0030 | 69 FF A0 EA 0B C5 AC 08 F3 47 27 D8 7F 16 88 3C
|
|
|
|
|
0040 | 97 4F F7 44 53 23 58 48 12 A4 81 96 97 1A 8A FF
|
|
|
|
|
0050 | 98 8C 3A 65 16 C7 09 06 81 83 69 57 93 F2 35 20
|
|
|
|
|
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 = 1991233259</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>0828E234CEA37BCB47000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2945975168364432199</td>
|
|
|
|
|
<td><code>081D5A9F5F40CF9C09000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2115178206461926409</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>04582EF615000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1479472661</td>
|
|
|
|
|
<td><code>044B63ADA5000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1264823717</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>0476AFCEEB000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1991233259</td>
|
|
|
|
|
<td><code>0463AD6F95000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1672310677</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>7E7938C14AB73024C394DBC0E80A6B5D</code></td>
|
|
|
|
|
<td><code>A1D050584CB793A79A251DC434D9E6C6</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>DDF3952525822DBE37BBF15E0DC8A860</code></td>
|
|
|
|
|
<td><code>69FFA0EA0BC5AC08F34727D87F16883C</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>EA1894A903E6FE9028FDBF7A08F300DC</code> <code>B42411F7B21FABCF35F9545C32AB3D74</code></td>
|
|
|
|
|
<td><code>974FF7445323584812A48196971A8AFF</code> <code>988C3A6516C709068183695793F23520</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1991233259</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 = 955FF5A90828E234CEA37BCB4700000004582EF6150000000476AFCEEB0000007E7938C14AB73024C394DBC0E80A6B5DDDF3952525822DBE37BBF15E0DC8A860EA1894A903E6FE9028FDBF7A08F300DCB42411F7B21FABCF35F9545C32AB3D7402000000
|
|
|
|
|
random_padding_bytes = 3D1339ACBAC2FAD94051E2552D22E156939320323A0F95E163E5D02A8AF9B3E03D061C0C1FD9113C29439A04A7B2C1B998BA5A02E9DE2807079582B2E1A5EDF6E9D698C2D95780F5F4729F9584DFC05806E97867DB8D8971D9A4C721</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A9081D5A9F5F40CF9C09000000044B63ADA50000000463AD6F95000000A1D050584CB793A79A251DC434D9E6C669FFA0EA0BC5AC08F34727D87F16883C974FF7445323584812A48196971A8AFF988C3A6516C709068183695793F2352002000000
|
|
|
|
|
random_padding_bytes = E1D17479B26E38705348671BC9D13509EF615573C0BAC08E8066A3DF64AB6A45704B352DEEBB51135AF8C91909D183568A5F2FE80D02CA5354CC5482276909FEC32D1E14CE72A9D338E47F706A9CD0E07A5693F0248A266FC9E3BFB8</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 = C2DA62C8601D370E922F5F7CBCCA4255C84910E5DDE9B562336BBBB7215B94E2F82C9C288C64F48FABE0140A5138C54F42879C21F7383FEC315989EB1EA95010EC6E78130037C490D40C3405EB69DD9A54FD9A1AB2F14D5086E8321E7D150E62F42D0B87C8A6C5AE07C9B53A21EB868509D4C96B5C13C45C230B58CAB63F7FC77A3A717CFCFF6D41DA5C6DF2EF6DBABCFB98370F515D00E4888F2D4B5DE2F1A0E893AA77E2E42F040A64ECF2AC0AE536CB3DE13BF17D7BC9AAACFB69FB28DAADBB198D4ED7FC512F50CC864758C1237B96BF59E2C8201F6C91223DE666B3B74541DA315EA71E5E7817535514BD45A258D49789650A8FBF156C996D00303F5543</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = BE04CA7B6C62E8531B3DCE1D486F9C5C64CC3966FFE6ED7946ABE52720D7D568ECD36C2AD390BF2EC2F0B652A6259BF80F3544D38C7CE718E83522DED2DCD3121EBA30B8D89079BCB6603840C41C63C5DDA14DEE1BC2306D14F1D9D3E0D5B5D252B44A187CAA9815E302430FFC6E4D60DF59A3E038A7C67CB2C0004C5483EF1176F2BEC1D5F3E1C1137F368D3785F8CF3A184C56E0FB62F98917BD888928565A4138534E84BC1113F38B04E14A3ACDD4158B4517FA6D89E8257861705B7D7F939491B5CDE35FD32B921773BE6B99701F35C76A6BC8FC7F7AAE11C674505B79B8916B8370CCFCEFE61DDA7FB5BEAD720826A8D0A984294B68B1E1D4FEF55C027F</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 8C 68 08 00 C8 32 87 65
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 7E 79 38 C1 4A B7 30 24
|
|
|
|
|
0020 | C3 94 DB C0 E8 0A 6B 5D DD F3 95 25 25 82 2D BE
|
|
|
|
|
0030 | 37 BB F1 5E 0D C8 A8 60 04 58 2E F6 15 00 00 00
|
|
|
|
|
0040 | 04 76 AF CE EB 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 C2 DA 62 C8 60 1D 37 0E 92 2F 5F 7C
|
|
|
|
|
0060 | BC CA 42 55 C8 49 10 E5 DD E9 B5 62 33 6B BB B7
|
|
|
|
|
0070 | 21 5B 94 E2 F8 2C 9C 28 8C 64 F4 8F AB E0 14 0A
|
|
|
|
|
0080 | 51 38 C5 4F 42 87 9C 21 F7 38 3F EC 31 59 89 EB
|
|
|
|
|
0090 | 1E A9 50 10 EC 6E 78 13 00 37 C4 90 D4 0C 34 05
|
|
|
|
|
00A0 | EB 69 DD 9A 54 FD 9A 1A B2 F1 4D 50 86 E8 32 1E
|
|
|
|
|
00B0 | 7D 15 0E 62 F4 2D 0B 87 C8 A6 C5 AE 07 C9 B5 3A
|
|
|
|
|
00C0 | 21 EB 86 85 09 D4 C9 6B 5C 13 C4 5C 23 0B 58 CA
|
|
|
|
|
00D0 | B6 3F 7F C7 7A 3A 71 7C FC FF 6D 41 DA 5C 6D F2
|
|
|
|
|
00E0 | EF 6D BA BC FB 98 37 0F 51 5D 00 E4 88 8F 2D 4B
|
|
|
|
|
00F0 | 5D E2 F1 A0 E8 93 AA 77 E2 E4 2F 04 0A 64 EC F2
|
|
|
|
|
0100 | AC 0A E5 36 CB 3D E1 3B F1 7D 7B C9 AA AC FB 69
|
|
|
|
|
0110 | FB 28 DA AD BB 19 8D 4E D7 FC 51 2F 50 CC 86 47
|
|
|
|
|
0120 | 58 C1 23 7B 96 BF 59 E2 C8 20 1F 6C 91 22 3D E6
|
|
|
|
|
0130 | 66 B3 B7 45 41 DA 31 5E A7 1E 5E 78 17 53 55 14
|
|
|
|
|
0140 | BD 45 A2 58 D4 97 89 65 0A 8F BF 15 6C 99 6D 00
|
|
|
|
|
0150 | 30 3F 55 43</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 C4 1F 0D 00 0A 4F 87 65
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 A1 D0 50 58 4C B7 93 A7
|
|
|
|
|
0020 | 9A 25 1D C4 34 D9 E6 C6 69 FF A0 EA 0B C5 AC 08
|
|
|
|
|
0030 | F3 47 27 D8 7F 16 88 3C 04 4B 63 AD A5 00 00 00
|
|
|
|
|
0040 | 04 63 AD 6F 95 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 BE 04 CA 7B 6C 62 E8 53 1B 3D CE 1D
|
|
|
|
|
0060 | 48 6F 9C 5C 64 CC 39 66 FF E6 ED 79 46 AB E5 27
|
|
|
|
|
0070 | 20 D7 D5 68 EC D3 6C 2A D3 90 BF 2E C2 F0 B6 52
|
|
|
|
|
0080 | A6 25 9B F8 0F 35 44 D3 8C 7C E7 18 E8 35 22 DE
|
|
|
|
|
0090 | D2 DC D3 12 1E BA 30 B8 D8 90 79 BC B6 60 38 40
|
|
|
|
|
00A0 | C4 1C 63 C5 DD A1 4D EE 1B C2 30 6D 14 F1 D9 D3
|
|
|
|
|
00B0 | E0 D5 B5 D2 52 B4 4A 18 7C AA 98 15 E3 02 43 0F
|
|
|
|
|
00C0 | FC 6E 4D 60 DF 59 A3 E0 38 A7 C6 7C B2 C0 00 4C
|
|
|
|
|
00D0 | 54 83 EF 11 76 F2 BE C1 D5 F3 E1 C1 13 7F 36 8D
|
|
|
|
|
00E0 | 37 85 F8 CF 3A 18 4C 56 E0 FB 62 F9 89 17 BD 88
|
|
|
|
|
00F0 | 89 28 56 5A 41 38 53 4E 84 BC 11 13 F3 8B 04 E1
|
|
|
|
|
0100 | 4A 3A CD D4 15 8B 45 17 FA 6D 89 E8 25 78 61 70
|
|
|
|
|
0110 | 5B 7D 7F 93 94 91 B5 CD E3 5F D3 2B 92 17 73 BE
|
|
|
|
|
0120 | 6B 99 70 1F 35 C7 6A 6B C8 FC 7F 7A AE 11 C6 74
|
|
|
|
|
0130 | 50 5B 79 B8 91 6B 83 70 CC FC EF E6 1D DA 7F B5
|
|
|
|
|
0140 | BE AD 72 08 26 A8 D0 A9 84 29 4B 68 B1 E1 D4 FE
|
|
|
|
|
0150 | F5 5C 02 7F</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 = 3D1339ACBAC2FAD94051E2552D22E156939320323A0F95E163E5D02A8
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>8C680800C8328765</code></td>
|
|
|
|
|
<td><code>C41F0D000A4F8765</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 = 3D1339ACBAC2FAD94051E2552D22E156939320323A0F95E163E5D02A8
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>7E7938C14AB73024C394DBC0E80A6B5D</code></td>
|
|
|
|
|
<td><code>A1D050584CB793A79A251DC434D9E6C6</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>DDF3952525822DBE37BBF15E0DC8A860</code></td>
|
|
|
|
|
<td><code>69FFA0EA0BC5AC08F34727D87F16883C</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>04582EF615000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1479472661</td>
|
|
|
|
|
<td><code>044B63ADA5000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1264823717</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>0476AFCEEB000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1991233259</td>
|
|
|
|
|
<td><code>0463AD6F95000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1672310677</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 = 3D1339ACBAC2FAD94051E2552D22E156939320323A0F95E163E5D02A8
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE000100C2DA62C8601D370E922F5F7C</code> <code>BCCA4255C84910E5DDE9B562336BBBB7</code> <code>215B94E2F82C9C288C64F48FABE0140A</code> <code>5138C54F42879C21F7383FEC315989EB</code> <code>1EA95010EC6E78130037C490D40C3405</code> <code>EB69DD9A54FD9A1AB2F14D5086E8321E</code> <code>7D150E62F42D0B87C8A6C5AE07C9B53A</code> <code>21EB868509D4C96B5C13C45C230B58CA</code> <code>B63F7FC77A3A717CFCFF6D41DA5C6DF2</code> <code>EF6DBABCFB98370F515D00E4888F2D4B</code> <code>5DE2F1A0E893AA77E2E42F040A64ECF2</code> <code>AC0AE536CB3DE13BF17D7BC9AAACFB69</code> <code>FB28DAADBB198D4ED7FC512F50CC8647</code> <code>58C1237B96BF59E2C8201F6C91223DE6</code> <code>66B3B74541DA315EA71E5E7817535514</code> <code>BD45A258D49789650A8FBF156C996D00</code><br> <code>303F5543</code></td>
|
|
|
|
|
<td><code>FE000100BE04CA7B6C62E8531B3DCE1D</code> <code>486F9C5C64CC3966FFE6ED7946ABE527</code> <code>20D7D568ECD36C2AD390BF2EC2F0B652</code> <code>A6259BF80F3544D38C7CE718E83522DE</code> <code>D2DCD3121EBA30B8D89079BCB6603840</code> <code>C41C63C5DDA14DEE1BC2306D14F1D9D3</code> <code>E0D5B5D252B44A187CAA9815E302430F</code> <code>FC6E4D60DF59A3E038A7C67CB2C0004C</code> <code>5483EF1176F2BEC1D5F3E1C1137F368D</code> <code>3785F8CF3A184C56E0FB62F98917BD88</code> <code>8928565A4138534E84BC1113F38B04E1</code> <code>4A3ACDD4158B4517FA6D89E825786170</code> <code>5B7D7F939491B5CDE35FD32B921773BE</code> <code>6B99701F35C76A6BC8FC7F7AAE11C674</code> <code>505B79B8916B8370CCFCEFE61DDA7FB5</code> <code>BEAD720826A8D0A984294B68B1E1D4FE</code><br> <code>F55C027F</code></td>
|
|
|
|
|
<td>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = 3D1339ACBAC2FAD94051E2552D22E156939320323A0F95E163E5D02A8
|
|
|
|
|
<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 67 6B C9 32 87 65
|
|
|
|
|
0010 | C8 02 00 00 5C 07 E8 D0 7E 79 38 C1 4A B7 30 24
|
|
|
|
|
0020 | C3 94 DB C0 E8 0A 6B 5D DD F3 95 25 25 82 2D BE
|
|
|
|
|
0030 | 37 BB F1 5E 0D C8 A8 60 FE 50 02 00 11 7B 12 70
|
|
|
|
|
0040 | 27 9D F6 38 53 71 04 69 06 D7 7C 00 74 2E 68 54
|
|
|
|
|
0050 | D6 A8 14 12 42 4F AD 5C B9 63 3D 68 21 53 D9 79
|
|
|
|
|
0060 | 7A 4C 4F 10 EF 56 61 6B 9C 52 AA 5D 03 B8 4D A7
|
|
|
|
|
0070 | 27 39 15 5A BC D0 6A 24 C3 83 5C A3 F4 0D 31 22
|
|
|
|
|
0080 | 6F D8 B3 2A BF FE 68 AA 4E 19 7B 91 43 2E ED 29
|
|
|
|
|
0090 | 97 48 B6 1F B6 CB E1 43 A5 E7 E1 30 DB 41 C9 30
|
|
|
|
|
00A0 | C8 79 F8 FC 77 98 0C 72 B8 15 02 16 62 1D 53 B7
|
|
|
|
|
00B0 | 31 2A DE 47 3D 5B 0A A1 79 92 C2 B1 06 52 E9 E8
|
|
|
|
|
00C0 | DF 20 E4 66 3B CB 3B 2B 1C 5E 36 02 E4 F6 CA 87
|
|
|
|
|
00D0 | F7 EC CF 33 A7 49 28 DB 8E 2F B0 C3 FF 4A F9 75
|
|
|
|
|
00E0 | B0 51 32 50 09 93 B6 63 01 19 00 4D 05 1C B2 BA
|
|
|
|
|
00F0 | 3F CA B2 82 38 C8 8F 0A 8A 91 B5 B5 24 2D F3 71
|
|
|
|
|
0100 | B2 4A EE F1 C1 2D 83 3D 49 3C 5F 24 9C E9 4C 4F
|
|
|
|
|
0110 | C1 AC 1F 50 3C C0 51 EB BB B2 7C 72 27 FE 89 56
|
|
|
|
|
0120 | 94 A5 A4 92 F3 F0 56 EC B7 55 54 C7 F3 96 14 B6
|
|
|
|
|
0130 | B6 C6 DD CA BB 4A 86 32 65 A3 6C EC B3 06 C8 F2
|
|
|
|
|
0140 | EF 52 AE D8 AE CD 3D AD 04 3B 1C E7 F1 D8 BC F4
|
|
|
|
|
0150 | 0F B3 B3 AA AF C7 BB EE 9A 32 67 36 EF 1A 87 FA
|
|
|
|
|
0160 | 0A BB 18 BD D1 AF AC AA DB 0D CF 23 D5 9D 0A 6A
|
|
|
|
|
0170 | F9 0E 76 A0 85 98 14 49 5E 76 D2 D9 9B 23 0F 46
|
|
|
|
|
0180 | 9E FD F3 D1 4A 04 D2 D4 8D 89 23 2E 98 DE 50 79
|
|
|
|
|
0190 | 21 D4 4E 58 00 13 F7 67 1C 9A 12 7A E3 EB 43 06
|
|
|
|
|
01A0 | 46 67 71 C2 01 9E 88 C6 0F E1 62 30 19 05 CD 85
|
|
|
|
|
01B0 | 55 B4 D3 80 F2 6A 10 93 D7 BE 05 27 10 5A DE EE
|
|
|
|
|
01C0 | 7A CD AF 3A 91 56 2E F0 3F 76 B0 C9 81 73 AE 1E
|
|
|
|
|
01D0 | 18 60 D7 B7 2C 1D 1F BF 20 8D FC 02 69 0D 17 81
|
|
|
|
|
01E0 | 3A 26 A2 B4 7B B8 C3 6A 26 FC 41 01 0D 2E 2B 79
|
|
|
|
|
01F0 | FF F6 C3 D1 0D B0 6A 66 CA CC B7 0D F1 5D 4A 51
|
|
|
|
|
0200 | 6A DA 5A 7E 95 C1 D0 B0 FC AB 52 0A 6B 73 92 06
|
|
|
|
|
0210 | E5 5B 68 C5 E6 18 90 51 FF B4 46 67 32 80 A4 BB
|
|
|
|
|
0220 | 62 B5 E3 FC 0F 70 40 6B D6 CA 60 D6 4E 46 80 98
|
|
|
|
|
0230 | 43 66 57 52 E3 6D FF 40 92 38 07 4F F5 7D C9 A4
|
|
|
|
|
0240 | A2 88 76 F2 B4 FF 6A 54 97 A6 F3 BA 82 B9 13 8B
|
|
|
|
|
0250 | B8 12 0D 2E 77 96 30 09 82 C5 F1 B8 82 DD FD 03
|
|
|
|
|
0260 | DC E7 83 E6 89 05 E7 BB C2 10 6E ED 65 A8 69 71
|
|
|
|
|
0270 | 3F 6D 4D 5D 2A 60 2F ED 31 A9 2F 31 E2 6F 46 AB
|
|
|
|
|
0280 | 1F 5B 3B 71 FB 06 08 D1 3A 5A 57 49</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 94 DF A9 0A 4F 87 65
|
|
|
|
|
0010 | D0 02 00 00 5C 07 E8 D0 A1 D0 50 58 4C B7 93 A7
|
|
|
|
|
0020 | 9A 25 1D C4 34 D9 E6 C6 69 FF A0 EA 0B C5 AC 08
|
|
|
|
|
0030 | F3 47 27 D8 7F 16 88 3C FE 50 02 00 23 BF 4E BA
|
|
|
|
|
0040 | 09 FE D0 74 63 97 04 06 16 B4 7A 0D 59 40 41 39
|
|
|
|
|
0050 | FD 9D 20 6F 23 F3 5B D8 03 CC 0C A8 06 C7 29 84
|
|
|
|
|
0060 | FC E1 4F 45 0D 1C 35 8B DE 23 FC AD CB C4 8F 7D
|
|
|
|
|
0070 | CB CE B8 BD E2 A3 B0 74 E8 EB A2 FE DE B7 C9 7D
|
|
|
|
|
0080 | 93 6E 7B 69 51 62 F6 B1 37 BB A8 CE 52 92 A1 2B
|
|
|
|
|
0090 | DA 8D FA A5 01 29 CA 99 A4 89 B1 63 A2 88 11 FC
|
|
|
|
|
00A0 | 8F EC 1A 00 D7 48 C9 84 ED DD 71 F9 05 AA D8 44
|
|
|
|
|
00B0 | 19 0B 4C 17 AC 4B 4E E3 74 32 24 B5 3D 0B 67 AC
|
|
|
|
|
00C0 | 02 7A 58 D2 03 F6 E7 C6 BA 2F 87 65 AF 7D 24 62
|
|
|
|
|
00D0 | 07 0D 69 07 C7 98 80 13 C9 74 25 87 48 87 21 33
|
|
|
|
|
00E0 | 7B E0 CE E7 77 B9 76 F8 01 18 66 D9 EE 4D B2 AC
|
|
|
|
|
00F0 | A4 41 B3 33 49 2D 32 C8 70 4F 01 85 DF EF 08 10
|
|
|
|
|
0100 | B6 C3 6F DF EE 69 02 F0 55 66 3D 99 22 C6 78 3F
|
|
|
|
|
0110 | 86 14 9C 8A 51 BE F0 EE A9 81 6E 79 95 08 53 AD
|
|
|
|
|
0120 | 7C 4D D5 6D C4 EC DA 7D 8B 08 E8 EE 98 16 33 EE
|
|
|
|
|
0130 | 55 94 50 4D C6 2B 8B B5 A1 AC 16 D7 BD D0 BE EF
|
|
|
|
|
0140 | EF 60 B4 6D 06 53 57 05 A9 E9 0B EA A9 B5 B7 F2
|
|
|
|
|
0150 | 8C 0F 67 CB 8F D2 B9 9C C3 47 8F D8 CC 75 5D 5C
|
|
|
|
|
0160 | 2B DF 28 DF A6 B4 EE BC F2 4C A6 1F 3B 3C F8 37
|
|
|
|
|
0170 | D5 E6 39 3E CE 79 E4 F0 47 2A 00 4A E1 4F 4B 33
|
|
|
|
|
0180 | 9D ED B3 7B 28 F6 A1 56 78 B9 45 E2 1E 1F CE 2D
|
|
|
|
|
0190 | 4B 65 45 9B 63 97 35 9A 32 77 45 54 29 A1 A1 07
|
|
|
|
|
01A0 | CA 34 6A C3 4E D3 07 BC 7D 61 50 29 10 0C 87 E9
|
|
|
|
|
01B0 | 31 EB B0 97 A2 F1 F3 2E 76 26 37 72 53 61 99 4B
|
|
|
|
|
01C0 | C6 9B 97 3A 7B A7 8B 6B 67 54 FC C4 AE 0F 24 F3
|
|
|
|
|
01D0 | 23 0F 95 59 D8 D4 97 ED 45 23 BE 8C C2 72 3B 24
|
|
|
|
|
01E0 | 50 E1 B0 01 56 9A E5 08 C7 5B 85 27 A3 56 2F 59
|
|
|
|
|
01F0 | 21 07 FD 2D D5 13 36 6A C8 6B AB 2C 95 FF BD 2B
|
|
|
|
|
0200 | 95 C2 E3 4C F0 2E 67 E6 50 94 D3 34 7D 8A C3 FB
|
|
|
|
|
0210 | 87 8B 5F 43 DF E5 38 4C 0D D2 02 73 75 9C 06 09
|
|
|
|
|
0220 | 91 CA 65 32 DA 5F CD 8D 6F C3 BD 4E 67 9F 53 49
|
|
|
|
|
0230 | 0E D2 6A D3 8A 7C 60 38 29 64 D9 36 BC 07 01 15
|
|
|
|
|
0240 | 0E 48 66 94 8D 7E 34 D9 14 B1 1A 2B BC 2D A4 24
|
|
|
|
|
0250 | 42 D9 07 65 33 FF 84 D3 4C 9D 6D 0D D5 B5 D9 C0
|
|
|
|
|
0260 | 47 66 A1 BA FE 96 E1 91 94 51 CE AB 40 F9 7F 38
|
|
|
|
|
0270 | CD BA 0C E4 DA AA 29 70 0E 69 00 E4 5F 37 47 64
|
|
|
|
|
0280 | 4D 6B 3E A7 69 29 EA 12 C9 EB 1B 34</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 = 3D1339ACBAC2FAD94051E2552D22E156939320323A0F95E163E5D02A8
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>0164676BC9328765</code></td>
|
|
|
|
|
<td><code>0194DFA90A4F8765</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>C8020000</code> (712 in decimal)</td>
|
|
|
|
|
<td><code>D0020000</code> (720 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -482,19 +482,19 @@ random_padding_bytes = 3D1339ACBAC2FAD94051E2552D22E156939320323A0F95E163E5D02A8
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>7E7938C14AB73024C394DBC0E80A6B5D</code></td>
|
|
|
|
|
<td><code>A1D050584CB793A79A251DC434D9E6C6</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>DDF3952525822DBE37BBF15E0DC8A860</code></td>
|
|
|
|
|
<td><code>69FFA0EA0BC5AC08F34727D87F16883C</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE500200117B1270279DF63853710469</code> <code>06D77C00742E6854D6A81412424FAD5C</code> <code>B9633D682153D9797A4C4F10EF56616B</code> <code>9C52AA5D03B84DA72739155ABCD06A24</code> <code>C3835CA3F40D31226FD8B32ABFFE68AA</code> <code>4E197B91432EED299748B61FB6CBE143</code> <code>A5E7E130DB41C930C879F8FC77980C72</code> <code>B8150216621D53B7312ADE473D5B0AA1</code> <code>7992C2B10652E9E8DF20E4663BCB3B2B</code> <code>1C5E3602E4F6CA87F7ECCF33A74928DB</code> <code>8E2FB0C3FF4AF975B05132500993B663</code> <code>0119004D051CB2BA3FCAB28238C88F0A</code> <code>8A91B5B5242DF371B24AEEF1C12D833D</code> <code>493C5F249CE94C4FC1AC1F503CC051EB</code> <code>BBB27C7227FE895694A5A492F3F056EC</code> <code>B75554C7F39614B6B6C6DDCABB4A8632</code> <code>65A36CECB306C8F2EF52AED8AECD3DAD</code> <code>043B1CE7F1D8BCF40FB3B3AAAFC7BBEE</code> <code>9A326736EF1A87FA0ABB18BDD1AFACAA</code> <code>DB0DCF23D59D0A6AF90E76A085981449</code> <code>5E76D2D99B230F469EFDF3D14A04D2D4</code> <code>8D89232E98DE507921D44E580013F767</code> <code>1C9A127AE3EB4306466771C2019E88C6</code> <code>0FE162301905CD8555B4D380F26A1093</code> <code>D7BE0527105ADEEE7ACDAF3A91562EF0</code> <code>3F76B0C98173AE1E1860D7B72C1D1FBF</code> <code>208DFC02690D17813A26A2B47BB8C36A</code> <code>26FC41010D2E2B79FFF6C3D10DB06A66</code> <code>CACCB70DF15D4A516ADA5A7E95C1D0B0</code> <code>FCAB520A6B739206E55B68C5E6189051</code> <code>FFB446673280A4BB62B5E3FC0F70406B</code> <code>D6CA60D64E46809843665752E36DFF40</code> <code>9238074FF57DC9A4A28876F2B4FF6A54</code> <code>97A6F3BA82B9138BB8120D2E77963009</code> <code>82C5F1B882DDFD03DCE783E68905E7BB</code> <code>C2106EED65A869713F6D4D5D2A602FED</code> <code>31A92F31E26F46AB1F5B3B71FB0608D1</code><br> <code>3A5A5749</code></td>
|
|
|
|
|
<td><code>FE50020023BF4EBA09FED07463970406</code> <code>16B47A0D59404139FD9D206F23F35BD8</code> <code>03CC0CA806C72984FCE14F450D1C358B</code> <code>DE23FCADCBC48F7DCBCEB8BDE2A3B074</code> <code>E8EBA2FEDEB7C97D936E7B695162F6B1</code> <code>37BBA8CE5292A12BDA8DFAA50129CA99</code> <code>A489B163A28811FC8FEC1A00D748C984</code> <code>EDDD71F905AAD844190B4C17AC4B4EE3</code> <code>743224B53D0B67AC027A58D203F6E7C6</code> <code>BA2F8765AF7D2462070D6907C7988013</code> <code>C9742587488721337BE0CEE777B976F8</code> <code>011866D9EE4DB2ACA441B333492D32C8</code> <code>704F0185DFEF0810B6C36FDFEE6902F0</code> <code>55663D9922C6783F86149C8A51BEF0EE</code> <code>A9816E79950853AD7C4DD56DC4ECDA7D</code> <code>8B08E8EE981633EE5594504DC62B8BB5</code> <code>A1AC16D7BDD0BEEFEF60B46D06535705</code> <code>A9E90BEAA9B5B7F28C0F67CB8FD2B99C</code> <code>C3478FD8CC755D5C2BDF28DFA6B4EEBC</code> <code>F24CA61F3B3CF837D5E6393ECE79E4F0</code> <code>472A004AE14F4B339DEDB37B28F6A156</code> <code>78B945E21E1FCE2D4B65459B6397359A</code> <code>3277455429A1A107CA346AC34ED307BC</code> <code>7D615029100C87E931EBB097A2F1F32E</code> <code>762637725361994BC69B973A7BA78B6B</code> <code>6754FCC4AE0F24F3230F9559D8D497ED</code> <code>4523BE8CC2723B2450E1B001569AE508</code> <code>C75B8527A3562F592107FD2DD513366A</code> <code>C86BAB2C95FFBD2B95C2E34CF02E67E6</code> <code>5094D3347D8AC3FB878B5F43DFE5384C</code> <code>0DD20273759C060991CA6532DA5FCD8D</code> <code>6FC3BD4E679F53490ED26AD38A7C6038</code> <code>2964D936BC0701150E4866948D7E34D9</code> <code>14B11A2BBC2DA42442D9076533FF84D3</code> <code>4C9D6D0DD5B5D9C04766A1BAFE96E191</code> <code>9451CEAB40F97F38CDBA0CE4DAAA2970</code> <code>0E6900E45F3747644D6B3EA76929EA12</code><br> <code>C9EB1B34</code></td>
|
|
|
|
|
<td>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = 3D1339ACBAC2FAD94051E2552D22E156939320323A0F95E163E5D02A8
|
|
|
|
|
<!-- 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 = 117B1270279DF6385371046906D77C00742E6854D6A81412424FAD5CB9633D682153D9797A4C4F10EF56616B9C52AA5D03B84DA72739155ABCD06A24C3835CA3F40D31226FD8B32ABFFE68AA4E197B91432EED299748B61FB6CBE143A5E7E130DB41C930C879F8FC77980C72B8150216621D53B7312ADE473D5B0AA17992C2B10652E9E8DF20E4663BCB3B2B1C5E3602E4F6CA87F7ECCF33A74928DB8E2FB0C3FF4AF975B05132500993B6630119004D051CB2BA3FCAB28238C88F0A8A91B5B5242DF371B24AEEF1C12D833D493C5F249CE94C4FC1AC1F503CC051EBBBB27C7227FE895694A5A492F3F056ECB75554C7F39614B6B6C6DDCABB4A863265A36CECB306C8F2EF52AED8AECD3DAD043B1CE7F1D8BCF40FB3B3AAAFC7BBEE9A326736EF1A87FA0ABB18BDD1AFACAADB0DCF23D59D0A6AF90E76A0859814495E76D2D99B230F469EFDF3D14A04D2D48D89232E98DE507921D44E580013F7671C9A127AE3EB4306466771C2019E88C60FE162301905CD8555B4D380F26A1093D7BE0527105ADEEE7ACDAF3A91562EF03F76B0C98173AE1E1860D7B72C1D1FBF208DFC02690D17813A26A2B47BB8C36A26FC41010D2E2B79FFF6C3D10DB06A66CACCB70DF15D4A516ADA5A7E95C1D0B0FCAB520A6B739206E55B68C5E6189051FFB446673280A4BB62B5E3FC0F70406BD6CA60D64E46809843665752E36DFF409238074FF57DC9A4A28876F2B4FF6A5497A6F3BA82B9138BB8120D2E7796300982C5F1B882DDFD03DCE783E68905E7BBC2106EED65A869713F6D4D5D2A602FED31A92F31E26F46AB1F5B3B71FB0608D13A5A5749
|
|
|
|
|
tmp_aes_key = D28A87C0D70101BB2B10FB424BE653AE8EFB79805727725BD0189841E9004B8A
|
|
|
|
|
tmp_aes_iv = FE8486D1C9DBCCC51BC4D8AFF6F9581FB6A086BC2F678552CF66D37BEA1894A9</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = 23BF4EBA09FED0746397040616B47A0D59404139FD9D206F23F35BD803CC0CA806C72984FCE14F450D1C358BDE23FCADCBC48F7DCBCEB8BDE2A3B074E8EBA2FEDEB7C97D936E7B695162F6B137BBA8CE5292A12BDA8DFAA50129CA99A489B163A28811FC8FEC1A00D748C984EDDD71F905AAD844190B4C17AC4B4EE3743224B53D0B67AC027A58D203F6E7C6BA2F8765AF7D2462070D6907C7988013C9742587488721337BE0CEE777B976F8011866D9EE4DB2ACA441B333492D32C8704F0185DFEF0810B6C36FDFEE6902F055663D9922C6783F86149C8A51BEF0EEA9816E79950853AD7C4DD56DC4ECDA7D8B08E8EE981633EE5594504DC62B8BB5A1AC16D7BDD0BEEFEF60B46D06535705A9E90BEAA9B5B7F28C0F67CB8FD2B99CC3478FD8CC755D5C2BDF28DFA6B4EEBCF24CA61F3B3CF837D5E6393ECE79E4F0472A004AE14F4B339DEDB37B28F6A15678B945E21E1FCE2D4B65459B6397359A3277455429A1A107CA346AC34ED307BC7D615029100C87E931EBB097A2F1F32E762637725361994BC69B973A7BA78B6B6754FCC4AE0F24F3230F9559D8D497ED4523BE8CC2723B2450E1B001569AE508C75B8527A3562F592107FD2DD513366AC86BAB2C95FFBD2B95C2E34CF02E67E65094D3347D8AC3FB878B5F43DFE5384C0DD20273759C060991CA6532DA5FCD8D6FC3BD4E679F53490ED26AD38A7C60382964D936BC0701150E4866948D7E34D914B11A2BBC2DA42442D9076533FF84D34C9D6D0DD5B5D9C04766A1BAFE96E1919451CEAB40F97F38CDBA0CE4DAAA29700E6900E45F3747644D6B3EA76929EA12C9EB1B34
|
|
|
|
|
tmp_aes_key = CB7D6D9817AD90C5CA0D0C9DE2B6A96777A9DDC44B7D75E8FB68509CF0D6C892
|
|
|
|
|
tmp_aes_iv = E0FADC1731AFFFB59DC98A1B7A8B390C5BDDF383365551EFE75FB469974FF744</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = CD620676A7F66F858B7AA1A7160C6423F43E4934BA0D89B57E7938C14AB73024C394DBC0E80A6B5DDDF3952525822DBE37BBF15E0DC8A86003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001004F6869C2282055E5119EB1046452FD4C2521575FA300221D0B350A58AE4196B6390518074614F869AD9705B929E15E9F05D1D3283D9FA8E3EF5702C04C3CFE05054266F759596D03F4FA731F74591F5D4B678A2975053C9D5294E879A43B1C8EE613082B7AD1FDABD75FCBE941EE19C2EAAD44BAB132355D509C4A816D9F59B486326899D8D1B5D22B8C6CD15F00040B5950D9ED6E3F8104EEC30DA48A4F5B37DACAC246A842FB9B535E9CD55D001FCC516A662203122F4A141D4B8BF8C8E9D5B1A84BD3F39296172A59420BA2E33729EFA6B78F7F27D53E0A4697490DA040FB730CC5B9D860530C17ACDA40FBFFC0A557D624B7C85D7AE8E75AA39E470540FEC93287653AFE6C493AF0C20F
|
|
|
|
|
answer = BA0D89B57E7938C14AB73024C394DBC0E80A6B5DDDF3952525822DBE37BBF15E0DC8A86003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001004F6869C2282055E5119EB1046452FD4C2521575FA300221D0B350A58AE4196B6390518074614F869AD9705B929E15E9F05D1D3283D9FA8E3EF5702C04C3CFE05054266F759596D03F4FA731F74591F5D4B678A2975053C9D5294E879A43B1C8EE613082B7AD1FDABD75FCBE941EE19C2EAAD44BAB132355D509C4A816D9F59B486326899D8D1B5D22B8C6CD15F00040B5950D9ED6E3F8104EEC30DA48A4F5B37DACAC246A842FB9B535E9CD55D001FCC516A662203122F4A141D4B8BF8C8E9D5B1A84BD3F39296172A59420BA2E33729EFA6B78F7F27D53E0A4697490DA040FB730CC5B9D860530C17ACDA40FBFFC0A557D624B7C85D7AE8E75AA39E470540FEC93287653AFE6C493AF0C20F</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = F1370A9F5C98174D45C7879701005F13FE5E9519BA0D89B5A1D050584CB793A79A251DC434D9E6C669FFA0EA0BC5AC08F34727D87F16883C03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010087F03ADD09F978C37CBD8F34AE67093243963588D7107B423BE28877BFFFC7B2195A0A6A6774A6F5AC2627662A6BE12E3D15CFD80CF99C93B30BABAD76C9EDFB258E0345BBC3D9A246DBB217382C18DB7E1CB04949DEB10C8C4CA8F7AB67E6085993EF69290147448F429B412D07CD3E79B47F5EA5DB8ED01D5A0DAF0DBF70BEE9E64150D2EC06DA395081BE7D2AF9195099C97562148FD9493CB12426096A32214833EE2018423FF054B49127A89C914A2D4D84D6702FD0330E7D5C36D81110CDD5B5007F44E686E534A58536BF0DD84B17A01C0A50FCDD7F24283ECFD030508B65490D993E703D1F79A5FA9CB0FAB30FD0EDD953491D84E25D8F055C86B15F0A4F87651B5929D26FD657AC
|
|
|
|
|
answer = BA0D89B5A1D050584CB793A79A251DC434D9E6C669FFA0EA0BC5AC08F34727D87F16883C03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010087F03ADD09F978C37CBD8F34AE67093243963588D7107B423BE28877BFFFC7B2195A0A6A6774A6F5AC2627662A6BE12E3D15CFD80CF99C93B30BABAD76C9EDFB258E0345BBC3D9A246DBB217382C18DB7E1CB04949DEB10C8C4CA8F7AB67E6085993EF69290147448F429B412D07CD3E79B47F5EA5DB8ED01D5A0DAF0DBF70BEE9E64150D2EC06DA395081BE7D2AF9195099C97562148FD9493CB12426096A32214833EE2018423FF054B49127A89C914A2D4D84D6702FD0330E7D5C36D81110CDD5B5007F44E686E534A58536BF0DD84B17A01C0A50FCDD7F24283ECFD030508B65490D993E703D1F79A5FA9CB0FAB30FD0EDD953491D84E25D8F055C86B15F0A4F87651B5929D26FD657AC</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 7E 79 38 C1 4A B7 30 24 C3 94 DB C0
|
|
|
|
|
0010 | E8 0A 6B 5D DD F3 95 25 25 82 2D BE 37 BB F1 5E
|
|
|
|
|
0020 | 0D C8 A8 60 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 A1 D0 50 58 4C B7 93 A7 9A 25 1D C4
|
|
|
|
|
0010 | 34 D9 E6 C6 69 FF A0 EA 0B C5 AC 08 F3 47 27 D8
|
|
|
|
|
0020 | 7F 16 88 3C 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 = BA0D89B57E7938C14AB73024C394DBC0E80A6B5DDDF3952525822DBE37BBF15E0DC8A86
|
|
|
|
|
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 | 4F 68 69 C2 28 20 55 E5 11 9E B1 04 64 52 FD 4C
|
|
|
|
|
0140 | 25 21 57 5F A3 00 22 1D 0B 35 0A 58 AE 41 96 B6
|
|
|
|
|
0150 | 39 05 18 07 46 14 F8 69 AD 97 05 B9 29 E1 5E 9F
|
|
|
|
|
0160 | 05 D1 D3 28 3D 9F A8 E3 EF 57 02 C0 4C 3C FE 05
|
|
|
|
|
0170 | 05 42 66 F7 59 59 6D 03 F4 FA 73 1F 74 59 1F 5D
|
|
|
|
|
0180 | 4B 67 8A 29 75 05 3C 9D 52 94 E8 79 A4 3B 1C 8E
|
|
|
|
|
0190 | E6 13 08 2B 7A D1 FD AB D7 5F CB E9 41 EE 19 C2
|
|
|
|
|
01A0 | EA AD 44 BA B1 32 35 5D 50 9C 4A 81 6D 9F 59 B4
|
|
|
|
|
01B0 | 86 32 68 99 D8 D1 B5 D2 2B 8C 6C D1 5F 00 04 0B
|
|
|
|
|
01C0 | 59 50 D9 ED 6E 3F 81 04 EE C3 0D A4 8A 4F 5B 37
|
|
|
|
|
01D0 | DA CA C2 46 A8 42 FB 9B 53 5E 9C D5 5D 00 1F CC
|
|
|
|
|
01E0 | 51 6A 66 22 03 12 2F 4A 14 1D 4B 8B F8 C8 E9 D5
|
|
|
|
|
01F0 | B1 A8 4B D3 F3 92 96 17 2A 59 42 0B A2 E3 37 29
|
|
|
|
|
0200 | EF A6 B7 8F 7F 27 D5 3E 0A 46 97 49 0D A0 40 FB
|
|
|
|
|
0210 | 73 0C C5 B9 D8 60 53 0C 17 AC DA 40 FB FF C0 A5
|
|
|
|
|
0220 | 57 D6 24 B7 C8 5D 7A E8 E7 5A A3 9E 47 05 40 FE
|
|
|
|
|
0230 | C9 32 87 65</code></pre>
|
|
|
|
|
0130 | 87 F0 3A DD 09 F9 78 C3 7C BD 8F 34 AE 67 09 32
|
|
|
|
|
0140 | 43 96 35 88 D7 10 7B 42 3B E2 88 77 BF FF C7 B2
|
|
|
|
|
0150 | 19 5A 0A 6A 67 74 A6 F5 AC 26 27 66 2A 6B E1 2E
|
|
|
|
|
0160 | 3D 15 CF D8 0C F9 9C 93 B3 0B AB AD 76 C9 ED FB
|
|
|
|
|
0170 | 25 8E 03 45 BB C3 D9 A2 46 DB B2 17 38 2C 18 DB
|
|
|
|
|
0180 | 7E 1C B0 49 49 DE B1 0C 8C 4C A8 F7 AB 67 E6 08
|
|
|
|
|
0190 | 59 93 EF 69 29 01 47 44 8F 42 9B 41 2D 07 CD 3E
|
|
|
|
|
01A0 | 79 B4 7F 5E A5 DB 8E D0 1D 5A 0D AF 0D BF 70 BE
|
|
|
|
|
01B0 | E9 E6 41 50 D2 EC 06 DA 39 50 81 BE 7D 2A F9 19
|
|
|
|
|
01C0 | 50 99 C9 75 62 14 8F D9 49 3C B1 24 26 09 6A 32
|
|
|
|
|
01D0 | 21 48 33 EE 20 18 42 3F F0 54 B4 91 27 A8 9C 91
|
|
|
|
|
01E0 | 4A 2D 4D 84 D6 70 2F D0 33 0E 7D 5C 36 D8 11 10
|
|
|
|
|
01F0 | CD D5 B5 00 7F 44 E6 86 E5 34 A5 85 36 BF 0D D8
|
|
|
|
|
0200 | 4B 17 A0 1C 0A 50 FC DD 7F 24 28 3E CF D0 30 50
|
|
|
|
|
0210 | 8B 65 49 0D 99 3E 70 3D 1F 79 A5 FA 9C B0 FA B3
|
|
|
|
|
0220 | 0F D0 ED D9 53 49 1D 84 E2 5D 8F 05 5C 86 B1 5F
|
|
|
|
|
0230 | 0A 4F 87 65</code></pre>
|
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
|
<pre><code>server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;</code></pre>
|
|
|
|
|
<table class="table">
|
|
|
|
@ -570,13 +570,13 @@ answer = BA0D89B57E7938C14AB73024C394DBC0E80A6B5DDDF3952525822DBE37BBF15E0DC8A86
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>7E7938C14AB73024C394DBC0E80A6B5D</code></td>
|
|
|
|
|
<td><code>A1D050584CB793A79A251DC434D9E6C6</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>DDF3952525822DBE37BBF15E0DC8A860</code></td>
|
|
|
|
|
<td><code>69FFA0EA0BC5AC08F34727D87F16883C</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B57E7938C14AB73024C394DBC0E80A6B5DDDF3952525822DBE37BBF15E0DC8A86
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE0001004F6869C2282055E5119EB104</code> <code>6452FD4C2521575FA300221D0B350A58</code> <code>AE4196B6390518074614F869AD9705B9</code> <code>29E15E9F05D1D3283D9FA8E3EF5702C0</code> <code>4C3CFE05054266F759596D03F4FA731F</code> <code>74591F5D4B678A2975053C9D5294E879</code> <code>A43B1C8EE613082B7AD1FDABD75FCBE9</code> <code>41EE19C2EAAD44BAB132355D509C4A81</code> <code>6D9F59B486326899D8D1B5D22B8C6CD1</code> <code>5F00040B5950D9ED6E3F8104EEC30DA4</code> <code>8A4F5B37DACAC246A842FB9B535E9CD5</code> <code>5D001FCC516A662203122F4A141D4B8B</code> <code>F8C8E9D5B1A84BD3F39296172A59420B</code> <code>A2E33729EFA6B78F7F27D53E0A469749</code> <code>0DA040FB730CC5B9D860530C17ACDA40</code> <code>FBFFC0A557D624B7C85D7AE8E75AA39E</code><br> <code>470540FE</code></td>
|
|
|
|
|
<td><code>FE00010087F03ADD09F978C37CBD8F34</code> <code>AE67093243963588D7107B423BE28877</code> <code>BFFFC7B2195A0A6A6774A6F5AC262766</code> <code>2A6BE12E3D15CFD80CF99C93B30BABAD</code> <code>76C9EDFB258E0345BBC3D9A246DBB217</code> <code>382C18DB7E1CB04949DEB10C8C4CA8F7</code> <code>AB67E6085993EF69290147448F429B41</code> <code>2D07CD3E79B47F5EA5DB8ED01D5A0DAF</code> <code>0DBF70BEE9E64150D2EC06DA395081BE</code> <code>7D2AF9195099C97562148FD9493CB124</code> <code>26096A32214833EE2018423FF054B491</code> <code>27A89C914A2D4D84D6702FD0330E7D5C</code> <code>36D81110CDD5B5007F44E686E534A585</code> <code>36BF0DD84B17A01C0A50FCDD7F24283E</code> <code>CFD030508B65490D993E703D1F79A5FA</code> <code>9CB0FAB30FD0EDD953491D84E25D8F05</code><br> <code>5C86B15F</code></td>
|
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>C9328765</code> (1703359177 in decimal)</td>
|
|
|
|
|
<td><code>0A4F8765</code> (1703366410 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B57E7938C14AB73024C394DBC0E80A6B5DDDF3952525822DBE37BBF15E0DC8A86
|
|
|
|
|
<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 = CA1889050E305B662888564636B20AD5A2303286A031867498FA652122269ED33E83280AE0F361C44272025BA7D025C0B440FF53A44757FBC41E2D323A483AF708D79E8F6F86E470D081D7E1C856ED766E94DDE74FE4747D69778D6B6A148985BAE39BB00549BAA266ACE81EFE787A5939A87CAED4FDF63F2CF37989313DE8AB825D2A50DCF90066A0665FC9FA43B8ED1728DE6167C9E82FA48AE9BDB9F795E86CB358BD5BC0DB7A03E89F49067E4C083829615983DE7A9EA75A1A22238FFC551A262D53E976BE695929031E193C5C134214C0213167E5969689CD33F3C08D038396554631E29B7EDF6F7B6686DC86CE6938CCF17B4D02818CB34561D8C8467C</code></pre>
|
|
|
|
|
<pre><code>b = 20A03DED499A18AE912DCD0BAEF0F391C4C28F9F901EF3031C10F5FD2364D223312153A7A51D2FC62044AD600D31AC7973C0D93E4CDA2741DEEE9F50FE0D83D317396270DB47415034155DC3C701B3F508C0542858921CE84FC7E0A338D8D8CD6D31F5E4DD959328443067D8B536C869A5E221C2DF17A1BE81FA5113A4E04934E924967BD7EC04B2E80E3ABFDC6FD13BFF7D2B3A075CC6B0DC9DAA1752E95926166A30A47C9EE96265F78FD5FFA1E18C0A346F5A139003A7A34731A3D394E54396D5CD3A97684303D1B0A083969673903D744E99EF19328C1DB743D2C8D86EE3C259E460F44AAD04F3E2E561FDC550DEE81E1ADD839FA23DADE591CDFB6A5200</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 = B5C07CAB67304C7EC341D6CF79F231ABC9F3BBD72E3318586C426D7D2775435F37991FF37E915CA3338B3A7ABCEF1501E5FA3160278DC36184E202559A0F392DF0D8B3D44701682619BC8A7AA42166C83AC3FFCA427C9437F56B3D98FF04F64C7BD068B479FE88599473DEEB0638A61CC4F22343838CDD0736B384E6127D0C000FB0F1B5C283620F855BB51FEEA8D5C1F75A00FA90F063C0560EA66246CAB1045EEC355652442C4D85CDE65FF1D3A17AF09461C893FD17080D32B8ED50BCEF57A82B5C0D343CEAAECA94CECB2996923876F2CC3FF1BE2243A0EDC455B68ACB25B66CCB6BDC4CC668E68DC29F64A7DA6FDEACB7D9A837E26AE46B77B852495D71</code></pre>
|
|
|
|
|
<pre><code>g_b = 65F6C6F42E720D4A1EE898D1195C970DA2ADEB0460D361AE413E7AFF5109CAD730C3216D0067078A740B704D66AD80FA0869B86A50AE4D2C9D1050EA2CFBA8EBDB88403B70049ED0EB1F54D550A4A8FC877A0A682EBF7F62BB3230041131FFAFDE91E5CBE1F22EBE141332E20D5658C7BFDBC3DEAC5875637BED83FE7C2C800DF6FC87D89149F33150FCD96338DBE8E98DFF4D9FA5E6EE718CFE76CE3721AAD9B4667109C855AF0D04D41A5CC8D6131ABD7511B3E04010532DFE8D42B8085B7BD8180EED3DD134B5B018B81DAF086495210524EB8F6615077FA71C9A8EB2110757548347DEB2277CB464328E2A982D5FCEB5155587910485282CE77084D56D3B</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 7E 79 38 C1 4A B7 30 24 C3 94 DB C0
|
|
|
|
|
0010 | E8 0A 6B 5D DD F3 95 25 25 82 2D BE 37 BB F1 5E
|
|
|
|
|
0020 | 0D C8 A8 60 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | B5 C0 7C AB 67 30 4C 7E C3 41 D6 CF 79 F2 31 AB
|
|
|
|
|
0040 | C9 F3 BB D7 2E 33 18 58 6C 42 6D 7D 27 75 43 5F
|
|
|
|
|
0050 | 37 99 1F F3 7E 91 5C A3 33 8B 3A 7A BC EF 15 01
|
|
|
|
|
0060 | E5 FA 31 60 27 8D C3 61 84 E2 02 55 9A 0F 39 2D
|
|
|
|
|
0070 | F0 D8 B3 D4 47 01 68 26 19 BC 8A 7A A4 21 66 C8
|
|
|
|
|
0080 | 3A C3 FF CA 42 7C 94 37 F5 6B 3D 98 FF 04 F6 4C
|
|
|
|
|
0090 | 7B D0 68 B4 79 FE 88 59 94 73 DE EB 06 38 A6 1C
|
|
|
|
|
00A0 | C4 F2 23 43 83 8C DD 07 36 B3 84 E6 12 7D 0C 00
|
|
|
|
|
00B0 | 0F B0 F1 B5 C2 83 62 0F 85 5B B5 1F EE A8 D5 C1
|
|
|
|
|
00C0 | F7 5A 00 FA 90 F0 63 C0 56 0E A6 62 46 CA B1 04
|
|
|
|
|
00D0 | 5E EC 35 56 52 44 2C 4D 85 CD E6 5F F1 D3 A1 7A
|
|
|
|
|
00E0 | F0 94 61 C8 93 FD 17 08 0D 32 B8 ED 50 BC EF 57
|
|
|
|
|
00F0 | A8 2B 5C 0D 34 3C EA AE CA 94 CE CB 29 96 92 38
|
|
|
|
|
0100 | 76 F2 CC 3F F1 BE 22 43 A0 ED C4 55 B6 8A CB 25
|
|
|
|
|
0110 | B6 6C CB 6B DC 4C C6 68 E6 8D C2 9F 64 A7 DA 6F
|
|
|
|
|
0120 | DE AC B7 D9 A8 37 E2 6A E4 6B 77 B8 52 49 5D 71</code></pre>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 A1 D0 50 58 4C B7 93 A7 9A 25 1D C4
|
|
|
|
|
0010 | 34 D9 E6 C6 69 FF A0 EA 0B C5 AC 08 F3 47 27 D8
|
|
|
|
|
0020 | 7F 16 88 3C 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 65 F6 C6 F4 2E 72 0D 4A 1E E8 98 D1 19 5C 97 0D
|
|
|
|
|
0040 | A2 AD EB 04 60 D3 61 AE 41 3E 7A FF 51 09 CA D7
|
|
|
|
|
0050 | 30 C3 21 6D 00 67 07 8A 74 0B 70 4D 66 AD 80 FA
|
|
|
|
|
0060 | 08 69 B8 6A 50 AE 4D 2C 9D 10 50 EA 2C FB A8 EB
|
|
|
|
|
0070 | DB 88 40 3B 70 04 9E D0 EB 1F 54 D5 50 A4 A8 FC
|
|
|
|
|
0080 | 87 7A 0A 68 2E BF 7F 62 BB 32 30 04 11 31 FF AF
|
|
|
|
|
0090 | DE 91 E5 CB E1 F2 2E BE 14 13 32 E2 0D 56 58 C7
|
|
|
|
|
00A0 | BF DB C3 DE AC 58 75 63 7B ED 83 FE 7C 2C 80 0D
|
|
|
|
|
00B0 | F6 FC 87 D8 91 49 F3 31 50 FC D9 63 38 DB E8 E9
|
|
|
|
|
00C0 | 8D FF 4D 9F A5 E6 EE 71 8C FE 76 CE 37 21 AA D9
|
|
|
|
|
00D0 | B4 66 71 09 C8 55 AF 0D 04 D4 1A 5C C8 D6 13 1A
|
|
|
|
|
00E0 | BD 75 11 B3 E0 40 10 53 2D FE 8D 42 B8 08 5B 7B
|
|
|
|
|
00F0 | D8 18 0E ED 3D D1 34 B5 B0 18 B8 1D AF 08 64 95
|
|
|
|
|
0100 | 21 05 24 EB 8F 66 15 07 7F A7 1C 9A 8E B2 11 07
|
|
|
|
|
0110 | 57 54 83 47 DE B2 27 7C B4 64 32 8E 2A 98 2D 5F
|
|
|
|
|
0120 | CE B5 15 55 87 91 04 85 28 2C E7 70 84 D5 6D 3B</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 = BA0D89B57E7938C14AB73024C394DBC0E80A6B5DDDF3952525822DBE37BBF15E0DC8A86
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>7E7938C14AB73024C394DBC0E80A6B5D</code></td>
|
|
|
|
|
<td><code>A1D050584CB793A79A251DC434D9E6C6</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>DDF3952525822DBE37BBF15E0DC8A860</code></td>
|
|
|
|
|
<td><code>69FFA0EA0BC5AC08F34727D87F16883C</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE000100B5C07CAB67304C7EC341D6CF</code> <code>79F231ABC9F3BBD72E3318586C426D7D</code> <code>2775435F37991FF37E915CA3338B3A7A</code> <code>BCEF1501E5FA3160278DC36184E20255</code> <code>9A0F392DF0D8B3D44701682619BC8A7A</code> <code>A42166C83AC3FFCA427C9437F56B3D98</code> <code>FF04F64C7BD068B479FE88599473DEEB</code> <code>0638A61CC4F22343838CDD0736B384E6</code> <code>127D0C000FB0F1B5C283620F855BB51F</code> <code>EEA8D5C1F75A00FA90F063C0560EA662</code> <code>46CAB1045EEC355652442C4D85CDE65F</code> <code>F1D3A17AF09461C893FD17080D32B8ED</code> <code>50BCEF57A82B5C0D343CEAAECA94CECB</code> <code>2996923876F2CC3FF1BE2243A0EDC455</code> <code>B68ACB25B66CCB6BDC4CC668E68DC29F</code> <code>64A7DA6FDEACB7D9A837E26AE46B77B8</code><br> <code>52495D71</code></td>
|
|
|
|
|
<td><code>FE00010065F6C6F42E720D4A1EE898D1</code> <code>195C970DA2ADEB0460D361AE413E7AFF</code> <code>5109CAD730C3216D0067078A740B704D</code> <code>66AD80FA0869B86A50AE4D2C9D1050EA</code> <code>2CFBA8EBDB88403B70049ED0EB1F54D5</code> <code>50A4A8FC877A0A682EBF7F62BB323004</code> <code>1131FFAFDE91E5CBE1F22EBE141332E2</code> <code>0D5658C7BFDBC3DEAC5875637BED83FE</code> <code>7C2C800DF6FC87D89149F33150FCD963</code> <code>38DBE8E98DFF4D9FA5E6EE718CFE76CE</code> <code>3721AAD9B4667109C855AF0D04D41A5C</code> <code>C8D6131ABD7511B3E04010532DFE8D42</code> <code>B8085B7BD8180EED3DD134B5B018B81D</code> <code>AF086495210524EB8F6615077FA71C9A</code> <code>8EB2110757548347DEB2277CB464328E</code> <code>2A982D5FCEB5155587910485282CE770</code><br> <code>84D56D3B</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 = BA0D89B57E7938C14AB73024C394DBC0E80A6B5DDDF3952525822DBE37BBF15E0DC8A86
|
|
|
|
|
<!-- 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 = 54B643667E7938C14AB73024C394DBC0E80A6B5DDDF3952525822DBE37BBF15E0DC8A8600000000000000000FE000100B5C07CAB67304C7EC341D6CF79F231ABC9F3BBD72E3318586C426D7D2775435F37991FF37E915CA3338B3A7ABCEF1501E5FA3160278DC36184E202559A0F392DF0D8B3D44701682619BC8A7AA42166C83AC3FFCA427C9437F56B3D98FF04F64C7BD068B479FE88599473DEEB0638A61CC4F22343838CDD0736B384E6127D0C000FB0F1B5C283620F855BB51FEEA8D5C1F75A00FA90F063C0560EA66246CAB1045EEC355652442C4D85CDE65FF1D3A17AF09461C893FD17080D32B8ED50BCEF57A82B5C0D343CEAAECA94CECB2996923876F2CC3FF1BE2243A0EDC455B68ACB25B66CCB6BDC4CC668E68DC29F64A7DA6FDEACB7D9A837E26AE46B77B852495D71
|
|
|
|
|
padding = BBA8B20E4238251F949799DA
|
|
|
|
|
tmp_aes_key = D28A87C0D70101BB2B10FB424BE653AE8EFB79805727725BD0189841E9004B8A
|
|
|
|
|
tmp_aes_iv = FE8486D1C9DBCCC51BC4D8AFF6F9581FB6A086BC2F678552CF66D37BEA1894A9</code></pre>
|
|
|
|
|
<pre><code>data = 54B64366A1D050584CB793A79A251DC434D9E6C669FFA0EA0BC5AC08F34727D87F16883C0000000000000000FE00010065F6C6F42E720D4A1EE898D1195C970DA2ADEB0460D361AE413E7AFF5109CAD730C3216D0067078A740B704D66AD80FA0869B86A50AE4D2C9D1050EA2CFBA8EBDB88403B70049ED0EB1F54D550A4A8FC877A0A682EBF7F62BB3230041131FFAFDE91E5CBE1F22EBE141332E20D5658C7BFDBC3DEAC5875637BED83FE7C2C800DF6FC87D89149F33150FCD96338DBE8E98DFF4D9FA5E6EE718CFE76CE3721AAD9B4667109C855AF0D04D41A5CC8D6131ABD7511B3E04010532DFE8D42B8085B7BD8180EED3DD134B5B018B81DAF086495210524EB8F6615077FA71C9A8EB2110757548347DEB2277CB464328E2A982D5FCEB5155587910485282CE77084D56D3B
|
|
|
|
|
padding = 20089454DE689556049E0E6C
|
|
|
|
|
tmp_aes_key = CB7D6D9817AD90C5CA0D0C9DE2B6A96777A9DDC44B7D75E8FB68509CF0D6C892
|
|
|
|
|
tmp_aes_iv = E0FADC1731AFFFB59DC98A1B7A8B390C5BDDF383365551EFE75FB469974FF744</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 = 73FF308F4675402329FE202B4DEB8B710166302B2CA230CB60A89B0CA23BFD830D677F3D6AC21A9C5628C3D4F0D804F59A20273A9D85A3A1C83D2AC464066A1DFED37E2862BB9AB3D5D3871AA24B25F2CC07B387A2B6B0D4A947C329E57EF41FCE8DE2E0456BB90DD239A8E5A9324898FFE5F125750B29BA6943A491417A8C50DD5E8E47AA23F720759373B1527BE9D593A85F82DA527AAA4E361B1F2EFDA6BA392171FEAB13E0D09B43E7C626DB105E2DF116A384042B9DE5ECFF08795DBAC1AF0B6268783AFB889A49A2510D94079FB7EB9A25F86070BADD3AB3644C252771EB153A742F8D4CD20248843510EFFDADC498590AD6258C0381EE84987DD714B7804DF6AFEA76A7E8CD656ACE90C10260F0BAD3ABFF4466FD726E2E76E0CBBC8BF759C9C243C589CDED5389602C870A006D0B58C84D3DE8C01569D53F9489973945AF5AB6E5869CB76311B78F147359CE</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 23A72F1531023903698D2F7F28D09832154B6EECBA016FF7A223B00CA85B4CB68A0C2A0085D4A909E00F5933443E3FA2B4783151392C5733B640594C4CE541F26850B4499DE1F0E35406A2CEE3E23D7C3C26C19AB41E589CCCEC618FD53DBCA65D8479FA43D0521173AACE311B6A1D0BF0BF4209B60C1C04F45BA4FC58AF15D779B00B6B3136B5158D04CAAA34633524EC69827623DC62DD417F422CC858A370963DDE17CA5EFAAA07D2ECDFD3D786D2DC3AA4EEC74C30B4663131A30B09AA4AFD44D36ECD397ED1EDD99C8F02725047B5821C87F4CEA539A970C6AEDB7A2AE8B18C0D22AF538466F0C8224256DEE4CBACE4ED1EE78758E03275DE34AA47D4EAB9FF253F3FAEA05DB754A4C4F1D0EA8141D3B599DE5DA06858889FE00625F5F0C95B70E2F72CF024987B49C9BCC958CBEE3010F70AF6E914D7FDF84706C60FEAA6DBA643153792712D0E5305C94AF5C6</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 58 33 0D 00 C9 32 87 65
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 7E 79 38 C1 4A B7 30 24
|
|
|
|
|
0020 | C3 94 DB C0 E8 0A 6B 5D DD F3 95 25 25 82 2D BE
|
|
|
|
|
0030 | 37 BB F1 5E 0D C8 A8 60 FE 50 01 00 73 FF 30 8F
|
|
|
|
|
0040 | 46 75 40 23 29 FE 20 2B 4D EB 8B 71 01 66 30 2B
|
|
|
|
|
0050 | 2C A2 30 CB 60 A8 9B 0C A2 3B FD 83 0D 67 7F 3D
|
|
|
|
|
0060 | 6A C2 1A 9C 56 28 C3 D4 F0 D8 04 F5 9A 20 27 3A
|
|
|
|
|
0070 | 9D 85 A3 A1 C8 3D 2A C4 64 06 6A 1D FE D3 7E 28
|
|
|
|
|
0080 | 62 BB 9A B3 D5 D3 87 1A A2 4B 25 F2 CC 07 B3 87
|
|
|
|
|
0090 | A2 B6 B0 D4 A9 47 C3 29 E5 7E F4 1F CE 8D E2 E0
|
|
|
|
|
00A0 | 45 6B B9 0D D2 39 A8 E5 A9 32 48 98 FF E5 F1 25
|
|
|
|
|
00B0 | 75 0B 29 BA 69 43 A4 91 41 7A 8C 50 DD 5E 8E 47
|
|
|
|
|
00C0 | AA 23 F7 20 75 93 73 B1 52 7B E9 D5 93 A8 5F 82
|
|
|
|
|
00D0 | DA 52 7A AA 4E 36 1B 1F 2E FD A6 BA 39 21 71 FE
|
|
|
|
|
00E0 | AB 13 E0 D0 9B 43 E7 C6 26 DB 10 5E 2D F1 16 A3
|
|
|
|
|
00F0 | 84 04 2B 9D E5 EC FF 08 79 5D BA C1 AF 0B 62 68
|
|
|
|
|
0100 | 78 3A FB 88 9A 49 A2 51 0D 94 07 9F B7 EB 9A 25
|
|
|
|
|
0110 | F8 60 70 BA DD 3A B3 64 4C 25 27 71 EB 15 3A 74
|
|
|
|
|
0120 | 2F 8D 4C D2 02 48 84 35 10 EF FD AD C4 98 59 0A
|
|
|
|
|
0130 | D6 25 8C 03 81 EE 84 98 7D D7 14 B7 80 4D F6 AF
|
|
|
|
|
0140 | EA 76 A7 E8 CD 65 6A CE 90 C1 02 60 F0 BA D3 AB
|
|
|
|
|
0150 | FF 44 66 FD 72 6E 2E 76 E0 CB BC 8B F7 59 C9 C2
|
|
|
|
|
0160 | 43 C5 89 CD ED 53 89 60 2C 87 0A 00 6D 0B 58 C8
|
|
|
|
|
0170 | 4D 3D E8 C0 15 69 D5 3F 94 89 97 39 45 AF 5A B6
|
|
|
|
|
0180 | E5 86 9C B7 63 11 B7 8F 14 73 59 CE</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 C8 1F 0D 00 0A 4F 87 65
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 A1 D0 50 58 4C B7 93 A7
|
|
|
|
|
0020 | 9A 25 1D C4 34 D9 E6 C6 69 FF A0 EA 0B C5 AC 08
|
|
|
|
|
0030 | F3 47 27 D8 7F 16 88 3C FE 50 01 00 23 A7 2F 15
|
|
|
|
|
0040 | 31 02 39 03 69 8D 2F 7F 28 D0 98 32 15 4B 6E EC
|
|
|
|
|
0050 | BA 01 6F F7 A2 23 B0 0C A8 5B 4C B6 8A 0C 2A 00
|
|
|
|
|
0060 | 85 D4 A9 09 E0 0F 59 33 44 3E 3F A2 B4 78 31 51
|
|
|
|
|
0070 | 39 2C 57 33 B6 40 59 4C 4C E5 41 F2 68 50 B4 49
|
|
|
|
|
0080 | 9D E1 F0 E3 54 06 A2 CE E3 E2 3D 7C 3C 26 C1 9A
|
|
|
|
|
0090 | B4 1E 58 9C CC EC 61 8F D5 3D BC A6 5D 84 79 FA
|
|
|
|
|
00A0 | 43 D0 52 11 73 AA CE 31 1B 6A 1D 0B F0 BF 42 09
|
|
|
|
|
00B0 | B6 0C 1C 04 F4 5B A4 FC 58 AF 15 D7 79 B0 0B 6B
|
|
|
|
|
00C0 | 31 36 B5 15 8D 04 CA AA 34 63 35 24 EC 69 82 76
|
|
|
|
|
00D0 | 23 DC 62 DD 41 7F 42 2C C8 58 A3 70 96 3D DE 17
|
|
|
|
|
00E0 | CA 5E FA AA 07 D2 EC DF D3 D7 86 D2 DC 3A A4 EE
|
|
|
|
|
00F0 | C7 4C 30 B4 66 31 31 A3 0B 09 AA 4A FD 44 D3 6E
|
|
|
|
|
0100 | CD 39 7E D1 ED D9 9C 8F 02 72 50 47 B5 82 1C 87
|
|
|
|
|
0110 | F4 CE A5 39 A9 70 C6 AE DB 7A 2A E8 B1 8C 0D 22
|
|
|
|
|
0120 | AF 53 84 66 F0 C8 22 42 56 DE E4 CB AC E4 ED 1E
|
|
|
|
|
0130 | E7 87 58 E0 32 75 DE 34 AA 47 D4 EA B9 FF 25 3F
|
|
|
|
|
0140 | 3F AE A0 5D B7 54 A4 C4 F1 D0 EA 81 41 D3 B5 99
|
|
|
|
|
0150 | DE 5D A0 68 58 88 9F E0 06 25 F5 F0 C9 5B 70 E2
|
|
|
|
|
0160 | F7 2C F0 24 98 7B 49 C9 BC C9 58 CB EE 30 10 F7
|
|
|
|
|
0170 | 0A F6 E9 14 D7 FD F8 47 06 C6 0F EA A6 DB A6 43
|
|
|
|
|
0180 | 15 37 92 71 2D 0E 53 05 C9 4A F5 C6</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>58330D00C9328765</code></td>
|
|
|
|
|
<td><code>C81F0D000A4F8765</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>7E7938C14AB73024C394DBC0E80A6B5D</code></td>
|
|
|
|
|
<td><code>A1D050584CB793A79A251DC434D9E6C6</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>DDF3952525822DBE37BBF15E0DC8A860</code></td>
|
|
|
|
|
<td><code>69FFA0EA0BC5AC08F34727D87F16883C</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE50010073FF308F4675402329FE202B</code> <code>4DEB8B710166302B2CA230CB60A89B0C</code> <code>A23BFD830D677F3D6AC21A9C5628C3D4</code> <code>F0D804F59A20273A9D85A3A1C83D2AC4</code> <code>64066A1DFED37E2862BB9AB3D5D3871A</code> <code>A24B25F2CC07B387A2B6B0D4A947C329</code> <code>E57EF41FCE8DE2E0456BB90DD239A8E5</code> <code>A9324898FFE5F125750B29BA6943A491</code> <code>417A8C50DD5E8E47AA23F720759373B1</code> <code>527BE9D593A85F82DA527AAA4E361B1F</code> <code>2EFDA6BA392171FEAB13E0D09B43E7C6</code> <code>26DB105E2DF116A384042B9DE5ECFF08</code> <code>795DBAC1AF0B6268783AFB889A49A251</code> <code>0D94079FB7EB9A25F86070BADD3AB364</code> <code>4C252771EB153A742F8D4CD202488435</code> <code>10EFFDADC498590AD6258C0381EE8498</code> <code>7DD714B7804DF6AFEA76A7E8CD656ACE</code> <code>90C10260F0BAD3ABFF4466FD726E2E76</code> <code>E0CBBC8BF759C9C243C589CDED538960</code> <code>2C870A006D0B58C84D3DE8C01569D53F</code> <code>9489973945AF5AB6E5869CB76311B78F</code><br> <code>147359CE</code></td>
|
|
|
|
|
<td><code>FE50010023A72F1531023903698D2F7F</code> <code>28D09832154B6EECBA016FF7A223B00C</code> <code>A85B4CB68A0C2A0085D4A909E00F5933</code> <code>443E3FA2B4783151392C5733B640594C</code> <code>4CE541F26850B4499DE1F0E35406A2CE</code> <code>E3E23D7C3C26C19AB41E589CCCEC618F</code> <code>D53DBCA65D8479FA43D0521173AACE31</code> <code>1B6A1D0BF0BF4209B60C1C04F45BA4FC</code> <code>58AF15D779B00B6B3136B5158D04CAAA</code> <code>34633524EC69827623DC62DD417F422C</code> <code>C858A370963DDE17CA5EFAAA07D2ECDF</code> <code>D3D786D2DC3AA4EEC74C30B4663131A3</code> <code>0B09AA4AFD44D36ECD397ED1EDD99C8F</code> <code>02725047B5821C87F4CEA539A970C6AE</code> <code>DB7A2AE8B18C0D22AF538466F0C82242</code> <code>56DEE4CBACE4ED1EE78758E03275DE34</code> <code>AA47D4EAB9FF253F3FAEA05DB754A4C4</code> <code>F1D0EA8141D3B599DE5DA06858889FE0</code> <code>0625F5F0C95B70E2F72CF024987B49C9</code> <code>BCC958CBEE3010F70AF6E914D7FDF847</code> <code>06C60FEAA6DBA643153792712D0E5305</code><br> <code>C94AF5C6</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 = 939D202589036350FD00600C0CC822E3065B4AEC892004714CE49FC098254F73A5A909116A35D2543E56A2908694701F0E05D1A7FB76D72E5A4D004DA6B559B714ECE285DC49E82704EAA3DBA24983F3E626FB134DEA02B41DEF75EDEE8F0C4DC5EEBC807365068F6CB5BD24FF2B5847F9C8DB65CE658F3839E553AADAFF64DF3281CA3B8D27DA8850E80A5B211951C0491D6A57FF6F2A4DB59652EBE8FB7BD9B03A6214D673E4B517FA0A827D2AB2079B7CBF8B938254C13A95F4331495D2FCB449821FAC4D3A07BA2A2E2C22B0B718B8FFF5E872A19CF20C784E8376705CF2C20257A1AD3BF3FFCE25B84A69FD6D006AEDD3F9F5D72C5DD2EB56ABFD7EFCBF</code></pre>
|
|
|
|
|
<pre><code>auth_key = 621E2237406242E39078280AC35DB0AD5A959E560511A96DB02B62103F55AA27B967D7249C0A5F7AB666CD010A57E5D997A495E9824D706FE54173DFDA3A3B41C05E39134F97E7E042DFFCC2161D3DC54DC37857C85DFF33C437D00B9BC995599DEF9827B18FFB5DDB42B905C86E0EAD2F4767B174456B36A42AB581BCDC11E4AEF282A8B8FF04374C07A0A1694B7738A703E4D085030432EDC5E5EAF6BA060FE17AC628049671CF2E555272D5BBB863F2B2355110C8071C746AB4465F10A8BA9BB105DF755AF82B47F991B8EAC10146638623534A05FDDF100B2653A25F8B89594D2575699A6091A0201C2C54CDEEB7481EB8B355B9A9811B31BE2DE24C98B7</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 D0 C0 BC C9 32 87 65
|
|
|
|
|
0010 | 6C 00 00 00 34 F7 CB 3B 7E 79 38 C1 4A B7 30 24
|
|
|
|
|
0020 | C3 94 DB C0 E8 0A 6B 5D DD F3 95 25 25 82 2D BE
|
|
|
|
|
0030 | 37 BB F1 5E 0D C8 A8 60 04 F9 91 DD 4F 67 9B 4C
|
|
|
|
|
0040 | A2 E7 C7 3B 00 19 4D EC</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 10 34 FE 0A 4F 87 65
|
|
|
|
|
0010 | 94 00 00 00 34 F7 CB 3B A1 D0 50 58 4C B7 93 A7
|
|
|
|
|
0020 | 9A 25 1D C4 34 D9 E6 C6 69 FF A0 EA 0B C5 AC 08
|
|
|
|
|
0030 | F3 47 27 D8 7F 16 88 3C B8 12 43 C5 4D B8 F0 71
|
|
|
|
|
0040 | 95 87 E0 B9 73 A2 11 4D</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>01D0C0BCC9328765</code></td>
|
|
|
|
|
<td><code>011034FE0A4F8765</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>6C000000</code> (108 in decimal)</td>
|
|
|
|
|
<td><code>94000000</code> (148 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>7E7938C14AB73024C394DBC0E80A6B5D</code></td>
|
|
|
|
|
<td><code>A1D050584CB793A79A251DC434D9E6C6</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>DDF3952525822DBE37BBF15E0DC8A860</code></td>
|
|
|
|
|
<td><code>69FFA0EA0BC5AC08F34727D87F16883C</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>04F991DD4F679B4CA2E7C73B00194DEC</code></td>
|
|
|
|
|
<td><code>B81243C54DB8F0719587E0B973A2114D</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>
|
|
|
|
|