From 8bd0435329eaf6c9065c565d647ef45eda5bad12 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 3 Oct 2023 19:05:00 +0000 Subject: [PATCH] Update content of files --- .../corefork.telegram.org/bots/webapps.html | 4 +- .../mtproto/samples-auth_key.html | 412 +++++++++--------- 2 files changed, 208 insertions(+), 208 deletions(-) diff --git a/data/web/corefork.telegram.org/bots/webapps.html b/data/web/corefork.telegram.org/bots/webapps.html index 21f0e24b0c..38a582204a 100644 --- a/data/web/corefork.telegram.org/bots/webapps.html +++ b/data/web/corefork.telegram.org/bots/webapps.html @@ -916,8 +916,8 @@

You can verify the integrity of the data received by comparing the received hash parameter with the hexadecimal representation of the HMAC-SHA-256 signature of the data-check-string with the secret key, which is the HMAC-SHA-256 signature of the bot's token with the constant string WebAppData used as a key.

Data-check-string is a chain of all received fields, sorted alphabetically, in the format key=<value> with a line feed character ('\n', 0x0A) used as separator – e.g., 'auth_date=<auth_date>\nquery_id=<query_id>\nuser=<user>'.

The full check might look like:

-
data_check_string = ...
-secret_key = HMAC_SHA256(;, "WebAppData")
+
data_check_string := ...
+secret_key := HMAC_SHA256(<bot_token>, "WebAppData")
 if (hex(HMAC_SHA256(data_check_string, secret_key)) == hash) {
   // data is from Telegram
 }
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 f0f300edcc..af15af9c5e 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 04 6E 08 00 91 60 1C 65
-0010 | 14 00 00 00 F1 8E 7E BE 76 55 34 97 7E 7D 6E EB
-0020 | BF 22 4D 1C 23 4A C2 88
+
0000 | 00 00 00 00 00 00 00 00 C0 DA 04 00 7E 62 1C 65
+0010 | 14 00 00 00 F1 8E 7E BE 17 2F 85 E7 17 61 F3 BB
+0020 | 2C BD BE 71 2D 1E AF E5

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 9C 53 57 91 60 1C 65
-0010 | 6C 00 00 00 63 24 16 05 76 55 34 97 7E 7D 6E EB
-0020 | BF 22 4D 1C 23 4A C2 88 59 3C 34 32 13 42 6C D2
-0030 | 20 8E 22 49 A7 E2 C5 FA 08 1B E9 B5 1A B4 FD 59
-0040 | EF 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 90 20 72 7E 62 1C 65
+0010 | 54 00 00 00 63 24 16 05 17 2F 85 E7 17 61 F3 BB
+0020 | 2C BD BE 71 2D 1E AF E5 88 17 DB E8 74 20 77 FA
+0030 | 5F 1C 0C 1C 6F F0 58 BD 08 15 17 74 9F 74 DE 35
+0040 | 09 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 = 2011337834907916783
-

Decompose into 2 prime cofactors p < q: 2011337834907916783 = 1164458353 * 1727273311

-
p = 1164458353
-q = 1727273311
+
pq = 1519811627470173449
+

Decompose into 2 prime cofactors p < q: 1519811627470173449 = 1196775271 * 1269922319

+
p = 1196775271
+q = 1269922319

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 1B E9 B5 1A B4 FD 59 EF 00 00 00
-0010 | 04 45 68 39 71 00 00 00 04 66 F4 19 5F 00 00 00
-0020 | 76 55 34 97 7E 7D 6E EB BF 22 4D 1C 23 4A C2 88
-0030 | 59 3C 34 32 13 42 6C D2 20 8E 22 49 A7 E2 C5 FA
-0040 | 5F 16 2B 23 C5 73 DA E0 D5 DE 9C 09 96 15 16 E8
-0050 | 0D D9 A9 FA 99 16 6F 8A 65 2F F8 EB E1 AD 35 30
+
0000 | 95 5F F5 A9 08 15 17 74 9F 74 DE 35 09 00 00 00
+0010 | 04 47 55 57 67 00 00 00 04 4B B1 7A 0F 00 00 00
+0020 | 17 2F 85 E7 17 61 F3 BB 2C BD BE 71 2D 1E AF E5
+0030 | 88 17 DB E8 74 20 77 FA 5F 1C 0C 1C 6F F0 58 BD
+0040 | 36 56 DB B3 F8 48 32 A4 08 55 5E 45 40 3D 6C CB
+0050 | E3 53 04 AD 6C 76 CC FA BB E7 E9 E8 98 35 C3 C1
 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 = 1727273311
- + - + - + - + - + - + @@ -291,39 +291,39 @@ q = 1727273311

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 = 955FF5A9081BE9B51AB4FD59EF00000004456839710000000466F4195F000000765534977E7D6EEBBF224D1C234AC288593C343213426CD2208E2249A7E2C5FA5F162B23C573DAE0D5DE9C09961516E80DD9A9FA99166F8A652FF8EBE1AD353002000000
-random_padding_bytes = E072931022DF619FAB9DF4CA248B60D849819621C492F8AADC3B464442E112D10E595AD3A2A619BB4C45EBF0A187D921EF744439CFAA1AC1CB0CA6F6D653FA532F6E99FA67268C48F20184907828D19F31BDC5AA4B585D591B8F56B2
+
data = 955FF5A9081517749F74DE35090000000447555767000000044BB17A0F000000172F85E71761F3BB2CBDBE712D1EAFE58817DBE8742077FA5F1C0C1C6FF058BD3656DBB3F84832A408555E45403D6CCBE35304AD6C76CCFABBE7E9E89835C3C102000000
+random_padding_bytes = 8053F00D9FE8DDFF7E3B727D6C3FC737B3C161C7B610EDDBF518944EEF2E6528718990D3F4C1CEF03DA6279DE5CB391A82C1E7019E5F74C26726BAD616B74C5046C642427C828189F291CFAE5D27736C67F819053E285E7D6C233380

And this is the output:

-
encrypted_data = 60CF219007695868E84EC1305C103320EFF892550ABC4F6CFC6B5B6597F946F6FB135EDAD741E7F783C729469D7A84B63AD2845076F087B0BED97C4A35C0C6619272BD8B5DF60376A4CCD3B906D791DBE768AFA84EED969F01A31DE75EA022A6492446C967180EA460DECF450155EF0B164B9F30A1CC9DC671393D0A92EE7CC71AD26B1A7FA411F2836D0FBDF8AEA3C6ADB8BEBD996A4B6B30F4E7019A3E636AC1B4480ABFAF43482860064FAF520B57A35B2FAEBB39E526B483824D709D0B6F3B1540DF13BD33251622F5952615FA4A616906CD441C94DB2A489A67749F560446C061D1E7F200A4290DCBB6845DBA2EB40E2ED4D9420C5304E25EE65F663BA5
+
encrypted_data = 9B64DCF6A1329BA6F9606B85898519BEEAC516D67B2CE01818B59ABA4857664D3B239FE4725D6BC3A8FADDCE726E0D74C86DBB45C2A84E81426D903F43D272DCB3C956ADDC1F070EFEC12BF2A6963CE675BE36A674F4763447AD1D8711119B87A60D3673739245FE3CDF745B5034E9967FAE70A98FFB49514EE9AF73FC82FE4B07FAB67E380937253028BA451C6CAC485FC04E8808BC90A18B38BAF246AC7F65ED6F014540A006285FF792CCF7B0E02580EE8486FDD2EADD4B98B8F806885C3DF0B1396D72FC14BD32F2520394853DA3CBE69582D4A5A04732E1BB456D8F010DF336D2F5C6CFC4540035E49639FEDFA9C31FAD6B44A6BC750B95319EAAEE19CA

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

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, 8046E080091601C65C0DA04007E621C65 Message ID generated as specified here » (unixtime() << 32) + (N*4)
nonce 24, 16765534977E7D6EEBBF224D1C234AC288172F85E71761F3BB2CBDBE712D1EAFE5 Random number
message_id 8, 8019C535791601C65019020727E621C65 Message ID generated as specified here » (unixtime() << 32) + (N*4)
message_length 16, 46C000000 (108 in decimal)54000000 (84 in decimal) Message body length
nonce 24, 16765534977E7D6EEBBF224D1C234AC288172F85E71761F3BB2CBDBE712D1EAFE5 Value generated by client in Step 1
server_nonce 40, 16593C343213426CD2208E2249A7E2C5FA8817DBE8742077FA5F1C0C1C6FF058BD Server-generated random number
pq 56, 12081BE9B51AB4FD59EF000000
TL byte deserialization
=> bigendian conversion to decimal
=> 2011337834907916783
081517749F74DE3509000000
TL byte deserialization
=> bigendian conversion to decimal
=> 1519811627470173449
Single-byte prefix denoting length, an 8-byte string, and three bytes of padding
pq 4, 12081BE9B51AB4FD59EF000000
TL byte deserialization
=> bigendian conversion to decimal
=> 2011337834907916783
081517749F74DE3509000000
TL byte deserialization
=> bigendian conversion to decimal
=> 1519811627470173449
Single-byte prefix denoting length, 8-byte string, and three bytes of padding
p 16, 80445683971000000
TL byte deserialization
=> bigendian conversion to decimal
=> 1164458353
0447555767000000
TL byte deserialization
=> bigendian conversion to decimal
=> 1196775271
First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding
q 24, 80466F4195F000000
TL byte deserialization
=> bigendian conversion to decimal
=> 1727273311
044BB17A0F000000
TL byte deserialization
=> bigendian conversion to decimal
=> 1269922319
Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding
nonce 32, 16765534977E7D6EEBBF224D1C234AC288172F85E71761F3BB2CBDBE712D1EAFE5 Value generated by client in Step 1
server_nonce 48, 16593C343213426CD2208E2249A7E2C5FA8817DBE8742077FA5F1C0C1C6FF058BD Value received from server in Step 2
new_nonce 64, 325F162B23C573DAE0D5DE9C09961516E8 0DD9A9FA99166F8A652FF8EBE1AD35303656DBB3F84832A408555E45403D6CCB E35304AD6C76CCFABBE7E9E89835C3C1 Client-generated random number
@@ -345,7 +345,7 @@ random_padding_bytes = E072931022DF619FAB9DF4CA248B60D849819621C492F8AADC3B46444 - + @@ -363,25 +363,25 @@ random_padding_bytes = E072931022DF619FAB9DF4CA248B60D849819621C492F8AADC3B46444 - + - + - + - + @@ -393,7 +393,7 @@ random_padding_bytes = E072931022DF619FAB9DF4CA248B60D849819621C492F8AADC3B46444 - + @@ -402,47 +402,47 @@ random_padding_bytes = E072931022DF619FAB9DF4CA248B60D849819621C492F8AADC3B46444
6) Server responds with:

Received payload (excluding transport headers/trailers):

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

Payload (de)serialization:

server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;
message_id 8, 8086E080091601C65C4DA04007E621C65 Message ID generated as specified here » (unixtime() << 32) + (N*4)
nonce 24, 16765534977E7D6EEBBF224D1C234AC288172F85E71761F3BB2CBDBE712D1EAFE5 Value generated by client in Step 1
server_nonce 40, 16593C343213426CD2208E2249A7E2C5FA8817DBE8742077FA5F1C0C1C6FF058BD Value received from server in Step 2
p 56, 80445683971000000
TL byte deserialization
=> bigendian conversion to decimal
=> 1164458353
0447555767000000
TL byte deserialization
=> bigendian conversion to decimal
=> 1196775271
First prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding
q 64, 80466F4195F000000
TL byte deserialization
=> bigendian conversion to decimal
=> 1727273311
044BB17A0F000000
TL byte deserialization
=> bigendian conversion to decimal
=> 1269922319
Second prime cofactor: single-byte prefix denoting length, 4-byte string, and three bytes of padding
encrypted_data 80, 260FE00010060CF219007695868E84EC130 5C103320EFF892550ABC4F6CFC6B5B65 97F946F6FB135EDAD741E7F783C72946 9D7A84B63AD2845076F087B0BED97C4A 35C0C6619272BD8B5DF60376A4CCD3B9 06D791DBE768AFA84EED969F01A31DE7 5EA022A6492446C967180EA460DECF45 0155EF0B164B9F30A1CC9DC671393D0A 92EE7CC71AD26B1A7FA411F2836D0FBD F8AEA3C6ADB8BEBD996A4B6B30F4E701 9A3E636AC1B4480ABFAF43482860064F AF520B57A35B2FAEBB39E526B483824D 709D0B6F3B1540DF13BD33251622F595 2615FA4A616906CD441C94DB2A489A67 749F560446C061D1E7F200A4290DCBB6 845DBA2EB40E2ED4D9420C5304E25EE6
5F663BA5
FE0001009B64DCF6A1329BA6F9606B85 898519BEEAC516D67B2CE01818B59ABA 4857664D3B239FE4725D6BC3A8FADDCE 726E0D74C86DBB45C2A84E81426D903F 43D272DCB3C956ADDC1F070EFEC12BF2 A6963CE675BE36A674F4763447AD1D87 11119B87A60D3673739245FE3CDF745B 5034E9967FAE70A98FFB49514EE9AF73 FC82FE4B07FAB67E380937253028BA45 1C6CAC485FC04E8808BC90A18B38BAF2 46AC7F65ED6F014540A006285FF792CC F7B0E02580EE8486FDD2EADD4B98B8F8 06885C3DF0B1396D72FC14BD32F25203 94853DA3CBE69582D4A5A04732E1BB45 6D8F010DF336D2F5C6CFC4540035E496 39FEDFA9C31FAD6B44A6BC750B95319E
AAEE19CA
Value generated above
@@ -464,13 +464,13 @@ random_padding_bytes = E072931022DF619FAB9DF4CA248B60D849819621C492F8AADC3B46444 - + - + @@ -482,19 +482,19 @@ random_padding_bytes = E072931022DF619FAB9DF4CA248B60D849819621C492F8AADC3B46444 - + - + - + @@ -502,20 +502,20 @@ random_padding_bytes = E072931022DF619FAB9DF4CA248B60D849819621C492F8AADC3B46444

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

