diff --git a/data/web/corefork.telegram.org/api/auth.html b/data/web/corefork.telegram.org/api/auth.html index 3c1ae72b38..8769be098a 100644 --- a/data/web/corefork.telegram.org/api/auth.html +++ b/data/web/corefork.telegram.org/api/auth.html @@ -207,14 +207,33 @@ After obtaining the ID token, call account

If the user cannot access their email address, an email reset may be requested using auth.resetLoginEmail.

To change the login email after login, pass emailVerifyPurposeLoginChange as purpose, following the exact same Google ID/Apple ID/email code login flow as above: on success, the account.verifyEmail method will return an account.emailVerified constructor.

-

Sign in/sign up

+

Sign in/sign up

When user enters verification code, the auth.signIn method must be used to validate it and possibly sign user in.

If the code was entered correctly, but the method returns auth.authorizationSignUpRequired, it means that account with this phone number doesn't exist yet: user needs to provide basic information, accept terms of service and then the new user registration method (auth.signUp) must be invoked.

2FA

When trying to sign in using auth.signIn, an error 400 SESSION_PASSWORD_NEEDED may be returned, if the user has two-factor authentication enabled. In this case, instructions for SRP 2FA authentication must be followed.

To set up two-factor authorization on an already authorized account, follow the SRP 2FA authentication docs.

-

Test Accounts

+

Confirming login

+
authorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true password_pending:flags.2?true encrypted_requests_disabled:flags.3?true call_requests_disabled:flags.4?true unconfirmed:flags.5?true hash:long device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization;
+
+account.authorizations#4bff8ea0 authorization_ttl_days:int authorizations:Vector<Authorization> = account.Authorizations;
+
+updateNewAuthorization#8951abef flags:# unconfirmed:flags.0?true hash:long date:flags.0?int device:flags.0?string location:flags.0?string = Update;
+
+---functions---
+
+account.getAuthorizations#e320c158 = account.Authorizations;
+
+account.changeAuthorizationSettings#40f48462 flags:# confirmed:flags.3?true hash:long encrypted_requests_disabled:flags.0?Bool call_requests_disabled:flags.1?Bool = Bool;
+
+account.resetAuthorization#df77f3bc hash:long = Bool;
+

When logging in, other logged-in sessions will receive an updateNewAuthorization update.
+If the unconfirmed flag is set, clients should display a notification, asking the user if they recognize the session.

+

If the user clicks on the Yes button, invoke account.changeAuthorizationSettings with the new session's hash and the confirmed flag set, confirming the specified session.

+

If the user clicks on the No button, invoke account.resetAuthorization with the new session's hash, logging out the specified session.

+

If no action is taken by the user, the session will be autoconfirmed authorization_autoconfirm_period seconds after login (see the associated client configuration parameter »).

+

Test Accounts

Each phone number is limited to only a certain amount of logins per day (e.g. 5, but this is subject to change) after which the API will return a FLOOD error until the next day. This might not be enough for testing the implementation of User Authorization flows in client applications.

There are several reserved phone number prefixes for testing that your application handles redirects between DCs, sign up, sign in and 2FA flows correctly. These numbers are only available on Test DCs (their IP addresses for TCP transport are available in API development tools panel after api_id was obtained, URI format for HTTPS/WebSocket transport).

If you wish to emulate an application of a user associated with DC number X, it is sufficient to specify the phone number as 99966XYYYY, where YYYY are random numbers, when registering the user. A user like this would always get XXXXX as the login confirmation code (the DC number, repeated five times). Note that the value of X must be in the range of 1-3 because there are only 3 Test DCs. When the flood limit is reached for any particular test number, just choose another number (changing the YYYY random part).

diff --git a/data/web/corefork.telegram.org/api/config.html b/data/web/corefork.telegram.org/api/config.html index 5f984a35c2..2b147de71f 100644 --- a/data/web/corefork.telegram.org/api/config.html +++ b/data/web/corefork.telegram.org/api/config.html @@ -460,12 +460,14 @@ Note that the stickerset can be fetched using large_queue_max_active_operations_count

A soft limit, specifying the maximum number of files that should be downloaded in parallel from the same DC, for files bigger than 20MB. (integer)

authorization_autoconfirm_period

+

An unconfirmed session » will be autoconfirmed this many seconds after login. (integer)

story_viewers_expire_period

The exact list of users that viewed the story will be hidden from the poster this many seconds after the story expires. (integer)

This limit applies only to non-Premium users, Premium users can always access the viewer list.

story_expiring_limit_default

-

The maximum number of active stories

+

The maximum number of active stories for non-Premium users (integer).

story_expiring_limit_premium

+

The maximum number of active stories for Premium users (integer).

story_caption_length_limit_premium

The maximum UTF-8 length of story captions for Premium users. (integer)

story_caption_length_limit_default

