|
|
|
@ -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 0C 73 0A 00 95 F4 AB 65
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 3C 7C AF 02 B0 8D 8E AE
|
|
|
|
|
0020 | C6 D4 4F DB D8 41 66 85</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 F4 86 0E 00 12 12 AC 65
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 85 11 E6 D3 FF 7B BF B4
|
|
|
|
|
0020 | 57 05 3C E2 C4 78 65 2B</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>0C730A0095F4AB65</code></td>
|
|
|
|
|
<td><code>F4860E001212AC65</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>3C7CAF02B08D8EAEC6D44FDBD8416685</code></td>
|
|
|
|
|
<td><code>8511E6D3FF7BBFB457053CE2C478652B</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 68 CD 2E 95 F4 AB 65
|
|
|
|
|
0010 | 98 00 00 00 63 24 16 05 3C 7C AF 02 B0 8D 8E AE
|
|
|
|
|
0020 | C6 D4 4F DB D8 41 66 85 8F 63 99 8E 6C 71 46 86
|
|
|
|
|
0030 | 13 4A C1 51 57 B0 2F 00 08 24 1C DB E0 68 F4 2A
|
|
|
|
|
0040 | F5 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 8C 02 CF 12 12 AC 65
|
|
|
|
|
0010 | 80 00 00 00 63 24 16 05 85 11 E6 D3 FF 7B BF B4
|
|
|
|
|
0020 | 57 05 3C E2 C4 78 65 2B 68 82 A4 88 2C 65 B8 FC
|
|
|
|
|
0030 | D0 E4 DC 0C DC 8A DC 85 08 30 54 53 24 C8 A8 C7
|
|
|
|
|
0040 | 65 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>0168CD2E95F4AB65</code></td>
|
|
|
|
|
<td><code>018C02CF1212AC65</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>98000000</code> (152 in decimal)</td>
|
|
|
|
|
<td><code>80000000</code> (128 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>3C7CAF02B08D8EAEC6D44FDBD8416685</code></td>
|
|
|
|
|
<td><code>8511E6D3FF7BBFB457053CE2C478652B</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>8F63998E6C714686134AC15157B02F00</code></td>
|
|
|
|
|
<td><code>6882A4882C65B8FCD0E4DC0CDC8ADC85</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>08241CDBE068F42AF5000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2602196441593293557</td>
|
|
|
|
|
<td><code>0830545324C8A8C765000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 3482499829314668389</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 = 2602196441593293557</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2602196441593293557 = 1343787589 * 1936464113</code></p>
|
|
|
|
|
<pre><code>p = 1343787589
|
|
|
|
|
q = 1936464113</code></pre>
|
|
|
|
|
<pre><code>pq = 3482499829314668389</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>3482499829314668389 = 1829631877 * 1903388257</code></p>
|
|
|
|
|
<pre><code>p = 1829631877
|
|
|
|
|
q = 1903388257</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 24 1C DB E0 68 F4 2A F5 00 00 00
|
|
|
|
|
0010 | 04 50 18 92 45 00 00 00 04 73 6C 18 F1 00 00 00
|
|
|
|
|
0020 | 3C 7C AF 02 B0 8D 8E AE C6 D4 4F DB D8 41 66 85
|
|
|
|
|
0030 | 8F 63 99 8E 6C 71 46 86 13 4A C1 51 57 B0 2F 00
|
|
|
|
|
0040 | 2A C2 0E B0 94 E3 79 8F FD 19 B4 CE 69 44 F9 30
|
|
|
|
|
0050 | FE 5D 43 9E 73 D4 77 95 A3 2E 9B 05 05 C5 EA 58
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 30 54 53 24 C8 A8 C7 65 00 00 00
|
|
|
|
|
0010 | 04 6D 0D F7 85 00 00 00 04 71 73 66 61 00 00 00
|
|
|
|
|
0020 | 85 11 E6 D3 FF 7B BF B4 57 05 3C E2 C4 78 65 2B
|
|
|
|
|
0030 | 68 82 A4 88 2C 65 B8 FC D0 E4 DC 0C DC 8A DC 85
|
|
|
|
|
0040 | B7 8C 89 6B 15 CC B4 D6 30 63 CA AD 7E 59 96 04
|
|
|
|
|
0050 | FF 4C 71 9D 6E 71 A3 39 EF 22 B6 2B 75 B8 00 F5
|
|
|
|
|
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 = 1936464113</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>08241CDBE068F42AF5000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2602196441593293557</td>
|
|
|
|
|
<td><code>0830545324C8A8C765000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 3482499829314668389</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>0450189245000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1343787589</td>
|
|
|
|
|
<td><code>046D0DF785000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1829631877</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>04736C18F1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1936464113</td>
|
|
|
|
|
<td><code>0471736661000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1903388257</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>3C7CAF02B08D8EAEC6D44FDBD8416685</code></td>
|
|
|
|
|
<td><code>8511E6D3FF7BBFB457053CE2C478652B</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>8F63998E6C714686134AC15157B02F00</code></td>
|
|
|
|
|
<td><code>6882A4882C65B8FCD0E4DC0CDC8ADC85</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>2AC20EB094E3798FFD19B4CE6944F930</code> <code>FE5D439E73D47795A32E9B0505C5EA58</code></td>
|
|
|
|
|
<td><code>B78C896B15CCB4D63063CAAD7E599604</code> <code>FF4C719D6E71A339EF22B62B75B800F5</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1936464113</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 = 955FF5A908241CDBE068F42AF5000000045018924500000004736C18F10000003C7CAF02B08D8EAEC6D44FDBD84166858F63998E6C714686134AC15157B02F002AC20EB094E3798FFD19B4CE6944F930FE5D439E73D47795A32E9B0505C5EA5802000000
|
|
|
|
|
random_padding_bytes = B9DCC41054C5DA6BDE4B8837F5E323DC4097ED5817E097DAB5C82C62D35202C9530D84CF14847DE3CB2E684367CB238D943235C010053437BBA85CDBBBD6C26463341E98E7E5562516D0549579CFBEB2F2DB13F28CA4F7776CD2B746</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A90830545324C8A8C765000000046D0DF78500000004717366610000008511E6D3FF7BBFB457053CE2C478652B6882A4882C65B8FCD0E4DC0CDC8ADC85B78C896B15CCB4D63063CAAD7E599604FF4C719D6E71A339EF22B62B75B800F502000000
|
|
|
|
|
random_padding_bytes = 85B452C8A8E2231841E09BA5B04CCB1BD08B7A8135E12693EDF57D4EA67B04716079ED1D8C5C6DFFC899D88B4F27FB8DB955C1BF460FCF1C96B8A92B70656319179B2B4DEDF292D9A6C274D037229F2AE7956020D9A0BE4C84327A07</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 = 60C976533F9767CCBFAC3CCAF7A39B10C877E9F3E13BE558AC1979E14486575423A6BC59CB65FD880B76CAA1AC72B124F24F2EEE92246CE7881B0D3DD66700B4CED8037E4A042B5588A78D6D9BA03EDB1BBA65B86EE7EB54C6BBD041620A2A5AC08FEE0EA2888D8C1D3F4A414AE8D62B97CC3165AE85A893F5F74A0DB6E46BF668D79960E715E2A4F331D39F86328D9011ACE0DE74F615137D27EFD79B6BF91C22F3A4FE3C917F5DABA2C222C707022BE8CD974DEAA8252C87703153727BCCA9625E074CF3FC4E9C5C3415C0119ED05C1CBA203F9D1BB513D875A4AC97E273A0F8ECB42DA3A8020E2A65CFF3C4204FC3FB02FC0ACA5E42CB9C73EA83718F80F6</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = AFE23F2C39D79EB16F4E58719FB4BCE2721313590B8508C09C5BE40074DC124EDA179ED092FA389B1F1FE957D069EEE3C4DC3470E6600FA39F85CE6A73BDF27C6147EB481338D7A52AC7777CD3398C2A0A5E9F9B055B96F6175CD49753D00DFD5506C1FAE534D76FD882EAA5FAFD948D0F9B147DB87EF08AE5B54B808E47701B52963689074515B6889CD7FB3D401ED6CD078EB80373D37C11BAD4B1A227A04224A121669406DEEA919C115392F78C83B1B006D53DFE5308F69BF537BC9AC75C849187E009E5BD80BB5282264D0DFACC223D587BB5F4F2FE4A53C6FC20E1367BCA16ECAAD723F631133E18BDBA05FB52E0CF19C8FE660AEB1F0B9E78BAB0AA70</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 90 E9 0D 00 95 F4 AB 65
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 3C 7C AF 02 B0 8D 8E AE
|
|
|
|
|
0020 | C6 D4 4F DB D8 41 66 85 8F 63 99 8E 6C 71 46 86
|
|
|
|
|
0030 | 13 4A C1 51 57 B0 2F 00 04 50 18 92 45 00 00 00
|
|
|
|
|
0040 | 04 73 6C 18 F1 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 60 C9 76 53 3F 97 67 CC BF AC 3C CA
|
|
|
|
|
0060 | F7 A3 9B 10 C8 77 E9 F3 E1 3B E5 58 AC 19 79 E1
|
|
|
|
|
0070 | 44 86 57 54 23 A6 BC 59 CB 65 FD 88 0B 76 CA A1
|
|
|
|
|
0080 | AC 72 B1 24 F2 4F 2E EE 92 24 6C E7 88 1B 0D 3D
|
|
|
|
|
0090 | D6 67 00 B4 CE D8 03 7E 4A 04 2B 55 88 A7 8D 6D
|
|
|
|
|
00A0 | 9B A0 3E DB 1B BA 65 B8 6E E7 EB 54 C6 BB D0 41
|
|
|
|
|
00B0 | 62 0A 2A 5A C0 8F EE 0E A2 88 8D 8C 1D 3F 4A 41
|
|
|
|
|
00C0 | 4A E8 D6 2B 97 CC 31 65 AE 85 A8 93 F5 F7 4A 0D
|
|
|
|
|
00D0 | B6 E4 6B F6 68 D7 99 60 E7 15 E2 A4 F3 31 D3 9F
|
|
|
|
|
00E0 | 86 32 8D 90 11 AC E0 DE 74 F6 15 13 7D 27 EF D7
|
|
|
|
|
00F0 | 9B 6B F9 1C 22 F3 A4 FE 3C 91 7F 5D AB A2 C2 22
|
|
|
|
|
0100 | C7 07 02 2B E8 CD 97 4D EA A8 25 2C 87 70 31 53
|
|
|
|
|
0110 | 72 7B CC A9 62 5E 07 4C F3 FC 4E 9C 5C 34 15 C0
|
|
|
|
|
0120 | 11 9E D0 5C 1C BA 20 3F 9D 1B B5 13 D8 75 A4 AC
|
|
|
|
|
0130 | 97 E2 73 A0 F8 EC B4 2D A3 A8 02 0E 2A 65 CF F3
|
|
|
|
|
0140 | C4 20 4F C3 FB 02 FC 0A CA 5E 42 CB 9C 73 EA 83
|
|
|
|
|
0150 | 71 8F 80 F6</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 6C B6 0E 00 12 12 AC 65
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 85 11 E6 D3 FF 7B BF B4
|
|
|
|
|
0020 | 57 05 3C E2 C4 78 65 2B 68 82 A4 88 2C 65 B8 FC
|
|
|
|
|
0030 | D0 E4 DC 0C DC 8A DC 85 04 6D 0D F7 85 00 00 00
|
|
|
|
|
0040 | 04 71 73 66 61 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 AF E2 3F 2C 39 D7 9E B1 6F 4E 58 71
|
|
|
|
|
0060 | 9F B4 BC E2 72 13 13 59 0B 85 08 C0 9C 5B E4 00
|
|
|
|
|
0070 | 74 DC 12 4E DA 17 9E D0 92 FA 38 9B 1F 1F E9 57
|
|
|
|
|
0080 | D0 69 EE E3 C4 DC 34 70 E6 60 0F A3 9F 85 CE 6A
|
|
|
|
|
0090 | 73 BD F2 7C 61 47 EB 48 13 38 D7 A5 2A C7 77 7C
|
|
|
|
|
00A0 | D3 39 8C 2A 0A 5E 9F 9B 05 5B 96 F6 17 5C D4 97
|
|
|
|
|
00B0 | 53 D0 0D FD 55 06 C1 FA E5 34 D7 6F D8 82 EA A5
|
|
|
|
|
00C0 | FA FD 94 8D 0F 9B 14 7D B8 7E F0 8A E5 B5 4B 80
|
|
|
|
|
00D0 | 8E 47 70 1B 52 96 36 89 07 45 15 B6 88 9C D7 FB
|
|
|
|
|
00E0 | 3D 40 1E D6 CD 07 8E B8 03 73 D3 7C 11 BA D4 B1
|
|
|
|
|
00F0 | A2 27 A0 42 24 A1 21 66 94 06 DE EA 91 9C 11 53
|
|
|
|
|
0100 | 92 F7 8C 83 B1 B0 06 D5 3D FE 53 08 F6 9B F5 37
|
|
|
|
|
0110 | BC 9A C7 5C 84 91 87 E0 09 E5 BD 80 BB 52 82 26
|
|
|
|
|
0120 | 4D 0D FA CC 22 3D 58 7B B5 F4 F2 FE 4A 53 C6 FC
|
|
|
|
|
0130 | 20 E1 36 7B CA 16 EC AA D7 23 F6 31 13 3E 18 BD
|
|
|
|
|
0140 | BA 05 FB 52 E0 CF 19 C8 FE 66 0A EB 1F 0B 9E 78
|
|
|
|
|
0150 | BA B0 AA 70</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 = B9DCC41054C5DA6BDE4B8837F5E323DC4097ED5817E097DAB5C82C62D
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>90E90D0095F4AB65</code></td>
|
|
|
|
|
<td><code>6CB60E001212AC65</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 = B9DCC41054C5DA6BDE4B8837F5E323DC4097ED5817E097DAB5C82C62D
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>3C7CAF02B08D8EAEC6D44FDBD8416685</code></td>
|
|
|
|
|
<td><code>8511E6D3FF7BBFB457053CE2C478652B</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>8F63998E6C714686134AC15157B02F00</code></td>
|
|
|
|
|
<td><code>6882A4882C65B8FCD0E4DC0CDC8ADC85</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>0450189245000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1343787589</td>
|
|
|
|
|
<td><code>046D0DF785000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1829631877</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>04736C18F1000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1936464113</td>
|
|
|
|
|
<td><code>0471736661000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1903388257</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 = B9DCC41054C5DA6BDE4B8837F5E323DC4097ED5817E097DAB5C82C62D
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE00010060C976533F9767CCBFAC3CCA</code> <code>F7A39B10C877E9F3E13BE558AC1979E1</code> <code>4486575423A6BC59CB65FD880B76CAA1</code> <code>AC72B124F24F2EEE92246CE7881B0D3D</code> <code>D66700B4CED8037E4A042B5588A78D6D</code> <code>9BA03EDB1BBA65B86EE7EB54C6BBD041</code> <code>620A2A5AC08FEE0EA2888D8C1D3F4A41</code> <code>4AE8D62B97CC3165AE85A893F5F74A0D</code> <code>B6E46BF668D79960E715E2A4F331D39F</code> <code>86328D9011ACE0DE74F615137D27EFD7</code> <code>9B6BF91C22F3A4FE3C917F5DABA2C222</code> <code>C707022BE8CD974DEAA8252C87703153</code> <code>727BCCA9625E074CF3FC4E9C5C3415C0</code> <code>119ED05C1CBA203F9D1BB513D875A4AC</code> <code>97E273A0F8ECB42DA3A8020E2A65CFF3</code> <code>C4204FC3FB02FC0ACA5E42CB9C73EA83</code><br> <code>718F80F6</code></td>
|
|
|
|
|
<td><code>FE000100AFE23F2C39D79EB16F4E5871</code> <code>9FB4BCE2721313590B8508C09C5BE400</code> <code>74DC124EDA179ED092FA389B1F1FE957</code> <code>D069EEE3C4DC3470E6600FA39F85CE6A</code> <code>73BDF27C6147EB481338D7A52AC7777C</code> <code>D3398C2A0A5E9F9B055B96F6175CD497</code> <code>53D00DFD5506C1FAE534D76FD882EAA5</code> <code>FAFD948D0F9B147DB87EF08AE5B54B80</code> <code>8E47701B52963689074515B6889CD7FB</code> <code>3D401ED6CD078EB80373D37C11BAD4B1</code> <code>A227A04224A121669406DEEA919C1153</code> <code>92F78C83B1B006D53DFE5308F69BF537</code> <code>BC9AC75C849187E009E5BD80BB528226</code> <code>4D0DFACC223D587BB5F4F2FE4A53C6FC</code> <code>20E1367BCA16ECAAD723F631133E18BD</code> <code>BA05FB52E0CF19C8FE660AEB1F0B9E78</code><br> <code>BAB0AA70</code></td>
|
|
|
|
|
<td>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = B9DCC41054C5DA6BDE4B8837F5E323DC4097ED5817E097DAB5C82C62D
|
|
|
|
|
<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 F4 56 BC 95 F4 AB 65
|
|
|
|
|
0010 | B8 02 00 00 5C 07 E8 D0 3C 7C AF 02 B0 8D 8E AE
|
|
|
|
|
0020 | C6 D4 4F DB D8 41 66 85 8F 63 99 8E 6C 71 46 86
|
|
|
|
|
0030 | 13 4A C1 51 57 B0 2F 00 FE 50 02 00 DE C1 51 B7
|
|
|
|
|
0040 | 88 15 4C 83 49 EF 67 5A BE 72 72 02 D8 9C 56 BD
|
|
|
|
|
0050 | 8C C5 48 25 2A 23 0D 3B 32 0D CC 07 EF 91 C3 86
|
|
|
|
|
0060 | 84 5A AF A0 1D F6 E4 85 D3 4D A0 4C F4 7A 93 B5
|
|
|
|
|
0070 | 31 2A 04 73 56 5C DB 4E 32 3D 3D A7 B6 3E 86 D0
|
|
|
|
|
0080 | 31 24 99 20 51 0F ED 6B 88 38 FC 23 20 53 7B 9A
|
|
|
|
|
0090 | 9C AF 24 8D 07 C7 95 9D 85 24 BA D5 41 24 F6 E8
|
|
|
|
|
00A0 | 99 D2 36 00 82 84 0D 8E 53 D3 C9 74 44 CB 6B 1D
|
|
|
|
|
00B0 | 1E B0 B2 D8 E5 C5 0F E9 E4 7E A9 EF 1B 9A 50 BC
|
|
|
|
|
00C0 | 4C 46 EB 6F 66 B5 EA 4B 3A 27 0A A5 D5 4E 73 47
|
|
|
|
|
00D0 | 89 1E C3 84 FB 5E 06 AD BB 7B 02 B2 A4 DC 84 84
|
|
|
|
|
00E0 | 79 00 4E A3 73 47 28 F5 A1 96 3A 18 BA AE D6 5A
|
|
|
|
|
00F0 | 6C 6B 5A 05 41 1F 32 40 C3 F9 B0 6E CC 13 2D F2
|
|
|
|
|
0100 | E1 9B 86 B0 2A 99 33 1A 9E 7B FB 42 C8 DB E4 65
|
|
|
|
|
0110 | 63 1A 7B 18 EF CD 34 0A 8A 7C 66 58 C8 60 FB A9
|
|
|
|
|
0120 | DB 9A 78 F2 62 14 A6 67 BE 08 5E 61 8F F9 AE F6
|
|
|
|
|
0130 | 23 BA 7D 62 A9 BA C8 B0 53 5C B3 FF AC FC A2 FD
|
|
|
|
|
0140 | DD FF 46 C9 C2 F3 B0 81 95 B1 1A AF 48 46 0A 60
|
|
|
|
|
0150 | 32 CF A2 B2 5E F1 1E 38 7D 99 69 8E 38 C2 A9 A9
|
|
|
|
|
0160 | 1F 6F 4D 5A 6A ED B0 DE 77 35 DD 96 90 FE 18 45
|
|
|
|
|
0170 | FA EF 5F 22 7F 5C 6F E4 D2 21 B6 00 FB 2E FA 9E
|
|
|
|
|
0180 | 26 2D 5E 40 C5 9C 62 5F 3C CF A6 F8 87 85 3C F9
|
|
|
|
|
0190 | D3 C0 53 94 9D 96 9A 58 7E 65 F0 89 64 97 3F 2A
|
|
|
|
|
01A0 | D4 6B A5 81 1C 17 62 E5 BC 04 D4 BB CB 64 FD DC
|
|
|
|
|
01B0 | 64 90 DF FF D4 E1 27 C0 75 6E A8 90 00 61 C0 FC
|
|
|
|
|
01C0 | 80 E7 1D 79 39 E9 F2 2D B8 0D 3F 1E C7 CD F5 8A
|
|
|
|
|
01D0 | AC F9 C7 C3 95 56 55 D6 A5 B7 D3 5F BC F5 C3 B5
|
|
|
|
|
01E0 | BE CC 79 88 AA 6B BD D6 55 2D D0 84 2E 83 62 58
|
|
|
|
|
01F0 | 09 92 F1 8E 0B F0 77 1E 99 74 52 C8 85 08 D7 E3
|
|
|
|
|
0200 | B7 76 9F 7A 7D 1C C1 CC 71 4B 57 0B 57 8E 97 BD
|
|
|
|
|
0210 | 9B F2 05 29 6B 3E 45 19 94 10 74 7A 5A DA 36 46
|
|
|
|
|
0220 | 75 76 13 62 7A 42 02 93 54 17 B5 E9 A2 91 09 BD
|
|
|
|
|
0230 | B0 D5 62 6A 6F 78 60 25 EF DA 11 2F 37 01 0E CB
|
|
|
|
|
0240 | A4 0C 20 84 EA AC D6 24 97 D2 EC EB 5D F7 58 C8
|
|
|
|
|
0250 | 7E A9 99 78 6F 39 E8 A5 1D 17 84 3A B0 B3 3E 1E
|
|
|
|
|
0260 | 2F 3D B1 53 C6 70 E4 4B C1 56 15 21 5B 1F 23 74
|
|
|
|
|
0270 | 61 EC 94 AB 48 93 30 F6 44 3F 93 A0 81 15 11 A2
|
|
|
|
|
0280 | C9 88 9F 1D 00 CC 7B 0C 91 5A D7 B2</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 34 67 89 13 12 AC 65
|
|
|
|
|
0010 | A8 02 00 00 5C 07 E8 D0 85 11 E6 D3 FF 7B BF B4
|
|
|
|
|
0020 | 57 05 3C E2 C4 78 65 2B 68 82 A4 88 2C 65 B8 FC
|
|
|
|
|
0030 | D0 E4 DC 0C DC 8A DC 85 FE 50 02 00 83 08 4B FF
|
|
|
|
|
0040 | 48 E9 DB 4F 59 18 FB E4 44 3E C8 E3 5B 7A 8F FB
|
|
|
|
|
0050 | 85 60 65 FB 00 41 AE FB 97 CF FE 97 03 80 EB 36
|
|
|
|
|
0060 | 96 C0 F9 47 7D C9 7C 64 3E 13 C5 59 59 45 5F 4B
|
|
|
|
|
0070 | 6B 1D 4A 5D 72 9A 1A C7 A8 F0 D8 CA F6 C6 15 3A
|
|
|
|
|
0080 | 45 FA B5 3A 9F 4F 4C 6B E2 F2 11 B0 53 79 7F 6A
|
|
|
|
|
0090 | 6D 1C 34 81 8F 83 98 5B 26 8D 82 F5 4A 51 80 05
|
|
|
|
|
00A0 | 45 BC 81 3D AA 31 32 B5 13 82 FB 0A F7 78 E1 63
|
|
|
|
|
00B0 | 67 06 06 8A 29 98 EB 8E 4E 42 12 B0 6C 63 09 F1
|
|
|
|
|
00C0 | 5E ED 4E AD 8A 18 A1 4F 3B B5 94 CE 16 2D C7 E9
|
|
|
|
|
00D0 | 46 36 C0 91 7F ED 6B E8 A2 7F 2B 1E DD 75 2F 21
|
|
|
|
|
00E0 | 80 1C 2A 48 D8 03 10 FC A2 94 5C C4 D6 24 92 57
|
|
|
|
|
00F0 | F7 5E 0D 85 92 71 A7 C5 CC 46 C5 4C DD CF AD 07
|
|
|
|
|
0100 | 6A 29 4A 00 80 85 8B B5 6F 85 5B 99 27 DC 01 46
|
|
|
|
|
0110 | 1D 91 2A 0D 6E 78 6A 84 52 F0 63 A3 42 A2 94 36
|
|
|
|
|
0120 | 6F 38 A9 97 7D 99 37 7B 48 C8 CF 08 68 BD 10 D5
|
|
|
|
|
0130 | CB AB DB CA B4 51 36 C3 6C F8 DE 59 CF 05 F3 D6
|
|
|
|
|
0140 | AB 2F 96 09 D6 56 92 CB 19 B6 95 7D C8 C9 CB EF
|
|
|
|
|
0150 | 54 9B F7 72 BB 32 42 F9 9C 07 75 72 49 E1 40 0F
|
|
|
|
|
0160 | D2 78 70 56 C5 5A 17 C4 2A C6 CD B7 EE 8B 1F AB
|
|
|
|
|
0170 | 64 70 8E 53 EC FA 9E BC AD 7F BA 09 81 7A 1E E7
|
|
|
|
|
0180 | F9 4C 0F 6A 65 9C DE 70 95 B0 7A 82 BC CF 6E 8E
|
|
|
|
|
0190 | 43 D9 76 2D 1F 01 CA 8A 60 CB 10 BC 22 24 F0 A9
|
|
|
|
|
01A0 | FF F5 FF E2 F3 52 80 2B 58 AC 5E F8 15 96 03 E8
|
|
|
|
|
01B0 | 9A 20 E8 A6 76 AE D4 25 03 35 00 C7 CF 1B AF B1
|
|
|
|
|
01C0 | AD 99 A1 FE 0E 2A 9E 54 B1 C3 A9 5A 90 F4 4E 06
|
|
|
|
|
01D0 | 20 93 06 36 CC 45 85 D1 A3 37 22 21 06 4D 14 0A
|
|
|
|
|
01E0 | F3 C1 A0 28 4E BF 4A CB D9 0B FC 98 AA C2 7F 9F
|
|
|
|
|
01F0 | B8 C6 4E FC C2 93 B2 54 D5 18 DE 7E 6B E8 6F 0C
|
|
|
|
|
0200 | BB FA 8A A7 A9 92 19 91 7B 6B DC A9 84 E9 CF FF
|
|
|
|
|
0210 | BD 16 58 6E 80 B4 EC 55 C0 97 99 EF D4 78 8B D2
|
|
|
|
|
0220 | 74 5A 6C C5 93 0F BB 86 61 7A A8 A2 5A E6 F6 DB
|
|
|
|
|
0230 | 5E AC 78 73 7A AB 27 B6 1D 4E 6C D4 5F 6B 31 8F
|
|
|
|
|
0240 | 52 10 84 84 7F 41 57 DD 68 A8 12 DE 08 B9 48 58
|
|
|
|
|
0250 | 3F E7 14 34 E8 C0 6B EC D7 7A 1C 03 31 D9 23 C0
|
|
|
|
|
0260 | 44 B0 E8 4C C9 48 58 B4 41 CE DC C6 D3 D1 51 B8
|
|
|
|
|
0270 | 8D B0 F0 5D C3 DA E9 56 32 00 7E D9 C2 7A ED 03
|
|
|
|
|
0280 | C4 17 7E 89 E3 85 EF 25 B2 73 69 E5</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 = B9DCC41054C5DA6BDE4B8837F5E323DC4097ED5817E097DAB5C82C62D
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>01F456BC95F4AB65</code></td>
|
|
|
|
|
<td><code>013467891312AC65</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>B8020000</code> (696 in decimal)</td>
|
|
|
|
|
<td><code>A8020000</code> (680 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -482,19 +482,19 @@ random_padding_bytes = B9DCC41054C5DA6BDE4B8837F5E323DC4097ED5817E097DAB5C82C62D
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>3C7CAF02B08D8EAEC6D44FDBD8416685</code></td>
|
|
|
|
|
<td><code>8511E6D3FF7BBFB457053CE2C478652B</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>8F63998E6C714686134AC15157B02F00</code></td>
|
|
|
|
|
<td><code>6882A4882C65B8FCD0E4DC0CDC8ADC85</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE500200DEC151B788154C8349EF675A</code> <code>BE727202D89C56BD8CC548252A230D3B</code> <code>320DCC07EF91C386845AAFA01DF6E485</code> <code>D34DA04CF47A93B5312A0473565CDB4E</code> <code>323D3DA7B63E86D031249920510FED6B</code> <code>8838FC2320537B9A9CAF248D07C7959D</code> <code>8524BAD54124F6E899D2360082840D8E</code> <code>53D3C97444CB6B1D1EB0B2D8E5C50FE9</code> <code>E47EA9EF1B9A50BC4C46EB6F66B5EA4B</code> <code>3A270AA5D54E7347891EC384FB5E06AD</code> <code>BB7B02B2A4DC848479004EA3734728F5</code> <code>A1963A18BAAED65A6C6B5A05411F3240</code> <code>C3F9B06ECC132DF2E19B86B02A99331A</code> <code>9E7BFB42C8DBE465631A7B18EFCD340A</code> <code>8A7C6658C860FBA9DB9A78F26214A667</code> <code>BE085E618FF9AEF623BA7D62A9BAC8B0</code> <code>535CB3FFACFCA2FDDDFF46C9C2F3B081</code> <code>95B11AAF48460A6032CFA2B25EF11E38</code> <code>7D99698E38C2A9A91F6F4D5A6AEDB0DE</code> <code>7735DD9690FE1845FAEF5F227F5C6FE4</code> <code>D221B600FB2EFA9E262D5E40C59C625F</code> <code>3CCFA6F887853CF9D3C053949D969A58</code> <code>7E65F08964973F2AD46BA5811C1762E5</code> <code>BC04D4BBCB64FDDC6490DFFFD4E127C0</code> <code>756EA8900061C0FC80E71D7939E9F22D</code> <code>B80D3F1EC7CDF58AACF9C7C3955655D6</code> <code>A5B7D35FBCF5C3B5BECC7988AA6BBDD6</code> <code>552DD0842E8362580992F18E0BF0771E</code> <code>997452C88508D7E3B7769F7A7D1CC1CC</code> <code>714B570B578E97BD9BF205296B3E4519</code> <code>9410747A5ADA3646757613627A420293</code> <code>5417B5E9A29109BDB0D5626A6F786025</code> <code>EFDA112F37010ECBA40C2084EAACD624</code> <code>97D2ECEB5DF758C87EA999786F39E8A5</code> <code>1D17843AB0B33E1E2F3DB153C670E44B</code> <code>C15615215B1F237461EC94AB489330F6</code> <code>443F93A0811511A2C9889F1D00CC7B0C</code><br> <code>915AD7B2</code></td>
|
|
|
|
|
<td><code>FE50020083084BFF48E9DB4F5918FBE4</code> <code>443EC8E35B7A8FFB856065FB0041AEFB</code> <code>97CFFE970380EB3696C0F9477DC97C64</code> <code>3E13C55959455F4B6B1D4A5D729A1AC7</code> <code>A8F0D8CAF6C6153A45FAB53A9F4F4C6B</code> <code>E2F211B053797F6A6D1C34818F83985B</code> <code>268D82F54A51800545BC813DAA3132B5</code> <code>1382FB0AF778E1636706068A2998EB8E</code> <code>4E4212B06C6309F15EED4EAD8A18A14F</code> <code>3BB594CE162DC7E94636C0917FED6BE8</code> <code>A27F2B1EDD752F21801C2A48D80310FC</code> <code>A2945CC4D6249257F75E0D859271A7C5</code> <code>CC46C54CDDCFAD076A294A0080858BB5</code> <code>6F855B9927DC01461D912A0D6E786A84</code> <code>52F063A342A294366F38A9977D99377B</code> <code>48C8CF0868BD10D5CBABDBCAB45136C3</code> <code>6CF8DE59CF05F3D6AB2F9609D65692CB</code> <code>19B6957DC8C9CBEF549BF772BB3242F9</code> <code>9C07757249E1400FD2787056C55A17C4</code> <code>2AC6CDB7EE8B1FAB64708E53ECFA9EBC</code> <code>AD7FBA09817A1EE7F94C0F6A659CDE70</code> <code>95B07A82BCCF6E8E43D9762D1F01CA8A</code> <code>60CB10BC2224F0A9FFF5FFE2F352802B</code> <code>58AC5EF8159603E89A20E8A676AED425</code> <code>033500C7CF1BAFB1AD99A1FE0E2A9E54</code> <code>B1C3A95A90F44E0620930636CC4585D1</code> <code>A3372221064D140AF3C1A0284EBF4ACB</code> <code>D90BFC98AAC27F9FB8C64EFCC293B254</code> <code>D518DE7E6BE86F0CBBFA8AA7A9921991</code> <code>7B6BDCA984E9CFFFBD16586E80B4EC55</code> <code>C09799EFD4788BD2745A6CC5930FBB86</code> <code>617AA8A25AE6F6DB5EAC78737AAB27B6</code> <code>1D4E6CD45F6B318F521084847F4157DD</code> <code>68A812DE08B948583FE71434E8C06BEC</code> <code>D77A1C0331D923C044B0E84CC94858B4</code> <code>41CEDCC6D3D151B88DB0F05DC3DAE956</code> <code>32007ED9C27AED03C4177E89E385EF25</code><br> <code>B27369E5</code></td>
|
|
|
|
|
<td>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = B9DCC41054C5DA6BDE4B8837F5E323DC4097ED5817E097DAB5C82C62D
|
|
|
|
|
<!-- 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 = DEC151B788154C8349EF675ABE727202D89C56BD8CC548252A230D3B320DCC07EF91C386845AAFA01DF6E485D34DA04CF47A93B5312A0473565CDB4E323D3DA7B63E86D031249920510FED6B8838FC2320537B9A9CAF248D07C7959D8524BAD54124F6E899D2360082840D8E53D3C97444CB6B1D1EB0B2D8E5C50FE9E47EA9EF1B9A50BC4C46EB6F66B5EA4B3A270AA5D54E7347891EC384FB5E06ADBB7B02B2A4DC848479004EA3734728F5A1963A18BAAED65A6C6B5A05411F3240C3F9B06ECC132DF2E19B86B02A99331A9E7BFB42C8DBE465631A7B18EFCD340A8A7C6658C860FBA9DB9A78F26214A667BE085E618FF9AEF623BA7D62A9BAC8B0535CB3FFACFCA2FDDDFF46C9C2F3B08195B11AAF48460A6032CFA2B25EF11E387D99698E38C2A9A91F6F4D5A6AEDB0DE7735DD9690FE1845FAEF5F227F5C6FE4D221B600FB2EFA9E262D5E40C59C625F3CCFA6F887853CF9D3C053949D969A587E65F08964973F2AD46BA5811C1762E5BC04D4BBCB64FDDC6490DFFFD4E127C0756EA8900061C0FC80E71D7939E9F22DB80D3F1EC7CDF58AACF9C7C3955655D6A5B7D35FBCF5C3B5BECC7988AA6BBDD6552DD0842E8362580992F18E0BF0771E997452C88508D7E3B7769F7A7D1CC1CC714B570B578E97BD9BF205296B3E45199410747A5ADA3646757613627A4202935417B5E9A29109BDB0D5626A6F786025EFDA112F37010ECBA40C2084EAACD62497D2ECEB5DF758C87EA999786F39E8A51D17843AB0B33E1E2F3DB153C670E44BC15615215B1F237461EC94AB489330F6443F93A0811511A2C9889F1D00CC7B0C915AD7B2
|
|
|
|
|
tmp_aes_key = 0A7E80F0AD7CF0445C6C627DD6FE5F83030ECAECD2C31CB65EFE28A434F45714
|
|
|
|
|
tmp_aes_iv = 4F1897AF4531CD9257239CF77B1A78A6035DE20EA41CAFCCC59EF8F02AC20EB0</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = 83084BFF48E9DB4F5918FBE4443EC8E35B7A8FFB856065FB0041AEFB97CFFE970380EB3696C0F9477DC97C643E13C55959455F4B6B1D4A5D729A1AC7A8F0D8CAF6C6153A45FAB53A9F4F4C6BE2F211B053797F6A6D1C34818F83985B268D82F54A51800545BC813DAA3132B51382FB0AF778E1636706068A2998EB8E4E4212B06C6309F15EED4EAD8A18A14F3BB594CE162DC7E94636C0917FED6BE8A27F2B1EDD752F21801C2A48D80310FCA2945CC4D6249257F75E0D859271A7C5CC46C54CDDCFAD076A294A0080858BB56F855B9927DC01461D912A0D6E786A8452F063A342A294366F38A9977D99377B48C8CF0868BD10D5CBABDBCAB45136C36CF8DE59CF05F3D6AB2F9609D65692CB19B6957DC8C9CBEF549BF772BB3242F99C07757249E1400FD2787056C55A17C42AC6CDB7EE8B1FAB64708E53ECFA9EBCAD7FBA09817A1EE7F94C0F6A659CDE7095B07A82BCCF6E8E43D9762D1F01CA8A60CB10BC2224F0A9FFF5FFE2F352802B58AC5EF8159603E89A20E8A676AED425033500C7CF1BAFB1AD99A1FE0E2A9E54B1C3A95A90F44E0620930636CC4585D1A3372221064D140AF3C1A0284EBF4ACBD90BFC98AAC27F9FB8C64EFCC293B254D518DE7E6BE86F0CBBFA8AA7A99219917B6BDCA984E9CFFFBD16586E80B4EC55C09799EFD4788BD2745A6CC5930FBB86617AA8A25AE6F6DB5EAC78737AAB27B61D4E6CD45F6B318F521084847F4157DD68A812DE08B948583FE71434E8C06BECD77A1C0331D923C044B0E84CC94858B441CEDCC6D3D151B88DB0F05DC3DAE95632007ED9C27AED03C4177E89E385EF25B27369E5
|
|
|
|
|
tmp_aes_key = 81DA5DD974446677CB4862CD420017D29094F1ACAF3313E41573AC6E882A1307
|
|
|
|
|
tmp_aes_iv = 62D8149AA82CF10237A48FA917744B3D7BB50E18B131BB77C4792581B78C896B</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = 053F417EC8F14644B5DC6577466D189843B2FCEBBA0D89B53C7CAF02B08D8EAEC6D44FDBD84166858F63998E6C714686134AC15157B02F0003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100471F7DE634C283284C9FF31ADCB995AF46D25E966CF69C088C2F3EFB212D366C0699136898D36BFEF7E49BFFBA5F9BC7AA852A9B74573FA2A851E7EC87672390F7DCDE802389080185119821698841942599F846FCE417DEF992045FB540FD74A8D3241D89BA4C842948143452949277944F238BBC917D7E421962343801CD6111C09B32A7692492AC2A9CCFD41476F032F0B701B400C3FFD601EC5637DB56B6FE6585DF5ADC895E65668F50D062F6CD65EACBB5AE33D3057F11AA223FD63B484BA95A24B463CC5D2DD63AC1AC667AEFA5F0AF241D086A823BA34B0C2ABCF24104AB142F37DA197098A1007DF24EDDF4CF1DC341AB51B304B1732A390BECE4EA95F4AB6585F6D8E71077A732
|
|
|
|
|
answer = BA0D89B53C7CAF02B08D8EAEC6D44FDBD84166858F63998E6C714686134AC15157B02F0003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100471F7DE634C283284C9FF31ADCB995AF46D25E966CF69C088C2F3EFB212D366C0699136898D36BFEF7E49BFFBA5F9BC7AA852A9B74573FA2A851E7EC87672390F7DCDE802389080185119821698841942599F846FCE417DEF992045FB540FD74A8D3241D89BA4C842948143452949277944F238BBC917D7E421962343801CD6111C09B32A7692492AC2A9CCFD41476F032F0B701B400C3FFD601EC5637DB56B6FE6585DF5ADC895E65668F50D062F6CD65EACBB5AE33D3057F11AA223FD63B484BA95A24B463CC5D2DD63AC1AC667AEFA5F0AF241D086A823BA34B0C2ABCF24104AB142F37DA197098A1007DF24EDDF4CF1DC341AB51B304B1732A390BECE4EA95F4AB6585F6D8E71077A732</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = 815D069AF1EA8A9D6F77D128869282DE4C0ED94EBA0D89B58511E6D3FF7BBFB457053CE2C478652B6882A4882C65B8FCD0E4DC0CDC8ADC8503000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100ADBD5AA15A02DD1BABC572752AEB577ED92036FFC5249D2B510042B9D4AC1FFBD73C1B0E52A6242F4D5863A4397BDAEB9223FDBBB9057F3D656D419E3EC704117E49D486AED9DC0FF27CF2668204324809B1034FF4087C19E7CC429491887B9D802F3B69410ACB13B193BD510AF253ACC61E5C3985D781D654EAB39AE12552D2C025988610AB42251977CF0DAFE62778CCBC29D480E2A13F27E8ACDDAAB6407ADCF2C2997B6C15DE77DB85BDC8FCE81EF67213717F70E64A407CB661E4068501EEBE46CB24FF1C3F9C03EE7E5CDB6F84F1A6E396FB3ABD12A08BD74B9E85A8D16390BD9E68B6458B9589B07CB3646157D51C5659D999F48A8672A2B554834BC61312AC657C987C2F1D39C613
|
|
|
|
|
answer = BA0D89B58511E6D3FF7BBFB457053CE2C478652B6882A4882C65B8FCD0E4DC0CDC8ADC8503000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100ADBD5AA15A02DD1BABC572752AEB577ED92036FFC5249D2B510042B9D4AC1FFBD73C1B0E52A6242F4D5863A4397BDAEB9223FDBBB9057F3D656D419E3EC704117E49D486AED9DC0FF27CF2668204324809B1034FF4087C19E7CC429491887B9D802F3B69410ACB13B193BD510AF253ACC61E5C3985D781D654EAB39AE12552D2C025988610AB42251977CF0DAFE62778CCBC29D480E2A13F27E8ACDDAAB6407ADCF2C2997B6C15DE77DB85BDC8FCE81EF67213717F70E64A407CB661E4068501EEBE46CB24FF1C3F9C03EE7E5CDB6F84F1A6E396FB3ABD12A08BD74B9E85A8D16390BD9E68B6458B9589B07CB3646157D51C5659D999F48A8672A2B554834BC61312AC657C987C2F1D39C613</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 3C 7C AF 02 B0 8D 8E AE C6 D4 4F DB
|
|
|
|
|
0010 | D8 41 66 85 8F 63 99 8E 6C 71 46 86 13 4A C1 51
|
|
|
|
|
0020 | 57 B0 2F 00 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 85 11 E6 D3 FF 7B BF B4 57 05 3C E2
|
|
|
|
|
0010 | C4 78 65 2B 68 82 A4 88 2C 65 B8 FC D0 E4 DC 0C
|
|
|
|
|
0020 | DC 8A DC 85 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 = BA0D89B53C7CAF02B08D8EAEC6D44FDBD84166858F63998E6C714686134AC15157B02F0
|
|
|
|
|
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 | 47 1F 7D E6 34 C2 83 28 4C 9F F3 1A DC B9 95 AF
|
|
|
|
|
0140 | 46 D2 5E 96 6C F6 9C 08 8C 2F 3E FB 21 2D 36 6C
|
|
|
|
|
0150 | 06 99 13 68 98 D3 6B FE F7 E4 9B FF BA 5F 9B C7
|
|
|
|
|
0160 | AA 85 2A 9B 74 57 3F A2 A8 51 E7 EC 87 67 23 90
|
|
|
|
|
0170 | F7 DC DE 80 23 89 08 01 85 11 98 21 69 88 41 94
|
|
|
|
|
0180 | 25 99 F8 46 FC E4 17 DE F9 92 04 5F B5 40 FD 74
|
|
|
|
|
0190 | A8 D3 24 1D 89 BA 4C 84 29 48 14 34 52 94 92 77
|
|
|
|
|
01A0 | 94 4F 23 8B BC 91 7D 7E 42 19 62 34 38 01 CD 61
|
|
|
|
|
01B0 | 11 C0 9B 32 A7 69 24 92 AC 2A 9C CF D4 14 76 F0
|
|
|
|
|
01C0 | 32 F0 B7 01 B4 00 C3 FF D6 01 EC 56 37 DB 56 B6
|
|
|
|
|
01D0 | FE 65 85 DF 5A DC 89 5E 65 66 8F 50 D0 62 F6 CD
|
|
|
|
|
01E0 | 65 EA CB B5 AE 33 D3 05 7F 11 AA 22 3F D6 3B 48
|
|
|
|
|
01F0 | 4B A9 5A 24 B4 63 CC 5D 2D D6 3A C1 AC 66 7A EF
|
|
|
|
|
0200 | A5 F0 AF 24 1D 08 6A 82 3B A3 4B 0C 2A BC F2 41
|
|
|
|
|
0210 | 04 AB 14 2F 37 DA 19 70 98 A1 00 7D F2 4E DD F4
|
|
|
|
|
0220 | CF 1D C3 41 AB 51 B3 04 B1 73 2A 39 0B EC E4 EA
|
|
|
|
|
0230 | 95 F4 AB 65</code></pre>
|
|
|
|
|
0130 | AD BD 5A A1 5A 02 DD 1B AB C5 72 75 2A EB 57 7E
|
|
|
|
|
0140 | D9 20 36 FF C5 24 9D 2B 51 00 42 B9 D4 AC 1F FB
|
|
|
|
|
0150 | D7 3C 1B 0E 52 A6 24 2F 4D 58 63 A4 39 7B DA EB
|
|
|
|
|
0160 | 92 23 FD BB B9 05 7F 3D 65 6D 41 9E 3E C7 04 11
|
|
|
|
|
0170 | 7E 49 D4 86 AE D9 DC 0F F2 7C F2 66 82 04 32 48
|
|
|
|
|
0180 | 09 B1 03 4F F4 08 7C 19 E7 CC 42 94 91 88 7B 9D
|
|
|
|
|
0190 | 80 2F 3B 69 41 0A CB 13 B1 93 BD 51 0A F2 53 AC
|
|
|
|
|
01A0 | C6 1E 5C 39 85 D7 81 D6 54 EA B3 9A E1 25 52 D2
|
|
|
|
|
01B0 | C0 25 98 86 10 AB 42 25 19 77 CF 0D AF E6 27 78
|
|
|
|
|
01C0 | CC BC 29 D4 80 E2 A1 3F 27 E8 AC DD AA B6 40 7A
|
|
|
|
|
01D0 | DC F2 C2 99 7B 6C 15 DE 77 DB 85 BD C8 FC E8 1E
|
|
|
|
|
01E0 | F6 72 13 71 7F 70 E6 4A 40 7C B6 61 E4 06 85 01
|
|
|
|
|
01F0 | EE BE 46 CB 24 FF 1C 3F 9C 03 EE 7E 5C DB 6F 84
|
|
|
|
|
0200 | F1 A6 E3 96 FB 3A BD 12 A0 8B D7 4B 9E 85 A8 D1
|
|
|
|
|
0210 | 63 90 BD 9E 68 B6 45 8B 95 89 B0 7C B3 64 61 57
|
|
|
|
|
0220 | D5 1C 56 59 D9 99 F4 8A 86 72 A2 B5 54 83 4B C6
|
|
|
|
|
0230 | 13 12 AC 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 = BA0D89B53C7CAF02B08D8EAEC6D44FDBD84166858F63998E6C714686134AC15157B02F0
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>3C7CAF02B08D8EAEC6D44FDBD8416685</code></td>
|
|
|
|
|
<td><code>8511E6D3FF7BBFB457053CE2C478652B</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>8F63998E6C714686134AC15157B02F00</code></td>
|
|
|
|
|
<td><code>6882A4882C65B8FCD0E4DC0CDC8ADC85</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B53C7CAF02B08D8EAEC6D44FDBD84166858F63998E6C714686134AC15157B02F0
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE000100471F7DE634C283284C9FF31A</code> <code>DCB995AF46D25E966CF69C088C2F3EFB</code> <code>212D366C0699136898D36BFEF7E49BFF</code> <code>BA5F9BC7AA852A9B74573FA2A851E7EC</code> <code>87672390F7DCDE802389080185119821</code> <code>698841942599F846FCE417DEF992045F</code> <code>B540FD74A8D3241D89BA4C8429481434</code> <code>52949277944F238BBC917D7E42196234</code> <code>3801CD6111C09B32A7692492AC2A9CCF</code> <code>D41476F032F0B701B400C3FFD601EC56</code> <code>37DB56B6FE6585DF5ADC895E65668F50</code> <code>D062F6CD65EACBB5AE33D3057F11AA22</code> <code>3FD63B484BA95A24B463CC5D2DD63AC1</code> <code>AC667AEFA5F0AF241D086A823BA34B0C</code> <code>2ABCF24104AB142F37DA197098A1007D</code> <code>F24EDDF4CF1DC341AB51B304B1732A39</code><br> <code>0BECE4EA</code></td>
|
|
|
|
|
<td><code>FE000100ADBD5AA15A02DD1BABC57275</code> <code>2AEB577ED92036FFC5249D2B510042B9</code> <code>D4AC1FFBD73C1B0E52A6242F4D5863A4</code> <code>397BDAEB9223FDBBB9057F3D656D419E</code> <code>3EC704117E49D486AED9DC0FF27CF266</code> <code>8204324809B1034FF4087C19E7CC4294</code> <code>91887B9D802F3B69410ACB13B193BD51</code> <code>0AF253ACC61E5C3985D781D654EAB39A</code> <code>E12552D2C025988610AB42251977CF0D</code> <code>AFE62778CCBC29D480E2A13F27E8ACDD</code> <code>AAB6407ADCF2C2997B6C15DE77DB85BD</code> <code>C8FCE81EF67213717F70E64A407CB661</code> <code>E4068501EEBE46CB24FF1C3F9C03EE7E</code> <code>5CDB6F84F1A6E396FB3ABD12A08BD74B</code> <code>9E85A8D16390BD9E68B6458B9589B07C</code> <code>B3646157D51C5659D999F48A8672A2B5</code><br> <code>54834BC6</code></td>
|
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>95F4AB65</code> (1705768085 in decimal)</td>
|
|
|
|
|
<td><code>1312AC65</code> (1705775635 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B53C7CAF02B08D8EAEC6D44FDBD84166858F63998E6C714686134AC15157B02F0
|
|
|
|
|
<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 = E63A7A12B8C57BDF4E8FE8C66B889E88B0FDBC4522A17E58EA9127067101F404C43D3BCC3617FD08E84B2793B325B1C63C527848303A64F146E1E84BD65BCA8D4706A6EF47D75B71B598943E99BB27CCF08BCBB1ACB08D8FAE8552B0C3DDACAD7BA67F2F1EAC4082F1E26FB403D357C1EE8FAA1336BA500F1C67D0A8F377ECB47685AD67B49DD2F040BE266966A06D7A0477973515D0591B05C0504BC345F5EA985284F22E0980EEB4AFE3599CD1EC0461B7254147CC60489F9278AE07D13C39860D1A74E69729F3E6003007B3CA077B7A960B3AB67F180AD924FAE4C9157E69B904C3A267BBE79AB76FE381D10E02AD0F1C5A25ED5876DC059BD980AC41814B</code></pre>
|
|
|
|
|
<pre><code>b = 34E2A93BE4CFE13511D35E3E465CD0B9ACBBEEBF624FC2C3C8464428B3DEA2A1EB4EF072AF066C0407E1968F05653EAFF329E9C94C50607158FB99D78B26620977AA3FEE2CAC16BF7AAEBD94F3DB29DA95CB12213DC1849AF245C78664F822F41EE54B032973AFA9E713CB1EDE1395E45249B118F0935C3C29DFFF99BB0E8994EEE9B68BDCB5009740F1BCBCEA0CF97CA6537F8A89A51615B341D50C60DB54576EBAAE3E31944619F162E1424B1F9A6C096F56D102071F9A74489B0201F61E363F9920FA7A0BF3663A93C07EFB63B2BB84EB1C651685EE061818A9E805BF47A5A3205CF6B64A3AE81A8B199DFF9198771B527DC2C2A862067EC20E03C76879C3</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 = 7C511DC64CB4F1AF327A1E22C183F87101C90D0B58214044F5967EF645D1735E431E86F6ED7CC832D6674D9CF38ADF3C0C84D293C470FACBBBC7A1F792DEFCBEB0BA7EE7B6E118D4617427E3D0689B1325B30362C4C69743DAAC413197AD49B08C46A957D19BC4EAD1F97AA493EBD7A531301A60A70C27ECF38031CA81E20C994DAF4359554966CF6295A03F06669E2FAFC3BF935A64B2641CF86E753BEEA3E529D8ADA8C3E18008459D1BAC33287C9E5D7D14999456284EF0D7F1C1E77BA9B083A7B8C872FD6CDFD48F4A6FE334E2DC3E3D716A9ED68B71EFA69FB0E33379DCDE25A56473C0E208F064AE71DC0E6EC671FB9577F573D56AEC3B4C4D6FD59E42</code></pre>
|
|
|
|
|
<pre><code>g_b = 22752B60FA46F5CBA1A270DE3E0F69F09A4443816DD795B8B12115A955729E25275A241C1F375DC5773FAF48F538B0E1ED24C7C8B2696BBEF2F86E025574967E4E7CA2A43C694B9FBA4D1920DFE3ABB6F6362D44B311415082D5BD801A7829EBA67DFFA0BBA474476512729ACBC34D0AEC3A320048D2A04882BE5CADD60A885650C2C810D543D100C8A9650BF18D6E3CDEB17E5E921E0B7D3A56EA3441BFD66601BBA52AC6FFB2272A9C2093AE95015DC24D58F806E04EB6B84C2818CE36551FA38EC3C80CD6A0E295ED7322FFE942B2522E3CD6E33C1E52F7C8E20607CD44C0244631006A63609A1FFCABE4EA0DCF276CEE1F92FB3978B5AD0B9776EC7ED453</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 3C 7C AF 02 B0 8D 8E AE C6 D4 4F DB
|
|
|
|
|
0010 | D8 41 66 85 8F 63 99 8E 6C 71 46 86 13 4A C1 51
|
|
|
|
|
0020 | 57 B0 2F 00 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 7C 51 1D C6 4C B4 F1 AF 32 7A 1E 22 C1 83 F8 71
|
|
|
|
|
0040 | 01 C9 0D 0B 58 21 40 44 F5 96 7E F6 45 D1 73 5E
|
|
|
|
|
0050 | 43 1E 86 F6 ED 7C C8 32 D6 67 4D 9C F3 8A DF 3C
|
|
|
|
|
0060 | 0C 84 D2 93 C4 70 FA CB BB C7 A1 F7 92 DE FC BE
|
|
|
|
|
0070 | B0 BA 7E E7 B6 E1 18 D4 61 74 27 E3 D0 68 9B 13
|
|
|
|
|
0080 | 25 B3 03 62 C4 C6 97 43 DA AC 41 31 97 AD 49 B0
|
|
|
|
|
0090 | 8C 46 A9 57 D1 9B C4 EA D1 F9 7A A4 93 EB D7 A5
|
|
|
|
|
00A0 | 31 30 1A 60 A7 0C 27 EC F3 80 31 CA 81 E2 0C 99
|
|
|
|
|
00B0 | 4D AF 43 59 55 49 66 CF 62 95 A0 3F 06 66 9E 2F
|
|
|
|
|
00C0 | AF C3 BF 93 5A 64 B2 64 1C F8 6E 75 3B EE A3 E5
|
|
|
|
|
00D0 | 29 D8 AD A8 C3 E1 80 08 45 9D 1B AC 33 28 7C 9E
|
|
|
|
|
00E0 | 5D 7D 14 99 94 56 28 4E F0 D7 F1 C1 E7 7B A9 B0
|
|
|
|
|
00F0 | 83 A7 B8 C8 72 FD 6C DF D4 8F 4A 6F E3 34 E2 DC
|
|
|
|
|
0100 | 3E 3D 71 6A 9E D6 8B 71 EF A6 9F B0 E3 33 79 DC
|
|
|
|
|
0110 | DE 25 A5 64 73 C0 E2 08 F0 64 AE 71 DC 0E 6E C6
|
|
|
|
|
0120 | 71 FB 95 77 F5 73 D5 6A EC 3B 4C 4D 6F D5 9E 42</code></pre>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 85 11 E6 D3 FF 7B BF B4 57 05 3C E2
|
|
|
|
|
0010 | C4 78 65 2B 68 82 A4 88 2C 65 B8 FC D0 E4 DC 0C
|
|
|
|
|
0020 | DC 8A DC 85 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 22 75 2B 60 FA 46 F5 CB A1 A2 70 DE 3E 0F 69 F0
|
|
|
|
|
0040 | 9A 44 43 81 6D D7 95 B8 B1 21 15 A9 55 72 9E 25
|
|
|
|
|
0050 | 27 5A 24 1C 1F 37 5D C5 77 3F AF 48 F5 38 B0 E1
|
|
|
|
|
0060 | ED 24 C7 C8 B2 69 6B BE F2 F8 6E 02 55 74 96 7E
|
|
|
|
|
0070 | 4E 7C A2 A4 3C 69 4B 9F BA 4D 19 20 DF E3 AB B6
|
|
|
|
|
0080 | F6 36 2D 44 B3 11 41 50 82 D5 BD 80 1A 78 29 EB
|
|
|
|
|
0090 | A6 7D FF A0 BB A4 74 47 65 12 72 9A CB C3 4D 0A
|
|
|
|
|
00A0 | EC 3A 32 00 48 D2 A0 48 82 BE 5C AD D6 0A 88 56
|
|
|
|
|
00B0 | 50 C2 C8 10 D5 43 D1 00 C8 A9 65 0B F1 8D 6E 3C
|
|
|
|
|
00C0 | DE B1 7E 5E 92 1E 0B 7D 3A 56 EA 34 41 BF D6 66
|
|
|
|
|
00D0 | 01 BB A5 2A C6 FF B2 27 2A 9C 20 93 AE 95 01 5D
|
|
|
|
|
00E0 | C2 4D 58 F8 06 E0 4E B6 B8 4C 28 18 CE 36 55 1F
|
|
|
|
|
00F0 | A3 8E C3 C8 0C D6 A0 E2 95 ED 73 22 FF E9 42 B2
|
|
|
|
|
0100 | 52 2E 3C D6 E3 3C 1E 52 F7 C8 E2 06 07 CD 44 C0
|
|
|
|
|
0110 | 24 46 31 00 6A 63 60 9A 1F FC AB E4 EA 0D CF 27
|
|
|
|
|
0120 | 6C EE 1F 92 FB 39 78 B5 AD 0B 97 76 EC 7E D4 53</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 = BA0D89B53C7CAF02B08D8EAEC6D44FDBD84166858F63998E6C714686134AC15157B02F0
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>3C7CAF02B08D8EAEC6D44FDBD8416685</code></td>
|
|
|
|
|
<td><code>8511E6D3FF7BBFB457053CE2C478652B</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>8F63998E6C714686134AC15157B02F00</code></td>
|
|
|
|
|
<td><code>6882A4882C65B8FCD0E4DC0CDC8ADC85</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE0001007C511DC64CB4F1AF327A1E22</code> <code>C183F87101C90D0B58214044F5967EF6</code> <code>45D1735E431E86F6ED7CC832D6674D9C</code> <code>F38ADF3C0C84D293C470FACBBBC7A1F7</code> <code>92DEFCBEB0BA7EE7B6E118D4617427E3</code> <code>D0689B1325B30362C4C69743DAAC4131</code> <code>97AD49B08C46A957D19BC4EAD1F97AA4</code> <code>93EBD7A531301A60A70C27ECF38031CA</code> <code>81E20C994DAF4359554966CF6295A03F</code> <code>06669E2FAFC3BF935A64B2641CF86E75</code> <code>3BEEA3E529D8ADA8C3E18008459D1BAC</code> <code>33287C9E5D7D14999456284EF0D7F1C1</code> <code>E77BA9B083A7B8C872FD6CDFD48F4A6F</code> <code>E334E2DC3E3D716A9ED68B71EFA69FB0</code> <code>E33379DCDE25A56473C0E208F064AE71</code> <code>DC0E6EC671FB9577F573D56AEC3B4C4D</code><br> <code>6FD59E42</code></td>
|
|
|
|
|
<td><code>FE00010022752B60FA46F5CBA1A270DE</code> <code>3E0F69F09A4443816DD795B8B12115A9</code> <code>55729E25275A241C1F375DC5773FAF48</code> <code>F538B0E1ED24C7C8B2696BBEF2F86E02</code> <code>5574967E4E7CA2A43C694B9FBA4D1920</code> <code>DFE3ABB6F6362D44B311415082D5BD80</code> <code>1A7829EBA67DFFA0BBA474476512729A</code> <code>CBC34D0AEC3A320048D2A04882BE5CAD</code> <code>D60A885650C2C810D543D100C8A9650B</code> <code>F18D6E3CDEB17E5E921E0B7D3A56EA34</code> <code>41BFD66601BBA52AC6FFB2272A9C2093</code> <code>AE95015DC24D58F806E04EB6B84C2818</code> <code>CE36551FA38EC3C80CD6A0E295ED7322</code> <code>FFE942B2522E3CD6E33C1E52F7C8E206</code> <code>07CD44C0244631006A63609A1FFCABE4</code> <code>EA0DCF276CEE1F92FB3978B5AD0B9776</code><br> <code>EC7ED453</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 = BA0D89B53C7CAF02B08D8EAEC6D44FDBD84166858F63998E6C714686134AC15157B02F0
|
|
|
|
|
<!-- 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 = 54B643663C7CAF02B08D8EAEC6D44FDBD84166858F63998E6C714686134AC15157B02F000000000000000000FE0001007C511DC64CB4F1AF327A1E22C183F87101C90D0B58214044F5967EF645D1735E431E86F6ED7CC832D6674D9CF38ADF3C0C84D293C470FACBBBC7A1F792DEFCBEB0BA7EE7B6E118D4617427E3D0689B1325B30362C4C69743DAAC413197AD49B08C46A957D19BC4EAD1F97AA493EBD7A531301A60A70C27ECF38031CA81E20C994DAF4359554966CF6295A03F06669E2FAFC3BF935A64B2641CF86E753BEEA3E529D8ADA8C3E18008459D1BAC33287C9E5D7D14999456284EF0D7F1C1E77BA9B083A7B8C872FD6CDFD48F4A6FE334E2DC3E3D716A9ED68B71EFA69FB0E33379DCDE25A56473C0E208F064AE71DC0E6EC671FB9577F573D56AEC3B4C4D6FD59E42
|
|
|
|
|
padding = 83544D79DD0F2CC5AE99CC8E
|
|
|
|
|
tmp_aes_key = 0A7E80F0AD7CF0445C6C627DD6FE5F83030ECAECD2C31CB65EFE28A434F45714
|
|
|
|
|
tmp_aes_iv = 4F1897AF4531CD9257239CF77B1A78A6035DE20EA41CAFCCC59EF8F02AC20EB0</code></pre>
|
|
|
|
|
<pre><code>data = 54B643668511E6D3FF7BBFB457053CE2C478652B6882A4882C65B8FCD0E4DC0CDC8ADC850000000000000000FE00010022752B60FA46F5CBA1A270DE3E0F69F09A4443816DD795B8B12115A955729E25275A241C1F375DC5773FAF48F538B0E1ED24C7C8B2696BBEF2F86E025574967E4E7CA2A43C694B9FBA4D1920DFE3ABB6F6362D44B311415082D5BD801A7829EBA67DFFA0BBA474476512729ACBC34D0AEC3A320048D2A04882BE5CADD60A885650C2C810D543D100C8A9650BF18D6E3CDEB17E5E921E0B7D3A56EA3441BFD66601BBA52AC6FFB2272A9C2093AE95015DC24D58F806E04EB6B84C2818CE36551FA38EC3C80CD6A0E295ED7322FFE942B2522E3CD6E33C1E52F7C8E20607CD44C0244631006A63609A1FFCABE4EA0DCF276CEE1F92FB3978B5AD0B9776EC7ED453
|
|
|
|
|
padding = 0973B9CD9A3095118E4B9D62
|
|
|
|
|
tmp_aes_key = 81DA5DD974446677CB4862CD420017D29094F1ACAF3313E41573AC6E882A1307
|
|
|
|
|
tmp_aes_iv = 62D8149AA82CF10237A48FA917744B3D7BB50E18B131BB77C4792581B78C896B</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 = A985CE8EA94BB5DC217B820836C81C6FF697801B17354AB58FCD7C60DABB93B40136983EB29183D254DFC5D4149E3EB0C78B6F2AD3E79F652E78B6EDF9FE32C59DDDB1D608C5741C02C8F16EC1D942DB2DD45651C6B8C11D6AF2C939006E6F844342E67E54EDDCA25A0A0666C39D7BE4EF9BEC2CE1144864DEFDC756D70B62496381226E6615E2C2A77F86C87A2CF78B1BED3269ABFB429E00B7A97F114A2D1090BD4A3B9B64F04E42A859CCDC4F224F5500E35BB8C5DDE649F9007A90A1AD23A6D36EEB4F39E0D1297C19D6E586EF5F527A7047BE1B53480D6101BB87A6ACA96F870A827D3AE032F2DA3F08D4F0CC9EFAEF5B2D49E8995691D8D329A198695711A83AF93F068C02DA7952691ECFBA842541E4079304EBA56F33968980884F649FCAFDC157514F83BA69CE01FED322048903BD6FC34CBF9D09956BFD634965DB7359C9AC30861BDBEC135FA06E242335</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 3131D119B3A858E77A31F330EE8480414931A55ECC64D4E54B9EAD643AA110111B4B9066F514E12C78F6C3CB3FB68445D8CAEE8CBD366066DDC48E197D11BECE73ED510B54BEA938A5C3717ED8CE019E3073B95FD198175626544B58A15F79B4C9D9028D8DA2B0389661282DFCE55B522AF7A756611AAF00FFEDC421A50AECF530EA806E8B1A150C689F429A82D7701EFF370A3D9EC12051325E95AD0A3A6991287118BE3686F6D8F5FE882B524976C9E1288F0594E33385DA155005EFD757F4F4F669BF0204C09A9B267758DE41ED6CC68E2124598368B30F56C643C7C6BBD180AA82669EC0CC8715581A5A3220FFC76D547E83EBB1C2520874B57726B7E90A518089DE9255FF40D0D9FB06AD8D22DCEEB38BC8E972230800C4A08D959DC768DB09CE13C897E80A675ED30B7D0B3C534BED289F9E58BFD5F4DA692A98B31E72334777FF091B9F095A096E6227F1BA32</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 D0 A9 03 00 96 F4 AB 65
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 3C 7C AF 02 B0 8D 8E AE
|
|
|
|
|
0020 | C6 D4 4F DB D8 41 66 85 8F 63 99 8E 6C 71 46 86
|
|
|
|
|
0030 | 13 4A C1 51 57 B0 2F 00 FE 50 01 00 A9 85 CE 8E
|
|
|
|
|
0040 | A9 4B B5 DC 21 7B 82 08 36 C8 1C 6F F6 97 80 1B
|
|
|
|
|
0050 | 17 35 4A B5 8F CD 7C 60 DA BB 93 B4 01 36 98 3E
|
|
|
|
|
0060 | B2 91 83 D2 54 DF C5 D4 14 9E 3E B0 C7 8B 6F 2A
|
|
|
|
|
0070 | D3 E7 9F 65 2E 78 B6 ED F9 FE 32 C5 9D DD B1 D6
|
|
|
|
|
0080 | 08 C5 74 1C 02 C8 F1 6E C1 D9 42 DB 2D D4 56 51
|
|
|
|
|
0090 | C6 B8 C1 1D 6A F2 C9 39 00 6E 6F 84 43 42 E6 7E
|
|
|
|
|
00A0 | 54 ED DC A2 5A 0A 06 66 C3 9D 7B E4 EF 9B EC 2C
|
|
|
|
|
00B0 | E1 14 48 64 DE FD C7 56 D7 0B 62 49 63 81 22 6E
|
|
|
|
|
00C0 | 66 15 E2 C2 A7 7F 86 C8 7A 2C F7 8B 1B ED 32 69
|
|
|
|
|
00D0 | AB FB 42 9E 00 B7 A9 7F 11 4A 2D 10 90 BD 4A 3B
|
|
|
|
|
00E0 | 9B 64 F0 4E 42 A8 59 CC DC 4F 22 4F 55 00 E3 5B
|
|
|
|
|
00F0 | B8 C5 DD E6 49 F9 00 7A 90 A1 AD 23 A6 D3 6E EB
|
|
|
|
|
0100 | 4F 39 E0 D1 29 7C 19 D6 E5 86 EF 5F 52 7A 70 47
|
|
|
|
|
0110 | BE 1B 53 48 0D 61 01 BB 87 A6 AC A9 6F 87 0A 82
|
|
|
|
|
0120 | 7D 3A E0 32 F2 DA 3F 08 D4 F0 CC 9E FA EF 5B 2D
|
|
|
|
|
0130 | 49 E8 99 56 91 D8 D3 29 A1 98 69 57 11 A8 3A F9
|
|
|
|
|
0140 | 3F 06 8C 02 DA 79 52 69 1E CF BA 84 25 41 E4 07
|
|
|
|
|
0150 | 93 04 EB A5 6F 33 96 89 80 88 4F 64 9F CA FD C1
|
|
|
|
|
0160 | 57 51 4F 83 BA 69 CE 01 FE D3 22 04 89 03 BD 6F
|
|
|
|
|
0170 | C3 4C BF 9D 09 95 6B FD 63 49 65 DB 73 59 C9 AC
|
|
|
|
|
0180 | 30 86 1B DB EC 13 5F A0 6E 24 23 35</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 24 FA 09 00 13 12 AC 65
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 85 11 E6 D3 FF 7B BF B4
|
|
|
|
|
0020 | 57 05 3C E2 C4 78 65 2B 68 82 A4 88 2C 65 B8 FC
|
|
|
|
|
0030 | D0 E4 DC 0C DC 8A DC 85 FE 50 01 00 31 31 D1 19
|
|
|
|
|
0040 | B3 A8 58 E7 7A 31 F3 30 EE 84 80 41 49 31 A5 5E
|
|
|
|
|
0050 | CC 64 D4 E5 4B 9E AD 64 3A A1 10 11 1B 4B 90 66
|
|
|
|
|
0060 | F5 14 E1 2C 78 F6 C3 CB 3F B6 84 45 D8 CA EE 8C
|
|
|
|
|
0070 | BD 36 60 66 DD C4 8E 19 7D 11 BE CE 73 ED 51 0B
|
|
|
|
|
0080 | 54 BE A9 38 A5 C3 71 7E D8 CE 01 9E 30 73 B9 5F
|
|
|
|
|
0090 | D1 98 17 56 26 54 4B 58 A1 5F 79 B4 C9 D9 02 8D
|
|
|
|
|
00A0 | 8D A2 B0 38 96 61 28 2D FC E5 5B 52 2A F7 A7 56
|
|
|
|
|
00B0 | 61 1A AF 00 FF ED C4 21 A5 0A EC F5 30 EA 80 6E
|
|
|
|
|
00C0 | 8B 1A 15 0C 68 9F 42 9A 82 D7 70 1E FF 37 0A 3D
|
|
|
|
|
00D0 | 9E C1 20 51 32 5E 95 AD 0A 3A 69 91 28 71 18 BE
|
|
|
|
|
00E0 | 36 86 F6 D8 F5 FE 88 2B 52 49 76 C9 E1 28 8F 05
|
|
|
|
|
00F0 | 94 E3 33 85 DA 15 50 05 EF D7 57 F4 F4 F6 69 BF
|
|
|
|
|
0100 | 02 04 C0 9A 9B 26 77 58 DE 41 ED 6C C6 8E 21 24
|
|
|
|
|
0110 | 59 83 68 B3 0F 56 C6 43 C7 C6 BB D1 80 AA 82 66
|
|
|
|
|
0120 | 9E C0 CC 87 15 58 1A 5A 32 20 FF C7 6D 54 7E 83
|
|
|
|
|
0130 | EB B1 C2 52 08 74 B5 77 26 B7 E9 0A 51 80 89 DE
|
|
|
|
|
0140 | 92 55 FF 40 D0 D9 FB 06 AD 8D 22 DC EE B3 8B C8
|
|
|
|
|
0150 | E9 72 23 08 00 C4 A0 8D 95 9D C7 68 DB 09 CE 13
|
|
|
|
|
0160 | C8 97 E8 0A 67 5E D3 0B 7D 0B 3C 53 4B ED 28 9F
|
|
|
|
|
0170 | 9E 58 BF D5 F4 DA 69 2A 98 B3 1E 72 33 47 77 FF
|
|
|
|
|
0180 | 09 1B 9F 09 5A 09 6E 62 27 F1 BA 32</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>D0A9030096F4AB65</code></td>
|
|
|
|
|
<td><code>24FA09001312AC65</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>3C7CAF02B08D8EAEC6D44FDBD8416685</code></td>
|
|
|
|
|
<td><code>8511E6D3FF7BBFB457053CE2C478652B</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>8F63998E6C714686134AC15157B02F00</code></td>
|
|
|
|
|
<td><code>6882A4882C65B8FCD0E4DC0CDC8ADC85</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE500100A985CE8EA94BB5DC217B8208</code> <code>36C81C6FF697801B17354AB58FCD7C60</code> <code>DABB93B40136983EB29183D254DFC5D4</code> <code>149E3EB0C78B6F2AD3E79F652E78B6ED</code> <code>F9FE32C59DDDB1D608C5741C02C8F16E</code> <code>C1D942DB2DD45651C6B8C11D6AF2C939</code> <code>006E6F844342E67E54EDDCA25A0A0666</code> <code>C39D7BE4EF9BEC2CE1144864DEFDC756</code> <code>D70B62496381226E6615E2C2A77F86C8</code> <code>7A2CF78B1BED3269ABFB429E00B7A97F</code> <code>114A2D1090BD4A3B9B64F04E42A859CC</code> <code>DC4F224F5500E35BB8C5DDE649F9007A</code> <code>90A1AD23A6D36EEB4F39E0D1297C19D6</code> <code>E586EF5F527A7047BE1B53480D6101BB</code> <code>87A6ACA96F870A827D3AE032F2DA3F08</code> <code>D4F0CC9EFAEF5B2D49E8995691D8D329</code> <code>A198695711A83AF93F068C02DA795269</code> <code>1ECFBA842541E4079304EBA56F339689</code> <code>80884F649FCAFDC157514F83BA69CE01</code> <code>FED322048903BD6FC34CBF9D09956BFD</code> <code>634965DB7359C9AC30861BDBEC135FA0</code><br> <code>6E242335</code></td>
|
|
|
|
|
<td><code>FE5001003131D119B3A858E77A31F330</code> <code>EE8480414931A55ECC64D4E54B9EAD64</code> <code>3AA110111B4B9066F514E12C78F6C3CB</code> <code>3FB68445D8CAEE8CBD366066DDC48E19</code> <code>7D11BECE73ED510B54BEA938A5C3717E</code> <code>D8CE019E3073B95FD198175626544B58</code> <code>A15F79B4C9D9028D8DA2B0389661282D</code> <code>FCE55B522AF7A756611AAF00FFEDC421</code> <code>A50AECF530EA806E8B1A150C689F429A</code> <code>82D7701EFF370A3D9EC12051325E95AD</code> <code>0A3A6991287118BE3686F6D8F5FE882B</code> <code>524976C9E1288F0594E33385DA155005</code> <code>EFD757F4F4F669BF0204C09A9B267758</code> <code>DE41ED6CC68E2124598368B30F56C643</code> <code>C7C6BBD180AA82669EC0CC8715581A5A</code> <code>3220FFC76D547E83EBB1C2520874B577</code> <code>26B7E90A518089DE9255FF40D0D9FB06</code> <code>AD8D22DCEEB38BC8E972230800C4A08D</code> <code>959DC768DB09CE13C897E80A675ED30B</code> <code>7D0B3C534BED289F9E58BFD5F4DA692A</code> <code>98B31E72334777FF091B9F095A096E62</code><br> <code>27F1BA32</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 = 550B5ADCC3AF473C4B6238F500A3CED8941FE5F7C69F3AAA8823A6B8FED6217C8689B311CAA69FB30A6A6C6C4AE498C78656832FAAADE842C57F84B0ADF613359309D11918469792EB304DF182B3EC3A1905DBF7477C70A460FD5522C5A807A0CA89B45DFE027A3701EB31D08C38637F702186AF5526FA7709C906D607C7EED052576EBB26F4BFD723541BF77291E5CDD2493EADD59938E1668F610FB2B3908048B16E3A86898726FE5C7B7564DEE5E15E276E8603778CC45B7645C3C4B90AEFD1638B35296EDD231115C361EC7BA8528253170ACD7B244C3B53F5D10230004DE6443438198EDC7EA025F317D8B4EDAC30B6E50C174473A3B4E19058FAC4A433</code></pre>
|
|
|
|
|
<pre><code>auth_key = 98A0E913A31DF91DF8DBEC98A4E0F87EC11FF954BDEDBC7E3E99C0F10A474A47AFDA64A6303A1B252423BA30179ECA31FC9BCFD07AA01AFCB4437ABDC2E3877D7B9DF83886AF1D5EDDE6F1CEA48420C56624EDCAA7938000EF315434015122A797D4A0DB15D3DDAA75DF4D2E1260487592CBA9E134DB6B4E2EAAD626213C37C68D441C883FD66C0147438DA099BDCB28B97C6B9CA90AF2FFC3B466A286ED79D7B218E956284F73B26A5E0229C52E21AFA9ABC3D4F64FE728D2DD56F83B8C6F63B4E311703A663D9F7023488F11FD42B43ECE7D28B91BF2FC6831A115F930814957C8E5A335C341B1741A4789611AD340078BDE0AD7F2EF68CA3D71E4E85B3EE3</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 9C AC CC 96 F4 AB 65
|
|
|
|
|
0010 | 5C 00 00 00 34 F7 CB 3B 3C 7C AF 02 B0 8D 8E AE
|
|
|
|
|
0020 | C6 D4 4F DB D8 41 66 85 8F 63 99 8E 6C 71 46 86
|
|
|
|
|
0030 | 13 4A C1 51 57 B0 2F 00 D6 D0 71 E8 A4 CC 1A DF
|
|
|
|
|
0040 | 12 36 57 FD 08 0C D0 48</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 28 A6 07 14 12 AC 65
|
|
|
|
|
0010 | 9C 00 00 00 34 F7 CB 3B 85 11 E6 D3 FF 7B BF B4
|
|
|
|
|
0020 | 57 05 3C E2 C4 78 65 2B 68 82 A4 88 2C 65 B8 FC
|
|
|
|
|
0030 | D0 E4 DC 0C DC 8A DC 85 C7 2A F9 F9 B7 66 4C 54
|
|
|
|
|
0040 | 44 19 C2 1C 7B 0C 98 8E</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>019CACCC96F4AB65</code></td>
|
|
|
|
|
<td><code>0128A6071412AC65</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>5C000000</code> (92 in decimal)</td>
|
|
|
|
|
<td><code>9C000000</code> (156 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>3C7CAF02B08D8EAEC6D44FDBD8416685</code></td>
|
|
|
|
|
<td><code>8511E6D3FF7BBFB457053CE2C478652B</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>8F63998E6C714686134AC15157B02F00</code></td>
|
|
|
|
|
<td><code>6882A4882C65B8FCD0E4DC0CDC8ADC85</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>D6D071E8A4CC1ADF123657FD080CD048</code></td>
|
|
|
|
|
<td><code>C72AF9F9B7664C544419C21C7B0C988E</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>
|
|
|
|
|