-
encrypted_answer = 8AA09BF3CDAC35CD422CBBECA41EBB4AE6A9BF10F3F678315FEE25B9E7D3BDA4CF48353323F03B94CC5FDE5AAE99D008F2022DF5EB16B1F6D32B5BF2AB8E20AA1E99D972CDBEF6B13B2F4A1A2B9AA579B8F94FC8BFCF873872BFDBD03DA9E52E02823D6D5BFEEE17833DF02D87D411CD19B4AFB7D843F30601420346B322A831EC5157BC7FCD10A323A1E2EC206648F33C9F9A45B27A6BA7CC4055355E0933C42EA54A3ED9E680C236CA43D0ADB60639B919452F541841A5F2F9DFFE6FCA854ABB3024646C23E1F242C62A8816E246092031AAF6C8F35CE75FD46FFAE9F83AA6A9D81F4687F0D9EEB3633D7C3E346E087FB7A6D338C5FD3CFD8792B7AD9C79FFDDD4276D69579842DAABA08DD8B1C57EE4BDA434FF4045ABC9EFA826F9A5102E126B15222223173A369AE4260D8540DDD60AAD215A28A0903263F126605D814881CAD566E84132A6C0017EA7B1F63CA27429A7CC189D10A4E4271896DE6F0E077E69895DF9BC7DF5914604ACFDBBDAC95C0C175C040A268236EC29D810744BC85AD75AD27069AF96DF1C12BB99B9D7E2D2F4A29B2175A57647997DBBA3AF9FD7F0F6373AECDC8378AD001C05791979135BC539E1BDD221B1D130253DB310E9DCB0A67BF1C84915BA5AE9A92866C77E25AF04DD07FE26E56CE04E1490C021C67E8F61F817F0EE5536972C8F8D92C21A2313C9A824EDF5C7B1AAA370BCC83952EE10B9B36D91F0DDF88BDA98E0CE247B97A248AB8084E7D4488EB0099EE6F56E23505756F8014C26EF0E52916B3DEC5F4510AC0AD13F5E0AE75C2C069BF17923F5A77D6432F999DADBCE466F27AE21B8A6
-tmp_aes_key = 00957C715B8E1E63150F7124A4836143E1E185A67B7558EE95A7C9D6E2ED1674
-tmp_aes_iv = 12FD28AFDDC00AE7C9C4AB10E46045991452F0301725D23563C0E0135F162B23
+
encrypted_answer = 613EF99416A06493A862CC34AC4DAD0CA634F4168F80A8718575FF5142CE9F1573C3251D6CF21280805ACF1022A9B4D1C2697CF0B8EFA3ADE105EF95233C169166EDEC2F7B930F2C6384900AD8E01AE90818D0D7CF3B4AACABA8AF05EA879E93F345B3DF653DF023F8E84D6C298FEC7D91A0311B2E5F7A293AB3478BD51DC18A00E31E826A495FD4F7A7455E4EE5FE852723E2B5877DE24FCAA5C9E64A858B460427D4055AD345811401FED39A21DC6A9DECB796302BBBA687751C8E88847631C0A59DFFDBFC719D07105C50BEFCE89BBD61CCEF86B192BF80CFD42BB18349D25558A41108D6C7EBD203DA4B14E38CAFC80B97071EC8EABBEB5CCACD336039850729BD21E4A1D3659DF3FD381E79EEA0EC711A0D15AEB0D9A269C300AA65E41CE59CAB4604DF245D26FC8613D1562375D178B7E72749C1C17175F8E82DED77FA4268E123AB08B6661D94F7394045623D5CBA6BB93D8274FF1F73E5490AB7AF0E383BD9FCE46869392527B632C7950B9B9594D8F73E4EFEEB5E32242B5560244341894F2F7E8D5763AE604861FB2E79EC345F702B3A30DEF41F81C61822183A9CC0F161874806DB55F723A95D52A76B71ED38AFAF12925D6CDBD54C41D893621C60BB348941479AF313A59541EC869BE8A470488E19977B70B47D748C3555821FC7E8134E3044FA7F74AC2D4960EE4EE02349DDC34BCFC20A4321BC082FC1476669FAB54BB8F5EB07A98AD73BA04AEE46C6F3768CB0B6BB7DA6DD5CED7E72E110321A31C0F9775D4B4D897709C0783EFA269D195C41C1F8A96F7875D20141F23B3BE53CF44023D28BAFEABACC7E701B08
+tmp_aes_key = 27E43D018B2EF8AF3395B27B19DF173DD09438278E712FB63CDDEBBEAE0CBE6C
+tmp_aes_iv = EA31E588F2C4D371DD73B81C016BC9B12BDF9B29AB42D106FD2CCED63656DBB3

Yielding:

-
answer_with_hash = 8B47B67C90587A880847DEA7635FDF16C04C3A36BA0D89B5765534977E7D6EEBBF224D1C234AC288593C343213426CD2208E2249A7E2C5FA03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001005E59B593235434AAC7B56E20D2CF1EE2EED93E6AA8B6735AEF7E7A4AE0C4EA235054FFA861EF09C93CDCE4906F44A948943D3C3F761DF381439F44B043C848AF40076A3BA53D9CAB17FAAA4FFC75D6BFD0067BF3A2E34329D89A3EA091120CAAAA3606DD7D71AF8DBDCFC4A002A1A8B6DDE48E583144E42EBF4359104D0E9A813214C0E2A68D63AC0306C8F8883F5CC8C65D78712C8B35EB089231DA4E985C9ED6550785230186B525B87DE2B1AEA6B5D2D7AD113B856F08DE959F5C91EC28CBF596FF7A16C4F3FC618B7EAD59274A1CD45DEA44EEF64BEB4BF6701E1569BA37018BE538DAC9BE7FF598CF26EBDC8B9F0CB30A68557762634056DE151139633391601C65E1451B24376CEBC0
-answer = BA0D89B5765534977E7D6EEBBF224D1C234AC288593C343213426CD2208E2249A7E2C5FA03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001005E59B593235434AAC7B56E20D2CF1EE2EED93E6AA8B6735AEF7E7A4AE0C4EA235054FFA861EF09C93CDCE4906F44A948943D3C3F761DF381439F44B043C848AF40076A3BA53D9CAB17FAAA4FFC75D6BFD0067BF3A2E34329D89A3EA091120CAAAA3606DD7D71AF8DBDCFC4A002A1A8B6DDE48E583144E42EBF4359104D0E9A813214C0E2A68D63AC0306C8F8883F5CC8C65D78712C8B35EB089231DA4E985C9ED6550785230186B525B87DE2B1AEA6B5D2D7AD113B856F08DE959F5C91EC28CBF596FF7A16C4F3FC618B7EAD59274A1CD45DEA44EEF64BEB4BF6701E1569BA37018BE538DAC9BE7FF598CF26EBDC8B9F0CB30A68557762634056DE151139633391601C65E1451B24376CEBC0
+
answer_with_hash = CEDFCC7073A25B1887B35BCB78F39E386AA06D63BA0D89B5172F85E71761F3BB2CBDBE712D1EAFE58817DBE8742077FA5F1C0C1C6FF058BD03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001008DC5651CB12C9F356AB2D51621AEA73B50365C5F8B5E1C9CFFD296864FCD931229EBB650607C26795A923E81CEC067A22712D1D35F5D9D99013F3B3E39A6C3C9CE38F95F53299F56F9C6792594848AA5C803D1607ACEA125619CB5624D3BE2A47C904B3FA402AE8691B8038676326CF6ED55C1E42229621F09E6B6EA0138FF63C03C185112A6C735BFF2D7C62595F570721CCDB915AFE67D16BAF8ADF660F8F15C6BC9C8C6C23B74C28DDF5626CA97B6007EB475F1D30FA5D37D5EC17830B66C8BE78FD5DFA136B98ADAE360ED6FD3082E3B6205B811102977A298620E965B8FBC5756CD76D738AADCF2CB69D3D0D4E4294F64CD70993FCCEF275191A92D00B47E621C65614B3887B7E3A96A
+answer = BA0D89B5172F85E71761F3BB2CBDBE712D1EAFE58817DBE8742077FA5F1C0C1C6FF058BD03000000FE000100C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5BFE0001008DC5651CB12C9F356AB2D51621AEA73B50365C5F8B5E1C9CFFD296864FCD931229EBB650607C26795A923E81CEC067A22712D1D35F5D9D99013F3B3E39A6C3C9CE38F95F53299F56F9C6792594848AA5C803D1607ACEA125619CB5624D3BE2A47C904B3FA402AE8691B8038676326CF6ED55C1E42229621F09E6B6EA0138FF63C03C185112A6C735BFF2D7C62595F570721CCDB915AFE67D16BAF8ADF660F8F15C6BC9C8C6C23B74C28DDF5626CA97B6007EB475F1D30FA5D37D5EC17830B66C8BE78FD5DFA136B98ADAE360ED6FD3082E3B6205B811102977A298620E965B8FBC5756CD76D738AADCF2CB69D3D0D4E4294F64CD70993FCCEF275191A92D00B47E621C65614B3887B7E3A96A

Generated payload (excluding transport headers/trailers):

-
0000 | BA 0D 89 B5 76 55 34 97 7E 7D 6E EB BF 22 4D 1C
-0010 | 23 4A C2 88 59 3C 34 32 13 42 6C D2 20 8E 22 49
-0020 | A7 E2 C5 FA 03 00 00 00 FE 00 01 00 C7 1C AE B9
+
0000 | BA 0D 89 B5 17 2F 85 E7 17 61 F3 BB 2C BD BE 71
+0010 | 2D 1E AF E5 88 17 DB E8 74 20 77 FA 5F 1C 0C 1C
+0020 | 6F F0 58 BD 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 = BA0D89B5765534977E7D6EEBBF224D1C234AC288593C343213426CD2208E2249A7E2C5F
 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 | 5E 59 B5 93 23 54 34 AA C7 B5 6E 20 D2 CF 1E E2
