mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-12-29 15:59:13 +01:00
Update content of files
This commit is contained in:
parent
944d5488b0
commit
8bd0435329
2 changed files with 208 additions and 208 deletions
|
@ -916,8 +916,8 @@
|
|||
<p>You can verify the integrity of the data received by comparing the received <em>hash</em> parameter with the hexadecimal representation of the <a href="https://en.wikipedia.org/wiki/Hash-based_message_authentication_code">HMAC-SHA-256</a> signature of the <strong>data-check-string</strong> with the secret key, which is the <a href="https://en.wikipedia.org/wiki/Hash-based_message_authentication_code">HMAC-SHA-256</a> signature of the <a href="/bots#creating-a-new-bot">bot's token</a> with the constant string <code>WebAppData</code> used as a key.</p>
|
||||
<p><strong>Data-check-string</strong> is a chain of all received fields, sorted alphabetically, in the format <code>key=<value></code> with a <a href="https://en.wikipedia.org/wiki/Newline">line feed</a> character ('\n', 0x0A) used as separator – e.g., <code>'auth_date=<auth_date>\nquery_id=<query_id>\nuser=<user>'</code>.</p>
|
||||
<p>The full check might look like:</p>
|
||||
<pre><code>data_check_string = ...
|
||||
<a href='/constructor/secret_key'>secret_key</a> = <a href='/type/HMAC_SHA256%28%3Cbot_token%26gt'>HMAC_SHA256(<bot_token></a>;, "WebAppData")
|
||||
<pre><code>data_check_string := ...
|
||||
secret_key := HMAC_SHA256(<bot_token>, "WebAppData")
|
||||
if (hex(HMAC_SHA256(data_check_string, secret_key)) == hash) {
|
||||
// data is from Telegram
|
||||
}</code></pre>
|
||||
|
|
|
@ -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 04 6E 08 00 91 60 1C 65
|
||||
0010 | 14 00 00 00 F1 8E 7E BE 76 55 34 97 7E 7D 6E EB
|
||||
0020 | BF 22 4D 1C 23 4A C2 88</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 C0 DA 04 00 7E 62 1C 65
|
||||
0010 | 14 00 00 00 F1 8E 7E BE 17 2F 85 E7 17 61 F3 BB
|
||||
0020 | 2C BD BE 71 2D 1E AF E5</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>046E080091601C65</code></td>
|
||||
<td><code>C0DA04007E621C65</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>765534977E7D6EEBBF224D1C234AC288</code></td>
|
||||
<td><code>172F85E71761F3BB2CBDBE712D1EAFE5</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 9C 53 57 91 60 1C 65
|
||||
0010 | 6C 00 00 00 63 24 16 05 76 55 34 97 7E 7D 6E EB
|
||||
0020 | BF 22 4D 1C 23 4A C2 88 59 3C 34 32 13 42 6C D2
|
||||
0030 | 20 8E 22 49 A7 E2 C5 FA 08 1B E9 B5 1A B4 FD 59
|
||||
0040 | EF 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 90 20 72 7E 62 1C 65
|
||||
0010 | 54 00 00 00 63 24 16 05 17 2F 85 E7 17 61 F3 BB
|
||||
0020 | 2C BD BE 71 2D 1E AF E5 88 17 DB E8 74 20 77 FA
|
||||
0030 | 5F 1C 0C 1C 6F F0 58 BD 08 15 17 74 9F 74 DE 35
|
||||
0040 | 09 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
|
||||
0050 | 35 5F C3 0B 21 6B E8 6C 02 2B B4 C3 85 FD 64 DE
|
||||
0060 | 85 1D 9D D0</code></pre>
|
||||
<p>Payload (de)serialization:</p>
|
||||
|
@ -132,13 +132,13 @@
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>019C535791601C65</code></td>
|
||||
<td><code>019020727E621C65</code></td>
|
||||
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>message_length</td>
|
||||
<td>16, 4</td>
|
||||
<td><code>6C000000</code> (108 in decimal)</td>
|
||||
<td><code>54000000</code> (84 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -150,19 +150,19 @@
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>765534977E7D6EEBBF224D1C234AC288</code></td>
|
||||
<td><code>172F85E71761F3BB2CBDBE712D1EAFE5</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>593C343213426CD2208E2249A7E2C5FA</code></td>
|
||||
<td><code>8817DBE8742077FA5F1C0C1C6FF058BD</code></td>
|
||||
<td>Server-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pq</td>
|
||||
<td>56, 12</td>
|
||||
<td><code>081BE9B51AB4FD59EF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2011337834907916783</td>
|
||||
<td><code>081517749F74DE3509000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1519811627470173449</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--q" id="3-client-decomposes-pq-into-prime-factors-such-that-p--q" name="3-client-decomposes-pq-into-prime-factors-such-that-p--q"><i class="anchor-icon"></i></a>3) Client decomposes pq into prime factors such that p < q.</h5>
|
||||
<!-- start pq -->
|
||||
<pre><code>pq = 2011337834907916783</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2011337834907916783 = 1164458353 * 1727273311</code></p>
|
||||
<pre><code>p = 1164458353
|
||||
q = 1727273311</code></pre>
|
||||
<pre><code>pq = 1519811627470173449</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1519811627470173449 = 1196775271 * 1269922319</code></p>
|
||||
<pre><code>p = 1196775271
|
||||
q = 1269922319</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 1B E9 B5 1A B4 FD 59 EF 00 00 00
|
||||
0010 | 04 45 68 39 71 00 00 00 04 66 F4 19 5F 00 00 00
|
||||
0020 | 76 55 34 97 7E 7D 6E EB BF 22 4D 1C 23 4A C2 88
|
||||
0030 | 59 3C 34 32 13 42 6C D2 20 8E 22 49 A7 E2 C5 FA
|
||||
0040 | 5F 16 2B 23 C5 73 DA E0 D5 DE 9C 09 96 15 16 E8
|
||||
0050 | 0D D9 A9 FA 99 16 6F 8A 65 2F F8 EB E1 AD 35 30
|
||||
<pre><code>0000 | 95 5F F5 A9 08 15 17 74 9F 74 DE 35 09 00 00 00
|
||||
0010 | 04 47 55 57 67 00 00 00 04 4B B1 7A 0F 00 00 00
|
||||
0020 | 17 2F 85 E7 17 61 F3 BB 2C BD BE 71 2D 1E AF E5
|
||||
0030 | 88 17 DB E8 74 20 77 FA 5F 1C 0C 1C 6F F0 58 BD
|
||||
0040 | 36 56 DB B3 F8 48 32 A4 08 55 5E 45 40 3D 6C CB
|
||||
0050 | E3 53 04 AD 6C 76 CC FA BB E7 E9 E8 98 35 C3 C1
|
||||
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 = 1727273311</code></pre>
|
|||
<tr>
|
||||
<td>pq</td>
|
||||
<td>4, 12</td>
|
||||
<td><code>081BE9B51AB4FD59EF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2011337834907916783</td>
|
||||
<td><code>081517749F74DE3509000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1519811627470173449</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>0445683971000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1164458353</td>
|
||||
<td><code>0447555767000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1196775271</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>0466F4195F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1727273311</td>
|
||||
<td><code>044BB17A0F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1269922319</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>765534977E7D6EEBBF224D1C234AC288</code></td>
|
||||
<td><code>172F85E71761F3BB2CBDBE712D1EAFE5</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>48, 16</td>
|
||||
<td><code>593C343213426CD2208E2249A7E2C5FA</code></td>
|
||||
<td><code>8817DBE8742077FA5F1C0C1C6FF058BD</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce</td>
|
||||
<td>64, 32</td>
|
||||
<td><code>5F162B23C573DAE0D5DE9C09961516E8</code> <code>0DD9A9FA99166F8A652FF8EBE1AD3530</code></td>
|
||||
<td><code>3656DBB3F84832A408555E45403D6CCB</code> <code>E35304AD6C76CCFABBE7E9E89835C3C1</code></td>
|
||||
<td>Client-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -291,39 +291,39 @@ q = 1727273311</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 = 955FF5A9081BE9B51AB4FD59EF00000004456839710000000466F4195F000000765534977E7D6EEBBF224D1C234AC288593C343213426CD2208E2249A7E2C5FA5F162B23C573DAE0D5DE9C09961516E80DD9A9FA99166F8A652FF8EBE1AD353002000000
|
||||
random_padding_bytes = E072931022DF619FAB9DF4CA248B60D849819621C492F8AADC3B464442E112D10E595AD3A2A619BB4C45EBF0A187D921EF744439CFAA1AC1CB0CA6F6D653FA532F6E99FA67268C48F20184907828D19F31BDC5AA4B585D591B8F56B2</code></pre>
|
||||
<pre><code>data = 955FF5A9081517749F74DE35090000000447555767000000044BB17A0F000000172F85E71761F3BB2CBDBE712D1EAFE58817DBE8742077FA5F1C0C1C6FF058BD3656DBB3F84832A408555E45403D6CCBE35304AD6C76CCFABBE7E9E89835C3C102000000
|
||||
random_padding_bytes = 8053F00D9FE8DDFF7E3B727D6C3FC737B3C161C7B610EDDBF518944EEF2E6528718990D3F4C1CEF03DA6279DE5CB391A82C1E7019E5F74C26726BAD616B74C5046C642427C828189F291CFAE5D27736C67F819053E285E7D6C233380</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 = 60CF219007695868E84EC1305C103320EFF892550ABC4F6CFC6B5B6597F946F6FB135EDAD741E7F783C729469D7A84B63AD2845076F087B0BED97C4A35C0C6619272BD8B5DF60376A4CCD3B906D791DBE768AFA84EED969F01A31DE75EA022A6492446C967180EA460DECF450155EF0B164B9F30A1CC9DC671393D0A92EE7CC71AD26B1A7FA411F2836D0FBDF8AEA3C6ADB8BEBD996A4B6B30F4E7019A3E636AC1B4480ABFAF43482860064FAF520B57A35B2FAEBB39E526B483824D709D0B6F3B1540DF13BD33251622F5952615FA4A616906CD441C94DB2A489A67749F560446C061D1E7F200A4290DCBB6845DBA2EB40E2ED4D9420C5304E25EE65F663BA5</code></pre>
|
||||
<pre><code>encrypted_data = 9B64DCF6A1329BA6F9606B85898519BEEAC516D67B2CE01818B59ABA4857664D3B239FE4725D6BC3A8FADDCE726E0D74C86DBB45C2A84E81426D903F43D272DCB3C956ADDC1F070EFEC12BF2A6963CE675BE36A674F4763447AD1D8711119B87A60D3673739245FE3CDF745B5034E9967FAE70A98FFB49514EE9AF73FC82FE4B07FAB67E380937253028BA451C6CAC485FC04E8808BC90A18B38BAF246AC7F65ED6F014540A006285FF792CCF7B0E02580EE8486FDD2EADD4B98B8F806885C3DF0B1396D72FC14BD32F2520394853DA3CBE69582D4A5A04732E1BB456D8F010DF336D2F5C6CFC4540035E49639FEDFA9C31FAD6B44A6BC750B95319EAAEE19CA</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 08 6E 08 00 91 60 1C 65
|
||||
0010 | 40 01 00 00 BE E4 12 D7 76 55 34 97 7E 7D 6E EB
|
||||
0020 | BF 22 4D 1C 23 4A C2 88 59 3C 34 32 13 42 6C D2
|
||||
0030 | 20 8E 22 49 A7 E2 C5 FA 04 45 68 39 71 00 00 00
|
||||
0040 | 04 66 F4 19 5F 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 60 CF 21 90 07 69 58 68 E8 4E C1 30
|
||||
0060 | 5C 10 33 20 EF F8 92 55 0A BC 4F 6C FC 6B 5B 65
|
||||
0070 | 97 F9 46 F6 FB 13 5E DA D7 41 E7 F7 83 C7 29 46
|
||||
0080 | 9D 7A 84 B6 3A D2 84 50 76 F0 87 B0 BE D9 7C 4A
|
||||
0090 | 35 C0 C6 61 92 72 BD 8B 5D F6 03 76 A4 CC D3 B9
|
||||
00A0 | 06 D7 91 DB E7 68 AF A8 4E ED 96 9F 01 A3 1D E7
|
||||
00B0 | 5E A0 22 A6 49 24 46 C9 67 18 0E A4 60 DE CF 45
|
||||
00C0 | 01 55 EF 0B 16 4B 9F 30 A1 CC 9D C6 71 39 3D 0A
|
||||
00D0 | 92 EE 7C C7 1A D2 6B 1A 7F A4 11 F2 83 6D 0F BD
|
||||
00E0 | F8 AE A3 C6 AD B8 BE BD 99 6A 4B 6B 30 F4 E7 01
|
||||
00F0 | 9A 3E 63 6A C1 B4 48 0A BF AF 43 48 28 60 06 4F
|
||||
0100 | AF 52 0B 57 A3 5B 2F AE BB 39 E5 26 B4 83 82 4D
|
||||
0110 | 70 9D 0B 6F 3B 15 40 DF 13 BD 33 25 16 22 F5 95
|
||||
0120 | 26 15 FA 4A 61 69 06 CD 44 1C 94 DB 2A 48 9A 67
|
||||
0130 | 74 9F 56 04 46 C0 61 D1 E7 F2 00 A4 29 0D CB B6
|
||||
0140 | 84 5D BA 2E B4 0E 2E D4 D9 42 0C 53 04 E2 5E E6
|
||||
0150 | 5F 66 3B A5</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 C4 DA 04 00 7E 62 1C 65
|
||||
0010 | 40 01 00 00 BE E4 12 D7 17 2F 85 E7 17 61 F3 BB
|
||||
0020 | 2C BD BE 71 2D 1E AF E5 88 17 DB E8 74 20 77 FA
|
||||
0030 | 5F 1C 0C 1C 6F F0 58 BD 04 47 55 57 67 00 00 00
|
||||
0040 | 04 4B B1 7A 0F 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 9B 64 DC F6 A1 32 9B A6 F9 60 6B 85
|
||||
0060 | 89 85 19 BE EA C5 16 D6 7B 2C E0 18 18 B5 9A BA
|
||||
0070 | 48 57 66 4D 3B 23 9F E4 72 5D 6B C3 A8 FA DD CE
|
||||
0080 | 72 6E 0D 74 C8 6D BB 45 C2 A8 4E 81 42 6D 90 3F
|
||||
0090 | 43 D2 72 DC B3 C9 56 AD DC 1F 07 0E FE C1 2B F2
|
||||
00A0 | A6 96 3C E6 75 BE 36 A6 74 F4 76 34 47 AD 1D 87
|
||||
00B0 | 11 11 9B 87 A6 0D 36 73 73 92 45 FE 3C DF 74 5B
|
||||
00C0 | 50 34 E9 96 7F AE 70 A9 8F FB 49 51 4E E9 AF 73
|
||||
00D0 | FC 82 FE 4B 07 FA B6 7E 38 09 37 25 30 28 BA 45
|
||||
00E0 | 1C 6C AC 48 5F C0 4E 88 08 BC 90 A1 8B 38 BA F2
|
||||
00F0 | 46 AC 7F 65 ED 6F 01 45 40 A0 06 28 5F F7 92 CC
|
||||
0100 | F7 B0 E0 25 80 EE 84 86 FD D2 EA DD 4B 98 B8 F8
|
||||
0110 | 06 88 5C 3D F0 B1 39 6D 72 FC 14 BD 32 F2 52 03
|
||||
0120 | 94 85 3D A3 CB E6 95 82 D4 A5 A0 47 32 E1 BB 45
|
||||
0130 | 6D 8F 01 0D F3 36 D2 F5 C6 CF C4 54 00 35 E4 96
|
||||
0140 | 39 FE DF A9 C3 1F AD 6B 44 A6 BC 75 0B 95 31 9E
|
||||
0150 | AA EE 19 CA</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 = E072931022DF619FAB9DF4CA248B60D849819621C492F8AADC3B46444
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>086E080091601C65</code></td>
|
||||
<td><code>C4DA04007E621C65</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 = E072931022DF619FAB9DF4CA248B60D849819621C492F8AADC3B46444
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>765534977E7D6EEBBF224D1C234AC288</code></td>
|
||||
<td><code>172F85E71761F3BB2CBDBE712D1EAFE5</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>593C343213426CD2208E2249A7E2C5FA</code></td>
|
||||
<td><code>8817DBE8742077FA5F1C0C1C6FF058BD</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p</td>
|
||||
<td>56, 8</td>
|
||||
<td><code>0445683971000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1164458353</td>
|
||||
<td><code>0447555767000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1196775271</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>0466F4195F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1727273311</td>
|
||||
<td><code>044BB17A0F000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1269922319</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 = E072931022DF619FAB9DF4CA248B60D849819621C492F8AADC3B46444
|
|||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>80, 260</td>
|
||||
<td><code>FE00010060CF219007695868E84EC130</code> <code>5C103320EFF892550ABC4F6CFC6B5B65</code> <code>97F946F6FB135EDAD741E7F783C72946</code> <code>9D7A84B63AD2845076F087B0BED97C4A</code> <code>35C0C6619272BD8B5DF60376A4CCD3B9</code> <code>06D791DBE768AFA84EED969F01A31DE7</code> <code>5EA022A6492446C967180EA460DECF45</code> <code>0155EF0B164B9F30A1CC9DC671393D0A</code> <code>92EE7CC71AD26B1A7FA411F2836D0FBD</code> <code>F8AEA3C6ADB8BEBD996A4B6B30F4E701</code> <code>9A3E636AC1B4480ABFAF43482860064F</code> <code>AF520B57A35B2FAEBB39E526B483824D</code> <code>709D0B6F3B1540DF13BD33251622F595</code> <code>2615FA4A616906CD441C94DB2A489A67</code> <code>749F560446C061D1E7F200A4290DCBB6</code> <code>845DBA2EB40E2ED4D9420C5304E25EE6</code><br> <code>5F663BA5</code></td>
|
||||
<td><code>FE0001009B64DCF6A1329BA6F9606B85</code> <code>898519BEEAC516D67B2CE01818B59ABA</code> <code>4857664D3B239FE4725D6BC3A8FADDCE</code> <code>726E0D74C86DBB45C2A84E81426D903F</code> <code>43D272DCB3C956ADDC1F070EFEC12BF2</code> <code>A6963CE675BE36A674F4763447AD1D87</code> <code>11119B87A60D3673739245FE3CDF745B</code> <code>5034E9967FAE70A98FFB49514EE9AF73</code> <code>FC82FE4B07FAB67E380937253028BA45</code> <code>1C6CAC485FC04E8808BC90A18B38BAF2</code> <code>46AC7F65ED6F014540A006285FF792CC</code> <code>F7B0E02580EE8486FDD2EADD4B98B8F8</code> <code>06885C3DF0B1396D72FC14BD32F25203</code> <code>94853DA3CBE69582D4A5A04732E1BB45</code> <code>6D8F010DF336D2F5C6CFC4540035E496</code> <code>39FEDFA9C31FAD6B44A6BC750B95319E</code><br> <code>AAEE19CA</code></td>
|
||||
<td>Value generated above</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -402,47 +402,47 @@ random_padding_bytes = E072931022DF619FAB9DF4CA248B60D849819621C492F8AADC3B46444
|
|||
<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 E8 D4 F6 91 60 1C 65
|
||||
0010 | 78 02 00 00 5C 07 E8 D0 76 55 34 97 7E 7D 6E EB
|
||||
0020 | BF 22 4D 1C 23 4A C2 88 59 3C 34 32 13 42 6C D2
|
||||
0030 | 20 8E 22 49 A7 E2 C5 FA FE 50 02 00 8A A0 9B F3
|
||||
0040 | CD AC 35 CD 42 2C BB EC A4 1E BB 4A E6 A9 BF 10
|
||||
0050 | F3 F6 78 31 5F EE 25 B9 E7 D3 BD A4 CF 48 35 33
|
||||
0060 | 23 F0 3B 94 CC 5F DE 5A AE 99 D0 08 F2 02 2D F5
|
||||
0070 | EB 16 B1 F6 D3 2B 5B F2 AB 8E 20 AA 1E 99 D9 72
|
||||
0080 | CD BE F6 B1 3B 2F 4A 1A 2B 9A A5 79 B8 F9 4F C8
|
||||
0090 | BF CF 87 38 72 BF DB D0 3D A9 E5 2E 02 82 3D 6D
|
||||
00A0 | 5B FE EE 17 83 3D F0 2D 87 D4 11 CD 19 B4 AF B7
|
||||
00B0 | D8 43 F3 06 01 42 03 46 B3 22 A8 31 EC 51 57 BC
|
||||
00C0 | 7F CD 10 A3 23 A1 E2 EC 20 66 48 F3 3C 9F 9A 45
|
||||
00D0 | B2 7A 6B A7 CC 40 55 35 5E 09 33 C4 2E A5 4A 3E
|
||||
00E0 | D9 E6 80 C2 36 CA 43 D0 AD B6 06 39 B9 19 45 2F
|
||||
00F0 | 54 18 41 A5 F2 F9 DF FE 6F CA 85 4A BB 30 24 64
|
||||
0100 | 6C 23 E1 F2 42 C6 2A 88 16 E2 46 09 20 31 AA F6
|
||||
0110 | C8 F3 5C E7 5F D4 6F FA E9 F8 3A A6 A9 D8 1F 46
|
||||
0120 | 87 F0 D9 EE B3 63 3D 7C 3E 34 6E 08 7F B7 A6 D3
|
||||
0130 | 38 C5 FD 3C FD 87 92 B7 AD 9C 79 FF DD D4 27 6D
|
||||
0140 | 69 57 98 42 DA AB A0 8D D8 B1 C5 7E E4 BD A4 34
|
||||
0150 | FF 40 45 AB C9 EF A8 26 F9 A5 10 2E 12 6B 15 22
|
||||
0160 | 22 23 17 3A 36 9A E4 26 0D 85 40 DD D6 0A AD 21
|
||||
0170 | 5A 28 A0 90 32 63 F1 26 60 5D 81 48 81 CA D5 66
|
||||
0180 | E8 41 32 A6 C0 01 7E A7 B1 F6 3C A2 74 29 A7 CC
|
||||
0190 | 18 9D 10 A4 E4 27 18 96 DE 6F 0E 07 7E 69 89 5D
|
||||
01A0 | F9 BC 7D F5 91 46 04 AC FD BB DA C9 5C 0C 17 5C
|
||||
01B0 | 04 0A 26 82 36 EC 29 D8 10 74 4B C8 5A D7 5A D2
|
||||
01C0 | 70 69 AF 96 DF 1C 12 BB 99 B9 D7 E2 D2 F4 A2 9B
|
||||
01D0 | 21 75 A5 76 47 99 7D BB A3 AF 9F D7 F0 F6 37 3A
|
||||
01E0 | EC DC 83 78 AD 00 1C 05 79 19 79 13 5B C5 39 E1
|
||||
01F0 | BD D2 21 B1 D1 30 25 3D B3 10 E9 DC B0 A6 7B F1
|
||||
0200 | C8 49 15 BA 5A E9 A9 28 66 C7 7E 25 AF 04 DD 07
|
||||
0210 | FE 26 E5 6C E0 4E 14 90 C0 21 C6 7E 8F 61 F8 17
|
||||
0220 | F0 EE 55 36 97 2C 8F 8D 92 C2 1A 23 13 C9 A8 24
|
||||
0230 | ED F5 C7 B1 AA A3 70 BC C8 39 52 EE 10 B9 B3 6D
|
||||
0240 | 91 F0 DD F8 8B DA 98 E0 CE 24 7B 97 A2 48 AB 80
|
||||
0250 | 84 E7 D4 48 8E B0 09 9E E6 F5 6E 23 50 57 56 F8
|
||||
0260 | 01 4C 26 EF 0E 52 91 6B 3D EC 5F 45 10 AC 0A D1
|
||||
0270 | 3F 5E 0A E7 5C 2C 06 9B F1 79 23 F5 A7 7D 64 32
|
||||
0280 | F9 99 DA DB CE 46 6F 27 AE 21 B8 A6</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 AC 6C FB 7E 62 1C 65
|
||||
0010 | CC 02 00 00 5C 07 E8 D0 17 2F 85 E7 17 61 F3 BB
|
||||
0020 | 2C BD BE 71 2D 1E AF E5 88 17 DB E8 74 20 77 FA
|
||||
0030 | 5F 1C 0C 1C 6F F0 58 BD FE 50 02 00 61 3E F9 94
|
||||
0040 | 16 A0 64 93 A8 62 CC 34 AC 4D AD 0C A6 34 F4 16
|
||||
0050 | 8F 80 A8 71 85 75 FF 51 42 CE 9F 15 73 C3 25 1D
|
||||
0060 | 6C F2 12 80 80 5A CF 10 22 A9 B4 D1 C2 69 7C F0
|
||||
0070 | B8 EF A3 AD E1 05 EF 95 23 3C 16 91 66 ED EC 2F
|
||||
0080 | 7B 93 0F 2C 63 84 90 0A D8 E0 1A E9 08 18 D0 D7
|
||||
0090 | CF 3B 4A AC AB A8 AF 05 EA 87 9E 93 F3 45 B3 DF
|
||||
00A0 | 65 3D F0 23 F8 E8 4D 6C 29 8F EC 7D 91 A0 31 1B
|
||||
00B0 | 2E 5F 7A 29 3A B3 47 8B D5 1D C1 8A 00 E3 1E 82
|
||||
00C0 | 6A 49 5F D4 F7 A7 45 5E 4E E5 FE 85 27 23 E2 B5
|
||||
00D0 | 87 7D E2 4F CA A5 C9 E6 4A 85 8B 46 04 27 D4 05
|
||||
00E0 | 5A D3 45 81 14 01 FE D3 9A 21 DC 6A 9D EC B7 96
|
||||
00F0 | 30 2B BB A6 87 75 1C 8E 88 84 76 31 C0 A5 9D FF
|
||||
0100 | DB FC 71 9D 07 10 5C 50 BE FC E8 9B BD 61 CC EF
|
||||
0110 | 86 B1 92 BF 80 CF D4 2B B1 83 49 D2 55 58 A4 11
|
||||
0120 | 08 D6 C7 EB D2 03 DA 4B 14 E3 8C AF C8 0B 97 07
|
||||
0130 | 1E C8 EA BB EB 5C CA CD 33 60 39 85 07 29 BD 21
|
||||
0140 | E4 A1 D3 65 9D F3 FD 38 1E 79 EE A0 EC 71 1A 0D
|
||||
0150 | 15 AE B0 D9 A2 69 C3 00 AA 65 E4 1C E5 9C AB 46
|
||||
0160 | 04 DF 24 5D 26 FC 86 13 D1 56 23 75 D1 78 B7 E7
|
||||
0170 | 27 49 C1 C1 71 75 F8 E8 2D ED 77 FA 42 68 E1 23
|
||||
0180 | AB 08 B6 66 1D 94 F7 39 40 45 62 3D 5C BA 6B B9
|
||||
0190 | 3D 82 74 FF 1F 73 E5 49 0A B7 AF 0E 38 3B D9 FC
|
||||
01A0 | E4 68 69 39 25 27 B6 32 C7 95 0B 9B 95 94 D8 F7
|
||||
01B0 | 3E 4E FE EB 5E 32 24 2B 55 60 24 43 41 89 4F 2F
|
||||
01C0 | 7E 8D 57 63 AE 60 48 61 FB 2E 79 EC 34 5F 70 2B
|
||||
01D0 | 3A 30 DE F4 1F 81 C6 18 22 18 3A 9C C0 F1 61 87
|
||||
01E0 | 48 06 DB 55 F7 23 A9 5D 52 A7 6B 71 ED 38 AF AF
|
||||
01F0 | 12 92 5D 6C DB D5 4C 41 D8 93 62 1C 60 BB 34 89
|
||||
0200 | 41 47 9A F3 13 A5 95 41 EC 86 9B E8 A4 70 48 8E
|
||||
0210 | 19 97 7B 70 B4 7D 74 8C 35 55 82 1F C7 E8 13 4E
|
||||
0220 | 30 44 FA 7F 74 AC 2D 49 60 EE 4E E0 23 49 DD C3
|
||||
0230 | 4B CF C2 0A 43 21 BC 08 2F C1 47 66 69 FA B5 4B
|
||||
0240 | B8 F5 EB 07 A9 8A D7 3B A0 4A EE 46 C6 F3 76 8C
|
||||
0250 | B0 B6 BB 7D A6 DD 5C ED 7E 72 E1 10 32 1A 31 C0
|
||||
0260 | F9 77 5D 4B 4D 89 77 09 C0 78 3E FA 26 9D 19 5C
|
||||
0270 | 41 C1 F8 A9 6F 78 75 D2 01 41 F2 3B 3B E5 3C F4
|
||||
0280 | 40 23 D2 8B AF EA BA CC 7E 70 1B 08</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 = E072931022DF619FAB9DF4CA248B60D849819621C492F8AADC3B46444
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>01E8D4F691601C65</code></td>
|
||||
<td><code>01AC6CFB7E621C65</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>78020000</code> (632 in decimal)</td>
|
||||
<td><code>CC020000</code> (716 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -482,19 +482,19 @@ random_padding_bytes = E072931022DF619FAB9DF4CA248B60D849819621C492F8AADC3B46444
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>765534977E7D6EEBBF224D1C234AC288</code></td>
|
||||
<td><code>172F85E71761F3BB2CBDBE712D1EAFE5</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>593C343213426CD2208E2249A7E2C5FA</code></td>
|
||||
<td><code>8817DBE8742077FA5F1C0C1C6FF058BD</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_answer</td>
|
||||
<td>56, 596</td>
|
||||
<td><code>FE5002008AA09BF3CDAC35CD422CBBEC</code> <code>A41EBB4AE6A9BF10F3F678315FEE25B9</code> <code>E7D3BDA4CF48353323F03B94CC5FDE5A</code> <code>AE99D008F2022DF5EB16B1F6D32B5BF2</code> <code>AB8E20AA1E99D972CDBEF6B13B2F4A1A</code> <code>2B9AA579B8F94FC8BFCF873872BFDBD0</code> <code>3DA9E52E02823D6D5BFEEE17833DF02D</code> <code>87D411CD19B4AFB7D843F30601420346</code> <code>B322A831EC5157BC7FCD10A323A1E2EC</code> <code>206648F33C9F9A45B27A6BA7CC405535</code> <code>5E0933C42EA54A3ED9E680C236CA43D0</code> <code>ADB60639B919452F541841A5F2F9DFFE</code> <code>6FCA854ABB3024646C23E1F242C62A88</code> <code>16E246092031AAF6C8F35CE75FD46FFA</code> <code>E9F83AA6A9D81F4687F0D9EEB3633D7C</code> <code>3E346E087FB7A6D338C5FD3CFD8792B7</code> <code>AD9C79FFDDD4276D69579842DAABA08D</code> <code>D8B1C57EE4BDA434FF4045ABC9EFA826</code> <code>F9A5102E126B15222223173A369AE426</code> <code>0D8540DDD60AAD215A28A0903263F126</code> <code>605D814881CAD566E84132A6C0017EA7</code> <code>B1F63CA27429A7CC189D10A4E4271896</code> <code>DE6F0E077E69895DF9BC7DF5914604AC</code> <code>FDBBDAC95C0C175C040A268236EC29D8</code> <code>10744BC85AD75AD27069AF96DF1C12BB</code> <code>99B9D7E2D2F4A29B2175A57647997DBB</code> <code>A3AF9FD7F0F6373AECDC8378AD001C05</code> <code>791979135BC539E1BDD221B1D130253D</code> <code>B310E9DCB0A67BF1C84915BA5AE9A928</code> <code>66C77E25AF04DD07FE26E56CE04E1490</code> <code>C021C67E8F61F817F0EE5536972C8F8D</code> <code>92C21A2313C9A824EDF5C7B1AAA370BC</code> <code>C83952EE10B9B36D91F0DDF88BDA98E0</code> <code>CE247B97A248AB8084E7D4488EB0099E</code> <code>E6F56E23505756F8014C26EF0E52916B</code> <code>3DEC5F4510AC0AD13F5E0AE75C2C069B</code> <code>F17923F5A77D6432F999DADBCE466F27</code><br> <code>AE21B8A6</code></td>
|
||||
<td><code>FE500200613EF99416A06493A862CC34</code> <code>AC4DAD0CA634F4168F80A8718575FF51</code> <code>42CE9F1573C3251D6CF21280805ACF10</code> <code>22A9B4D1C2697CF0B8EFA3ADE105EF95</code> <code>233C169166EDEC2F7B930F2C6384900A</code> <code>D8E01AE90818D0D7CF3B4AACABA8AF05</code> <code>EA879E93F345B3DF653DF023F8E84D6C</code> <code>298FEC7D91A0311B2E5F7A293AB3478B</code> <code>D51DC18A00E31E826A495FD4F7A7455E</code> <code>4EE5FE852723E2B5877DE24FCAA5C9E6</code> <code>4A858B460427D4055AD345811401FED3</code> <code>9A21DC6A9DECB796302BBBA687751C8E</code> <code>88847631C0A59DFFDBFC719D07105C50</code> <code>BEFCE89BBD61CCEF86B192BF80CFD42B</code> <code>B18349D25558A41108D6C7EBD203DA4B</code> <code>14E38CAFC80B97071EC8EABBEB5CCACD</code> <code>336039850729BD21E4A1D3659DF3FD38</code> <code>1E79EEA0EC711A0D15AEB0D9A269C300</code> <code>AA65E41CE59CAB4604DF245D26FC8613</code> <code>D1562375D178B7E72749C1C17175F8E8</code> <code>2DED77FA4268E123AB08B6661D94F739</code> <code>4045623D5CBA6BB93D8274FF1F73E549</code> <code>0AB7AF0E383BD9FCE46869392527B632</code> <code>C7950B9B9594D8F73E4EFEEB5E32242B</code> <code>5560244341894F2F7E8D5763AE604861</code> <code>FB2E79EC345F702B3A30DEF41F81C618</code> <code>22183A9CC0F161874806DB55F723A95D</code> <code>52A76B71ED38AFAF12925D6CDBD54C41</code> <code>D893621C60BB348941479AF313A59541</code> <code>EC869BE8A470488E19977B70B47D748C</code> <code>3555821FC7E8134E3044FA7F74AC2D49</code> <code>60EE4EE02349DDC34BCFC20A4321BC08</code> <code>2FC1476669FAB54BB8F5EB07A98AD73B</code> <code>A04AEE46C6F3768CB0B6BB7DA6DD5CED</code> <code>7E72E110321A31C0F9775D4B4D897709</code> <code>C0783EFA269D195C41C1F8A96F7875D2</code> <code>0141F23B3BE53CF44023D28BAFEABACC</code><br> <code>7E701B08</code></td>
|
||||
<td>See below</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -502,20 +502,20 @@ random_padding_bytes = E072931022DF619FAB9DF4CA248B60D849819621C492F8AADC3B46444
|
|||
<!-- 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 = 8AA09BF3CDAC35CD422CBBECA41EBB4AE6A9BF10F3F678315FEE25B9E7D3BDA4CF48353323F03B94CC5FDE5AAE99D008F2022DF5EB16B1F6D32B5BF2AB8E20AA1E99D972CDBEF6B13B2F4A1A2B9AA579B8F94FC8BFCF873872BFDBD03DA9E52E02823D6D5BFEEE17833DF02D87D411CD19B4AFB7D843F30601420346B322A831EC5157BC7FCD10A323A1E2EC206648F33C9F9A45B27A6BA7CC4055355E0933C42EA54A3ED9E680C236CA43D0ADB60639B919452F541841A5F2F9DFFE6FCA854ABB3024646C23E1F242C62A8816E246092031AAF6C8F35CE75FD46FFAE9F83AA6A9D81F4687F0D9EEB3633D7C3E346E087FB7A6D338C5FD3CFD8792B7AD9C79FFDDD4276D69579842DAABA08DD8B1C57EE4BDA434FF4045ABC9EFA826F9A5102E126B15222223173A369AE4260D8540DDD60AAD215A28A0903263F126605D814881CAD566E84132A6C0017EA7B1F63CA27429A7CC189D10A4E4271896DE6F0E077E69895DF9BC7DF5914604ACFDBBDAC95C0C175C040A268236EC29D810744BC85AD75AD27069AF96DF1C12BB99B9D7E2D2F4A29B2175A57647997DBBA3AF9FD7F0F6373AECDC8378AD001C05791979135BC539E1BDD221B1D130253DB310E9DCB0A67BF1C84915BA5AE9A92866C77E25AF04DD07FE26E56CE04E1490C021C67E8F61F817F0EE5536972C8F8D92C21A2313C9A824EDF5C7B1AAA370BCC83952EE10B9B36D91F0DDF88BDA98E0CE247B97A248AB8084E7D4488EB0099EE6F56E23505756F8014C26EF0E52916B3DEC5F4510AC0AD13F5E0AE75C2C069BF17923F5A77D6432F999DADBCE466F27AE21B8A6
|
||||
tmp_aes_key = 00957C715B8E1E63150F7124A4836143E1E185A67B7558EE95A7C9D6E2ED1674
|
||||
tmp_aes_iv = 12FD28AFDDC00AE7C9C4AB10E46045991452F0301725D23563C0E0135F162B23</code></pre>
|
||||
<pre><code>encrypted_answer = 613EF99416A06493A862CC34AC4DAD0CA634F4168F80A8718575FF5142CE9F1573C3251D6CF21280805ACF1022A9B4D1C2697CF0B8EFA3ADE105EF95233C169166EDEC2F7B930F2C6384900AD8E01AE90818D0D7CF3B4AACABA8AF05EA879E93F345B3DF653DF023F8E84D6C298FEC7D91A0311B2E5F7A293AB3478BD51DC18A00E31E826A495FD4F7A7455E4EE5FE852723E2B5877DE24FCAA5C9E64A858B460427D4055AD345811401FED39A21DC6A9DECB796302BBBA687751C8E88847631C0A59DFFDBFC719D07105C50BEFCE89BBD61CCEF86B192BF80CFD42BB18349D25558A41108D6C7EBD203DA4B14E38CAFC80B97071EC8EABBEB5CCACD336039850729BD21E4A1D3659DF3FD381E79EEA0EC711A0D15AEB0D9A269C300AA65E41CE59CAB4604DF245D26FC8613D1562375D178B7E72749C1C17175F8E82DED77FA4268E123AB08B6661D94F7394045623D5CBA6BB93D8274FF1F73E5490AB7AF0E383BD9FCE46869392527B632C7950B9B9594D8F73E4EFEEB5E32242B5560244341894F2F7E8D5763AE604861FB2E79EC345F702B3A30DEF41F81C61822183A9CC0F161874806DB55F723A95D52A76B71ED38AFAF12925D6CDBD54C41D893621C60BB348941479AF313A59541EC869BE8A470488E19977B70B47D748C3555821FC7E8134E3044FA7F74AC2D4960EE4EE02349DDC34BCFC20A4321BC082FC1476669FAB54BB8F5EB07A98AD73BA04AEE46C6F3768CB0B6BB7DA6DD5CED7E72E110321A31C0F9775D4B4D897709C0783EFA269D195C41C1F8A96F7875D20141F23B3BE53CF44023D28BAFEABACC7E701B08
|
||||
tmp_aes_key = 27E43D018B2EF8AF3395B27B19DF173DD09438278E712FB63CDDEBBEAE0CBE6C
|
||||
tmp_aes_iv = EA31E588F2C4D371DD73B81C016BC9B12BDF9B29AB42D106FD2CCED63656DBB3</code></pre>
|
||||
<!-- end server_DH_inner_data_input -->
|
||||
<p>Yielding:</p>
|
||||
<!-- start server_DH_inner_data_output -->
|
||||
<pre><code>answer_with_hash = 8B47B67C90587A880847DEA7635FDF16C04C3A36BA0D89B5765534977E7D6EEBBF224D1C234AC288593C343213426CD2208E2249A7E2C5FA03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001005E59B593235434AAC7B56E20D2CF1EE2EED93E6AA8B6735AEF7E7A4AE0C4EA235054FFA861EF09C93CDCE4906F44A948943D3C3F761DF381439F44B043C848AF40076A3BA53D9CAB17FAAA4FFC75D6BFD0067BF3A2E34329D89A3EA091120CAAAA3606DD7D71AF8DBDCFC4A002A1A8B6DDE48E583144E42EBF4359104D0E9A813214C0E2A68D63AC0306C8F8883F5CC8C65D78712C8B35EB089231DA4E985C9ED6550785230186B525B87DE2B1AEA6B5D2D7AD113B856F08DE959F5C91EC28CBF596FF7A16C4F3FC618B7EAD59274A1CD45DEA44EEF64BEB4BF6701E1569BA37018BE538DAC9BE7FF598CF26EBDC8B9F0CB30A68557762634056DE151139633391601C65E1451B24376CEBC0
|
||||
answer = BA0D89B5765534977E7D6EEBBF224D1C234AC288593C343213426CD2208E2249A7E2C5FA03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001005E59B593235434AAC7B56E20D2CF1EE2EED93E6AA8B6735AEF7E7A4AE0C4EA235054FFA861EF09C93CDCE4906F44A948943D3C3F761DF381439F44B043C848AF40076A3BA53D9CAB17FAAA4FFC75D6BFD0067BF3A2E34329D89A3EA091120CAAAA3606DD7D71AF8DBDCFC4A002A1A8B6DDE48E583144E42EBF4359104D0E9A813214C0E2A68D63AC0306C8F8883F5CC8C65D78712C8B35EB089231DA4E985C9ED6550785230186B525B87DE2B1AEA6B5D2D7AD113B856F08DE959F5C91EC28CBF596FF7A16C4F3FC618B7EAD59274A1CD45DEA44EEF64BEB4BF6701E1569BA37018BE538DAC9BE7FF598CF26EBDC8B9F0CB30A68557762634056DE151139633391601C65E1451B24376CEBC0</code></pre>
|
||||
<pre><code>answer_with_hash = CEDFCC7073A25B1887B35BCB78F39E386AA06D63BA0D89B5172F85E71761F3BB2CBDBE712D1EAFE58817DBE8742077FA5F1C0C1C6FF058BD03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001008DC5651CB12C9F356AB2D51621AEA73B50365C5F8B5E1C9CFFD296864FCD931229EBB650607C26795A923E81CEC067A22712D1D35F5D9D99013F3B3E39A6C3C9CE38F95F53299F56F9C6792594848AA5C803D1607ACEA125619CB5624D3BE2A47C904B3FA402AE8691B8038676326CF6ED55C1E42229621F09E6B6EA0138FF63C03C185112A6C735BFF2D7C62595F570721CCDB915AFE67D16BAF8ADF660F8F15C6BC9C8C6C23B74C28DDF5626CA97B6007EB475F1D30FA5D37D5EC17830B66C8BE78FD5DFA136B98ADAE360ED6FD3082E3B6205B811102977A298620E965B8FBC5756CD76D738AADCF2CB69D3D0D4E4294F64CD70993FCCEF275191A92D00B47E621C65614B3887B7E3A96A
|
||||
answer = BA0D89B5172F85E71761F3BB2CBDBE712D1EAFE58817DBE8742077FA5F1C0C1C6FF058BD03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001008DC5651CB12C9F356AB2D51621AEA73B50365C5F8B5E1C9CFFD296864FCD931229EBB650607C26795A923E81CEC067A22712D1D35F5D9D99013F3B3E39A6C3C9CE38F95F53299F56F9C6792594848AA5C803D1607ACEA125619CB5624D3BE2A47C904B3FA402AE8691B8038676326CF6ED55C1E42229621F09E6B6EA0138FF63C03C185112A6C735BFF2D7C62595F570721CCDB915AFE67D16BAF8ADF660F8F15C6BC9C8C6C23B74C28DDF5626CA97B6007EB475F1D30FA5D37D5EC17830B66C8BE78FD5DFA136B98ADAE360ED6FD3082E3B6205B811102977A298620E965B8FBC5756CD76D738AADCF2CB69D3D0D4E4294F64CD70993FCCEF275191A92D00B47E621C65614B3887B7E3A96A</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 76 55 34 97 7E 7D 6E EB BF 22 4D 1C
|
||||
0010 | 23 4A C2 88 59 3C 34 32 13 42 6C D2 20 8E 22 49
|
||||
0020 | A7 E2 C5 FA 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
||||
<pre><code>0000 | BA 0D 89 B5 17 2F 85 E7 17 61 F3 BB 2C BD BE 71
|
||||
0010 | 2D 1E AF E5 88 17 DB E8 74 20 77 FA 5F 1C 0C 1C
|
||||
0020 | 6F F0 58 BD 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 = BA0D89B5765534977E7D6EEBBF224D1C234AC288593C343213426CD2208E2249A7E2C5F
|
|||
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 | 5E 59 B5 93 23 54 34 AA C7 B5 6E 20 D2 CF 1E E2
|
||||
0140 | EE D9 3E 6A A8 B6 73 5A EF 7E 7A 4A E0 C4 EA 23
|
||||
0150 | 50 54 FF A8 61 EF 09 C9 3C DC E4 90 6F 44 A9 48
|
||||
0160 | 94 3D 3C 3F 76 1D F3 81 43 9F 44 B0 43 C8 48 AF
|
||||
0170 | 40 07 6A 3B A5 3D 9C AB 17 FA AA 4F FC 75 D6 BF
|
||||
0180 | D0 06 7B F3 A2 E3 43 29 D8 9A 3E A0 91 12 0C AA
|
||||
0190 | AA 36 06 DD 7D 71 AF 8D BD CF C4 A0 02 A1 A8 B6
|
||||
01A0 | DD E4 8E 58 31 44 E4 2E BF 43 59 10 4D 0E 9A 81
|
||||
01B0 | 32 14 C0 E2 A6 8D 63 AC 03 06 C8 F8 88 3F 5C C8
|
||||
01C0 | C6 5D 78 71 2C 8B 35 EB 08 92 31 DA 4E 98 5C 9E
|
||||
01D0 | D6 55 07 85 23 01 86 B5 25 B8 7D E2 B1 AE A6 B5
|
||||
01E0 | D2 D7 AD 11 3B 85 6F 08 DE 95 9F 5C 91 EC 28 CB
|
||||
01F0 | F5 96 FF 7A 16 C4 F3 FC 61 8B 7E AD 59 27 4A 1C
|
||||
0200 | D4 5D EA 44 EE F6 4B EB 4B F6 70 1E 15 69 BA 37
|
||||
0210 | 01 8B E5 38 DA C9 BE 7F F5 98 CF 26 EB DC 8B 9F
|
||||
0220 | 0C B3 0A 68 55 77 62 63 40 56 DE 15 11 39 63 33
|
||||
0230 | 91 60 1C 65</code></pre>
|
||||
0130 | 8D C5 65 1C B1 2C 9F 35 6A B2 D5 16 21 AE A7 3B
|
||||
0140 | 50 36 5C 5F 8B 5E 1C 9C FF D2 96 86 4F CD 93 12
|
||||
0150 | 29 EB B6 50 60 7C 26 79 5A 92 3E 81 CE C0 67 A2
|
||||
0160 | 27 12 D1 D3 5F 5D 9D 99 01 3F 3B 3E 39 A6 C3 C9
|
||||
0170 | CE 38 F9 5F 53 29 9F 56 F9 C6 79 25 94 84 8A A5
|
||||
0180 | C8 03 D1 60 7A CE A1 25 61 9C B5 62 4D 3B E2 A4
|
||||
0190 | 7C 90 4B 3F A4 02 AE 86 91 B8 03 86 76 32 6C F6
|
||||
01A0 | ED 55 C1 E4 22 29 62 1F 09 E6 B6 EA 01 38 FF 63
|
||||
01B0 | C0 3C 18 51 12 A6 C7 35 BF F2 D7 C6 25 95 F5 70
|
||||
01C0 | 72 1C CD B9 15 AF E6 7D 16 BA F8 AD F6 60 F8 F1
|
||||
01D0 | 5C 6B C9 C8 C6 C2 3B 74 C2 8D DF 56 26 CA 97 B6
|
||||
01E0 | 00 7E B4 75 F1 D3 0F A5 D3 7D 5E C1 78 30 B6 6C
|
||||
01F0 | 8B E7 8F D5 DF A1 36 B9 8A DA E3 60 ED 6F D3 08
|
||||
0200 | 2E 3B 62 05 B8 11 10 29 77 A2 98 62 0E 96 5B 8F
|
||||
0210 | BC 57 56 CD 76 D7 38 AA DC F2 CB 69 D3 D0 D4 E4
|
||||
0220 | 29 4F 64 CD 70 99 3F CC EF 27 51 91 A9 2D 00 B4
|
||||
0230 | 7E 62 1C 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 = BA0D89B5765534977E7D6EEBBF224D1C234AC288593C343213426CD2208E2249A7E2C5F
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>765534977E7D6EEBBF224D1C234AC288</code></td>
|
||||
<td><code>172F85E71761F3BB2CBDBE712D1EAFE5</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>593C343213426CD2208E2249A7E2C5FA</code></td>
|
||||
<td><code>8817DBE8742077FA5F1C0C1C6FF058BD</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -594,13 +594,13 @@ answer = BA0D89B5765534977E7D6EEBBF224D1C234AC288593C343213426CD2208E2249A7E2C5F
|
|||
<tr>
|
||||
<td>g_a</td>
|
||||
<td>300, 260</td>
|
||||
<td><code>FE0001005E59B593235434AAC7B56E20</code> <code>D2CF1EE2EED93E6AA8B6735AEF7E7A4A</code> <code>E0C4EA235054FFA861EF09C93CDCE490</code> <code>6F44A948943D3C3F761DF381439F44B0</code> <code>43C848AF40076A3BA53D9CAB17FAAA4F</code> <code>FC75D6BFD0067BF3A2E34329D89A3EA0</code> <code>91120CAAAA3606DD7D71AF8DBDCFC4A0</code> <code>02A1A8B6DDE48E583144E42EBF435910</code> <code>4D0E9A813214C0E2A68D63AC0306C8F8</code> <code>883F5CC8C65D78712C8B35EB089231DA</code> <code>4E985C9ED6550785230186B525B87DE2</code> <code>B1AEA6B5D2D7AD113B856F08DE959F5C</code> <code>91EC28CBF596FF7A16C4F3FC618B7EAD</code> <code>59274A1CD45DEA44EEF64BEB4BF6701E</code> <code>1569BA37018BE538DAC9BE7FF598CF26</code> <code>EBDC8B9F0CB30A68557762634056DE15</code><br> <code>11396333</code></td>
|
||||
<td><code>FE0001008DC5651CB12C9F356AB2D516</code> <code>21AEA73B50365C5F8B5E1C9CFFD29686</code> <code>4FCD931229EBB650607C26795A923E81</code> <code>CEC067A22712D1D35F5D9D99013F3B3E</code> <code>39A6C3C9CE38F95F53299F56F9C67925</code> <code>94848AA5C803D1607ACEA125619CB562</code> <code>4D3BE2A47C904B3FA402AE8691B80386</code> <code>76326CF6ED55C1E42229621F09E6B6EA</code> <code>0138FF63C03C185112A6C735BFF2D7C6</code> <code>2595F570721CCDB915AFE67D16BAF8AD</code> <code>F660F8F15C6BC9C8C6C23B74C28DDF56</code> <code>26CA97B6007EB475F1D30FA5D37D5EC1</code> <code>7830B66C8BE78FD5DFA136B98ADAE360</code> <code>ED6FD3082E3B6205B811102977A29862</code> <code>0E965B8FBC5756CD76D738AADCF2CB69</code> <code>D3D0D4E4294F64CD70993FCCEF275191</code><br> <code>A92D00B4</code></td>
|
||||
<td><code>g_a</code> diffie-hellman parameter</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_time</td>
|
||||
<td>560, 4</td>
|
||||
<td><code>91601C65</code> (1696358545 in decimal)</td>
|
||||
<td><code>7E621C65</code> (1696359038 in decimal)</td>
|
||||
<td>Server time</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -609,34 +609,34 @@ answer = BA0D89B5765534977E7D6EEBBF224D1C234AC288593C343213426CD2208E2249A7E2C5F
|
|||
<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 = B053907FBA6EE657355CE89C6C30AFCF55BE727393084452215BEE1EA901CFDC6F6FEB277C03B82E33029436B0185BC834188BF7983D010C749051840BFA5C661618C1AB94943EE2A24F8C7829A2A561FE219BF4E7337E1506F50C10FD2061D3D007D2AB0A5D07B620B8C12E156A58BEE675BA2C1FEB0D5A4F0F9B8F4CAD8AB51AE9FC0729B425C471E6D771AC836C5B6D96F3F135D21F6BA372ABD81DE4A14960B05E944DE545B8B93771FC4EB62E66164EE26621B18511854E551EA67191A3BD7B1424386D970F4527D2D58EFC959576426EA4E84117D7AA894A32888882747A852545F024C4986643E39D69E3C1EFFEBC4791E4CD7A253271488280294693</code></pre>
|
||||
<pre><code>b = F226B4AB8313660386E985D25151773C42B73164114F9FC139B99799B052283CDCEA6EFCA93D07DA68897D2E5A6AA14AB38C57146984A9EE1F127265E7234E16C9C76EFD83CB5AA6A59FD26AC3146F7E3953EB56FA62207228CBB41774F49DFFC05C4D97A644D09999AAEB1A7A4A7167B83B82DD1877B95EACCC758D7779A98F3CEF3C781AE8BFB7B72B2E2AEBEC53651898396AFA006010DCC456A8703120852B0F460199AC160A52A083D4061DBBA105566E9478AE5B9CC2EF8A032A8358AC55B840C4F9A7DC70469A39F887E93489A72E2B492C5E88B94738900A6EF9CEF83A05F7410B720793BEA9C49440CB9543E081D2098C9F79FB1832DDF76F0AA0E1</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 = 2194D68418CD6B3273273D213311CE848C584B03F8D62F6E3FB26DE670117CDC0206A7F958236C4D2611A43E554E2DF485794E0F40601648838850126FD9323BC686575165D1B13E2628F21B9D3697FA8A37890A281FDEDE9BBB8A69D74345124E5775961994DEBC1B51C2910DF142E1C637E1A20C98033D9CD49B2460AF21241AD7864C6BB4605419C99DC36F78FDED75073CE014619A43D8571C45BDBB79115BF985766E41E3D9590E9B318A102E3E0D80335B3E6715582E2C85FB183D119833812FCFB2F1629B727D929AB33ABD7CBD91F60AB53AE0ACD06A3DDAB60CCDC243B239466F048E76E733AB09CB488D67B075BB33A9FD2AFEF4DD19D3593E0200</code></pre>
|
||||
<pre><code>g_b = 239C05827B2E75E7EA297C4E957EB25C0C4A2DD8BC20E36B17D3AE69943522CF0D09EC0720487AEFA88CCCC66ADA24887120D3F325E29C0200E63C38872FD9D514981EB2B18287413EB912FEA618766F1805984748BF59FBDB5E35A35B379960576AAE3B852DBD4D36C34EC9ADC15118CBF4EE83238D7BFEDF4DE0A408AC74F63273261D4678615D5A5ADF950D4FF9E2D441119976C79C56BD5343AC6C04697D115A5917AE29488EC9C8F10B7AC4836FDC36304464905392FA6FBADAB5E684D43616E03BDDF68C230A18A34642301EA7ACB0165C97B88E08BE2BADC95E75D4FC2F54C9ABE9B0F1C2BC2BBFD97AE9B44F186C498B3E6967DAC1E1E4AA5A8F3866</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 76 55 34 97 7E 7D 6E EB BF 22 4D 1C
|
||||
0010 | 23 4A C2 88 59 3C 34 32 13 42 6C D2 20 8E 22 49
|
||||
0020 | A7 E2 C5 FA 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | 21 94 D6 84 18 CD 6B 32 73 27 3D 21 33 11 CE 84
|
||||
0040 | 8C 58 4B 03 F8 D6 2F 6E 3F B2 6D E6 70 11 7C DC
|
||||
0050 | 02 06 A7 F9 58 23 6C 4D 26 11 A4 3E 55 4E 2D F4
|
||||
0060 | 85 79 4E 0F 40 60 16 48 83 88 50 12 6F D9 32 3B
|
||||
0070 | C6 86 57 51 65 D1 B1 3E 26 28 F2 1B 9D 36 97 FA
|
||||
0080 | 8A 37 89 0A 28 1F DE DE 9B BB 8A 69 D7 43 45 12
|
||||
0090 | 4E 57 75 96 19 94 DE BC 1B 51 C2 91 0D F1 42 E1
|
||||
00A0 | C6 37 E1 A2 0C 98 03 3D 9C D4 9B 24 60 AF 21 24
|
||||
00B0 | 1A D7 86 4C 6B B4 60 54 19 C9 9D C3 6F 78 FD ED
|
||||
00C0 | 75 07 3C E0 14 61 9A 43 D8 57 1C 45 BD BB 79 11
|
||||
00D0 | 5B F9 85 76 6E 41 E3 D9 59 0E 9B 31 8A 10 2E 3E
|
||||
00E0 | 0D 80 33 5B 3E 67 15 58 2E 2C 85 FB 18 3D 11 98
|
||||
00F0 | 33 81 2F CF B2 F1 62 9B 72 7D 92 9A B3 3A BD 7C
|
||||
0100 | BD 91 F6 0A B5 3A E0 AC D0 6A 3D DA B6 0C CD C2
|
||||
0110 | 43 B2 39 46 6F 04 8E 76 E7 33 AB 09 CB 48 8D 67
|
||||
0120 | B0 75 BB 33 A9 FD 2A FE F4 DD 19 D3 59 3E 02 00</code></pre>
|
||||
<pre><code>0000 | 54 B6 43 66 17 2F 85 E7 17 61 F3 BB 2C BD BE 71
|
||||
0010 | 2D 1E AF E5 88 17 DB E8 74 20 77 FA 5F 1C 0C 1C
|
||||
0020 | 6F F0 58 BD 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | 23 9C 05 82 7B 2E 75 E7 EA 29 7C 4E 95 7E B2 5C
|
||||
0040 | 0C 4A 2D D8 BC 20 E3 6B 17 D3 AE 69 94 35 22 CF
|
||||
0050 | 0D 09 EC 07 20 48 7A EF A8 8C CC C6 6A DA 24 88
|
||||
0060 | 71 20 D3 F3 25 E2 9C 02 00 E6 3C 38 87 2F D9 D5
|
||||
0070 | 14 98 1E B2 B1 82 87 41 3E B9 12 FE A6 18 76 6F
|
||||
0080 | 18 05 98 47 48 BF 59 FB DB 5E 35 A3 5B 37 99 60
|
||||
0090 | 57 6A AE 3B 85 2D BD 4D 36 C3 4E C9 AD C1 51 18
|
||||
00A0 | CB F4 EE 83 23 8D 7B FE DF 4D E0 A4 08 AC 74 F6
|
||||
00B0 | 32 73 26 1D 46 78 61 5D 5A 5A DF 95 0D 4F F9 E2
|
||||
00C0 | D4 41 11 99 76 C7 9C 56 BD 53 43 AC 6C 04 69 7D
|
||||
00D0 | 11 5A 59 17 AE 29 48 8E C9 C8 F1 0B 7A C4 83 6F
|
||||
00E0 | DC 36 30 44 64 90 53 92 FA 6F BA DA B5 E6 84 D4
|
||||
00F0 | 36 16 E0 3B DD F6 8C 23 0A 18 A3 46 42 30 1E A7
|
||||
0100 | AC B0 16 5C 97 B8 8E 08 BE 2B AD C9 5E 75 D4 FC
|
||||
0110 | 2F 54 C9 AB E9 B0 F1 C2 BC 2B BF D9 7A E9 B4 4F
|
||||
0120 | 18 6C 49 8B 3E 69 67 DA C1 E1 E4 AA 5A 8F 38 66</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 = BA0D89B5765534977E7D6EEBBF224D1C234AC288593C343213426CD2208E2249A7E2C5F
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>765534977E7D6EEBBF224D1C234AC288</code></td>
|
||||
<td><code>172F85E71761F3BB2CBDBE712D1EAFE5</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>593C343213426CD2208E2249A7E2C5FA</code></td>
|
||||
<td><code>8817DBE8742077FA5F1C0C1C6FF058BD</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>g_b</td>
|
||||
<td>36, 260</td>
|
||||
<td><code>FE0001002194D68418CD6B3273273D21</code> <code>3311CE848C584B03F8D62F6E3FB26DE6</code> <code>70117CDC0206A7F958236C4D2611A43E</code> <code>554E2DF485794E0F4060164883885012</code> <code>6FD9323BC686575165D1B13E2628F21B</code> <code>9D3697FA8A37890A281FDEDE9BBB8A69</code> <code>D74345124E5775961994DEBC1B51C291</code> <code>0DF142E1C637E1A20C98033D9CD49B24</code> <code>60AF21241AD7864C6BB4605419C99DC3</code> <code>6F78FDED75073CE014619A43D8571C45</code> <code>BDBB79115BF985766E41E3D9590E9B31</code> <code>8A102E3E0D80335B3E6715582E2C85FB</code> <code>183D119833812FCFB2F1629B727D929A</code> <code>B33ABD7CBD91F60AB53AE0ACD06A3DDA</code> <code>B60CCDC243B239466F048E76E733AB09</code> <code>CB488D67B075BB33A9FD2AFEF4DD19D3</code><br> <code>593E0200</code></td>
|
||||
<td><code>FE000100239C05827B2E75E7EA297C4E</code> <code>957EB25C0C4A2DD8BC20E36B17D3AE69</code> <code>943522CF0D09EC0720487AEFA88CCCC6</code> <code>6ADA24887120D3F325E29C0200E63C38</code> <code>872FD9D514981EB2B18287413EB912FE</code> <code>A618766F1805984748BF59FBDB5E35A3</code> <code>5B379960576AAE3B852DBD4D36C34EC9</code> <code>ADC15118CBF4EE83238D7BFEDF4DE0A4</code> <code>08AC74F63273261D4678615D5A5ADF95</code> <code>0D4FF9E2D441119976C79C56BD5343AC</code> <code>6C04697D115A5917AE29488EC9C8F10B</code> <code>7AC4836FDC36304464905392FA6FBADA</code> <code>B5E684D43616E03BDDF68C230A18A346</code> <code>42301EA7ACB0165C97B88E08BE2BADC9</code> <code>5E75D4FC2F54C9ABE9B0F1C2BC2BBFD9</code> <code>7AE9B44F186C498B3E6967DAC1E1E4AA</code><br> <code>5A8F3866</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 = BA0D89B5765534977E7D6EEBBF224D1C234AC288593C343213426CD2208E2249A7E2C5F
|
|||
<!-- 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 = 54B64366765534977E7D6EEBBF224D1C234AC288593C343213426CD2208E2249A7E2C5FA0000000000000000FE0001002194D68418CD6B3273273D213311CE848C584B03F8D62F6E3FB26DE670117CDC0206A7F958236C4D2611A43E554E2DF485794E0F40601648838850126FD9323BC686575165D1B13E2628F21B9D3697FA8A37890A281FDEDE9BBB8A69D74345124E5775961994DEBC1B51C2910DF142E1C637E1A20C98033D9CD49B2460AF21241AD7864C6BB4605419C99DC36F78FDED75073CE014619A43D8571C45BDBB79115BF985766E41E3D9590E9B318A102E3E0D80335B3E6715582E2C85FB183D119833812FCFB2F1629B727D929AB33ABD7CBD91F60AB53AE0ACD06A3DDAB60CCDC243B239466F048E76E733AB09CB488D67B075BB33A9FD2AFEF4DD19D3593E0200
|
||||
padding = AA0DFD317572F5C32CABE4C2
|
||||
tmp_aes_key = 00957C715B8E1E63150F7124A4836143E1E185A67B7558EE95A7C9D6E2ED1674
|
||||
tmp_aes_iv = 12FD28AFDDC00AE7C9C4AB10E46045991452F0301725D23563C0E0135F162B23</code></pre>
|
||||
<pre><code>data = 54B64366172F85E71761F3BB2CBDBE712D1EAFE58817DBE8742077FA5F1C0C1C6FF058BD0000000000000000FE000100239C05827B2E75E7EA297C4E957EB25C0C4A2DD8BC20E36B17D3AE69943522CF0D09EC0720487AEFA88CCCC66ADA24887120D3F325E29C0200E63C38872FD9D514981EB2B18287413EB912FEA618766F1805984748BF59FBDB5E35A35B379960576AAE3B852DBD4D36C34EC9ADC15118CBF4EE83238D7BFEDF4DE0A408AC74F63273261D4678615D5A5ADF950D4FF9E2D441119976C79C56BD5343AC6C04697D115A5917AE29488EC9C8F10B7AC4836FDC36304464905392FA6FBADAB5E684D43616E03BDDF68C230A18A34642301EA7ACB0165C97B88E08BE2BADC95E75D4FC2F54C9ABE9B0F1C2BC2BBFD97AE9B44F186C498B3E6967DAC1E1E4AA5A8F3866
|
||||
padding = F71920395D1DC608B1E457B5
|
||||
tmp_aes_key = 27E43D018B2EF8AF3395B27B19DF173DD09438278E712FB63CDDEBBEAE0CBE6C
|
||||
tmp_aes_iv = EA31E588F2C4D371DD73B81C016BC9B12BDF9B29AB42D106FD2CCED63656DBB3</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 = AFB299B11F6CAA228AC43D729E476482AAD236FAFE1BC6B11B454694BD11C6A4634FD9488C40C148169805B867D35746FB9FB39864906D50FE2035A19C8C90328F8761A4CC85E709889CE0A42E1861D1DAD925A148EC0F57BFDFC909687924D8731E8FA8109DC1BDEE29E67FCEBB865E4A58B9A27D58A56DF8FC9C70CF44BBB6F4D9E55BD1BE629ABEF83A44D18AF6ABCB94D2E521F2808A18047BA6639ABEAE9701C1D5A98EFE53E4131E582D1A041A2222CCDDB62F4446697226C374F15405F4E56FFAA648270E70EEEF18855C59E4E0B16CD85B902EE9AA4E205342385A1357D3B155EE04DE58BAD21A5400E373D56F1F159AF84FEE0AB8B290C913ECA62AF2702D1BE61279FE1170041BA274F854F28C358494B833CDC45E5BD5B75A8196EEA8B3D277A951D25EC45B0D9C83D8E45AEF29F2685B6F40F98A9A8B29FCE84EF4873758B6DF36B1E8E665BC5952086F</code></pre>
|
||||
<pre><code>encrypted_data = 3E0F2FF2F1AD61511CEE9C91A06607A63F2C2AC4D9EB416C9AF137C66E9F0BB8C8ACAFA9D30695842206A873099F3935F812B570669EDAB1775DCA7811F49B41ABABC932ED325C804726BEAAABC52C40A39A97E75171B75CFB13ECF58BED2E14D411EAA7CB098FA49DBA15FFAE05E2E35963BA622862BADE2CB1A1608A5E9ACCF8B02F6FAA4DC092A25051533302B6FF9A3939C0FCD92AB0237A499C9112BA91BF2801C0987F54760BF3422A68C435AE5E75AEC837015A41587EAF32E715A7C767FC19F94AA21444FB3A6BAC1B6B8CD0A9118374C7D96B3A31740655A162777BF6487E160E6C8C0EAD25DA521414BF1A1C002F69C8A5C6BD2557389EB9BC94ED34CD7D6C657D2B1000853746B113C01581E05ED400156C55ED44EF01B19E2137A9B39018403EA767D212284F89E08946C43B80270BDD852FDC41BCDE540F491B03C80AF0BCE8F1905A709CAB8D96B2BA</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 0C 6E 08 00 91 60 1C 65
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 76 55 34 97 7E 7D 6E EB
|
||||
0020 | BF 22 4D 1C 23 4A C2 88 59 3C 34 32 13 42 6C D2
|
||||
0030 | 20 8E 22 49 A7 E2 C5 FA FE 50 01 00 AF B2 99 B1
|
||||
0040 | 1F 6C AA 22 8A C4 3D 72 9E 47 64 82 AA D2 36 FA
|
||||
0050 | FE 1B C6 B1 1B 45 46 94 BD 11 C6 A4 63 4F D9 48
|
||||
0060 | 8C 40 C1 48 16 98 05 B8 67 D3 57 46 FB 9F B3 98
|
||||
0070 | 64 90 6D 50 FE 20 35 A1 9C 8C 90 32 8F 87 61 A4
|
||||
0080 | CC 85 E7 09 88 9C E0 A4 2E 18 61 D1 DA D9 25 A1
|
||||
0090 | 48 EC 0F 57 BF DF C9 09 68 79 24 D8 73 1E 8F A8
|
||||
00A0 | 10 9D C1 BD EE 29 E6 7F CE BB 86 5E 4A 58 B9 A2
|
||||
00B0 | 7D 58 A5 6D F8 FC 9C 70 CF 44 BB B6 F4 D9 E5 5B
|
||||
00C0 | D1 BE 62 9A BE F8 3A 44 D1 8A F6 AB CB 94 D2 E5
|
||||
00D0 | 21 F2 80 8A 18 04 7B A6 63 9A BE AE 97 01 C1 D5
|
||||
00E0 | A9 8E FE 53 E4 13 1E 58 2D 1A 04 1A 22 22 CC DD
|
||||
00F0 | B6 2F 44 46 69 72 26 C3 74 F1 54 05 F4 E5 6F FA
|
||||
0100 | A6 48 27 0E 70 EE EF 18 85 5C 59 E4 E0 B1 6C D8
|
||||
0110 | 5B 90 2E E9 AA 4E 20 53 42 38 5A 13 57 D3 B1 55
|
||||
0120 | EE 04 DE 58 BA D2 1A 54 00 E3 73 D5 6F 1F 15 9A
|
||||
0130 | F8 4F EE 0A B8 B2 90 C9 13 EC A6 2A F2 70 2D 1B
|
||||
0140 | E6 12 79 FE 11 70 04 1B A2 74 F8 54 F2 8C 35 84
|
||||
0150 | 94 B8 33 CD C4 5E 5B D5 B7 5A 81 96 EE A8 B3 D2
|
||||
0160 | 77 A9 51 D2 5E C4 5B 0D 9C 83 D8 E4 5A EF 29 F2
|
||||
0170 | 68 5B 6F 40 F9 8A 9A 8B 29 FC E8 4E F4 87 37 58
|
||||
0180 | B6 DF 36 B1 E8 E6 65 BC 59 52 08 6F</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 08 B2 05 00 7E 62 1C 65
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 17 2F 85 E7 17 61 F3 BB
|
||||
0020 | 2C BD BE 71 2D 1E AF E5 88 17 DB E8 74 20 77 FA
|
||||
0030 | 5F 1C 0C 1C 6F F0 58 BD FE 50 01 00 3E 0F 2F F2
|
||||
0040 | F1 AD 61 51 1C EE 9C 91 A0 66 07 A6 3F 2C 2A C4
|
||||
0050 | D9 EB 41 6C 9A F1 37 C6 6E 9F 0B B8 C8 AC AF A9
|
||||
0060 | D3 06 95 84 22 06 A8 73 09 9F 39 35 F8 12 B5 70
|
||||
0070 | 66 9E DA B1 77 5D CA 78 11 F4 9B 41 AB AB C9 32
|
||||
0080 | ED 32 5C 80 47 26 BE AA AB C5 2C 40 A3 9A 97 E7
|
||||
0090 | 51 71 B7 5C FB 13 EC F5 8B ED 2E 14 D4 11 EA A7
|
||||
00A0 | CB 09 8F A4 9D BA 15 FF AE 05 E2 E3 59 63 BA 62
|
||||
00B0 | 28 62 BA DE 2C B1 A1 60 8A 5E 9A CC F8 B0 2F 6F
|
||||
00C0 | AA 4D C0 92 A2 50 51 53 33 02 B6 FF 9A 39 39 C0
|
||||
00D0 | FC D9 2A B0 23 7A 49 9C 91 12 BA 91 BF 28 01 C0
|
||||
00E0 | 98 7F 54 76 0B F3 42 2A 68 C4 35 AE 5E 75 AE C8
|
||||
00F0 | 37 01 5A 41 58 7E AF 32 E7 15 A7 C7 67 FC 19 F9
|
||||
0100 | 4A A2 14 44 FB 3A 6B AC 1B 6B 8C D0 A9 11 83 74
|
||||
0110 | C7 D9 6B 3A 31 74 06 55 A1 62 77 7B F6 48 7E 16
|
||||
0120 | 0E 6C 8C 0E AD 25 DA 52 14 14 BF 1A 1C 00 2F 69
|
||||
0130 | C8 A5 C6 BD 25 57 38 9E B9 BC 94 ED 34 CD 7D 6C
|
||||
0140 | 65 7D 2B 10 00 85 37 46 B1 13 C0 15 81 E0 5E D4
|
||||
0150 | 00 15 6C 55 ED 44 EF 01 B1 9E 21 37 A9 B3 90 18
|
||||
0160 | 40 3E A7 67 D2 12 28 4F 89 E0 89 46 C4 3B 80 27
|
||||
0170 | 0B DD 85 2F DC 41 BC DE 54 0F 49 1B 03 C8 0A F0
|
||||
0180 | BC E8 F1 90 5A 70 9C AB 8D 96 B2 BA</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>0C6E080091601C65</code></td>
|
||||
<td><code>08B205007E621C65</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>765534977E7D6EEBBF224D1C234AC288</code></td>
|
||||
<td><code>172F85E71761F3BB2CBDBE712D1EAFE5</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>593C343213426CD2208E2249A7E2C5FA</code></td>
|
||||
<td><code>8817DBE8742077FA5F1C0C1C6FF058BD</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>56, 340</td>
|
||||
<td><code>FE500100AFB299B11F6CAA228AC43D72</code> <code>9E476482AAD236FAFE1BC6B11B454694</code> <code>BD11C6A4634FD9488C40C148169805B8</code> <code>67D35746FB9FB39864906D50FE2035A1</code> <code>9C8C90328F8761A4CC85E709889CE0A4</code> <code>2E1861D1DAD925A148EC0F57BFDFC909</code> <code>687924D8731E8FA8109DC1BDEE29E67F</code> <code>CEBB865E4A58B9A27D58A56DF8FC9C70</code> <code>CF44BBB6F4D9E55BD1BE629ABEF83A44</code> <code>D18AF6ABCB94D2E521F2808A18047BA6</code> <code>639ABEAE9701C1D5A98EFE53E4131E58</code> <code>2D1A041A2222CCDDB62F4446697226C3</code> <code>74F15405F4E56FFAA648270E70EEEF18</code> <code>855C59E4E0B16CD85B902EE9AA4E2053</code> <code>42385A1357D3B155EE04DE58BAD21A54</code> <code>00E373D56F1F159AF84FEE0AB8B290C9</code> <code>13ECA62AF2702D1BE61279FE1170041B</code> <code>A274F854F28C358494B833CDC45E5BD5</code> <code>B75A8196EEA8B3D277A951D25EC45B0D</code> <code>9C83D8E45AEF29F2685B6F40F98A9A8B</code> <code>29FCE84EF4873758B6DF36B1E8E665BC</code><br> <code>5952086F</code></td>
|
||||
<td><code>FE5001003E0F2FF2F1AD61511CEE9C91</code> <code>A06607A63F2C2AC4D9EB416C9AF137C6</code> <code>6E9F0BB8C8ACAFA9D30695842206A873</code> <code>099F3935F812B570669EDAB1775DCA78</code> <code>11F49B41ABABC932ED325C804726BEAA</code> <code>ABC52C40A39A97E75171B75CFB13ECF5</code> <code>8BED2E14D411EAA7CB098FA49DBA15FF</code> <code>AE05E2E35963BA622862BADE2CB1A160</code> <code>8A5E9ACCF8B02F6FAA4DC092A2505153</code> <code>3302B6FF9A3939C0FCD92AB0237A499C</code> <code>9112BA91BF2801C0987F54760BF3422A</code> <code>68C435AE5E75AEC837015A41587EAF32</code> <code>E715A7C767FC19F94AA21444FB3A6BAC</code> <code>1B6B8CD0A9118374C7D96B3A31740655</code> <code>A162777BF6487E160E6C8C0EAD25DA52</code> <code>1414BF1A1C002F69C8A5C6BD2557389E</code> <code>B9BC94ED34CD7D6C657D2B1000853746</code> <code>B113C01581E05ED400156C55ED44EF01</code> <code>B19E2137A9B39018403EA767D212284F</code> <code>89E08946C43B80270BDD852FDC41BCDE</code> <code>540F491B03C80AF0BCE8F1905A709CAB</code><br> <code>8D96B2BA</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 = A941A8D95B595167A3FE292EFDFB885DBEAD9716334438E13E6F472A3960617160978AE50F4CFF8ECE62106A3BBDE68BAF9D20D4D40AA9F5E3A21175E60CDE3CB59C2C92C0B9F917B4747F90C81FF83AB7BF2F19F6468806B7071A14B268AD16D5DD8EFB28B51C75C4EC23CE306CF8C4A845C7A4557C66F1D7E3716914D86466E9E49472025574F1A2DC39A5F096A6AA2DACE51699000B07DCEF0AE1D7E1CB98F6D99E1075180AFCD34DA733A8324FFAC52C0FD07BEF7B2389F66CB93E56A3FCEF60B9359FAC4995CA4191A9CACFC925A5811C66DDC33E1E6ACCAA89CD2D66E2E13C6C391BE1A3BCF025D8E786826F642132B6574044CF265024F9285DCF85CE</code></pre>
|
||||
<pre><code>auth_key = 12B3496D5E5E73291DB22E1E140DC8C9D2B569ABA651275EAFAE0E56B5865BC50C5A3456B950816E5705E1CBB079E0EFF02462FEFBC3B681DE961B60FCD1B3539F889CC64B94DA5EE3439BF17CD8623714CAEF251BAE413C25B1733BECB79E9D1A45171F40ED5736A56364728C9F91C701F26A7E2BA4F2522CD4AA5CC4E066744EB7F7BF0DED165B8BE91E2AF6029D4B9298672356DA5BE13F233C2CF4C99CB772AECCE8C9B9E76DA2C55778B7DF0F15DF01125EAAF6C79A465A6B156887D2B4E8CFCA64ACE735729EA480BFD042D5AD5CBE205084B08144F7BC2F4DC51792A387843652EC5BDFE8E4F481A90647D11FA850C37838FBB3D2FA149621415E006C</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 50 64 51 92 60 1C 65
|
||||
0010 | 8C 00 00 00 34 F7 CB 3B 76 55 34 97 7E 7D 6E EB
|
||||
0020 | BF 22 4D 1C 23 4A C2 88 59 3C 34 32 13 42 6C D2
|
||||
0030 | 20 8E 22 49 A7 E2 C5 FA F7 4A 93 E6 31 3F EA 9A
|
||||
0040 | 22 76 BA B6 5C 81 2D F7</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 64 D1 47 7F 62 1C 65
|
||||
0010 | 7C 00 00 00 34 F7 CB 3B 17 2F 85 E7 17 61 F3 BB
|
||||
0020 | 2C BD BE 71 2D 1E AF E5 88 17 DB E8 74 20 77 FA
|
||||
0030 | 5F 1C 0C 1C 6F F0 58 BD FF D0 9D 43 DE EA B2 E7
|
||||
0040 | A4 1B 02 9F 38 2B 10 3A</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>0150645192601C65</code></td>
|
||||
<td><code>0164D1477F621C65</code></td>
|
||||
<td>Message ID generated as specified <a href="/mtproto/description#message-identifier-msg-id">here »</a> (unixtime() << 32) + (N*4)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>message_length</td>
|
||||
<td>16, 4</td>
|
||||
<td><code>8C000000</code> (140 in decimal)</td>
|
||||
<td><code>7C000000</code> (124 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>765534977E7D6EEBBF224D1C234AC288</code></td>
|
||||
<td><code>172F85E71761F3BB2CBDBE712D1EAFE5</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>593C343213426CD2208E2249A7E2C5FA</code></td>
|
||||
<td><code>8817DBE8742077FA5F1C0C1C6FF058BD</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce_hash1</td>
|
||||
<td>56, 16</td>
|
||||
<td><code>F74A93E6313FEA9A2276BAB65C812DF7</code></td>
|
||||
<td><code>FFD09D43DEEAB2E7A41B029F382B103A</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