diff --git a/data/web/corefork.telegram.org/api/layers.html b/data/web/corefork.telegram.org/api/layers.html index a5d5c8f692..bf5870fa8a 100644 --- a/data/web/corefork.telegram.org/api/layers.html +++ b/data/web/corefork.telegram.org/api/layers.html @@ -1789,7 +1789,7 @@ Also, discussion group admins can now messages.saveDefaultSendAs - Change the default peer that should be used when sending messages to a specific group
  • Added channels.getSendAs - Obtains a list of peers that can be used to send messages in a specific group
  • Added account.setAuthorizationTTL - Set time-to-live of current session
  • -
  • Added account.changeAuthorizationSettings - Change settings related to the current session.
  • +
  • Added account.changeAuthorizationSettings - Change settings related to a session.
  • Added channels.deleteParticipantHistory - Delete all messages sent by a specific participant of a given supergroup
  • Changed Methods
    diff --git a/data/web/corefork.telegram.org/constructor/authorization.html b/data/web/corefork.telegram.org/constructor/authorization.html index 82296d735a..b37fa11743 100644 --- a/data/web/corefork.telegram.org/constructor/authorization.html +++ b/data/web/corefork.telegram.org/constructor/authorization.html @@ -99,7 +99,7 @@ unconfirmed flags.5?true -  +Whether the session is unconfirmed, see here » for more info. hash diff --git a/data/web/corefork.telegram.org/constructor/updateNewAuthorization.html b/data/web/corefork.telegram.org/constructor/updateNewAuthorization.html index 7e96d0453c..730e095919 100644 --- a/data/web/corefork.telegram.org/constructor/updateNewAuthorization.html +++ b/data/web/corefork.telegram.org/constructor/updateNewAuthorization.html @@ -74,7 +74,7 @@ unconfirmed flags.0?true -  +Whether the session is unconfirmed, see here » for more info. hash diff --git a/data/web/corefork.telegram.org/mtproto/samples-auth_key.html b/data/web/corefork.telegram.org/mtproto/samples-auth_key.html index e1b00e1a68..986aedbb80 100644 --- a/data/web/corefork.telegram.org/mtproto/samples-auth_key.html +++ b/data/web/corefork.telegram.org/mtproto/samples-auth_key.html @@ -53,9 +53,9 @@
    1) Client sends query to server

    Sent payload (excluding transport headers/trailers):

    -
    0000 | 00 00 00 00 00 00 00 00 3C 06 03 00 A7 E3 53 65
    -0010 | 14 00 00 00 F1 8E 7E BE 87 54 F2 3A B4 CF 8B 0A
    -0020 | 3C 1A 5F 51 8A B8 E7 94
    +
    0000 | 00 00 00 00 00 00 00 00 1C 38 09 00 77 2F 55 65
    +0010 | 14 00 00 00 F1 8E 7E BE 2E 43 2C 2D 21 17 81 12
    +0020 | 6D A7 CE 6E F1 B7 45 6B

    Payload (de)serialization:

    req_pq_multi#be7e8ef1 nonce:int128 = ResPQ;
    @@ -77,7 +77,7 @@ - + @@ -95,7 +95,7 @@ - + @@ -104,11 +104,11 @@
    2) Server sends response of the form

    Received payload (excluding transport headers/trailers):

    -
    0000 | 00 00 00 00 00 00 00 00 01 F4 4B 4C A7 E3 53 65
    -0010 | 80 00 00 00 63 24 16 05 87 54 F2 3A B4 CF 8B 0A
    -0020 | 3C 1A 5F 51 8A B8 E7 94 71 35 4E 3E 4E 79 EA 40
    -0030 | FF 69 78 AC 3E 15 77 69 08 29 52 0D D9 C5 1D 69
    -0040 | 4F 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
    +
    0000 | 00 00 00 00 00 00 00 00 01 EC 39 27 77 2F 55 65
    +0010 | 84 00 00 00 63 24 16 05 2E 43 2C 2D 21 17 81 12
    +0020 | 6D A7 CE 6E F1 B7 45 6B 3F BD 31 0C 0C C8 47 30
    +0030 | 39 A6 A5 A4 4C 02 D5 01 08 0E 20 2E 1B F7 E4 D0
    +0040 | E1 00 00 00 15 C4 B5 1C 03 00 00 00 A5 B7 F7 09
     0050 | 35 5F C3 0B 21 6B E8 6C 02 2B B4 C3 85 FD 64 DE
     0060 | 85 1D 9D D0

    Payload (de)serialization:

    @@ -132,13 +132,13 @@
    - + - + @@ -150,19 +150,19 @@ - + - + - + @@ -208,22 +208,22 @@

    Proof of work

    3) Client decomposes pq into prime factors such that p < q.
    -
    pq = 2977457532611422543
    -

    Decompose into 2 prime cofactors p < q: 2977457532611422543 = 1615862537 * 1842642839

    -
    p = 1615862537
    -q = 1842642839
    +
    pq = 1017864213443694817
    +

    Decompose into 2 prime cofactors p < q: 1017864213443694817 = 1001404913 * 1016436209

    +
    p = 1001404913
    +q = 1016436209

    Presenting proof of work; Server authentication

    4) encrypted_data payload generation

    First of all, generate an encrypted_data payload as follows:

    Generated payload (excluding transport headers/trailers):

    -
    0000 | 95 5F F5 A9 08 29 52 0D D9 C5 1D 69 4F 00 00 00
    -0010 | 04 60 50 1B 09 00 00 00 04 6D D4 7F 97 00 00 00
    -0020 | 87 54 F2 3A B4 CF 8B 0A 3C 1A 5F 51 8A B8 E7 94
    -0030 | 71 35 4E 3E 4E 79 EA 40 FF 69 78 AC 3E 15 77 69
    -0040 | 0F 0D 2B E2 18 FC AE 41 EB 36 96 6E 36 E7 D9 6D
    -0050 | E1 80 E7 41 84 A6 E9 CF 1D 70 2C 59 54 E2 DF A0
    +
    0000 | 95 5F F5 A9 08 0E 20 2E 1B F7 E4 D0 E1 00 00 00
    +0010 | 04 3B B0 39 F1 00 00 00 04 3C 95 95 F1 00 00 00
    +0020 | 2E 43 2C 2D 21 17 81 12 6D A7 CE 6E F1 B7 45 6B
    +0030 | 3F BD 31 0C 0C C8 47 30 39 A6 A5 A4 4C 02 D5 01
    +0040 | D2 99 14 0C 54 81 B8 DB C3 F0 00 65 1A E0 14 AF
    +0050 | E6 24 2C CA 50 6B DE 69 E7 81 62 68 FB 33 D4 12
     0060 | 02 00 00 00

    Payload (de)serialization:

    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;
    @@ -246,37 +246,37 @@ q = 1842642839
    - + - + - + - + - + - + @@ -291,39 +291,39 @@ q = 1842642839

    The serialization of P_Q_inner_data produces data, which is used to generate encrypted_data as specified in step 4.1.
    These are the inputs to the algorithm specified in step 4.1:

    -
    data = 955FF5A90829520DD9C51D694F0000000460501B09000000046DD47F970000008754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E1577690F0D2BE218FCAE41EB36966E36E7D96DE180E74184A6E9CF1D702C5954E2DFA002000000
    -random_padding_bytes = 3C38DC7F98BD7A9156B1A7D60D372FCB8FF2B4E45C1B0614F736E3BD3F0006A060FED8C7399A4BEE95BE25C2DD9E9EA9960FA2C367D219A36FB7BD1B4D12A0DBD9DCED0348DCE0ABE7C09B5E86A5CEBAFDC6281ED38A537B5D9772A1
    +
    data = 955FF5A9080E202E1BF7E4D0E1000000043BB039F1000000043C9595F10000002E432C2D211781126DA7CE6EF1B7456B3FBD310C0CC8473039A6A5A44C02D501D299140C5481B8DBC3F000651AE014AFE6242CCA506BDE69E7816268FB33D41202000000
    +random_padding_bytes = 305965C61DC018BF689D32636FBF4317C63006AE347C04B7279503139A5A02DF90B5F5F7BAA235BF79570D0C8621B252257CCCC42887DE397F83B42A653BBBB1182AE0AD93FCD9E0B8FCFCA49CFC3E077EDF9E82AE1DB2AD01ECC716

    And this is the output:

    -
    encrypted_data = 48C017F4BBC9DF6717A695D2F76B9515B6A08DE23C9ECB2661AA22D6717B005E6345B7E48FF3837A30285841F8A4B236532E2E48F56486F934ADCA245370C4E00F0FDAF2CA001F0BB6F92BF8532D35B1EBD062B743F902BBCA9AEE371F749682B9A5EFAFEB5B03B21C00DED5EF54B1B287A592911FC984D1A6C45E26BB26A0A6D194887F3A5EB829AE9D32297782632EE1ABECF61DDDBBD70341E32E98AE3032DCCDCDA817EA7C035046267DE0A715673C8353CC95594520BD850654A0DABF78F842C075DD652955B870A301F6F48A158D453A96D66FD2490E5DC648506DBA6223E69CDF35A5C4D1D51A574BE1A716DA24872FFEE84F5BB8E8293B8501B2C8BF
    +
    encrypted_data = 23ECB4204C6BE286A6DCA7DE73830B70209CB289052882E50682CC3F0BFAE7CCB92FA4E683A1FE06DF8CFA2A01BEA507DEE569A88A1CE8674DEABFE57125A66BC0CDD114DED3918D49C22B778704DBFA2AE73F7C52CB0B6989F0296601347F0659F337633BA09C8AA9CDB08F4162D61FD3B70A0E19316BFD919BEACBC39EFF7B0A80B8FECEEC345F82C637A0FB647A707007EE552F98577969BD0C1930F7010E344695FF0A51B4E6435172259159C7D2E128B14B3368E070006E30CF15AEFCF695E80F66E539AEFE48A74A9AEF17737F9C1437D1ED41A005F52C7ABBB955921639EF62AD3DA0B07AA38B88766290DB1FA2651DBC85EBD747AC363572BAB76AFA

    The length of the final string is 256 bytes.

    5) Send req_DH_params query with generated encrypted_data

    Sent payload (excluding transport headers/trailers):

    -
    0000 | 00 00 00 00 00 00 00 00 40 06 03 00 A7 E3 53 65
    -0010 | 40 01 00 00 BE E4 12 D7 87 54 F2 3A B4 CF 8B 0A
    -0020 | 3C 1A 5F 51 8A B8 E7 94 71 35 4E 3E 4E 79 EA 40
    -0030 | FF 69 78 AC 3E 15 77 69 04 60 50 1B 09 00 00 00
    -0040 | 04 6D D4 7F 97 00 00 00 85 FD 64 DE 85 1D 9D D0
    -0050 | FE 00 01 00 48 C0 17 F4 BB C9 DF 67 17 A6 95 D2
    -0060 | F7 6B 95 15 B6 A0 8D E2 3C 9E CB 26 61 AA 22 D6
    -0070 | 71 7B 00 5E 63 45 B7 E4 8F F3 83 7A 30 28 58 41
    -0080 | F8 A4 B2 36 53 2E 2E 48 F5 64 86 F9 34 AD CA 24
    -0090 | 53 70 C4 E0 0F 0F DA F2 CA 00 1F 0B B6 F9 2B F8
    -00A0 | 53 2D 35 B1 EB D0 62 B7 43 F9 02 BB CA 9A EE 37
    -00B0 | 1F 74 96 82 B9 A5 EF AF EB 5B 03 B2 1C 00 DE D5
    -00C0 | EF 54 B1 B2 87 A5 92 91 1F C9 84 D1 A6 C4 5E 26
    -00D0 | BB 26 A0 A6 D1 94 88 7F 3A 5E B8 29 AE 9D 32 29
    -00E0 | 77 82 63 2E E1 AB EC F6 1D DD BB D7 03 41 E3 2E
    -00F0 | 98 AE 30 32 DC CD CD A8 17 EA 7C 03 50 46 26 7D
    -0100 | E0 A7 15 67 3C 83 53 CC 95 59 45 20 BD 85 06 54
    -0110 | A0 DA BF 78 F8 42 C0 75 DD 65 29 55 B8 70 A3 01
    -0120 | F6 F4 8A 15 8D 45 3A 96 D6 6F D2 49 0E 5D C6 48
    -0130 | 50 6D BA 62 23 E6 9C DF 35 A5 C4 D1 D5 1A 57 4B
    -0140 | E1 A7 16 DA 24 87 2F FE E8 4F 5B B8 E8 29 3B 85
    -0150 | 01 B2 C8 BF
    +
    0000 | 00 00 00 00 00 00 00 00 20 38 09 00 77 2F 55 65
    +0010 | 40 01 00 00 BE E4 12 D7 2E 43 2C 2D 21 17 81 12
    +0020 | 6D A7 CE 6E F1 B7 45 6B 3F BD 31 0C 0C C8 47 30
    +0030 | 39 A6 A5 A4 4C 02 D5 01 04 3B B0 39 F1 00 00 00
    +0040 | 04 3C 95 95 F1 00 00 00 85 FD 64 DE 85 1D 9D D0
    +0050 | FE 00 01 00 23 EC B4 20 4C 6B E2 86 A6 DC A7 DE
    +0060 | 73 83 0B 70 20 9C B2 89 05 28 82 E5 06 82 CC 3F
    +0070 | 0B FA E7 CC B9 2F A4 E6 83 A1 FE 06 DF 8C FA 2A
    +0080 | 01 BE A5 07 DE E5 69 A8 8A 1C E8 67 4D EA BF E5
    +0090 | 71 25 A6 6B C0 CD D1 14 DE D3 91 8D 49 C2 2B 77
    +00A0 | 87 04 DB FA 2A E7 3F 7C 52 CB 0B 69 89 F0 29 66
    +00B0 | 01 34 7F 06 59 F3 37 63 3B A0 9C 8A A9 CD B0 8F
    +00C0 | 41 62 D6 1F D3 B7 0A 0E 19 31 6B FD 91 9B EA CB
    +00D0 | C3 9E FF 7B 0A 80 B8 FE CE EC 34 5F 82 C6 37 A0
    +00E0 | FB 64 7A 70 70 07 EE 55 2F 98 57 79 69 BD 0C 19
    +00F0 | 30 F7 01 0E 34 46 95 FF 0A 51 B4 E6 43 51 72 25
    +0100 | 91 59 C7 D2 E1 28 B1 4B 33 68 E0 70 00 6E 30 CF
    +0110 | 15 AE FC F6 95 E8 0F 66 E5 39 AE FE 48 A7 4A 9A
    +0120 | EF 17 73 7F 9C 14 37 D1 ED 41 A0 05 F5 2C 7A BB
    +0130 | B9 55 92 16 39 EF 62 AD 3D A0 B0 7A A3 8B 88 76
    +0140 | 62 90 DB 1F A2 65 1D BC 85 EB D7 47 AC 36 35 72
    +0150 | BA B7 6A FA

    Payload (de)serialization:

    req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;
    message_id 8, 83C060300A7E353651C380900772F5565 Message ID generated as specified here » (unixtime() << 32) + (N*4)
    nonce 24, 168754F23AB4CF8B0A3C1A5F518AB8E7942E432C2D211781126DA7CE6EF1B7456B Random number
    message_id 8, 801F44B4CA7E3536501EC3927772F5565 Message ID generated as specified here » (unixtime() << 32) + (N*4)
    message_length 16, 480000000 (128 in decimal)84000000 (132 in decimal) Message body length
    nonce 24, 168754F23AB4CF8B0A3C1A5F518AB8E7942E432C2D211781126DA7CE6EF1B7456B Value generated by client in Step 1
    server_nonce 40, 1671354E3E4E79EA40FF6978AC3E1577693FBD310C0CC8473039A6A5A44C02D501 Server-generated random number
    pq 56, 120829520DD9C51D694F000000
    TL byte deserialization
    => bigendian conversion to decimal
    => 2977457532611422543
    080E202E1BF7E4D0E1000000
    TL byte deserialization
    => bigendian conversion to decimal
    => 1017864213443694817
    Single-byte prefix denoting length, an 8-byte string, and three bytes of padding
    pq 4, 120829520DD9C51D694F000000
    TL byte deserialization
    => bigendian conversion to decimal
    => 2977457532611422543
    080E202E1BF7E4D0E1000000
    TL byte deserialization
    => bigendian conversion to decimal
    => 1017864213443694817
    Single-byte prefix denoting length, 8-byte string, and three bytes of padding
    p 16, 80460501B09000000
    TL byte deserialization
    => bigendian conversion to decimal
    => 1615862537
    043BB039F1000000
    TL byte deserialization
    => bigendian conversion to decimal
    => 1001404913
    First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding
    q 24, 8046DD47F97000000
    TL byte deserialization
    => bigendian conversion to decimal
    => 1842642839
    043C9595F1000000
    TL byte deserialization
    => bigendian conversion to decimal
    => 1016436209
    Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding
    nonce 32, 168754F23AB4CF8B0A3C1A5F518AB8E7942E432C2D211781126DA7CE6EF1B7456B Value generated by client in Step 1
    server_nonce 48, 1671354E3E4E79EA40FF6978AC3E1577693FBD310C0CC8473039A6A5A44C02D501 Value received from server in Step 2
    new_nonce 64, 320F0D2BE218FCAE41EB36966E36E7D96D E180E74184A6E9CF1D702C5954E2DFA0D299140C5481B8DBC3F000651AE014AF E6242CCA506BDE69E7816268FB33D412 Client-generated random number
    @@ -345,7 +345,7 @@ random_padding_bytes = 3C38DC7F98BD7A9156B1A7D60D372FCB8FF2B4E45C1B0614F736E3BD3 - + @@ -363,25 +363,25 @@ random_padding_bytes = 3C38DC7F98BD7A9156B1A7D60D372FCB8FF2B4E45C1B0614F736E3BD3 - + - + - + - + @@ -393,7 +393,7 @@ random_padding_bytes = 3C38DC7F98BD7A9156B1A7D60D372FCB8FF2B4E45C1B0614F736E3BD3 - + @@ -402,47 +402,47 @@ random_padding_bytes = 3C38DC7F98BD7A9156B1A7D60D372FCB8FF2B4E45C1B0614F736E3BD3
    6) Server responds with:

    Received payload (excluding transport headers/trailers):

    -
    0000 | 00 00 00 00 00 00 00 00 01 FC 65 FF A7 E3 53 65
    -0010 | B4 02 00 00 5C 07 E8 D0 87 54 F2 3A B4 CF 8B 0A
    -0020 | 3C 1A 5F 51 8A B8 E7 94 71 35 4E 3E 4E 79 EA 40
    -0030 | FF 69 78 AC 3E 15 77 69 FE 50 02 00 EC 30 0C AA
    -0040 | B8 20 19 C7 32 46 AC B1 BD 36 4D A4 1B 0C 87 86
    -0050 | 89 2D 4C 6E C9 2D 11 74 CD 1D 42 4A 5E 22 08 39
    -0060 | 86 4A 49 AF 37 77 EF BB 42 8C 8D D5 5E 7F 91 72
    -0070 | 18 39 05 99 0C 76 42 B1 41 24 3E B6 09 11 59 50
    -0080 | 4D 54 26 72 E2 5D 2C D5 10 8B F6 22 F5 16 14 C0
    -0090 | 90 50 D0 1C 89 9D 1E B9 CB 8C 30 A8 C7 76 CF E2
    -00A0 | 05 95 87 58 07 32 48 E7 D2 15 48 F9 A1 D4 02 99
    -00B0 | 9A A7 09 75 DC EF 08 10 B8 68 4F 2D 34 A7 BA 70
    -00C0 | 66 C7 10 E7 31 E5 5E 98 36 95 96 22 90 94 67 99
    -00D0 | CC 14 15 39 31 65 AA EA DC 40 6F 9E 01 B5 25 85
    -00E0 | 2A DC BA 3D D4 FB D9 68 79 4B D3 58 E9 9E F3 39
    -00F0 | 3B 2D 3B FD B5 BD D7 8B C3 37 4D DA 4C 4F 3D 25
    -0100 | 1A 04 6D 2C 0A 0D DE C4 27 75 90 BF DD 39 15 33
    -0110 | 53 CE 2D B1 EA FF CF 95 88 5F 75 42 67 7E 47 1D
    -0120 | 12 21 C1 00 A5 9A 23 EC 5E 74 61 62 21 3E BC F2
    -0130 | 46 79 F2 F5 3F D4 E8 B3 41 CC 90 C8 38 8B 32 A0
    -0140 | 0F 9D F8 54 59 A4 71 18 12 AC 1C 64 13 DA 79 93
    -0150 | D5 10 4E 72 BD CD 11 56 41 BF EF 70 ED 9B 8A 1D
    -0160 | E8 A2 09 81 4A A1 3D 13 95 87 5C 3C BE DF 4E B2
    -0170 | 2D 09 B5 8F 24 D2 E5 17 DE 75 44 B7 CB 8E 8A 30
    -0180 | 4D 1C 11 4D 5B B2 F1 FA B6 AE 3A 0A 86 E9 1A 0D
    -0190 | AE 70 4B CB 04 0A 37 22 66 6B 35 32 E0 55 4D CF
    -01A0 | 64 DB FC B3 DB EC 8A 35 07 CC 64 48 36 2C D3 64
    -01B0 | AE 56 45 BE FD 99 AB CF 32 72 88 F8 B9 91 04 A3
    -01C0 | 3C 1C CD 07 19 F2 2A 2A C7 2A 45 5E A0 44 5B D5
    -01D0 | 11 19 13 42 2D 19 09 C1 5F 34 98 71 A7 D1 F1 88
    -01E0 | 71 B1 01 21 68 6B 9E 1C 93 32 1C BE F1 FD D7 D0
    -01F0 | 5B 65 6C 0D 79 E3 E7 58 71 61 2D EB 0A 01 C9 98
    -0200 | C7 A9 94 F4 25 C6 19 47 E3 26 F7 97 AB AF B7 75
    -0210 | AD E7 58 A8 08 A9 C4 76 59 60 27 8F 8E 33 E7 D0
    -0220 | ED 33 AE 40 BE CB B3 86 9D 59 E9 53 BB 19 71 3A
    -0230 | F0 92 A4 12 C0 DB 06 52 FF 29 FA 4E 91 43 39 34
    -0240 | 2B 23 9B 65 AF 8F EF 34 FD 6F D3 C6 20 42 87 B7
    -0250 | DF 95 D5 DC E1 12 CB C1 E4 1D A2 2B 48 76 AA B0
    -0260 | 94 00 46 C1 35 B2 FF 3C 12 46 D6 B2 D9 3E D2 0C
    -0270 | ED D1 10 C2 AF B4 14 62 35 F6 A8 9D 4D 41 BC 7E
    -0280 | 63 B0 4E 3E 9F 62 79 2F B5 D5 67 B3
    +
    0000 | 00 00 00 00 00 00 00 00 01 9C 62 D9 77 2F 55 65
    +0010 | 8C 02 00 00 5C 07 E8 D0 2E 43 2C 2D 21 17 81 12
    +0020 | 6D A7 CE 6E F1 B7 45 6B 3F BD 31 0C 0C C8 47 30
    +0030 | 39 A6 A5 A4 4C 02 D5 01 FE 50 02 00 1D 7E 4E 4D
    +0040 | 30 82 B4 0F D0 8B A8 CF 93 B4 37 64 7C E4 11 92
    +0050 | 5A 51 B9 C8 26 4A E6 A5 F4 CA A3 A0 1D 6C C1 90
    +0060 | A0 64 C4 C2 11 FD 0A 10 B7 FA ED BE 20 04 BF 59
    +0070 | F3 99 A3 48 16 6C 86 E6 C9 74 D0 B8 6B E5 4F 0A
    +0080 | 99 A6 93 3F 02 13 E5 1C EC 42 56 21 13 DB E8 4B
    +0090 | A1 B7 78 B9 FD 55 94 02 03 6B BF C2 5D 66 2E 18
    +00A0 | B2 CF 42 8A 9B 9A 5B 47 ED E6 F2 2F AB 31 93 90
    +00B0 | 74 0D 09 15 D1 FC 68 8E 10 5B AF 32 F6 F0 1B 92
    +00C0 | 7D D2 E0 A9 D7 B0 1E C6 57 83 36 77 D5 84 B4 73
    +00D0 | 27 08 EA BA 5F BC EB 34 5A DF 5B 1F E6 B9 A1 58
    +00E0 | F5 D7 76 D0 84 A3 AB 53 80 60 0C D5 20 1E DE 4C
    +00F0 | 9E D0 64 7E 1C 82 DF 55 0A B2 72 CD 96 D3 7D 33
    +0100 | 40 63 89 D8 B4 A1 14 45 41 87 C1 4F F8 2E 84 B3
    +0110 | 3A AC C6 13 D6 EF 50 E8 16 2E EB E0 A6 F2 61 3E
    +0120 | 48 7B 7A BD DF 44 C4 FB FF 3F 19 DE 95 BC 39 53
    +0130 | 42 F0 E9 CA 0D 91 7B D7 0D A3 4D AC 1B 52 0B C5
    +0140 | 68 EF 3F DB 1D 0B 6E 0D FB D1 C8 1C B1 FC 76 D0
    +0150 | 31 52 6F EA F4 E0 5F 02 92 4D 0E 00 2D E8 CC CC
    +0160 | A2 0B F9 DB 5E BC B2 05 21 D4 B6 CB 24 1A 3A 89
    +0170 | FC 79 62 4D 08 77 23 0B 18 98 AF 08 E0 07 79 6F
    +0180 | F7 75 62 74 DD 3C FC 16 93 3D B8 3E 1A B0 45 6A
    +0190 | E1 5B 1D 35 BC D5 19 20 9C E4 38 2D EF 96 8F E5
    +01A0 | D2 84 3A 02 DF 7D 61 11 23 45 17 51 1F 97 5F BD
    +01B0 | 0A 08 D7 05 86 37 8C 83 11 1B 69 75 8A 14 9B 1B
    +01C0 | 44 09 D7 93 6D DA 3C 4C 7A 63 C8 69 6C B9 D5 8D
    +01D0 | 9B E6 AB 6B 76 40 A2 B5 4F DA B6 FF 06 A6 AB C1
    +01E0 | AB ED F3 B3 D9 F3 43 D3 D9 87 D6 BA 57 C8 85 00
    +01F0 | 9E CA 3A BD 57 3F 7B DC 49 F4 B6 4E 69 73 1B B4
    +0200 | 5F 66 3C CB 64 26 35 F6 F3 E8 88 65 1F DA F5 9C
    +0210 | 51 6A 13 D3 8B 77 74 48 31 97 98 EC 9E 72 4F 9C
    +0220 | 5D D9 45 25 E6 E1 9A A0 49 55 FC 4C C3 9D 49 4B
    +0230 | A7 6A DF 4B 9D F8 A5 28 1E 9B C5 F2 9F 16 0C 74
    +0240 | B1 91 11 71 59 9E 68 31 5D 2A 51 6C 4A 73 46 41
    +0250 | 60 7C 2D 97 D6 F0 64 90 B2 5C 1C 67 1E 20 35 A9
    +0260 | B4 C1 A7 B5 94 69 3D 25 0E AC 4B 79 78 5D DA 64
    +0270 | 89 6E E6 36 3C E9 D5 F4 1B 4F 85 CE DB BD 6F CA
    +0280 | 42 92 99 F8 FB 9A 4B 72 4F 2D 15 F6

    Payload (de)serialization:

    server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;
    message_id 8, 840060300A7E3536520380900772F5565 Message ID generated as specified here » (unixtime() << 32) + (N*4)
    nonce 24, 168754F23AB4CF8B0A3C1A5F518AB8E7942E432C2D211781126DA7CE6EF1B7456B Value generated by client in Step 1
    server_nonce 40, 1671354E3E4E79EA40FF6978AC3E1577693FBD310C0CC8473039A6A5A44C02D501 Value received from server in Step 2
    p 56, 80460501B09000000
    TL byte deserialization
    => bigendian conversion to decimal
    => 1615862537
    043BB039F1000000
    TL byte deserialization
    => bigendian conversion to decimal
    => 1001404913
    First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding
    q 64, 8046DD47F97000000
    TL byte deserialization
    => bigendian conversion to decimal
    => 1842642839
    043C9595F1000000
    TL byte deserialization
    => bigendian conversion to decimal
    => 1016436209
    Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding
    encrypted_data 80, 260FE00010048C017F4BBC9DF6717A695D2 F76B9515B6A08DE23C9ECB2661AA22D6 717B005E6345B7E48FF3837A30285841 F8A4B236532E2E48F56486F934ADCA24 5370C4E00F0FDAF2CA001F0BB6F92BF8 532D35B1EBD062B743F902BBCA9AEE37 1F749682B9A5EFAFEB5B03B21C00DED5 EF54B1B287A592911FC984D1A6C45E26 BB26A0A6D194887F3A5EB829AE9D3229 7782632EE1ABECF61DDDBBD70341E32E 98AE3032DCCDCDA817EA7C035046267D E0A715673C8353CC95594520BD850654 A0DABF78F842C075DD652955B870A301 F6F48A158D453A96D66FD2490E5DC648 506DBA6223E69CDF35A5C4D1D51A574B E1A716DA24872FFEE84F5BB8E8293B85
    01B2C8BF
    FE00010023ECB4204C6BE286A6DCA7DE 73830B70209CB289052882E50682CC3F 0BFAE7CCB92FA4E683A1FE06DF8CFA2A 01BEA507DEE569A88A1CE8674DEABFE5 7125A66BC0CDD114DED3918D49C22B77 8704DBFA2AE73F7C52CB0B6989F02966 01347F0659F337633BA09C8AA9CDB08F 4162D61FD3B70A0E19316BFD919BEACB C39EFF7B0A80B8FECEEC345F82C637A0 FB647A707007EE552F98577969BD0C19 30F7010E344695FF0A51B4E643517225 9159C7D2E128B14B3368E070006E30CF 15AEFCF695E80F66E539AEFE48A74A9A EF17737F9C1437D1ED41A005F52C7ABB B955921639EF62AD3DA0B07AA38B8876 6290DB1FA2651DBC85EBD747AC363572
    BAB76AFA
    Value generated above
    @@ -464,13 +464,13 @@ random_padding_bytes = 3C38DC7F98BD7A9156B1A7D60D372FCB8FF2B4E45C1B0614F736E3BD3 - + - + @@ -482,19 +482,19 @@ random_padding_bytes = 3C38DC7F98BD7A9156B1A7D60D372FCB8FF2B4E45C1B0614F736E3BD3 - + - + - + @@ -502,20 +502,20 @@ random_padding_bytes = 3C38DC7F98BD7A9156B1A7D60D372FCB8FF2B4E45C1B0614F736E3BD3

    Decrypt encrypted_answer using the reverse of the process specified in step 6:

    -
    encrypted_answer = EC300CAAB82019C73246ACB1BD364DA41B0C8786892D4C6EC92D1174CD1D424A5E220839864A49AF3777EFBB428C8DD55E7F9172183905990C7642B141243EB6091159504D542672E25D2CD5108BF622F51614C09050D01C899D1EB9CB8C30A8C776CFE205958758073248E7D21548F9A1D402999AA70975DCEF0810B8684F2D34A7BA7066C710E731E55E983695962290946799CC1415393165AAEADC406F9E01B525852ADCBA3DD4FBD968794BD358E99EF3393B2D3BFDB5BDD78BC3374DDA4C4F3D251A046D2C0A0DDEC4277590BFDD39153353CE2DB1EAFFCF95885F7542677E471D1221C100A59A23EC5E746162213EBCF24679F2F53FD4E8B341CC90C8388B32A00F9DF85459A4711812AC1C6413DA7993D5104E72BDCD115641BFEF70ED9B8A1DE8A209814AA13D1395875C3CBEDF4EB22D09B58F24D2E517DE7544B7CB8E8A304D1C114D5BB2F1FAB6AE3A0A86E91A0DAE704BCB040A3722666B3532E0554DCF64DBFCB3DBEC8A3507CC6448362CD364AE5645BEFD99ABCF327288F8B99104A33C1CCD0719F22A2AC72A455EA0445BD5111913422D1909C15F349871A7D1F18871B10121686B9E1C93321CBEF1FDD7D05B656C0D79E3E75871612DEB0A01C998C7A994F425C61947E326F797ABAFB775ADE758A808A9C4765960278F8E33E7D0ED33AE40BECBB3869D59E953BB19713AF092A412C0DB0652FF29FA4E914339342B239B65AF8FEF34FD6FD3C6204287B7DF95D5DCE112CBC1E41DA22B4876AAB0940046C135B2FF3C1246D6B2D93ED20CEDD110C2AFB4146235F6A89D4D41BC7E63B04E3E9F62792FB5D567B3
    -tmp_aes_key = 18BFF5E15D497FE20AE89092E2AF5E584F1274BC4BC69B1B5B963C844D43E90F
    -tmp_aes_iv = 14D91E3D5A21F5C5055DDD1E6FB9F9295FA21AFD94BD2DAB211D7BB40F0D2BE2
    +
    encrypted_answer = 1D7E4E4D3082B40FD08BA8CF93B437647CE411925A51B9C8264AE6A5F4CAA3A01D6CC190A064C4C211FD0A10B7FAEDBE2004BF59F399A348166C86E6C974D0B86BE54F0A99A6933F0213E51CEC42562113DBE84BA1B778B9FD559402036BBFC25D662E18B2CF428A9B9A5B47EDE6F22FAB319390740D0915D1FC688E105BAF32F6F01B927DD2E0A9D7B01EC657833677D584B4732708EABA5FBCEB345ADF5B1FE6B9A158F5D776D084A3AB5380600CD5201EDE4C9ED0647E1C82DF550AB272CD96D37D33406389D8B4A114454187C14FF82E84B33AACC613D6EF50E8162EEBE0A6F2613E487B7ABDDF44C4FBFF3F19DE95BC395342F0E9CA0D917BD70DA34DAC1B520BC568EF3FDB1D0B6E0DFBD1C81CB1FC76D031526FEAF4E05F02924D0E002DE8CCCCA20BF9DB5EBCB20521D4B6CB241A3A89FC79624D0877230B1898AF08E007796FF7756274DD3CFC16933DB83E1AB0456AE15B1D35BCD519209CE4382DEF968FE5D2843A02DF7D6111234517511F975FBD0A08D70586378C83111B69758A149B1B4409D7936DDA3C4C7A63C8696CB9D58D9BE6AB6B7640A2B54FDAB6FF06A6ABC1ABEDF3B3D9F343D3D987D6BA57C885009ECA3ABD573F7BDC49F4B64E69731BB45F663CCB642635F6F3E888651FDAF59C516A13D38B777448319798EC9E724F9C5DD94525E6E19AA04955FC4CC39D494BA76ADF4B9DF8A5281E9BC5F29F160C74B1911171599E68315D2A516C4A734641607C2D97D6F06490B25C1C671E2035A9B4C1A7B594693D250EAC4B79785DDA64896EE6363CE9D5F41B4F85CEDBBD6FCA429299F8FB9A4B724F2D15F6
    +tmp_aes_key = EE9089727DC03241E5CB7804BBA1A9ED63E7ABFC07D3D65A97E90D9011721485
    +tmp_aes_iv = C999974CCB15BE1A71525735380F9F2B3D84B704F734CCEA9DFB2B02D299140C

    Yielding:

    -
    answer_with_hash = EDF6E5D5B7B267DD24A8E9942989E5A9A2641503BA0D89B58754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E15776903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001006C6A8EBE0DAEDDED3B621DC52ACEEB0B0054D34234E0C7566408C59789A80A053970CC73EBBFDAFDBCEABAF17B920ABF7486E92A78B501C806B12B91AC3096EF649AE5CFA6C7035B02F2ADAC98628D0FF317D59E475B77363D28997F66C595B0D66EC1506EEADCCB92325A22893981CED27E0006861345CFBE9D36C91E177B7C5F1AF31695582D2350EAE97972D4138C6FF57A68E954A0F34E88D7CEE2C4BB8DF826E0BCE8194FCE35809C9A3D86DBAA1F77F841F55E5DD98D74761C13B8B316354521DE8E6484B3B45F212FA0AD3F408E527AD6286454F4B11E7FA51830B89DE2B97F6AD09ED33AEC9EE80E65988B399F83A8E7A58F148966F259C8E34E41E2A7E3536595D817C24AB5E551
    -answer = BA0D89B58754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E15776903000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001006C6A8EBE0DAEDDED3B621DC52ACEEB0B0054D34234E0C7566408C59789A80A053970CC73EBBFDAFDBCEABAF17B920ABF7486E92A78B501C806B12B91AC3096EF649AE5CFA6C7035B02F2ADAC98628D0FF317D59E475B77363D28997F66C595B0D66EC1506EEADCCB92325A22893981CED27E0006861345CFBE9D36C91E177B7C5F1AF31695582D2350EAE97972D4138C6FF57A68E954A0F34E88D7CEE2C4BB8DF826E0BCE8194FCE35809C9A3D86DBAA1F77F841F55E5DD98D74761C13B8B316354521DE8E6484B3B45F212FA0AD3F408E527AD6286454F4B11E7FA51830B89DE2B97F6AD09ED33AEC9EE80E65988B399F83A8E7A58F148966F259C8E34E41E2A7E3536595D817C24AB5E551
    +
    answer_with_hash = 05533A31BBCBEFCEDC94220613DF0527C1379CAABA0D89B52E432C2D211781126DA7CE6EF1B7456B3FBD310C0CC8473039A6A5A44C02D50103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010063ECDFAEB4AC2E0D2C0DF46F1CAC0341179355F058B7FCE39C4226BB97721E0A52BC3023C4734B4209A5FBEB6E0A39320E634736E75F89861FCB2EFF73C94C97AF32B08C61D58B5A2855F433657F7744E4DB6B6E6644BF5BF5179380D5810581923153F803458CA0146159B11D89B40D54F3AB5F0431CA533BDFE9A5F1F7D9E35F15026357790A295D1DD4A7775A53DECBE6217A123CA7E520729409B73AB30DC0B717BC8D35B00DB6E276BD618486A20507669FCDBAC10C7BFD10EA665BBAB8C3FF9FC408CA4454660D0546D2158ECD0CA946FFE617C66607A686CF503E72A97CF22C51F75273CAAF20D2B51F088F10013D4EE651C85D43350770FFDCABD95A772F55652DE622EC1B37DDDB
    +answer = BA0D89B52E432C2D211781126DA7CE6EF1B7456B3FBD310C0CC8473039A6A5A44C02D50103000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE00010063ECDFAEB4AC2E0D2C0DF46F1CAC0341179355F058B7FCE39C4226BB97721E0A52BC3023C4734B4209A5FBEB6E0A39320E634736E75F89861FCB2EFF73C94C97AF32B08C61D58B5A2855F433657F7744E4DB6B6E6644BF5BF5179380D5810581923153F803458CA0146159B11D89B40D54F3AB5F0431CA533BDFE9A5F1F7D9E35F15026357790A295D1DD4A7775A53DECBE6217A123CA7E520729409B73AB30DC0B717BC8D35B00DB6E276BD618486A20507669FCDBAC10C7BFD10EA665BBAB8C3FF9FC408CA4454660D0546D2158ECD0CA946FFE617C66607A686CF503E72A97CF22C51F75273CAAF20D2B51F088F10013D4EE651C85D43350770FFDCABD95A772F55652DE622EC1B37DDDB

    Generated payload (excluding transport headers/trailers):

    -
    0000 | BA 0D 89 B5 87 54 F2 3A B4 CF 8B 0A 3C 1A 5F 51
    -0010 | 8A B8 E7 94 71 35 4E 3E 4E 79 EA 40 FF 69 78 AC
    -0020 | 3E 15 77 69 03 00 00 00 FE 00 01 00 C7 1C AE B9
    +
    0000 | BA 0D 89 B5 2E 43 2C 2D 21 17 81 12 6D A7 CE 6E
    +0010 | F1 B7 45 6B 3F BD 31 0C 0C C8 47 30 39 A6 A5 A4
    +0020 | 4C 02 D5 01 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 = BA0D89B58754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E15776
     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 | 6C 6A 8E BE 0D AE DD ED 3B 62 1D C5 2A CE EB 0B
    -0140 | 00 54 D3 42 34 E0 C7 56 64 08 C5 97 89 A8 0A 05
    -0150 | 39 70 CC 73 EB BF DA FD BC EA BA F1 7B 92 0A BF
    -0160 | 74 86 E9 2A 78 B5 01 C8 06 B1 2B 91 AC 30 96 EF
    -0170 | 64 9A E5 CF A6 C7 03 5B 02 F2 AD AC 98 62 8D 0F
    -0180 | F3 17 D5 9E 47 5B 77 36 3D 28 99 7F 66 C5 95 B0
    -0190 | D6 6E C1 50 6E EA DC CB 92 32 5A 22 89 39 81 CE
    -01A0 | D2 7E 00 06 86 13 45 CF BE 9D 36 C9 1E 17 7B 7C
    -01B0 | 5F 1A F3 16 95 58 2D 23 50 EA E9 79 72 D4 13 8C
    -01C0 | 6F F5 7A 68 E9 54 A0 F3 4E 88 D7 CE E2 C4 BB 8D
    -01D0 | F8 26 E0 BC E8 19 4F CE 35 80 9C 9A 3D 86 DB AA
    -01E0 | 1F 77 F8 41 F5 5E 5D D9 8D 74 76 1C 13 B8 B3 16
    -01F0 | 35 45 21 DE 8E 64 84 B3 B4 5F 21 2F A0 AD 3F 40
    -0200 | 8E 52 7A D6 28 64 54 F4 B1 1E 7F A5 18 30 B8 9D
    -0210 | E2 B9 7F 6A D0 9E D3 3A EC 9E E8 0E 65 98 8B 39
    -0220 | 9F 83 A8 E7 A5 8F 14 89 66 F2 59 C8 E3 4E 41 E2
    -0230 | A7 E3 53 65
    +0130 | 63 EC DF AE B4 AC 2E 0D 2C 0D F4 6F 1C AC 03 41 +0140 | 17 93 55 F0 58 B7 FC E3 9C 42 26 BB 97 72 1E 0A +0150 | 52 BC 30 23 C4 73 4B 42 09 A5 FB EB 6E 0A 39 32 +0160 | 0E 63 47 36 E7 5F 89 86 1F CB 2E FF 73 C9 4C 97 +0170 | AF 32 B0 8C 61 D5 8B 5A 28 55 F4 33 65 7F 77 44 +0180 | E4 DB 6B 6E 66 44 BF 5B F5 17 93 80 D5 81 05 81 +0190 | 92 31 53 F8 03 45 8C A0 14 61 59 B1 1D 89 B4 0D +01A0 | 54 F3 AB 5F 04 31 CA 53 3B DF E9 A5 F1 F7 D9 E3 +01B0 | 5F 15 02 63 57 79 0A 29 5D 1D D4 A7 77 5A 53 DE +01C0 | CB E6 21 7A 12 3C A7 E5 20 72 94 09 B7 3A B3 0D +01D0 | C0 B7 17 BC 8D 35 B0 0D B6 E2 76 BD 61 84 86 A2 +01E0 | 05 07 66 9F CD BA C1 0C 7B FD 10 EA 66 5B BA B8 +01F0 | C3 FF 9F C4 08 CA 44 54 66 0D 05 46 D2 15 8E CD +0200 | 0C A9 46 FF E6 17 C6 66 07 A6 86 CF 50 3E 72 A9 +0210 | 7C F2 2C 51 F7 52 73 CA AF 20 D2 B5 1F 08 8F 10 +0220 | 01 3D 4E E6 51 C8 5D 43 35 07 70 FF DC AB D9 5A +0230 | 77 2F 55 65

    Payload (de)serialization:

    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;
    message_id 8, 801FC65FFA7E35365019C62D9772F5565 Message ID generated as specified here » (unixtime() << 32) + (N*4)
    message_length 16, 4B4020000 (692 in decimal)8C020000 (652 in decimal) Message body length
    nonce 24, 168754F23AB4CF8B0A3C1A5F518AB8E7942E432C2D211781126DA7CE6EF1B7456B Value generated by client in Step 1
    server_nonce 40, 1671354E3E4E79EA40FF6978AC3E1577693FBD310C0CC8473039A6A5A44C02D501 Value received from server in Step 2
    encrypted_answer 56, 596FE500200EC300CAAB82019C73246ACB1 BD364DA41B0C8786892D4C6EC92D1174 CD1D424A5E220839864A49AF3777EFBB 428C8DD55E7F9172183905990C7642B1 41243EB6091159504D542672E25D2CD5 108BF622F51614C09050D01C899D1EB9 CB8C30A8C776CFE205958758073248E7 D21548F9A1D402999AA70975DCEF0810 B8684F2D34A7BA7066C710E731E55E98 3695962290946799CC1415393165AAEA DC406F9E01B525852ADCBA3DD4FBD968 794BD358E99EF3393B2D3BFDB5BDD78B C3374DDA4C4F3D251A046D2C0A0DDEC4 277590BFDD39153353CE2DB1EAFFCF95 885F7542677E471D1221C100A59A23EC 5E746162213EBCF24679F2F53FD4E8B3 41CC90C8388B32A00F9DF85459A47118 12AC1C6413DA7993D5104E72BDCD1156 41BFEF70ED9B8A1DE8A209814AA13D13 95875C3CBEDF4EB22D09B58F24D2E517 DE7544B7CB8E8A304D1C114D5BB2F1FA B6AE3A0A86E91A0DAE704BCB040A3722 666B3532E0554DCF64DBFCB3DBEC8A35 07CC6448362CD364AE5645BEFD99ABCF 327288F8B99104A33C1CCD0719F22A2A C72A455EA0445BD5111913422D1909C1 5F349871A7D1F18871B10121686B9E1C 93321CBEF1FDD7D05B656C0D79E3E758 71612DEB0A01C998C7A994F425C61947 E326F797ABAFB775ADE758A808A9C476 5960278F8E33E7D0ED33AE40BECBB386 9D59E953BB19713AF092A412C0DB0652 FF29FA4E914339342B239B65AF8FEF34 FD6FD3C6204287B7DF95D5DCE112CBC1 E41DA22B4876AAB0940046C135B2FF3C 1246D6B2D93ED20CEDD110C2AFB41462 35F6A89D4D41BC7E63B04E3E9F62792F
    B5D567B3
    FE5002001D7E4E4D3082B40FD08BA8CF 93B437647CE411925A51B9C8264AE6A5 F4CAA3A01D6CC190A064C4C211FD0A10 B7FAEDBE2004BF59F399A348166C86E6 C974D0B86BE54F0A99A6933F0213E51C EC42562113DBE84BA1B778B9FD559402 036BBFC25D662E18B2CF428A9B9A5B47 EDE6F22FAB319390740D0915D1FC688E 105BAF32F6F01B927DD2E0A9D7B01EC6 57833677D584B4732708EABA5FBCEB34 5ADF5B1FE6B9A158F5D776D084A3AB53 80600CD5201EDE4C9ED0647E1C82DF55 0AB272CD96D37D33406389D8B4A11445 4187C14FF82E84B33AACC613D6EF50E8 162EEBE0A6F2613E487B7ABDDF44C4FB FF3F19DE95BC395342F0E9CA0D917BD7 0DA34DAC1B520BC568EF3FDB1D0B6E0D FBD1C81CB1FC76D031526FEAF4E05F02 924D0E002DE8CCCCA20BF9DB5EBCB205 21D4B6CB241A3A89FC79624D0877230B 1898AF08E007796FF7756274DD3CFC16 933DB83E1AB0456AE15B1D35BCD51920 9CE4382DEF968FE5D2843A02DF7D6111 234517511F975FBD0A08D70586378C83 111B69758A149B1B4409D7936DDA3C4C 7A63C8696CB9D58D9BE6AB6B7640A2B5 4FDAB6FF06A6ABC1ABEDF3B3D9F343D3 D987D6BA57C885009ECA3ABD573F7BDC 49F4B64E69731BB45F663CCB642635F6 F3E888651FDAF59C516A13D38B777448 319798EC9E724F9C5DD94525E6E19AA0 4955FC4CC39D494BA76ADF4B9DF8A528 1E9BC5F29F160C74B1911171599E6831 5D2A516C4A734641607C2D97D6F06490 B25C1C671E2035A9B4C1A7B594693D25 0EAC4B79785DDA64896EE6363CE9D5F4 1B4F85CEDBBD6FCA429299F8FB9A4B72
    4F2D15F6
    See below
    @@ -570,13 +570,13 @@ answer = BA0D89B58754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E15776 - + - + @@ -594,13 +594,13 @@ answer = BA0D89B58754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E15776 - + - + @@ -609,34 +609,34 @@ answer = BA0D89B58754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E15776
    7) Client computes random 2048-bit number b (using a sufficient amount of entropy) and sends the server a message

    First, generate a secure random 2048-bit number b:

    -
    b = 525206EF8F2EB255A6766F5E808BA653C8C0A3BFA58E572E9EFC7F6DC4465855B1DB49D31D64EA233677DD39609B45B7788972B7C36720CA7D43090E3B3DFCE354A77B83A8FDD623F36CE06FA751DCBBF8869CD0C932EE2D1B2E183657605FBD624A68746C95DB1D0185CA9D8855E24D32B9D99D6B29CF1948974AFF7C9F8DA948603DC451E98A4A6D28216996841B326CE1F215882D1987D85D944BF42EC10B6633C7454B62DF67D7103C2576E1F4B42BC17539A470A8B2E14E7A2DCD9DFAE3959B2304E4D653FED74A1E7B6C81727686E394278DE1E7D588E8E6F27465B5AE655F21E2403181D02F338B237E58FF59DD3C0AE0BF6FE8B35F159BD1CACD60DA
    +
    b = E6FB3B7B3A740733C365A0623A697FD0EF13458CD03A3E32BC9B91DE5B23C0E794CE0062630F12077BDFD16171FB4E907D3BB68C276590306DBBD270C49E937098E0E77ACD88756F646EDBB65E9F54347571A8FDED531CE9A547736A992CBD619B072075DBD643F12FB5DC322C668E48DF22DBCC1C7BE0721FCAE026FF0FE3C5851D64D6BB7D74AA860AC623DE25D60F2336242BC8A86E533ECC5C667DEBAF6EA08ECEB700397023F24C8B0C48654CE58C396B2C72FB0CABD93A9058812B7874B88466A1CA8FF89F727DF653B3D6713560F9DBC0FCE757400C8ABC26625E2FCDB254609CD230A6646242E252DD116466EF8A8324EFF4DA5365A11DAF410900C5

    Then compute g_b = pow(g, b) mod dh_prime

    -
    g_b = 89EEA25E4698E4AA56CC3BBF4398CA8A8C46402A51ECF96CA737074047E0A835BE831839026ED65C714B74B113B258DFA74E472DB4B1A7C5AA41B369A361F92399B8D741BF4146593022CEA4E3E9DFE7900A5A2289BD8A546E586BF430E1411AFFA9C63C60AF79326F7D515B5FA4424BA06B67B4AD3DE23C8F4FC113079E030357BA3AA97A836C3A744C478CACAE1C62D795B6705972C816F18822699490D7F4A3C63BF6E3D43F370D405B075C2F333F1AEF1CA63BEDC373FD4C6509C837A65805BAE993B07F0CE563A8DE703389059245ACC381837821589EFC64439A225D7646DDE471D4D8167B9BF21A2B2AB06839CC595848B5D671BB78AA0C241A4B4AFC
    +
    g_b = 26B5658C749730885AEFB3956B27BA6B24B3C50C6C7D9C986ECC9D71F8904E9A79018EC2034732C8D6FAC1FC3F01AC6DC40FBBF5EF171D21CACB63076FB71312AFB39C73B4AF3CFF0DC6D1681382A92A88253166FE0E20162E80C745D560670C9B1C66F885C4C8137376C1A4882FE8A4D6BAA59460D86AE479D1E9E3DF5007FC1CB208B0B385618D28DDD046EFB21D03A6718AB9F87D7168084EF5505419C00CF6A4A9F3968A376AE99F84FB48A949D821AA7EE3044BDA13993590089FCA46DEF8A42CC7F3B8E062A64C4B1645A1B16333A406D345772ABDFDB2B76A6E5D6C2D4CEC8734CD47359F478F90CBBE211A11F62AD73455637B86689BE47605CAA2B4
    7.1) generation of encrypted_data

    Generated payload (excluding transport headers/trailers):

    -
    0000 | 54 B6 43 66 87 54 F2 3A B4 CF 8B 0A 3C 1A 5F 51
    -0010 | 8A B8 E7 94 71 35 4E 3E 4E 79 EA 40 FF 69 78 AC
    -0020 | 3E 15 77 69 00 00 00 00 00 00 00 00 FE 00 01 00
    -0030 | 89 EE A2 5E 46 98 E4 AA 56 CC 3B BF 43 98 CA 8A
    -0040 | 8C 46 40 2A 51 EC F9 6C A7 37 07 40 47 E0 A8 35
    -0050 | BE 83 18 39 02 6E D6 5C 71 4B 74 B1 13 B2 58 DF
    -0060 | A7 4E 47 2D B4 B1 A7 C5 AA 41 B3 69 A3 61 F9 23
    -0070 | 99 B8 D7 41 BF 41 46 59 30 22 CE A4 E3 E9 DF E7
    -0080 | 90 0A 5A 22 89 BD 8A 54 6E 58 6B F4 30 E1 41 1A
    -0090 | FF A9 C6 3C 60 AF 79 32 6F 7D 51 5B 5F A4 42 4B
    -00A0 | A0 6B 67 B4 AD 3D E2 3C 8F 4F C1 13 07 9E 03 03
    -00B0 | 57 BA 3A A9 7A 83 6C 3A 74 4C 47 8C AC AE 1C 62
    -00C0 | D7 95 B6 70 59 72 C8 16 F1 88 22 69 94 90 D7 F4
    -00D0 | A3 C6 3B F6 E3 D4 3F 37 0D 40 5B 07 5C 2F 33 3F
    -00E0 | 1A EF 1C A6 3B ED C3 73 FD 4C 65 09 C8 37 A6 58
    -00F0 | 05 BA E9 93 B0 7F 0C E5 63 A8 DE 70 33 89 05 92
    -0100 | 45 AC C3 81 83 78 21 58 9E FC 64 43 9A 22 5D 76
    -0110 | 46 DD E4 71 D4 D8 16 7B 9B F2 1A 2B 2A B0 68 39
    -0120 | CC 59 58 48 B5 D6 71 BB 78 AA 0C 24 1A 4B 4A FC
    +
    0000 | 54 B6 43 66 2E 43 2C 2D 21 17 81 12 6D A7 CE 6E
    +0010 | F1 B7 45 6B 3F BD 31 0C 0C C8 47 30 39 A6 A5 A4
    +0020 | 4C 02 D5 01 00 00 00 00 00 00 00 00 FE 00 01 00
    +0030 | 26 B5 65 8C 74 97 30 88 5A EF B3 95 6B 27 BA 6B
    +0040 | 24 B3 C5 0C 6C 7D 9C 98 6E CC 9D 71 F8 90 4E 9A
    +0050 | 79 01 8E C2 03 47 32 C8 D6 FA C1 FC 3F 01 AC 6D
    +0060 | C4 0F BB F5 EF 17 1D 21 CA CB 63 07 6F B7 13 12
    +0070 | AF B3 9C 73 B4 AF 3C FF 0D C6 D1 68 13 82 A9 2A
    +0080 | 88 25 31 66 FE 0E 20 16 2E 80 C7 45 D5 60 67 0C
    +0090 | 9B 1C 66 F8 85 C4 C8 13 73 76 C1 A4 88 2F E8 A4
    +00A0 | D6 BA A5 94 60 D8 6A E4 79 D1 E9 E3 DF 50 07 FC
    +00B0 | 1C B2 08 B0 B3 85 61 8D 28 DD D0 46 EF B2 1D 03
    +00C0 | A6 71 8A B9 F8 7D 71 68 08 4E F5 50 54 19 C0 0C
    +00D0 | F6 A4 A9 F3 96 8A 37 6A E9 9F 84 FB 48 A9 49 D8
    +00E0 | 21 AA 7E E3 04 4B DA 13 99 35 90 08 9F CA 46 DE
    +00F0 | F8 A4 2C C7 F3 B8 E0 62 A6 4C 4B 16 45 A1 B1 63
    +0100 | 33 A4 06 D3 45 77 2A BD FD B2 B7 6A 6E 5D 6C 2D
    +0110 | 4C EC 87 34 CD 47 35 9F 47 8F 90 CB BE 21 1A 11
    +0120 | F6 2A D7 34 55 63 7B 86 68 9B E4 76 05 CA A2 B4

    Payload (de)serialization:

    client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;
    nonce 4, 168754F23AB4CF8B0A3C1A5F518AB8E7942E432C2D211781126DA7CE6EF1B7456B Value generated by client in Step 1
    server_nonce 20, 1671354E3E4E79EA40FF6978AC3E1577693FBD310C0CC8473039A6A5A44C02D501 Value received from server in Step 2
    g_a 300, 260FE0001006C6A8EBE0DAEDDED3B621DC5 2ACEEB0B0054D34234E0C7566408C597 89A80A053970CC73EBBFDAFDBCEABAF1 7B920ABF7486E92A78B501C806B12B91 AC3096EF649AE5CFA6C7035B02F2ADAC 98628D0FF317D59E475B77363D28997F 66C595B0D66EC1506EEADCCB92325A22 893981CED27E0006861345CFBE9D36C9 1E177B7C5F1AF31695582D2350EAE979 72D4138C6FF57A68E954A0F34E88D7CE E2C4BB8DF826E0BCE8194FCE35809C9A 3D86DBAA1F77F841F55E5DD98D74761C 13B8B316354521DE8E6484B3B45F212F A0AD3F408E527AD6286454F4B11E7FA5 1830B89DE2B97F6AD09ED33AEC9EE80E 65988B399F83A8E7A58F148966F259C8
    E34E41E2
    FE00010063ECDFAEB4AC2E0D2C0DF46F 1CAC0341179355F058B7FCE39C4226BB 97721E0A52BC3023C4734B4209A5FBEB 6E0A39320E634736E75F89861FCB2EFF 73C94C97AF32B08C61D58B5A2855F433 657F7744E4DB6B6E6644BF5BF5179380 D5810581923153F803458CA0146159B1 1D89B40D54F3AB5F0431CA533BDFE9A5 F1F7D9E35F15026357790A295D1DD4A7 775A53DECBE6217A123CA7E520729409 B73AB30DC0B717BC8D35B00DB6E276BD 618486A20507669FCDBAC10C7BFD10EA 665BBAB8C3FF9FC408CA4454660D0546 D2158ECD0CA946FFE617C66607A686CF 503E72A97CF22C51F75273CAAF20D2B5 1F088F10013D4EE651C85D43350770FF
    DCABD95A
    g_a diffie-hellman parameter
    server_time 560, 4A7E35365 (1699996583 in decimal)772F5565 (1700081527 in decimal) Server time
    @@ -658,19 +658,19 @@ answer = BA0D89B58754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E15776 - + - + - + @@ -684,47 +684,47 @@ answer = BA0D89B58754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E15776

    The serialization of Client_DH_Inner_Data produces a string data. This is used to generate encrypted_data as specified in step 6, using the following inputs:

    -
    data = 54B643668754F23AB4CF8B0A3C1A5F518AB8E79471354E3E4E79EA40FF6978AC3E1577690000000000000000FE00010089EEA25E4698E4AA56CC3BBF4398CA8A8C46402A51ECF96CA737074047E0A835BE831839026ED65C714B74B113B258DFA74E472DB4B1A7C5AA41B369A361F92399B8D741BF4146593022CEA4E3E9DFE7900A5A2289BD8A546E586BF430E1411AFFA9C63C60AF79326F7D515B5FA4424BA06B67B4AD3DE23C8F4FC113079E030357BA3AA97A836C3A744C478CACAE1C62D795B6705972C816F18822699490D7F4A3C63BF6E3D43F370D405B075C2F333F1AEF1CA63BEDC373FD4C6509C837A65805BAE993B07F0CE563A8DE703389059245ACC381837821589EFC64439A225D7646DDE471D4D8167B9BF21A2B2AB06839CC595848B5D671BB78AA0C241A4B4AFC
    -padding = BF530E565913D52672F80775
    -tmp_aes_key = 18BFF5E15D497FE20AE89092E2AF5E584F1274BC4BC69B1B5B963C844D43E90F
    -tmp_aes_iv = 14D91E3D5A21F5C5055DDD1E6FB9F9295FA21AFD94BD2DAB211D7BB40F0D2BE2
    +
    data = 54B643662E432C2D211781126DA7CE6EF1B7456B3FBD310C0CC8473039A6A5A44C02D5010000000000000000FE00010026B5658C749730885AEFB3956B27BA6B24B3C50C6C7D9C986ECC9D71F8904E9A79018EC2034732C8D6FAC1FC3F01AC6DC40FBBF5EF171D21CACB63076FB71312AFB39C73B4AF3CFF0DC6D1681382A92A88253166FE0E20162E80C745D560670C9B1C66F885C4C8137376C1A4882FE8A4D6BAA59460D86AE479D1E9E3DF5007FC1CB208B0B385618D28DDD046EFB21D03A6718AB9F87D7168084EF5505419C00CF6A4A9F3968A376AE99F84FB48A949D821AA7EE3044BDA13993590089FCA46DEF8A42CC7F3B8E062A64C4B1645A1B16333A406D345772ABDFDB2B76A6E5D6C2D4CEC8734CD47359F478F90CBBE211A11F62AD73455637B86689BE47605CAA2B4
    +padding = 42713D7C63F7A248A383EEA8
    +tmp_aes_key = EE9089727DC03241E5CB7804BBA1A9ED63E7ABFC07D3D65A97E90D9011721485
    +tmp_aes_iv = C999974CCB15BE1A71525735380F9F2B3D84B704F734CCEA9DFB2B02D299140C

    Process:

    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);

    Output:

    -
    encrypted_data = 2AA22937AAEE091A898926996CD6AF9F50030F64766F53943B6C834779643971582012CD4AC08D29D3CF34C57E6B598469E4852173E0071237CF35207691567826987E8856CAC4485F04B87B50DF10C089C524CC25E3718BC20D8E661A61BBC888BB0EC244DF2C766B462453FC576820D6C0DC253FF1873DC20B70344C22E71A86AB9FBE5DDCDC25E2FD37EAC43E4CC6F89206D26103CA8D877776F9494D9D54473E7A1A7ED815633AD3107B27933759D7FD93868C96F4EE36A268547C1E36F016E331AA5E1F2EBDDC5D381F5149AAD73B37EA375030BF1E7E537C30AA7F4BC16B9E394A1EE14A39A2233F69F69E1177C298B5CFA8216A3DB2E09A7B98C3DE609D0ECA405796BBFBED9EDF4C8CC048957AAE7EF2634F25B2656DD6DA6E0B31246E78A44605FEEACE9296843DD86AA46290337B48F3058E989C443887664B3A9CC28A333C8031AB776D893C2A5B67D115
    +
    encrypted_data = 43B58FB3C3D12AFCE51B4DEA2511C55B73FF1AB30F1B6237E7748AA38A5521830D374B878D70617ED153DA684245C422FC52F80A5DABB1E14D90D3DB688759EF5D220069D33E64BE07B0C416EDE8CE755322FD36284F6C92127F6FA08EABF37F3BF2586779306B2B65D29470AC9FD28A767E2B8F67DDDBB0C5ED9AECB1F430DB284AAF487F8E8823DC285F43931D4C316AE869D98E329B7B3DB04C82228442ADFCB86A1A28F414F4BB67456A35BE9DBE0C922B841270D7F61FABC8F8E8B124B0A12A9DF3A796D823EABB640EDB6434702AA541B5C1253EB8B1A0EB1713D242C9F2A383AEE1764763C2EEE3B21612738E41094DD230D907338AC30442E952C525BCA32412899F72D5D3FA5A47B1674A2824978BC8414201C0B8B7074C5D3AA758411C630A90D381D5834DF7295A7A933C6D779D87831401483299F4101300B3CF2F7AF32C16377FF0BA111F5DCFB0FF2F

    The length of the final string is 336 bytes.

    7.2) set_client_DH_params query

    Sent payload (excluding transport headers/trailers):

    -
    0000 | 00 00 00 00 00 00 00 00 70 CC 03 00 A7 E3 53 65
    -0010 | 78 01 00 00 1F 5F 04 F5 87 54 F2 3A B4 CF 8B 0A
    -0020 | 3C 1A 5F 51 8A B8 E7 94 71 35 4E 3E 4E 79 EA 40
    -0030 | FF 69 78 AC 3E 15 77 69 FE 50 01 00 2A A2 29 37
    -0040 | AA EE 09 1A 89 89 26 99 6C D6 AF 9F 50 03 0F 64
    -0050 | 76 6F 53 94 3B 6C 83 47 79 64 39 71 58 20 12 CD
    -0060 | 4A C0 8D 29 D3 CF 34 C5 7E 6B 59 84 69 E4 85 21
    -0070 | 73 E0 07 12 37 CF 35 20 76 91 56 78 26 98 7E 88
    -0080 | 56 CA C4 48 5F 04 B8 7B 50 DF 10 C0 89 C5 24 CC
    -0090 | 25 E3 71 8B C2 0D 8E 66 1A 61 BB C8 88 BB 0E C2
    -00A0 | 44 DF 2C 76 6B 46 24 53 FC 57 68 20 D6 C0 DC 25
    -00B0 | 3F F1 87 3D C2 0B 70 34 4C 22 E7 1A 86 AB 9F BE
    -00C0 | 5D DC DC 25 E2 FD 37 EA C4 3E 4C C6 F8 92 06 D2
    -00D0 | 61 03 CA 8D 87 77 76 F9 49 4D 9D 54 47 3E 7A 1A
    -00E0 | 7E D8 15 63 3A D3 10 7B 27 93 37 59 D7 FD 93 86
    -00F0 | 8C 96 F4 EE 36 A2 68 54 7C 1E 36 F0 16 E3 31 AA
    -0100 | 5E 1F 2E BD DC 5D 38 1F 51 49 AA D7 3B 37 EA 37
    -0110 | 50 30 BF 1E 7E 53 7C 30 AA 7F 4B C1 6B 9E 39 4A
    -0120 | 1E E1 4A 39 A2 23 3F 69 F6 9E 11 77 C2 98 B5 CF
    -0130 | A8 21 6A 3D B2 E0 9A 7B 98 C3 DE 60 9D 0E CA 40
    -0140 | 57 96 BB FB ED 9E DF 4C 8C C0 48 95 7A AE 7E F2
    -0150 | 63 4F 25 B2 65 6D D6 DA 6E 0B 31 24 6E 78 A4 46
    -0160 | 05 FE EA CE 92 96 84 3D D8 6A A4 62 90 33 7B 48
    -0170 | F3 05 8E 98 9C 44 38 87 66 4B 3A 9C C2 8A 33 3C
    -0180 | 80 31 AB 77 6D 89 3C 2A 5B 67 D1 15
    +
    0000 | 00 00 00 00 00 00 00 00 20 92 03 00 78 2F 55 65
    +0010 | 78 01 00 00 1F 5F 04 F5 2E 43 2C 2D 21 17 81 12
    +0020 | 6D A7 CE 6E F1 B7 45 6B 3F BD 31 0C 0C C8 47 30
    +0030 | 39 A6 A5 A4 4C 02 D5 01 FE 50 01 00 43 B5 8F B3
    +0040 | C3 D1 2A FC E5 1B 4D EA 25 11 C5 5B 73 FF 1A B3
    +0050 | 0F 1B 62 37 E7 74 8A A3 8A 55 21 83 0D 37 4B 87
    +0060 | 8D 70 61 7E D1 53 DA 68 42 45 C4 22 FC 52 F8 0A
    +0070 | 5D AB B1 E1 4D 90 D3 DB 68 87 59 EF 5D 22 00 69
    +0080 | D3 3E 64 BE 07 B0 C4 16 ED E8 CE 75 53 22 FD 36
    +0090 | 28 4F 6C 92 12 7F 6F A0 8E AB F3 7F 3B F2 58 67
    +00A0 | 79 30 6B 2B 65 D2 94 70 AC 9F D2 8A 76 7E 2B 8F
    +00B0 | 67 DD DB B0 C5 ED 9A EC B1 F4 30 DB 28 4A AF 48
    +00C0 | 7F 8E 88 23 DC 28 5F 43 93 1D 4C 31 6A E8 69 D9
    +00D0 | 8E 32 9B 7B 3D B0 4C 82 22 84 42 AD FC B8 6A 1A
    +00E0 | 28 F4 14 F4 BB 67 45 6A 35 BE 9D BE 0C 92 2B 84
    +00F0 | 12 70 D7 F6 1F AB C8 F8 E8 B1 24 B0 A1 2A 9D F3
    +0100 | A7 96 D8 23 EA BB 64 0E DB 64 34 70 2A A5 41 B5
    +0110 | C1 25 3E B8 B1 A0 EB 17 13 D2 42 C9 F2 A3 83 AE
    +0120 | E1 76 47 63 C2 EE E3 B2 16 12 73 8E 41 09 4D D2
    +0130 | 30 D9 07 33 8A C3 04 42 E9 52 C5 25 BC A3 24 12
    +0140 | 89 9F 72 D5 D3 FA 5A 47 B1 67 4A 28 24 97 8B C8
    +0150 | 41 42 01 C0 B8 B7 07 4C 5D 3A A7 58 41 1C 63 0A
    +0160 | 90 D3 81 D5 83 4D F7 29 5A 7A 93 3C 6D 77 9D 87
    +0170 | 83 14 01 48 32 99 F4 10 13 00 B3 CF 2F 7A F3 2C
    +0180 | 16 37 7F F0 BA 11 1F 5D CF B0 FF 2F

    Payload (de)serialization:

    set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;
    nonce 4, 168754F23AB4CF8B0A3C1A5F518AB8E7942E432C2D211781126DA7CE6EF1B7456B Value generated by client in Step 1
    server_nonce 20, 1671354E3E4E79EA40FF6978AC3E1577693FBD310C0CC8473039A6A5A44C02D501 Value received from server in Step 2
    g_b 36, 260FE00010089EEA25E4698E4AA56CC3BBF 4398CA8A8C46402A51ECF96CA7370740 47E0A835BE831839026ED65C714B74B1 13B258DFA74E472DB4B1A7C5AA41B369 A361F92399B8D741BF4146593022CEA4 E3E9DFE7900A5A2289BD8A546E586BF4 30E1411AFFA9C63C60AF79326F7D515B 5FA4424BA06B67B4AD3DE23C8F4FC113 079E030357BA3AA97A836C3A744C478C ACAE1C62D795B6705972C816F1882269 9490D7F4A3C63BF6E3D43F370D405B07 5C2F333F1AEF1CA63BEDC373FD4C6509 C837A65805BAE993B07F0CE563A8DE70 3389059245ACC381837821589EFC6443 9A225D7646DDE471D4D8167B9BF21A2B 2AB06839CC595848B5D671BB78AA0C24
    1A4B4AFC
    FE00010026B5658C749730885AEFB395 6B27BA6B24B3C50C6C7D9C986ECC9D71 F8904E9A79018EC2034732C8D6FAC1FC 3F01AC6DC40FBBF5EF171D21CACB6307 6FB71312AFB39C73B4AF3CFF0DC6D168 1382A92A88253166FE0E20162E80C745 D560670C9B1C66F885C4C8137376C1A4 882FE8A4D6BAA59460D86AE479D1E9E3 DF5007FC1CB208B0B385618D28DDD046 EFB21D03A6718AB9F87D7168084EF550 5419C00CF6A4A9F3968A376AE99F84FB 48A949D821AA7EE3044BDA1399359008 9FCA46DEF8A42CC7F3B8E062A64C4B16 45A1B16333A406D345772ABDFDB2B76A 6E5D6C2D4CEC8734CD47359F478F90CB BE211A11F62AD73455637B86689BE476
    05CAA2B4
    Single-byte prefix denoting length, a 256-byte (2048-bit) string, and zero bytes of padding
    @@ -746,7 +746,7 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);< - + @@ -764,19 +764,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);< - + - + - + @@ -785,17 +785,17 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);<
    8) Auth key generation

    The client computes the auth_key using formula g_a^b mod dh_prime:

    -
    auth_key = 2814F03C98D79F97E37918AA54005773E19CF04FA1DEDF6CEF5A28B649CB335AA5C899A91EA062083CC0755E26F6AED4878C7E55CE33C8DFDC9F9A5729BD0B256BDDC6F5A568A709CB2E1ECB5DF262CC552AFF9DA9114C9EB01BAAC2A640CB801EE4630BCD5AD80983641B9911B0511958373DF15DFE156D6FA4991CCECBB01C42C10AAC4801F2DFF1725BA2A582388940D45958F742B0FF09CFE60BEB0971B1BF8CCD438A8F1BB77B2DD8A7325133C890B9905625404DB5A34B6838E6DBD001DEA92F6C9010A8AFC37888038D4DA8A3476E129ED2948ECE2A394943BA060CBA4BD790D6219CCE39547E49BD7920FA79C53D3530CDFE24875C6ECD300D1D5020
    +
    auth_key = 80E188CDCC0FEBB560B9E1F8A2D8803A8E52EF0C629EB73E75B2C197971A4EBBD1ACA56D902A5D2CF9D6BB7E64853EE4606A66663D0590607DEFAB61D0548D2FCC12DF1F39C9A94FB41EFF7FEDAE2786F92C8208EE10118751AEBFE73A77F5F8A0ECA63FDC7F157DE28AED3F5E5A7BA1049ED69E30BFB66A62AFE75267D5857895D452D0EF9297C9B705DE40E414749C876A40DE99A9EDE803B39F2B74A613311F9ACB14146173048C1931E36984ADF1A8D52C35EA9EEDBDE5F9F9D718EBA2E5F1F16A4DA33C7FD3608FC36FF068EB6CED61F229850BCA84E33606F2456F0DC921F482DFB13FA35013D6010A545DCF1519FD53781C47EE4F2E0376673B4C3783
    9) Final server reply

    The server verifies and confirms that auth_key_hash is unique: since it's unique, it replies with the following:

    Received payload (excluding transport headers/trailers):

    -
    0000 | 00 00 00 00 00 00 00 00 01 E0 C4 5B A8 E3 53 65
    -0010 | 38 00 00 00 34 F7 CB 3B 87 54 F2 3A B4 CF 8B 0A
    -0020 | 3C 1A 5F 51 8A B8 E7 94 71 35 4E 3E 4E 79 EA 40
    -0030 | FF 69 78 AC 3E 15 77 69 16 C8 ED 7B 97 0A 71 7A
    -0040 | F6 E4 86 DB 8C 8D 3A C4
    +
    0000 | 00 00 00 00 00 00 00 00 01 A8 DE 97 78 2F 55 65
    +0010 | 5C 00 00 00 34 F7 CB 3B 2E 43 2C 2D 21 17 81 12
    +0020 | 6D A7 CE 6E F1 B7 45 6B 3F BD 31 0C 0C C8 47 30
    +0030 | 39 A6 A5 A4 4C 02 D5 01 D5 89 78 EF 7B 68 27 29
    +0040 | 4A 27 29 83 33 1E D6 87

    Payload (de)serialization:

    dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;
    message_id 8, 870CC0300A7E3536520920300782F5565 Message ID generated as specified here » (unixtime() << 32) + (N*4)
    nonce 24, 168754F23AB4CF8B0A3C1A5F518AB8E7942E432C2D211781126DA7CE6EF1B7456B Value generated by client in Step 1
    server_nonce 40, 1671354E3E4E79EA40FF6978AC3E1577693FBD310C0CC8473039A6A5A44C02D501 Value received from server in Step 2
    encrypted_data 56, 340FE5001002AA22937AAEE091A89892699 6CD6AF9F50030F64766F53943B6C8347 79643971582012CD4AC08D29D3CF34C5 7E6B598469E4852173E0071237CF3520 7691567826987E8856CAC4485F04B87B 50DF10C089C524CC25E3718BC20D8E66 1A61BBC888BB0EC244DF2C766B462453 FC576820D6C0DC253FF1873DC20B7034 4C22E71A86AB9FBE5DDCDC25E2FD37EA C43E4CC6F89206D26103CA8D877776F9 494D9D54473E7A1A7ED815633AD3107B 27933759D7FD93868C96F4EE36A26854 7C1E36F016E331AA5E1F2EBDDC5D381F 5149AAD73B37EA375030BF1E7E537C30 AA7F4BC16B9E394A1EE14A39A2233F69 F69E1177C298B5CFA8216A3DB2E09A7B 98C3DE609D0ECA405796BBFBED9EDF4C 8CC048957AAE7EF2634F25B2656DD6DA 6E0B31246E78A44605FEEACE9296843D D86AA46290337B48F3058E989C443887 664B3A9CC28A333C8031AB776D893C2A
    5B67D115
    FE50010043B58FB3C3D12AFCE51B4DEA 2511C55B73FF1AB30F1B6237E7748AA3 8A5521830D374B878D70617ED153DA68 4245C422FC52F80A5DABB1E14D90D3DB 688759EF5D220069D33E64BE07B0C416 EDE8CE755322FD36284F6C92127F6FA0 8EABF37F3BF2586779306B2B65D29470 AC9FD28A767E2B8F67DDDBB0C5ED9AEC B1F430DB284AAF487F8E8823DC285F43 931D4C316AE869D98E329B7B3DB04C82 228442ADFCB86A1A28F414F4BB67456A 35BE9DBE0C922B841270D7F61FABC8F8 E8B124B0A12A9DF3A796D823EABB640E DB6434702AA541B5C1253EB8B1A0EB17 13D242C9F2A383AEE1764763C2EEE3B2 1612738E41094DD230D907338AC30442 E952C525BCA32412899F72D5D3FA5A47 B1674A2824978BC8414201C0B8B7074C 5D3AA758411C630A90D381D5834DF729 5A7A933C6D779D87831401483299F410 1300B3CF2F7AF32C16377FF0BA111F5D
    CFB0FF2F
    Encrypted client_DH_inner_data generated previously, serialized as a TL byte string
    @@ -817,13 +817,13 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);< - + - + @@ -835,19 +835,19 @@ encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);< - + - + - +
    message_id 8, 801E0C45BA8E3536501A8DE97782F5565 Message ID generated as specified here » (unixtime() << 32) + (N*4)
    message_length 16, 438000000 (56 in decimal)5C000000 (92 in decimal) Message body length
    nonce 24, 168754F23AB4CF8B0A3C1A5F518AB8E7942E432C2D211781126DA7CE6EF1B7456B Value generated by client in Step 1
    server_nonce 40, 1671354E3E4E79EA40FF6978AC3E1577693FBD310C0CC8473039A6A5A44C02D501 Value received from server in Step 2
    new_nonce_hash1 56, 1616C8ED7B970A717AF6E486DB8C8D3AC4D58978EF7B6827294A272983331ED687 The 128 lower-order bits of SHA1 of the byte string derived from the new_nonce string by adding a single byte with the value of 1, 2, or 3, and followed by another 8 bytes with auth_key_aux_hash. Different values are required to prevent an intruder from changing server response dh_gen_ok into dh_gen_retry.