A WhatsApp end-to-end encryption key acquisition method and device and related medium

By communicating with the WhatsApp server through the noise and opaque protocols and combining them with decryption algorithms to obtain the end-to-end encryption key, the problem of users being unable to view and edit WhatsApp end-to-end encrypted data is solved, achieving efficient and secure data decryption and editing.

CN115767518BActive Publication Date: 2025-12-30AFIRSTSOFT CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211379759.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-04
Publication Date
2025-12-30
Estimated Expiration
2042-11-04

AI Technical Summary

Technical Problem

In the current WhatsApp end-to-end encryption feature, users cannot view or edit encrypted data themselves, and traditional key acquisition methods are inefficient, have a high error rate, and cannot be decrypted in non-WhatsApp environments.

Method used

By establishing communication with the WhatsApp server through the noise protocol, and combining the opaque protocol and decryption algorithm, the end-to-end encryption key is obtained and decrypted, thereby enabling the decryption and editing of the WhatsApp crypt15 encrypted database.

Benefits of technology

Users can quickly and intuitively view and edit WhatsApp chat backup data in non-WhatsApp environments, improving the efficiency and security of key acquisition and reducing the error rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115767518B_ABST
    Figure CN115767518B_ABST
Patent Text Reader

Abstract

The application discloses a WhatsApp end-to-end encryption key acquisition method and device and related media, and the method comprises the following steps: establishing communication with a WhatsApp server through a noise protocol; based on a noise protocol framework, sending an acquisition key information request to the WhatsApp server, and gradually receiving key information returned by the WhatsApp server; and using a decryption algorithm to decrypt the key information to obtain an end-to-end encryption key. The application combines the noise protocol and the opaque protocol, sends a backup password corresponding to an account, receives the end-to-end encryption key of WhatsApp, and then decrypts the WhatsApp crypt15 encryption database through the key, so that the user can freely view and edit the backup data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer software technology, and in particular to a method, apparatus and related medium for obtaining end-to-end encryption keys for WhatsApp. Background Technology

[0002] WhatsApp Messenger, or WhatsApp for short, is a cross-platform encrypted instant messaging application for smartphones. It allows users to make voice and video calls over the internet and send text messages, documents, PDFs, pictures, videos, music, contact information, user location, and audio recordings to other users using standard mobile network phone numbers. WhatsApp Messenger supports cloud backup on both Android and iOS systems. Android uses Google Drive for cloud backup, while iOS uses iCloud. To further enhance the security of user chat data, WhatsApp employs end-to-end encryption, replacing traditional key-based encryption with end-to-end key-based encryption for chat data backed up to the cloud.

[0003] Prior to the introduction of end-to-end encryption, WhatsApp used traditional keys to encrypt chat data. These keys were used not only for database encryption but also for encrypting chat data transmission. Chat databases encrypted using traditional keys are represented as crypt12 or crypt14, and methods for obtaining the keys to crypt12 or crypt14 encrypted databases exist. However, these methods are not applicable to crypt15 encrypted databases generated by end-to-end encryption.

[0004] For the crypt15 type encrypted database generated by the end-to-end encryption function, there are currently two ways to obtain its private key. One is for the user to set a password themselves, and the other is for WhatsApp to generate a 64-bit key image. However, the latter method requires the user to manually save the image and manually enter the 64-bit key the next time they need to use the decryption database. Therefore, obtaining the private key through this method is inefficient and has a high error rate. Furthermore, because it requires saving an image instead of text, the storage cost is also high. Additionally, this method can only be used within WhatsApp itself; users cannot view the encrypted backup data content, nor can they modify or transfer it. Summary of the Invention

[0005] This invention provides a method, apparatus, computer device, and storage medium for obtaining end-to-end encryption keys for WhatsApp, aiming to enable users to freely view and edit backup data.

[0006] In a first aspect, embodiments of the present invention provide a method for obtaining end-to-end encryption keys for WhatsApp, including:

