Mysql sensitive data protection system based on scalable precision double chaotic hash and RSA

By combining the scalable precision dual Logistic chaotic hashing algorithm and RSA asymmetric encryption algorithm, the chaotic characteristic degradation problem in the protection of sensitive information of Mysql database is solved, achieving higher security and reduced collision conflicts.

CN113297619BActive Publication Date: 2025-04-11HARBIN UNIV OF SCI & TECH

Patent Information

Application Number
CN202110590508.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-28
Publication Date
2025-04-11
Estimated Expiration
2041-05-28

AI Technical Summary

Technical Problem

The prior art is difficult to effectively protect sensitive information in Mysql databases, especially the problem of chaotic characteristics degradation under limited computing accuracy, which has led to a threat to database security.

Method used

The extensible precision dual Logistic chaotic hashing algorithm is used in combination with RSA asymmetric encryption algorithm, and the RSA private key is used as the initial parameter and control parameter of the dual chaotic hashing algorithm. By iteratively generating a hash digest and encrypting it with sensitive data for XOR operation, ensuring the security of sensitive information.

Benefits of technology

Through this method, the security of database sensitive information is significantly improved, the collision collision of hash values ​​is reduced, the space for chaotic mapping is increased, and illegal access and data leakage is prevented.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113297619B_ABST
    Figure CN113297619B_ABST
Patent Text Reader

Abstract

The present invention proposes a Mysql sensitive data protection system based on scalable precision double chaotic hash and RSA. It includes: 1. Generate asymmetric keys through RSA algorithm to protect database user accounts; 2. Use the private key of RSA algorithm as the initial parameter of scalable precision double Logistic chaotic algorithm, generate keys through iterative calculation of double chaotic hash algorithm, encrypt binary data group of sensitive data of customers in hotel database, and generate ciphertext; 3. When it is necessary to decrypt the sensitive data of customers in hotel database, use the private key as the initial parameter of double chaotic hash algorithm to perform XOR operation with ciphertext, and restore ciphertext to plaintext. The present invention makes full use of the private key and public key of RSA asymmetric encryption algorithm and the excellent collision avoidance feature of scalable precision double chaotic hash algorithm to protect sensitive information in hotel database and improve the security of user privacy data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of cryptography and data security, and specifically is a system for encrypting and protecting sensitive field information of a Mysql database by utilizing an extensible precision double Logistic chaotic hash algorithm and an RSA asymmetric encryption algorithm. Background Art

[0002] Nowadays, stricter management is needed to track and query the identity registration information of guests staying in the hotel. Therefore, many hotels and B&Bs have begun to abandon "room cards" and customers use their own mobile phones and faces to register.

[0003] The significance of this solution is not only that it requires stricter identity registration and authentication, but more importantly, it can help hotels achieve "cost reduction" and "contactless service", facilitate the check-in / check-out procedures for customers, avoid queues during peak hours, and reduce intensive contact between guests.

[0004] However, the use of new technologies will also bring about privacy and security issues for users. For example, the user's mobile phone information, facial information, etc. All the user's various privacy information is registered in the hotel's system database; therefore, this information needs to be protected to prevent the user's information from being illegally stolen.

[0005] The hash function is one-way. The input of the hash function is a message M of variable size, and the output is a hash value H(M) of fixed size. The core of the hash algorithm is to design a collision-free hash function to obtain an ideal and uniform hash value in the hash space.

[0006] Encryption is essential for protecting sensitive data. With the rapid development of artificial intelligence and big data, my country has entered the information age. Information data is growing exponentially. Previous encryption algorithms for data, such as symmetric encryption algorithms and asymmetric encryption algorithms, can no longer meet the fast and secure encryption protection needs of information technology. Therefore, many scholars are now studying safer and more efficient encryption algorithms to protect data.

[0007] Chaotic systems have many excellent properties, such as randomness, sensitivity to initial values, long-term unpredictability, etc. These properties can fit well with good cryptographic theories, and these properties can be used to construct excellent encryption algorithms. Although some chaotic encryption algorithms have been fully studied and applied, there are still problems that are difficult to avoid in chaotic cryptography, that is, the degradation of chaotic characteristics, which seriously threatens the security of cryptographic systems. Therefore, improving the security of chaotic mapping in cryptographic algorithms is an important issue in this field.

[0008] In order to solve the problem of degradation of chaotic characteristics under limited calculation accuracy, the existing solutions are to add random perturbations to the chaotic system or to superimpose multiple chaotic mappings, but they still cannot fundamentally solve the quantization errors caused by limited precision; therefore, scalable precision methods can be used to perform chaotic calculations. The scalable precision method allows "users" to specify the calculation accuracy, thereby breaking the limitations of calculations under limited precision, preventing the excellent characteristics of chaos from degrading, thereby increasing the mapping space and obtaining better chaotic functions.

[0009] The information in the MySQL database is generally stored in the form of plain text characters. Criminals can use this vulnerability to break into the database system and illegally obtain the data in the MySQL database, or even tamper with the data in the database, which will cause the database system to crash and cause losses to users. At the same time, some database staff can access the information in the database at will, which will also bring security risks to the database. Based on this, the protection of the database should not only prevent the intrusion of illegal personnel, but also prevent the illegal access of staff. Therefore, it is necessary to encrypt the data in the database, so that even if these personnel obtain the encrypted data in the database, they cannot be restored to plain text, so as to achieve the purpose of protecting the database.

[0010] The hash algorithm of the scalable precision chaotic mapping model and the RSA asymmetric encryption algorithm are combined to encrypt and protect the data in the database. The security of the database can be greatly improved by combining the scalable precision double chaotic hash function and the RSA algorithm.

[0011] The private key of the RSA algorithm is used as the initial parameter and control parameter of the scalable precision double chaotic hash algorithm, and an iterative operation is performed to generate a hash summary, and then the iteratively generated hash summary and the information to be encrypted in the database are XOR-operated and encrypted into a ciphertext and stored in the database. The present invention utilizes the security of chaotic Hash hashing and combines the advantage that only the user can obtain the RSA private key, which can better protect the security of sensitive information in the MySQL database. Summary of the invention

[0012] 1. Technical issues to be resolved

[0013] In order to protect sensitive information in the MySQL database, the present invention can obtain a more uniform hash value and greatly reduce collision conflicts. The user can specify the number of iterations of the scalable precision dual chaotic hash function and the calculation accuracy, and can also specify the length of the hash value summary to improve the randomness of the chaotic hash function, thereby obtaining a more secure chaotic hash algorithm.

[0014] The encryption of sensitive information in the Mysql database is completed by combining the scalable precision double chaotic hash algorithm and the RSA asymmetric encryption algorithm. The private key of the RSA asymmetric encryption algorithm is mainly used as the initial parameter and control parameter of the scalable precision double chaotic hash algorithm, and then the hash summary is generated through iteration. The generated hash summary is converted into binary form and XORed with the sensitive data to be encrypted to generate ciphertext. When the user needs to view the sensitive data for decryption, the private key obtained from the server is used as the initial parameter and control parameter for chaotic hash iteration operation, and the generated summary is XORed with the ciphertext to restore the plaintext. The scalable precision double chaotic hash encryption algorithm is applied to the Mysql database of the hotel to prevent the hotel staff from illegally using sensitive information.

[0015] By using the customer's private key as the initial parameter of the encryption algorithm, hotel staff cannot arbitrarily view the sensitive information and facial recognition information of hotel customers, protecting the customer's privacy information from infringement and illegal use.

[0016] (II) Technical solution

[0017] In order to safely implement the protection of the Mysql database, the present invention provides a Mysql sensitive data protection system based on the combination of scalable precision dual chaotic hash and RSA, wherein the RSA algorithm implements the login of the database front end and uses the private key of the RSA algorithm combined with the scalable precision dual Logistic chaotic hash encryption algorithm to implement the encryption and decryption of sensitive data in the Mysql database. The specific steps include:

[0018] Step 1: Use the RSA algorithm to generate an asymmetric key to protect the database user account. The method of using the public key for encryption at the front end and the private key for decryption at the back end is used to prevent the user's account password from being leaked during the transmission process.

[0019] Step 2: To prevent the sensitive information in the Mysql database from being leaked, the sensitive information of the hotel customers (tel: mobile phone number, IDcard: ID card number) needs to be encrypted. Here, the scalable precision double chaotic hash algorithm is used for encryption, and the private key of the RSA algorithm is selected as the initial parameter and control parameter of the algorithm. The hotel staff cannot obtain the authorized private key, so they cannot decrypt the ciphertext and view the sensitive information of the customers.

[0020] Step 3: Use the scalable precision double chaotic hash algorithm to perform iterative operations to generate a hash summary, convert it into binary form, perform an XOR operation with the binary information of the data to be encrypted in the database to generate a ciphertext, and store it in the database.

[0021] Step 4: When the user needs to view sensitive data in the hotel database, the encrypted ciphertext needs to be decrypted. The private key of the RSA algorithm is used as the initial parameter and control parameter of the chaotic iterative operation to perform scalable precision double chaotic hash iteration to generate a hash summary and perform an XOR operation with the ciphertext to restore the ciphertext to plaintext.

[0022] The hotel Mysql database is encrypted and decrypted based on the combination of scalable precision double chaos hash encryption and RSA algorithm to achieve the purpose of protecting sensitive information in the database. The scheme is as follows:

[0023] Generate asymmetric keys to protect user accounts in the hotel's MySQL database, encrypt sensitive customer information in the database, and allow users to log in to the hotel database to view data.

[0024] Part 1: Use the RSA algorithm to generate asymmetric keys to protect database user accounts.

[0025] Function_1: The process of using the RSA asymmetric encryption key generation algorithm when a user logs into the hotel database system is described as follows:

[0026] S1_1, the hotel MySQL database is divided into two categories of users for logging in: hotel customers and hotel staff. Hotel users choose their own identities and log in with usernames and passwords when logging in;

[0027] S1_2. In order to prevent the key from being intercepted during communication, the server uses the RSA asymmetric algorithm to generate a pair of public and private keys during a session and saves them in the session on the server.

[0028] S1_3. Pass the public key to the front end for the front end to encrypt the user's account password, encrypt the user's account password, and keep the user's password encrypted during the transmission process. In this way, even if the request is intercepted by malicious people and the username and password are obtained, others will not be able to crack the password;

[0029] S1_4. The front end encrypts the user's account and password with the public key and transmits the ciphertext to the server. After obtaining the ciphertext encrypted by the public key, the server obtains the private key from the server's session to decrypt the account password and saves the decrypted account password in the database.

[0030] Function_2: The implementation process of the hotel's customer login system is described as follows:

[0031] S2_1. Choose to log in to the system as a customer. When you enter your username and password to log in to the system, the system will pass the public key to the front end to encrypt the account and password you entered. When the encrypted ciphertext is transmitted to the server, the server will call the private key to decrypt the encrypted data.

[0032] S2_2, compare the decrypted user password with the user password stored in the database, and if the comparison is successful, the user can successfully log in to the system;

[0033] S2_3. After successfully logging into the system, the hotel customer can view his / her sensitive information (mobile phone number, ID number, and face recognition information) and non-sensitive information (name, room information, check-in time, check-out time, bill);

[0034] S2_4. When the hotel customer enters the system, he needs to view or modify his sensitive information. The server uses the private key as the initial parameter and control parameter of the scalable precision double chaotic hash algorithm, performs iterative calculation to generate a hash summary, and performs XOR operation on the generated hash summary and the ciphertext of the sensitive information to decrypt and restore it to plain text.

[0035] Function_3: The implementation process of the hotel staff logging into the system is described as follows:

[0036] S3_1. Choose to log in to the system as a hotel staff member. When entering the user name and password to log in to the system, the user password is encrypted using the public key of RSA asymmetric encryption, and the user password is decrypted using the private key on the server side.

[0037] S3_2. Compare the decrypted user password with the user password stored in the database. If the comparison is successful, you can successfully log in to the system.

[0038] S3_3. After successfully logging into the system, the hotel staff can view the non-sensitive information of hotel users in the database (name, room information, check-in time, check-out time, bill).

[0039] S3_4. The hotel staff cannot obtain the private key of the RSA algorithm from the server, and cannot decrypt or view the sensitive information of the hotel customers.

[0040] Part 2: Encryption of sensitive customer information in the MySQL database.

[0041] The implementation process of the hotel database encrypting the sensitive data of customers is described as follows:

[0042] SM1. Initialize the private key in the RSA algorithm key generated by the server;

[0043] SM1_1. Divide each byte of the hexadecimal private key into blocks (L 1 , L 2 , L 3. ....L N ), N is the number of blocks of bytes of the private key;

[0044] SM1_2. Quantize all byte blocks of the private key. The quantization method is to use a character as a plaintext information block and convert it into the corresponding ASCII code value. The private key is represented by an array S. The S in the array 1 For L 1 The converted ASCII code value, S 2 For L 2 The corresponding ASCII code value is..., S N For L N Corresponding ASCII code value;

[0045] SM2, for (S 1 , S 2 , S 3 .....S N ) Perform scalable precision double Logistic hash iterative operations in sequence to generate a hash summary;

[0046] SM3, first of all, S 1 Perform iterative operations and convert S 1 Transformed into initial parameters and control parameters of scalable precision dual logistic chaotic iterative operation;

[0047] SM3_1. The first logistic equation is defined as: i+1 =μ 1 x i (1-x i); Logistic x 0 =2S 1 / (k-1), where k=256, x 0 ∈(0,1),μ 1 =(S 1 -30) / 1000+3.9, where μ∈(3.9,4), x 0 μ is the initial parameter and control parameter of Logistic mapping. Under chaotic mapping, x is a non-periodic non-convergent sequence. When μ is between [3.5699456, 4], the Logistic mapping is in a chaotic state. When μ=4, it can cover all values ​​between 0 and 1, and can achieve the effect of surjection. That is, the closer the value of μ is to 4, the better the chaotic characteristics of the sequence and the stronger the randomness.

[0048] SM3_2, the second logistic equation is defined as: i+1 =μ 2 y i (1-y i ); Logistic y 0 =(μ 1 -3.9)*100, where y 0 ∈(0,1),μ 2 =x 0 / 100+3.9, where μ∈(3.9,4).

[0049] SM4, perform scalable precision double logistic hash iteration operation;

[0050] SM4_1, calculate the first Logistic equation, x∈(0,1);

[0051] SM4_2, set the number of iterations of the scalable precision dual chaotic hash function to n and the precision of the random sequence to m;

[0052] SM4_3. The mathematical relationship between the number of iterations and the accuracy of the random sequence is: L n+1 =2*L n +L μ , where L n is the precision of the current parameter x, L μ is the accuracy of the current parameter μ;

[0053] SM4_4, perform iterative calculation. If the current number of iterations is less than the set number of iterations or if the precision of the current random sequence is less than the set precision m, then continue the iterative calculation;

