|
|
|
@ -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 38 40 0E 00 2A C5 96 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE F6 82 BC AE D6 6D 37 DF
|
|
|
|
|
0020 | C8 5F 2F 8E 45 5B 24 FA</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 A0 E6 0A 00 1A C6 96 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE D4 C3 9F 0A 0C E2 40 8D
|
|
|
|
|
0020 | 53 7C 91 DC 35 9D 63 20</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>38400E002AC59666</code></td>
|
|
|
|
|
<td><code>A0E60A001AC69666</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>F682BCAED66D37DFC85F2F8E455B24FA</code></td>
|
|
|
|
|
<td><code>D4C39F0A0CE2408D537C91DC359D6320</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 34 7B 42 2A C5 96 66
|
|
|
|
|
0010 | 68 00 00 00 63 24 16 05 F6 82 BC AE D6 6D 37 DF
|
|
|
|
|
0020 | C8 5F 2F 8E 45 5B 24 FA CC 5A 5E 98 8D E8 26 0B
|
|
|
|
|
0030 | 1E A7 A5 AE 5E 9B B4 B3 08 1D 9E 37 F0 DF 6A 8F
|
|
|
|
|
0040 | EB 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 9C 3E 33 1A C6 96 66
|
|
|
|
|
0010 | B0 00 00 00 63 24 16 05 D4 C3 9F 0A 0C E2 40 8D
|
|
|
|
|
0020 | 53 7C 91 DC 35 9D 63 20 18 3C C8 76 B0 24 21 5D
|
|
|
|
|
0030 | 4B 9F F4 29 66 91 0A 96 08 2B 91 A1 69 85 24 38
|
|
|
|
|
0040 | F7 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>01347B422AC59666</code></td>
|
|
|
|
|
<td><code>019C3E331AC69666</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>68000000</code> (104 in decimal)</td>
|
|
|
|
|
<td><code>B0000000</code> (176 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>F682BCAED66D37DFC85F2F8E455B24FA</code></td>
|
|
|
|
|
<td><code>D4C39F0A0CE2408D537C91DC359D6320</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>CC5A5E988DE8260B1EA7A5AE5E9BB4B3</code></td>
|
|
|
|
|
<td><code>183CC876B024215D4B9FF42966910A96</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>081D9E37F0DF6A8FEB000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2134204781100175339</td>
|
|
|
|
|
<td><code>082B91A169852438F7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 3139467889831327991</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 = 2134204781100175339</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2134204781100175339 = 1340884063 * 1591640053</code></p>
|
|
|
|
|
<pre><code>p = 1340884063
|
|
|
|
|
q = 1591640053</code></pre>
|
|
|
|
|
<pre><code>pq = 3139467889831327991</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>3139467889831327991 = 1701286669 * 1845349139</code></p>
|
|
|
|
|
<pre><code>p = 1701286669
|
|
|
|
|
q = 1845349139</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 1D 9E 37 F0 DF 6A 8F EB 00 00 00
|
|
|
|
|
0010 | 04 4F EC 44 5F 00 00 00 04 5E DE 7F F5 00 00 00
|
|
|
|
|
0020 | F6 82 BC AE D6 6D 37 DF C8 5F 2F 8E 45 5B 24 FA
|
|
|
|
|
0030 | CC 5A 5E 98 8D E8 26 0B 1E A7 A5 AE 5E 9B B4 B3
|
|
|
|
|
0040 | 99 16 8C 34 5E C4 A3 3A B7 7B 6E A9 5C 67 38 3A
|
|
|
|
|
0050 | 23 93 51 3E 1A 2F 88 AE 3E 60 1B 8B E5 5C DC 92
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 2B 91 A1 69 85 24 38 F7 00 00 00
|
|
|
|
|
0010 | 04 65 67 93 0D 00 00 00 04 6D FD CB 13 00 00 00
|
|
|
|
|
0020 | D4 C3 9F 0A 0C E2 40 8D 53 7C 91 DC 35 9D 63 20
|
|
|
|
|
0030 | 18 3C C8 76 B0 24 21 5D 4B 9F F4 29 66 91 0A 96
|
|
|
|
|
0040 | EA EC 6E 0F 35 9A 7D 85 A8 C2 E4 9E 62 26 45 46
|
|
|
|
|
0050 | 3F C5 65 5B A2 A5 C8 A6 1D 7E FA 7C 7D 92 3A 1B
|
|
|
|
|
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 = 1591640053</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>081D9E37F0DF6A8FEB000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2134204781100175339</td>
|
|
|
|
|
<td><code>082B91A169852438F7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 3139467889831327991</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>044FEC445F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1340884063</td>
|
|
|
|
|
<td><code>046567930D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1701286669</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>045EDE7FF5000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1591640053</td>
|
|
|
|
|
<td><code>046DFDCB13000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1845349139</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>F682BCAED66D37DFC85F2F8E455B24FA</code></td>
|
|
|
|
|
<td><code>D4C39F0A0CE2408D537C91DC359D6320</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>CC5A5E988DE8260B1EA7A5AE5E9BB4B3</code></td>
|
|
|
|
|
<td><code>183CC876B024215D4B9FF42966910A96</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>99168C345EC4A33AB77B6EA95C67383A</code> <code>2393513E1A2F88AE3E601B8BE55CDC92</code></td>
|
|
|
|
|
<td><code>EAEC6E0F359A7D85A8C2E49E62264546</code> <code>3FC5655BA2A5C8A61D7EFA7C7D923A1B</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1591640053</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 = 955FF5A9081D9E37F0DF6A8FEB000000044FEC445F000000045EDE7FF5000000F682BCAED66D37DFC85F2F8E455B24FACC5A5E988DE8260B1EA7A5AE5E9BB4B399168C345EC4A33AB77B6EA95C67383A2393513E1A2F88AE3E601B8BE55CDC9202000000
|
|
|
|
|
random_padding_bytes = E5D51A658C033CCAA5A839B15B0B0EDC8DB905F73705BA6F4806D7109215E8E7FA88A57D87F5878DD7067776A4DB55A3C777E10FCB253786CB802C1117999CEEE197AB2C9683A3D052381C0C71EA3BD5B924C8DA9DB94293C9F04D6A</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A9082B91A169852438F7000000046567930D000000046DFDCB13000000D4C39F0A0CE2408D537C91DC359D6320183CC876B024215D4B9FF42966910A96EAEC6E0F359A7D85A8C2E49E622645463FC5655BA2A5C8A61D7EFA7C7D923A1B02000000
|
|
|
|
|
random_padding_bytes = 28524709F59B991A34F3DB5C8CAB65EEA45C50C8306CFDC4CDD3636AEE797DE073ED07FBC36726BBBB70C31E413E8344357DD0933194F75FA7A4D19DE35E28A1526097F18C2D85BFC55C15AA810C898A623CC17CD1C7487A1DC5EB25</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 = B5812471C9574BC9BAB413AB97AC6438A672364E11910BD14F670B1D3A2AFB8081C6E49021E0E93E1A6EDA7B861475ADD9BB5D3974543CE20D350B3B3F61F1ED97A7AE79341DFBE3CD94FAD96D45025CEDEBC77EFD29FDB53F87527FDD3DBC666D374BC87D1F2CBF874BA59BF3D86C10B0D1004B18BE25A66DA078044A3101121C5A990388572C630C2ACC88265B0FCF993EC0F727A69D7A52060559ED233EF1BB1D6A48F9E85739A1320D6C3D6BAAF266CCE66797D3AF83BCD9BCBFC7AB721DC366F8312AB715FCFAAB0A5F024C1F9C638B52E153752056D8AB33D55DCBFF92C67EC6573F19CEB2D112DB5F434D34BF5FACA9F71BE139E29EAF7E5DDD998708</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 4B38FF50DA4D395306A59D8A3B60FCCE3DBF6A26CDD26C3E2CE17468D2C2A3F663C3C68D8B5DA5386E2D65F9CC68763B95EC91186CA7EB55FD9D76A3C5896A411C2AF646377D4909D2F651EEBE970ADD15F72BA4BD471AD64D65A12A589332676741103F0BA68529C38CAEA17D710529B486EEEECEEE6AD06D2C9BF477553B987A06D17B73BAB5254E9EE037FBFEB622D9E323466DED1811DFE02088ACAF91EAB8A5DF7B485C4E135BD596E267402DA32A0F2EDF7A1D146922068F1ED68810ED5F4983354A204A1E38C4F70EAD52B28C05BA11DF6E925D66E15CAEF18E38E9C9739C135BE8B4300601ABAE2E8BC9115B9F1F03FD173524C8CE0DC4A9ECEB6144</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 3C 40 0E 00 2A C5 96 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 F6 82 BC AE D6 6D 37 DF
|
|
|
|
|
0020 | C8 5F 2F 8E 45 5B 24 FA CC 5A 5E 98 8D E8 26 0B
|
|
|
|
|
0030 | 1E A7 A5 AE 5E 9B B4 B3 04 4F EC 44 5F 00 00 00
|
|
|
|
|
0040 | 04 5E DE 7F F5 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 B5 81 24 71 C9 57 4B C9 BA B4 13 AB
|
|
|
|
|
0060 | 97 AC 64 38 A6 72 36 4E 11 91 0B D1 4F 67 0B 1D
|
|
|
|
|
0070 | 3A 2A FB 80 81 C6 E4 90 21 E0 E9 3E 1A 6E DA 7B
|
|
|
|
|
0080 | 86 14 75 AD D9 BB 5D 39 74 54 3C E2 0D 35 0B 3B
|
|
|
|
|
0090 | 3F 61 F1 ED 97 A7 AE 79 34 1D FB E3 CD 94 FA D9
|
|
|
|
|
00A0 | 6D 45 02 5C ED EB C7 7E FD 29 FD B5 3F 87 52 7F
|
|
|
|
|
00B0 | DD 3D BC 66 6D 37 4B C8 7D 1F 2C BF 87 4B A5 9B
|
|
|
|
|
00C0 | F3 D8 6C 10 B0 D1 00 4B 18 BE 25 A6 6D A0 78 04
|
|
|
|
|
00D0 | 4A 31 01 12 1C 5A 99 03 88 57 2C 63 0C 2A CC 88
|
|
|
|
|
00E0 | 26 5B 0F CF 99 3E C0 F7 27 A6 9D 7A 52 06 05 59
|
|
|
|
|
00F0 | ED 23 3E F1 BB 1D 6A 48 F9 E8 57 39 A1 32 0D 6C
|
|
|
|
|
0100 | 3D 6B AA F2 66 CC E6 67 97 D3 AF 83 BC D9 BC BF
|
|
|
|
|
0110 | C7 AB 72 1D C3 66 F8 31 2A B7 15 FC FA AB 0A 5F
|
|
|
|
|
0120 | 02 4C 1F 9C 63 8B 52 E1 53 75 20 56 D8 AB 33 D5
|
|
|
|
|
0130 | 5D CB FF 92 C6 7E C6 57 3F 19 CE B2 D1 12 DB 5F
|
|
|
|
|
0140 | 43 4D 34 BF 5F AC A9 F7 1B E1 39 E2 9E AF 7E 5D
|
|
|
|
|
0150 | DD 99 87 08</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 80 CD 0D 00 1A C6 96 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 D4 C3 9F 0A 0C E2 40 8D
|
|
|
|
|
0020 | 53 7C 91 DC 35 9D 63 20 18 3C C8 76 B0 24 21 5D
|
|
|
|
|
0030 | 4B 9F F4 29 66 91 0A 96 04 65 67 93 0D 00 00 00
|
|
|
|
|
0040 | 04 6D FD CB 13 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 4B 38 FF 50 DA 4D 39 53 06 A5 9D 8A
|
|
|
|
|
0060 | 3B 60 FC CE 3D BF 6A 26 CD D2 6C 3E 2C E1 74 68
|
|
|
|
|
0070 | D2 C2 A3 F6 63 C3 C6 8D 8B 5D A5 38 6E 2D 65 F9
|
|
|
|
|
0080 | CC 68 76 3B 95 EC 91 18 6C A7 EB 55 FD 9D 76 A3
|
|
|
|
|
0090 | C5 89 6A 41 1C 2A F6 46 37 7D 49 09 D2 F6 51 EE
|
|
|
|
|
00A0 | BE 97 0A DD 15 F7 2B A4 BD 47 1A D6 4D 65 A1 2A
|
|
|
|
|
00B0 | 58 93 32 67 67 41 10 3F 0B A6 85 29 C3 8C AE A1
|
|
|
|
|
00C0 | 7D 71 05 29 B4 86 EE EE CE EE 6A D0 6D 2C 9B F4
|
|
|
|
|
00D0 | 77 55 3B 98 7A 06 D1 7B 73 BA B5 25 4E 9E E0 37
|
|
|
|
|
00E0 | FB FE B6 22 D9 E3 23 46 6D ED 18 11 DF E0 20 88
|
|
|
|
|
00F0 | AC AF 91 EA B8 A5 DF 7B 48 5C 4E 13 5B D5 96 E2
|
|
|
|
|
0100 | 67 40 2D A3 2A 0F 2E DF 7A 1D 14 69 22 06 8F 1E
|
|
|
|
|
0110 | D6 88 10 ED 5F 49 83 35 4A 20 4A 1E 38 C4 F7 0E
|
|
|
|
|
0120 | AD 52 B2 8C 05 BA 11 DF 6E 92 5D 66 E1 5C AE F1
|
|
|
|
|
0130 | 8E 38 E9 C9 73 9C 13 5B E8 B4 30 06 01 AB AE 2E
|
|
|
|
|
0140 | 8B C9 11 5B 9F 1F 03 FD 17 35 24 C8 CE 0D C4 A9
|
|
|
|
|
0150 | EC EB 61 44</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 = E5D51A658C033CCAA5A839B15B0B0EDC8DB905F73705BA6F4806D7109
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>3C400E002AC59666</code></td>
|
|
|
|
|
<td><code>80CD0D001AC69666</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 = E5D51A658C033CCAA5A839B15B0B0EDC8DB905F73705BA6F4806D7109
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>F682BCAED66D37DFC85F2F8E455B24FA</code></td>
|
|
|
|
|
<td><code>D4C39F0A0CE2408D537C91DC359D6320</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>CC5A5E988DE8260B1EA7A5AE5E9BB4B3</code></td>
|
|
|
|
|
<td><code>183CC876B024215D4B9FF42966910A96</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>044FEC445F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1340884063</td>
|
|
|
|
|
<td><code>046567930D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1701286669</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>045EDE7FF5000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1591640053</td>
|
|
|
|
|
<td><code>046DFDCB13000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1845349139</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 = E5D51A658C033CCAA5A839B15B0B0EDC8DB905F73705BA6F4806D7109
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE000100B5812471C9574BC9BAB413AB</code> <code>97AC6438A672364E11910BD14F670B1D</code> <code>3A2AFB8081C6E49021E0E93E1A6EDA7B</code> <code>861475ADD9BB5D3974543CE20D350B3B</code> <code>3F61F1ED97A7AE79341DFBE3CD94FAD9</code> <code>6D45025CEDEBC77EFD29FDB53F87527F</code> <code>DD3DBC666D374BC87D1F2CBF874BA59B</code> <code>F3D86C10B0D1004B18BE25A66DA07804</code> <code>4A3101121C5A990388572C630C2ACC88</code> <code>265B0FCF993EC0F727A69D7A52060559</code> <code>ED233EF1BB1D6A48F9E85739A1320D6C</code> <code>3D6BAAF266CCE66797D3AF83BCD9BCBF</code> <code>C7AB721DC366F8312AB715FCFAAB0A5F</code> <code>024C1F9C638B52E153752056D8AB33D5</code> <code>5DCBFF92C67EC6573F19CEB2D112DB5F</code> <code>434D34BF5FACA9F71BE139E29EAF7E5D</code><br> <code>DD998708</code></td>
|
|
|
|
|
<td><code>FE0001004B38FF50DA4D395306A59D8A</code> <code>3B60FCCE3DBF6A26CDD26C3E2CE17468</code> <code>D2C2A3F663C3C68D8B5DA5386E2D65F9</code> <code>CC68763B95EC91186CA7EB55FD9D76A3</code> <code>C5896A411C2AF646377D4909D2F651EE</code> <code>BE970ADD15F72BA4BD471AD64D65A12A</code> <code>589332676741103F0BA68529C38CAEA1</code> <code>7D710529B486EEEECEEE6AD06D2C9BF4</code> <code>77553B987A06D17B73BAB5254E9EE037</code> <code>FBFEB622D9E323466DED1811DFE02088</code> <code>ACAF91EAB8A5DF7B485C4E135BD596E2</code> <code>67402DA32A0F2EDF7A1D146922068F1E</code> <code>D68810ED5F4983354A204A1E38C4F70E</code> <code>AD52B28C05BA11DF6E925D66E15CAEF1</code> <code>8E38E9C9739C135BE8B4300601ABAE2E</code> <code>8BC9115B9F1F03FD173524C8CE0DC4A9</code><br> <code>ECEB6144</code></td>
|
|
|
|
|
<td>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = E5D51A658C033CCAA5A839B15B0B0EDC8DB905F73705BA6F4806D7109
|
|
|
|
|
<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 C4 71 EA 2A C5 96 66
|
|
|
|
|
0010 | BC 02 00 00 5C 07 E8 D0 F6 82 BC AE D6 6D 37 DF
|
|
|
|
|
0020 | C8 5F 2F 8E 45 5B 24 FA CC 5A 5E 98 8D E8 26 0B
|
|
|
|
|
0030 | 1E A7 A5 AE 5E 9B B4 B3 FE 50 02 00 EA 91 BA B4
|
|
|
|
|
0040 | 2D DB DC B7 F3 8A 54 07 E8 08 9A B7 69 24 96 41
|
|
|
|
|
0050 | 66 29 3E 01 78 3A 6A E2 83 DB B9 F6 49 90 23 DB
|
|
|
|
|
0060 | 08 0D CC 48 8B 26 2C 15 43 05 BE EF 68 7F 1B C7
|
|
|
|
|
0070 | 6F 4F F9 E9 98 F1 00 B8 51 B0 4C E2 84 C8 9B 3A
|
|
|
|
|
0080 | C4 21 2E 2C 49 97 44 80 95 0D FD 29 E7 DD 8A E0
|
|
|
|
|
0090 | E6 3F EF 77 93 AB 43 AB E6 1F 4F 52 B8 04 08 94
|
|
|
|
|
00A0 | 59 79 DB 30 A5 ED CB 1F 1C 6E DC 8C 68 7A 70 AD
|
|
|
|
|
00B0 | 6D 64 C9 52 74 F4 DB 8B C6 FA AE 3D A2 FB 56 C4
|
|
|
|
|
00C0 | B5 EF AA C7 9E FA DE 6E 15 BF EA 95 55 B3 D0 BD
|
|
|
|
|
00D0 | 9F 52 8D 7B 8C C3 06 7D FB AE 52 06 FE B9 60 17
|
|
|
|
|
00E0 | E1 D7 15 F5 86 D4 87 F7 0D 11 4A 49 C2 0A 9F E4
|
|
|
|
|
00F0 | 02 BA 86 D6 72 00 D1 4B E9 D4 EA BB 96 91 66 DF
|
|
|
|
|
0100 | 71 9F 50 4D 69 F6 65 F8 F7 09 60 35 ED 02 94 7B
|
|
|
|
|
0110 | DC C0 B1 EC C9 BC EE A4 C5 67 A0 DC DB 69 AE E3
|
|
|
|
|
0120 | FC EB 51 64 75 F3 3D 1E AE 91 99 C7 81 01 4F DA
|
|
|
|
|
0130 | E6 85 6E FE B2 60 6D 88 BA 04 FA CA 8E 61 73 6A
|
|
|
|
|
0140 | 20 FA B6 A8 2C F8 48 18 6F 0C 4D FB CB BE 34 15
|
|
|
|
|
0150 | E8 71 B8 F1 64 4E E3 F6 DA A8 C5 FE 8B 73 B5 E9
|
|
|
|
|
0160 | C0 13 3D 92 8C 77 92 96 26 0E 14 2C BE 19 0A AC
|
|
|
|
|
0170 | 0C 7E F1 40 57 31 A6 EE CB C7 3C 80 9F 14 5C 19
|
|
|
|
|
0180 | DE 4A C0 E7 D8 40 3E C3 CE 4B CE 61 CF 2D D6 42
|
|
|
|
|
0190 | E5 F9 4E FA 29 2B 34 A9 39 22 82 8A 01 F9 97 7A
|
|
|
|
|
01A0 | EE 87 02 12 0A 44 55 9C E9 F5 2C 9A 10 16 97 0F
|
|
|
|
|
01B0 | F6 BF 81 83 15 43 84 55 07 EC 6F 3C DE E4 BA 9B
|
|
|
|
|
01C0 | 9F 0F 06 E9 D8 F7 53 3E 73 4B 65 1C 45 7D EE 79
|
|
|
|
|
01D0 | 82 B7 A7 9C 2F 12 9D 9E FC C1 75 7F CA 1D 68 27
|
|
|
|
|
01E0 | B1 6E 57 CE 95 BE DA 98 20 07 AE B5 60 A4 EC AA
|
|
|
|
|
01F0 | 42 FC B0 5F E7 7B 6E 0A B2 59 56 50 C2 87 59 F2
|
|
|
|
|
0200 | A3 AE 04 8F 42 13 8B DF D9 D2 45 33 D3 01 55 1E
|
|
|
|
|
0210 | 14 FF CB B1 C3 D5 E9 00 C0 53 21 81 0C 07 F1 AD
|
|
|
|
|
0220 | C8 92 72 FF 53 F1 E1 F7 70 EE 5E EC F7 AC 32 C2
|
|
|
|
|
0230 | 67 A4 C2 37 20 D9 64 FD 37 5B 25 31 BF 58 FD 22
|
|
|
|
|
0240 | DD 2E 8D 81 A6 29 91 E8 AF 83 15 71 71 04 EC 68
|
|
|
|
|
0250 | 8F AD 52 9D C7 FF A0 3C 8C C5 72 B9 BE 48 1A 90
|
|
|
|
|
0260 | FA 7B C0 0D F7 09 2E E7 E3 59 4E A6 3F 9A B7 97
|
|
|
|
|
0270 | 97 8D 09 03 5F 00 92 A1 0F EC B2 DF 97 13 C2 39
|
|
|
|
|
0280 | 2E 02 0D BA 6E 66 89 37 BC 66 40 FF</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 24 6F F8 1A C6 96 66
|
|
|
|
|
0010 | 8C 02 00 00 5C 07 E8 D0 D4 C3 9F 0A 0C E2 40 8D
|
|
|
|
|
0020 | 53 7C 91 DC 35 9D 63 20 18 3C C8 76 B0 24 21 5D
|
|
|
|
|
0030 | 4B 9F F4 29 66 91 0A 96 FE 50 02 00 0E 34 09 E7
|
|
|
|
|
0040 | 8B E3 D8 C2 48 AA 68 AF 02 C3 28 EA 93 C9 31 D5
|
|
|
|
|
0050 | 51 51 F0 54 5A 5E 21 CF D0 17 83 F5 95 51 61 91
|
|
|
|
|
0060 | B1 27 44 F9 49 D9 26 F2 7C 06 47 5D 55 16 4D 62
|
|
|
|
|
0070 | 4C 93 F4 24 63 83 9A E4 EC BA 31 77 AB B1 87 31
|
|
|
|
|
0080 | E8 B7 79 01 7C F0 26 6B 04 26 38 3C 6F 6B 5E 4F
|
|
|
|
|
0090 | 8C 8F D2 9A F9 16 08 79 25 6F CC 20 C8 39 A4 62
|
|
|
|
|
00A0 | 63 8B 28 6C 65 20 4D 48 AA 84 84 E3 8F 9E E3 46
|
|
|
|
|
00B0 | 9D 63 19 AA 44 D0 2C 76 B8 BE 02 FA 26 CC 76 5E
|
|
|
|
|
00C0 | BA 86 E5 EE 55 F8 07 28 4F 9E AE DA E0 99 CE 15
|
|
|
|
|
00D0 | D1 CD 73 7F 31 8B 44 F1 B3 22 D9 7B 38 66 34 F9
|
|
|
|
|
00E0 | 79 D4 76 EE 6A D2 49 EA C7 A2 03 F9 08 8B 90 B0
|
|
|
|
|
00F0 | 23 5B A4 7B 11 EC 7D DD 71 F5 45 93 44 0B A7 A3
|
|
|
|
|
0100 | 36 AB 39 FC EC F6 0C D4 CE 5E 04 82 7A 80 CA C2
|
|
|
|
|
0110 | E4 79 15 39 93 E6 06 58 6D 8D BD 94 2D 54 70 0D
|
|
|
|
|
0120 | 4A 0B B0 F6 15 C2 C3 1A D2 02 29 12 4D 31 43 9B
|
|
|
|
|
0130 | 5E 5D 7E 43 09 78 71 80 56 F4 A0 3C 02 D1 94 C3
|
|
|
|
|
0140 | 10 49 19 FD 98 DE 07 5B 67 17 1A C7 E3 65 C4 2E
|
|
|
|
|
0150 | 05 0C 92 D0 F0 18 1C 93 B1 CA 3F 31 DC D6 AF 8B
|
|
|
|
|
0160 | C7 4D 18 53 0D 19 98 93 B5 96 F6 F8 59 37 1C 3B
|
|
|
|
|
0170 | 4A F4 4D 22 67 72 C6 12 27 0D 9E 39 AB AA 50 7A
|
|
|
|
|
0180 | F5 C7 ED 46 3A CD 44 C9 15 7D 7E 2E 93 C0 EA D9
|
|
|
|
|
0190 | B0 97 97 7F 37 BC BD 42 10 37 03 47 3A 5E 83 68
|
|
|
|
|
01A0 | 5A FE F6 6B 83 E3 C0 0B 9C 85 A9 BC C0 47 41 1F
|
|
|
|
|
01B0 | EB 12 BB B0 8A B7 20 D0 71 E9 A1 8A 91 5F 9C B2
|
|
|
|
|
01C0 | 6A AF 91 3A BB B6 74 63 6C 40 D0 D3 8E EC 4A 52
|
|
|
|
|
01D0 | D7 07 DE 7C AA 7D F6 2E 02 A3 02 34 08 DF 9D E7
|
|
|
|
|
01E0 | 07 B8 BF BA DC 08 EE 8C F8 73 71 09 2A 06 C4 8A
|
|
|
|
|
01F0 | 74 FC 01 B4 9D 10 F8 E2 41 C1 D6 52 B8 3C 60 4D
|
|
|
|
|
0200 | C3 49 01 AA D7 CA 52 3B 34 FE 08 1D C3 E6 80 BB
|
|
|
|
|
0210 | 19 B0 AB 01 E4 00 60 CB 4F 57 24 5A 45 C4 AC 8A
|
|
|
|
|
0220 | 49 25 46 50 76 B8 37 04 DD 8D 0C 97 1E A9 77 87
|
|
|
|
|
0230 | 8C 73 B4 06 50 28 4D A3 7B 2E BA F3 24 D5 FD 94
|
|
|
|
|
0240 | C8 AE 8A 7D 24 14 DD 53 CF 24 E3 99 56 91 22 8C
|
|
|
|
|
0250 | 4F 64 D6 46 DF 2B 81 C0 B8 57 7E 58 FB BE 83 A5
|
|
|
|
|
0260 | DC C0 71 0D DD D8 A6 D2 8C 3E 31 7E 6A 36 52 F4
|
|
|
|
|
0270 | D5 60 CD 7F 11 8B 1C B1 CA D4 8E 05 B9 C5 2B 41
|
|
|
|
|
0280 | 17 16 47 E6 19 85 EB 46 0C 0D FB 13</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 = E5D51A658C033CCAA5A839B15B0B0EDC8DB905F73705BA6F4806D7109
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>01C471EA2AC59666</code></td>
|
|
|
|
|
<td><code>01246FF81AC69666</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>8C020000</code> (652 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -482,19 +482,19 @@ random_padding_bytes = E5D51A658C033CCAA5A839B15B0B0EDC8DB905F73705BA6F4806D7109
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>F682BCAED66D37DFC85F2F8E455B24FA</code></td>
|
|
|
|
|
<td><code>D4C39F0A0CE2408D537C91DC359D6320</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>CC5A5E988DE8260B1EA7A5AE5E9BB4B3</code></td>
|
|
|
|
|
<td><code>183CC876B024215D4B9FF42966910A96</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE500200EA91BAB42DDBDCB7F38A5407</code> <code>E8089AB76924964166293E01783A6AE2</code> <code>83DBB9F6499023DB080DCC488B262C15</code> <code>4305BEEF687F1BC76F4FF9E998F100B8</code> <code>51B04CE284C89B3AC4212E2C49974480</code> <code>950DFD29E7DD8AE0E63FEF7793AB43AB</code> <code>E61F4F52B80408945979DB30A5EDCB1F</code> <code>1C6EDC8C687A70AD6D64C95274F4DB8B</code> <code>C6FAAE3DA2FB56C4B5EFAAC79EFADE6E</code> <code>15BFEA9555B3D0BD9F528D7B8CC3067D</code> <code>FBAE5206FEB96017E1D715F586D487F7</code> <code>0D114A49C20A9FE402BA86D67200D14B</code> <code>E9D4EABB969166DF719F504D69F665F8</code> <code>F7096035ED02947BDCC0B1ECC9BCEEA4</code> <code>C567A0DCDB69AEE3FCEB516475F33D1E</code> <code>AE9199C781014FDAE6856EFEB2606D88</code> <code>BA04FACA8E61736A20FAB6A82CF84818</code> <code>6F0C4DFBCBBE3415E871B8F1644EE3F6</code> <code>DAA8C5FE8B73B5E9C0133D928C779296</code> <code>260E142CBE190AAC0C7EF1405731A6EE</code> <code>CBC73C809F145C19DE4AC0E7D8403EC3</code> <code>CE4BCE61CF2DD642E5F94EFA292B34A9</code> <code>3922828A01F9977AEE8702120A44559C</code> <code>E9F52C9A1016970FF6BF818315438455</code> <code>07EC6F3CDEE4BA9B9F0F06E9D8F7533E</code> <code>734B651C457DEE7982B7A79C2F129D9E</code> <code>FCC1757FCA1D6827B16E57CE95BEDA98</code> <code>2007AEB560A4ECAA42FCB05FE77B6E0A</code> <code>B2595650C28759F2A3AE048F42138BDF</code> <code>D9D24533D301551E14FFCBB1C3D5E900</code> <code>C05321810C07F1ADC89272FF53F1E1F7</code> <code>70EE5EECF7AC32C267A4C23720D964FD</code> <code>375B2531BF58FD22DD2E8D81A62991E8</code> <code>AF8315717104EC688FAD529DC7FFA03C</code> <code>8CC572B9BE481A90FA7BC00DF7092EE7</code> <code>E3594EA63F9AB797978D09035F0092A1</code> <code>0FECB2DF9713C2392E020DBA6E668937</code><br> <code>BC6640FF</code></td>
|
|
|
|
|
<td><code>FE5002000E3409E78BE3D8C248AA68AF</code> <code>02C328EA93C931D55151F0545A5E21CF</code> <code>D01783F595516191B12744F949D926F2</code> <code>7C06475D55164D624C93F42463839AE4</code> <code>ECBA3177ABB18731E8B779017CF0266B</code> <code>0426383C6F6B5E4F8C8FD29AF9160879</code> <code>256FCC20C839A462638B286C65204D48</code> <code>AA8484E38F9EE3469D6319AA44D02C76</code> <code>B8BE02FA26CC765EBA86E5EE55F80728</code> <code>4F9EAEDAE099CE15D1CD737F318B44F1</code> <code>B322D97B386634F979D476EE6AD249EA</code> <code>C7A203F9088B90B0235BA47B11EC7DDD</code> <code>71F54593440BA7A336AB39FCECF60CD4</code> <code>CE5E04827A80CAC2E479153993E60658</code> <code>6D8DBD942D54700D4A0BB0F615C2C31A</code> <code>D20229124D31439B5E5D7E4309787180</code> <code>56F4A03C02D194C3104919FD98DE075B</code> <code>67171AC7E365C42E050C92D0F0181C93</code> <code>B1CA3F31DCD6AF8BC74D18530D199893</code> <code>B596F6F859371C3B4AF44D226772C612</code> <code>270D9E39ABAA507AF5C7ED463ACD44C9</code> <code>157D7E2E93C0EAD9B097977F37BCBD42</code> <code>103703473A5E83685AFEF66B83E3C00B</code> <code>9C85A9BCC047411FEB12BBB08AB720D0</code> <code>71E9A18A915F9CB26AAF913ABBB67463</code> <code>6C40D0D38EEC4A52D707DE7CAA7DF62E</code> <code>02A3023408DF9DE707B8BFBADC08EE8C</code> <code>F87371092A06C48A74FC01B49D10F8E2</code> <code>41C1D652B83C604DC34901AAD7CA523B</code> <code>34FE081DC3E680BB19B0AB01E40060CB</code> <code>4F57245A45C4AC8A4925465076B83704</code> <code>DD8D0C971EA977878C73B40650284DA3</code> <code>7B2EBAF324D5FD94C8AE8A7D2414DD53</code> <code>CF24E3995691228C4F64D646DF2B81C0</code> <code>B8577E58FBBE83A5DCC0710DDDD8A6D2</code> <code>8C3E317E6A3652F4D560CD7F118B1CB1</code> <code>CAD48E05B9C52B41171647E61985EB46</code><br> <code>0C0DFB13</code></td>
|
|
|
|
|
<td>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = E5D51A658C033CCAA5A839B15B0B0EDC8DB905F73705BA6F4806D7109
|
|
|
|
|
<!-- 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 = EA91BAB42DDBDCB7F38A5407E8089AB76924964166293E01783A6AE283DBB9F6499023DB080DCC488B262C154305BEEF687F1BC76F4FF9E998F100B851B04CE284C89B3AC4212E2C49974480950DFD29E7DD8AE0E63FEF7793AB43ABE61F4F52B80408945979DB30A5EDCB1F1C6EDC8C687A70AD6D64C95274F4DB8BC6FAAE3DA2FB56C4B5EFAAC79EFADE6E15BFEA9555B3D0BD9F528D7B8CC3067DFBAE5206FEB96017E1D715F586D487F70D114A49C20A9FE402BA86D67200D14BE9D4EABB969166DF719F504D69F665F8F7096035ED02947BDCC0B1ECC9BCEEA4C567A0DCDB69AEE3FCEB516475F33D1EAE9199C781014FDAE6856EFEB2606D88BA04FACA8E61736A20FAB6A82CF848186F0C4DFBCBBE3415E871B8F1644EE3F6DAA8C5FE8B73B5E9C0133D928C779296260E142CBE190AAC0C7EF1405731A6EECBC73C809F145C19DE4AC0E7D8403EC3CE4BCE61CF2DD642E5F94EFA292B34A93922828A01F9977AEE8702120A44559CE9F52C9A1016970FF6BF81831543845507EC6F3CDEE4BA9B9F0F06E9D8F7533E734B651C457DEE7982B7A79C2F129D9EFCC1757FCA1D6827B16E57CE95BEDA982007AEB560A4ECAA42FCB05FE77B6E0AB2595650C28759F2A3AE048F42138BDFD9D24533D301551E14FFCBB1C3D5E900C05321810C07F1ADC89272FF53F1E1F770EE5EECF7AC32C267A4C23720D964FD375B2531BF58FD22DD2E8D81A62991E8AF8315717104EC688FAD529DC7FFA03C8CC572B9BE481A90FA7BC00DF7092EE7E3594EA63F9AB797978D09035F0092A10FECB2DF9713C2392E020DBA6E668937BC6640FF
|
|
|
|
|
tmp_aes_key = 192D215E748F95FD73801788B85F590E7C148D32D273A665210540C00EEA2526
|
|
|
|
|
tmp_aes_iv = A16A3B38A557F03F6FD1E8EB5B40800EA012A1678A005E1D32D2C74D99168C34</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = 0E3409E78BE3D8C248AA68AF02C328EA93C931D55151F0545A5E21CFD01783F595516191B12744F949D926F27C06475D55164D624C93F42463839AE4ECBA3177ABB18731E8B779017CF0266B0426383C6F6B5E4F8C8FD29AF9160879256FCC20C839A462638B286C65204D48AA8484E38F9EE3469D6319AA44D02C76B8BE02FA26CC765EBA86E5EE55F807284F9EAEDAE099CE15D1CD737F318B44F1B322D97B386634F979D476EE6AD249EAC7A203F9088B90B0235BA47B11EC7DDD71F54593440BA7A336AB39FCECF60CD4CE5E04827A80CAC2E479153993E606586D8DBD942D54700D4A0BB0F615C2C31AD20229124D31439B5E5D7E430978718056F4A03C02D194C3104919FD98DE075B67171AC7E365C42E050C92D0F0181C93B1CA3F31DCD6AF8BC74D18530D199893B596F6F859371C3B4AF44D226772C612270D9E39ABAA507AF5C7ED463ACD44C9157D7E2E93C0EAD9B097977F37BCBD42103703473A5E83685AFEF66B83E3C00B9C85A9BCC047411FEB12BBB08AB720D071E9A18A915F9CB26AAF913ABBB674636C40D0D38EEC4A52D707DE7CAA7DF62E02A3023408DF9DE707B8BFBADC08EE8CF87371092A06C48A74FC01B49D10F8E241C1D652B83C604DC34901AAD7CA523B34FE081DC3E680BB19B0AB01E40060CB4F57245A45C4AC8A4925465076B83704DD8D0C971EA977878C73B40650284DA37B2EBAF324D5FD94C8AE8A7D2414DD53CF24E3995691228C4F64D646DF2B81C0B8577E58FBBE83A5DCC0710DDDD8A6D28C3E317E6A3652F4D560CD7F118B1CB1CAD48E05B9C52B41171647E61985EB460C0DFB13
|
|
|
|
|
tmp_aes_key = 669395D66EE9A717398173BA8A55287C6503F4AF4D43DF48D39E9FD0CD07E914
|
|
|
|
|
tmp_aes_iv = 70991BA30BC241AD98B9D948961E747E214FB81262811620640D2FE8EAEC6E0F</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = 670189FD50F3D59A5EC941A4EAD342811AC6A09ABA0D89B5F682BCAED66D37DFC85F2F8E455B24FACC5A5E988DE8260B1EA7A5AE5E9BB4B303000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001007DEDF675D8B9D3A24D8100C528996BCE6CD61277BBAFC15F45C1A82E386AC197316701B9659F1E4097EDFB571A5D8FEEEEFFE26F63C68B5B00CD6F7522C6AA54BF96EAA9E6A7B4C190C81E058120C18547A8FA939DE594A50F3A1C4A24BD324607878FBB41C756AF0FB5F725236B9E2497662C94D9EABE63F92B28877CFAAB1636581B61344E2B979A4427FF809BE3DE60A7A0CB49A8AB5BD9B9319F4EC55557F7A58F0197D51B921F88842C873E786745AD16AC44B0FF7C34887E5A662BA8442AE988F111F5DFE79183182A92050151D9FE39523BA8C84EF98E26B0B6B4EB1553CD85C4112A29AFD0471D13F13434D2A1E7752B6E4BFE3E36EC9FDB78D36F162AC596669F9468246618AB15
|
|
|
|
|
answer = BA0D89B5F682BCAED66D37DFC85F2F8E455B24FACC5A5E988DE8260B1EA7A5AE5E9BB4B303000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001007DEDF675D8B9D3A24D8100C528996BCE6CD61277BBAFC15F45C1A82E386AC197316701B9659F1E4097EDFB571A5D8FEEEEFFE26F63C68B5B00CD6F7522C6AA54BF96EAA9E6A7B4C190C81E058120C18547A8FA939DE594A50F3A1C4A24BD324607878FBB41C756AF0FB5F725236B9E2497662C94D9EABE63F92B28877CFAAB1636581B61344E2B979A4427FF809BE3DE60A7A0CB49A8AB5BD9B9319F4EC55557F7A58F0197D51B921F88842C873E786745AD16AC44B0FF7C34887E5A662BA8442AE988F111F5DFE79183182A92050151D9FE39523BA8C84EF98E26B0B6B4EB1553CD85C4112A29AFD0471D13F13434D2A1E7752B6E4BFE3E36EC9FDB78D36F162AC596669F9468246618AB15</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = B2EF299D3C22059967EA491E42A19A0751B0AE43BA0D89B5D4C39F0A0CE2408D537C91DC359D6320183CC876B024215D4B9FF42966910A9603000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001004EF8630BECB9D22E81C42CAE129FA54458A37EC29BADB42E35114DA6E36A03B05BF11A930C604A2519223BA1580E550821E1E7F77563415E49EF8577FAC89C7821100496DC739FA6EE7B2486B1C80DA38E0038FE0B646EFDC49830F3C933406B6B47C06415C2A57222A89C3CC66C2A0EA763C4B97221782EEEB6E80EA341735F948E96DA22B00D13994819686B2975D20E56B7CBD0B7F2C5420103CDE77CEA4AF9597B7EDCB9C3BD4EC87480A4B123A9BC0B146CB280D66715060B52171CFB7F7E3CABF43D28758395C71C13D7C18E74BD5533BB1F354383592F8B6C4579F7170A5C6FA3DE4E52422DF6A3430D1B4FAAB0B2295CC911BE568FB0CAC7F2E2991C1AC69666BBA14826842A81F6
|
|
|
|
|
answer = BA0D89B5D4C39F0A0CE2408D537C91DC359D6320183CC876B024215D4B9FF42966910A9603000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001004EF8630BECB9D22E81C42CAE129FA54458A37EC29BADB42E35114DA6E36A03B05BF11A930C604A2519223BA1580E550821E1E7F77563415E49EF8577FAC89C7821100496DC739FA6EE7B2486B1C80DA38E0038FE0B646EFDC49830F3C933406B6B47C06415C2A57222A89C3CC66C2A0EA763C4B97221782EEEB6E80EA341735F948E96DA22B00D13994819686B2975D20E56B7CBD0B7F2C5420103CDE77CEA4AF9597B7EDCB9C3BD4EC87480A4B123A9BC0B146CB280D66715060B52171CFB7F7E3CABF43D28758395C71C13D7C18E74BD5533BB1F354383592F8B6C4579F7170A5C6FA3DE4E52422DF6A3430D1B4FAAB0B2295CC911BE568FB0CAC7F2E2991C1AC69666BBA14826842A81F6</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 F6 82 BC AE D6 6D 37 DF C8 5F 2F 8E
|
|
|
|
|
0010 | 45 5B 24 FA CC 5A 5E 98 8D E8 26 0B 1E A7 A5 AE
|
|
|
|
|
0020 | 5E 9B B4 B3 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 D4 C3 9F 0A 0C E2 40 8D 53 7C 91 DC
|
|
|
|
|
0010 | 35 9D 63 20 18 3C C8 76 B0 24 21 5D 4B 9F F4 29
|
|
|
|
|
0020 | 66 91 0A 96 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 = BA0D89B5F682BCAED66D37DFC85F2F8E455B24FACC5A5E988DE8260B1EA7A5AE5E9BB4B
|
|
|
|
|
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 | 7D ED F6 75 D8 B9 D3 A2 4D 81 00 C5 28 99 6B CE
|
|
|
|
|
0140 | 6C D6 12 77 BB AF C1 5F 45 C1 A8 2E 38 6A C1 97
|
|
|
|
|
0150 | 31 67 01 B9 65 9F 1E 40 97 ED FB 57 1A 5D 8F EE
|
|
|
|
|
0160 | EE FF E2 6F 63 C6 8B 5B 00 CD 6F 75 22 C6 AA 54
|
|
|
|
|
0170 | BF 96 EA A9 E6 A7 B4 C1 90 C8 1E 05 81 20 C1 85
|
|
|
|
|
0180 | 47 A8 FA 93 9D E5 94 A5 0F 3A 1C 4A 24 BD 32 46
|
|
|
|
|
0190 | 07 87 8F BB 41 C7 56 AF 0F B5 F7 25 23 6B 9E 24
|
|
|
|
|
01A0 | 97 66 2C 94 D9 EA BE 63 F9 2B 28 87 7C FA AB 16
|
|
|
|
|
01B0 | 36 58 1B 61 34 4E 2B 97 9A 44 27 FF 80 9B E3 DE
|
|
|
|
|
01C0 | 60 A7 A0 CB 49 A8 AB 5B D9 B9 31 9F 4E C5 55 57
|
|
|
|
|
01D0 | F7 A5 8F 01 97 D5 1B 92 1F 88 84 2C 87 3E 78 67
|
|
|
|
|
01E0 | 45 AD 16 AC 44 B0 FF 7C 34 88 7E 5A 66 2B A8 44
|
|
|
|
|
01F0 | 2A E9 88 F1 11 F5 DF E7 91 83 18 2A 92 05 01 51
|
|
|
|
|
0200 | D9 FE 39 52 3B A8 C8 4E F9 8E 26 B0 B6 B4 EB 15
|
|
|
|
|
0210 | 53 CD 85 C4 11 2A 29 AF D0 47 1D 13 F1 34 34 D2
|
|
|
|
|
0220 | A1 E7 75 2B 6E 4B FE 3E 36 EC 9F DB 78 D3 6F 16
|
|
|
|
|
0230 | 2A C5 96 66</code></pre>
|
|
|
|
|
0130 | 4E F8 63 0B EC B9 D2 2E 81 C4 2C AE 12 9F A5 44
|
|
|
|
|
0140 | 58 A3 7E C2 9B AD B4 2E 35 11 4D A6 E3 6A 03 B0
|
|
|
|
|
0150 | 5B F1 1A 93 0C 60 4A 25 19 22 3B A1 58 0E 55 08
|
|
|
|
|
0160 | 21 E1 E7 F7 75 63 41 5E 49 EF 85 77 FA C8 9C 78
|
|
|
|
|
0170 | 21 10 04 96 DC 73 9F A6 EE 7B 24 86 B1 C8 0D A3
|
|
|
|
|
0180 | 8E 00 38 FE 0B 64 6E FD C4 98 30 F3 C9 33 40 6B
|
|
|
|
|
0190 | 6B 47 C0 64 15 C2 A5 72 22 A8 9C 3C C6 6C 2A 0E
|
|
|
|
|
01A0 | A7 63 C4 B9 72 21 78 2E EE B6 E8 0E A3 41 73 5F
|
|
|
|
|
01B0 | 94 8E 96 DA 22 B0 0D 13 99 48 19 68 6B 29 75 D2
|
|
|
|
|
01C0 | 0E 56 B7 CB D0 B7 F2 C5 42 01 03 CD E7 7C EA 4A
|
|
|
|
|
01D0 | F9 59 7B 7E DC B9 C3 BD 4E C8 74 80 A4 B1 23 A9
|
|
|
|
|
01E0 | BC 0B 14 6C B2 80 D6 67 15 06 0B 52 17 1C FB 7F
|
|
|
|
|
01F0 | 7E 3C AB F4 3D 28 75 83 95 C7 1C 13 D7 C1 8E 74
|
|
|
|
|
0200 | BD 55 33 BB 1F 35 43 83 59 2F 8B 6C 45 79 F7 17
|
|
|
|
|
0210 | 0A 5C 6F A3 DE 4E 52 42 2D F6 A3 43 0D 1B 4F AA
|
|
|
|
|
0220 | B0 B2 29 5C C9 11 BE 56 8F B0 CA C7 F2 E2 99 1C
|
|
|
|
|
0230 | 1A C6 96 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 = BA0D89B5F682BCAED66D37DFC85F2F8E455B24FACC5A5E988DE8260B1EA7A5AE5E9BB4B
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>F682BCAED66D37DFC85F2F8E455B24FA</code></td>
|
|
|
|
|
<td><code>D4C39F0A0CE2408D537C91DC359D6320</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>CC5A5E988DE8260B1EA7A5AE5E9BB4B3</code></td>
|
|
|
|
|
<td><code>183CC876B024215D4B9FF42966910A96</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B5F682BCAED66D37DFC85F2F8E455B24FACC5A5E988DE8260B1EA7A5AE5E9BB4B
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE0001007DEDF675D8B9D3A24D8100C5</code> <code>28996BCE6CD61277BBAFC15F45C1A82E</code> <code>386AC197316701B9659F1E4097EDFB57</code> <code>1A5D8FEEEEFFE26F63C68B5B00CD6F75</code> <code>22C6AA54BF96EAA9E6A7B4C190C81E05</code> <code>8120C18547A8FA939DE594A50F3A1C4A</code> <code>24BD324607878FBB41C756AF0FB5F725</code> <code>236B9E2497662C94D9EABE63F92B2887</code> <code>7CFAAB1636581B61344E2B979A4427FF</code> <code>809BE3DE60A7A0CB49A8AB5BD9B9319F</code> <code>4EC55557F7A58F0197D51B921F88842C</code> <code>873E786745AD16AC44B0FF7C34887E5A</code> <code>662BA8442AE988F111F5DFE79183182A</code> <code>92050151D9FE39523BA8C84EF98E26B0</code> <code>B6B4EB1553CD85C4112A29AFD0471D13</code> <code>F13434D2A1E7752B6E4BFE3E36EC9FDB</code><br> <code>78D36F16</code></td>
|
|
|
|
|
<td><code>FE0001004EF8630BECB9D22E81C42CAE</code> <code>129FA54458A37EC29BADB42E35114DA6</code> <code>E36A03B05BF11A930C604A2519223BA1</code> <code>580E550821E1E7F77563415E49EF8577</code> <code>FAC89C7821100496DC739FA6EE7B2486</code> <code>B1C80DA38E0038FE0B646EFDC49830F3</code> <code>C933406B6B47C06415C2A57222A89C3C</code> <code>C66C2A0EA763C4B97221782EEEB6E80E</code> <code>A341735F948E96DA22B00D1399481968</code> <code>6B2975D20E56B7CBD0B7F2C5420103CD</code> <code>E77CEA4AF9597B7EDCB9C3BD4EC87480</code> <code>A4B123A9BC0B146CB280D66715060B52</code> <code>171CFB7F7E3CABF43D28758395C71C13</code> <code>D7C18E74BD5533BB1F354383592F8B6C</code> <code>4579F7170A5C6FA3DE4E52422DF6A343</code> <code>0D1B4FAAB0B2295CC911BE568FB0CAC7</code><br> <code>F2E2991C</code></td>
|
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>2AC59666</code> (1721156906 in decimal)</td>
|
|
|
|
|
<td><code>1AC69666</code> (1721157146 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B5F682BCAED66D37DFC85F2F8E455B24FACC5A5E988DE8260B1EA7A5AE5E9BB4B
|
|
|
|
|
<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 = A699E4796CABCA0136345536E4E469B4AE59E93F597F5CEC135DD20BD7D6CDF6324547EDFA7A2AE5C457C3D642FD153B31E62E5FE155997AA1586EF679D4E8EA9C7A67BDE5BBF6B750FDC1EAE43769439D55A1C8C5F4E681FDCAEFD4A0A4B1A2191E717D12390BB566AFAAC4E3A1F176E6AE5836E17401DB6CF0F54AB3D4ADE508C8F883C59C9AF7D70079A075758973424C89511A776C00120B02AC602813AAA2E6DF4D02B7E504386877471A847FB19A173F71DF81AE1BD259388A0BC4786DFBE78B7BA8A196A7D8FBB3A89322569E531393A2C302FF8CC2AF33EBF39D5D0886826A6B08C118AD9029EF2C8711DE320DD0FA487330AA6CA7E50AF0601B50E1</code></pre>
|
|
|
|
|
<pre><code>b = 2FA1FA533C2F8B12055F6E7A04E8DF4468333A7C0C0C2754F7E6E1C9D2CB657F5AF49D21184D4CAC5581A3D46FCBE6355338A5ABF720F91F4C3DE96E862C75A93F18B7A0AE28BE311C57E78F8F2A5F4DF98D59D86E4D4D02D7EF3BCFAFF6B35FA66984D70424EE7340EA41B8EA1A19C13F2947DF9CDBA325944FE6E9CD2BD3081C6A2204AFEEDC675D72BCC9E3C42941283048EA5751631A6D8FED525F686CF468BB8A1B6112B3996C1557896AF78F6FDBDDBC3BE69E2D886D8D60A0C9FDC04E28D27053DF7E83DFCA510EE929233BA3EDC0F54940F1AE06B260FBAD93A8B89515560E6A622F8ACABD8602303F2F379348D6ADD3F466CE4343BAC7A767DD8CA6</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 = 7194579669F36B05764F00E733B5A802D7069AF48CE5EE603AA49011F354CAA1CD5F2DAACB18AB53C7D664CC07C21CF5741D6C5EAD61F25F56CE3A754BB2FB0CB98E3A41488C0638DF185B13C08DE52F592E7A1C8BFB51CA84FA6929E4A895226B5F7A9EA09BF721C9F917E90AD534092393F88E6950705B9B9C46C362C1D43D0D4729C39D9FA41F43DEFF8AA2AEFF0E1C15AAEF585F5473D82079387A35E078850AE07BB97606B4718DF49CC9BB5415B13D2C3153BE82E09C09949876E2E55F9756037A8191D61915F128B167168C13E083CCEFA96F15859DAB21AD836D2A18EC2464F4BFDB886682C6FED6A852B217ACC454686EACCC2DF3D43D2AF30F94DB</code></pre>
|
|
|
|
|
<pre><code>g_b = 6285A925AFD0126C873715D1E0F1E728B28CC816381BD32642E0D41EDC88E929BBCEA49D45E3D1B5B9B237D189EA4A7F13228F1ED508BD0DB548687E31BC6D1199AD292C747F09C190AB0224B7F110A15F82848B2D6EB855B70DD0BF7CC1559A6254B4ABFCF6F234BC11BA7508425CC368BB22A0D3C055981C3D932057B7B6B09426FE6DF1B7387590DFFC7CE1CFECFAFBF2A211E34077788F9B0D84CB89E556B31AA8A2848F950E8FE0504020696364D946989D3BF85BF349EC1E7C92A9A872910844DA4F3065EBB324D3D65274B489A44F18ACDA84CFB4CD30B8FD9E81DC5D9D2F69EF1305F10CB8F52B2B2E58863D01A70D3A055066990CD2CD129A1C5DEC</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 F6 82 BC AE D6 6D 37 DF C8 5F 2F 8E
|
|
|
|
|
0010 | 45 5B 24 FA CC 5A 5E 98 8D E8 26 0B 1E A7 A5 AE
|
|
|
|
|
0020 | 5E 9B B4 B3 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 71 94 57 96 69 F3 6B 05 76 4F 00 E7 33 B5 A8 02
|
|
|
|
|
0040 | D7 06 9A F4 8C E5 EE 60 3A A4 90 11 F3 54 CA A1
|
|
|
|
|
0050 | CD 5F 2D AA CB 18 AB 53 C7 D6 64 CC 07 C2 1C F5
|
|
|
|
|
0060 | 74 1D 6C 5E AD 61 F2 5F 56 CE 3A 75 4B B2 FB 0C
|
|
|
|
|
0070 | B9 8E 3A 41 48 8C 06 38 DF 18 5B 13 C0 8D E5 2F
|
|
|
|
|
0080 | 59 2E 7A 1C 8B FB 51 CA 84 FA 69 29 E4 A8 95 22
|
|
|
|
|
0090 | 6B 5F 7A 9E A0 9B F7 21 C9 F9 17 E9 0A D5 34 09
|
|
|
|
|
00A0 | 23 93 F8 8E 69 50 70 5B 9B 9C 46 C3 62 C1 D4 3D
|
|
|
|
|
00B0 | 0D 47 29 C3 9D 9F A4 1F 43 DE FF 8A A2 AE FF 0E
|
|
|
|
|
00C0 | 1C 15 AA EF 58 5F 54 73 D8 20 79 38 7A 35 E0 78
|
|
|
|
|
00D0 | 85 0A E0 7B B9 76 06 B4 71 8D F4 9C C9 BB 54 15
|
|
|
|
|
00E0 | B1 3D 2C 31 53 BE 82 E0 9C 09 94 98 76 E2 E5 5F
|
|
|
|
|
00F0 | 97 56 03 7A 81 91 D6 19 15 F1 28 B1 67 16 8C 13
|
|
|
|
|
0100 | E0 83 CC EF A9 6F 15 85 9D AB 21 AD 83 6D 2A 18
|
|
|
|
|
0110 | EC 24 64 F4 BF DB 88 66 82 C6 FE D6 A8 52 B2 17
|
|
|
|
|
0120 | AC C4 54 68 6E AC CC 2D F3 D4 3D 2A F3 0F 94 DB</code></pre>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 D4 C3 9F 0A 0C E2 40 8D 53 7C 91 DC
|
|
|
|
|
0010 | 35 9D 63 20 18 3C C8 76 B0 24 21 5D 4B 9F F4 29
|
|
|
|
|
0020 | 66 91 0A 96 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 62 85 A9 25 AF D0 12 6C 87 37 15 D1 E0 F1 E7 28
|
|
|
|
|
0040 | B2 8C C8 16 38 1B D3 26 42 E0 D4 1E DC 88 E9 29
|
|
|
|
|
0050 | BB CE A4 9D 45 E3 D1 B5 B9 B2 37 D1 89 EA 4A 7F
|
|
|
|
|
0060 | 13 22 8F 1E D5 08 BD 0D B5 48 68 7E 31 BC 6D 11
|
|
|
|
|
0070 | 99 AD 29 2C 74 7F 09 C1 90 AB 02 24 B7 F1 10 A1
|
|
|
|
|
0080 | 5F 82 84 8B 2D 6E B8 55 B7 0D D0 BF 7C C1 55 9A
|
|
|
|
|
0090 | 62 54 B4 AB FC F6 F2 34 BC 11 BA 75 08 42 5C C3
|
|
|
|
|
00A0 | 68 BB 22 A0 D3 C0 55 98 1C 3D 93 20 57 B7 B6 B0
|
|
|
|
|
00B0 | 94 26 FE 6D F1 B7 38 75 90 DF FC 7C E1 CF EC FA
|
|
|
|
|
00C0 | FB F2 A2 11 E3 40 77 78 8F 9B 0D 84 CB 89 E5 56
|
|
|
|
|
00D0 | B3 1A A8 A2 84 8F 95 0E 8F E0 50 40 20 69 63 64
|
|
|
|
|
00E0 | D9 46 98 9D 3B F8 5B F3 49 EC 1E 7C 92 A9 A8 72
|
|
|
|
|
00F0 | 91 08 44 DA 4F 30 65 EB B3 24 D3 D6 52 74 B4 89
|
|
|
|
|
0100 | A4 4F 18 AC DA 84 CF B4 CD 30 B8 FD 9E 81 DC 5D
|
|
|
|
|
0110 | 9D 2F 69 EF 13 05 F1 0C B8 F5 2B 2B 2E 58 86 3D
|
|
|
|
|
0120 | 01 A7 0D 3A 05 50 66 99 0C D2 CD 12 9A 1C 5D EC</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 = BA0D89B5F682BCAED66D37DFC85F2F8E455B24FACC5A5E988DE8260B1EA7A5AE5E9BB4B
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>F682BCAED66D37DFC85F2F8E455B24FA</code></td>
|
|
|
|
|
<td><code>D4C39F0A0CE2408D537C91DC359D6320</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>CC5A5E988DE8260B1EA7A5AE5E9BB4B3</code></td>
|
|
|
|
|
<td><code>183CC876B024215D4B9FF42966910A96</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE0001007194579669F36B05764F00E7</code> <code>33B5A802D7069AF48CE5EE603AA49011</code> <code>F354CAA1CD5F2DAACB18AB53C7D664CC</code> <code>07C21CF5741D6C5EAD61F25F56CE3A75</code> <code>4BB2FB0CB98E3A41488C0638DF185B13</code> <code>C08DE52F592E7A1C8BFB51CA84FA6929</code> <code>E4A895226B5F7A9EA09BF721C9F917E9</code> <code>0AD534092393F88E6950705B9B9C46C3</code> <code>62C1D43D0D4729C39D9FA41F43DEFF8A</code> <code>A2AEFF0E1C15AAEF585F5473D8207938</code> <code>7A35E078850AE07BB97606B4718DF49C</code> <code>C9BB5415B13D2C3153BE82E09C099498</code> <code>76E2E55F9756037A8191D61915F128B1</code> <code>67168C13E083CCEFA96F15859DAB21AD</code> <code>836D2A18EC2464F4BFDB886682C6FED6</code> <code>A852B217ACC454686EACCC2DF3D43D2A</code><br> <code>F30F94DB</code></td>
|
|
|
|
|
<td><code>FE0001006285A925AFD0126C873715D1</code> <code>E0F1E728B28CC816381BD32642E0D41E</code> <code>DC88E929BBCEA49D45E3D1B5B9B237D1</code> <code>89EA4A7F13228F1ED508BD0DB548687E</code> <code>31BC6D1199AD292C747F09C190AB0224</code> <code>B7F110A15F82848B2D6EB855B70DD0BF</code> <code>7CC1559A6254B4ABFCF6F234BC11BA75</code> <code>08425CC368BB22A0D3C055981C3D9320</code> <code>57B7B6B09426FE6DF1B7387590DFFC7C</code> <code>E1CFECFAFBF2A211E34077788F9B0D84</code> <code>CB89E556B31AA8A2848F950E8FE05040</code> <code>20696364D946989D3BF85BF349EC1E7C</code> <code>92A9A872910844DA4F3065EBB324D3D6</code> <code>5274B489A44F18ACDA84CFB4CD30B8FD</code> <code>9E81DC5D9D2F69EF1305F10CB8F52B2B</code> <code>2E58863D01A70D3A055066990CD2CD12</code><br> <code>9A1C5DEC</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 = BA0D89B5F682BCAED66D37DFC85F2F8E455B24FACC5A5E988DE8260B1EA7A5AE5E9BB4B
|
|
|
|
|
<!-- 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 = 54B64366F682BCAED66D37DFC85F2F8E455B24FACC5A5E988DE8260B1EA7A5AE5E9BB4B30000000000000000FE0001007194579669F36B05764F00E733B5A802D7069AF48CE5EE603AA49011F354CAA1CD5F2DAACB18AB53C7D664CC07C21CF5741D6C5EAD61F25F56CE3A754BB2FB0CB98E3A41488C0638DF185B13C08DE52F592E7A1C8BFB51CA84FA6929E4A895226B5F7A9EA09BF721C9F917E90AD534092393F88E6950705B9B9C46C362C1D43D0D4729C39D9FA41F43DEFF8AA2AEFF0E1C15AAEF585F5473D82079387A35E078850AE07BB97606B4718DF49CC9BB5415B13D2C3153BE82E09C09949876E2E55F9756037A8191D61915F128B167168C13E083CCEFA96F15859DAB21AD836D2A18EC2464F4BFDB886682C6FED6A852B217ACC454686EACCC2DF3D43D2AF30F94DB
|
|
|
|
|
padding = 06DC26A83AEC6CB1B0C526E5
|
|
|
|
|
tmp_aes_key = 192D215E748F95FD73801788B85F590E7C148D32D273A665210540C00EEA2526
|
|
|
|
|
tmp_aes_iv = A16A3B38A557F03F6FD1E8EB5B40800EA012A1678A005E1D32D2C74D99168C34</code></pre>
|
|
|
|
|
<pre><code>data = 54B64366D4C39F0A0CE2408D537C91DC359D6320183CC876B024215D4B9FF42966910A960000000000000000FE0001006285A925AFD0126C873715D1E0F1E728B28CC816381BD32642E0D41EDC88E929BBCEA49D45E3D1B5B9B237D189EA4A7F13228F1ED508BD0DB548687E31BC6D1199AD292C747F09C190AB0224B7F110A15F82848B2D6EB855B70DD0BF7CC1559A6254B4ABFCF6F234BC11BA7508425CC368BB22A0D3C055981C3D932057B7B6B09426FE6DF1B7387590DFFC7CE1CFECFAFBF2A211E34077788F9B0D84CB89E556B31AA8A2848F950E8FE0504020696364D946989D3BF85BF349EC1E7C92A9A872910844DA4F3065EBB324D3D65274B489A44F18ACDA84CFB4CD30B8FD9E81DC5D9D2F69EF1305F10CB8F52B2B2E58863D01A70D3A055066990CD2CD129A1C5DEC
|
|
|
|
|
padding = 1956BD3D088DF02756EB7157
|
|
|
|
|
tmp_aes_key = 669395D66EE9A717398173BA8A55287C6503F4AF4D43DF48D39E9FD0CD07E914
|
|
|
|
|
tmp_aes_iv = 70991BA30BC241AD98B9D948961E747E214FB81262811620640D2FE8EAEC6E0F</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 = A15623196EA32948FCC535C935A3EAFF396A1E7032891F2A55E24BC62C166D443F31189AF3E1A19CB51B43C44D52C0F28BC399E0FCD77BCACF2376366F1DCDC51A29FFD17E72B8D72AEC1C1F8E994905CA1011398D88F4BCAAB193F55EA8961BEDE4BB7247A5CE2C0015A22A1DFCC05C0806F9EFC168A50B7E4FB3E5716435042DED395CCF09EB80AB65DD008BAE71862018C2EE422F144CDAC177A6240560C403B6A441F4F5DADA0DFE7A422F958CD13FF75086162467984EC243A7613C86AF7FF1149F94F6195D10A05AB14A3982E1DAB6D5B19F9D082DEC84B2D7FD53C167223E61CA65FC196FF72E9BBB812E764C531BE83569A258604E211B471EA8FCF4675C29E2025D9027B8DFFC71264DA1D0F91DA1B61DA14B348FC1DEB88728145D1616AAFB461DBF26A7F046578A6240340CA4C7B7975DD2C85360766399515C87A4B3DD0102E3DA44ED1B505750369805</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 6ABCD1667E5FAE53230E0CD58630827E1824C9107BEE371D40CA38A867779A41FDB4D997E88A3DC17F12E76096A1B4190D312C273F5FC600F37C75DD827F1A1901ADB4C72C0FE2D64A7DDF8E01F10A0F949547AB40A6B4634D83AF7B69C3D8F3EEE6D851A723CF8894D9B6D1751335B85F83183C0F784BC14B7EA8C469C6929A77B1EF44AB2F8356AE0B7348DDD5EDF89FB9EB0373A287C18DE6277F03447A95DCAE30DA4CEF8D2E6C9EBE910E5D80ACC47AA3C300A2C4B69F1818036E7AD41978098A33F2208FEA45273B6C256F1C2CB501F92F19AC3F4D1E2BDFD11081D9C6BFA43F7F503D8F85359A0D5400D8E5EDBA3D15755573A8110484B1C05A380B4B6A004D4C76B4D8ADE8F8F748B8CF49AB56E3F4FAEEFC49DF4516D54A579F32C5C6C6E1065982F108FB17B2475FBB4853C6906CB9C26E49174F5DAFEC5DCF0E189B72AB12C0F2127E256097F6A2546D06</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 40 40 0E 00 2A C5 96 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 F6 82 BC AE D6 6D 37 DF
|
|
|
|
|
0020 | C8 5F 2F 8E 45 5B 24 FA CC 5A 5E 98 8D E8 26 0B
|
|
|
|
|
0030 | 1E A7 A5 AE 5E 9B B4 B3 FE 50 01 00 A1 56 23 19
|
|
|
|
|
0040 | 6E A3 29 48 FC C5 35 C9 35 A3 EA FF 39 6A 1E 70
|
|
|
|
|
0050 | 32 89 1F 2A 55 E2 4B C6 2C 16 6D 44 3F 31 18 9A
|
|
|
|
|
0060 | F3 E1 A1 9C B5 1B 43 C4 4D 52 C0 F2 8B C3 99 E0
|
|
|
|
|
0070 | FC D7 7B CA CF 23 76 36 6F 1D CD C5 1A 29 FF D1
|
|
|
|
|
0080 | 7E 72 B8 D7 2A EC 1C 1F 8E 99 49 05 CA 10 11 39
|
|
|
|
|
0090 | 8D 88 F4 BC AA B1 93 F5 5E A8 96 1B ED E4 BB 72
|
|
|
|
|
00A0 | 47 A5 CE 2C 00 15 A2 2A 1D FC C0 5C 08 06 F9 EF
|
|
|
|
|
00B0 | C1 68 A5 0B 7E 4F B3 E5 71 64 35 04 2D ED 39 5C
|
|
|
|
|
00C0 | CF 09 EB 80 AB 65 DD 00 8B AE 71 86 20 18 C2 EE
|
|
|
|
|
00D0 | 42 2F 14 4C DA C1 77 A6 24 05 60 C4 03 B6 A4 41
|
|
|
|
|
00E0 | F4 F5 DA DA 0D FE 7A 42 2F 95 8C D1 3F F7 50 86
|
|
|
|
|
00F0 | 16 24 67 98 4E C2 43 A7 61 3C 86 AF 7F F1 14 9F
|
|
|
|
|
0100 | 94 F6 19 5D 10 A0 5A B1 4A 39 82 E1 DA B6 D5 B1
|
|
|
|
|
0110 | 9F 9D 08 2D EC 84 B2 D7 FD 53 C1 67 22 3E 61 CA
|
|
|
|
|
0120 | 65 FC 19 6F F7 2E 9B BB 81 2E 76 4C 53 1B E8 35
|
|
|
|
|
0130 | 69 A2 58 60 4E 21 1B 47 1E A8 FC F4 67 5C 29 E2
|
|
|
|
|
0140 | 02 5D 90 27 B8 DF FC 71 26 4D A1 D0 F9 1D A1 B6
|
|
|
|
|
0150 | 1D A1 4B 34 8F C1 DE B8 87 28 14 5D 16 16 AA FB
|
|
|
|
|
0160 | 46 1D BF 26 A7 F0 46 57 8A 62 40 34 0C A4 C7 B7
|
|
|
|
|
0170 | 97 5D D2 C8 53 60 76 63 99 51 5C 87 A4 B3 DD 01
|
|
|
|
|
0180 | 02 E3 DA 44 ED 1B 50 57 50 36 98 05</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 14 E5 0D 00 1A C6 96 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 D4 C3 9F 0A 0C E2 40 8D
|
|
|
|
|
0020 | 53 7C 91 DC 35 9D 63 20 18 3C C8 76 B0 24 21 5D
|
|
|
|
|
0030 | 4B 9F F4 29 66 91 0A 96 FE 50 01 00 6A BC D1 66
|
|
|
|
|
0040 | 7E 5F AE 53 23 0E 0C D5 86 30 82 7E 18 24 C9 10
|
|
|
|
|
0050 | 7B EE 37 1D 40 CA 38 A8 67 77 9A 41 FD B4 D9 97
|
|
|
|
|
0060 | E8 8A 3D C1 7F 12 E7 60 96 A1 B4 19 0D 31 2C 27
|
|
|
|
|
0070 | 3F 5F C6 00 F3 7C 75 DD 82 7F 1A 19 01 AD B4 C7
|
|
|
|
|
0080 | 2C 0F E2 D6 4A 7D DF 8E 01 F1 0A 0F 94 95 47 AB
|
|
|
|
|
0090 | 40 A6 B4 63 4D 83 AF 7B 69 C3 D8 F3 EE E6 D8 51
|
|
|
|
|
00A0 | A7 23 CF 88 94 D9 B6 D1 75 13 35 B8 5F 83 18 3C
|
|
|
|
|
00B0 | 0F 78 4B C1 4B 7E A8 C4 69 C6 92 9A 77 B1 EF 44
|
|
|
|
|
00C0 | AB 2F 83 56 AE 0B 73 48 DD D5 ED F8 9F B9 EB 03
|
|
|
|
|
00D0 | 73 A2 87 C1 8D E6 27 7F 03 44 7A 95 DC AE 30 DA
|
|
|
|
|
00E0 | 4C EF 8D 2E 6C 9E BE 91 0E 5D 80 AC C4 7A A3 C3
|
|
|
|
|
00F0 | 00 A2 C4 B6 9F 18 18 03 6E 7A D4 19 78 09 8A 33
|
|
|
|
|
0100 | F2 20 8F EA 45 27 3B 6C 25 6F 1C 2C B5 01 F9 2F
|
|
|
|
|
0110 | 19 AC 3F 4D 1E 2B DF D1 10 81 D9 C6 BF A4 3F 7F
|
|
|
|
|
0120 | 50 3D 8F 85 35 9A 0D 54 00 D8 E5 ED BA 3D 15 75
|
|
|
|
|
0130 | 55 73 A8 11 04 84 B1 C0 5A 38 0B 4B 6A 00 4D 4C
|
|
|
|
|
0140 | 76 B4 D8 AD E8 F8 F7 48 B8 CF 49 AB 56 E3 F4 FA
|
|
|
|
|
0150 | EE FC 49 DF 45 16 D5 4A 57 9F 32 C5 C6 C6 E1 06
|
|
|
|
|
0160 | 59 82 F1 08 FB 17 B2 47 5F BB 48 53 C6 90 6C B9
|
|
|
|
|
0170 | C2 6E 49 17 4F 5D AF EC 5D CF 0E 18 9B 72 AB 12
|
|
|
|
|
0180 | C0 F2 12 7E 25 60 97 F6 A2 54 6D 06</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>40400E002AC59666</code></td>
|
|
|
|
|
<td><code>14E50D001AC69666</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>F682BCAED66D37DFC85F2F8E455B24FA</code></td>
|
|
|
|
|
<td><code>D4C39F0A0CE2408D537C91DC359D6320</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>CC5A5E988DE8260B1EA7A5AE5E9BB4B3</code></td>
|
|
|
|
|
<td><code>183CC876B024215D4B9FF42966910A96</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE500100A15623196EA32948FCC535C9</code> <code>35A3EAFF396A1E7032891F2A55E24BC6</code> <code>2C166D443F31189AF3E1A19CB51B43C4</code> <code>4D52C0F28BC399E0FCD77BCACF237636</code> <code>6F1DCDC51A29FFD17E72B8D72AEC1C1F</code> <code>8E994905CA1011398D88F4BCAAB193F5</code> <code>5EA8961BEDE4BB7247A5CE2C0015A22A</code> <code>1DFCC05C0806F9EFC168A50B7E4FB3E5</code> <code>716435042DED395CCF09EB80AB65DD00</code> <code>8BAE71862018C2EE422F144CDAC177A6</code> <code>240560C403B6A441F4F5DADA0DFE7A42</code> <code>2F958CD13FF75086162467984EC243A7</code> <code>613C86AF7FF1149F94F6195D10A05AB1</code> <code>4A3982E1DAB6D5B19F9D082DEC84B2D7</code> <code>FD53C167223E61CA65FC196FF72E9BBB</code> <code>812E764C531BE83569A258604E211B47</code> <code>1EA8FCF4675C29E2025D9027B8DFFC71</code> <code>264DA1D0F91DA1B61DA14B348FC1DEB8</code> <code>8728145D1616AAFB461DBF26A7F04657</code> <code>8A6240340CA4C7B7975DD2C853607663</code> <code>99515C87A4B3DD0102E3DA44ED1B5057</code><br> <code>50369805</code></td>
|
|
|
|
|
<td><code>FE5001006ABCD1667E5FAE53230E0CD5</code> <code>8630827E1824C9107BEE371D40CA38A8</code> <code>67779A41FDB4D997E88A3DC17F12E760</code> <code>96A1B4190D312C273F5FC600F37C75DD</code> <code>827F1A1901ADB4C72C0FE2D64A7DDF8E</code> <code>01F10A0F949547AB40A6B4634D83AF7B</code> <code>69C3D8F3EEE6D851A723CF8894D9B6D1</code> <code>751335B85F83183C0F784BC14B7EA8C4</code> <code>69C6929A77B1EF44AB2F8356AE0B7348</code> <code>DDD5EDF89FB9EB0373A287C18DE6277F</code> <code>03447A95DCAE30DA4CEF8D2E6C9EBE91</code> <code>0E5D80ACC47AA3C300A2C4B69F181803</code> <code>6E7AD41978098A33F2208FEA45273B6C</code> <code>256F1C2CB501F92F19AC3F4D1E2BDFD1</code> <code>1081D9C6BFA43F7F503D8F85359A0D54</code> <code>00D8E5EDBA3D15755573A8110484B1C0</code> <code>5A380B4B6A004D4C76B4D8ADE8F8F748</code> <code>B8CF49AB56E3F4FAEEFC49DF4516D54A</code> <code>579F32C5C6C6E1065982F108FB17B247</code> <code>5FBB4853C6906CB9C26E49174F5DAFEC</code> <code>5DCF0E189B72AB12C0F2127E256097F6</code><br> <code>A2546D06</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 = 7A8DBBE072B65871B43946FBC9CDBDB5DAADA78C3935765EE381E72F692AF465FC193021CDC1455FEBA06F1C9BEADFBF57D1E2D947D0066BE4A81A60DF4FCEA4318572DEBF852865C4F838A2F1107C07578FCA780385FF1444F0D58BB9B8E98213F753FC1D4034E00EBE58D2784ADF85DB1C50E8992A0B4E34DA980983930E4C71303FB3596D105FF7CF58240E1EFA7F77BDF122B99FF0F20092879DAD8CC0E96478D62BD5B1BD3DA95D27BB59595B9653B16460DF98F9801972954FF6F7741CF8D7A43B54A129E2EAB47257D684231340AEB6628AF3177D1763E367050B85BA9A684D134B8080E5CAA2133106CF2C8A08F34E3224772E155382B296E96C2CF3</code></pre>
|
|
|
|
|
<pre><code>auth_key = 5062AB3AAB8D2FD719664CC8F051AB3D8FA92C7A3540472829E33A70A7291C49128728D1B79B646616C20A9A2E9D65996B313A6AA5CEA6F01170BBBC797CF6FF072E21AEFA803DBDD3A74D3A1EC007A9277CA52F7B06FFD202EC15F7F752A3C0A56B9C0F58578751367C2E3D6CD963FDF67DBBCAC7F9F49957B9DC7FABA17246ED68D81B2E30E9905C507A1F61157EDB8DD3B3051F02BE953AA3D66F8C46F6BF414A4CAEE9FF7558BD6EDC9AF1524EBB150B00F53AEDA0DF4B5FDE664E3D2B643344A8FE377CDCDE26A3315535773A262E087AB348F9148B7EA16D8AE5947006B8846DF051DD1BF5EE18FCAEC3EF26E699F6351F02984F5C212E4E9B7B6C4D31</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 FA CF 2B C5 96 66
|
|
|
|
|
0010 | 38 00 00 00 34 F7 CB 3B F6 82 BC AE D6 6D 37 DF
|
|
|
|
|
0020 | C8 5F 2F 8E 45 5B 24 FA CC 5A 5E 98 8D E8 26 0B
|
|
|
|
|
0030 | 1E A7 A5 AE 5E 9B B4 B3 67 E4 27 DE DB F3 A7 8B
|
|
|
|
|
0040 | 25 5E FB 96 7B 0D 55 38</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 A4 4A 62 1C C6 96 66
|
|
|
|
|
0010 | 84 00 00 00 34 F7 CB 3B D4 C3 9F 0A 0C E2 40 8D
|
|
|
|
|
0020 | 53 7C 91 DC 35 9D 63 20 18 3C C8 76 B0 24 21 5D
|
|
|
|
|
0030 | 4B 9F F4 29 66 91 0A 96 6C 3D 1A 01 48 70 8B C3
|
|
|
|
|
0040 | F3 9D 84 92 BC EF 03 B7</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>01D0FACF2BC59666</code></td>
|
|
|
|
|
<td><code>01A44A621CC69666</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>38000000</code> (56 in decimal)</td>
|
|
|
|
|
<td><code>84000000</code> (132 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>F682BCAED66D37DFC85F2F8E455B24FA</code></td>
|
|
|
|
|
<td><code>D4C39F0A0CE2408D537C91DC359D6320</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>CC5A5E988DE8260B1EA7A5AE5E9BB4B3</code></td>
|
|
|
|
|
<td><code>183CC876B024215D4B9FF42966910A96</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>67E427DEDBF3A78B255EFB967B0D5538</code></td>
|
|
|
|
|
<td><code>6C3D1A0148708BC3F39D8492BCEF03B7</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>
|
|
|
|
|