-0140 | EE D9 3E 6A A8 B6 73 5A EF 7E 7A 4A E0 C4 EA 23
-0150 | 50 54 FF A8 61 EF 09 C9 3C DC E4 90 6F 44 A9 48
-0160 | 94 3D 3C 3F 76 1D F3 81 43 9F 44 B0 43 C8 48 AF
-0170 | 40 07 6A 3B A5 3D 9C AB 17 FA AA 4F FC 75 D6 BF
-0180 | D0 06 7B F3 A2 E3 43 29 D8 9A 3E A0 91 12 0C AA
-0190 | AA 36 06 DD 7D 71 AF 8D BD CF C4 A0 02 A1 A8 B6
-01A0 | DD E4 8E 58 31 44 E4 2E BF 43 59 10 4D 0E 9A 81
-01B0 | 32 14 C0 E2 A6 8D 63 AC 03 06 C8 F8 88 3F 5C C8
-01C0 | C6 5D 78 71 2C 8B 35 EB 08 92 31 DA 4E 98 5C 9E
-01D0 | D6 55 07 85 23 01 86 B5 25 B8 7D E2 B1 AE A6 B5
-01E0 | D2 D7 AD 11 3B 85 6F 08 DE 95 9F 5C 91 EC 28 CB
-01F0 | F5 96 FF 7A 16 C4 F3 FC 61 8B 7E AD 59 27 4A 1C
-0200 | D4 5D EA 44 EE F6 4B EB 4B F6 70 1E 15 69 BA 37
-0210 | 01 8B E5 38 DA C9 BE 7F F5 98 CF 26 EB DC 8B 9F
-0220 | 0C B3 0A 68 55 77 62 63 40 56 DE 15 11 39 63 33
-0230 | 91 60 1C 65
+0130 | 8D C5 65 1C B1 2C 9F 35 6A B2 D5 16 21 AE A7 3B +0140 | 50 36 5C 5F 8B 5E 1C 9C FF D2 96 86 4F CD 93 12 +0150 | 29 EB B6 50 60 7C 26 79 5A 92 3E 81 CE C0 67 A2 +0160 | 27 12 D1 D3 5F 5D 9D 99 01 3F 3B 3E 39 A6 C3 C9 +0170 | CE 38 F9 5F 53 29 9F 56 F9 C6 79 25 94 84 8A A5 +0180 | C8 03 D1 60 7A CE A1 25 61 9C B5 62 4D 3B E2 A4 +0190 | 7C 90 4B 3F A4 02 AE 86 91 B8 03 86 76 32 6C F6 +01A0 | ED 55 C1 E4 22 29 62 1F 09 E6 B6 EA 01 38 FF 63 +01B0 | C0 3C 18 51 12 A6 C7 35 BF F2 D7 C6 25 95 F5 70 +01C0 | 72 1C CD B9 15 AF E6 7D 16 BA F8 AD F6 60 F8 F1 +01D0 | 5C 6B C9 C8 C6 C2 3B 74 C2 8D DF 56 26 CA 97 B6 +01E0 | 00 7E B4 75 F1 D3 0F A5 D3 7D 5E C1 78 30 B6 6C +01F0 | 8B E7 8F D5 DF A1 36 B9 8A DA E3 60 ED 6F D3 08 +0200 | 2E 3B 62 05 B8 11 10 29 77 A2 98 62 0E 96 5B 8F +0210 | BC 57 56 CD 76 D7 38 AA DC F2 CB 69 D3 D0 D4 E4 +0220 | 29 4F 64 CD 70 99 3F CC EF 27 51 91 A9 2D 00 B4 +0230 | 7E 62 1C 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, 801E8D4F691601C6501AC6CFB7E621C65 Message ID generated as specified here » (unixtime() << 32) + (N*4)
message_length 16, 478020000 (632 in decimal)CC020000 (716 in decimal) Message body length
nonce 24, 16765534977E7D6EEBBF224D1C234AC288172F85E71761F3BB2CBDBE712D1EAFE5 Value generated by client in Step 1
server_nonce 40, 16593C343213426CD2208E2249A7E2C5FA8817DBE8742077FA5F1C0C1C6FF058BD Value received from server in Step 2
encrypted_answer 56, 596FE5002008AA09BF3CDAC35CD422CBBEC A41EBB4AE6A9BF10F3F678315FEE25B9 E7D3BDA4CF48353323F03B94CC5FDE5A AE99D008F2022DF5EB16B1F6D32B5BF2 AB8E20AA1E99D972CDBEF6B13B2F4A1A 2B9AA579B8F94FC8BFCF873872BFDBD0 3DA9E52E02823D6D5BFEEE17833DF02D 87D411CD19B4AFB7D843F30601420346 B322A831EC5157BC7FCD10A323A1E2EC 206648F33C9F9A45B27A6BA7CC405535 5E0933C42EA54A3ED9E680C236CA43D0 ADB60639B919452F541841A5F2F9DFFE 6FCA854ABB3024646C23E1F242C62A88 16E246092031AAF6C8F35CE75FD46FFA E9F83AA6A9D81F4687F0D9EEB3633D7C 3E346E087FB7A6D338C5FD3CFD8792B7 AD9C79FFDDD4276D69579842DAABA08D D8B1C57EE4BDA434FF4045ABC9EFA826 F9A5102E126B15222223173A369AE426 0D8540DDD60AAD215A28A0903263F126 605D814881CAD566E84132A6C0017EA7 B1F63CA27429A7CC189D10A4E4271896 DE6F0E077E69895DF9BC7DF5914604AC FDBBDAC95C0C175C040A268236EC29D8 10744BC85AD75AD27069AF96DF1C12BB 99B9D7E2D2F4A29B2175A57647997DBB A3AF9FD7F0F6373AECDC8378AD001C05 791979135BC539E1BDD221B1D130253D B310E9DCB0A67BF1C84915BA5AE9A928 66C77E25AF04DD07FE26E56CE04E1490 C021C67E8F61F817F0EE5536972C8F8D 92C21A2313C9A824EDF5C7B1AAA370BC C83952EE10B9B36D91F0DDF88BDA98E0 CE247B97A248AB8084E7D4488EB0099E E6F56E23505756F8014C26EF0E52916B 3DEC5F4510AC0AD13F5E0AE75C2C069B F17923F5A77D6432F999DADBCE466F27
AE21B8A6
FE500200613EF99416A06493A862CC34 AC4DAD0CA634F4168F80A8718575FF51 42CE9F1573C3251D6CF21280805ACF10 22A9B4D1C2697CF0B8EFA3ADE105EF95 233C169166EDEC2F7B930F2C6384900A D8E01AE90818D0D7CF3B4AACABA8AF05 EA879E93F345B3DF653DF023F8E84D6C 298FEC7D91A0311B2E5F7A293AB3478B D51DC18A00E31E826A495FD4F7A7455E 4EE5FE852723E2B5877DE24FCAA5C9E6 4A858B460427D4055AD345811401FED3 9A21DC6A9DECB796302BBBA687751C8E 88847631C0A59DFFDBFC719D07105C50 BEFCE89BBD61CCEF86B192BF80CFD42B B18349D25558A41108D6C7EBD203DA4B 14E38CAFC80B97071EC8EABBEB5CCACD 336039850729BD21E4A1D3659DF3FD38 1E79EEA0EC711A0D15AEB0D9A269C300 AA65E41CE59CAB4604DF245D26FC8613 D1562375D178B7E72749C1C17175F8E8 2DED77FA4268E123AB08B6661D94F739 4045623D5CBA6BB93D8274FF1F73E549 0AB7AF0E383BD9FCE46869392527B632 C7950B9B9594D8F73E4EFEEB5E32242B 5560244341894F2F7E8D5763AE604861 FB2E79EC345F702B3A30DEF41F81C618 22183A9CC0F161874806DB55F723A95D 52A76B71ED38AFAF12925D6CDBD54C41 D893621C60BB348941479AF313A59541 EC869BE8A470488E19977B70B47D748C 3555821FC7E8134E3044FA7F74AC2D49 60EE4EE02349DDC34BCFC20A4321BC08 2FC1476669FAB54BB8F5EB07A98AD73B A04AEE46C6F3768CB0B6BB7DA6DD5CED 7E72E110321A31C0F9775D4B4D897709 C0783EFA269D195C41C1F8A96F7875D2 0141F23B3BE53CF44023D28BAFEABACC
7E701B08
See below
@@ -570,13 +570,13 @@ answer = BA0D89B5765534977E7D6EEBBF224D1C234AC288593C343213426CD2208E2249A7E2C5F - + - + @@ -594,13 +594,13 @@ answer = BA0D89B5765534977E7D6EEBBF224D1C234AC288593C343213426CD2208E2249A7E2C5F - + - + @@ -609,34 +609,34 @@ answer = BA0D89B5765534977E7D6EEBBF224D1C234AC288593C343213426CD2208E2249A7E2C5F
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 = B053907FBA6EE657355CE89C6C30AFCF55BE727393084452215BEE1EA901CFDC6F6FEB277C03B82E33029436B0185BC834188BF7983D010C749051840BFA5C661618C1AB94943EE2A24F8C7829A2A561FE219BF4E7337E1506F50C10FD2061D3D007D2AB0A5D07B620B8C12E156A58BEE675BA2C1FEB0D5A4F0F9B8F4CAD8AB51AE9FC0729B425C471E6D771AC836C5B6D96F3F135D21F6BA372ABD81DE4A14960B05E944DE545B8B93771FC4EB62E66164EE26621B18511854E551EA67191A3BD7B1424386D970F4527D2D58EFC959576426EA4E84117D7AA894A32888882747A852545F024C4986643E39D69E3C1EFFEBC4791E4CD7A253271488280294693
+
b = F226B4AB8313660386E985D25151773C42B73164114F9FC139B99799B052283CDCEA6EFCA93D07DA68897D2E5A6AA14AB38C57146984A9EE1F127265E7234E16C9C76EFD83CB5AA6A59FD26AC3146F7E3953EB56FA62207228CBB41774F49DFFC05C4D97A644D09999AAEB1A7A4A7167B83B82DD1877B95EACCC758D7779A98F3CEF3C781AE8BFB7B72B2E2AEBEC53651898396AFA006010DCC456A8703120852B0F460199AC160A52A083D4061DBBA105566E9478AE5B9CC2EF8A032A8358AC55B840C4F9A7DC70469A39F887E93489A72E2B492C5E88B94738900A6EF9CEF83A05F7410B720793BEA9C49440CB9543E081D2098C9F79FB1832DDF76F0AA0E1

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

