File encryption and decryption method, system and storage medium based on multi-factor authentication
By segmenting files and inserting obfuscated gaps to generate decryption clues and clue encryption and decryption functions, the file encryption and decryption method based on multi-factor authentication solves the problem of insufficient decryption security in two-factor authentication and achieves efficient and high security. File encryption and decryption process.
Patent Information
- Application Number
- CN202410471853.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-19
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-04-19
AI Technical Summary
The existing two-factor authentication technology has insufficient security during the decryption process and cannot effectively improve the security of file encryption and decryption. The decryption algorithm is the same as under normal circumstances, so there is room for improvement.
Using a file encryption and decryption method based on multi-factor authentication, by segmenting the file to be encrypted and inserting obfuscation gaps, it generates decryption clues and clue encryption and decryption functions, ensuring that multiple factors are required to correctly match the file during the decryption process to restore the original text, improving security. sex.
It improves the security of file encryption and decryption, ensuring that files cannot be decrypted correctly when any factor goes wrong, enhancing security while maintaining an efficient encryption and decryption process.
Smart Images

Figure CN118070317B
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to encryption and decryption algorithms, and specifically to a file encryption and decryption method, system, and storage medium based on multi-factor authentication. Background Art
[0002] Two-factor authentication (2FA) is an authentication mechanism that uses two different factors to verify the identity of a user. Usually, the two factors include a "known" factor (such as a password) and a "possession" factor (such as a mobile phone or hardware security token). Two-factor authentication can improve the security of an account and prevent unauthorized access. However, two-factor authentication itself does not involve a decryption algorithm. It is only used to verify the identity of the user and provide access rights after verification. When using two-factor authentication, the decryption algorithm works in the same way as in normal situations, so there is still room for improvement in security. For this reason, it is necessary to further study multi-factor authentication file encryption and decryption technology in which multiple factors are interrelated. Summary of the invention
[0003] One or more embodiments of this specification describe a file encryption and decryption method, system, and storage medium based on multi-factor authentication, which improves the security of file encryption while taking into account the efficiency of encryption and decryption.
[0004] In a first aspect, an embodiment of the present specification provides a file encryption and decryption method based on multi-factor authentication, including:
[0005] Encryption steps:
[0006] Divide the file to be encrypted into segments and record the sequence numbers of the segments;
[0007] generating a position record of obfuscated spaces for each segment, and inserting spaces in each segment based on the position record;
[0008] Disrupting the order of the segments and then storing them, recording the relative storage address of each segment, and generating a decryption clue for each segment, wherein the decryption clue indicates the relative storage address of the corresponding segment;
[0009] Generate a clue encryption and decryption function, encrypt the decryption clue of each segment based on the clue encryption and decryption function, and fill the position record and the encrypted decryption clue into the obfuscated space of the previous segment;
[0010] Decryption steps:
[0011] Obtaining the location record of the first segment, the decryption clue of the first segment and the clue encryption and decryption function;
[0012] Substituting the decryption clue of the first segment into the clue encryption and decryption function, obtaining the relative storage address of the first segment, and reading the content of the first segment;
[0013] Based on the position record, obtain the position record and decryption clue of the next segment, obtain the relative storage address of the next segment based on the decryption clue, and read the content of the segment;
[0014] Repeat the previous step until all segments are read, and then concatenate all segments in the order in which they were read to obtain the decrypted file.
[0015] In a second aspect, the embodiments of this specification provide a file encryption and decryption system based on multi-factor authentication, including:
[0016] The encryption component is used to receive the file to be encrypted and perform the encryption steps;
[0017] The decryption component is used to receive the file to be decrypted, the location record of the first segment, the decryption clue of the first segment and the clue encryption and decryption function, and execute the decryption steps.
[0018] In a third aspect, an embodiment of the present specification provides a computer system, the computer system comprising a processor and a memory, the processor being connected to the memory, the memory being used to store executable program code, the processor running a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the file encryption and decryption method based on multi-factor authentication as described above.
[0019] In a fourth aspect, an embodiment of the present specification provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the file encryption and decryption method based on multi-factor authentication as described above.
[0020] The beneficial technical effects of one or more embodiments of the present specification include: during the encryption process, obfuscated content is added to the file in binary form. When the file cannot be correctly decrypted, the file cannot be restored to any fragment, thereby improving the security of file encryption. After encryption, multiple factors for decryption are formed. If any factor is wrong, the file cannot be correctly decrypted, thereby improving the security of file encryption and decryption. The encryption and decryption process does not require a large amount of numerical calculations, and has a high encryption and decryption efficiency.
[0021] Other features and advantages of one or more embodiments of the present specification will be disclosed in detail in the following specific implementations and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The following is a further description of this specification in conjunction with the accompanying drawings:
[0023] Figure 1 This is a panoramic diagram of the application scenario of the embodiments of this specification.
[0024] Figure 2 This is a panoramic diagram of another application scenario of the embodiment of this specification.
[0025] Figure 3 This is a flowchart of the file encryption method according to the embodiment of this specification.
[0026] Figure 4 This is a schematic diagram of the file encryption process of the embodiment of this specification.
[0027] Figure 5 This is a flowchart of the file decryption method according to the embodiment of this specification.
[0028] Figure 6 This is a schematic diagram of the encryption component structure of the embodiment of this specification.
[0029] Figure 7 This is a schematic diagram of the decryption component structure of the embodiment of this specification.
[0030] Figure 8 This is a schematic diagram of the computer system structure of the embodiment of this specification.
[0031] Among them: 11. encryption party, 12. ciphertext, 21. decryption party, 22. plaintext, 31. identity binding server, 1101. location record, 1102. decryption clue, 1103. clue encryption and decryption function, 2101. starting storage address, 2102. indication sequence, 31. encryption component, 3101. segmented storage subcomponent, 3102. obfuscated empty position subcomponent, 3103. clue subcomponent, 41. decryption component, 4101. clue decryption subcomponent, 4102. splicing subcomponent, 51. electronic device, 5101. processor, 5102. communication bus, 5103. user interface, 5104. network interface, 5105. memory. DETAILED DESCRIPTION
[0032] The following is an explanation and description of the technical solutions of the embodiments of this specification in conjunction with the drawings of the embodiments of this specification, but the following embodiments are only preferred embodiments of this specification, not all. Based on the embodiments in the implementation mode, other embodiments obtained by those skilled in the art without creative work are all within the scope of protection of this specification.
[0033] In the following description, terms such as "inside", "outside", "up", "down", "left", "right", etc. that indicate directions or positional relationships are only used to facilitate the description of the embodiments and simplify the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as a limitation of this specification.
[0034] Before introducing the embodiments of this specification, the application scenarios of the embodiments of this specification are introduced.
[0035] One or more embodiments of the present specification disclose a multi-factor authentication file encryption and decryption technology, and disclose a corresponding encryption and decryption system. Multi-factor authentication (MFA) is an identity authentication method that uses two or more different factors to verify the identity of the user, so as to determine whether the user has the decryption permission. These factors include the following types: Knowledge factor (Something you know): This is the most common factor, such as a password, PIN code, answer, etc. The user must provide the correct secret information to verify the identity. Possession factor (Something you have): This factor requires the user to have a physical device or object, such as a mobile phone, hardware token, smart card, etc. The user needs to use these devices to complete the identity authentication. Biometric factor (Something you are): This factor is based on the user's biometrics, such as fingerprints, irises, voice, etc. The user's identity is verified through biometric recognition technology. Geographical location factor (Somewhere you are): This factor is based on the user's geographical location information, such as IP address, GPS location, etc. The identity is authenticated by verifying the legitimacy of the user's location. Multi-factor authentication provides higher security than single-factor authentication because the attacker needs to obtain multiple factors at the same time to pass the authentication. Even if one of the factors is leaked or attacked, the other factors can still provide sufficient protection. However, multi-factor authentication itself does not involve the decryption algorithm. It is only used to verify the user's identity and provide access rights after verification. When using multi-factor authentication, the decryption algorithm works in the same way as in normal situations, so there is still room for improvement in security.
[0036] One or more embodiments of this specification provide a decryption technology involving a decryption algorithm itself and multi-factor authentication. The multi-factor authentication decryption technology disclosed in this specification can be applied to online services or applications. For example, in scenarios such as online banking, email services, social media platforms, and tender document delivery.
[0037] Please see attached Figure 1, which is a panoramic view of the application scenarios of the technical solution disclosed in this specification. After the encryption party 11 encrypts the file, it passes the ciphertext 12 to the decryption party 21, and the decryption party 21 obtains the ciphertext 12. After encryption, the encryption party 11 generates three decryption factors directly related to the decryption algorithm. The encryption party 11 passes the three decryption factors to the decryption party 21 through different channels. For example, the first decryption factor is sent to the decryption party 21 by online transmission, the second decryption factor is provided to the decryption party 21 according to the agreed change rule, and the third decryption factor is agreed in person to use a fixed value. In this way, the decryption party 21 can obtain the three decryption factors from different channels. The first decryption factor belongs to the knowledge factor, the second decryption factor belongs to the possession factor, and the third decryption factor belongs to the identity factor. Decryption based on these three factors can obtain the original text.
[0038] Exemplarily, when used for online banking, the bank and the user agree that the second decryption factor is calculated according to a predetermined function based on the current time. Exemplarily, the time granularity is 5 minutes, that is, when the time difference between the user and the bank does not exceed 5 minutes, the calculated result is the same, thereby completing the transmission of the second decryption factor. In other embodiments, the time may have other values, such as 5 seconds, 2 minutes, 10 minutes, etc. The first decryption factor is transmitted using encrypted online transmission. The third decryption factor is handled by the user at the bank counter and a fixed value is set. The user uses the APP provided by the bank for encryption and decryption. When the user encrypts and transmits the information to the bank, the APP generates the first decryption factor, obtains the second decryption factor by calculation, directly uses the stored third decryption factor, and runs the encryption algorithm to achieve the clear encryption to obtain the ciphertext 12. The ciphertext 12 and the first decryption factor are sent to the bank through online encrypted communication. After the bank receives the ciphertext 12 and the first decryption factor, it calculates the second decryption factor within the time granularity through the timestamp, and uses the stored third decryption factor to achieve the decryption of the ciphertext 12 to obtain the original text. The bank sends the encrypted information to the user's APP, and the user's APP uses a similar method to complete the decryption, which will not be repeated here.
[0039] Please see attached Figure 2, which is a panoramic view of another application scenario of the technical solution disclosed in this specification. In this scenario, an identity binding server 23 is used. The decryption party 21 first needs to register on the identity binding server 23. The identity binding server 23 will generate a third decryption factor and bind the third decryption factor to the decryption party 21. When the encryption party 11 encrypts, it first accesses the identity binding server 23 to obtain the third decryption factor bound to the decryption party 21. The third decryption factor bound by the identity binding server 23 to the decryption party 21 can be fixed or periodically changed. When the third decryption factor changes, the changed third decryption factor needs to be sent to the decryption party 21. The encryption party 11 sends the first decryption factor to the decryption party 21 by online transmission. The encryption party 11 synchronizes the second decryption factor with the decryption party 21 according to the agreed change rule. When the encryption party 11 encrypts, it requests the third decryption factor bound to the target decryption party 21 from the identity binding server 23. The encryption party 11 calculates the second decryption factor according to the agreed change rule, and the encryption party 11 generates the first decryption factor. The encrypting party 11 uses the three decryption factors to implement the encryption process of encrypting the plaintext 22 into the ciphertext 12, and sends the ciphertext 12 and the first decryption factor to the decrypting party 21 through online encrypted transmission. The decrypting party 21 obtains the ciphertext 12 and the first decryption factor, and obtains the second decryption factor by calculating the agreed change rule. The third decryption factor is obtained in advance from the identity binding server 23 or pulled by instant communication. The decrypting party 21 uses the three decryption factors to decrypt the ciphertext 12 to obtain the plaintext 22.
[0040] Exemplarily, when used for bidding document transmission in bidding activities. When the bidder understands the bidding matters and decides to participate in the insurance, the bidder agrees with the bidder on the change rule of the second decryption factor. Exemplarily, the initial value, change function and change cycle of the second decryption factor are agreed upon. At the end of each change cycle, the current value of the second decryption factor is substituted into the change function to obtain the value of the next change cycle, and so on. Thus, the bidder and the bidder are synchronized with respect to the second decryption factor. The bidder registers on the identity binding server 23 and obtains the bound third decryption factor. The third decryption factor can be fixed or periodically changed. The identity binding server 23 will send the new third decryption factor and timestamp to the bidder when the third decryption factor changes. After the bidder prepares the bidding materials, it is ready to perform the encryption process. The bidder generates the first decryption factor, obtains the second decryption factor by calculation, and accesses the identity binding server 23 to obtain the third decryption factor of the bidder. The bidder uses the three decryption factors to encrypt the bidding document and obtain the ciphertext 12. The ciphertext 12 and the first decryption factor are sent to the bidder through an encrypted communication channel. The tenderer obtains the ciphertext 12 and the first decryption factor, and obtains the second decryption factor through calculation. When the third decryption factor is a fixed value, the tenderer directly obtains the third decryption factor. When the third decryption factor changes periodically, the tenderer obtains the corresponding third decryption factor according to the encrypted timestamp of the bidding document. The tenderer uses the three decryption factors obtained to decrypt and obtain the original text of the bidding document.
[0041] Specifically, first, this specification provides a file encryption and decryption method based on multi-factor authentication. Figure 3 ,include:
[0042] Encryption steps:
[0043] Step A02) Divide the file to be encrypted into segments and record the sequence numbers of the segments;
[0044] Step A04) generating a position record 1101 of the obfuscated space of each segment, and inserting a space into each segment based on the position record 1101;
[0045] Step A06) shuffling the order of the segments and storing them, recording the relative storage address 2101 of each segment, generating a decryption clue 1102 for each segment, the decryption clue 1102 indicating the relative storage address 2101 of the corresponding segment;
[0046] Step A08) Generate a clue encryption and decryption function 1103, encrypt the decryption clue 1102 of each segment based on the clue encryption and decryption function 1103, and fill the position record 1101 and the encrypted decryption clue 1102 into the obfuscated space of the previous segment.
[0047] In the encryption step, the file to be encrypted is first segmented. The length of each segment is not fixed. The length of each segment is obtained by the indicator sequence 2102 obtained based on the position record 1101. The position record 1101 is stored in the empty space of the previous segment. The segment after the empty space is inserted has data mixed at the binary level. If the correct indicator sequence 2102 is not obtained, the file will be in a garbled state. Please refer to the attached Figure 4 Since the data is mixed at the binary level, it is almost impossible to accurately exclude the inserted vacancies in the absence of a correct indication sequence 2102. The encryption and decryption scheme 21 provided in this embodiment has relatively high security. The binary bits occupied by the inserted vacancies are used to store the position record 1101 and decryption clue 1102 of the next segment. The position record 1101 is used to extract the position record 1101 and decryption clue 1102 of the next segment from the next segment. The decryption clue 1102 can obtain the relative storage address 2101 of the next segment through the clue encryption and decryption function 1103, so as to locate and read the content of the next segment.
[0048] The process of reading the content of the next segment involves: obtaining the indication sequence 2102 of the next segment according to the position record 1101, and the binary length of the indication sequence 2102 is exactly equal to the length of the next segment after the insertion of the vacant position. Reading starts from the relative storage address 2101, and reading the corresponding length, that is, obtaining the content of the next segment after the complete insertion of the vacant position. If there is a lack of position record 1101, even if the relative storage address 2101 of the next segment is known, the end position of the segment cannot be determined, and the content of the segment cannot be correctly obtained. The relevant information of the next segment cannot be obtained, thereby ensuring the security of the segment. The indication sequence 2102 bit value is 1, indicating that the binary bits of the corresponding order of the segment are vacant positions, and vice versa, the indication sequence 2102 bit value is 0, indicating that the binary bits of the corresponding order of the segment are not vacant positions. The meaning of the indication sequence 2102 bit value can be reversed, that is, the indication sequence 2102 bit value is 0, indicating that the binary bits of the corresponding order of the segment are vacant positions, and the indication sequence 2102 bit value is 1, indicating that the binary bits of the corresponding order of the segment are not vacant positions.
[0049] In this implementation, the relative storage address 2101 adopts: the relative storage address 2101 referring to the start address of the previous segment, or the relative storage address 2101 referring to the end address of the previous segment, or the relative storage address 2101 referring to the set reference address. The reference address is recommended to adopt the start address of the whole ciphertext 12, that is, all segments are stored in the address after the start address of the whole ciphertext 12.
[0050] Please see attached Figure 5 , the corresponding decryption steps include:
[0051] Step B02) obtaining the location record 1101 of the first segment, the decryption clue 1102 of the first segment and the clue encryption and decryption function 1103;
[0052] Step B04) Substitute the decryption clue 1102 of the first segment into the clue encryption and decryption function 1103, obtain the relative storage address 2101 of the first segment, and read the content of the first segment;
[0053] Step B06) Based on the location record 1101, obtain the location record 1101 and the decryption clue 1102 of the next segment, obtain the relative storage address 2101 of the next segment based on the decryption clue 1102, and read the content of the segment;
[0054] Step B08) Repeat the previous step until all segments are read, and then splice all segments in the reading order to obtain the decrypted file.
[0055] After the decryption party 21 obtains the ciphertext 12, the position record 1101 of the first segment, the decryption clue 1102 of the first segment and the clue encryption and decryption function 1103, it can perform the decryption steps. Substitute the decryption clue 1102 of the first segment into the clue encryption and decryption function 1103 to obtain the relative storage address 2101 of the first segment. Through the position record 1101 of the first segment, the position of the inserted empty space in the first segment is obtained, and the binary length of the first segment after the inserted empty space can also be obtained. According to the relative storage address 2101 and the binary length of the first segment, the content of the first segment after the inserted empty space is read. According to the position record 1101, the data stored in the empty space can be extracted. After the empty space is extracted, the remaining part constitutes the original content of the first segment. The content extracted from the empty space of the first segment includes the position record 1101 and the decryption clue 1102 of the next segment. The relative storage position of the next segment is obtained based on the decryption clue 1102 and the clue encryption and decryption function 1103. Combined with the position record 1101 of the next segment, the binary length of the next segment is obtained, so that the content of the next segment after the insertion of the empty space can be read. Repeat this until the last segment is read. The content stored in the empty space inserted in the last segment does not contain a valid decryption clue 1102, and a meaningless result similar to garbled code will be obtained by substituting it into the clue encryption and decryption function 1103. That is, when the result obtained by substituting the decryption clue 1102 into the clue encryption and decryption function 1103 is not the relative storage address 2101, it means that the segment is the last segment. The segments after deleting the empty space are spliced in the order in which they are read to obtain the complete plaintext 22. In this embodiment, most of the plaintext 22 does not need to be encrypted, and only involves the change of the storage position. In binary form, adding spaces can achieve sufficient obfuscation effect, so that the illegal decryption party 21 cannot obtain any valid plaintext 22 fragments, which has high security. At the same time, since most of the plaintext 22 does not need to be operated, it has high execution efficiency.
[0056] On the other hand, the embodiment of this specification provides an implementation of the position record 1101. In this implementation, the position record 1101 includes a length indication value and an interval number, the length indication value is used to indicate the length of the segment after the empty position is inserted, and the indication sequence 2102 for determining whether the binary bit of the segment belongs to the empty position is obtained based on the interval number. Exemplarily, the length indication value is 1024, and the interval number is 16, which means that the length of the segment after the empty position is inserted is 1024 binary bits, and one empty position is generated for every 16 bits in the binary bit. In the first 16 bits, the serial numbers are represented as 0 to 15, and the bit with serial number 15 is an empty position. In the bits with serial numbers 16 to 31, the bit with serial number 31 is also an empty position, and so on. A complete indication sequence 2102 for determining whether the binary bit of the segment belongs to an empty position can be generated.
[0057] The position record 1101 includes a cycle number and a screening number. Based on the cycle number and the screening number, an indication sequence 2102 is obtained, the length of which matches the segment after the insertion of the vacancy, and is used to determine whether the binary bit of the segment belongs to the vacancy. The cycle number indicates the number of cycles of the screening number, and the screening number is a binary sequence containing 0 and 1. For example, if the cycle number is 64, the screening number is 0100 00100010 0100, the length of the screening number is 16 bits, and the cycle number is 64, then the obtained indication sequence 2102 has a length of 1024 bits, that is, the length of the segment after the insertion of the vacancy is 1024 bits. There are 4 1s representing the vacancy contained in each screening number, so the total number of vacancy is 256 bits, and 256 bits of information can be recorded.
[0058] In another embodiment, the position record 1101 includes a length indication value and a screening number, and the quotient of the length indication value and the screening number is the cycle number. Referring to the aforementioned position record 1101 including the cycle number and the screening number, a complete indication sequence 2102 for determining whether the binary bit of the segment belongs to an empty position can be obtained.
[0059] On the other hand, the embodiments of the present specification provide implementation methods of the decryption clue 1102 and the clue encryption and decryption function 1103. In this implementation method, when the decryption clue 1102 is generated for each segment, the decryption clue 1102 includes the relative storage address 2101 of the segment, and when the clue encryption and decryption function 1103 is generated, the clue encryption and decryption function 1103 is a one-dimensional linear function. The method for obtaining the decryption clue 1102 includes: obtaining the decryption clue 1102 based on the relative storage address 2101 of the segment and the one-dimensional linear function. Performing a linear operation on the relative storage address 2101, such as multiplying it by a coefficient and then adding it to a constant, the result is used as the decryption clue 1102. During the decryption process, the decryption clue 1102 can be decrypted by performing an inverse operation of the one-dimensional linear function to obtain the relative storage address 2101.
[0060] On the other hand, the embodiment of this specification provides another implementation of the decryption clue 1102 and the clue encryption and decryption function 1103.
[0061] When generating a decryption clue 1102 for each segment, the decryption clue 1102 includes at least two integer variables, and when generating a clue encryption and decryption function 1103, the clue encryption and decryption function 1103 is a multivariate polynomial function.
[0062] The method for obtaining the decryption clue 1102 includes: solving the values of all the integer variables, substituting the values of the integer variables into the clue encryption and decryption function 1103, and the obtained function value corresponds to the relative storage address 2101; the values of all the integer variables are used as the decryption clue 1102.
[0063] Exemplarily, the equation is constructed: relative storage address 2101 = first coefficient * first integer^2 + second coefficient * second integer. According to the equation, multiple value combinations of the first integer and the second integer can be obtained, and any value combination can be used as the decryption clue 1102. During decryption, the first integer and the second integer are substituted into the right side of the equation to calculate the relative storage address 2101. In other embodiments, more integers can be used, and the right side of the equation has a higher degree.
[0064] On the other hand, the embodiment of this specification provides another implementation of the decryption clue 1102 and the clue encryption and decryption function 1103.
[0065] When generating a decryption clue 1102 for each segment, the decryption clue 1102 includes a relative storage address 2101 and a symmetric key. When generating a clue encryption and decryption function 1103, the clue encryption and decryption function 1103 is a symmetric encryption algorithm. The method for obtaining the decryption clue 1102 includes: encrypting the relative storage address 2101 based on the symmetric key and the symmetric encryption algorithm, and obtaining the ciphertext 12 as the decryption clue 1102. In this embodiment, the symmetric encryption algorithm used in the art can be used, such as 3DES, AES, RC4, Blowfish, IDEA, etc. The decryption clue 1102 includes a symmetric key and a corresponding symmetric encryption algorithm. In the encryption step, the relative storage address 2101 is encrypted using the symmetric key. In the decryption step, the relative storage address 2101 can be obtained by decrypting using the same key.
[0066] On the other hand, an embodiment of the present specification provides a file encryption and decryption system based on multi-factor authentication, including:
[0067] The encryption component 31 is used to receive the file to be encrypted and perform the encryption step;
[0068] The decryption component 41 is used to receive the file to be decrypted, the location record 1101 of the first segment, the decryption clue 1102 of the first segment and the clue encryption and decryption function 1103, and execute the decryption steps.
[0069] On the other hand, the present specification provides an implementation of the encryption component 31, see the attached Figure 6 , the encryption component 31 includes a segment storage subcomponent 3101, which is used to segment the file to be encrypted, record the serial numbers of the segment order, store the segments after disrupting the order, and record the relative storage address 2101 of each segment;
[0070] Obfuscated space subcomponent 3102, for generating a position record 1101 of an obfuscated space for each segment, and inserting a space in the segment based on the position record 1101;
[0071] The clue subcomponent 3103 is used to generate a decryption clue 1102 for each segment, wherein the decryption clue 1102 indicates the relative storage address 2101 of the corresponding segment, and generates a clue encryption and decryption function 1103, obtains the decryption clue 1102 based on the clue encryption and decryption function 1103, and fills the location record 1101 and the decryption clue 1102 into the obfuscated space of the previous segment.
[0072] On the other hand, the present specification provides an implementation of the encryption component 31, see the attached Figure 7 , the decryption component 41 comprises:
[0073] The clue decryption subcomponent 4101 substitutes the decryption clue 1102 of the first segment into the clue encryption and decryption function 1103, obtains the relative storage address 2101 of the first segment, reads the content of the first segment, and obtains the location record 1101 and the decryption clue 1102 of the next segment based on the location record 1101, and obtains the relative storage address 2101 of the next segment based on the decryption clue 1102.
[0074] The splicing subcomponent 4102 receives the content of the first segment read by the clue decryption subcomponent 4101, and splices the content of the next segment one by one based on the relative storage address 2101 of the next segment continuously obtained by the clue decryption subcomponent 4101, and splices all the segments to obtain the decrypted file.
[0075] The encryption component 31 and the decryption component 41 run on the same device, so that the device has both encryption and decryption functions. Alternatively, the encryption component 31 and the decryption component 41 run on different devices, so that the device running the encryption component 31 only has the encryption function, and the device running the decryption component 41 only has the decryption function. For example, during the bidding document delivery process, the bidder only runs the encryption component 31, and the tenderer only runs the decryption component 41 to complete the delivery of the bidding document.
[0076] See also Figure 8 A schematic diagram of the structure of a computer system provided by an embodiment of this specification is shown.
[0077] like Figure 8As shown, the computer system 51 may include: at least one processor 5101, at least one network interface 5104, a user interface 5103, a memory 5105 and at least one communication bus 5102. Among them, the communication bus 5102 can be used to realize the connection and communication of the above-mentioned components. Among them, the user interface 5103 may include a button, and the optional user interface may also include a standard wired interface and a wireless interface. Among them, the network interface 5104 may include but is not limited to a Bluetooth module, an NFC module, a Wi-Fi module, etc. Among them, the processor 5101 may include one or more processing cores. The processor 5101 uses various interfaces and lines to connect various parts in the entire computer system 51, and executes various functions and processes data of the computer system 51 by running or executing instructions, programs, code sets or instruction sets stored in the memory 5105, and calling data stored in the memory 5105. Optionally, the processor 5101 can be implemented in at least one hardware form of DSP, FPGA, and PLA. The processor 5101 can integrate one or a combination of CPU, GPU, modem, etc. Among them, the CPU mainly handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content that needs to be displayed on the display; and the modem is used to handle wireless communications.
[0078] It is understandable that the above-mentioned modem may not be integrated into the processor 5101, but may be implemented by a separate chip.
[0079] Among them, the memory 5105 may include RAM or ROM. Optionally, the memory 5105 includes a non-transitory computer-readable medium. The memory 5105 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 5105 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 5105 may also be at least one storage device located away from the aforementioned processor 5101. The memory 5105 as a computer storage medium may include an operating system, a network communication module, a user interface module and an application. The processor 5101 may be used to call the application stored in the memory 5105 and execute the method in one or more of the above-mentioned embodiments.
[0080] The embodiments of this specification also provide a computer-readable storage medium, which stores instructions, and when the instructions are executed on a computer or a processor, the computer or the processor executes one or more steps in the above embodiments. If the components of the above computer system are implemented in the form of software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium.
[0081] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of this specification is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state drive (SSD)).
[0082] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.
[0083] In the absence of conflict, the technical features in this embodiment and implementation scheme can be combined arbitrarily.
[0084] The embodiments described above are merely preferred embodiments of this specification and are not intended to limit the scope of this specification. Without departing from the design spirit of this specification, various modifications and improvements made to the technical solutions of this specification by ordinary technicians in this field should fall within the scope of protection determined by the claims of this specification.
Claims
1. A file encryption and decryption method based on multi-factor authentication, characterized in that: include: Encryption steps: Divide the file to be encrypted into segments and record the sequence numbers of the segments; generating a position record of obfuscated spaces for each segment, and inserting spaces in each segment based on the position record; Disrupting the order of the segments and then storing them, recording the relative storage address of each segment, and generating a decryption clue for each segment, wherein the decryption clue indicates the relative storage address of the corresponding segment; Generate a clue encryption and decryption function, encrypt the decryption clue of each segment based on the clue encryption and decryption function, and fill the position record and the encrypted decryption clue into the obfuscated space of the previous segment; Decryption steps: Obtaining the location record of the first segment, the decryption clue of the first segment and the clue encryption and decryption function; Substituting the decryption clue of the first segment into the clue encryption and decryption function, obtaining the relative storage address of the first segment, and reading the content of the first segment; Based on the position record, obtain the position record and decryption clue of the next segment, obtain the relative storage address of the next segment based on the decryption clue, and read the content of the segment; Repeat the previous step until all segments are read, and then concatenate all segments in the order in which they were read to obtain the decrypted file.
2. The file encryption and decryption method based on multi-factor authentication according to claim 1, characterized in that: The position record includes a length indication value and an interval number, the length indication value is used to indicate the length of the segment after the empty position is inserted, and an indication sequence for determining whether the binary bit of the segment belongs to the empty position is obtained based on the interval number; or, The position record includes a cycle number and a screening number. Based on the cycle number and the screening number, an indication sequence is obtained whose length matches the segment after the gap is inserted, and is used to determine whether the binary bits of the segment belong to the gap.
3. The file encryption and decryption method based on multi-factor authentication according to claim 1 or 2, characterized in that: When generating a decryption clue for each segment, the decryption clue includes a relative storage address of the segment; When generating a clue encryption and decryption function, the clue encryption and decryption function is a one-dimensional linear function; Methods for obtaining decryption clues include: Based on the relative storage address of the segment and the unary linear function, a decryption clue is obtained.
4. The file encryption and decryption method based on multi-factor authentication according to claim 1 or 2, characterized in that: When generating a decryption clue for each segment, the decryption clue includes at least two integer variables; When generating a clue encryption and decryption function, the clue encryption and decryption function is a multivariate polynomial function; Methods for obtaining decryption clues include: Solving the values of all the integer variables, substituting the values of the integer variables into the clue encryption and decryption function, and obtaining the function value corresponding to the relative storage address; The values of all the integer variables serve as decryption clues.
5. The file encryption and decryption method based on multi-factor authentication according to claim 1 or 2, characterized in that: When generating a decryption clue for each segment, the decryption clue includes a relative storage address and a symmetric key; When generating a clue encryption and decryption function, the clue encryption and decryption function is a symmetric encryption algorithm; Methods for obtaining decryption clues include: Based on the symmetric key and the symmetric encryption algorithm, the relative storage address is encrypted, and the obtained ciphertext is used as a decryption clue.
6. File encryption and decryption system based on multi-factor authentication, characterized in that: include: The encryption component is used to receive the file to be encrypted and perform the encryption steps; A decryption component, used for receiving the file to be decrypted, the location record of the first segment, the decryption clue of the first segment and the clue encryption and decryption function, and executing the decryption steps; The encryption component includes: The segment storage subcomponent is used to segment the file to be encrypted, record the serial numbers of the segment order, store the segments after disrupting the order, and record the relative storage address of each segment; a confusion slot subcomponent, configured to generate a position record of the confusion slots of each segment, and insert a slot into the segment based on the position record; A clue subcomponent, for generating a decryption clue for each segment, the decryption clue indicating a relative storage address of the corresponding segment, generating a clue encryption and decryption function, encrypting the decryption clue based on the clue encryption and decryption function to obtain a decryption clue, and filling the position record and the decryption clue into the obfuscated space of the previous segment; The decryption component includes: The clue decryption subcomponent substitutes the decryption clue of the first segment into the clue encryption and decryption function, obtains the relative storage address of the first segment, reads the content of the first segment, and obtains the position record and decryption clue of the next segment based on the position record, and obtains the relative storage address of the next segment based on the decryption clue. The splicing subcomponent receives the content of the first segment read by the clue decryption subcomponent, and splices the content of the next segment one by one based on the relative storage address of the next segment continuously obtained by the clue decryption subcomponent, and splices all the segments to obtain the decrypted file.
7. A computer system, characterized in that The computer system includes a processor and a memory, the processor is connected to the memory, the memory is used to store executable program code, and the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the file encryption and decryption method based on multi-factor authentication as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the file encryption and decryption method based on multi-factor authentication according to any one of claims 1 to 5 is implemented.
