Access control data encryption method and system

By using the encryption method and MD5 algorithm of the interaction between two servers in the access control system, combined with the incremental sequence and salt processing, the security problem of the identity information database in the access control system is solved, and the encryption and decryption process is simple and highly secure. , avoiding the risk of data leakage.

CN118523903BActive Publication Date: 2024-10-15FUJIAN MAIWEI INFORMATION ENG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410988053.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-10-15
Estimated Expiration
2044-07-23

AI Technical Summary

Technical Problem

It is difficult to develop a method with simple encryption steps, simple usage, safe and reliable encryption in the access control system to protect the security of the identity information database.

Method used

Using a specific interaction method between two servers, using incremental sequences for data encryption and decryption, combined with the MD5 algorithm, and deploying a dedicated encryption and decryption server outside the application server, security is improved through the retention and salting of MD5 values.

Benefits of technology

It achieves simplicity and high security in the encryption and decryption process, and increases the difficulty of cracking. Even if developers know the encryption method, they cannot carry out matching attacks, ensuring that data will not be leaked when third-party servers and back-end databases are breached.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118523903B_ABST
    Figure CN118523903B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of access control data encryption, and in particular to an access control data encryption method and system. Two servers interact in a specific manner, and an increasing series is cleverly used as a means of data encryption. Since a preset threshold d can be modified and adjusted, and can be large or small, the difficulty of cracking is further increased, and the security is improved. In combination with the MD5 algorithm, the method has the advantages of simple encryption and decryption processes, strong security, and no matching attack can be carried out even if the developer knows the encryption and decryption methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of access control data encryption, and in particular to an access control data encryption method and system. Background Art

[0002] The access control system monitors the status of the door through specific sensors or devices. When the access control system detects that the door is opened or closed, it will immediately respond and record the status of the door.

[0003] The access control system is generally used in conjunction with an identity authentication device to verify the identity of people entering and leaving the door. When a person needs to enter the door, he or she needs to use his or her identity authentication card or provide correct identity authentication information so that the access control system can verify it. The access control system needs to be connected to an external database to store and compare the registered personnel information. When a person performs identity authentication, the access control system will send the identity information provided to the database or server for comparison. If the identity information matches, the access control system will unlock the door for the person who has passed the authentication.

[0004] When storing identity information data in an identity information database, it is usually necessary to encrypt the data stored in the database to ensure data security;

[0005] Therefore, how to develop a method with simple encryption steps, simple usage, safe and reliable encryption, which can be applied to the encryption of the identity information database of the access control system, has become a technical problem that needs to be solved urgently. Summary of the invention

[0006] The technical problem to be solved by the present invention is to develop a method with simple encryption steps, simple usage, safe and reliable encryption, which can be applied to the encryption of the identity information database of the access control system.

[0007] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0008] The access control data encryption method includes the following steps:

[0009] S1: Server A obtains the original identity information data to be encrypted sent by the front-end user, and then sends it to server B;

[0010] S2: Server B calculates the MD5 value of the original text and saves it;

[0011] S3: Server B obtains the ciphertext corresponding to the original text through the following data encryption method:

[0012] S31: Convert the original data to be encrypted into binary numbers;

[0013] S32: Convert the binary number to a decimal number a;

[0014] S33: Obtain the number b closest to the decimal number a in the increasing sequence, and obtain the increasing sequence item number i corresponding to the number b, wherein b is smaller than a;

[0015] S34: Calculate and obtain the difference between a and b;

[0016] S35: using the number c as a in S32, repeating steps S32 to S34 until the obtained difference number c is smaller than a preset threshold value d;

[0017] S36: Obtain ciphertext, which is a string formed by recording multiple increasing sequence item numbers i obtained by repeating steps S32 to S34, separating each item number i in turn by a separator, and adding the MD5 value corresponding to the original data to be encrypted at the beginning;

[0018] S4: Server B calculates the MD5 value of the ciphertext and saves it;

[0019] S5: Server B sends the ciphertext to the backend database for storage.

[0020] Furthermore, in the above-mentioned access control data encryption method, in S36, the separator symbol is “,”.

[0021] Furthermore, in the above-mentioned access control data encryption method, the increasing number series is selected from the Fibonacci series.

[0022] Furthermore, in the above-mentioned access control data encryption method, the MD5 value is a salted MD5 value.

[0023] Furthermore, the access control data encryption method further includes a decryption method, which includes the following steps:

[0024] S6: Server B obtains the ciphertext sent by the backend database;

[0025] S7: Server B calculates the ciphertext to obtain the MD5 value of the ciphertext;

[0026] S8: Server B searches for the MD5 of the corresponding original text based on the MD5 value;