-
g_b = 2194D68418CD6B3273273D213311CE848C584B03F8D62F6E3FB26DE670117CDC0206A7F958236C4D2611A43E554E2DF485794E0F40601648838850126FD9323BC686575165D1B13E2628F21B9D3697FA8A37890A281FDEDE9BBB8A69D74345124E5775961994DEBC1B51C2910DF142E1C637E1A20C98033D9CD49B2460AF21241AD7864C6BB4605419C99DC36F78FDED75073CE014619A43D8571C45BDBB79115BF985766E41E3D9590E9B318A102E3E0D80335B3E6715582E2C85FB183D119833812FCFB2F1629B727D929AB33ABD7CBD91F60AB53AE0ACD06A3DDAB60CCDC243B239466F048E76E733AB09CB488D67B075BB33A9FD2AFEF4DD19D3593E0200
+
g_b = 239C05827B2E75E7EA297C4E957EB25C0C4A2DD8BC20E36B17D3AE69943522CF0D09EC0720487AEFA88CCCC66ADA24887120D3F325E29C0200E63C38872FD9D514981EB2B18287413EB912FEA618766F1805984748BF59FBDB5E35A35B379960576AAE3B852DBD4D36C34EC9ADC15118CBF4EE83238D7BFEDF4DE0A408AC74F63273261D4678615D5A5ADF950D4FF9E2D441119976C79C56BD5343AC6C04697D115A5917AE29488EC9C8F10B7AC4836FDC36304464905392FA6FBADAB5E684D43616E03BDDF68C230A18A34642301EA7ACB0165C97B88E08BE2BADC95E75D4FC2F54C9ABE9B0F1C2BC2BBFD97AE9B44F186C498B3E6967DAC1E1E4AA5A8F3866
7.1) generation of encrypted_data