[0054] SM4_5, for random sequences x exceeding the set precisioni Perform "Truncation operation" and "Rounding operation". If the number of final iterations does not match the number of digits in the set random sequence, then take the maximum number of iterations to meet the accuracy requirements of the random sequence.

[0055] SM4_6, finally after iteration, the random sequence x will be obtained k Save in a one-dimensional array, denoted as X;

[0056] SM4_7, iteratively calculate the second Logistic chaotic equation, the calculation equation is, y∈(0,1), where y 0 =(μ 1 -3.9)*100, y 0 ∈(0,1),μ 2 =x 0 / 100+3.9,μ∈(3.9,4);

[0057] SM4_8, repeat steps S4_2 to S4_5, and finally obtain the random sequence y after iteration k Save in a one-dimensional array, denoted as Y;

[0058] SM4_9, let z = |x k -y k |, z∈(0,1), the final random sequence is stored in a one-dimensional array, denoted as Z;

[0059] SM5. Set the number of bits of the hash summary to be obtained to b, and evenly group the Z sequence according to the set number of bits of the hash summary; the first group Array_1, Array_2...Array_b, if the number of bits is not enough to be evenly divided, the missing bits of the group are filled with 0;

[0060] SM6, set the seed, and start selecting the position for the grouping of the random sequence;

[0061] SM6_1, seed is x 0 The sum of the digits of ;

[0062] SM6_2, the specific steps of random position selection are: obtain the corresponding group according to the seed value, use the array value of the corresponding position on the group that matches the seed value as the position selection value of this group, and use the position selection value as the next seed to continue position selection until all groups are selected and the random position selection ends. If the seed value is greater than the length of the Array of the random sequence group, then perform a modulo (mod) operation on the length value of the Array;

[0063] SM6_3, save the value obtained by random selection into the array, which is S 1 The hash digest of .

[0064] SM7, according to the method of steps S3 to S6, 2 , S 3 ......S N Perform a hash summary operation and convert the hash summary of the requested private key into binary form;

[0065] SM8. Use the binary form of the generated hash summary as a key to encrypt the sensitive data of the customer in the hotel database Mysql;

[0066] S8_1. The sensitive data to be encrypted are: sensitive data 1, sensitive data 2, sensitive data 3.....;

[0067] S8_2, convert the sensitive data 1 to be encrypted into binary form, perform XOR operation on the binary form of the hash summary generated in step S7, and obtain the ciphertext 1 of the sensitive data 1, and store the ciphertext in the database; if the number of binary digits of the hash summary is greater than the number of binary digits of the sensitive data to be encrypted, then perform XOR operation starting from the first digit of the hash summary, and discard the excess digits;

[0068] SM8_3, perform the k+1th scalable precision double logistic hash iteration operation to generate a hash summary and convert it into binary form, perform an XOR operation with the binary plaintext data of sensitive data 2 to generate ciphertext 2, and store the ciphertext in the database;

[0069] SM8_4, and so on, perform the k+j-1th scalable precision double Logistic hash iteration operation to generate the hash summary and convert it into binary form, perform XOR operation with the binary plaintext data of sensitive data j to generate ciphertext j, and store the ciphertext in the database;

[0070] SM9. The scalable precision double logistic hash encryption algorithm using the RSA private key as the initial parameter ends.

[0071] Part 3: The user logs into the hotel database to view the data.

[0072] The implementation process of the decryption method Func for users to log in to the hotel database to view the customer's sensitive data is described as follows:

[0073] SF1. Hotel staff cannot view customers' sensitive data. After logging into the system, the server will not grant them private keys, so they cannot generate hash summaries to decrypt customers' sensitive data.

[0074] SF2. Hotel customers can view their sensitive data stored in the database;

[0075] SF2_1. After the hotel customer logs into the system, the server will grant him a private key and perform a scalable precision double Logistic hash iteration operation on the private key to generate a hash summary;

[0076] SF2_2. Perform an XOR operation on the binary form of the generated hash summary and the binary form of the ciphertext of the customer's sensitive data stored in the database to decrypt and restore them to plain text.

[0077] (III) Beneficial effects

[0078] The beneficial effects of the present invention are as follows: by adopting a hash encryption algorithm with scalable precision dual chaos, the precision of calculating chaos can be specified. As the precision increases, the mapping space will also increase accordingly, breaking the limitation of limited precision in the computer, making the obtained hash values ​​evenly distributed, reducing conflicts, and making chaos closer to an ideal state.

[0079] The double Logistic chaos iteration method increases the disorder of the sequence, which can improve the complexity of the chaotic hash encryption algorithm and make the encryption algorithm more secure.

[0080] The scalable precision double chaotic hash encryption algorithm is applied to the encryption of sensitive data in the database, and combined with the RSA encryption algorithm, the private key of the RSA asymmetric encryption is used as the initial parameter of the iteration of the scalable precision double chaotic hash algorithm, and the hash summary generated by the scalable precision double chaotic hash algorithm is XORed with the plaintext of the sensitive data to obtain the ciphertext. When decryption is required, the hash summary and the ciphertext are XORed back to the plaintext. The security and unidirectionality of the chaotic hash algorithm can be fully utilized to realize the encryption and decryption of data, thereby improving the security of the database. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] Figure 1 It is a flowchart of Mysql sensitive data protection based on scalable precision double chaotic hashing and RSA. DETAILED DESCRIPTION