[0007] Establish communication with the WhatsApp server via the noise protocol;

[0008] Based on the noise protocol framework, a request to obtain key information is sent to the WhatsApp server, and the key information returned by the WhatsApp server is received step by step.

[0009] The key information is decrypted using a decryption algorithm to obtain the end-to-end encryption key.

[0010] Secondly, embodiments of the present invention provide a device for obtaining end-to-end encryption keys for WhatsApp, comprising:

[0011] A communication establishment unit is used to establish communication with the WhatsApp server via the noise protocol.

[0012] The private key receiving unit is used to send a request to the WhatsApp server to obtain key information based on the noise protocol framework, and to receive the key information returned by the WhatsApp server step by step.

[0013] The decryption processing unit is used to decrypt the key information using a decryption algorithm to obtain an end-to-end encryption key.

[0014] Thirdly, embodiments of the present invention provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the WhatsApp end-to-end encryption key acquisition method as described in the first aspect.

[0015] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the WhatsApp end-to-end encryption key acquisition method as described in the first aspect.

[0016] This invention provides a method, apparatus, computer device, and storage medium for obtaining end-to-end encryption keys for WhatsApp. The method includes: establishing communication with a WhatsApp server via a noise protocol; sending a request to the WhatsApp server to obtain key information based on the noise protocol framework, and progressively receiving key information returned by the WhatsApp server; and decrypting the key information using a decryption algorithm to obtain the end-to-end encryption key. This invention combines the noise and opaque protocols, sending the backup password for the corresponding account to receive the end-to-end encryption key for WhatsApp. This key is then used to decrypt the WhatsApp crypt15 encrypted database, thus enabling users to freely view and edit backup data. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart illustrating a method for obtaining an end-to-end encryption key for WhatsApp, provided in an embodiment of the present invention;

[0019] Figure 2 A schematic diagram of a sub-process of a WhatsApp end-to-end encryption key acquisition method provided in an embodiment of the present invention;

[0020] Figure 3 This is a schematic diagram of another sub-process of a method for obtaining an end-to-end encryption key for WhatsApp, provided in an embodiment of the present invention.

[0021] Figure 4 A schematic block diagram of a WhatsApp end-to-end encryption key acquisition device provided in an embodiment of the present invention;

[0022] Figure 5 This is a schematic sub-block diagram of a WhatsApp end-to-end encryption key acquisition device provided in an embodiment of the present invention;

[0023] Figure 6 Another schematic block diagram of a WhatsApp end-to-end encryption key acquisition device provided in an embodiment of the present invention. Detailed Implementation

[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0025] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0026] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0027] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0028] Please see below. Figure 1 , Figure 1 The flowchart of a method for obtaining an end-to-end encryption key for WhatsApp provided in an embodiment of the present invention specifically includes steps S101 to S103.

[0029] S101. Establish communication with the WhatsApp server via the noise protocol;

[0030] S102. Based on the noise protocol framework, send a request to the WhatsApp server to obtain key information, and gradually receive the key information returned by the WhatsApp server.

[0031] S103. The key information is decrypted using a decryption algorithm to obtain an end-to-end encryption key.

[0032] In this embodiment, the first step is the preparation work before obtaining the end-to-end encryption key. After successfully logging in, the WhatsApp client establishes a handshake connection with the WhatsApp server via the noise protocol. Next, it sends a request to the WhatsApp server to obtain key information and gradually receives the private key information returned by the WhatsApp server. Then, it can decrypt the received private key information using a decryption algorithm to obtain the end-to-end encryption private key. This end-to-end encryption private key can then be used to view, modify, and transmit encrypted backup data.

[0033] This embodiment, through the WhatsApp end-to-end encryption key acquisition method, primarily aims to address the problems in existing solutions: users cannot directly view encrypted data or decrypt it themselves when using WhatsApp's end-to-end encryption function. Specifically, this embodiment simulates logging into WhatsApp on a terminal device and obtaining the end-to-end encryption key. It integrates the necessary user credentials and constructs key request structure data, sending them to the WhatsApp E2E server. By combining XMPP, noise, and opaque protocols, a backup password for the corresponding account is sent, thereby receiving the WhatsApp end-to-end encryption key. This key is then used to decrypt the WhatsApp crypt15 encrypted database.

[0034] The WhatsApp end-to-end encryption key acquisition method described in this embodiment allows for the decryption of the WhatsApp end-to-end encrypted crypt15 database using third-party programs or tools. It also enables intuitive viewing and editing of the WhatsApp chat backup database. Furthermore, the method described in this embodiment decrypts the WhatsApp crypt15 database without using the WhatsApp program. Compared to existing technologies, this embodiment can decrypt the WhatsApp end-to-end encrypted crypt15 database and perform database viewing, editing, and saving operations intuitively, quickly, and efficiently, thus solving the problems of existing solutions.

[0035] In one embodiment, such as Figure 2 As shown, step S101 includes steps S201 to S204.

[0036] S201. Configure the first private key pair when logging into the account;

[0037] S202, Send a communication connection request to the WhatsApp server and configure a second private key pair;

[0038] S203. After establishing a communication connection with the WhatsApp server, use the second private key to send communication check information.

[0039] S204. Receive feedback information from the WhatsApp server regarding the communication check information, confirming that the communication connection with the WhatsApp server has been successfully established.

[0040] In this embodiment, before establishing communication with the WhatsApp server, preparations are first made to obtain the end-to-end encryption key. A handshake connection is established with the WhatsApp server via the noise protocol. Specifically, the protocol algorithm is Noise_XX_25519_AESGCM_SHA256, the target domain is g.whatsapp.net, the port number is 5222, and the prologueid (representing the sequence number) is 0x02054157. When logging into the account, a key pair is randomly generated, namely the first private key pair, named client_static_private and client_static_public, which represent the user's connection private key and user connection public key, respectively. Then, during the handshake with the WhatsApp server, a temporary key pair needs to be randomly generated, namely the second private key pair, named client_ephemeral_private and client_ephemeral_public, respectively. After the handshake begins, a Client Hello message (i.e., the communication check message) is sent to the WhatsApp server. This check message consists of an unencrypted client_ephemeral_public message. Correspondingly, a Server Hello message is received from the WhatsApp server, thus obtaining the server's temporary public key and other payload data. It can be understood that the above steps constitute the handshake process in the noise protocol, specifically including three processes: client hello, server hello, and client finish. Client hello indicates that the client sends a message containing the temporary connection public key, and server hello indicates that the server sends a message containing the temporary service public key, an encrypted static service public key, and encrypted payload data. The entire received data is collectively referred to as the Server hello message.

[0041] After the handshake is complete, the client_static_public key encrypted using Elasticsearch (ES) and the User-Agent payload encrypted using Dexterity Optimization (DH) (server_ephemeral_public, client_static_private) are sent. The User-Agent payload contains information about the current terminal device, the WhatsApp version, and the user's phone number. It's important to note that the ES encryption of the connection's static public key is a step in the noise protocol. DH, on the other hand, is an elliptic curve key exchange algorithm, used by the client and server to decrypt the same data without knowing each other's private keys. For detailed encryption steps, refer to the Elliptic Curve Cryptography (ECC) algorithm. Once the handshake is successful, the WhatsApp server returns a success message, the current timestamp, and other information (such as the connection port number and assigned routing information).

[0042] In one embodiment, step S102 includes:

[0043] The system uses the opaque protocol to send configuration information retrieval requests, initial login requests, login start information, and login end information to the WhatsApp server, and then receives the return information from the WhatsApp server step by step.

[0044] In one specific embodiment, the step of sending configuration information retrieval requests, initial login requests, start login information, and end login information to the WhatsApp server via the opaque protocol, and progressively receiving return information from the WhatsApp server, includes:

[0045] A configuration information retrieval request is sent to the WhatsApp server via the opaque protocol; wherein the data format of the configuration information retrieval request is xmpp format;

[0046] The system gradually receives configuration information returned by the WhatsApp server, including routing information, connection type, current account synchronization method, and GCM ID information.

[0047] Based on the configuration information, an initial login request is sent to the WhatsApp server via the opaque protocol; wherein the initial login request contains XMPP format data of type GET.

[0048] Receive initial login information returned by the WhatsApp server; wherein, the initial login information includes the hk_pub public key, ok_pub public key, and ed_pub public key and the corresponding public key signature.

[0049] In this embodiment, a request to obtain configuration information is first sent to the WhatsApp server. The original data is in XMPP format, and this request is encrypted using the noise protocol framework before being sent. Then, configuration information returned by the WhatsApp server is received step by step. This configuration information may include routing information, connection type, current account synchronization method, GCM ID, etc. When the aforementioned configuration information can be received, it indicates that normal communication with the server is possible. Subsequently, based on the noise protocol framework, a message requesting initial login is sent via the opaque protocol. This initial login request contains XMPP data of type GET, "init_login", and the string "api_version=2". The XMPP data containing the string is encrypted and sent to the server, indicating that the initial login operation is about to begin. Then, the data returned by WhatsApp is received accordingly. After decryption, several public keys are obtained, including hk_pub, ok_pub, ed_pub, and the corresponding signature.

[0050] Furthermore, in another specific embodiment, the step of sending configuration information retrieval requests, initial login requests, start login information, and end login information to the WhatsApp server via the opaque protocol, and progressively receiving the return information from the WhatsApp server, also includes:

[0051] The login start information is sent to the WhatsApp server via the opaque protocol; wherein, the login start information includes login credential request data;

[0052] Receive the login start information returned by the WhatsApp server and log in, and receive the login credential response data returned by the WhatsApp server upon successful login;

[0053] Send login termination information to the WhatsApp server via the opaque protocol; wherein, the login termination information includes login credential completion data;

[0054] The login credential completion data is obtained based on the decryption results of the opaque protocol and the login credential response data.

[0055] The login credentials are sent to the WhatsApp server, and the key information returned by the WhatsApp server is received.

[0056] In this embodiment, based on the noise protocol framework, a login start message or a "CreateCredentialRequest" (i.e., a login credential creation request) is sent via the opaque protocol. Specifically, it includes encrypted data of type GET and type L1. This data is sent to the server via the noise framework. When the server verifies the correct password, WhatsApp receives the returned data, decrypts it, and obtains the data needed for subsequent steps.

[0057] In a specific embodiment, generating L1 data specifically includes:

[0058] Obtain the user's backup password and then use an unintentional pseudo-random function to randomly process the user's backup password;

[0059] Obtain the public key information from the first private key pair, and select any random number. Combine the randomly processed user backup password with the public key information and the random array to form the login credential request information.

[0060] In other words, the L1 data consists of the user-set backup password processed by the oprf::blind algorithm, plus a random number and the public key from a randomly generated key pair. It's important to note that the oprf::blind algorithm refers to OPRF, or oblivious pseudo-random function. The oprf::blind algorithm can also be replaced by the OPRF algorithm of DH (Elliptic Curve Key Exchange), whose mathematical formula is Fa(x) = H'(H(x)a). After successful login, the WhatsApp end-to-end server returns L2 data, which is decrypted to obtain the subsequent required data. Here, L1 and L2 data are identifiers used by WhatsApp in the opaque protocol. In the original opaque protocol, L1 corresponds to the login credential request data, and L2 corresponds to the login credential response data.

[0061] Subsequently, based on the noise protocol framework, a login termination message, or "CreateCredentialRequest," is sent via the opaque protocol. This generates encrypted data of type GET and type "l3" (in the opaque protocol, l3 represents login credential completion data), which is also sent to the server via the noise framework. Next, the opaque protocol process and l2 decryption yield the required ke3_message, session_key, and export_key. The ke3_message is the aforementioned l3 data, i.e., the login credential completion data. The session key and export key are used for subsequent decryption. The WhatsApp server then returns data with a success identifier.

