|
|
|
@ -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 9C 27 0B 00 55 7C 81 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 26 42 06 E4 2D 00 4B 77
|
|
|
|
|
0020 | E8 23 76 A4 40 D7 9E 0F</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 C0 EC 05 00 B1 82 81 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 57 FF D7 2B 59 89 6B 51
|
|
|
|
|
0020 | 90 E1 9C 97 8E 8C BF E2</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>9C270B00557C8166</code></td>
|
|
|
|
|
<td><code>C0EC0500B1828166</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>264206E42D004B77E82376A440D79E0F</code></td>
|
|
|
|
|
<td><code>57FFD72B59896B5190E19C978E8CBFE2</code></td>
|
|
|
|
|
<td>Random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -104,11 +104,11 @@
|
|
|
|
|
<h5><a class="anchor" href="#2-server-sends-response-of-the-form" id="2-server-sends-response-of-the-form" name="2-server-sends-response-of-the-form"><i class="anchor-icon"></i></a>2) Server sends response of the form</h5>
|
|
|
|
|
<!-- start resPQ -->
|
|
|
|
|
<p>Received payload (excluding transport headers/trailers):</p>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 E8 EB B7 55 7C 81 66
|
|
|
|
|
0010 | 64 00 00 00 63 24 16 05 26 42 06 E4 2D 00 4B 77
|
|
|
|
|
0020 | E8 23 76 A4 40 D7 9E 0F 36 C0 74 7D 7C 98 4C 57
|
|
|
|
|
0030 | 73 98 4B 10 C2 DE 52 A3 08 11 6D 8C 24 73 B6 44
|
|
|
|
|
0040 | 01 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 8C FA 7C B1 82 81 66
|
|
|
|
|
0010 | 9C 00 00 00 63 24 16 05 57 FF D7 2B 59 89 6B 51
|
|
|
|
|
0020 | 90 E1 9C 97 8E 8C BF E2 6B 64 54 0E 20 4B 82 27
|
|
|
|
|
0030 | 92 38 17 F2 43 DB 60 44 08 11 B3 CD 1E 75 17 8A
|
|
|
|
|
0040 | D5 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>01E8EBB7557C8166</code></td>
|
|
|
|
|
<td><code>018CFA7CB1828166</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>64000000</code> (100 in decimal)</td>
|
|
|
|
|
<td><code>9C000000</code> (156 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>264206E42D004B77E82376A440D79E0F</code></td>
|
|
|
|
|
<td><code>57FFD72B59896B5190E19C978E8CBFE2</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>36C0747D7C984C5773984B10C2DE52A3</code></td>
|
|
|
|
|
<td><code>6B64540E204B8227923817F243DB6044</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>08116D8C2473B64401000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1255813959294272513</td>
|
|
|
|
|
<td><code>0811B3CD1E75178AD5000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1275588650173172437</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 = 1255813959294272513</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1255813959294272513 = 1120424969 * 1120837177</code></p>
|
|
|
|
|
<pre><code>p = 1120424969
|
|
|
|
|
q = 1120837177</code></pre>
|
|
|
|
|
<pre><code>pq = 1275588650173172437</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1275588650173172437 = 1065626909 * 1197031193</code></p>
|
|
|
|
|
<pre><code>p = 1065626909
|
|
|
|
|
q = 1197031193</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 11 6D 8C 24 73 B6 44 01 00 00 00
|
|
|
|
|
0010 | 04 42 C8 54 09 00 00 00 04 42 CE 9E 39 00 00 00
|
|
|
|
|
0020 | 26 42 06 E4 2D 00 4B 77 E8 23 76 A4 40 D7 9E 0F
|
|
|
|
|
0030 | 36 C0 74 7D 7C 98 4C 57 73 98 4B 10 C2 DE 52 A3
|
|
|
|
|
0040 | D4 B7 96 AE 7E EB 59 65 F0 52 96 B8 CD 81 16 32
|
|
|
|
|
0050 | 3E AE D5 0F FC 80 A8 80 4E D1 9A 8D 58 84 54 6D
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 11 B3 CD 1E 75 17 8A D5 00 00 00
|
|
|
|
|
0010 | 04 3F 84 2D 1D 00 00 00 04 47 59 3F 19 00 00 00
|
|
|
|
|
0020 | 57 FF D7 2B 59 89 6B 51 90 E1 9C 97 8E 8C BF E2
|
|
|
|
|
0030 | 6B 64 54 0E 20 4B 82 27 92 38 17 F2 43 DB 60 44
|
|
|
|
|
0040 | 03 3C E0 ED CC A9 41 D8 C8 5F A5 47 6C 78 53 EB
|
|
|
|
|
0050 | E8 ED D1 3C 55 4A CB 57 D2 A3 C8 21 DB 86 0A C8
|
|
|
|
|
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 = 1120837177</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>08116D8C2473B64401000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1255813959294272513</td>
|
|
|
|
|
<td><code>0811B3CD1E75178AD5000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1275588650173172437</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>0442C85409000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1120424969</td>
|
|
|
|
|
<td><code>043F842D1D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1065626909</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>0442CE9E39000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1120837177</td>
|
|
|
|
|
<td><code>0447593F19000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1197031193</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>264206E42D004B77E82376A440D79E0F</code></td>
|
|
|
|
|
<td><code>57FFD72B59896B5190E19C978E8CBFE2</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>36C0747D7C984C5773984B10C2DE52A3</code></td>
|
|
|
|
|
<td><code>6B64540E204B8227923817F243DB6044</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>D4B796AE7EEB5965F05296B8CD811632</code> <code>3EAED50FFC80A8804ED19A8D5884546D</code></td>
|
|
|
|
|
<td><code>033CE0EDCCA941D8C85FA5476C7853EB</code> <code>E8EDD13C554ACB57D2A3C821DB860AC8</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1120837177</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 = 955FF5A908116D8C2473B644010000000442C854090000000442CE9E39000000264206E42D004B77E82376A440D79E0F36C0747D7C984C5773984B10C2DE52A3D4B796AE7EEB5965F05296B8CD8116323EAED50FFC80A8804ED19A8D5884546D02000000
|
|
|
|
|
random_padding_bytes = 81FD20ED98562D09FF752B332E9030BD19F278131FF6DC6E09B0B444D3EEA6488DCAAE8E6B10D4E664376303DC5B0A29EE6623856A1F43FEDAF4DDF46C08B97584A6FDA990C18F7661EF75164E82C3CEC5EE530307EF0A0F2765FC6B</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A90811B3CD1E75178AD5000000043F842D1D0000000447593F1900000057FFD72B59896B5190E19C978E8CBFE26B64540E204B8227923817F243DB6044033CE0EDCCA941D8C85FA5476C7853EBE8EDD13C554ACB57D2A3C821DB860AC802000000
|
|
|
|
|
random_padding_bytes = 1164F6CDFDAD771E45856EF60F3F1D0BF2086D39D7C7B130CF964C27E443BD02AC75EF01D1A24D7D7022A2B0E11135B1C680EF466F255507A51F2C3983CC608350EC19A154A7991BCB53CBA51FA74FE999967FE909273A66E47F3003</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 = BADF37EA080A7B56CFEF30AEB3395C03FED4209572F32CEE21347AE5A4738249B52AF03243F90B4FA83D9F9B4C7988D54DD3F141158225D60B244D1F70DD31945954ADA298ADFA944E955F0D2E2AA789E52623A54E2AB19EDF4C95DFB97BEEF8823DFA5285515FC3717F56C6012D8EE6FE2505B6CE343EB4183ABAB9214C22B115992CC0BD9C57732DA25AD8D6385156456F1B63B6A0F7139A5274CE3AB9A00EE9D657EE706F4A3BEE79CD4D856943A68D42A8727B233ECCEB76F8F86030EF57A90221679B031DEE07B929B7C597F77766AE1ADDC44610F0D9B71D034BF8F02CE913B9086428FFFC4770B96B027B48E863AC314DB586A76CCA03213565811FC2</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 8F02E46879B206D24A0879E7F3C98EB000FB71E2A3F706E5CED8DBAD106D02044C7A59C5CCFA880578FDE1CD01FA49E5D9C89661DA7B483EECF53EE8243B453E52D41E83A1576E127119955669ECC7F781152BB99C7BB2927550C77D504CD7AFDCC8951BDD54D294D659913DA79A2257BAF85D890483AABE94C5AF4F885778102AB72D11C00CB10820448EF9D43CADE2233ACDE0D7D4837DC9EC1F3186CC8EE5C36C08A5A84D27E992243971ACD74206B1AB3419D12A155BC5030113DCB348FF13D0C2D3477D636FB88D52909D167397EF110C172DDB44634264245C5D9C6F513D498F049C409AE647FC68D59B8254573217955EC63D3B51523D2BB5E26D24FC</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 A0 27 0B 00 55 7C 81 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 26 42 06 E4 2D 00 4B 77
|
|
|
|
|
0020 | E8 23 76 A4 40 D7 9E 0F 36 C0 74 7D 7C 98 4C 57
|
|
|
|
|
0030 | 73 98 4B 10 C2 DE 52 A3 04 42 C8 54 09 00 00 00
|
|
|
|
|
0040 | 04 42 CE 9E 39 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 BA DF 37 EA 08 0A 7B 56 CF EF 30 AE
|
|
|
|
|
0060 | B3 39 5C 03 FE D4 20 95 72 F3 2C EE 21 34 7A E5
|
|
|
|
|
0070 | A4 73 82 49 B5 2A F0 32 43 F9 0B 4F A8 3D 9F 9B
|
|
|
|
|
0080 | 4C 79 88 D5 4D D3 F1 41 15 82 25 D6 0B 24 4D 1F
|
|
|
|
|
0090 | 70 DD 31 94 59 54 AD A2 98 AD FA 94 4E 95 5F 0D
|
|
|
|
|
00A0 | 2E 2A A7 89 E5 26 23 A5 4E 2A B1 9E DF 4C 95 DF
|
|
|
|
|
00B0 | B9 7B EE F8 82 3D FA 52 85 51 5F C3 71 7F 56 C6
|
|
|
|
|
00C0 | 01 2D 8E E6 FE 25 05 B6 CE 34 3E B4 18 3A BA B9
|
|
|
|
|
00D0 | 21 4C 22 B1 15 99 2C C0 BD 9C 57 73 2D A2 5A D8
|
|
|
|
|
00E0 | D6 38 51 56 45 6F 1B 63 B6 A0 F7 13 9A 52 74 CE
|
|
|
|
|
00F0 | 3A B9 A0 0E E9 D6 57 EE 70 6F 4A 3B EE 79 CD 4D
|
|
|
|
|
0100 | 85 69 43 A6 8D 42 A8 72 7B 23 3E CC EB 76 F8 F8
|
|
|
|
|
0110 | 60 30 EF 57 A9 02 21 67 9B 03 1D EE 07 B9 29 B7
|
|
|
|
|
0120 | C5 97 F7 77 66 AE 1A DD C4 46 10 F0 D9 B7 1D 03
|
|
|
|
|
0130 | 4B F8 F0 2C E9 13 B9 08 64 28 FF FC 47 70 B9 6B
|
|
|
|
|
0140 | 02 7B 48 E8 63 AC 31 4D B5 86 A7 6C CA 03 21 35
|
|
|
|
|
0150 | 65 81 1F C2</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 C4 EC 05 00 B1 82 81 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 57 FF D7 2B 59 89 6B 51
|
|
|
|
|
0020 | 90 E1 9C 97 8E 8C BF E2 6B 64 54 0E 20 4B 82 27
|
|
|
|
|
0030 | 92 38 17 F2 43 DB 60 44 04 3F 84 2D 1D 00 00 00
|
|
|
|
|
0040 | 04 47 59 3F 19 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 8F 02 E4 68 79 B2 06 D2 4A 08 79 E7
|
|
|
|
|
0060 | F3 C9 8E B0 00 FB 71 E2 A3 F7 06 E5 CE D8 DB AD
|
|
|
|
|
0070 | 10 6D 02 04 4C 7A 59 C5 CC FA 88 05 78 FD E1 CD
|
|
|
|
|
0080 | 01 FA 49 E5 D9 C8 96 61 DA 7B 48 3E EC F5 3E E8
|
|
|
|
|
0090 | 24 3B 45 3E 52 D4 1E 83 A1 57 6E 12 71 19 95 56
|
|
|
|
|
00A0 | 69 EC C7 F7 81 15 2B B9 9C 7B B2 92 75 50 C7 7D
|
|
|
|
|
00B0 | 50 4C D7 AF DC C8 95 1B DD 54 D2 94 D6 59 91 3D
|
|
|
|
|
00C0 | A7 9A 22 57 BA F8 5D 89 04 83 AA BE 94 C5 AF 4F
|
|
|
|
|
00D0 | 88 57 78 10 2A B7 2D 11 C0 0C B1 08 20 44 8E F9
|
|
|
|
|
00E0 | D4 3C AD E2 23 3A CD E0 D7 D4 83 7D C9 EC 1F 31
|
|
|
|
|
00F0 | 86 CC 8E E5 C3 6C 08 A5 A8 4D 27 E9 92 24 39 71
|
|
|
|
|
0100 | AC D7 42 06 B1 AB 34 19 D1 2A 15 5B C5 03 01 13
|
|
|
|
|
0110 | DC B3 48 FF 13 D0 C2 D3 47 7D 63 6F B8 8D 52 90
|
|
|
|
|
0120 | 9D 16 73 97 EF 11 0C 17 2D DB 44 63 42 64 24 5C
|
|
|
|
|
0130 | 5D 9C 6F 51 3D 49 8F 04 9C 40 9A E6 47 FC 68 D5
|
|
|
|
|
0140 | 9B 82 54 57 32 17 95 5E C6 3D 3B 51 52 3D 2B B5
|
|
|
|
|
0150 | E2 6D 24 FC</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 = 81FD20ED98562D09FF752B332E9030BD19F278131FF6DC6E09B0B444D
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>A0270B00557C8166</code></td>
|
|
|
|
|
<td><code>C4EC0500B1828166</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 = 81FD20ED98562D09FF752B332E9030BD19F278131FF6DC6E09B0B444D
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>264206E42D004B77E82376A440D79E0F</code></td>
|
|
|
|
|
<td><code>57FFD72B59896B5190E19C978E8CBFE2</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>36C0747D7C984C5773984B10C2DE52A3</code></td>
|
|
|
|
|
<td><code>6B64540E204B8227923817F243DB6044</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>0442C85409000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1120424969</td>
|
|
|
|
|
<td><code>043F842D1D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1065626909</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>0442CE9E39000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1120837177</td>
|
|
|
|
|
<td><code>0447593F19000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1197031193</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 = 81FD20ED98562D09FF752B332E9030BD19F278131FF6DC6E09B0B444D
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE000100BADF37EA080A7B56CFEF30AE</code> <code>B3395C03FED4209572F32CEE21347AE5</code> <code>A4738249B52AF03243F90B4FA83D9F9B</code> <code>4C7988D54DD3F141158225D60B244D1F</code> <code>70DD31945954ADA298ADFA944E955F0D</code> <code>2E2AA789E52623A54E2AB19EDF4C95DF</code> <code>B97BEEF8823DFA5285515FC3717F56C6</code> <code>012D8EE6FE2505B6CE343EB4183ABAB9</code> <code>214C22B115992CC0BD9C57732DA25AD8</code> <code>D6385156456F1B63B6A0F7139A5274CE</code> <code>3AB9A00EE9D657EE706F4A3BEE79CD4D</code> <code>856943A68D42A8727B233ECCEB76F8F8</code> <code>6030EF57A90221679B031DEE07B929B7</code> <code>C597F77766AE1ADDC44610F0D9B71D03</code> <code>4BF8F02CE913B9086428FFFC4770B96B</code> <code>027B48E863AC314DB586A76CCA032135</code><br> <code>65811FC2</code></td>
|
|
|
|
|
<td><code>FE0001008F02E46879B206D24A0879E7</code> <code>F3C98EB000FB71E2A3F706E5CED8DBAD</code> <code>106D02044C7A59C5CCFA880578FDE1CD</code> <code>01FA49E5D9C89661DA7B483EECF53EE8</code> <code>243B453E52D41E83A1576E1271199556</code> <code>69ECC7F781152BB99C7BB2927550C77D</code> <code>504CD7AFDCC8951BDD54D294D659913D</code> <code>A79A2257BAF85D890483AABE94C5AF4F</code> <code>885778102AB72D11C00CB10820448EF9</code> <code>D43CADE2233ACDE0D7D4837DC9EC1F31</code> <code>86CC8EE5C36C08A5A84D27E992243971</code> <code>ACD74206B1AB3419D12A155BC5030113</code> <code>DCB348FF13D0C2D3477D636FB88D5290</code> <code>9D167397EF110C172DDB44634264245C</code> <code>5D9C6F513D498F049C409AE647FC68D5</code> <code>9B8254573217955EC63D3B51523D2BB5</code><br> <code>E26D24FC</code></td>
|
|
|
|
|
<td>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = 81FD20ED98562D09FF752B332E9030BD19F278131FF6DC6E09B0B444D
|
|
|
|
|
<h5><a class="anchor" href="#6-server-responds-with" id="6-server-responds-with" name="6-server-responds-with"><i class="anchor-icon"></i></a>6) Server responds with:</h5>
|
|
|
|
|
<!-- start server_DH_params_ok -->
|
|
|
|
|
<p>Received payload (excluding transport headers/trailers):</p>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 98 E0 62 56 7C 81 66
|
|
|
|
|
0010 | D8 02 00 00 5C 07 E8 D0 26 42 06 E4 2D 00 4B 77
|
|
|
|
|
0020 | E8 23 76 A4 40 D7 9E 0F 36 C0 74 7D 7C 98 4C 57
|
|
|
|
|
0030 | 73 98 4B 10 C2 DE 52 A3 FE 50 02 00 00 B3 3E 76
|
|
|
|
|
0040 | 84 B6 DF D1 E7 07 B3 35 FB 29 3C 5D 2C 25 BA 0D
|
|
|
|
|
0050 | 47 DF 1B C2 8F F3 60 40 D7 7D 48 AD E4 F4 41 85
|
|
|
|
|
0060 | AF AE 97 D8 88 C4 59 0C 39 CD 64 22 02 D2 D8 2E
|
|
|
|
|
0070 | 8D 2A 7C 14 3E 8D 87 B4 A3 9E 4A 0F 89 51 E9 F3
|
|
|
|
|
0080 | 56 E5 4F DB 91 74 00 BF 6A E3 AA 7A 54 12 2F 9C
|
|
|
|
|
0090 | B5 FC 0C FD FA 2F BD FB 7A 6C F1 D9 C4 26 1C DF
|
|
|
|
|
00A0 | DE DA 96 A0 32 B3 BA 14 4E 0F DC D0 A7 32 E5 B0
|
|
|
|
|
00B0 | 68 19 45 F4 A2 3D 8E E1 3F CB 93 61 88 84 E3 6D
|
|
|
|
|
00C0 | D3 58 AD 53 6E 98 F5 62 C8 6E 0E 80 0D 99 F9 5F
|
|
|
|
|
00D0 | 71 28 EC 00 17 D9 61 7D F2 AF DE C3 B3 02 C8 DA
|
|
|
|
|
00E0 | 5E 9B B8 1C 54 17 F1 DF 76 D7 90 09 E4 A3 5E F0
|
|
|
|
|
00F0 | F3 2F 87 83 3B 9D 77 FE 28 D7 EA A6 9C 22 F6 C1
|
|
|
|
|
0100 | A6 1F 82 83 8D 80 94 36 E4 F5 BB C3 64 E6 2E 92
|
|
|
|
|
0110 | 3F 9E 76 8C 63 88 B0 A5 67 1D DE D7 73 22 EC 12
|
|
|
|
|
0120 | F7 AD 0D 41 31 09 1A FF F8 C9 1B 97 6A 78 63 E6
|
|
|
|
|
0130 | 0D 56 0D 06 30 B7 F4 17 8C 45 0F 3B F6 20 39 10
|
|
|
|
|
0140 | 41 34 17 BE 23 E4 75 CE 7E 42 4A 08 F7 E2 DE AA
|
|
|
|
|
0150 | 16 9E A7 96 6F 29 37 0F 4B 10 19 C7 2B 50 48 8A
|
|
|
|
|
0160 | 37 B1 17 4D 76 E8 CB 9F 25 C0 01 42 0D 72 69 32
|
|
|
|
|
0170 | 54 94 76 1B D4 E8 08 E9 41 5F A8 30 F6 93 47 4B
|
|
|
|
|
0180 | 3F 94 C5 85 D0 C0 74 22 01 57 30 31 63 A9 70 EC
|
|
|
|
|
0190 | 95 D9 5A 8F 82 0A 2C 40 A7 51 C8 A4 17 56 E9 DC
|
|
|
|
|
01A0 | F6 14 98 7A 2F 7B 7D 93 AA D5 24 70 50 D3 C8 7C
|
|
|
|
|
01B0 | A1 50 73 CC 2B 03 67 61 6D 80 6B CA 86 CE AE 75
|
|
|
|
|
01C0 | 4C 5D DD 5B DC D5 EB C9 E4 65 4E D3 31 78 75 29
|
|
|
|
|
01D0 | FD 52 C5 79 A3 61 30 41 B5 61 11 4C 4C 5A 64 FF
|
|
|
|
|
01E0 | 5F B7 8F F3 AC 10 92 EF 41 89 F7 8A B7 16 27 7A
|
|
|
|
|
01F0 | 76 47 19 9C 6E B5 1B 6A 4B 79 E5 00 A3 0A 50 70
|
|
|
|
|
0200 | 2F 5F 04 33 96 74 0C 00 33 C1 EB 5F 6D 9E C1 88
|
|
|
|
|
0210 | B4 79 8E BF C9 C4 3B EF 7F 8F E6 15 BA 97 E6 18
|
|
|
|
|
0220 | 90 71 86 A8 0B D9 A2 05 AD FF BB 3F B1 97 47 F7
|
|
|
|
|
0230 | BD 6E BD 68 63 94 8A 68 D3 D2 7B EB 37 BD 98 2B
|
|
|
|
|
0240 | E7 8F DF 90 B9 43 56 40 37 4F 4E D3 09 C6 4A 92
|
|
|
|
|
0250 | DF 25 04 FB EF 07 53 4D F2 BB 3E F4 38 3B 1F B3
|
|
|
|
|
0260 | 90 18 48 4C 79 EE EF B0 BB 1A 49 D2 7B 2B 9A 5B
|
|
|
|
|
0270 | B4 93 E1 7E 36 90 D1 E2 C1 38 DC A1 59 76 9B 05
|
|
|
|
|
0280 | 57 0A CA 6F 38 36 F1 71 7A 1C 57 F9</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 7C 7F 46 B2 82 81 66
|
|
|
|
|
0010 | 78 02 00 00 5C 07 E8 D0 57 FF D7 2B 59 89 6B 51
|
|
|
|
|
0020 | 90 E1 9C 97 8E 8C BF E2 6B 64 54 0E 20 4B 82 27
|
|
|
|
|
0030 | 92 38 17 F2 43 DB 60 44 FE 50 02 00 3E EB 0A 9A
|
|
|
|
|
0040 | 1E 8C AF 4C 8A DB 0D 2C 73 14 FF F8 67 7A 6B 64
|
|
|
|
|
0050 | 23 3E 4A 15 8A D5 EF 32 46 87 15 FC FD 1B 4D 6D
|
|
|
|
|
0060 | C2 F8 44 BE 68 6E 87 58 2A 6D 8B F8 C4 86 0A AA
|
|
|
|
|
0070 | 25 D5 4B 9F 8D 99 E0 51 2D 61 91 43 E6 C6 5F 45
|
|
|
|
|
0080 | 0A B0 84 EC 6D 57 31 89 92 75 F5 07 DC 1D 51 23
|
|
|
|
|
0090 | 0F F8 62 FF 92 3F 8A E3 63 3C 88 71 3C BE 3D 2E
|
|
|
|
|
00A0 | 30 CA A8 C5 B2 0A 8C 58 F0 81 77 B1 09 20 87 2F
|
|
|
|
|
00B0 | 1E E4 26 BB 73 30 91 58 8E 18 0B 7C 39 7E 06 55
|
|
|
|
|
00C0 | 39 F4 FB 0A CF 87 9F 99 85 F2 80 02 32 0C 75 5E
|
|
|
|
|
00D0 | 9B 71 09 9D DC 0E F7 95 AC 1C F8 B4 14 89 CC 9E
|
|
|
|
|
00E0 | 64 F8 39 FF 81 9E 22 1F A2 E4 06 0D 1C E0 F5 C1
|
|
|
|
|
00F0 | 3C 8D 09 30 60 D9 6B 55 F5 2B D5 A1 FE 40 2F 93
|
|
|
|
|
0100 | 79 86 84 57 2D 45 44 74 4C 19 A2 52 5E 86 29 AA
|
|
|
|
|
0110 | 43 A5 B9 0A 2B 27 3A 68 6C 32 53 F8 2A F6 05 14
|
|
|
|
|
0120 | 3B AF E7 E0 F6 11 FA 9A 0C 46 81 BA AB 94 96 F1
|
|
|
|
|
0130 | 11 C8 9E 08 15 94 0D 6D 43 76 22 40 D7 C9 C2 24
|
|
|
|
|
0140 | F0 0E F5 10 4B BC 41 11 30 64 1D A7 6B D0 38 48
|
|
|
|
|
0150 | BD 6C 3C EF F2 EE 13 21 5B 85 64 DA 8F 03 25 3E
|
|
|
|
|
0160 | 0A CC CD BC 1D B1 8C C4 98 42 62 34 1E 8F 7C D4
|
|
|
|
|
0170 | B0 C9 27 8F C0 41 A8 5C A6 EA 83 10 4F 5F 03 4B
|
|
|
|
|
0180 | C2 15 C4 0D 75 1C 7D BE 03 EB DA 51 37 55 78 EE
|
|
|
|
|
0190 | 68 87 63 89 BE 28 13 D8 70 51 A1 C8 50 2B 03 A4
|
|
|
|
|
01A0 | EF FE 64 93 74 47 EA 28 CC 8D 65 5B C9 96 32 A1
|
|
|
|
|
01B0 | 18 91 DF 2F B5 75 63 50 85 CD 94 8F 83 86 04 FE
|
|
|
|
|
01C0 | A9 C1 99 40 E9 66 7F 17 FE A8 A5 C0 C3 D2 E4 20
|
|
|
|
|
01D0 | 72 62 03 77 45 BB 3E 87 34 46 B0 73 6B 73 DB 73
|
|
|
|
|
01E0 | 19 7B E9 61 F9 AC 38 D9 4B 45 C5 2C B9 32 8A 0A
|
|
|
|
|
01F0 | B8 F0 F2 F7 58 F3 4E 92 54 26 9C 52 4F 56 81 0B
|
|
|
|
|
0200 | 7D 45 B9 23 6D ED 33 A3 E1 D6 1B 0E 00 72 F2 5C
|
|
|
|
|
0210 | EB 33 5F A5 3C A5 2D EF DB 70 80 40 C1 E7 DA 6F
|
|
|
|
|
0220 | 67 75 51 91 17 BE AB 9E C4 90 33 80 49 79 DC F1
|
|
|
|
|
0230 | 98 97 FA 37 AC 52 C7 DC 17 73 09 67 49 66 FA 9C
|
|
|
|
|
0240 | D9 67 C9 5D C8 9E 24 8B DE 80 06 34 99 3C 35 ED
|
|
|
|
|
0250 | 8F 46 75 B8 F2 1D 7A A3 49 7C D0 DD C3 41 19 DB
|
|
|
|
|
0260 | 99 91 D3 37 0F 2B 93 5F 74 C8 C7 F4 4F 3F 1A 50
|
|
|
|
|
0270 | 62 0F 99 21 E3 88 B1 4D 8D 2D 35 0B AA 73 6A EA
|
|
|
|
|
0280 | 19 33 32 BD 76 7C 79 EF E1 2F 28 69</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 = 81FD20ED98562D09FF752B332E9030BD19F278131FF6DC6E09B0B444D
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>0198E062567C8166</code></td>
|
|
|
|
|
<td><code>017C7F46B2828166</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>D8020000</code> (728 in decimal)</td>
|
|
|
|
|
<td><code>78020000</code> (632 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -482,19 +482,19 @@ random_padding_bytes = 81FD20ED98562D09FF752B332E9030BD19F278131FF6DC6E09B0B444D
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>264206E42D004B77E82376A440D79E0F</code></td>
|
|
|
|
|
<td><code>57FFD72B59896B5190E19C978E8CBFE2</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>36C0747D7C984C5773984B10C2DE52A3</code></td>
|
|
|
|
|
<td><code>6B64540E204B8227923817F243DB6044</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE50020000B33E7684B6DFD1E707B335</code> <code>FB293C5D2C25BA0D47DF1BC28FF36040</code> <code>D77D48ADE4F44185AFAE97D888C4590C</code> <code>39CD642202D2D82E8D2A7C143E8D87B4</code> <code>A39E4A0F8951E9F356E54FDB917400BF</code> <code>6AE3AA7A54122F9CB5FC0CFDFA2FBDFB</code> <code>7A6CF1D9C4261CDFDEDA96A032B3BA14</code> <code>4E0FDCD0A732E5B0681945F4A23D8EE1</code> <code>3FCB93618884E36DD358AD536E98F562</code> <code>C86E0E800D99F95F7128EC0017D9617D</code> <code>F2AFDEC3B302C8DA5E9BB81C5417F1DF</code> <code>76D79009E4A35EF0F32F87833B9D77FE</code> <code>28D7EAA69C22F6C1A61F82838D809436</code> <code>E4F5BBC364E62E923F9E768C6388B0A5</code> <code>671DDED77322EC12F7AD0D4131091AFF</code> <code>F8C91B976A7863E60D560D0630B7F417</code> <code>8C450F3BF6203910413417BE23E475CE</code> <code>7E424A08F7E2DEAA169EA7966F29370F</code> <code>4B1019C72B50488A37B1174D76E8CB9F</code> <code>25C001420D7269325494761BD4E808E9</code> <code>415FA830F693474B3F94C585D0C07422</code> <code>0157303163A970EC95D95A8F820A2C40</code> <code>A751C8A41756E9DCF614987A2F7B7D93</code> <code>AAD5247050D3C87CA15073CC2B036761</code> <code>6D806BCA86CEAE754C5DDD5BDCD5EBC9</code> <code>E4654ED331787529FD52C579A3613041</code> <code>B561114C4C5A64FF5FB78FF3AC1092EF</code> <code>4189F78AB716277A7647199C6EB51B6A</code> <code>4B79E500A30A50702F5F043396740C00</code> <code>33C1EB5F6D9EC188B4798EBFC9C43BEF</code> <code>7F8FE615BA97E618907186A80BD9A205</code> <code>ADFFBB3FB19747F7BD6EBD6863948A68</code> <code>D3D27BEB37BD982BE78FDF90B9435640</code> <code>374F4ED309C64A92DF2504FBEF07534D</code> <code>F2BB3EF4383B1FB39018484C79EEEFB0</code> <code>BB1A49D27B2B9A5BB493E17E3690D1E2</code> <code>C138DCA159769B05570ACA6F3836F171</code><br> <code>7A1C57F9</code></td>
|
|
|
|
|
<td><code>FE5002003EEB0A9A1E8CAF4C8ADB0D2C</code> <code>7314FFF8677A6B64233E4A158AD5EF32</code> <code>468715FCFD1B4D6DC2F844BE686E8758</code> <code>2A6D8BF8C4860AAA25D54B9F8D99E051</code> <code>2D619143E6C65F450AB084EC6D573189</code> <code>9275F507DC1D51230FF862FF923F8AE3</code> <code>633C88713CBE3D2E30CAA8C5B20A8C58</code> <code>F08177B10920872F1EE426BB73309158</code> <code>8E180B7C397E065539F4FB0ACF879F99</code> <code>85F28002320C755E9B71099DDC0EF795</code> <code>AC1CF8B41489CC9E64F839FF819E221F</code> <code>A2E4060D1CE0F5C13C8D093060D96B55</code> <code>F52BD5A1FE402F93798684572D454474</code> <code>4C19A2525E8629AA43A5B90A2B273A68</code> <code>6C3253F82AF605143BAFE7E0F611FA9A</code> <code>0C4681BAAB9496F111C89E0815940D6D</code> <code>43762240D7C9C224F00EF5104BBC4111</code> <code>30641DA76BD03848BD6C3CEFF2EE1321</code> <code>5B8564DA8F03253E0ACCCDBC1DB18CC4</code> <code>984262341E8F7CD4B0C9278FC041A85C</code> <code>A6EA83104F5F034BC215C40D751C7DBE</code> <code>03EBDA51375578EE68876389BE2813D8</code> <code>7051A1C8502B03A4EFFE64937447EA28</code> <code>CC8D655BC99632A11891DF2FB5756350</code> <code>85CD948F838604FEA9C19940E9667F17</code> <code>FEA8A5C0C3D2E4207262037745BB3E87</code> <code>3446B0736B73DB73197BE961F9AC38D9</code> <code>4B45C52CB9328A0AB8F0F2F758F34E92</code> <code>54269C524F56810B7D45B9236DED33A3</code> <code>E1D61B0E0072F25CEB335FA53CA52DEF</code> <code>DB708040C1E7DA6F6775519117BEAB9E</code> <code>C49033804979DCF19897FA37AC52C7DC</code> <code>177309674966FA9CD967C95DC89E248B</code> <code>DE800634993C35ED8F4675B8F21D7AA3</code> <code>497CD0DDC34119DB9991D3370F2B935F</code> <code>74C8C7F44F3F1A50620F9921E388B14D</code> <code>8D2D350BAA736AEA193332BD767C79EF</code><br> <code>E12F2869</code></td>
|
|
|
|
|
<td>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = 81FD20ED98562D09FF752B332E9030BD19F278131FF6DC6E09B0B444D
|
|
|
|
|
<!-- 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 = 00B33E7684B6DFD1E707B335FB293C5D2C25BA0D47DF1BC28FF36040D77D48ADE4F44185AFAE97D888C4590C39CD642202D2D82E8D2A7C143E8D87B4A39E4A0F8951E9F356E54FDB917400BF6AE3AA7A54122F9CB5FC0CFDFA2FBDFB7A6CF1D9C4261CDFDEDA96A032B3BA144E0FDCD0A732E5B0681945F4A23D8EE13FCB93618884E36DD358AD536E98F562C86E0E800D99F95F7128EC0017D9617DF2AFDEC3B302C8DA5E9BB81C5417F1DF76D79009E4A35EF0F32F87833B9D77FE28D7EAA69C22F6C1A61F82838D809436E4F5BBC364E62E923F9E768C6388B0A5671DDED77322EC12F7AD0D4131091AFFF8C91B976A7863E60D560D0630B7F4178C450F3BF6203910413417BE23E475CE7E424A08F7E2DEAA169EA7966F29370F4B1019C72B50488A37B1174D76E8CB9F25C001420D7269325494761BD4E808E9415FA830F693474B3F94C585D0C074220157303163A970EC95D95A8F820A2C40A751C8A41756E9DCF614987A2F7B7D93AAD5247050D3C87CA15073CC2B0367616D806BCA86CEAE754C5DDD5BDCD5EBC9E4654ED331787529FD52C579A3613041B561114C4C5A64FF5FB78FF3AC1092EF4189F78AB716277A7647199C6EB51B6A4B79E500A30A50702F5F043396740C0033C1EB5F6D9EC188B4798EBFC9C43BEF7F8FE615BA97E618907186A80BD9A205ADFFBB3FB19747F7BD6EBD6863948A68D3D27BEB37BD982BE78FDF90B9435640374F4ED309C64A92DF2504FBEF07534DF2BB3EF4383B1FB39018484C79EEEFB0BB1A49D27B2B9A5BB493E17E3690D1E2C138DCA159769B05570ACA6F3836F1717A1C57F9
|
|
|
|
|
tmp_aes_key = 4DD1F82FEA74E6AC13FCFB1C34E05A6FDD50954939D0B647E93440DEA62C9CC7
|
|
|
|
|
tmp_aes_iv = 6EFD8D392FD679BB65A5D15EDD981946A61912D23CBBCDCFE92F867AD4B796AE</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = 3EEB0A9A1E8CAF4C8ADB0D2C7314FFF8677A6B64233E4A158AD5EF32468715FCFD1B4D6DC2F844BE686E87582A6D8BF8C4860AAA25D54B9F8D99E0512D619143E6C65F450AB084EC6D5731899275F507DC1D51230FF862FF923F8AE3633C88713CBE3D2E30CAA8C5B20A8C58F08177B10920872F1EE426BB733091588E180B7C397E065539F4FB0ACF879F9985F28002320C755E9B71099DDC0EF795AC1CF8B41489CC9E64F839FF819E221FA2E4060D1CE0F5C13C8D093060D96B55F52BD5A1FE402F93798684572D4544744C19A2525E8629AA43A5B90A2B273A686C3253F82AF605143BAFE7E0F611FA9A0C4681BAAB9496F111C89E0815940D6D43762240D7C9C224F00EF5104BBC411130641DA76BD03848BD6C3CEFF2EE13215B8564DA8F03253E0ACCCDBC1DB18CC4984262341E8F7CD4B0C9278FC041A85CA6EA83104F5F034BC215C40D751C7DBE03EBDA51375578EE68876389BE2813D87051A1C8502B03A4EFFE64937447EA28CC8D655BC99632A11891DF2FB575635085CD948F838604FEA9C19940E9667F17FEA8A5C0C3D2E4207262037745BB3E873446B0736B73DB73197BE961F9AC38D94B45C52CB9328A0AB8F0F2F758F34E9254269C524F56810B7D45B9236DED33A3E1D61B0E0072F25CEB335FA53CA52DEFDB708040C1E7DA6F6775519117BEAB9EC49033804979DCF19897FA37AC52C7DC177309674966FA9CD967C95DC89E248BDE800634993C35ED8F4675B8F21D7AA3497CD0DDC34119DB9991D3370F2B935F74C8C7F44F3F1A50620F9921E388B14D8D2D350BAA736AEA193332BD767C79EFE12F2869
|
|
|
|
|
tmp_aes_key = 9159A8DB860A0A9B604682F82791FFBE74EC747F62B5966D938E8DFBB6145E98
|
|
|
|
|
tmp_aes_iv = 74EF7917036C3F15F0C24FDDDE31E1F70F19BE75627A3F8D34E26A68033CE0ED</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = 74ED3105B9B3B74508A6D77BC119EF23D78BCE37BA0D89B5264206E42D004B77E82376A440D79E0F36C0747D7C984C5773984B10C2DE52A303000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001009573324A84D5A8E6175C56EDF0FED91478605A883C632548DC8812F1C127E55C0CEE23E1A8CBE9460CA2182A9AF1FF04433BE4B49B21023B65BEE5D23FD7C1315C771C2EC5CF71155D4F2F1AED657C9652EA758952D95CEAC0270C3449B37251C9AA338B4692B2A1E609F8583CA4C7AD0DC89BF0A90F0A2B34B27CE9DCBC02580C15DFBDA3F1F4A6FBC1882E1EC1B952C2F5196DBC31165F1F957256D50CC5C69CD23958478E82DE0126E76C877C2D9BCB4E810861E4E76267728CBB8E301DA44847CDB43A896D7B0CDEB4D717BAFEB88C05C5EC8A49E7F03960D02BF27059FA7174172B50C6C6C9D5B0116B73FDE40B74A05AC09B4602995583187D5DA52E2C567C8166628D172F1865EC85
|
|
|
|
|
answer = BA0D89B5264206E42D004B77E82376A440D79E0F36C0747D7C984C5773984B10C2DE52A303000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001009573324A84D5A8E6175C56EDF0FED91478605A883C632548DC8812F1C127E55C0CEE23E1A8CBE9460CA2182A9AF1FF04433BE4B49B21023B65BEE5D23FD7C1315C771C2EC5CF71155D4F2F1AED657C9652EA758952D95CEAC0270C3449B37251C9AA338B4692B2A1E609F8583CA4C7AD0DC89BF0A90F0A2B34B27CE9DCBC02580C15DFBDA3F1F4A6FBC1882E1EC1B952C2F5196DBC31165F1F957256D50CC5C69CD23958478E82DE0126E76C877C2D9BCB4E810861E4E76267728CBB8E301DA44847CDB43A896D7B0CDEB4D717BAFEB88C05C5EC8A49E7F03960D02BF27059FA7174172B50C6C6C9D5B0116B73FDE40B74A05AC09B4602995583187D5DA52E2C567C8166628D172F1865EC85</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = E07962CB735D4966E1687036A3DD4AD7AB1E855ABA0D89B557FFD72B59896B5190E19C978E8CBFE26B64540E204B8227923817F243DB604403000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010023012C6EA5D0A93B9E31C5BCF6F6AA17797C1D662A2A3B790FDCB8B19257871AE62AB5A78DE685DAF3C4B8118015AE3D6BD475AC6465DF170F0247FF057BE95DB7CF7D9882B8148AC631A040308448A26F80E80364659F3D6B2FF049882572B3D30347D3AF152AA81C0B5544F6C715C1A9ADCE36C32CCE230D4B1E5C008C0FD3D7C5B7C25F5A6E3C2F06B664DED71856A7E16EF068E7CE7BEEBE4EB7696CE224F20507CCC8CB090F76C0BA65EE9957B7228624BEE31CC7FE54EDE3289B48F3A76BA6470352A4628955BF13F5CF7B9F46EE922310E286F557120812B055B10AED531B8B834A4D99A2A9B39AC5D29DD0A7DCC70C2C0E46CA542216E48486E041DDB28281662C787CBBCCC96212
|
|
|
|
|
answer = BA0D89B557FFD72B59896B5190E19C978E8CBFE26B64540E204B8227923817F243DB604403000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010023012C6EA5D0A93B9E31C5BCF6F6AA17797C1D662A2A3B790FDCB8B19257871AE62AB5A78DE685DAF3C4B8118015AE3D6BD475AC6465DF170F0247FF057BE95DB7CF7D9882B8148AC631A040308448A26F80E80364659F3D6B2FF049882572B3D30347D3AF152AA81C0B5544F6C715C1A9ADCE36C32CCE230D4B1E5C008C0FD3D7C5B7C25F5A6E3C2F06B664DED71856A7E16EF068E7CE7BEEBE4EB7696CE224F20507CCC8CB090F76C0BA65EE9957B7228624BEE31CC7FE54EDE3289B48F3A76BA6470352A4628955BF13F5CF7B9F46EE922310E286F557120812B055B10AED531B8B834A4D99A2A9B39AC5D29DD0A7DCC70C2C0E46CA542216E48486E041DDB28281662C787CBBCCC96212</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 26 42 06 E4 2D 00 4B 77 E8 23 76 A4
|
|
|
|
|
0010 | 40 D7 9E 0F 36 C0 74 7D 7C 98 4C 57 73 98 4B 10
|
|
|
|
|
0020 | C2 DE 52 A3 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 57 FF D7 2B 59 89 6B 51 90 E1 9C 97
|
|
|
|
|
0010 | 8E 8C BF E2 6B 64 54 0E 20 4B 82 27 92 38 17 F2
|
|
|
|
|
0020 | 43 DB 60 44 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 = BA0D89B5264206E42D004B77E82376A440D79E0F36C0747D7C984C5773984B10C2DE52A
|
|
|
|
|
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 | 95 73 32 4A 84 D5 A8 E6 17 5C 56 ED F0 FE D9 14
|
|
|
|
|
0140 | 78 60 5A 88 3C 63 25 48 DC 88 12 F1 C1 27 E5 5C
|
|
|
|
|
0150 | 0C EE 23 E1 A8 CB E9 46 0C A2 18 2A 9A F1 FF 04
|
|
|
|
|
0160 | 43 3B E4 B4 9B 21 02 3B 65 BE E5 D2 3F D7 C1 31
|
|
|
|
|
0170 | 5C 77 1C 2E C5 CF 71 15 5D 4F 2F 1A ED 65 7C 96
|
|
|
|
|
0180 | 52 EA 75 89 52 D9 5C EA C0 27 0C 34 49 B3 72 51
|
|
|
|
|
0190 | C9 AA 33 8B 46 92 B2 A1 E6 09 F8 58 3C A4 C7 AD
|
|
|
|
|
01A0 | 0D C8 9B F0 A9 0F 0A 2B 34 B2 7C E9 DC BC 02 58
|
|
|
|
|
01B0 | 0C 15 DF BD A3 F1 F4 A6 FB C1 88 2E 1E C1 B9 52
|
|
|
|
|
01C0 | C2 F5 19 6D BC 31 16 5F 1F 95 72 56 D5 0C C5 C6
|
|
|
|
|
01D0 | 9C D2 39 58 47 8E 82 DE 01 26 E7 6C 87 7C 2D 9B
|
|
|
|
|
01E0 | CB 4E 81 08 61 E4 E7 62 67 72 8C BB 8E 30 1D A4
|
|
|
|
|
01F0 | 48 47 CD B4 3A 89 6D 7B 0C DE B4 D7 17 BA FE B8
|
|
|
|
|
0200 | 8C 05 C5 EC 8A 49 E7 F0 39 60 D0 2B F2 70 59 FA
|
|
|
|
|
0210 | 71 74 17 2B 50 C6 C6 C9 D5 B0 11 6B 73 FD E4 0B
|
|
|
|
|
0220 | 74 A0 5A C0 9B 46 02 99 55 83 18 7D 5D A5 2E 2C
|
|
|
|
|
0230 | 56 7C 81 66</code></pre>
|
|
|
|
|
0130 | 23 01 2C 6E A5 D0 A9 3B 9E 31 C5 BC F6 F6 AA 17
|
|
|
|
|
0140 | 79 7C 1D 66 2A 2A 3B 79 0F DC B8 B1 92 57 87 1A
|
|
|
|
|
0150 | E6 2A B5 A7 8D E6 85 DA F3 C4 B8 11 80 15 AE 3D
|
|
|
|
|
0160 | 6B D4 75 AC 64 65 DF 17 0F 02 47 FF 05 7B E9 5D
|
|
|
|
|
0170 | B7 CF 7D 98 82 B8 14 8A C6 31 A0 40 30 84 48 A2
|
|
|
|
|
0180 | 6F 80 E8 03 64 65 9F 3D 6B 2F F0 49 88 25 72 B3
|
|
|
|
|
0190 | D3 03 47 D3 AF 15 2A A8 1C 0B 55 44 F6 C7 15 C1
|
|
|
|
|
01A0 | A9 AD CE 36 C3 2C CE 23 0D 4B 1E 5C 00 8C 0F D3
|
|
|
|
|
01B0 | D7 C5 B7 C2 5F 5A 6E 3C 2F 06 B6 64 DE D7 18 56
|
|
|
|
|
01C0 | A7 E1 6E F0 68 E7 CE 7B EE BE 4E B7 69 6C E2 24
|
|
|
|
|
01D0 | F2 05 07 CC C8 CB 09 0F 76 C0 BA 65 EE 99 57 B7
|
|
|
|
|
01E0 | 22 86 24 BE E3 1C C7 FE 54 ED E3 28 9B 48 F3 A7
|
|
|
|
|
01F0 | 6B A6 47 03 52 A4 62 89 55 BF 13 F5 CF 7B 9F 46
|
|
|
|
|
0200 | EE 92 23 10 E2 86 F5 57 12 08 12 B0 55 B1 0A ED
|
|
|
|
|
0210 | 53 1B 8B 83 4A 4D 99 A2 A9 B3 9A C5 D2 9D D0 A7
|
|
|
|
|
0220 | DC C7 0C 2C 0E 46 CA 54 22 16 E4 84 86 E0 41 DD
|
|
|
|
|
0230 | B2 82 81 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 = BA0D89B5264206E42D004B77E82376A440D79E0F36C0747D7C984C5773984B10C2DE52A
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>264206E42D004B77E82376A440D79E0F</code></td>
|
|
|
|
|
<td><code>57FFD72B59896B5190E19C978E8CBFE2</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>36C0747D7C984C5773984B10C2DE52A3</code></td>
|
|
|
|
|
<td><code>6B64540E204B8227923817F243DB6044</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B5264206E42D004B77E82376A440D79E0F36C0747D7C984C5773984B10C2DE52A
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE0001009573324A84D5A8E6175C56ED</code> <code>F0FED91478605A883C632548DC8812F1</code> <code>C127E55C0CEE23E1A8CBE9460CA2182A</code> <code>9AF1FF04433BE4B49B21023B65BEE5D2</code> <code>3FD7C1315C771C2EC5CF71155D4F2F1A</code> <code>ED657C9652EA758952D95CEAC0270C34</code> <code>49B37251C9AA338B4692B2A1E609F858</code> <code>3CA4C7AD0DC89BF0A90F0A2B34B27CE9</code> <code>DCBC02580C15DFBDA3F1F4A6FBC1882E</code> <code>1EC1B952C2F5196DBC31165F1F957256</code> <code>D50CC5C69CD23958478E82DE0126E76C</code> <code>877C2D9BCB4E810861E4E76267728CBB</code> <code>8E301DA44847CDB43A896D7B0CDEB4D7</code> <code>17BAFEB88C05C5EC8A49E7F03960D02B</code> <code>F27059FA7174172B50C6C6C9D5B0116B</code> <code>73FDE40B74A05AC09B4602995583187D</code><br> <code>5DA52E2C</code></td>
|
|
|
|
|
<td><code>FE00010023012C6EA5D0A93B9E31C5BC</code> <code>F6F6AA17797C1D662A2A3B790FDCB8B1</code> <code>9257871AE62AB5A78DE685DAF3C4B811</code> <code>8015AE3D6BD475AC6465DF170F0247FF</code> <code>057BE95DB7CF7D9882B8148AC631A040</code> <code>308448A26F80E80364659F3D6B2FF049</code> <code>882572B3D30347D3AF152AA81C0B5544</code> <code>F6C715C1A9ADCE36C32CCE230D4B1E5C</code> <code>008C0FD3D7C5B7C25F5A6E3C2F06B664</code> <code>DED71856A7E16EF068E7CE7BEEBE4EB7</code> <code>696CE224F20507CCC8CB090F76C0BA65</code> <code>EE9957B7228624BEE31CC7FE54EDE328</code> <code>9B48F3A76BA6470352A4628955BF13F5</code> <code>CF7B9F46EE922310E286F557120812B0</code> <code>55B10AED531B8B834A4D99A2A9B39AC5</code> <code>D29DD0A7DCC70C2C0E46CA542216E484</code><br> <code>86E041DD</code></td>
|
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>567C8166</code> (1719762006 in decimal)</td>
|
|
|
|
|
<td><code>B2828166</code> (1719763634 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B5264206E42D004B77E82376A440D79E0F36C0747D7C984C5773984B10C2DE52A
|
|
|
|
|
<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 = F551A3F288F2CA7F5A5924BAAF6DB4A08D9B6F4C10AE64B370B38B6C9FEA4BA75DF1C42394C3575A78368AE5CA760659C4E0B13C3E984D31DD131A2B1C42B7B149BFA859C7DA7802A07685FA3AEB6F3A1275F1A6DD8CEE8CEAE1B74F7CC8956CBDE115EBFE8B0AA6B9130488D6F34474AF2159CCD1E814A024377473D4991B936C8EAB8013F937459EEAFCC02A69F4CC4932423675854D5C1CF092F2027BA1B3395500D539755C79A9C4976B22ED71A31046AC779B9469BAD0D7BE7E80012DF586B50E0A9325992248E3FD6E94FC7A734A283C5C4F5AD6E26DC8C360E0334AC07D97AAD849403FC12F739462934B69E12F7DB1EE95BA211F8C070FEC9C94D6E9</code></pre>
|
|
|
|
|
<pre><code>b = C7ACF73FAAD55EC2BC25D249F24E52E98DE42CEC5CE2DD27CF3948088DEA9F8CA143DA47077998BA309A081D8D09DD2B9D9DCF6A05B2F1A2A93A632F2BA2CEF301551B043BE6A829C103A6438753E989E483083BD0C36C96BD4C374EE6ECCF66243EAD18376173EF57AC956D283D37D5B33059B9C13EF59BB046B05180F2228617FBA2996A4AF1CE680F6A601BA3B3990E3F9AF89DFFAE73102A3B346B7D7F74B6380AB7D6A89F04263DE44B9D17D937E604272C85D8A961627652B5473B02388A5E8D1BBF41BA72F40E3072F4E2B36D12EFD01B549CCEAD3760E33D6E8D1062BC21D662AD29B80FEE0DC355D1C84BD429047B2276156662D3F5652FA0571A3C</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 = 1C9203526D093C160AE19CCB14102BE896EDBD35E93EB19B1F6984BBFCFC0408256DD9EE1EB33181BE534CE5654AAEA706F84C3735F82945B4257FC6E47064E5E71C04E88547F662F3AC7BFCD38C37FF65971B32800AB57C4F3A26EBD19B23F17EDCC2F23546F021A4B096CEB00DC3FB875A3C56C6CA4B5F2254656EEA259B0AFA64BF0F6B9345699DC6B97728FDABECE8CDFE6B42142126BB17AD195951AD0094C0D0E64BA9ACC6B86C232649D2C937B6C4CFB3192BCC93C0E614DB39786F5D7CAB1422B45147978EAAAD21D34448E51B5038D6600E2DBA14F7E8F6265BAFDFE6A83763517DB1F6FA36114C347B7F0E371ED379F47A008407B3772BFE3B6AD4</code></pre>
|
|
|
|
|
<pre><code>g_b = 4438D9C6D8E85C53B620CD40CA6510C36E91922641F2D5CA5CB08A19A52320341A9074BAFC4AF4DB183FF961C79091C9545A17FA892E76DA7D49C66581ADFCE8595497C593F87221456CE0705484CD0A6998C102DFC419C15527312A4B5B19004688D7BAFB372E2D47D26009BD581C2BC564864B9E34615E54BA89DBCEE94FA506109A76762503428CA9AA7E89BCB4BD41984EB396BB3526260D348B2B153D9B456C6E065E28DF971E8A25ACB2E7D921CBF26B1088B6DF49D86288AAA9AD180BA29F84CD4DFD17F58A579E5CA8C375FDA6862299F6B795A1A1629523BB2009C81D5D8D7FB7F6291A221A6FE385FD4ACA34238B879F3C24C1A90DAB933573BE9F</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 26 42 06 E4 2D 00 4B 77 E8 23 76 A4
|
|
|
|
|
0010 | 40 D7 9E 0F 36 C0 74 7D 7C 98 4C 57 73 98 4B 10
|
|
|
|
|
0020 | C2 DE 52 A3 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 1C 92 03 52 6D 09 3C 16 0A E1 9C CB 14 10 2B E8
|
|
|
|
|
0040 | 96 ED BD 35 E9 3E B1 9B 1F 69 84 BB FC FC 04 08
|
|
|
|
|
0050 | 25 6D D9 EE 1E B3 31 81 BE 53 4C E5 65 4A AE A7
|
|
|
|
|
0060 | 06 F8 4C 37 35 F8 29 45 B4 25 7F C6 E4 70 64 E5
|
|
|
|
|
0070 | E7 1C 04 E8 85 47 F6 62 F3 AC 7B FC D3 8C 37 FF
|
|
|
|
|
0080 | 65 97 1B 32 80 0A B5 7C 4F 3A 26 EB D1 9B 23 F1
|
|
|
|
|
0090 | 7E DC C2 F2 35 46 F0 21 A4 B0 96 CE B0 0D C3 FB
|
|
|
|
|
00A0 | 87 5A 3C 56 C6 CA 4B 5F 22 54 65 6E EA 25 9B 0A
|
|
|
|
|
00B0 | FA 64 BF 0F 6B 93 45 69 9D C6 B9 77 28 FD AB EC
|
|
|
|
|
00C0 | E8 CD FE 6B 42 14 21 26 BB 17 AD 19 59 51 AD 00
|
|
|
|
|
00D0 | 94 C0 D0 E6 4B A9 AC C6 B8 6C 23 26 49 D2 C9 37
|
|
|
|
|
00E0 | B6 C4 CF B3 19 2B CC 93 C0 E6 14 DB 39 78 6F 5D
|
|
|
|
|
00F0 | 7C AB 14 22 B4 51 47 97 8E AA AD 21 D3 44 48 E5
|
|
|
|
|
0100 | 1B 50 38 D6 60 0E 2D BA 14 F7 E8 F6 26 5B AF DF
|
|
|
|
|
0110 | E6 A8 37 63 51 7D B1 F6 FA 36 11 4C 34 7B 7F 0E
|
|
|
|
|
0120 | 37 1E D3 79 F4 7A 00 84 07 B3 77 2B FE 3B 6A D4</code></pre>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 57 FF D7 2B 59 89 6B 51 90 E1 9C 97
|
|
|
|
|
0010 | 8E 8C BF E2 6B 64 54 0E 20 4B 82 27 92 38 17 F2
|
|
|
|
|
0020 | 43 DB 60 44 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 44 38 D9 C6 D8 E8 5C 53 B6 20 CD 40 CA 65 10 C3
|
|
|
|
|
0040 | 6E 91 92 26 41 F2 D5 CA 5C B0 8A 19 A5 23 20 34
|
|
|
|
|
0050 | 1A 90 74 BA FC 4A F4 DB 18 3F F9 61 C7 90 91 C9
|
|
|
|
|
0060 | 54 5A 17 FA 89 2E 76 DA 7D 49 C6 65 81 AD FC E8
|
|
|
|
|
0070 | 59 54 97 C5 93 F8 72 21 45 6C E0 70 54 84 CD 0A
|
|
|
|
|
0080 | 69 98 C1 02 DF C4 19 C1 55 27 31 2A 4B 5B 19 00
|
|
|
|
|
0090 | 46 88 D7 BA FB 37 2E 2D 47 D2 60 09 BD 58 1C 2B
|
|
|
|
|
00A0 | C5 64 86 4B 9E 34 61 5E 54 BA 89 DB CE E9 4F A5
|
|
|
|
|
00B0 | 06 10 9A 76 76 25 03 42 8C A9 AA 7E 89 BC B4 BD
|
|
|
|
|
00C0 | 41 98 4E B3 96 BB 35 26 26 0D 34 8B 2B 15 3D 9B
|
|
|
|
|
00D0 | 45 6C 6E 06 5E 28 DF 97 1E 8A 25 AC B2 E7 D9 21
|
|
|
|
|
00E0 | CB F2 6B 10 88 B6 DF 49 D8 62 88 AA A9 AD 18 0B
|
|
|
|
|
00F0 | A2 9F 84 CD 4D FD 17 F5 8A 57 9E 5C A8 C3 75 FD
|
|
|
|
|
0100 | A6 86 22 99 F6 B7 95 A1 A1 62 95 23 BB 20 09 C8
|
|
|
|
|
0110 | 1D 5D 8D 7F B7 F6 29 1A 22 1A 6F E3 85 FD 4A CA
|
|
|
|
|
0120 | 34 23 8B 87 9F 3C 24 C1 A9 0D AB 93 35 73 BE 9F</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 = BA0D89B5264206E42D004B77E82376A440D79E0F36C0747D7C984C5773984B10C2DE52A
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>264206E42D004B77E82376A440D79E0F</code></td>
|
|
|
|
|
<td><code>57FFD72B59896B5190E19C978E8CBFE2</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>36C0747D7C984C5773984B10C2DE52A3</code></td>
|
|
|
|
|
<td><code>6B64540E204B8227923817F243DB6044</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE0001001C9203526D093C160AE19CCB</code> <code>14102BE896EDBD35E93EB19B1F6984BB</code> <code>FCFC0408256DD9EE1EB33181BE534CE5</code> <code>654AAEA706F84C3735F82945B4257FC6</code> <code>E47064E5E71C04E88547F662F3AC7BFC</code> <code>D38C37FF65971B32800AB57C4F3A26EB</code> <code>D19B23F17EDCC2F23546F021A4B096CE</code> <code>B00DC3FB875A3C56C6CA4B5F2254656E</code> <code>EA259B0AFA64BF0F6B9345699DC6B977</code> <code>28FDABECE8CDFE6B42142126BB17AD19</code> <code>5951AD0094C0D0E64BA9ACC6B86C2326</code> <code>49D2C937B6C4CFB3192BCC93C0E614DB</code> <code>39786F5D7CAB1422B45147978EAAAD21</code> <code>D34448E51B5038D6600E2DBA14F7E8F6</code> <code>265BAFDFE6A83763517DB1F6FA36114C</code> <code>347B7F0E371ED379F47A008407B3772B</code><br> <code>FE3B6AD4</code></td>
|
|
|
|
|
<td><code>FE0001004438D9C6D8E85C53B620CD40</code> <code>CA6510C36E91922641F2D5CA5CB08A19</code> <code>A52320341A9074BAFC4AF4DB183FF961</code> <code>C79091C9545A17FA892E76DA7D49C665</code> <code>81ADFCE8595497C593F87221456CE070</code> <code>5484CD0A6998C102DFC419C15527312A</code> <code>4B5B19004688D7BAFB372E2D47D26009</code> <code>BD581C2BC564864B9E34615E54BA89DB</code> <code>CEE94FA506109A76762503428CA9AA7E</code> <code>89BCB4BD41984EB396BB3526260D348B</code> <code>2B153D9B456C6E065E28DF971E8A25AC</code> <code>B2E7D921CBF26B1088B6DF49D86288AA</code> <code>A9AD180BA29F84CD4DFD17F58A579E5C</code> <code>A8C375FDA6862299F6B795A1A1629523</code> <code>BB2009C81D5D8D7FB7F6291A221A6FE3</code> <code>85FD4ACA34238B879F3C24C1A90DAB93</code><br> <code>3573BE9F</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 = BA0D89B5264206E42D004B77E82376A440D79E0F36C0747D7C984C5773984B10C2DE52A
|
|
|
|
|
<!-- 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 = 54B64366264206E42D004B77E82376A440D79E0F36C0747D7C984C5773984B10C2DE52A30000000000000000FE0001001C9203526D093C160AE19CCB14102BE896EDBD35E93EB19B1F6984BBFCFC0408256DD9EE1EB33181BE534CE5654AAEA706F84C3735F82945B4257FC6E47064E5E71C04E88547F662F3AC7BFCD38C37FF65971B32800AB57C4F3A26EBD19B23F17EDCC2F23546F021A4B096CEB00DC3FB875A3C56C6CA4B5F2254656EEA259B0AFA64BF0F6B9345699DC6B97728FDABECE8CDFE6B42142126BB17AD195951AD0094C0D0E64BA9ACC6B86C232649D2C937B6C4CFB3192BCC93C0E614DB39786F5D7CAB1422B45147978EAAAD21D34448E51B5038D6600E2DBA14F7E8F6265BAFDFE6A83763517DB1F6FA36114C347B7F0E371ED379F47A008407B3772BFE3B6AD4
|
|
|
|
|
padding = 65264F208203F02A43C83301
|
|
|
|
|
tmp_aes_key = 4DD1F82FEA74E6AC13FCFB1C34E05A6FDD50954939D0B647E93440DEA62C9CC7
|
|
|
|
|
tmp_aes_iv = 6EFD8D392FD679BB65A5D15EDD981946A61912D23CBBCDCFE92F867AD4B796AE</code></pre>
|
|
|
|
|
<pre><code>data = 54B6436657FFD72B59896B5190E19C978E8CBFE26B64540E204B8227923817F243DB60440000000000000000FE0001004438D9C6D8E85C53B620CD40CA6510C36E91922641F2D5CA5CB08A19A52320341A9074BAFC4AF4DB183FF961C79091C9545A17FA892E76DA7D49C66581ADFCE8595497C593F87221456CE0705484CD0A6998C102DFC419C15527312A4B5B19004688D7BAFB372E2D47D26009BD581C2BC564864B9E34615E54BA89DBCEE94FA506109A76762503428CA9AA7E89BCB4BD41984EB396BB3526260D348B2B153D9B456C6E065E28DF971E8A25ACB2E7D921CBF26B1088B6DF49D86288AAA9AD180BA29F84CD4DFD17F58A579E5CA8C375FDA6862299F6B795A1A1629523BB2009C81D5D8D7FB7F6291A221A6FE385FD4ACA34238B879F3C24C1A90DAB933573BE9F
|
|
|
|
|
padding = 067B0B9E115DD5BC7C77480A
|
|
|
|
|
tmp_aes_key = 9159A8DB860A0A9B604682F82791FFBE74EC747F62B5966D938E8DFBB6145E98
|
|
|
|
|
tmp_aes_iv = 74EF7917036C3F15F0C24FDDDE31E1F70F19BE75627A3F8D34E26A68033CE0ED</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 = 4D067B75538C141F45F0E658C3E0560239D75E2650BB0D4DD703C657D98EEE6F93C30E77F40730BA0A4A3374D4867F701069203481B225ED5B8235F789D3653CCF5D5673CD4E93953DB0E0174C565FF90D5CDDCED2167647E77C0617BCB22AED94CF17F98EF5D50CC498745AED4BED6DAF4A33F5FFC4389DB08069821BC82041D702AE603900CDD6A37D40323A2A969F4E5C8CE92778521B4860AE458E8E14C114CAB523D92169D98C1DBBC9D4A995AB2FCBEAC08307116A87744B9CE0B828138A11F00BBCF10AB42A401DB152E99C08E4DED2C3371B98BE001C736F098ACF118A5DC1DB1CF356292A900D66396196E86A1100E86492900B7607C67AA1EDA333E732926C54CF6292DEC9BC17ECDD289FD25E6F299D6A811AB8D5BF0CEE12A2E20B902E98C87378206D46F1DFE65395E7F46AADD0942772622C73F57EE36FBF5A4582F69EE3D9D676FF2B8AA39EFE8F8B</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = D79D7C54BE1516433C014E683E8A9BD171533D9482BBB6F34C7F508E29EFAF7CBE97A2001755C934A082A2907952D14597B365D3ED4F710F479005083BC61194FE08788C6FEC66395B6687098F134FD910DC79CE645CEC0FC8B4B5E73E9D65CD4485C1E390D4435647E2F067209FDA29D11575099B6B9A12B380992F5048F11599E905B3200358579A2F9314F70548CC4F40778103A256465347D2E0D14B3D5BA538AD6FB6D4B124BD2D0BB0B0E7C850CAEAC6553F83326779443A6DD33D26F534205D072852BE4E010CC1AEFBD93EE4E75C45BF5703F9919FFD30C363170ED7AFD4BCC26FA6D167490AA61604389F564671ECF1CD3E21EBECE54167619E32A2027E15E14F76E17FD53B3E0F35D64BF1DC8D7E786B8A127BBB2077CAFA036F4E7AEB3D06BF495B0DC4973BD13FD82C19B9D545004093472205A83D264C06479E36C684C908519832508C1C9B25B37637</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 F8 07 04 00 57 7C 81 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 26 42 06 E4 2D 00 4B 77
|
|
|
|
|
0020 | E8 23 76 A4 40 D7 9E 0F 36 C0 74 7D 7C 98 4C 57
|
|
|
|
|
0030 | 73 98 4B 10 C2 DE 52 A3 FE 50 01 00 4D 06 7B 75
|
|
|
|
|
0040 | 53 8C 14 1F 45 F0 E6 58 C3 E0 56 02 39 D7 5E 26
|
|
|
|
|
0050 | 50 BB 0D 4D D7 03 C6 57 D9 8E EE 6F 93 C3 0E 77
|
|
|
|
|
0060 | F4 07 30 BA 0A 4A 33 74 D4 86 7F 70 10 69 20 34
|
|
|
|
|
0070 | 81 B2 25 ED 5B 82 35 F7 89 D3 65 3C CF 5D 56 73
|
|
|
|
|
0080 | CD 4E 93 95 3D B0 E0 17 4C 56 5F F9 0D 5C DD CE
|
|
|
|
|
0090 | D2 16 76 47 E7 7C 06 17 BC B2 2A ED 94 CF 17 F9
|
|
|
|
|
00A0 | 8E F5 D5 0C C4 98 74 5A ED 4B ED 6D AF 4A 33 F5
|
|
|
|
|
00B0 | FF C4 38 9D B0 80 69 82 1B C8 20 41 D7 02 AE 60
|
|
|
|
|
00C0 | 39 00 CD D6 A3 7D 40 32 3A 2A 96 9F 4E 5C 8C E9
|
|
|
|
|
00D0 | 27 78 52 1B 48 60 AE 45 8E 8E 14 C1 14 CA B5 23
|
|
|
|
|
00E0 | D9 21 69 D9 8C 1D BB C9 D4 A9 95 AB 2F CB EA C0
|
|
|
|
|
00F0 | 83 07 11 6A 87 74 4B 9C E0 B8 28 13 8A 11 F0 0B
|
|
|
|
|
0100 | BC F1 0A B4 2A 40 1D B1 52 E9 9C 08 E4 DE D2 C3
|
|
|
|
|
0110 | 37 1B 98 BE 00 1C 73 6F 09 8A CF 11 8A 5D C1 DB
|
|
|
|
|
0120 | 1C F3 56 29 2A 90 0D 66 39 61 96 E8 6A 11 00 E8
|
|
|
|
|
0130 | 64 92 90 0B 76 07 C6 7A A1 ED A3 33 E7 32 92 6C
|
|
|
|
|
0140 | 54 CF 62 92 DE C9 BC 17 EC DD 28 9F D2 5E 6F 29
|
|
|
|
|
0150 | 9D 6A 81 1A B8 D5 BF 0C EE 12 A2 E2 0B 90 2E 98
|
|
|
|
|
0160 | C8 73 78 20 6D 46 F1 DF E6 53 95 E7 F4 6A AD D0
|
|
|
|
|
0170 | 94 27 72 62 2C 73 F5 7E E3 6F BF 5A 45 82 F6 9E
|
|
|
|
|
0180 | E3 D9 D6 76 FF 2B 8A A3 9E FE 8F 8B</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 E4 2E 05 00 B2 82 81 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 57 FF D7 2B 59 89 6B 51
|
|
|
|
|
0020 | 90 E1 9C 97 8E 8C BF E2 6B 64 54 0E 20 4B 82 27
|
|
|
|
|
0030 | 92 38 17 F2 43 DB 60 44 FE 50 01 00 D7 9D 7C 54
|
|
|
|
|
0040 | BE 15 16 43 3C 01 4E 68 3E 8A 9B D1 71 53 3D 94
|
|
|
|
|
0050 | 82 BB B6 F3 4C 7F 50 8E 29 EF AF 7C BE 97 A2 00
|
|
|
|
|
0060 | 17 55 C9 34 A0 82 A2 90 79 52 D1 45 97 B3 65 D3
|
|
|
|
|
0070 | ED 4F 71 0F 47 90 05 08 3B C6 11 94 FE 08 78 8C
|
|
|
|
|
0080 | 6F EC 66 39 5B 66 87 09 8F 13 4F D9 10 DC 79 CE
|
|
|
|
|
0090 | 64 5C EC 0F C8 B4 B5 E7 3E 9D 65 CD 44 85 C1 E3
|
|
|
|
|
00A0 | 90 D4 43 56 47 E2 F0 67 20 9F DA 29 D1 15 75 09
|
|
|
|
|
00B0 | 9B 6B 9A 12 B3 80 99 2F 50 48 F1 15 99 E9 05 B3
|
|
|
|
|
00C0 | 20 03 58 57 9A 2F 93 14 F7 05 48 CC 4F 40 77 81
|
|
|
|
|
00D0 | 03 A2 56 46 53 47 D2 E0 D1 4B 3D 5B A5 38 AD 6F
|
|
|
|
|
00E0 | B6 D4 B1 24 BD 2D 0B B0 B0 E7 C8 50 CA EA C6 55
|
|
|
|
|
00F0 | 3F 83 32 67 79 44 3A 6D D3 3D 26 F5 34 20 5D 07
|
|
|
|
|
0100 | 28 52 BE 4E 01 0C C1 AE FB D9 3E E4 E7 5C 45 BF
|
|
|
|
|
0110 | 57 03 F9 91 9F FD 30 C3 63 17 0E D7 AF D4 BC C2
|
|
|
|
|
0120 | 6F A6 D1 67 49 0A A6 16 04 38 9F 56 46 71 EC F1
|
|
|
|
|
0130 | CD 3E 21 EB EC E5 41 67 61 9E 32 A2 02 7E 15 E1
|
|
|
|
|
0140 | 4F 76 E1 7F D5 3B 3E 0F 35 D6 4B F1 DC 8D 7E 78
|
|
|
|
|
0150 | 6B 8A 12 7B BB 20 77 CA FA 03 6F 4E 7A EB 3D 06
|
|
|
|
|
0160 | BF 49 5B 0D C4 97 3B D1 3F D8 2C 19 B9 D5 45 00
|
|
|
|
|
0170 | 40 93 47 22 05 A8 3D 26 4C 06 47 9E 36 C6 84 C9
|
|
|
|
|
0180 | 08 51 98 32 50 8C 1C 9B 25 B3 76 37</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>F8070400577C8166</code></td>
|
|
|
|
|
<td><code>E42E0500B2828166</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>264206E42D004B77E82376A440D79E0F</code></td>
|
|
|
|
|
<td><code>57FFD72B59896B5190E19C978E8CBFE2</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>36C0747D7C984C5773984B10C2DE52A3</code></td>
|
|
|
|
|
<td><code>6B64540E204B8227923817F243DB6044</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE5001004D067B75538C141F45F0E658</code> <code>C3E0560239D75E2650BB0D4DD703C657</code> <code>D98EEE6F93C30E77F40730BA0A4A3374</code> <code>D4867F701069203481B225ED5B8235F7</code> <code>89D3653CCF5D5673CD4E93953DB0E017</code> <code>4C565FF90D5CDDCED2167647E77C0617</code> <code>BCB22AED94CF17F98EF5D50CC498745A</code> <code>ED4BED6DAF4A33F5FFC4389DB0806982</code> <code>1BC82041D702AE603900CDD6A37D4032</code> <code>3A2A969F4E5C8CE92778521B4860AE45</code> <code>8E8E14C114CAB523D92169D98C1DBBC9</code> <code>D4A995AB2FCBEAC08307116A87744B9C</code> <code>E0B828138A11F00BBCF10AB42A401DB1</code> <code>52E99C08E4DED2C3371B98BE001C736F</code> <code>098ACF118A5DC1DB1CF356292A900D66</code> <code>396196E86A1100E86492900B7607C67A</code> <code>A1EDA333E732926C54CF6292DEC9BC17</code> <code>ECDD289FD25E6F299D6A811AB8D5BF0C</code> <code>EE12A2E20B902E98C87378206D46F1DF</code> <code>E65395E7F46AADD0942772622C73F57E</code> <code>E36FBF5A4582F69EE3D9D676FF2B8AA3</code><br> <code>9EFE8F8B</code></td>
|
|
|
|
|
<td><code>FE500100D79D7C54BE1516433C014E68</code> <code>3E8A9BD171533D9482BBB6F34C7F508E</code> <code>29EFAF7CBE97A2001755C934A082A290</code> <code>7952D14597B365D3ED4F710F47900508</code> <code>3BC61194FE08788C6FEC66395B668709</code> <code>8F134FD910DC79CE645CEC0FC8B4B5E7</code> <code>3E9D65CD4485C1E390D4435647E2F067</code> <code>209FDA29D11575099B6B9A12B380992F</code> <code>5048F11599E905B3200358579A2F9314</code> <code>F70548CC4F40778103A256465347D2E0</code> <code>D14B3D5BA538AD6FB6D4B124BD2D0BB0</code> <code>B0E7C850CAEAC6553F83326779443A6D</code> <code>D33D26F534205D072852BE4E010CC1AE</code> <code>FBD93EE4E75C45BF5703F9919FFD30C3</code> <code>63170ED7AFD4BCC26FA6D167490AA616</code> <code>04389F564671ECF1CD3E21EBECE54167</code> <code>619E32A2027E15E14F76E17FD53B3E0F</code> <code>35D64BF1DC8D7E786B8A127BBB2077CA</code> <code>FA036F4E7AEB3D06BF495B0DC4973BD1</code> <code>3FD82C19B9D545004093472205A83D26</code> <code>4C06479E36C684C908519832508C1C9B</code><br> <code>25B37637</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 = B90DF59DA1482FBB5709B1743A6F49814EF1AC233B51F191FACAB22627198EF3832C9748BF8B72D795961EA32B745C04F749E52A5CB001B5242849BA1AD45C467490CCD941AA8F2D4D5A16A42AA999B7B9184244FAAC385DE2F1A35177523A6CDDF7AAF78B9312DCE2D0DF39D9E691CFC69CCA363A70D1ECEA58E7A9FF40F62914DE8EF2F524EFBE7F7DD8A43F4B8A83196193546F2DBC6706A7D78F7D36EF4C9356F8CED0D09600F9125C88D48F2D292DE98CF6B6000548803C5060084B2935C37A26F9A102B2A9147E7EA29BF2E2AD7B303B84DD92D1790B05868266B615E8BE6BD61441B58D422B4FCD9B8CBB0216D83A890A5B01F6DFC1C602BC68F3329A</code></pre>
|
|
|
|
|
<pre><code>auth_key = 542AAE70CE79C1193CD0BC2C17D7876148CA0B61AB833432A8272C40904DCE79EDBB351D9F9838DDB4026D30A52B31F623301C3CBE31E15ABC252C478C18BC71EF2091226F11BB4AFCCFE8F1523F7C9078D3565C658F7622792CF3826DE5B5936C8FBA47C4B0A420E4B743181114EF51E768666B599CB45C2ED2DE5D4666150B3501337E90BC56855A72BEE32951FB851A7F37BE9C507C01845C891B6724500A3A08F95E16967CBE4C1FC5EE0B839AE3DDDCC3225B7F96445C0EA4F28EBA33FBC578EB8482FEE6540D361125B8D08C09EAF63DB8988D0CBFAD85AEAAD3F1915E465950780F11C511E17DA357A9004BD75498D28B5D1751C01754EA0FA3D3816F</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 0C 15 35 58 7C 81 66
|
|
|
|
|
0010 | 8C 00 00 00 34 F7 CB 3B 26 42 06 E4 2D 00 4B 77
|
|
|
|
|
0020 | E8 23 76 A4 40 D7 9E 0F 36 C0 74 7D 7C 98 4C 57
|
|
|
|
|
0030 | 73 98 4B 10 C2 DE 52 A3 A9 FD B9 62 4B 62 72 76
|
|
|
|
|
0040 | BB 09 FC 08 2D 7B B4 4E</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 94 DD 06 B4 82 81 66
|
|
|
|
|
0010 | A8 00 00 00 34 F7 CB 3B 57 FF D7 2B 59 89 6B 51
|
|
|
|
|
0020 | 90 E1 9C 97 8E 8C BF E2 6B 64 54 0E 20 4B 82 27
|
|
|
|
|
0030 | 92 38 17 F2 43 DB 60 44 B3 FF 1B 83 6E D8 C6 D6
|
|
|
|
|
0040 | DE E1 C1 53 76 B2 49 C8</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>010C1535587C8166</code></td>
|
|
|
|
|
<td><code>0194DD06B4828166</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>8C000000</code> (140 in decimal)</td>
|
|
|
|
|
<td><code>A8000000</code> (168 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -835,19 +835,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>264206E42D004B77E82376A440D79E0F</code></td>
|
|
|
|
|
<td><code>57FFD72B59896B5190E19C978E8CBFE2</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>36C0747D7C984C5773984B10C2DE52A3</code></td>
|
|
|
|
|
<td><code>6B64540E204B8227923817F243DB6044</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>A9FDB9624B627276BB09FC082D7BB44E</code></td>
|
|
|
|
|
<td><code>B3FF1B836ED8C6D6DEE1C15376B249C8</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>
|
|
|
|
|