WO2020192007A1 - 数据脱敏方法和相关装置 - Google Patents

数据脱敏方法和相关装置 Download PDF

Info

Publication number
WO2020192007A1
WO2020192007A1 PCT/CN2019/102746 CN2019102746W WO2020192007A1 WO 2020192007 A1 WO2020192007 A1 WO 2020192007A1 CN 2019102746 W CN2019102746 W CN 2019102746W WO 2020192007 A1 WO2020192007 A1 WO 2020192007A1
Authority
WO
WIPO (PCT)
Prior art keywords
identifier
data
sequence
identification
dictionary
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.)
Ceased
Application number
PCT/CN2019/102746
Other languages
English (en)
French (fr)
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Publication of WO2020192007A1 publication Critical patent/WO2020192007A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes

Definitions

  • This application relates to the field of information security technology, especially data desensitization methods and related devices.
  • Data desensitization also known as data bleaching, data deprivation or data deformation, refers to data deformation of certain sensitive information according to certain rules, so that the data is transformed into another data, so as to achieve reliable protection of sensitive privacy data.
  • data bleaching data deprivation
  • data deformation refers to data deformation of certain sensitive information according to certain rules, so that the data is transformed into another data, so as to achieve reliable protection of sensitive privacy data.
  • customer security data or some commercially sensitive data and without violating system rules, when using real data to transform and provide test use, individuals such as ID card numbers, mobile phone numbers, card numbers, customer numbers, etc.
  • the information can only be used after data desensitization.
  • Data desensitization can be divided into recoverable desensitization and irreversible desensitization according to the desensitization rules.
  • recoverable desensitization means that the desensitized data can be restored to the original sensitive data through a certain method
  • non-recoverable desensitization means that the desensitized part of the desensitized data cannot be recovered in any way.
  • data desensitization generally involves establishing a data dictionary, and then performing a certain mapping according to the data dictionary to obtain the desensitized data.
  • One method is to randomly map according to the data dictionary, which is irreversible desensitization, but the problem is that the data after random desensitization cannot be restored to the original data; the other method is to map according to the data dictionary.
  • Rule mapping this method is recoverable desensitization, but the problem lies in the risk that the mapping relationship is easily known, and the security is insufficient.
  • the embodiments of the present application provide a data desensitization method and related devices to solve the problem that the current desensitization method cannot balance data restoration and data security.
  • the first aspect provides a data masking method, including:
  • the first data is the data to be desensitized.
  • the data dictionary includes a correspondence between a data sequence and a first identification sequence.
  • the data sequence includes a plurality of data.
  • the first identification sequence includes multiple identifications, one identification in the data sequence corresponds to one data in the first identification sequence, and the data desensitization key includes at least one of the first identification sequence Logo
  • the identification dictionary is determined according to the desensitization key, the identification dictionary includes the corresponding relationship between the first identification sequence and the second identification sequence, and the second identification sequence is based on the identification pair in the desensitization key.
  • a sequence obtained by reordering the first identification sequence, and an identification in the second identification sequence corresponds to an identification in the first identification sequence;
  • the second data corresponding to the second identifier in the data sequence is determined according to the data dictionary, and the second data is determined as desensitization data corresponding to the first data.
  • a data desensitization device including:
  • the dictionary key determination module is used to determine the data dictionary and the desensitization key corresponding to the first data, the first data is the data to be desensitized, and the data dictionary includes the corresponding relationship between the data sequence and the first identification sequence,
  • the data sequence includes multiple data, the first identification sequence includes multiple identifiers, one data in the data sequence corresponds to one identifier in the first identification sequence, and the desensitization key includes at least one The identifier in the first identifier sequence;
  • a first identification determining module configured to determine a first identification corresponding to the first data in the first identification sequence according to the data dictionary
  • the identification dictionary determination module is configured to determine an identification dictionary according to the desensitization key, the identification dictionary includes the corresponding relationship between the first identification sequence and the second identification sequence, and the second identification sequence is based on the desensitization A sequence obtained by reordering the first identification sequence with an identifier in the key, and an identifier in the second identifier sequence corresponds to an identifier in the first identifier sequence;
  • a second identification determining module configured to determine a second identification corresponding to the first identification in the second identification sequence according to the identification dictionary
  • a desensitization data determining module configured to determine second data corresponding to the second identifier in the data sequence according to the data dictionary, and determine the second data as the desensitization corresponding to the first data data.
  • another data desensitization device including a processor, a memory, and an input-output interface, the processor, the memory, and the input-output interface are connected to each other, wherein the input-output interface is used to input or output data,
  • the memory is used to store application program code for the data desensitization device to execute the above method, and the processor is configured to execute the method of the above first aspect.
  • a computer non-volatile readable storage medium stores a computer program, the computer program includes program instructions, and the program instructions when executed by a processor When the processor executes the method of the first aspect.
  • the security of the data and the reducibility of the desensitized data can be taken into consideration at the same time.
  • FIG. 1 is a schematic flowchart of a data desensitization method provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of a data and identification conversion provided by an embodiment of the present application
  • FIG. 3 is a schematic diagram of a mapping provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of the composition structure of a data desensitization device provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of the composition structure of another data desensitization device provided by an embodiment of the present application.
  • the solutions of the embodiments of the present application can be applied to scenarios where sensitive data needs to be used for data mining and data analysis in various industries such as financial companies, government units, hospitals, and banks.
  • the sensitive data needs to be desensitized to prevent sensitive data from leaking.
  • the solution of the embodiment of this application can be specifically applied to a social security data center that needs to provide social security data to outsourced developers for the development and testing of the social security system.
  • the social security data needs to be desensitized and provided to the outsourcing Developer.
  • the solutions of the embodiments of this application can also be specifically applied to operators to provide customer information, call records and other business data to visitors with different identities such as supervisory agencies, public security agencies, and government departments. Users configure different data masking rules to meet their different needs.
  • sensitive data includes, but is not limited to, name, ID number, residential address, telephone number, bank account, email address, city, zip code, various passwords (such as account query password, withdrawal password, login password, etc.) ), organization name, business license number, bank account number, transaction date, transaction amount equal to data related to the user's subject or the user's behavior.
  • Fig. 1 is a schematic flowchart of a data desensitization method provided by an embodiment of the present application. As shown in the figure, the method includes the following steps:
  • the first data is data to be desensitized.
  • the data dictionary includes a data sequence and a first identification sequence.
  • the data sequence includes multiple data, and the first identification sequence includes multiple data.
  • One identification, one data in the data sequence corresponds to one identification in the first identification sequence.
  • the data dictionary corresponding to the first data is a data dictionary corresponding to the type or category to which the first data belongs, and the data sequence includes all possible data corresponding to the type or category to which the first data belongs.
  • the type or category to which the first data belongs specifically refers to what type or category of data the current data to be desensitized is. For example, if the current data to be desensitized is an ID number, the type or category of the first data is the ID number, and the data sequence includes all possible data corresponding to the ID number, that is, the first data dictionary includes 0 to 9 Every number of and X.
  • the type or category of the first data is an email address
  • the data sequence includes all possible data corresponding to the email address, that is, the data sequence includes every number from 0 to 9 , A to Z and each of the English letters from a to z, and other characters that may be used in the email address, such as ".”, "/" and other characters.
  • the first identification sequence is that the number set according to the number and type of data in the first data sequence is the same as the number of data in the data sequence, and the type is the same as that of the data in the first data sequence.
  • the data sequence includes all possible data corresponding to the ID number, that is, the first data dictionary includes every number from 0 to 9 and X
  • the first identification sequence can be a sequence composed of English letters a to k
  • An identification sequence can also be a sequence composed of numbers 0-9 and X.
  • the identifier in the first identifier sequence may include all possible identifiers related to the desensitization task and/or related to the desensitization operator.
  • the identification in the first identification sequence includes all possible identifications corresponding to the task number of the desensitization task. Assuming that the task number of the desensitization task consists of any number from 0 to 9 and the two letters A and B, then the first An identifier in an identifier sequence may include each number from 0 to 9 and the two letters A and B. For another example, the identification in the first identification sequence also includes all possible identifications corresponding to the job number of the desensitization operator. Assuming that the job number of the desensitization operator consists of any number from 0 to 9, then the first identification sequence The identifier in can include every number from 0 to 9.
  • the identification sequence in the first identification sequence includes all possible identifications corresponding to the task number of the desensitization task and all possible identifications corresponding to the job number of the desensitization operator. It is assumed that the task number of the desensitization task ranges from 0 to 9. Any number in A and B, and the job number of the desensitization operator is composed of any number from 0 to 9, then the data identification in the first identification sequence can include each of 0 to 9 Data and the two letters A and B. Not limited to the description here.
  • the desensitization key is composed of at least one identification in the first identification sequence.
  • the desensitization key may be a certain account or number or identification or number related to the desensitization task.
  • the desensitization key can be the task number of the desensitization task, or the desensitization key can be the job number and the desensitization number of the desensitization operator performing the current desensitization task, or the first desensitization key can be It is the task number of the desensitization task and the job number and desensitization number of the desensitization operator performing the current desensitization task.
  • the currently executing desensitization task is to desensitize the user's phone number
  • the desensitization task number is 0x001
  • the job number of the desensitization operator currently performing the desensitization task is bj856
  • the format of the desensitization task number is "0x+digital number”
  • the format of the job number of the desensitization operator is "bj+digital number”
  • the phone number is composed of numbers
  • the first data is a data in the user's phone number
  • the data dictionary corresponding to the first data is as follows
  • the left column of A in Figure 2 (data) is a data sequence
  • the first data sequence is composed of all possible numbers of the telephone number
  • the right column (identification 1) is the first identification sequence.
  • An identification sequence is composed of all possible digits of the digital number in the desensitization task number or all possible digits of the digital number in the job number of the desensitization operator.
  • the first desensitization key can be "001" or "856". When the first desensitization key is "001", the first desensitization key is related to the desensitization task number of the desensitization task.
  • the key can be used to indicate the task number of the desensitization task; when the first desensitization key is "856", the first desensitization key is related to the job number of the desensitization operator currently performing the desensitization task, and its A desensitization key can be used to represent the job number of the desensitization operator currently performing the desensitization task.
  • one or more data dictionaries can be preset for the data categories involved in the desensitization scenario, so that the data in the first data sequence in the one or more data dictionaries can cover all the data that may exist in the data category , And save the correspondence between the data category and the data dictionary.
  • the data dictionary corresponding to the first data can be determined according to the category or type of the first data, and then the first data corresponding to the first data can be determined according to the sequence of the first data in all the data currently to be desensitized The first desensitization key.
  • S102 Determine a first identifier corresponding to the first data in the first identifier sequence according to the data dictionary.
  • the data dictionary is shown as A in FIG. 2 and the first data is 3, and 3 can be determined as the first identifier corresponding to the data "3" in the first identifier sequence (identification 1) according to the data dictionary.
  • S103 Determine an identification dictionary according to the desensitization key, where the identification dictionary includes the corresponding relationship between the first identification sequence and the second identification sequence, and the second identification sequence is obtained by reordering the first identification sequence according to the identifiers in the desensitization key A sequence, an identifier in the second identifier sequence corresponds to an identifier in the first identifier sequence.
  • reordering the identifiers in the first identifier sequence refers to changing and adjusting the order of the identifiers in the first identifier sequence in the first identifier sequence, so that the order of the identifiers in the changed identifier sequence is the same as that in the changed identifier sequence.
  • the arrangement order in the first identification sequence is different, that is, the identity contained in the sequence obtained by reordering the first identification sequence is the same as the content and number of the identification contained in the first identification sequence, and the identification is in the first identification sequence
  • the sequence in the sequence obtained by reordering is different from the sequence of the identifier in the first identifier sequence.
  • the first identification sequence is shown in the right column of A in FIG. 2, and the identification sequence after reordering the identifications in the first identification sequence may be as shown in B in FIG. 2. Comparing B and A in FIG. 2, it can be seen that the arrangement order of the marks in B has changed relative to the arrangement order of the marks in A.
  • the identification dictionary may be composed of one or more sub-identification dictionaries corresponding to the desensitization key, and the number of sub-identification dictionaries corresponding to the desensitization key may be related to the number of identifiers contained in the desensitization key.
  • the following specifically introduces the method of determining the identification dictionary based on the desensitization key.
  • Determining the identity dictionary based on the masking key can be divided into the following two steps:
  • Step 1 Determine the sub-identity dictionary corresponding to each identifier in the desensitization key.
  • the desensitization key including m identifiers as an example, m is a positive integer, and m is greater than or equal to 1. Since the desensitization key includes m identities, there are m sub-identity dictionaries determined according to the m identities in the desensitization key, that is, the m sub-identity dictionaries corresponding to the m identities are first determined.
  • the first identification sequence can be reordered according to the preset reordering rule and the m identifiers in the desensitization key, respectively, to obtain the corresponding m identifiers in the desensitization key.
  • m reordering identifier sequences and then combining the first identifier sequence and m reordering identifier sequences corresponding to the m identifiers in the desensitization key to form m sub-identity dictionaries corresponding to the m identifiers in the desensitization key.
  • the preset reordering rule may be to sequentially shift the first identification sequence, so that the target identifier is at the kth position in the reordering identification sequence obtained by the shift, and k is greater than or equal to 1 and any positive integer less than or equal to N, where N is the number of identifications in the first identification sequence.
  • the target identifier is the identifier to determine the corresponding reordering identifier sequence.
  • the first identification sequence is shown in the right column of A in Figure 2, and the m identifiers in the desensitization key are paired according to the preset reordering rules and The first identification sequence is reordered, and the process of obtaining m reordering identification sequences corresponding to the m identities in the desensitization key is as follows:
  • the shifted sequence is shown in D in Figure 2. As shown, the sequence shown by D in FIG. 2 is the reordering identifier sequence corresponding to the identifier "6".
  • the process of composing the first identification sequence and m reordering identification sequences corresponding to each of the m identifications in the desensitization key to form m sub-identity dictionaries corresponding to the m identifications in the desensitization key may be as follows:
  • the first identification sequence and the reordering identification sequence corresponding to the identification "8" form a sub-identification dictionary corresponding to the identification "8", and the sub-identification dictionary corresponding to "8" is shown in E in FIG.
  • the first identification sequence and the reordering identification sequence corresponding to the identification "5" form a sub-identification dictionary corresponding to the identification "5", and the sub-identification dictionary corresponding to "5" is shown in F in FIG.
  • the first identification sequence and the reordering identification sequence corresponding to the identification "6" form a sub-identification dictionary corresponding to the identification "6", and the sub-identification dictionary corresponding to "6" is shown as G in FIG.
  • the reordering rule may also be to replace the target identifier with the identifier located at the hth position in the first identifier sequence to obtain the reordering identifier sequence corresponding to the target identifier, where h is greater than or equal to 1. And any positive integer less than or equal to N.
  • N reordering identifiers for the N identifiers in the first identifier sequence according to the preset reordering rule and the N identifiers in the first identifier sequence in advance. Sequence, and then respectively establish the corresponding relationship between the N reordering identification sequences and the N identifications in the first identification sequence, where N is the total number of identifications in the first identification sequence.
  • determine the corresponding relationship between the N reordering identifier sequences and the N identifiers, and the m identifiers in the desensitization key determine the corresponding relationship between the N reordering identifier sequences and the N identifiers, and the m identifiers in the desensitization key. Identify the corresponding m reordering identification sequences, and then compose the first identification sequence and the reordering identification sequences corresponding to the m identifications in the desensitization key to form m sub-identification dictionaries.
  • Step 2 According to the preset permutation and combination rules, the m sub-identity dictionaries corresponding to the m identifiers are repeatedly arranged and combined to obtain the identifier dictionary.
  • the identifier dictionary obtained by repeatedly arranging and combining m sub-identity dictionaries includes M sub-identity dictionaries, where M is a positive integer, and M is greater than or equal to m.
  • the i-th sub-identification dictionary in the M sub-identification dictionaries includes a first identification sequence and an i-th identification sequence
  • the i-th identification sequence is the reordering identification sequence corresponding to the identifier corresponding to the i-th sub-identification dictionary
  • i is a positive integer
  • I is greater than or equal to 1 and less than or equal to M.
  • the i-th sub-identity dictionary is the sub-identity dictionary corresponding to the first identifier in the desensitization key
  • the i-th identifier sequence is the reordering identifier sequence corresponding to the first identifier in the desensitization key.
  • the M-th identification sequence in the i-th identification sequence is the second identification sequence.
  • repeatable permutation and combination means that in the process of permuting and combining the m sub-identity dictionaries according to the preset permutation and combination rules, one or more sub-identity dictionaries of the m sub-identity dictionaries can be used multiple times or repeatedly.
  • Permutation and combination with other identification dictionaries in the m sub-identification dictionaries For example, if four sub-identity dictionaries are obtained, namely, sub-identity dictionary 1, sub-identity dictionary 2, sub-identity dictionary 3, and sub-identity dictionary 4, the m sub-identity dictionaries are arranged and combined according to the preset permutation and combination rules. , Use the sub-identification dictionary 1 twice, and perform permutation and combination with the sub-identification dictionary 2, the sub-identification dictionary 3, and the sub-identification dictionary 4 to obtain an identification dictionary containing 5 sub-identification dictionaries.
  • the permutation and combination rule may be: permutation and combination of the sub-identity dictionaries according to the sequence of the identifiers in the desensitization key in the desensitization key, so that the sub-identity dictionaries contained in the permutation and combination of the identifier dictionary
  • the number of identification dictionaries is equal to the number of identifications in the desensitization key
  • the order of the sub-identity dictionaries after permutation and combination in the identification dictionary is equal to the order of the identifications corresponding to each sub-identity dictionary in the desensitization key .
  • the identifiers in the desensitization key are identifier 1, identifier 2, and identifier 3.
  • the order of identifier 1 in the desensitization key is 1, and the order of identifier 2 in the desensitization key is 2.
  • the order in the desensitization key is 3, the sub-identity dictionary corresponding to ID 1 is determined as sub-identity dictionary 1 through step 1, and the sub-identity dictionary corresponding to identifier 2 is determined as sub-identity dictionary 2 through step 1.
  • the sub-identity dictionary corresponding to the identifier 3 is the sub-identity dictionary 3.
  • the identification dictionary obtained by permuting and combining the sub-identity dictionaries according to the above-mentioned preset permutation and combination rules includes the sub-identity dictionary 1, the identification dictionary 2, and the sub-identification dictionary 3.
  • the order of the sub-identity dictionary 1 in the identification dictionary is 1, and the identification The order of dictionary 2 in the identification dictionary is 2, and the order of sub-identity dictionary 3 in the identification dictionary is 3.
  • the permutation and combination rule can also be: permutation and combination of the sub-identity dictionary according to the sequence of the identifiers in the desensitization key in the desensitization key, so that the identifier dictionary obtained by the permutation and combination contains
  • the number of sub-identity dictionaries is equal to twice the number of identifiers in the desensitization key minus one.
  • the order of each sub-identity dictionary in the identifier dictionary is equal to the corresponding identifier of each sub-identity dictionary.
  • the order in the key, or equal to the reverse order of each sub-identity dictionary in the identifier is equal to the identifier corresponding to each sub-identity dictionary.
  • the i-th sub-identity dictionary is a sub-identity dictionary determined according to the j-th identity in the desensitization key, j is a positive integer greater than or equal to 1 and less than or equal to m.
  • the identifiers in the desensitization key are identifier 1, identifier 2, and identifier 3.
  • the order of identifier 1 in the desensitization key is 1, and the order of identifier 2 in the desensitization key is 2.
  • the order in the desensitization key is 3, the sub-identity dictionary corresponding to ID 1 is determined as sub-identity dictionary 1 through step 1, and the sub-identity dictionary corresponding to identifier 2 is determined as sub-identity dictionary 2 through step 1.
  • the sub-identity dictionary corresponding to the identifier 3 is the sub-identity dictionary 3.
  • the identification dictionary obtained by permuting and combining the sub-identity dictionaries according to the above-mentioned permutation and combination rules includes two sub-identity dictionaries 1, two identification dictionaries 2 and one sub-identity dictionary 3, and the order of sub-identity dictionary 1 in the identification dictionary is 1 and 5, the order of identification dictionary 2 in the identification dictionary is 2 and 4, and the order of sub-identification dictionary 3 in the identification dictionary is 3.
  • S104 Determine a second identifier corresponding to the first identifier in the second identifier sequence according to the identifier dictionary.
  • the identification dictionary is composed of a first identification sequence and a second identification sequence, and the specific implementation of the second identification corresponding to the first identification is determined in the second identification sequence according to the identification dictionary It is: determining the identifier corresponding to the first identifier in the second identifier sequence as the second identifier.
  • the identification dictionary is composed of the first identification sequence (identification 1) in B in FIG. 2 and A in FIG. 2, the identification dictionary may be as shown in E in FIG. 2. Assuming that the determined first identifier is 3, the second identifier determined according to E is 1.
  • the identity dictionary is composed of M sub-identity dictionaries
  • the i-th sub-identity dictionary in the M sub-identity dictionaries includes the first identity sequence and the i-th identity sequence
  • the i-th identity sequence For the sequence obtained by reordering the first identification sequence, an identification in the i-th identification sequence corresponds to an identification in the first identification sequence, and the M-th identification sequence is the second identification sequence.
  • the specific process can be: determining the second identifier corresponding to the first identifier in the first identifier sequence according to the first sub identifier dictionary; determining the third identifier corresponding to the second identifier in the second identifier sequence according to the second sub identifier dictionary Identification; ...; Determine the (M+1)th identification corresponding to the Mth identification in the Mth identification sequence according to the Mth sub-identification dictionary.
  • the first identifier is 3
  • the sub-identity dictionaries are shown as E, F, and G in FIG. 2 respectively.
  • the order of the sub-identification dictionary shown in E in the identification dictionary is 1 and 5
  • the order of the sub-identification dictionary shown in F in the identification dictionary is 2 and 4
  • the sub-identification dictionary shown in G is in the identification dictionary
  • the order of is 3, the above process can be as shown in Figure 3.
  • the first sub-identity dictionary in the first identification sequence is the sub-identity shown in E Dictionary
  • the first identification sequence is the identification sequence of identification 2 in the sub-identification dictionary shown in E, that is, the identification sequence corresponding to identification 3 is determined in the identification sequence of identification 2 according to the sub-identification dictionary shown in E, and the identification corresponding to 3 is determined Is 1
  • the second sub-identification dictionary in the second identification sequence corresponding to the third identification of the second identification is the sub-identification dictionary shown in F
  • the second identification sequence is the sub-identification dictionary shown in F Identify the identification sequence of identification 2 in the identification dictionary, that is, determine the identification corresponding to 1 in the identification sequence of identification 2 according to the sub-identification dictionary shown in F, and the corresponding identification of 1 is 6.
  • the 3rd sub ID dictionary is the sub ID dictionary shown in G
  • the first ID sequence is the ID 2 sequence in the sub ID dictionary shown in G, which is based on
  • the sub-identity dictionary shown in G determines the identity corresponding to 6 in the identity sequence of identity 2, and the corresponding identity of 6 is 2.
  • the fourth sub-identity dictionary in the fourth identity sequence the fifth corresponding to the fourth identity is determined.
  • the fourth sub-identification dictionary is the sub-identification dictionary shown in F
  • the fourth identification sequence is the identification sequence of identification 2 in the sub-identification dictionary shown in F, that is, the identification corresponding to 2 is determined according to the identification dictionary shown in F, 2.
  • the corresponding identifier is 7;
  • the sixth identifier corresponding to the fifth identifier, the fifth sub-identity dictionary is the sub-identity dictionary shown in E, and the first identifier sequence is The identifier sequence of identifier 2 in the sub-identity dictionary shown in E, that is, the identifier corresponding to 7 is determined according to the identifier dictionary shown in E, and the identifier corresponding to 7 is 5.
  • S105 Determine the second data corresponding to the second identifier in the data sequence according to the data dictionary.
  • the data dictionary is shown as A in Figure 2, the second identifier determined according to the identifier dictionary is 7, then the data corresponding to the identifier "7" is determined in the data sequence (data) according to the data dictionary, and the identifier "7" is corresponding
  • the data of is determined to be the second data, and the data corresponding to the identifier "7” is 7, then the data "7" is determined to be the desensitization data corresponding to the first data.
  • the identification dictionary can be determined according to the desensitization key, and then according to the reverse mapping process, the desensitized data can be restored, which ensures the reducibility of the desensitized data, that is, the embodiments of the present application can simultaneously take into account the data Security and reducibility of desensitized data.
  • the data of the same type to be desensitized can be desensitized according to the method shown in FIG. 1 above.
  • different desensitization keys can also be used to desensitize different data belonging to the same data unit to be desensitized, and the desensitization secrets corresponding to two adjacent data in the data unit
  • the keys can be related to each other.
  • the data as a whole can refer to a complete set of data that has actual meaning when combined.
  • the data as a whole can be all data corresponding to a name, an ID number, a residential address, a telephone number, a bank account number, or an email address.
  • the data as a whole is all the data corresponding to an ID card number.
  • the data as a whole is a data set containing 18 digits.
  • the entire data may also refer to a collection of all data to be desensitized. For example, if there are 100 data to be desensitized, the entire data may refer to a collection containing these 100 data.
  • the above method may further include the steps of determining the A-th sub-identity dictionary in the identifier dictionary, where the A-th sub-identity dictionary is a sub-identity dictionary determined according to the a-th identifier in the desensitization key, B is the sequence of the first data in the entire data to be desensitized.
  • the data to be desensitized includes at least two data, a and n are both positive integers, and N is equal to the number of identifiers in the first identifier sequence; Determine the third identifier in the A-th identifier sequence according to the A-th sub-identity dictionary.
  • the third identifier is located after the a-th identifier in the A-th identifier sequence; replace the a-th identifier with the first in the desensitization key Three identification; the desensitization key obtained by the replacement is determined as the desensitization key corresponding to the next data of the first data.
  • one of the desensitization keys can be Push other desensitization keys, so that the data can be restored separately and the data can be restored.
  • FIG. 4 is a schematic diagram of the composition structure of a data desensitization device provided by an embodiment of the present application.
  • the device 30 includes:
  • the dictionary key determining module 301 is used to determine a data dictionary and a desensitization key corresponding to the first data, the first data being the data to be desensitized, and the data dictionary including the correspondence between the data sequence and the first identification sequence ,
  • the data sequence includes a plurality of data
  • the first identification sequence includes a plurality of identifications
  • one data in the data sequence corresponds to an identification in the first identification sequence
  • the desensitization key includes at least one The identifier in the first identifier sequence
  • the first identification determining module 302 is configured to determine a first identification corresponding to the first data in the first identification sequence according to the data dictionary;
  • the identification dictionary determination module 303 is configured to determine an identification dictionary according to the desensitization key, the identification dictionary including the corresponding relationship between the first identification sequence and the second identification sequence, and the second identification sequence is based on the desensitization key.
  • a sequence obtained by reordering the first identification sequence with an identifier in the sensitive key, and an identifier in the second identifier sequence corresponds to an identifier in the first identifier sequence;
  • the second identification determining module 304 is configured to determine a second identification corresponding to the first identification in the second identification sequence according to the identification dictionary;
  • the desensitization data determination module 305 is configured to determine the second data corresponding to the second identifier in the data sequence according to the data dictionary, and determine the second data as the desensitization corresponding to the first data. Sensitive data.
  • the desensitization key includes m identifiers
  • the identifier dictionary includes M sub-identity dictionaries
  • the M sub-identity dictionaries are obtained by permutation and combination of m sub-identity dictionaries that can be arranged repeatedly.
  • the m sub-identification dictionaries are sub-identification dictionaries determined according to the m identification dictionaries, m and M are both positive integers, and M is greater than or equal to m;
  • the i-th sub-identification dictionary in the M sub-identification dictionaries includes the corresponding relationship between the first identification sequence and the i-th identification sequence, and the i-th identification sequence is a sequence obtained by reordering the first identification sequence, An identifier in the i-th identifier sequence corresponds to an identifier in the first identifier sequence, the M-th identifier sequence is the second identifier sequence, i is a positive integer, i is greater than or equal to 1 and less than or equal to M;
  • the second identification determining module 303 is specifically configured to:
  • the identification dictionary determining module 303 is specifically used for:
  • the sub-identity dictionaries corresponding to the respective identifiers are respectively arranged and combined repeatedly.
  • the i-th sub-identity dictionary is a sub-identity dictionary determined according to the j-th identifier in the desensitization key
  • j i
  • j is a positive integer
  • j is greater than Or equal to 1 and less than or equal to m.
  • the i-th sub-identity dictionary is a sub-identity dictionary determined according to the j-th identifier in the desensitization key
  • the i-th identification sequence is a sequence obtained by sequentially shifting the first identification sequence
  • the j-th identification is in the i-th sub-identification dictionary Located at the k-th position in the identification sequence, k is any positive integer greater than or equal to 1 and less than or equal to N, and N is equal to the number of identifications in the first identification sequence.
  • the dictionary key determining module 301 is also used to:
  • the A-th sub-identification dictionary is a sub-identification dictionary determined according to the a-th identification in the desensitization key
  • B is the arrangement order of the first data in the entire data to be desensitized, the data as a whole includes at least two data, a and n are both positive integers, and N is equal to the number of identifiers in the first identifier sequence number;
  • the desensitization key obtained by the replacement is determined as the desensitization key corresponding to the next data of the first data.
  • the desensitization key is any account, any number, any identifier, or any number related to the desensitization task corresponding to the first data.
  • the data desensitization device determines the identification dictionary according to the data desensitization key, and then uses the data dictionary and the identification dictionary to map the data multiple times to obtain the desensitized data.
  • the mapping of the identification in the identification dictionary is equivalent to The original mapping sequence of the data dictionary is disrupted, making the mapping have the characteristics of random mapping. Others cannot derive the mapping relationship based on the desensitized data, ensuring the security of the data, because it is through the identification in the data desensitization key
  • the identification dictionary can be determined according to the desensitization key, and then the desensitized data can be restored according to the reverse mapping process, ensuring the reducibility of the desensitized data.
  • FIG. 5 is a schematic diagram of the composition structure of another data desensitization device provided by an embodiment of the present application.
  • the device 40 includes a processor 401, a memory 402, and an input and output interface 403.
  • the processor 401 is connected to the memory 402 and the input/output interface 403.
  • the processor 401 may be connected to the memory 402 and the input/output interface 403 via a bus.
  • the processor 401 is configured to support the data desensitization device to perform corresponding functions in the data desensitization method in the foregoing method embodiment.
  • the processor 401 may be a central processing unit (central processing unit, CPU), a network processor (network processor, NP), a hardware chip, or any combination thereof.
  • the aforementioned hardware chip may be an application specific integrated circuit (appldcatdonspecdfdcdntegratedcdrcudt, ASDC), a programmable logic device (programmable logdcdevdce, PLD) or a combination thereof.
  • the above-mentioned PLD may be a complex programmable logic device (complex programmable logdcdevdce, CPLD), a field programmable logic gate array (fdeld-programmable gate array, FPGA), a general array logic (generdc array logdc, GAL) or any combination thereof.
  • complex programmable logdcdevdce CPLD
  • field programmable logic gate array FPGA
  • general array logic genedc array logdc, GAL
  • the memory 402 is used to store program codes and the like.
  • the memory 402 may include a volatile memory (VM), such as a random access memory (random access memory, RAM); the memory 402 may also include a non-volatile memory (non-volatdle memory, NVM), such as read-only Memory (read-only memory, ROM), flash memory (flash memory), hard disk (hard ddskdrdve, HDD) or solid state disk (sold-state drive, SSD); the memory 402 may also include a combination of the foregoing types of memories.
  • the memory 402 is used for data to be desensitized, a data dictionary, a desensitization key, and the like.
  • the input and output interface 403 is used to input or output data.
  • the processor 401 may call the program code to perform the following operations:
  • the first data is the data to be desensitized.
  • the data dictionary includes a correspondence between a data sequence and a first identification sequence.
  • the data sequence includes a plurality of data.
  • the first identification sequence includes multiple identifications, one identification in the data sequence corresponds to one data in the first identification sequence, and the data desensitization key includes at least one of the first identification sequence Logo
  • An identification dictionary is determined according to the desensitization key, the identification dictionary includes the corresponding relationship between the first identification sequence and the second identification sequence, and the second identification sequence is obtained by reordering the first identification sequence Sequence, an identifier in the second identifier sequence corresponds to an identifier in the first identifier sequence;
  • the second data corresponding to the second identifier in the data sequence is determined according to the data dictionary, and the second data is determined as desensitization data corresponding to the first data.
  • each operation can also refer to the corresponding description of the method embodiment; the processor 401 can also cooperate with the input and output interface 403 to perform other operations in the above method embodiment.
  • the embodiments of the present application also provide a computer non-volatile readable storage medium, the computer non-volatile readable storage medium stores a computer program, the computer program includes program instructions, and the program instructions are executed by a computer.
  • the computer may be a part of the aforementioned data desensitization device.
  • the aforementioned processor 401 For example, the aforementioned processor 401.
  • the program can be stored in a computer readable storage medium. During execution, it may include the procedures of the above-mentioned method embodiments.
  • the storage medium can be a magnetic disk, an optical disk, ROM or RAM, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Medical Informatics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Machine Translation (AREA)