Generated payload (excluding transport headers/trailers):

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

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, 16765534977E7D6EEBBF224D1C234AC288172F85E71761F3BB2CBDBE712D1EAFE5 Value generated by client in Step 1
server_nonce 20, 16593C343213426CD2208E2249A7E2C5FA8817DBE8742077FA5F1C0C1C6FF058BD Value received from server in Step 2
g_a 300, 260FE0001005E59B593235434AAC7B56E20 D2CF1EE2EED93E6AA8B6735AEF7E7A4A E0C4EA235054FFA861EF09C93CDCE490 6F44A948943D3C3F761DF381439F44B0 43C848AF40076A3BA53D9CAB17FAAA4F FC75D6BFD0067BF3A2E34329D89A3EA0 91120CAAAA3606DD7D71AF8DBDCFC4A0 02A1A8B6DDE48E583144E42EBF435910 4D0E9A813214C0E2A68D63AC0306C8F8 883F5CC8C65D78712C8B35EB089231DA 4E985C9ED6550785230186B525B87DE2 B1AEA6B5D2D7AD113B856F08DE959F5C 91EC28CBF596FF7A16C4F3FC618B7EAD 59274A1CD45DEA44EEF64BEB4BF6701E 1569BA37018BE538DAC9BE7FF598CF26 EBDC8B9F0CB30A68557762634056DE15
11396333
FE0001008DC5651CB12C9F356AB2D516 21AEA73B50365C5F8B5E1C9CFFD29686 4FCD931229EBB650607C26795A923E81 CEC067A22712D1D35F5D9D99013F3B3E 39A6C3C9CE38F95F53299F56F9C67925 94848AA5C803D1607ACEA125619CB562 4D3BE2A47C904B3FA402AE8691B80386 76326CF6ED55C1E42229621F09E6B6EA 0138FF63C03C185112A6C735BFF2D7C6 2595F570721CCDB915AFE67D16BAF8AD F660F8F15C6BC9C8C6C23B74C28DDF56 26CA97B6007EB475F1D30FA5D37D5EC1 7830B66C8BE78FD5DFA136B98ADAE360 ED6FD3082E3B6205B811102977A29862 0E965B8FBC5756CD76D738AADCF2CB69 D3D0D4E4294F64CD70993FCCEF275191
A92D00B4
g_a diffie-hellman parameter
server_time 560, 491601C65 (1696358545 in decimal)7E621C65 (1696359038 in decimal) Server time
@@ -658,19 +658,19 @@ answer = BA0D89B5765534977E7D6EEBBF224D1C234AC288593C343213426CD2208E2249A7E2C5F - + - + - + @@ -684,47 +684,47 @@ answer = BA0D89B5765534977E7D6EEBBF224D1C234AC288593C343213426CD2208E2249A7E2C5F

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 = 54B64366765534977E7D6EEBBF224D1C234AC288593C343213426CD2208E2249A7E2C5FA0000000000000000FE0001002194D68418CD6B3273273D213311CE848C584B03F8D62F6E3FB26DE670117CDC0206A7F958236C4D2611A43E554E2DF485794E0F40601648838850126FD9323BC686575165D1B13E2628F21B9D3697FA8A37890A281FDEDE9BBB8A69D74345124E5775961994DEBC1B51C2910DF142E1C637E1A20C98033D9CD49B2460AF21241AD7864C6BB4605419C99DC36F78FDED75073CE014619A43D8571C45BDBB79115BF985766E41E3D9590E9B318A102E3E0D80335B3E6715582E2C85FB183D119833812FCFB2F1629B727D929AB33ABD7CBD91F60AB53AE0ACD06A3DDAB60CCDC243B239466F048E76E733AB09CB488D67B075BB33A9FD2AFEF4DD19D3593E0200
-padding = AA0DFD317572F5C32CABE4C2
-tmp_aes_key = 00957C715B8E1E63150F7124A4836143E1E185A67B7558EE95A7C9D6E2ED1674
-tmp_aes_iv = 12FD28AFDDC00AE7C9C4AB10E46045991452F0301725D23563C0E0135F162B23
+
data = 54B64366172F85E71761F3BB2CBDBE712D1EAFE58817DBE8742077FA5F1C0C1C6FF058BD0000000000000000FE000100239C05827B2E75E7EA297C4E957EB25C0C4A2DD8BC20E36B17D3AE69943522CF0D09EC0720487AEFA88CCCC66ADA24887120D3F325E29C0200E63C38872FD9D514981EB2B18287413EB912FEA618766F1805984748BF59FBDB5E35A35B379960576AAE3B852DBD4D36C34EC9ADC15118CBF4EE83238D7BFEDF4DE0A408AC74F63273261D4678615D5A5ADF950D4FF9E2D441119976C79C56BD5343AC6C04697D115A5917AE29488EC9C8F10B7AC4836FDC36304464905392FA6FBADAB5E684D43616E03BDDF68C230A18A34642301EA7ACB0165C97B88E08BE2BADC95E75D4FC2F54C9ABE9B0F1C2BC2BBFD97AE9B44F186C498B3E6967DAC1E1E4AA5A8F3866
+padding = F71920395D1DC608B1E457B5
+tmp_aes_key = 27E43D018B2EF8AF3395B27B19DF173DD09438278E712FB63CDDEBBEAE0CBE6C
+tmp_aes_iv = EA31E588F2C4D371DD73B81C016BC9B12BDF9B29AB42D106FD2CCED63656DBB3

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 = AFB299B11F6CAA228AC43D729E476482AAD236FAFE1BC6B11B454694BD11C6A4634FD9488C40C148169805B867D35746FB9FB39864906D50FE2035A19C8C90328F8761A4CC85E709889CE0A42E1861D1DAD925A148EC0F57BFDFC909687924D8731E8FA8109DC1BDEE29E67FCEBB865E4A58B9A27D58A56DF8FC9C70CF44BBB6F4D9E55BD1BE629ABEF83A44D18AF6ABCB94D2E521F2808A18047BA6639ABEAE9701C1D5A98EFE53E4131E582D1A041A2222CCDDB62F4446697226C374F15405F4E56FFAA648270E70EEEF18855C59E4E0B16CD85B902EE9AA4E205342385A1357D3B155EE04DE58BAD21A5400E373D56F1F159AF84FEE0AB8B290C913ECA62AF2702D1BE61279FE1170041BA274F854F28C358494B833CDC45E5BD5B75A8196EEA8B3D277A951D25EC45B0D9C83D8E45AEF29F2685B6F40F98A9A8B29FCE84EF4873758B6DF36B1E8E665BC5952086F
+
encrypted_data = 3E0F2FF2F1AD61511CEE9C91A06607A63F2C2AC4D9EB416C9AF137C66E9F0BB8C8ACAFA9D30695842206A873099F3935F812B570669EDAB1775DCA7811F49B41ABABC932ED325C804726BEAAABC52C40A39A97E75171B75CFB13ECF58BED2E14D411EAA7CB098FA49DBA15FFAE05E2E35963BA622862BADE2CB1A1608A5E9ACCF8B02F6FAA4DC092A25051533302B6FF9A3939C0FCD92AB0237A499C9112BA91BF2801C0987F54760BF3422A68C435AE5E75AEC837015A41587EAF32E715A7C767FC19F94AA21444FB3A6BAC1B6B8CD0A9118374C7D96B3A31740655A162777BF6487E160E6C8C0EAD25DA521414BF1A1C002F69C8A5C6BD2557389EB9BC94ED34CD7D6C657D2B1000853746B113C01581E05ED400156C55ED44EF01B19E2137A9B39018403EA767D212284F89E08946C43B80270BDD852FDC41BCDE540F491B03C80AF0BCE8F1905A709CAB8D96B2BA

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

Payload (de)serialization:

set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;
nonce 4, 16765534977E7D6EEBBF224D1C234AC288172F85E71761F3BB2CBDBE712D1EAFE5 Value generated by client in Step 1
server_nonce 20, 16593C343213426CD2208E2249A7E2C5FA8817DBE8742077FA5F1C0C1C6FF058BD Value received from server in Step 2
g_b 36, 260FE0001002194D68418CD6B3273273D21 3311CE848C584B03F8D62F6E3FB26DE6 70117CDC0206A7F958236C4D2611A43E 554E2DF485794E0F4060164883885012 6FD9323BC686575165D1B13E2628F21B 9D3697FA8A37890A281FDEDE9BBB8A69 D74345124E5775961994DEBC1B51C291 0DF142E1C637E1A20C98033D9CD49B24 60AF21241AD7864C6BB4605419C99DC3 6F78FDED75073CE014619A43D8571C45 BDBB79115BF985766E41E3D9590E9B31 8A102E3E0D80335B3E6715582E2C85FB 183D119833812FCFB2F1629B727D929A B33ABD7CBD91F60AB53AE0ACD06A3DDA B60CCDC243B239466F048E76E733AB09 CB488D67B075BB33A9FD2AFEF4DD19D3
593E0200
FE000100239C05827B2E75E7EA297C4E 957EB25C0C4A2DD8BC20E36B17D3AE69 943522CF0D09EC0720487AEFA88CCCC6 6ADA24887120D3F325E29C0200E63C38 872FD9D514981EB2B18287413EB912FE A618766F1805984748BF59FBDB5E35A3 5B379960576AAE3B852DBD4D36C34EC9 ADC15118CBF4EE83238D7BFEDF4DE0A4 08AC74F63273261D4678615D5A5ADF95 0D4FF9E2D441119976C79C56BD5343AC 6C04697D115A5917AE29488EC9C8F10B 7AC4836FDC36304464905392FA6FBADA B5E684D43616E03BDDF68C230A18A346 42301EA7ACB0165C97B88E08BE2BADC9 5E75D4FC2F54C9ABE9B0F1C2BC2BBFD9 7AE9B44F186C498B3E6967DAC1E1E4AA
5A8F3866
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 = A941A8D95B595167A3FE292EFDFB885DBEAD9716334438E13E6F472A3960617160978AE50F4CFF8ECE62106A3BBDE68BAF9D20D4D40AA9F5E3A21175E60CDE3CB59C2C92C0B9F917B4747F90C81FF83AB7BF2F19F6468806B7071A14B268AD16D5DD8EFB28B51C75C4EC23CE306CF8C4A845C7A4557C66F1D7E3716914D86466E9E49472025574F1A2DC39A5F096A6AA2DACE51699000B07DCEF0AE1D7E1CB98F6D99E1075180AFCD34DA733A8324FFAC52C0FD07BEF7B2389F66CB93E56A3FCEF60B9359FAC4995CA4191A9CACFC925A5811C66DDC33E1E6ACCAA89CD2D66E2E13C6C391BE1A3BCF025D8E786826F642132B6574044CF265024F9285DCF85CE
+
auth_key = 12B3496D5E5E73291DB22E1E140DC8C9D2B569ABA651275EAFAE0E56B5865BC50C5A3456B950816E5705E1CBB079E0EFF02462FEFBC3B681DE961B60FCD1B3539F889CC64B94DA5EE3439BF17CD8623714CAEF251BAE413C25B1733BECB79E9D1A45171F40ED5736A56364728C9F91C701F26A7E2BA4F2522CD4AA5CC4E066744EB7F7BF0DED165B8BE91E2AF6029D4B9298672356DA5BE13F233C2CF4C99CB772AECCE8C9B9E76DA2C55778B7DF0F15DF01125EAAF6C79A465A6B156887D2B4E8CFCA64ACE735729EA480BFD042D5AD5CBE205084B08144F7BC2F4DC51792A387843652EC5BDFE8E4F481A90647D11FA850C37838FBB3D2FA149621415E006C
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 50 64 51 92 60 1C 65
-0010 | 8C 00 00 00 34 F7 CB 3B 76 55 34 97 7E 7D 6E EB
-0020 | BF 22 4D 1C 23 4A C2 88 59 3C 34 32 13 42 6C D2
-0030 | 20 8E 22 49 A7 E2 C5 FA F7 4A 93 E6 31 3F EA 9A
-0040 | 22 76 BA B6 5C 81 2D F7
+
0000 | 00 00 00 00 00 00 00 00 01 64 D1 47 7F 62 1C 65
+0010 | 7C 00 00 00 34 F7 CB 3B 17 2F 85 E7 17 61 F3 BB
+0020 | 2C BD BE 71 2D 1E AF E5 88 17 DB E8 74 20 77 FA
+0030 | 5F 1C 0C 1C 6F F0 58 BD FF D0 9D 43 DE EA B2 E7
+0040 | A4 1B 02 9F 38 2B 10 3A

Payload (de)serialization:

dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;
message_id 8, 80C6E080091601C6508B205007E621C65 Message ID generated as specified here » (unixtime() << 32) + (N*4)
nonce 24, 16765534977E7D6EEBBF224D1C234AC288172F85E71761F3BB2CBDBE712D1EAFE5 Value generated by client in Step 1
server_nonce 40, 16593C343213426CD2208E2249A7E2C5FA8817DBE8742077FA5F1C0C1C6FF058BD Value received from server in Step 2
encrypted_data 56, 340FE500100AFB299B11F6CAA228AC43D72 9E476482AAD236FAFE1BC6B11B454694 BD11C6A4634FD9488C40C148169805B8 67D35746FB9FB39864906D50FE2035A1 9C8C90328F8761A4CC85E709889CE0A4 2E1861D1DAD925A148EC0F57BFDFC909 687924D8731E8FA8109DC1BDEE29E67F CEBB865E4A58B9A27D58A56DF8FC9C70 CF44BBB6F4D9E55BD1BE629ABEF83A44 D18AF6ABCB94D2E521F2808A18047BA6 639ABEAE9701C1D5A98EFE53E4131E58 2D1A041A2222CCDDB62F4446697226C3 74F15405F4E56FFAA648270E70EEEF18 855C59E4E0B16CD85B902EE9AA4E2053 42385A1357D3B155EE04DE58BAD21A54 00E373D56F1F159AF84FEE0AB8B290C9 13ECA62AF2702D1BE61279FE1170041B A274F854F28C358494B833CDC45E5BD5 B75A8196EEA8B3D277A951D25EC45B0D 9C83D8E45AEF29F2685B6F40F98A9A8B 29FCE84EF4873758B6DF36B1E8E665BC
5952086F
FE5001003E0F2FF2F1AD61511CEE9C91 A06607A63F2C2AC4D9EB416C9AF137C6 6E9F0BB8C8ACAFA9D30695842206A873 099F3935F812B570669EDAB1775DCA78 11F49B41ABABC932ED325C804726BEAA ABC52C40A39A97E75171B75CFB13ECF5 8BED2E14D411EAA7CB098FA49DBA15FF AE05E2E35963BA622862BADE2CB1A160 8A5E9ACCF8B02F6FAA4DC092A2505153 3302B6FF9A3939C0FCD92AB0237A499C 9112BA91BF2801C0987F54760BF3422A 68C435AE5E75AEC837015A41587EAF32 E715A7C767FC19F94AA21444FB3A6BAC 1B6B8CD0A9118374C7D96B3A31740655 A162777BF6487E160E6C8C0EAD25DA52 1414BF1A1C002F69C8A5C6BD2557389E B9BC94ED34CD7D6C657D2B1000853746 B113C01581E05ED400156C55ED44EF01 B19E2137A9B39018403EA767D212284F 89E08946C43B80270BDD852FDC41BCDE 540F491B03C80AF0BCE8F1905A709CAB
8D96B2BA
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, 80150645192601C650164D1477F621C65 Message ID generated as specified here » (unixtime() << 32) + (N*4)
message_length 16, 48C000000 (140 in decimal)7C000000 (124 in decimal) Message body length
nonce 24, 16765534977E7D6EEBBF224D1C234AC288172F85E71761F3BB2CBDBE712D1EAFE5 Value generated by client in Step 1
server_nonce 40, 16593C343213426CD2208E2249A7E2C5FA8817DBE8742077FA5F1C0C1C6FF058BD Value received from server in Step 2
new_nonce_hash1 56, 16F74A93E6313FEA9A2276BAB65C812DF7FFD09D43DEEAB2E7A41B029F382B103A 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.