[0027] S9: Server B obtains the ciphertext corresponding to the original text through the following data encryption method;

[0028] S91: intercept the first 16 bits of the ciphertext string, that is, obtain the decimal MD5 value of the original text after adding salt;

[0029] S92: Split the remaining ciphertext string according to the separator symbol to obtain item numbers i of all increasing series obtained during the encryption process;

[0030] S93: Obtain a corresponding number in the increasing sequence according to each item number i, and add up the numbers in the increasing sequence corresponding to all the item numbers i to obtain a decimal number e;

[0031] S94: Calculate the MD5 value of the decimal number e after adding the salt, and compare it with the MD5 value of the decimal number of the original text after adding the salt. If the MD5 values ​​are different, obtain the MD5 value of e plus 1, and compare it with the MD5 value of the decimal number of the original text;

[0032] If the MD5 values ​​are different, repeat this step n times until the MD5 value of e plus n plus the salt is the same as the MD5 value of the original decimal number plus the salt, then convert the e plus n number into a binary number;

[0033] S95: Restore the original data according to the binary digits.

[0034] The present invention also protects a door access data encryption system, comprising:

[0035] Server A, which is used to obtain the original data to be encrypted sent by the front-end user, and then send it to server B; display the original text to the front-end user;

[0036] Server B, the server B is used to calculate the MD5 value of the original text and retain it; obtain the ciphertext corresponding to the original text through a data encryption method; calculate the MD5 value of the ciphertext and retain it; send the ciphertext to the background database for storage; obtain the ciphertext sent by the background database; calculate the ciphertext to obtain the MD5 value of the ciphertext; find the corresponding MD5 of the original text according to the MD5 value; restore the ciphertext to the original text through a decryption method; and send the original text to server A.

[0037] The above-mentioned access control data encryption system also includes:

[0038] The backend database is used to store the ciphertext sent by server B.

[0039] The beneficial effects of the present invention are as follows: through the interaction of two servers in a specific manner, an increasing series is cleverly used as a means of data encryption. Since the preset threshold d can be modified and adjusted, and can be large or small, the difficulty of cracking is further increased, and the security is improved. In combination with the MD5 algorithm, it has the advantages of simple encryption and decryption processes, strong security, and even if the developer knows the encryption and decryption methods, it cannot carry out matching attacks.

[0040] Data security is achieved by deploying an additional encryption and decryption server in addition to the application server. Since the third-party server is only used for data encryption and decryption calculations, and the retention of MD5 values, and does not store ciphertext, even if the third-party server is hacked, there will be no leakage, further ensuring the security of data encryption; on the other hand, although the background database contains ciphertext, no MD5 value is retained and cannot be verified, so even if the background database is hacked, there will be no leakage, further ensuring the security of data encryption. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 A flowchart of a method for encrypting access control data according to a specific embodiment of the present invention;

[0042] Figure 2 A schematic diagram of the structure of a door access data encryption system according to a specific embodiment of the present invention; DETAILED DESCRIPTION

[0043] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.

[0044] Please refer to Figure 1 as well as Figure 2 The specific implementation of the present invention relates to a method for encrypting access control data, comprising the following steps:

[0045] S1: Server A obtains the original identity information data to be encrypted sent by the front-end user, and then sends it to server B;

[0046] S2: Server B calculates the MD5 value of the original text and saves it;

[0047] S3: Server B obtains the ciphertext corresponding to the original text through the following data encryption method:

[0048] S31: Convert the original data to be encrypted into binary numbers;

[0049] S32: Convert the binary number to a decimal number a;

[0050] S33: Obtain the number b closest to the decimal number a in the increasing sequence, and obtain the increasing sequence item number i corresponding to the number b, wherein b is smaller than a;

[0051] S34: Calculate and obtain the difference between a and b;

[0052] S35: using the number c as a in S32, repeating steps S32 to S34 until the obtained difference number c is smaller than a preset threshold value d;

[0053] S36: Obtain ciphertext, which is a string formed by recording multiple increasing sequence item numbers i obtained by repeating steps S32 to S34, separating each item number i in turn by a separator, and adding the MD5 value corresponding to the original data to be encrypted at the beginning;

[0054] S4: Server B calculates the MD5 value of the ciphertext and saves it;

[0055] S5: Server B sends the ciphertext to the backend database for storage.

[0056] Among the existing encryption algorithms, such as the MD5 encryption algorithm (information digest algorithm), MD5 encryption has several characteristics. No matter how long the original text is, the length of the result after the MD5 operation is the same; MD5 is irreversible; even if one character of the original text is changed, the MD5 value will be completely different. Therefore, MD5 is often used to verify the integrity and consistency of data. In order to prevent attackers from matching the results of the MD5 operation with the results of exhaustive enumeration of massive data and reverse checking the original text, it is necessary to add other information to the original text. The MD5 value calculated by the original text + other information is called MD5 salting. Since MD5 is irreversible, the result after the MD5 operation cannot be reversed to the original text, so it is safe and reliable to use MD5 for data tampering prevention. In general, the result of MD5 salting will be stored in the database, and the software developers or operation and maintenance personnel or other personnel with database access rights can obtain the salt and ciphertext, which poses a potential information security risk.

[0057] A person who knows how to perform an MD5 operation on the original text, with database access rights and salt, can use brute force to continuously match the ciphertext in order to find the original text.

[0058] In the above implementation mode, two servers interact in a specific manner and cleverly use an increasing series as a means of data encryption. Since the preset threshold d can be modified and adjusted, it can be large or small, which further increases the difficulty of cracking and improves security. In combination with the MD5 algorithm, it has the advantages of simple encryption and decryption process, strong security, and even if the developer knows the encryption and decryption methods, it cannot carry out matching attacks.

[0059] Data security is achieved by deploying an additional encryption and decryption server in addition to the application server. Since the third-party server is only used for data encryption and decryption calculations, and the retention of MD5 values, and does not store ciphertext, even if the third-party server is hacked, there will be no leakage, further ensuring the security of data encryption; on the other hand, although the background database contains ciphertext, no MD5 value is retained and cannot be verified, so even if the background database is hacked, there will be no leakage, further ensuring the security of data encryption.

[0060] As a preferred implementation, in S36, the separator is “,”.

[0061] As a preferred implementation, the increasing number sequence is selected from the Fibonacci sequence.

[0062] As a preferred implementation, the MD5 value is a salted MD5 value.

[0063] As a preferred embodiment, a decryption method is also included, comprising the following steps:

[0064] S6: Server B obtains the ciphertext sent by the backend database;

[0065] S7: Server B calculates the ciphertext to obtain the MD5 value of the ciphertext;

[0066] S8: Server B searches for the MD5 of the corresponding original text based on the MD5 value;

[0067] S9: Server B obtains the ciphertext corresponding to the original text through the following data encryption method;

[0068] S91: intercept the first 16 bits of the ciphertext string, that is, obtain the decimal MD5 value of the original text after adding salt;

[0069] S92: Split the remaining ciphertext string according to the separator symbol to obtain item numbers i of all increasing series obtained during the encryption process;

[0070] S93: Obtain a corresponding number in the increasing sequence according to each item number i, and add up the numbers in the increasing sequence corresponding to all the item numbers i to obtain a decimal number e;

[0071] S94: Calculate the MD5 value of the decimal number e after adding the salt, and compare it with the MD5 value of the decimal number of the original text after adding the salt. If the MD5 values ​​are different, obtain the MD5 value of e plus 1, and compare it with the MD5 value of the decimal number of the original text;

[0072] If the MD5 values ​​are different, repeat this step n times until the MD5 value of e plus n plus the salt is the same as the MD5 value of the original decimal number plus the salt, then convert the e plus n number into a binary number;

[0073] S95: Restore the original data according to the binary digits.

[0074] The present invention also protects a door access data encryption system, comprising:

[0075] Server A, which is used to obtain the original data to be encrypted sent by the front-end user, and then send it to server B; display the original text to the front-end user;

[0076] Server B, the server B is used to calculate the MD5 value of the original text and retain it; obtain the ciphertext corresponding to the original text through a data encryption method; calculate the MD5 value of the ciphertext and retain it; send the ciphertext to the background database for storage; obtain the ciphertext sent by the background database; calculate the ciphertext to obtain the MD5 value of the ciphertext; find the corresponding MD5 of the original text according to the MD5 value; restore the ciphertext to the original text through a decryption method; and send the original text to server A.

[0077] The above-mentioned access control data encryption system also includes:

[0078] The backend database is used to store the ciphertext sent by server B.