Abstract

一种数据脱敏方法和相关装置,其中,方法包括:确定第一数据对应的数据字典和脱敏密钥,数据字典包括数据序列和第一标识序列的对应关系,数据序列中的数据对应第一标识序列中的标识;根据数据字典确定与第一数据对应的第一标识;根据脱敏密钥确定标识字典,标识字典包括第一标识序列和第二标识序列的对应关系,第二标识序列为对第一标识序列进行重排序得到的序列,第二标识序列中的标识对应第一标识序列中的标识;根据标识字典在第二标识序列中确定与第一标识对应的第二标识;根据数据字典确定与第二标识对应的第二数据,并将第二数据确定为第一数据对应的脱敏数据。该方法可同时兼顾未脱敏数据的安全性和脱敏数据的可还原性。

Description

数据脱敏方法和相关装置
本申请要求于2019年03月28日提交中国专利局、申请号为201910241311X、申请名称为“数据脱敏方法和相关装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及信息安全技术领域,尤其数据脱敏方法和相关装置。
背景技术
数据脱敏,又称数据漂白、数据去隐私化或数据变形,是指对某些敏感信息按照一定规则进行数据的变形,使得数据变换为另一个数据,以实现对敏感隐私数据的可靠保护。在涉及客户安全数据或者一些商业性敏感数据的场景下,在不违反系统规则条件下,在利用真实数据进行改造并提供测试使用时需要对如身份证号、手机号、卡号、客户号等个人信息进行数据脱敏后才能使用。
数据脱敏按脱敏规则划分可分为可恢复脱敏与不可恢复脱敏。其中,可恢复脱敏是指脱敏后的数据通过一定的方式,可以恢复成原来的敏感数据;不可恢复脱敏是指脱敏后的数据被脱敏的部分使用任何方式都不能恢复出。目前,数据脱敏一般是通过建立一个数据字典,然后根据该数据字典进行一定的映射,得到脱敏后的数据。一种方式是根据数据字典随机映射,这种方式即为不可恢复脱敏,但存在的问题在于进行随机脱敏后的数据无法还原为原始数据;另一种方式是根据数据字典按照一定的映射规则进行映射,这种方式为可恢复脱敏,但存在的问题在于映射关系容易被获知的风险,安全性不足。
申请内容
本申请实施例提供数据脱敏方法和相关装置,解决目前的脱敏方法无法兼顾数据还原和数据安全的问题。
第一方面,提供一种数据脱敏方法,包括:
确定第一数据对应的数据字典和脱敏密钥,所述第一数据为待脱敏的数据,所述数据字典包括数据序列和第一标识序列的对应关系,所述数据序列包括多个数据,所述第一标识序列包括多个标识,所述数据序列中的一个标识对应所述第一标识序列中的一个数据,所述数据脱敏密钥包括至少一个所述第一标识序列中的标识;
根据所述数据字典在所述第一标识序列中确定与所述第一数据对应的第一标识;
根据所述脱敏密钥确定标识字典,所述标识字典包括所述第一标识序列和第二标识序列的对应关系,所述第二标识序列为根据所述脱敏密钥中的标识对所述第一标识序列进行重排序得到的序列,所述第二标识序列中的一个标识对应所述第一标识序列中的一个标识;
根据所述标识字典在所述第二标识序列中确定与所述第一标识对应的第二标识;
根据所述数据字典确定在所述数据序列中与所述第二标识对应的第二数据,并将所述第二数据确定为所述第一数据对应的脱敏数据。
第二方面,提供一种数据脱敏装置,包括:
字典密钥确定模块,用于确定第一数据对应的数据字典和脱敏密钥,所述第一数据为待脱敏的数据,所述数据字典包括数据序列和第一标识序列的对应关系,所述数据序列包括多个数据,所述第一标识序列包括多个标识,所述数据序列中的一个数据对应所述第一标识序列中的一个标识,所述脱敏密钥包括至少一个所述第一标识序列中的标识;
第一标识确定模块,用于根据所述数据字典确定在所述第一标识序列中确定与所述第一数据对应的第一标识;
标识字典确定模块,用于根据所述脱敏密钥确定标识字典,所述标识字典包括所述第一标识序列和第二标识序列的对应关系,所述第二标识序列为根据所述脱敏密钥中的标识对所述第一标识序列进行重排序得到的序列,所述第二标识序列中的一个标识对应所述第一标识序列中的一个标识;
第二标识确定模块,用于根据所述标识字典在所述第二标识序列中确定与所述第一标识对应的第二标识;
脱敏数据确定模块,用于根据所述数据字典在所述数据序列中确定与所述第二标识对应的第二数据,并将所述第二数据确定为所述第一数据对应的脱敏数据。
第三方面,提供另一种数据脱敏装置,包括处理器、存储器以及输入输出接口,所述处理器、存储器和输入输出接口相互连接,其中,所述输入输出接口用于输入或输出数据,所述存储器用于存储数据脱敏装置执行上述方法的应用程序代码,所述处理器被配置用于执行上述第一方面的方法。
第四方面,提供一种计算机非易失性可读存储介质,所述计算机非易失性可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行上述第一方面的方法。
通过本申请实施例可以同时兼顾数据的安全性和脱敏数据的可还原性。
附图说明
图1是本申请实施例提供的一种数据脱敏方法的流程示意图;
图2是本申请实施例提供的一种数据与标识的变换的示意图;
图3是本申请实施例提供的一种映射示意图;
图4是本申请实施例提供的一种数据脱敏装置的组成结构示意图;
图5是本申请实施例提供的另一种数据脱敏装置的组成结构示意图。
具体实施方式
下面将结合图1至图5,对本申请实施例提供的数据脱敏方法和相关装置进行说明。
本申请实施例的方案可以应用于金融公司、政府单位、医院、银行等各个行业中需要利用敏感数据进行数据挖掘、数据分析等使用敏感数据的场景中。在这些场景中,在利用敏感数据进行数据挖掘或数据分析之前,需要对这些敏感数据进行数据脱敏,以防止敏感数据泄露。例如,本申请实施例的方案具体可应用于社保数据中心需要将社保数据提供给外包开发人员进行社保系统的开发和测试,在这种场景下,需要将社保数据进行数据脱敏后提供给外包开发人员。又如,本申请实施例的方案具体还可应用于运营商将客户信息、通话记录等业务数据提供给如监察机构、公安机关、政府部门等不同身份的访问者,运营 商需要根据不同身份的用户配置不同的数据脱敏规则以满足其不同的需求。本申请实施例中,敏感数据包括但不限于姓名、身份证号码、居住地址、电话号码、银行账号、邮箱地址、所属城市、邮编、各种密码(如账户查询密码、取款密码、登录密码等)、组织机构名称、营业执照号码、银行账号、交易日期、交易金额等于用户主体或用户主体的行为有关的数据。
以下介绍申请实施例的技术方案。
参见图1,图1是本申请实施例提供的一种数据脱敏方法的流程示意图,如图所示,该方法包括如下步骤:
S101,确定第一数据对应的数据字典和脱敏密钥,第一数据为待脱敏的数据,数据字典包括数据序列和第一标识序列,数据序列包括多个数据,第一标识序列包括多个标识,数据序列中的一个数据对应第一标识序列中的一个标识。
这里,第一数据对应的数据字典为与第一数据所属的类型或类别相对应的数据字典,数据序列包括该第一数据所属的类型或类别对应的所有可能的数据。其中,第一数据所属的类型或类别具体是指当前待脱敏的数据具体是什么类型或类别的数据。例如,当前待脱敏的数据为身份证号码,则第一数据所属的类型或类别为身份证号码,数据序列包括身份证号码对应的所有可能的数据,即第一数据字典包括0至9中的每一个数字以及X。又如,当前待脱敏的数据为邮箱地址,则第一数据所属的类型或类别为邮箱地址,数据序列包括邮箱地址对应的所有可能的数据,即数据序列包括0至9中的每一个数字、A至Z和a至z中的每一个英文字母以及邮箱地址可能用到的其他字符,如“.”、“/”等字符。
这里,第一标识序列为根据第一数据序列中的数据的个数和类型所设置的个数与该数据序列中的数据的个数相同的,并且,类型与第一数据序列中的数据的类型相同或不同的标识的组合。例如,数据序列包括身份证号码对应的所有可能的数据,即第一数据字典包括0至9中的每一个数字以及X,则第一标识序列可以为由英文字母a至k组成的序列,第一标识序列也可以为数字0至9以及X组成的序列。本申请实施例中,第一标识序列中的标识可以包括与脱敏任务相关的和/或与脱敏操作人员相关的所有的可能的标识。例如,第一标识序列中的标识包括脱敏任务的任务号对应的所有可能的标识,假设脱敏任务的任务号由0至9中的任一数字以及A和B两个字母组成,则第一标识序列中的标识可以包括0至9中的每一个数字以及A和B两个字母。又如,第一标识序列中的标识也包括脱敏操作人员的工号对应的所有可能的标识,假设脱敏操作人员的工号由0至9中的任一数字组成,则第一标识序列中的标识可以包括0至9中的每一个数字。又如,第一标识序列中的标识序列包括脱敏任务的任务号对应的所有可能的标识和脱敏操作人员的工号对应的所有可能的标识,假设脱敏任务的任务号由0至9中的任一数字以及A和B两个字母组成,脱敏操作人员的工号由0至9中的任一数字组成,则第一标识序列中的数据标识可以包括0至9中的每一个数据以及A和B两个字母。不限于这里的描述。
这里,脱敏密钥由第一标识序列中的至少一个标识组成。在一种可能的实施方式中,该脱敏密钥可以为与脱敏任务相关的某一个账号或者号码或者标识或编号。例如,脱敏密钥可以为脱敏任务的任务号,或者,脱敏密钥可以为执行当前脱敏任务的脱敏操作人员的工号、脱敏编号,或者,第一脱敏密钥可以为脱敏任务的任务号与执行当前脱敏任务的脱 敏操作人员的工号、脱敏编号。
以下举例来对第一数据、第一数据对应的数据字典和脱敏密钥进行说明。例如,当前执行的脱敏任务为对用户的电话号码进行数据脱敏,脱敏任务的编号为0x001,当前执行脱敏任务的脱敏操作人员的工号为bj856,脱敏任务编号的格式为“0x+数字编号”,脱敏操作人员的工号格式为“bj+数字编号”,电话号码由数字组成,则第一数据为用户的电话号码中的一个数据,第一数据对应的数据字典中如图2中的A所示,其中,图2中A的左边一列(数据)为数据序列,第一数据序列由电话号码所有可能的数字组成,右边一列(标识1)为第一标识序列,第一标识序列由脱敏任务编号中的数字编号的所有可能的数字或者脱敏操作人员的工号中的数字编号的所有可能的数字组成。第一脱敏密钥可以为“001”或“856”,当第一脱敏密钥为“001”时,第一脱敏密钥与脱敏任务的脱敏任务编号相关,第一脱敏密钥可以用于表示脱敏任务的任务编号;当第一脱敏密钥为“856”时,第一脱敏密钥与当前执行脱敏任务的脱敏操作人员的工号相关,其第一脱敏密钥可以用于表示当前执行脱敏任务的脱敏操作人员的工号。
具体实现中,可以针对脱敏场景中涉及的数据类别预设一个或多个数据字典,使得该一个或多个数据字典中的第一数据序列中的数据能够涵盖该数据类别可能存在的所有数据,并保存数据类别与数据字典之间的对应关系。在进行数据脱敏时,可根据第一数据所属的类别或类型确定与第一数据对应的数据字典,然后根据该第一数据在当前待脱敏的所有数据中的排列顺序确定第一数据对应的第一脱敏密钥。
S102,根据数据字典在第一标识序列中确定与第一数据对应的第一标识。
例如,数据字典如图2中的A所示,第一数据为3,可根据数据字典确定在第一标识序列(标识1)中确定3为与数据“3”对应的第一标识。
S103,根据脱敏密钥确定标识字典,标识字典包括第一标识序列和第二标识序列的对应关系,第二标识序列为根据脱敏密钥中的标识对第一标识序列进行重排序得到的序列,第二标识序列中的一个标识对应第一标识序列中的一个标识。
这里,对第一标识序列中的标识进行重排序是指将第一标识序列中的标识在第一标识序列中的顺序进行变化和调整,使得这些标识在变化后的标识序列中的排列顺序与在第一标识序列中的排列顺序不同,即对第一标识序列进行重排序得到的序列中包含的标识与第一标识序列中包含的标识的内容和个数相同,标识在对第一标识序列进行重排序得到的序列中的顺序和标识在第一标识序列中的顺序不同。
例如,第一标识序列如图2中的A的右边一列所示,则对第一标识序列中的标识进行重排序后的标识序列可以如图2中的B所示。对比图2中的B和A可知,B中的标识的排列顺序相对于A中的标识的排列顺序发生了变化。
本申请实施例中,标识字典可以由脱敏密钥对应的一个或多个子标识字典组成,脱敏密钥对应的子标识字典的个数可以与脱敏密钥包含的标识的个数有关。以下具体介绍根据脱敏密钥确定标识字典的方式。
根据脱敏密钥确定标识字典可以分为以下两个步骤:
步骤一、确定脱敏密钥中的各个标识对应的子标识字典。以脱敏密钥包括m个标识为例,m为正整数,m大于或等于1。由于脱敏密钥包括m个标识,则根据脱敏密钥中的m 个标识确定的子标识字典有m个,即首先确定m个标识各自对应的m个子标识字典。
在一种可行的实施方式中,可以根据预设的重排序规则和脱敏密钥中的m个标识分别对第一标识序列进行重排序,得到脱敏密钥中的m个标识各自对应的m个重排序标识序列,然后将第一标识序列分别与脱敏密钥中的m个标识各自对应的m个重排序标识序列组成脱敏密钥中的m个标识各自对应的m个子标识字典。
具体地,预设的重排序规则可以有多种。在一种具体实现方式中,预设的重排序规则可以为对第一标识序列进行按顺序移位,使得目标标识在移位得到的重排序标识序列中处于第k位,k为大于或等于1并且小于或等于N的任一正整数,N为第一标识序列中标识的个数。这里,目标标识是要确定与其相对应的重排序标识序列的标识。
举例进行说明,例如,脱敏密钥为856,第一标识序列如图2中的A的右边一列数据所示,则根据预设的重排序规则和脱敏密钥中的m个标识分别对第一标识序列进行重排序,得到脱敏密钥中的m个标识各自对应的m个重排序标识序列的过程如下:
1、将第一标识序列中的标识进行按顺序移位,使得脱敏密钥中的标识“8”在移位后的序列中位于第1位,移位后的序列如图2中的B所示,图2中的B所示的序列即为标识“8”对应的重排序标识序列。
2、将第一标识序列中的标识进行按顺序移位,使得脱敏密钥中的标识“5”在移位后的序列中位于第1位,移位后的序列如图2中的C所示,图2中的C所示的序列即为标识“5”对应的重排序标识序列。
3、将第一标识序列中的标识进行按顺序移位,使得脱敏密钥中的标识“6”在移位后的序列中位于第1位,移位后的序列如图2中的D所示,图2中的D所示的序列即为标识“6”对应的重排序标识序列。
进一步地,将第一标识序列分别与脱敏密钥中的m个标识各自对应的m个重排序标识序列组成脱敏密钥中的m个标识各自对应的m个子标识字典的过程可以如下:
1、将第一标识序列与标识“8”对应的重排序标识序列组成标识“8”对应的子标识字典,“8”对应的子标识字典如图2中的E所示。
2、将第一标识序列与标识“5”对应的重排序标识序列组成标识“5”对应的子标识字典,“5”对应的子标识字典如图2中的F所示。
3、将第一标识序列与标识“6”对应的重排序标识序列组成标识“6”对应的子标识字典,“6”对应的子标识字典如图2中的G所示。
在另一种具体实现方式中,重排序规则还可以为在第一标识序列中将目标标识与位于第h位的标识进行替换,得到目标标识对应的重排序标识序列,h为大于或等于1并且小于或等于N的任一正整数。
在另一种可行的实施方式中,也可以事先根据预设的重排序规则和第一标识序列中的N个标识为第一标识序列中的N个标识设置与其相对应的N个重排序标识序列,然后分别建立N个重排序标识序列与第一标识序列中的N个标识之间的对应关系,其中,N为第一标识序列中的标识的总个数。在根据脱敏密钥确定标识字典时,根据N个重排序标识序列与N个标识之间的对应关系,以及,脱敏密钥中的m个标识,确定与脱敏密钥中的m个标识相对应的m个重排序标识序列,然后将第一标识序列分别与脱敏密钥中的m个标识对 应的重排序标识序列组成m个子标识字典。
步骤二、按照预设的排列组合规则将m个标识各自对应的m个子标识字典进行可重复性地排列和组合,以得到标识字典。将m个子标识字典进行可重复性地排列和组合所得到的标识字典包括M个子标识字典,M为正整数,M大于或等于m。该M个子标识字典中的第i个子标识字典包括第一标识序列和第i标识序列,该第i标识序列为该第i个子标识字典对应的标识所对应的重排序标识序列,i为正整数,i大于或等于1并且小于或等于M。例如,第i个子标识字典为脱敏密钥中的第1个标识对应的子标识字典,则第i标识序列为脱敏密钥中的第1个标识对应的重排序标识序列。其中,第i标识序列中的第M标识序列为第二标识序列。
这里,可重复性地排列和组合,是指在按照预设的排列组合规则对m个子标识字典进行排列组合的过程中,可多次或重复使用m个子标识字典中的一个或多个子标识字典与m个子标识字典中的其他标识字典进行排列组合。例如,得到4个子标识字典,分别为子标识字典1、子标识字典2、子标识字典3以及子标识字典4,则在按照预设的排列组合规则对m个子标识字典进行排列组合的过程中,使用子标识字典1两次,与子标识字典2、子标识字典3以及子标识字典4进行排列组合,以此得到包含5个子标识字典的标识字典。
具体地,预设的排列组合规则可以有多种。在一种可能的实施方式中,排列组合规则可以为:按脱敏密钥中的标识在脱敏密钥中的排列顺序对子标识字典进行排列组合,使得排列组合得到的标识字典包含的子标识字典的个数等于脱敏密钥中的标识的个数,以及,进行排列组合后的各个子标识字典在标识字典中的顺序等于各个子标识字典对应的标识在脱敏密钥中的顺序。即使得M=m,以及第i个子标识字典为根据脱敏密钥中的第j个标识确定的子标识字典,j=i,j为大于或等于1并且小于或等于m的正整数。
举例来进行说明,例如,脱敏密钥中的标识分别为标识1、标识2、标识3,标识1在脱敏密钥中的顺序为1,标识2在脱敏密钥中的顺序为2,在脱敏密钥中的顺序为3,通过步骤一确定标识1对应的子标识字典为子标识字典1,通过步骤一确定标识2对应的子标识字典为子标识字典2,通过步骤一确定标识3对应的子标识字典为子标识字典3。按照上述预设的排列组合规则将子标识字典进行排列组合得到的标识字典包括子标识字典1、标识字典2以及子标识字典3,并且,子标识字典1在标识字典中的顺序为1,标识字典2在标识字典中的顺序为2,,子标识字典3在标识字典中的顺序为3。
在另一种可能的实施方式中,排列组合规则还可以为:按脱敏密钥中的标识在脱敏密钥中的排列顺序对子标识字典进行排列组合,使得排列组合得到的标识字典包含的子标识字典的个数等于脱敏密钥中的标识的个数的两倍减一,进行排列组合后的各个子标识字典在标识字典中的顺序等于各个子标识字典对应的标识在脱敏密钥中的顺序,或者,等于各个子标识字典在标识中的逆向顺序等于各个子标识字典对应的标识。即使得M=2m-1,第i个子标识字典为根据脱敏密钥中的第j个标识确定的子标识字典,
Figure PCTCN2019102746-appb-000001
j为大于或等于1并且小于或等于m的正整数。
举例来进行说明,例如,脱敏密钥中的标识分别为标识1、标识2、标识3,标识1在脱敏密钥中的顺序为1,标识2在脱敏密钥中的顺序为2,在脱敏密钥中的顺序为3,通过 步骤一确定标识1对应的子标识字典为子标识字典1,通过步骤一确定标识2对应的子标识字典为子标识字典2,通过步骤一确定标识3对应的子标识字典为子标识字典3。那么,按照上述排列组合规则将子标识字典进行排列组合得到的标识字典包括2个子标识字典1、2个标识字典2以及1个子标识字典3,并且,子标识字典1在标识字典中的顺序为1和5,标识字典2在标识字典中的顺序为2和4,子标识字典3在标识字典中的顺序为3。
不限于上述两种排列组合规则,在可选实施方式中,还可以有其他的排列组合规则,本申请实施例不做限制。
S104,根据标识字典在第二标识序列中确定与第一标识对应的第二标识。
这里,在脱敏密钥包括一个标识的情况下,标识字典由第一标识序列和第二标识序列组成,根据标识字典在第二标识序列中确定第一标识对应的第二标识的具体实现方式为:将第二标识序列中与第一标识对应的标识确定为第二标识。
举例来说明,例如,标识字典由图2中B和图2中的A中的第一标识序列(标识1)组成,则标识字典可以如图2中的E所示。假设确定的第一标识为3,则根据E确定的第二标识为1。
这里,在脱敏密钥包括多个标识的情况下,标识字典由M个子标识字典组成,M个子标识字典中的第i个子标识字典包括第一标识序列和第i标识序列,第i标识序列为对第一标识序列进行重排序得到的序列,第i标识序列中的一个标识对应第一标识序列中的一个标识,第M标识序列为第二标识序列。根据标识字典在第二标识序列中确定第一标识对应的第二标识的具体实现方式为:根据第i个子标识字典在第i标识序列中确定与第i标识对应的第(i+1)标识,其中,当i=1时,第i标识为第一标识,将第M标识序列中的第(M+1)标识确定为第二标识。其具体过程可以为:根据第1个子标识字典在第1标识序列中确定与第一标识对应的第2标识;根据第2个子标识字典在第2标识序列中确定与第2标识对应的第3标识;……;根据第M个子标识字典在第M标识序列中确定与第M标识对应的第(M+1)标识。
举例来进行说明,M=5,第一标识为3,子标识字典分别如图2中的E、F、G所示。其中,E所示的子标识字典在标识字典中的顺序为1和5,F所示的子标识字典在标识字典中的顺序为2和4,G所示的子标识字典的在标识字典中的顺序为3,则上述过程可以如图3所示,首先根据第1个子标识字典在第1标识序列中与第一标识对应的第2标识,第1个子标识字典为E所示的子标识字典,第1标识序列为E所示的子标识字典中标识2这一标识序列,即根据E所示的子标识字典确定在标识2这一标识序列中确定3对应的标识,3对应的标识为1;然后根据第2个子标识字典在第2标识序列中与第2标识对应的第3标识,第2个子标识字典为F所示的子标识字典,第2标识序列为F所示的子标识字典中标识2这一标识序列,即根据F所示的子标识字典在标识2这一标识序列中确定1对应的标识,1对应的标识为6;接着,根据第3个子标识字典在第3标识序列中与第3标识对应的第4标识,第3个子标识字典为G所示的子标识字典,第1标识序列为G所示的子标识字典中标识2这一标识序列,即根据G所示的子标识字典在标识2这一标识序列中确定6对 应的标识,6对应的标识为2;接着,根据第4个子标识字典在第4标识序列中与第4标识对应的第5标识,第4个子标识字典为F所示的子标识字典,第4标识序列为F所示的子标识字典中标识2这一标识序列,即根据F所示的标识字典确定2对应的标识,2对应的标识为7;最后,根据第5个子标识字典在第5标识序列中与第5标识对应的第6标识,第5个子标识字典为E所示的子标识字典,第1标识序列为E所示的子标识字典中标识2这一标识序列,即根据E所示的标识字典确定7对应的标识,7对应的标识为5。
S105,根据数据字典在数据序列中确定与第二标识对应的第二数据。
例如,数据字典如图2中的A所示,根据标识字典确定的第二标识为7,则根据数据字典在数据序列(数据)中确定标识“7”对应的数据,将标识“7”对应的数据确定为第二数据,标识“7”对应的数据为7,则将数据“7”确定为第一数据对应的脱敏数据。
结合图2和图3可知,通过上述方案,将数据3变换成了数据7,实现了对数据的脱敏。在上述方案中,根据数据脱敏密钥确定标识字典,然后利用数据字典和标识字典对数据进行多次映射得到脱敏后的数据,在标识字典中对标识的映射相当于打乱了数据字典原始的映射顺序,使得映射具备随机映射的特性,其他人根据脱敏后的数据无法推导出映射关系,保证了数据的安全性,由于是通过数据脱敏密钥中的标识得到标识字典,那么根据脱敏密钥可确定标识字典,然后根据逆向的映射过程,可以对脱敏后的数据进行还原,保证了脱敏后的数据的可还原性,即,本申请实施例可同时兼顾数据的安全性和脱敏数据的可还原性。
在一种可行的实施方式中,可以对待脱敏的属于同一类型的数据均按上述图1所示的方法进行数据脱敏。
在另一种可行的实施方式中,也可以采用不同的脱敏密钥对待脱敏的属于同一数据整体的不同数据进行数据脱敏,数据整体中的两个相邻数据所对应的脱敏密钥之间可以相互关联。其中,数据整体可以是指完整的组合起来拥有实际含义的数据的集合。具体地,数据整体可以为一个姓名、一个身份证号码、一个居住地址、一个电话号码、一个银行账号或一个邮箱地址等对应的所有数据。例如,数据整体为一个身份证号码对应的所有数据,对于中国大陆的身份证号码来说,该数据整体为一个包含18位数字的数据集合。可选地,数据整体也可以是指待脱敏的所有数据的集合,例如,待脱敏的数据一共有100个,那么数据整体可以是指包含了这100个数据的集合。
可选地,上述方法还可以包括如下步骤,确定标识字典中的第A个子标识字典,第A个子标识字典为根据脱敏密钥中的第a个标识确定的子标识字典,
Figure PCTCN2019102746-appb-000002
B为第一数据在待脱敏的数据整体中的排列顺序,待脱敏的数据整体包括至少两个数据,a和n均为正整数,N等于第一标识序列中的标识的个数;根据第A个子标识字典确定第A标识序列中的第三标识,第三标识在第A标识序列中位于 第a个标识的后一位;在脱敏密钥中将第a个标识替换为第三标识;将替换得到的脱敏密钥确定为第一数据的下一个数据对应的脱敏密钥。
举例来进行说明,例如,待脱敏的数据整体为一个身份证号码对应的所有数据的集合,那么数据字典的第一数据序列包括0至9以及X这11个数据,即N=11,假设待脱敏的数据整体为500310111111111111,第一数据为3,数据脱敏密钥为856,3在待脱敏的数据整体中的排列顺序为4,则确定B=4,m=3,N*m为33,B不为N*m的整数倍,
Figure PCTCN2019102746-appb-000003
那么在标识字典中确定根据脱敏密钥中的第1个标识确定的子标识字典,即确定标识“8”对应的子标识字典,假设标识8对应的标识字典为如图2中的E所示,图2中的E所示的第二标识序列(标识2)中排列在8下一位的为9,则将9确定为第三标识,然后在第一脱敏密钥中将8替换为9,替换得到的脱敏密钥为956,将956确定为3的下一个数据“1”对应的脱敏密钥。
针对同一个数据整体中的不同数据,采用不同的脱敏密钥,可进一步保证数据的安全性,同时根据相邻数据对应的脱敏密钥之间的联系,根据其中一个脱敏密钥可推得其他的脱敏密钥,从而可以分别对数据进行还原,也能保证数据的可还原性。
上面介绍了申请实施例的方法,下面介绍申请实施例的装置。
参见图4,图4是本申请实施例提供的一种数据脱敏装置的组成结构示意图,该装置30包括:
字典密钥确定模块301,用于确定第一数据对应的数据字典和脱敏密钥,所述第一数据为待脱敏的数据,所述数据字典包括数据序列和第一标识序列的对应关系,所述数据序列包括多个数据,所述第一标识序列包括多个标识,所述数据序列中的一个数据对应所述第一标识序列中的一个标识,所述脱敏密钥包括至少一个所述第一标识序列中的标识;
第一标识确定模块302,用于根据所述数据字典确定在所述第一标识序列中确定与所述第一数据对应的第一标识;
标识字典确定模块303,用于根据所述脱敏密钥确定标识字典,所述标识字典包括所述第一标识序列和第二标识序列的对应关系,所述第二标识序列为根据所述脱敏密钥中的标识对所述第一标识序列进行重排序得到的序列,所述第二标识序列中的一个标识对应所述第一标识序列中的一个标识;
第二标识确定模块304,用于根据所述标识字典在所述第二标识序列中确定与所述第一标识对应的第二标识;
脱敏数据确定模块305,用于根据所述数据字典在所述数据序列中确定与所述第二标识对应的第二数据,并将所述第二数据确定为所述第一数据对应的脱敏数据。
在一种可能的设计中,所述脱敏密钥包括m个标识,所述标识字典包括M个子标识字典,所述M个子标识字典由可重复排列的m个子标识字典排列组合得到,所述m个子标识字典为根据所述m个标识字典确定的子标识字典,m、M均为正整数,M大于或等于m;
所述M个子标识字典中的第i个子标识字典包括所述第一标识序列和第i标识序列的 对应关系,所述第i标识序列为对所述第一标识序列进行重排序得到的序列,所述第i标识序列中的一个标识对应所述第一标识序列中的一个标识,第M标识序列为所述第二标识序列,i为正整数,i大于或等于1并且小于或等于M;
第二标识确定模块303具体用于:
根据所述第i个子标识字典在所述第i标识序列中确定与所述第i标识对应的第(i+1)标识,其中,当i=1时,所述第i标识为所述第一标识;
将第M标识序列中的第M标识确定为所述第二标识。
在一种可能的设计中,所述标识字典确定模块303,具体用于:
确定所述脱敏密钥中的各个标识对应的子标识字典;
按照预设的排列组合规则,分别将所述各个标识各自对应的子标识字典进行可重复性地排列和组合。
在一种可能的设计中,M=m,所述第i个子标识字典为根据所述脱敏密钥中的第j个标识确定的子标识字典,j=i,j为正整数,j大于或等于1并且小于或等于m。
在一种可能的设计中,M=2m-1,所述第i个子标识字典为根据所述脱敏密钥中的第j个标识确定的子标识字典,
Figure PCTCN2019102746-appb-000004
在一种可能的设计中,所述第i标识序列为对所述第一标识序列进行按顺序移位得到的序列,并且,所述第j个标识在所述第i个子标识字典的第i标识序列中位于第k位,k为大于或等于1并且小于或等于N的任一正整数,N等于所述第一标识序列中的标识的个数。
在一种可能的设计中,该字典密钥确定模块301还用于:
确定所述标识字典中的第A个子标识字典,所述第A个子标识字典为根据所述脱敏密钥中的第a个标识确定的子标识字典,
Figure PCTCN2019102746-appb-000005
B为所述第一数据在待脱敏的数据整体中的排列顺序,所述数据整体包括至少两个数据,a和n均为正整数,N等于所述第一标识序列中的标识的个数;
根据所述第A个子标识字典确定第A标识序列中的第三标识,所述第三标识在所述第A标识序列中位于所述第a个标识的后一位;
在所述脱敏密钥中将所述第a个标识替换为所述第三标识;
将替换得到的脱敏密钥确定为所述第一数据的下一个数据对应的脱敏密钥。
在一种可能的设计中,所述脱敏密钥为与所述第一数据对应的脱敏任务相关的任意一个账号、任意一个号码、任意一个标识或者任意一个编号。
需要说明的是,图4对应的实施例中未提及的内容可参见方法实施例的描述,这里不再赘述。
本申请实施例中,数据脱敏装置根据数据脱敏密钥确定标识字典,然后利用数据字典 和标识字典对数据进行多次映射得到脱敏后的数据,在标识字典中对标识的映射相当于打乱了数据字典原始的映射顺序,使得映射具备随机映射的特性,其他人根据脱敏后的数据无法推导出映射关系,保证了数据的安全性,由于是通过数据脱敏密钥中的标识得到标识字典,那么根据脱敏密钥可确定标识字典,然后根据逆向的映射过程,可以对脱敏后的数据进行还原,保证了脱敏后的数据的可还原性。
参见图5,图5是本申请实施例提供的另一种数据脱敏装置的组成结构示意图,该装置40包括处理器401、存储器402以及输入输出接口403。处理器401连接到存储器402和输入输出接口403,例如处理器401可以通过总线连接到存储器402和输入输出接口403。
处理器401被配置为支持数据脱敏装置执行前述方法实施例中的数据脱敏方法中相应的功能。该处理器401可以是中央处理器(central processdngundt,CPU),网络处理器(network processor,NP),硬件芯片或者其任意组合。上述硬件芯片可以是专用集成电路(appldcatdonspecdfdcdntegratedcdrcudt,ASDC),可编程逻辑器件(programmable logdcdevdce,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logdcdevdce,CPLD),现场可编程逻辑门阵列(fdeld-programmable gate array,FPGA),通用阵列逻辑(generdc array logdc,GAL)或其任意组合。
存储器402存储器用于存储程序代码等。存储器402可以包括易失性存储器(volatdle memory,VM),例如随机存取存储器(random access memory,RAM);存储器402也可以包括非易失性存储器(non-volatdle memory,NVM),例如只读存储器(read-only memory,ROM),快闪存储器(flash memory),硬盘(hard ddskdrdve,HDD)或固态硬盘(soldd-state drdve,SSD);存储器402还可以包括上述种类的存储器的组合。本申请实施例中,存储器402用于待脱敏的数据、数据字典、脱敏密钥等。
所述输入输出接口403用于输入或输出数据。
处理器401可以调用所述程序代码以执行以下操作:
确定第一数据对应的数据字典和脱敏密钥,所述第一数据为待脱敏的数据,所述数据字典包括数据序列和第一标识序列的对应关系,所述数据序列包括多个数据,所述第一标识序列包括多个标识,所述数据序列中的一个标识对应所述第一标识序列中的一个数据,所述数据脱敏密钥包括至少一个所述第一标识序列中的标识;
根据所述数据字典在所述第一标识序列中确定与所述第一数据对应的第一标识;
根据所述脱敏密钥确定标识字典,所述标识字典包括所述第一标识序列和第二标识序列的对应关系,所述第二标识序列为对所述第一标识序列进行重排序得到的序列,所述第二标识序列中的一个标识对应所述第一标识序列中的一个标识;
根据所述标识字典在所述第二标识序列中确定与所述第一标识对应的第二标识;
根据所述数据字典确定在所述数据序列中与所述第二标识对应的第二数据,并将所述第二数据确定为所述第一数据对应的脱敏数据。
需要说明的是,各个操作的实现还可以对应参照方法实施例的相应描述;所述处理器401还可以与输入输出接口403配合执行上述方法实施例中的其他操作。
本申请实施例还提供一种计算机非易失性可读存储介质,所述计算机非易失性可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被计算机执行时使所述计算机执行如前述实施例所述的方法,所述计算机可以为上述提到的数据脱敏装置的一部分。例如为上述的处理器401。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、ROM或RAM等。
以上所揭露的仅为本申请较佳实施例而已,当然不能以此来限定本申请之权利范围,因此依本申请权利要求所作的等同变化,仍属本申请所涵盖的范围。