[0082] The following is a more detailed description of the embodiments of the present invention in conjunction with the accompanying drawings and examples. The following examples are only used to illustrate the present invention and cannot be used to limit the scope of application of the present invention.

[0083] Example 1: Use the RSA algorithm to generate asymmetric keys to protect database user accounts.

[0084] S1. The hotel database uses a MySQL database, which can be divided into two types of users for logging in: hotel customers and hotel staff. Hotel users choose the appropriate identity to log in with a username and password when logging in.

[0085] S2. In order to prevent the key pair from being intercepted when it is transmitted to the front end, the server uses the RSA asymmetric algorithm to generate a pair of keys - a public key and a private key - during a session, and stores them in the session on the server.

[0086] S3. When you enter your username and password to log in to the system, the system transmits the public key from the server to the front end. The front end encrypts the user's account password so that the user's password is encrypted during transmission, and then the encrypted ciphertext is transmitted to the server.

[0087] S4. The front end encrypts the user's account and password with the public key and transmits the ciphertext to the server. After obtaining the ciphertext encrypted by the public key, the server obtains the private key from the session on the server to decrypt the account password.

[0088] S5. Compare the decrypted user password with the user password stored in the database. If the comparison is successful, the user can successfully log in to the system.

[0089] Example 2: The implementation process of building a hotel database to encrypt customers' sensitive data.

[0090] S1. Initialize the private key in the key pair of the RSA algorithm generated by the server;

[0091] S1_1. Assume that the private key is: 73D36C4451F6, divide all bytes of the hexadecimal private key into blocks [7,3,D,3,6,C,4,4,5,1,F,6];

[0092] S1_2. Quantize each byte block of the private key. The quantization method is to use a character as a plaintext information block and convert it into the corresponding ASCII code value. The private key is represented by an array S. The S in the array 1 The converted ASCII code value of 7 is 55, S 2 The ASCII code value corresponding to 3 is 51......S 12 The ASCII code value corresponding to 6 is 54;

[0093] S2. Perform scalable precision double logistic hashing iteration operation on [55, 51, 68, 51, 54, 67, 52, 52, 53, 49, 70, 54] in sequence to generate a hash summary.

[0094] S3. First, S1 =55 for iterative operation, and S 1 Transformed into initial parameters and control parameters of scalable precision dual logistic chaotic iterative operation;

[0095] S3_1, first Logistic: x 0 =2S 1 / (k-1)=0.43, where k=256, x 0 ∈(0,1), x is a non-periodic non-convergent sequence under chaotic mapping, x 0 is the initial parameter of Logistic mapping; μ 1 =(S 1 -30) / 1000+3.9=3.92, where μ∈(3.9,4), μ is the control parameter of the Logistic mapping;

[0096] S3_2, the second Logistic: y 0 =(μ 1 -3.9)*10=0.25, where y 0 ∈(0,1),y 0 is the initial parameter of Logistic chaos; μ 2 =x 0 / 100+3.9=3.90, where μ∈[3.9,4), μ is the control parameter of Logistic chaos;

[0097] S4, perform scalable precision double Logistic hash iteration operation;

[0098] S4_1, the calculation equation for the first Logistic iteration is: i+1 =μ 1 x i (1-x i ), x∈(0,1);

[0099] S4_2, setting the number of iterations of the scalable precision dual chaotic hash function to 3 and the precision of the random sequence to 20;

[0100] S4_3. The mathematical relationship between the number of iterations and the accuracy of the random sequence is: L n+1 =2*L n +L μ , where L n is the precision of the current parameter x, L μ is the accuracy of the current parameter μ; at this time x 0 The accuracy of L 0 =2,μ 1 The accuracy of L μ is 2, so L1 =2*2+2=6.

[0101] S4_4, perform iterative calculation, since x 1 =3.92*0.43*(1-0.43)=0.960792, because L 1 The precision of x is 6, so 1 Keep 6 digits of precision.

[0102] S4_5. For a random sequence x that exceeds the set precision i Perform "Truncation operation" and "Rounding operation". If the number of final iterations does not match the number of digits in the set random sequence, then take the maximum number of iterations to meet the accuracy requirements of the random sequence.

[0103] S4_6, after 3 iterations, the precision of the random sequence is taken as 20. After calculation, x 3 for:

[0104] x 3 =μ 1 *x 2 *(1-x 2 )=0.66744412870149173441

[0105] The random sequence x 3 Stored in a one-dimensional array, denoted as X.

[0106] S4_7, perform iterative calculation of the second Logistic chaos equation, the calculation equation is y i+1 =μ 2 y i (1-y i ), y∈(0,1), where y 0 =(μ 1 -3.9)*100,y 0 ∈(0,1),μ 2 =x 0 / 100+3.9,μ∈(3.9,4);

