Communication encryption method, electronic device and readable storage medium

By detecting network signal quality in electronic devices and receiving key seed encrypted data, it solves the problem that existing encryption schemes may cause data transmission failure when the network quality is poor, and achieves efficient data transmission in harsh network environments.

CN111355575BActive Publication Date: 2025-01-24SHANGHAI TRANSSION CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010112493.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-02-24
Publication Date
2025-01-24
Estimated Expiration
2040-02-24

AI Technical Summary

Technical Problem

Existing encryption solutions may lead to data transmission failure when the network quality is poor and data security is required.

Method used

By detecting the network signal quality of the electronic device, when the signal quality is lower than the preset value, the key seed is received and used to encrypt the data, and the encrypted data is sent to the server. The server decrypts the data via the key seed and updates the encryption key if necessary.

Benefits of technology

In the case of poor network quality and need to ensure data security, the success rate of data transmission is improved and resource overhead of single data communication encryption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111355575B_ABST
    Figure CN111355575B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a communication encryption method, an electronic device, and a readable storage medium. In the method, when the signal quality of the network of the electronic device is lower than the preset signal quality, the electronic device receives a key seed, the electronic device uses the key seed to encrypt the data, and then sends a first message to the server, the first message includes the encrypted data; after receiving the first message, the server can decrypt the encrypted data by determining the key seed corresponding to the encrypted data. The present application can improve the success rate of data transmission when the network quality is poor and the data security needs to be guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a communication encryption method, an electronic device and a readable storage medium. Background Art

[0002] With the rapid development of Internet technology, people's lives are inseparable from the network, and data needs to be transmitted through the network between users and between users and devices. When transmitting data over the network, it is necessary to ensure the integrity and confidentiality of the data, as well as to authenticate the sender of the data, all of which need to be achieved through some encryption algorithms.

[0003] When existing electronic devices and servers communicate over the network, the Hypertext Transfer Protocol (HTTP) is used as the basis. The HTTP protocol itself can prevent man-in-the-middle attacks. In order to further ensure the security of data, secondary encryption is performed. The secondary encryption is that before the electronic device sends data to the server, the electronic device uses the key generated by itself to encrypt the transmitted data, and sends the transmitted data ciphertext and the key together to the server. The server uses the key to decrypt the transmitted data ciphertext and processes it, and encrypts the processed result data into ciphertext using the same key and returns it to the electronic device for use.

[0004] However, during the above data encryption process, the electronic device needs to send a key to the other party for decryption by the server, but the key itself may not be secure or the protection scheme to ensure the security of the key is too complicated, resulting in a large amount of resource overhead required for single data communication encryption. When the network quality is poor and data security needs to be guaranteed, the existing encryption scheme may cause data transmission failure. Summary of the invention

[0005] The present application provides a communication encryption method, an electronic device and a readable storage medium, which can solve the technical problem that the existing encryption scheme may cause data transmission failure when the network quality is poor and data security needs to be guaranteed.

[0006] In a first aspect, the present application provides a communication encryption method, comprising:

[0007] detecting a signal quality of a network of the electronic device;

[0008] When the signal quality of the network is lower than a preset signal quality, receiving a key seed;

[0009] Encrypting the first data based on the key seed to obtain first encrypted data;

[0010] A first message is sent, where the first message includes the first encrypted data.

[0011] In a feasible implementation manner, encrypting the first data based on the key seed to obtain the first encrypted data includes:

[0012] generating a first encryption key according to the key seed;

[0013] The first data is encrypted using the first encryption key to obtain the first encrypted data.

[0014] In a feasible implementation, it also includes:

[0015] The electronic device generates a new encryption key according to the key seed when an update condition is met;

[0016] The electronic device stores the new encryption key and the generation time of the new encryption key;

[0017] After generating a new encryption key, the electronic device does not delete the encryption keys and generation times generated for the previous N times, and each encryption key is deleted after a preset time, where N is greater than or equal to 1.

