mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2025-01-05 18:38:19 +01:00
Update content of files
This commit is contained in:
parent
fa0221dd3c
commit
9ed3ac9ba1
2 changed files with 206 additions and 206 deletions
|
@ -49,7 +49,7 @@ An error is characterized by several parameters:</p>
|
|||
<h4><a class="anchor" href="#error-type" id="error-type" name="error-type"><i class="anchor-icon"></i></a>Error Type</h4>
|
||||
<p>A string literal in the form of <code>/[A-Z_0-9]+/</code>, which summarizes the problem. For example, <code>AUTH_KEY_UNREGISTERED</code>. This is an optional parameter.</p>
|
||||
<h4><a class="anchor" href="#error-database" id="error-database" name="error-database"><i class="anchor-icon"></i></a>Error Database</h4>
|
||||
<p>A full human-readable JSON list of RPC errors that can be returned by all methods in the API can be found <a href="/file/400780400203/4/Fur14cB2JPY.110250.json/21edc77f71292e9672">here »</a>, what follows is a description of its fields: </p>
|
||||
<p>A full human-readable JSON list of RPC errors that can be returned by all methods in the API can be found <a href="/file/400780400770/2/UkrVTqks7WU.110347.json/0a48eed8753dd797a9">here »</a>, what follows is a description of its fields: </p>
|
||||
<ul>
|
||||
<li><code>errors</code> - All error messages and codes for each method (object).<ul>
|
||||
<li>Keys: Error codes as strings (numeric strings)</li>
|
||||
|
|
|
@ -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 44 75 02 00 B1 14 AC 65
|
||||
0010 | 14 00 00 00 F1 8E 7E BE E9 78 DB B0 74 3F E9 90
|
||||
0020 | 23 90 8D 35 49 A9 D0 3E</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 9C 2F 03 00 AD 0A AD 65
|
||||
0010 | 14 00 00 00 F1 8E 7E BE 26 A5 DC AE 80 4C A6 2C
|
||||
0020 | 78 28 79 33 31 2D 88 9F</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>44750200B114AC65</code></td>
|
||||
<td><code>9C2F0300AD0AAD65</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>E978DBB0743FE99023908D3549A9D03E</code></td>
|
||||
<td><code>26A5DCAE804CA62C78287933312D889F</code></td>
|
||||
<td>Random number</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -104,11 +104,11 @@
|
|||
<h5><a class="anchor" href="#2-server-sends-response-of-the-form" id="2-server-sends-response-of-the-form" name="2-server-sends-response-of-the-form"><i class="anchor-icon"></i></a>2) Server sends response of the form</h5>
|
||||
<!-- start resPQ -->
|
||||
<p>Received payload (excluding transport headers/trailers):</p>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 A4 5F 52 B1 14 AC 65
|
||||
0010 | BC 00 00 00 63 24 16 05 E9 78 DB B0 74 3F E9 90
|
||||
0020 | 23 90 8D 35 49 A9 D0 3E 43 7A 52 81 56 6B 8D D1
|
||||
0030 | B4 C2 39 1A 28 03 40 0C 08 15 BB 46 F8 61 C2 9A
|
||||
0040 | E7 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 E8 38 40 AD 0A AD 65
|
||||
0010 | 78 00 00 00 63 24 16 05 26 A5 DC AE 80 4C A6 2C
|
||||
0020 | 78 28 79 33 31 2D 88 9F 25 0F 44 58 E1 C9 38 44
|
||||
0030 | 4C 16 11 BE 29 BE 8F 92 08 2D D7 94 15 B6 5B 9F
|
||||
0040 | 35 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>01A45F52B114AC65</code></td>
|
||||
<td><code>01E83840AD0AAD65</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>BC000000</code> (188 in decimal)</td>
|
||||
<td><code>78000000</code> (120 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -150,19 +150,19 @@
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>E978DBB0743FE99023908D3549A9D03E</code></td>
|
||||
<td><code>26A5DCAE804CA62C78287933312D889F</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>437A5281566B8DD1B4C2391A2803400C</code></td>
|
||||
<td><code>250F4458E1C938444C1611BE29BE8F92</code></td>
|
||||
<td>Server-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pq</td>
|
||||
<td>56, 12</td>
|
||||
<td><code>0815BB46F861C29AE7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1565923328047356647</td>
|
||||
<td><code>082DD79415B65B9F35000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 3303271672674230069</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 = 1565923328047356647</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1565923328047356647 = 1171349233 * 1336854359</code></p>
|
||||
<pre><code>p = 1171349233
|
||||
q = 1336854359</code></pre>
|
||||
<pre><code>pq = 3303271672674230069</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>3303271672674230069 = 1703551429 * 1939050161</code></p>
|
||||
<pre><code>p = 1703551429
|
||||
q = 1939050161</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 15 BB 46 F8 61 C2 9A E7 00 00 00
|
||||
0010 | 04 45 D1 5E F1 00 00 00 04 4F AE C7 57 00 00 00
|
||||
0020 | E9 78 DB B0 74 3F E9 90 23 90 8D 35 49 A9 D0 3E
|
||||
0030 | 43 7A 52 81 56 6B 8D D1 B4 C2 39 1A 28 03 40 0C
|
||||
0040 | 73 D7 F0 C7 7D FB 49 EB BC 51 8F 5D 94 9D 71 FC
|
||||
0050 | 34 A1 32 6A E4 61 F9 6C 05 E8 E4 04 DD B2 F7 4E
|
||||
<pre><code>0000 | 95 5F F5 A9 08 2D D7 94 15 B6 5B 9F 35 00 00 00
|
||||
0010 | 04 65 8A 21 C5 00 00 00 04 73 93 8E B1 00 00 00
|
||||
0020 | 26 A5 DC AE 80 4C A6 2C 78 28 79 33 31 2D 88 9F
|
||||
0030 | 25 0F 44 58 E1 C9 38 44 4C 16 11 BE 29 BE 8F 92
|
||||
0040 | 0F E1 FF 61 C2 B1 7C 44 87 0C 4B 90 98 B4 00 1D
|
||||
0050 | 67 36 8C 1E 07 26 EC 0A 55 8B 44 0E 1C 7D 18 6D
|
||||
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 = 1336854359</code></pre>
|
|||
<tr>
|
||||
<td>pq</td>
|
||||
<td>4, 12</td>
|
||||
<td><code>0815BB46F861C29AE7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1565923328047356647</td>
|
||||
<td><code>082DD79415B65B9F35000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 3303271672674230069</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>0445D15EF1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1171349233</td>
|
||||
<td><code>04658A21C5000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1703551429</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>044FAEC757000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1336854359</td>
|
||||
<td><code>0473938EB1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1939050161</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>E978DBB0743FE99023908D3549A9D03E</code></td>
|
||||
<td><code>26A5DCAE804CA62C78287933312D889F</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>48, 16</td>
|
||||
<td><code>437A5281566B8DD1B4C2391A2803400C</code></td>
|
||||
<td><code>250F4458E1C938444C1611BE29BE8F92</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce</td>
|
||||
<td>64, 32</td>
|
||||
<td><code>73D7F0C77DFB49EBBC518F5D949D71FC</code> <code>34A1326AE461F96C05E8E404DDB2F74E</code></td>
|
||||
<td><code>0FE1FF61C2B17C44870C4B9098B4001D</code> <code>67368C1E0726EC0A558B440E1C7D186D</code></td>
|
||||
<td>Client-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -291,39 +291,39 @@ q = 1336854359</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 = 955FF5A90815BB46F861C29AE70000000445D15EF1000000044FAEC757000000E978DBB0743FE99023908D3549A9D03E437A5281566B8DD1B4C2391A2803400C73D7F0C77DFB49EBBC518F5D949D71FC34A1326AE461F96C05E8E404DDB2F74E02000000
|
||||
random_padding_bytes = 14BF6A70E3F550467FAE1BE28E80F43545AEEFD410661367EF0D1FE2C1DB27F312549AA75E13C15C17417F2535F10CADADE45FB8EC24FFFE33DB2B6BF2980D491991904D1FFBEBF398DDC890E218AACB21C25D1C0C0F7935E596126E</code></pre>
|
||||
<pre><code>data = 955FF5A9082DD79415B65B9F3500000004658A21C50000000473938EB100000026A5DCAE804CA62C78287933312D889F250F4458E1C938444C1611BE29BE8F920FE1FF61C2B17C44870C4B9098B4001D67368C1E0726EC0A558B440E1C7D186D02000000
|
||||
random_padding_bytes = B2EA42FBE8B453167126DAEE4BE67E04A381EAB12118FEBC35BBDD1371F6F5F62DFA169C10CBD05FE94324744728E3B0187CB31D51EA19C36B3ACA17963254DA0FDCA9C9272DA52CB6B7FF7A7C199DA89D5896C57867AE22268F7D48</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 = ADBAFD9A9BF1E23B77A1C20D6D1A7EFFF9D678D6ABD122378D9ED8E09A4E5A33FD3519B821D339F0CB2CC6E7ADBCAC7C754698508AB7B024C61F48E4084CDA4DDEE413A65D729E5D09ACFAAC5F2FF93141C02126794A2475A6428F4D094EFF3D5DF111BD2AEBB4F38D07728D622C7DC536D284AC71F9F980264B3E5E9A281E849E99B0A9DA817775481BB623F1F2F915FD955427D6D823C03EC30FBA9D810D195177B5EFE322DBCDF60862E5EA44FE0A56B6CF6A9017A25ADB52F7935A31E033763C4DBD47E5F507D8ED216D6CF7029AC7F7B85CF50CBDA91423F545D73A497FC26885A1CDF464728BAF0FBC07523556CE9C3C5AA02F516F26997BF54F8CF4C7</code></pre>
|
||||
<pre><code>encrypted_data = 6204E57B20D54182C65042F51565FE1A50E21118615E2AC6B5490CB33C1B0CAE9C427F5A2509B74E7D0CFF8388DC0557590A9D58F7E6B37421A66880F1A83B5F56DE43DE86100322A06EE92CC0FBC9F1E175343DE5EDE6E8D9D368D735EF7331EB8D3AA3B890F77F9CACAB9271395CE9B1C83BC5E7B546B766AFB9F2EF652104DACE141CA99585C0D6FABA1EF873860699D806D2607E9F361F24F1BE968A55B1692F7AF44D2B3080D6D9D23B9F8D2FE29CFD66FF909F76AD62A11338A44F6DA043687E096915BCDB8FF42B89A4410F3AAE199DF60E28B306956431A11F8B1CB893625D1477A63EBB30DB4EEDBD0F4B3587C87C35F8C489368A12E0221BF2C779</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 80 E8 05 00 B1 14 AC 65
|
||||
0010 | 40 01 00 00 BE E4 12 D7 E9 78 DB B0 74 3F E9 90
|
||||
0020 | 23 90 8D 35 49 A9 D0 3E 43 7A 52 81 56 6B 8D D1
|
||||
0030 | B4 C2 39 1A 28 03 40 0C 04 45 D1 5E F1 00 00 00
|
||||
0040 | 04 4F AE C7 57 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 AD BA FD 9A 9B F1 E2 3B 77 A1 C2 0D
|
||||
0060 | 6D 1A 7E FF F9 D6 78 D6 AB D1 22 37 8D 9E D8 E0
|
||||
0070 | 9A 4E 5A 33 FD 35 19 B8 21 D3 39 F0 CB 2C C6 E7
|
||||
0080 | AD BC AC 7C 75 46 98 50 8A B7 B0 24 C6 1F 48 E4
|
||||
0090 | 08 4C DA 4D DE E4 13 A6 5D 72 9E 5D 09 AC FA AC
|
||||
00A0 | 5F 2F F9 31 41 C0 21 26 79 4A 24 75 A6 42 8F 4D
|
||||
00B0 | 09 4E FF 3D 5D F1 11 BD 2A EB B4 F3 8D 07 72 8D
|
||||
00C0 | 62 2C 7D C5 36 D2 84 AC 71 F9 F9 80 26 4B 3E 5E
|
||||
00D0 | 9A 28 1E 84 9E 99 B0 A9 DA 81 77 75 48 1B B6 23
|
||||
00E0 | F1 F2 F9 15 FD 95 54 27 D6 D8 23 C0 3E C3 0F BA
|
||||
00F0 | 9D 81 0D 19 51 77 B5 EF E3 22 DB CD F6 08 62 E5
|
||||
0100 | EA 44 FE 0A 56 B6 CF 6A 90 17 A2 5A DB 52 F7 93
|
||||
0110 | 5A 31 E0 33 76 3C 4D BD 47 E5 F5 07 D8 ED 21 6D
|
||||
0120 | 6C F7 02 9A C7 F7 B8 5C F5 0C BD A9 14 23 F5 45
|
||||
0130 | D7 3A 49 7F C2 68 85 A1 CD F4 64 72 8B AF 0F BC
|
||||
0140 | 07 52 35 56 CE 9C 3C 5A A0 2F 51 6F 26 99 7B F5
|
||||
0150 | 4F 8C F4 C7</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 CC E4 07 00 AD 0A AD 65
|
||||
0010 | 40 01 00 00 BE E4 12 D7 26 A5 DC AE 80 4C A6 2C
|
||||
0020 | 78 28 79 33 31 2D 88 9F 25 0F 44 58 E1 C9 38 44
|
||||
0030 | 4C 16 11 BE 29 BE 8F 92 04 65 8A 21 C5 00 00 00
|
||||
0040 | 04 73 93 8E B1 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 62 04 E5 7B 20 D5 41 82 C6 50 42 F5
|
||||
0060 | 15 65 FE 1A 50 E2 11 18 61 5E 2A C6 B5 49 0C B3
|
||||
0070 | 3C 1B 0C AE 9C 42 7F 5A 25 09 B7 4E 7D 0C FF 83
|
||||
0080 | 88 DC 05 57 59 0A 9D 58 F7 E6 B3 74 21 A6 68 80
|
||||
0090 | F1 A8 3B 5F 56 DE 43 DE 86 10 03 22 A0 6E E9 2C
|
||||
00A0 | C0 FB C9 F1 E1 75 34 3D E5 ED E6 E8 D9 D3 68 D7
|
||||
00B0 | 35 EF 73 31 EB 8D 3A A3 B8 90 F7 7F 9C AC AB 92
|
||||
00C0 | 71 39 5C E9 B1 C8 3B C5 E7 B5 46 B7 66 AF B9 F2
|
||||
00D0 | EF 65 21 04 DA CE 14 1C A9 95 85 C0 D6 FA BA 1E
|
||||
00E0 | F8 73 86 06 99 D8 06 D2 60 7E 9F 36 1F 24 F1 BE
|
||||
00F0 | 96 8A 55 B1 69 2F 7A F4 4D 2B 30 80 D6 D9 D2 3B
|
||||
0100 | 9F 8D 2F E2 9C FD 66 FF 90 9F 76 AD 62 A1 13 38
|
||||
0110 | A4 4F 6D A0 43 68 7E 09 69 15 BC DB 8F F4 2B 89
|
||||
0120 | A4 41 0F 3A AE 19 9D F6 0E 28 B3 06 95 64 31 A1
|
||||
0130 | 1F 8B 1C B8 93 62 5D 14 77 A6 3E BB 30 DB 4E ED
|
||||
0140 | BD 0F 4B 35 87 C8 7C 35 F8 C4 89 36 8A 12 E0 22
|
||||
0150 | 1B F2 C7 79</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 = 14BF6A70E3F550467FAE1BE28E80F43545AEEFD410661367EF0D1FE2C
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>80E80500B114AC65</code></td>
|
||||
<td><code>CCE40700AD0AAD65</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 = 14BF6A70E3F550467FAE1BE28E80F43545AEEFD410661367EF0D1FE2C
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>E978DBB0743FE99023908D3549A9D03E</code></td>
|
||||
<td><code>26A5DCAE804CA62C78287933312D889F</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>437A5281566B8DD1B4C2391A2803400C</code></td>
|
||||
<td><code>250F4458E1C938444C1611BE29BE8F92</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p</td>
|
||||
<td>56, 8</td>
|
||||
<td><code>0445D15EF1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1171349233</td>
|
||||
<td><code>04658A21C5000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1703551429</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>044FAEC757000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1336854359</td>
|
||||
<td><code>0473938EB1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1939050161</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 = 14BF6A70E3F550467FAE1BE28E80F43545AEEFD410661367EF0D1FE2C
|
|||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>80, 260</td>
|
||||
<td><code>FE000100ADBAFD9A9BF1E23B77A1C20D</code> <code>6D1A7EFFF9D678D6ABD122378D9ED8E0</code> <code>9A4E5A33FD3519B821D339F0CB2CC6E7</code> <code>ADBCAC7C754698508AB7B024C61F48E4</code> <code>084CDA4DDEE413A65D729E5D09ACFAAC</code> <code>5F2FF93141C02126794A2475A6428F4D</code> <code>094EFF3D5DF111BD2AEBB4F38D07728D</code> <code>622C7DC536D284AC71F9F980264B3E5E</code> <code>9A281E849E99B0A9DA817775481BB623</code> <code>F1F2F915FD955427D6D823C03EC30FBA</code> <code>9D810D195177B5EFE322DBCDF60862E5</code> <code>EA44FE0A56B6CF6A9017A25ADB52F793</code> <code>5A31E033763C4DBD47E5F507D8ED216D</code> <code>6CF7029AC7F7B85CF50CBDA91423F545</code> <code>D73A497FC26885A1CDF464728BAF0FBC</code> <code>07523556CE9C3C5AA02F516F26997BF5</code><br> <code>4F8CF4C7</code></td>
|
||||
<td><code>FE0001006204E57B20D54182C65042F5</code> <code>1565FE1A50E21118615E2AC6B5490CB3</code> <code>3C1B0CAE9C427F5A2509B74E7D0CFF83</code> <code>88DC0557590A9D58F7E6B37421A66880</code> <code>F1A83B5F56DE43DE86100322A06EE92C</code> <code>C0FBC9F1E175343DE5EDE6E8D9D368D7</code> <code>35EF7331EB8D3AA3B890F77F9CACAB92</code> <code>71395CE9B1C83BC5E7B546B766AFB9F2</code> <code>EF652104DACE141CA99585C0D6FABA1E</code> <code>F873860699D806D2607E9F361F24F1BE</code> <code>968A55B1692F7AF44D2B3080D6D9D23B</code> <code>9F8D2FE29CFD66FF909F76AD62A11338</code> <code>A44F6DA043687E096915BCDB8FF42B89</code> <code>A4410F3AAE199DF60E28B306956431A1</code> <code>1F8B1CB893625D1477A63EBB30DB4EED</code> <code>BD0F4B3587C87C35F8C489368A12E022</code><br> <code>1BF2C779</code></td>
|
||||
<td>Value generated above</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -402,47 +402,47 @@ random_padding_bytes = 14BF6A70E3F550467FAE1BE28E80F43545AEEFD410661367EF0D1FE2C
|
|||
<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 7C 64 FF B1 14 AC 65
|
||||
0010 | 90 02 00 00 5C 07 E8 D0 E9 78 DB B0 74 3F E9 90
|
||||
0020 | 23 90 8D 35 49 A9 D0 3E 43 7A 52 81 56 6B 8D D1
|
||||
0030 | B4 C2 39 1A 28 03 40 0C FE 50 02 00 D9 77 C0 F7
|
||||
0040 | 92 34 D1 4B A4 3A C0 C7 A9 42 95 0F CC 70 66 E8
|
||||
0050 | A8 4F 8B F4 BF EB 2D 77 A3 1C EE BC B5 6A E0 78
|
||||
0060 | A8 D9 D4 F0 9D 4C 17 D7 0C 0C 56 9F 08 E4 EC B3
|
||||
0070 | FD 90 4E 08 42 2D 08 31 DF 12 F1 A7 87 5F 23 3E
|
||||
0080 | BE 0B DF DD 73 14 8B 9A D1 80 A3 06 2C 6A 8B BF
|
||||
0090 | 3B 5B 96 6F CF 0C 75 1A A0 57 88 4B 3D D1 75 87
|
||||
00A0 | E7 69 70 C3 79 F4 8A 0D FD BF 9A 75 A4 46 1F E8
|
||||
00B0 | C5 EE 3B 00 29 60 19 E9 B3 9F 24 A1 3F 10 42 E0
|
||||
00C0 | 6F 35 69 5F FE 17 87 8D BE 96 73 E2 31 E3 68 D9
|
||||
00D0 | CF 87 73 32 4D DE 2F 62 C6 77 DA C2 CF EC F4 0E
|
||||
00E0 | 40 BD 41 4B BB BF 77 79 A8 63 0A C9 B4 05 88 28
|
||||
00F0 | AF 60 8D A6 3E 91 E5 9E CA C6 AE 23 4C 69 B0 EE
|
||||
0100 | 8B 57 F0 C9 D6 9A DA 34 10 08 86 85 07 9A 7F A6
|
||||
0110 | F7 09 EB 8E 9F 82 1D 24 1F EA 13 C5 DA 6D 0F F5
|
||||
0120 | 6D 6F 90 0A 40 AA 84 8B F5 CC 44 CB 09 8A 85 7B
|
||||
0130 | 6B 59 7D C5 23 CA 54 4D 74 DE 63 2D C2 C9 87 A6
|
||||
0140 | 59 01 24 73 F3 3D 59 47 83 54 47 BE B2 BB D7 4C
|
||||
0150 | F1 9C 15 9F 34 B6 84 20 81 78 A6 C9 FD 6F 9A 54
|
||||
0160 | CF F2 8E C7 24 A9 FF 2E 19 C3 79 09 CE E7 4C 3F
|
||||
0170 | F3 54 04 4A 30 3B 70 EC 69 1F A0 A3 BD F5 A3 FA
|
||||
0180 | A2 26 D9 00 98 75 7B 3D E0 AF 9A 4C 27 47 97 85
|
||||
0190 | 4A 5B 35 C9 F5 8E 68 37 A0 E9 A1 5E B3 78 6B AC
|
||||
01A0 | E8 71 B8 C6 AB C0 69 3B 41 40 5D 9B C2 07 D8 DE
|
||||
01B0 | 04 D3 F4 2C E5 68 48 19 CD 0C 48 C9 9F C5 77 76
|
||||
01C0 | 25 86 F7 25 16 2A 21 A0 95 7E A4 FD 15 C5 5E A6
|
||||
01D0 | 4D CE 91 15 33 7A 9C 5B 18 D8 16 CC 3A 99 33 A4
|
||||
01E0 | 83 61 D0 5A F1 4F 99 8E 28 18 9D 14 BA 60 75 55
|
||||
01F0 | 96 26 95 D5 0A 24 D7 A7 D2 FE D4 7E 39 E2 C5 7B
|
||||
0200 | F1 1A 67 8C E4 F6 95 7F 90 A5 AC C6 5E 12 77 CF
|
||||
0210 | A2 DE 4E 5F 63 AE 9B 30 9F 04 EC CD 93 E1 AE 07
|
||||
0220 | 74 BD ED 7B 64 51 45 18 15 03 8C 5A 93 56 32 17
|
||||
0230 | C7 3D 5F 69 25 93 EB FE 28 FC 3C D7 5A B7 3F 14
|
||||
0240 | C6 8C 57 F2 41 BA FD B9 B1 48 78 30 47 B3 1C 78
|
||||
0250 | 23 85 C7 8D 2D D9 6E 45 79 DF 46 E3 D0 49 D5 0F
|
||||
0260 | 18 C3 D7 1E 92 2D 07 DC E9 BA 40 7B C3 D3 BF 76
|
||||
0270 | A1 88 E9 41 39 82 CD EA 98 78 AA 52 61 10 16 11
|
||||
0280 | 7D F9 8B F9 4B 67 85 55 CA 95 CA AD</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 E0 A7 02 AE 0A AD 65
|
||||
0010 | 90 02 00 00 5C 07 E8 D0 26 A5 DC AE 80 4C A6 2C
|
||||
0020 | 78 28 79 33 31 2D 88 9F 25 0F 44 58 E1 C9 38 44
|
||||
0030 | 4C 16 11 BE 29 BE 8F 92 FE 50 02 00 D5 0B 2E 62
|
||||
0040 | 88 D4 C0 A7 47 EB 1F EE F0 ED AD 7A 55 63 87 19
|
||||
0050 | 21 94 93 EE 77 F0 29 35 9E D1 8E 9B 0E 07 0E EB
|
||||
0060 | 43 5D 3A 77 0F 92 B1 51 6B 3E D4 97 66 CF 13 73
|
||||
0070 | 7D C3 65 14 51 72 FA 6C 44 0C 78 4F ED 39 C7 C1
|
||||
0080 | BD 99 5D C7 0C 5A 1D 0C 7D 63 58 71 DD D8 A4 DC
|
||||
0090 | 68 D8 5E 6A DE 50 F8 02 BB D4 B1 D5 D2 A0 44 88
|
||||
00A0 | 26 93 92 A1 BE BC 05 B4 86 56 BE 64 69 7A 09 64
|
||||
00B0 | 3C 26 93 28 9D D8 9D 39 B0 BF 97 7B 45 70 71 EA
|
||||
00C0 | 02 43 C1 D8 C1 5F 30 A1 11 03 DD E3 ED 0D DC F6
|
||||
00D0 | EC 0E 76 56 8A C8 3B C6 7B 42 9B E8 FD F8 71 C7
|
||||
00E0 | 6D 02 C5 5A 08 B1 BB 96 D8 5F 4D B8 99 25 89 5B
|
||||
00F0 | 81 01 65 A5 18 84 84 05 62 58 12 A1 88 58 25 7A
|
||||
0100 | 67 9E FA 40 98 F2 60 86 96 46 A0 81 E5 58 0E 6C
|
||||
0110 | 95 AA 29 CD 39 4F D1 5F CB 0A 83 61 4F 83 78 B9
|
||||
0120 | 12 7D 76 FC 44 E1 29 C2 74 0F C4 09 69 E3 4B F3
|
||||
0130 | 54 C7 4E 43 4F 9A 6E 2C 4C 8C 97 80 3A 57 E3 B2
|
||||
0140 | 44 1A 91 70 F8 FF 85 96 54 18 21 A5 2D 10 96 E8
|
||||
0150 | D1 8C A6 43 54 B8 42 26 C6 A2 97 30 C2 F7 D7 79
|
||||
0160 | F7 19 20 26 9E 7E DC 1C A7 EB 96 AB 28 1A 52 85
|
||||
0170 | ED 78 A9 BE 77 20 92 3E 3A 03 19 C2 F9 E9 83 8E
|
||||
0180 | 4E 8D 62 FB 67 6C AC 6F 7D 6A D7 C6 B3 F1 E3 94
|
||||
0190 | D5 B5 FC 5D FD 37 FD 5A 01 01 41 E1 E4 00 68 C0
|
||||
01A0 | 5D D7 12 FA DF 1E 1D 69 3C 61 2E 3F D8 6A 1D 3C
|
||||
01B0 | 33 38 13 1E AF 5E FB A3 C3 34 C6 A8 70 AE 17 28
|
||||
01C0 | E5 82 00 3B 68 02 11 13 34 0F 6C 00 06 98 4E 3D
|
||||
01D0 | 7A 3F 95 92 2D 2E F0 AF D2 C5 1A 8F F5 68 9A B3
|
||||
01E0 | FD 0E 0B A3 1E D8 A7 BE 60 2C 19 14 71 D7 64 A8
|
||||
01F0 | 75 DF 23 A1 BA B5 66 53 F4 BB 54 0C 3A 77 DB 42
|
||||
0200 | D1 47 96 B4 10 AE 8D 31 CF AB 2A 69 E3 F1 F6 DE
|
||||
0210 | 16 AB F3 92 C3 F4 B8 D9 90 9E 40 74 89 B2 F6 67
|
||||
0220 | F1 78 AE 60 C8 75 FC 7E 7C C8 FD 3C 7F 10 F4 1C
|
||||
0230 | A1 CC 3F F7 64 3C 55 A5 3C 35 C7 88 BF E9 B2 B7
|
||||
0240 | 3E AA 0F 98 82 0D CB 4F A6 1E C5 34 F7 2A B2 FC
|
||||
0250 | 5E EB AF D7 51 CC 68 38 2E 63 16 A8 A7 BE 07 0D
|
||||
0260 | A3 75 8B 4E 34 A2 F0 78 0C 72 3D 57 7F CF 2F 13
|
||||
0270 | 86 28 5C F1 94 2E 27 BF 38 72 5E D0 26 4D 77 64
|
||||
0280 | C9 FD 8C 8C 9E 03 57 36 34 DB 42 00</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,7 +464,7 @@ random_padding_bytes = 14BF6A70E3F550467FAE1BE28E80F43545AEEFD410661367EF0D1FE2C
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>017C64FFB114AC65</code></td>
|
||||
<td><code>01E0A702AE0AAD65</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>
|
||||
|
@ -482,19 +482,19 @@ random_padding_bytes = 14BF6A70E3F550467FAE1BE28E80F43545AEEFD410661367EF0D1FE2C
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>E978DBB0743FE99023908D3549A9D03E</code></td>
|
||||
<td><code>26A5DCAE804CA62C78287933312D889F</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>437A5281566B8DD1B4C2391A2803400C</code></td>
|
||||
<td><code>250F4458E1C938444C1611BE29BE8F92</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_answer</td>
|
||||
<td>56, 596</td>
|
||||
<td><code>FE500200D977C0F79234D14BA43AC0C7</code> <code>A942950FCC7066E8A84F8BF4BFEB2D77</code> <code>A31CEEBCB56AE078A8D9D4F09D4C17D7</code> <code>0C0C569F08E4ECB3FD904E08422D0831</code> <code>DF12F1A7875F233EBE0BDFDD73148B9A</code> <code>D180A3062C6A8BBF3B5B966FCF0C751A</code> <code>A057884B3DD17587E76970C379F48A0D</code> <code>FDBF9A75A4461FE8C5EE3B00296019E9</code> <code>B39F24A13F1042E06F35695FFE17878D</code> <code>BE9673E231E368D9CF8773324DDE2F62</code> <code>C677DAC2CFECF40E40BD414BBBBF7779</code> <code>A8630AC9B4058828AF608DA63E91E59E</code> <code>CAC6AE234C69B0EE8B57F0C9D69ADA34</code> <code>10088685079A7FA6F709EB8E9F821D24</code> <code>1FEA13C5DA6D0FF56D6F900A40AA848B</code> <code>F5CC44CB098A857B6B597DC523CA544D</code> <code>74DE632DC2C987A659012473F33D5947</code> <code>835447BEB2BBD74CF19C159F34B68420</code> <code>8178A6C9FD6F9A54CFF28EC724A9FF2E</code> <code>19C37909CEE74C3FF354044A303B70EC</code> <code>691FA0A3BDF5A3FAA226D90098757B3D</code> <code>E0AF9A4C274797854A5B35C9F58E6837</code> <code>A0E9A15EB3786BACE871B8C6ABC0693B</code> <code>41405D9BC207D8DE04D3F42CE5684819</code> <code>CD0C48C99FC577762586F725162A21A0</code> <code>957EA4FD15C55EA64DCE9115337A9C5B</code> <code>18D816CC3A9933A48361D05AF14F998E</code> <code>28189D14BA607555962695D50A24D7A7</code> <code>D2FED47E39E2C57BF11A678CE4F6957F</code> <code>90A5ACC65E1277CFA2DE4E5F63AE9B30</code> <code>9F04ECCD93E1AE0774BDED7B64514518</code> <code>15038C5A93563217C73D5F692593EBFE</code> <code>28FC3CD75AB73F14C68C57F241BAFDB9</code> <code>B148783047B31C782385C78D2DD96E45</code> <code>79DF46E3D049D50F18C3D71E922D07DC</code> <code>E9BA407BC3D3BF76A188E9413982CDEA</code> <code>9878AA52611016117DF98BF94B678555</code><br> <code>CA95CAAD</code></td>
|
||||
<td><code>FE500200D50B2E6288D4C0A747EB1FEE</code> <code>F0EDAD7A55638719219493EE77F02935</code> <code>9ED18E9B0E070EEB435D3A770F92B151</code> <code>6B3ED49766CF13737DC365145172FA6C</code> <code>440C784FED39C7C1BD995DC70C5A1D0C</code> <code>7D635871DDD8A4DC68D85E6ADE50F802</code> <code>BBD4B1D5D2A04488269392A1BEBC05B4</code> <code>8656BE64697A09643C2693289DD89D39</code> <code>B0BF977B457071EA0243C1D8C15F30A1</code> <code>1103DDE3ED0DDCF6EC0E76568AC83BC6</code> <code>7B429BE8FDF871C76D02C55A08B1BB96</code> <code>D85F4DB89925895B810165A518848405</code> <code>625812A18858257A679EFA4098F26086</code> <code>9646A081E5580E6C95AA29CD394FD15F</code> <code>CB0A83614F8378B9127D76FC44E129C2</code> <code>740FC40969E34BF354C74E434F9A6E2C</code> <code>4C8C97803A57E3B2441A9170F8FF8596</code> <code>541821A52D1096E8D18CA64354B84226</code> <code>C6A29730C2F7D779F71920269E7EDC1C</code> <code>A7EB96AB281A5285ED78A9BE7720923E</code> <code>3A0319C2F9E9838E4E8D62FB676CAC6F</code> <code>7D6AD7C6B3F1E394D5B5FC5DFD37FD5A</code> <code>010141E1E40068C05DD712FADF1E1D69</code> <code>3C612E3FD86A1D3C3338131EAF5EFBA3</code> <code>C334C6A870AE1728E582003B68021113</code> <code>340F6C0006984E3D7A3F95922D2EF0AF</code> <code>D2C51A8FF5689AB3FD0E0BA31ED8A7BE</code> <code>602C191471D764A875DF23A1BAB56653</code> <code>F4BB540C3A77DB42D14796B410AE8D31</code> <code>CFAB2A69E3F1F6DE16ABF392C3F4B8D9</code> <code>909E407489B2F667F178AE60C875FC7E</code> <code>7CC8FD3C7F10F41CA1CC3FF7643C55A5</code> <code>3C35C788BFE9B2B73EAA0F98820DCB4F</code> <code>A61EC534F72AB2FC5EEBAFD751CC6838</code> <code>2E6316A8A7BE070DA3758B4E34A2F078</code> <code>0C723D577FCF2F1386285CF1942E27BF</code> <code>38725ED0264D7764C9FD8C8C9E035736</code><br> <code>34DB4200</code></td>
|
||||
<td>See below</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -502,20 +502,20 @@ random_padding_bytes = 14BF6A70E3F550467FAE1BE28E80F43545AEEFD410661367EF0D1FE2C
|
|||
<!-- 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 = D977C0F79234D14BA43AC0C7A942950FCC7066E8A84F8BF4BFEB2D77A31CEEBCB56AE078A8D9D4F09D4C17D70C0C569F08E4ECB3FD904E08422D0831DF12F1A7875F233EBE0BDFDD73148B9AD180A3062C6A8BBF3B5B966FCF0C751AA057884B3DD17587E76970C379F48A0DFDBF9A75A4461FE8C5EE3B00296019E9B39F24A13F1042E06F35695FFE17878DBE9673E231E368D9CF8773324DDE2F62C677DAC2CFECF40E40BD414BBBBF7779A8630AC9B4058828AF608DA63E91E59ECAC6AE234C69B0EE8B57F0C9D69ADA3410088685079A7FA6F709EB8E9F821D241FEA13C5DA6D0FF56D6F900A40AA848BF5CC44CB098A857B6B597DC523CA544D74DE632DC2C987A659012473F33D5947835447BEB2BBD74CF19C159F34B684208178A6C9FD6F9A54CFF28EC724A9FF2E19C37909CEE74C3FF354044A303B70EC691FA0A3BDF5A3FAA226D90098757B3DE0AF9A4C274797854A5B35C9F58E6837A0E9A15EB3786BACE871B8C6ABC0693B41405D9BC207D8DE04D3F42CE5684819CD0C48C99FC577762586F725162A21A0957EA4FD15C55EA64DCE9115337A9C5B18D816CC3A9933A48361D05AF14F998E28189D14BA607555962695D50A24D7A7D2FED47E39E2C57BF11A678CE4F6957F90A5ACC65E1277CFA2DE4E5F63AE9B309F04ECCD93E1AE0774BDED7B6451451815038C5A93563217C73D5F692593EBFE28FC3CD75AB73F14C68C57F241BAFDB9B148783047B31C782385C78D2DD96E4579DF46E3D049D50F18C3D71E922D07DCE9BA407BC3D3BF76A188E9413982CDEA9878AA52611016117DF98BF94B678555CA95CAAD
|
||||
tmp_aes_key = 9D464C45BFDBF0975744920C88FBCD9F83D23DF794CB0C0CCCEF73FA533221EC
|
||||
tmp_aes_iv = 003930D9E4EE401EA2A0EDC81E549AA70E9379EE97C2AEE9B901A95C73D7F0C7</code></pre>
|
||||
<pre><code>encrypted_answer = D50B2E6288D4C0A747EB1FEEF0EDAD7A55638719219493EE77F029359ED18E9B0E070EEB435D3A770F92B1516B3ED49766CF13737DC365145172FA6C440C784FED39C7C1BD995DC70C5A1D0C7D635871DDD8A4DC68D85E6ADE50F802BBD4B1D5D2A04488269392A1BEBC05B48656BE64697A09643C2693289DD89D39B0BF977B457071EA0243C1D8C15F30A11103DDE3ED0DDCF6EC0E76568AC83BC67B429BE8FDF871C76D02C55A08B1BB96D85F4DB89925895B810165A518848405625812A18858257A679EFA4098F260869646A081E5580E6C95AA29CD394FD15FCB0A83614F8378B9127D76FC44E129C2740FC40969E34BF354C74E434F9A6E2C4C8C97803A57E3B2441A9170F8FF8596541821A52D1096E8D18CA64354B84226C6A29730C2F7D779F71920269E7EDC1CA7EB96AB281A5285ED78A9BE7720923E3A0319C2F9E9838E4E8D62FB676CAC6F7D6AD7C6B3F1E394D5B5FC5DFD37FD5A010141E1E40068C05DD712FADF1E1D693C612E3FD86A1D3C3338131EAF5EFBA3C334C6A870AE1728E582003B68021113340F6C0006984E3D7A3F95922D2EF0AFD2C51A8FF5689AB3FD0E0BA31ED8A7BE602C191471D764A875DF23A1BAB56653F4BB540C3A77DB42D14796B410AE8D31CFAB2A69E3F1F6DE16ABF392C3F4B8D9909E407489B2F667F178AE60C875FC7E7CC8FD3C7F10F41CA1CC3FF7643C55A53C35C788BFE9B2B73EAA0F98820DCB4FA61EC534F72AB2FC5EEBAFD751CC68382E6316A8A7BE070DA3758B4E34A2F0780C723D577FCF2F1386285CF1942E27BF38725ED0264D7764C9FD8C8C9E03573634DB4200
|
||||
tmp_aes_key = E839EDB6392A3EF9D14C40772F4400002D99D5EDFC8A0501895F73B42E1F71D1
|
||||
tmp_aes_iv = 7B1C4DE37730744394BE017EC3CFF64B2B19C9CCC8B7FFD181FE7E610FE1FF61</code></pre>
|
||||
<!-- end server_DH_inner_data_input -->
|
||||
<p>Yielding:</p>
|
||||
<!-- start server_DH_inner_data_output -->
|
||||
<pre><code>answer_with_hash = 9FE17F63CD99657B72F874E8B9D51DB3CB70E5CFBA0D89B5E978DBB0743FE99023908D3549A9D03E437A5281566B8DD1B4C2391A2803400C03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010052A783B9A22EC1DC4969B37491A7A52FAD830D2F81686502E224E589F92EFFCA4C03D9F0C542D30E89DC227B512637FEDA0035E8C68FC044835F3BB0A3E48DF78A640615158528537E190482C475319332C43AC35368AE9857CC80C04B795536BDA9CF3C506391265DF2094CCAD5E2EB5F0BAAC34E3FBB70F181A9203ADC595BE225CF32999F67E3C190B684B72387972337DA5517A4E7746AE569F7995B5DA276AD97284BE85C15157CDAD9BE287167812ECDEF9903C2A3D2C2693ED2BBF9190F4E65D56BC8F1AE75F6A7986AC9A214CBF9E7599D099C8B60DAA9DC4425A9CA016BDF8B7A9582540F5F66BBDC5FFF9F878982976290BE974DA5A7397E454C35B114AC651D04E47BD0474E2C
|
||||
answer = BA0D89B5E978DBB0743FE99023908D3549A9D03E437A5281566B8DD1B4C2391A2803400C03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010052A783B9A22EC1DC4969B37491A7A52FAD830D2F81686502E224E589F92EFFCA4C03D9F0C542D30E89DC227B512637FEDA0035E8C68FC044835F3BB0A3E48DF78A640615158528537E190482C475319332C43AC35368AE9857CC80C04B795536BDA9CF3C506391265DF2094CCAD5E2EB5F0BAAC34E3FBB70F181A9203ADC595BE225CF32999F67E3C190B684B72387972337DA5517A4E7746AE569F7995B5DA276AD97284BE85C15157CDAD9BE287167812ECDEF9903C2A3D2C2693ED2BBF9190F4E65D56BC8F1AE75F6A7986AC9A214CBF9E7599D099C8B60DAA9DC4425A9CA016BDF8B7A9582540F5F66BBDC5FFF9F878982976290BE974DA5A7397E454C35B114AC651D04E47BD0474E2C</code></pre>
|
||||
<pre><code>answer_with_hash = E09C2249690396FF856F63ADDA5B673D2C7D5BBCBA0D89B526A5DCAE804CA62C78287933312D889F250F4458E1C938444C1611BE29BE8F9203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001001C6C41954EBE724CC28347F9BED5246610E54918244D348EE0EA1BBEAE0BB447B7E1156638E0C78B6E0C78A11680869001C8A7019230A8E247376A94FE28535BE98F0C032AAF0F0C390A4DFE708FAE8FC2FB64486C255DE436A753ADFD78635344DCE58568F766113CAB6CDE29D11C9092D02CA6A18E487B9FEA9333382D3511CC6D9B068A440EC090B40FB68A1C376EC8C0F768A756A681719D43116A42AD37B29B2DFE329D94F5CC643CADC3F6F2BB6F8C4D084C6A0BBCA54BA9CBAE4E1E0D309201C65FEB3E78E98DB2EB6D248DE643B4F30F933DA2FCC3B799B1558A87C07A4BC301F127A1DCE2E7D970FF033E8C1D46E7DF8F29C54310DDF053288A1933AE0AAD65AAEF80CF88418AF8
|
||||
answer = BA0D89B526A5DCAE804CA62C78287933312D889F250F4458E1C938444C1611BE29BE8F9203000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001001C6C41954EBE724CC28347F9BED5246610E54918244D348EE0EA1BBEAE0BB447B7E1156638E0C78B6E0C78A11680869001C8A7019230A8E247376A94FE28535BE98F0C032AAF0F0C390A4DFE708FAE8FC2FB64486C255DE436A753ADFD78635344DCE58568F766113CAB6CDE29D11C9092D02CA6A18E487B9FEA9333382D3511CC6D9B068A440EC090B40FB68A1C376EC8C0F768A756A681719D43116A42AD37B29B2DFE329D94F5CC643CADC3F6F2BB6F8C4D084C6A0BBCA54BA9CBAE4E1E0D309201C65FEB3E78E98DB2EB6D248DE643B4F30F933DA2FCC3B799B1558A87C07A4BC301F127A1DCE2E7D970FF033E8C1D46E7DF8F29C54310DDF053288A1933AE0AAD65AAEF80CF88418AF8</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 E9 78 DB B0 74 3F E9 90 23 90 8D 35
|
||||
0010 | 49 A9 D0 3E 43 7A 52 81 56 6B 8D D1 B4 C2 39 1A
|
||||
0020 | 28 03 40 0C 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
||||
<pre><code>0000 | BA 0D 89 B5 26 A5 DC AE 80 4C A6 2C 78 28 79 33
|
||||
0010 | 31 2D 88 9F 25 0F 44 58 E1 C9 38 44 4C 16 11 BE
|
||||
0020 | 29 BE 8F 92 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 = BA0D89B5E978DBB0743FE99023908D3549A9D03E437A5281566B8DD1B4C2391A2803400
|
|||
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 | 52 A7 83 B9 A2 2E C1 DC 49 69 B3 74 91 A7 A5 2F
|
||||
0140 | AD 83 0D 2F 81 68 65 02 E2 24 E5 89 F9 2E FF CA
|
||||
0150 | 4C 03 D9 F0 C5 42 D3 0E 89 DC 22 7B 51 26 37 FE
|
||||
0160 | DA 00 35 E8 C6 8F C0 44 83 5F 3B B0 A3 E4 8D F7
|
||||
0170 | 8A 64 06 15 15 85 28 53 7E 19 04 82 C4 75 31 93
|
||||
0180 | 32 C4 3A C3 53 68 AE 98 57 CC 80 C0 4B 79 55 36
|
||||
0190 | BD A9 CF 3C 50 63 91 26 5D F2 09 4C CA D5 E2 EB
|
||||
01A0 | 5F 0B AA C3 4E 3F BB 70 F1 81 A9 20 3A DC 59 5B
|
||||
01B0 | E2 25 CF 32 99 9F 67 E3 C1 90 B6 84 B7 23 87 97
|
||||
01C0 | 23 37 DA 55 17 A4 E7 74 6A E5 69 F7 99 5B 5D A2
|
||||
01D0 | 76 AD 97 28 4B E8 5C 15 15 7C DA D9 BE 28 71 67
|
||||
01E0 | 81 2E CD EF 99 03 C2 A3 D2 C2 69 3E D2 BB F9 19
|
||||
01F0 | 0F 4E 65 D5 6B C8 F1 AE 75 F6 A7 98 6A C9 A2 14
|
||||
0200 | CB F9 E7 59 9D 09 9C 8B 60 DA A9 DC 44 25 A9 CA
|
||||
0210 | 01 6B DF 8B 7A 95 82 54 0F 5F 66 BB DC 5F FF 9F
|
||||
0220 | 87 89 82 97 62 90 BE 97 4D A5 A7 39 7E 45 4C 35
|
||||
0230 | B1 14 AC 65</code></pre>
|
||||
0130 | 1C 6C 41 95 4E BE 72 4C C2 83 47 F9 BE D5 24 66
|
||||
0140 | 10 E5 49 18 24 4D 34 8E E0 EA 1B BE AE 0B B4 47
|
||||
0150 | B7 E1 15 66 38 E0 C7 8B 6E 0C 78 A1 16 80 86 90
|
||||
0160 | 01 C8 A7 01 92 30 A8 E2 47 37 6A 94 FE 28 53 5B
|
||||
0170 | E9 8F 0C 03 2A AF 0F 0C 39 0A 4D FE 70 8F AE 8F
|
||||
0180 | C2 FB 64 48 6C 25 5D E4 36 A7 53 AD FD 78 63 53
|
||||
0190 | 44 DC E5 85 68 F7 66 11 3C AB 6C DE 29 D1 1C 90
|
||||
01A0 | 92 D0 2C A6 A1 8E 48 7B 9F EA 93 33 38 2D 35 11
|
||||
01B0 | CC 6D 9B 06 8A 44 0E C0 90 B4 0F B6 8A 1C 37 6E
|
||||
01C0 | C8 C0 F7 68 A7 56 A6 81 71 9D 43 11 6A 42 AD 37
|
||||
01D0 | B2 9B 2D FE 32 9D 94 F5 CC 64 3C AD C3 F6 F2 BB
|
||||
01E0 | 6F 8C 4D 08 4C 6A 0B BC A5 4B A9 CB AE 4E 1E 0D
|
||||
01F0 | 30 92 01 C6 5F EB 3E 78 E9 8D B2 EB 6D 24 8D E6
|
||||
0200 | 43 B4 F3 0F 93 3D A2 FC C3 B7 99 B1 55 8A 87 C0
|
||||
0210 | 7A 4B C3 01 F1 27 A1 DC E2 E7 D9 70 FF 03 3E 8C
|
||||
0220 | 1D 46 E7 DF 8F 29 C5 43 10 DD F0 53 28 8A 19 33
|
||||
0230 | AE 0A AD 65</code></pre>
|
||||
<p>Payload (de)serialization:</p>
|
||||
<pre><code>server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;</code></pre>
|
||||
<table class="table">
|
||||
|
@ -570,13 +570,13 @@ answer = BA0D89B5E978DBB0743FE99023908D3549A9D03E437A5281566B8DD1B4C2391A2803400
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>E978DBB0743FE99023908D3549A9D03E</code></td>
|
||||
<td><code>26A5DCAE804CA62C78287933312D889F</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>437A5281566B8DD1B4C2391A2803400C</code></td>
|
||||
<td><code>250F4458E1C938444C1611BE29BE8F92</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -594,13 +594,13 @@ answer = BA0D89B5E978DBB0743FE99023908D3549A9D03E437A5281566B8DD1B4C2391A2803400
|
|||
<tr>
|
||||
<td>g_a</td>
|
||||
<td>300, 260</td>
|
||||
<td><code>FE00010052A783B9A22EC1DC4969B374</code> <code>91A7A52FAD830D2F81686502E224E589</code> <code>F92EFFCA4C03D9F0C542D30E89DC227B</code> <code>512637FEDA0035E8C68FC044835F3BB0</code> <code>A3E48DF78A640615158528537E190482</code> <code>C475319332C43AC35368AE9857CC80C0</code> <code>4B795536BDA9CF3C506391265DF2094C</code> <code>CAD5E2EB5F0BAAC34E3FBB70F181A920</code> <code>3ADC595BE225CF32999F67E3C190B684</code> <code>B72387972337DA5517A4E7746AE569F7</code> <code>995B5DA276AD97284BE85C15157CDAD9</code> <code>BE287167812ECDEF9903C2A3D2C2693E</code> <code>D2BBF9190F4E65D56BC8F1AE75F6A798</code> <code>6AC9A214CBF9E7599D099C8B60DAA9DC</code> <code>4425A9CA016BDF8B7A9582540F5F66BB</code> <code>DC5FFF9F878982976290BE974DA5A739</code><br> <code>7E454C35</code></td>
|
||||
<td><code>FE0001001C6C41954EBE724CC28347F9</code> <code>BED5246610E54918244D348EE0EA1BBE</code> <code>AE0BB447B7E1156638E0C78B6E0C78A1</code> <code>1680869001C8A7019230A8E247376A94</code> <code>FE28535BE98F0C032AAF0F0C390A4DFE</code> <code>708FAE8FC2FB64486C255DE436A753AD</code> <code>FD78635344DCE58568F766113CAB6CDE</code> <code>29D11C9092D02CA6A18E487B9FEA9333</code> <code>382D3511CC6D9B068A440EC090B40FB6</code> <code>8A1C376EC8C0F768A756A681719D4311</code> <code>6A42AD37B29B2DFE329D94F5CC643CAD</code> <code>C3F6F2BB6F8C4D084C6A0BBCA54BA9CB</code> <code>AE4E1E0D309201C65FEB3E78E98DB2EB</code> <code>6D248DE643B4F30F933DA2FCC3B799B1</code> <code>558A87C07A4BC301F127A1DCE2E7D970</code> <code>FF033E8C1D46E7DF8F29C54310DDF053</code><br> <code>288A1933</code></td>
|
||||
<td><code>g_a</code> diffie-hellman parameter</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_time</td>
|
||||
<td>560, 4</td>
|
||||
<td><code>B114AC65</code> (1705776305 in decimal)</td>
|
||||
<td><code>AE0AAD65</code> (1705839278 in decimal)</td>
|
||||
<td>Server time</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -609,34 +609,34 @@ answer = BA0D89B5E978DBB0743FE99023908D3549A9D03E437A5281566B8DD1B4C2391A2803400
|
|||
<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 = F5167391C60A0EBDA2071C37A5E084D06D9C9228E862ECF0013E0BE74D9D1B2358415A696DA68FAAD9A7CDFDE5898343729BEFDBF4B15A62B477EBEED313012BD021F140032F30EC34AEDDB670464597EACFB25E0FB2D3E7ABFF2EE60264DA115731A81549E90DDB3D3BD6DF365F9D026FF5DE53075047CD3B0AF9B8B97ADB1E9608C5DB1EBD9BC4BEB54A9B5F263F9604A6B445BD611E0E3A02B0161C7345489DE26658E51D2B38B726AAC82084782CCC2E81CD1333720201048B483D7F2763CA43EA25BBFA3FCFB32DCE197F3F89585B4D2E3FBBC130E22D8A76B5F06C7DABA35BD8D511A7078D41E64356CA0C9353A9397E1FD2BBF784C7BAB9E492096012</code></pre>
|
||||
<pre><code>b = E246FCCD0A92623DDC6C5447A8CFA142E20B185CBD6F3DE505ED6DD0B28AE6F5C5634B49B5FB10215EB649AF4B66872A6822E4098FB021F6B01F52C76113374EA96F38E81A99E802887565C1FC332CFCB34DE524D51CFCB931A3399AADEA2B911020459D2BBA784CCA5513243A9654F452E7837D658391CBD7BEA81EBC672B9C400F97AF40A0F1A2695873C708B02113ACC94DB3DED92E0638587D422F40F47F3631114930FDC91641B61BE23641F1D77D789629B0C35D8B898D197BCAF9EEEBA6B56447EE5AB8556536F62F70CC7232A3C97A18A01154AC17C4F4A5B29EF44666812CAFD079F4C6D5D12C149FA5F932AC3F12E399C9660A4B9D67A3B6A49DC3</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 = C2246172FFB04B371A24EE430BD735394280ED1B34AB0E59F865498B2C7FC4D795E3E71A0D2B80D8F9FF0FCDA262E52AFE0C5FF3B1B09911091E8A8D885D8C017B622D2560BC4487FAE42E04E1971D16C4BF6B88E2AC632385719A31236B7F2B417022E0865A046003D5B320DEB3B2CA845CEDB0EFB5BDCAF0F5F2F2B17249FD42CEE616EC64EC02C6B10C33BAFEE67FD13D4283EFE2E399B3ED006B4184295EA69B991083F083617D5875AE7BE5027281C1FA33E6D408FE500EE45DFC11913C54E4B5F3E247A998917F4BDE2CDFE952B7D6C820B8682A1EC974B44147E3A2D1CC9938DE9B3F2061C80FF0B67A5446F90F11BFFE48652653E0EE4DE1FEC5268C</code></pre>
|
||||
<pre><code>g_b = 02EBAADDB9F2135D13479ED6D44909046168FA9B5807ECD122B1CC618559EF3A5807E5EE6E397C1241DAE0D88361BEE706E2E4C1CDB9C7BF1E73456CC32C33E966BF822468DD5FBB50C9CF52C042B922D2557C87304FF590C91A09356E964D644A4795F60141C6EF6FA92F9EEC07A6CB1ACC73233CF3B8E17792EAB07742D7043AA32F9A464EA8FC754F2AFA53A3FD53D1585E744371BD0BD543F9453781D80FC4132CBD433FE5BB1A5DAE453831C20385852F0040A306EBD1106BD5ECC0770A38434B2DAAA3ED16759426E7816219833D67ABA66114E15FA7DB7928B160050236FCE1D55195CAFE1CC1C41DCDD239C6F343D0301CD2D06D0987ED9F4FAA69DD</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 E9 78 DB B0 74 3F E9 90 23 90 8D 35
|
||||
0010 | 49 A9 D0 3E 43 7A 52 81 56 6B 8D D1 B4 C2 39 1A
|
||||
0020 | 28 03 40 0C 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | C2 24 61 72 FF B0 4B 37 1A 24 EE 43 0B D7 35 39
|
||||
0040 | 42 80 ED 1B 34 AB 0E 59 F8 65 49 8B 2C 7F C4 D7
|
||||
0050 | 95 E3 E7 1A 0D 2B 80 D8 F9 FF 0F CD A2 62 E5 2A
|
||||
0060 | FE 0C 5F F3 B1 B0 99 11 09 1E 8A 8D 88 5D 8C 01
|
||||
0070 | 7B 62 2D 25 60 BC 44 87 FA E4 2E 04 E1 97 1D 16
|
||||
0080 | C4 BF 6B 88 E2 AC 63 23 85 71 9A 31 23 6B 7F 2B
|
||||
0090 | 41 70 22 E0 86 5A 04 60 03 D5 B3 20 DE B3 B2 CA
|
||||
00A0 | 84 5C ED B0 EF B5 BD CA F0 F5 F2 F2 B1 72 49 FD
|
||||
00B0 | 42 CE E6 16 EC 64 EC 02 C6 B1 0C 33 BA FE E6 7F
|
||||
00C0 | D1 3D 42 83 EF E2 E3 99 B3 ED 00 6B 41 84 29 5E
|
||||
00D0 | A6 9B 99 10 83 F0 83 61 7D 58 75 AE 7B E5 02 72
|
||||
00E0 | 81 C1 FA 33 E6 D4 08 FE 50 0E E4 5D FC 11 91 3C
|
||||
00F0 | 54 E4 B5 F3 E2 47 A9 98 91 7F 4B DE 2C DF E9 52
|
||||
0100 | B7 D6 C8 20 B8 68 2A 1E C9 74 B4 41 47 E3 A2 D1
|
||||
0110 | CC 99 38 DE 9B 3F 20 61 C8 0F F0 B6 7A 54 46 F9
|
||||
0120 | 0F 11 BF FE 48 65 26 53 E0 EE 4D E1 FE C5 26 8C</code></pre>
|
||||
<pre><code>0000 | 54 B6 43 66 26 A5 DC AE 80 4C A6 2C 78 28 79 33
|
||||
0010 | 31 2D 88 9F 25 0F 44 58 E1 C9 38 44 4C 16 11 BE
|
||||
0020 | 29 BE 8F 92 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | 02 EB AA DD B9 F2 13 5D 13 47 9E D6 D4 49 09 04
|
||||
0040 | 61 68 FA 9B 58 07 EC D1 22 B1 CC 61 85 59 EF 3A
|
||||
0050 | 58 07 E5 EE 6E 39 7C 12 41 DA E0 D8 83 61 BE E7
|
||||
0060 | 06 E2 E4 C1 CD B9 C7 BF 1E 73 45 6C C3 2C 33 E9
|
||||
0070 | 66 BF 82 24 68 DD 5F BB 50 C9 CF 52 C0 42 B9 22
|
||||
0080 | D2 55 7C 87 30 4F F5 90 C9 1A 09 35 6E 96 4D 64
|
||||
0090 | 4A 47 95 F6 01 41 C6 EF 6F A9 2F 9E EC 07 A6 CB
|
||||
00A0 | 1A CC 73 23 3C F3 B8 E1 77 92 EA B0 77 42 D7 04
|
||||
00B0 | 3A A3 2F 9A 46 4E A8 FC 75 4F 2A FA 53 A3 FD 53
|
||||
00C0 | D1 58 5E 74 43 71 BD 0B D5 43 F9 45 37 81 D8 0F
|
||||
00D0 | C4 13 2C BD 43 3F E5 BB 1A 5D AE 45 38 31 C2 03
|
||||
00E0 | 85 85 2F 00 40 A3 06 EB D1 10 6B D5 EC C0 77 0A
|
||||
00F0 | 38 43 4B 2D AA A3 ED 16 75 94 26 E7 81 62 19 83
|
||||
0100 | 3D 67 AB A6 61 14 E1 5F A7 DB 79 28 B1 60 05 02
|
||||
0110 | 36 FC E1 D5 51 95 CA FE 1C C1 C4 1D CD D2 39 C6
|
||||
0120 | F3 43 D0 30 1C D2 D0 6D 09 87 ED 9F 4F AA 69 DD</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 = BA0D89B5E978DBB0743FE99023908D3549A9D03E437A5281566B8DD1B4C2391A2803400
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>E978DBB0743FE99023908D3549A9D03E</code></td>
|
||||
<td><code>26A5DCAE804CA62C78287933312D889F</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>437A5281566B8DD1B4C2391A2803400C</code></td>
|
||||
<td><code>250F4458E1C938444C1611BE29BE8F92</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>g_b</td>
|
||||
<td>36, 260</td>
|
||||
<td><code>FE000100C2246172FFB04B371A24EE43</code> <code>0BD735394280ED1B34AB0E59F865498B</code> <code>2C7FC4D795E3E71A0D2B80D8F9FF0FCD</code> <code>A262E52AFE0C5FF3B1B09911091E8A8D</code> <code>885D8C017B622D2560BC4487FAE42E04</code> <code>E1971D16C4BF6B88E2AC632385719A31</code> <code>236B7F2B417022E0865A046003D5B320</code> <code>DEB3B2CA845CEDB0EFB5BDCAF0F5F2F2</code> <code>B17249FD42CEE616EC64EC02C6B10C33</code> <code>BAFEE67FD13D4283EFE2E399B3ED006B</code> <code>4184295EA69B991083F083617D5875AE</code> <code>7BE5027281C1FA33E6D408FE500EE45D</code> <code>FC11913C54E4B5F3E247A998917F4BDE</code> <code>2CDFE952B7D6C820B8682A1EC974B441</code> <code>47E3A2D1CC9938DE9B3F2061C80FF0B6</code> <code>7A5446F90F11BFFE48652653E0EE4DE1</code><br> <code>FEC5268C</code></td>
|
||||
<td><code>FE00010002EBAADDB9F2135D13479ED6</code> <code>D44909046168FA9B5807ECD122B1CC61</code> <code>8559EF3A5807E5EE6E397C1241DAE0D8</code> <code>8361BEE706E2E4C1CDB9C7BF1E73456C</code> <code>C32C33E966BF822468DD5FBB50C9CF52</code> <code>C042B922D2557C87304FF590C91A0935</code> <code>6E964D644A4795F60141C6EF6FA92F9E</code> <code>EC07A6CB1ACC73233CF3B8E17792EAB0</code> <code>7742D7043AA32F9A464EA8FC754F2AFA</code> <code>53A3FD53D1585E744371BD0BD543F945</code> <code>3781D80FC4132CBD433FE5BB1A5DAE45</code> <code>3831C20385852F0040A306EBD1106BD5</code> <code>ECC0770A38434B2DAAA3ED16759426E7</code> <code>816219833D67ABA66114E15FA7DB7928</code> <code>B160050236FCE1D55195CAFE1CC1C41D</code> <code>CDD239C6F343D0301CD2D06D0987ED9F</code><br> <code>4FAA69DD</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 = BA0D89B5E978DBB0743FE99023908D3549A9D03E437A5281566B8DD1B4C2391A2803400
|
|||
<!-- 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 = 54B64366E978DBB0743FE99023908D3549A9D03E437A5281566B8DD1B4C2391A2803400C0000000000000000FE000100C2246172FFB04B371A24EE430BD735394280ED1B34AB0E59F865498B2C7FC4D795E3E71A0D2B80D8F9FF0FCDA262E52AFE0C5FF3B1B09911091E8A8D885D8C017B622D2560BC4487FAE42E04E1971D16C4BF6B88E2AC632385719A31236B7F2B417022E0865A046003D5B320DEB3B2CA845CEDB0EFB5BDCAF0F5F2F2B17249FD42CEE616EC64EC02C6B10C33BAFEE67FD13D4283EFE2E399B3ED006B4184295EA69B991083F083617D5875AE7BE5027281C1FA33E6D408FE500EE45DFC11913C54E4B5F3E247A998917F4BDE2CDFE952B7D6C820B8682A1EC974B44147E3A2D1CC9938DE9B3F2061C80FF0B67A5446F90F11BFFE48652653E0EE4DE1FEC5268C
|
||||
padding = A239ABEDF75DB73AFA1FD7B5
|
||||
tmp_aes_key = 9D464C45BFDBF0975744920C88FBCD9F83D23DF794CB0C0CCCEF73FA533221EC
|
||||
tmp_aes_iv = 003930D9E4EE401EA2A0EDC81E549AA70E9379EE97C2AEE9B901A95C73D7F0C7</code></pre>
|
||||
<pre><code>data = 54B6436626A5DCAE804CA62C78287933312D889F250F4458E1C938444C1611BE29BE8F920000000000000000FE00010002EBAADDB9F2135D13479ED6D44909046168FA9B5807ECD122B1CC618559EF3A5807E5EE6E397C1241DAE0D88361BEE706E2E4C1CDB9C7BF1E73456CC32C33E966BF822468DD5FBB50C9CF52C042B922D2557C87304FF590C91A09356E964D644A4795F60141C6EF6FA92F9EEC07A6CB1ACC73233CF3B8E17792EAB07742D7043AA32F9A464EA8FC754F2AFA53A3FD53D1585E744371BD0BD543F9453781D80FC4132CBD433FE5BB1A5DAE453831C20385852F0040A306EBD1106BD5ECC0770A38434B2DAAA3ED16759426E7816219833D67ABA66114E15FA7DB7928B160050236FCE1D55195CAFE1CC1C41DCDD239C6F343D0301CD2D06D0987ED9F4FAA69DD
|
||||
padding = 378BFACF9FFD72F700314B1A
|
||||
tmp_aes_key = E839EDB6392A3EF9D14C40772F4400002D99D5EDFC8A0501895F73B42E1F71D1
|
||||
tmp_aes_iv = 7B1C4DE37730744394BE017EC3CFF64B2B19C9CCC8B7FFD181FE7E610FE1FF61</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 = 9508FE98AACA0EA3897250A9C454D0F0AB67F4FCA1CC99EC031F0AF84D974D8A75475F6420E58A86C2162A6BD3B06B6D5D61F2098858E0C3505FCF294C3E4CD9F251BE6533816F7CE7F22341E3D021F4BD4EF4551ABFA446A36D3906BC90F29D74DA0BBDA55C85A6DA2C7C4A75B9A883BD65C28981E496390473D2D33AEAB86E3C593BE41BD8BA311A521876B976F58115B41B27DE29EE80422080F4BC7CD673A965FE9C2BCB29B5F979650387F35550FD7E119FBF585576F15AA5354C0AA69A8D070382A93B0882F979E9265C5E6D63159C5578057856D5D71804E361A35DA8B3DD2A8E2E8692E7F8414D218DCD805D9A0C20B7BD77CF2052E0DF16C1BA9932B43B27A08D1FD1ECDD43A6B08297BA7CBD74E43434B85E67845246EF52AC0874612156FA30DF5EE6EA9F4AD3726E044B9E477FFE89D4682B6DCE3A63381FDB05B53C28EDD64EA8D376D3A458A02204FE</code></pre>
|
||||
<pre><code>encrypted_data = AF7700656CD795EEC889C3D4C5BFC96A03F1A74A3C6776DC6D09E65BC0F64ED1AF9ECEFBC24A92A54AE4E890FE51BD0DD8849CF0E1E06AF9B20F61D58D52CDBDADD3277068C7A0230C277430558A447186013E830A975FE32C349FC9FCBDF87AEDEDD191EEF1DE76F5440F2610D090D851DCB3E18AA40D4260A80089EBFCB5E14562F9B3A7EAEFC065C62099960DEB86661AC9E6E494EEA905A2F1CA45A3E15D50040F014824C6D322124BE23CFF49CB6E022540349223F09BE2BDA3CF0A27C2AA014182FE635944A896D9EDF95D28A5870FA0E0AEE64F21B6852400DF0B426087DD21A325B036A3AFA207470436625B9812AE1E1D42811D4F97DB3D2A55A1C51D5A2A1123038BBD18603870A04CDEFBC87D97F324AEC74A71CE8F40A132F92604C83BBB2E0D3A376FED272E90956F01C1D3082CD994DCB96D7A788D11F2E4D0BE7C33DA95C8D411614181AF83B77D71</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 C8 A0 09 00 B1 14 AC 65
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 E9 78 DB B0 74 3F E9 90
|
||||
0020 | 23 90 8D 35 49 A9 D0 3E 43 7A 52 81 56 6B 8D D1
|
||||
0030 | B4 C2 39 1A 28 03 40 0C FE 50 01 00 95 08 FE 98
|
||||
0040 | AA CA 0E A3 89 72 50 A9 C4 54 D0 F0 AB 67 F4 FC
|
||||
0050 | A1 CC 99 EC 03 1F 0A F8 4D 97 4D 8A 75 47 5F 64
|
||||
0060 | 20 E5 8A 86 C2 16 2A 6B D3 B0 6B 6D 5D 61 F2 09
|
||||
0070 | 88 58 E0 C3 50 5F CF 29 4C 3E 4C D9 F2 51 BE 65
|
||||
0080 | 33 81 6F 7C E7 F2 23 41 E3 D0 21 F4 BD 4E F4 55
|
||||
0090 | 1A BF A4 46 A3 6D 39 06 BC 90 F2 9D 74 DA 0B BD
|
||||
00A0 | A5 5C 85 A6 DA 2C 7C 4A 75 B9 A8 83 BD 65 C2 89
|
||||
00B0 | 81 E4 96 39 04 73 D2 D3 3A EA B8 6E 3C 59 3B E4
|
||||
00C0 | 1B D8 BA 31 1A 52 18 76 B9 76 F5 81 15 B4 1B 27
|
||||
00D0 | DE 29 EE 80 42 20 80 F4 BC 7C D6 73 A9 65 FE 9C
|
||||
00E0 | 2B CB 29 B5 F9 79 65 03 87 F3 55 50 FD 7E 11 9F
|
||||
00F0 | BF 58 55 76 F1 5A A5 35 4C 0A A6 9A 8D 07 03 82
|
||||
0100 | A9 3B 08 82 F9 79 E9 26 5C 5E 6D 63 15 9C 55 78
|
||||
0110 | 05 78 56 D5 D7 18 04 E3 61 A3 5D A8 B3 DD 2A 8E
|
||||
0120 | 2E 86 92 E7 F8 41 4D 21 8D CD 80 5D 9A 0C 20 B7
|
||||
0130 | BD 77 CF 20 52 E0 DF 16 C1 BA 99 32 B4 3B 27 A0
|
||||
0140 | 8D 1F D1 EC DD 43 A6 B0 82 97 BA 7C BD 74 E4 34
|
||||
0150 | 34 B8 5E 67 84 52 46 EF 52 AC 08 74 61 21 56 FA
|
||||
0160 | 30 DF 5E E6 EA 9F 4A D3 72 6E 04 4B 9E 47 7F FE
|
||||
0170 | 89 D4 68 2B 6D CE 3A 63 38 1F DB 05 B5 3C 28 ED
|
||||
0180 | D6 4E A8 D3 76 D3 A4 58 A0 22 04 FE</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 30 4F 07 00 AE 0A AD 65
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 26 A5 DC AE 80 4C A6 2C
|
||||
0020 | 78 28 79 33 31 2D 88 9F 25 0F 44 58 E1 C9 38 44
|
||||
0030 | 4C 16 11 BE 29 BE 8F 92 FE 50 01 00 AF 77 00 65
|
||||
0040 | 6C D7 95 EE C8 89 C3 D4 C5 BF C9 6A 03 F1 A7 4A
|
||||
0050 | 3C 67 76 DC 6D 09 E6 5B C0 F6 4E D1 AF 9E CE FB
|
||||
0060 | C2 4A 92 A5 4A E4 E8 90 FE 51 BD 0D D8 84 9C F0
|
||||
0070 | E1 E0 6A F9 B2 0F 61 D5 8D 52 CD BD AD D3 27 70
|
||||
0080 | 68 C7 A0 23 0C 27 74 30 55 8A 44 71 86 01 3E 83
|
||||
0090 | 0A 97 5F E3 2C 34 9F C9 FC BD F8 7A ED ED D1 91
|
||||
00A0 | EE F1 DE 76 F5 44 0F 26 10 D0 90 D8 51 DC B3 E1
|
||||
00B0 | 8A A4 0D 42 60 A8 00 89 EB FC B5 E1 45 62 F9 B3
|
||||
00C0 | A7 EA EF C0 65 C6 20 99 96 0D EB 86 66 1A C9 E6
|
||||
00D0 | E4 94 EE A9 05 A2 F1 CA 45 A3 E1 5D 50 04 0F 01
|
||||
00E0 | 48 24 C6 D3 22 12 4B E2 3C FF 49 CB 6E 02 25 40
|
||||
00F0 | 34 92 23 F0 9B E2 BD A3 CF 0A 27 C2 AA 01 41 82
|
||||
0100 | FE 63 59 44 A8 96 D9 ED F9 5D 28 A5 87 0F A0 E0
|
||||
0110 | AE E6 4F 21 B6 85 24 00 DF 0B 42 60 87 DD 21 A3
|
||||
0120 | 25 B0 36 A3 AF A2 07 47 04 36 62 5B 98 12 AE 1E
|
||||
0130 | 1D 42 81 1D 4F 97 DB 3D 2A 55 A1 C5 1D 5A 2A 11
|
||||
0140 | 23 03 8B BD 18 60 38 70 A0 4C DE FB C8 7D 97 F3
|
||||
0150 | 24 AE C7 4A 71 CE 8F 40 A1 32 F9 26 04 C8 3B BB
|
||||
0160 | 2E 0D 3A 37 6F ED 27 2E 90 95 6F 01 C1 D3 08 2C
|
||||
0170 | D9 94 DC B9 6D 7A 78 8D 11 F2 E4 D0 BE 7C 33 DA
|
||||
0180 | 95 C8 D4 11 61 41 81 AF 83 B7 7D 71</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>C8A00900B114AC65</code></td>
|
||||
<td><code>304F0700AE0AAD65</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>E978DBB0743FE99023908D3549A9D03E</code></td>
|
||||
<td><code>26A5DCAE804CA62C78287933312D889F</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>437A5281566B8DD1B4C2391A2803400C</code></td>
|
||||
<td><code>250F4458E1C938444C1611BE29BE8F92</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>56, 340</td>
|
||||
<td><code>FE5001009508FE98AACA0EA3897250A9</code> <code>C454D0F0AB67F4FCA1CC99EC031F0AF8</code> <code>4D974D8A75475F6420E58A86C2162A6B</code> <code>D3B06B6D5D61F2098858E0C3505FCF29</code> <code>4C3E4CD9F251BE6533816F7CE7F22341</code> <code>E3D021F4BD4EF4551ABFA446A36D3906</code> <code>BC90F29D74DA0BBDA55C85A6DA2C7C4A</code> <code>75B9A883BD65C28981E496390473D2D3</code> <code>3AEAB86E3C593BE41BD8BA311A521876</code> <code>B976F58115B41B27DE29EE80422080F4</code> <code>BC7CD673A965FE9C2BCB29B5F9796503</code> <code>87F35550FD7E119FBF585576F15AA535</code> <code>4C0AA69A8D070382A93B0882F979E926</code> <code>5C5E6D63159C5578057856D5D71804E3</code> <code>61A35DA8B3DD2A8E2E8692E7F8414D21</code> <code>8DCD805D9A0C20B7BD77CF2052E0DF16</code> <code>C1BA9932B43B27A08D1FD1ECDD43A6B0</code> <code>8297BA7CBD74E43434B85E67845246EF</code> <code>52AC0874612156FA30DF5EE6EA9F4AD3</code> <code>726E044B9E477FFE89D4682B6DCE3A63</code> <code>381FDB05B53C28EDD64EA8D376D3A458</code><br> <code>A02204FE</code></td>
|
||||
<td><code>FE500100AF7700656CD795EEC889C3D4</code> <code>C5BFC96A03F1A74A3C6776DC6D09E65B</code> <code>C0F64ED1AF9ECEFBC24A92A54AE4E890</code> <code>FE51BD0DD8849CF0E1E06AF9B20F61D5</code> <code>8D52CDBDADD3277068C7A0230C277430</code> <code>558A447186013E830A975FE32C349FC9</code> <code>FCBDF87AEDEDD191EEF1DE76F5440F26</code> <code>10D090D851DCB3E18AA40D4260A80089</code> <code>EBFCB5E14562F9B3A7EAEFC065C62099</code> <code>960DEB86661AC9E6E494EEA905A2F1CA</code> <code>45A3E15D50040F014824C6D322124BE2</code> <code>3CFF49CB6E022540349223F09BE2BDA3</code> <code>CF0A27C2AA014182FE635944A896D9ED</code> <code>F95D28A5870FA0E0AEE64F21B6852400</code> <code>DF0B426087DD21A325B036A3AFA20747</code> <code>0436625B9812AE1E1D42811D4F97DB3D</code> <code>2A55A1C51D5A2A1123038BBD18603870</code> <code>A04CDEFBC87D97F324AEC74A71CE8F40</code> <code>A132F92604C83BBB2E0D3A376FED272E</code> <code>90956F01C1D3082CD994DCB96D7A788D</code> <code>11F2E4D0BE7C33DA95C8D411614181AF</code><br> <code>83B77D71</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 = 27A95B5899719BB35E4AE0DB6B6BC6947FF46DD631E499BBDA6F961C56554D09EE1B78ED28FDBE916000CCB524074461D141DBACE5B09667FA7C2660C85C3B09798E7DFE33A081124771EE963880033760B4049EF2A49E0685D5A9476F03ED8212D898A8353477FCD8A5A8823850D70D0B114612843CA75DB8CC4686CC34E59D25B484B9C3F1381AACD5B3E26F122B8FF5D5D808AE98049F6D35F8CCEDE7D357F7D1976B25249B2DFF6D16F151A3CC274FFFFD23BA5146A2805CA9B78A731DC49DA1A345ABA1798FEFFB7DC6E5B6334B4E059DB14F2414E159460476B1E78D7C04F1681618B322DB56B7A0D2CDEFDA679B76C27C5AD033119C76BB119293B7B7</code></pre>
|
||||
<pre><code>auth_key = 44145C2AA2666DE3F10788597C82B1E2ADD29134C257D5A9C42262991C4725DC83761B4707D5AF57E0F9F23C667A29324EB92113A19263E5B77E3D37DF3C5DCC97748EBAE96F45094CCF0CF4A5A30B43DED6B9486AE451556D4A7E7406A70084DAE4CE5B34FFCDD49515B28EF89C89DC174E07097DDEA14B8AB2F58D39A5EDF81C1C13124889FC22FACAD30A1170C987E4509664C9EABC1B074A68713AE4D712F514A03D2CDE84ED801EE7550580708232413E4F7CD60CD858A9E4EF5B96F1520F5239ABF6BCCA4A11F8C9A9E155482D9AE5B49CC4568537C4FC347F3960CEDF7829CEC5A243AA10717A382DF8FE7F3A44D7DCAAAACBB96DC4D93B3BAAA69D55</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 70 C6 06 B3 14 AC 65
|
||||
0010 | 60 00 00 00 34 F7 CB 3B E9 78 DB B0 74 3F E9 90
|
||||
0020 | 23 90 8D 35 49 A9 D0 3E 43 7A 52 81 56 6B 8D D1
|
||||
0030 | B4 C2 39 1A 28 03 40 0C BA DF F3 86 0B A8 AF BA
|
||||
0040 | 2C 98 F3 A9 03 0D D1 6D</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 3C 0A FA AE 0A AD 65
|
||||
0010 | AC 00 00 00 34 F7 CB 3B 26 A5 DC AE 80 4C A6 2C
|
||||
0020 | 78 28 79 33 31 2D 88 9F 25 0F 44 58 E1 C9 38 44
|
||||
0030 | 4C 16 11 BE 29 BE 8F 92 85 FA 0C 4A C2 C7 BD DA
|
||||
0040 | FE D1 9A 2D 90 BE 64 F6</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>0170C606B314AC65</code></td>
|
||||
<td><code>013C0AFAAE0AAD65</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>60000000</code> (96 in decimal)</td>
|
||||
<td><code>AC000000</code> (172 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>E978DBB0743FE99023908D3549A9D03E</code></td>
|
||||
<td><code>26A5DCAE804CA62C78287933312D889F</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>437A5281566B8DD1B4C2391A2803400C</code></td>
|
||||
<td><code>250F4458E1C938444C1611BE29BE8F92</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce_hash1</td>
|
||||
<td>56, 16</td>
|
||||
<td><code>BADFF3860BA8AFBA2C98F3A9030DD16D</code></td>
|
||||
<td><code>85FA0C4AC2C7BDDAFED19A2D90BE64F6</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