Claims (20)

  1. 一种数据脱敏方法,其特征在于,包括:
    确定第一数据对应的数据字典和脱敏密钥,所述第一数据为待脱敏的数据,所述数据字典包括数据序列和第一标识序列的对应关系,所述数据序列包括多个数据,所述第一标识序列包括多个标识,所述数据序列中的一个数据对应所述第一标识序列中的一个标识,所述脱敏密钥包括至少一个所述第一标识序列中的标识;
    根据所述数据字典在所述第一标识序列中确定与所述第一数据对应的第一标识;
    根据所述脱敏密钥确定标识字典,所述标识字典包括所述第一标识序列和第二标识序列的对应关系,所述第二标识序列为根据所述脱敏密钥中的标识对所述第一标识序列进行重排序得到的序列,所述第二标识序列中的一个标识对应所述第一标识序列中的一个标识;
    根据所述标识字典在所述第二标识序列中确定与所述第一标识对应的第二标识;
    根据所述数据字典在所述数据序列中确定与所述第二标识对应的第二数据,并将所述第二数据确定为所述第一数据对应的脱敏数据。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述脱敏密钥确定标识字典包括:
    确定所述脱敏密钥中的各个标识对应的子标识字典;
    按照预设的排列组合规则,分别将所述各个标识各自对应的子标识字典进行可重复性地排列和组合。
  3. 根据权利要求1~2任一所述的方法,其特征在于,所述脱敏密钥包括m个标识,所述标识字典包括M个子标识字典,所述M个子标识字典由可重复排列的m个子标识字典排列组合得到,所述m个子标识字典为根据所述m个标识确定的子标识字典,m、M均为正整数,M大于或等于m;
    所述M个子标识字典中的第i个子标识字典包括所述第一标识序列和第i标识序列的对应关系,所述第i标识序列为对所述第一标识序列进行重排序得到的序列,所述第i标识序列中的一个标识对应所述第一标识序列中的一个标识,第M标识序列为所述第二标识序列,i为正整数,i大于或等于1并且小于或等于M;
    所述根据所述标识字典在所述第二标识序列中确定与所述第一标识对应的第二标识,包括:
    根据所述第i个子标识字典在所述第i标识序列中确定与第i标识对应的第(i+1)标识,其中,当i=1时,所述第i标识为所述第一标识;
    将第M标识序列中的第(M+1)标识确定为所述第二标识。
  4. 根据权利要求3所述的方法,其特征在于,
    M=m,所述第i个子标识字典为根据所述脱敏密钥中的第j个标识确定的子标识字典,j=i,j为正整数,j大于或等于1并且小于或等于m。
  5. 根据权利要求3所述的方法,其特征在于:
    M=2m-1,所述第i个子标识字典为根据所述脱敏密钥中的第j个标识确定的子标识字 典,
    Figure PCTCN2019102746-appb-100001
  6. 根据权利要求4或5所述的方法,其特征在于,所述第i标识序列为对所述第一标识序列进行按顺序移位得到的序列,并且,所述第j个标识在所述第i个子标识字典的第i标识序列中位于第k位,k为大于或等于1并且小于或等于N的任一正整数,N等于所述第一标识序列中的标识的个数。
  7. 根据权利要求2-6任一项所述的方法,其特征在于,所述确定第一数据对应的数据字典和脱敏密钥之后,包括:
    确定所述标识字典中的第A个子标识字典,所述第A个子标识字典为根据所述脱敏密钥中的第a个标识确定的子标识字典,
    Figure PCTCN2019102746-appb-100002
    B为所述第一数据在待脱敏的数据整体中的排列顺序,所述数据整体包括至少两个数据,a和n均为正整数,N等于所述第一标识序列中的标识的个数;
    根据所述第A个子标识字典确定第A标识序列中的第三标识,所述第三标识在所述第A标识序列中位于所述第a个标识的后一位;
    在所述脱敏密钥中将所述第a个标识替换为所述第三标识;
    将替换得到的脱敏密钥确定为所述第一数据的下一个数据对应的脱敏密钥。
  8. 根据权利要求1~7任一所述的方法,其特征在于,所述脱敏密钥为与所述第一数据对应的脱敏任务相关的任意一个账号、任意一个号码、任意一个标识或者任意一个编号。
  9. 一种数据脱敏装置,其特征在于,包括:
    字典密钥确定模块,用于确定第一数据对应的数据字典和脱敏密钥,所述第一数据为待脱敏的数据,所述数据字典包括数据序列和第一标识序列的对应关系,所述数据序列包括多个数据,所述第一标识序列包括多个标识,所述数据序列中的一个数据对应所述第一标识序列中的一个标识,所述脱敏密钥包括至少一个所述第一标识序列中的标识;
    第一标识确定模块,用于根据所述数据字典确定在所述第一标识序列中确定与所述第一数据对应的第一标识;
    标识字典确定模块,用于根据所述脱敏密钥确定标识字典,所述标识字典包括所述第一标识序列和第二标识序列的对应关系,所述第二标识序列为根据所述脱敏密钥中的标识对所述第一标识序列进行重排序得到的序列,所述第二标识序列中的一个标识对应所述第一标识序列中的一个标识;
    第二标识确定模块,用于根据所述标识字典在所述第二标识序列中确定与所述第一标识对应的第二标识;
    脱敏数据确定模块,用于根据所述数据字典在所述数据序列中确定与所述第二标识对应的第二数据,并将所述第二数据确定为所述第一数据对应的脱敏数据。
  10. 根据权利要求9所述的装置,其特征在于,所述标识字典确定模块,具体用于:
    确定所述脱敏密钥中的各个标识对应的子标识字典;
    按照预设的排列组合规则,分别将所述各个标识各自对应的子标识字典进行可重复性 地排列和组合。
  11. 根据权利要求9~11任一所述的装置,其特征在于,所述脱敏密钥包括m个标识,所述标识字典包括M个子标识字典,所述M个子标识字典由可重复排列的m个子标识字典排列组合得到,所述m个子标识字典为根据所述m个标识字典确定的子标识字典,m、M均为正整数,M大于或等于m;
    所述M个子标识字典中的第i个子标识字典包括所述第一标识序列和第i标识序列的对应关系,所述第i标识序列为对所述第一标识序列进行重排序得到的序列,所述第i标识序列中的一个标识对应所述第一标识序列中的一个标识,第M标识序列为所述第二标识序列,i为正整数,i大于或等于1并且小于或等于M;
    所述第二标识确定模块具体用于:
    根据所述第i个子标识字典在所述第i标识序列中确定与所述第i标识对应的第(i+1)标识,其中,当i=1时,所述第i标识为所述第一标识;
    将第M标识序列中的第(M+1)标识确定为所述第二标识。
  12. 根据权利要求11所述的装置,其特征在于,
    M=m,所述第i个子标识字典为根据所述脱敏密钥中的第j个标识确定的子标识字典,j=i,j为正整数,j大于或等于1并且小于或等于m。
  13. 根据权利要求11所述的装置,其特征在于,
    M=2m-1,所述第i个子标识字典为根据所述脱敏密钥中的第j个标识确定的子标识字典,
    Figure PCTCN2019102746-appb-100003
  14. 根据权利要求12或13所述的装置,其特征在于,所述第i标识序列为对所述第一标识序列进行按顺序移位得到的序列,并且,所述第j个标识在所述第i个子标识字典的第i标识序列中位于第k位,k为大于或等于1并且小于或等于N的任一正整数,N等于所述第一标识序列中的标识的个数。
  15. 根据权利要求10~14任一项所述的方法,其特征在于,所述字典密钥确定模块,还用于:
    确定所述标识字典中的第A个子标识字典,所述第A个子标识字典为根据所述脱敏密钥中的第a个标识确定的子标识字典,
    Figure PCTCN2019102746-appb-100004
    B为所述第一数据在待脱敏的数据整体中的排列顺序,所述数据整体包括至少两个数据,a和n均为正整数,N等于所述第一标识序列中的标识的个数;
    根据所述第A个子标识字典确定第A标识序列中的第三标识,所述第三标识在所述第A标识序列中位于所述第a个标识的后一位;
    在所述脱敏密钥中将所述第a个标识替换为所述第三标识;
    将替换得到的脱敏密钥确定为所述第一数据的下一个数据对应的脱敏密钥。
  16. 根据权利要求9~15任一所述的装置,其特征在于,所述脱敏密钥为与所述第一数据对应的脱敏任务相关的任意一个账号、任意一个号码、任意一个标识或者任意一个编号。
  17. 一种数据脱敏装置,其特征在于,包括处理器、存储器以及通信接口,所述处理器、存储器和通信接口相互连接,其中,所述存储器用于存储计算机程序,所述计算机程序包括程序指令,所述处理器被配置用于调用所述程序指令执行:
    确定第一数据对应的数据字典和脱敏密钥,所述第一数据为待脱敏的数据,所述数据字典包括数据序列和第一标识序列的对应关系,所述数据序列包括多个数据,所述第一标识序列包括多个标识,所述数据序列中的一个数据对应所述第一标识序列中的一个标识,所述脱敏密钥包括至少一个所述第一标识序列中的标识;
    根据所述数据字典在所述第一标识序列中确定与所述第一数据对应的第一标识;
    根据所述脱敏密钥确定标识字典,所述标识字典包括所述第一标识序列和第二标识序列的对应关系,所述第二标识序列为根据所述脱敏密钥中的标识对所述第一标识序列进行重排序得到的序列,所述第二标识序列中的一个标识对应所述第一标识序列中的一个标识;
    根据所述标识字典在所述第二标识序列中确定与所述第一标识对应的第二标识;
    根据所述数据字典在所述数据序列中确定与所述第二标识对应的第二数据,并将所述第二数据确定为所述第一数据对应的脱敏数据。
  18. 根据权利要求17所述的装置,其特征在于,所述脱敏密钥包括m个标识,所述标识字典包括M个子标识字典,所述M个子标识字典由可重复排列的m个子标识字典排列组合得到,所述m个子标识字典为根据所述m个标识确定的子标识字典,m、M均为正整数,M大于或等于m;
    所述M个子标识字典中的第i个子标识字典包括所述第一标识序列和第i标识序列的对应关系,所述第i标识序列为对所述第一标识序列进行重排序得到的序列,所述第i标识序列中的一个标识对应所述第一标识序列中的一个标识,第M标识序列为所述第二标识序列,i为正整数,i大于或等于1并且小于或等于M;
    所述处理器具体用于:
    根据所述第i个子标识字典在所述第i标识序列中确定与第i标识对应的第(i+1)标识,其中,当i=1时,所述第i标识为所述第一标识;
    将第M标识序列中的第(M+1)标识确定为所述第二标识。
  19. 根据权利要求17所述的装置,其特征在于,所述处理器还用于:
    确定所述标识字典中的第A个子标识字典,所述第A个子标识字典为根据所述脱敏密钥中的第a个标识确定的子标识字典,
    Figure PCTCN2019102746-appb-100005
    B为所述第一数据在待脱敏的数据整体中的排列顺序,所述数据整体包括至少两个数据,a和n均为正整数,N等于所述第一标识序列中的标识的个数;
    根据所述第A个子标识字典确定第A标识序列中的第三标识,所述第三标识在所述第A标识序列中位于所述第a个标识的后一位;
    在所述脱敏密钥中将所述第a个标识替换为所述第三标识;
    将替换得到的脱敏密钥确定为所述第一数据的下一个数据对应的脱敏密钥。
  20. 一种计算机非易失性可读存储介质,其特征在于,所述计算机非易失性可读存储 介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行如权利要求1-8任一项所述的方法。