[0018] In a feasible implementation, it also includes:

[0019] The electronic device receives a response message to the first message, wherein the response message to the first message includes second encrypted data and second encryption key information;

[0020] The electronic device determines, according to the second encryption key information and the correspondence between the encryption key of the electronic terminal and the encryption key information, a second encryption key corresponding to the second encryption key information;

[0021] The electronic device decrypts the second encrypted data according to the second encryption key;

[0022] The electronic device processes a response message of the first message according to the second encryption key and the decrypted second encrypted data.

[0023] In a feasible implementation, it also includes:

[0024] The electronic device receives an identity authentication;

[0025] After confirming the identity authentication, the electronic device receives the key seed.

[0026] In a second aspect, the present application provides a communication encryption method, comprising:

[0027] The server receives a first message, wherein the first message includes first encrypted data;

[0028] The server determines a key seed used for the first encrypted data;

[0029] The server decrypts the first encrypted data according to the key seed.

[0030] In a feasible implementation, it also includes:

[0031] The server generates a new encryption key according to the key seed when the update condition is met;

[0032] The server stores the new encryption key and the generation time of the new encryption key;

[0033] After generating a new encryption key, the server does not delete the encryption keys and generation times generated for the previous N times, and each encryption key is deleted after a preset time, where N is greater than or equal to 1.

[0034] In a feasible implementation, it also includes:

[0035] The server encrypts the second data using a second encryption key to obtain second encrypted data, where the second encryption key is generated by the server according to the key seed;

[0036] The server sends a response message to the first message, wherein the response message to the first message includes the second encrypted data.

[0037] In a third aspect, the present application provides a device, comprising: at least one processor and a memory;

[0038] The memory stores computer-executable instructions;

[0039] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the communication encryption method provided in the first aspect; or, executes the communication encryption method provided in the second aspect.

[0040] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the communication encryption method provided in the first aspect is implemented; or, the communication encryption method provided in the second aspect is implemented.

[0041] The embodiment of the present application provides a communication encryption method, an electronic device, and a readable storage medium. In the method, when the signal quality of the network of the electronic device is lower than the preset signal quality, the electronic device receives a key seed, the electronic device uses the key seed to encrypt the data, and then sends a first message to the server, the first message includes the encrypted data; after receiving the first message, the server can decrypt the encrypted data by determining the key seed corresponding to the encrypted data. The embodiment of the present application can improve the success rate of data transmission when the network quality is poor and the data security needs to be guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0043] Figure 1 A schematic diagram of the architecture of a communication encryption system provided in an embodiment of the present application;

[0044] Figure 2 Schematic diagram of the communication encryption method provided in the embodiment of the present application Figure 1 ;

[0045] Figure 3 Schematic diagram of the communication encryption method provided in the embodiment of the present application Figure 2 ;

[0046] Figure 4 A schematic diagram of the signaling flow of the communication encryption method provided in an embodiment of the present application;

[0047] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0049] The terms "first", "second" and the like in the specification, claims and drawings of the present application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential sequence.

[0050] The embodiments of the present application can be applied to various communication systems, such as: Global System of Mobile communication (GSM) system, Code Division Multiple Access (CDMA) system, Wideband Code Division Multiple Access (WCDMA) system, General Packet Radio Service (GPRS), Long Term Evolution (LTE) system, Advanced long term evolution (LTE-A) system, New Radio (NR) system, NR system evolution system, LTE on unlicensed spectrum (LTE-based access to unlicensed spectrum, LTE-U) system, NR on unlicensed spectrum (NR-based access to unlicensed spectrum, NR-U) system, Universal Mobile Telecommunication System (UMTS), Wireless Local Area Networks (WLAN), Wireless Fidelity (WiFi), next generation communication system or other communication systems, etc.

