mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2025-01-05 18:38:19 +01:00
Update content of files
This commit is contained in:
parent
61ef9d75bd
commit
6732477a21
3 changed files with 208 additions and 218 deletions
|
@ -192,8 +192,8 @@ When the stories of a user are marked as hidden, the <code>stories_hidden</code>
|
|||
<a href='/method/stories.getStoryViewsList'>stories.getStoryViewsList</a>#7ed23c57 flags:<a href='/type/%23'>#</a> just_contacts:flags.0?<a href='/constructor/true'>true</a> reactions_first:flags.2?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> q:flags.1?<a href='/type/string'>string</a> id:<a href='/type/int'>int</a> offset:<a href='/type/string'>string</a> limit:<a href='/type/int'>int</a> = <a href='/type/stories.StoryViewsList'>stories.StoryViewsList</a>;
|
||||
|
||||
<a href='/method/stories.getStoriesViews'>stories.getStoriesViews</a>#28e16cc8 peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/Vector%20t'>Vector</a><<a href='/type/int'>int</a>> = <a href='/type/stories.StoryViews'>stories.StoryViews</a>;</code></pre>
|
||||
<p>Use <a href="/method/stories.getStoryViewsList">stories.getStoryViewsList</a> to obtain the list of users that have viewed a specific story we posted, returned as a list of <a href="/constructor/storyView">storyView</a> constructors; pass the returned <code>next_offset</code> (if present) to <code>offset</code> to paginate through the results. </p>
|
||||
<p>Use <a href="/method/stories.getStoriesViews">stories.getStoriesViews</a> to obtain info about the view count, forward count, reactions and recent viewers of one or more stories, using a single, unpaginated method call. </p>
|
||||
<p>Use <a href="/method/stories.getStoryViewsList">stories.getStoryViewsList</a> to obtain the full list of users that have viewed a specific story we posted, returned as a list of <a href="/constructor/storyView">storyView</a> constructors; pass the returned <code>next_offset</code> (if present) to <code>offset</code> to paginate through the results. </p>
|
||||
<p>Use <a href="/method/stories.getStoriesViews">stories.getStoriesViews</a> to obtain info about the view count, forward count, reactions and recent viewers list of one or more stories, using a single, unpaginated method call, obviously potentially returning less info than <a href="/method/stories.getStoryViewsList">stories.getStoryViewsList</a>. </p>
|
||||
<h3><a class="anchor" href="#replying-to-stories" id="replying-to-stories" name="replying-to-stories"><i class="anchor-icon"></i></a>Replying to stories</h3>
|
||||
<pre><code><a href='/constructor/inputReplyToStory'>inputReplyToStory</a>#15b0f283 user_id:<a href='/type/InputUser'>InputUser</a> story_id:<a href='/type/int'>int</a> = <a href='/type/InputReplyTo'>InputReplyTo</a>;
|
||||
|
||||
|
|
|
@ -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 14 84 07 00 89 41 6A 65
|
||||
0010 | 14 00 00 00 F1 8E 7E BE C2 8F 15 55 BD 72 6E 6D
|
||||
0020 | 31 75 6E 83 F8 5D A7 39</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 04 95 08 00 92 48 6A 65
|
||||
0010 | 14 00 00 00 F1 8E 7E BE E2 A2 03 78 80 7D D3 38
|
||||
0020 | 7B 46 CE C6 CC 91 8F 48</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>1484070089416A65</code></td>
|
||||
<td><code>0495080092486A65</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>C28F1555BD726E6D31756E83F85DA739</code></td>
|
||||
<td><code>E2A20378807DD3387B46CEC6CC918F48</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 3C 05 6D 89 41 6A 65
|
||||
0010 | 5C 00 00 00 63 24 16 05 C2 8F 15 55 BD 72 6E 6D
|
||||
0020 | 31 75 6E 83 F8 5D A7 39 F0 08 06 90 63 A5 C6 AF
|
||||
0030 | 2F 54 CD DD 23 3E 76 7C 08 1B 86 E2 01 26 86 DB
|
||||
0040 | EF 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 7C E8 51 92 48 6A 65
|
||||
0010 | 88 00 00 00 63 24 16 05 E2 A2 03 78 80 7D D3 38
|
||||
0020 | 7B 46 CE C6 CC 91 8F 48 92 54 F3 93 E5 FB 43 86
|
||||
0030 | 98 FA 57 A7 44 1D 98 38 08 19 98 68 30 5A F3 05
|
||||
0040 | 9D 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>013C056D89416A65</code></td>
|
||||
<td><code>017CE85192486A65</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>88000000</code> (136 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -150,19 +150,19 @@
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>C28F1555BD726E6D31756E83F85DA739</code></td>
|
||||
<td><code>E2A20378807DD3387B46CEC6CC918F48</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>F008069063A5C6AF2F54CDDD233E767C</code></td>
|
||||
<td><code>9254F393E5FB438698FA57A7441D9838</code></td>
|
||||
<td>Server-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pq</td>
|
||||
<td>56, 12</td>
|
||||
<td><code>081B86E2012686DBEF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1983521180472499183</td>
|
||||
<td><code>08199868305AF3059D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1844338604301813149</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 = 1983521180472499183</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1983521180472499183 = 1102309289 * 1799423447</code></p>
|
||||
<pre><code>p = 1102309289
|
||||
q = 1799423447</code></pre>
|
||||
<pre><code>pq = 1844338604301813149</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>1844338604301813149 = 1244688997 * 1481766617</code></p>
|
||||
<pre><code>p = 1244688997
|
||||
q = 1481766617</code></pre>
|
||||
<!-- end pq -->
|
||||
<h4><a class="anchor" href="#presenting-proof-of-work-server-authentication" id="presenting-proof-of-work-server-authentication" name="presenting-proof-of-work-server-authentication"><i class="anchor-icon"></i></a>Presenting proof of work; Server authentication</h4>
|
||||
<h5><a class="anchor" href="#4-encrypted-data-payload-generation" id="4-encrypted-data-payload-generation" name="4-encrypted-data-payload-generation"><i class="anchor-icon"></i></a>4) <code>encrypted_data</code> payload generation</h5>
|
||||
<p>First of all, generate an <code>encrypted_data</code> payload as follows:</p>
|
||||
<!-- start p_q_inner_data_dc -->
|
||||
<p>Generated payload (excluding transport headers/trailers):</p>
|
||||
<pre><code>0000 | 95 5F F5 A9 08 1B 86 E2 01 26 86 DB EF 00 00 00
|
||||
0010 | 04 41 B3 E7 A9 00 00 00 04 6B 41 05 D7 00 00 00
|
||||
0020 | C2 8F 15 55 BD 72 6E 6D 31 75 6E 83 F8 5D A7 39
|
||||
0030 | F0 08 06 90 63 A5 C6 AF 2F 54 CD DD 23 3E 76 7C
|
||||
0040 | 28 62 5E DE BB DE FA A3 96 71 02 93 12 0B 03 D6
|
||||
0050 | 5B 75 C3 F7 7F 2E 76 3F E5 7C 11 57 8E 46 8B 5A
|
||||
<pre><code>0000 | 95 5F F5 A9 08 19 98 68 30 5A F3 05 9D 00 00 00
|
||||
0010 | 04 4A 30 72 65 00 00 00 04 58 51 F6 D9 00 00 00
|
||||
0020 | E2 A2 03 78 80 7D D3 38 7B 46 CE C6 CC 91 8F 48
|
||||
0030 | 92 54 F3 93 E5 FB 43 86 98 FA 57 A7 44 1D 98 38
|
||||
0040 | 84 80 1F 4C 0A E1 2B A4 10 94 7A 69 D0 B2 8B 44
|
||||
0050 | 02 9D 23 01 CA 74 1B 38 14 11 17 36 6E 28 94 E6
|
||||
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 = 1799423447</code></pre>
|
|||
<tr>
|
||||
<td>pq</td>
|
||||
<td>4, 12</td>
|
||||
<td><code>081B86E2012686DBEF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1983521180472499183</td>
|
||||
<td><code>08199868305AF3059D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1844338604301813149</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>0441B3E7A9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1102309289</td>
|
||||
<td><code>044A307265000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1244688997</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>046B4105D7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1799423447</td>
|
||||
<td><code>045851F6D9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1481766617</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>C28F1555BD726E6D31756E83F85DA739</code></td>
|
||||
<td><code>E2A20378807DD3387B46CEC6CC918F48</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>48, 16</td>
|
||||
<td><code>F008069063A5C6AF2F54CDDD233E767C</code></td>
|
||||
<td><code>9254F393E5FB438698FA57A7441D9838</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce</td>
|
||||
<td>64, 32</td>
|
||||
<td><code>28625EDEBBDEFAA396710293120B03D6</code> <code>5B75C3F77F2E763FE57C11578E468B5A</code></td>
|
||||
<td><code>84801F4C0AE12BA410947A69D0B28B44</code> <code>029D2301CA741B38141117366E2894E6</code></td>
|
||||
<td>Client-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -291,39 +291,39 @@ q = 1799423447</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 = 955FF5A9081B86E2012686DBEF0000000441B3E7A9000000046B4105D7000000C28F1555BD726E6D31756E83F85DA739F008069063A5C6AF2F54CDDD233E767C28625EDEBBDEFAA396710293120B03D65B75C3F77F2E763FE57C11578E468B5A02000000
|
||||
random_padding_bytes = 0B5C09C0EDD424CA0CF42B8D5A2008FEFF72518E00E41701157AC1155FDE95F56AE4E09B75BFFC25A591974E130AB5B5405B848D2E1FE5925A04B9F9D8D49441CEBFDF40E52B0DFD533F9F4E2B454E9090D7B5953F40A831ADE1334A</code></pre>
|
||||
<pre><code>data = 955FF5A908199868305AF3059D000000044A307265000000045851F6D9000000E2A20378807DD3387B46CEC6CC918F489254F393E5FB438698FA57A7441D983884801F4C0AE12BA410947A69D0B28B44029D2301CA741B38141117366E2894E602000000
|
||||
random_padding_bytes = 7B5BC33A172357E71025980827959970B32388764D3215F03A0185A2B5C4671B54D0FFB91701C8811C154A0CCD9F77E7DDEA868958A9D2320EDA2A41838913929881BF04F8EB602255206115B9117648FDE7938E0351CC499C8F8A0A</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 = B6CB01B9D20D1C5683ABDAA85CF69E219C71DBE0BD0E4A12EC88FF754EF425A198A26C03BC2B012441503CB21CCEAFBFA8042AB1BA9187E771EAAFF1C47C7584545CE57324A507509CBEE613510264205B6C56A82046BB41D89AD5F598C027B7196D2755CA13CB8614CCACA1BFD6586343186BE321D29D76946A683F8F2A175000A581677B2CBA64E342E79A126F61D94B28F3B8222B8CB1E85DC5EA031573B79C2D87AA5F9AF5FB91826B38A3FDBF8C4878A634F0084F7ACB26602B6E3C272DE4406AF4D2DEBCEA61FA200D23E1EC477368C05CE92B968410476F6E2C11DF305BA9C0C7CD385C4E8D14FDDCAB09ED1071AEB0DB20306569419B9AF6B04C99F9</code></pre>
|
||||
<pre><code>encrypted_data = 4DDA98052432E52B903D07CD37A79CAC04EACCDBEEB6B425F5DDD036995F0E17360208AFAFF1EF35F4B6E37BA720CA10CCC9C910301DE511920A2133B4EECAEF096F7B84691E83E92E26A3F997789AF6855582FB83B99FF14F98F921159A2484AE836BB3D1601A861D77539AE0CC5826E40491A1B7CED6781C87D5CA7C5D5C29C80F688860D99421E3EBF133B26008EBE78DD19F05CF34221EAD235BA75AD0C1FECEF133BAA77E5D98334F7E58DB88951AFA0B763CD6EAD3815FCC509A24CA0D16026B349CAD85994281D2C2BA996D9DECFB1EF4738E06ED5678600DA11CF93A1683517CD9332321A87691B190B1FDEEAEA570881F564B2D5A129E162A7F6D65</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 74 BF 0D 00 89 41 6A 65
|
||||
0010 | 40 01 00 00 BE E4 12 D7 C2 8F 15 55 BD 72 6E 6D
|
||||
0020 | 31 75 6E 83 F8 5D A7 39 F0 08 06 90 63 A5 C6 AF
|
||||
0030 | 2F 54 CD DD 23 3E 76 7C 04 41 B3 E7 A9 00 00 00
|
||||
0040 | 04 6B 41 05 D7 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 B6 CB 01 B9 D2 0D 1C 56 83 AB DA A8
|
||||
0060 | 5C F6 9E 21 9C 71 DB E0 BD 0E 4A 12 EC 88 FF 75
|
||||
0070 | 4E F4 25 A1 98 A2 6C 03 BC 2B 01 24 41 50 3C B2
|
||||
0080 | 1C CE AF BF A8 04 2A B1 BA 91 87 E7 71 EA AF F1
|
||||
0090 | C4 7C 75 84 54 5C E5 73 24 A5 07 50 9C BE E6 13
|
||||
00A0 | 51 02 64 20 5B 6C 56 A8 20 46 BB 41 D8 9A D5 F5
|
||||
00B0 | 98 C0 27 B7 19 6D 27 55 CA 13 CB 86 14 CC AC A1
|
||||
00C0 | BF D6 58 63 43 18 6B E3 21 D2 9D 76 94 6A 68 3F
|
||||
00D0 | 8F 2A 17 50 00 A5 81 67 7B 2C BA 64 E3 42 E7 9A
|
||||
00E0 | 12 6F 61 D9 4B 28 F3 B8 22 2B 8C B1 E8 5D C5 EA
|
||||
00F0 | 03 15 73 B7 9C 2D 87 AA 5F 9A F5 FB 91 82 6B 38
|
||||
0100 | A3 FD BF 8C 48 78 A6 34 F0 08 4F 7A CB 26 60 2B
|
||||
0110 | 6E 3C 27 2D E4 40 6A F4 D2 DE BC EA 61 FA 20 0D
|
||||
0120 | 23 E1 EC 47 73 68 C0 5C E9 2B 96 84 10 47 6F 6E
|
||||
0130 | 2C 11 DF 30 5B A9 C0 C7 CD 38 5C 4E 8D 14 FD DC
|
||||
0140 | AB 09 ED 10 71 AE B0 DB 20 30 65 69 41 9B 9A F6
|
||||
0150 | B0 4C 99 F9</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 DC 91 0B 00 92 48 6A 65
|
||||
0010 | 40 01 00 00 BE E4 12 D7 E2 A2 03 78 80 7D D3 38
|
||||
0020 | 7B 46 CE C6 CC 91 8F 48 92 54 F3 93 E5 FB 43 86
|
||||
0030 | 98 FA 57 A7 44 1D 98 38 04 4A 30 72 65 00 00 00
|
||||
0040 | 04 58 51 F6 D9 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 4D DA 98 05 24 32 E5 2B 90 3D 07 CD
|
||||
0060 | 37 A7 9C AC 04 EA CC DB EE B6 B4 25 F5 DD D0 36
|
||||
0070 | 99 5F 0E 17 36 02 08 AF AF F1 EF 35 F4 B6 E3 7B
|
||||
0080 | A7 20 CA 10 CC C9 C9 10 30 1D E5 11 92 0A 21 33
|
||||
0090 | B4 EE CA EF 09 6F 7B 84 69 1E 83 E9 2E 26 A3 F9
|
||||
00A0 | 97 78 9A F6 85 55 82 FB 83 B9 9F F1 4F 98 F9 21
|
||||
00B0 | 15 9A 24 84 AE 83 6B B3 D1 60 1A 86 1D 77 53 9A
|
||||
00C0 | E0 CC 58 26 E4 04 91 A1 B7 CE D6 78 1C 87 D5 CA
|
||||
00D0 | 7C 5D 5C 29 C8 0F 68 88 60 D9 94 21 E3 EB F1 33
|
||||
00E0 | B2 60 08 EB E7 8D D1 9F 05 CF 34 22 1E AD 23 5B
|
||||
00F0 | A7 5A D0 C1 FE CE F1 33 BA A7 7E 5D 98 33 4F 7E
|
||||
0100 | 58 DB 88 95 1A FA 0B 76 3C D6 EA D3 81 5F CC 50
|
||||
0110 | 9A 24 CA 0D 16 02 6B 34 9C AD 85 99 42 81 D2 C2
|
||||
0120 | BA 99 6D 9D EC FB 1E F4 73 8E 06 ED 56 78 60 0D
|
||||
0130 | A1 1C F9 3A 16 83 51 7C D9 33 23 21 A8 76 91 B1
|
||||
0140 | 90 B1 FD EE AE A5 70 88 1F 56 4B 2D 5A 12 9E 16
|
||||
0150 | 2A 7F 6D 65</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 = 0B5C09C0EDD424CA0CF42B8D5A2008FEFF72518E00E41701157AC1155
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>74BF0D0089416A65</code></td>
|
||||
<td><code>DC910B0092486A65</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 = 0B5C09C0EDD424CA0CF42B8D5A2008FEFF72518E00E41701157AC1155
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>C28F1555BD726E6D31756E83F85DA739</code></td>
|
||||
<td><code>E2A20378807DD3387B46CEC6CC918F48</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>F008069063A5C6AF2F54CDDD233E767C</code></td>
|
||||
<td><code>9254F393E5FB438698FA57A7441D9838</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p</td>
|
||||
<td>56, 8</td>
|
||||
<td><code>0441B3E7A9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1102309289</td>
|
||||
<td><code>044A307265000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1244688997</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>046B4105D7000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1799423447</td>
|
||||
<td><code>045851F6D9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1481766617</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 = 0B5C09C0EDD424CA0CF42B8D5A2008FEFF72518E00E41701157AC1155
|
|||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>80, 260</td>
|
||||
<td><code>FE000100B6CB01B9D20D1C5683ABDAA8</code> <code>5CF69E219C71DBE0BD0E4A12EC88FF75</code> <code>4EF425A198A26C03BC2B012441503CB2</code> <code>1CCEAFBFA8042AB1BA9187E771EAAFF1</code> <code>C47C7584545CE57324A507509CBEE613</code> <code>510264205B6C56A82046BB41D89AD5F5</code> <code>98C027B7196D2755CA13CB8614CCACA1</code> <code>BFD6586343186BE321D29D76946A683F</code> <code>8F2A175000A581677B2CBA64E342E79A</code> <code>126F61D94B28F3B8222B8CB1E85DC5EA</code> <code>031573B79C2D87AA5F9AF5FB91826B38</code> <code>A3FDBF8C4878A634F0084F7ACB26602B</code> <code>6E3C272DE4406AF4D2DEBCEA61FA200D</code> <code>23E1EC477368C05CE92B968410476F6E</code> <code>2C11DF305BA9C0C7CD385C4E8D14FDDC</code> <code>AB09ED1071AEB0DB20306569419B9AF6</code><br> <code>B04C99F9</code></td>
|
||||
<td><code>FE0001004DDA98052432E52B903D07CD</code> <code>37A79CAC04EACCDBEEB6B425F5DDD036</code> <code>995F0E17360208AFAFF1EF35F4B6E37B</code> <code>A720CA10CCC9C910301DE511920A2133</code> <code>B4EECAEF096F7B84691E83E92E26A3F9</code> <code>97789AF6855582FB83B99FF14F98F921</code> <code>159A2484AE836BB3D1601A861D77539A</code> <code>E0CC5826E40491A1B7CED6781C87D5CA</code> <code>7C5D5C29C80F688860D99421E3EBF133</code> <code>B26008EBE78DD19F05CF34221EAD235B</code> <code>A75AD0C1FECEF133BAA77E5D98334F7E</code> <code>58DB88951AFA0B763CD6EAD3815FCC50</code> <code>9A24CA0D16026B349CAD85994281D2C2</code> <code>BA996D9DECFB1EF4738E06ED5678600D</code> <code>A11CF93A1683517CD9332321A87691B1</code> <code>90B1FDEEAEA570881F564B2D5A129E16</code><br> <code>2A7F6D65</code></td>
|
||||
<td>Value generated above</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -402,47 +402,47 @@ random_padding_bytes = 0B5C09C0EDD424CA0CF42B8D5A2008FEFF72518E00E41701157AC1155
|
|||
<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 40 FB 0A 8A 41 6A 65
|
||||
0010 | 90 02 00 00 5C 07 E8 D0 C2 8F 15 55 BD 72 6E 6D
|
||||
0020 | 31 75 6E 83 F8 5D A7 39 F0 08 06 90 63 A5 C6 AF
|
||||
0030 | 2F 54 CD DD 23 3E 76 7C FE 50 02 00 7F 0A 0E F3
|
||||
0040 | 36 7A 20 F2 88 88 D5 AC 07 9B 8F 09 BA 46 14 7D
|
||||
0050 | 1A 46 6E 8F 3A EA BE 47 15 0B 49 07 B5 C6 06 78
|
||||
0060 | 51 B6 FC A4 0B C2 D9 E4 8B 41 FF ED BD B2 17 44
|
||||
0070 | 93 37 EC C5 1F F7 96 00 70 92 89 64 81 45 3E 46
|
||||
0080 | 1E 7F E4 82 43 B7 8F 0B A7 2F A4 EB 2A E0 E0 64
|
||||
0090 | 96 26 59 02 EE 87 A8 9A 94 F1 E8 0B 3A F2 1D AA
|
||||
00A0 | 7C E7 CB A9 D6 23 04 97 10 41 D9 A2 75 0F D4 34
|
||||
00B0 | 9C A0 89 87 F1 84 39 04 4D 84 3B DD 4D 7C B8 FF
|
||||
00C0 | BA 72 CC 9D 13 32 B1 8D 38 3C AA 0A B9 4A 5B D7
|
||||
00D0 | 43 14 3B 0C 14 A1 4C CA C2 A0 8C 07 29 95 84 6E
|
||||
00E0 | 91 96 E6 8B 00 8F 0C F5 D4 7E C6 18 7F BA 11 8F
|
||||
00F0 | 9E D0 93 A9 B2 99 39 80 8F D2 BC 5B D0 7A 28 7D
|
||||
0100 | 5E 44 AA 9A AE ED E3 F4 C2 FC 65 93 9A 94 91 D4
|
||||
0110 | 2E B8 1E 69 63 61 8A C2 47 85 26 FB C0 32 E5 41
|
||||
0120 | 69 CA F5 08 F2 E2 3E C8 1A 20 F4 05 2F 4F BE E4
|
||||
0130 | E3 BC 9C C4 16 0A 45 76 09 CF 61 A7 0A AB 65 49
|
||||
0140 | D8 AF 75 B7 B4 88 C1 C6 F1 55 A5 29 1A 66 D7 FA
|
||||
0150 | 16 92 71 6D 64 66 CA 89 54 83 DA 13 6E 37 35 23
|
||||
0160 | 9F CA E5 55 EF 53 CC A6 B6 43 EE 3C 30 5F 0F 99
|
||||
0170 | BD 2B 80 83 2B 8B 7B 53 AB F1 02 5E DD D1 27 1F
|
||||
0180 | B6 6A F4 7B 6A 48 9A 03 9B 48 32 CE 81 E7 C0 0A
|
||||
0190 | 2A CC FD 8B 3D 58 5A E8 F0 05 D6 64 7B 55 C0 26
|
||||
01A0 | 06 AF E6 74 E7 A9 7B 7F 90 DF E9 97 5E 8F 57 50
|
||||
01B0 | 01 BF 66 35 09 99 54 F0 90 87 30 1C D1 C5 FF 1D
|
||||
01C0 | C6 71 74 E7 E7 16 EA 91 79 46 4D 6E 09 85 D8 7B
|
||||
01D0 | EE D3 4F F1 C2 1B 4E 4C B9 13 D6 CC 98 FB EA 1D
|
||||
01E0 | 82 78 34 1F 05 39 EF 45 9F 83 70 2F 84 E1 C8 AF
|
||||
01F0 | 91 1A AB 71 20 8D 1A 8A 37 A0 94 3E 5B 80 B0 84
|
||||
0200 | 2A 12 D5 56 FD 07 44 50 3F 49 1F E6 DE 6C 94 63
|
||||
0210 | 13 93 2F 79 5F 06 D7 68 D6 42 8E 99 0C F7 DF 6A
|
||||
0220 | 1B 1B FE 7A 6D 09 70 25 51 EC 72 09 27 5C A3 7D
|
||||
0230 | 53 77 99 68 2A 67 B9 DC 6C E7 34 C2 38 1C 3D D3
|
||||
0240 | D0 AF B1 01 4A 46 F0 CB 28 15 34 F6 ED BC 6C C5
|
||||
0250 | 59 D7 99 39 12 50 BB 54 40 97 3C 88 0D F0 43 2B
|
||||
0260 | AB FF 63 0A 76 76 67 95 C3 FD 9B 12 B5 21 DF 72
|
||||
0270 | 9E E3 A1 79 80 71 11 1A A1 50 7A 41 5E DB 2D 43
|
||||
0280 | 5B C0 7D A4 C2 28 15 08 30 DF F6 80</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 D8 22 0B 93 48 6A 65
|
||||
0010 | E4 02 00 00 5C 07 E8 D0 E2 A2 03 78 80 7D D3 38
|
||||
0020 | 7B 46 CE C6 CC 91 8F 48 92 54 F3 93 E5 FB 43 86
|
||||
0030 | 98 FA 57 A7 44 1D 98 38 FE 50 02 00 A1 19 B0 C4
|
||||
0040 | D9 50 62 A7 D7 26 69 67 D1 75 05 15 E8 1B A5 B6
|
||||
0050 | 6B 4F 92 47 73 B8 20 64 EC 7E D7 B7 D6 6B DD 9F
|
||||
0060 | D0 27 BF 71 D0 65 7F 8E F4 CF C6 02 BD 74 71 32
|
||||
0070 | 42 8C 4B C2 10 F9 CA 94 2D E2 9F 43 4A 43 23 62
|
||||
0080 | 80 41 A7 AE 60 00 CD 43 0C 80 95 31 5D 2C FB B0
|
||||
0090 | E9 A2 D6 24 4A A5 0A B3 0F 78 F9 2A A0 6D 21 C4
|
||||
00A0 | FC 47 B0 BB 63 CC A3 D8 82 27 31 6A 8F 8E 8A 55
|
||||
00B0 | 4B 34 CA 21 CF 35 27 7B 25 54 CD B9 9C 81 DB A6
|
||||
00C0 | A4 E1 DD 4C 2C 76 AA 7A 61 DC CB E1 92 87 54 89
|
||||
00D0 | 75 A1 B0 82 7D 43 4B B5 86 66 49 15 73 33 11 0F
|
||||
00E0 | 77 A7 7B 2A 8D 6C 24 9C A6 09 C0 D7 6E 6D 87 BD
|
||||
00F0 | BB A4 05 9F 7F 55 DD 12 B9 EE C2 8F 52 E3 86 C6
|
||||
0100 | 81 F0 18 3B 82 EC 49 4B 2F 92 F0 B9 C3 8F BF 2E
|
||||
0110 | 3F E0 E4 8F 67 5A 25 7E 13 77 6C AD 99 C5 FB AC
|
||||
0120 | 73 22 D7 ED 44 71 31 C7 97 DE FD D1 24 58 66 ED
|
||||
0130 | CA 85 53 C6 E0 6D C0 10 78 B0 AA AA 1A 7A 31 42
|
||||
0140 | 76 EF 31 DC 3C 65 2C 47 2E C7 F8 F1 CE C0 33 5C
|
||||
0150 | A2 E0 26 C8 79 E6 E9 11 E6 59 BE EA 10 D4 74 C9
|
||||
0160 | EA 3C A9 8C A7 82 BB 3A 9C 2B DA 5C F8 26 57 A0
|
||||
0170 | B9 04 6A 6A 90 94 76 5F 7B 15 3F A9 3B 84 B7 23
|
||||
0180 | FA FC BE 49 49 3D A2 30 A4 DF C9 FA 5A A8 E9 43
|
||||
0190 | F0 F5 34 FF 8D C2 2C 62 DE 6D FB FF C8 E0 ED B7
|
||||
01A0 | BB E5 8D 50 F5 33 CD 2B 58 79 CB 3C D0 8F A6 4E
|
||||
01B0 | 7A 42 62 29 B9 60 B9 51 83 8B B4 D0 38 43 7B 25
|
||||
01C0 | E4 63 1E 5C 1B 1C 3C AB 5E 92 8C 45 86 7B 81 DF
|
||||
01D0 | F5 B3 5A CB 8B 08 00 AA 5C EA CB C6 48 C3 9A 45
|
||||
01E0 | CB 0F 77 DD F8 7A 11 28 55 27 1F 37 EA DE 7A B6
|
||||
01F0 | AB 93 5C D9 20 C6 65 73 85 56 CC 3B E5 91 22 4E
|
||||
0200 | 19 88 18 BD 4C C2 57 C8 36 BF EA 64 05 76 47 74
|
||||
0210 | DE DB 1A 69 F3 F0 3B 2F 1E D6 D3 7F 40 7F 59 1E
|
||||
0220 | F8 AC 33 07 C2 6D 4F 4E AE 96 6D 3E 0E EF AD D9
|
||||
0230 | 42 31 F7 48 FF D9 4F 43 B1 21 6E 79 49 DD 5F FA
|
||||
0240 | 1C FD A5 CA 5E 20 D0 B5 7C 2F BB 44 06 8B 00 A0
|
||||
0250 | 74 D5 03 11 CD 50 7A 36 13 8B 7B 87 C8 AB FD 8B
|
||||
0260 | 79 9A 53 0C C7 9A 54 0A BC CF 72 B8 F9 B1 75 A6
|
||||
0270 | FC FC FB 9B 16 03 FD 3C EF 49 93 51 39 CA 78 9C
|
||||
0280 | 99 45 CA 49 DC 03 70 C2 83 4B DF 08</code></pre>
|
||||
<p>Payload (de)serialization:</p>
|
||||
<pre><code>server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;</code></pre>
|
||||
<table class="table">
|
||||
|
@ -464,13 +464,13 @@ random_padding_bytes = 0B5C09C0EDD424CA0CF42B8D5A2008FEFF72518E00E41701157AC1155
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>0140FB0A8A416A65</code></td>
|
||||
<td><code>01D8220B93486A65</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>90020000</code> (656 in decimal)</td>
|
||||
<td><code>E4020000</code> (740 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -482,19 +482,19 @@ random_padding_bytes = 0B5C09C0EDD424CA0CF42B8D5A2008FEFF72518E00E41701157AC1155
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>C28F1555BD726E6D31756E83F85DA739</code></td>
|
||||
<td><code>E2A20378807DD3387B46CEC6CC918F48</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>F008069063A5C6AF2F54CDDD233E767C</code></td>
|
||||
<td><code>9254F393E5FB438698FA57A7441D9838</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_answer</td>
|
||||
<td>56, 596</td>
|
||||
<td><code>FE5002007F0A0EF3367A20F28888D5AC</code> <code>079B8F09BA46147D1A466E8F3AEABE47</code> <code>150B4907B5C6067851B6FCA40BC2D9E4</code> <code>8B41FFEDBDB217449337ECC51FF79600</code> <code>7092896481453E461E7FE48243B78F0B</code> <code>A72FA4EB2AE0E06496265902EE87A89A</code> <code>94F1E80B3AF21DAA7CE7CBA9D6230497</code> <code>1041D9A2750FD4349CA08987F1843904</code> <code>4D843BDD4D7CB8FFBA72CC9D1332B18D</code> <code>383CAA0AB94A5BD743143B0C14A14CCA</code> <code>C2A08C072995846E9196E68B008F0CF5</code> <code>D47EC6187FBA118F9ED093A9B2993980</code> <code>8FD2BC5BD07A287D5E44AA9AAEEDE3F4</code> <code>C2FC65939A9491D42EB81E6963618AC2</code> <code>478526FBC032E54169CAF508F2E23EC8</code> <code>1A20F4052F4FBEE4E3BC9CC4160A4576</code> <code>09CF61A70AAB6549D8AF75B7B488C1C6</code> <code>F155A5291A66D7FA1692716D6466CA89</code> <code>5483DA136E3735239FCAE555EF53CCA6</code> <code>B643EE3C305F0F99BD2B80832B8B7B53</code> <code>ABF1025EDDD1271FB66AF47B6A489A03</code> <code>9B4832CE81E7C00A2ACCFD8B3D585AE8</code> <code>F005D6647B55C02606AFE674E7A97B7F</code> <code>90DFE9975E8F575001BF6635099954F0</code> <code>9087301CD1C5FF1DC67174E7E716EA91</code> <code>79464D6E0985D87BEED34FF1C21B4E4C</code> <code>B913D6CC98FBEA1D8278341F0539EF45</code> <code>9F83702F84E1C8AF911AAB71208D1A8A</code> <code>37A0943E5B80B0842A12D556FD074450</code> <code>3F491FE6DE6C946313932F795F06D768</code> <code>D6428E990CF7DF6A1B1BFE7A6D097025</code> <code>51EC7209275CA37D537799682A67B9DC</code> <code>6CE734C2381C3DD3D0AFB1014A46F0CB</code> <code>281534F6EDBC6CC559D799391250BB54</code> <code>40973C880DF0432BABFF630A76766795</code> <code>C3FD9B12B521DF729EE3A1798071111A</code> <code>A1507A415EDB2D435BC07DA4C2281508</code><br> <code>30DFF680</code></td>
|
||||
<td><code>FE500200A119B0C4D95062A7D7266967</code> <code>D1750515E81BA5B66B4F924773B82064</code> <code>EC7ED7B7D66BDD9FD027BF71D0657F8E</code> <code>F4CFC602BD747132428C4BC210F9CA94</code> <code>2DE29F434A4323628041A7AE6000CD43</code> <code>0C8095315D2CFBB0E9A2D6244AA50AB3</code> <code>0F78F92AA06D21C4FC47B0BB63CCA3D8</code> <code>8227316A8F8E8A554B34CA21CF35277B</code> <code>2554CDB99C81DBA6A4E1DD4C2C76AA7A</code> <code>61DCCBE19287548975A1B0827D434BB5</code> <code>866649157333110F77A77B2A8D6C249C</code> <code>A609C0D76E6D87BDBBA4059F7F55DD12</code> <code>B9EEC28F52E386C681F0183B82EC494B</code> <code>2F92F0B9C38FBF2E3FE0E48F675A257E</code> <code>13776CAD99C5FBAC7322D7ED447131C7</code> <code>97DEFDD1245866EDCA8553C6E06DC010</code> <code>78B0AAAA1A7A314276EF31DC3C652C47</code> <code>2EC7F8F1CEC0335CA2E026C879E6E911</code> <code>E659BEEA10D474C9EA3CA98CA782BB3A</code> <code>9C2BDA5CF82657A0B9046A6A9094765F</code> <code>7B153FA93B84B723FAFCBE49493DA230</code> <code>A4DFC9FA5AA8E943F0F534FF8DC22C62</code> <code>DE6DFBFFC8E0EDB7BBE58D50F533CD2B</code> <code>5879CB3CD08FA64E7A426229B960B951</code> <code>838BB4D038437B25E4631E5C1B1C3CAB</code> <code>5E928C45867B81DFF5B35ACB8B0800AA</code> <code>5CEACBC648C39A45CB0F77DDF87A1128</code> <code>55271F37EADE7AB6AB935CD920C66573</code> <code>8556CC3BE591224E198818BD4CC257C8</code> <code>36BFEA6405764774DEDB1A69F3F03B2F</code> <code>1ED6D37F407F591EF8AC3307C26D4F4E</code> <code>AE966D3E0EEFADD94231F748FFD94F43</code> <code>B1216E7949DD5FFA1CFDA5CA5E20D0B5</code> <code>7C2FBB44068B00A074D50311CD507A36</code> <code>138B7B87C8ABFD8B799A530CC79A540A</code> <code>BCCF72B8F9B175A6FCFCFB9B1603FD3C</code> <code>EF49935139CA789C9945CA49DC0370C2</code><br> <code>834BDF08</code></td>
|
||||
<td>See below</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -502,20 +502,20 @@ random_padding_bytes = 0B5C09C0EDD424CA0CF42B8D5A2008FEFF72518E00E41701157AC1155
|
|||
<!-- 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 = 7F0A0EF3367A20F28888D5AC079B8F09BA46147D1A466E8F3AEABE47150B4907B5C6067851B6FCA40BC2D9E48B41FFEDBDB217449337ECC51FF796007092896481453E461E7FE48243B78F0BA72FA4EB2AE0E06496265902EE87A89A94F1E80B3AF21DAA7CE7CBA9D62304971041D9A2750FD4349CA08987F18439044D843BDD4D7CB8FFBA72CC9D1332B18D383CAA0AB94A5BD743143B0C14A14CCAC2A08C072995846E9196E68B008F0CF5D47EC6187FBA118F9ED093A9B29939808FD2BC5BD07A287D5E44AA9AAEEDE3F4C2FC65939A9491D42EB81E6963618AC2478526FBC032E54169CAF508F2E23EC81A20F4052F4FBEE4E3BC9CC4160A457609CF61A70AAB6549D8AF75B7B488C1C6F155A5291A66D7FA1692716D6466CA895483DA136E3735239FCAE555EF53CCA6B643EE3C305F0F99BD2B80832B8B7B53ABF1025EDDD1271FB66AF47B6A489A039B4832CE81E7C00A2ACCFD8B3D585AE8F005D6647B55C02606AFE674E7A97B7F90DFE9975E8F575001BF6635099954F09087301CD1C5FF1DC67174E7E716EA9179464D6E0985D87BEED34FF1C21B4E4CB913D6CC98FBEA1D8278341F0539EF459F83702F84E1C8AF911AAB71208D1A8A37A0943E5B80B0842A12D556FD0744503F491FE6DE6C946313932F795F06D768D6428E990CF7DF6A1B1BFE7A6D09702551EC7209275CA37D537799682A67B9DC6CE734C2381C3DD3D0AFB1014A46F0CB281534F6EDBC6CC559D799391250BB5440973C880DF0432BABFF630A76766795C3FD9B12B521DF729EE3A1798071111AA1507A415EDB2D435BC07DA4C228150830DFF680
|
||||
tmp_aes_key = 6C7CE92A1E77D36A6319624098FA0D8712081E66A5FE7A20E50C8F0F7DAD5805
|
||||
tmp_aes_iv = 957600BBA5EF8C267B43B945CBD247823AAFA3EFBD957E8337E01DCD28625EDE</code></pre>
|
||||
<pre><code>encrypted_answer = A119B0C4D95062A7D7266967D1750515E81BA5B66B4F924773B82064EC7ED7B7D66BDD9FD027BF71D0657F8EF4CFC602BD747132428C4BC210F9CA942DE29F434A4323628041A7AE6000CD430C8095315D2CFBB0E9A2D6244AA50AB30F78F92AA06D21C4FC47B0BB63CCA3D88227316A8F8E8A554B34CA21CF35277B2554CDB99C81DBA6A4E1DD4C2C76AA7A61DCCBE19287548975A1B0827D434BB5866649157333110F77A77B2A8D6C249CA609C0D76E6D87BDBBA4059F7F55DD12B9EEC28F52E386C681F0183B82EC494B2F92F0B9C38FBF2E3FE0E48F675A257E13776CAD99C5FBAC7322D7ED447131C797DEFDD1245866EDCA8553C6E06DC01078B0AAAA1A7A314276EF31DC3C652C472EC7F8F1CEC0335CA2E026C879E6E911E659BEEA10D474C9EA3CA98CA782BB3A9C2BDA5CF82657A0B9046A6A9094765F7B153FA93B84B723FAFCBE49493DA230A4DFC9FA5AA8E943F0F534FF8DC22C62DE6DFBFFC8E0EDB7BBE58D50F533CD2B5879CB3CD08FA64E7A426229B960B951838BB4D038437B25E4631E5C1B1C3CAB5E928C45867B81DFF5B35ACB8B0800AA5CEACBC648C39A45CB0F77DDF87A112855271F37EADE7AB6AB935CD920C665738556CC3BE591224E198818BD4CC257C836BFEA6405764774DEDB1A69F3F03B2F1ED6D37F407F591EF8AC3307C26D4F4EAE966D3E0EEFADD94231F748FFD94F43B1216E7949DD5FFA1CFDA5CA5E20D0B57C2FBB44068B00A074D50311CD507A36138B7B87C8ABFD8B799A530CC79A540ABCCF72B8F9B175A6FCFCFB9B1603FD3CEF49935139CA789C9945CA49DC0370C2834BDF08
|
||||
tmp_aes_key = E8934AA8785EB376BF5AF1DC8E6CCF115E85119979BF221D614927806C1C180E
|
||||
tmp_aes_iv = 283FE0D00A698688BCFBEB86198DF96B2613AFEB015932561E9D7CA284801F4C</code></pre>
|
||||
<!-- end server_DH_inner_data_input -->
|
||||
<p>Yielding:</p>
|
||||
<!-- start server_DH_inner_data_output -->
|
||||
<pre><code>answer_with_hash = D5A8D5D94590761C8538274B43847C2E219659F6BA0D89B5C28F1555BD726E6D31756E83F85DA739F008069063A5C6AF2F54CDDD233E767C03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001001CB3294DAA83FFCC700B43DD051EC5E788BD5CBFD1F140BC64E5DE58A98F53BBEA29402A0EB184832A107AC820CEDD2000AF59202F1E0F3D766CD1F12291F77D8550BB3A32A6AAF1FCBE5E12B21A8DE8FA48C7B6BFBA98861A69072015FFFC6CC1D32BEE2573178E29FE9FF1E5290D23672B2B795B52CFC0614C5AFD29C49D269BA8F9922987B2A996CC82CCA56E229C8993AD5FF289FA935FCB54F65918445F11DA325944B9CE74CB0D1F36B6456B0E9D744EEE370032B03C4B6E722CC9250F1F661A84726628E2C101E9E0CAF5799E4FF93C94C84736F4E3EC75DEA38F0A975B2B3AE975319DECF53EA56A3583B2CC8F145F9F20C8D578E701967876A84DD78A416A65362C6D1F470B159C
|
||||
answer = BA0D89B5C28F1555BD726E6D31756E83F85DA739F008069063A5C6AF2F54CDDD233E767C03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001001CB3294DAA83FFCC700B43DD051EC5E788BD5CBFD1F140BC64E5DE58A98F53BBEA29402A0EB184832A107AC820CEDD2000AF59202F1E0F3D766CD1F12291F77D8550BB3A32A6AAF1FCBE5E12B21A8DE8FA48C7B6BFBA98861A69072015FFFC6CC1D32BEE2573178E29FE9FF1E5290D23672B2B795B52CFC0614C5AFD29C49D269BA8F9922987B2A996CC82CCA56E229C8993AD5FF289FA935FCB54F65918445F11DA325944B9CE74CB0D1F36B6456B0E9D744EEE370032B03C4B6E722CC9250F1F661A84726628E2C101E9E0CAF5799E4FF93C94C84736F4E3EC75DEA38F0A975B2B3AE975319DECF53EA56A3583B2CC8F145F9F20C8D578E701967876A84DD78A416A65362C6D1F470B159C</code></pre>
|
||||
<pre><code>answer_with_hash = 6589FB2BE1C907C660B97611E0A07C02D67D961ABA0D89B5E2A20378807DD3387B46CEC6CC918F489254F393E5FB438698FA57A7441D983803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001008C0E47ACCCE07622B99F900EF624AE698AA069C0435B4B13E975E834ABE075AD01811CA9D7E3CAB6634E01024E43CC52CF983695BD7D6A31E1070159809EFF8FC91D92C83EBC3979EA49E24157EE36AE4B165358C9A3EB9C0065ECBBA6F6B7A8A5B8E390DDD7F5B1B12B49DAEAC52532035F695944792A0801F4E34490AB5B06027AFCE3D419E3B73B5B375D369852EF8EC7382FB6E1ECA75CB2282AF2D7AD60787188309E7A79ECF02DAE48FD516CF649D94088E4FE41D1439AF85D4888BDFCBA5C5147CC28FE56A35C89EB59242DE38701CEE3170F5AE545A05BCC824B2C1E12C381600CACA85451FDA2DF2F7A9C37D37BB3BB2F8CF2293DC185BD8FEBBC8593486A65047EF7BB0E81704B
|
||||
answer = BA0D89B5E2A20378807DD3387B46CEC6CC918F489254F393E5FB438698FA57A7441D983803000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001008C0E47ACCCE07622B99F900EF624AE698AA069C0435B4B13E975E834ABE075AD01811CA9D7E3CAB6634E01024E43CC52CF983695BD7D6A31E1070159809EFF8FC91D92C83EBC3979EA49E24157EE36AE4B165358C9A3EB9C0065ECBBA6F6B7A8A5B8E390DDD7F5B1B12B49DAEAC52532035F695944792A0801F4E34490AB5B06027AFCE3D419E3B73B5B375D369852EF8EC7382FB6E1ECA75CB2282AF2D7AD60787188309E7A79ECF02DAE48FD516CF649D94088E4FE41D1439AF85D4888BDFCBA5C5147CC28FE56A35C89EB59242DE38701CEE3170F5AE545A05BCC824B2C1E12C381600CACA85451FDA2DF2F7A9C37D37BB3BB2F8CF2293DC185BD8FEBBC8593486A65047EF7BB0E81704B</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 C2 8F 15 55 BD 72 6E 6D 31 75 6E 83
|
||||
0010 | F8 5D A7 39 F0 08 06 90 63 A5 C6 AF 2F 54 CD DD
|
||||
0020 | 23 3E 76 7C 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
||||
<pre><code>0000 | BA 0D 89 B5 E2 A2 03 78 80 7D D3 38 7B 46 CE C6
|
||||
0010 | CC 91 8F 48 92 54 F3 93 E5 FB 43 86 98 FA 57 A7
|
||||
0020 | 44 1D 98 38 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 = BA0D89B5C28F1555BD726E6D31756E83F85DA739F008069063A5C6AF2F54CDDD233E767
|
|||
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 | 1C B3 29 4D AA 83 FF CC 70 0B 43 DD 05 1E C5 E7
|
||||
0140 | 88 BD 5C BF D1 F1 40 BC 64 E5 DE 58 A9 8F 53 BB
|
||||
0150 | EA 29 40 2A 0E B1 84 83 2A 10 7A C8 20 CE DD 20
|
||||
0160 | 00 AF 59 20 2F 1E 0F 3D 76 6C D1 F1 22 91 F7 7D
|
||||
0170 | 85 50 BB 3A 32 A6 AA F1 FC BE 5E 12 B2 1A 8D E8
|
||||
0180 | FA 48 C7 B6 BF BA 98 86 1A 69 07 20 15 FF FC 6C
|
||||
0190 | C1 D3 2B EE 25 73 17 8E 29 FE 9F F1 E5 29 0D 23
|
||||
01A0 | 67 2B 2B 79 5B 52 CF C0 61 4C 5A FD 29 C4 9D 26
|
||||
01B0 | 9B A8 F9 92 29 87 B2 A9 96 CC 82 CC A5 6E 22 9C
|
||||
01C0 | 89 93 AD 5F F2 89 FA 93 5F CB 54 F6 59 18 44 5F
|
||||
01D0 | 11 DA 32 59 44 B9 CE 74 CB 0D 1F 36 B6 45 6B 0E
|
||||
01E0 | 9D 74 4E EE 37 00 32 B0 3C 4B 6E 72 2C C9 25 0F
|
||||
01F0 | 1F 66 1A 84 72 66 28 E2 C1 01 E9 E0 CA F5 79 9E
|
||||
0200 | 4F F9 3C 94 C8 47 36 F4 E3 EC 75 DE A3 8F 0A 97
|
||||
0210 | 5B 2B 3A E9 75 31 9D EC F5 3E A5 6A 35 83 B2 CC
|
||||
0220 | 8F 14 5F 9F 20 C8 D5 78 E7 01 96 78 76 A8 4D D7
|
||||
0230 | 8A 41 6A 65</code></pre>
|
||||
0130 | 8C 0E 47 AC CC E0 76 22 B9 9F 90 0E F6 24 AE 69
|
||||
0140 | 8A A0 69 C0 43 5B 4B 13 E9 75 E8 34 AB E0 75 AD
|
||||
0150 | 01 81 1C A9 D7 E3 CA B6 63 4E 01 02 4E 43 CC 52
|
||||
0160 | CF 98 36 95 BD 7D 6A 31 E1 07 01 59 80 9E FF 8F
|
||||
0170 | C9 1D 92 C8 3E BC 39 79 EA 49 E2 41 57 EE 36 AE
|
||||
0180 | 4B 16 53 58 C9 A3 EB 9C 00 65 EC BB A6 F6 B7 A8
|
||||
0190 | A5 B8 E3 90 DD D7 F5 B1 B1 2B 49 DA EA C5 25 32
|
||||
01A0 | 03 5F 69 59 44 79 2A 08 01 F4 E3 44 90 AB 5B 06
|
||||
01B0 | 02 7A FC E3 D4 19 E3 B7 3B 5B 37 5D 36 98 52 EF
|
||||
01C0 | 8E C7 38 2F B6 E1 EC A7 5C B2 28 2A F2 D7 AD 60
|
||||
01D0 | 78 71 88 30 9E 7A 79 EC F0 2D AE 48 FD 51 6C F6
|
||||
01E0 | 49 D9 40 88 E4 FE 41 D1 43 9A F8 5D 48 88 BD FC
|
||||
01F0 | BA 5C 51 47 CC 28 FE 56 A3 5C 89 EB 59 24 2D E3
|
||||
0200 | 87 01 CE E3 17 0F 5A E5 45 A0 5B CC 82 4B 2C 1E
|
||||
0210 | 12 C3 81 60 0C AC A8 54 51 FD A2 DF 2F 7A 9C 37
|
||||
0220 | D3 7B B3 BB 2F 8C F2 29 3D C1 85 BD 8F EB BC 85
|
||||
0230 | 93 48 6A 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 = BA0D89B5C28F1555BD726E6D31756E83F85DA739F008069063A5C6AF2F54CDDD233E767
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>C28F1555BD726E6D31756E83F85DA739</code></td>
|
||||
<td><code>E2A20378807DD3387B46CEC6CC918F48</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>F008069063A5C6AF2F54CDDD233E767C</code></td>
|
||||
<td><code>9254F393E5FB438698FA57A7441D9838</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -594,13 +594,13 @@ answer = BA0D89B5C28F1555BD726E6D31756E83F85DA739F008069063A5C6AF2F54CDDD233E767
|
|||
<tr>
|
||||
<td>g_a</td>
|
||||
<td>300, 260</td>
|
||||
<td><code>FE0001001CB3294DAA83FFCC700B43DD</code> <code>051EC5E788BD5CBFD1F140BC64E5DE58</code> <code>A98F53BBEA29402A0EB184832A107AC8</code> <code>20CEDD2000AF59202F1E0F3D766CD1F1</code> <code>2291F77D8550BB3A32A6AAF1FCBE5E12</code> <code>B21A8DE8FA48C7B6BFBA98861A690720</code> <code>15FFFC6CC1D32BEE2573178E29FE9FF1</code> <code>E5290D23672B2B795B52CFC0614C5AFD</code> <code>29C49D269BA8F9922987B2A996CC82CC</code> <code>A56E229C8993AD5FF289FA935FCB54F6</code> <code>5918445F11DA325944B9CE74CB0D1F36</code> <code>B6456B0E9D744EEE370032B03C4B6E72</code> <code>2CC9250F1F661A84726628E2C101E9E0</code> <code>CAF5799E4FF93C94C84736F4E3EC75DE</code> <code>A38F0A975B2B3AE975319DECF53EA56A</code> <code>3583B2CC8F145F9F20C8D578E7019678</code><br> <code>76A84DD7</code></td>
|
||||
<td><code>FE0001008C0E47ACCCE07622B99F900E</code> <code>F624AE698AA069C0435B4B13E975E834</code> <code>ABE075AD01811CA9D7E3CAB6634E0102</code> <code>4E43CC52CF983695BD7D6A31E1070159</code> <code>809EFF8FC91D92C83EBC3979EA49E241</code> <code>57EE36AE4B165358C9A3EB9C0065ECBB</code> <code>A6F6B7A8A5B8E390DDD7F5B1B12B49DA</code> <code>EAC52532035F695944792A0801F4E344</code> <code>90AB5B06027AFCE3D419E3B73B5B375D</code> <code>369852EF8EC7382FB6E1ECA75CB2282A</code> <code>F2D7AD60787188309E7A79ECF02DAE48</code> <code>FD516CF649D94088E4FE41D1439AF85D</code> <code>4888BDFCBA5C5147CC28FE56A35C89EB</code> <code>59242DE38701CEE3170F5AE545A05BCC</code> <code>824B2C1E12C381600CACA85451FDA2DF</code> <code>2F7A9C37D37BB3BB2F8CF2293DC185BD</code><br> <code>8FEBBC85</code></td>
|
||||
<td><code>g_a</code> diffie-hellman parameter</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_time</td>
|
||||
<td>560, 4</td>
|
||||
<td><code>8A416A65</code> (1701462410 in decimal)</td>
|
||||
<td><code>93486A65</code> (1701464211 in decimal)</td>
|
||||
<td>Server time</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -609,34 +609,34 @@ answer = BA0D89B5C28F1555BD726E6D31756E83F85DA739F008069063A5C6AF2F54CDDD233E767
|
|||
<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 = B15E7E8679440AD21C5673205B909AB8DBAEAC175835AF5DD25CD2F2CAC14D2E0C82BCDA4D82B96E80B6A85A09C8FD02AC5A2E12099A32F3A4F65CF127AE66043E2B6D744D0E68E3E96B27D012AE4B72E8AE7CD7A3B4E7987A7B37B18F6F9868E00EA69119B3D1BC2E5BB671DA2FDFC828707A7251B2438D6A4279F8A700B41841B551C5FC3A7842280C1A514D5BD279F69C7E60756330170C8DDA0CA3F80481237A754A8A75C5C6402EC31981040166FF23C15266A2130A681B6EFD65466BF2B52307A6AC9F7007113BFCA3D9A38860F43E03FEF97F8A494AAE070870F7B196AFA66B95C0E2106E9CDD4DCFF2F92B76B39D6044AEEAA529E62EEDA546655CDA</code></pre>
|
||||
<pre><code>b = 1161AEBD1183084F82308B0947C4B22D81CBFB34FDF1FF5C1A4E37F9CEF5EDB8AC656D7AC7EBFC065695369DC0E720CA447743A6D4586BC0533D27FE85EE088AA66BFB09CB3C2553AACAC48AB4E0212BDCDBB0B0C1C6A1043DCA9DA98109DD141337748CE3C226073CF61CB5C42AA2F53381962F9F3B52981A3DDE4CC875E969FC5B42A378C8C02FC9389B18BBD9C82199425F27A6DBB0BE8001B49845118BDCB6661CD71699A2C6220F441E0D8CA34FA62A143E85CA025F659AAD3633ED670F856C4CD0EC8F575CBAB029BBCFD59898CD46925D2DD4B9E0C7EB54588E81661634FED8D484981A0151A7468928F742EDEBA25B3C2402253A2C161A496E7500B5</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 = 7CD1DC488E57D09593A2DC616BE525626B52F6DE778110BB844BD132D9053A6D8CB26EDF072280111F59E76A0DAA5774C07FD1A73965E6DA3C7039C0C0FD452E0B7F8F4E8F0695118779046DF6C3E8135768CFFEAD1E0355B8333BBE19397075829241059FD806F756D26D66769ADF6FEA3B943A294F3B0A7867EE37E21CE0718EFC20A3DFB36EC8263C2F532C2B30709117ABCAF951EF4E2ECA9C7E3E323B9C5EBDD2D5F1ABB22DF8B349805C0A521ADCFF782A2325AD79BB43BFEBC563274106A2FA715BBB5AB5A9AAF08707571FB36FE2ACBC40787B7CCEF94230D781D7E63811961956A6EC11B9A74D5971EA3D62B89318CBBC8D9B3A13B0EF4E68264EEB</code></pre>
|
||||
<pre><code>g_b = 1EA6C38815262DC3A66343D108CECEF30EE4AC999AF46F9FECD0FF02CA2F6C6FF7FAFF1F24F74A2ABEE6A68040F8EAB08647E0BC7FD99D55F8AEC85CB349503F9083DD54B46E18CB0C2AE45EC11DC8854C35C12BF01BFE646F1990CA313F0E1EBF4BF2775DAF05ABD242BDA037F41FD1084819D9DA701929BD9874D3184A8217D75DECC302F82D48B22139385CE607C98196CB24C19C79720042DFBCEC639642E7C4BEF901B59A631E768AAD4650BE3F18CDCC14F1011D63D6B29DE5224EFAC7F7AC1FCD0131630BCB4805C39E2F50B00C5A99F51A9525AADF3A0A567DB8933ED079E6F0256BCB9CDE084D9F920ECD5E7819F5ACEAB1F21C4625A8B599702300</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 C2 8F 15 55 BD 72 6E 6D 31 75 6E 83
|
||||
0010 | F8 5D A7 39 F0 08 06 90 63 A5 C6 AF 2F 54 CD DD
|
||||
0020 | 23 3E 76 7C 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | 7C D1 DC 48 8E 57 D0 95 93 A2 DC 61 6B E5 25 62
|
||||
0040 | 6B 52 F6 DE 77 81 10 BB 84 4B D1 32 D9 05 3A 6D
|
||||
0050 | 8C B2 6E DF 07 22 80 11 1F 59 E7 6A 0D AA 57 74
|
||||
0060 | C0 7F D1 A7 39 65 E6 DA 3C 70 39 C0 C0 FD 45 2E
|
||||
0070 | 0B 7F 8F 4E 8F 06 95 11 87 79 04 6D F6 C3 E8 13
|
||||
0080 | 57 68 CF FE AD 1E 03 55 B8 33 3B BE 19 39 70 75
|
||||
0090 | 82 92 41 05 9F D8 06 F7 56 D2 6D 66 76 9A DF 6F
|
||||
00A0 | EA 3B 94 3A 29 4F 3B 0A 78 67 EE 37 E2 1C E0 71
|
||||
00B0 | 8E FC 20 A3 DF B3 6E C8 26 3C 2F 53 2C 2B 30 70
|
||||
00C0 | 91 17 AB CA F9 51 EF 4E 2E CA 9C 7E 3E 32 3B 9C
|
||||
00D0 | 5E BD D2 D5 F1 AB B2 2D F8 B3 49 80 5C 0A 52 1A
|
||||
00E0 | DC FF 78 2A 23 25 AD 79 BB 43 BF EB C5 63 27 41
|
||||
00F0 | 06 A2 FA 71 5B BB 5A B5 A9 AA F0 87 07 57 1F B3
|
||||
0100 | 6F E2 AC BC 40 78 7B 7C CE F9 42 30 D7 81 D7 E6
|
||||
0110 | 38 11 96 19 56 A6 EC 11 B9 A7 4D 59 71 EA 3D 62
|
||||
0120 | B8 93 18 CB BC 8D 9B 3A 13 B0 EF 4E 68 26 4E EB</code></pre>
|
||||
<pre><code>0000 | 54 B6 43 66 E2 A2 03 78 80 7D D3 38 7B 46 CE C6
|
||||
0010 | CC 91 8F 48 92 54 F3 93 E5 FB 43 86 98 FA 57 A7
|
||||
0020 | 44 1D 98 38 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | 1E A6 C3 88 15 26 2D C3 A6 63 43 D1 08 CE CE F3
|
||||
0040 | 0E E4 AC 99 9A F4 6F 9F EC D0 FF 02 CA 2F 6C 6F
|
||||
0050 | F7 FA FF 1F 24 F7 4A 2A BE E6 A6 80 40 F8 EA B0
|
||||
0060 | 86 47 E0 BC 7F D9 9D 55 F8 AE C8 5C B3 49 50 3F
|
||||
0070 | 90 83 DD 54 B4 6E 18 CB 0C 2A E4 5E C1 1D C8 85
|
||||
0080 | 4C 35 C1 2B F0 1B FE 64 6F 19 90 CA 31 3F 0E 1E
|
||||
0090 | BF 4B F2 77 5D AF 05 AB D2 42 BD A0 37 F4 1F D1
|
||||
00A0 | 08 48 19 D9 DA 70 19 29 BD 98 74 D3 18 4A 82 17
|
||||
00B0 | D7 5D EC C3 02 F8 2D 48 B2 21 39 38 5C E6 07 C9
|
||||
00C0 | 81 96 CB 24 C1 9C 79 72 00 42 DF BC EC 63 96 42
|
||||
00D0 | E7 C4 BE F9 01 B5 9A 63 1E 76 8A AD 46 50 BE 3F
|
||||
00E0 | 18 CD CC 14 F1 01 1D 63 D6 B2 9D E5 22 4E FA C7
|
||||
00F0 | F7 AC 1F CD 01 31 63 0B CB 48 05 C3 9E 2F 50 B0
|
||||
0100 | 0C 5A 99 F5 1A 95 25 AA DF 3A 0A 56 7D B8 93 3E
|
||||
0110 | D0 79 E6 F0 25 6B CB 9C DE 08 4D 9F 92 0E CD 5E
|
||||
0120 | 78 19 F5 AC EA B1 F2 1C 46 25 A8 B5 99 70 23 00</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 = BA0D89B5C28F1555BD726E6D31756E83F85DA739F008069063A5C6AF2F54CDDD233E767
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>C28F1555BD726E6D31756E83F85DA739</code></td>
|
||||
<td><code>E2A20378807DD3387B46CEC6CC918F48</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>F008069063A5C6AF2F54CDDD233E767C</code></td>
|
||||
<td><code>9254F393E5FB438698FA57A7441D9838</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>g_b</td>
|
||||
<td>36, 260</td>
|
||||
<td><code>FE0001007CD1DC488E57D09593A2DC61</code> <code>6BE525626B52F6DE778110BB844BD132</code> <code>D9053A6D8CB26EDF072280111F59E76A</code> <code>0DAA5774C07FD1A73965E6DA3C7039C0</code> <code>C0FD452E0B7F8F4E8F0695118779046D</code> <code>F6C3E8135768CFFEAD1E0355B8333BBE</code> <code>19397075829241059FD806F756D26D66</code> <code>769ADF6FEA3B943A294F3B0A7867EE37</code> <code>E21CE0718EFC20A3DFB36EC8263C2F53</code> <code>2C2B30709117ABCAF951EF4E2ECA9C7E</code> <code>3E323B9C5EBDD2D5F1ABB22DF8B34980</code> <code>5C0A521ADCFF782A2325AD79BB43BFEB</code> <code>C563274106A2FA715BBB5AB5A9AAF087</code> <code>07571FB36FE2ACBC40787B7CCEF94230</code> <code>D781D7E63811961956A6EC11B9A74D59</code> <code>71EA3D62B89318CBBC8D9B3A13B0EF4E</code><br> <code>68264EEB</code></td>
|
||||
<td><code>FE0001001EA6C38815262DC3A66343D1</code> <code>08CECEF30EE4AC999AF46F9FECD0FF02</code> <code>CA2F6C6FF7FAFF1F24F74A2ABEE6A680</code> <code>40F8EAB08647E0BC7FD99D55F8AEC85C</code> <code>B349503F9083DD54B46E18CB0C2AE45E</code> <code>C11DC8854C35C12BF01BFE646F1990CA</code> <code>313F0E1EBF4BF2775DAF05ABD242BDA0</code> <code>37F41FD1084819D9DA701929BD9874D3</code> <code>184A8217D75DECC302F82D48B2213938</code> <code>5CE607C98196CB24C19C79720042DFBC</code> <code>EC639642E7C4BEF901B59A631E768AAD</code> <code>4650BE3F18CDCC14F1011D63D6B29DE5</code> <code>224EFAC7F7AC1FCD0131630BCB4805C3</code> <code>9E2F50B00C5A99F51A9525AADF3A0A56</code> <code>7DB8933ED079E6F0256BCB9CDE084D9F</code> <code>920ECD5E7819F5ACEAB1F21C4625A8B5</code><br> <code>99702300</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 = BA0D89B5C28F1555BD726E6D31756E83F85DA739F008069063A5C6AF2F54CDDD233E767
|
|||
<!-- 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 = 54B64366C28F1555BD726E6D31756E83F85DA739F008069063A5C6AF2F54CDDD233E767C0000000000000000FE0001007CD1DC488E57D09593A2DC616BE525626B52F6DE778110BB844BD132D9053A6D8CB26EDF072280111F59E76A0DAA5774C07FD1A73965E6DA3C7039C0C0FD452E0B7F8F4E8F0695118779046DF6C3E8135768CFFEAD1E0355B8333BBE19397075829241059FD806F756D26D66769ADF6FEA3B943A294F3B0A7867EE37E21CE0718EFC20A3DFB36EC8263C2F532C2B30709117ABCAF951EF4E2ECA9C7E3E323B9C5EBDD2D5F1ABB22DF8B349805C0A521ADCFF782A2325AD79BB43BFEBC563274106A2FA715BBB5AB5A9AAF08707571FB36FE2ACBC40787B7CCEF94230D781D7E63811961956A6EC11B9A74D5971EA3D62B89318CBBC8D9B3A13B0EF4E68264EEB
|
||||
padding = 84A022CA231998BDC523EAB2
|
||||
tmp_aes_key = 6C7CE92A1E77D36A6319624098FA0D8712081E66A5FE7A20E50C8F0F7DAD5805
|
||||
tmp_aes_iv = 957600BBA5EF8C267B43B945CBD247823AAFA3EFBD957E8337E01DCD28625EDE</code></pre>
|
||||
<pre><code>data = 54B64366E2A20378807DD3387B46CEC6CC918F489254F393E5FB438698FA57A7441D98380000000000000000FE0001001EA6C38815262DC3A66343D108CECEF30EE4AC999AF46F9FECD0FF02CA2F6C6FF7FAFF1F24F74A2ABEE6A68040F8EAB08647E0BC7FD99D55F8AEC85CB349503F9083DD54B46E18CB0C2AE45EC11DC8854C35C12BF01BFE646F1990CA313F0E1EBF4BF2775DAF05ABD242BDA037F41FD1084819D9DA701929BD9874D3184A8217D75DECC302F82D48B22139385CE607C98196CB24C19C79720042DFBCEC639642E7C4BEF901B59A631E768AAD4650BE3F18CDCC14F1011D63D6B29DE5224EFAC7F7AC1FCD0131630BCB4805C39E2F50B00C5A99F51A9525AADF3A0A567DB8933ED079E6F0256BCB9CDE084D9F920ECD5E7819F5ACEAB1F21C4625A8B599702300
|
||||
padding = A5BB328025F4BFBC2231E6EC
|
||||
tmp_aes_key = E8934AA8785EB376BF5AF1DC8E6CCF115E85119979BF221D614927806C1C180E
|
||||
tmp_aes_iv = 283FE0D00A698688BCFBEB86198DF96B2613AFEB015932561E9D7CA284801F4C</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 = 516F3067F67848CB09499858B9F2997298A9C008EC04242041D0A7AB9227D2555E679587BCF91AC6DE88EC064FC081D41178B35448BE387C8BB61BA21D8B8723CE47DBBB8E6FAE531862B095882E3DB07D2E19396837E7DB538D4BB11D96A0E2A000D55B6FC7085B77E17D1C1AEAD547886F6F82B96624F7CBD7CFC7E460FB988F7AD6951BB1ACDBD3CC85F0EAC72AE206C4E59AAA4685056227B69777E37CC776CCC6986AD0DB28C0B30F1EE588DD4CBFEA2BDBB9D636BC2BDBD0FE5FE02B0E223B52FBA85178D93559516C06F88069D022978A3D009A6F52F2361C76D01AD940762B168CE3405EAA9FBD53F583A0CF5E9393B35526FF7A98A05F3D5F3539526DAA896301C68427D48987BED0BFBE82D2F10EBB29FA6AB1F43B4C4B886D07FD3DB0787CFE0AFC6397CAF3F5520A9D278FAAD931E63C6C3336FDD0CA67769EC4A3DE8FC9CB081713469168B5C0D27E54</code></pre>
|
||||
<pre><code>encrypted_data = 3E2942908CE41FC5B98721FC56302799B98E338A4D750D91126B4C3304E0E9B110E9C060389A241E5D96D047802D042DCDEDB07F53D34AC61EAFD03D293F70527E7CABCE16820922614F9A1BA94931CE5959F0B9900C692F585B84B061532AF9CFDC18818157DCF079D53687DDE7414466CCD941812EEB0E159BB3D72D96E7B66700F234FAA773A5992FF590E082C2266EB4D1884DE996D796450DBB0D72A12F35056BF0B126B22F1539347D23719A9EA99B3CC4EC50B82BC6C6794EAFA382C799DD74EF44AB5B038770E6561C80C81F422743BF6C08F266733DC758DBDF49B9E465BD29C8981DC16F576A4B5C02241DCC5038E118AE14BDDE48B00D350CD44082092314D7C9A8DDBC3A674ED3A3C3EABBC80B96EB048284EED13D788B1E30E865B607EB3C990EF82B2875D0BBC781540E1CB9422AE8D3A014C77BCEF4CA73762D7DF02542C61EC29F1AEF3043EFC0F4</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 34 0E 00 8A 41 6A 65
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 C2 8F 15 55 BD 72 6E 6D
|
||||
0020 | 31 75 6E 83 F8 5D A7 39 F0 08 06 90 63 A5 C6 AF
|
||||
0030 | 2F 54 CD DD 23 3E 76 7C FE 50 01 00 51 6F 30 67
|
||||
0040 | F6 78 48 CB 09 49 98 58 B9 F2 99 72 98 A9 C0 08
|
||||
0050 | EC 04 24 20 41 D0 A7 AB 92 27 D2 55 5E 67 95 87
|
||||
0060 | BC F9 1A C6 DE 88 EC 06 4F C0 81 D4 11 78 B3 54
|
||||
0070 | 48 BE 38 7C 8B B6 1B A2 1D 8B 87 23 CE 47 DB BB
|
||||
0080 | 8E 6F AE 53 18 62 B0 95 88 2E 3D B0 7D 2E 19 39
|
||||
0090 | 68 37 E7 DB 53 8D 4B B1 1D 96 A0 E2 A0 00 D5 5B
|
||||
00A0 | 6F C7 08 5B 77 E1 7D 1C 1A EA D5 47 88 6F 6F 82
|
||||
00B0 | B9 66 24 F7 CB D7 CF C7 E4 60 FB 98 8F 7A D6 95
|
||||
00C0 | 1B B1 AC DB D3 CC 85 F0 EA C7 2A E2 06 C4 E5 9A
|
||||
00D0 | AA 46 85 05 62 27 B6 97 77 E3 7C C7 76 CC C6 98
|
||||
00E0 | 6A D0 DB 28 C0 B3 0F 1E E5 88 DD 4C BF EA 2B DB
|
||||
00F0 | B9 D6 36 BC 2B DB D0 FE 5F E0 2B 0E 22 3B 52 FB
|
||||
0100 | A8 51 78 D9 35 59 51 6C 06 F8 80 69 D0 22 97 8A
|
||||
0110 | 3D 00 9A 6F 52 F2 36 1C 76 D0 1A D9 40 76 2B 16
|
||||
0120 | 8C E3 40 5E AA 9F BD 53 F5 83 A0 CF 5E 93 93 B3
|
||||
0130 | 55 26 FF 7A 98 A0 5F 3D 5F 35 39 52 6D AA 89 63
|
||||
0140 | 01 C6 84 27 D4 89 87 BE D0 BF BE 82 D2 F1 0E BB
|
||||
0150 | 29 FA 6A B1 F4 3B 4C 4B 88 6D 07 FD 3D B0 78 7C
|
||||
0160 | FE 0A FC 63 97 CA F3 F5 52 0A 9D 27 8F AA D9 31
|
||||
0170 | E6 3C 6C 33 36 FD D0 CA 67 76 9E C4 A3 DE 8F C9
|
||||
0180 | CB 08 17 13 46 91 68 B5 C0 D2 7E 54</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 D4 92 08 00 93 48 6A 65
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 E2 A2 03 78 80 7D D3 38
|
||||
0020 | 7B 46 CE C6 CC 91 8F 48 92 54 F3 93 E5 FB 43 86
|
||||
0030 | 98 FA 57 A7 44 1D 98 38 FE 50 01 00 3E 29 42 90
|
||||
0040 | 8C E4 1F C5 B9 87 21 FC 56 30 27 99 B9 8E 33 8A
|
||||
0050 | 4D 75 0D 91 12 6B 4C 33 04 E0 E9 B1 10 E9 C0 60
|
||||
0060 | 38 9A 24 1E 5D 96 D0 47 80 2D 04 2D CD ED B0 7F
|
||||
0070 | 53 D3 4A C6 1E AF D0 3D 29 3F 70 52 7E 7C AB CE
|
||||
0080 | 16 82 09 22 61 4F 9A 1B A9 49 31 CE 59 59 F0 B9
|
||||
0090 | 90 0C 69 2F 58 5B 84 B0 61 53 2A F9 CF DC 18 81
|
||||
00A0 | 81 57 DC F0 79 D5 36 87 DD E7 41 44 66 CC D9 41
|
||||
00B0 | 81 2E EB 0E 15 9B B3 D7 2D 96 E7 B6 67 00 F2 34
|
||||
00C0 | FA A7 73 A5 99 2F F5 90 E0 82 C2 26 6E B4 D1 88
|
||||
00D0 | 4D E9 96 D7 96 45 0D BB 0D 72 A1 2F 35 05 6B F0
|
||||
00E0 | B1 26 B2 2F 15 39 34 7D 23 71 9A 9E A9 9B 3C C4
|
||||
00F0 | EC 50 B8 2B C6 C6 79 4E AF A3 82 C7 99 DD 74 EF
|
||||
0100 | 44 AB 5B 03 87 70 E6 56 1C 80 C8 1F 42 27 43 BF
|
||||
0110 | 6C 08 F2 66 73 3D C7 58 DB DF 49 B9 E4 65 BD 29
|
||||
0120 | C8 98 1D C1 6F 57 6A 4B 5C 02 24 1D CC 50 38 E1
|
||||
0130 | 18 AE 14 BD DE 48 B0 0D 35 0C D4 40 82 09 23 14
|
||||
0140 | D7 C9 A8 DD BC 3A 67 4E D3 A3 C3 EA BB C8 0B 96
|
||||
0150 | EB 04 82 84 EE D1 3D 78 8B 1E 30 E8 65 B6 07 EB
|
||||
0160 | 3C 99 0E F8 2B 28 75 D0 BB C7 81 54 0E 1C B9 42
|
||||
0170 | 2A E8 D3 A0 14 C7 7B CE F4 CA 73 76 2D 7D F0 25
|
||||
0180 | 42 C6 1E C2 9F 1A EF 30 43 EF C0 F4</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>FC340E008A416A65</code></td>
|
||||
<td><code>D492080093486A65</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>C28F1555BD726E6D31756E83F85DA739</code></td>
|
||||
<td><code>E2A20378807DD3387B46CEC6CC918F48</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>F008069063A5C6AF2F54CDDD233E767C</code></td>
|
||||
<td><code>9254F393E5FB438698FA57A7441D9838</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>56, 340</td>
|
||||
<td><code>FE500100516F3067F67848CB09499858</code> <code>B9F2997298A9C008EC04242041D0A7AB</code> <code>9227D2555E679587BCF91AC6DE88EC06</code> <code>4FC081D41178B35448BE387C8BB61BA2</code> <code>1D8B8723CE47DBBB8E6FAE531862B095</code> <code>882E3DB07D2E19396837E7DB538D4BB1</code> <code>1D96A0E2A000D55B6FC7085B77E17D1C</code> <code>1AEAD547886F6F82B96624F7CBD7CFC7</code> <code>E460FB988F7AD6951BB1ACDBD3CC85F0</code> <code>EAC72AE206C4E59AAA4685056227B697</code> <code>77E37CC776CCC6986AD0DB28C0B30F1E</code> <code>E588DD4CBFEA2BDBB9D636BC2BDBD0FE</code> <code>5FE02B0E223B52FBA85178D93559516C</code> <code>06F88069D022978A3D009A6F52F2361C</code> <code>76D01AD940762B168CE3405EAA9FBD53</code> <code>F583A0CF5E9393B35526FF7A98A05F3D</code> <code>5F3539526DAA896301C68427D48987BE</code> <code>D0BFBE82D2F10EBB29FA6AB1F43B4C4B</code> <code>886D07FD3DB0787CFE0AFC6397CAF3F5</code> <code>520A9D278FAAD931E63C6C3336FDD0CA</code> <code>67769EC4A3DE8FC9CB081713469168B5</code><br> <code>C0D27E54</code></td>
|
||||
<td><code>FE5001003E2942908CE41FC5B98721FC</code> <code>56302799B98E338A4D750D91126B4C33</code> <code>04E0E9B110E9C060389A241E5D96D047</code> <code>802D042DCDEDB07F53D34AC61EAFD03D</code> <code>293F70527E7CABCE16820922614F9A1B</code> <code>A94931CE5959F0B9900C692F585B84B0</code> <code>61532AF9CFDC18818157DCF079D53687</code> <code>DDE7414466CCD941812EEB0E159BB3D7</code> <code>2D96E7B66700F234FAA773A5992FF590</code> <code>E082C2266EB4D1884DE996D796450DBB</code> <code>0D72A12F35056BF0B126B22F1539347D</code> <code>23719A9EA99B3CC4EC50B82BC6C6794E</code> <code>AFA382C799DD74EF44AB5B038770E656</code> <code>1C80C81F422743BF6C08F266733DC758</code> <code>DBDF49B9E465BD29C8981DC16F576A4B</code> <code>5C02241DCC5038E118AE14BDDE48B00D</code> <code>350CD44082092314D7C9A8DDBC3A674E</code> <code>D3A3C3EABBC80B96EB048284EED13D78</code> <code>8B1E30E865B607EB3C990EF82B2875D0</code> <code>BBC781540E1CB9422AE8D3A014C77BCE</code> <code>F4CA73762D7DF02542C61EC29F1AEF30</code><br> <code>43EFC0F4</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 = 6AA456AF3C05911B9AE9AAF4331B1AD44C5DE8A2975EAECEE51B0EAE3E7B1E8AD72BC88E5D2575782F33D3074783AD6366FCD32F6ABB9D43EAB19E8BCBFD21DEDC7BF54C56A7F9F753A01F8570F62352525B05595A974B37E9F65C683730E3FAE4CA7B43B808B475D01F40B71D78CF682C9B7C7D116BCE35F9083438A77570D0C3E81648F4AE1496F2BF1CE0CA15EE027283129B0F6B76BDB5B144217F4C0E3C2CF9D394158972E3FBA423601C1F01EC905AE2601B3E58C29CE83C61BA943509AE0CE8C5BE8F792DFCEA569CA782D4F378638BDC9FED866B6288935225391C1E070F8D3920CB9A473907C814E8E5554782B97CA654E4DCEE982C4FAFC826A7AA</code></pre>
|
||||
<pre><code>auth_key = A397DCB4877B00433A19CE2043C635DBD1E3DFDBA282B6E470EDAAA0E68F9D78451A2011576D8608A2EA458A2DD762D049AF77E956982AE64C5A62D508F06A0AB774C448CE4D527278676D2D4B756FE68CC6DA0441DF853F08BD976F80FA4E80EBD3044C1A8FA829D9D20EECFD30337A67726F5347ECCBB4C6C13278A45031622ADE66D8A5C30D28E85C1B3A0C47A06842C04DA186086D3720BD2C76B6E7D16BB294BA5620B781B8998767D31F63AA65CBF5B2A61F4DF07BBAE4A4B1125D95E1ABE7737DF6A2F23A078161A470EE68545CC13D3C1ABC4D1668F4B8581842337E9001DF095D40FC10AF2D466B5E33CEA0377283806AF15A29DA00B063A65E337C</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 98 F1 5C 8A 41 6A 65
|
||||
0010 | 40 00 00 00 34 F7 CB 3B C2 8F 15 55 BD 72 6E 6D
|
||||
0020 | 31 75 6E 83 F8 5D A7 39 F0 08 06 90 63 A5 C6 AF
|
||||
0030 | 2F 54 CD DD 23 3E 76 7C F2 4C DB 7D 46 6D 0D 12
|
||||
0040 | 14 6F 26 88 EC 56 9A A9</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 F4 B0 65 93 48 6A 65
|
||||
0010 | 68 00 00 00 34 F7 CB 3B E2 A2 03 78 80 7D D3 38
|
||||
0020 | 7B 46 CE C6 CC 91 8F 48 92 54 F3 93 E5 FB 43 86
|
||||
0030 | 98 FA 57 A7 44 1D 98 38 5A B3 92 16 0B C1 00 96
|
||||
0040 | 20 B6 CD C0 42 80 DC 92</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>0198F15C8A416A65</code></td>
|
||||
<td><code>01F4B06593486A65</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>40000000</code> (64 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>C28F1555BD726E6D31756E83F85DA739</code></td>
|
||||
<td><code>E2A20378807DD3387B46CEC6CC918F48</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>F008069063A5C6AF2F54CDDD233E767C</code></td>
|
||||
<td><code>9254F393E5FB438698FA57A7441D9838</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce_hash1</td>
|
||||
<td>56, 16</td>
|
||||
<td><code>F24CDB7D466D0D12146F2688EC569AA9</code></td>
|
||||
<td><code>5AB392160BC1009620B6CDC04280DC92</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>
|
||||
|
|
|
@ -1302,13 +1302,11 @@ var Random = {
|
|||
var LoginCodes = {
|
||||
init: function() {
|
||||
Aj.onLoad(function(state) {
|
||||
$('.js-toggle-receive').on('change', LoginCodes.eToggleReceive);
|
||||
state.needUpdate = true;
|
||||
state.updLastReq = +Date.now();
|
||||
state.updStateTo = setTimeout(LoginCodes.updateState, Main.UPDATE_PERIOD);
|
||||
});
|
||||
Aj.onUnload(function(state) {
|
||||
$('.js-toggle-receive').off('change', LoginCodes.eToggleReceive);
|
||||
clearTimeout(state.updStateTo);
|
||||
state.needUpdate = false;
|
||||
});
|
||||
|
@ -1339,14 +1337,6 @@ var LoginCodes = {
|
|||
}
|
||||
|
||||
}
|
||||
},
|
||||
eToggleReceive: function() {
|
||||
var can_receive = $(this).prop('checked');
|
||||
$('.js-codes-main').toggleClass('codes-disabled', !can_receive);
|
||||
Aj.apiRequest('toggleLoginCodes', {
|
||||
number: Aj.state.number,
|
||||
can_receive: can_receive ? 1 : 0
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue