CN110889017B - Retrieval method and terminal for information encrypted through base64 - Google Patents

Retrieval method and terminal for information encrypted through base64 Download PDF

Info

Publication number
CN110889017B
CN110889017B CN201910976677.1A CN201910976677A CN110889017B CN 110889017 B CN110889017 B CN 110889017B CN 201910976677 A CN201910976677 A CN 201910976677A CN 110889017 B CN110889017 B CN 110889017B
Authority
CN
China
Prior art keywords
encrypted
plaintext data
base64
data
retrieved
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910976677.1A
Other languages
Chinese (zh)
Other versions
CN110889017A (en
Inventor
陈本锋
林晋安
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Landi Commercial Equipment Co Ltd
Original Assignee
Fujian Landi Commercial Equipment Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Landi Commercial Equipment Co Ltd filed Critical Fujian Landi Commercial Equipment Co Ltd
Priority to CN201910976677.1A priority Critical patent/CN110889017B/en
Publication of CN110889017A publication Critical patent/CN110889017A/en
Application granted granted Critical
Publication of CN110889017B publication Critical patent/CN110889017B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Abstract

The invention discloses a retrieval method and a terminal of information encrypted by base64, wherein a plaintext data set to be encrypted is determined according to the length of plaintext data corresponding to the information encrypted by base 64; performing base64 encryption on each plaintext data to be encrypted in the plaintext data set to be encrypted to obtain a retrieval keyword set; searching in the file to be searched according to the search keyword set, and judging whether the file to be searched has information which is corresponding to the plaintext data and is encrypted by base 64; by determining the length of the plaintext data, the plaintext data combination to be encrypted under different conditions can be obtained, the possible existing form of the encrypted ciphertext is fully considered, whether the information encrypted by the base64 exists in the file to be retrieved can be accurately judged, the retrieval efficiency is high, and the cost is saved.

Description

Retrieval method and terminal for information encrypted through base64
Technical Field
The present invention relates to the field of information retrieval, and in particular, to a method and a terminal for retrieving information encrypted by base 64.
Background
For an application APP related to a transaction, information generated during the transaction process is stored in a file log or a database, for example, sensitive data (a bank card number, a name, a master key, and the like) during the transaction process is encrypted by base64 and then stored. In order to search whether sensitive data exists in information generated in the transaction process, testers must find 64-bit encrypted data of base first, then manually decrypt the data and compare the data one by one, which is time-consuming and easy to miss. If sensitive data are directly subjected to base64 encryption and then searched in a data file, the sensitive data cannot be found necessarily, because the base64 encryption is to encode every 3 bytes in sequence to generate 4 bytes of data, and finally, the data are spliced together, and if the length is not a multiple of 4, the data are complemented by "═ through". The base64 encryption is performed with the sensitive data in plain text, and the starting position is not consistent with the encrypted position of the sensitive data in the original data, so that the matching cannot be performed, and the detection error is caused.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: provided are a method and a terminal for searching for information encrypted with base64, which can efficiently and accurately search for information encrypted with base 64.
In order to solve the technical problems, the invention adopts a technical scheme that:
a method for retrieving information encrypted by base64, comprising the steps of:
s1, determining a plaintext data set to be encrypted according to the length of the plaintext data corresponding to the information encrypted by the base 64;
s2, performing base64 encryption on each plaintext data to be encrypted in the plaintext data set to be encrypted to obtain a retrieval keyword set;
and S3, retrieving the files to be retrieved according to the retrieval key word set, and judging whether the files to be retrieved have information which is corresponding to the plaintext data and is encrypted by base 64.
In order to solve the technical problem, the invention adopts another technical scheme as follows:
a retrieval terminal for information encrypted by base64, comprising a memory, a processor and a computer program stored on said memory and executable on said processor, said processor implementing the following steps when executing said computer program:
s1, determining a plaintext data set to be encrypted according to the length of plaintext data corresponding to the information encrypted by the base 64;
s2, performing base64 encryption on each plaintext data to be encrypted in the plaintext data set to be encrypted to obtain a retrieval keyword set;
and S3, retrieving the files to be retrieved according to the retrieval key word set, and judging whether the files to be retrieved have information which is corresponding to the plaintext data and is encrypted by base 64.
The invention has the beneficial effects that: the method comprises the steps of determining a plaintext data set to be encrypted according to the length of plaintext data corresponding to ciphertext to be retrieved, encrypting elements in the plaintext data set to be encrypted to obtain a retrieval key set, retrieving in a file to be retrieved according to the retrieval key set to determine whether information encrypted by base64 corresponding to the plaintext data exists, obtaining plaintext data combinations to be encrypted under different conditions by determining the length of the plaintext data, fully considering the possible existing form of the encrypted ciphertext, guaranteeing that whether the information encrypted by base64 exists in the file to be retrieved can be accurately judged, achieving high retrieval efficiency and saving cost.
Drawings
Fig. 1 is a flowchart illustrating steps of a method for retrieving information encrypted by base64 according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a retrieval terminal of information encrypted by base64 according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating the detailed steps of a method for retrieving information encrypted by base64 according to an embodiment of the present invention;
fig. 4 is a flowchart of the steps of retrieving the information encrypted by base64 based on the PC side and the device side according to the embodiment of the present invention;
description of reference numerals:
1. a retrieval terminal of information encrypted by base 64; 2. a memory; 3. a processor.
Detailed Description
In order to explain the technical contents, the objects and the effects of the present invention in detail, the following description is made with reference to the accompanying drawings in combination with the embodiments.
Referring to fig. 1, a method for retrieving information encrypted by base64 includes the steps of:
s1, determining a plaintext data set to be encrypted according to the length of plaintext data corresponding to the information encrypted by the base 64;
s2, performing base64 encryption on each plaintext data to be encrypted in the plaintext data set to be encrypted to obtain a retrieval keyword set;
and S3, retrieving the file to be retrieved according to the retrieval key word set, and judging whether the file to be retrieved has information which is corresponding to the plaintext data and is encrypted by base 64.
As can be seen from the above description, the beneficial effects of the present invention are: the method comprises the steps of determining a plaintext data set to be encrypted according to the length of plaintext data corresponding to ciphertext to be retrieved, encrypting elements in the plaintext data set to be encrypted to obtain a retrieval key set, retrieving in a file to be retrieved according to the retrieval key set to determine whether information encrypted by base64 corresponding to the plaintext data exists, obtaining plaintext data combinations to be encrypted under different conditions by determining the length of the plaintext data, fully considering the possible existing form of the encrypted ciphertext, guaranteeing that whether the information encrypted by base64 exists in the file to be retrieved can be accurately judged, achieving high retrieval efficiency and saving cost.
Further, the step S1 includes:
and if the length of the plaintext data is less than 3, not retrieving.
Further, the step S1 includes:
and if the length of the plaintext data is equal to 3, determining the plaintext data as the plaintext data to be encrypted.
Further, the step S1 includes:
if the length of the plaintext data is equal to 4, the plaintext data set to be encrypted comprises data consisting of first to third characters of the plaintext data and data consisting of second to fourth characters of the plaintext data.
Further, the step S1 includes:
if the length of the plaintext data is greater than 4, the plaintext data set to be encrypted comprises the plaintext data, data formed by deleting the first character from the plaintext data, and data formed by deleting the first two characters from the plaintext data.
According to the above description, the possible combinations of the plaintext data to be encrypted under different conditions are determined by judging the length of the plaintext data, so that the accuracy of subsequent retrieval judgment can be ensured, and the misjudgment can be avoided.
Further, the step S2 further includes:
and judging whether the encrypted data of the base64 ends in a positive state, if so, deleting the last 4 characters of the corresponding encrypted data of the base 64.
As can be seen from the above description, since the base64 is encrypted and filled with the "═ sign if the length is not a multiple of 4, when the encrypted data is detected to end with the" ═ sign, the last four characters are deleted, thereby avoiding the mismatch between the encrypted information to be retrieved due to the introduction of the filled "═ sign, and further improving the accuracy of retrieval.
Further, if the number of elements in the plaintext data set to be encrypted determined in step S1 is greater than or equal to 2, step S2 and step S3 are respectively performed for each element in the plaintext data set to be encrypted until the information encrypted by base64 corresponding to the plaintext data is retrieved from the file to be retrieved or the elements in the plaintext data set to be encrypted have traversed.
As can be seen from the above description, if the number of elements in the plaintext data set to be encrypted is greater than or equal to 2, the encryption and the retrieval may be performed one by one, and if the retrieval is not performed, the encryption and the retrieval of the next element are performed, and if the retrieval is performed, the process is directly ended, and the encryption and the retrieval of other elements are not performed, which not only improves the retrieval efficiency, but also avoids the waste of resources.
Further, the determining whether the information encrypted by base64 and corresponding to the plaintext data exists in the file to be retrieved includes:
judging whether a matching keyword matched with the retrieval keyword in the retrieval keyword set exists in the file to be retrieved, if so, determining encrypted matching information containing the matching keyword according to the matching keyword;
decrypting the encrypted matching information to obtain decrypted data;
and judging whether the file to be retrieved has the information which is encrypted by base64 and corresponds to the plaintext data or not according to the decrypted data and the plaintext data.
According to the description, after the encrypted matching information corresponding to the matching keyword is retrieved, the encrypted matching information is decrypted and then compared with plaintext data for judgment, and the accuracy of retrieval judgment is further ensured through secondary matching.
Further, the determining the encrypted matching information containing the matching key according to the matching key includes:
determining the starting position and the ending position of the matched keywords;
judging whether the characters in the file to be retrieved are base64 characters one by one from the starting position of the matched keyword until a non-base 64 character is judged;
judging whether the characters in the file to be retrieved are base64 characters one by one from the end position of the matched keyword until a non-base 64 character is judged;
and arranging all the determined base64 characters according to the sequence of the base64 characters in the file to be retrieved as the encrypted matching information.
From the above description, after the matching keyword matched with the search keyword is retrieved from the file to be retrieved, with the matching keyword as the center, respectively forward and backward character by character judgment whether the character is the encrypted character of base64 to determine the complete character string encrypted by base64, thereby ensuring the integrity of the encrypted information of base64 to be matched and further improving the judgment accuracy.
Further, determining whether the information encrypted by base64 and corresponding to the plaintext data exists in the file to be retrieved according to the decrypted data and the plaintext data includes:
and judging whether the decrypted data is matched with the plaintext data, if so, the information which is encrypted by base64 and corresponds to the plaintext data exists in the file to be retrieved, and otherwise, the information which is encrypted by base64 and corresponds to the plaintext data does not exist in the file to be retrieved.
Referring to fig. 2, a retrieval terminal for information encrypted by base64 includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the following steps:
s1, determining a plaintext data set to be encrypted according to the length of plaintext data corresponding to the information encrypted by the base 64;
s2, performing base64 encryption on each plaintext data to be encrypted in the plaintext data set to be encrypted to obtain a retrieval keyword set;
and S3, retrieving the files to be retrieved according to the retrieval key word set, and judging whether the files to be retrieved have information which is corresponding to the plaintext data and is encrypted by base 64.
As can be seen from the above description, the beneficial effects of the present invention are: the method comprises the steps of determining a plaintext data set to be encrypted according to the length of plaintext data corresponding to ciphertext to be retrieved, encrypting elements in the plaintext data set to be encrypted to obtain a retrieval key set, retrieving in a file to be retrieved according to the retrieval key set to determine whether information encrypted by base64 corresponding to the plaintext data exists, obtaining plaintext data combinations to be encrypted under different conditions by determining the length of the plaintext data, fully considering the possible existing form of the encrypted ciphertext, guaranteeing that whether the information encrypted by base64 exists in the file to be retrieved can be accurately judged, achieving high retrieval efficiency and saving cost.
Further, the step S1 includes:
and if the length of the plaintext data is less than 3, not retrieving.
Further, the step S1 includes:
and if the length of the plaintext data is equal to 3, determining the plaintext data as the plaintext data to be encrypted.
Further, the step S1 includes:
if the length of the plaintext data is equal to 4, the plaintext data set to be encrypted comprises data consisting of first to third characters of the plaintext data and data consisting of second to fourth characters of the plaintext data.
Further, the step S1 includes:
if the length of the plaintext data is greater than 4, the set of the plaintext data to be encrypted comprises the plaintext data, data formed after the first character of the plaintext data is deleted, and data formed after the first two characters of the plaintext data are deleted.
According to the above description, the possible combinations of the plaintext data to be encrypted under different conditions are determined by judging the length of the plaintext data, so that the accuracy of subsequent retrieval judgment can be ensured, and the misjudgment can be avoided.
Further, the step S2 further includes:
and judging whether the encrypted data of the base64 is ended in a state of being equal to the end, if so, deleting the last 4 characters of the corresponding encrypted data of the base 64.
As can be seen from the above description, since the base64 is encrypted and filled with the "═ sign if the length is not a multiple of 4, when the encrypted data is detected to end with the" ═ sign, the last four characters are deleted, thereby avoiding the mismatch between the encrypted information to be retrieved due to the introduction of the filled "═ sign, and further improving the accuracy of retrieval.
Further, if the number of elements in the plaintext data set to be encrypted determined in step S1 is greater than or equal to 2, step S2 and step S3 are respectively performed for each element in the plaintext data set to be encrypted until the information encrypted by base64 corresponding to the plaintext data is retrieved from the file to be retrieved or the elements in the plaintext data set to be encrypted have traversed.
As can be seen from the above description, if the number of elements in the plaintext data set to be encrypted is greater than or equal to 2, the plaintext data set can be encrypted and retrieved one by one, and if the plaintext data set cannot be retrieved, the next element is encrypted and retrieved, and if the plaintext data set is retrieved, the encryption and retrieval of the next element is directly finished, and no encryption and retrieval of other elements are required, which improves the retrieval efficiency and avoids the waste of resources.
Further, the determining whether the information encrypted by the base64 and corresponding to the plaintext data exists in the file to be retrieved includes:
judging whether a matching keyword matched with the retrieval keyword in the retrieval keyword set exists in the file to be retrieved, if so, determining encrypted matching information containing the matching keyword according to the matching keyword;
decrypting the encrypted matching information to obtain decrypted data;
and judging whether the file to be retrieved has the information which is encrypted by base64 and corresponds to the plaintext data or not according to the decrypted data and the plaintext data.
According to the description, after the encrypted matching information corresponding to the matching keyword is retrieved, the encrypted matching information is decrypted and then compared with plaintext data for judgment, and the accuracy of retrieval judgment is further ensured through secondary matching.
Further, the determining the encrypted matching information containing the matching keyword according to the matching keyword comprises:
determining the starting position and the ending position of the matched keywords;
starting from the initial position of the matched keyword in the file to be retrieved, judging whether the character by character is a base64 character or not until a non-base 64 character is judged;
judging whether the characters in the file to be retrieved are base64 characters one by one from the end position of the matched keyword until a non-base 64 character is judged;
and arranging all the judged base64 characters according to the sequence of the characters in the file to be retrieved as the encrypted matching information.
From the above description, after the matching keyword matched with the search keyword is retrieved from the file to be retrieved, with the matching keyword as the center, respectively forward and backward character by character judgment whether the character is the encrypted character of base64 to determine the complete character string encrypted by base64, thereby ensuring the integrity of the encrypted information of base64 to be matched and further improving the judgment accuracy.
Further, determining whether the information encrypted by base64 and corresponding to the plaintext data exists in the file to be retrieved according to the decrypted data and the plaintext data includes:
and judging whether the decrypted data are matched with the plaintext data, if so, the information which is encrypted by base64 and corresponds to the plaintext data exists in the file to be retrieved, and otherwise, the information which is encrypted by base64 and corresponds to the plaintext data does not exist in the file to be retrieved.
The above-mentioned method and terminal for retrieving information encrypted by base64 of the present invention can be applied to any scene that needs to retrieve information encrypted by base64, and are described below with reference to specific embodiments:
example one
Referring to fig. 1, the present embodiment is applied to search whether transaction data generated in APP application software includes sensitive data (such as a bank card, an account, and the like), and a method for searching information encrypted by base64 includes the steps of:
s1, determining a plaintext data set to be encrypted according to the length of plaintext data corresponding to the information encrypted by the base 64;
specifically, in this embodiment, the plaintext data is plaintext sensitive data, such as bank card data, as shown in fig. 3, a length of the plaintext sensitive data is determined first, and if the length of the plaintext data is less than 3, the plaintext data is not retrieved, that is, whether the information encrypted by base64 exists is not detected;
if the length of the plaintext data is equal to 3, determining the plaintext data as plaintext data to be encrypted, namely, the plaintext data set to be encrypted comprises 1 group of data;
if the length of the plaintext data is equal to 4, the plaintext data set to be encrypted comprises data consisting of first to third characters of the plaintext data and data consisting of second to fourth characters of the plaintext data, namely the plaintext data set to be encrypted comprises 2 groups of data;
if the length of the plaintext data is greater than 4, the plaintext data set to be encrypted comprises the plaintext data, data formed after the plaintext data deletes the first character, and data formed after the plaintext data deletes the first two characters, namely the plaintext data set to be encrypted comprises 3 sets of data;
s2, performing base64 encryption on each plaintext data to be encrypted in the plaintext data set to be encrypted to obtain a retrieval keyword set;
judging whether the encrypted data of the base64 is ended in "═ or" state, if yes, deleting the last 4 characters of the corresponding encrypted data of the base 64;
s3, retrieving in the file to be retrieved according to the retrieval keyword set, and judging whether the file to be retrieved has information which is corresponding to the plaintext data and is encrypted by base 64;
the judging whether the information which is encrypted by the base64 and corresponds to the plaintext data exists in the file to be retrieved comprises the following steps:
judging whether a matching keyword matched with the retrieval keyword in the retrieval keyword set exists in the file to be retrieved, if so, determining encrypted matching information containing the matching keyword according to the matching keyword;
decrypting the encrypted matching information to obtain decrypted data;
judging whether information which corresponds to the plaintext data and is encrypted by base64 exists in the file to be retrieved according to the decrypted data and the plaintext data;
the determining, from the matching key, encrypted matching information that includes the matching key comprises:
determining the starting position and the ending position of the matched keywords;
judging whether the characters in the file to be retrieved are base64 characters one by one from the starting position of the matched keyword until a non-base 64 character is judged;
64 characters including '0-9', 'a-Z', 'A-Z', 'plus' and 'minus' are base64 characters, and the characters to be judged are compared with the 64 characters one by one in sequence to judge whether the characters are base64 characters;
judging whether the characters in the file to be retrieved are base64 characters one by one from the end position of the matched keyword until a non-base 64 character is judged;
arranging all the judged base64 characters according to the sequence of the characters in the file to be retrieved as the encrypted matching information, namely, taking the base64 character positioned in front of the matching keyword, the base64 character string corresponding to the matching keyword and the base64 character behind the matching keyword as the encrypted matching information;
judging whether the information which corresponds to the plaintext data and is encrypted by base64 exists in the file to be retrieved according to the decrypted data and the plaintext data comprises the following steps:
judging whether the decrypted data are matched with the plaintext data or not, if so, the information which is encrypted by base64 and corresponds to the plaintext data exists in the file to be retrieved, and if not, the information which is encrypted by base64 and corresponds to the plaintext data does not exist in the file to be retrieved;
specifically, during the search, the search process may be executed at the PC, and presented in the form of an automatic search service running in a Windows system, the mobile terminal device (such as a POS terminal) runs APP application software, and the APP application software executes a transaction to generate a data file to be detected, that is, a data file to be searched;
the PC terminal is communicated with the POS terminal through a serial port, and a data file which is stored in the POS terminal in an application software transaction mode is uploaded to the PC terminal;
the PC side configures sensitive words to be retrieved, wherein multiple groups can be set;
the automatic retrieval service encrypts the sensitive words by base64 according to the method to generate keywords to be retrieved;
then, retrieving each row of data of each data file by using the keywords to be retrieved, wherein the specific flow is shown in fig. 4;
in order to improve efficiency, parallel retrieval can be performed on the files with multiple groups of sensitive words, namely, one thread performs retrieval on one group of sensitive words, and one file is only allowed to be opened sequentially, and the same file cannot be opened by multiple threads simultaneously, so that multiple files can be processed in multiple threads respectively, and the retrieval of multiple groups of sensitive words can be performed in parallel.
Example two
The present embodiment is different from the first embodiment in that, if the number of elements in the plaintext data sets to be encrypted determined in step S1 is greater than or equal to 2, step S2 and step S3 are respectively performed on each element in the plaintext data sets to be encrypted until the information encrypted by base64 corresponding to the plaintext data is retrieved from the file to be retrieved or the elements in the plaintext data sets to be encrypted have traversed;
specifically, for the case that the length of the plaintext data is greater than 4, base64 encryption can be performed on the original sensitive data (in a plaintext form) to form a keyword to be retrieved, then the keyword is retrieved line by line in the file to be retrieved, if the retrieval cannot be performed, the first character of the original sensitive data is deleted, the remaining sensitive data is encrypted and then retrieved again, and if the retrieval is performed, the retrieval can be stopped; if the sensitive data cannot be searched, deleting the first character of the remaining sensitive data again, then encrypting the remaining data and searching, and if the sensitive data cannot be searched, indicating that the sensitive data does not exist in the file to be searched.
EXAMPLE III
Referring to fig. 2, a retrieval terminal 1 for information encrypted by base64 includes a memory 2, a processor 3, and a computer program stored in the memory 2 and capable of running on the processor 3, where the processor 3 implements the steps of the first embodiment when executing the computer program.
Example four
Referring to fig. 2, a retrieval terminal 1 for information encrypted by base64 includes a memory 2, a processor 3, and a computer program stored on the memory 2 and capable of running on the processor 3, where the processor 3 implements the steps of the second embodiment when executing the computer program.
In summary, the invention provides a retrieval method and a terminal for information encrypted by base64, which determine the combination of plaintext data to be retrieved according to the length of the plaintext data, because the plaintext data is encrypted by base64 together with other data, the encryption of every 3 characters is not necessarily started by the first character of the plaintext data, different plaintext data to be retrieved represent various forms in which the information may be encrypted, the combination of plaintext data to be retrieved is respectively encrypted by base64 to obtain a keyword set to be retrieved, and then the retrieval is performed on the file to be retrieved line by line, thereby solving the problems of insufficient testing personnel, much time consumption and easy error, not only greatly improving the retrieval efficiency, saving the cost, but also improving the retrieval accuracy, and simultaneously determining the possible form of the plaintext data to be retrieved while retrieving various plaintext data to be retrieved, the retrieval and the determination of the possible form of the plaintext data to be retrieved are performed in a crossed manner, so that the retrieval efficiency is improved, and the resource consumption is avoided.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent changes made by using the contents of the present specification and the drawings, or applied directly or indirectly to the related technical fields, are included in the scope of the present invention.

Claims (10)

1. A method for retrieving information encrypted by base64, comprising the steps of:
s1, determining a plaintext data set to be encrypted according to the length of plaintext data corresponding to the information encrypted by the base 64;
s2, performing base64 encryption on each plaintext data to be encrypted in the plaintext data set to be encrypted to obtain a retrieval keyword set;
s3, retrieving in the file to be retrieved according to the retrieval keyword set, and judging whether the file to be retrieved has information which is corresponding to the plaintext data and is encrypted by base 64;
the step S1 includes:
if the length of the plaintext data is less than 3, not retrieving;
if the length of the plaintext data is equal to 3, determining the plaintext data as plaintext data to be encrypted;
if the length of the plaintext data is equal to 4, the set of plaintext data to be encrypted comprises data consisting of first to third characters of the plaintext data and data consisting of second to fourth characters of the plaintext data;
if the length of the plaintext data is greater than 4, the plaintext data set to be encrypted comprises the plaintext data, data formed by deleting the first character from the plaintext data, and data formed by deleting the first two characters from the plaintext data;
if the number of the elements in the plaintext data set to be encrypted determined in step S1 is greater than or equal to 2, step S2 and step S3 are respectively performed for each element in the plaintext data set to be encrypted until the information encrypted by base64 corresponding to the plaintext data is retrieved from the file to be retrieved or the elements in the plaintext data set to be encrypted have traversed.
2. The method for retrieving information encrypted by base64, according to claim 1, wherein the step S2 further comprises:
and judging whether the encrypted data of the base64 ends in a positive state, if so, deleting the last 4 characters of the corresponding encrypted data of the base 64.
3. The method for retrieving information encrypted by base64, according to claim 1 or 2, wherein the determining whether the information encrypted by base64 corresponding to the plaintext data exists in the file to be retrieved includes:
judging whether a matching keyword matched with the retrieval keyword in the retrieval keyword set exists in the file to be retrieved, if so, determining encrypted matching information containing the matching keyword according to the matching keyword;
decrypting the encrypted matching information to obtain decrypted data;
and judging whether the information which corresponds to the plaintext data and is encrypted by base64 exists in the file to be retrieved according to the decrypted data and the plaintext data.
4. The method as claimed in claim 3, wherein said determining the encrypted matching information containing the matching key according to the matching key comprises:
determining the starting position and the ending position of the matched keywords;
starting from the initial position of the matched keyword in the file to be retrieved, judging whether the character by character is a base64 character or not until a non-base 64 character is judged;
judging whether the characters in the file to be retrieved are base64 characters one by one from the end position of the matched keyword until a non-base 64 character is judged;
and arranging all the determined base64 characters according to the sequence of the base64 characters in the file to be retrieved as the encrypted matching information.
5. The method as claimed in claim 3, wherein the step of determining whether the base64 encrypted information corresponding to the plaintext data exists in the file to be retrieved according to the decrypted data and the plaintext data comprises:
and judging whether the decrypted data is matched with the plaintext data, if so, the information which is encrypted by base64 and corresponds to the plaintext data exists in the file to be retrieved, and otherwise, the information which is encrypted by base64 and corresponds to the plaintext data does not exist in the file to be retrieved.
6. A retrieval terminal for information encrypted by base64, comprising a memory, a processor and a computer program stored on said memory and executable on said processor, characterized in that said processor implements the following steps when executing said computer program:
s1, determining a plaintext data set to be encrypted according to the length of plaintext data corresponding to the information encrypted by the base 64;
s2, performing base64 encryption on each plaintext data to be encrypted in the plaintext data set to be encrypted to obtain a retrieval keyword set;
s3, retrieving the files to be retrieved according to the retrieval keyword set, and judging whether the files to be retrieved have information which is corresponding to the plaintext data and is encrypted by base 64;
the step S1 includes:
if the length of the plaintext data is less than 3, not retrieving;
if the length of the plaintext data is equal to 3, determining the plaintext data as plaintext data to be encrypted;
if the length of the plaintext data is equal to 4, the plaintext data set to be encrypted comprises data consisting of first to third characters of the plaintext data and data consisting of second to fourth characters of the plaintext data;
if the length of the plaintext data is greater than 4, the plaintext data set to be encrypted comprises the plaintext data, data formed by deleting the first character from the plaintext data, and data formed by deleting the first two characters from the plaintext data;
if the number of the elements in the plaintext data set to be encrypted determined in step S1 is greater than or equal to 2, step S2 and step S3 are respectively performed for each element in the plaintext data set to be encrypted until information encrypted by base64 corresponding to the plaintext data is retrieved from the file to be retrieved or the elements in the plaintext data set to be encrypted have traversed.
7. The terminal for retrieving information encrypted by base64, according to claim 6, wherein the step S2 further comprises:
and judging whether the encrypted data of the base64 is ended in a state of being equal to the end, if so, deleting the last 4 characters of the corresponding encrypted data of the base 64.
8. The terminal for retrieving information encrypted by base64 as claimed in claim 6 or 7, wherein said determining whether the information encrypted by base64 corresponding to the plaintext data exists in the file to be retrieved comprises:
judging whether a matching keyword matched with the retrieval keyword in the retrieval keyword set exists in the file to be retrieved, if so, determining encrypted matching information containing the matching keyword according to the matching keyword;
decrypting the encrypted matching information to obtain decrypted data;
and judging whether the information which corresponds to the plaintext data and is encrypted by base64 exists in the file to be retrieved according to the decrypted data and the plaintext data.
9. The terminal of claim 8, wherein said determining the encrypted matching information containing the matching key according to the matching key comprises:
determining the starting position and the ending position of the matched keywords;
starting from the initial position of the matched keyword in the file to be retrieved, judging whether the character by character is a base64 character or not until a non-base 64 character is judged;
judging whether the characters in the file to be retrieved are base64 characters one by one from the end position of the matched keyword until a non-base 64 character is judged;
and arranging all the judged base64 characters according to the sequence of the characters in the file to be retrieved as the encrypted matching information.
10. The terminal for retrieving information encrypted with base64 as claimed in claim 8, wherein said determining whether the information encrypted with base64 corresponding to the plaintext data exists in the file to be retrieved according to the decrypted data and the plaintext data comprises:
and judging whether the decrypted data is matched with the plaintext data, if so, the information which is encrypted by base64 and corresponds to the plaintext data exists in the file to be retrieved, and otherwise, the information which is encrypted by base64 and corresponds to the plaintext data does not exist in the file to be retrieved.
CN201910976677.1A 2019-10-15 2019-10-15 Retrieval method and terminal for information encrypted through base64 Active CN110889017B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910976677.1A CN110889017B (en) 2019-10-15 2019-10-15 Retrieval method and terminal for information encrypted through base64

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910976677.1A CN110889017B (en) 2019-10-15 2019-10-15 Retrieval method and terminal for information encrypted through base64

Publications (2)

Publication Number Publication Date
CN110889017A CN110889017A (en) 2020-03-17
CN110889017B true CN110889017B (en) 2022-09-13

Family

ID=69746203

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910976677.1A Active CN110889017B (en) 2019-10-15 2019-10-15 Retrieval method and terminal for information encrypted through base64

Country Status (1)

Country Link
CN (1) CN110889017B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114257442A (en) * 2021-12-20 2022-03-29 山石网科通信技术股份有限公司 Method and device for detecting transmission loophole and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1863042A (en) * 2005-12-13 2006-11-15 华为技术有限公司 Method for information encryption
CN106375083A (en) * 2016-09-30 2017-02-01 广东网金控股股份有限公司 Encryption-decryption method based on Base64 and device thereof
CN106610995A (en) * 2015-10-23 2017-05-03 华为技术有限公司 Ciphertext index creating method, device and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10642828B2 (en) * 2017-10-10 2020-05-05 Sap Se Searchable encryption scheme with external tokenizer

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1863042A (en) * 2005-12-13 2006-11-15 华为技术有限公司 Method for information encryption
CN106610995A (en) * 2015-10-23 2017-05-03 华为技术有限公司 Ciphertext index creating method, device and system
CN106375083A (en) * 2016-09-30 2017-02-01 广东网金控股股份有限公司 Encryption-decryption method based on Base64 and device thereof

Also Published As

Publication number Publication date
CN110889017A (en) 2020-03-17

Similar Documents

Publication Publication Date Title
CN111563041B (en) Test case on-demand accurate execution method
CN108647357B (en) Data query method and device
CN104021132A (en) Method and system for verification of consistency of backup data of host database and backup database
CN111475376A (en) Method and device for processing test data, computer equipment and storage medium
WO2024007481A1 (en) Fault detection method and apparatus for security chip, electronic device, and medium
CN110618999A (en) Data query method and device, computer storage medium and electronic equipment
CN110889017B (en) Retrieval method and terminal for information encrypted through base64
CN109145016A (en) A kind of finance internet big data searching system
CN115048435A (en) Intelligent database storage method and system
CN110753080A (en) Block transmission method, device, equipment and readable storage medium
CN102982288B (en) The encryption of data and the equipment of deciphering and method is performed in portable terminal
US10289531B2 (en) Software integration testing with unstructured database
CN114116811B (en) Log processing method, device, equipment and storage medium
CN108460116B (en) Search method, search device, computer equipment, storage medium and search system
CN107315806B (en) Embedded storage method and device based on file system
CN110851437A (en) Storage method, device and equipment
CN111045983B (en) Nuclear power station electronic file management method, device, terminal equipment and medium
CN113076548A (en) Robot automation process account information processing method and device
CN112463791A (en) Nuclear power station document data acquisition method and device, computer equipment and storage medium
CN110727726A (en) Method and system for extracting data from document type database to relational database
CN116701493B (en) Database operation method supporting fuzzy query and user side
CN116050376A (en) Data comparison method, device, equipment and storage medium
CN113032594B (en) Label image storage method, apparatus, computer device and storage medium
CN116720818B (en) Warehouse processing method, device and computer equipment based on block chain
CN101350837B (en) Method and system for identifying file package bundling

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant