|
|
|
@ -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 00 05 0B 00 9D 54 7C 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 93 10 2C AE BB 91 9E 9C
|
|
|
|
|
0020 | 27 B0 00 AA 59 D8 3F D7</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 D0 4E 0B 00 DD 0D 80 66
|
|
|
|
|
0010 | 14 00 00 00 F1 8E 7E BE 44 36 92 6E 47 1B C5 A7
|
|
|
|
|
0020 | A3 BF E6 59 49 69 EF F6</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>00050B009D547C66</code></td>
|
|
|
|
|
<td><code>D04E0B00DD0D8066</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>93102CAEBB919E9C27B000AA59D83FD7</code></td>
|
|
|
|
|
<td><code>4436926E471BC5A7A3BFE6594969EFF6</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 70 BE AF 9D 54 7C 66
|
|
|
|
|
0010 | 98 00 00 00 63 24 16 05 93 10 2C AE BB 91 9E 9C
|
|
|
|
|
0020 | 27 B0 00 AA 59 D8 3F D7 8D 2B 59 2A 7F 3E D1 0F
|
|
|
|
|
0030 | 45 D4 06 FD 35 9F D1 D0 08 22 AB 2F B7 96 54 EB
|
|
|
|
|
0040 | A3 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 F5 2C DD 0D 80 66
|
|
|
|
|
0010 | 60 00 00 00 63 24 16 05 44 36 92 6E 47 1B C5 A7
|
|
|
|
|
0020 | A3 BF E6 59 49 69 EF F6 3E 11 9F 7C 04 20 1F BF
|
|
|
|
|
0030 | 1C 66 41 C4 A6 EE 58 64 08 24 D8 BA 5A 32 3A 21
|
|
|
|
|
0040 | A9 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>0170BEAF9D547C66</code></td>
|
|
|
|
|
<td><code>0190F52CDD0D8066</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>60000000</code> (96 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -150,19 +150,19 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>93102CAEBB919E9C27B000AA59D83FD7</code></td>
|
|
|
|
|
<td><code>4436926E471BC5A7A3BFE6594969EFF6</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>8D2B592A7F3ED10F45D406FD359FD1D0</code></td>
|
|
|
|
|
<td><code>3E119F7C04201FBF1C6641C4A6EE5864</code></td>
|
|
|
|
|
<td>Server-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>56, 12</td>
|
|
|
|
|
<td><code>0822AB2FB79654EBA3000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2498142883854740387</td>
|
|
|
|
|
<td><code>0824D8BA5A323A21A9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2655076876887400873</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 = 2498142883854740387</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2498142883854740387 = 1492963699 * 1673277713</code></p>
|
|
|
|
|
<pre><code>p = 1492963699
|
|
|
|
|
q = 1673277713</code></pre>
|
|
|
|
|
<pre><code>pq = 2655076876887400873</code></pre>
|
|
|
|
|
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2655076876887400873 = 1406753197 * 1887379309</code></p>
|
|
|
|
|
<pre><code>p = 1406753197
|
|
|
|
|
q = 1887379309</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 22 AB 2F B7 96 54 EB A3 00 00 00
|
|
|
|
|
0010 | 04 58 FC D1 73 00 00 00 04 63 BC 31 11 00 00 00
|
|
|
|
|
0020 | 93 10 2C AE BB 91 9E 9C 27 B0 00 AA 59 D8 3F D7
|
|
|
|
|
0030 | 8D 2B 59 2A 7F 3E D1 0F 45 D4 06 FD 35 9F D1 D0
|
|
|
|
|
0040 | 09 5D 45 35 DC 97 DF 66 A3 08 76 19 2E 41 DD 65
|
|
|
|
|
0050 | 61 8E C9 0B 14 B6 1F 99 89 15 AA 75 4A 09 B3 D0
|
|
|
|
|
<pre><code>0000 | 95 5F F5 A9 08 24 D8 BA 5A 32 3A 21 A9 00 00 00
|
|
|
|
|
0010 | 04 53 D9 59 AD 00 00 00 04 70 7F 1F 6D 00 00 00
|
|
|
|
|
0020 | 44 36 92 6E 47 1B C5 A7 A3 BF E6 59 49 69 EF F6
|
|
|
|
|
0030 | 3E 11 9F 7C 04 20 1F BF 1C 66 41 C4 A6 EE 58 64
|
|
|
|
|
0040 | A4 41 F5 F5 27 DC 09 CD AB 96 3D 39 0A 71 E3 2D
|
|
|
|
|
0050 | 75 58 A1 9D CA 71 B3 95 2F 95 96 86 71 71 9C 08
|
|
|
|
|
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 = 1673277713</code></pre>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>pq</td>
|
|
|
|
|
<td>4, 12</td>
|
|
|
|
|
<td><code>0822AB2FB79654EBA3000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2498142883854740387</td>
|
|
|
|
|
<td><code>0824D8BA5A323A21A9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2655076876887400873</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>0458FCD173000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1492963699</td>
|
|
|
|
|
<td><code>0453D959AD000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1406753197</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>0463BC3111000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1673277713</td>
|
|
|
|
|
<td><code>04707F1F6D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1887379309</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>93102CAEBB919E9C27B000AA59D83FD7</code></td>
|
|
|
|
|
<td><code>4436926E471BC5A7A3BFE6594969EFF6</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>48, 16</td>
|
|
|
|
|
<td><code>8D2B592A7F3ED10F45D406FD359FD1D0</code></td>
|
|
|
|
|
<td><code>3E119F7C04201FBF1C6641C4A6EE5864</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce</td>
|
|
|
|
|
<td>64, 32</td>
|
|
|
|
|
<td><code>095D4535DC97DF66A30876192E41DD65</code> <code>618EC90B14B61F998915AA754A09B3D0</code></td>
|
|
|
|
|
<td><code>A441F5F527DC09CDAB963D390A71E32D</code> <code>7558A19DCA71B3952F95968671719C08</code></td>
|
|
|
|
|
<td>Client-generated random number</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -291,39 +291,39 @@ q = 1673277713</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 = 955FF5A90822AB2FB79654EBA30000000458FCD1730000000463BC311100000093102CAEBB919E9C27B000AA59D83FD78D2B592A7F3ED10F45D406FD359FD1D0095D4535DC97DF66A30876192E41DD65618EC90B14B61F998915AA754A09B3D002000000
|
|
|
|
|
random_padding_bytes = 4A8A01C2440C95533FEE81181232C5B3248FE57C9766C92FFCBB2BBC8A4973C41719087F0B1527C8049F73C1061D10AE8E2995C63F4C8D15D690B57BDE10865F7B9F728E5BEDA522B74DA20413B77AB9FCC189279D6DAF1A9B81156F</code></pre>
|
|
|
|
|
<pre><code>data = 955FF5A90824D8BA5A323A21A90000000453D959AD00000004707F1F6D0000004436926E471BC5A7A3BFE6594969EFF63E119F7C04201FBF1C6641C4A6EE5864A441F5F527DC09CDAB963D390A71E32D7558A19DCA71B3952F95968671719C0802000000
|
|
|
|
|
random_padding_bytes = 55043137DC8CE71B53BBC781E31013F72DA63D92E7C658E7FB7B8AB2C0F5DD6E28647B00A550DBCCBAF76CA8366D2F62ED25D0125A76D71BB10FAD5C216D3A4F4461B8E5B83F3F5E1E2D8DDAAC6E2D0EB539DAC148CDF5933E313545</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 = 2E6E0EAD1DEB5384ED80C51F511244964BD28881D2834D404937453820569DAABDC1A091E743CB81E614E9B6EA3299A31E76632D8A2E0028C7A1AC18F7C8F6439F34D397C85101F33DBE1D1C5C7552A447B2602F28C9DBF07875F7B663AB4EA93118922E95E79F5873C7335A3F041C3D971689EA77055DDD6E795AEE357460DD34728D1B142E7018093E4147B278DC83CE72E1527C22EA7297B47D080EF882224CF9D5FB4CCC9BB8C24840B22E92817D5F2C7668D767815C30792983B8743AFFD905CD0E028DC4546BDE9AEB2C105543A3E87A92D44546F618047E78D19C1F380EDD8704E5B21F2370B01902DF0269FDA91D7EB4A064D40ABAD23995F3C224D1</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 5F70F2C5C9B7024B40BFD12BBE89FF5D183DDD0159BDE2A27B9F2A0D2629B3BE655469F40E472B78EF2A1B34394D0128363A9821DE4CD27FD1527578D81EA812B413A9E2BFCA1E8E995AE49E15A706351F292318C18A78265CBDC6D95CC60A6FA8B79FB307B8463FB81A12F67AB9B88A3F95D1B567AF75E1B50F7E6CFBF9896508895FC1B52E90DC40B05FE48D7173E4F17D550C97E2522D0B7860AB46AB421AF4013FB340D5BD480EFEB4B6303ABFE030DACE39078C27C1313506F8D4AF89E9ABA779CD12D3B177A43FB49A51D0004297FEF19830B9FA251165DCCC8D6336BF9B38BD3933942568F6D8033DD97AB96CCF5DCFCC99CB46C85866F6A78FA49648</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 04 05 0B 00 9D 54 7C 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 93 10 2C AE BB 91 9E 9C
|
|
|
|
|
0020 | 27 B0 00 AA 59 D8 3F D7 8D 2B 59 2A 7F 3E D1 0F
|
|
|
|
|
0030 | 45 D4 06 FD 35 9F D1 D0 04 58 FC D1 73 00 00 00
|
|
|
|
|
0040 | 04 63 BC 31 11 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 2E 6E 0E AD 1D EB 53 84 ED 80 C5 1F
|
|
|
|
|
0060 | 51 12 44 96 4B D2 88 81 D2 83 4D 40 49 37 45 38
|
|
|
|
|
0070 | 20 56 9D AA BD C1 A0 91 E7 43 CB 81 E6 14 E9 B6
|
|
|
|
|
0080 | EA 32 99 A3 1E 76 63 2D 8A 2E 00 28 C7 A1 AC 18
|
|
|
|
|
0090 | F7 C8 F6 43 9F 34 D3 97 C8 51 01 F3 3D BE 1D 1C
|
|
|
|
|
00A0 | 5C 75 52 A4 47 B2 60 2F 28 C9 DB F0 78 75 F7 B6
|
|
|
|
|
00B0 | 63 AB 4E A9 31 18 92 2E 95 E7 9F 58 73 C7 33 5A
|
|
|
|
|
00C0 | 3F 04 1C 3D 97 16 89 EA 77 05 5D DD 6E 79 5A EE
|
|
|
|
|
00D0 | 35 74 60 DD 34 72 8D 1B 14 2E 70 18 09 3E 41 47
|
|
|
|
|
00E0 | B2 78 DC 83 CE 72 E1 52 7C 22 EA 72 97 B4 7D 08
|
|
|
|
|
00F0 | 0E F8 82 22 4C F9 D5 FB 4C CC 9B B8 C2 48 40 B2
|
|
|
|
|
0100 | 2E 92 81 7D 5F 2C 76 68 D7 67 81 5C 30 79 29 83
|
|
|
|
|
0110 | B8 74 3A FF D9 05 CD 0E 02 8D C4 54 6B DE 9A EB
|
|
|
|
|
0120 | 2C 10 55 43 A3 E8 7A 92 D4 45 46 F6 18 04 7E 78
|
|
|
|
|
0130 | D1 9C 1F 38 0E DD 87 04 E5 B2 1F 23 70 B0 19 02
|
|
|
|
|
0140 | DF 02 69 FD A9 1D 7E B4 A0 64 D4 0A BA D2 39 95
|
|
|
|
|
0150 | F3 C2 24 D1</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 D4 4E 0B 00 DD 0D 80 66
|
|
|
|
|
0010 | 40 01 00 00 BE E4 12 D7 44 36 92 6E 47 1B C5 A7
|
|
|
|
|
0020 | A3 BF E6 59 49 69 EF F6 3E 11 9F 7C 04 20 1F BF
|
|
|
|
|
0030 | 1C 66 41 C4 A6 EE 58 64 04 53 D9 59 AD 00 00 00
|
|
|
|
|
0040 | 04 70 7F 1F 6D 00 00 00 85 FD 64 DE 85 1D 9D D0
|
|
|
|
|
0050 | FE 00 01 00 5F 70 F2 C5 C9 B7 02 4B 40 BF D1 2B
|
|
|
|
|
0060 | BE 89 FF 5D 18 3D DD 01 59 BD E2 A2 7B 9F 2A 0D
|
|
|
|
|
0070 | 26 29 B3 BE 65 54 69 F4 0E 47 2B 78 EF 2A 1B 34
|
|
|
|
|
0080 | 39 4D 01 28 36 3A 98 21 DE 4C D2 7F D1 52 75 78
|
|
|
|
|
0090 | D8 1E A8 12 B4 13 A9 E2 BF CA 1E 8E 99 5A E4 9E
|
|
|
|
|
00A0 | 15 A7 06 35 1F 29 23 18 C1 8A 78 26 5C BD C6 D9
|
|
|
|
|
00B0 | 5C C6 0A 6F A8 B7 9F B3 07 B8 46 3F B8 1A 12 F6
|
|
|
|
|
00C0 | 7A B9 B8 8A 3F 95 D1 B5 67 AF 75 E1 B5 0F 7E 6C
|
|
|
|
|
00D0 | FB F9 89 65 08 89 5F C1 B5 2E 90 DC 40 B0 5F E4
|
|
|
|
|
00E0 | 8D 71 73 E4 F1 7D 55 0C 97 E2 52 2D 0B 78 60 AB
|
|
|
|
|
00F0 | 46 AB 42 1A F4 01 3F B3 40 D5 BD 48 0E FE B4 B6
|
|
|
|
|
0100 | 30 3A BF E0 30 DA CE 39 07 8C 27 C1 31 35 06 F8
|
|
|
|
|
0110 | D4 AF 89 E9 AB A7 79 CD 12 D3 B1 77 A4 3F B4 9A
|
|
|
|
|
0120 | 51 D0 00 42 97 FE F1 98 30 B9 FA 25 11 65 DC CC
|
|
|
|
|
0130 | 8D 63 36 BF 9B 38 BD 39 33 94 25 68 F6 D8 03 3D
|
|
|
|
|
0140 | D9 7A B9 6C CF 5D CF CC 99 CB 46 C8 58 66 F6 A7
|
|
|
|
|
0150 | 8F A4 96 48</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 = 4A8A01C2440C95533FEE81181232C5B3248FE57C9766C92FFCBB2BBC8
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>04050B009D547C66</code></td>
|
|
|
|
|
<td><code>D44E0B00DD0D8066</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 = 4A8A01C2440C95533FEE81181232C5B3248FE57C9766C92FFCBB2BBC8
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>93102CAEBB919E9C27B000AA59D83FD7</code></td>
|
|
|
|
|
<td><code>4436926E471BC5A7A3BFE6594969EFF6</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>8D2B592A7F3ED10F45D406FD359FD1D0</code></td>
|
|
|
|
|
<td><code>3E119F7C04201FBF1C6641C4A6EE5864</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p</td>
|
|
|
|
|
<td>56, 8</td>
|
|
|
|
|
<td><code>0458FCD173000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1492963699</td>
|
|
|
|
|
<td><code>0453D959AD000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1406753197</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>0463BC3111000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1673277713</td>
|
|
|
|
|
<td><code>04707F1F6D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1887379309</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 = 4A8A01C2440C95533FEE81181232C5B3248FE57C9766C92FFCBB2BBC8
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>80, 260</td>
|
|
|
|
|
<td><code>FE0001002E6E0EAD1DEB5384ED80C51F</code> <code>511244964BD28881D2834D4049374538</code> <code>20569DAABDC1A091E743CB81E614E9B6</code> <code>EA3299A31E76632D8A2E0028C7A1AC18</code> <code>F7C8F6439F34D397C85101F33DBE1D1C</code> <code>5C7552A447B2602F28C9DBF07875F7B6</code> <code>63AB4EA93118922E95E79F5873C7335A</code> <code>3F041C3D971689EA77055DDD6E795AEE</code> <code>357460DD34728D1B142E7018093E4147</code> <code>B278DC83CE72E1527C22EA7297B47D08</code> <code>0EF882224CF9D5FB4CCC9BB8C24840B2</code> <code>2E92817D5F2C7668D767815C30792983</code> <code>B8743AFFD905CD0E028DC4546BDE9AEB</code> <code>2C105543A3E87A92D44546F618047E78</code> <code>D19C1F380EDD8704E5B21F2370B01902</code> <code>DF0269FDA91D7EB4A064D40ABAD23995</code><br> <code>F3C224D1</code></td>
|
|
|
|
|
<td><code>FE0001005F70F2C5C9B7024B40BFD12B</code> <code>BE89FF5D183DDD0159BDE2A27B9F2A0D</code> <code>2629B3BE655469F40E472B78EF2A1B34</code> <code>394D0128363A9821DE4CD27FD1527578</code> <code>D81EA812B413A9E2BFCA1E8E995AE49E</code> <code>15A706351F292318C18A78265CBDC6D9</code> <code>5CC60A6FA8B79FB307B8463FB81A12F6</code> <code>7AB9B88A3F95D1B567AF75E1B50F7E6C</code> <code>FBF9896508895FC1B52E90DC40B05FE4</code> <code>8D7173E4F17D550C97E2522D0B7860AB</code> <code>46AB421AF4013FB340D5BD480EFEB4B6</code> <code>303ABFE030DACE39078C27C1313506F8</code> <code>D4AF89E9ABA779CD12D3B177A43FB49A</code> <code>51D0004297FEF19830B9FA251165DCCC</code> <code>8D6336BF9B38BD3933942568F6D8033D</code> <code>D97AB96CCF5DCFCC99CB46C85866F6A7</code><br> <code>8FA49648</code></td>
|
|
|
|
|
<td>Value generated above</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -402,47 +402,47 @@ random_padding_bytes = 4A8A01C2440C95533FEE81181232C5B3248FE57C9766C92FFCBB2BBC8
|
|
|
|
|
<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 BC DB 57 9E 54 7C 66
|
|
|
|
|
0010 | 84 02 00 00 5C 07 E8 D0 93 10 2C AE BB 91 9E 9C
|
|
|
|
|
0020 | 27 B0 00 AA 59 D8 3F D7 8D 2B 59 2A 7F 3E D1 0F
|
|
|
|
|
0030 | 45 D4 06 FD 35 9F D1 D0 FE 50 02 00 3E 63 FA 8F
|
|
|
|
|
0040 | 22 21 B6 3E 02 3E 30 41 CA A5 76 0E 29 DB C8 C2
|
|
|
|
|
0050 | 47 CA CE F4 B3 6F 62 8A BD 03 BA DC AC FC 10 51
|
|
|
|
|
0060 | 27 18 03 93 5B 9F B8 6D 46 0B 86 AE 2D 5F 97 82
|
|
|
|
|
0070 | 28 95 D0 F1 70 A6 E1 0D 84 32 EA 8E D2 3E 1E 39
|
|
|
|
|
0080 | 5A A6 D5 02 F7 75 0C 3E 8C 77 10 57 FD A2 67 AD
|
|
|
|
|
0090 | E3 20 E6 23 41 62 58 A7 BF 2E 03 23 B8 2A BB 42
|
|
|
|
|
00A0 | 54 7B 1C 60 05 39 65 82 EF 35 DC BA CC D7 55 4A
|
|
|
|
|
00B0 | C0 04 3D 73 37 6F 8C 22 F9 8A 78 1B E7 C9 62 FF
|
|
|
|
|
00C0 | A1 D2 D3 26 6E B4 0A 2D 38 5B F4 1E 3E 0B 5C C6
|
|
|
|
|
00D0 | E2 A5 AA 68 38 3A A5 5E AB 1C 58 8D 6E 96 AE C3
|
|
|
|
|
00E0 | 14 DE BD EB 7B 94 5B E7 BD 4A A3 3D 6B 60 DC D5
|
|
|
|
|
00F0 | 66 2D 53 C2 6C 10 D7 E1 99 81 C0 82 3C EA A2 CB
|
|
|
|
|
0100 | FF D6 98 D7 21 83 6A 6B 22 23 33 FD C4 19 8F A8
|
|
|
|
|
0110 | EB 4D F2 2F D1 90 E0 71 4F C9 52 8F 6C BD B2 CE
|
|
|
|
|
0120 | DA 6A DD 05 49 24 3E B8 70 FE 90 44 E0 93 FD 73
|
|
|
|
|
0130 | 27 A8 D9 6C DC F7 79 8F 48 74 5A 3D 8D E3 FA B7
|
|
|
|
|
0140 | 38 27 7E 6A C2 E6 0D 9A 22 78 5D 88 BF 91 92 24
|
|
|
|
|
0150 | 59 D5 55 4E 7D DD 04 73 99 74 B1 7B 09 2A F4 CF
|
|
|
|
|
0160 | DF 86 FC 9F 57 CA 48 51 3D B9 C8 7A 6F B8 3C 71
|
|
|
|
|
0170 | 55 9E FD 27 45 20 CB 84 E8 10 FC 64 65 9F 53 D3
|
|
|
|
|
0180 | 73 4F CC 19 90 0E 14 0D 08 F5 12 F2 32 4D 2C BF
|
|
|
|
|
0190 | D1 3F 19 A6 F4 33 0E D5 3C 17 2F 28 FA 2F B1 24
|
|
|
|
|
01A0 | 83 65 1F BC BD CD E1 74 A1 40 FA 6B 76 F2 14 BB
|
|
|
|
|
01B0 | 0F 8F 80 19 73 A4 E8 FF DE BA 33 1F 07 99 20 8C
|
|
|
|
|
01C0 | 37 BA 69 91 9F 91 08 1A DD 00 98 46 98 3F CB E4
|
|
|
|
|
01D0 | 1D F1 13 51 4C 55 C7 57 60 CD 8C E0 AF D1 17 E2
|
|
|
|
|
01E0 | FD 02 B3 5D 92 DE C1 25 AB 70 3C A7 E8 36 19 6E
|
|
|
|
|
01F0 | 39 89 59 05 2A 2F E8 E3 E9 87 9D BD 60 35 FA CB
|
|
|
|
|
0200 | 40 00 F9 CF F2 37 1F FE C8 FF 3A 82 A3 06 EE 8E
|
|
|
|
|
0210 | 37 B3 08 68 C5 A8 22 AF 85 03 D8 6C 30 FC AF 0C
|
|
|
|
|
0220 | 41 81 C0 06 5A 5F 15 CD E1 BD 28 25 3A D3 D4 1D
|
|
|
|
|
0230 | E2 03 7E 40 44 94 1A 85 8C B6 5B DB 14 E4 9F 44
|
|
|
|
|
0240 | 88 57 D8 E0 7F F6 38 95 6B 1F C0 F1 46 31 3C 69
|
|
|
|
|
0250 | 18 90 DE 2C B8 1C 0C 79 AB 79 0D B1 40 8D 7C 3F
|
|
|
|
|
0260 | EF 36 A2 D7 9E 4C 57 03 1E B4 5D DB B6 BE 51 21
|
|
|
|
|
0270 | DD 7B 33 B0 A0 B1 22 8A CD 61 97 EF 0F 38 A1 D0
|
|
|
|
|
0280 | 51 43 C0 AC 03 10 EB A7 01 8D 30 22</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 A0 F6 F3 DD 0D 80 66
|
|
|
|
|
0010 | C0 02 00 00 5C 07 E8 D0 44 36 92 6E 47 1B C5 A7
|
|
|
|
|
0020 | A3 BF E6 59 49 69 EF F6 3E 11 9F 7C 04 20 1F BF
|
|
|
|
|
0030 | 1C 66 41 C4 A6 EE 58 64 FE 50 02 00 B8 71 13 FD
|
|
|
|
|
0040 | 1B 46 D7 7D FC 86 2E 2D CD 04 7D F6 C1 4D D8 85
|
|
|
|
|
0050 | 97 3A 80 7A 79 F2 B7 54 A0 D4 97 F3 2F 60 64 D3
|
|
|
|
|
0060 | 1C 20 89 DF 34 11 97 B9 6F F8 4B 27 21 71 8C 11
|
|
|
|
|
0070 | 30 95 ED F8 6B 96 9C B7 A5 65 22 65 01 BA 40 8E
|
|
|
|
|
0080 | 4B A7 FA 4D 28 10 10 F7 A5 9F 16 B1 03 DB DF 1A
|
|
|
|
|
0090 | 57 9E 7A E9 F8 C6 01 B2 DE D3 1E AF FB 36 5B 4C
|
|
|
|
|
00A0 | 50 21 0C FC 22 52 74 89 5B B9 29 CD 2C 30 7D 27
|
|
|
|
|
00B0 | 51 51 6A C1 1A D8 0C 8B 08 D4 7F 79 96 0C EA 18
|
|
|
|
|
00C0 | 40 40 0D B0 55 67 9C 0D 36 F9 C7 1E 27 1B 77 4F
|
|
|
|
|
00D0 | 36 91 62 E7 C7 90 74 BC 0A 68 61 87 AA 42 B9 31
|
|
|
|
|
00E0 | 3D 07 E1 1F 7D BA A1 A1 EB 02 97 CF 14 88 B7 BC
|
|
|
|
|
00F0 | 1C 1A 7A C4 B2 94 0E 47 14 CC 48 D0 23 0A 1D 69
|
|
|
|
|
0100 | 4A C9 0A 2A FE 23 BC 8E 70 B0 D9 F1 2E BD 0F DC
|
|
|
|
|
0110 | 30 70 EA D2 77 9D 7F 6F 76 E6 DB B8 AE 38 A7 FB
|
|
|
|
|
0120 | EC 0F A5 6D 23 F0 5D D3 B6 17 98 28 D7 03 F7 DD
|
|
|
|
|
0130 | CF E6 D7 FE 9D 32 1F BD 6D 98 3B FB 99 32 51 95
|
|
|
|
|
0140 | 47 93 D1 93 F9 92 2A 9D 1E AD 27 08 5B BC 51 54
|
|
|
|
|
0150 | 77 A3 6D 1B 57 D7 12 A2 7C E2 DC A0 90 C4 34 1C
|
|
|
|
|
0160 | 0D B2 CF 68 1F A1 D4 E0 EA 14 B7 D5 0B 72 CE B6
|
|
|
|
|
0170 | 3B 83 98 25 EA F2 00 F4 CB F0 9F E1 01 2C 7C 70
|
|
|
|
|
0180 | 5A 3C 22 E0 5E BC 36 F0 36 70 6C B9 E1 91 A1 09
|
|
|
|
|
0190 | 29 2B 6B 5E FB 32 FD 68 B0 AF A1 B9 48 E4 30 AA
|
|
|
|
|
01A0 | DD 88 A1 6C 3A 2C 7D AF 4B D9 3D 80 2C 85 86 E9
|
|
|
|
|
01B0 | 44 3D CA CC 41 0E 84 D1 ED E7 A7 8E 79 4B 4B FA
|
|
|
|
|
01C0 | A1 81 96 9E 12 BA B3 F8 CC 9F 74 82 2B 0C D6 1B
|
|
|
|
|
01D0 | 88 76 4E C6 07 4B 96 8E 7E E0 FF 1F 9F 89 5E 56
|
|
|
|
|
01E0 | 16 87 FC 9C 7C 8C 11 BE BB ED A2 8C 4E AD 50 45
|
|
|
|
|
01F0 | 43 EF E5 06 BB F7 89 67 97 53 18 B8 35 C9 70 8F
|
|
|
|
|
0200 | 53 A2 29 37 EB EC 6F 7C D8 A4 AC 70 D7 D3 80 8D
|
|
|
|
|
0210 | 4D BB B4 BF 46 5D 61 56 FC 4B 7D DD FD 99 16 52
|
|
|
|
|
0220 | 01 C4 18 5B E2 C7 D5 6D C4 E9 79 13 BC 90 31 4C
|
|
|
|
|
0230 | 7B 1D 85 38 3C B6 FD 70 05 D5 05 67 09 15 17 27
|
|
|
|
|
0240 | 09 72 4B B1 0C A7 32 16 5E C6 40 D0 C2 DB DF CD
|
|
|
|
|
0250 | 36 F9 76 89 83 8E CB 8E 41 31 59 41 1E B6 87 BF
|
|
|
|
|
0260 | B0 EA C3 58 93 D0 A8 3E 8B A1 99 49 AE 1E 3B 05
|
|
|
|
|
0270 | 63 00 96 6A 79 5E E6 4A F8 6F AB 68 98 BA A4 96
|
|
|
|
|
0280 | BD CC 38 8A 5E F5 1A 35 96 66 D6 D6</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 = 4A8A01C2440C95533FEE81181232C5B3248FE57C9766C92FFCBB2BBC8
|
|
|
|
|
<tr>
|
|
|
|
|
<td>message_id</td>
|
|
|
|
|
<td>8, 8</td>
|
|
|
|
|
<td><code>01BCDB579E547C66</code></td>
|
|
|
|
|
<td><code>01A0F6F3DD0D8066</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>84020000</code> (644 in decimal)</td>
|
|
|
|
|
<td><code>C0020000</code> (704 in decimal)</td>
|
|
|
|
|
<td>Message body length</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -482,19 +482,19 @@ random_padding_bytes = 4A8A01C2440C95533FEE81181232C5B3248FE57C9766C92FFCBB2BBC8
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>24, 16</td>
|
|
|
|
|
<td><code>93102CAEBB919E9C27B000AA59D83FD7</code></td>
|
|
|
|
|
<td><code>4436926E471BC5A7A3BFE6594969EFF6</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>8D2B592A7F3ED10F45D406FD359FD1D0</code></td>
|
|
|
|
|
<td><code>3E119F7C04201FBF1C6641C4A6EE5864</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_answer</td>
|
|
|
|
|
<td>56, 596</td>
|
|
|
|
|
<td><code>FE5002003E63FA8F2221B63E023E3041</code> <code>CAA5760E29DBC8C247CACEF4B36F628A</code> <code>BD03BADCACFC1051271803935B9FB86D</code> <code>460B86AE2D5F97822895D0F170A6E10D</code> <code>8432EA8ED23E1E395AA6D502F7750C3E</code> <code>8C771057FDA267ADE320E623416258A7</code> <code>BF2E0323B82ABB42547B1C6005396582</code> <code>EF35DCBACCD7554AC0043D73376F8C22</code> <code>F98A781BE7C962FFA1D2D3266EB40A2D</code> <code>385BF41E3E0B5CC6E2A5AA68383AA55E</code> <code>AB1C588D6E96AEC314DEBDEB7B945BE7</code> <code>BD4AA33D6B60DCD5662D53C26C10D7E1</code> <code>9981C0823CEAA2CBFFD698D721836A6B</code> <code>222333FDC4198FA8EB4DF22FD190E071</code> <code>4FC9528F6CBDB2CEDA6ADD0549243EB8</code> <code>70FE9044E093FD7327A8D96CDCF7798F</code> <code>48745A3D8DE3FAB738277E6AC2E60D9A</code> <code>22785D88BF91922459D5554E7DDD0473</code> <code>9974B17B092AF4CFDF86FC9F57CA4851</code> <code>3DB9C87A6FB83C71559EFD274520CB84</code> <code>E810FC64659F53D3734FCC19900E140D</code> <code>08F512F2324D2CBFD13F19A6F4330ED5</code> <code>3C172F28FA2FB12483651FBCBDCDE174</code> <code>A140FA6B76F214BB0F8F801973A4E8FF</code> <code>DEBA331F0799208C37BA69919F91081A</code> <code>DD009846983FCBE41DF113514C55C757</code> <code>60CD8CE0AFD117E2FD02B35D92DEC125</code> <code>AB703CA7E836196E398959052A2FE8E3</code> <code>E9879DBD6035FACB4000F9CFF2371FFE</code> <code>C8FF3A82A306EE8E37B30868C5A822AF</code> <code>8503D86C30FCAF0C4181C0065A5F15CD</code> <code>E1BD28253AD3D41DE2037E4044941A85</code> <code>8CB65BDB14E49F448857D8E07FF63895</code> <code>6B1FC0F146313C691890DE2CB81C0C79</code> <code>AB790DB1408D7C3FEF36A2D79E4C5703</code> <code>1EB45DDBB6BE5121DD7B33B0A0B1228A</code> <code>CD6197EF0F38A1D05143C0AC0310EBA7</code><br> <code>018D3022</code></td>
|
|
|
|
|
<td><code>FE500200B87113FD1B46D77DFC862E2D</code> <code>CD047DF6C14DD885973A807A79F2B754</code> <code>A0D497F32F6064D31C2089DF341197B9</code> <code>6FF84B2721718C113095EDF86B969CB7</code> <code>A565226501BA408E4BA7FA4D281010F7</code> <code>A59F16B103DBDF1A579E7AE9F8C601B2</code> <code>DED31EAFFB365B4C50210CFC22527489</code> <code>5BB929CD2C307D2751516AC11AD80C8B</code> <code>08D47F79960CEA1840400DB055679C0D</code> <code>36F9C71E271B774F369162E7C79074BC</code> <code>0A686187AA42B9313D07E11F7DBAA1A1</code> <code>EB0297CF1488B7BC1C1A7AC4B2940E47</code> <code>14CC48D0230A1D694AC90A2AFE23BC8E</code> <code>70B0D9F12EBD0FDC3070EAD2779D7F6F</code> <code>76E6DBB8AE38A7FBEC0FA56D23F05DD3</code> <code>B6179828D703F7DDCFE6D7FE9D321FBD</code> <code>6D983BFB993251954793D193F9922A9D</code> <code>1EAD27085BBC515477A36D1B57D712A2</code> <code>7CE2DCA090C4341C0DB2CF681FA1D4E0</code> <code>EA14B7D50B72CEB63B839825EAF200F4</code> <code>CBF09FE1012C7C705A3C22E05EBC36F0</code> <code>36706CB9E191A109292B6B5EFB32FD68</code> <code>B0AFA1B948E430AADD88A16C3A2C7DAF</code> <code>4BD93D802C8586E9443DCACC410E84D1</code> <code>EDE7A78E794B4BFAA181969E12BAB3F8</code> <code>CC9F74822B0CD61B88764EC6074B968E</code> <code>7EE0FF1F9F895E561687FC9C7C8C11BE</code> <code>BBEDA28C4EAD504543EFE506BBF78967</code> <code>975318B835C9708F53A22937EBEC6F7C</code> <code>D8A4AC70D7D3808D4DBBB4BF465D6156</code> <code>FC4B7DDDFD99165201C4185BE2C7D56D</code> <code>C4E97913BC90314C7B1D85383CB6FD70</code> <code>05D505670915172709724BB10CA73216</code> <code>5EC640D0C2DBDFCD36F97689838ECB8E</code> <code>413159411EB687BFB0EAC35893D0A83E</code> <code>8BA19949AE1E3B056300966A795EE64A</code> <code>F86FAB6898BAA496BDCC388A5EF51A35</code><br> <code>9666D6D6</code></td>
|
|
|
|
|
<td>See below</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -502,20 +502,20 @@ random_padding_bytes = 4A8A01C2440C95533FEE81181232C5B3248FE57C9766C92FFCBB2BBC8
|
|
|
|
|
<!-- 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 = 3E63FA8F2221B63E023E3041CAA5760E29DBC8C247CACEF4B36F628ABD03BADCACFC1051271803935B9FB86D460B86AE2D5F97822895D0F170A6E10D8432EA8ED23E1E395AA6D502F7750C3E8C771057FDA267ADE320E623416258A7BF2E0323B82ABB42547B1C6005396582EF35DCBACCD7554AC0043D73376F8C22F98A781BE7C962FFA1D2D3266EB40A2D385BF41E3E0B5CC6E2A5AA68383AA55EAB1C588D6E96AEC314DEBDEB7B945BE7BD4AA33D6B60DCD5662D53C26C10D7E19981C0823CEAA2CBFFD698D721836A6B222333FDC4198FA8EB4DF22FD190E0714FC9528F6CBDB2CEDA6ADD0549243EB870FE9044E093FD7327A8D96CDCF7798F48745A3D8DE3FAB738277E6AC2E60D9A22785D88BF91922459D5554E7DDD04739974B17B092AF4CFDF86FC9F57CA48513DB9C87A6FB83C71559EFD274520CB84E810FC64659F53D3734FCC19900E140D08F512F2324D2CBFD13F19A6F4330ED53C172F28FA2FB12483651FBCBDCDE174A140FA6B76F214BB0F8F801973A4E8FFDEBA331F0799208C37BA69919F91081ADD009846983FCBE41DF113514C55C75760CD8CE0AFD117E2FD02B35D92DEC125AB703CA7E836196E398959052A2FE8E3E9879DBD6035FACB4000F9CFF2371FFEC8FF3A82A306EE8E37B30868C5A822AF8503D86C30FCAF0C4181C0065A5F15CDE1BD28253AD3D41DE2037E4044941A858CB65BDB14E49F448857D8E07FF638956B1FC0F146313C691890DE2CB81C0C79AB790DB1408D7C3FEF36A2D79E4C57031EB45DDBB6BE5121DD7B33B0A0B1228ACD6197EF0F38A1D05143C0AC0310EBA7018D3022
|
|
|
|
|
tmp_aes_key = 50D5A9339BAD43D2C764AB7335AED393F367BFE6C5D8EB4518468F7478DFA7DF
|
|
|
|
|
tmp_aes_iv = 056F5C6B4E865E1617D6D5FFA603BD40556F13DF5839A806D036908F095D4535</code></pre>
|
|
|
|
|
<pre><code>encrypted_answer = B87113FD1B46D77DFC862E2DCD047DF6C14DD885973A807A79F2B754A0D497F32F6064D31C2089DF341197B96FF84B2721718C113095EDF86B969CB7A565226501BA408E4BA7FA4D281010F7A59F16B103DBDF1A579E7AE9F8C601B2DED31EAFFB365B4C50210CFC225274895BB929CD2C307D2751516AC11AD80C8B08D47F79960CEA1840400DB055679C0D36F9C71E271B774F369162E7C79074BC0A686187AA42B9313D07E11F7DBAA1A1EB0297CF1488B7BC1C1A7AC4B2940E4714CC48D0230A1D694AC90A2AFE23BC8E70B0D9F12EBD0FDC3070EAD2779D7F6F76E6DBB8AE38A7FBEC0FA56D23F05DD3B6179828D703F7DDCFE6D7FE9D321FBD6D983BFB993251954793D193F9922A9D1EAD27085BBC515477A36D1B57D712A27CE2DCA090C4341C0DB2CF681FA1D4E0EA14B7D50B72CEB63B839825EAF200F4CBF09FE1012C7C705A3C22E05EBC36F036706CB9E191A109292B6B5EFB32FD68B0AFA1B948E430AADD88A16C3A2C7DAF4BD93D802C8586E9443DCACC410E84D1EDE7A78E794B4BFAA181969E12BAB3F8CC9F74822B0CD61B88764EC6074B968E7EE0FF1F9F895E561687FC9C7C8C11BEBBEDA28C4EAD504543EFE506BBF78967975318B835C9708F53A22937EBEC6F7CD8A4AC70D7D3808D4DBBB4BF465D6156FC4B7DDDFD99165201C4185BE2C7D56DC4E97913BC90314C7B1D85383CB6FD7005D505670915172709724BB10CA732165EC640D0C2DBDFCD36F97689838ECB8E413159411EB687BFB0EAC35893D0A83E8BA19949AE1E3B056300966A795EE64AF86FAB6898BAA496BDCC388A5EF51A359666D6D6
|
|
|
|
|
tmp_aes_key = 19FF563FC6595F36B2B7E11EE1C8DD0D9621705A8A9D1A94F7E92B44A80E5263
|
|
|
|
|
tmp_aes_iv = 3F9571D56B8A52725AA6191E34CD015E2BB36446736E5E44F1B63CF7A441F5F5</code></pre>
|
|
|
|
|
<!-- end server_DH_inner_data_input -->
|
|
|
|
|
<p>Yielding:</p>
|
|
|
|
|
<!-- start server_DH_inner_data_output -->
|
|
|
|
|
<pre><code>answer_with_hash = E40D8CA2F25AA7452CE0F723AC8A26ED53069D69BA0D89B593102CAEBB919E9C27B000AA59D83FD78D2B592A7F3ED10F45D406FD359FD1D003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100B54372DF3D272961E7D431788AC788B31AE3A8552F35C01FBEF0AAB2FABD7D05FCE8D8D258B970399DB43B23406F97CD9FA21AC5500DB026FBE48A960C0DF4AC21D541CC244F6E823C0490032C6E99C564784C09D68C47BD14A37A35683FFBAF2A15F38471505A26DC289AA4E580ED517AE6FA5D71F976468D445AB94B5C0DD08F5D62145DFD8ACEDD58719C6CA9614C845E95EFE971758D1473498A5A75DBDF1833F15A76A79DB73964DFD6A98B8FDD1219C927956DB33F85A0EA16B450A928421BB3EEC5C9BF4CC9C13866CED40969C533587C7D27C65BC59B08654896E612491943E835BB8146277517815C980503D13E46E43DF8AA6C8BD9A3D5B1E097BD9E547C6693750A1B18A2A922
|
|
|
|
|
answer = BA0D89B593102CAEBB919E9C27B000AA59D83FD78D2B592A7F3ED10F45D406FD359FD1D003000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100B54372DF3D272961E7D431788AC788B31AE3A8552F35C01FBEF0AAB2FABD7D05FCE8D8D258B970399DB43B23406F97CD9FA21AC5500DB026FBE48A960C0DF4AC21D541CC244F6E823C0490032C6E99C564784C09D68C47BD14A37A35683FFBAF2A15F38471505A26DC289AA4E580ED517AE6FA5D71F976468D445AB94B5C0DD08F5D62145DFD8ACEDD58719C6CA9614C845E95EFE971758D1473498A5A75DBDF1833F15A76A79DB73964DFD6A98B8FDD1219C927956DB33F85A0EA16B450A928421BB3EEC5C9BF4CC9C13866CED40969C533587C7D27C65BC59B08654896E612491943E835BB8146277517815C980503D13E46E43DF8AA6C8BD9A3D5B1E097BD9E547C6693750A1B18A2A922</code></pre>
|
|
|
|
|
<pre><code>answer_with_hash = 9A6E616DE954BF99BB4307C01B75B867353604EDBA0D89B54436926E471BC5A7A3BFE6594969EFF63E119F7C04201FBF1C6641C4A6EE586403000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001003E504381CAB477A783C28C385DFD63D3828D98941219FC1BC08B7D6BD87417BF05355BD2BE1DAFB191D21D3C09995A769AE03A07D36D81264EB27F87CEED2B9DEF5D67D45DEE3B874C057116EC42B819F983ECD03C9EF5ABBA896605C953EC286149503C5E38229D578407CA36F80D512584EB8CE7BF5A13294C1CD6FA18C0986E01E6C5E6840A439E84DA2F0782A54DF9AA98E6F7A0F030B30EC06C5E023A45E6F636102DEC0748839DEC625A6176A7DEC93088A6A304F7C17D7D433FFBF397739ADE0FFFDE9ADE08BD70757031D0B4779C505A18D17BCB26872896D9D09D9DCE6D728CB14C5CBB7E5E78A456AE217F9FFE52AF1B0BA86B055B6FC1D530E559DD0D806614AA9DCE4E198F01
|
|
|
|
|
answer = BA0D89B54436926E471BC5A7A3BFE6594969EFF63E119F7C04201FBF1C6641C4A6EE586403000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001003E504381CAB477A783C28C385DFD63D3828D98941219FC1BC08B7D6BD87417BF05355BD2BE1DAFB191D21D3C09995A769AE03A07D36D81264EB27F87CEED2B9DEF5D67D45DEE3B874C057116EC42B819F983ECD03C9EF5ABBA896605C953EC286149503C5E38229D578407CA36F80D512584EB8CE7BF5A13294C1CD6FA18C0986E01E6C5E6840A439E84DA2F0782A54DF9AA98E6F7A0F030B30EC06C5E023A45E6F636102DEC0748839DEC625A6176A7DEC93088A6A304F7C17D7D433FFBF397739ADE0FFFDE9ADE08BD70757031D0B4779C505A18D17BCB26872896D9D09D9DCE6D728CB14C5CBB7E5E78A456AE217F9FFE52AF1B0BA86B055B6FC1D530E559DD0D806614AA9DCE4E198F01</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 93 10 2C AE BB 91 9E 9C 27 B0 00 AA
|
|
|
|
|
0010 | 59 D8 3F D7 8D 2B 59 2A 7F 3E D1 0F 45 D4 06 FD
|
|
|
|
|
0020 | 35 9F D1 D0 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
|
|
|
|
<pre><code>0000 | BA 0D 89 B5 44 36 92 6E 47 1B C5 A7 A3 BF E6 59
|
|
|
|
|
0010 | 49 69 EF F6 3E 11 9F 7C 04 20 1F BF 1C 66 41 C4
|
|
|
|
|
0020 | A6 EE 58 64 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 = BA0D89B593102CAEBB919E9C27B000AA59D83FD78D2B592A7F3ED10F45D406FD359FD1D
|
|
|
|
|
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 | B5 43 72 DF 3D 27 29 61 E7 D4 31 78 8A C7 88 B3
|
|
|
|
|
0140 | 1A E3 A8 55 2F 35 C0 1F BE F0 AA B2 FA BD 7D 05
|
|
|
|
|
0150 | FC E8 D8 D2 58 B9 70 39 9D B4 3B 23 40 6F 97 CD
|
|
|
|
|
0160 | 9F A2 1A C5 50 0D B0 26 FB E4 8A 96 0C 0D F4 AC
|
|
|
|
|
0170 | 21 D5 41 CC 24 4F 6E 82 3C 04 90 03 2C 6E 99 C5
|
|
|
|
|
0180 | 64 78 4C 09 D6 8C 47 BD 14 A3 7A 35 68 3F FB AF
|
|
|
|
|
0190 | 2A 15 F3 84 71 50 5A 26 DC 28 9A A4 E5 80 ED 51
|
|
|
|
|
01A0 | 7A E6 FA 5D 71 F9 76 46 8D 44 5A B9 4B 5C 0D D0
|
|
|
|
|
01B0 | 8F 5D 62 14 5D FD 8A CE DD 58 71 9C 6C A9 61 4C
|
|
|
|
|
01C0 | 84 5E 95 EF E9 71 75 8D 14 73 49 8A 5A 75 DB DF
|
|
|
|
|
01D0 | 18 33 F1 5A 76 A7 9D B7 39 64 DF D6 A9 8B 8F DD
|
|
|
|
|
01E0 | 12 19 C9 27 95 6D B3 3F 85 A0 EA 16 B4 50 A9 28
|
|
|
|
|
01F0 | 42 1B B3 EE C5 C9 BF 4C C9 C1 38 66 CE D4 09 69
|
|
|
|
|
0200 | C5 33 58 7C 7D 27 C6 5B C5 9B 08 65 48 96 E6 12
|
|
|
|
|
0210 | 49 19 43 E8 35 BB 81 46 27 75 17 81 5C 98 05 03
|
|
|
|
|
0220 | D1 3E 46 E4 3D F8 AA 6C 8B D9 A3 D5 B1 E0 97 BD
|
|
|
|
|
0230 | 9E 54 7C 66</code></pre>
|
|
|
|
|
0130 | 3E 50 43 81 CA B4 77 A7 83 C2 8C 38 5D FD 63 D3
|
|
|
|
|
0140 | 82 8D 98 94 12 19 FC 1B C0 8B 7D 6B D8 74 17 BF
|
|
|
|
|
0150 | 05 35 5B D2 BE 1D AF B1 91 D2 1D 3C 09 99 5A 76
|
|
|
|
|
0160 | 9A E0 3A 07 D3 6D 81 26 4E B2 7F 87 CE ED 2B 9D
|
|
|
|
|
0170 | EF 5D 67 D4 5D EE 3B 87 4C 05 71 16 EC 42 B8 19
|
|
|
|
|
0180 | F9 83 EC D0 3C 9E F5 AB BA 89 66 05 C9 53 EC 28
|
|
|
|
|
0190 | 61 49 50 3C 5E 38 22 9D 57 84 07 CA 36 F8 0D 51
|
|
|
|
|
01A0 | 25 84 EB 8C E7 BF 5A 13 29 4C 1C D6 FA 18 C0 98
|
|
|
|
|
01B0 | 6E 01 E6 C5 E6 84 0A 43 9E 84 DA 2F 07 82 A5 4D
|
|
|
|
|
01C0 | F9 AA 98 E6 F7 A0 F0 30 B3 0E C0 6C 5E 02 3A 45
|
|
|
|
|
01D0 | E6 F6 36 10 2D EC 07 48 83 9D EC 62 5A 61 76 A7
|
|
|
|
|
01E0 | DE C9 30 88 A6 A3 04 F7 C1 7D 7D 43 3F FB F3 97
|
|
|
|
|
01F0 | 73 9A DE 0F FF DE 9A DE 08 BD 70 75 70 31 D0 B4
|
|
|
|
|
0200 | 77 9C 50 5A 18 D1 7B CB 26 87 28 96 D9 D0 9D 9D
|
|
|
|
|
0210 | CE 6D 72 8C B1 4C 5C BB 7E 5E 78 A4 56 AE 21 7F
|
|
|
|
|
0220 | 9F FE 52 AF 1B 0B A8 6B 05 5B 6F C1 D5 30 E5 59
|
|
|
|
|
0230 | DD 0D 80 66</code></pre>
|
|
|
|
|
<p>Payload (de)serialization:</p>
|
|
|
|
|
<pre><code>server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;</code></pre>
|
|
|
|
|
<table class="table">
|
|
|
|
@ -570,13 +570,13 @@ answer = BA0D89B593102CAEBB919E9C27B000AA59D83FD78D2B592A7F3ED10F45D406FD359FD1D
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>93102CAEBB919E9C27B000AA59D83FD7</code></td>
|
|
|
|
|
<td><code>4436926E471BC5A7A3BFE6594969EFF6</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>8D2B592A7F3ED10F45D406FD359FD1D0</code></td>
|
|
|
|
|
<td><code>3E119F7C04201FBF1C6641C4A6EE5864</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
@ -594,13 +594,13 @@ answer = BA0D89B593102CAEBB919E9C27B000AA59D83FD78D2B592A7F3ED10F45D406FD359FD1D
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_a</td>
|
|
|
|
|
<td>300, 260</td>
|
|
|
|
|
<td><code>FE000100B54372DF3D272961E7D43178</code> <code>8AC788B31AE3A8552F35C01FBEF0AAB2</code> <code>FABD7D05FCE8D8D258B970399DB43B23</code> <code>406F97CD9FA21AC5500DB026FBE48A96</code> <code>0C0DF4AC21D541CC244F6E823C049003</code> <code>2C6E99C564784C09D68C47BD14A37A35</code> <code>683FFBAF2A15F38471505A26DC289AA4</code> <code>E580ED517AE6FA5D71F976468D445AB9</code> <code>4B5C0DD08F5D62145DFD8ACEDD58719C</code> <code>6CA9614C845E95EFE971758D1473498A</code> <code>5A75DBDF1833F15A76A79DB73964DFD6</code> <code>A98B8FDD1219C927956DB33F85A0EA16</code> <code>B450A928421BB3EEC5C9BF4CC9C13866</code> <code>CED40969C533587C7D27C65BC59B0865</code> <code>4896E612491943E835BB814627751781</code> <code>5C980503D13E46E43DF8AA6C8BD9A3D5</code><br> <code>B1E097BD</code></td>
|
|
|
|
|
<td><code>FE0001003E504381CAB477A783C28C38</code> <code>5DFD63D3828D98941219FC1BC08B7D6B</code> <code>D87417BF05355BD2BE1DAFB191D21D3C</code> <code>09995A769AE03A07D36D81264EB27F87</code> <code>CEED2B9DEF5D67D45DEE3B874C057116</code> <code>EC42B819F983ECD03C9EF5ABBA896605</code> <code>C953EC286149503C5E38229D578407CA</code> <code>36F80D512584EB8CE7BF5A13294C1CD6</code> <code>FA18C0986E01E6C5E6840A439E84DA2F</code> <code>0782A54DF9AA98E6F7A0F030B30EC06C</code> <code>5E023A45E6F636102DEC0748839DEC62</code> <code>5A6176A7DEC93088A6A304F7C17D7D43</code> <code>3FFBF397739ADE0FFFDE9ADE08BD7075</code> <code>7031D0B4779C505A18D17BCB26872896</code> <code>D9D09D9DCE6D728CB14C5CBB7E5E78A4</code> <code>56AE217F9FFE52AF1B0BA86B055B6FC1</code><br> <code>D530E559</code></td>
|
|
|
|
|
<td><code>g_a</code> diffie-hellman parameter</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_time</td>
|
|
|
|
|
<td>560, 4</td>
|
|
|
|
|
<td><code>9E547C66</code> (1719424158 in decimal)</td>
|
|
|
|
|
<td><code>DD0D8066</code> (1719668189 in decimal)</td>
|
|
|
|
|
<td>Server time</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
@ -609,34 +609,34 @@ answer = BA0D89B593102CAEBB919E9C27B000AA59D83FD78D2B592A7F3ED10F45D406FD359FD1D
|
|
|
|
|
<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 = 7519F4941FA4B012AE8C307E77F7F52CBD51E3A9B5473FD83B5220C99AD83081CB0DC9F9406B48D537ED9D2C910FCF19BC647AE363EF86944DC74CDDE73286B857A4D43D73D48F3192DFE8F7255F00A01634049E330D8699A2F34A8C304730BD31C7B86E254FC9345F965CDEE043D1CC8DDD1390F7A42B11B58DFC4B26BF9678397E88C0E8E7F0368186AA853F9C4CBF75200D3C508D6789BB10A4705C8F2AC2E2CC544812C64E0C8B720F9628C8705C562BAC39DCB949DCB05CB040552F366C16AA832BEA09E4668DF6539BD9E6AA2A61EA725922A02C9CE09E8796090E857C1A185119DA87F61655D3BA378486926E5B13DF626C1165B8812F3AE0B6F9891B</code></pre>
|
|
|
|
|
<pre><code>b = 43854873396F6CC062353301A7B99D3B88FA994B84E9D76D06501D2554D02DD7AAF11DF485B5FE2980124077850012219D8BEDD0DDAFD7935A56605B64767E62D11AB0DCBF0331434B4C322BE6766D6AAB420A8C3CFAD588CDB6F48B1DA41098A6B5FCA96A2F9FC9264D723DFE367665D7CE59873894D18B1082D29183BF11F8511D1CCD443EE58D862C272BAC4A97D80E44C2493AE9138B694E7583A5E92D1AFAA52FC94DEA8172C8EFAD1DB24BE841227A0714268B62F62EFDC3D0DB1BAE6E7A118257F19E182E38894549AC63FA88D130386C407BE2BD3358B49AA5FB4BF6A67051757CED63D9C9C642E0228ABACAC6DF2A3D1FCC39DFA34B55D3124442DC</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 = C1781601FF80F73A9C5446B9646E0592D84D80ADB8983E57C871E1386BCCEAFDC784FA30CE9430454CB6E5A2AB396F39E0EEC41B01B256391BAA2C52BD0EB15AE478B23A08A8D499EB75A9B8FC630F2D591C41783B8AE021B30FE57013B311CE776E6DA995DE02A6C6FC82823DBC81F3119B953B95F20AF505242CD63517650D0C03B72223531172AC02CA50FD0E2526D24D911BE9AFDCD25A1C5F18538796B51AFD2FCE0CEAB4E68154471744418B3D76F8047DC81E664E475B8131F133F9817B2E0D38AF1AEB4D60FAF4ABE091A4A282B3D8D138765795810C08681F680250900D7507B43D14EDA99449D1A7DD6BFB69BCE48399D3D52E5059269E3782B951</code></pre>
|
|
|
|
|
<pre><code>g_b = 7E0A64D764CE7D6D2CD1F3533ABF0B61FB031D2EBFA5601799B80537569458B5BCD65DC2C6BCC9848FE78E1441E9D28C89D7E22B8ECF0FF6B06970E07B1FE031B8938E958E44977A725CF7137F47DDCABD0F8303DEC7973396910704BD05CB7CB34EBA8E3BC006F72680A5910E23F3D24ADEDA33FDF7D2926A402A3D97F84595873277E2C19C872385F8D064CE008D4E917BFADFD4AE79C782660A0495CDF68E962E113F9589272E5A866BBB60A0ED226F351C122BE0766A2A447274158708709A82834199E2B2BF73799B204074D399432175C2A8A65AAD479726DAC00DDF0BAA125F2CC2F614404EEA2EA4BC0F6A2636BF1E20818F80C7C714A00B9B9B3C5A</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 93 10 2C AE BB 91 9E 9C 27 B0 00 AA
|
|
|
|
|
0010 | 59 D8 3F D7 8D 2B 59 2A 7F 3E D1 0F 45 D4 06 FD
|
|
|
|
|
0020 | 35 9F D1 D0 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | C1 78 16 01 FF 80 F7 3A 9C 54 46 B9 64 6E 05 92
|
|
|
|
|
0040 | D8 4D 80 AD B8 98 3E 57 C8 71 E1 38 6B CC EA FD
|
|
|
|
|
0050 | C7 84 FA 30 CE 94 30 45 4C B6 E5 A2 AB 39 6F 39
|
|
|
|
|
0060 | E0 EE C4 1B 01 B2 56 39 1B AA 2C 52 BD 0E B1 5A
|
|
|
|
|
0070 | E4 78 B2 3A 08 A8 D4 99 EB 75 A9 B8 FC 63 0F 2D
|
|
|
|
|
0080 | 59 1C 41 78 3B 8A E0 21 B3 0F E5 70 13 B3 11 CE
|
|
|
|
|
0090 | 77 6E 6D A9 95 DE 02 A6 C6 FC 82 82 3D BC 81 F3
|
|
|
|
|
00A0 | 11 9B 95 3B 95 F2 0A F5 05 24 2C D6 35 17 65 0D
|
|
|
|
|
00B0 | 0C 03 B7 22 23 53 11 72 AC 02 CA 50 FD 0E 25 26
|
|
|
|
|
00C0 | D2 4D 91 1B E9 AF DC D2 5A 1C 5F 18 53 87 96 B5
|
|
|
|
|
00D0 | 1A FD 2F CE 0C EA B4 E6 81 54 47 17 44 41 8B 3D
|
|
|
|
|
00E0 | 76 F8 04 7D C8 1E 66 4E 47 5B 81 31 F1 33 F9 81
|
|
|
|
|
00F0 | 7B 2E 0D 38 AF 1A EB 4D 60 FA F4 AB E0 91 A4 A2
|
|
|
|
|
0100 | 82 B3 D8 D1 38 76 57 95 81 0C 08 68 1F 68 02 50
|
|
|
|
|
0110 | 90 0D 75 07 B4 3D 14 ED A9 94 49 D1 A7 DD 6B FB
|
|
|
|
|
0120 | 69 BC E4 83 99 D3 D5 2E 50 59 26 9E 37 82 B9 51</code></pre>
|
|
|
|
|
<pre><code>0000 | 54 B6 43 66 44 36 92 6E 47 1B C5 A7 A3 BF E6 59
|
|
|
|
|
0010 | 49 69 EF F6 3E 11 9F 7C 04 20 1F BF 1C 66 41 C4
|
|
|
|
|
0020 | A6 EE 58 64 00 00 00 00 00 00 00 00 FE 00 01 00
|
|
|
|
|
0030 | 7E 0A 64 D7 64 CE 7D 6D 2C D1 F3 53 3A BF 0B 61
|
|
|
|
|
0040 | FB 03 1D 2E BF A5 60 17 99 B8 05 37 56 94 58 B5
|
|
|
|
|
0050 | BC D6 5D C2 C6 BC C9 84 8F E7 8E 14 41 E9 D2 8C
|
|
|
|
|
0060 | 89 D7 E2 2B 8E CF 0F F6 B0 69 70 E0 7B 1F E0 31
|
|
|
|
|
0070 | B8 93 8E 95 8E 44 97 7A 72 5C F7 13 7F 47 DD CA
|
|
|
|
|
0080 | BD 0F 83 03 DE C7 97 33 96 91 07 04 BD 05 CB 7C
|
|
|
|
|
0090 | B3 4E BA 8E 3B C0 06 F7 26 80 A5 91 0E 23 F3 D2
|
|
|
|
|
00A0 | 4A DE DA 33 FD F7 D2 92 6A 40 2A 3D 97 F8 45 95
|
|
|
|
|
00B0 | 87 32 77 E2 C1 9C 87 23 85 F8 D0 64 CE 00 8D 4E
|
|
|
|
|
00C0 | 91 7B FA DF D4 AE 79 C7 82 66 0A 04 95 CD F6 8E
|
|
|
|
|
00D0 | 96 2E 11 3F 95 89 27 2E 5A 86 6B BB 60 A0 ED 22
|
|
|
|
|
00E0 | 6F 35 1C 12 2B E0 76 6A 2A 44 72 74 15 87 08 70
|
|
|
|
|
00F0 | 9A 82 83 41 99 E2 B2 BF 73 79 9B 20 40 74 D3 99
|
|
|
|
|
0100 | 43 21 75 C2 A8 A6 5A AD 47 97 26 DA C0 0D DF 0B
|
|
|
|
|
0110 | AA 12 5F 2C C2 F6 14 40 4E EA 2E A4 BC 0F 6A 26
|
|
|
|
|
0120 | 36 BF 1E 20 81 8F 80 C7 C7 14 A0 0B 9B 9B 3C 5A</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 = BA0D89B593102CAEBB919E9C27B000AA59D83FD78D2B592A7F3ED10F45D406FD359FD1D
|
|
|
|
|
<tr>
|
|
|
|
|
<td>nonce</td>
|
|
|
|
|
<td>4, 16</td>
|
|
|
|
|
<td><code>93102CAEBB919E9C27B000AA59D83FD7</code></td>
|
|
|
|
|
<td><code>4436926E471BC5A7A3BFE6594969EFF6</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>20, 16</td>
|
|
|
|
|
<td><code>8D2B592A7F3ED10F45D406FD359FD1D0</code></td>
|
|
|
|
|
<td><code>3E119F7C04201FBF1C6641C4A6EE5864</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>g_b</td>
|
|
|
|
|
<td>36, 260</td>
|
|
|
|
|
<td><code>FE000100C1781601FF80F73A9C5446B9</code> <code>646E0592D84D80ADB8983E57C871E138</code> <code>6BCCEAFDC784FA30CE9430454CB6E5A2</code> <code>AB396F39E0EEC41B01B256391BAA2C52</code> <code>BD0EB15AE478B23A08A8D499EB75A9B8</code> <code>FC630F2D591C41783B8AE021B30FE570</code> <code>13B311CE776E6DA995DE02A6C6FC8282</code> <code>3DBC81F3119B953B95F20AF505242CD6</code> <code>3517650D0C03B72223531172AC02CA50</code> <code>FD0E2526D24D911BE9AFDCD25A1C5F18</code> <code>538796B51AFD2FCE0CEAB4E681544717</code> <code>44418B3D76F8047DC81E664E475B8131</code> <code>F133F9817B2E0D38AF1AEB4D60FAF4AB</code> <code>E091A4A282B3D8D138765795810C0868</code> <code>1F680250900D7507B43D14EDA99449D1</code> <code>A7DD6BFB69BCE48399D3D52E5059269E</code><br> <code>3782B951</code></td>
|
|
|
|
|
<td><code>FE0001007E0A64D764CE7D6D2CD1F353</code> <code>3ABF0B61FB031D2EBFA5601799B80537</code> <code>569458B5BCD65DC2C6BCC9848FE78E14</code> <code>41E9D28C89D7E22B8ECF0FF6B06970E0</code> <code>7B1FE031B8938E958E44977A725CF713</code> <code>7F47DDCABD0F8303DEC7973396910704</code> <code>BD05CB7CB34EBA8E3BC006F72680A591</code> <code>0E23F3D24ADEDA33FDF7D2926A402A3D</code> <code>97F84595873277E2C19C872385F8D064</code> <code>CE008D4E917BFADFD4AE79C782660A04</code> <code>95CDF68E962E113F9589272E5A866BBB</code> <code>60A0ED226F351C122BE0766A2A447274</code> <code>158708709A82834199E2B2BF73799B20</code> <code>4074D399432175C2A8A65AAD479726DA</code> <code>C00DDF0BAA125F2CC2F614404EEA2EA4</code> <code>BC0F6A2636BF1E20818F80C7C714A00B</code><br> <code>9B9B3C5A</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 = BA0D89B593102CAEBB919E9C27B000AA59D83FD78D2B592A7F3ED10F45D406FD359FD1D
|
|
|
|
|
<!-- 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 = 54B6436693102CAEBB919E9C27B000AA59D83FD78D2B592A7F3ED10F45D406FD359FD1D00000000000000000FE000100C1781601FF80F73A9C5446B9646E0592D84D80ADB8983E57C871E1386BCCEAFDC784FA30CE9430454CB6E5A2AB396F39E0EEC41B01B256391BAA2C52BD0EB15AE478B23A08A8D499EB75A9B8FC630F2D591C41783B8AE021B30FE57013B311CE776E6DA995DE02A6C6FC82823DBC81F3119B953B95F20AF505242CD63517650D0C03B72223531172AC02CA50FD0E2526D24D911BE9AFDCD25A1C5F18538796B51AFD2FCE0CEAB4E68154471744418B3D76F8047DC81E664E475B8131F133F9817B2E0D38AF1AEB4D60FAF4ABE091A4A282B3D8D138765795810C08681F680250900D7507B43D14EDA99449D1A7DD6BFB69BCE48399D3D52E5059269E3782B951
|
|
|
|
|
padding = 5407123B9B60C50933258AB3
|
|
|
|
|
tmp_aes_key = 50D5A9339BAD43D2C764AB7335AED393F367BFE6C5D8EB4518468F7478DFA7DF
|
|
|
|
|
tmp_aes_iv = 056F5C6B4E865E1617D6D5FFA603BD40556F13DF5839A806D036908F095D4535</code></pre>
|
|
|
|
|
<pre><code>data = 54B643664436926E471BC5A7A3BFE6594969EFF63E119F7C04201FBF1C6641C4A6EE58640000000000000000FE0001007E0A64D764CE7D6D2CD1F3533ABF0B61FB031D2EBFA5601799B80537569458B5BCD65DC2C6BCC9848FE78E1441E9D28C89D7E22B8ECF0FF6B06970E07B1FE031B8938E958E44977A725CF7137F47DDCABD0F8303DEC7973396910704BD05CB7CB34EBA8E3BC006F72680A5910E23F3D24ADEDA33FDF7D2926A402A3D97F84595873277E2C19C872385F8D064CE008D4E917BFADFD4AE79C782660A0495CDF68E962E113F9589272E5A866BBB60A0ED226F351C122BE0766A2A447274158708709A82834199E2B2BF73799B204074D399432175C2A8A65AAD479726DAC00DDF0BAA125F2CC2F614404EEA2EA4BC0F6A2636BF1E20818F80C7C714A00B9B9B3C5A
|
|
|
|
|
padding = 4291D92FF3F3CC64DF28BFF2
|
|
|
|
|
tmp_aes_key = 19FF563FC6595F36B2B7E11EE1C8DD0D9621705A8A9D1A94F7E92B44A80E5263
|
|
|
|
|
tmp_aes_iv = 3F9571D56B8A52725AA6191E34CD015E2BB36446736E5E44F1B63CF7A441F5F5</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 = ABC1E578AE5AE4F70E9B27E977BAA9B0D334AA37FD8688695CAEC3811EB7F6229FCD16F5BD9936E69A9FF77BBD2EEEE5FBC65F64C1AF6796D5E9D7B45BCFE95D79AD5BA3445B5BC1887EE4A84867D7C8E08142566414EB1842D3EC540B8E1F039F712A9CD699F046DF0438C4ECC6F2169CF229CDA4EA7F71A36FF8736828A9298FC8737A9B1CE42F237FFCA23DCA1E350D09466994AA879EDFC523405C4CB0BB8551C02CC69EB3D2D0F9FE614872C83602AFF3E9BD7EBFB92B6E53472FB7803A79AF626BABC75D96D24D5B94D7D117BE613BB8DDC22318F04BB88B1D638E95D21346C7EB6F2AA058AF3F183FE490772E16063D34987418DEE2BD5BE47CB4527F50716ACE6CE3EC0276680A5D29C98118A852D99BA06D16C1A68BA22D02C95C7F41ACEE1F0BAFABC6E8C0CF558DFA5AFC3AFEC2B9C91109FB182CB553D9EB4EE5BA7F6E29202122AC78C0E0040B77FC12</code></pre>
|
|
|
|
|
<pre><code>encrypted_data = 18A392A24AD8E840E5CA8B0C7FA14D23339D9DC0BC73CE81CE7451203B6CE2ACD25CB746C839ABAEA5994BE8827047BD6091C98C815B570FC76DEB448143F1E4CDEFBD682EA03A3A943DF92F54C0B0C6B50E14018C4C92058A5613A74065D1DF1F87F6D7E668A94140344F848268498AC33ED2B1BE6EA2ECD77FEF169221BA144E1CC0339C3C23CC32C9A9C6B00E9F7057B652337555B6A0D7C5CE1B41D27C93AF1C23626EF7BCAD06A59A35CFA062F53CCEAF0D154A8D50E2B150DA5A8913629DFC7EB532CD20C45649A50ED5F98BBFDE18C17BF56725608A7D3887375B08FB5865778E269D6293498D5AF4986A6190357214C7302DEB86ABA0DBA2F7FE3EDBB020615F1A54D9AE6E5A0313308F74F6866CD3D77C0B90152EBFEE24CB7A402752BA169EDAC197E004C34D7084511E72248D098E7D2AD597774870496EE7A0DA89BF585877C2362ECE0CD210EDE03328</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 FC 2C 0F 00 9E 54 7C 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 93 10 2C AE BB 91 9E 9C
|
|
|
|
|
0020 | 27 B0 00 AA 59 D8 3F D7 8D 2B 59 2A 7F 3E D1 0F
|
|
|
|
|
0030 | 45 D4 06 FD 35 9F D1 D0 FE 50 01 00 AB C1 E5 78
|
|
|
|
|
0040 | AE 5A E4 F7 0E 9B 27 E9 77 BA A9 B0 D3 34 AA 37
|
|
|
|
|
0050 | FD 86 88 69 5C AE C3 81 1E B7 F6 22 9F CD 16 F5
|
|
|
|
|
0060 | BD 99 36 E6 9A 9F F7 7B BD 2E EE E5 FB C6 5F 64
|
|
|
|
|
0070 | C1 AF 67 96 D5 E9 D7 B4 5B CF E9 5D 79 AD 5B A3
|
|
|
|
|
0080 | 44 5B 5B C1 88 7E E4 A8 48 67 D7 C8 E0 81 42 56
|
|
|
|
|
0090 | 64 14 EB 18 42 D3 EC 54 0B 8E 1F 03 9F 71 2A 9C
|
|
|
|
|
00A0 | D6 99 F0 46 DF 04 38 C4 EC C6 F2 16 9C F2 29 CD
|
|
|
|
|
00B0 | A4 EA 7F 71 A3 6F F8 73 68 28 A9 29 8F C8 73 7A
|
|
|
|
|
00C0 | 9B 1C E4 2F 23 7F FC A2 3D CA 1E 35 0D 09 46 69
|
|
|
|
|
00D0 | 94 AA 87 9E DF C5 23 40 5C 4C B0 BB 85 51 C0 2C
|
|
|
|
|
00E0 | C6 9E B3 D2 D0 F9 FE 61 48 72 C8 36 02 AF F3 E9
|
|
|
|
|
00F0 | BD 7E BF B9 2B 6E 53 47 2F B7 80 3A 79 AF 62 6B
|
|
|
|
|
0100 | AB C7 5D 96 D2 4D 5B 94 D7 D1 17 BE 61 3B B8 DD
|
|
|
|
|
0110 | C2 23 18 F0 4B B8 8B 1D 63 8E 95 D2 13 46 C7 EB
|
|
|
|
|
0120 | 6F 2A A0 58 AF 3F 18 3F E4 90 77 2E 16 06 3D 34
|
|
|
|
|
0130 | 98 74 18 DE E2 BD 5B E4 7C B4 52 7F 50 71 6A CE
|
|
|
|
|
0140 | 6C E3 EC 02 76 68 0A 5D 29 C9 81 18 A8 52 D9 9B
|
|
|
|
|
0150 | A0 6D 16 C1 A6 8B A2 2D 02 C9 5C 7F 41 AC EE 1F
|
|
|
|
|
0160 | 0B AF AB C6 E8 C0 CF 55 8D FA 5A FC 3A FE C2 B9
|
|
|
|
|
0170 | C9 11 09 FB 18 2C B5 53 D9 EB 4E E5 BA 7F 6E 29
|
|
|
|
|
0180 | 20 21 22 AC 78 C0 E0 04 0B 77 FC 12</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 D8 4E 0B 00 DD 0D 80 66
|
|
|
|
|
0010 | 78 01 00 00 1F 5F 04 F5 44 36 92 6E 47 1B C5 A7
|
|
|
|
|
0020 | A3 BF E6 59 49 69 EF F6 3E 11 9F 7C 04 20 1F BF
|
|
|
|
|
0030 | 1C 66 41 C4 A6 EE 58 64 FE 50 01 00 18 A3 92 A2
|
|
|
|
|
0040 | 4A D8 E8 40 E5 CA 8B 0C 7F A1 4D 23 33 9D 9D C0
|
|
|
|
|
0050 | BC 73 CE 81 CE 74 51 20 3B 6C E2 AC D2 5C B7 46
|
|
|
|
|
0060 | C8 39 AB AE A5 99 4B E8 82 70 47 BD 60 91 C9 8C
|
|
|
|
|
0070 | 81 5B 57 0F C7 6D EB 44 81 43 F1 E4 CD EF BD 68
|
|
|
|
|
0080 | 2E A0 3A 3A 94 3D F9 2F 54 C0 B0 C6 B5 0E 14 01
|
|
|
|
|
0090 | 8C 4C 92 05 8A 56 13 A7 40 65 D1 DF 1F 87 F6 D7
|
|
|
|
|
00A0 | E6 68 A9 41 40 34 4F 84 82 68 49 8A C3 3E D2 B1
|
|
|
|
|
00B0 | BE 6E A2 EC D7 7F EF 16 92 21 BA 14 4E 1C C0 33
|
|
|
|
|
00C0 | 9C 3C 23 CC 32 C9 A9 C6 B0 0E 9F 70 57 B6 52 33
|
|
|
|
|
00D0 | 75 55 B6 A0 D7 C5 CE 1B 41 D2 7C 93 AF 1C 23 62
|
|
|
|
|
00E0 | 6E F7 BC AD 06 A5 9A 35 CF A0 62 F5 3C CE AF 0D
|
|
|
|
|
00F0 | 15 4A 8D 50 E2 B1 50 DA 5A 89 13 62 9D FC 7E B5
|
|
|
|
|
0100 | 32 CD 20 C4 56 49 A5 0E D5 F9 8B BF DE 18 C1 7B
|
|
|
|
|
0110 | F5 67 25 60 8A 7D 38 87 37 5B 08 FB 58 65 77 8E
|
|
|
|
|
0120 | 26 9D 62 93 49 8D 5A F4 98 6A 61 90 35 72 14 C7
|
|
|
|
|
0130 | 30 2D EB 86 AB A0 DB A2 F7 FE 3E DB B0 20 61 5F
|
|
|
|
|
0140 | 1A 54 D9 AE 6E 5A 03 13 30 8F 74 F6 86 6C D3 D7
|
|
|
|
|
0150 | 7C 0B 90 15 2E BF EE 24 CB 7A 40 27 52 BA 16 9E
|
|
|
|
|
0160 | DA C1 97 E0 04 C3 4D 70 84 51 1E 72 24 8D 09 8E
|
|
|
|
|
0170 | 7D 2A D5 97 77 48 70 49 6E E7 A0 DA 89 BF 58 58
|
|
|
|
|
0180 | 77 C2 36 2E CE 0C D2 10 ED E0 33 28</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>FC2C0F009E547C66</code></td>
|
|
|
|
|
<td><code>D84E0B00DD0D8066</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>93102CAEBB919E9C27B000AA59D83FD7</code></td>
|
|
|
|
|
<td><code>4436926E471BC5A7A3BFE6594969EFF6</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>8D2B592A7F3ED10F45D406FD359FD1D0</code></td>
|
|
|
|
|
<td><code>3E119F7C04201FBF1C6641C4A6EE5864</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>encrypted_data</td>
|
|
|
|
|
<td>56, 340</td>
|
|
|
|
|
<td><code>FE500100ABC1E578AE5AE4F70E9B27E9</code> <code>77BAA9B0D334AA37FD8688695CAEC381</code> <code>1EB7F6229FCD16F5BD9936E69A9FF77B</code> <code>BD2EEEE5FBC65F64C1AF6796D5E9D7B4</code> <code>5BCFE95D79AD5BA3445B5BC1887EE4A8</code> <code>4867D7C8E08142566414EB1842D3EC54</code> <code>0B8E1F039F712A9CD699F046DF0438C4</code> <code>ECC6F2169CF229CDA4EA7F71A36FF873</code> <code>6828A9298FC8737A9B1CE42F237FFCA2</code> <code>3DCA1E350D09466994AA879EDFC52340</code> <code>5C4CB0BB8551C02CC69EB3D2D0F9FE61</code> <code>4872C83602AFF3E9BD7EBFB92B6E5347</code> <code>2FB7803A79AF626BABC75D96D24D5B94</code> <code>D7D117BE613BB8DDC22318F04BB88B1D</code> <code>638E95D21346C7EB6F2AA058AF3F183F</code> <code>E490772E16063D34987418DEE2BD5BE4</code> <code>7CB4527F50716ACE6CE3EC0276680A5D</code> <code>29C98118A852D99BA06D16C1A68BA22D</code> <code>02C95C7F41ACEE1F0BAFABC6E8C0CF55</code> <code>8DFA5AFC3AFEC2B9C91109FB182CB553</code> <code>D9EB4EE5BA7F6E29202122AC78C0E004</code><br> <code>0B77FC12</code></td>
|
|
|
|
|
<td><code>FE50010018A392A24AD8E840E5CA8B0C</code> <code>7FA14D23339D9DC0BC73CE81CE745120</code> <code>3B6CE2ACD25CB746C839ABAEA5994BE8</code> <code>827047BD6091C98C815B570FC76DEB44</code> <code>8143F1E4CDEFBD682EA03A3A943DF92F</code> <code>54C0B0C6B50E14018C4C92058A5613A7</code> <code>4065D1DF1F87F6D7E668A94140344F84</code> <code>8268498AC33ED2B1BE6EA2ECD77FEF16</code> <code>9221BA144E1CC0339C3C23CC32C9A9C6</code> <code>B00E9F7057B652337555B6A0D7C5CE1B</code> <code>41D27C93AF1C23626EF7BCAD06A59A35</code> <code>CFA062F53CCEAF0D154A8D50E2B150DA</code> <code>5A8913629DFC7EB532CD20C45649A50E</code> <code>D5F98BBFDE18C17BF56725608A7D3887</code> <code>375B08FB5865778E269D6293498D5AF4</code> <code>986A6190357214C7302DEB86ABA0DBA2</code> <code>F7FE3EDBB020615F1A54D9AE6E5A0313</code> <code>308F74F6866CD3D77C0B90152EBFEE24</code> <code>CB7A402752BA169EDAC197E004C34D70</code> <code>84511E72248D098E7D2AD59777487049</code> <code>6EE7A0DA89BF585877C2362ECE0CD210</code><br> <code>EDE03328</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 = 1835C5216BBC405490789296866B99CDC7C1540970D809B10F7F40E137317B99827E8A6DF5B87897AF5E05D1460AA478C0DA3269B01E652697D9983390B6BB3B0A67CEB0611F04B3EA4344CA00647695E7BD1DD73F5BAA2C8CB35ED738A8455136E0A9C9EC16E588806CD09740A0ED5DC639BA4D2968AB521A4D14EBD9B922036AAD15C080D54E3579E2548CB657F5B1F47EC6C30B162F833E089F510C712C687CA7BC951AF0D5764831506AF63D73B319E9BDD1DD8BA59D7CFC0EAC0378C3D4BB9A733206457704908B8843FECC11A2BFE9DA258834091182C9627AB80D40863F399863B8AF627B5E6B1C1C0B05C57EBDFD63BDA710A4626DFDB62A28D951B0</code></pre>
|
|
|
|
|
<pre><code>auth_key = 440EEC95D09DAE497D84A0DFFD34CF45B13F241E115088D41C4C8E6E9220CCFEA9EFB666CEF83D09F12E7F9B34B2AEBABDC868910548A6C883CB505D9987170CC361327B0B1F15C1A6FD4BB2019E2694863F754A1F7F5865C8CEF54198BFCAF1D9682DBD54AA1AE070ABAABF47A421C5A435382B95B01E67D42A705936560BC13057DCBA30133243832B6799CEE274F72622DDF8904C3323F1220C427EFEFD517468E522B526FED3A03C31AA014D7423CC8D15AD567E7E37E411B5DF2ED964C8502460E6BC67D0390AA277BBE30AFB0B4047D6DD628BEC92DF037059061456F04D5AEA054F1388D8870502EAFE3D7A6A5123952125E22B6854F373AECE6B13DF</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 34 A9 38 9F 54 7C 66
|
|
|
|
|
0010 | AC 00 00 00 34 F7 CB 3B 93 10 2C AE BB 91 9E 9C
|
|
|
|
|
0020 | 27 B0 00 AA 59 D8 3F D7 8D 2B 59 2A 7F 3E D1 0F
|
|
|
|
|
0030 | 45 D4 06 FD 35 9F D1 D0 64 05 E8 75 E3 D3 40 7C
|
|
|
|
|
0040 | C5 91 75 1C CF AA 46 E2</code></pre>
|
|
|
|
|
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 AC 82 9F DE 0D 80 66
|
|
|
|
|
0010 | 68 00 00 00 34 F7 CB 3B 44 36 92 6E 47 1B C5 A7
|
|
|
|
|
0020 | A3 BF E6 59 49 69 EF F6 3E 11 9F 7C 04 20 1F BF
|
|
|
|
|
0030 | 1C 66 41 C4 A6 EE 58 64 A1 EF ED 43 84 82 9C 4F
|
|
|
|
|
0040 | E7 2A 10 D9 B0 FD 47 A2</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>0134A9389F547C66</code></td>
|
|
|
|
|
<td><code>01AC829FDE0D8066</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>AC000000</code> (172 in decimal)</td>
|
|
|
|
|
<td><code>68000000</code> (104 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>93102CAEBB919E9C27B000AA59D83FD7</code></td>
|
|
|
|
|
<td><code>4436926E471BC5A7A3BFE6594969EFF6</code></td>
|
|
|
|
|
<td>Value generated by client in Step 1</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>server_nonce</td>
|
|
|
|
|
<td>40, 16</td>
|
|
|
|
|
<td><code>8D2B592A7F3ED10F45D406FD359FD1D0</code></td>
|
|
|
|
|
<td><code>3E119F7C04201FBF1C6641C4A6EE5864</code></td>
|
|
|
|
|
<td>Value received from server in Step 2</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>new_nonce_hash1</td>
|
|
|
|
|
<td>56, 16</td>
|
|
|
|
|
<td><code>6405E875E3D3407CC591751CCFAA46E2</code></td>
|
|
|
|
|
<td><code>A1EFED4384829C4FE72A10D9B0FD47A2</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>
|
|
|
|
|