[0051] Generally speaking, traditional communication systems support a limited number of connections and are easy to implement. However, with the development of communication technology, mobile communication systems will not only support traditional communications, but will also support, for example: device to device (Device to Device, D2D) communication, machine to machine (Machine to Machine, M2M) communication, machine type communication (Machine Type Communication, MTC), and vehicle to vehicle (Vehicle to Vehicle, V2V) communication, etc. The embodiments of the present application can also be applied to these communication systems.

[0052] Reference Figure 1 , Figure 1 The wireless communication system provided in this embodiment includes an electronic device 101 and a server 102.

[0053] Optionally, the electronic device 101 may refer to various forms of user equipment, access terminals, user units, user stations, mobile stations, mobile stations (MS), remote stations, remote terminals, mobile devices, terminal equipment, wireless communication equipment, user agents or user devices. It may also be a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA), a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a wearable device, a terminal device in a future 5G network or a terminal device in a future evolved Public Land Mobile Network (PLMN), etc. The embodiment of the present application is not limited to this, as long as the electronic device 101 can communicate wirelessly with the server 102.

[0054] Optionally, the server 102 includes but is not limited to a single-channel server, a multi-channel server, and a distributed server.

[0055] The communication encryption method provided in the embodiment of the present application can be applied to a weak network environment with poor signal quality, and can also be applied to a network environment with normal signal quality.

[0056] In addition, optionally, the communication encryption method provided in the embodiment of the present application can be applied to mobile payment services. While ensuring the security of the secondary encryption key, the encryption calculation overhead of a single data transmission request of the payment service in a weak network environment is minimized, thereby ensuring the security of the payment data and the availability of the payment function.

[0057] Reference Figure 2 , Figure 2 Schematic diagram of the communication encryption method provided in the embodiment of the present application Figure 1 , the execution subject of this embodiment can be Figure 1 The electronic device 101 in the illustrated embodiment. Figure 2 As shown, the method includes:

[0058] S201, detecting signal quality of a network of an electronic device.

[0059] In the embodiment of the present application, before a client of the electronic device needs to send data, the signal quality of the network of the electronic device can be detected first.

[0060] The client (or user end) is a program that corresponds to the server and provides local services to customers. In addition to some applications that only run locally, they can generally be installed on the electronic device 101 and need to cooperate with the server to run. Commonly used clients include web browsers such as those used in the World Wide Web and client software for instant messaging, such as APP (Application), web browsers, etc. running in electronic devices such as mobile phones, tablet computers, laptops, desktop computers, smart TVs, etc.

[0061] The signal quality of the network can be represented by the following parameters: Reference Signal Receiving Power (RSRP), Received Signal Strength Indicator (RSSI), Reference Signal Received Quality (RSRQ) or Signal to Interference Noise Ratio (RS-SINR).

[0062] S202: When the signal quality of the network is lower than a preset signal quality, a key seed is received.

[0063] In an embodiment of the present application, the electronic device and the server will perform identity authentication in advance. After the identity authentication is passed, the server generates a key seed and sends the key seed to the electronic device when the signal quality of the network of the electronic device is lower than the preset signal quality.

[0064] S203: Encrypt the first data based on the key seed to obtain first encrypted data.

[0065] In an embodiment of the present application, when the signal quality of the above-mentioned network is lower than the preset signal quality, for example, when the RSSI measured by the electronic device is less than a preset value, the electronic device can use the received key seed to generate a first encryption key, and then use the first encryption key to encrypt the first data to obtain the first encrypted data.

[0066] Optionally, when the signal quality of the above network is better than the preset signal quality, the electronic device may encrypt the first data using an encryption key generated locally by the electronic device, and then send the encryption key used by the electronic device to the server while sending the encrypted data.

[0067] Optionally, the first data may be mobile payment data, such as data generated when making a payment or transferring money by scanning a QR code.

[0068] S204: Send a first message, where the first message includes first encrypted data.

[0069] In an embodiment of the present application, after encrypting the first data to be sent, the electronic device will send the generated first encrypted data to the server. When sending, the electronic device will randomly generate a first random variable, and send the generation time of the first encryption key and the first random variable to the server. The generation time of the first encryption key can be used by the server to determine the encryption key used by the electronic device, and the first random variable can be used to verify whether the first message comes from a legitimate device.