PCT/CN2019/102746 2019-03-28 2019-08-27 数据脱敏方法和相关装置 Ceased WO2020192007A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910241311.XA CN110008744B (zh) 2019-03-28 2019-03-28 数据脱敏方法和相关装置
CN201910241311.X 2019-03-28

Publications (1)

Publication Number Publication Date
WO2020192007A1 true WO2020192007A1 (zh) 2020-10-01

Family

ID=67168466

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/102746 Ceased WO2020192007A1 (zh) 2019-03-28 2019-08-27 数据脱敏方法和相关装置

Country Status (2)

Country Link
CN (1) CN110008744B (zh)
WO (1) WO2020192007A1 (zh)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113282931A (zh) * 2021-05-19 2021-08-20 绿盟科技集团股份有限公司 一种风险评估方法、装置、设备及介质
CN114186275A (zh) * 2021-12-13 2022-03-15 平安国际融资租赁有限公司 隐私保护方法、装置、计算机设备及存储介质
CN115118438A (zh) * 2022-08-29 2022-09-27 北京智芯微电子科技有限公司 基于区块链的终端数字身份管理方法及系统
CN115114665A (zh) * 2022-07-21 2022-09-27 平安付科技服务有限公司 一种数据打码方法、装置、存储介质以及电子设备
CN115329365A (zh) * 2022-07-04 2022-11-11 华能伊敏煤电有限责任公司 一种实现热电厂生产流程大数据数据应用的方法
CN119512765A (zh) * 2025-01-14 2025-02-25 杭州安泉数智科技有限公司 一种大数据并行脱敏方法及系统

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110008744B (zh) * 2019-03-28 2022-04-01 平安科技(深圳)有限公司 数据脱敏方法和相关装置
CN110457949A (zh) * 2019-08-14 2019-11-15 于向东 一种基于数据字典的保持唯一性、完整性、关联性的数据脱敏方法
CN111737750B (zh) * 2020-06-30 2023-12-26 绿盟科技集团股份有限公司 一种数据处理方法、装置、电子设备及存储介质
CN114065272B (zh) * 2020-07-30 2024-12-31 阿里巴巴集团控股有限公司 数据处理与发布方法、设备及存储介质
CN112582045A (zh) * 2020-12-22 2021-03-30 无锡慧方科技有限公司 一种电子式医疗报告单传输系统
CN114444115B (zh) * 2021-12-17 2025-04-08 厦门市美亚柏科信息股份有限公司 一种数据脱敏方法、终端设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100228783A1 (en) * 2009-03-06 2010-09-09 Castellanos Maria G Desensitizing Character Strings
CN107609418A (zh) * 2017-08-31 2018-01-19 深圳市牛鼎丰科技有限公司 文本数据的脱敏方法、装置、存储设备以及计算机设备
CN109039586A (zh) * 2018-08-17 2018-12-18 贵州大学 一种可恢复的保留数字类型轻量级脱敏方法
CN110008744A (zh) * 2019-03-28 2019-07-12 平安科技(深圳)有限公司 数据脱敏方法和相关装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1293483C (zh) * 2002-08-14 2007-01-03 北京唯美星计算机安全保护技术有限公司 多存储器式物理隔离型计算机数据安全防护方法及装置
US20060005017A1 (en) * 2004-06-22 2006-01-05 Black Alistair D Method and apparatus for recognition and real time encryption of sensitive terms in documents
CN105975870B (zh) * 2016-05-19 2018-10-23 上海点融信息科技有限责任公司 数据脱敏方法和系统
CN107145799A (zh) * 2017-05-04 2017-09-08 山东浪潮云服务信息科技有限公司 一种数据脱敏方法及装置
CN107871083A (zh) * 2017-11-07 2018-04-03 平安科技(深圳)有限公司 脱敏规则配置方法、应用服务器及计算机可读存储介质
CN107992727B (zh) * 2017-12-11 2021-08-03 北京安华金和科技有限公司 一种基于原有数据变形实现的水印处理和数据溯源方法
CN108289095A (zh) * 2018-01-02 2018-07-17 诚壹泰合(北京)科技有限公司 一种敏感数据存储方法、装置及系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100228783A1 (en) * 2009-03-06 2010-09-09 Castellanos Maria G Desensitizing Character Strings
CN107609418A (zh) * 2017-08-31 2018-01-19 深圳市牛鼎丰科技有限公司 文本数据的脱敏方法、装置、存储设备以及计算机设备
CN109039586A (zh) * 2018-08-17 2018-12-18 贵州大学 一种可恢复的保留数字类型轻量级脱敏方法
CN110008744A (zh) * 2019-03-28 2019-07-12 平安科技(深圳)有限公司 数据脱敏方法和相关装置

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113282931A (zh) * 2021-05-19 2021-08-20 绿盟科技集团股份有限公司 一种风险评估方法、装置、设备及介质
CN114186275A (zh) * 2021-12-13 2022-03-15 平安国际融资租赁有限公司 隐私保护方法、装置、计算机设备及存储介质
CN115329365A (zh) * 2022-07-04 2022-11-11 华能伊敏煤电有限责任公司 一种实现热电厂生产流程大数据数据应用的方法
CN115114665A (zh) * 2022-07-21 2022-09-27 平安付科技服务有限公司 一种数据打码方法、装置、存储介质以及电子设备
CN115118438A (zh) * 2022-08-29 2022-09-27 北京智芯微电子科技有限公司 基于区块链的终端数字身份管理方法及系统
CN115118438B (zh) * 2022-08-29 2023-01-20 北京智芯微电子科技有限公司 基于区块链的终端数字身份管理方法及系统
CN119512765A (zh) * 2025-01-14 2025-02-25 杭州安泉数智科技有限公司 一种大数据并行脱敏方法及系统

Also Published As

Publication number Publication date
CN110008744B (zh) 2022-04-01
CN110008744A (zh) 2019-07-12

Similar Documents

Publication Publication Date Title
WO2020192007A1 (zh) 数据脱敏方法和相关装置
EP3166041B1 (en) Format preserving masking system and method
CN107145799A (zh) 一种数据脱敏方法及装置
CN112613917A (zh) 基于用户画像的信息推送方法、装置、设备及存储介质
WO2019051946A1 (zh) 节点任务数据显示方法、装置、存储介质和计算机设备
CN106959955A (zh) 一种数据库的数据处理方法及装置
US11500992B2 (en) Trusted execution environment-based model training methods and apparatuses
CN113254995B (zh) 数据脱敏方法、装置、系统及计算机可读介质
CN109740359B (zh) 用于数据脱敏的方法、装置及存储介质
CN108595338A (zh) 测试用例编写方法、装置、计算机设备及存储介质
CN114154198B (zh) 数据处理方法及装置
US20210157900A1 (en) Securing passwords by using dummy characters
CN111159329A (zh) 敏感词检测方法、装置、终端设备和计算机可读存储介质
CN113553583A (zh) 信息系统资产安全风险评估方法与装置
EP3973429A1 (en) Compatible anonymization of data sets of different sources
CN111078668B (zh) 数据生成方法、装置、电子设备和存储介质
CN113051183A (zh) 一种测试数据的推荐方法、系统、电子设备及存储介质
KR20100138291A (ko) 개인정보 변환방법, 시스템 및 이를 이용한 서비스 테스트 방법
US11301587B2 (en) Systems and methods for masking and unmasking of sensitive data
CN111428251B (zh) 数据处理方法和装置
Amrulloh et al. Implementation of AES-256 algorithm in Android-Based E-Voting data security
US20220092210A1 (en) Policy-based data migration
CN113722334A (zh) 数据处理的方法、装置、电子设备及介质
CN113343288B (zh) 一种基于tee的区块链智能合约安全管理系统
CN112162929B (zh) 测试数据生成方法、装置、计算机设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19921356

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19921356

Country of ref document: EP

Kind code of ref document: A1