[0107] S4_8, repeat steps S4_2-S4_5, iterate 3 times, after calculation, y 3 for:

[0108] y 3 =μ 2 *y 2 *(1-y 2 )=0.70017940513160130636

[0109] The obtained random sequence y 3 Save in a one-dimensional array, denoted as Y.

[0110] S4_9, let z = |x 3 -y 3 |=0.21799366418296825846,z∈(0,1), the final random sequence is stored in a one-dimensional array, denoted as Z;

[0111] S5. Set the number of bits of the hash summary to be obtained to 2, and evenly group the Z sequence according to the set number of bits of the hash summary. At this time, the number of bits of the hash summary to be obtained is less than the precision of the random sequence that the set Logistic mapping needs to obtain, which is 20. Therefore, the number of information bits is extracted according to the number of bits of the hash summary to be obtained set by the user, and Z is divided into two groups.

[0112] The first group Array_1 = [2,1,7,9,9,3,6,6,4,1].

[0113] The second group Array_2 = [8, 2, 9, 6, 8, 2, 5, 8, 4, 6].

[0114] S6. Set the seed and start selecting positions for the groups of the random sequence;

[0115] S6_1, seed=4+3=7, (seed is x 0 Since the value of seed is less than the length of the array, there is no need to perform a modulo operation on the value;

[0116] S6_2, the specific steps of random position selection are: since the seed value is 7, the position selection value of the first Array_1 is 6, and the first position selection value is used as the seed for the next position selection to continue the position selection. The position selection value of the second Array_2 is 5, and the position selection ends at this time.

[0117] S6_3, the obtained selection value [6,5] is saved in the array, represented as S 1 The hash digest of .

[0118] S7. According to the method of steps S3 to S6, the hash summary is calculated in sequence as [51, 68, 51, 54, 67, 52, 52, 53, 49, 70, 54], and the hash summary of the private key "73D36C4451F6" obtained after iterating the scalable precision double logistic chaotic hash algorithm is: [657825782031878735818320]. And the hash summary of the private key is converted into binary form as follows: 100010110100110011001110100111100001011 11010000001111000111110000110111001010000

[0121] S8, using the binary form of the generated hash summary as a key to encrypt the sensitive data of the customer in the hotel database;

[0122] S8_1. Assume that the sensitive data to be encrypted is: 1134X, 193abc;

[0123] S8_2, convert the sensitive data 1 to be encrypted: "1134X" into a binary sequence of 10110001001011, perform XOR operation on the binary form of the hash summary generated in step S7 to obtain the ciphertext of the sensitive data 1 as "00111010011010", and store the ciphertext in the database; since the number of binary digits of the hash summary is greater than the number of binary digits of the sensitive database to be encrypted, the XOR operation is performed starting from the first digit of the hash summary, and the excess digits are discarded;

[0124] S8_3. Initialize the encrypted sensitive data 2: "193abc" and convert it into a binary sequence of 101111000101111001.

[0125] S8_4. Perform the fourth scalable precision double chaotic hash iteration operation, and the generated hash summary is [116342637770525264932877]. Convert this hash summary into binary form as follows: 11000101000101111001001110000101000101 001010001100110101110010111000000001101

[0128] S8_5. XOR the binary form of the hash summary generated by the fourth scalable precision double logistic hash iteration operation with the binary plaintext data of sensitive data 2 to generate ciphertext 2 "001101110001001010", and store the ciphertext in the database;

[0129] S9. The scalable precision double logistic hash encryption algorithm using the RSA private key as the initial parameter ends.

[0130] Example 3: After logging into the hotel database, the user can view the hotel customer information.

[0131] S1. After logging into the system, the hotel staff can view the non-sensitive information of the hotel customers (name, room information, check-in time, check-out time, bill). After logging into the system, the server will not grant the hotel staff a private key, so the hotel staff cannot generate a hash summary to decrypt the customer's sensitive data and cannot view the customer's sensitive data;

[0132] S2. After successfully logging into the system, hotel customers can view their non-sensitive information (name, room information, check-in time, check-out time, bill);

[0133] S3. After successfully logging into the system, the hotel customer decrypts the ciphertext of his sensitive data so that he can view his sensitive information (mobile phone number, ID card number). The decryption process is as follows:

[0134] S3_1. After the hotel customer logs into the system, the server will grant him a private key. The server uses the private key as the initial parameter and control parameter of the scalable precision double logistic hash iterative algorithm to perform iterative calculations to generate hash summaries.

[0135] S3_2. Perform an XOR operation on the binary form of the generated hash summary and the binary form of the ciphertext of the customer's sensitive data stored in the database to decrypt and restore them to plain text.

[0136] Finally, it should be noted that the above examples are only used to illustrate the technical method of the present invention, rather than to limit it. Although the present invention has been described in detail according to the above examples, researchers in this field should understand that the technical solutions of the above examples can still be changed, and some technical points therein can also be replaced. Whether it is a change or a replacement, it is still within the scope of protection of the present invention.

Claims

1. A Mysql sensitive data protection system based on scalable precision dual chaotic hashing and RSA, characterized by: (1) Protecting the database user account by generating an asymmetric key through the RSA algorithm, including: the process of using the RSA asymmetric encryption key generation algorithm when the user logs into the hotel database system, the implementation process of the hotel's customer login system, and the implementation process of the hotel's staff login system; (2) The implementation process of encrypting the sensitive information of customers in the MySQL database includes: using the scalable precision double chaotic hash algorithm to encrypt the sensitive data in the database, and selecting the private key of the RSA algorithm as the initial parameters and control parameters of the scalable precision double chaotic hash algorithm; (3) The implementation process of the user logging into the hotel database to view the data includes: using the private key of the RSA algorithm as the initial parameter and control parameter of the chaotic iterative operation to perform scalable precision double chaotic hash iteration to generate a hash summary and perform an XOR operation with the ciphertext, and then restore the ciphertext to plaintext; Also includes: SM1. Initialize the private key in the key pair of the RSA algorithm generated by the server; SM2, for S1, S2, S3, ..., S N Perform scalable precision double Logistic hash iterative operations in sequence to generate hash summaries; SM3, firstly, iterates S1 and converts S1 into initial parameters and control parameters of scalable precision dual logistic chaos iterative operation; SM4, perform scalable precision double logistic hash iteration operation; SM5. Set the number of bits of the hash summary to be obtained to b, and evenly group the Z sequences according to the set number of bits of the hash summary. The first group is Array_1, Array_2, ..., Array_b. If the number of bits cannot be evenly distributed, the number of bits in the group is padded with 0. SM6, set the seed, and start selecting the position for the grouping of the random sequence; SM7, according to the method of steps SM3 to SM6, S2, S3...S N Perform a hash summary operation and convert the hash summary of the requested private key into binary form; SM8. Use the binary form of the generated hash summary as a key to encrypt the sensitive data of the customer in the hotel database Mysql; The scalable precision double logistic hash encryption algorithm with SM9 and RSA private key as initial parameters ends.

2. The Mysql sensitive data protection system based on scalable precision dual chaotic hash and RSA according to claim 1 is characterized in that: Function_1: The process of using the RSA asymmetric encryption key generation algorithm when the user logs into the hotel database system; S1_1, the hotel MySQL database is divided into two categories of users for login: hotel customers and hotel staff; hotel users select their own identities and login with username and password when logging in; S1_2. In order to prevent the key from being intercepted during communication, the server uses the RSA asymmetric algorithm to generate a pair of public and private keys during a session and saves them in the session on the server. S1_3, pass the public key to the front end for the front end to encrypt the user's account password, encrypt the user's account password, so that the user's password remains encrypted during the transmission process; S1_4, the front end transmits the user's account and the ciphertext encrypted with the public key to the server. After obtaining the ciphertext encrypted with the public key, the server obtains the private key from the server session to decrypt the account password and saves the decrypted account password in the database; Function_2: The implementation process of the hotel's customer login system; S2_1. Choose to log in to the system as a customer. When you enter your username and password to log in to the system, the system will pass the public key to the front end to encrypt the account and password you entered. When the encrypted ciphertext is transmitted to the server, the server will call the private key to decrypt the encrypted data. S2_2, compare the decrypted user password with the user password stored in the database, and if the comparison is successful, the user logs into the system successfully; S2_3. After successfully logging into the system, the hotel customer can view his / her sensitive information: mobile phone number, ID number, and face recognition information, and non-sensitive information: name, room information, check-in time, check-out time, and bill; S2_4. When a hotel customer enters the system and needs to view his / her sensitive information, the server uses the private key as the initial parameter and control parameter of the scalable precision double chaotic hash algorithm, performs iterative calculation to generate a hash summary, and performs an XOR operation on the generated hash summary and the ciphertext of the sensitive information to decrypt and restore it to plain text; Function_3: The implementation process of the hotel staff logging into the system; S3_1, choose to log in to the system as a hotel staff member, when entering the user name and password to log in to the system, the user password is encrypted using the public key of RSA asymmetric encryption, and the user password is decrypted using the private key on the server side; S3_2, compare the decrypted user password with the user password stored in the database, if the comparison is successful, the user logs into the system successfully; S3_3. After successfully logging into the system, the hotel staff can view the non-sensitive information of the hotel user in the database: name, room information, check-in time, check-out time, and bill; S3_4. The hotel staff cannot obtain the private key of the RSA algorithm from the server, and cannot decrypt or view the sensitive information of the hotel customers.

3. The Mysql sensitive data protection system based on scalable precision dual chaotic hash and RSA according to claim 1 is characterized in that: SM1. Initialize the private key in the RSA algorithm key pair generated by the server, including: SM1_1. Divide all bytes of the hexadecimal private key into blocks L1, L2, L3, ..., L N , N is the number of blocks of bytes of the private key; SM1_2. Quantize the byte blocks of the private key. The quantization method is to use a character as a plaintext information block and convert it into the corresponding ASCII code value. The private key is represented by an array S. S1 in the array is the ASCII code value after L1 conversion, S2 is the ASCII code value corresponding to L2, ..., S N For L N Corresponding ASCII code value; SM3, firstly, iterate S1 and transform S1 into the initial parameters and control parameters of the scalable precision dual logistic chaos iterative operation, including: SM3_1. The first logistic equation is defined as: i+1 =μ1x i (1-x i ); Logistic x0=2S1 / (k-1), where k=256, x0∈(0,1), μ1=(S1-30) / 1000+3.9, where μ∈(3.9,4), x0 and μ are the initial parameter and control parameter of Logistic mapping respectively. When μ is in [3.5699456, 4], Logistic mapping is in a chaotic state, achieving the effect of surjection; SM3_2, the second logistic equation is defined as: i+1 =μ2y i (1-y i ), Logistic y0=(μ1-3.9)*100, where y0∈(0,1), μ2=x0 / 100+3.9, where μ∈(3.9,4); SM4, perform scalable precision double logistic hash iteration operations, including: SM4_1, calculate the first Logistic equation, x∈(0,1); SM4_2, set the number of iterations of the scalable precision dual chaotic hash function to n, and set the precision of the random sequence to m; SM4_3. The mathematical relationship between the number of iterations and the accuracy of the random sequence is: L n+1 =2*L n +L μ , where L n is the precision of parameter x, L μ is the accuracy of parameter μ; SM4_4, perform iterative calculation. If the current number of iterations is less than the set number of iterations; the precision of the current random sequence is less than the set precision m, then continue the iterative calculation; SM4_5, for random sequences x exceeding the set precision i Perform "truncation" and "rounding" operations. If the number of final iterations does not match the number of digits in the set random sequence, then the maximum number of iterations set by the system is selected to meet the accuracy requirements of the random sequence. SM4_6, iteratively obtained random sequence x k Save in a one-dimensional array, denoted as X; SM4_7, iteratively calculate the second Logistic chaotic equation, the calculation equation is, y∈(0,1), where y0=(μ1-3.9)*100, y0∈(0,1), μ2=x0 / 100+3.9, μ∈(3.9,4); SM4_8. Repeat steps SM4_2 to SM4_5 to iterate the obtained random sequence y k Save in a one-dimensional array, denoted as Y; SM4_9, let z = |x k -y k |, z∈(0,1), the obtained random sequence is stored in a one-dimensional array, denoted as Z; SM6: Set the seed and start selecting the position for the grouping of the random sequence, including: SM6_1, seed is the sum of the digits of x0; SM6_2, the specific steps of random position selection are: obtain the corresponding group according to the seed value, use the array value of the corresponding position on the group that matches the seed value as the position selection value of this group, and use the position selection value as the next seed to continue position selection until all groups are selected and the random position selection ends. If the seed value is greater than the length of the Array of the random sequence group, then perform a mod operation on the length value of the Array; SM6_3, save the value obtained by random position selection into an array, represented as the hash summary of S1; SM8. Use the binary form of the generated hash summary as a key to encrypt the sensitive data of the customer in the hotel database Mysql, including: SM8_1, sensitive data to be encrypted are: sensitive data 1, sensitive data 2, sensitive data 3, ...; SM8_2, convert the sensitive data 1 to be encrypted into binary form, perform XOR operation on the binary form of the hash summary generated in step SM7, and obtain the ciphertext 1 of the sensitive data 1, and store the ciphertext in the database; if the number of binary digits of the hash summary is greater than the number of binary digits of the sensitive data to be encrypted, then perform XOR operation starting from the first digit of the hash summary, and discard the excess digits; SM8_3, perform the k+1th scalable precision double logistic hash iteration operation to generate a hash summary and convert it into binary form, perform an XOR operation with the binary plaintext data of sensitive data 2 to generate ciphertext 2, and store the ciphertext in the database; SM8_4. And so on, perform the k+j-1th scalable precision double Logistic hash iteration operation to generate the hash summary and convert it into binary form, perform XOR operation with the binary plaintext data of sensitive data j to generate ciphertext j, and store the ciphertext in the database.

4. The Mysql sensitive data protection system based on scalable precision dual chaotic hashing and RSA according to claim 1 is characterized in that: SF1. Hotel staff cannot view customers' sensitive data. After logging into the system, the server will not grant them private keys, so they cannot generate hash summaries to decrypt customers' sensitive data. SF2. Hotel customers view their sensitive data stored in the database; SF2_1. After the hotel customer logs into the system, the server will grant the customer a private key and use the private key to perform scalable precision double Logistic hash iterative operation to generate a hash summary; SF2_2. Perform an XOR operation on the binary form of the generated hash summary and the binary form of the ciphertext of the customer's sensitive data stored in the database to decrypt and restore them to plain text.

Citation Information

Patent Citations

  • Hash Algorithm Based on Scalable Precision Chaos

    CN102289425A

  • Android file code box system based on double chaotic hash file control

    CN112380559A

Cited By

  • Database bank card number encryption storage method based on composite chaotic mapping

    CN122221286A