mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2025-01-05 02:32:23 +01:00
Update content of files
This commit is contained in:
parent
a6f37e932d
commit
8d5c070473
1 changed files with 206 additions and 206 deletions
|
@ -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 58 30 0C 00 7A 43 A1 66
|
||||
0010 | 14 00 00 00 F1 8E 7E BE 66 CD 10 76 62 1B 9E 73
|
||||
0020 | E9 F5 D2 63 5F 0C 1A 01</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 04 1C 0D 00 13 44 A1 66
|
||||
0010 | 14 00 00 00 F1 8E 7E BE 6A 9B 4E AF AE 17 1B B3
|
||||
0020 | A7 3D 9E A9 7C 57 90 09</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>58300C007A43A166</code></td>
|
||||
<td><code>041C0D001344A166</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>66CD1076621B9E73E9F5D2635F0C1A01</code></td>
|
||||
<td><code>6A9B4EAFAE171BB3A73D9EA97C579009</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 7C 25 D6 7A 43 A1 66
|
||||
0010 | A0 00 00 00 63 24 16 05 66 CD 10 76 62 1B 9E 73
|
||||
0020 | E9 F5 D2 63 5F 0C 1A 01 26 AF A9 7C 5F D7 7F F1
|
||||
0030 | E0 39 D1 40 00 ED 24 1D 08 18 E5 21 66 98 54 81
|
||||
0040 | 05 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 18 64 74 13 44 A1 66
|
||||
0010 | 74 00 00 00 63 24 16 05 6A 9B 4E AF AE 17 1B B3
|
||||
0020 | A7 3D 9E A9 7C 57 90 09 33 E8 1F 9C 78 18 56 F0
|
||||
0030 | 1D D4 12 93 F2 25 29 B8 08 18 BC 88 58 D2 19 99
|
||||
0040 | B9 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>017C25D67A43A166</code></td>
|
||||
<td><code>011864741344A166</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>A0000000</code> (160 in decimal)</td>
|
||||
<td><code>74000000</code> (116 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -150,19 +150,19 @@
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>66CD1076621B9E73E9F5D2635F0C1A01</code></td>
|
||||
<td><code>6A9B4EAFAE171BB3A73D9EA97C579009</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>26AFA97C5FD77FF1E039D14000ED241D</code></td>
|
||||
<td><code>33E81F9C781856F01DD41293F22529B8</code></td>
|
||||
<td>Server-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pq</td>
|
||||
<td>56, 12</td>
|
||||
<td><code>0818E5216698548105000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1793876751103066373</td>
|
||||
<td><code>0818BC8858D21999B9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1782449467595266489</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 = 1793876751103066373</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1793876751103066373 = 1128986147 * 1588927159</code></p>
|
||||
<pre><code>p = 1128986147
|
||||
q = 1588927159</code></pre>
|
||||
<pre><code>pq = 1782449467595266489</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1782449467595266489 = 1019918539 * 1747639051</code></p>
|
||||
<pre><code>p = 1019918539
|
||||
q = 1747639051</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 18 E5 21 66 98 54 81 05 00 00 00
|
||||
0010 | 04 43 4A F6 23 00 00 00 04 5E B5 1A B7 00 00 00
|
||||
0020 | 66 CD 10 76 62 1B 9E 73 E9 F5 D2 63 5F 0C 1A 01
|
||||
0030 | 26 AF A9 7C 5F D7 7F F1 E0 39 D1 40 00 ED 24 1D
|
||||
0040 | 9A 87 9B 42 20 45 9F 61 DA D0 C6 96 12 A4 7A 3E
|
||||
0050 | C0 07 6A B1 6E 06 36 4C 70 0D 14 53 3A 22 C6 6A
|
||||
<pre><code>0000 | 95 5F F5 A9 08 18 BC 88 58 D2 19 99 B9 00 00 00
|
||||
0010 | 04 3C CA B8 CB 00 00 00 04 68 2A DB 0B 00 00 00
|
||||
0020 | 6A 9B 4E AF AE 17 1B B3 A7 3D 9E A9 7C 57 90 09
|
||||
0030 | 33 E8 1F 9C 78 18 56 F0 1D D4 12 93 F2 25 29 B8
|
||||
0040 | 67 C7 C1 2C 08 D9 8E A3 67 79 F2 2E 6A 37 EC 96
|
||||
0050 | B2 08 3E 55 C1 32 E8 8E 3A A2 14 1B 13 89 40 42
|
||||
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 = 1588927159</code></pre>
|
|||
<tr>
|
||||
<td>pq</td>
|
||||
<td>4, 12</td>
|
||||
<td><code>0818E5216698548105000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1793876751103066373</td>
|
||||
<td><code>0818BC8858D21999B9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1782449467595266489</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>04434AF623000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1128986147</td>
|
||||
<td><code>043CCAB8CB000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1019918539</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>045EB51AB7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1588927159</td>
|
||||
<td><code>04682ADB0B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1747639051</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>66CD1076621B9E73E9F5D2635F0C1A01</code></td>
|
||||
<td><code>6A9B4EAFAE171BB3A73D9EA97C579009</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>48, 16</td>
|
||||
<td><code>26AFA97C5FD77FF1E039D14000ED241D</code></td>
|
||||
<td><code>33E81F9C781856F01DD41293F22529B8</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce</td>
|
||||
<td>64, 32</td>
|
||||
<td><code>9A879B4220459F61DAD0C69612A47A3E</code> <code>C0076AB16E06364C700D14533A22C66A</code></td>
|
||||
<td><code>67C7C12C08D98EA36779F22E6A37EC96</code> <code>B2083E55C132E88E3AA2141B13894042</code></td>
|
||||
<td>Client-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -291,39 +291,39 @@ q = 1588927159</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 = 955FF5A90818E521669854810500000004434AF623000000045EB51AB700000066CD1076621B9E73E9F5D2635F0C1A0126AFA97C5FD77FF1E039D14000ED241D9A879B4220459F61DAD0C69612A47A3EC0076AB16E06364C700D14533A22C66A02000000
|
||||
random_padding_bytes = AC68E271EAEE1982E6AAE68D9D8BF850E7FF60921D8DF734798EA0D2BC3EB101027F4C7534517F48D6BC9E8541DF75F449C4758B88D72AB64B48F6A6B55F7613EBD18D7CD98CD53E42BEAE3425F3B57CB23B7DEA4910D5208F68C828</code></pre>
|
||||
<pre><code>data = 955FF5A90818BC8858D21999B9000000043CCAB8CB00000004682ADB0B0000006A9B4EAFAE171BB3A73D9EA97C57900933E81F9C781856F01DD41293F22529B867C7C12C08D98EA36779F22E6A37EC96B2083E55C132E88E3AA2141B1389404202000000
|
||||
random_padding_bytes = 8F16820B9F80F936AF6EC6F9AD9CAA06DD5C1280FF51958D69905208DDE494E74D04C448F505F866A944E4EB07309ECA53F7C132F70A9EC68A524D4A1259C1201BEE594E90E1619E1F83B24F061149E384A11D93BC3441F1AB2C00F4</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 = 653653CFB0757F413BB587CB19DAD439720270A1044E977861E5374030341977C54B1B479E995270816782C710D5DC842C9A60E9ECDC2B99E4214BAC4B2B248F29D32EB224981BFF4AF9864FB0CF9225F50B036DC714AD7C26385CA97B75ED09253A02AF66F3083E2B0B604FBC1CA175120037B92A891E2495DBD1CA086C4F283CE45760E24DAA9CA554204C68E2E6A7809DE6021AF626A8448F89CADB171D51B7E710EA78C6E8475F5445EB3CC15560AF846F9B19D39C7830621A04D14726E9893CB6795E96F6003A39B5E2521D58E50177BEDBCEBC5F545A71CE571043A60E17AEC6034ECE5DBF2DE0755242DA7807943BCC6987625C2A46F5F397502384ED</code></pre>
|
||||
<pre><code>encrypted_data = 9D2A4DDC7FED3E9BE602AFF7F58C487F792A0002DEC204F1A3CBD4BA64219C890EFFD98E2966616D4AEE1B627CE2A14A21472659FCB872FF3B56CC59D78ECA9F18829CA11511C1B226B7172CE7038181F5E84106346695B2D0FC8FDB2F0FD7EDDC0CA90093A4EEC1E13E5F2C23408508342B1989ECCC2249395EFB84042BEA5F501DE94652D2B7F66EAF0A31F300E8CC08C00568D6B287E7C0ABA5BF112415C9B8C62489F3A11DBDAF9D310A6FEBC60D4E64B103D4BE8B1A6D06B122F4DDD7192B8E8FAB93289875C352980607D28D712ACF7A5EEC158E2514850752D9F75D0DFFCBA32CB3DE037274754E7E73183C31D187694B3E76C187D06485B00273A7F3</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 40 3B 0F 00 7A 43 A1 66
|
||||
0010 | 40 01 00 00 BE E4 12 D7 66 CD 10 76 62 1B 9E 73
|
||||
0020 | E9 F5 D2 63 5F 0C 1A 01 26 AF A9 7C 5F D7 7F F1
|
||||
0030 | E0 39 D1 40 00 ED 24 1D 04 43 4A F6 23 00 00 00
|
||||
0040 | 04 5E B5 1A B7 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 65 36 53 CF B0 75 7F 41 3B B5 87 CB
|
||||
0060 | 19 DA D4 39 72 02 70 A1 04 4E 97 78 61 E5 37 40
|
||||
0070 | 30 34 19 77 C5 4B 1B 47 9E 99 52 70 81 67 82 C7
|
||||
0080 | 10 D5 DC 84 2C 9A 60 E9 EC DC 2B 99 E4 21 4B AC
|
||||
0090 | 4B 2B 24 8F 29 D3 2E B2 24 98 1B FF 4A F9 86 4F
|
||||
00A0 | B0 CF 92 25 F5 0B 03 6D C7 14 AD 7C 26 38 5C A9
|
||||
00B0 | 7B 75 ED 09 25 3A 02 AF 66 F3 08 3E 2B 0B 60 4F
|
||||
00C0 | BC 1C A1 75 12 00 37 B9 2A 89 1E 24 95 DB D1 CA
|
||||
00D0 | 08 6C 4F 28 3C E4 57 60 E2 4D AA 9C A5 54 20 4C
|
||||
00E0 | 68 E2 E6 A7 80 9D E6 02 1A F6 26 A8 44 8F 89 CA
|
||||
00F0 | DB 17 1D 51 B7 E7 10 EA 78 C6 E8 47 5F 54 45 EB
|
||||
0100 | 3C C1 55 60 AF 84 6F 9B 19 D3 9C 78 30 62 1A 04
|
||||
0110 | D1 47 26 E9 89 3C B6 79 5E 96 F6 00 3A 39 B5 E2
|
||||
0120 | 52 1D 58 E5 01 77 BE DB CE BC 5F 54 5A 71 CE 57
|
||||
0130 | 10 43 A6 0E 17 AE C6 03 4E CE 5D BF 2D E0 75 52
|
||||
0140 | 42 DA 78 07 94 3B CC 69 87 62 5C 2A 46 F5 F3 97
|
||||
0150 | 50 23 84 ED</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 08 1C 0D 00 13 44 A1 66
|
||||
0010 | 40 01 00 00 BE E4 12 D7 6A 9B 4E AF AE 17 1B B3
|
||||
0020 | A7 3D 9E A9 7C 57 90 09 33 E8 1F 9C 78 18 56 F0
|
||||
0030 | 1D D4 12 93 F2 25 29 B8 04 3C CA B8 CB 00 00 00
|
||||
0040 | 04 68 2A DB 0B 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 9D 2A 4D DC 7F ED 3E 9B E6 02 AF F7
|
||||
0060 | F5 8C 48 7F 79 2A 00 02 DE C2 04 F1 A3 CB D4 BA
|
||||
0070 | 64 21 9C 89 0E FF D9 8E 29 66 61 6D 4A EE 1B 62
|
||||
0080 | 7C E2 A1 4A 21 47 26 59 FC B8 72 FF 3B 56 CC 59
|
||||
0090 | D7 8E CA 9F 18 82 9C A1 15 11 C1 B2 26 B7 17 2C
|
||||
00A0 | E7 03 81 81 F5 E8 41 06 34 66 95 B2 D0 FC 8F DB
|
||||
00B0 | 2F 0F D7 ED DC 0C A9 00 93 A4 EE C1 E1 3E 5F 2C
|
||||
00C0 | 23 40 85 08 34 2B 19 89 EC CC 22 49 39 5E FB 84
|
||||
00D0 | 04 2B EA 5F 50 1D E9 46 52 D2 B7 F6 6E AF 0A 31
|
||||
00E0 | F3 00 E8 CC 08 C0 05 68 D6 B2 87 E7 C0 AB A5 BF
|
||||
00F0 | 11 24 15 C9 B8 C6 24 89 F3 A1 1D BD AF 9D 31 0A
|
||||
0100 | 6F EB C6 0D 4E 64 B1 03 D4 BE 8B 1A 6D 06 B1 22
|
||||
0110 | F4 DD D7 19 2B 8E 8F AB 93 28 98 75 C3 52 98 06
|
||||
0120 | 07 D2 8D 71 2A CF 7A 5E EC 15 8E 25 14 85 07 52
|
||||
0130 | D9 F7 5D 0D FF CB A3 2C B3 DE 03 72 74 75 4E 7E
|
||||
0140 | 73 18 3C 31 D1 87 69 4B 3E 76 C1 87 D0 64 85 B0
|
||||
0150 | 02 73 A7 F3</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 = AC68E271EAEE1982E6AAE68D9D8BF850E7FF60921D8DF734798EA0D2B
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>403B0F007A43A166</code></td>
|
||||
<td><code>081C0D001344A166</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 = AC68E271EAEE1982E6AAE68D9D8BF850E7FF60921D8DF734798EA0D2B
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>66CD1076621B9E73E9F5D2635F0C1A01</code></td>
|
||||
<td><code>6A9B4EAFAE171BB3A73D9EA97C579009</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>26AFA97C5FD77FF1E039D14000ED241D</code></td>
|
||||
<td><code>33E81F9C781856F01DD41293F22529B8</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p</td>
|
||||
<td>56, 8</td>
|
||||
<td><code>04434AF623000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1128986147</td>
|
||||
<td><code>043CCAB8CB000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1019918539</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>045EB51AB7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1588927159</td>
|
||||
<td><code>04682ADB0B000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1747639051</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 = AC68E271EAEE1982E6AAE68D9D8BF850E7FF60921D8DF734798EA0D2B
|
|||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>80, 260</td>
|
||||
<td><code>FE000100653653CFB0757F413BB587CB</code> <code>19DAD439720270A1044E977861E53740</code> <code>30341977C54B1B479E995270816782C7</code> <code>10D5DC842C9A60E9ECDC2B99E4214BAC</code> <code>4B2B248F29D32EB224981BFF4AF9864F</code> <code>B0CF9225F50B036DC714AD7C26385CA9</code> <code>7B75ED09253A02AF66F3083E2B0B604F</code> <code>BC1CA175120037B92A891E2495DBD1CA</code> <code>086C4F283CE45760E24DAA9CA554204C</code> <code>68E2E6A7809DE6021AF626A8448F89CA</code> <code>DB171D51B7E710EA78C6E8475F5445EB</code> <code>3CC15560AF846F9B19D39C7830621A04</code> <code>D14726E9893CB6795E96F6003A39B5E2</code> <code>521D58E50177BEDBCEBC5F545A71CE57</code> <code>1043A60E17AEC6034ECE5DBF2DE07552</code> <code>42DA7807943BCC6987625C2A46F5F397</code><br> <code>502384ED</code></td>
|
||||
<td><code>FE0001009D2A4DDC7FED3E9BE602AFF7</code> <code>F58C487F792A0002DEC204F1A3CBD4BA</code> <code>64219C890EFFD98E2966616D4AEE1B62</code> <code>7CE2A14A21472659FCB872FF3B56CC59</code> <code>D78ECA9F18829CA11511C1B226B7172C</code> <code>E7038181F5E84106346695B2D0FC8FDB</code> <code>2F0FD7EDDC0CA90093A4EEC1E13E5F2C</code> <code>23408508342B1989ECCC2249395EFB84</code> <code>042BEA5F501DE94652D2B7F66EAF0A31</code> <code>F300E8CC08C00568D6B287E7C0ABA5BF</code> <code>112415C9B8C62489F3A11DBDAF9D310A</code> <code>6FEBC60D4E64B103D4BE8B1A6D06B122</code> <code>F4DDD7192B8E8FAB93289875C3529806</code> <code>07D28D712ACF7A5EEC158E2514850752</code> <code>D9F75D0DFFCBA32CB3DE037274754E7E</code> <code>73183C31D187694B3E76C187D06485B0</code><br> <code>0273A7F3</code></td>
|
||||
<td>Value generated above</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -402,47 +402,47 @@ random_padding_bytes = AC68E271EAEE1982E6AAE68D9D8BF850E7FF60921D8DF734798EA0D2B
|
|||
<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 E0 8B A3 7B 43 A1 66
|
||||
0010 | A4 02 00 00 5C 07 E8 D0 66 CD 10 76 62 1B 9E 73
|
||||
0020 | E9 F5 D2 63 5F 0C 1A 01 26 AF A9 7C 5F D7 7F F1
|
||||
0030 | E0 39 D1 40 00 ED 24 1D FE 50 02 00 18 B9 1A 33
|
||||
0040 | DE F8 5A FB 14 DF CA 63 35 97 CD BA B2 C2 34 4D
|
||||
0050 | 8A F8 F5 44 20 5E 48 63 F1 D3 40 77 F9 77 1C 75
|
||||
0060 | 8D 22 7D BA A3 BB 9F 3C FE F7 2F 5C 79 CC 3C D0
|
||||
0070 | 59 28 8F CC 65 16 46 19 3E 13 BD CA 93 A2 23 E5
|
||||
0080 | 04 0B C3 0F 3F 90 2A 11 12 90 65 B4 8A 65 0E FB
|
||||
0090 | F6 76 CF 71 38 C2 1C 33 5F 40 EC AE BA E9 CD A4
|
||||
00A0 | 3D 39 D4 A3 58 55 99 92 3B 15 FC FA C8 97 A2 8D
|
||||
00B0 | B5 0B 54 7D 9A B2 D9 B7 B0 40 5B 65 93 03 6D 12
|
||||
00C0 | FA 41 50 0F 3A 03 F7 E9 C6 24 B0 6B C1 A4 D9 16
|
||||
00D0 | 94 1C 39 0F 63 D5 F5 18 09 43 D3 F8 0C 3F E5 30
|
||||
00E0 | 07 96 55 E2 3C 4C 1E B2 2A 9F FE A3 72 E6 6A 41
|
||||
00F0 | 7D 60 4F D6 D0 5F 34 35 88 C2 BC 8F 92 7A 84 44
|
||||
0100 | 7B EF CA 8B C9 0B E1 2C D2 37 37 6D 16 73 17 12
|
||||
0110 | 6A D2 5E 7C 2A 80 83 70 CF 9D 63 88 CC CE 13 CC
|
||||
0120 | 49 F8 EA E4 A3 6C 97 44 F3 11 CB 79 60 05 04 E1
|
||||
0130 | A0 5B F2 16 71 A1 BA AA 52 D3 8F 38 3E F5 6C BD
|
||||
0140 | 6B A4 D5 E9 14 A9 35 50 FF 74 CC E1 DA 5E CD 5C
|
||||
0150 | 77 ED AF 39 F5 AC BE 7E 8D BE 21 DF FB 1A 99 80
|
||||
0160 | 99 D4 13 47 09 5E E9 B7 5D 2E 63 E7 45 D1 1B 00
|
||||
0170 | 4B DF 79 46 FA 8C A7 AF 0F 08 BA 2D 8A 41 BA 9B
|
||||
0180 | 8F B2 7B 25 DD 5F 5E 28 CF B7 C0 90 58 D4 C4 ED
|
||||
0190 | DF F7 FB E8 33 EC FB 98 C3 BC 36 C3 EC E4 52 15
|
||||
01A0 | 95 F2 24 6F DB 05 D9 C3 03 2A 24 A9 85 A7 89 5F
|
||||
01B0 | 3A 84 B4 A7 7C 6D 6E 19 5A 58 94 46 79 69 44 E6
|
||||
01C0 | B5 4E B0 87 55 CD 4F 03 C5 07 A1 F8 86 54 51 C4
|
||||
01D0 | 4B F3 DB 53 DA 1F 95 DD 8F 0D 16 42 41 C0 84 43
|
||||
01E0 | 8F AC F5 DD 5C E9 1E 1F BA B4 AE 23 DF 58 88 EA
|
||||
01F0 | 49 70 5D 85 88 7F 37 40 D2 FD 13 87 AD D0 F1 D0
|
||||
0200 | B5 97 69 E7 A1 24 72 13 7A 65 99 BB 08 02 5B 37
|
||||
0210 | 96 69 5E 34 3F 39 33 BF AF 19 DA 9B 9D 13 52 E8
|
||||
0220 | A5 ED 5D 01 3B 11 84 86 AC F9 76 B8 AA E8 65 36
|
||||
0230 | 2C 20 9C B4 92 A9 34 7E 09 B3 01 36 9D E8 C5 6D
|
||||
0240 | E5 06 1E DE D3 7C B5 E3 1D FA 98 DB 4A 27 73 FB
|
||||
0250 | 07 36 A1 87 ED 5F 46 92 2D 37 44 6F 1C 6E 26 DD
|
||||
0260 | 64 CC 1C D1 A3 8C 07 D9 9A CA FB F7 C6 09 91 03
|
||||
0270 | BA A4 93 2C C1 A2 8F D0 C3 5B 2D 6C FB 9D 73 F9
|
||||
0280 | F3 FD 90 06 DD DA B1 3D 23 08 5D 80</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 DC 8E 4E 14 44 A1 66
|
||||
0010 | 80 02 00 00 5C 07 E8 D0 6A 9B 4E AF AE 17 1B B3
|
||||
0020 | A7 3D 9E A9 7C 57 90 09 33 E8 1F 9C 78 18 56 F0
|
||||
0030 | 1D D4 12 93 F2 25 29 B8 FE 50 02 00 66 1D BB F5
|
||||
0040 | 4D 31 AC B8 FE 6B 1A 44 E9 D5 0A 4F 28 56 8A 5D
|
||||
0050 | 82 8F 20 EA E6 4C 2F DB ED 8E FE 39 A1 76 D0 BC
|
||||
0060 | F3 45 9C 69 6D 7B 52 F9 39 09 50 09 24 53 68 D2
|
||||
0070 | 69 73 F9 B7 79 4C EF 3D B9 49 0E 98 31 0C 20 32
|
||||
0080 | 25 0C 3C 81 24 E6 75 90 DF 75 3A 35 78 32 95 20
|
||||
0090 | 55 FE EC 39 FF F7 E3 C7 68 4F D8 F5 14 D3 B7 CF
|
||||
00A0 | DA DD DA A2 DE 42 52 4C 0B 2A 15 42 A8 EF 11 E7
|
||||
00B0 | 2B 18 84 2C 0F A9 20 41 CF 23 3B DE 62 E1 98 66
|
||||
00C0 | C0 FA 25 7E DF 2C E3 84 56 EF 76 61 E3 2E 0F 08
|
||||
00D0 | 06 4D 67 A4 3D 16 1B F6 7A 28 CD 80 CA 29 C6 9F
|
||||
00E0 | CD 47 0A 27 3E 1F F3 15 AD 47 F4 07 7A 0C 3E 28
|
||||
00F0 | EC 99 64 D0 3A BE 59 AB CD 90 AA BC 7A 41 E1 50
|
||||
0100 | C9 22 BC A8 10 FF 53 27 1E 20 2B 6D F4 48 4A 4A
|
||||
0110 | 21 F4 D5 5A 7E 98 94 99 54 CD CE B4 C4 33 78 3D
|
||||
0120 | FE 02 1B 93 F3 0E 55 D7 45 E7 D2 78 13 4A 1E D6
|
||||
0130 | 86 65 7B 80 8B 1F 4D 28 2B A1 24 3E 99 5F 92 F2
|
||||
0140 | 6D AD 07 E4 E2 99 3F 84 2A 97 60 59 2C 66 11 2B
|
||||
0150 | C9 5B 09 4F 11 B9 15 62 9D 29 3A B0 DF F1 7A AA
|
||||
0160 | 5C E1 F2 3C E3 1E 25 0C 48 E8 61 F6 10 25 BF C6
|
||||
0170 | 22 2C 23 06 CB DB 2A 11 93 F7 80 0E 0B 72 61 6A
|
||||
0180 | DF 12 1A 08 8C 58 A3 2D 51 99 C0 8D EB 94 DE C3
|
||||
0190 | 3B E1 A6 DF 98 85 CB A3 0F 95 11 58 84 0F E5 F1
|
||||
01A0 | EA A7 A1 51 0F 93 09 B8 93 42 2E A6 6D D4 DF 4A
|
||||
01B0 | A4 86 C3 99 05 E7 45 D6 33 22 C1 5A 58 8E ED A6
|
||||
01C0 | 9D B1 60 84 34 3B 8A 04 4D A4 2D 2F 00 0C 37 01
|
||||
01D0 | 3D D3 1A 0B 2B 46 C8 8D B7 AD 96 B9 EB 99 DC 0D
|
||||
01E0 | 7C AB 92 EA 54 6B 1E 1E 49 F1 D1 74 FD 94 F1 5C
|
||||
01F0 | CF E3 04 37 57 9B A8 17 04 5B C7 C4 B2 16 F5 2E
|
||||
0200 | 6A 7D 9E 58 87 9C 55 7F A0 F3 5F 66 F5 60 18 3F
|
||||
0210 | F2 AC A3 F7 7D A8 B6 66 8E D0 8B CD 48 88 EE C6
|
||||
0220 | 44 B1 54 7C A0 9D 7F CB CA 19 E8 A7 75 4D 43 3A
|
||||
0230 | E2 51 E7 D8 F4 FB 99 EC BE 59 09 11 54 06 0B 4F
|
||||
0240 | 90 DF 9E 6F E4 1B 54 EA B2 0D 7D D8 C2 DF A2 CB
|
||||
0250 | 75 E4 4D E1 C8 D7 EB FB 6A D9 00 2E 44 1A E8 EF
|
||||
0260 | 38 78 F4 B3 CE 4E 7D 94 41 86 FF DA 66 89 56 30
|
||||
0270 | 04 BC 49 1B 95 D8 3A 04 4A E9 98 78 69 9C FC EF
|
||||
0280 | 88 FA 14 14 AC 1C D1 A4 49 7F D9 4C</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 = AC68E271EAEE1982E6AAE68D9D8BF850E7FF60921D8DF734798EA0D2B
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>01E08BA37B43A166</code></td>
|
||||
<td><code>01DC8E4E1444A166</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>A4020000</code> (676 in decimal)</td>
|
||||
<td><code>80020000</code> (640 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -482,19 +482,19 @@ random_padding_bytes = AC68E271EAEE1982E6AAE68D9D8BF850E7FF60921D8DF734798EA0D2B
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>66CD1076621B9E73E9F5D2635F0C1A01</code></td>
|
||||
<td><code>6A9B4EAFAE171BB3A73D9EA97C579009</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>26AFA97C5FD77FF1E039D14000ED241D</code></td>
|
||||
<td><code>33E81F9C781856F01DD41293F22529B8</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_answer</td>
|
||||
<td>56, 596</td>
|
||||
<td><code>FE50020018B91A33DEF85AFB14DFCA63</code> <code>3597CDBAB2C2344D8AF8F544205E4863</code> <code>F1D34077F9771C758D227DBAA3BB9F3C</code> <code>FEF72F5C79CC3CD059288FCC65164619</code> <code>3E13BDCA93A223E5040BC30F3F902A11</code> <code>129065B48A650EFBF676CF7138C21C33</code> <code>5F40ECAEBAE9CDA43D39D4A358559992</code> <code>3B15FCFAC897A28DB50B547D9AB2D9B7</code> <code>B0405B6593036D12FA41500F3A03F7E9</code> <code>C624B06BC1A4D916941C390F63D5F518</code> <code>0943D3F80C3FE530079655E23C4C1EB2</code> <code>2A9FFEA372E66A417D604FD6D05F3435</code> <code>88C2BC8F927A84447BEFCA8BC90BE12C</code> <code>D237376D167317126AD25E7C2A808370</code> <code>CF9D6388CCCE13CC49F8EAE4A36C9744</code> <code>F311CB79600504E1A05BF21671A1BAAA</code> <code>52D38F383EF56CBD6BA4D5E914A93550</code> <code>FF74CCE1DA5ECD5C77EDAF39F5ACBE7E</code> <code>8DBE21DFFB1A998099D41347095EE9B7</code> <code>5D2E63E745D11B004BDF7946FA8CA7AF</code> <code>0F08BA2D8A41BA9B8FB27B25DD5F5E28</code> <code>CFB7C09058D4C4EDDFF7FBE833ECFB98</code> <code>C3BC36C3ECE4521595F2246FDB05D9C3</code> <code>032A24A985A7895F3A84B4A77C6D6E19</code> <code>5A589446796944E6B54EB08755CD4F03</code> <code>C507A1F8865451C44BF3DB53DA1F95DD</code> <code>8F0D164241C084438FACF5DD5CE91E1F</code> <code>BAB4AE23DF5888EA49705D85887F3740</code> <code>D2FD1387ADD0F1D0B59769E7A1247213</code> <code>7A6599BB08025B3796695E343F3933BF</code> <code>AF19DA9B9D1352E8A5ED5D013B118486</code> <code>ACF976B8AAE865362C209CB492A9347E</code> <code>09B301369DE8C56DE5061EDED37CB5E3</code> <code>1DFA98DB4A2773FB0736A187ED5F4692</code> <code>2D37446F1C6E26DD64CC1CD1A38C07D9</code> <code>9ACAFBF7C6099103BAA4932CC1A28FD0</code> <code>C35B2D6CFB9D73F9F3FD9006DDDAB13D</code><br> <code>23085D80</code></td>
|
||||
<td><code>FE500200661DBBF54D31ACB8FE6B1A44</code> <code>E9D50A4F28568A5D828F20EAE64C2FDB</code> <code>ED8EFE39A176D0BCF3459C696D7B52F9</code> <code>39095009245368D26973F9B7794CEF3D</code> <code>B9490E98310C2032250C3C8124E67590</code> <code>DF753A357832952055FEEC39FFF7E3C7</code> <code>684FD8F514D3B7CFDADDDAA2DE42524C</code> <code>0B2A1542A8EF11E72B18842C0FA92041</code> <code>CF233BDE62E19866C0FA257EDF2CE384</code> <code>56EF7661E32E0F08064D67A43D161BF6</code> <code>7A28CD80CA29C69FCD470A273E1FF315</code> <code>AD47F4077A0C3E28EC9964D03ABE59AB</code> <code>CD90AABC7A41E150C922BCA810FF5327</code> <code>1E202B6DF4484A4A21F4D55A7E989499</code> <code>54CDCEB4C433783DFE021B93F30E55D7</code> <code>45E7D278134A1ED686657B808B1F4D28</code> <code>2BA1243E995F92F26DAD07E4E2993F84</code> <code>2A9760592C66112BC95B094F11B91562</code> <code>9D293AB0DFF17AAA5CE1F23CE31E250C</code> <code>48E861F61025BFC6222C2306CBDB2A11</code> <code>93F7800E0B72616ADF121A088C58A32D</code> <code>5199C08DEB94DEC33BE1A6DF9885CBA3</code> <code>0F951158840FE5F1EAA7A1510F9309B8</code> <code>93422EA66DD4DF4AA486C39905E745D6</code> <code>3322C15A588EEDA69DB16084343B8A04</code> <code>4DA42D2F000C37013DD31A0B2B46C88D</code> <code>B7AD96B9EB99DC0D7CAB92EA546B1E1E</code> <code>49F1D174FD94F15CCFE30437579BA817</code> <code>045BC7C4B216F52E6A7D9E58879C557F</code> <code>A0F35F66F560183FF2ACA3F77DA8B666</code> <code>8ED08BCD4888EEC644B1547CA09D7FCB</code> <code>CA19E8A7754D433AE251E7D8F4FB99EC</code> <code>BE59091154060B4F90DF9E6FE41B54EA</code> <code>B20D7DD8C2DFA2CB75E44DE1C8D7EBFB</code> <code>6AD9002E441AE8EF3878F4B3CE4E7D94</code> <code>4186FFDA6689563004BC491B95D83A04</code> <code>4AE99878699CFCEF88FA1414AC1CD1A4</code><br> <code>497FD94C</code></td>
|
||||
<td>See below</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -502,20 +502,20 @@ random_padding_bytes = AC68E271EAEE1982E6AAE68D9D8BF850E7FF60921D8DF734798EA0D2B
|
|||
<!-- 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 = 18B91A33DEF85AFB14DFCA633597CDBAB2C2344D8AF8F544205E4863F1D34077F9771C758D227DBAA3BB9F3CFEF72F5C79CC3CD059288FCC651646193E13BDCA93A223E5040BC30F3F902A11129065B48A650EFBF676CF7138C21C335F40ECAEBAE9CDA43D39D4A3585599923B15FCFAC897A28DB50B547D9AB2D9B7B0405B6593036D12FA41500F3A03F7E9C624B06BC1A4D916941C390F63D5F5180943D3F80C3FE530079655E23C4C1EB22A9FFEA372E66A417D604FD6D05F343588C2BC8F927A84447BEFCA8BC90BE12CD237376D167317126AD25E7C2A808370CF9D6388CCCE13CC49F8EAE4A36C9744F311CB79600504E1A05BF21671A1BAAA52D38F383EF56CBD6BA4D5E914A93550FF74CCE1DA5ECD5C77EDAF39F5ACBE7E8DBE21DFFB1A998099D41347095EE9B75D2E63E745D11B004BDF7946FA8CA7AF0F08BA2D8A41BA9B8FB27B25DD5F5E28CFB7C09058D4C4EDDFF7FBE833ECFB98C3BC36C3ECE4521595F2246FDB05D9C3032A24A985A7895F3A84B4A77C6D6E195A589446796944E6B54EB08755CD4F03C507A1F8865451C44BF3DB53DA1F95DD8F0D164241C084438FACF5DD5CE91E1FBAB4AE23DF5888EA49705D85887F3740D2FD1387ADD0F1D0B59769E7A12472137A6599BB08025B3796695E343F3933BFAF19DA9B9D1352E8A5ED5D013B118486ACF976B8AAE865362C209CB492A9347E09B301369DE8C56DE5061EDED37CB5E31DFA98DB4A2773FB0736A187ED5F46922D37446F1C6E26DD64CC1CD1A38C07D99ACAFBF7C6099103BAA4932CC1A28FD0C35B2D6CFB9D73F9F3FD9006DDDAB13D23085D80
|
||||
tmp_aes_key = 9C9BB7C3AA015DBE62FE5577D0C089EF7C0A6EE4350CAC3BEE267C92AF846BBF
|
||||
tmp_aes_iv = E8F23793463529F1EBDB9B64830F0D3FDD9F5AD447CBBFF257E7385F9A879B42</code></pre>
|
||||
<pre><code>encrypted_answer = 661DBBF54D31ACB8FE6B1A44E9D50A4F28568A5D828F20EAE64C2FDBED8EFE39A176D0BCF3459C696D7B52F939095009245368D26973F9B7794CEF3DB9490E98310C2032250C3C8124E67590DF753A357832952055FEEC39FFF7E3C7684FD8F514D3B7CFDADDDAA2DE42524C0B2A1542A8EF11E72B18842C0FA92041CF233BDE62E19866C0FA257EDF2CE38456EF7661E32E0F08064D67A43D161BF67A28CD80CA29C69FCD470A273E1FF315AD47F4077A0C3E28EC9964D03ABE59ABCD90AABC7A41E150C922BCA810FF53271E202B6DF4484A4A21F4D55A7E98949954CDCEB4C433783DFE021B93F30E55D745E7D278134A1ED686657B808B1F4D282BA1243E995F92F26DAD07E4E2993F842A9760592C66112BC95B094F11B915629D293AB0DFF17AAA5CE1F23CE31E250C48E861F61025BFC6222C2306CBDB2A1193F7800E0B72616ADF121A088C58A32D5199C08DEB94DEC33BE1A6DF9885CBA30F951158840FE5F1EAA7A1510F9309B893422EA66DD4DF4AA486C39905E745D63322C15A588EEDA69DB16084343B8A044DA42D2F000C37013DD31A0B2B46C88DB7AD96B9EB99DC0D7CAB92EA546B1E1E49F1D174FD94F15CCFE30437579BA817045BC7C4B216F52E6A7D9E58879C557FA0F35F66F560183FF2ACA3F77DA8B6668ED08BCD4888EEC644B1547CA09D7FCBCA19E8A7754D433AE251E7D8F4FB99ECBE59091154060B4F90DF9E6FE41B54EAB20D7DD8C2DFA2CB75E44DE1C8D7EBFB6AD9002E441AE8EF3878F4B3CE4E7D944186FFDA6689563004BC491B95D83A044AE99878699CFCEF88FA1414AC1CD1A4497FD94C
|
||||
tmp_aes_key = 76B7856C62B3B063872C5836F41263DBBEE80BE03CCB81964E47909EC368BA45
|
||||
tmp_aes_iv = C8461CF3798BF669D030D8D3910AEBFD94849B2FBC83DE839397845A67C7C12C</code></pre>
|
||||
<!-- end server_DH_inner_data_input -->
|
||||
<p>Yielding:</p>
|
||||
<!-- start server_DH_inner_data_output -->
|
||||
<pre><code>answer_with_hash = 410295692DFDDE1C218D38A7F377C196FCBF538BBA0D89B566CD1076621B9E73E9F5D2635F0C1A0126AFA97C5FD77FF1E039D14000ED241D03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100BBCC9D18A34899FB13B987A3CDCD838DCE934554B98753F095E890A9B2934D144F8E07531A5522636C85B594D1576A0C56C1C29C99421294238FE8006B59EC9EF5BE48DE208B3134FED5415256A61DB92FF630B341DFFB475CC3BAFA8C8578BDD5CD41C7EC15D05436BC6E30BBD00A76FC79CD743966153C8D0DC39083E4DF249B30F7E98261112410DFBC70C9699C1CD4233650D57BB91EE1BD381294807DCA26DEE3EBF37ADD9E361E4DCA6CA35F539605116EF1D7412933E45651A1C2E9EF67BC393FB9E71036429D7B66528543DD657C300436C968DE7A033A1E550E22E825A3F7481AF4BBB7DADAF640EF265788813546C7F9898F2E8CDD45A6889FD1637B43A16627A4C8D9D2F1C26B
|
||||
answer = BA0D89B566CD1076621B9E73E9F5D2635F0C1A0126AFA97C5FD77FF1E039D14000ED241D03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100BBCC9D18A34899FB13B987A3CDCD838DCE934554B98753F095E890A9B2934D144F8E07531A5522636C85B594D1576A0C56C1C29C99421294238FE8006B59EC9EF5BE48DE208B3134FED5415256A61DB92FF630B341DFFB475CC3BAFA8C8578BDD5CD41C7EC15D05436BC6E30BBD00A76FC79CD743966153C8D0DC39083E4DF249B30F7E98261112410DFBC70C9699C1CD4233650D57BB91EE1BD381294807DCA26DEE3EBF37ADD9E361E4DCA6CA35F539605116EF1D7412933E45651A1C2E9EF67BC393FB9E71036429D7B66528543DD657C300436C968DE7A033A1E550E22E825A3F7481AF4BBB7DADAF640EF265788813546C7F9898F2E8CDD45A6889FD1637B43A16627A4C8D9D2F1C26B</code></pre>
|
||||
<pre><code>answer_with_hash = 2559B75F41BAC536C88FFD608406F7EBE5796A0EBA0D89B56A9B4EAFAE171BB3A73D9EA97C57900933E81F9C781856F01DD41293F22529B803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100C58C73F45D67F73438D4A9049E10C18951E0EA8E9322EF6658F41E6478A9E7BC5266ADE5A458A498A737CB5E7B67C1070B8D3002A7E78F414FDB066068A38E05E81123120849CB83E8A1189065F94D31286C2A34C6E3B77AC84BF54C1FA7D0F7DE80CF2E9B26B7F7454A648468952418467A52BAEB140080112243C78D68C1CFDAC56A62C667AC469C1E5E3EA0A88F2862B67E5160AE3E744FDAD670BCE4165D1C3C3EAE2628B409E8E9D857D64F33476F72E77DADC46885A12E6BBFEB9E95A0CBA61403AA6CB61F6EA46348B6BB7D9CE7EEC9DCA777CD33E5E9E936FF15A1339961E1D0DB93F4136843C9C38A5AF3C9A49BBFEEA43301E6F032C543274CDD3F1444A1660A597A3BFBBAC27C
|
||||
answer = BA0D89B56A9B4EAFAE171BB3A73D9EA97C57900933E81F9C781856F01DD41293F22529B803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100C58C73F45D67F73438D4A9049E10C18951E0EA8E9322EF6658F41E6478A9E7BC5266ADE5A458A498A737CB5E7B67C1070B8D3002A7E78F414FDB066068A38E05E81123120849CB83E8A1189065F94D31286C2A34C6E3B77AC84BF54C1FA7D0F7DE80CF2E9B26B7F7454A648468952418467A52BAEB140080112243C78D68C1CFDAC56A62C667AC469C1E5E3EA0A88F2862B67E5160AE3E744FDAD670BCE4165D1C3C3EAE2628B409E8E9D857D64F33476F72E77DADC46885A12E6BBFEB9E95A0CBA61403AA6CB61F6EA46348B6BB7D9CE7EEC9DCA777CD33E5E9E936FF15A1339961E1D0DB93F4136843C9C38A5AF3C9A49BBFEEA43301E6F032C543274CDD3F1444A1660A597A3BFBBAC27C</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 66 CD 10 76 62 1B 9E 73 E9 F5 D2 63
|
||||
0010 | 5F 0C 1A 01 26 AF A9 7C 5F D7 7F F1 E0 39 D1 40
|
||||
0020 | 00 ED 24 1D 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
||||
<pre><code>0000 | BA 0D 89 B5 6A 9B 4E AF AE 17 1B B3 A7 3D 9E A9
|
||||
0010 | 7C 57 90 09 33 E8 1F 9C 78 18 56 F0 1D D4 12 93
|
||||
0020 | F2 25 29 B8 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 = BA0D89B566CD1076621B9E73E9F5D2635F0C1A0126AFA97C5FD77FF1E039D14000ED241
|
|||
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 | BB CC 9D 18 A3 48 99 FB 13 B9 87 A3 CD CD 83 8D
|
||||
0140 | CE 93 45 54 B9 87 53 F0 95 E8 90 A9 B2 93 4D 14
|
||||
0150 | 4F 8E 07 53 1A 55 22 63 6C 85 B5 94 D1 57 6A 0C
|
||||
0160 | 56 C1 C2 9C 99 42 12 94 23 8F E8 00 6B 59 EC 9E
|
||||
0170 | F5 BE 48 DE 20 8B 31 34 FE D5 41 52 56 A6 1D B9
|
||||
0180 | 2F F6 30 B3 41 DF FB 47 5C C3 BA FA 8C 85 78 BD
|
||||
0190 | D5 CD 41 C7 EC 15 D0 54 36 BC 6E 30 BB D0 0A 76
|
||||
01A0 | FC 79 CD 74 39 66 15 3C 8D 0D C3 90 83 E4 DF 24
|
||||
01B0 | 9B 30 F7 E9 82 61 11 24 10 DF BC 70 C9 69 9C 1C
|
||||
01C0 | D4 23 36 50 D5 7B B9 1E E1 BD 38 12 94 80 7D CA
|
||||
01D0 | 26 DE E3 EB F3 7A DD 9E 36 1E 4D CA 6C A3 5F 53
|
||||
01E0 | 96 05 11 6E F1 D7 41 29 33 E4 56 51 A1 C2 E9 EF
|
||||
01F0 | 67 BC 39 3F B9 E7 10 36 42 9D 7B 66 52 85 43 DD
|
||||
0200 | 65 7C 30 04 36 C9 68 DE 7A 03 3A 1E 55 0E 22 E8
|
||||
0210 | 25 A3 F7 48 1A F4 BB B7 DA DA F6 40 EF 26 57 88
|
||||
0220 | 81 35 46 C7 F9 89 8F 2E 8C DD 45 A6 88 9F D1 63
|
||||
0230 | 7B 43 A1 66</code></pre>
|
||||
0130 | C5 8C 73 F4 5D 67 F7 34 38 D4 A9 04 9E 10 C1 89
|
||||
0140 | 51 E0 EA 8E 93 22 EF 66 58 F4 1E 64 78 A9 E7 BC
|
||||
0150 | 52 66 AD E5 A4 58 A4 98 A7 37 CB 5E 7B 67 C1 07
|
||||
0160 | 0B 8D 30 02 A7 E7 8F 41 4F DB 06 60 68 A3 8E 05
|
||||
0170 | E8 11 23 12 08 49 CB 83 E8 A1 18 90 65 F9 4D 31
|
||||
0180 | 28 6C 2A 34 C6 E3 B7 7A C8 4B F5 4C 1F A7 D0 F7
|
||||
0190 | DE 80 CF 2E 9B 26 B7 F7 45 4A 64 84 68 95 24 18
|
||||
01A0 | 46 7A 52 BA EB 14 00 80 11 22 43 C7 8D 68 C1 CF
|
||||
01B0 | DA C5 6A 62 C6 67 AC 46 9C 1E 5E 3E A0 A8 8F 28
|
||||
01C0 | 62 B6 7E 51 60 AE 3E 74 4F DA D6 70 BC E4 16 5D
|
||||
01D0 | 1C 3C 3E AE 26 28 B4 09 E8 E9 D8 57 D6 4F 33 47
|
||||
01E0 | 6F 72 E7 7D AD C4 68 85 A1 2E 6B BF EB 9E 95 A0
|
||||
01F0 | CB A6 14 03 AA 6C B6 1F 6E A4 63 48 B6 BB 7D 9C
|
||||
0200 | E7 EE C9 DC A7 77 CD 33 E5 E9 E9 36 FF 15 A1 33
|
||||
0210 | 99 61 E1 D0 DB 93 F4 13 68 43 C9 C3 8A 5A F3 C9
|
||||
0220 | A4 9B BF EE A4 33 01 E6 F0 32 C5 43 27 4C DD 3F
|
||||
0230 | 14 44 A1 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 = BA0D89B566CD1076621B9E73E9F5D2635F0C1A0126AFA97C5FD77FF1E039D14000ED241
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>66CD1076621B9E73E9F5D2635F0C1A01</code></td>
|
||||
<td><code>6A9B4EAFAE171BB3A73D9EA97C579009</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>26AFA97C5FD77FF1E039D14000ED241D</code></td>
|
||||
<td><code>33E81F9C781856F01DD41293F22529B8</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -594,13 +594,13 @@ answer = BA0D89B566CD1076621B9E73E9F5D2635F0C1A0126AFA97C5FD77FF1E039D14000ED241
|
|||
<tr>
|
||||
<td>g_a</td>
|
||||
<td>300, 260</td>
|
||||
<td><code>FE000100BBCC9D18A34899FB13B987A3</code> <code>CDCD838DCE934554B98753F095E890A9</code> <code>B2934D144F8E07531A5522636C85B594</code> <code>D1576A0C56C1C29C99421294238FE800</code> <code>6B59EC9EF5BE48DE208B3134FED54152</code> <code>56A61DB92FF630B341DFFB475CC3BAFA</code> <code>8C8578BDD5CD41C7EC15D05436BC6E30</code> <code>BBD00A76FC79CD743966153C8D0DC390</code> <code>83E4DF249B30F7E98261112410DFBC70</code> <code>C9699C1CD4233650D57BB91EE1BD3812</code> <code>94807DCA26DEE3EBF37ADD9E361E4DCA</code> <code>6CA35F539605116EF1D7412933E45651</code> <code>A1C2E9EF67BC393FB9E71036429D7B66</code> <code>528543DD657C300436C968DE7A033A1E</code> <code>550E22E825A3F7481AF4BBB7DADAF640</code> <code>EF265788813546C7F9898F2E8CDD45A6</code><br> <code>889FD163</code></td>
|
||||
<td><code>FE000100C58C73F45D67F73438D4A904</code> <code>9E10C18951E0EA8E9322EF6658F41E64</code> <code>78A9E7BC5266ADE5A458A498A737CB5E</code> <code>7B67C1070B8D3002A7E78F414FDB0660</code> <code>68A38E05E81123120849CB83E8A11890</code> <code>65F94D31286C2A34C6E3B77AC84BF54C</code> <code>1FA7D0F7DE80CF2E9B26B7F7454A6484</code> <code>68952418467A52BAEB140080112243C7</code> <code>8D68C1CFDAC56A62C667AC469C1E5E3E</code> <code>A0A88F2862B67E5160AE3E744FDAD670</code> <code>BCE4165D1C3C3EAE2628B409E8E9D857</code> <code>D64F33476F72E77DADC46885A12E6BBF</code> <code>EB9E95A0CBA61403AA6CB61F6EA46348</code> <code>B6BB7D9CE7EEC9DCA777CD33E5E9E936</code> <code>FF15A1339961E1D0DB93F4136843C9C3</code> <code>8A5AF3C9A49BBFEEA43301E6F032C543</code><br> <code>274CDD3F</code></td>
|
||||
<td><code>g_a</code> diffie-hellman parameter</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_time</td>
|
||||
<td>560, 4</td>
|
||||
<td><code>7B43A166</code> (1721844603 in decimal)</td>
|
||||
<td><code>1444A166</code> (1721844756 in decimal)</td>
|
||||
<td>Server time</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -609,34 +609,34 @@ answer = BA0D89B566CD1076621B9E73E9F5D2635F0C1A0126AFA97C5FD77FF1E039D14000ED241
|
|||
<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 = F3BD198E3CC3EFD50CD81617DEC349D6D1CED6F151A3CF2FDB8474C745B699024DFF87C750C1F1010337E7978602B9CF5A40886FA213B8CAD0DDDCEFFA24E5085CDBDC0B7AA83CD5EE3B4D556F17B0E8D75FA54ABDC2FC158B6A85E84EEA42BBA411805625F08922C83D3736B580B69003BDF7F25DE7216094305A4C384A1C98446D1572BE84ECB8A217DF614D6B7B32E473A1C2B8C8AF7DC957F7CA88D42BD3CDA313CC685434E3AEC33125C486983C799DAA1712AB9113539A555F932CF7ACF4C0F5FAD58EA6A2D4441738312EA3A021F0CCB49C79DD54BB9E4AA8938C33BA64016CFAE612641C4D9D080A08B15879CAA6DA8DCADFBF0EED807293433251A4</code></pre>
|
||||
<pre><code>b = 42319D46D6A137C772F7031694A4EE1D7ED755A6DD55134F536AF51DA31F968D5F77ED98F90F6C8D0EDFFFD3C6EA6A56544B18AD1E7592CFF5E61D86137BAAD84C381BDB1493D0A27C8DBCB3EC5CB3A687CB517ABEA728DA3D4B16FAD7F071EF6FB0CA263D5888B714BAC123F4C610105C4F97A24737ED321823E2D9410C4617B26333EE4664A5C3647715F0DA532A87D70CBF170577E32501E48E679A9872F43BCAECFDA7F9D08226F5F0913406CD000F14F5899C0B13B70DD5F9E330B82CC06D048472160F663FADC2C6825CE47ABDB7CF16C5A718B39925E95A1B23F1F91309CBBF3EB73ACCB4E32ED376C51A5287D7BBC872AA05F382E45F1F78134CB199</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 = 9B35B0EE11899D4E05822A62AE8FBE66F760548CFB05D137B00A90B349D0FB053E66AB85CA80E7347960D6780CB79A2FEA109EACB12BCBE9C8D8D66DB20C4D40475ADBBCFEB1E5E8B346BA902EBE0AE9A00FB96337218A46E66CC5323AE8F88EE814707FA57887FF010FEE519704DE88056B5C3BDBF8D911DA07B2E9F615C41C495A47372AC3E8D5604D24B2C94737142CE8FA10765C7575CEA0136B3B2F17CC93B2CC5C46EB8C7416CAFFD346C9784B7A3B50EE2B064380087F3E86EBE9C2679DC1F4A238C9D27660FDE64C53798EC23BBB36F602441F37B2F370F1F3379D0FB57FCA43B9A58B4CA7022E658D0D93849543CAC46DDFB27D6DDED4174DDA97CB</code></pre>
|
||||
<pre><code>g_b = 75A40F5AB94BF77D83F9718884A57CB402DCA13BF7E7B656F9F71D373155F29F4964498949AFDCBAC8A0860E88C469A9DA84689E9DF269CFD20EED57B110BCC56CB328888D2554B13E502A3CCE43B306F642F8E7481C9006BF29257F7CFD3CE0C409BB46D010B20A73242D1D254BAC3181D394E3B90075D172EE9A3C92838F57F5B4094DDBA94CAB683A9D1D465EE60DC63CBC97499EE9E954AA30C433369B8FBB47B4AD03D51A3B4241882B055233C3EC29508B11B139D0F72ED69C62F92CB1B6D806A3E5B73D81ED5FF2F48878F61526E4CD46BC7745E936E518FA91A6B43552A61DB43006F9EA976EF72CB41F455AA493CA27CF5543EF5607402C29ECBBDF</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 66 CD 10 76 62 1B 9E 73 E9 F5 D2 63
|
||||
0010 | 5F 0C 1A 01 26 AF A9 7C 5F D7 7F F1 E0 39 D1 40
|
||||
0020 | 00 ED 24 1D 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | 9B 35 B0 EE 11 89 9D 4E 05 82 2A 62 AE 8F BE 66
|
||||
0040 | F7 60 54 8C FB 05 D1 37 B0 0A 90 B3 49 D0 FB 05
|
||||
0050 | 3E 66 AB 85 CA 80 E7 34 79 60 D6 78 0C B7 9A 2F
|
||||
0060 | EA 10 9E AC B1 2B CB E9 C8 D8 D6 6D B2 0C 4D 40
|
||||
0070 | 47 5A DB BC FE B1 E5 E8 B3 46 BA 90 2E BE 0A E9
|
||||
0080 | A0 0F B9 63 37 21 8A 46 E6 6C C5 32 3A E8 F8 8E
|
||||
0090 | E8 14 70 7F A5 78 87 FF 01 0F EE 51 97 04 DE 88
|
||||
00A0 | 05 6B 5C 3B DB F8 D9 11 DA 07 B2 E9 F6 15 C4 1C
|
||||
00B0 | 49 5A 47 37 2A C3 E8 D5 60 4D 24 B2 C9 47 37 14
|
||||
00C0 | 2C E8 FA 10 76 5C 75 75 CE A0 13 6B 3B 2F 17 CC
|
||||
00D0 | 93 B2 CC 5C 46 EB 8C 74 16 CA FF D3 46 C9 78 4B
|
||||
00E0 | 7A 3B 50 EE 2B 06 43 80 08 7F 3E 86 EB E9 C2 67
|
||||
00F0 | 9D C1 F4 A2 38 C9 D2 76 60 FD E6 4C 53 79 8E C2
|
||||
0100 | 3B BB 36 F6 02 44 1F 37 B2 F3 70 F1 F3 37 9D 0F
|
||||
0110 | B5 7F CA 43 B9 A5 8B 4C A7 02 2E 65 8D 0D 93 84
|
||||
0120 | 95 43 CA C4 6D DF B2 7D 6D DE D4 17 4D DA 97 CB</code></pre>
|
||||
<pre><code>0000 | 54 B6 43 66 6A 9B 4E AF AE 17 1B B3 A7 3D 9E A9
|
||||
0010 | 7C 57 90 09 33 E8 1F 9C 78 18 56 F0 1D D4 12 93
|
||||
0020 | F2 25 29 B8 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | 75 A4 0F 5A B9 4B F7 7D 83 F9 71 88 84 A5 7C B4
|
||||
0040 | 02 DC A1 3B F7 E7 B6 56 F9 F7 1D 37 31 55 F2 9F
|
||||
0050 | 49 64 49 89 49 AF DC BA C8 A0 86 0E 88 C4 69 A9
|
||||
0060 | DA 84 68 9E 9D F2 69 CF D2 0E ED 57 B1 10 BC C5
|
||||
0070 | 6C B3 28 88 8D 25 54 B1 3E 50 2A 3C CE 43 B3 06
|
||||
0080 | F6 42 F8 E7 48 1C 90 06 BF 29 25 7F 7C FD 3C E0
|
||||
0090 | C4 09 BB 46 D0 10 B2 0A 73 24 2D 1D 25 4B AC 31
|
||||
00A0 | 81 D3 94 E3 B9 00 75 D1 72 EE 9A 3C 92 83 8F 57
|
||||
00B0 | F5 B4 09 4D DB A9 4C AB 68 3A 9D 1D 46 5E E6 0D
|
||||
00C0 | C6 3C BC 97 49 9E E9 E9 54 AA 30 C4 33 36 9B 8F
|
||||
00D0 | BB 47 B4 AD 03 D5 1A 3B 42 41 88 2B 05 52 33 C3
|
||||
00E0 | EC 29 50 8B 11 B1 39 D0 F7 2E D6 9C 62 F9 2C B1
|
||||
00F0 | B6 D8 06 A3 E5 B7 3D 81 ED 5F F2 F4 88 78 F6 15
|
||||
0100 | 26 E4 CD 46 BC 77 45 E9 36 E5 18 FA 91 A6 B4 35
|
||||
0110 | 52 A6 1D B4 30 06 F9 EA 97 6E F7 2C B4 1F 45 5A
|
||||
0120 | A4 93 CA 27 CF 55 43 EF 56 07 40 2C 29 EC BB DF</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 = BA0D89B566CD1076621B9E73E9F5D2635F0C1A0126AFA97C5FD77FF1E039D14000ED241
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>66CD1076621B9E73E9F5D2635F0C1A01</code></td>
|
||||
<td><code>6A9B4EAFAE171BB3A73D9EA97C579009</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>26AFA97C5FD77FF1E039D14000ED241D</code></td>
|
||||
<td><code>33E81F9C781856F01DD41293F22529B8</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>g_b</td>
|
||||
<td>36, 260</td>
|
||||
<td><code>FE0001009B35B0EE11899D4E05822A62</code> <code>AE8FBE66F760548CFB05D137B00A90B3</code> <code>49D0FB053E66AB85CA80E7347960D678</code> <code>0CB79A2FEA109EACB12BCBE9C8D8D66D</code> <code>B20C4D40475ADBBCFEB1E5E8B346BA90</code> <code>2EBE0AE9A00FB96337218A46E66CC532</code> <code>3AE8F88EE814707FA57887FF010FEE51</code> <code>9704DE88056B5C3BDBF8D911DA07B2E9</code> <code>F615C41C495A47372AC3E8D5604D24B2</code> <code>C94737142CE8FA10765C7575CEA0136B</code> <code>3B2F17CC93B2CC5C46EB8C7416CAFFD3</code> <code>46C9784B7A3B50EE2B064380087F3E86</code> <code>EBE9C2679DC1F4A238C9D27660FDE64C</code> <code>53798EC23BBB36F602441F37B2F370F1</code> <code>F3379D0FB57FCA43B9A58B4CA7022E65</code> <code>8D0D93849543CAC46DDFB27D6DDED417</code><br> <code>4DDA97CB</code></td>
|
||||
<td><code>FE00010075A40F5AB94BF77D83F97188</code> <code>84A57CB402DCA13BF7E7B656F9F71D37</code> <code>3155F29F4964498949AFDCBAC8A0860E</code> <code>88C469A9DA84689E9DF269CFD20EED57</code> <code>B110BCC56CB328888D2554B13E502A3C</code> <code>CE43B306F642F8E7481C9006BF29257F</code> <code>7CFD3CE0C409BB46D010B20A73242D1D</code> <code>254BAC3181D394E3B90075D172EE9A3C</code> <code>92838F57F5B4094DDBA94CAB683A9D1D</code> <code>465EE60DC63CBC97499EE9E954AA30C4</code> <code>33369B8FBB47B4AD03D51A3B4241882B</code> <code>055233C3EC29508B11B139D0F72ED69C</code> <code>62F92CB1B6D806A3E5B73D81ED5FF2F4</code> <code>8878F61526E4CD46BC7745E936E518FA</code> <code>91A6B43552A61DB43006F9EA976EF72C</code> <code>B41F455AA493CA27CF5543EF5607402C</code><br> <code>29ECBBDF</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 = BA0D89B566CD1076621B9E73E9F5D2635F0C1A0126AFA97C5FD77FF1E039D14000ED241
|
|||
<!-- 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 = 54B6436666CD1076621B9E73E9F5D2635F0C1A0126AFA97C5FD77FF1E039D14000ED241D0000000000000000FE0001009B35B0EE11899D4E05822A62AE8FBE66F760548CFB05D137B00A90B349D0FB053E66AB85CA80E7347960D6780CB79A2FEA109EACB12BCBE9C8D8D66DB20C4D40475ADBBCFEB1E5E8B346BA902EBE0AE9A00FB96337218A46E66CC5323AE8F88EE814707FA57887FF010FEE519704DE88056B5C3BDBF8D911DA07B2E9F615C41C495A47372AC3E8D5604D24B2C94737142CE8FA10765C7575CEA0136B3B2F17CC93B2CC5C46EB8C7416CAFFD346C9784B7A3B50EE2B064380087F3E86EBE9C2679DC1F4A238C9D27660FDE64C53798EC23BBB36F602441F37B2F370F1F3379D0FB57FCA43B9A58B4CA7022E658D0D93849543CAC46DDFB27D6DDED4174DDA97CB
|
||||
padding = B646261505D593BCB4C1D796
|
||||
tmp_aes_key = 9C9BB7C3AA015DBE62FE5577D0C089EF7C0A6EE4350CAC3BEE267C92AF846BBF
|
||||
tmp_aes_iv = E8F23793463529F1EBDB9B64830F0D3FDD9F5AD447CBBFF257E7385F9A879B42</code></pre>
|
||||
<pre><code>data = 54B643666A9B4EAFAE171BB3A73D9EA97C57900933E81F9C781856F01DD41293F22529B80000000000000000FE00010075A40F5AB94BF77D83F9718884A57CB402DCA13BF7E7B656F9F71D373155F29F4964498949AFDCBAC8A0860E88C469A9DA84689E9DF269CFD20EED57B110BCC56CB328888D2554B13E502A3CCE43B306F642F8E7481C9006BF29257F7CFD3CE0C409BB46D010B20A73242D1D254BAC3181D394E3B90075D172EE9A3C92838F57F5B4094DDBA94CAB683A9D1D465EE60DC63CBC97499EE9E954AA30C433369B8FBB47B4AD03D51A3B4241882B055233C3EC29508B11B139D0F72ED69C62F92CB1B6D806A3E5B73D81ED5FF2F48878F61526E4CD46BC7745E936E518FA91A6B43552A61DB43006F9EA976EF72CB41F455AA493CA27CF5543EF5607402C29ECBBDF
|
||||
padding = 51042950C65DB29CA8AA231A
|
||||
tmp_aes_key = 76B7856C62B3B063872C5836F41263DBBEE80BE03CCB81964E47909EC368BA45
|
||||
tmp_aes_iv = C8461CF3798BF669D030D8D3910AEBFD94849B2FBC83DE839397845A67C7C12C</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 = C533E5FB208024045491BC78D56FDCA13C02E9C40463BC90AB7A97D62D44445686762FCB33E2E286AB1A9186B0CDD436892E970DCE565F34D8EAAEB72E11B615E4ED0C6871577AE4ED5A8AB10BE7BCB31CA00E9902CF33DC26D9571B02AC2D2E8827BEE24CE00513CC95BD39B8B705597A05CDEBBEFD4FBABA1EB72B6DC628ACB7B0CBCD9DDD511E98B93C7671E74B7F3667A04DAF15D4C613A64E4F5870E1CF5027D199C4D95394A3A7E7AFD371CE9045E0DAF48C1C48AEC248A51363C6401CCE30EA0B2A5EB41F5112FCBC58AB40369BF0153A880D54B1634114E47FCCD12C76486F9621C98B2B963CE0CA37E23A0017DC61E8778F544A8167C8DE3A1067EFC53B064D0578F2D3D867B562D027FBE20E08D4AD3232922A95E9C2BFF803F7E80B814969297B1D380084DD21C39C7B78A497CEFA2E9F167595DB499B6661B0AC0E339CB57F9F7ED64433A7806FAB7B29</code></pre>
|
||||
<pre><code>encrypted_data = 057EE5BCC7953EF0ACF466FCB5FD73C71188D1572835F4D78C5152DAFC31878661C4EA1F283C60D3618EF2297D65907DB17FF1CC4D7589187F63B6284629C3974061E6E9F9FAD0506857BF91E75EC56AFBD03E387818B9E1DF3B07FC70A53DBC9515DFD9340BA82CA9C1A53E8CE0D335C1C6DC121E719879E7D48ADC64D5EC567D9034767B32942052E204AD96E9897DC844541126AAFD73DD1CC2A95C5FC6841FAE863C3D34512E23D68DD3A9885033BB26D6A6340D1BC57974AD7D25D65A9BD1635720BC348B57F20E357D4CACE2A83CCCB822260184E7C7512AD638F3DFF7ED63688B24E7E9D534041122CD809EBF7295BEFF70D8473AB5107C04ECFACACEB93A21EBE023351DC86A852F65B3CF4695E0F5FF3CBB4317CA48AA75FDA86A987DFE6017175C2BE8D9B64BDF575DCDF13716D5F8F7C7A1895DDB743DF3BC24A24707D44767B061C1E8CF646C65F6C1F2</code></pre>
|
||||
<!-- end client_DH_inner_data_output -->
|
||||
<p>The length of the final string is 336 bytes.</p>
|
||||
<h6>7.2) set_client_DH_params query</h6>
|
||||
<!-- start set_client_DH_params -->
|
||||
<p>Sent payload (excluding transport headers/trailers):</p>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 80 14 01 00 7C 43 A1 66
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 66 CD 10 76 62 1B 9E 73
|
||||
0020 | E9 F5 D2 63 5F 0C 1A 01 26 AF A9 7C 5F D7 7F F1
|
||||
0030 | E0 39 D1 40 00 ED 24 1D FE 50 01 00 C5 33 E5 FB
|
||||
0040 | 20 80 24 04 54 91 BC 78 D5 6F DC A1 3C 02 E9 C4
|
||||
0050 | 04 63 BC 90 AB 7A 97 D6 2D 44 44 56 86 76 2F CB
|
||||
0060 | 33 E2 E2 86 AB 1A 91 86 B0 CD D4 36 89 2E 97 0D
|
||||
0070 | CE 56 5F 34 D8 EA AE B7 2E 11 B6 15 E4 ED 0C 68
|
||||
0080 | 71 57 7A E4 ED 5A 8A B1 0B E7 BC B3 1C A0 0E 99
|
||||
0090 | 02 CF 33 DC 26 D9 57 1B 02 AC 2D 2E 88 27 BE E2
|
||||
00A0 | 4C E0 05 13 CC 95 BD 39 B8 B7 05 59 7A 05 CD EB
|
||||
00B0 | BE FD 4F BA BA 1E B7 2B 6D C6 28 AC B7 B0 CB CD
|
||||
00C0 | 9D DD 51 1E 98 B9 3C 76 71 E7 4B 7F 36 67 A0 4D
|
||||
00D0 | AF 15 D4 C6 13 A6 4E 4F 58 70 E1 CF 50 27 D1 99
|
||||
00E0 | C4 D9 53 94 A3 A7 E7 AF D3 71 CE 90 45 E0 DA F4
|
||||
00F0 | 8C 1C 48 AE C2 48 A5 13 63 C6 40 1C CE 30 EA 0B
|
||||
0100 | 2A 5E B4 1F 51 12 FC BC 58 AB 40 36 9B F0 15 3A
|
||||
0110 | 88 0D 54 B1 63 41 14 E4 7F CC D1 2C 76 48 6F 96
|
||||
0120 | 21 C9 8B 2B 96 3C E0 CA 37 E2 3A 00 17 DC 61 E8
|
||||
0130 | 77 8F 54 4A 81 67 C8 DE 3A 10 67 EF C5 3B 06 4D
|
||||
0140 | 05 78 F2 D3 D8 67 B5 62 D0 27 FB E2 0E 08 D4 AD
|
||||
0150 | 32 32 92 2A 95 E9 C2 BF F8 03 F7 E8 0B 81 49 69
|
||||
0160 | 29 7B 1D 38 00 84 DD 21 C3 9C 7B 78 A4 97 CE FA
|
||||
0170 | 2E 9F 16 75 95 DB 49 9B 66 61 B0 AC 0E 33 9C B5
|
||||
0180 | 7F 9F 7E D6 44 33 A7 80 6F AB 7B 29</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 00 96 0C 00 14 44 A1 66
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 6A 9B 4E AF AE 17 1B B3
|
||||
0020 | A7 3D 9E A9 7C 57 90 09 33 E8 1F 9C 78 18 56 F0
|
||||
0030 | 1D D4 12 93 F2 25 29 B8 FE 50 01 00 05 7E E5 BC
|
||||
0040 | C7 95 3E F0 AC F4 66 FC B5 FD 73 C7 11 88 D1 57
|
||||
0050 | 28 35 F4 D7 8C 51 52 DA FC 31 87 86 61 C4 EA 1F
|
||||
0060 | 28 3C 60 D3 61 8E F2 29 7D 65 90 7D B1 7F F1 CC
|
||||
0070 | 4D 75 89 18 7F 63 B6 28 46 29 C3 97 40 61 E6 E9
|
||||
0080 | F9 FA D0 50 68 57 BF 91 E7 5E C5 6A FB D0 3E 38
|
||||
0090 | 78 18 B9 E1 DF 3B 07 FC 70 A5 3D BC 95 15 DF D9
|
||||
00A0 | 34 0B A8 2C A9 C1 A5 3E 8C E0 D3 35 C1 C6 DC 12
|
||||
00B0 | 1E 71 98 79 E7 D4 8A DC 64 D5 EC 56 7D 90 34 76
|
||||
00C0 | 7B 32 94 20 52 E2 04 AD 96 E9 89 7D C8 44 54 11
|
||||
00D0 | 26 AA FD 73 DD 1C C2 A9 5C 5F C6 84 1F AE 86 3C
|
||||
00E0 | 3D 34 51 2E 23 D6 8D D3 A9 88 50 33 BB 26 D6 A6
|
||||
00F0 | 34 0D 1B C5 79 74 AD 7D 25 D6 5A 9B D1 63 57 20
|
||||
0100 | BC 34 8B 57 F2 0E 35 7D 4C AC E2 A8 3C CC B8 22
|
||||
0110 | 26 01 84 E7 C7 51 2A D6 38 F3 DF F7 ED 63 68 8B
|
||||
0120 | 24 E7 E9 D5 34 04 11 22 CD 80 9E BF 72 95 BE FF
|
||||
0130 | 70 D8 47 3A B5 10 7C 04 EC FA CA CE B9 3A 21 EB
|
||||
0140 | E0 23 35 1D C8 6A 85 2F 65 B3 CF 46 95 E0 F5 FF
|
||||
0150 | 3C BB 43 17 CA 48 AA 75 FD A8 6A 98 7D FE 60 17
|
||||
0160 | 17 5C 2B E8 D9 B6 4B DF 57 5D CD F1 37 16 D5 F8
|
||||
0170 | F7 C7 A1 89 5D DB 74 3D F3 BC 24 A2 47 07 D4 47
|
||||
0180 | 67 B0 61 C1 E8 CF 64 6C 65 F6 C1 F2</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>801401007C43A166</code></td>
|
||||
<td><code>00960C001444A166</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>66CD1076621B9E73E9F5D2635F0C1A01</code></td>
|
||||
<td><code>6A9B4EAFAE171BB3A73D9EA97C579009</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>26AFA97C5FD77FF1E039D14000ED241D</code></td>
|
||||
<td><code>33E81F9C781856F01DD41293F22529B8</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>56, 340</td>
|
||||
<td><code>FE500100C533E5FB208024045491BC78</code> <code>D56FDCA13C02E9C40463BC90AB7A97D6</code> <code>2D44445686762FCB33E2E286AB1A9186</code> <code>B0CDD436892E970DCE565F34D8EAAEB7</code> <code>2E11B615E4ED0C6871577AE4ED5A8AB1</code> <code>0BE7BCB31CA00E9902CF33DC26D9571B</code> <code>02AC2D2E8827BEE24CE00513CC95BD39</code> <code>B8B705597A05CDEBBEFD4FBABA1EB72B</code> <code>6DC628ACB7B0CBCD9DDD511E98B93C76</code> <code>71E74B7F3667A04DAF15D4C613A64E4F</code> <code>5870E1CF5027D199C4D95394A3A7E7AF</code> <code>D371CE9045E0DAF48C1C48AEC248A513</code> <code>63C6401CCE30EA0B2A5EB41F5112FCBC</code> <code>58AB40369BF0153A880D54B1634114E4</code> <code>7FCCD12C76486F9621C98B2B963CE0CA</code> <code>37E23A0017DC61E8778F544A8167C8DE</code> <code>3A1067EFC53B064D0578F2D3D867B562</code> <code>D027FBE20E08D4AD3232922A95E9C2BF</code> <code>F803F7E80B814969297B1D380084DD21</code> <code>C39C7B78A497CEFA2E9F167595DB499B</code> <code>6661B0AC0E339CB57F9F7ED64433A780</code><br> <code>6FAB7B29</code></td>
|
||||
<td><code>FE500100057EE5BCC7953EF0ACF466FC</code> <code>B5FD73C71188D1572835F4D78C5152DA</code> <code>FC31878661C4EA1F283C60D3618EF229</code> <code>7D65907DB17FF1CC4D7589187F63B628</code> <code>4629C3974061E6E9F9FAD0506857BF91</code> <code>E75EC56AFBD03E387818B9E1DF3B07FC</code> <code>70A53DBC9515DFD9340BA82CA9C1A53E</code> <code>8CE0D335C1C6DC121E719879E7D48ADC</code> <code>64D5EC567D9034767B32942052E204AD</code> <code>96E9897DC844541126AAFD73DD1CC2A9</code> <code>5C5FC6841FAE863C3D34512E23D68DD3</code> <code>A9885033BB26D6A6340D1BC57974AD7D</code> <code>25D65A9BD1635720BC348B57F20E357D</code> <code>4CACE2A83CCCB822260184E7C7512AD6</code> <code>38F3DFF7ED63688B24E7E9D534041122</code> <code>CD809EBF7295BEFF70D8473AB5107C04</code> <code>ECFACACEB93A21EBE023351DC86A852F</code> <code>65B3CF4695E0F5FF3CBB4317CA48AA75</code> <code>FDA86A987DFE6017175C2BE8D9B64BDF</code> <code>575DCDF13716D5F8F7C7A1895DDB743D</code> <code>F3BC24A24707D44767B061C1E8CF646C</code><br> <code>65F6C1F2</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 = 4276EF1032C70A4E35670EAF0E50151FFD3EC40D76DDFB6F1E034ABDAB81639D82E7E7CF136998ED3BEE8043BFD2B9E4D6BCCBD454C8B1981A215ADA694516C6E63F033D3243FC8309FA37441C1BC7FE9F478B463A99ADB3A9AD3A05C31946E23641A2EFD932AA92B3FA945381F4CD242FCBF7B5405C01B770D116531F94282DBA1B8D084326527D7CA31D38A3E8609CB9E5E2550C34C5FF1B48F007C9548CEF02786EA179FA31C30EF2487116C5EF267994F77E79D851E5A0D73A50AC6A706D19B941A6630EA092A4EB238EA3255CBCF02B32DE812DD69C93B49DD1EEE0DED53FC31698CA918BB51099E1FD514657228CC46FDAF446EBFC428CAE931B6725ED</code></pre>
|
||||
<pre><code>auth_key = B4FDA21A25AF3F5F6BCC71FD5007FFF4F232DFDC5299E077D4120BEC55D49472A01DBFB0DED518801C131F88E55D674BE1DBB0AF59304B78757ADD6022F86E366603CBFDF83AB9E7168B66436C707696086F30A99519280A439450E9323F566A9A1258395D121C026EBED8053C6A50DA88848332B97E405038A9E63507F9CEC7BCE38D5DE18ED6502A548A24B224DC9E4D07CC365D6AEB38CFEE0FC68FBFA14ED3F60B53A7354E67782658829168037CBDB10C9B9EC9DA589186F47C112D980044025413772BCA722CB54407F7BB2184AD91909119C6A2C64C4F512CA6130D78F589ED19C79508FD3AB9741B0D0E68E5BB7131057873297833BCC76CB5F8FF4D</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 90 46 C9 7C 43 A1 66
|
||||
0010 | 3C 00 00 00 34 F7 CB 3B 66 CD 10 76 62 1B 9E 73
|
||||
0020 | E9 F5 D2 63 5F 0C 1A 01 26 AF A9 7C 5F D7 7F F1
|
||||
0030 | E0 39 D1 40 00 ED 24 1D 68 01 01 49 64 44 91 E7
|
||||
0040 | 76 C7 E3 8A 54 E3 33 F9</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 8C 51 EE 15 44 A1 66
|
||||
0010 | 48 00 00 00 34 F7 CB 3B 6A 9B 4E AF AE 17 1B B3
|
||||
0020 | A7 3D 9E A9 7C 57 90 09 33 E8 1F 9C 78 18 56 F0
|
||||
0030 | 1D D4 12 93 F2 25 29 B8 4A E4 66 01 24 F6 C9 BE
|
||||
0040 | 97 86 17 9B 33 45 56 71</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>019046C97C43A166</code></td>
|
||||
<td><code>018C51EE1544A166</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>3C000000</code> (60 in decimal)</td>
|
||||
<td><code>48000000</code> (72 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>66CD1076621B9E73E9F5D2635F0C1A01</code></td>
|
||||
<td><code>6A9B4EAFAE171BB3A73D9EA97C579009</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>26AFA97C5FD77FF1E039D14000ED241D</code></td>
|
||||
<td><code>33E81F9C781856F01DD41293F22529B8</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce_hash1</td>
|
||||
<td>56, 16</td>
|
||||
<td><code>68010149644491E776C7E38A54E333F9</code></td>
|
||||
<td><code>4AE4660124F6C9BE9786179B33455671</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>
|
||||
|
|
Loading…
Reference in a new issue