[0070] In a feasible implementation, in order to ensure the encryption of the key seed, after the server sends the key seed to the electronic device, the server and the electronic device may update the encryption key generated by the key seed at a preset time interval.

[0071] For example, the server can update the encryption key generated by the key seed stored locally on the server at preset time intervals, and send an update instruction to the electronic device at the same time, so that the electronic device synchronously updates the encryption key generated by the key seed stored locally on the electronic device in the same update manner, wherein the encryption key updated locally on the server is consistent with the encryption key updated by the electronic device.

[0072] It can be understood that in this embodiment, since the encryption key stored in the server and the encryption key used in the electronic device are consistent, after receiving the above-mentioned first message, the server can determine the encryption key used by the electronic device to encrypt the first data by determining the encryption key generated locally by the server when the above-mentioned first encryption key is generated, so that the encryption key can be used to decrypt the above-mentioned first encrypted data.

[0073] In order to further improve the security of the data transmission process, in this embodiment, the electronic device generates a random variable when transmitting the first encrypted data, and then sends the random variable together with the first encrypted data to the server. After receiving the first message, the server can authenticate the first message through the random variable. If the verification is successful, the decryption operation continues. If the verification fails, the first encrypted data cannot be decrypted.

[0074] For example, the electronic device can add the above-mentioned first random variable to a certain position of the data message corresponding to the above-mentioned first message, and the position is a position agreed in advance between the electronic device and the server. After the server receives the data message of the above-mentioned first message, if it can find the above-mentioned first random variable at the agreed position in advance, the identity authentication is passed.

[0075] It is understandable that when the data message of the above-mentioned first encrypted data is intercepted by other third-party devices, since the third-party device has not made an agreement with the above-mentioned electronic device in advance, it is impossible to accurately read the above-mentioned first random variable. Even if the third-party device cracks the above-mentioned first encryption key, it is impossible to decrypt the above-mentioned first encrypted data.

[0076] In addition, the electronic device can also input the above-mentioned first random variable into the encryption function agreed upon in advance with the server to obtain output information, and then send the output information to the server. After receiving the above-mentioned first random variable, the server inputs the first random variable into the encryption function agreed upon in advance with the electronic device to obtain output information, or the output information is consistent with the output information sent by the electronic device, and the identity authentication is passed.

[0077] It can be understood that when the data message of the above-mentioned first encrypted data is intercepted by other third-party devices, since the third-party device has not agreed on the above-mentioned encryption function with the above-mentioned electronic device in advance, it is impossible to obtain the above-mentioned output information through the above-mentioned first random variable. Therefore, even if the third-party device cracks the above-mentioned first encryption key, it is impossible to decrypt the above-mentioned first encrypted data.

[0078] The communication encryption method provided by the present application, when the signal quality of the network of the electronic device is lower than the preset signal quality, the electronic device will receive a key seed, the electronic device uses the key seed to encrypt the data, and then sends a first message to the server, the first message includes the encrypted data; after receiving the first message, the server can decrypt the encrypted data by determining the key seed corresponding to the encrypted data. The embodiment of the present application can improve the success rate of data transmission when the network quality is poor and the data security needs to be guaranteed.

[0079] Based on the contents described in the above embodiments, in a feasible implementation manner of the present application, the above communication encryption method further includes:

[0080] When the update condition is met, the electronic device generates a new encryption key according to the key seed, and saves the new encryption key and the generation time of the new encryption key. After generating the new encryption key, the electronic device does not delete the encryption keys and generation times generated for the previous N times, and each encryption key is deleted after a preset time, where N is greater than or equal to 1.

[0081] That is, in the embodiment of the present application, the electronic device can generate a new encryption key according to the key seed stored locally at every preset time interval, and save the new encryption key and the generation time of the new encryption key. In addition, in order to ensure that the electronic device can decrypt the encrypted data sent by the server, after generating a new encryption key, the electronic device still retains the encryption key and generation time generated for the previous N (N is greater than or equal to 1) times.