[0062] In one embodiment, such as Figure 3 As shown, step S103 includes steps S301 to S304.

[0063] S301. Use protobuf technology to parse the key information to obtain the corresponding key ciphertext and key IV value;

[0064] S302. Use the AES GCM algorithm to decrypt the key ciphertext and the key IV value to obtain encrypted data;

[0065] S303. Use protobuf technology to parse the encrypted data to obtain the corresponding encrypted ciphertext and encrypted IV value;

[0066] S304. The encrypted ciphertext and encrypted IV value are decrypted using the AES GCM algorithm to obtain the end-to-end encryption key.

[0067] In this embodiment, the private key information (i.e., the data with the success identifier) ​​is parsed using protobuf to obtain the ciphertext and IV value of the key; then it is decrypted using the AES GCM algorithm, with the key being the first 16 bytes of the aforementioned session_key, thus obtaining a new string of encrypted data; then the newly obtained encrypted data is also parsed using protobuf to obtain the encrypted ciphertext and IV value; subsequently, it is decrypted again using the AES GCM algorithm, with the key being the first 16 bytes of the aforementioned export_key, thus obtaining the required WhatsApp end-to-end encryption key. The reason for using the AES GCM algorithm twice for decryption is that the opaque protocol used by the WhatsApp server encrypts the data twice: the first time decrypts the data returned from the opaque protocol framework, and the second time decrypts the contained data.

[0068] The AES GCM algorithm described in this embodiment refers to the Advanced Encryption Standard (AES), also known as Rijndael encryption, a block cipher standard. In cryptography, Galois / Counter mode (GCM) is an operational mode of symmetric-key block ciphers, widely adopted due to its performance. This operation is an authenticated encryption algorithm designed to provide data authenticity (integrity) and confidentiality. GCM is defined for block ciphers with a block size of 128 bits.

[0069] Figure 4 This is a schematic block diagram of a WhatsApp end-to-end encryption key acquisition device 400 provided in an embodiment of the present invention. The device 400 includes:

[0070] The communication establishment unit 401 is used to establish communication with the WhatsApp server via the noise protocol.

[0071] The private key receiving unit 402 is used to send a request to the WhatsApp server to obtain key information based on the noise protocol framework, and to receive the key information returned by the WhatsApp server step by step.

[0072] The decryption processing unit 403 is used to decrypt the key information using a decryption algorithm to obtain an end-to-end encryption key.

[0073] In one embodiment, such as Figure 5 As shown, the communication establishment unit 401 includes:

[0074] The first configuration unit 501 is used to configure the first private key pair when logging in to the account;

[0075] The second configuration unit 502 is used to send a communication connection request to the WhatsApp server and configure a second private key pair;

[0076] The communication inspection unit 503 is used to send communication inspection information using the second private key pair after establishing a communication connection with the WhatsApp server through a handshake.

[0077] The successful connection unit 504 is used to receive feedback information from the WhatsApp server regarding the communication check information, confirming that the communication connection with the WhatsApp server has been successfully established.

[0078] In one embodiment, the private key receiving unit 402 includes:

[0079] The sending and receiving unit is used to send configuration information retrieval requests, initial login requests, start login information, and end login information to the WhatsApp server via the opaque protocol, and to receive the return information from the WhatsApp server step by step.

[0080] In one embodiment, the transmitting and receiving unit includes:

[0081] A configuration information sending unit is used to send a configuration information retrieval request to the WhatsApp server via the opaque protocol; wherein the data format of the configuration information retrieval request is xmpp format;

[0082] The configuration information receiving unit is used to receive configuration information returned by the WhatsApp server step by step, wherein the configuration information includes routing information, connection type, current account synchronization method, and GCM ID information.

