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
a7b535648a
commit
9feae224aa
6 changed files with 229 additions and 229 deletions
|
@ -4,10 +4,10 @@
|
|||
<meta charset="utf-8">
|
||||
<title>Giveaways</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta property="description" content="Telegram channel administrators may launch giveaways to randomly distribute Telegram Premium subscriptions and other gifts among their followers, in exchange for boosts.">
|
||||
<meta property="description" content="Telegram channel and supergroup administrators may launch giveaways to randomly distribute Telegram Premium subscriptions and other gifts among their followers, in exchange for boosts.">
|
||||
<meta property="og:title" content="Giveaways">
|
||||
<meta property="og:image" content="">
|
||||
<meta property="og:description" content="Telegram channel administrators may launch giveaways to randomly distribute Telegram Premium subscriptions and other gifts among their followers, in exchange for boosts.">
|
||||
<meta property="og:description" content="Telegram channel and supergroup administrators may launch giveaways to randomly distribute Telegram Premium subscriptions and other gifts among their followers, in exchange for boosts.">
|
||||
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
|
||||
|
@ -44,7 +44,7 @@
|
|||
|
||||
<div id="dev_page_content"><!-- scroll_nav -->
|
||||
|
||||
<p>Telegram <a href="/api/channel">channel</a> administrators may launch giveaways to randomly distribute <a href="/api/premium">Telegram Premium</a> subscriptions and other gifts among their followers, in exchange for <a href="/api/boost">boosts</a>.</p>
|
||||
<p>Telegram <a href="/api/channel">channel and supergroup</a> administrators may launch giveaways to randomly distribute <a href="/api/premium">Telegram Premium</a> subscriptions and other gifts among their followers, in exchange for <a href="/api/boost">boosts</a>.</p>
|
||||
<p>This functionality should only be enabled if the <a href="/api/config#giveaway-gifts-purchase-available">giveaway_gifts_purchase_available</a> config value is set to true. </p>
|
||||
<p>Note that the flow described below can also be used to gift a Premium subscriptions to multiple friends, and is different from the <a href="/api/premium#gifting-telegram-premium">old gift flow</a>, which allowed gifting only one subscription with some extra limitations, not present in this flow. </p>
|
||||
<p>Note that <a href="/api/links#premium-multigift-links">premium multigift links</a> lead to a page that uses the new gift flow described below. </p>
|
||||
|
@ -89,12 +89,12 @@
|
|||
<p>First of all, invoke <a href="/method/payments.getPremiumGiftCodeOptions">payments.getPremiumGiftCodeOptions</a> to obtain a list of <a href="/constructor/premiumGiftCodeOption">premiumGiftCodeOption</a> constructors, containing a list of giveaway options that may be chosen by the admin, indicating the number and duration of the of <a href="/api/premium">Telegram Premium</a> subscriptions that will be gifted in the giveaway, along with their price (<code>amount</code>) in the specified <code>currency</code> (see the <a href="/constructor/premiumGiftCodeOption">constructor page »</a> for more info on these fields). </p>
|
||||
<p>Once the admin has chosen a specific gift code option, invoke <a href="/method/payments.getPaymentForm">payments.getPaymentForm</a>, passing an <a href="/constructor/inputInvoicePremiumGiftCode">inputInvoicePremiumGiftCode</a>, with the chosen <a href="/constructor/premiumGiftCodeOption">premiumGiftCodeOption</a> in <code>option</code> and a <code>purpose</code> containing either:</p>
|
||||
<ul>
|
||||
<li><a href="/constructor/inputStorePaymentPremiumGiveaway">inputStorePaymentPremiumGiveaway</a> to create a giveaway, where Telegram will randomly select <code>option.users</code> subscribers to the channel specified in <code>purpose.boost_peer</code> (only new subscribers starting from the giveaway creation date if the <code>purpose.only_new_subscribers</code> field is set).<br>
|
||||
Additional channels that the user must join to participate to the giveaway can be specified in <code>additional_peers</code>.<br>
|
||||
<li><a href="/constructor/inputStorePaymentPremiumGiveaway">inputStorePaymentPremiumGiveaway</a> to create a giveaway, where Telegram will randomly select <code>option.users</code> subscribers to the channel/supergroup specified in <code>purpose.boost_peer</code> (only new subscribers starting from the giveaway creation date if the <code>purpose.only_new_subscribers</code> field is set).<br>
|
||||
Additional channels/supergroups that the user must join to participate to the giveaway can be specified in <code>additional_peers</code>.<br>
|
||||
The set of users that can participate to the giveaway can be restricted by passing an explicit whitelist of up to <a href="/api/config#giveaway-countries-max">giveaway_countries_max</a> countries, specified as two-letter ISO 3166-1 alpha-2 country codes in <code>countries_iso2</code>.<br>
|
||||
The end date of the giveaway must be specified in <code>until_date</code>, and it must be at most <a href="/api/config#giveaway-period-max">giveaway_period_max</a> seconds in the future; at that date, Telegram will randomly choose <code>option.users</code> subscribers according to the conditions specified above, and send them a Telegram Premium giftcode as a <a href="/constructor/messageActionGiftCode">messageActionGiftCode</a> constructor, that should be used client-side to generate a <a href="/api/links#premium-giftcode-links">giftcode link</a>.<br>
|
||||
The channel specified in <code>boost_peer</code> will receive <a href="/api/config#giveaway-boosts-per-premium">giveaway_boosts_per_premium</a> <a href="/api/boost">boosts</a> from each user, that cannot be reassigned to another channel for the duration of the gifted subscription. </li>
|
||||
<li>or <a href="/constructor/inputStorePaymentPremiumGiftCode">inputStorePaymentPremiumGiftCode</a>, to gift <a href="/api/premium">Telegram Premium</a> subscriptions only to some specific subscribers (<code>purpose.users</code>, max <a href="/api/config#giveaway-add-peers-max">giveaway_add_peers_max</a> users) of the channel specified in <code>purpose.boost_peer</code>, which will receive <a href="/api/config#giveaway-boosts-per-premium">giveaway_boosts_per_premium</a> <a href="/api/boost">boosts</a> from each user, that cannot be reassigned to another channel for the duration of the gifted subscription.<br>
|
||||
The channel/supergroup specified in <code>boost_peer</code> will receive <a href="/api/config#giveaway-boosts-per-premium">giveaway_boosts_per_premium</a> <a href="/api/boost">boosts</a> from each user, that cannot be reassigned to another channel/supergroup for the duration of the gifted subscription. </li>
|
||||
<li>or <a href="/constructor/inputStorePaymentPremiumGiftCode">inputStorePaymentPremiumGiftCode</a>, to gift <a href="/api/premium">Telegram Premium</a> subscriptions only to some specific subscribers (<code>purpose.users</code>, max <a href="/api/config#giveaway-add-peers-max">giveaway_add_peers_max</a> users) of the channel/supergroup specified in <code>purpose.boost_peer</code>, which will receive <a href="/api/config#giveaway-boosts-per-premium">giveaway_boosts_per_premium</a> <a href="/api/boost">boosts</a> from each user, that cannot be reassigned to another channel/supergroup for the duration of the gifted subscription.<br>
|
||||
Users may also use this method to simply gift subscriptions to contacts by <strong>not</strong> setting the <code>boost_peer</code> field: in this case, gifting a <a href="/api/premium">Telegram Premium</a> subscription to another user will create <a href="/api/config#boosts-per-sent-gift">boosts_per_sent_gift</a> <a href="/api/boost">boost slots »</a> for us, and one boost slot for the destination user. </li>
|
||||
</ul>
|
||||
<p>Then, follow the <a href="/api/payments#22-getting-invoice-info-about-the-product">invoice payment flow as described in the payments documentation »</a>. </p>
|
||||
|
@ -110,15 +110,15 @@ Users may also use this method to simply gift subscriptions to contacts by <stro
|
|||
<p>If the payment was made using the <a href="/method/payments.getPaymentForm">payments.getPaymentForm</a> or <a href="/method/payments.assignAppStoreTransaction">payments.assignAppStoreTransaction</a>/<a href="/method/payments.assignPlayMarketTransaction">payments.assignPlayMarketTransaction</a> payment flows, the giveaway will launch as soon as the payment is complete.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Otherwise, if the <a href="/api/config#premium-bot-username">Premium bot</a> or <a href="https://fragment.com">Fragment</a> flows were used, once the payment for the giveaway is made, invoke <a href="/method/premium.getBoostsStatus">premium.getBoostsStatus</a>, passing to <code>peer</code> the ID of the channel that we selected when paying for the giveaway, to obtain a <a href="/constructor/prepaidGiveaway">prepaidGiveaway</a> constructor in <a href="/constructor/premium.boostsStatus">premium.boostsStatus</a>.<code>prepaid_giveaways</code>, containing info about the prepaid giveaway. </p>
|
||||
<p>To actually launch the giveaway for the Fragment and bot flows, invoke <a href="/method/payments.launchPrepaidGiveaway">payments.launchPrepaidGiveaway</a>, passing <a href="/constructor/prepaidGiveaway">prepaidGiveaway</a>.<code>id</code> to <code>giveaway_id</code>, the ID of the channel to <code>peer</code> and giveaway settings in <code>purpose</code> (populated as specified above). </p>
|
||||
<p>Otherwise, if the <a href="/api/config#premium-bot-username">Premium bot</a> or <a href="https://fragment.com">Fragment</a> flows were used, once the payment for the giveaway is made, invoke <a href="/method/premium.getBoostsStatus">premium.getBoostsStatus</a>, passing to <code>peer</code> the ID of the channel/supergroup that we selected when paying for the giveaway, to obtain a <a href="/constructor/prepaidGiveaway">prepaidGiveaway</a> constructor in <a href="/constructor/premium.boostsStatus">premium.boostsStatus</a>.<code>prepaid_giveaways</code>, containing info about the prepaid giveaway. </p>
|
||||
<p>To actually launch the giveaway for the Fragment and bot flows, invoke <a href="/method/payments.launchPrepaidGiveaway">payments.launchPrepaidGiveaway</a>, passing <a href="/constructor/prepaidGiveaway">prepaidGiveaway</a>.<code>id</code> to <code>giveaway_id</code>, the ID of the channel/supergroup to <code>peer</code> and giveaway settings in <code>purpose</code> (populated as specified above). </p>
|
||||
</li>
|
||||
</ul>
|
||||
<p>Finally:</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>If the payment succeeds and we're launching a giveaway using <a href="/constructor/inputStorePaymentPremiumGiveaway">inputStorePaymentPremiumGiveaway</a>: a <a href="/constructor/messageActionGiveawayLaunch">messageActionGiveawayLaunch</a> service message and a media message containing a <a href="/constructor/messageMediaGiveaway">messageMediaGiveaway</a> will be sent to the channel. </p>
|
||||
<p>Once the giveaway is over, a <a href="/constructor/messageActionGiveawayResults">messageActionGiveawayResults</a> will be sent to the channel and the winners will automatically receive a <a href="/constructor/messageActionGiftCode">messageActionGiftCode</a> service message from Telegram's service user, containing the <code>slug</code> that can be used to generate a <a href="/api/links#premium-giftcode-links">giftcode link</a> to redeem the Premium subscription.<br>
|
||||
<p>If the payment succeeds and we're launching a giveaway using <a href="/constructor/inputStorePaymentPremiumGiveaway">inputStorePaymentPremiumGiveaway</a>: a <a href="/constructor/messageActionGiveawayLaunch">messageActionGiveawayLaunch</a> service message and a media message containing a <a href="/constructor/messageMediaGiveaway">messageMediaGiveaway</a> will be sent to the channel/supergroup. </p>
|
||||
<p>Once the giveaway is over, a <a href="/constructor/messageActionGiveawayResults">messageActionGiveawayResults</a> will be sent to the channel/supergroup and the winners will automatically receive a <a href="/constructor/messageActionGiftCode">messageActionGiftCode</a> service message from Telegram's service user, containing the <code>slug</code> that can be used to generate a <a href="/api/links#premium-giftcode-links">giftcode link</a> to redeem the Premium subscription.<br>
|
||||
The <a href="/constructor/messageActionGiftCode">messageActionGiftCode</a>.<code>via_giveaway</code> flag will be set. </p>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -129,9 +129,9 @@ Clients should display this message, along with a sticker from the <a href="/con
|
|||
</li>
|
||||
</ul>
|
||||
<p>The <a href="/constructor/messageActionGiftCode">messageActionGiftCode</a>.<code>slug</code> should be used to generate a <a href="/api/links#premium-giftcode-links">giftcode link</a>, that the user can use to redeem the subscription, or re-gift it to someone else. </p>
|
||||
<p>If <code>winners_are_visible</code> flag is set while starting a giveaway, giveaway winners are public and will be listed in a <a href="/constructor/messageMediaGiveawayResults">messageMediaGiveawayResults</a> message that will be automatically sent to the channel once the giveaway ends. </p>
|
||||
<p>Any user can invoke <a href="/method/payments.checkGiftCode">payments.checkGiftCode</a> with the link's slug to obtain info about the giveaway, such as the channel that gifted the subscription (<code>from_id</code>), and the user that originally received the gift (<code>to_id</code>).<br>
|
||||
This can also be useful to channel administrators to precisely determine the winners of a giveaway, for example if the giveaway also included some extra gifts apart from Premium subscriptions (<em>like Teslas</em>): the winners can simply send their link as undisputable proof that they won the giveaway, because the user that received the gift can be viewed in the <code>to_id</code> field returned by Telegram when invoking <a href="/method/payments.checkGiftCode">payments.checkGiftCode</a> on the slug.<br>
|
||||
<p>If <code>winners_are_visible</code> flag is set while starting a giveaway, giveaway winners are public and will be listed in a <a href="/constructor/messageMediaGiveawayResults">messageMediaGiveawayResults</a> message that will be automatically sent to the channel/supergroup once the giveaway ends. </p>
|
||||
<p>Any user can invoke <a href="/method/payments.checkGiftCode">payments.checkGiftCode</a> with the link's slug to obtain info about the giveaway, such as the channel/supergroup that gifted the subscription (<code>from_id</code>), and the user that originally received the gift (<code>to_id</code>).<br>
|
||||
This can also be useful to channel/supergroup administrators to precisely determine the winners of a giveaway, for example if the giveaway also included some extra gifts apart from Premium subscriptions (<em>like Teslas</em>): the winners can simply send their link as undisputable proof that they won the giveaway, because the user that received the gift can be viewed in the <code>to_id</code> field returned by Telegram when invoking <a href="/method/payments.checkGiftCode">payments.checkGiftCode</a> on the slug.<br>
|
||||
Another way for admins to check who received the gifts is to simply use <a href="/method/premium.getBoostsList">premium.getBoostsList</a> while the boosts received by the gifts are still active. </p>
|
||||
<p>To claim the <a href="/api/premium">Telegram Premium</a> subscription, simply invoke <a href="/method/payments.applyGiftCode">payments.applyGiftCode</a>, passing the link's <code>slug</code>.</p></div>
|
||||
|
||||
|
|
|
@ -74,12 +74,12 @@
|
|||
<tr>
|
||||
<td><strong>gift</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.1?<a href="/constructor/true">true</a></td>
|
||||
<td>Whether this boost was applied because the channel <a href="/api/giveaways">directly gifted a subscription to the user</a>.</td>
|
||||
<td>Whether this boost was applied because the channel/supergroup <a href="/api/giveaways">directly gifted a subscription to the user</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>giveaway</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.2?<a href="/constructor/true">true</a></td>
|
||||
<td>Whether this boost was applied because the user was chosen in a <a href="/api/giveaways">giveaway started by the channel</a>.</td>
|
||||
<td>Whether this boost was applied because the user was chosen in a <a href="/api/giveaways">giveaway started by the channel/supergroup</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>unclaimed</strong></td>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/inputStorePaymentPremiumGiftCode" >inputStorePaymentPremiumGiftCode</a></li></ul></div>
|
||||
<h1 id="dev_page_title">inputStorePaymentPremiumGiftCode</h1>
|
||||
|
||||
<div id="dev_page_content"><p>Used to gift <a href="/api/premium">Telegram Premium</a> subscriptions only to some specific subscribers of a channel or to some of our contacts, see <a href="/api/giveaways">here »</a> for more info on giveaways and gifts.</p>
|
||||
<div id="dev_page_content"><p>Used to gift <a href="/api/premium">Telegram Premium</a> subscriptions only to some specific subscribers of a channel/supergroup or to some of our contacts, see <a href="/api/giveaways">here »</a> for more info on giveaways and gifts.</p>
|
||||
<p><div class="clearfix">
|
||||
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
|
||||
<li class="dropdown">
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
<tr>
|
||||
<td><strong>via_giveaway</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.0?<a href="/constructor/true">true</a></td>
|
||||
<td>If set, this gift code was received from a <a href="/api/giveaways">giveaway »</a> started by a channel we're subscribed to.</td>
|
||||
<td>If set, this gift code was received from a <a href="/api/giveaways">giveaway »</a> started by a channel/supergroup we're subscribed to.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>unclaimed</strong></td>
|
||||
|
@ -84,7 +84,7 @@
|
|||
<tr>
|
||||
<td><strong>boost_peer</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.1?<a href="/type/Peer">Peer</a></td>
|
||||
<td>Identifier of the channel/supergroup that created the gift code <a href="/api/giveaways">either directly or through a giveaway</a>: if we import this giftcode link, we will also automatically <a href="/api/boost">boost</a> this channel.</td>
|
||||
<td>Identifier of the channel/supergroup that created the gift code <a href="/api/giveaways">either directly or through a giveaway</a>: if we import this giftcode link, we will also automatically <a href="/api/boost">boost</a> this channel/supergroup.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>months</strong></td>
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
<tr>
|
||||
<td><strong>level</strong></td>
|
||||
<td style="text-align: center;"><a href="/type/int">int</a></td>
|
||||
<td>The current boost level of the channel.</td>
|
||||
<td>The current boost level of the channel/supergroup.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>current_level_boosts</strong></td>
|
||||
|
@ -94,7 +94,7 @@
|
|||
<tr>
|
||||
<td><strong>gift_boosts</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.4?<a href="/type/int">int</a></td>
|
||||
<td>The number of boosts acquired from created Telegram Premium <a href="/api/giveaways">gift codes</a> and <a href="/api/giveaways">giveaways</a>; only returned to channel admins.</td>
|
||||
<td>The number of boosts acquired from created Telegram Premium <a href="/api/giveaways">gift codes</a> and <a href="/api/giveaways">giveaways</a>; only returned to channel/supergroup admins.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>next_level_boosts</strong></td>
|
||||
|
@ -104,7 +104,7 @@
|
|||
<tr>
|
||||
<td><strong>premium_audience</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.1?<a href="/type/StatsPercentValue">StatsPercentValue</a></td>
|
||||
<td>Only returned to channel admins: contains the approximated number of Premium users subscribed to the channel, related to the total number of subscribers.</td>
|
||||
<td>Only returned to channel/supergroup admins: contains the approximated number of Premium users subscribed to the channel/supergroup, related to the total number of subscribers.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>boost_url</strong></td>
|
||||
|
@ -114,7 +114,7 @@
|
|||
<tr>
|
||||
<td><strong>prepaid_giveaways</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.3?<a href="/type/Vector%20t">Vector</a><<a href="/type/PrepaidGiveaway">PrepaidGiveaway</a>></td>
|
||||
<td>A list of prepaid <a href="/api/giveaways">giveaways</a> available for the chat; only returned to channel admins.</td>
|
||||
<td>A list of prepaid <a href="/api/giveaways">giveaways</a> available for the chat; only returned to channel/supergroup admins.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>my_boost_slots</strong></td>
|
||||
|
|
|
@ -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 FC 37 09 00 E9 29 7B 66
|
||||
0010 | 14 00 00 00 F1 8E 7E BE 2C 22 11 12 85 A5 5F FA
|
||||
0020 | 5D BF 7A DF B7 C0 C0 44</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 CC E5 02 00 E8 2E 7B 66
|
||||
0010 | 14 00 00 00 F1 8E 7E BE FE 76 51 D6 28 ED 47 10
|
||||
0020 | EE 66 DE C7 F2 89 F2 D3</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>FC370900E9297B66</code></td>
|
||||
<td><code>CCE50200E82E7B66</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>2C22111285A55FFA5DBF7ADFB7C0C044</code></td>
|
||||
<td><code>FE7651D628ED4710EE66DEC7F289F2D3</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 8C AA 62 E9 29 7B 66
|
||||
0010 | 5C 00 00 00 63 24 16 05 2C 22 11 12 85 A5 5F FA
|
||||
0020 | 5D BF 7A DF B7 C0 C0 44 A0 A2 EE 29 93 D9 C7 A4
|
||||
0030 | 75 68 9A C7 B8 F6 7C F3 08 1F 43 95 81 FA E5 38
|
||||
0040 | CF 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 E8 11 97 E8 2E 7B 66
|
||||
0010 | B4 00 00 00 63 24 16 05 FE 76 51 D6 28 ED 47 10
|
||||
0020 | EE 66 DE C7 F2 89 F2 D3 A8 71 EC 90 54 40 E9 4F
|
||||
0030 | 36 CA AE 3C 16 AE 24 E1 08 29 0B 62 FE 56 DA C8
|
||||
0040 | B3 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>018CAA62E9297B66</code></td>
|
||||
<td><code>01E81197E82E7B66</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>B4000000</code> (180 in decimal)</td>
|
||||
<td>Message body length</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -150,19 +150,19 @@
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>2C22111285A55FFA5DBF7ADFB7C0C044</code></td>
|
||||
<td><code>FE7651D628ED4710EE66DEC7F289F2D3</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>A0A2EE2993D9C7A475689AC7B8F67CF3</code></td>
|
||||
<td><code>A871EC905440E94F36CAAE3C16AE24E1</code></td>
|
||||
<td>Server-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pq</td>
|
||||
<td>56, 12</td>
|
||||
<td><code>081F439581FAE538CF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2252808624108026063</td>
|
||||
<td><code>08290B62FE56DAC8B3000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2957566424817256627</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 = 2252808624108026063</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2252808624108026063 = 1198987549 * 1878925787</code></p>
|
||||
<pre><code>p = 1198987549
|
||||
q = 1878925787</code></pre>
|
||||
<pre><code>pq = 2957566424817256627</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2957566424817256627 = 1650247297 * 1792195891</code></p>
|
||||
<pre><code>p = 1650247297
|
||||
q = 1792195891</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 1F 43 95 81 FA E5 38 CF 00 00 00
|
||||
0010 | 04 47 77 19 1D 00 00 00 04 6F FE 21 DB 00 00 00
|
||||
0020 | 2C 22 11 12 85 A5 5F FA 5D BF 7A DF B7 C0 C0 44
|
||||
0030 | A0 A2 EE 29 93 D9 C7 A4 75 68 9A C7 B8 F6 7C F3
|
||||
0040 | 7A CF E5 4A 85 8A 75 CF D7 FC EB 54 DB E4 9C 33
|
||||
0050 | 34 AC DE 42 C9 F5 61 8E 1F 32 DB 2D CF AC 91 2E
|
||||
<pre><code>0000 | 95 5F F5 A9 08 29 0B 62 FE 56 DA C8 B3 00 00 00
|
||||
0010 | 04 62 5C C6 81 00 00 00 04 6A D2 BD 33 00 00 00
|
||||
0020 | FE 76 51 D6 28 ED 47 10 EE 66 DE C7 F2 89 F2 D3
|
||||
0030 | A8 71 EC 90 54 40 E9 4F 36 CA AE 3C 16 AE 24 E1
|
||||
0040 | 69 56 FE C1 57 B9 00 B9 C0 FF 2E F9 33 2B D8 FD
|
||||
0050 | F0 CB 19 0F BE 4F 10 49 41 F7 4C FE 6C C0 A2 D8
|
||||
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 = 1878925787</code></pre>
|
|||
<tr>
|
||||
<td>pq</td>
|
||||
<td>4, 12</td>
|
||||
<td><code>081F439581FAE538CF000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2252808624108026063</td>
|
||||
<td><code>08290B62FE56DAC8B3000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2957566424817256627</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>044777191D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1198987549</td>
|
||||
<td><code>04625CC681000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1650247297</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>046FFE21DB000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1878925787</td>
|
||||
<td><code>046AD2BD33000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1792195891</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>2C22111285A55FFA5DBF7ADFB7C0C044</code></td>
|
||||
<td><code>FE7651D628ED4710EE66DEC7F289F2D3</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>48, 16</td>
|
||||
<td><code>A0A2EE2993D9C7A475689AC7B8F67CF3</code></td>
|
||||
<td><code>A871EC905440E94F36CAAE3C16AE24E1</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce</td>
|
||||
<td>64, 32</td>
|
||||
<td><code>7ACFE54A858A75CFD7FCEB54DBE49C33</code> <code>34ACDE42C9F5618E1F32DB2DCFAC912E</code></td>
|
||||
<td><code>6956FEC157B900B9C0FF2EF9332BD8FD</code> <code>F0CB190FBE4F104941F74CFE6CC0A2D8</code></td>
|
||||
<td>Client-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -291,39 +291,39 @@ q = 1878925787</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 = 955FF5A9081F439581FAE538CF000000044777191D000000046FFE21DB0000002C22111285A55FFA5DBF7ADFB7C0C044A0A2EE2993D9C7A475689AC7B8F67CF37ACFE54A858A75CFD7FCEB54DBE49C3334ACDE42C9F5618E1F32DB2DCFAC912E02000000
|
||||
random_padding_bytes = 6CCE48F774BFB5A7C5E8D1A44DA3568D986E320F8A4A248C01E8556C425474B697D5D6AA7DFFB9837C0A9FE3292EFFBC9FC89AC619868C482DD2E598833893D5837789F7ADB2A09FBD7104B3F1CE746245514CE885DF885D9A77DD51</code></pre>
|
||||
<pre><code>data = 955FF5A908290B62FE56DAC8B300000004625CC681000000046AD2BD33000000FE7651D628ED4710EE66DEC7F289F2D3A871EC905440E94F36CAAE3C16AE24E16956FEC157B900B9C0FF2EF9332BD8FDF0CB190FBE4F104941F74CFE6CC0A2D802000000
|
||||
random_padding_bytes = 10E6A86C7055C990CB7E20A61032FEEC341959199DBE48C3B6EF7B24AFF34152C1D89BA48A3325D3C90D4E67420F61FAC601BE55E54B6242B17DC8FFEE182AC86EA9CFF52396B9608E175478B678AFADEFF5A2CB310798054172AD88</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 = 10AA0856A0F68268D91ED14DB9837F46D190A2E41C7877F278D7B71AAB04826A20C6A167D23F6BBA860D1462D119DA96513E44E4E36A57F592F4518F9BC3325076A24DF938D2AF4FA1181D65367CF9F5BD2611E31EF33830FCDE657072A7520BB167FD7499AE00C89C49A54B14284B01422D8259DBE8C58D5C74AA740FF1DD68C22613435DDFB5827F798D7F9B5265DF22D584B10B320925550036155A1D9755CDFFA1EA37BBE0B19CF5B82CBAC1DD6D796AC19F7BA21DF1E9107317469DA9A445D6EB1D955F0A60AB8D85AC3D72AA48B99B925A391E85A9623DE2C9AF970B9749CC8B9ED1E61058745E9487891DF060D2637CD1E3984DDD644E48E67DD1193B</code></pre>
|
||||
<pre><code>encrypted_data = 50F897F754BC90122EC904E0797B56062100C1091339D3EBF5991350BAFFA1B096DDC7CD6DE9AA8ED200A7B3F0D73A568BFC94F2833EFE005BD990C02A0B80B49C6370D46B97BE7CEC46F5A228D01014DD0D9BA1FBDC1D841AEC0BFF5EA2067AB9E504B4FE2FD8340C1828B5C5D278698ED7AE01F08D494A35648C3B31147C38A13F62EFD65510F0E0C3583FED00048C6DADFAF143398B24ED7F1338FCCBEA03DFC0AD86247F5D380706F59CCA61F1E22636FE985B421BF33AE45843B96548DAB274D624AAEDA2054CFCC8DCED7867E409B78952CDA85CFC6BF2F56FA028C591BD90A8A77E976D73BFCF2FAE57546E7C036E6D5390EC7C070360CD6E8F9E44CA</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 00 38 09 00 E9 29 7B 66
|
||||
0010 | 40 01 00 00 BE E4 12 D7 2C 22 11 12 85 A5 5F FA
|
||||
0020 | 5D BF 7A DF B7 C0 C0 44 A0 A2 EE 29 93 D9 C7 A4
|
||||
0030 | 75 68 9A C7 B8 F6 7C F3 04 47 77 19 1D 00 00 00
|
||||
0040 | 04 6F FE 21 DB 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 10 AA 08 56 A0 F6 82 68 D9 1E D1 4D
|
||||
0060 | B9 83 7F 46 D1 90 A2 E4 1C 78 77 F2 78 D7 B7 1A
|
||||
0070 | AB 04 82 6A 20 C6 A1 67 D2 3F 6B BA 86 0D 14 62
|
||||
0080 | D1 19 DA 96 51 3E 44 E4 E3 6A 57 F5 92 F4 51 8F
|
||||
0090 | 9B C3 32 50 76 A2 4D F9 38 D2 AF 4F A1 18 1D 65
|
||||
00A0 | 36 7C F9 F5 BD 26 11 E3 1E F3 38 30 FC DE 65 70
|
||||
00B0 | 72 A7 52 0B B1 67 FD 74 99 AE 00 C8 9C 49 A5 4B
|
||||
00C0 | 14 28 4B 01 42 2D 82 59 DB E8 C5 8D 5C 74 AA 74
|
||||
00D0 | 0F F1 DD 68 C2 26 13 43 5D DF B5 82 7F 79 8D 7F
|
||||
00E0 | 9B 52 65 DF 22 D5 84 B1 0B 32 09 25 55 00 36 15
|
||||
00F0 | 5A 1D 97 55 CD FF A1 EA 37 BB E0 B1 9C F5 B8 2C
|
||||
0100 | BA C1 DD 6D 79 6A C1 9F 7B A2 1D F1 E9 10 73 17
|
||||
0110 | 46 9D A9 A4 45 D6 EB 1D 95 5F 0A 60 AB 8D 85 AC
|
||||
0120 | 3D 72 AA 48 B9 9B 92 5A 39 1E 85 A9 62 3D E2 C9
|
||||
0130 | AF 97 0B 97 49 CC 8B 9E D1 E6 10 58 74 5E 94 87
|
||||
0140 | 89 1D F0 60 D2 63 7C D1 E3 98 4D DD 64 4E 48 E6
|
||||
0150 | 7D D1 19 3B</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 F0 70 06 00 E8 2E 7B 66
|
||||
0010 | 40 01 00 00 BE E4 12 D7 FE 76 51 D6 28 ED 47 10
|
||||
0020 | EE 66 DE C7 F2 89 F2 D3 A8 71 EC 90 54 40 E9 4F
|
||||
0030 | 36 CA AE 3C 16 AE 24 E1 04 62 5C C6 81 00 00 00
|
||||
0040 | 04 6A D2 BD 33 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 50 F8 97 F7 54 BC 90 12 2E C9 04 E0
|
||||
0060 | 79 7B 56 06 21 00 C1 09 13 39 D3 EB F5 99 13 50
|
||||
0070 | BA FF A1 B0 96 DD C7 CD 6D E9 AA 8E D2 00 A7 B3
|
||||
0080 | F0 D7 3A 56 8B FC 94 F2 83 3E FE 00 5B D9 90 C0
|
||||
0090 | 2A 0B 80 B4 9C 63 70 D4 6B 97 BE 7C EC 46 F5 A2
|
||||
00A0 | 28 D0 10 14 DD 0D 9B A1 FB DC 1D 84 1A EC 0B FF
|
||||
00B0 | 5E A2 06 7A B9 E5 04 B4 FE 2F D8 34 0C 18 28 B5
|
||||
00C0 | C5 D2 78 69 8E D7 AE 01 F0 8D 49 4A 35 64 8C 3B
|
||||
00D0 | 31 14 7C 38 A1 3F 62 EF D6 55 10 F0 E0 C3 58 3F
|
||||
00E0 | ED 00 04 8C 6D AD FA F1 43 39 8B 24 ED 7F 13 38
|
||||
00F0 | FC CB EA 03 DF C0 AD 86 24 7F 5D 38 07 06 F5 9C
|
||||
0100 | CA 61 F1 E2 26 36 FE 98 5B 42 1B F3 3A E4 58 43
|
||||
0110 | B9 65 48 DA B2 74 D6 24 AA ED A2 05 4C FC C8 DC
|
||||
0120 | ED 78 67 E4 09 B7 89 52 CD A8 5C FC 6B F2 F5 6F
|
||||
0130 | A0 28 C5 91 BD 90 A8 A7 7E 97 6D 73 BF CF 2F AE
|
||||
0140 | 57 54 6E 7C 03 6E 6D 53 90 EC 7C 07 03 60 CD 6E
|
||||
0150 | 8F 9E 44 CA</code></pre>
|
||||
<p>Payload (de)serialization:</p>
|
||||
<pre><code>req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;</code></pre>
|
||||
<table class="table">
|
||||
|
@ -345,7 +345,7 @@ random_padding_bytes = 6CCE48F774BFB5A7C5E8D1A44DA3568D986E320F8A4A248C01E8556C4
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>00380900E9297B66</code></td>
|
||||
<td><code>F0700600E82E7B66</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 = 6CCE48F774BFB5A7C5E8D1A44DA3568D986E320F8A4A248C01E8556C4
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>2C22111285A55FFA5DBF7ADFB7C0C044</code></td>
|
||||
<td><code>FE7651D628ED4710EE66DEC7F289F2D3</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>A0A2EE2993D9C7A475689AC7B8F67CF3</code></td>
|
||||
<td><code>A871EC905440E94F36CAAE3C16AE24E1</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p</td>
|
||||
<td>56, 8</td>
|
||||
<td><code>044777191D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1198987549</td>
|
||||
<td><code>04625CC681000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1650247297</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>046FFE21DB000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1878925787</td>
|
||||
<td><code>046AD2BD33000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1792195891</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 = 6CCE48F774BFB5A7C5E8D1A44DA3568D986E320F8A4A248C01E8556C4
|
|||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>80, 260</td>
|
||||
<td><code>FE00010010AA0856A0F68268D91ED14D</code> <code>B9837F46D190A2E41C7877F278D7B71A</code> <code>AB04826A20C6A167D23F6BBA860D1462</code> <code>D119DA96513E44E4E36A57F592F4518F</code> <code>9BC3325076A24DF938D2AF4FA1181D65</code> <code>367CF9F5BD2611E31EF33830FCDE6570</code> <code>72A7520BB167FD7499AE00C89C49A54B</code> <code>14284B01422D8259DBE8C58D5C74AA74</code> <code>0FF1DD68C22613435DDFB5827F798D7F</code> <code>9B5265DF22D584B10B32092555003615</code> <code>5A1D9755CDFFA1EA37BBE0B19CF5B82C</code> <code>BAC1DD6D796AC19F7BA21DF1E9107317</code> <code>469DA9A445D6EB1D955F0A60AB8D85AC</code> <code>3D72AA48B99B925A391E85A9623DE2C9</code> <code>AF970B9749CC8B9ED1E61058745E9487</code> <code>891DF060D2637CD1E3984DDD644E48E6</code><br> <code>7DD1193B</code></td>
|
||||
<td><code>FE00010050F897F754BC90122EC904E0</code> <code>797B56062100C1091339D3EBF5991350</code> <code>BAFFA1B096DDC7CD6DE9AA8ED200A7B3</code> <code>F0D73A568BFC94F2833EFE005BD990C0</code> <code>2A0B80B49C6370D46B97BE7CEC46F5A2</code> <code>28D01014DD0D9BA1FBDC1D841AEC0BFF</code> <code>5EA2067AB9E504B4FE2FD8340C1828B5</code> <code>C5D278698ED7AE01F08D494A35648C3B</code> <code>31147C38A13F62EFD65510F0E0C3583F</code> <code>ED00048C6DADFAF143398B24ED7F1338</code> <code>FCCBEA03DFC0AD86247F5D380706F59C</code> <code>CA61F1E22636FE985B421BF33AE45843</code> <code>B96548DAB274D624AAEDA2054CFCC8DC</code> <code>ED7867E409B78952CDA85CFC6BF2F56F</code> <code>A028C591BD90A8A77E976D73BFCF2FAE</code> <code>57546E7C036E6D5390EC7C070360CD6E</code><br> <code>8F9E44CA</code></td>
|
||||
<td>Value generated above</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -402,47 +402,47 @@ random_padding_bytes = 6CCE48F774BFB5A7C5E8D1A44DA3568D986E320F8A4A248C01E8556C4
|
|||
<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 F0 2C 22 EA 29 7B 66
|
||||
0010 | B4 02 00 00 5C 07 E8 D0 2C 22 11 12 85 A5 5F FA
|
||||
0020 | 5D BF 7A DF B7 C0 C0 44 A0 A2 EE 29 93 D9 C7 A4
|
||||
0030 | 75 68 9A C7 B8 F6 7C F3 FE 50 02 00 6F B8 75 96
|
||||
0040 | A5 61 C2 23 B6 F1 40 5E 13 EC 1D 6B 9B 6D 56 EF
|
||||
0050 | 53 B6 9D 3A FC AD 71 4F AF 87 23 3A 76 D1 DA 61
|
||||
0060 | B3 8C 82 1E 77 67 3D FC E2 43 D8 20 49 14 3F F1
|
||||
0070 | 00 34 13 D2 97 10 7C 7C 62 CE C5 25 9C 13 A1 B5
|
||||
0080 | 27 7C B5 4B 38 11 FA 26 1C 77 19 6A 90 C7 1D BD
|
||||
0090 | 97 2D F7 35 F1 F7 F8 E2 36 0B 52 16 7F 91 07 2F
|
||||
00A0 | 0C 42 91 88 AE 73 D3 63 53 8B AC 43 E0 BB BB 21
|
||||
00B0 | A6 BA 42 D2 F0 7D 86 76 0D 48 B0 9A 02 ED F0 70
|
||||
00C0 | 1A AE A5 11 67 4F 66 63 86 EB 16 10 9C CB 50 48
|
||||
00D0 | 34 63 01 4A E4 8E B5 EC 23 59 96 80 00 5E 9D B6
|
||||
00E0 | EC FD 8C A2 AE 61 42 1E 1A 6F 9B 4F FF 8D 79 DE
|
||||
00F0 | B7 B7 6E DB 26 2B 96 74 18 91 85 CB 24 8F DB 38
|
||||
0100 | DA 8E 19 21 AC EE 84 40 16 73 EA C6 53 DD 08 B9
|
||||
0110 | 93 86 99 8E 18 4E 15 5D AD 6C D3 46 2F B1 FF 3C
|
||||
0120 | BB 1C 51 4C AF 4B 98 D5 FB 7B AB E1 13 3E CF 22
|
||||
0130 | 48 85 77 F4 3E E7 41 6A D9 82 F9 27 00 F0 F7 4D
|
||||
0140 | 3B 82 1E 38 2C 73 00 66 B3 C5 F3 AE 1F DC 3B AA
|
||||
0150 | 3D 62 63 92 BB 7A 66 DA A8 17 32 CA 2A E0 B8 5A
|
||||
0160 | D6 E1 74 1C 59 BC 31 17 63 66 33 85 70 C7 C4 ED
|
||||
0170 | D4 A2 62 A2 C3 47 25 A4 73 C3 37 43 18 2B BB 8E
|
||||
0180 | E0 3E 4E 62 36 6E D9 0E B7 20 9B FA A5 ED F7 07
|
||||
0190 | D5 A0 3F 79 C2 6C 05 AF D4 E8 E2 CB 69 64 57 F3
|
||||
01A0 | 8F 7E 39 0C 57 06 4A 6F 0B EC CA 0B 2A 80 22 AD
|
||||
01B0 | B3 15 22 3B F6 87 31 E9 3A 8C 01 C2 A8 4A 10 2D
|
||||
01C0 | 39 D1 25 1C F4 61 6D D8 6D 4E 15 FE 89 5F D3 A8
|
||||
01D0 | A7 6C 56 26 71 92 94 66 AF F6 08 A0 2F 2D 07 13
|
||||
01E0 | 48 FD 02 93 CE 11 00 52 DB F4 D9 A2 4A C9 47 B0
|
||||
01F0 | D8 60 8D AA A0 1B D0 40 8E 55 AD A4 3C 4C 10 65
|
||||
0200 | EC 20 15 AE C8 5E E6 19 FB 4D 4A 60 14 BB 51 99
|
||||
0210 | 7C 6F 46 88 87 ED E2 DB 48 52 DC 60 BE D4 84 2A
|
||||
0220 | 48 A9 8F 33 56 D2 DE 20 8D 94 31 9C E8 4E 64 14
|
||||
0230 | FA 44 6B 62 F3 2B 78 87 23 94 3E E5 31 A7 5B E1
|
||||
0240 | 9E F6 13 00 CE F5 23 91 8B A7 61 4B C2 B3 46 E6
|
||||
0250 | 08 9B 90 3C A4 1E E0 16 61 B0 00 E2 27 0F EB 46
|
||||
0260 | D4 7C 43 CC 19 B9 D9 0C 32 C8 E6 DB 4E FF 4F 58
|
||||
0270 | B6 0E F3 30 75 14 FD 35 64 A3 47 06 E9 D8 BA 29
|
||||
0280 | E0 D7 4E 4D 86 FB 1E 42 B9 CF 5A B1</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 5C F5 4F E9 2E 7B 66
|
||||
0010 | C0 02 00 00 5C 07 E8 D0 FE 76 51 D6 28 ED 47 10
|
||||
0020 | EE 66 DE C7 F2 89 F2 D3 A8 71 EC 90 54 40 E9 4F
|
||||
0030 | 36 CA AE 3C 16 AE 24 E1 FE 50 02 00 7B 33 7C 45
|
||||
0040 | 5B C8 B9 56 F0 BA 88 DA 47 72 4C E9 C3 79 5B 2F
|
||||
0050 | 87 03 98 67 B0 4A 1F 16 D7 27 E0 33 A7 0D 00 18
|
||||
0060 | FF 6D 63 20 B6 E7 FC 41 94 7F 96 8A F9 BD 4E 91
|
||||
0070 | E8 4B 7B 43 8E 6C 23 E2 51 7C 8C 47 A2 8E D7 55
|
||||
0080 | 6F 18 4B AF 5A B3 5E 17 82 BD 0D 34 FC 0F 0D 4D
|
||||
0090 | CB D0 F7 BE C7 27 B1 CD FE F4 BC 37 E9 82 F8 9E
|
||||
00A0 | 0B DA 30 8A D2 D3 31 54 B8 78 07 3F 46 F9 4E 8B
|
||||
00B0 | E2 41 0D 2A 36 A8 99 51 3E 0D 3E 73 EA 56 B1 12
|
||||
00C0 | AA 3D 26 7D 71 CB AA CC 73 53 B8 CF ED 98 40 C4
|
||||
00D0 | 50 36 6F 33 1A C1 C1 23 7C B4 4B 58 F1 46 3B B1
|
||||
00E0 | 99 C0 D9 E4 97 14 C9 C2 5E FC F9 8A DE DC 81 21
|
||||
00F0 | 4A 2A CF 62 4A 18 BE A0 81 43 54 B9 10 79 54 77
|
||||
0100 | EF 87 28 6D 27 4C 48 09 DC 93 21 19 9D D0 73 CD
|
||||
0110 | A5 E7 E0 AB 42 C2 9C 23 62 ED B8 FE E9 98 8B DF
|
||||
0120 | 31 2C 8D 6D 2B 74 74 C6 92 29 1F 53 3A 36 93 E3
|
||||
0130 | 6C A6 AE CB 30 F9 10 E2 79 F4 42 83 A3 7F 53 93
|
||||
0140 | 0A C4 05 5D F5 49 3D A7 DC E7 AE 3B 5B B7 1D 10
|
||||
0150 | BC 3D 20 DF 5A F7 9F B4 7F B2 91 6B 77 AC 47 7F
|
||||
0160 | FC 89 0D 64 6C DE C2 3A AD B5 7C A6 AA 05 87 94
|
||||
0170 | 7F 74 65 BC A4 09 02 12 3E 97 EB 97 ED 1D A5 C1
|
||||
0180 | 33 2D 34 A8 93 10 C4 06 B7 29 E2 64 4F A3 F7 D2
|
||||
0190 | 4B A1 70 0C 13 27 27 4E 78 D1 93 18 5E 4B D0 4C
|
||||
01A0 | 99 0F 3A E7 AD 30 3E FF BA 61 C7 76 D5 6D 2C A1
|
||||
01B0 | F5 06 94 9B 82 A7 8F ED 69 E7 75 C6 6C 17 F1 8C
|
||||
01C0 | B0 38 77 E4 08 28 D0 11 ED 2A 62 54 11 FE 8D 12
|
||||
01D0 | 63 4B 38 E3 14 90 E2 0A 4A 52 96 38 11 08 51 0E
|
||||
01E0 | 6D 8B E8 77 79 5F 78 E4 08 3D 56 DA 6E 5D F0 BB
|
||||
01F0 | 57 A6 E7 BF C1 58 8B 3A 6B B7 DB 99 AE DB 98 BD
|
||||
0200 | C3 BC F9 C8 98 DA 65 DB 19 78 70 AB 7A F3 B7 E3
|
||||
0210 | 36 5F 18 F3 9A 37 7A E0 7C 17 24 08 85 A3 D9 A9
|
||||
0220 | AC 2A C1 74 00 E9 83 96 6F AA BF 89 05 30 B2 81
|
||||
0230 | BA FE 53 C7 D5 A3 0F A4 CA DA 81 4F 5B AB 69 85
|
||||
0240 | 67 BE BC 09 B1 C9 64 23 E9 36 6E AB 82 8D 25 2A
|
||||
0250 | 42 1D C0 4E C3 BF DF 8D DB 16 2B 9D 9B AC 4A 42
|
||||
0260 | CC 60 1D 69 A0 55 10 B4 81 0D DA C4 2B 3D B6 45
|
||||
0270 | 91 13 CC 4C 7A F3 1D 7C 7F F8 38 18 56 19 AA 30
|
||||
0280 | FE 96 8E B4 59 B5 26 E7 6C 60 34 FC</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 = 6CCE48F774BFB5A7C5E8D1A44DA3568D986E320F8A4A248C01E8556C4
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>01F02C22EA297B66</code></td>
|
||||
<td><code>015CF54FE92E7B66</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>B4020000</code> (692 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 = 6CCE48F774BFB5A7C5E8D1A44DA3568D986E320F8A4A248C01E8556C4
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>2C22111285A55FFA5DBF7ADFB7C0C044</code></td>
|
||||
<td><code>FE7651D628ED4710EE66DEC7F289F2D3</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>A0A2EE2993D9C7A475689AC7B8F67CF3</code></td>
|
||||
<td><code>A871EC905440E94F36CAAE3C16AE24E1</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_answer</td>
|
||||
<td>56, 596</td>
|
||||
<td><code>FE5002006FB87596A561C223B6F1405E</code> <code>13EC1D6B9B6D56EF53B69D3AFCAD714F</code> <code>AF87233A76D1DA61B38C821E77673DFC</code> <code>E243D82049143FF1003413D297107C7C</code> <code>62CEC5259C13A1B5277CB54B3811FA26</code> <code>1C77196A90C71DBD972DF735F1F7F8E2</code> <code>360B52167F91072F0C429188AE73D363</code> <code>538BAC43E0BBBB21A6BA42D2F07D8676</code> <code>0D48B09A02EDF0701AAEA511674F6663</code> <code>86EB16109CCB50483463014AE48EB5EC</code> <code>23599680005E9DB6ECFD8CA2AE61421E</code> <code>1A6F9B4FFF8D79DEB7B76EDB262B9674</code> <code>189185CB248FDB38DA8E1921ACEE8440</code> <code>1673EAC653DD08B99386998E184E155D</code> <code>AD6CD3462FB1FF3CBB1C514CAF4B98D5</code> <code>FB7BABE1133ECF22488577F43EE7416A</code> <code>D982F92700F0F74D3B821E382C730066</code> <code>B3C5F3AE1FDC3BAA3D626392BB7A66DA</code> <code>A81732CA2AE0B85AD6E1741C59BC3117</code> <code>6366338570C7C4EDD4A262A2C34725A4</code> <code>73C33743182BBB8EE03E4E62366ED90E</code> <code>B7209BFAA5EDF707D5A03F79C26C05AF</code> <code>D4E8E2CB696457F38F7E390C57064A6F</code> <code>0BECCA0B2A8022ADB315223BF68731E9</code> <code>3A8C01C2A84A102D39D1251CF4616DD8</code> <code>6D4E15FE895FD3A8A76C562671929466</code> <code>AFF608A02F2D071348FD0293CE110052</code> <code>DBF4D9A24AC947B0D8608DAAA01BD040</code> <code>8E55ADA43C4C1065EC2015AEC85EE619</code> <code>FB4D4A6014BB51997C6F468887EDE2DB</code> <code>4852DC60BED4842A48A98F3356D2DE20</code> <code>8D94319CE84E6414FA446B62F32B7887</code> <code>23943EE531A75BE19EF61300CEF52391</code> <code>8BA7614BC2B346E6089B903CA41EE016</code> <code>61B000E2270FEB46D47C43CC19B9D90C</code> <code>32C8E6DB4EFF4F58B60EF3307514FD35</code> <code>64A34706E9D8BA29E0D74E4D86FB1E42</code><br> <code>B9CF5AB1</code></td>
|
||||
<td><code>FE5002007B337C455BC8B956F0BA88DA</code> <code>47724CE9C3795B2F87039867B04A1F16</code> <code>D727E033A70D0018FF6D6320B6E7FC41</code> <code>947F968AF9BD4E91E84B7B438E6C23E2</code> <code>517C8C47A28ED7556F184BAF5AB35E17</code> <code>82BD0D34FC0F0D4DCBD0F7BEC727B1CD</code> <code>FEF4BC37E982F89E0BDA308AD2D33154</code> <code>B878073F46F94E8BE2410D2A36A89951</code> <code>3E0D3E73EA56B112AA3D267D71CBAACC</code> <code>7353B8CFED9840C450366F331AC1C123</code> <code>7CB44B58F1463BB199C0D9E49714C9C2</code> <code>5EFCF98ADEDC81214A2ACF624A18BEA0</code> <code>814354B910795477EF87286D274C4809</code> <code>DC9321199DD073CDA5E7E0AB42C29C23</code> <code>62EDB8FEE9988BDF312C8D6D2B7474C6</code> <code>92291F533A3693E36CA6AECB30F910E2</code> <code>79F44283A37F53930AC4055DF5493DA7</code> <code>DCE7AE3B5BB71D10BC3D20DF5AF79FB4</code> <code>7FB2916B77AC477FFC890D646CDEC23A</code> <code>ADB57CA6AA0587947F7465BCA4090212</code> <code>3E97EB97ED1DA5C1332D34A89310C406</code> <code>B729E2644FA3F7D24BA1700C1327274E</code> <code>78D193185E4BD04C990F3AE7AD303EFF</code> <code>BA61C776D56D2CA1F506949B82A78FED</code> <code>69E775C66C17F18CB03877E40828D011</code> <code>ED2A625411FE8D12634B38E31490E20A</code> <code>4A5296381108510E6D8BE877795F78E4</code> <code>083D56DA6E5DF0BB57A6E7BFC1588B3A</code> <code>6BB7DB99AEDB98BDC3BCF9C898DA65DB</code> <code>197870AB7AF3B7E3365F18F39A377AE0</code> <code>7C17240885A3D9A9AC2AC17400E98396</code> <code>6FAABF890530B281BAFE53C7D5A30FA4</code> <code>CADA814F5BAB698567BEBC09B1C96423</code> <code>E9366EAB828D252A421DC04EC3BFDF8D</code> <code>DB162B9D9BAC4A42CC601D69A05510B4</code> <code>810DDAC42B3DB6459113CC4C7AF31D7C</code> <code>7FF838185619AA30FE968EB459B526E7</code><br> <code>6C6034FC</code></td>
|
||||
<td>See below</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -502,20 +502,20 @@ random_padding_bytes = 6CCE48F774BFB5A7C5E8D1A44DA3568D986E320F8A4A248C01E8556C4
|
|||
<!-- 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 = 6FB87596A561C223B6F1405E13EC1D6B9B6D56EF53B69D3AFCAD714FAF87233A76D1DA61B38C821E77673DFCE243D82049143FF1003413D297107C7C62CEC5259C13A1B5277CB54B3811FA261C77196A90C71DBD972DF735F1F7F8E2360B52167F91072F0C429188AE73D363538BAC43E0BBBB21A6BA42D2F07D86760D48B09A02EDF0701AAEA511674F666386EB16109CCB50483463014AE48EB5EC23599680005E9DB6ECFD8CA2AE61421E1A6F9B4FFF8D79DEB7B76EDB262B9674189185CB248FDB38DA8E1921ACEE84401673EAC653DD08B99386998E184E155DAD6CD3462FB1FF3CBB1C514CAF4B98D5FB7BABE1133ECF22488577F43EE7416AD982F92700F0F74D3B821E382C730066B3C5F3AE1FDC3BAA3D626392BB7A66DAA81732CA2AE0B85AD6E1741C59BC31176366338570C7C4EDD4A262A2C34725A473C33743182BBB8EE03E4E62366ED90EB7209BFAA5EDF707D5A03F79C26C05AFD4E8E2CB696457F38F7E390C57064A6F0BECCA0B2A8022ADB315223BF68731E93A8C01C2A84A102D39D1251CF4616DD86D4E15FE895FD3A8A76C562671929466AFF608A02F2D071348FD0293CE110052DBF4D9A24AC947B0D8608DAAA01BD0408E55ADA43C4C1065EC2015AEC85EE619FB4D4A6014BB51997C6F468887EDE2DB4852DC60BED4842A48A98F3356D2DE208D94319CE84E6414FA446B62F32B788723943EE531A75BE19EF61300CEF523918BA7614BC2B346E6089B903CA41EE01661B000E2270FEB46D47C43CC19B9D90C32C8E6DB4EFF4F58B60EF3307514FD3564A34706E9D8BA29E0D74E4D86FB1E42B9CF5AB1
|
||||
tmp_aes_key = 19581A6606A51B4D64B6965A1576485CA19F65F37C34AF91728670A4BE3EEC40
|
||||
tmp_aes_iv = FF9918EEF27701B049AD105054D9DC0AC33189635D5217C82E11B4AB7ACFE54A</code></pre>
|
||||
<pre><code>encrypted_answer = 7B337C455BC8B956F0BA88DA47724CE9C3795B2F87039867B04A1F16D727E033A70D0018FF6D6320B6E7FC41947F968AF9BD4E91E84B7B438E6C23E2517C8C47A28ED7556F184BAF5AB35E1782BD0D34FC0F0D4DCBD0F7BEC727B1CDFEF4BC37E982F89E0BDA308AD2D33154B878073F46F94E8BE2410D2A36A899513E0D3E73EA56B112AA3D267D71CBAACC7353B8CFED9840C450366F331AC1C1237CB44B58F1463BB199C0D9E49714C9C25EFCF98ADEDC81214A2ACF624A18BEA0814354B910795477EF87286D274C4809DC9321199DD073CDA5E7E0AB42C29C2362EDB8FEE9988BDF312C8D6D2B7474C692291F533A3693E36CA6AECB30F910E279F44283A37F53930AC4055DF5493DA7DCE7AE3B5BB71D10BC3D20DF5AF79FB47FB2916B77AC477FFC890D646CDEC23AADB57CA6AA0587947F7465BCA40902123E97EB97ED1DA5C1332D34A89310C406B729E2644FA3F7D24BA1700C1327274E78D193185E4BD04C990F3AE7AD303EFFBA61C776D56D2CA1F506949B82A78FED69E775C66C17F18CB03877E40828D011ED2A625411FE8D12634B38E31490E20A4A5296381108510E6D8BE877795F78E4083D56DA6E5DF0BB57A6E7BFC1588B3A6BB7DB99AEDB98BDC3BCF9C898DA65DB197870AB7AF3B7E3365F18F39A377AE07C17240885A3D9A9AC2AC17400E983966FAABF890530B281BAFE53C7D5A30FA4CADA814F5BAB698567BEBC09B1C96423E9366EAB828D252A421DC04EC3BFDF8DDB162B9D9BAC4A42CC601D69A05510B4810DDAC42B3DB6459113CC4C7AF31D7C7FF838185619AA30FE968EB459B526E76C6034FC
|
||||
tmp_aes_key = D643DDC0A2EF8831729DB7D01C356F174CE09C6C8C26008E1A16BD197F89579A
|
||||
tmp_aes_iv = 5136F208E6F269F4963A2965142188C736DBB06227671DFBAB563A056956FEC1</code></pre>
|
||||
<!-- end server_DH_inner_data_input -->
|
||||
<p>Yielding:</p>
|
||||
<!-- start server_DH_inner_data_output -->
|
||||
<pre><code>answer_with_hash = 6CBDF8247F6DF12109DE6F90719F8CE13D85343CBA0D89B52C22111285A55FFA5DBF7ADFB7C0C044A0A2EE2993D9C7A475689AC7B8F67CF303000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010013A776883E6EF3EADE80AB1E49C79E236D8EF659E6A9C4B8985C5BC7E4C11BAF98478F3F3F8CA0535F7A02938EA0FB8CF60B0AB79D469248001DB79705E42D2D79A2845647EE4EC9B617A8E68A54A33F2E5C8F7751AD6FCD1CE232BA6BDFDAD55C5A815E8AB2178FC5ED00325118522BBD07D4C62A44567F3AF8B27F3B4ABB578AE6B6631B2AE48D0DEB1C688FF13C8A60E2369C0782387476FDC76461EFDA24A6BAB9970DB8D7349244F13FBB6D208D92A6BB8518E01A46C87FD78C1898F90F5545BBB1381892F39286A039315C97E4C252D8DCBA8A6395E9FA1BE43B3AE8D94880CC46F45957236650D4B763EFC2AE2AAF296C42854FCDDB68CAFCBF91D6A9EA297B66582169B7E24CBEE9
|
||||
answer = BA0D89B52C22111285A55FFA5DBF7ADFB7C0C044A0A2EE2993D9C7A475689AC7B8F67CF303000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010013A776883E6EF3EADE80AB1E49C79E236D8EF659E6A9C4B8985C5BC7E4C11BAF98478F3F3F8CA0535F7A02938EA0FB8CF60B0AB79D469248001DB79705E42D2D79A2845647EE4EC9B617A8E68A54A33F2E5C8F7751AD6FCD1CE232BA6BDFDAD55C5A815E8AB2178FC5ED00325118522BBD07D4C62A44567F3AF8B27F3B4ABB578AE6B6631B2AE48D0DEB1C688FF13C8A60E2369C0782387476FDC76461EFDA24A6BAB9970DB8D7349244F13FBB6D208D92A6BB8518E01A46C87FD78C1898F90F5545BBB1381892F39286A039315C97E4C252D8DCBA8A6395E9FA1BE43B3AE8D94880CC46F45957236650D4B763EFC2AE2AAF296C42854FCDDB68CAFCBF91D6A9EA297B66582169B7E24CBEE9</code></pre>
|
||||
<pre><code>answer_with_hash = 661B87493E4C91D6651897768B9645D16457093BBA0D89B5FE7651D628ED4710EE66DEC7F289F2D3A871EC905440E94F36CAAE3C16AE24E103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100B0772194A508D6F92C5E914769EB206F31E755D07DB39AF339376EB2F3873B980F3F3BCAD528FF333F0AB24190887EE1D07E6112269098CE31D3EE52BAA09AF0EEAA1260A9B269F97916C9276B6176D314D1B65A55A59B523D41DFA9F7138D18FD73F265F93B52B93980841B1BE965BD775D3F52A23D5544367C6F6E8FB2F0D237D5970BD0A326606C7325B740EBCB82C30C69D62EB9D2E412567795A891878F0FEC03572B70A7396EC7186EDF10AF4A07F92964ED8FD6C397FDE724B33B150B4C58FE81CC0173731F40EA16F1ACD2C26EF2B88CE1AAA4572162D6F13EF04056CD54EE6AC8709B3CA411957240CFAA66354D5D4257FF5342B110F22AE3C3B186E92E7B664E5FA4C64957CFB2
|
||||
answer = BA0D89B5FE7651D628ED4710EE66DEC7F289F2D3A871EC905440E94F36CAAE3C16AE24E103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE000100B0772194A508D6F92C5E914769EB206F31E755D07DB39AF339376EB2F3873B980F3F3BCAD528FF333F0AB24190887EE1D07E6112269098CE31D3EE52BAA09AF0EEAA1260A9B269F97916C9276B6176D314D1B65A55A59B523D41DFA9F7138D18FD73F265F93B52B93980841B1BE965BD775D3F52A23D5544367C6F6E8FB2F0D237D5970BD0A326606C7325B740EBCB82C30C69D62EB9D2E412567795A891878F0FEC03572B70A7396EC7186EDF10AF4A07F92964ED8FD6C397FDE724B33B150B4C58FE81CC0173731F40EA16F1ACD2C26EF2B88CE1AAA4572162D6F13EF04056CD54EE6AC8709B3CA411957240CFAA66354D5D4257FF5342B110F22AE3C3B186E92E7B664E5FA4C64957CFB2</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 2C 22 11 12 85 A5 5F FA 5D BF 7A DF
|
||||
0010 | B7 C0 C0 44 A0 A2 EE 29 93 D9 C7 A4 75 68 9A C7
|
||||
0020 | B8 F6 7C F3 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
||||
<pre><code>0000 | BA 0D 89 B5 FE 76 51 D6 28 ED 47 10 EE 66 DE C7
|
||||
0010 | F2 89 F2 D3 A8 71 EC 90 54 40 E9 4F 36 CA AE 3C
|
||||
0020 | 16 AE 24 E1 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 = BA0D89B52C22111285A55FFA5DBF7ADFB7C0C044A0A2EE2993D9C7A475689AC7B8F67CF
|
|||
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 | 13 A7 76 88 3E 6E F3 EA DE 80 AB 1E 49 C7 9E 23
|
||||
0140 | 6D 8E F6 59 E6 A9 C4 B8 98 5C 5B C7 E4 C1 1B AF
|
||||
0150 | 98 47 8F 3F 3F 8C A0 53 5F 7A 02 93 8E A0 FB 8C
|
||||
0160 | F6 0B 0A B7 9D 46 92 48 00 1D B7 97 05 E4 2D 2D
|
||||
0170 | 79 A2 84 56 47 EE 4E C9 B6 17 A8 E6 8A 54 A3 3F
|
||||
0180 | 2E 5C 8F 77 51 AD 6F CD 1C E2 32 BA 6B DF DA D5
|
||||
0190 | 5C 5A 81 5E 8A B2 17 8F C5 ED 00 32 51 18 52 2B
|
||||
01A0 | BD 07 D4 C6 2A 44 56 7F 3A F8 B2 7F 3B 4A BB 57
|
||||
01B0 | 8A E6 B6 63 1B 2A E4 8D 0D EB 1C 68 8F F1 3C 8A
|
||||
01C0 | 60 E2 36 9C 07 82 38 74 76 FD C7 64 61 EF DA 24
|
||||
01D0 | A6 BA B9 97 0D B8 D7 34 92 44 F1 3F BB 6D 20 8D
|
||||
01E0 | 92 A6 BB 85 18 E0 1A 46 C8 7F D7 8C 18 98 F9 0F
|
||||
01F0 | 55 45 BB B1 38 18 92 F3 92 86 A0 39 31 5C 97 E4
|
||||
0200 | C2 52 D8 DC BA 8A 63 95 E9 FA 1B E4 3B 3A E8 D9
|
||||
0210 | 48 80 CC 46 F4 59 57 23 66 50 D4 B7 63 EF C2 AE
|
||||
0220 | 2A AF 29 6C 42 85 4F CD DB 68 CA FC BF 91 D6 A9
|
||||
0230 | EA 29 7B 66</code></pre>
|
||||
0130 | B0 77 21 94 A5 08 D6 F9 2C 5E 91 47 69 EB 20 6F
|
||||
0140 | 31 E7 55 D0 7D B3 9A F3 39 37 6E B2 F3 87 3B 98
|
||||
0150 | 0F 3F 3B CA D5 28 FF 33 3F 0A B2 41 90 88 7E E1
|
||||
0160 | D0 7E 61 12 26 90 98 CE 31 D3 EE 52 BA A0 9A F0
|
||||
0170 | EE AA 12 60 A9 B2 69 F9 79 16 C9 27 6B 61 76 D3
|
||||
0180 | 14 D1 B6 5A 55 A5 9B 52 3D 41 DF A9 F7 13 8D 18
|
||||
0190 | FD 73 F2 65 F9 3B 52 B9 39 80 84 1B 1B E9 65 BD
|
||||
01A0 | 77 5D 3F 52 A2 3D 55 44 36 7C 6F 6E 8F B2 F0 D2
|
||||
01B0 | 37 D5 97 0B D0 A3 26 60 6C 73 25 B7 40 EB CB 82
|
||||
01C0 | C3 0C 69 D6 2E B9 D2 E4 12 56 77 95 A8 91 87 8F
|
||||
01D0 | 0F EC 03 57 2B 70 A7 39 6E C7 18 6E DF 10 AF 4A
|
||||
01E0 | 07 F9 29 64 ED 8F D6 C3 97 FD E7 24 B3 3B 15 0B
|
||||
01F0 | 4C 58 FE 81 CC 01 73 73 1F 40 EA 16 F1 AC D2 C2
|
||||
0200 | 6E F2 B8 8C E1 AA A4 57 21 62 D6 F1 3E F0 40 56
|
||||
0210 | CD 54 EE 6A C8 70 9B 3C A4 11 95 72 40 CF AA 66
|
||||
0220 | 35 4D 5D 42 57 FF 53 42 B1 10 F2 2A E3 C3 B1 86
|
||||
0230 | E9 2E 7B 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 = BA0D89B52C22111285A55FFA5DBF7ADFB7C0C044A0A2EE2993D9C7A475689AC7B8F67CF
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>2C22111285A55FFA5DBF7ADFB7C0C044</code></td>
|
||||
<td><code>FE7651D628ED4710EE66DEC7F289F2D3</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>A0A2EE2993D9C7A475689AC7B8F67CF3</code></td>
|
||||
<td><code>A871EC905440E94F36CAAE3C16AE24E1</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -594,13 +594,13 @@ answer = BA0D89B52C22111285A55FFA5DBF7ADFB7C0C044A0A2EE2993D9C7A475689AC7B8F67CF
|
|||
<tr>
|
||||
<td>g_a</td>
|
||||
<td>300, 260</td>
|
||||
<td><code>FE00010013A776883E6EF3EADE80AB1E</code> <code>49C79E236D8EF659E6A9C4B8985C5BC7</code> <code>E4C11BAF98478F3F3F8CA0535F7A0293</code> <code>8EA0FB8CF60B0AB79D469248001DB797</code> <code>05E42D2D79A2845647EE4EC9B617A8E6</code> <code>8A54A33F2E5C8F7751AD6FCD1CE232BA</code> <code>6BDFDAD55C5A815E8AB2178FC5ED0032</code> <code>5118522BBD07D4C62A44567F3AF8B27F</code> <code>3B4ABB578AE6B6631B2AE48D0DEB1C68</code> <code>8FF13C8A60E2369C0782387476FDC764</code> <code>61EFDA24A6BAB9970DB8D7349244F13F</code> <code>BB6D208D92A6BB8518E01A46C87FD78C</code> <code>1898F90F5545BBB1381892F39286A039</code> <code>315C97E4C252D8DCBA8A6395E9FA1BE4</code> <code>3B3AE8D94880CC46F45957236650D4B7</code> <code>63EFC2AE2AAF296C42854FCDDB68CAFC</code><br> <code>BF91D6A9</code></td>
|
||||
<td><code>FE000100B0772194A508D6F92C5E9147</code> <code>69EB206F31E755D07DB39AF339376EB2</code> <code>F3873B980F3F3BCAD528FF333F0AB241</code> <code>90887EE1D07E6112269098CE31D3EE52</code> <code>BAA09AF0EEAA1260A9B269F97916C927</code> <code>6B6176D314D1B65A55A59B523D41DFA9</code> <code>F7138D18FD73F265F93B52B93980841B</code> <code>1BE965BD775D3F52A23D5544367C6F6E</code> <code>8FB2F0D237D5970BD0A326606C7325B7</code> <code>40EBCB82C30C69D62EB9D2E412567795</code> <code>A891878F0FEC03572B70A7396EC7186E</code> <code>DF10AF4A07F92964ED8FD6C397FDE724</code> <code>B33B150B4C58FE81CC0173731F40EA16</code> <code>F1ACD2C26EF2B88CE1AAA4572162D6F1</code> <code>3EF04056CD54EE6AC8709B3CA4119572</code> <code>40CFAA66354D5D4257FF5342B110F22A</code><br> <code>E3C3B186</code></td>
|
||||
<td><code>g_a</code> diffie-hellman parameter</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_time</td>
|
||||
<td>560, 4</td>
|
||||
<td><code>EA297B66</code> (1719347690 in decimal)</td>
|
||||
<td><code>E92E7B66</code> (1719348969 in decimal)</td>
|
||||
<td>Server time</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -609,34 +609,34 @@ answer = BA0D89B52C22111285A55FFA5DBF7ADFB7C0C044A0A2EE2993D9C7A475689AC7B8F67CF
|
|||
<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 = BBE774D3966DF0FB036AFAF8ED130D717A11C2E0B0BFAED55AADF4BDDCBDE72682E8251A8C796E6C8A70E1398F5B13CAFDD51ED3FF63052C2C3DFB4274BB43397BC820CBC8B8592CC23D36437F8B7F57F62952E7A7473ABF09A5648E15F2129FC69C7D4610219202211879F79D0018273195244C3B1BB1ED377CA02BB4BE3D8024EAC492745A08557C824D39EC465C25D93B76BE4CF3AA433DBDEE953E2153F7E1405ECA5F438754FA20A727F1EAC86928B0DCFD2FBCB8C1BAAF185FB315EC4473C4D788DD12B2499F9C1D798D8F3CEF7197C0D1AD7CD4B99CBE109520EFF0A1ED32793B9A502A8DC5298467C594B3ADC57ACC8F8E48A6FBE455AA8BC5CA65DA</code></pre>
|
||||
<pre><code>b = D50EA9047898647D4588A719EA6250AA9397A825CABBDE031EEB5F5D7599CD9C0C75FC693E10B1EEDC7218C5AFFA726ADDF4D1F873EB0FBC22997720873B942A698B0F99453934207D85EE0B5365CF2C9F2303AABDC705DFC0052FC27EC512024999D507012BCB3F8321FC461D34280F910BE7F9190AD931B9FDACCDF82448324025F84D65B472D090BA6E2DF03C5DF5A888A530AC1231B123A90E68F4CF1FDBD752A573682ED61C3893C1FFA38C729970AF28D4ECCF2AD1713957D695E550A978B88FDCE4531B936E4AAB7240815209A14AEB1D26EE8B48499E1E144F35CCDAFEDF3F203AD8357369CE7D8579133B4CD9929F6668A8492645932C334CAA16F8</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 = B0B4090020ECC9906C9A78314F45C0272C4E2783CE9CF7708759BE8D56D991E8A5F2173B3B770A264E937EFF8A5D48F66B51A0708E0FC5D1E614935ECB81D83024B02E4BD41D430A2095447F71FF225A02010F97A617E69B03A48C71291D4ADC53C5AF6503A8634545AC2A2834AD2B585093615473E76FD5E880B0E640A34FB94753ACC7DE65BF55CC999984F266F773F8A44814567EF47C929EFCA309A16D1E2B0F4D7A30F7FB2A2119A2ABE51AA8C780BDC89FE34E34D5C9C88161B6F93C52FAA8BBB3D69F410971D7ED6314793D5A78AFA1D71EFF7430A28EE27AB50859888E0C6B311024F1EC2AF4B83124AAC0778B5014316D20764969FCE8E9D95FCCD5</code></pre>
|
||||
<pre><code>g_b = 61F9C703D8BDB0F8C7F74ACD60E59C65B013F2933B888DA35D41195A13A548C27800FDCFEAEA1705DF8FE846734A74338A0CF0AAE517ABD824DFFEF0560C8F985375088B5E5DEB8F90D05863B8ACD0F5B53E625414D28E91AB1014A1EAA54D1465438ABCB19C0881751643689E674FBE3889D260455DC419A28FBB93499DBBC30C9F33CB2F1C35942198D66E89351C136762783773276E1C531F6CA97AA65CA92E4DD3106D62B277253A8594E838FF3BC858D7922D505ED1FA141A7F5339E33A59EAB18FA971FEE834D927D745580341C9ADF3467CB14DE6B7E54DE03402A86CCDD93D5E65A06B09C702F36E565116789F0D4E366F8E21FD992FFB63C6BBA32B</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 2C 22 11 12 85 A5 5F FA 5D BF 7A DF
|
||||
0010 | B7 C0 C0 44 A0 A2 EE 29 93 D9 C7 A4 75 68 9A C7
|
||||
0020 | B8 F6 7C F3 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | B0 B4 09 00 20 EC C9 90 6C 9A 78 31 4F 45 C0 27
|
||||
0040 | 2C 4E 27 83 CE 9C F7 70 87 59 BE 8D 56 D9 91 E8
|
||||
0050 | A5 F2 17 3B 3B 77 0A 26 4E 93 7E FF 8A 5D 48 F6
|
||||
0060 | 6B 51 A0 70 8E 0F C5 D1 E6 14 93 5E CB 81 D8 30
|
||||
0070 | 24 B0 2E 4B D4 1D 43 0A 20 95 44 7F 71 FF 22 5A
|
||||
0080 | 02 01 0F 97 A6 17 E6 9B 03 A4 8C 71 29 1D 4A DC
|
||||
0090 | 53 C5 AF 65 03 A8 63 45 45 AC 2A 28 34 AD 2B 58
|
||||
00A0 | 50 93 61 54 73 E7 6F D5 E8 80 B0 E6 40 A3 4F B9
|
||||
00B0 | 47 53 AC C7 DE 65 BF 55 CC 99 99 84 F2 66 F7 73
|
||||
00C0 | F8 A4 48 14 56 7E F4 7C 92 9E FC A3 09 A1 6D 1E
|
||||
00D0 | 2B 0F 4D 7A 30 F7 FB 2A 21 19 A2 AB E5 1A A8 C7
|
||||
00E0 | 80 BD C8 9F E3 4E 34 D5 C9 C8 81 61 B6 F9 3C 52
|
||||
00F0 | FA A8 BB B3 D6 9F 41 09 71 D7 ED 63 14 79 3D 5A
|
||||
0100 | 78 AF A1 D7 1E FF 74 30 A2 8E E2 7A B5 08 59 88
|
||||
0110 | 8E 0C 6B 31 10 24 F1 EC 2A F4 B8 31 24 AA C0 77
|
||||
0120 | 8B 50 14 31 6D 20 76 49 69 FC E8 E9 D9 5F CC D5</code></pre>
|
||||
<pre><code>0000 | 54 B6 43 66 FE 76 51 D6 28 ED 47 10 EE 66 DE C7
|
||||
0010 | F2 89 F2 D3 A8 71 EC 90 54 40 E9 4F 36 CA AE 3C
|
||||
0020 | 16 AE 24 E1 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | 61 F9 C7 03 D8 BD B0 F8 C7 F7 4A CD 60 E5 9C 65
|
||||
0040 | B0 13 F2 93 3B 88 8D A3 5D 41 19 5A 13 A5 48 C2
|
||||
0050 | 78 00 FD CF EA EA 17 05 DF 8F E8 46 73 4A 74 33
|
||||
0060 | 8A 0C F0 AA E5 17 AB D8 24 DF FE F0 56 0C 8F 98
|
||||
0070 | 53 75 08 8B 5E 5D EB 8F 90 D0 58 63 B8 AC D0 F5
|
||||
0080 | B5 3E 62 54 14 D2 8E 91 AB 10 14 A1 EA A5 4D 14
|
||||
0090 | 65 43 8A BC B1 9C 08 81 75 16 43 68 9E 67 4F BE
|
||||
00A0 | 38 89 D2 60 45 5D C4 19 A2 8F BB 93 49 9D BB C3
|
||||
00B0 | 0C 9F 33 CB 2F 1C 35 94 21 98 D6 6E 89 35 1C 13
|
||||
00C0 | 67 62 78 37 73 27 6E 1C 53 1F 6C A9 7A A6 5C A9
|
||||
00D0 | 2E 4D D3 10 6D 62 B2 77 25 3A 85 94 E8 38 FF 3B
|
||||
00E0 | C8 58 D7 92 2D 50 5E D1 FA 14 1A 7F 53 39 E3 3A
|
||||
00F0 | 59 EA B1 8F A9 71 FE E8 34 D9 27 D7 45 58 03 41
|
||||
0100 | C9 AD F3 46 7C B1 4D E6 B7 E5 4D E0 34 02 A8 6C
|
||||
0110 | CD D9 3D 5E 65 A0 6B 09 C7 02 F3 6E 56 51 16 78
|
||||
0120 | 9F 0D 4E 36 6F 8E 21 FD 99 2F FB 63 C6 BB A3 2B</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 = BA0D89B52C22111285A55FFA5DBF7ADFB7C0C044A0A2EE2993D9C7A475689AC7B8F67CF
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>2C22111285A55FFA5DBF7ADFB7C0C044</code></td>
|
||||
<td><code>FE7651D628ED4710EE66DEC7F289F2D3</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>A0A2EE2993D9C7A475689AC7B8F67CF3</code></td>
|
||||
<td><code>A871EC905440E94F36CAAE3C16AE24E1</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>g_b</td>
|
||||
<td>36, 260</td>
|
||||
<td><code>FE000100B0B4090020ECC9906C9A7831</code> <code>4F45C0272C4E2783CE9CF7708759BE8D</code> <code>56D991E8A5F2173B3B770A264E937EFF</code> <code>8A5D48F66B51A0708E0FC5D1E614935E</code> <code>CB81D83024B02E4BD41D430A2095447F</code> <code>71FF225A02010F97A617E69B03A48C71</code> <code>291D4ADC53C5AF6503A8634545AC2A28</code> <code>34AD2B585093615473E76FD5E880B0E6</code> <code>40A34FB94753ACC7DE65BF55CC999984</code> <code>F266F773F8A44814567EF47C929EFCA3</code> <code>09A16D1E2B0F4D7A30F7FB2A2119A2AB</code> <code>E51AA8C780BDC89FE34E34D5C9C88161</code> <code>B6F93C52FAA8BBB3D69F410971D7ED63</code> <code>14793D5A78AFA1D71EFF7430A28EE27A</code> <code>B50859888E0C6B311024F1EC2AF4B831</code> <code>24AAC0778B5014316D20764969FCE8E9</code><br> <code>D95FCCD5</code></td>
|
||||
<td><code>FE00010061F9C703D8BDB0F8C7F74ACD</code> <code>60E59C65B013F2933B888DA35D41195A</code> <code>13A548C27800FDCFEAEA1705DF8FE846</code> <code>734A74338A0CF0AAE517ABD824DFFEF0</code> <code>560C8F985375088B5E5DEB8F90D05863</code> <code>B8ACD0F5B53E625414D28E91AB1014A1</code> <code>EAA54D1465438ABCB19C088175164368</code> <code>9E674FBE3889D260455DC419A28FBB93</code> <code>499DBBC30C9F33CB2F1C35942198D66E</code> <code>89351C136762783773276E1C531F6CA9</code> <code>7AA65CA92E4DD3106D62B277253A8594</code> <code>E838FF3BC858D7922D505ED1FA141A7F</code> <code>5339E33A59EAB18FA971FEE834D927D7</code> <code>45580341C9ADF3467CB14DE6B7E54DE0</code> <code>3402A86CCDD93D5E65A06B09C702F36E</code> <code>565116789F0D4E366F8E21FD992FFB63</code><br> <code>C6BBA32B</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 = BA0D89B52C22111285A55FFA5DBF7ADFB7C0C044A0A2EE2993D9C7A475689AC7B8F67CF
|
|||
<!-- 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 = 54B643662C22111285A55FFA5DBF7ADFB7C0C044A0A2EE2993D9C7A475689AC7B8F67CF30000000000000000FE000100B0B4090020ECC9906C9A78314F45C0272C4E2783CE9CF7708759BE8D56D991E8A5F2173B3B770A264E937EFF8A5D48F66B51A0708E0FC5D1E614935ECB81D83024B02E4BD41D430A2095447F71FF225A02010F97A617E69B03A48C71291D4ADC53C5AF6503A8634545AC2A2834AD2B585093615473E76FD5E880B0E640A34FB94753ACC7DE65BF55CC999984F266F773F8A44814567EF47C929EFCA309A16D1E2B0F4D7A30F7FB2A2119A2ABE51AA8C780BDC89FE34E34D5C9C88161B6F93C52FAA8BBB3D69F410971D7ED6314793D5A78AFA1D71EFF7430A28EE27AB50859888E0C6B311024F1EC2AF4B83124AAC0778B5014316D20764969FCE8E9D95FCCD5
|
||||
padding = C1D4CE31DFAFF631C655A6CC
|
||||
tmp_aes_key = 19581A6606A51B4D64B6965A1576485CA19F65F37C34AF91728670A4BE3EEC40
|
||||
tmp_aes_iv = FF9918EEF27701B049AD105054D9DC0AC33189635D5217C82E11B4AB7ACFE54A</code></pre>
|
||||
<pre><code>data = 54B64366FE7651D628ED4710EE66DEC7F289F2D3A871EC905440E94F36CAAE3C16AE24E10000000000000000FE00010061F9C703D8BDB0F8C7F74ACD60E59C65B013F2933B888DA35D41195A13A548C27800FDCFEAEA1705DF8FE846734A74338A0CF0AAE517ABD824DFFEF0560C8F985375088B5E5DEB8F90D05863B8ACD0F5B53E625414D28E91AB1014A1EAA54D1465438ABCB19C0881751643689E674FBE3889D260455DC419A28FBB93499DBBC30C9F33CB2F1C35942198D66E89351C136762783773276E1C531F6CA97AA65CA92E4DD3106D62B277253A8594E838FF3BC858D7922D505ED1FA141A7F5339E33A59EAB18FA971FEE834D927D745580341C9ADF3467CB14DE6B7E54DE03402A86CCDD93D5E65A06B09C702F36E565116789F0D4E366F8E21FD992FFB63C6BBA32B
|
||||
padding = 320D2D4A2E5B51C92719E3AD
|
||||
tmp_aes_key = D643DDC0A2EF8831729DB7D01C356F174CE09C6C8C26008E1A16BD197F89579A
|
||||
tmp_aes_iv = 5136F208E6F269F4963A2965142188C736DBB06227671DFBAB563A056956FEC1</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 = 209DE500B5117602CA83A0FA23E26A693FEF63E38673E7FB427550CBB9BC585971825707D7F369FA4F63512F29636F4F7A4740566D0E388359BBF9162136180467F1EE537A0ECF6BB05F9C91369651D8A1A5B6D0886AE1157CC8464BF7AB57D818AA865561CF8B0A34BE9B33F5C2A27F1F755E083FE7B416255B40488A6776AFE4ADB3E3BD4CC16116CAD25192C25EB761D60B6B18A9905223B160FB79A806634D1B6E98F717D7EB24B3643C303F924C4B65902C45AB84575B8F58627F51BD3A4AE5DCE9E31E5827AD292CFBEFF827F64120F0C90CF0F00681F60B7E1CCD593B78967601A8C1549CEBFE1C80B540861CE64B2F60419A14023B4204FBECB97EE1A43FB390AB1F5AD608EDF73CFDE71F45732051FFD3B516250179591440E86327D5D3B8AE49D6D8FEF0B430843A35A46AE61EB254A34CA93CE21EDBEFE1E6536925552C46D5D65731F47E75D8139AD3E5</code></pre>
|
||||
<pre><code>encrypted_data = 3404452FC25D9F806B4D8ED3FA3D410A031315318896713D798C32F19F95714728522AA4A0D2E86AC2F107E09E4D238E2BDDB26F99B5E5D18B8B5B7FF0E9C93F8D830430F458EA441EBEF3FD69C7A60F29E21F96D2703D1B94AA469C7BE2278ECF37C01DC715FE6679D929C09EF433AEACB9CE5B74E55085F35EC48AB6FCB3DFA3210DEA29F8079CA9C27791019AAD20B7D10FD7C47F21EBE7123DE1F712C0BAE5F1EBFCA4D7863523B8870FDD1C3EC48344ED223684444C0FF0542487F3F4B35FB7015C384D560A3A5E249586283DCA8C3C7702019ADD46094CEC9C8F3BB233B6437252B27657CD9EBA7D675CADB9CD6E18C2B969E7FB78F6042C87AB6108E76043503CC7A785C521EA86EAE6F790BA87B1103FBB00C6E50090E2F0ECBC5118E91E7A8849E320B3132CB65AA6A4F11067376DA01879D8CEDEB9B10783A212798E2A32435018F527795CB34FC5FA2FB9</code></pre>
|
||||
<!-- end client_DH_inner_data_output -->
|
||||
<p>The length of the final string is 336 bytes.</p>
|
||||
<h6>7.2) set_client_DH_params query</h6>
|
||||
<!-- start set_client_DH_params -->
|
||||
<p>Sent payload (excluding transport headers/trailers):</p>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 D0 DB 06 00 EA 29 7B 66
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 2C 22 11 12 85 A5 5F FA
|
||||
0020 | 5D BF 7A DF B7 C0 C0 44 A0 A2 EE 29 93 D9 C7 A4
|
||||
0030 | 75 68 9A C7 B8 F6 7C F3 FE 50 01 00 20 9D E5 00
|
||||
0040 | B5 11 76 02 CA 83 A0 FA 23 E2 6A 69 3F EF 63 E3
|
||||
0050 | 86 73 E7 FB 42 75 50 CB B9 BC 58 59 71 82 57 07
|
||||
0060 | D7 F3 69 FA 4F 63 51 2F 29 63 6F 4F 7A 47 40 56
|
||||
0070 | 6D 0E 38 83 59 BB F9 16 21 36 18 04 67 F1 EE 53
|
||||
0080 | 7A 0E CF 6B B0 5F 9C 91 36 96 51 D8 A1 A5 B6 D0
|
||||
0090 | 88 6A E1 15 7C C8 46 4B F7 AB 57 D8 18 AA 86 55
|
||||
00A0 | 61 CF 8B 0A 34 BE 9B 33 F5 C2 A2 7F 1F 75 5E 08
|
||||
00B0 | 3F E7 B4 16 25 5B 40 48 8A 67 76 AF E4 AD B3 E3
|
||||
00C0 | BD 4C C1 61 16 CA D2 51 92 C2 5E B7 61 D6 0B 6B
|
||||
00D0 | 18 A9 90 52 23 B1 60 FB 79 A8 06 63 4D 1B 6E 98
|
||||
00E0 | F7 17 D7 EB 24 B3 64 3C 30 3F 92 4C 4B 65 90 2C
|
||||
00F0 | 45 AB 84 57 5B 8F 58 62 7F 51 BD 3A 4A E5 DC E9
|
||||
0100 | E3 1E 58 27 AD 29 2C FB EF F8 27 F6 41 20 F0 C9
|
||||
0110 | 0C F0 F0 06 81 F6 0B 7E 1C CD 59 3B 78 96 76 01
|
||||
0120 | A8 C1 54 9C EB FE 1C 80 B5 40 86 1C E6 4B 2F 60
|
||||
0130 | 41 9A 14 02 3B 42 04 FB EC B9 7E E1 A4 3F B3 90
|
||||
0140 | AB 1F 5A D6 08 ED F7 3C FD E7 1F 45 73 20 51 FF
|
||||
0150 | D3 B5 16 25 01 79 59 14 40 E8 63 27 D5 D3 B8 AE
|
||||
0160 | 49 D6 D8 FE F0 B4 30 84 3A 35 A4 6A E6 1E B2 54
|
||||
0170 | A3 4C A9 3C E2 1E DB EF E1 E6 53 69 25 55 2C 46
|
||||
0180 | D5 D6 57 31 F4 7E 75 D8 13 9A D3 E5</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 B8 3F 07 00 E9 2E 7B 66
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 FE 76 51 D6 28 ED 47 10
|
||||
0020 | EE 66 DE C7 F2 89 F2 D3 A8 71 EC 90 54 40 E9 4F
|
||||
0030 | 36 CA AE 3C 16 AE 24 E1 FE 50 01 00 34 04 45 2F
|
||||
0040 | C2 5D 9F 80 6B 4D 8E D3 FA 3D 41 0A 03 13 15 31
|
||||
0050 | 88 96 71 3D 79 8C 32 F1 9F 95 71 47 28 52 2A A4
|
||||
0060 | A0 D2 E8 6A C2 F1 07 E0 9E 4D 23 8E 2B DD B2 6F
|
||||
0070 | 99 B5 E5 D1 8B 8B 5B 7F F0 E9 C9 3F 8D 83 04 30
|
||||
0080 | F4 58 EA 44 1E BE F3 FD 69 C7 A6 0F 29 E2 1F 96
|
||||
0090 | D2 70 3D 1B 94 AA 46 9C 7B E2 27 8E CF 37 C0 1D
|
||||
00A0 | C7 15 FE 66 79 D9 29 C0 9E F4 33 AE AC B9 CE 5B
|
||||
00B0 | 74 E5 50 85 F3 5E C4 8A B6 FC B3 DF A3 21 0D EA
|
||||
00C0 | 29 F8 07 9C A9 C2 77 91 01 9A AD 20 B7 D1 0F D7
|
||||
00D0 | C4 7F 21 EB E7 12 3D E1 F7 12 C0 BA E5 F1 EB FC
|
||||
00E0 | A4 D7 86 35 23 B8 87 0F DD 1C 3E C4 83 44 ED 22
|
||||
00F0 | 36 84 44 4C 0F F0 54 24 87 F3 F4 B3 5F B7 01 5C
|
||||
0100 | 38 4D 56 0A 3A 5E 24 95 86 28 3D CA 8C 3C 77 02
|
||||
0110 | 01 9A DD 46 09 4C EC 9C 8F 3B B2 33 B6 43 72 52
|
||||
0120 | B2 76 57 CD 9E BA 7D 67 5C AD B9 CD 6E 18 C2 B9
|
||||
0130 | 69 E7 FB 78 F6 04 2C 87 AB 61 08 E7 60 43 50 3C
|
||||
0140 | C7 A7 85 C5 21 EA 86 EA E6 F7 90 BA 87 B1 10 3F
|
||||
0150 | BB 00 C6 E5 00 90 E2 F0 EC BC 51 18 E9 1E 7A 88
|
||||
0160 | 49 E3 20 B3 13 2C B6 5A A6 A4 F1 10 67 37 6D A0
|
||||
0170 | 18 79 D8 CE DE B9 B1 07 83 A2 12 79 8E 2A 32 43
|
||||
0180 | 50 18 F5 27 79 5C B3 4F C5 FA 2F B9</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>D0DB0600EA297B66</code></td>
|
||||
<td><code>B83F0700E92E7B66</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>2C22111285A55FFA5DBF7ADFB7C0C044</code></td>
|
||||
<td><code>FE7651D628ED4710EE66DEC7F289F2D3</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>A0A2EE2993D9C7A475689AC7B8F67CF3</code></td>
|
||||
<td><code>A871EC905440E94F36CAAE3C16AE24E1</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>56, 340</td>
|
||||
<td><code>FE500100209DE500B5117602CA83A0FA</code> <code>23E26A693FEF63E38673E7FB427550CB</code> <code>B9BC585971825707D7F369FA4F63512F</code> <code>29636F4F7A4740566D0E388359BBF916</code> <code>2136180467F1EE537A0ECF6BB05F9C91</code> <code>369651D8A1A5B6D0886AE1157CC8464B</code> <code>F7AB57D818AA865561CF8B0A34BE9B33</code> <code>F5C2A27F1F755E083FE7B416255B4048</code> <code>8A6776AFE4ADB3E3BD4CC16116CAD251</code> <code>92C25EB761D60B6B18A9905223B160FB</code> <code>79A806634D1B6E98F717D7EB24B3643C</code> <code>303F924C4B65902C45AB84575B8F5862</code> <code>7F51BD3A4AE5DCE9E31E5827AD292CFB</code> <code>EFF827F64120F0C90CF0F00681F60B7E</code> <code>1CCD593B78967601A8C1549CEBFE1C80</code> <code>B540861CE64B2F60419A14023B4204FB</code> <code>ECB97EE1A43FB390AB1F5AD608EDF73C</code> <code>FDE71F45732051FFD3B5162501795914</code> <code>40E86327D5D3B8AE49D6D8FEF0B43084</code> <code>3A35A46AE61EB254A34CA93CE21EDBEF</code> <code>E1E6536925552C46D5D65731F47E75D8</code><br> <code>139AD3E5</code></td>
|
||||
<td><code>FE5001003404452FC25D9F806B4D8ED3</code> <code>FA3D410A031315318896713D798C32F1</code> <code>9F95714728522AA4A0D2E86AC2F107E0</code> <code>9E4D238E2BDDB26F99B5E5D18B8B5B7F</code> <code>F0E9C93F8D830430F458EA441EBEF3FD</code> <code>69C7A60F29E21F96D2703D1B94AA469C</code> <code>7BE2278ECF37C01DC715FE6679D929C0</code> <code>9EF433AEACB9CE5B74E55085F35EC48A</code> <code>B6FCB3DFA3210DEA29F8079CA9C27791</code> <code>019AAD20B7D10FD7C47F21EBE7123DE1</code> <code>F712C0BAE5F1EBFCA4D7863523B8870F</code> <code>DD1C3EC48344ED223684444C0FF05424</code> <code>87F3F4B35FB7015C384D560A3A5E2495</code> <code>86283DCA8C3C7702019ADD46094CEC9C</code> <code>8F3BB233B6437252B27657CD9EBA7D67</code> <code>5CADB9CD6E18C2B969E7FB78F6042C87</code> <code>AB6108E76043503CC7A785C521EA86EA</code> <code>E6F790BA87B1103FBB00C6E50090E2F0</code> <code>ECBC5118E91E7A8849E320B3132CB65A</code> <code>A6A4F11067376DA01879D8CEDEB9B107</code> <code>83A212798E2A32435018F527795CB34F</code><br> <code>C5FA2FB9</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 = 2200FD813F2533FCD1AC335388B7B8AEC03C3EE5E774CD1CEFC06254CA14086B8ECC0E1280B9CDB4798F945BC8AE0165D3ECD185E867515EB2ABFFA1470E6B9FE62DE0E944E7A7BE8CAB9F3F365066C47BE9179C2A6099D8E3B1D4FA9206E1196E9EDD667C843A00EC731940FC79AACE38F2337683020BEB736C690EDE09517F522EDFB9E1863D7C1A334A4815D3EC6C27BBE5434969BE76BD0533F78CE2B6EF94C74A96DD8BA02D81992DE47167A25543F45FAB1D470EAB69986A92EB276FBC049325642DA76DF0A3290C887FC44C6C4C456D3943BB1395A294145200DEB13C1FBE1C6BDDD541AEE2433870F936C6CB875BDB69F4C607D47D856FF1778A0906</code></pre>
|
||||
<pre><code>auth_key = AD531187B49B35724A4CDEA28360522C24D572DE3DBA4B701B79E6486E10F3165BEBCB5BA36369FFD390E79C7AE018936CDCD44486F195DEF8A920CC24C6B8B94D615066E86A5F565A1554C292ABC403BB0184BBC66649FC1BA2F2394621C036B8ECA39496595CCEDBAF61FFC0E324167720FD0F597E28C43026089EC2B8BCDC50D20873AC30FD60F6A9AD59D8600E4BE4C1EA6F8B23625F45F16B780DFDD7C717A87E8732D1C2EF1A2698BC3FBEE569E09EB36B0E3797CCE231E084CCE3C4B815AF1BC463D84200104A514E4E29C809B59954A94AD3A54DECF7F2CB09B2D7AE01C7AB73DE9FEB8784CED6A81E744F7F7A77064411AF4574F1B717AF60CD4552</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 48 7A 86 EA 29 7B 66
|
||||
0010 | 58 00 00 00 34 F7 CB 3B 2C 22 11 12 85 A5 5F FA
|
||||
0020 | 5D BF 7A DF B7 C0 C0 44 A0 A2 EE 29 93 D9 C7 A4
|
||||
0030 | 75 68 9A C7 B8 F6 7C F3 FF 2E 0D 83 FE 87 25 8C
|
||||
0040 | 80 16 DA 9E A9 19 E1 1C</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 BC B7 71 EA 2E 7B 66
|
||||
0010 | 90 00 00 00 34 F7 CB 3B FE 76 51 D6 28 ED 47 10
|
||||
0020 | EE 66 DE C7 F2 89 F2 D3 A8 71 EC 90 54 40 E9 4F
|
||||
0030 | 36 CA AE 3C 16 AE 24 E1 BA FA BD FA 3C 62 E4 2A
|
||||
0040 | 9E 9D 11 78 6F B9 72 9F</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>01487A86EA297B66</code></td>
|
||||
<td><code>01BCB771EA2E7B66</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>58000000</code> (88 in decimal)</td>
|
||||
<td><code>90000000</code> (144 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>2C22111285A55FFA5DBF7ADFB7C0C044</code></td>
|
||||
<td><code>FE7651D628ED4710EE66DEC7F289F2D3</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>A0A2EE2993D9C7A475689AC7B8F67CF3</code></td>
|
||||
<td><code>A871EC905440E94F36CAAE3C16AE24E1</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce_hash1</td>
|
||||
<td>56, 16</td>
|
||||
<td><code>FF2E0D83FE87258C8016DA9EA919E11C</code></td>
|
||||
<td><code>BAFABDFA3C62E42A9E9D11786FB9729F</code></td>
|
||||
<td>The 128 lower-order bits of SHA1 of the byte string derived from the <code>new_nonce</code> string by adding a single byte with the value of 1, 2, or 3, and followed by another 8 bytes with <code>auth_key_aux_hash</code>. Different values are required to prevent an intruder from changing server response dh_gen_ok into dh_gen_retry.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
Loading…
Reference in a new issue