mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2025-02-18 04:03:28 +01:00
Update content of files
This commit is contained in:
parent
179fafd8e3
commit
be525b133e
8 changed files with 275 additions and 250 deletions
|
@ -140,12 +140,41 @@ Another way for admins to check who received the gifts is to simply use <a href=
|
|||
|
||||
<a href='/constructor/starsGiveawayWinnersOption'>starsGiveawayWinnersOption</a>#54236209 flags:<a href='/type/%23'>#</a> default:flags.0?<a href='/constructor/true'>true</a> users:<a href='/type/int'>int</a> per_user_stars:<a href='/type/long'>long</a> = <a href='/type/StarsGiveawayWinnersOption'>StarsGiveawayWinnersOption</a>;
|
||||
|
||||
<a href='/constructor/inputInvoiceStars'>inputInvoiceStars</a>#65f00ce3 purpose:<a href='/type/InputStorePaymentPurpose'>InputStorePaymentPurpose</a> = <a href='/type/InputInvoice'>InputInvoice</a>;
|
||||
|
||||
<a href='/constructor/inputStorePaymentStarsGiveaway'>inputStorePaymentStarsGiveaway</a>#751f08fa flags:<a href='/type/%23'>#</a> only_new_subscribers:flags.0?<a href='/constructor/true'>true</a> winners_are_visible:flags.3?<a href='/constructor/true'>true</a> stars:<a href='/type/long'>long</a> boost_peer:<a href='/type/InputPeer'>InputPeer</a> additional_peers:flags.1?<a href='/type/Vector%20t'>Vector</a><<a href='/type/InputPeer'>InputPeer</a>> countries_iso2:flags.2?<a href='/type/Vector%20t'>Vector</a><<a href='/type/string'>string</a>> prize_description:flags.4?<a href='/type/string'>string</a> random_id:<a href='/type/long'>long</a> until_date:<a href='/type/int'>int</a> currency:<a href='/type/string'>string</a> amount:<a href='/type/long'>long</a> users:<a href='/type/int'>int</a> = <a href='/type/InputStorePaymentPurpose'>InputStorePaymentPurpose</a>;
|
||||
|
||||
---functions---
|
||||
|
||||
<a href='/method/payments.getStarsGiveawayOptions'>payments.getStarsGiveawayOptions</a>#bd1efd3e = <a href='/type/Vector%20t'>Vector</a><<a href='/type/StarsGiveawayOption'>StarsGiveawayOption</a>>;</code></pre>
|
||||
<a href='/method/payments.getStarsGiveawayOptions'>payments.getStarsGiveawayOptions</a>#bd1efd3e = <a href='/type/Vector%20t'>Vector</a><<a href='/type/StarsGiveawayOption'>StarsGiveawayOption</a>>;
|
||||
|
||||
<a href='/method/payments.getPaymentForm'>payments.getPaymentForm</a>#37148dbb flags:<a href='/type/%23'>#</a> invoice:<a href='/type/InputInvoice'>InputInvoice</a> theme_params:flags.0?<a href='/type/DataJSON'>DataJSON</a> = <a href='/type/payments.PaymentForm'>payments.PaymentForm</a>;</code></pre>
|
||||
<p>Star giveaways are similar to <a href="#giveaways-and-giftcodes">normal giveaways</a>, with the only difference that instead of giving away gifts or <a href="/api/premium">Telegram Premium subscriptions</a>, the giveaway will automatically distribute <a href="/api/stars">Telegram Stars</a> among the winners.</p>
|
||||
<p>First of all, invoke <a href="/method/payments.getStarsGiveawayOptions">payments.getStarsGiveawayOptions</a> to obtain a list of <a href="/constructor/starsGiveawayOption">starsGiveawayOption</a> constructors, containing a list of giveaway options that may be chosen by the admin, indicating the number of <a href="/api/stars">Telegram Stars</a> 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/starsGiveawayOption">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></div>
|
||||
<p>First of all, invoke <a href="/method/payments.getStarsGiveawayOptions">payments.getStarsGiveawayOptions</a> to obtain a list of <a href="/constructor/starsGiveawayOption">starsGiveawayOption</a> constructors, containing a list of giveaway options that may be chosen by the admin, indicating the number of winners of the giveaway, the number of <a href="/api/stars">Telegram Stars</a> 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/starsGiveawayOption">constructor page »</a> for more info on these and all the remaining fields). </p>
|
||||
<p>Once the admin has chosen a specific giveaway option, invoke <a href="/method/payments.getPaymentForm">payments.getPaymentForm</a>, passing an <a href="/constructor/inputInvoiceStars">inputInvoiceStars</a>, containing an <a href="/constructor/inputStorePaymentStarsGiveaway">inputStorePaymentStarsGiveaway</a> constructor, with:</p>
|
||||
<ul>
|
||||
<li>The <code>stars</code>, <code>currency</code> and <code>amount</code> from the chosen <a href="/constructor/starsGiveawayOption">starsGiveawayOption</a> and some extra options, as specified in the <a href="/constructor/inputStorePaymentStarsGiveaway">constructor page »</a>.</li>
|
||||
<li>Additional channels/supergroups that the user must join to participate to the giveaway can be specified in <code>additional_peers</code>. </li>
|
||||
<li>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>. </li>
|
||||
<li>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>. </li>
|
||||
<li>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>
|
||||
</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>
|
||||
<p>More alternative payment flows are also available:</p>
|
||||
<ul>
|
||||
<li>The Premium Bot flow, by contacting <a href="/api/config#premium-bot-username">premium_bot_username</a>, and following the inline keyboard payment flow for star giveaways (the final keyboard with the prices will contain buttons with <a href="/api/links#invoice-links">invoice deep links »</a> that should be used to make the payment).</li>
|
||||
<li>The store-based subscription flow based on <a href="/method/payments.assignAppStoreTransaction">payments.assignAppStoreTransaction</a>/<a href="/method/payments.assignPlayMarketTransaction">payments.assignPlayMarketTransaction</a>, currently not available to third-party apps. </li>
|
||||
</ul>
|
||||
<p>Then:</p>
|
||||
<ul>
|
||||
<li>
|
||||
<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> flow was 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/prepaidStarsGiveaway">prepaidStarsGiveaway</a> constructor in <a href="/constructor/premium.boostsStatus">premium.boostsStatus</a>.<code>prepaid_giveaways</code>, containing info about the prepaid star giveaway. </p>
|
||||
</li>
|
||||
</ul>
|
||||
<p>To actually launch the giveaway for the bot flow, invoke <a href="/method/payments.launchPrepaidGiveaway">payments.launchPrepaidGiveaway</a>, passing <a href="/constructor/prepaidStarsGiveaway">prepaidStarsGiveaway</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 in the <a href="/constructor/inputStorePaymentStarsGiveaway">inputStorePaymentStarsGiveaway</a> created above).</p></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
<meta charset="utf-8">
|
||||
<title>inputInvoiceStars</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta property="description" content="Used to top up the Telegram Stars balance of the current account or someone else's account.">
|
||||
<meta property="description" content="Used to top up the Telegram Stars balance of the current account or someone else's account, or to start a Telegram Star giveaway ».">
|
||||
<meta property="og:title" content="inputInvoiceStars">
|
||||
<meta property="og:image" content="">
|
||||
<meta property="og:description" content="Used to top up the Telegram Stars balance of the current account or someone else's account.">
|
||||
<meta property="og:description" content="Used to top up the Telegram Stars balance of the current account or someone else's account, or to start a Telegram Star giveaway ».">
|
||||
<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">
|
||||
|
@ -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/inputInvoiceStars" >inputInvoiceStars</a></li></ul></div>
|
||||
<h1 id="dev_page_title">inputInvoiceStars</h1>
|
||||
|
||||
<div id="dev_page_content"><p>Used to top up the <a href="/api/stars">Telegram Stars</a> balance of the current account or someone else's account.</p>
|
||||
<div id="dev_page_content"><p>Used to top up the <a href="/api/stars">Telegram Stars</a> balance of the current account or someone else's account, or to start a <a href="/api/giveaways#star-giveaways">Telegram Star giveaway »</a>.</p>
|
||||
<p><div class="clearfix">
|
||||
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
|
||||
<li class="dropdown">
|
||||
|
@ -69,19 +69,23 @@
|
|||
<tr>
|
||||
<td><strong>purpose</strong></td>
|
||||
<td style="text-align: center;"><a href="/type/InputStorePaymentPurpose">InputStorePaymentPurpose</a></td>
|
||||
<td>Either an <a href="/constructor/inputStorePaymentStarsTopup">inputStorePaymentStarsTopup</a> or an <a href="/constructor/inputStorePaymentStarsGift">inputStorePaymentStarsGift</a>.</td>
|
||||
<td>An <a href="/constructor/inputStorePaymentStarsGiveaway">inputStorePaymentStarsGiveaway</a>, <a href="/constructor/inputStorePaymentStarsTopup">inputStorePaymentStarsTopup</a> or <a href="/constructor/inputStorePaymentStarsGift">inputStorePaymentStarsGift</a>.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#type" id="type" name="type"><i class="anchor-icon"></i></a>Type</h3>
|
||||
<p><a href="/type/InputInvoice">InputInvoice</a></p>
|
||||
<h3><a class="anchor" href="#related-pages" id="related-pages" name="related-pages"><i class="anchor-icon"></i></a>Related pages</h3>
|
||||
<h4><a class="anchor" href="#inputstorepaymentstarsgiveaway" id="inputstorepaymentstarsgiveaway" name="inputstorepaymentstarsgiveaway"><i class="anchor-icon"></i></a><a href="/constructor/inputStorePaymentStarsGiveaway">inputStorePaymentStarsGiveaway</a></h4>
|
||||
<p>Used to pay for a <a href="/api/giveaways#star-giveaways">star giveaway, see here »</a> for more info.</p>
|
||||
<h4><a class="anchor" href="#inputstorepaymentstarstopup" id="inputstorepaymentstarstopup" name="inputstorepaymentstarstopup"><i class="anchor-icon"></i></a><a href="/constructor/inputStorePaymentStarsTopup">inputStorePaymentStarsTopup</a></h4>
|
||||
<p>Used to top up the <a href="/api/stars">Telegram Stars balance</a> of the current account.</p>
|
||||
<h4><a class="anchor" href="#inputstorepaymentstarsgift" id="inputstorepaymentstarsgift" name="inputstorepaymentstarsgift"><i class="anchor-icon"></i></a><a href="/constructor/inputStorePaymentStarsGift">inputStorePaymentStarsGift</a></h4>
|
||||
<p>Used to gift <a href="/api/stars">Telegram Stars</a> to a friend.</p>
|
||||
<h4><a class="anchor" href="#telegram-stars" id="telegram-stars" name="telegram-stars"><i class="anchor-icon"></i></a><a href="/api/stars">Telegram Stars</a></h4>
|
||||
<p>Telegram Stars are virtual items that allow users to purchase digital goods and services from bots and mini apps inside the Telegram ecosystem, send gifts to content creators on the Telegram platform, and more.</p></div>
|
||||
<p>Telegram Stars are virtual items that allow users to purchase digital goods and services from bots and mini apps inside the Telegram ecosystem, send gifts to content creators on the Telegram platform, and more.</p>
|
||||
<h4><a class="anchor" href="#giveaways" id="giveaways" name="giveaways"><i class="anchor-icon"></i></a><a href="/api/giveaways">Giveaways</a></h4>
|
||||
<p>Telegram channel and supergroup administrators may launch giveaways to randomly distribute Telegram Premium subscriptions and other gifts among their followers, in exchange for boosts.</p></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -4,30 +4,10 @@
|
|||
<meta charset="utf-8">
|
||||
<title>inputStorePaymentStarsGiveaway</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta property="description" content="Parameters
|
||||
Name
|
||||
Type
|
||||
Description
|
||||
flags
|
||||
#
|
||||
Flags, see TL conditional fields
|
||||
only_new_subscribers
|
||||
flags.0?true
|
||||
|
||||
winners_are_visible…">
|
||||
<meta property="description" content="Used to pay for a star giveaway, see here » for more info.">
|
||||
<meta property="og:title" content="inputStorePaymentStarsGiveaway">
|
||||
<meta property="og:image" content="">
|
||||
<meta property="og:description" content="Parameters
|
||||
Name
|
||||
Type
|
||||
Description
|
||||
flags
|
||||
#
|
||||
Flags, see TL conditional fields
|
||||
only_new_subscribers
|
||||
flags.0?true
|
||||
|
||||
winners_are_visible…">
|
||||
<meta property="og:description" content="Used to pay for a star giveaway, see here » for more info.">
|
||||
<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">
|
||||
|
@ -62,7 +42,8 @@ winners_are_visible…">
|
|||
<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/inputStorePaymentStarsGiveaway" >inputStorePaymentStarsGiveaway</a></li></ul></div>
|
||||
<h1 id="dev_page_title">inputStorePaymentStarsGiveaway</h1>
|
||||
|
||||
<div id="dev_page_content"><p><div class="clearfix">
|
||||
<div id="dev_page_content"><p>Used to pay for a <a href="/api/giveaways#star-giveaways">star giveaway, see here »</a> for more info.</p>
|
||||
<p><div class="clearfix">
|
||||
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle" onclick="return dropdownClick(this, event)" href="#">Layer 192 <b class="caret"></b></a>
|
||||
|
@ -93,67 +74,77 @@ winners_are_visible…">
|
|||
<tr>
|
||||
<td><strong>only_new_subscribers</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> </td>
|
||||
<td>If set, only new subscribers starting from the giveaway creation date will be able to participate to the giveaway.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>winners_are_visible</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.3?<a href="/constructor/true">true</a></td>
|
||||
<td> </td>
|
||||
<td>If set, 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.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>stars</strong></td>
|
||||
<td style="text-align: center;"><a href="/type/long">long</a></td>
|
||||
<td> </td>
|
||||
<td>Total number of Telegram Stars being given away (each user will receive <code>stars/users</code> stars).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>boost_peer</strong></td>
|
||||
<td style="text-align: center;"><a href="/type/InputPeer">InputPeer</a></td>
|
||||
<td> </td>
|
||||
<td>The channel/supergroup starting the giveaway, that the user must join to participate, that will receive the giveaway <a href="/api/boost">boosts</a>; see <a href="/api/giveaways">here »</a> for more info on giveaways.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>additional_peers</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.1?<a href="/type/Vector%20t">Vector</a><<a href="/type/InputPeer">InputPeer</a>></td>
|
||||
<td> </td>
|
||||
<td>Additional channels that the user must join to participate to the giveaway can be specified here.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>countries_iso2</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.2?<a href="/type/Vector%20t">Vector</a><<a href="/type/string">string</a>></td>
|
||||
<td> </td>
|
||||
<td>The set of users that can participate to the giveaway can be restricted by passing here 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.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>prize_description</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.4?<a href="/type/string">string</a></td>
|
||||
<td> </td>
|
||||
<td>Can contain a textual description of additional giveaway prizes.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>random_id</strong></td>
|
||||
<td style="text-align: center;"><a href="/type/long">long</a></td>
|
||||
<td> </td>
|
||||
<td>Random ID to avoid resending the giveaway</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>until_date</strong></td>
|
||||
<td style="text-align: center;"><a href="/type/int">int</a></td>
|
||||
<td> </td>
|
||||
<td>The end date of the giveaway, must be at most <a href="/api/config#giveaway-period-max">giveaway_period_max</a> seconds in the future; see <a href="/api/giveaways">here »</a> for more info on giveaways.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>currency</strong></td>
|
||||
<td style="text-align: center;"><a href="/type/string">string</a></td>
|
||||
<td> </td>
|
||||
<td>Three-letter ISO 4217 <a href="/bots/payments#supported-currencies">currency</a> code</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>amount</strong></td>
|
||||
<td style="text-align: center;"><a href="/type/long">long</a></td>
|
||||
<td> </td>
|
||||
<td>Total price in the smallest units of the currency (integer, not float/double). For example, for a price of <code>US$ 1.45</code> pass <code>amount = 145</code>. See the exp parameter in <a href="/bots/payments/currencies.json">currencies.json</a>, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>users</strong></td>
|
||||
<td style="text-align: center;"><a href="/type/int">int</a></td>
|
||||
<td> </td>
|
||||
<td>Number of winners.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3><a class="anchor" href="#type" id="type" name="type"><i class="anchor-icon"></i></a>Type</h3>
|
||||
<p><a href="/type/InputStorePaymentPurpose">InputStorePaymentPurpose</a></p></div>
|
||||
<p><a href="/type/InputStorePaymentPurpose">InputStorePaymentPurpose</a></p>
|
||||
<h3><a class="anchor" href="#related-pages" id="related-pages" name="related-pages"><i class="anchor-icon"></i></a>Related pages</h3>
|
||||
<h4><a class="anchor" href="#messagemediagiveawayresults" id="messagemediagiveawayresults" name="messagemediagiveawayresults"><i class="anchor-icon"></i></a><a href="/constructor/messageMediaGiveawayResults">messageMediaGiveawayResults</a></h4>
|
||||
<p>A <a href="/api/giveaways">giveaway</a> with public winners has finished, this constructor contains info about the winners.</p>
|
||||
<h4><a class="anchor" href="#channel-and-supergroup-boosts" id="channel-and-supergroup-boosts" name="channel-and-supergroup-boosts"><i class="anchor-icon"></i></a><a href="/api/boost">Channel and supergroup boosts</a></h4>
|
||||
<p>Telegram Premium users can grant their favorite channels and supergroups additional features like the ability to post stories by giving them boosts.</p>
|
||||
<h4><a class="anchor" href="#giveaways" id="giveaways" name="giveaways"><i class="anchor-icon"></i></a><a href="/api/giveaways">Giveaways</a></h4>
|
||||
<p>Telegram channel and supergroup administrators may launch giveaways to randomly distribute Telegram Premium subscriptions and other gifts among their followers, in exchange for boosts.</p>
|
||||
<h4><a class="anchor" href="#client-configuration" id="client-configuration" name="client-configuration"><i class="anchor-icon"></i></a><a href="/api/config">Client configuration</a></h4>
|
||||
<p>The MTProto API has multiple configuration parameters that can be fetched with the appropriate methods.</p>
|
||||
<h4><a class="anchor" href="#bot-payments-api" id="bot-payments-api" name="bot-payments-api"><i class="anchor-icon"></i></a><a href="/bots/payments">Bot Payments API</a></h4></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -117,6 +117,7 @@
|
|||
<p><a href="/type/StarsGiveawayOption">StarsGiveawayOption</a></p>
|
||||
<h3><a class="anchor" href="#related-pages" id="related-pages" name="related-pages"><i class="anchor-icon"></i></a>Related pages</h3>
|
||||
<h4><a class="anchor" href="#inputstorepaymentstarsgiveaway" id="inputstorepaymentstarsgiveaway" name="inputstorepaymentstarsgiveaway"><i class="anchor-icon"></i></a><a href="/constructor/inputStorePaymentStarsGiveaway">inputStorePaymentStarsGiveaway</a></h4>
|
||||
<p>Used to pay for a <a href="/api/giveaways#star-giveaways">star giveaway, see here »</a> for more info.</p>
|
||||
<h4><a class="anchor" href="#bot-payments-api" id="bot-payments-api" name="bot-payments-api"><i class="anchor-icon"></i></a><a href="/bots/payments">Bot Payments API</a></h4>
|
||||
<h4><a class="anchor" href="#giveaways" id="giveaways" name="giveaways"><i class="anchor-icon"></i></a><a href="/api/giveaways">Giveaways</a></h4>
|
||||
<p>Telegram channel and supergroup administrators may launch giveaways to randomly distribute Telegram Premium subscriptions and other gifts among their followers, in exchange for boosts.</p></div>
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
<h4><a class="anchor" href="#telegram-stars" id="telegram-stars" name="telegram-stars"><i class="anchor-icon"></i></a><a href="/api/stars">Telegram Stars</a></h4>
|
||||
<p>Telegram Stars are virtual items that allow users to purchase digital goods and services from bots and mini apps inside the Telegram ecosystem, send gifts to content creators on the Telegram platform, and more.</p>
|
||||
<h4><a class="anchor" href="#inputinvoicestars" id="inputinvoicestars" name="inputinvoicestars"><i class="anchor-icon"></i></a><a href="/constructor/inputInvoiceStars">inputInvoiceStars</a></h4>
|
||||
<p>Used to top up the <a href="/api/stars">Telegram Stars</a> balance of the current account or someone else's account.</p></div>
|
||||
<p>Used to top up the <a href="/api/stars">Telegram Stars</a> balance of the current account or someone else's account, or to start a <a href="/api/giveaways#star-giveaways">Telegram Star giveaway »</a>.</p></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -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 F4 FE 0C 00 03 D7 38 67
|
||||
0010 | 14 00 00 00 F1 8E 7E BE 9A 5B A4 1B 3D 34 52 05
|
||||
0020 | 97 27 4D F2 D3 77 B5 20</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 44 B1 07 00 21 E5 38 67
|
||||
0010 | 14 00 00 00 F1 8E 7E BE D7 FB 5B D8 4F C9 31 BB
|
||||
0020 | D2 BA C2 65 E1 E8 CF 08</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>F4FE0C0003D73867</code></td>
|
||||
<td><code>44B1070021E53867</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>9A5BA41B3D34520597274DF2D377B520</code></td>
|
||||
<td><code>D7FB5BD84FC931BBD2BAC265E1E8CF08</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 4C 00 CA 03 D7 38 67
|
||||
0010 | 50 00 00 00 63 24 16 05 9A 5B A4 1B 3D 34 52 05
|
||||
0020 | 97 27 4D F2 D3 77 B5 20 2D 4F 3B FC C9 F3 A6 C2
|
||||
0030 | D6 A5 FD 96 13 D8 97 9B 08 22 7D B0 86 B4 19 39
|
||||
0040 | E9 00 00 00 15 C4 B5 1C 03 00 00 00 85 FD 64 DE
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 F4 F6 D9 21 E5 38 67
|
||||
0010 | 50 00 00 00 63 24 16 05 D7 FB 5B D8 4F C9 31 BB
|
||||
0020 | D2 BA C2 65 E1 E8 CF 08 7A F2 D2 12 20 08 39 DE
|
||||
0030 | 08 BD D4 C6 20 22 18 1A 08 1C D0 1C 65 F0 0A B1
|
||||
0040 | D9 00 00 00 15 C4 B5 1C 03 00 00 00 85 FD 64 DE
|
||||
0050 | 85 1D 9D D0 A5 B7 F7 09 35 5F C3 0B 21 6B E8 6C
|
||||
0060 | 02 2B B4 C3</code></pre>
|
||||
<p>Payload (de)serialization:</p>
|
||||
|
@ -132,7 +132,7 @@
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>014C00CA03D73867</code></td>
|
||||
<td><code>01F4F6D921E53867</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>
|
||||
|
@ -150,19 +150,19 @@
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>9A5BA41B3D34520597274DF2D377B520</code></td>
|
||||
<td><code>D7FB5BD84FC931BBD2BAC265E1E8CF08</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>2D4F3BFCC9F3A6C2D6A5FD9613D8979B</code></td>
|
||||
<td><code>7AF2D212200839DE08BDD4C62022181A</code></td>
|
||||
<td>Server-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pq</td>
|
||||
<td>56, 12</td>
|
||||
<td><code>08227DB086B41939E9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2485336661972040169</td>
|
||||
<td><code>081CD01C65F00AB1D9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2076190652362306009</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 = 2485336661972040169</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2485336661972040169 = 1305374701 * 1903925869</code></p>
|
||||
<pre><code>p = 1305374701
|
||||
q = 1903925869</code></pre>
|
||||
<pre><code>pq = 2076190652362306009</code></pre>
|
||||
<p>Decompose into 2 prime cofactors <code>p < q</code>: <code>2076190652362306009 = 1425026333 * 1456948973</code></p>
|
||||
<pre><code>p = 1425026333
|
||||
q = 1456948973</code></pre>
|
||||
<!-- end pq -->
|
||||
<h4><a class="anchor" href="#presenting-proof-of-work-server-authentication" id="presenting-proof-of-work-server-authentication" name="presenting-proof-of-work-server-authentication"><i class="anchor-icon"></i></a>Presenting proof of work; Server authentication</h4>
|
||||
<h5><a class="anchor" href="#4-encrypted-data-payload-generation" id="4-encrypted-data-payload-generation" name="4-encrypted-data-payload-generation"><i class="anchor-icon"></i></a>4) <code>encrypted_data</code> payload generation</h5>
|
||||
<p>First of all, generate an <code>encrypted_data</code> payload as follows:</p>
|
||||
<!-- start p_q_inner_data_dc -->
|
||||
<p>Generated payload (excluding transport headers/trailers):</p>
|
||||
<pre><code>0000 | 95 5F F5 A9 08 22 7D B0 86 B4 19 39 E9 00 00 00
|
||||
0010 | 04 4D CE 6F ED 00 00 00 04 71 7B 9A 6D 00 00 00
|
||||
0020 | 9A 5B A4 1B 3D 34 52 05 97 27 4D F2 D3 77 B5 20
|
||||
0030 | 2D 4F 3B FC C9 F3 A6 C2 D6 A5 FD 96 13 D8 97 9B
|
||||
0040 | F1 9B 19 37 87 16 9A 9F A5 76 B0 40 94 EB 94 5D
|
||||
0050 | DE 45 05 D5 A8 F2 1B F2 B2 43 CD B9 F4 51 EF 90
|
||||
<pre><code>0000 | 95 5F F5 A9 08 1C D0 1C 65 F0 0A B1 D9 00 00 00
|
||||
0010 | 04 54 F0 2D 1D 00 00 00 04 56 D7 46 ED 00 00 00
|
||||
0020 | D7 FB 5B D8 4F C9 31 BB D2 BA C2 65 E1 E8 CF 08
|
||||
0030 | 7A F2 D2 12 20 08 39 DE 08 BD D4 C6 20 22 18 1A
|
||||
0040 | 2E 80 D5 7A CA 81 CE C4 3B CA 39 F2 05 55 A3 CD
|
||||
0050 | 9E C7 08 E2 B7 85 D7 2D 48 1F ED CD 68 29 69 0C
|
||||
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 = 1903925869</code></pre>
|
|||
<tr>
|
||||
<td>pq</td>
|
||||
<td>4, 12</td>
|
||||
<td><code>08227DB086B41939E9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2485336661972040169</td>
|
||||
<td><code>081CD01C65F00AB1D9000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 2076190652362306009</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>044DCE6FED000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1305374701</td>
|
||||
<td><code>0454F02D1D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1425026333</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>04717B9A6D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1903925869</td>
|
||||
<td><code>0456D746ED000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1456948973</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>9A5BA41B3D34520597274DF2D377B520</code></td>
|
||||
<td><code>D7FB5BD84FC931BBD2BAC265E1E8CF08</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>48, 16</td>
|
||||
<td><code>2D4F3BFCC9F3A6C2D6A5FD9613D8979B</code></td>
|
||||
<td><code>7AF2D212200839DE08BDD4C62022181A</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce</td>
|
||||
<td>64, 32</td>
|
||||
<td><code>F19B193787169A9FA576B04094EB945D</code> <code>DE4505D5A8F21BF2B243CDB9F451EF90</code></td>
|
||||
<td><code>2E80D57ACA81CEC43BCA39F20555A3CD</code> <code>9EC708E2B785D72D481FEDCD6829690C</code></td>
|
||||
<td>Client-generated random number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -291,39 +291,39 @@ q = 1903925869</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 = 955FF5A908227DB086B41939E9000000044DCE6FED00000004717B9A6D0000009A5BA41B3D34520597274DF2D377B5202D4F3BFCC9F3A6C2D6A5FD9613D8979BF19B193787169A9FA576B04094EB945DDE4505D5A8F21BF2B243CDB9F451EF9002000000
|
||||
random_padding_bytes = 737F0EDCF6715AE78A3F73A045C58BAD897322FC4E01CEDBD4BEB2B67CA12D68F6C5BB00333C2C65AB54C0BB1F1C10D80899B8DF32BF1D82E912748F4B55C55DAA4949F4D00C9C6989CD45642BA79039DBE15CF7846A62AE6EE3F3EE</code></pre>
|
||||
<pre><code>data = 955FF5A9081CD01C65F00AB1D90000000454F02D1D0000000456D746ED000000D7FB5BD84FC931BBD2BAC265E1E8CF087AF2D212200839DE08BDD4C62022181A2E80D57ACA81CEC43BCA39F20555A3CD9EC708E2B785D72D481FEDCD6829690C02000000
|
||||
random_padding_bytes = 2559F994649A49F8FFB5EDF47E88C20DF5E907B2C4A16B35C6106A5A46614B442623ADAFCEEFBF6F35266C49179ECA2ABE68B7898758782A463278B408941B335A6FE0DAC4EA01C41510B826B7E16F14496EF4918D4E87A3B2FC634B</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 = 331AE866F377D9C51531B8BAEE08A181B7332769B1B24C120F79D70DE9E5A6EC13AD2777FC02BDE2267248187CE3EBCE0B7B67D8C1C6458269B4B759B4AB6E91BB60EE0539256A73A307D3AF98C2F52B048620B59B033E3ECCC7ED0BF453D25AFBDC7B1B35313181E6D8864942F254B7B5B7601FE008BE339A2CD16496114F088EE3F87D6F0ACE729B920898C252210CDFBB5127E17493AAFB7466B832A068992FF1266E30A1402555E29EAA945BE35D7DAA56EFAC0D85547723E831DD435CD52B7C1C47F23F8325ECAF1995F46044577A08632B5FE4F8115F4C4F790096207FA69316F83318B2720DCA7785D3BA657F096DF42CB8B00B844EA714D815426B25</code></pre>
|
||||
<pre><code>encrypted_data = C4B6CC8E8F772EF6ACB5036855FE4D78B9AB76B70AC8D5B001245C1F989A240C434BD312A2358801FF0D16C42496B568CC3D8F56C5F97BAABCCF848271D2C7207135C0F8D7D39E7B3649CEAE882E973F0EAA3FF31B851A9F2C4BE141F175B16D6B9E6138DF57426FA47D6BFB38CACC16F529C5E0F9E4FB819314142B65B2D6F58744929429C2FA3EBA79B4D5FCB4815BF281979CE22AA36BD6D283003F504E81AB25239BF370FA9C67073606FF476FA106E208778E257B6F8BD2F53AC0C7B17E2562753E0D5CB907AB745738B9B0AF424D947D19B4A54CF40334492BE599FDD33DDF27AAB1B4613E0A4EA28C2321ABDCBA18CFD43922157A4EB3716B22F3A79A</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 F8 FE 0C 00 03 D7 38 67
|
||||
0010 | 40 01 00 00 BE E4 12 D7 9A 5B A4 1B 3D 34 52 05
|
||||
0020 | 97 27 4D F2 D3 77 B5 20 2D 4F 3B FC C9 F3 A6 C2
|
||||
0030 | D6 A5 FD 96 13 D8 97 9B 04 4D CE 6F ED 00 00 00
|
||||
0040 | 04 71 7B 9A 6D 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 33 1A E8 66 F3 77 D9 C5 15 31 B8 BA
|
||||
0060 | EE 08 A1 81 B7 33 27 69 B1 B2 4C 12 0F 79 D7 0D
|
||||
0070 | E9 E5 A6 EC 13 AD 27 77 FC 02 BD E2 26 72 48 18
|
||||
0080 | 7C E3 EB CE 0B 7B 67 D8 C1 C6 45 82 69 B4 B7 59
|
||||
0090 | B4 AB 6E 91 BB 60 EE 05 39 25 6A 73 A3 07 D3 AF
|
||||
00A0 | 98 C2 F5 2B 04 86 20 B5 9B 03 3E 3E CC C7 ED 0B
|
||||
00B0 | F4 53 D2 5A FB DC 7B 1B 35 31 31 81 E6 D8 86 49
|
||||
00C0 | 42 F2 54 B7 B5 B7 60 1F E0 08 BE 33 9A 2C D1 64
|
||||
00D0 | 96 11 4F 08 8E E3 F8 7D 6F 0A CE 72 9B 92 08 98
|
||||
00E0 | C2 52 21 0C DF BB 51 27 E1 74 93 AA FB 74 66 B8
|
||||
00F0 | 32 A0 68 99 2F F1 26 6E 30 A1 40 25 55 E2 9E AA
|
||||
0100 | 94 5B E3 5D 7D AA 56 EF AC 0D 85 54 77 23 E8 31
|
||||
0110 | DD 43 5C D5 2B 7C 1C 47 F2 3F 83 25 EC AF 19 95
|
||||
0120 | F4 60 44 57 7A 08 63 2B 5F E4 F8 11 5F 4C 4F 79
|
||||
0130 | 00 96 20 7F A6 93 16 F8 33 18 B2 72 0D CA 77 85
|
||||
0140 | D3 BA 65 7F 09 6D F4 2C B8 B0 0B 84 4E A7 14 D8
|
||||
0150 | 15 42 6B 25</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 00 71 08 00 21 E5 38 67
|
||||
0010 | 40 01 00 00 BE E4 12 D7 D7 FB 5B D8 4F C9 31 BB
|
||||
0020 | D2 BA C2 65 E1 E8 CF 08 7A F2 D2 12 20 08 39 DE
|
||||
0030 | 08 BD D4 C6 20 22 18 1A 04 54 F0 2D 1D 00 00 00
|
||||
0040 | 04 56 D7 46 ED 00 00 00 85 FD 64 DE 85 1D 9D D0
|
||||
0050 | FE 00 01 00 C4 B6 CC 8E 8F 77 2E F6 AC B5 03 68
|
||||
0060 | 55 FE 4D 78 B9 AB 76 B7 0A C8 D5 B0 01 24 5C 1F
|
||||
0070 | 98 9A 24 0C 43 4B D3 12 A2 35 88 01 FF 0D 16 C4
|
||||
0080 | 24 96 B5 68 CC 3D 8F 56 C5 F9 7B AA BC CF 84 82
|
||||
0090 | 71 D2 C7 20 71 35 C0 F8 D7 D3 9E 7B 36 49 CE AE
|
||||
00A0 | 88 2E 97 3F 0E AA 3F F3 1B 85 1A 9F 2C 4B E1 41
|
||||
00B0 | F1 75 B1 6D 6B 9E 61 38 DF 57 42 6F A4 7D 6B FB
|
||||
00C0 | 38 CA CC 16 F5 29 C5 E0 F9 E4 FB 81 93 14 14 2B
|
||||
00D0 | 65 B2 D6 F5 87 44 92 94 29 C2 FA 3E BA 79 B4 D5
|
||||
00E0 | FC B4 81 5B F2 81 97 9C E2 2A A3 6B D6 D2 83 00
|
||||
00F0 | 3F 50 4E 81 AB 25 23 9B F3 70 FA 9C 67 07 36 06
|
||||
0100 | FF 47 6F A1 06 E2 08 77 8E 25 7B 6F 8B D2 F5 3A
|
||||
0110 | C0 C7 B1 7E 25 62 75 3E 0D 5C B9 07 AB 74 57 38
|
||||
0120 | B9 B0 AF 42 4D 94 7D 19 B4 A5 4C F4 03 34 49 2B
|
||||
0130 | E5 99 FD D3 3D DF 27 AA B1 B4 61 3E 0A 4E A2 8C
|
||||
0140 | 23 21 AB DC BA 18 CF D4 39 22 15 7A 4E B3 71 6B
|
||||
0150 | 22 F3 A7 9A</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 = 737F0EDCF6715AE78A3F73A045C58BAD897322FC4E01CEDBD4BEB2B67
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>F8FE0C0003D73867</code></td>
|
||||
<td><code>0071080021E53867</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 = 737F0EDCF6715AE78A3F73A045C58BAD897322FC4E01CEDBD4BEB2B67
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>9A5BA41B3D34520597274DF2D377B520</code></td>
|
||||
<td><code>D7FB5BD84FC931BBD2BAC265E1E8CF08</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>2D4F3BFCC9F3A6C2D6A5FD9613D8979B</code></td>
|
||||
<td><code>7AF2D212200839DE08BDD4C62022181A</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p</td>
|
||||
<td>56, 8</td>
|
||||
<td><code>044DCE6FED000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1305374701</td>
|
||||
<td><code>0454F02D1D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1425026333</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>04717B9A6D000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1903925869</td>
|
||||
<td><code>0456D746ED000000</code><br>TL byte deserialization <br>=> bigendian conversion to decimal<br>=> 1456948973</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 = 737F0EDCF6715AE78A3F73A045C58BAD897322FC4E01CEDBD4BEB2B67
|
|||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>80, 260</td>
|
||||
<td><code>FE000100331AE866F377D9C51531B8BA</code> <code>EE08A181B7332769B1B24C120F79D70D</code> <code>E9E5A6EC13AD2777FC02BDE226724818</code> <code>7CE3EBCE0B7B67D8C1C6458269B4B759</code> <code>B4AB6E91BB60EE0539256A73A307D3AF</code> <code>98C2F52B048620B59B033E3ECCC7ED0B</code> <code>F453D25AFBDC7B1B35313181E6D88649</code> <code>42F254B7B5B7601FE008BE339A2CD164</code> <code>96114F088EE3F87D6F0ACE729B920898</code> <code>C252210CDFBB5127E17493AAFB7466B8</code> <code>32A068992FF1266E30A1402555E29EAA</code> <code>945BE35D7DAA56EFAC0D85547723E831</code> <code>DD435CD52B7C1C47F23F8325ECAF1995</code> <code>F46044577A08632B5FE4F8115F4C4F79</code> <code>0096207FA69316F83318B2720DCA7785</code> <code>D3BA657F096DF42CB8B00B844EA714D8</code><br> <code>15426B25</code></td>
|
||||
<td><code>FE000100C4B6CC8E8F772EF6ACB50368</code> <code>55FE4D78B9AB76B70AC8D5B001245C1F</code> <code>989A240C434BD312A2358801FF0D16C4</code> <code>2496B568CC3D8F56C5F97BAABCCF8482</code> <code>71D2C7207135C0F8D7D39E7B3649CEAE</code> <code>882E973F0EAA3FF31B851A9F2C4BE141</code> <code>F175B16D6B9E6138DF57426FA47D6BFB</code> <code>38CACC16F529C5E0F9E4FB819314142B</code> <code>65B2D6F58744929429C2FA3EBA79B4D5</code> <code>FCB4815BF281979CE22AA36BD6D28300</code> <code>3F504E81AB25239BF370FA9C67073606</code> <code>FF476FA106E208778E257B6F8BD2F53A</code> <code>C0C7B17E2562753E0D5CB907AB745738</code> <code>B9B0AF424D947D19B4A54CF40334492B</code> <code>E599FDD33DDF27AAB1B4613E0A4EA28C</code> <code>2321ABDCBA18CFD43922157A4EB3716B</code><br> <code>22F3A79A</code></td>
|
||||
<td>Value generated above</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -402,47 +402,47 @@ random_padding_bytes = 737F0EDCF6715AE78A3F73A045C58BAD897322FC4E01CEDBD4BEB2B67
|
|||
<h5><a class="anchor" href="#6-server-responds-with" id="6-server-responds-with" name="6-server-responds-with"><i class="anchor-icon"></i></a>6) Server responds with:</h5>
|
||||
<!-- start server_DH_params_ok -->
|
||||
<p>Received payload (excluding transport headers/trailers):</p>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 F4 2E EB 03 D7 38 67
|
||||
0010 | 78 02 00 00 5C 07 E8 D0 9A 5B A4 1B 3D 34 52 05
|
||||
0020 | 97 27 4D F2 D3 77 B5 20 2D 4F 3B FC C9 F3 A6 C2
|
||||
0030 | D6 A5 FD 96 13 D8 97 9B FE 50 02 00 46 CC 6E 91
|
||||
0040 | 84 C8 07 08 31 C3 87 4E DC A1 FF 0C 87 F5 EB 43
|
||||
0050 | B6 2B 77 2D 3A 40 87 38 F9 32 38 4D F4 77 8B 22
|
||||
0060 | 0D 8F D4 6A EE C5 6C 76 78 83 8C 6A 10 4C B9 DF
|
||||
0070 | 2B D9 B7 48 3A 8E 4F 1E 2A D5 C0 7F C8 84 57 72
|
||||
0080 | B5 EE DD EA A5 CE 10 95 98 F4 F6 63 D2 5A 79 F8
|
||||
0090 | 63 98 DE 73 6F 28 6E 9E E0 12 79 F4 20 7F 43 94
|
||||
00A0 | 43 46 56 E1 13 7D 6C D8 1A F4 6E 32 0E 58 6A D8
|
||||
00B0 | 9A C7 35 37 AB 24 86 F5 0D D6 C9 9C 2B 40 5A 83
|
||||
00C0 | 96 FC B8 06 4B 46 8F E6 60 DF A8 27 6A 3D 8B 9E
|
||||
00D0 | 67 BA 51 30 5A 3E 29 FD D6 7D F9 22 83 2D 1A A5
|
||||
00E0 | 70 A8 BD C0 94 78 3E 77 CB CB 2A A5 CF 6C 15 59
|
||||
00F0 | 5F C7 32 AF DE 08 C8 76 58 56 A7 D3 FC A3 22 55
|
||||
0100 | DA 2F 20 4D 14 21 61 12 6B 4D 51 69 CC 2B FD 1F
|
||||
0110 | 2E B0 86 56 26 F6 02 0C 1D 5C 9B BB AA 4F 1B 12
|
||||
0120 | 12 4A E0 32 4B FA 9E 6A C5 9E 40 A1 95 24 86 D4
|
||||
0130 | D3 A6 B9 3B AB C5 A1 13 24 45 FE FD CA 3D C8 47
|
||||
0140 | 73 D3 E3 E7 A9 15 96 C1 C1 67 09 A8 1F A9 74 C8
|
||||
0150 | F1 28 F5 34 33 CD A3 89 D3 F4 84 11 2E 42 89 5F
|
||||
0160 | 99 3E 1E 4D B8 D1 F6 41 B6 37 7D C6 38 D4 DE 2E
|
||||
0170 | 79 80 C0 D3 D0 33 EC 28 79 C8 80 70 11 AD 52 5B
|
||||
0180 | 5D 8D F8 75 AE 12 0B BF 1B 0B BE CE 6D D4 0C D1
|
||||
0190 | 40 4C B3 E8 59 2E BC DE C5 F1 63 DA EF 67 F1 11
|
||||
01A0 | 74 C0 92 E0 61 41 7D 73 B8 5C E1 54 93 B9 E7 C7
|
||||
01B0 | B2 88 E7 AB D0 23 0C 96 00 22 EB 97 2B 51 17 22
|
||||
01C0 | 89 10 AD 90 1B A5 B5 C7 BF D0 D8 6D 4A 45 49 B5
|
||||
01D0 | 81 DC 37 6C 59 B1 32 60 6F 7E 7F D7 F9 6D AD 3D
|
||||
01E0 | 71 04 AB 26 F9 15 5C 13 FC 10 71 BE 04 C8 CF D1
|
||||
01F0 | 25 9C BC 55 7D 3D 54 DB B5 17 C7 A4 C4 D1 63 52
|
||||
0200 | 78 23 99 14 63 72 9C 03 25 B0 5F 01 05 FB 47 6A
|
||||
0210 | 9B 75 6C 44 7A 82 11 7B A8 1C CC AA 38 93 31 CC
|
||||
0220 | C7 88 B4 DC 0D ED 79 8C 78 63 EB 22 EC 30 C2 69
|
||||
0230 | 76 DC 3E 69 F4 4A 8D 40 74 0D FF 72 D6 D6 B4 2E
|
||||
0240 | 49 2A FE 93 7A 34 33 F3 2A CF 4F 1C AC FB FE 2B
|
||||
0250 | C3 A7 80 45 C0 BF 4B 34 46 F2 41 1A 8D 84 7D 20
|
||||
0260 | 66 3F C4 72 4F 57 3C 95 A5 66 94 49 33 22 1A 73
|
||||
0270 | A7 B5 CB 1E 92 3A E5 8C 2A 0B AE E2 FD 23 B8 5A
|
||||
0280 | A3 65 B3 A2 19 3B 36 55 74 23 44 B5</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 C4 67 F5 21 E5 38 67
|
||||
0010 | 78 02 00 00 5C 07 E8 D0 D7 FB 5B D8 4F C9 31 BB
|
||||
0020 | D2 BA C2 65 E1 E8 CF 08 7A F2 D2 12 20 08 39 DE
|
||||
0030 | 08 BD D4 C6 20 22 18 1A FE 50 02 00 49 3B 12 6C
|
||||
0040 | 34 6F 23 CB D0 E2 36 09 66 5A 13 3D DA 0B A3 F0
|
||||
0050 | ED 4A B1 45 D9 81 3D 50 F4 67 88 AE F6 94 6A C8
|
||||
0060 | F3 2D 1A 81 0B 0B 31 0B 7A 5B 34 E2 93 88 AC BB
|
||||
0070 | AE 07 01 45 89 10 BD 7C FD 79 CC B0 B9 4B 1F 5F
|
||||
0080 | 31 EC B8 91 8D C0 6A 68 1A 1F F5 F2 48 25 D7 EE
|
||||
0090 | 04 54 28 BF 1A AC CE B7 AA 6E F1 4B 62 B7 D2 DD
|
||||
00A0 | D9 69 72 75 18 F2 33 69 45 9D E0 33 4B 69 B6 B7
|
||||
00B0 | B5 FB 6C 95 91 8B 37 89 CA C5 31 0E 9F E9 5A 15
|
||||
00C0 | F6 B3 79 10 79 F3 31 50 CF A5 CB 2B 7B DC 23 51
|
||||
00D0 | E1 88 5A A3 03 C9 DB CA D0 19 7C 8B 7E 42 C5 3E
|
||||
00E0 | 32 F9 06 DC 0A CF 2B FA DB 62 41 09 4B 45 F4 8D
|
||||
00F0 | 1C 4C 60 EF 23 40 5C BD 39 02 B3 ED 0D 64 2E C5
|
||||
0100 | 4D 31 44 0F 34 1D 34 A7 B0 31 39 1F D3 3E D0 AB
|
||||
0110 | 8A AA 0E 3E ED 2E 03 00 FE 05 74 AC 93 DD D0 8D
|
||||
0120 | 77 61 45 B0 5E 36 35 31 0F 4B DC 53 08 31 71 BE
|
||||
0130 | DF A9 FB 94 74 28 65 8F BA 60 8C 0E A4 58 77 23
|
||||
0140 | 98 77 49 4F 89 2C B4 8A 26 40 76 DE 56 D3 B9 A2
|
||||
0150 | 49 DB F9 06 72 D5 86 36 74 74 41 81 7B 4E 0B DC
|
||||
0160 | B0 5C F7 4F B8 95 4F A4 D9 FE BF 10 71 8F 7D 7C
|
||||
0170 | 53 FF 0D A6 75 A4 FD CB 50 B6 33 CF 5C 63 9A 58
|
||||
0180 | D4 37 ED 56 92 6D 3B C3 68 51 F6 1A 98 6F 2C 1B
|
||||
0190 | 45 2B 8D EA 23 CA 08 54 73 71 F9 F2 E8 B5 FF 6C
|
||||
01A0 | 96 5C 44 CB DB B8 AB CC 91 D7 F5 C9 25 EF 12 50
|
||||
01B0 | 3D A7 8E E9 2C 08 B7 3F 5E 95 6A 44 A2 39 F7 A2
|
||||
01C0 | EE 7F FA 65 14 FA 62 D3 A5 53 06 54 54 AB A6 78
|
||||
01D0 | 6E 5C 02 F3 6F 4E 52 AC 20 F3 DE 10 A0 F0 06 46
|
||||
01E0 | 25 25 CD 39 D8 AB 24 4B 39 71 99 43 7E B0 48 92
|
||||
01F0 | D6 F3 56 AE 64 A5 7F D6 7A 41 9B 86 33 7E DF 08
|
||||
0200 | F7 BA D5 4B 57 61 C3 0F 5F 38 5E 5F 55 1E 5B 32
|
||||
0210 | 87 17 BC 43 80 D0 B5 72 D1 78 4E 4D 58 15 58 CB
|
||||
0220 | B8 09 2E A2 0D 05 6B CE B8 EB 51 ED E8 9E 7F 8C
|
||||
0230 | F6 E6 E9 95 EF 47 E8 FD 60 00 F2 EB D3 20 3D F1
|
||||
0240 | DE 2D 4B 4E EE 65 E5 F4 5B EF 34 1B A8 14 54 D1
|
||||
0250 | 6A 86 20 76 78 E4 B8 91 37 1B 49 0A 55 AE 6C AE
|
||||
0260 | 96 99 5C 9B F7 DF 87 E9 9C 6D 54 E3 BC 72 C7 2F
|
||||
0270 | 06 16 C0 17 90 44 46 DD 10 3F 9A 33 81 85 3E FD
|
||||
0280 | A3 7B FD BF 2B 91 FB CD D1 4C B1 D1</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,7 +464,7 @@ random_padding_bytes = 737F0EDCF6715AE78A3F73A045C58BAD897322FC4E01CEDBD4BEB2B67
|
|||
<tr>
|
||||
<td>message_id</td>
|
||||
<td>8, 8</td>
|
||||
<td><code>01F42EEB03D73867</code></td>
|
||||
<td><code>01C467F521E53867</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>
|
||||
|
@ -482,19 +482,19 @@ random_padding_bytes = 737F0EDCF6715AE78A3F73A045C58BAD897322FC4E01CEDBD4BEB2B67
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>24, 16</td>
|
||||
<td><code>9A5BA41B3D34520597274DF2D377B520</code></td>
|
||||
<td><code>D7FB5BD84FC931BBD2BAC265E1E8CF08</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>2D4F3BFCC9F3A6C2D6A5FD9613D8979B</code></td>
|
||||
<td><code>7AF2D212200839DE08BDD4C62022181A</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_answer</td>
|
||||
<td>56, 596</td>
|
||||
<td><code>FE50020046CC6E9184C8070831C3874E</code> <code>DCA1FF0C87F5EB43B62B772D3A408738</code> <code>F932384DF4778B220D8FD46AEEC56C76</code> <code>78838C6A104CB9DF2BD9B7483A8E4F1E</code> <code>2AD5C07FC8845772B5EEDDEAA5CE1095</code> <code>98F4F663D25A79F86398DE736F286E9E</code> <code>E01279F4207F4394434656E1137D6CD8</code> <code>1AF46E320E586AD89AC73537AB2486F5</code> <code>0DD6C99C2B405A8396FCB8064B468FE6</code> <code>60DFA8276A3D8B9E67BA51305A3E29FD</code> <code>D67DF922832D1AA570A8BDC094783E77</code> <code>CBCB2AA5CF6C15595FC732AFDE08C876</code> <code>5856A7D3FCA32255DA2F204D14216112</code> <code>6B4D5169CC2BFD1F2EB0865626F6020C</code> <code>1D5C9BBBAA4F1B12124AE0324BFA9E6A</code> <code>C59E40A1952486D4D3A6B93BABC5A113</code> <code>2445FEFDCA3DC84773D3E3E7A91596C1</code> <code>C16709A81FA974C8F128F53433CDA389</code> <code>D3F484112E42895F993E1E4DB8D1F641</code> <code>B6377DC638D4DE2E7980C0D3D033EC28</code> <code>79C8807011AD525B5D8DF875AE120BBF</code> <code>1B0BBECE6DD40CD1404CB3E8592EBCDE</code> <code>C5F163DAEF67F11174C092E061417D73</code> <code>B85CE15493B9E7C7B288E7ABD0230C96</code> <code>0022EB972B5117228910AD901BA5B5C7</code> <code>BFD0D86D4A4549B581DC376C59B13260</code> <code>6F7E7FD7F96DAD3D7104AB26F9155C13</code> <code>FC1071BE04C8CFD1259CBC557D3D54DB</code> <code>B517C7A4C4D163527823991463729C03</code> <code>25B05F0105FB476A9B756C447A82117B</code> <code>A81CCCAA389331CCC788B4DC0DED798C</code> <code>7863EB22EC30C26976DC3E69F44A8D40</code> <code>740DFF72D6D6B42E492AFE937A3433F3</code> <code>2ACF4F1CACFBFE2BC3A78045C0BF4B34</code> <code>46F2411A8D847D20663FC4724F573C95</code> <code>A566944933221A73A7B5CB1E923AE58C</code> <code>2A0BAEE2FD23B85AA365B3A2193B3655</code><br> <code>742344B5</code></td>
|
||||
<td><code>FE500200493B126C346F23CBD0E23609</code> <code>665A133DDA0BA3F0ED4AB145D9813D50</code> <code>F46788AEF6946AC8F32D1A810B0B310B</code> <code>7A5B34E29388ACBBAE0701458910BD7C</code> <code>FD79CCB0B94B1F5F31ECB8918DC06A68</code> <code>1A1FF5F24825D7EE045428BF1AACCEB7</code> <code>AA6EF14B62B7D2DDD969727518F23369</code> <code>459DE0334B69B6B7B5FB6C95918B3789</code> <code>CAC5310E9FE95A15F6B3791079F33150</code> <code>CFA5CB2B7BDC2351E1885AA303C9DBCA</code> <code>D0197C8B7E42C53E32F906DC0ACF2BFA</code> <code>DB6241094B45F48D1C4C60EF23405CBD</code> <code>3902B3ED0D642EC54D31440F341D34A7</code> <code>B031391FD33ED0AB8AAA0E3EED2E0300</code> <code>FE0574AC93DDD08D776145B05E363531</code> <code>0F4BDC53083171BEDFA9FB947428658F</code> <code>BA608C0EA45877239877494F892CB48A</code> <code>264076DE56D3B9A249DBF90672D58636</code> <code>747441817B4E0BDCB05CF74FB8954FA4</code> <code>D9FEBF10718F7D7C53FF0DA675A4FDCB</code> <code>50B633CF5C639A58D437ED56926D3BC3</code> <code>6851F61A986F2C1B452B8DEA23CA0854</code> <code>7371F9F2E8B5FF6C965C44CBDBB8ABCC</code> <code>91D7F5C925EF12503DA78EE92C08B73F</code> <code>5E956A44A239F7A2EE7FFA6514FA62D3</code> <code>A553065454ABA6786E5C02F36F4E52AC</code> <code>20F3DE10A0F006462525CD39D8AB244B</code> <code>397199437EB04892D6F356AE64A57FD6</code> <code>7A419B86337EDF08F7BAD54B5761C30F</code> <code>5F385E5F551E5B328717BC4380D0B572</code> <code>D1784E4D581558CBB8092EA20D056BCE</code> <code>B8EB51EDE89E7F8CF6E6E995EF47E8FD</code> <code>6000F2EBD3203DF1DE2D4B4EEE65E5F4</code> <code>5BEF341BA81454D16A86207678E4B891</code> <code>371B490A55AE6CAE96995C9BF7DF87E9</code> <code>9C6D54E3BC72C72F0616C017904446DD</code> <code>103F9A3381853EFDA37BFDBF2B91FBCD</code><br> <code>D14CB1D1</code></td>
|
||||
<td>See below</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -502,20 +502,20 @@ random_padding_bytes = 737F0EDCF6715AE78A3F73A045C58BAD897322FC4E01CEDBD4BEB2B67
|
|||
<!-- 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 = 46CC6E9184C8070831C3874EDCA1FF0C87F5EB43B62B772D3A408738F932384DF4778B220D8FD46AEEC56C7678838C6A104CB9DF2BD9B7483A8E4F1E2AD5C07FC8845772B5EEDDEAA5CE109598F4F663D25A79F86398DE736F286E9EE01279F4207F4394434656E1137D6CD81AF46E320E586AD89AC73537AB2486F50DD6C99C2B405A8396FCB8064B468FE660DFA8276A3D8B9E67BA51305A3E29FDD67DF922832D1AA570A8BDC094783E77CBCB2AA5CF6C15595FC732AFDE08C8765856A7D3FCA32255DA2F204D142161126B4D5169CC2BFD1F2EB0865626F6020C1D5C9BBBAA4F1B12124AE0324BFA9E6AC59E40A1952486D4D3A6B93BABC5A1132445FEFDCA3DC84773D3E3E7A91596C1C16709A81FA974C8F128F53433CDA389D3F484112E42895F993E1E4DB8D1F641B6377DC638D4DE2E7980C0D3D033EC2879C8807011AD525B5D8DF875AE120BBF1B0BBECE6DD40CD1404CB3E8592EBCDEC5F163DAEF67F11174C092E061417D73B85CE15493B9E7C7B288E7ABD0230C960022EB972B5117228910AD901BA5B5C7BFD0D86D4A4549B581DC376C59B132606F7E7FD7F96DAD3D7104AB26F9155C13FC1071BE04C8CFD1259CBC557D3D54DBB517C7A4C4D163527823991463729C0325B05F0105FB476A9B756C447A82117BA81CCCAA389331CCC788B4DC0DED798C7863EB22EC30C26976DC3E69F44A8D40740DFF72D6D6B42E492AFE937A3433F32ACF4F1CACFBFE2BC3A78045C0BF4B3446F2411A8D847D20663FC4724F573C95A566944933221A73A7B5CB1E923AE58C2A0BAEE2FD23B85AA365B3A2193B3655742344B5
|
||||
tmp_aes_key = 43304FF1FC6B7BAF07DB39696A08365AB6194F59460F1E6C4B1605F765C86676
|
||||
tmp_aes_iv = 1F93981C89E1ADACE692CC4BDBD2738BA309C47BDCB3B90907074E7CF19B1937</code></pre>
|
||||
<pre><code>encrypted_answer = 493B126C346F23CBD0E23609665A133DDA0BA3F0ED4AB145D9813D50F46788AEF6946AC8F32D1A810B0B310B7A5B34E29388ACBBAE0701458910BD7CFD79CCB0B94B1F5F31ECB8918DC06A681A1FF5F24825D7EE045428BF1AACCEB7AA6EF14B62B7D2DDD969727518F23369459DE0334B69B6B7B5FB6C95918B3789CAC5310E9FE95A15F6B3791079F33150CFA5CB2B7BDC2351E1885AA303C9DBCAD0197C8B7E42C53E32F906DC0ACF2BFADB6241094B45F48D1C4C60EF23405CBD3902B3ED0D642EC54D31440F341D34A7B031391FD33ED0AB8AAA0E3EED2E0300FE0574AC93DDD08D776145B05E3635310F4BDC53083171BEDFA9FB947428658FBA608C0EA45877239877494F892CB48A264076DE56D3B9A249DBF90672D58636747441817B4E0BDCB05CF74FB8954FA4D9FEBF10718F7D7C53FF0DA675A4FDCB50B633CF5C639A58D437ED56926D3BC36851F61A986F2C1B452B8DEA23CA08547371F9F2E8B5FF6C965C44CBDBB8ABCC91D7F5C925EF12503DA78EE92C08B73F5E956A44A239F7A2EE7FFA6514FA62D3A553065454ABA6786E5C02F36F4E52AC20F3DE10A0F006462525CD39D8AB244B397199437EB04892D6F356AE64A57FD67A419B86337EDF08F7BAD54B5761C30F5F385E5F551E5B328717BC4380D0B572D1784E4D581558CBB8092EA20D056BCEB8EB51EDE89E7F8CF6E6E995EF47E8FD6000F2EBD3203DF1DE2D4B4EEE65E5F45BEF341BA81454D16A86207678E4B891371B490A55AE6CAE96995C9BF7DF87E99C6D54E3BC72C72F0616C017904446DD103F9A3381853EFDA37BFDBF2B91FBCDD14CB1D1
|
||||
tmp_aes_key = 259A2243E880E7DDBD9493DBC32594F32EA11EDC02ED3D31EBF559CB234B3B2C
|
||||
tmp_aes_iv = 5F6767C06344242E1213C17A87D0AF70E29E57648D2C4CB618F46EB22E80D57A</code></pre>
|
||||
<!-- end server_DH_inner_data_input -->
|
||||
<p>Yielding:</p>
|
||||
<!-- start server_DH_inner_data_output -->
|
||||
<pre><code>answer_with_hash = 16C0C99B915CE6D6DACF77CC3E07D4692C522D4DBA0D89B59A5BA41B3D34520597274DF2D377B5202D4F3BFCC9F3A6C2D6A5FD9613D8979B03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001005CCC288C6903A793C0A53F04A570DCDBD3CA139421500CF06E1B37E2D5139E6CF728A16D07311EF980A3CAC80E37E51AA1FC459F472F0186F2B7F1E8270540B43CF34048ADA93BC160793F04D06BE2D4F49F3578E7665C23D4077A0DF03E3E71BC0F1FC0987DD4C100CB4DC9D2DDCF8F36A5D59C2197313AADF3E7E90F21DB08492D1E3BD7AD1BE2AF0913F3434443B9FE1E44393087A99EE50325A83027CF79609DF108F1544CF228263A073DC4CAC37ED9D1B843BACD23F2FC3426F39604015AC45BF1A255609DD1790CCF93D2183B20B8339AD27E9991C012CAC55D6FA12883440745340DF5B5D67C0BE9B2A45DFFB28BFDA5B147F34017594255F6FF279903D7386706263D9E00FD6324
|
||||
answer = BA0D89B59A5BA41B3D34520597274DF2D377B5202D4F3BFCC9F3A6C2D6A5FD9613D8979B03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001005CCC288C6903A793C0A53F04A570DCDBD3CA139421500CF06E1B37E2D5139E6CF728A16D07311EF980A3CAC80E37E51AA1FC459F472F0186F2B7F1E8270540B43CF34048ADA93BC160793F04D06BE2D4F49F3578E7665C23D4077A0DF03E3E71BC0F1FC0987DD4C100CB4DC9D2DDCF8F36A5D59C2197313AADF3E7E90F21DB08492D1E3BD7AD1BE2AF0913F3434443B9FE1E44393087A99EE50325A83027CF79609DF108F1544CF228263A073DC4CAC37ED9D1B843BACD23F2FC3426F39604015AC45BF1A255609DD1790CCF93D2183B20B8339AD27E9991C012CAC55D6FA12883440745340DF5B5D67C0BE9B2A45DFFB28BFDA5B147F34017594255F6FF279903D7386706263D9E00FD6324</code></pre>
|
||||
<pre><code>answer_with_hash = 91818C68401F6B3FC285024C52882BFE1685CAA0BA0D89B5D7FB5BD84FC931BBD2BAC265E1E8CF087AF2D212200839DE08BDD4C62022181A03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001001062F2360D199B5E2D79716238CCB3A21093E41E64F17D712F370A3A91B625640243501B8538712C1AD9B690A1C5204CCA45C62C6C3043B1B355D2C6D51E104A4F32E8EF2BD21E2A069BCEAEAA9C67135D7444394D690FA8FCFCD6E642C49164D22C7EE21A239F5BE7960F36A883695DC9B7BCD75CC43E5270B69CE45F39F6B840F57D4822AE3C2EBDC9A62BDEEC6539B4133AA67766CC000232E1C2C0BCEEB469AD6D088FB807765FB56CF7505479B827B9EB8AC3EB0A30A63F6BA0A1ACD86B0CA97A6DEE652E1E13E688E6095A51D3811533E951A26E526072B0FAEB6E95BB39495D725A7A4C7213B3D118813E40ECC5F8B782C9725B67A044E27B29DCF30121E53867576B4871B17F9AC3
|
||||
answer = BA0D89B5D7FB5BD84FC931BBD2BAC265E1E8CF087AF2D212200839DE08BDD4C62022181A03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001001062F2360D199B5E2D79716238CCB3A21093E41E64F17D712F370A3A91B625640243501B8538712C1AD9B690A1C5204CCA45C62C6C3043B1B355D2C6D51E104A4F32E8EF2BD21E2A069BCEAEAA9C67135D7444394D690FA8FCFCD6E642C49164D22C7EE21A239F5BE7960F36A883695DC9B7BCD75CC43E5270B69CE45F39F6B840F57D4822AE3C2EBDC9A62BDEEC6539B4133AA67766CC000232E1C2C0BCEEB469AD6D088FB807765FB56CF7505479B827B9EB8AC3EB0A30A63F6BA0A1ACD86B0CA97A6DEE652E1E13E688E6095A51D3811533E951A26E526072B0FAEB6E95BB39495D725A7A4C7213B3D118813E40ECC5F8B782C9725B67A044E27B29DCF30121E53867576B4871B17F9AC3</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 9A 5B A4 1B 3D 34 52 05 97 27 4D F2
|
||||
0010 | D3 77 B5 20 2D 4F 3B FC C9 F3 A6 C2 D6 A5 FD 96
|
||||
0020 | 13 D8 97 9B 03 00 00 00 FE 00 01 00 C7 1C AE B9
|
||||
<pre><code>0000 | BA 0D 89 B5 D7 FB 5B D8 4F C9 31 BB D2 BA C2 65
|
||||
0010 | E1 E8 CF 08 7A F2 D2 12 20 08 39 DE 08 BD D4 C6
|
||||
0020 | 20 22 18 1A 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 = BA0D89B59A5BA41B3D34520597274DF2D377B5202D4F3BFCC9F3A6C2D6A5FD9613D8979
|
|||
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 | 5C CC 28 8C 69 03 A7 93 C0 A5 3F 04 A5 70 DC DB
|
||||
0140 | D3 CA 13 94 21 50 0C F0 6E 1B 37 E2 D5 13 9E 6C
|
||||
0150 | F7 28 A1 6D 07 31 1E F9 80 A3 CA C8 0E 37 E5 1A
|
||||
0160 | A1 FC 45 9F 47 2F 01 86 F2 B7 F1 E8 27 05 40 B4
|
||||
0170 | 3C F3 40 48 AD A9 3B C1 60 79 3F 04 D0 6B E2 D4
|
||||
0180 | F4 9F 35 78 E7 66 5C 23 D4 07 7A 0D F0 3E 3E 71
|
||||
0190 | BC 0F 1F C0 98 7D D4 C1 00 CB 4D C9 D2 DD CF 8F
|
||||
01A0 | 36 A5 D5 9C 21 97 31 3A AD F3 E7 E9 0F 21 DB 08
|
||||
01B0 | 49 2D 1E 3B D7 AD 1B E2 AF 09 13 F3 43 44 43 B9
|
||||
01C0 | FE 1E 44 39 30 87 A9 9E E5 03 25 A8 30 27 CF 79
|
||||
01D0 | 60 9D F1 08 F1 54 4C F2 28 26 3A 07 3D C4 CA C3
|
||||
01E0 | 7E D9 D1 B8 43 BA CD 23 F2 FC 34 26 F3 96 04 01
|
||||
01F0 | 5A C4 5B F1 A2 55 60 9D D1 79 0C CF 93 D2 18 3B
|
||||
0200 | 20 B8 33 9A D2 7E 99 91 C0 12 CA C5 5D 6F A1 28
|
||||
0210 | 83 44 07 45 34 0D F5 B5 D6 7C 0B E9 B2 A4 5D FF
|
||||
0220 | B2 8B FD A5 B1 47 F3 40 17 59 42 55 F6 FF 27 99
|
||||
0230 | 03 D7 38 67</code></pre>
|
||||
0130 | 10 62 F2 36 0D 19 9B 5E 2D 79 71 62 38 CC B3 A2
|
||||
0140 | 10 93 E4 1E 64 F1 7D 71 2F 37 0A 3A 91 B6 25 64
|
||||
0150 | 02 43 50 1B 85 38 71 2C 1A D9 B6 90 A1 C5 20 4C
|
||||
0160 | CA 45 C6 2C 6C 30 43 B1 B3 55 D2 C6 D5 1E 10 4A
|
||||
0170 | 4F 32 E8 EF 2B D2 1E 2A 06 9B CE AE AA 9C 67 13
|
||||
0180 | 5D 74 44 39 4D 69 0F A8 FC FC D6 E6 42 C4 91 64
|
||||
0190 | D2 2C 7E E2 1A 23 9F 5B E7 96 0F 36 A8 83 69 5D
|
||||
01A0 | C9 B7 BC D7 5C C4 3E 52 70 B6 9C E4 5F 39 F6 B8
|
||||
01B0 | 40 F5 7D 48 22 AE 3C 2E BD C9 A6 2B DE EC 65 39
|
||||
01C0 | B4 13 3A A6 77 66 CC 00 02 32 E1 C2 C0 BC EE B4
|
||||
01D0 | 69 AD 6D 08 8F B8 07 76 5F B5 6C F7 50 54 79 B8
|
||||
01E0 | 27 B9 EB 8A C3 EB 0A 30 A6 3F 6B A0 A1 AC D8 6B
|
||||
01F0 | 0C A9 7A 6D EE 65 2E 1E 13 E6 88 E6 09 5A 51 D3
|
||||
0200 | 81 15 33 E9 51 A2 6E 52 60 72 B0 FA EB 6E 95 BB
|
||||
0210 | 39 49 5D 72 5A 7A 4C 72 13 B3 D1 18 81 3E 40 EC
|
||||
0220 | C5 F8 B7 82 C9 72 5B 67 A0 44 E2 7B 29 DC F3 01
|
||||
0230 | 21 E5 38 67</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 = BA0D89B59A5BA41B3D34520597274DF2D377B5202D4F3BFCC9F3A6C2D6A5FD9613D8979
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>9A5BA41B3D34520597274DF2D377B520</code></td>
|
||||
<td><code>D7FB5BD84FC931BBD2BAC265E1E8CF08</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>2D4F3BFCC9F3A6C2D6A5FD9613D8979B</code></td>
|
||||
<td><code>7AF2D212200839DE08BDD4C62022181A</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -594,13 +594,13 @@ answer = BA0D89B59A5BA41B3D34520597274DF2D377B5202D4F3BFCC9F3A6C2D6A5FD9613D8979
|
|||
<tr>
|
||||
<td>g_a</td>
|
||||
<td>300, 260</td>
|
||||
<td><code>FE0001005CCC288C6903A793C0A53F04</code> <code>A570DCDBD3CA139421500CF06E1B37E2</code> <code>D5139E6CF728A16D07311EF980A3CAC8</code> <code>0E37E51AA1FC459F472F0186F2B7F1E8</code> <code>270540B43CF34048ADA93BC160793F04</code> <code>D06BE2D4F49F3578E7665C23D4077A0D</code> <code>F03E3E71BC0F1FC0987DD4C100CB4DC9</code> <code>D2DDCF8F36A5D59C2197313AADF3E7E9</code> <code>0F21DB08492D1E3BD7AD1BE2AF0913F3</code> <code>434443B9FE1E44393087A99EE50325A8</code> <code>3027CF79609DF108F1544CF228263A07</code> <code>3DC4CAC37ED9D1B843BACD23F2FC3426</code> <code>F39604015AC45BF1A255609DD1790CCF</code> <code>93D2183B20B8339AD27E9991C012CAC5</code> <code>5D6FA12883440745340DF5B5D67C0BE9</code> <code>B2A45DFFB28BFDA5B147F34017594255</code><br> <code>F6FF2799</code></td>
|
||||
<td><code>FE0001001062F2360D199B5E2D797162</code> <code>38CCB3A21093E41E64F17D712F370A3A</code> <code>91B625640243501B8538712C1AD9B690</code> <code>A1C5204CCA45C62C6C3043B1B355D2C6</code> <code>D51E104A4F32E8EF2BD21E2A069BCEAE</code> <code>AA9C67135D7444394D690FA8FCFCD6E6</code> <code>42C49164D22C7EE21A239F5BE7960F36</code> <code>A883695DC9B7BCD75CC43E5270B69CE4</code> <code>5F39F6B840F57D4822AE3C2EBDC9A62B</code> <code>DEEC6539B4133AA67766CC000232E1C2</code> <code>C0BCEEB469AD6D088FB807765FB56CF7</code> <code>505479B827B9EB8AC3EB0A30A63F6BA0</code> <code>A1ACD86B0CA97A6DEE652E1E13E688E6</code> <code>095A51D3811533E951A26E526072B0FA</code> <code>EB6E95BB39495D725A7A4C7213B3D118</code> <code>813E40ECC5F8B782C9725B67A044E27B</code><br> <code>29DCF301</code></td>
|
||||
<td><code>g_a</code> diffie-hellman parameter</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_time</td>
|
||||
<td>560, 4</td>
|
||||
<td><code>03D73867</code> (1731778307 in decimal)</td>
|
||||
<td><code>21E53867</code> (1731781921 in decimal)</td>
|
||||
<td>Server time</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -609,34 +609,34 @@ answer = BA0D89B59A5BA41B3D34520597274DF2D377B5202D4F3BFCC9F3A6C2D6A5FD9613D8979
|
|||
<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 = E6616A623C7773B393C821A08F715B250A8F5C5116FA3995ECE8268D55D47C02406FE3638F03F9B1F013415E3C3B7547658A4683C6BE90043A6179B46CA7600CFCD8389819E88562A0FA4096C09D40783255F3938D5835E25ED3F489821AFB8F5E6AC15EFD22CE9E2454BD475D5AD2870B38FE713F38431F6547DF6F1F01F6674572AEEE075B37FEEE562E0D8C12AF262F9C22E2986D82F59B799CE5269C7048B395702577D1457EEB4FDF1D857D616562F7B854EAD8482D185017691A244F41D965AB2F84B25C9271AD04AE3AA5D1118A98767C0571301E71266DC55152503E721B5B506D45F790418361EE174E1E0831A27189FB46A59488664BAB8E44EF60</code></pre>
|
||||
<pre><code>b = E2141387C5AF49ACAAB6691E7BDF1C287FED8D36A6392D4FC9C6542040176E25AA9705789B06400539A043FCF233F801949CB1C079B46548DCCBB955A1E37B80EB48A30FECF53F00359927CDF5783B902D6632E46DA99030A8BDF996B59B8582226367763B25FECB16F315B63792BB987ACB061943C62640376D6ADF2135D1A095668CBE69867D56673C55A8CED16EBD4493DF3B62BAD056165033AA8A0798BC994C9E98B0B2EFED0F970E7BF75B0F6CD10DBBB194D4109A0A4E6A2B97022A138BF9F0633BBAD46E28095E0AF37C63FBFDD6C361B8D9B5FAE4B24E0DD6FDF1BF3A4F0163DAF0070B795A17AEB4DB297927C92C2694C5911F5CBB70AE31FF91ED</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 = 905BB047A141C068AD84271294378C6A5D7BE8A079C83FAF527490FF7E24A6C865C88B3EA86524E0D3DC831CCD98429AFFE729C3BBDDE4F194623C998D79DFCFD26E79D84528F61E8BCAF89288A6464F7D7A60026BA6AEA4C4932F17A2798F0202D7B9F94D791878E362865B8069CFEFD78B9B7DAE75A5D68C811C207F2BBE19DC2B72967735BB6E1EED93AD2BAE379C88582CC0970AC79A62D7CE5BA31195709E13E0F84E950EDF4B85E1BF1EE5109E933C4E0DA0822BC20B0EB2EB55D8EBF8C14CD143627B9D3BCCF1075757E0EB369F9BA42FC2036D89B77B6546D3E7EB6E62CBEF6A5B1B9B562A9DA9D42C6DA2DC0B8C94D9A30397628670996368961C97</code></pre>
|
||||
<pre><code>g_b = 2AF9C55C56C3B623F701EDB7FE2ACAA654B517AF1FBC7F7EF022E6EF044B1619C16873C60A9A5DE2D7086AD820A2FDCFDA11AD1746569B807C49444307D1C69313F8E85C019C1CE6410172EE05308C80CAA9EC80B89B7136E54EB216C2EF30200FB1E4C11FC8401CEACA39F4AEC54999C890A4E0AF7C78F373C85A5380168F87F2E5BA506E0F8B7CE6EAAD7C5041A057C4C5CF83B176125A4649D68D2043C4D6437F36DBD08974D7707E5C24AD8C7F86A37F0053844DC90994D20070BD42021C75002081BB6325816B17E1F12CA40D3B9A891C1C90EC9ACBC31C61052A372975DB907FA618A7F4314B027085DC70CE777B982DF6C62A9DE23877CEF920C84D55</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 9A 5B A4 1B 3D 34 52 05 97 27 4D F2
|
||||
0010 | D3 77 B5 20 2D 4F 3B FC C9 F3 A6 C2 D6 A5 FD 96
|
||||
0020 | 13 D8 97 9B 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | 90 5B B0 47 A1 41 C0 68 AD 84 27 12 94 37 8C 6A
|
||||
0040 | 5D 7B E8 A0 79 C8 3F AF 52 74 90 FF 7E 24 A6 C8
|
||||
0050 | 65 C8 8B 3E A8 65 24 E0 D3 DC 83 1C CD 98 42 9A
|
||||
0060 | FF E7 29 C3 BB DD E4 F1 94 62 3C 99 8D 79 DF CF
|
||||
0070 | D2 6E 79 D8 45 28 F6 1E 8B CA F8 92 88 A6 46 4F
|
||||
0080 | 7D 7A 60 02 6B A6 AE A4 C4 93 2F 17 A2 79 8F 02
|
||||
0090 | 02 D7 B9 F9 4D 79 18 78 E3 62 86 5B 80 69 CF EF
|
||||
00A0 | D7 8B 9B 7D AE 75 A5 D6 8C 81 1C 20 7F 2B BE 19
|
||||
00B0 | DC 2B 72 96 77 35 BB 6E 1E ED 93 AD 2B AE 37 9C
|
||||
00C0 | 88 58 2C C0 97 0A C7 9A 62 D7 CE 5B A3 11 95 70
|
||||
00D0 | 9E 13 E0 F8 4E 95 0E DF 4B 85 E1 BF 1E E5 10 9E
|
||||
00E0 | 93 3C 4E 0D A0 82 2B C2 0B 0E B2 EB 55 D8 EB F8
|
||||
00F0 | C1 4C D1 43 62 7B 9D 3B CC F1 07 57 57 E0 EB 36
|
||||
0100 | 9F 9B A4 2F C2 03 6D 89 B7 7B 65 46 D3 E7 EB 6E
|
||||
0110 | 62 CB EF 6A 5B 1B 9B 56 2A 9D A9 D4 2C 6D A2 DC
|
||||
0120 | 0B 8C 94 D9 A3 03 97 62 86 70 99 63 68 96 1C 97</code></pre>
|
||||
<pre><code>0000 | 54 B6 43 66 D7 FB 5B D8 4F C9 31 BB D2 BA C2 65
|
||||
0010 | E1 E8 CF 08 7A F2 D2 12 20 08 39 DE 08 BD D4 C6
|
||||
0020 | 20 22 18 1A 00 00 00 00 00 00 00 00 FE 00 01 00
|
||||
0030 | 2A F9 C5 5C 56 C3 B6 23 F7 01 ED B7 FE 2A CA A6
|
||||
0040 | 54 B5 17 AF 1F BC 7F 7E F0 22 E6 EF 04 4B 16 19
|
||||
0050 | C1 68 73 C6 0A 9A 5D E2 D7 08 6A D8 20 A2 FD CF
|
||||
0060 | DA 11 AD 17 46 56 9B 80 7C 49 44 43 07 D1 C6 93
|
||||
0070 | 13 F8 E8 5C 01 9C 1C E6 41 01 72 EE 05 30 8C 80
|
||||
0080 | CA A9 EC 80 B8 9B 71 36 E5 4E B2 16 C2 EF 30 20
|
||||
0090 | 0F B1 E4 C1 1F C8 40 1C EA CA 39 F4 AE C5 49 99
|
||||
00A0 | C8 90 A4 E0 AF 7C 78 F3 73 C8 5A 53 80 16 8F 87
|
||||
00B0 | F2 E5 BA 50 6E 0F 8B 7C E6 EA AD 7C 50 41 A0 57
|
||||
00C0 | C4 C5 CF 83 B1 76 12 5A 46 49 D6 8D 20 43 C4 D6
|
||||
00D0 | 43 7F 36 DB D0 89 74 D7 70 7E 5C 24 AD 8C 7F 86
|
||||
00E0 | A3 7F 00 53 84 4D C9 09 94 D2 00 70 BD 42 02 1C
|
||||
00F0 | 75 00 20 81 BB 63 25 81 6B 17 E1 F1 2C A4 0D 3B
|
||||
0100 | 9A 89 1C 1C 90 EC 9A CB C3 1C 61 05 2A 37 29 75
|
||||
0110 | DB 90 7F A6 18 A7 F4 31 4B 02 70 85 DC 70 CE 77
|
||||
0120 | 7B 98 2D F6 C6 2A 9D E2 38 77 CE F9 20 C8 4D 55</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 = BA0D89B59A5BA41B3D34520597274DF2D377B5202D4F3BFCC9F3A6C2D6A5FD9613D8979
|
|||
<tr>
|
||||
<td>nonce</td>
|
||||
<td>4, 16</td>
|
||||
<td><code>9A5BA41B3D34520597274DF2D377B520</code></td>
|
||||
<td><code>D7FB5BD84FC931BBD2BAC265E1E8CF08</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>20, 16</td>
|
||||
<td><code>2D4F3BFCC9F3A6C2D6A5FD9613D8979B</code></td>
|
||||
<td><code>7AF2D212200839DE08BDD4C62022181A</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>g_b</td>
|
||||
<td>36, 260</td>
|
||||
<td><code>FE000100905BB047A141C068AD842712</code> <code>94378C6A5D7BE8A079C83FAF527490FF</code> <code>7E24A6C865C88B3EA86524E0D3DC831C</code> <code>CD98429AFFE729C3BBDDE4F194623C99</code> <code>8D79DFCFD26E79D84528F61E8BCAF892</code> <code>88A6464F7D7A60026BA6AEA4C4932F17</code> <code>A2798F0202D7B9F94D791878E362865B</code> <code>8069CFEFD78B9B7DAE75A5D68C811C20</code> <code>7F2BBE19DC2B72967735BB6E1EED93AD</code> <code>2BAE379C88582CC0970AC79A62D7CE5B</code> <code>A31195709E13E0F84E950EDF4B85E1BF</code> <code>1EE5109E933C4E0DA0822BC20B0EB2EB</code> <code>55D8EBF8C14CD143627B9D3BCCF10757</code> <code>57E0EB369F9BA42FC2036D89B77B6546</code> <code>D3E7EB6E62CBEF6A5B1B9B562A9DA9D4</code> <code>2C6DA2DC0B8C94D9A303976286709963</code><br> <code>68961C97</code></td>
|
||||
<td><code>FE0001002AF9C55C56C3B623F701EDB7</code> <code>FE2ACAA654B517AF1FBC7F7EF022E6EF</code> <code>044B1619C16873C60A9A5DE2D7086AD8</code> <code>20A2FDCFDA11AD1746569B807C494443</code> <code>07D1C69313F8E85C019C1CE6410172EE</code> <code>05308C80CAA9EC80B89B7136E54EB216</code> <code>C2EF30200FB1E4C11FC8401CEACA39F4</code> <code>AEC54999C890A4E0AF7C78F373C85A53</code> <code>80168F87F2E5BA506E0F8B7CE6EAAD7C</code> <code>5041A057C4C5CF83B176125A4649D68D</code> <code>2043C4D6437F36DBD08974D7707E5C24</code> <code>AD8C7F86A37F0053844DC90994D20070</code> <code>BD42021C75002081BB6325816B17E1F1</code> <code>2CA40D3B9A891C1C90EC9ACBC31C6105</code> <code>2A372975DB907FA618A7F4314B027085</code> <code>DC70CE777B982DF6C62A9DE23877CEF9</code><br> <code>20C84D55</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 = BA0D89B59A5BA41B3D34520597274DF2D377B5202D4F3BFCC9F3A6C2D6A5FD9613D8979
|
|||
<!-- 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 = 54B643669A5BA41B3D34520597274DF2D377B5202D4F3BFCC9F3A6C2D6A5FD9613D8979B0000000000000000FE000100905BB047A141C068AD84271294378C6A5D7BE8A079C83FAF527490FF7E24A6C865C88B3EA86524E0D3DC831CCD98429AFFE729C3BBDDE4F194623C998D79DFCFD26E79D84528F61E8BCAF89288A6464F7D7A60026BA6AEA4C4932F17A2798F0202D7B9F94D791878E362865B8069CFEFD78B9B7DAE75A5D68C811C207F2BBE19DC2B72967735BB6E1EED93AD2BAE379C88582CC0970AC79A62D7CE5BA31195709E13E0F84E950EDF4B85E1BF1EE5109E933C4E0DA0822BC20B0EB2EB55D8EBF8C14CD143627B9D3BCCF1075757E0EB369F9BA42FC2036D89B77B6546D3E7EB6E62CBEF6A5B1B9B562A9DA9D42C6DA2DC0B8C94D9A30397628670996368961C97
|
||||
padding = 0BD0253E3F500BA4BB7D7226
|
||||
tmp_aes_key = 43304FF1FC6B7BAF07DB39696A08365AB6194F59460F1E6C4B1605F765C86676
|
||||
tmp_aes_iv = 1F93981C89E1ADACE692CC4BDBD2738BA309C47BDCB3B90907074E7CF19B1937</code></pre>
|
||||
<pre><code>data = 54B64366D7FB5BD84FC931BBD2BAC265E1E8CF087AF2D212200839DE08BDD4C62022181A0000000000000000FE0001002AF9C55C56C3B623F701EDB7FE2ACAA654B517AF1FBC7F7EF022E6EF044B1619C16873C60A9A5DE2D7086AD820A2FDCFDA11AD1746569B807C49444307D1C69313F8E85C019C1CE6410172EE05308C80CAA9EC80B89B7136E54EB216C2EF30200FB1E4C11FC8401CEACA39F4AEC54999C890A4E0AF7C78F373C85A5380168F87F2E5BA506E0F8B7CE6EAAD7C5041A057C4C5CF83B176125A4649D68D2043C4D6437F36DBD08974D7707E5C24AD8C7F86A37F0053844DC90994D20070BD42021C75002081BB6325816B17E1F12CA40D3B9A891C1C90EC9ACBC31C61052A372975DB907FA618A7F4314B027085DC70CE777B982DF6C62A9DE23877CEF920C84D55
|
||||
padding = D65E8D012EC849E28D4C7D07
|
||||
tmp_aes_key = 259A2243E880E7DDBD9493DBC32594F32EA11EDC02ED3D31EBF559CB234B3B2C
|
||||
tmp_aes_iv = 5F6767C06344242E1213C17A87D0AF70E29E57648D2C4CB618F46EB22E80D57A</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 = 426EBB1B144CBE678B2C46B0B1B1A9BC931CFE43A7B2470F944DB414429067B3E0154ECB3B08DAB0822BBAD3790B70EFAEBB172202DABC0042B84D60A1113055B447913E5214B0A10743A1130C25DFCF848A62F9B060D30D522DA5812AACF6BED88CFA4AC06398BF1584845855445CA46DAEB747A8C47710EF9CBDC8FF515F7B9DD9BFB14ADFC07E518F58438189E4A2CD6312F08E50A79FCE91E51900B308FE096E9802AF6D82C39AE0C5E43BAEF94BB3539749CE7894C7CD420FC0CA3123811D15A7A42961F256686FBA6E6ED80320C98EC6FADB8EF47FDD175A9540BF19A022B18CE4F8A8E995010FB4E285E2FE8FD05D97B6D6BF2F9ED786DC5E7915BEFA38EF2807E2587DE16E224ABD3C13C99F506A510297EF667405AAD9589D6EAD121D5669844EA71FACFD1C511E37EBEF81F6D5006D75736940C8A06F407DCF8D86E173A904F6E1A9F3B738DA1FFDC29C29</code></pre>
|
||||
<pre><code>encrypted_data = E7CAB87A0B99BDC31A1EB4E81D7B575797B0AB014115AE68BD08ADD8299D293A1E68B82202E1F05DC8F131D4C500DEB7AD9CA96021F849A7B7AD4D1138ACD37C196B98B5CB7BDF75660994B7F46EBA4A906767EDD1829EDDEF9CC113C7906568D946659844E180352B7A424EA2F4D3555F3A74F39211A980DCCBA484C6C78FCCB60E1A190036B9EF7CB07B7F82021EA4B4F93BEEDDBA4F61E7371C8E324BD3F80F4E4A4B818CAB35A31F7C63D171E83C90DD10E5FEC1485306FB2AC21E2AD3A25FC306C358DDB495ED5CB71B0B39607B00CD275EA60399E06BDBF80F0CCE8C37D1B6EFC1D6CA9B0FCFFE134772CE1741F0A58EAD80CF78D0095BA8E81CFC715C05AE752229765D053DE98598062AB1FE8127D64C93CDDB237038B2322D032FDDB6E2B88B879EEC150052740BCF7E5AE49AC1F4B588C516CB60F0BBF39EEE9F15FC56C310B5A8ADE548DE6C6ABD3FB105</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 FE 0C 00 03 D7 38 67
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 9A 5B A4 1B 3D 34 52 05
|
||||
0020 | 97 27 4D F2 D3 77 B5 20 2D 4F 3B FC C9 F3 A6 C2
|
||||
0030 | D6 A5 FD 96 13 D8 97 9B FE 50 01 00 42 6E BB 1B
|
||||
0040 | 14 4C BE 67 8B 2C 46 B0 B1 B1 A9 BC 93 1C FE 43
|
||||
0050 | A7 B2 47 0F 94 4D B4 14 42 90 67 B3 E0 15 4E CB
|
||||
0060 | 3B 08 DA B0 82 2B BA D3 79 0B 70 EF AE BB 17 22
|
||||
0070 | 02 DA BC 00 42 B8 4D 60 A1 11 30 55 B4 47 91 3E
|
||||
0080 | 52 14 B0 A1 07 43 A1 13 0C 25 DF CF 84 8A 62 F9
|
||||
0090 | B0 60 D3 0D 52 2D A5 81 2A AC F6 BE D8 8C FA 4A
|
||||
00A0 | C0 63 98 BF 15 84 84 58 55 44 5C A4 6D AE B7 47
|
||||
00B0 | A8 C4 77 10 EF 9C BD C8 FF 51 5F 7B 9D D9 BF B1
|
||||
00C0 | 4A DF C0 7E 51 8F 58 43 81 89 E4 A2 CD 63 12 F0
|
||||
00D0 | 8E 50 A7 9F CE 91 E5 19 00 B3 08 FE 09 6E 98 02
|
||||
00E0 | AF 6D 82 C3 9A E0 C5 E4 3B AE F9 4B B3 53 97 49
|
||||
00F0 | CE 78 94 C7 CD 42 0F C0 CA 31 23 81 1D 15 A7 A4
|
||||
0100 | 29 61 F2 56 68 6F BA 6E 6E D8 03 20 C9 8E C6 FA
|
||||
0110 | DB 8E F4 7F DD 17 5A 95 40 BF 19 A0 22 B1 8C E4
|
||||
0120 | F8 A8 E9 95 01 0F B4 E2 85 E2 FE 8F D0 5D 97 B6
|
||||
0130 | D6 BF 2F 9E D7 86 DC 5E 79 15 BE FA 38 EF 28 07
|
||||
0140 | E2 58 7D E1 6E 22 4A BD 3C 13 C9 9F 50 6A 51 02
|
||||
0150 | 97 EF 66 74 05 AA D9 58 9D 6E AD 12 1D 56 69 84
|
||||
0160 | 4E A7 1F AC FD 1C 51 1E 37 EB EF 81 F6 D5 00 6D
|
||||
0170 | 75 73 69 40 C8 A0 6F 40 7D CF 8D 86 E1 73 A9 04
|
||||
0180 | F6 E1 A9 F3 B7 38 DA 1F FD C2 9C 29</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 80 92 0E 00 21 E5 38 67
|
||||
0010 | 78 01 00 00 1F 5F 04 F5 D7 FB 5B D8 4F C9 31 BB
|
||||
0020 | D2 BA C2 65 E1 E8 CF 08 7A F2 D2 12 20 08 39 DE
|
||||
0030 | 08 BD D4 C6 20 22 18 1A FE 50 01 00 E7 CA B8 7A
|
||||
0040 | 0B 99 BD C3 1A 1E B4 E8 1D 7B 57 57 97 B0 AB 01
|
||||
0050 | 41 15 AE 68 BD 08 AD D8 29 9D 29 3A 1E 68 B8 22
|
||||
0060 | 02 E1 F0 5D C8 F1 31 D4 C5 00 DE B7 AD 9C A9 60
|
||||
0070 | 21 F8 49 A7 B7 AD 4D 11 38 AC D3 7C 19 6B 98 B5
|
||||
0080 | CB 7B DF 75 66 09 94 B7 F4 6E BA 4A 90 67 67 ED
|
||||
0090 | D1 82 9E DD EF 9C C1 13 C7 90 65 68 D9 46 65 98
|
||||
00A0 | 44 E1 80 35 2B 7A 42 4E A2 F4 D3 55 5F 3A 74 F3
|
||||
00B0 | 92 11 A9 80 DC CB A4 84 C6 C7 8F CC B6 0E 1A 19
|
||||
00C0 | 00 36 B9 EF 7C B0 7B 7F 82 02 1E A4 B4 F9 3B EE
|
||||
00D0 | DD BA 4F 61 E7 37 1C 8E 32 4B D3 F8 0F 4E 4A 4B
|
||||
00E0 | 81 8C AB 35 A3 1F 7C 63 D1 71 E8 3C 90 DD 10 E5
|
||||
00F0 | FE C1 48 53 06 FB 2A C2 1E 2A D3 A2 5F C3 06 C3
|
||||
0100 | 58 DD B4 95 ED 5C B7 1B 0B 39 60 7B 00 CD 27 5E
|
||||
0110 | A6 03 99 E0 6B DB F8 0F 0C CE 8C 37 D1 B6 EF C1
|
||||
0120 | D6 CA 9B 0F CF FE 13 47 72 CE 17 41 F0 A5 8E AD
|
||||
0130 | 80 CF 78 D0 09 5B A8 E8 1C FC 71 5C 05 AE 75 22
|
||||
0140 | 29 76 5D 05 3D E9 85 98 06 2A B1 FE 81 27 D6 4C
|
||||
0150 | 93 CD DB 23 70 38 B2 32 2D 03 2F DD B6 E2 B8 8B
|
||||
0160 | 87 9E EC 15 00 52 74 0B CF 7E 5A E4 9A C1 F4 B5
|
||||
0170 | 88 C5 16 CB 60 F0 BB F3 9E EE 9F 15 FC 56 C3 10
|
||||
0180 | B5 A8 AD E5 48 DE 6C 6A BD 3F B1 05</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>FCFE0C0003D73867</code></td>
|
||||
<td><code>80920E0021E53867</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>9A5BA41B3D34520597274DF2D377B520</code></td>
|
||||
<td><code>D7FB5BD84FC931BBD2BAC265E1E8CF08</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>2D4F3BFCC9F3A6C2D6A5FD9613D8979B</code></td>
|
||||
<td><code>7AF2D212200839DE08BDD4C62022181A</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encrypted_data</td>
|
||||
<td>56, 340</td>
|
||||
<td><code>FE500100426EBB1B144CBE678B2C46B0</code> <code>B1B1A9BC931CFE43A7B2470F944DB414</code> <code>429067B3E0154ECB3B08DAB0822BBAD3</code> <code>790B70EFAEBB172202DABC0042B84D60</code> <code>A1113055B447913E5214B0A10743A113</code> <code>0C25DFCF848A62F9B060D30D522DA581</code> <code>2AACF6BED88CFA4AC06398BF15848458</code> <code>55445CA46DAEB747A8C47710EF9CBDC8</code> <code>FF515F7B9DD9BFB14ADFC07E518F5843</code> <code>8189E4A2CD6312F08E50A79FCE91E519</code> <code>00B308FE096E9802AF6D82C39AE0C5E4</code> <code>3BAEF94BB3539749CE7894C7CD420FC0</code> <code>CA3123811D15A7A42961F256686FBA6E</code> <code>6ED80320C98EC6FADB8EF47FDD175A95</code> <code>40BF19A022B18CE4F8A8E995010FB4E2</code> <code>85E2FE8FD05D97B6D6BF2F9ED786DC5E</code> <code>7915BEFA38EF2807E2587DE16E224ABD</code> <code>3C13C99F506A510297EF667405AAD958</code> <code>9D6EAD121D5669844EA71FACFD1C511E</code> <code>37EBEF81F6D5006D75736940C8A06F40</code> <code>7DCF8D86E173A904F6E1A9F3B738DA1F</code><br> <code>FDC29C29</code></td>
|
||||
<td><code>FE500100E7CAB87A0B99BDC31A1EB4E8</code> <code>1D7B575797B0AB014115AE68BD08ADD8</code> <code>299D293A1E68B82202E1F05DC8F131D4</code> <code>C500DEB7AD9CA96021F849A7B7AD4D11</code> <code>38ACD37C196B98B5CB7BDF75660994B7</code> <code>F46EBA4A906767EDD1829EDDEF9CC113</code> <code>C7906568D946659844E180352B7A424E</code> <code>A2F4D3555F3A74F39211A980DCCBA484</code> <code>C6C78FCCB60E1A190036B9EF7CB07B7F</code> <code>82021EA4B4F93BEEDDBA4F61E7371C8E</code> <code>324BD3F80F4E4A4B818CAB35A31F7C63</code> <code>D171E83C90DD10E5FEC1485306FB2AC2</code> <code>1E2AD3A25FC306C358DDB495ED5CB71B</code> <code>0B39607B00CD275EA60399E06BDBF80F</code> <code>0CCE8C37D1B6EFC1D6CA9B0FCFFE1347</code> <code>72CE1741F0A58EAD80CF78D0095BA8E8</code> <code>1CFC715C05AE752229765D053DE98598</code> <code>062AB1FE8127D64C93CDDB237038B232</code> <code>2D032FDDB6E2B88B879EEC150052740B</code> <code>CF7E5AE49AC1F4B588C516CB60F0BBF3</code> <code>9EEE9F15FC56C310B5A8ADE548DE6C6A</code><br> <code>BD3FB105</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 = 5FFE49378BD08A285BFF82C7787F8354BC133BC9CF09FD890BD00DAB488ADAD1AFB5405293674191DEB60C7DAF5E93C54C3DF3E50A5B86C843C9C0637F1AC0551B5134DCDDDA2A71CF4F2F08440C8DF31BE6499A24A9B5A5D1D3192780EE1421F1C2E4878229C1420C5B28087EFB0F7597F8DE0D3C4D3D4D8714702E905C4E1ACBF256B920CC32D81825678652FA0CE1252B285110602F2B478A19F94CBBFCCA2729100279494FFA6286FA3B169415836EBB7B4CB4CF3548E33AA5AFC385B472057EF22782FA5E4C4F1F6270568C6328357A35D146249B09DC3A91FFDFC849B09EBCC7D45891E856AFA122175DC210D6F317C92E15DAD7806EBF940BF005D415</code></pre>
|
||||
<pre><code>auth_key = 9CCE6E54DF8B505A8519988B228FA7CEC3B4BBA9A0E20ED84081F54731E79BFF662B907A08ED1E84B5D4CED6CE4C0D30FEAA3818E3E9510AC306FDB802F23F82BE71FD265D9F9ACE38A807EF6AFFA933D160D924B5C12FBA1A74F781FF16D547DC2D545927770A8DBDFE65B1E1F5E1E5586DE7AD05ABC2380824952468253EC9243C43C5EC3BC45D58646D5AECA4D7D25A7B186F40B9573155510212CE985E582A9F4342390ADEB0812D6CCC8DCA51B5FF3B6ECD918542C933CE27EB6AB67097801ECDCC7D49EF8009CF37E6EDC6438BB246E32C4F386FEC5A8C73EEFCE98B543F16B64F8B00BE6AD111060F80BBE9AE0C9716847757E08402B9784C46DBD4A8</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 38 7C 3A 05 D7 38 67
|
||||
0010 | 34 00 00 00 34 F7 CB 3B 9A 5B A4 1B 3D 34 52 05
|
||||
0020 | 97 27 4D F2 D3 77 B5 20 2D 4F 3B FC C9 F3 A6 C2
|
||||
0030 | D6 A5 FD 96 13 D8 97 9B 0B 93 97 1B C6 80 0E 7F
|
||||
0040 | 47 A3 6E DE 1A D3 0B 58</code></pre>
|
||||
<pre><code>0000 | 00 00 00 00 00 00 00 00 01 88 C3 D0 23 E5 38 67
|
||||
0010 | 34 00 00 00 34 F7 CB 3B D7 FB 5B D8 4F C9 31 BB
|
||||
0020 | D2 BA C2 65 E1 E8 CF 08 7A F2 D2 12 20 08 39 DE
|
||||
0030 | 08 BD D4 C6 20 22 18 1A 61 A6 81 35 8C 40 90 D2
|
||||
0040 | 36 5A 5F 76 F1 38 12 85</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,7 +817,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>01387C3A05D73867</code></td>
|
||||
<td><code>0188C3D023E53867</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>
|
||||
|
@ -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>9A5BA41B3D34520597274DF2D377B520</code></td>
|
||||
<td><code>D7FB5BD84FC931BBD2BAC265E1E8CF08</code></td>
|
||||
<td>Value generated by client in Step 1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>server_nonce</td>
|
||||
<td>40, 16</td>
|
||||
<td><code>2D4F3BFCC9F3A6C2D6A5FD9613D8979B</code></td>
|
||||
<td><code>7AF2D212200839DE08BDD4C62022181A</code></td>
|
||||
<td>Value received from server in Step 2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>new_nonce_hash1</td>
|
||||
<td>56, 16</td>
|
||||
<td><code>0B93971BC6800E7F47A36EDE1AD30B58</code></td>
|
||||
<td><code>61A681358C4090D2365A5F76F1381285</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>
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td><a href="/constructor/inputInvoiceStars">inputInvoiceStars</a></td>
|
||||
<td>Used to top up the <a href="/api/stars">Telegram Stars</a> balance of the current account or someone else's account.</td>
|
||||
<td>Used to top up the <a href="/api/stars">Telegram Stars</a> balance of the current account or someone else's account, or to start a <a href="/api/giveaways#star-giveaways">Telegram Star giveaway »</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="/constructor/inputInvoiceChatInviteSubscription">inputInvoiceChatInviteSubscription</a></td>
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td><a href="/constructor/inputStorePaymentStarsGiveaway">inputStorePaymentStarsGiveaway</a></td>
|
||||
<td> </td>
|
||||
<td>Used to pay for a <a href="/api/giveaways#star-giveaways">star giveaway, see here »</a> for more info.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
|
|
Loading…
Add table
Reference in a new issue