Device data encryption method, storage medium and electronic device for elderly care system
Simplifying elliptical encryption by using AES encryption, ProGuard obfuscation and computing chain algorithms in the elderly care system solves the problems of low data encryption efficiency and insufficient security of IoT devices, achieves efficient and secure data encryption and transmission, and improves the entire system security.
Patent Information
- Application Number
- CN202311397652.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-25
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2043-10-25
AI Technical Summary
In the data encryption process of existing IoT devices, the dot multiplication operation is complex and inefficient, and the security vulnerabilities of the web server are easily exploited by attackers, affecting the quality of life and security of the elderly.
The AES encryption algorithm is used to initially encrypt the data, the ProGuard obfuscation tool is used to obfuscate the code, and the dot multiplication operation in the elliptical encryption algorithm is simplified through the calculation chain algorithm, and the elliptical encryption algorithm is combined with the elliptical encryption algorithm for data transmission between devices to enhance the confidentiality and confidentiality of the data. Security.
The efficiency of the elliptical encryption algorithm is improved, the security of the code and the confidentiality of the data are enhanced, the possibility of malicious attacks is reduced, and the quality of life and security of the elderly are ensured.
Smart Images

Figure FDA0005012688940000011
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data encryption, and in particular relates to a device data encryption method, a storage medium and an electronic device of a pension system. Background Art
[0002] Internet of Things (IoT) refers to the interconnection of various physical devices, sensors, software, data, etc. through the Internet to achieve intelligent, automated, and remote management and control. Through IoT technology, the interconnection between devices, real-time data collection, transmission, and analysis can be achieved, thereby improving production efficiency, reducing costs, and improving service quality. The introduction of IoT composed of smart devices into the elderly care system is to improve the quality of life and safety of the elderly, and also provide a more intelligent and efficient solution for elderly care services. At the same time, IoT technology can realize functions such as health monitoring, smart home device control, and emergency assistance for the elderly. For example, smart health monitoring equipment can monitor the physical condition of the elderly in real time, detect abnormal conditions in time and remind medical staff; it can control home appliances, lights and other equipment through voice or mobile phone APP, which is convenient for the lives of the elderly. At the same time, it can send alarms to family members or medical staff in time when the elderly encounter an emergency to ensure the safety of the elderly.
[0003] IoT devices are generally connected to web servers through various protocols. If there are security vulnerabilities in the web server, attackers can use these vulnerabilities to steal data from IoT devices and then control IoT devices. In the elderly care system, as users of IoT devices, if the security of the web server cannot be guaranteed, it will directly affect the quality of life and safety of the elderly. With the large-scale use of Internet web pages, most systems choose to set up applications on web servers. The importance of ensuring web security technology is self-evident. At present, the main web security technologies are mainly divided into the establishment of security models, the optimization and joint use of encryption methods, web application firewalls, and the establishment of security detection technologies. Among them, the security model can help identify and evaluate security risks in the system, design and implement security strategies, and improve the security of the web system. The combination of multiple encryption methods can improve Web security. In Web security, encryption is one of the important means to protect data transmission and storage. Using multiple encryption methods together can improve security, because different encryption methods have different advantages and disadvantages, and can complement each other to improve overall security; web application firewall (WAF) is a network security device that can detect and block malicious web traffic to protect web applications from various attacks, such as SQL injection, cross-site scripting (XSS), and cross-site request forgery (CSRF). WAF can identify and intercept malicious traffic by checking the content, headers, and metadata in HTTP requests and responses, and process it according to predefined rules or policies. WAF can establish a line of defense between web applications and attackers to improve the security of web applications; establishing security detection technology can help discover and repair vulnerabilities and weaknesses in web applications and web servers, thereby improving their security. Security detection technologies include vulnerability scanning, penetration testing, code auditing, etc. These technologies can help discover security vulnerabilities and weaknesses in web applications and web servers, and provide corresponding repair suggestions.
[0004] The most widely used data encryption algorithm at present is the elliptic encryption algorithm. Although the algorithm is safe, reliable and not easy to crack, its encryption process involves a large number of point multiplication operations. The point multiplication operation is not a conventional algebraic operation, but a process of multiplying a point on the elliptic curve by an integer to obtain another point on the elliptic curve. For example, the point multiplication operation 2P is expressed as: 2P is P+P (point addition operation, which is also not a conventional algebraic operation), that is, find the tangent line between point P and the elliptic curve and another point on the elliptic curve, and then make the point symmetrical with respect to the X-axis, which is the value of 2P, and so on; this point multiplication operation is more complicated, and direct calculation in sequence consumes a lot of computing power and has low efficiency. Summary of the invention
[0005] In view of the deficiencies in the prior art, the present invention provides a device data encryption method, storage medium and electronic device for an elderly care system, which can safely, reliably and efficiently encrypt the data of the elderly care system.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] A device data encryption method for a pension system, wherein the privacy data is first encrypted using an AES encryption algorithm to generate a preliminary code file; the preliminary code file is obfuscated using a ProGuard obfuscation tool to obtain an obfuscated code and then saved; the communication data between devices is encrypted using an elliptic encryption algorithm and then sent to a corresponding device, and a calculation chain algorithm is used to simplify the point multiplication operation in the elliptic encryption algorithm, and the calculation chain algorithm includes the following steps:
[0008] S1. Convert the scalar d to be multiplied into a binary number d k-1 d k-2 …d1d0, where k is the number of binary digits in d;
[0009] S2, calculate the doubling point according to the following formula
[0010]
[0011] where p i is the ith doubling point, d i is the value corresponding to the i-th bit of the binary number d, G is the base point in the dot multiplication operation; i=0,1,...,k-1;
[0012] S3, perform point multiplication operation, the specific process is as follows:
[0013] (1) Initialize Q, where Q is the point at infinity;
[0014] (2) Starting from i=k-1, perform the following operations
[0015] (2.1) Multiply Q;
[0016] (2.2) If d i =1, then add Q to p i ; if d i =0, Q does not perform any operation;
[0017] (2.3) Check whether i is 0. If it is 0, go to (3). Otherwise, decrement i by 1 and return to (2.1).
[0018] (3) Output Q.
[0019] Preferably, the elliptic encryption algorithm comprises the following steps:
[0020] S10, selecting an elliptic curve and a base point G;
[0021] S20 / The data sender selects a random number a as the sender's private key, and performs a point multiplication operation on a and the base point G to obtain the sender's public key A;
[0022] S30, the sender sends A to the receiver;
[0023] S40, the recipient selects a random number b as the recipient's private key, and performs a point multiplication operation on b and the base point G to obtain the recipient's public key B;
[0024] S50, the receiver sends B to the sender;
[0025] S60, perform point multiplication operations on a and B, and on b and A respectively, and obtain secret key C;
[0026] S70, sending converts the plain text message to be sent into a number m;
[0027] S80. The sender determines any coordinate value c of the secret key C on the elliptic curve, obtains the ciphertext M by performing an XOR operation on c and m, and sends the ciphertext M to the receiver.
[0028] Preferably, the elliptic encryption algorithm comprises the following steps: the elliptic curve selected in step S10 is the curve P-256 defined by the National Institute of Standards and Technology of the United States.
[0029] Preferably, the curve P-256 selects a 256-bit prime number field.
[0030] Preferably, in step S70, the character string of the plain text message is mapped to its corresponding integer value through ASCII encoding, and the integer value mapped to the character string is arranged as a number m according to the original order of the character string.
[0031] Preferably, the privacy data includes a unique identification ID for device communication.
[0032] A computer-readable storage medium stores a computer program, wherein the computer program enables a computer to execute any of the above-mentioned methods for encrypting data of smart devices in a pension system.
[0033] An electronic device comprises: a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for encrypting data of a smart device of a pension system described in any one of the above items is implemented.
[0034] The beneficial effects of the present invention are:
[0035] 1. The calculation chain algorithm is a recursive algorithm that decomposes the point multiplication operation into multiple small point multiplication operations, thereby reducing the number of point addition operations and point multiplication operations, and improving the efficiency of the elliptic encryption algorithm; because the public key of the elliptic encryption algorithm is calculated through point multiplication, and the secret key C used for actual encryption is also calculated through point multiplication operations, so optimizing the point multiplication operation improves the overall efficiency of the elliptic encryption algorithm.
[0036] 2. The code of the elderly care equipment management system can be encrypted with AES and then obfuscated with ProGuard to achieve higher security. Because the obfuscated code is difficult to decompile and reverse engineer, it is difficult for attackers to analyze the logic and algorithm of the code. The data encrypted by AES can ensure the confidentiality of the data. Even if the data is stolen, the attacker cannot decrypt the data. The purpose of encrypting the code is to ensure the confidentiality and security of the code, so that unauthorized personnel cannot access, copy, modify or steal the code. When the code is encrypted, only people with the decryption key can decrypt, view and run the code. Although the code needs to be decrypted when running on the server, encryption can prevent the code from being obtained by hackers and malware attackers during transmission, storage and backup; obfuscating the code is to increase the complexity and incomprehensibility of the code, making it difficult for attackers to analyze and modify it. This obfuscated method makes the structure of the code more complicated, and it is difficult to obtain useful information or attack directly from the code. Therefore, combining code obfuscation and encryption improves the security of the elderly care equipment management system to a certain extent and effectively reduces the possibility of successful malicious attacks.
[0037] 3. The result of the communication data encrypted by the elliptic encryption algorithm is a ciphertext, which is obtained by processing the encryption algorithm. When using the elliptic encryption algorithm for communication, the web platform needs to use the secret key of the operated device to encrypt the communication data, and the device uses the secret key to decrypt the ciphertext. Only with the correct secret key can the ciphertext be decrypted to obtain the communication data information, so as to use the communication data to manipulate the specific device. The security of the encryption and decryption of the elliptic encryption algorithm is based on solving the discrete logarithm problem, that is, finding the discrete logarithm between two points on the elliptic curve that satisfies a specific equation. This problem is not feasible on a classical computer and requires the use of complex mathematical methods and algorithms to solve it. It has high time complexity and huge calculation amount. Therefore, it is very difficult for an attacker to obtain the key by brute force. Therefore, even if the communication data encrypted by the elliptic encryption algorithm is intercepted by the attacker during the transmission process, the specific communication data plaintext cannot be decrypted, and thus cannot be used to control the device, which also improves the security of the entire elderly care equipment management system.
[0038] 4. Through AES encryption, ProGuard obfuscation and elliptic encryption algorithm, the data of the elderly care system equipment is processed for security at the source of data generation and during the transmission process, so the security of the entire system is also improved. DETAILED DESCRIPTION
[0039] The following is a clear and complete description of the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only 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.
[0040] The present invention provides a method for encrypting device data of a pension system, comprising the following process:
[0041] As a web platform for the elderly care equipment supervision system, the basic code can be divided into basic data processing code and privacy data processing code. The basic data processing code is mainly used to generate some basic information and daily data about the elderly, including the elderly’s life information in the nursing home, such as some beds, catering and logistics, some basic information about materials, etc. The privacy data processing code mainly includes communication with IoT devices and can be used to remotely control the equipment. These codes may mainly store privacy data such as the unique identification ID for communicating with the device.
[0042] Use the AES encryption algorithm to encrypt the privacy data processing related code in the code, generate an encrypted code file, and use the ProGuard obfuscation tool to confuse the encrypted code file, making the code more difficult to decompile and crack. When the program is running, use the ProGuard deobfuscation tool to deobfuscate the code to restore the original code, and then use the AES decryption algorithm to decrypt the code. The decrypted code is recompiled and then run on the server.
[0043] When the user uses the web platform to control the device to obtain device information or operate the device, communication data will be sent to the device. The communication data will be encrypted using the elliptic encryption algorithm. The elliptic encryption algorithm is an asymmetric encryption algorithm, so public and private keys are generated for the web platform and the device at the same time, and then the secret key is generated through the public and private keys. When sending communication data to the device, the communication data is encrypted using the secret key. After the communication data is sent to the device, the device uses its own secret key to decrypt the communication data and then operate the device. The response data of the operating device is encrypted with the web platform secret key and then replied to the web platform. In this way, the web platform uses its own secret key to decrypt the data. In this way, the security of the operating device information during transmission is protected by the elliptic asymmetric encryption algorithm. The security of the data in transmission is guaranteed by the security of the elliptic asymmetric encryption algorithm. Even if the attacker intercepts the communication data of the operating device, it cannot be easily decrypted, and it is even more impossible to tamper with it and operate the device.
[0044] In this patent, the elliptic encryption algorithm plays an important role in data transmission, and the elliptic encryption algorithm is a very secure encryption algorithm.
[0045] For security reasons, we choose a security curve that has been extensively researched and verified, and the curve defined by NIST (National Institute of Standards and Technology) is selected.
[0046] The size of the prime field affects the security and efficiency of the elliptic curve. As for the choice of prime field, we choose a 256-bit prime field.
[0047] The base point is a fixed point on the elliptic curve, which is used to generate public and private keys and perform encryption and decryption operations. Because the NIST curve standard contains some predefined base points, we choose one of them as the base point. Since our prime field corresponds to the 256-bit prime field, we choose the NIST curve P-256. This curve has a base point determined by NIST, which is usually denoted as G.
[0048] The whole process of the elliptic encryption algorithm is as follows (because the selection of elliptic curve and base point has been explained in the previous text, the sequence number of the following steps is different from that in the claims, but the selection of elliptic curve and base point should be carried out as the first step):
[0049] S10. The sender selects a random number a as the private key and calculates the corresponding point on the elliptic curve through point multiplication. This point is usually called the sender's public key A. As for how to calculate the corresponding point on the elliptic curve, the sender needs to multiply the random number by the base point G (point multiplication) and obtain a new point on the elliptic curve, that is, A=aG. The selected random number a is usually a large integer, because as long as it is large enough, even if other people know the public key and the base point, it is difficult to derive the specific private key from the public key and the base point, so as to achieve the purpose of keeping the private key confidential. This random number should be kept confidential and only known by the sender.
[0050] S20: The sender sends the sender's public key A to the receiver.
[0051] The receiver knows the base point G and the sender's public key A, but as mentioned earlier, the receiver cannot deduce the sender's private key through the sender's public key A and base point G.
[0052] S30. The recipient also randomly selects a large random number b as the recipient's private key, and this random number is kept confidential. Similarly, b and the base point G are multiplied by point multiplication to obtain the recipient's public key B, that is, B = bG
[0053] S40. Similarly, the receiver sends its public key B to the sender, thus completing the public key exchange between the two parties.
[0054] S50, the sender knows the public key B of the receiver, then the sender uses his private key a to multiply the public key B sent by the receiver to form a new secret key C, where B is equal to bG, then C = aB = abG; the receiver also passes his private key b to multiply the public key A sent by the sender to form his own secret key bA, where A = aG, then C = bA = baG, because ab are both numbers, then ab = ba, so for the receiver and the sender, after the exchange, in fact, after the exchange, the newly formed secret key is the same. However, a and b are both private keys of both parties, and they are large random numbers, which will be larger after multiplication. Therefore, the sender's public key A and the receiver's public key B are transmitted between the receiver and the sender, and the newly formed secret key C is the same between the receiver and the sender, but it is not public, so it is difficult to crack the original sender and receiver's private keys. The role of confidentiality is achieved.
[0055] S60, the sender converts the plaintext message into a number m. Here, the plaintext message can be converted into a number by encoding. For example, ASCII encoding can be used to map each character in the plaintext string from left to right to its corresponding integer value, and then these integer values are connected from left to right to form the number m.
[0056] S70, secret key C is a point. Point C can find the value c of the X-axis (or Y-axis) on the elliptic curve. The sender calculates c and m through XOR operation to obtain the ciphertext M and sends it to the receiver. According to the XOR characteristics, the receiver can also obtain m by combining the ciphertext M and the value of c. As long as the security of point C is guaranteed, encryption and decryption can be achieved. However, obtaining point C requires obtaining the private key of the sender a and the private key of the receiver b at the same time, which is difficult in itself.
[0057] From the encryption and decryption steps of the elliptic curve encryption algorithm above, we can know that point multiplication operations are involved. Therefore, since the elliptic curve encryption and decryption already provide good security, if we want to optimize the efficiency of the elliptic curve, we need to try to optimize the elliptic curve encryption algorithm by improving the efficiency of the point multiplication operation.
[0058] This system uses the calculation chain algorithm to optimize the point multiplication operation. The calculation chain algorithm is a recursive algorithm that decomposes the point multiplication operation into multiple small point multiplication operations, thereby reducing the number of point addition operations and point multiplication operations and improving the efficiency of the elliptic encryption algorithm. Its optimization idea is similar to the divide-and-conquer algorithm, which divides a large problem into many small problems, and then uses the known intermediate results to solve these small problems and finally get the final result.
[0059] Here are the steps to optimize the dot multiplication operation using the calculation chain algorithm:
[0060] S1. Convert the dot product to a bit operation: Convert the scalar d to binary form. For example, d = (d k-1 d k-2 …d1d0), where k is the number of binary digits in d.
[0061] S2. Calculate the doubling point. According to the value of each bit in binary representation, select the corresponding doubling point as the point in the calculation chain, that is, the doubling point where p i is the ith doubling point, d i is the value corresponding to the i-th bit of the binary number d, G is the base point in the dot multiplication operation; i = 0, 1, ..., k-1.
[0062] S3. Calculation chain operation: The specific calculation process is as follows
[0063] (1) Initialize Q and let Q represent the point at infinity.
[0064] (2) Starting from i=k-1, perform the following operations:
[0065] (2.1) Double Q, that is, Q becomes 2Q;
[0066] (2.2) If d i =1, then add Q to p i ; if d i=0, then no operation will be performed on Q;
[0067] (2.3) Check whether i is 0. If it is 0, go to (3). Otherwise, decrement i by 1 and return to (2.1).
[0068] (3) Output Q, which is the result of the dot multiplication of the scalar d and the base point G.
[0069] In this way, the process of point multiplication operation is simplified by utilizing the calculation chain algorithm, because the public key of the elliptic encryption algorithm is calculated through point multiplication, and the secret key C used for actual encryption is also calculated through point multiplication operation. Therefore, optimizing the point multiplication operation improves the overall efficiency of the elliptic encryption algorithm.
[0070] In this way, through the chain algorithm, we reduce the number of multiplication operations and only multiply non-zero elements, thereby reducing the complexity and amount of calculation, thereby improving the efficiency of the point multiplication operation.
[0071] The present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the above-mentioned method for encrypting data of smart devices in the elderly care system.
[0072] The present invention also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for encrypting data of smart devices of the above-mentioned elderly care system is implemented.
[0073] In the embodiments disclosed in the present application, the computer storage medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. The computer storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the above. More specific examples of computer storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.
[0074] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0075] The above are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should be regarded as the protection scope of the present invention.
Claims
1. A method for encrypting device data in a pension system, which first encrypts the privacy data using an AES encryption algorithm to generate a preliminary code file; The preliminary code file is obfuscated using the ProGuard obfuscation tool, and the obfuscated code is saved; the communication data between devices is encrypted using the elliptic encryption algorithm and then sent to the corresponding device, which is characterized by: A calculation chain algorithm is used to simplify the point multiplication operation in the elliptic encryption algorithm. The calculation chain algorithm includes the following steps: S1. Convert the scalar d to be multiplied into a binary number d k-1 d k-2 …d1d0, where k is the number of binary digits in d; S2, calculate the doubling point according to the following formula where p i is the ith doubling point, d i is the value corresponding to the i-th bit of the binary number d, G is the base point in the dot multiplication operation; i=0,1,...,k-1; S3, perform calculation chain operation, the specific process is as follows: (1) Initialize Q, where Q is the point at infinity; (2) Starting from i=k-1, perform the following operations (2.1) Multiply Q; (2.2) If d i =1, then add Q to p i ; if d i =0, Q does not perform any operation; (2.3) Check whether i is 0. If it is 0, go to (3). Otherwise, decrement i by 1 and return to (2.1). (3) Output Q; The elliptic encryption algorithm comprises the following steps: S10, selecting an elliptic curve and a base point G; S20 / The data sender selects a random number a as the sender's private key, and performs a point multiplication operation on a and the base point G to obtain the sender's public key A; S30, the sender sends A to the receiver; S40, the recipient selects a random number b as the recipient's private key, and performs a point multiplication operation on b and the base point G to obtain the recipient's public key B; S50, the receiver sends B to the sender; S60, perform point multiplication operations on a and B, and on b and A respectively, and obtain secret key C; S70, sending converts the plain text message to be sent into a number m; S80, the sender determines any coordinate value c of the secret key C on the elliptic curve, performs an XOR operation on c and m to obtain a ciphertext M, and sends the ciphertext M to the receiver; The elliptic curve selected in step S10 is the curve P-256 defined by the National Institute of Standards and Technology of the United States; The curve P-256 selects a 256-bit prime number field.
2. The device data encryption method of the elderly care system according to claim 1 is characterized by: In step S70, the character string of the plain text message is mapped to its corresponding integer value through ASCII encoding, and the integer value mapped to the character string is arranged as a number m according to the original order of the character string.
3. The device data encryption method of the elderly care system according to claim 1 is characterized by: The privacy data includes a unique identification ID for device communication.
4. A computer-readable storage medium storing a computer program, characterized in that: The computer program enables the computer to execute the smart device data encryption method for the elderly care system as described in any one of claims 1-3.
5. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for encrypting data of smart devices of a pension system as described in any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Data encryption method and device based on encryption algorithm and computer equipment
CN110855433A
Electric power data privacy communication method based on hybrid encryption algorithm
CN112511304A
Combination white box / black box cryptographic processes and apparatus
US20090252327A1
Elliptic domain curve operational method and elliptic domain curve operational unit
WO2015164996A1
