Input Method, System, Device and Medium for Encrypted Instant Messaging Temporary Key
By adding encrypted chat windows in the instant messaging software and using user-defined servers to generate and use key pairs, the problem of the server visible to the prior art message keys is solved, and the secure transmission of chat content and the protection of user privacy is realized.
Patent Information
- Application Number
- CN202210307184.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-25
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2042-03-25
AI Technical Summary
In the encryption scheme of the existing instant messaging system, the message key is visible to the server and cannot truly protect the privacy of users and the security of chat content.
Add an encrypted chat window to the instant messaging software. Users can use the user to encrypt the chat content by generating key pairs and using the user-defined server to ensure the security of the chat content during transmission.
Key generation and encryption processing are performed through user-defined servers, which enhances the security of chat content, prevents content from being leaked from local or service providers, and ensures user privacy.
Smart Images

Figure CN114726528B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of chat record encryption, and particularly to an input method, system, device and medium for encrypting instant messaging temporary keys. Background Art
[0002] Instant messaging is a way of instantaneously communicating messages based on the Internet. It allows two or more people to use the network to transmit text messages, files, and even voice and video in real time for communication, providing convenience for instant communication in the information society. Currently, there are many instant messaging systems at home and abroad, including QQ, WeChat, Google Messenger, DingTalk, and so on. However, using these systems often has the risk of privacy leakage, and incidents of account and chat content being leaked or maliciously obtained are common. Currently, many users' chat content sent during instant chat involves important content, and it is necessary to ensure its security during data transmission.
[0003] Encryption is a commonly used protection means in current instant messaging systems, that is, the message sender and the receiver negotiate a message key, and then use this message key to encrypt and decrypt communication information during communication. However, the existing encryption schemes adopted by instant messaging systems have limitations: in these encryption schemes, the message key is visible to the server. Since the instant messaging server belongs to the service provider and its operation is not controlled by the user, the user cannot guarantee that the service provider will not access the user's communication content for commercial or other reasons. Therefore, the user's privacy cannot be truly protected. Implementing a truly secure instant messaging system for users is an urgent need at present.
[0004] Therefore, there is currently no generally applicable method to solve the problem of inability to guarantee the security of chat content during instant messaging. Summary of the Invention
[0005] In view of this, the present invention proposes an input method for encrypting instant messaging temporary keys to solve the problem of inability to guarantee the security of chat content during instant messaging.
[0006] The technical solution of the present invention is implemented as follows:
[0007] In the first aspect of the present invention, an input method for encrypting instant messaging temporary keys is disclosed, and the method includes:
[0008] S1, adding an encrypted chat button in the instant messaging software dialogue interface, and the user clicks the encrypted chat button to switch the ordinary chat window with the current user to an encrypted chat window, and enters the encrypted chat window as the encrypted chat initiating user;
[0009] S2. Generate a key input window on the interface of the user initiating the encrypted chat for generating a key pair.
[0010] S3. Package the chat content entered by the user in the encrypted chat window to obtain a packaged file M, and then encrypt and save it. The chat content includes text messages and files.
[0011] Through the above method, the present invention adds an encrypted chat window on the basis of the instant messaging software, retaining the convenience of the instant messaging system. At the same time, the chat content sent in the encrypted chat window is packaged, encrypted and saved, ensuring the security of the chat content during the instant messaging process.
[0012] On the basis of the above technical solutions, preferably, step S2 specifically includes:
[0013] S2-1. Generate a key input window on the interface of the user initiating the encrypted chat. The key input window displays a two-dimensional coordinate system and an elliptic curve. The user initiating the encrypted chat moves the mouse and randomly clicks on the elliptic curve to determine a point O, and determines the distance k from point O to the origin of the two-dimensional coordinate system. k needs to fall within the domain [1, n-1], where n is a prime number.
[0014] S2-2. Calculate point P = [d]G, where G is the base point of the elliptic curve.
[0015] S2-3. Output the key pair (d, P), where d is the private key and P is the public key. Save the public key P in the server, and send the private key d to all users in the current encrypted chat window. The server is a user-defined server.
[0016] On the basis of the above technical solutions, preferably, the elliptic curve in step S2-1 is randomly generated, and its center point is at a random position in the two-dimensional coordinate system.
[0017] Through the above method, the present invention forms a key pair according to the user's operation. The server is a user-defined server, further improving the randomness of key generation and ensuring the security of the key.
[0018] On the basis of the above technical solutions, preferably, step S3 specifically includes:
[0019] S3-1. The server first packages the chat content entered by all users in the encrypted chat window to obtain a packaged file M, and then encrypts it with the public key P to obtain a ciphertext C.
[0020] S3-2. Send the ciphertext C to the encrypted chat window and save it in the server database in real time.
[0021] Based on the above technical solutions, preferably, step S3-1 specifically includes:
[0022] S3-1-1, calculate point C1 = [k]G = (x1, y1), where G is the base point of the elliptic curve,
[0023] C1 = (x1, y1) is a point on the elliptic curve different from point O;
[0024] S3-1-2, continue to calculate point S = (x2, y2) = [k]P, where P is the public key, and S = (x2, y2) is a point on the elliptic curve different from both point O and point C1. If S is the infinite point, cancel the key pair generated previously, and return to execute step S2; otherwise, continue to execute step S3-1-3;
[0025] S3-1-3, calculate the exclusive OR value M is the chat content input by the user in the encrypted chat window;
[0026] S3-1-4, obtain the ciphertext C = (C1, C2).
[0027] Through the above method, the server customized by the user automatically encrypts the chat content, enhancing the security of the chat content.
[0028] Based on the above technical solutions, preferably, after step S3 is executed, it includes:
[0029] When the user exits the current encrypted chat window, all the content in the encrypted chat window is automatically cleared locally.
[0030] Through the above method, the present invention does not save the chat content locally or in the server of the instant messaging software service provider, but synchronously saves it in the database of the server customized by the user in real time, preventing the chat content from being leaked from the local or the service provider.
[0031] Based on the above technical solutions, preferably, after step S3 is executed, it includes:
[0032] When any user in the current encrypted chat window invites a new user to join the current encrypted chat, a key sending confirmation window is generated on the interface of the user who initiated the encrypted chat, and it is determined whether to send the currently used private key to the new user.
[0033] In the second aspect of the present invention, an input system for encrypting instant messaging temporary keys is disclosed. The system includes:
[0034] Encryption module: used to generate a key input window on the interface of the user who initiated the encrypted chat for generating a key pair; encrypt the packaged file M;
[0035] Packaging module: Package the chat content M entered by the user in the encrypted chat window to generate a packaged file M;
[0036] Recording module: Save the packaged file M.
[0037] In a third aspect of the present invention, an electronic device is disclosed, and the device includes: at least one processor, at least one memory, a communication interface, and a bus; wherein, the processor, the memory, and the communication interface complete communication with each other through the bus; the memory stores a program for an input method of an encrypted instant messaging temporary key that can be executed by the processor, and an input method program of an encrypted instant messaging temporary key is configured to implement an input method of an encrypted instant messaging temporary key as described in the first aspect of the present invention.
[0038] In a fourth aspect of the present invention, a computer-readable storage medium is disclosed, and an input method program of an encrypted instant messaging temporary key is stored on the storage medium, and when the input method program of the encrypted instant messaging temporary key is executed, it implements an input method of an encrypted instant messaging temporary key as described in the first aspect of the present invention.
[0039] The input method of an encrypted instant messaging temporary key of the present invention has the following beneficial effects compared with the prior art:
[0040] (1) Based on the instant messaging software, it ensures the data transmission efficiency of instant conversations. At the same time, by using a key pair generated by a customer-defined server, saving the public key and performing packaging and encryption processing on the chat content, and finally only storing the encrypted content in the customer-defined server, it prevents the chat content from being leaked from the local or service provider, ensuring security;
[0041] (2) Generating a key pair according to user operations strengthens the randomness of key generation, improves the confidentiality of the key, and thus further improves the confidentiality of chat content. Description of the Drawings
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0043] Figure 1 It is a flowchart of the working process of an input method of an encrypted instant messaging temporary key of the present invention. Detailed Embodiments
[0044] Next, in combination with the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0045] Embodiment
[0046] The working process of an input method for encrypting instant messaging temporary keys in the present invention is shown in Figure 1 , and the processing steps are described as follows:
[0047] First step, add an encrypted chat button in the instant messaging software conversation interface. When the user clicks the encrypted chat button, the ordinary chat window with the current user is switched to an encrypted chat window, and the user enters the encrypted chat window as the encrypted chat initiating user. Proceed to the second step.
[0048] It should be understood that on the basis of the above solution, the instant messaging software conversation interface is a one-on-one chat interface or a group chat interface.
[0049] It should be understood that on the basis of the above solution, when the ordinary chat window is switched to an encrypted chat window, the server of the instant messaging service provider is switched to a user-defined server.
[0050] It should be understood that on the basis of the above solution, the user-defined server is specified by the user in advance in the settings of the instant messaging software.
[0051] For example, add an encrypted chat button in the WeChat private chat interface. When user A clicks it, user B who is having a private chat with user A also enters the encrypted chat window; at the same time, the server of the instant messaging service provider is switched to a user-defined server, and the original ordinary chat window is not closed;
[0052] Or, add an encrypted chat button in the WeChat group chat interface. When user A clicks it, users B, C, and D who are having a group chat with user A also enter the encrypted chat window; at the same time, the server of the instant messaging service provider is switched to a user-defined server, and the original ordinary chat window is not closed.
[0053] Second step, generate a key input window on the interface of the encrypted chat initiating user. The user operates on the key input window to generate a key pair. Proceed to the third step.
[0054] It should be understood that on the basis of the above solution, the second step specifically includes:
[0055] S2-1. Generate a key input window on the interface of the user initiating the encrypted chat. The key input window displays a two-dimensional coordinate system and an elliptic curve. The user initiating the encrypted chat moves the mouse and randomly clicks on the elliptic curve to determine a point O, and determines the distance k from point O to the origin of the two-dimensional coordinate system. k needs to fall within the domain [1, n - 1], where n is a prime number.
[0056] S2-2. Calculate the point P = [d]G, where G is the base point of the elliptic curve.
[0057] S2-3. Output the key pair (d, P), where d is the private key and P is the public key. Save the public key P in the server, and send the private key d to all users in the current encrypted chat window. The server is a user-defined server.
[0058] For example, when user A enters the encrypted chat window, a key input window is generated simultaneously. User A operates to generate the key pair (d, P). The public key P is saved in the user-defined server, and the private key d is sent to all users in the current encrypted chat window.
[0059] The third step: Package the chat content input by the user in the encrypted chat window to obtain a packaged file M, and then encrypt and save it. The chat content includes text messages and files. Proceed to the fourth step.
[0060] It should be understood that on the basis of the above solution, for the chat content, it is first packaged and then the packaged file is encrypted.
[0061] It should be understood that on the basis of the above solution, the third step specifically includes:
[0062] S3-1. The server first packages all the chat content input by the users in the encrypted chat window to obtain a packaged file M, and then encrypts it using the public key P to obtain the ciphertext C.
[0063] S3-2. Send the ciphertext C to the encrypted chat window and save it in the server database in real time.
[0064] It should be understood that on the basis of the above solution, step S3-1 specifically includes:
[0065] S3-1-1. Calculate the point C1 = [k]G = (x1, y1), where G is the base point of the elliptic curve.
[0066] C1 = (x1, y1) is a point on the elliptic curve different from point O.
[0067] S3-1-2. Continue to calculate the point S = (x2, y2) = [k]P, where P is the public key and S = (x2, y2) is a point on the elliptic curve that is different from both point O and point C1. If S is the infinite point, cancel the key pair generated previously and return to execute step S2; otherwise, continue to execute step S3-1-3.
[0068] S3-1-3. Calculate the XOR value M is the chat content entered by the user in the encrypted chat window.
[0069] S3-1-4. Obtain the ciphertext C = (C1, C2).
[0070] It should be understood that, based on the above solution, when the user exits the current encrypted chat window, all the content in the encrypted chat window is automatically cleared locally.
[0071] For example, when user A sends a document in the encrypted chat window, at the same time of sending, the user-defined server packages the document, encrypts it using the public key and sends it, and stores the encrypted packaged file in the database of the user-defined server.
[0072] It should be understood that, based on the above solution, when any user in the current encrypted chat window invites a new user to join the current encrypted chat, a key sending confirmation window is generated on the interface of the user who initiates the encrypted chat to determine whether to send the currently used private key to the new user.
[0073] For example, when user B invites new user E to join the current encrypted chat, a key sending confirmation window is generated on the interface of user A, the user who initiates the encrypted chat, to determine whether to send the currently used private key to the new user. If user A agrees, the currently used private key d is sent to user E, and user E can view and receive the previous encrypted chat content; if not, it is regarded as a refusal to join, and user E cannot join the current encrypted chat.
[0074] Fourth step, when the user in the current encrypted chat window receives the ciphertext C, decrypt it using the private key d:
[0075] Extract the bit string C1 from the ciphertext C;
[0076] Calculate the point z on the elliptic curve, whose coordinates are (x z , y z ) = [d]C1, where d is the private key;
[0077] Extract the bit string C2 from the ciphertext C;
[0078] Calculate the XOR value
[0079] Restore chat content M.
[0080] The present invention also discloses an input system for encrypting temporary keys of instant messaging, and the system includes:
[0081] An encryption module: used to generate a key input window on the interface of the user initiating the encrypted chat to generate a key pair; and perform encryption processing on the packaged file M;
[0082] A packaging module: perform packaging processing on the chat content M input by the user in the encrypted chat window to generate a packaged file M;
[0083] A recording module: perform saving processing on the packaged file M.
[0084] The system embodiment of the present invention corresponds one by one to the method embodiment. For the parts not described in detail in the system, refer to the working process of a method for sub-packaging, packaging and encryption based on a custom class loader described in the present invention.
[0085] The present invention also discloses an electronic device, and the device includes: at least one processor, at least one memory, a communication interface and a bus; wherein, the processor, the memory and the communication interface complete communication with each other through the bus; the memory stores a program for an input method of encrypting temporary keys of instant messaging, and the program for an input method of encrypting temporary keys of instant messaging is configured to implement an input method of encrypting temporary keys of instant messaging as described in the embodiment of the present invention.
[0086] The present invention also discloses a computer-readable storage medium, and a program for an input method of encrypting temporary keys of instant messaging is stored on the storage medium. When the program for an input method of encrypting temporary keys of instant messaging is executed, it implements an input method of encrypting temporary keys of instant messaging as described in the embodiment of the present invention.
[0087] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An input method for encrypting a temporary key of instant messaging, characterized in that, It includes the following steps: S1. Add an encrypted chat button in the instant messaging software conversation interface. When the user clicks the encrypted chat button, switch the ordinary chat window with the current user to an encrypted chat window, and enter the encrypted chat window as the encrypted chat initiating user; S2. Generate a key input window in the interface of the encrypted chat initiating user to generate a key pair; S3. Package the chat content entered by the user in the encrypted chat window to obtain a packaged file M, and then encrypt and save it. The chat content includes text messages and files; The step S2 specifically includes: S2-1. Generate a key input window in the interface of the encrypted chat initiating user. The key input window displays a two-dimensional coordinate system and an elliptic curve. The encrypted chat initiating user moves the mouse and randomly clicks on the elliptic curve to determine a point O, and determines the distance k from point O to the origin of the two-dimensional coordinate system. k needs to fall within the domain [1, n-1], where n is a prime number; S2-2. Calculate the point P = [d]G, where G is the base point of the elliptic curve; S2-3. Output the key pair (d, P), where d is the private key and P is the public key. Save the public key P in the server, and send the private key d to all users in the current encrypted chat window. The server is a user-defined server.
2. The input method of an encrypted instant messaging temporary key according to claim 1, wherein the elliptic curve in the step S2-1 is randomly generated, and its center point is at a random position in the two-dimensional coordinate system.
3. The input method of an encrypted instant messaging temporary key according to claim 1, characterized in that, The step S3 specifically includes: S3-1. The server first packages the chat content entered by all users in the encrypted chat window to obtain a packaged file M, and then encrypts it with the public key P to obtain a ciphertext C; S3-2. Send the ciphertext C to the encrypted chat window and save it in the database of the server in real time.
4. The input method of an encrypted instant messaging temporary key according to claim 3, characterized in that, The step S3-1 specifically includes: S3-1-1, Calculation point , where G is the base point of the elliptic curve is a point on the elliptic curve different from point O; S3-1-2, continue to calculate the point , where P is the public key, is a point on the elliptic curve that is different from both point O and point . If S is the infinite point, cancel the key pair generated previously and return to execute step S2; otherwise, continue to execute step S3-1-3; S3-1-3, Calculate the XOR value , where M is the chat content entered by the user in the encrypted chat window; S3-1-4, obtain the ciphertext 。 5. The input method of an encrypted instant messaging temporary key according to claim 1, wherein After the step S3 is executed, it includes: When the user exits the current encrypted chat window, automatically clear all content in the encrypted chat window locally.
6. The input method of a temporary key for encrypted instant messaging according to claim 1, characterized in that, After the step S3 is executed, it includes: When any user in the current encrypted chat window invites a new user to join the current encrypted chat, a key sending confirmation window is generated in the interface of the encrypted chat initiating user to determine whether to send the currently used private key to the new user.
7. An input system for encrypting an instant messaging temporary key, which adopts the input method for encrypting an instant messaging temporary key according to any one of claims 1 to 6, characterized in that, The system includes: Encryption module: used to generate a key input window in the interface of the encrypted chat initiating user to generate a key pair; encrypt the packaged file M; Packaging module: package the chat content M entered by the user in the encrypted chat window to generate a packaged file M; Recording module: save the packaged file M.
8. An electronic device, characterized in that, Comprising at least one processor, at least one memory, a communication interface and a bus; wherein, the processor, the memory and the communication interface complete communication with each other through the bus; the memory stores an input method program for an encrypted instant messaging temporary key, and an input method program for an encrypted instant messaging temporary key is configured to implement the input method for an encrypted instant messaging temporary key as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, An input method program for an encrypted instant messaging temporary key is stored on the storage medium, and when the input method program for an encrypted instant messaging temporary key is executed, it implements the input method for an encrypted instant messaging temporary key as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Password type instant message (IM) encryption method and system in self-service bank
CN102098307A
IM information protection method, IM information protection device, equipment, and computer storage medium
CN108390819A