[0082] Optionally, each encryption key can be deleted after being saved for a preset time. For example, each encryption key can be deleted after being saved for 5 minutes.

[0083] Based on the contents described in the above embodiments, in a feasible implementation manner of the present application, after the server decrypts the first message, if it needs to send response data to the electronic device, it can use the key seed currently stored in the server to generate a second encryption key, and then use the generated second encryption key to encrypt the response data to obtain second encrypted data, and at the same time generate a second random variable, and then send the second encrypted data, the generation time of the second encryption key and the second random variable as a response message to the above first message to the electronic device.

[0084] Among them, after receiving the response message of the above-mentioned first message, the electronic device verifies whether the above-mentioned response message comes from a legitimate device based on the second random variable; if it is legitimate, the above-mentioned second encryption key is determined according to the generation time of the second encryption key and the correspondence between the locally stored encryption key and the generation time of the encryption key, and then the second encrypted data is decrypted according to the second encryption key; if it is illegal, the electronic device discards the response message of the above-mentioned first message.

[0085] That is, in the embodiment of the present application, during the data interaction between the electronic device and the server, the server only needs to transmit encrypted data, the generation time of the encryption key and the random variable, and does not need to send the encryption key to the electronic device. This can reduce the resource overhead required for single data communication encryption, and improve the success rate of data transmission when the network quality is poor and data security needs to be guaranteed.

[0086] Based on the contents described in the above embodiments, Figure 3 , Figure 3 Schematic diagram of the communication encryption method provided in the embodiment of the present application Figure 2 , the execution subject of this embodiment can be Figure 1 The server 102 in the illustrated embodiment. Figure 3 As shown, the method includes:

[0087] S301. A server receives a first message, where the first message includes first encrypted data.

[0088] In this embodiment, the electronic device encrypts the first data using the first encryption key to obtain the first encrypted data. The first encryption key is generated by the electronic device using a key seed, and the key seed is sent to the electronic device by the server.

[0089] In addition, the first message also includes first encrypted data, generation time of the first encryption key and a first random variable.

[0090] S302: The server determines a key seed used for first encrypted data.

[0091] In this embodiment, the server may determine the first encryption key used by the electronic device to generate the first encrypted data based on the generation time of the first encryption key and the correspondence between the locally stored encryption key and the generation time of the encryption key.

[0092] After the server sends the key seed to the electronic device, the server and the electronic device can synchronously update the encryption key generated by the key seed at a preset time interval. When the server receives the generation time of the first encryption key, the server searches for the encryption key generated in the server at the generation time locally, and the encryption key is consistent with the first encryption key used by the electronic device to generate the first encrypted data.

[0093] S303: The server decrypts the first encrypted data according to the key seed.

[0094] That is, in the embodiment of the present application, during the data interaction between the electronic device and the server, the electronic device does not need to send the encryption key to the server, but only needs to transmit the encrypted data, the generation time of the encryption key and the random variable. The server can determine the encryption key used by the electronic device according to the generation time of the encryption key and perform decryption. This can reduce the resource overhead required for single data communication encryption, and improve the success rate of data transmission when the network quality is poor and data security needs to be guaranteed.

[0095] In a feasible implementation, when the update condition is met, the server generates a new encryption key according to the key seed, and saves the new encryption key and the generation time of the new encryption key. After generating the new encryption key, the server does not delete the encryption keys and generation times generated for the previous N times, and each encryption key is deleted after a preset time, where N is greater than or equal to 1.

[0096] In a feasible implementation, if the server needs to send the second data to the electronic device, the second encryption key can be generated according to the local key seed of the server, and then the second encryption key is used to encrypt the second data to obtain the second encrypted data. Then a response message is sent to the electronic device, and the response message includes the second encrypted data, the generation time of the second encryption key and the second random variable. The generation time of the second encryption key is used by the electronic device to determine the encryption key used by the server, and the second random variable is used to verify whether the response message comes from a legitimate device.

[0097] That is, in the embodiment of the present application, during the data interaction between the electronic device and the server, the server only needs to transmit encrypted data, the generation time of the encryption key and the random variable, and does not need to send the encryption key to the electronic device. This can reduce the resource overhead required for single data communication encryption, and improve the success rate of data transmission when the network quality is poor and data security needs to be guaranteed.

[0098] Based on the contents described in the above embodiments, in a feasible implementation manner, the above server and the above electronic device will perform identity authentication in advance, and after the identity authentication is passed, the server sends a key seed to the electronic device.

[0099] Reference Figure 4 , Figure 4 A signaling flow diagram of a communication encryption method provided in an embodiment of the present application. In a feasible implementation manner, the method includes:

[0100] S401. Sending random variable A: The electronic device generates random variable A locally, encrypts random variable A with a public key, and sends it to the server.

[0101] S402. Sending random variable B: After receiving the random variable A, the server decrypts the random variable A using the public key, generates a random variable B locally, encrypts the random variable B using the private key, and sends it to the electronic device.

[0102] S403. Send random variable C: After receiving the random variable A, the electronic device uses the local private key to decrypt the random variable B, and then generates the random variable C based on the random variable A and the random variable B, and uses the key C to encrypt the random variable C and send it to the server.

[0103] S404. Sending key seed: After the server sends the encrypted random variable B to the electronic device, if it can receive the random variable C within the preset time validity period (such as 5 minutes), it confirms that the identity authentication with the electronic device is completed, generates a key seed, and sends the key seed to the electronic device. If the server does not receive the random variable C within the preset time validity period (such as 5 minutes), it confirms that the identity authentication with the electronic device has failed and ends the current process.

[0104] S405. Encrypt data using key seed: After receiving the key seed sent by the server, the electronic device can use the key seed to generate an encryption key, and then use the generated encryption key to encrypt the data to be sent.

[0105] S406. Sending encrypted data, key generation time, and random variable D: After the electronic device completes data encryption, it generates a random variable D locally, and then sends the encrypted data, key generation time, and random variable D to the server.

[0106] S407. Use the key generation time to determine the encryption key, and decrypt the encrypted data based on the encryption key and the random variable D: After the server receives the encrypted data, key generation time, and random variable D sent by the electronic device, it uses the key generation time to determine the encryption key used by the electronic device, and decrypts the encrypted data based on the encryption key and the random variable D.

[0107] S408. Encrypt response data using key seed: After successfully decrypting the encrypted data, the server can also use the key seed stored locally on the server to generate an encryption key, and then use the encryption key to encrypt the response data.

[0108] S409. Sending encrypted data, key generation time, and random variable E: After encrypting the response data, the server generates a random variable E locally, and then sends the encrypted response data, key generation time, and random variable E to the electronic device.

[0109] S4010. Use the key generation time to determine the encryption key, and decrypt the encrypted data based on the encryption key and the random variable E: After the electronic device receives the encrypted data, key generation time, and random variable D sent by the server, it uses the key generation time to determine the encryption key used by the server, and decrypts the encrypted data based on the encryption key and the random variable E.

[0110] That is, the communication encryption method provided by the present application, during the data interaction process between the electronic device and the server, the sending end only needs to transmit the encrypted data, the generation time of the encryption key and the random variable, and does not need to send the encryption key to the receiving end. The receiving end can decrypt the encrypted data based on the received encryption key generation time and random variable, thereby reducing the resource overhead required for single data communication encryption, and improving the success rate of data transmission when the network quality is poor and data security needs to be guaranteed.

[0111] Based on the contents described in the above embodiments, the present application also provides an electronic device, which may be the electronic device described in the above embodiments, including at least one processor and a memory; the memory stores computer execution instructions; at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the communication encryption method executed by the electronic device in the above embodiments.