[0083] An initialization information sending unit is used to send an initialization login request to the WhatsApp server via the opaque protocol based on the configuration information; wherein the initialization login request is XMPP format data containing GET type data;

[0084] An initialization information receiving unit is used to receive initialization login information returned by the WhatsApp server; wherein, the initialization login information includes the hk_pub public key, the ok_pub public key, and the ed_pub public key, as well as the corresponding public key signatures.

[0085] In one embodiment, the transmitting and receiving unit further includes:

[0086] A login start sending unit is used to send login start information to the WhatsApp server via the opaque protocol; wherein, the login start information includes login credential request data;

[0087] The credential response receiving unit is used to receive the login start information returned by the WhatsApp server and log in, and to receive the login credential response data returned by the WhatsApp server upon successful login;

[0088] The login termination sending unit is used to send login termination information to the WhatsApp server via the opaque protocol; wherein, the login termination information includes login credential completion data;

[0089] The credential completion acquisition unit is used to acquire login credential completion data based on the decryption result of the opaque protocol and the login credential response data.

[0090] The credential completion sending unit is used to send the login credential completion data to the WhatsApp server and receive the key information returned by the WhatsApp server.

[0091] In one embodiment, the WhatsApp end-to-end encryption key acquisition device 400 further includes:

[0092] A random processing unit is used to obtain the user's backup password and perform random processing on the user's backup password using an unintentional pseudo-random function;

[0093] The information component unit is used to obtain the public key information in the first private key pair, and to select any random number to combine the randomly processed user backup password with the public key information and the random array to form the login credential request information.

[0094] In one embodiment, such as Figure 6 As shown, the decryption processing unit 403 includes:

[0095] The first parsing unit 601 is used to parse the key information using protobuf technology to obtain the corresponding key ciphertext and key IV value;

[0096] The first decryption unit 602 is used to decrypt the key ciphertext and the key IV value using the AES GCM algorithm to obtain encrypted data;

[0097] The second parsing unit 603 is used to parse the encrypted data using protobuf technology to obtain the corresponding encrypted ciphertext and encrypted IV value;

[0098] The second decryption unit 604 is used to decrypt the encrypted ciphertext and the encrypted IV value using the AES GCM algorithm to obtain the end-to-end encryption key.

[0099] Since the embodiments of the apparatus and the embodiments of the method correspond to each other, please refer to the description of the embodiments of the method for the embodiments of the apparatus, which will not be repeated here.

[0100] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed, can perform the steps provided in the above embodiments. The storage medium may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0101] This invention also provides a computer device, which may include a memory and a processor. The memory stores a computer program, and when the processor calls the computer program in the memory, it can implement the steps provided in the above embodiments. Of course, the computer device may also include various network interfaces, power supplies, and other components.

[0102] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.

[0103] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A method for obtaining an end-to-end encryption key of WhatsApp, characterized in that, The application relates to a method for establishing communication with a WhatsApp server through a noise protocol. The method comprises the following steps: establishing communication with the WhatsApp server through the noise protocol; sending a secret key information acquisition request to the WhatsApp server based on a noise protocol framework, and gradually receiving secret key information returned by the WhatsApp server; decrypting the secret key information by using a decryption algorithm to obtain an end-to-end encryption secret key; decrypting the secret key information by using a decryption algorithm to obtain an end-to-end encryption secret key, which comprises the following steps: decrypting the secret key information by using a decryption algorithm to obtain an end-to-end encryption secret key, which comprises the following steps: decrypting the secret key information by using a decryption algorithm to obtain an end-to-end encryption secret key, which comprises the following steps: decrypting the secret key information by using a decryption algorithm to obtain an end-to-end encryption secret key, which comprises the following steps:

2. The method for obtaining the end-to-end encryption key of WhatsApp according to claim 1, wherein, decrypting the secret key information by using a decryption algorithm to obtain an end-to-end encryption secret key, which comprises the following steps: The method comprises the following steps: configuring a first private key pair when logging in an account; sending a communication connection request to the WhatsApp server and configuring a second private key pair; sending communication check information by using the second private key pair when a handshake connection communication with the WhatsApp server is established; 3.The method of claim 2, wherein, receiving feedback information of the communication check information returned by the WhatsApp server, and confirming that the communication connection with the WhatsApp server is successfully established. The method comprises the following steps:

4. The method for obtaining the end-to-end encryption key of WhatsApp according to claim 3, characterized in that, sending configuration information acquisition requests, initialization login requests, start login information and end login information to the WhatsApp server through an opaque protocol, and gradually receiving return information of the WhatsApp server. The method comprises the following steps: sending configuration information acquisition requests, initialization login requests, start login information and end login information to the WhatsApp server through an opaque protocol, and gradually receiving return information of the WhatsApp server. sending a configuration information acquisition request to the WhatsApp server through an opaque protocol; wherein the data format of the configuration information acquisition request is xmpp format; gradually receiving configuration information returned by the WhatsApp server, wherein the configuration information comprises routing information, connection type, current account synchronization mode and GCM ID information; sending an initialization login request to the WhatsApp server based on the configuration information through an opaque protocol; wherein the initialization login request is xmpp format data containing a get type; receiving initialization login information returned by the WhatsApp server; wherein the initialization login information comprises hk_pub, ok_pub and ed_pub public keys and corresponding public key signatures.

5. The method of claim 3, wherein the WhatsApp end-to-end encryption key is obtained by, The configuration information acquisition request, the initialization login request, the start login information and the end login information are sent to the WhatsApp server through the opaque protocol respectively, and the return information of the WhatsApp server is received step by step, and the method further comprises: The start login information is sent to the WhatsApp server through the opaque protocol; wherein the start login information comprises login credential request data; The start login information returned by the WhatsApp server is received and logged in, and the login credential response data returned by the WhatsApp server is received after the login is successful; The end login information is sent to the WhatsApp server through the opaque protocol; wherein the end login information comprises login credential completion data; The login credential completion data is obtained according to the decryption result of the opaque protocol and the login credential response data; The login credential completion data is sent to the WhatsApp server, and the secret key information returned by the WhatsApp server is received.

6. The method for obtaining the end-to-end encryption key of WhatsApp according to claim 5, characterized in that, Further comprising: Obtaining a user backup password, and performing random processing on the user backup password by using an unobtrusive pseudo-random function; Obtaining public key information in the first private key pair, and selecting any random number, wherein the random processed user backup password, the public key information and the random number form the login credential request information.

7. A WhatsApp end-to-end encryption key acquisition apparatus, characterized by, Comprise: A communication establishment unit configured to establish communication with a WhatsApp server through a noise protocol; A private key receiving unit configured to send a secret key information acquisition request to the WhatsApp server based on a noise protocol framework, and receive the secret key information returned by the WhatsApp server step by step; A decryption processing unit configured to perform decryption processing on the secret key information by using a decryption algorithm to obtain an end-to-end encryption secret key; The decryption processing unit comprises: A first analysis unit configured to analyze the secret key information by using a protobuf technology to obtain corresponding secret key ciphertext and secret key IV value; A first decryption unit configured to perform decryption on the secret key ciphertext and secret key IV value by using an AES GCM algorithm to obtain encrypted data; A second analysis unit configured to analyze the encrypted data by using a protobuf technology to obtain corresponding encrypted ciphertext and encrypted IV value; A second decryption unit configured to perform decryption on the encrypted ciphertext and encrypted IV value by using an AES GCM algorithm to obtain the end-to-end encryption secret key.

8. A computer device, comprising: A computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the WhatsApp end-to-end encryption secret key acquisition method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer program is stored on the computer readable storage medium, and the computer program is executed by the processor to implement the WhatsApp end-to-end encryption secret key acquisition method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Information transmission method and device, client, server and storage medium

    CN110460439A