[0079] Take the decimal number a of the original data to be encrypted as "123456" as an example, and select the Fibonacci sequence as an increasing sequence. The Fibonacci sequence starts from the third term, and each term is equal to the sum of the previous two terms. For example: 1, 1, 2, 3, 5, 8, 13, 21, 34... Therefore, the corresponding value can be found through the "item number", for example, the 3rd item is 2, the 5th item is 5, the 9th item is 34...; Take the preset threshold d as 20 as an example; get the decimal number a "123456" in the Fibonacci sequence. The closest number b is "121393", and the item number i of this number b is "27". The difference between a and b is calculated as c, which is "2063". Then, using c as a, continue to find the closest number b in the Fibonacci sequence is "1597", and the item number i of this number b is "18". The difference between a and b is calculated as c, which is "466". Then, using c as a, continue to find the closest number b in the Fibonacci sequence is "337", and the item number i of this number b is "15". The difference between a and b is calculated as "129", then take c as a, continue to find the closest number b in the Bonacci number sequence is "89", the item number i of this number b is "12", and the difference c between a and b is calculated to be "40", then take c as a, continue to find the closest number b in the Bonacci number sequence is "34", the item number i of this number b is "10", and the difference c between a and b is calculated to be "6", at this time, c is less than the threshold d "20"; here, let the salt be: "awoe3r4f46hg7a9r879hg687f6l0a69hr23gouh", the result of concatenating 123456 and the salt is: "123456awoe3r4f46hg7a9r879hg687f6l0a69hr23gouh", and its MD5 value is: "a1c264b3799b457d". Therefore, the final ciphertext is: “a1c264b3799b457d#27,18,15,12,10”.

[0080] When decrypting, the MD5 value of the original text after adding salt is "a1c264b3799b457d", and then the Fibonacci numbers corresponding to each item number i are accumulated to get 123450. The corresponding MD5 value after adding salt is "b39fc28e7003051b", which is different from the MD5 value of the original text after adding salt "a1c264b3799b457d". At this time, add 1 to 123450, which is 123451. The corresponding MD5 value after adding salt is "b39fc28e7003051b". 39fc28e7003051b" is still different from the MD5 value "a1c264b3799b457d" of the original text after adding salt. Continue to add 1 to 123451 to get 123452, and continue to compare the corresponding MD5 value after adding salt. After exhaustive several times (less than the threshold d), until the MD5 value matches the original MD5 value, the original decimal number is obtained. The decimal number is converted to a binary number, and then the original data is restored according to the binary number. The salt used in the above content is the same salt, which can be implemented in the "one text, one salt" manner in actual work.

[0081] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. The access control data encryption method is characterized by: The following steps are involved: S1: Server A obtains the original identity information data to be encrypted sent by the front-end user, and then sends it to server B; S2: Server B calculates the MD5 value of the original text and saves it; S3: Server B obtains the ciphertext corresponding to the original text through the following data encryption method: S31: Convert the original identity information data to be encrypted into binary numbers; S32: Convert the binary number to a decimal number a; S33: Obtain the number b closest to the decimal number a in the increasing sequence, and obtain the increasing sequence item number i corresponding to the number b, wherein b is smaller than a; S34: Calculate and obtain the difference between a and b; S35: using the difference number c as a in step S32, repeating steps S32 to S34 until the obtained difference number c is less than a preset threshold value d; S36: Obtain ciphertext, which is a string formed by recording multiple increasing sequence item numbers i obtained by repeating steps S32 to S34, separating each item number i by a separator symbol, and adding the MD5 value corresponding to the original text of the identity information data to be encrypted at the beginning; S4: Server B calculates the MD5 value of the ciphertext and saves it; S5: Server B sends the ciphertext to the backend database for storage.

2. The access control data encryption method according to claim 1, characterized in that: In S36, the separator symbol is "," 3. The access control data encryption method according to claim 1, characterized in that: The increasing number sequence is selected from the Fibonacci sequence.

4. The access control data encryption method according to claim 1, characterized in that: The MD5 value is the MD5 value after adding salt.

5. The access control data encryption method according to any one of claims 1 to 4, characterized in that: Also included is a decryption method comprising the following steps: S6: Server B obtains the ciphertext sent by the backend database; S7: Server B calculates the ciphertext to obtain the MD5 value of the ciphertext; S8: Server B searches for the corresponding MD5 of the original text based on the MD5 value; S9: Server B obtains the ciphertext corresponding to the original text through the following data encryption method; S91: intercept the first 16 bits of the ciphertext string, that is, obtain the decimal MD5 value of the original text after adding salt; S92: Split the remaining ciphertext string according to the separator symbol to obtain the item number i of all increasing series obtained during the encryption process; S93: Obtain a corresponding number in the increasing sequence according to each item number i, and add up the numbers in the increasing sequence corresponding to all the acquired item numbers i to obtain a decimal number e; S94: Calculate the MD5 value of the decimal number e after adding the salt, and compare it with the MD5 value of the decimal number of the original text after adding the salt. If the MD5 values ​​are different, obtain the MD5 value of e plus 1, and compare it with the MD5 value of the decimal number of the original text; If the MD5 values ​​are different, repeat this step n times until the MD5 value of e plus n plus the salt is the same as the MD5 value of the original decimal number plus the salt, then convert the e plus n number into a binary number; S95: Restore the original data according to the binary digits.