[0112] Based on the contents described in the above embodiments, the present application also provides an electronic device, which may be the server described in the above embodiments, comprising at least one processor and a memory; the memory stores computer execution instructions; at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the communication encryption method executed by the server in the above embodiments.

[0113] In order to better understand the embodiments of the present application, refer to Figure 5 , Figure 5 The hardware structure diagram of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the electronic device 50 of this embodiment includes: a processor 501 and a memory 502;

[0114] Memory 502, used to store computer-executable instructions;

[0115] The processor 501 is used to execute the computer-executable instructions stored in the memory to implement the various steps executed by the electronic device in the above embodiment; or the various steps executed by the server in the above embodiment, for details, please refer to the relevant description in the above method embodiment.

[0116] Optionally, the memory 502 may be independent or integrated with the processor 501 .

[0117] When the memory 502 is independently provided, the device 50 further includes a bus 503 for connecting the memory 502 and the processor 501 .

[0118] An embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the communication encryption method as described above is implemented.

[0119] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0120] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0121] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The above-mentioned module-composed unit can be implemented in the form of hardware or in the form of hardware plus software functional units.

[0122] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application.

[0123] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the application may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.

[0124] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.

[0125] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0126] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0127] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device or a main control device.

[0128] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0129] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A communication encryption method, applied to electronic equipment, characterized in that: include: detecting a signal quality of a network of the electronic device; When the signal quality of the network is lower than a preset signal quality, receiving a key seed sent by a server; The first data is encrypted based on the key seed to obtain first encrypted data; and a first message is sent to the server, wherein the first message includes the first encrypted data.

2. The method according to claim 1, characterized in that Encrypting the first data based on the key seed to obtain the first encrypted data includes: generating a first encryption key according to the key seed; The first data is encrypted using the first encryption key to obtain the first encrypted data.

3. The method according to claim 2, characterized in that Also includes: The electronic device generates a new encryption key according to the key seed when an update condition is met; The electronic device stores the new encryption key and the generation time of the new encryption key; After generating a new encryption key, the electronic device does not delete the encryption keys and generation times generated for the previous N times, and each encryption key is deleted after a preset time, where N is greater than or equal to 1.

4. The method according to claim 2 or 3, characterized in that: Also includes: The electronic device receives a response message to the first message, wherein the response message to the first message includes second encrypted data and second encryption key information; The electronic device determines, according to the second encryption key information and the correspondence between the encryption key of the electronic device and the encryption key information, a second encryption key corresponding to the second encryption key information; The electronic device decrypts the second encrypted data according to the second encryption key; The electronic device processes a response message of the first message according to the second encryption key and the decrypted second encrypted data.

5. The method according to claim 4, characterized in that Also includes: The electronic device receives an identity authentication; After confirming the identity authentication, the electronic device receives the key seed.

6. A communication encryption method, characterized in that: include: The server generates a key seed, and when the quality of the network of the electronic device is lower than the preset signal quality, sends the key seed to the electronic device, so that the electronic device encrypts the first data based on the key seed to obtain the first encrypted data; The server receives a first message sent by the electronic device, wherein the first message includes first encrypted data; The server determines a key seed used for the first encrypted data; The server decrypts the first encrypted data according to the key seed.

7. The method according to claim 6, characterized in that Also includes: The server generates a new encryption key according to the key seed when the update condition is met; The server stores the new encryption key and the generation time of the new encryption key; After generating a new encryption key, the server does not delete the encryption keys and generation times generated for the previous N times, and each encryption key is deleted after a preset time, where N is greater than or equal to 1.

8. The method according to claim 6, characterized in that Also includes: The server encrypts the second data using a second encryption key to obtain second encrypted data, where the second encryption key is generated by the server according to the key seed; The server sends a response message to the first message, wherein the response message to the first message includes the second encrypted data.

9. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the communication encryption method according to any one of claims 1 to 5.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the communication encryption method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Method and apparatus for updating an encryption key

    US20180034794A1