WO2023178792A1 - 密文数据的存放方法、装置、设备及存储介质 - Google Patents
密文数据的存放方法、装置、设备及存储介质 Download PDFInfo
- Publication number
- WO2023178792A1 WO2023178792A1 PCT/CN2022/089999 CN2022089999W WO2023178792A1 WO 2023178792 A1 WO2023178792 A1 WO 2023178792A1 CN 2022089999 W CN2022089999 W CN 2022089999W WO 2023178792 A1 WO2023178792 A1 WO 2023178792A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- characters
- ciphertext
- character
- information
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting 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/6227—Protecting 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 where protection concerns the structure of data, e.g. records, types, queries
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
Definitions
- This application relates to the field of data security technology, and in particular to a storage method, device, equipment and storage medium for ciphertext data.
- the key information cannot correspond to the ciphertext data, making it impossible to judge the key based on the ciphertext. Due to this situation, it is impossible to achieve a smooth transition of the business system. In addition, in the business system, the relationship between the ciphertext data cannot be traced.
- embodiments of the present application provide a method, device, equipment and storage medium for storing ciphertext data, which can at least solve the problem of difficulty in distinguishing the algorithm used in ciphertext when a business system uses a mixture of multiple cryptographic algorithms.
- One of the technical problems is the inability to find the key corresponding to the ciphertext in the scenario of key replacement in the business system, and the inability to trace the relationship between the ciphertext data in the business system.
- the first aspect of the embodiment of the present application provides a method for storing ciphertext data, including:
- the data header information corresponding to the ciphertext data is generated according to the preset data header generation rules, wherein the data header information is characterized as a string containing several characters, and the The characters in the string are used to identify the encrypted information of the ciphertext data;
- a second aspect of the embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the electronic device.
- the processor executes the computer program, the first On the one hand, the steps of the storage method of ciphertext data are provided:
- the data header information corresponding to the ciphertext data is generated according to the preset data header generation rules, wherein the data header information is characterized as a string containing several characters, and the The characters in the string are used to identify the encrypted information of the ciphertext data;
- a third aspect of the embodiments of the present application provides a computer-readable storage medium.
- the computer-readable storage medium stores a computer program.
- the computer program is executed by a processor, the storage of the ciphertext data provided in the first aspect is implemented.
- the data header information corresponding to the ciphertext data is generated according to the preset data header generation rules, wherein the data header information is characterized as a string containing several characters, and the The characters in the string are used to identify the encrypted information of the ciphertext data;
- a fourth aspect of the embodiment of the present application provides a device for storing ciphertext data.
- the device for storing ciphertext data includes:
- An acquisition module used to encrypt the business data generated by the business system into ciphertext data and obtain the encrypted information of the ciphertext data;
- a generation module configured to generate data header information corresponding to the ciphertext data according to the preset data header generation rules according to the encryption information of the ciphertext data, wherein the data header information is characterized as containing several characters.
- a character string the characters in the character string are used to identify the encrypted information of the ciphertext data;
- a storage module is used to add the data header information to the header position of the ciphertext data, generate target data, and store the target data in the ciphertext database of the business system.
- the embodiments of this application provide a storage method, device, equipment and storage medium for ciphertext data, which have the following beneficial effects:
- the embodiment of the present application encrypts the business data generated by the business system into ciphertext data, and then generates the data header information corresponding to the ciphertext data according to the preset data header generation rules according to the encryption information of the ciphertext data, and then The data header information is added to the header position of the ciphertext data to generate target data, so that the target data contains the encryption information of the ciphertext data.
- the encryption algorithm used for the ciphertext data, the key version information used and the data source location information can be obtained by parsing the data header information of the ciphertext data, thereby solving the problem of mixed use of multiple ciphertext data in the business system.
- Figure 1 is an implementation flow chart of a method for storing ciphertext data provided by an embodiment of the present application
- Figure 2 is a schematic flow chart of a method for generating data header information in the storage method of ciphertext data provided by the embodiment of the present application;
- Figure 3 is a schematic flow chart of a method for setting fixed characters in the storage method of ciphertext data provided by the embodiment of the present application;
- Figure 4 is a basic structural block diagram of a ciphertext data storage device provided by an embodiment of the present application.
- Figure 5 is a detailed structural block diagram of the ciphertext data storage device provided by the embodiment of the present application.
- Figure 6 is a basic structural block diagram of an electronic device provided by an embodiment of the present application.
- the ciphertext data storage method provided by the embodiments of this application is used in business systems and smart cities, and is used to encrypt and store business data generated during business processing by the business system. Please refer to Figure 1 for details.
- Figure 1 is an implementation flow chart of a method for storing ciphertext data provided by an embodiment of the present application. Details are as follows:
- S11 Encrypt the business data generated by the business system into ciphertext data and obtain the encryption information of the ciphertext data.
- the business system encrypts the business data generated by the business into ciphertext data to prevent the business data from being leaked or misappropriated, and to ensure data security.
- the encryption information of ciphertext data includes encryption algorithm information, key version information and data source location information.
- different encryption algorithms can be selected for encryption based on factors such as the type of business data, data volume, or content form.
- multiple encryption algorithms may be pre-configured in the business system, including but not limited to DES algorithm, SM4 algorithm, SM3 algorithm, HASH algorithm, RSA algorithm, etc. The business system is based on these pre-configured multiple encryption algorithms.
- the business data and generating business data After processing the business data and generating business data, it traverses the applicable conditions of each encryption algorithm based on the type, data volume and content form of the business data, and selects one of the multiple encryption algorithms. Encrypt the encryption algorithm with a higher degree of matching with the business data to obtain the corresponding ciphertext data after encrypting the business data.
- the encryption information corresponding to the ciphertext data is obtained.
- the encryption information includes the encryption algorithm information used when encrypting the business data into ciphertext data, and the business data.
- the business system can update the key version used to encrypt business data from time to time according to business needs.
- the business system uses the latest version of the key. key for encryption. All versions of keys used by the business system will be stored in the business system for query.
- the encryption algorithm information can be represented as the name information of the encryption algorithm used when the business data is encrypted into ciphertext data
- the key version information can be represented as the key version number used when the business data is encrypted into ciphertext data.
- Data source location information can be represented as database, data table, and data column information where the business data is located.
- S12 According to the encryption information of the ciphertext data, generate the data header information corresponding to the ciphertext data according to the preset data header generation rules, wherein the data header information is represented as a string containing several characters, The characters in the string are used to identify the encrypted information of the ciphertext data.
- a string containing several characters can be generated according to the encryption information of the ciphertext data as the data header information of the ciphertext data.
- the string consists of characters used to identify the encryption algorithm information used when encrypting the ciphertext data, characters used to identify the key version information used when encrypting the ciphertext data, and characters used to identify the data source location of the ciphertext data.
- the characters of the message are combined to form.
- each character used to combine to form a string is represented by 62 visible characters in the ASCII character set, where the 62 visible characters in the ASCII character set include 26 uppercase English alphabetic characters and 26 lowercase English alphabetic characters. and 10 numeric characters.
- Each character in the string is represented as any one of the 62 visible characters.
- each encryption algorithm corresponds to a unique visible character.
- each key version corresponds to a unique visible character.
- the data source location of the business data generated by the business system can be represented by a permutation and combination of multiple visible characters. Hexadecimal is used in the permutation and combination of multiple visible characters to increase the location space. One data source location corresponds to one character. Permutations.
- the data header information can be added to the header position of the ciphertext data through embedding to generate target data.
- the target data is the ciphertext data with header information added.
- the business data of the business system can be stored in the form of ciphertext, and in the ciphertext database, each ciphertext data header can be processed by parsing its data header information. Trace the source, obtain the actual source of the ciphertext data, and obtain the encryption algorithm and key version used when encrypting the ciphertext data based on the data header information, so that the ciphertext data can be quickly decrypted.
- the business data generated by the business system is encrypted into ciphertext data, and then according to the encryption information of the ciphertext data, according to the preset data header
- the generation rule generates data header information corresponding to the ciphertext data, and then adds the data header information to the head position of the ciphertext data to generate target data, so that the target data contains the encryption information of the ciphertext data.
- the encryption algorithm used for the ciphertext data, the key version information used and the data source location information can be obtained by parsing the data header information of the ciphertext data, thereby solving the problem of mixed use of multiple ciphertext data in the business system.
- the preset data header generation rules are unique identification rules, which include: the rule that one data source position corresponds to one identification character, one encryption algorithm corresponds to one identification character, and one encryption algorithm corresponds to one identification character.
- a key version corresponds to a rule for identifying characters.
- a key version character corresponding to the key version information is randomly generated based on a preset character set.
- the key version character is used to identify a password.
- S24 Concatenate the position characters, the algorithm characters and the key version characters to generate data header information corresponding to the ciphertext data.
- the data header information when generating the data header information, can be predefined as a string containing several characters, where each character occupies one character bit, and each character bit is formed based on a preset character set. Sixty-two decimal.
- the default character set contains 62 ASCII visible characters, specifically composed of 26 uppercase English alphabetic characters, 26 lowercase English alphabetic characters and 10 numeric characters.
- location characters corresponding to the data source location information of the ciphertext data are randomly generated based on a preset character set, and the location characters are used to identify the ciphertext data. The location of the data source. Each character of this position character has 62 possibilities.
- each encryption algorithm is represented by a character in the preset character set.
- Different encryption algorithms The algorithm uses different characters accordingly. Specifically, algorithm characters corresponding to encryption algorithm information can be generated based on a preset character set, and the algorithm characters are used to identify the encryption algorithm used when encrypting ciphertext data.
- each key version is represented by a character in the preset character set.
- Different Key versions use different characters accordingly.
- a key version character corresponding to the key version information can be generated based on a preset character set, and the key version character is used to identify the key version used when encrypting the ciphertext data.
- the generated fixed characters, positional characters, algorithm characters, and key version characters are concatenated to form the data header information corresponding to the ciphertext data.
- characters that meet the fixed character generation conditions can be extracted from the preset character set based on the preset fixed character generation conditions, and the characters that meet the fixed character generation conditions can be set as fixed characters. and concatenated into the data header information to use fixed characters to identify the ciphertext data as encrypted data.
- a fixed character represented by three characters, a position character represented by five characters, an algorithm character represented by one character, and a key version character represented by one character are concatenated to form Header information of ciphertext data.
- the fixed character generation condition is pre-configured to be the least used character in the character set for data representation.
- the frequency of use of each character in the character set for data representation is analyzed.
- the data represents the frequency of use.
- Characters that meet the fixed character generation conditions are extracted from the preset character set, and then the characters that meet the fixed character generation conditions are set as fixed characters.
- the fixed characters are used to identify the ciphertext data as encrypted data.
- FIG. 3 is a schematic flowchart of a method for setting fixed characters in the storage method of ciphertext data provided by the embodiment of the present application. Details are as follows:
- S32 Based on the preset character set, traverse the preset number of plaintext data samples, and count the number of occurrences of each character in the preset character set in the preset number of plaintext data samples;
- S33 Sort the occurrence times of each character in the preset number of plaintext data samples, select the first three characters in the sorting and set them as fixed characters, and use the fixed characters to identify the ciphertext data as having been Encrypt data.
- fixed characters can be set through big data analysis. Specifically, a large number of plaintext data samples are first collected. For example, the preset number of plaintext data samples is set to greater than 100 to ensure the accuracy of big data analysis. Then based on the preset character set, by traversing the preset number of plaintext data samples, the number of occurrences of each character in the preset character set in the preset number of plaintext data samples is counted, and the corresponding occurrence times of each character are sorted. , and finally, according to the number of occurrences of each character in the preset number of plaintext data samples, the first three characters sorted from low to high are selected and set as fixed characters, thereby using fixed characters to identify the ciphertext data as encrypted data.
- the three characters obtained by statistics are zo0.
- setting zo0 as a fixed character can quickly confirm whether the data is encrypted ciphertext data, because zo0 appears in the plaintext data sample.
- the low frequency can avoid conflicts and improve the accuracy of confirming that the data is encrypted ciphertext data.
- sequence number of each step in the above embodiment does not mean the order of execution.
- the execution order of each process should be determined by its function and internal logic, and should not constitute any influence on the implementation process of the embodiment of the present application. limited.
- FIG. 4 is a basic structural block diagram of a device for storing ciphertext data provided by an embodiment of the present application.
- the ciphertext data storage device includes: an acquisition module 41, a generation module 42, and a storage module 43.
- the acquisition module 41 is used to encrypt the business data generated by the business system into ciphertext data and obtain the encryption information of the ciphertext data.
- the generation module 42 is configured to generate data header information corresponding to the ciphertext data according to the preset data header generation rules according to the encryption information of the ciphertext data, wherein the data header information is represented by including several A string of characters. The characters in the string are used to identify the encrypted information of the ciphertext data.
- the storage module 43 is used to add the data header information to the header position of the ciphertext data, generate target data, and store the target data in the ciphertext database of the business system.
- Figure 5 is a detailed structural block diagram of the ciphertext data storage device provided by the embodiment of the present application.
- the ciphertext data storage device further includes a first generation sub-module 51 , a second generation sub-module 52 , a third generation sub-module 53 and a first concatenation sub-module 54 .
- the first generation sub-module 51 is used to randomly generate location characters corresponding to the data source location information based on a preset character set according to the rule that one data source location corresponds to one identification character. Characters are used to identify the data source location of the ciphertext data.
- the second generation sub-module 52 is configured to randomly generate algorithm characters corresponding to the encryption algorithm information based on a preset character set according to the rule that one encryption algorithm corresponds to one identifier, and the algorithm characters are used to identify The encryption algorithm used when encrypting ciphertext data.
- the third generation sub-module 53 is configured to randomly generate key version characters corresponding to the key version information based on a preset character set according to the rule that one key version corresponds to one identification character. The key version character is used to identify the key version used when encrypting ciphertext data.
- the first concatenation sub-module 54 is used to concatenate the position characters, the algorithm characters and the key version characters to generate data header information corresponding to the ciphertext data.
- FIG. 6 is a basic structural block diagram of an electronic device provided by an embodiment of the present application.
- the electronic device 6 of this embodiment includes: a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61, such as the storage of ciphertext data. method procedure.
- the processor 61 executes the computer program 63, the steps in each embodiment of the above-mentioned storage method for ciphertext data are implemented.
- the processor 61 executes the computer program 63, the functions of each module in the corresponding embodiment of the ciphertext data storage device are implemented.
- the computer program 63 can be divided into one or more modules (units), and the one or more modules are stored in the memory 62 and executed by the processor 61 to complete the present invention. Apply.
- the one or more modules may be a series of computer program instruction segments capable of completing specific functions.
- the instruction segments are used to describe the execution process of the computer program 63 in the electronic device 6 .
- the computer program 63 can be divided into an acquisition module, a generation module and a storage module, and the specific functions of each module are as described above.
- the electronic device may include, but is not limited to, a processor 61 and a memory 62 .
- FIG. 6 is only an example of the electronic device 6 and does not constitute a limitation of the electronic device 6. It may include more or fewer components than shown in the figure, or some components may be combined, or different components may be used. , for example, the electronic device may also include input and output devices, network access devices, buses, etc.
- the processor 61 can be a central processing unit (Central Processing Unit, CPU), or other general-purpose processor, digital signal processor (Digital Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), Ready-made field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
- CPU Central Processing Unit
- DSP Digital Signal Processor
- ASIC Application Specific Integrated Circuit
- FPGA Ready-made field-programmable gate array
- a general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
- the memory 62 may be an internal storage unit of the electronic device 6 , such as a hard disk or memory of the electronic device 6 .
- the memory 62 may also be an external storage device of the electronic device 6, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), or a secure digital (SD) equipped on the electronic device 6. Card, Flash Card, etc.
- the memory 62 may also include both an internal storage unit of the electronic device 6 and an external storage device.
- the memory 62 is used to store the computer program and other programs and data required by the electronic device.
- the memory 62 can also be used to temporarily store data that has been output or is to be output.
- Embodiments of the present application also provide a computer-readable storage medium.
- the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the steps in each of the above method embodiments can be implemented.
- the computer-readable storage medium may be a non-volatile storage medium or a volatile storage medium.
- Embodiments of the present application provide a computer program product.
- the steps in each of the above method embodiments can be implemented when the mobile terminal is executed.
- Module completion means dividing the internal structure of the device into different functional units or modules to complete all or part of the functions described above.
- Each functional unit and module in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
- the above-mentioned integrated unit can be hardware-based. It can also be implemented in the form of software functional units.
- the specific names of each functional unit and module are only for the convenience of distinguishing each other and are not used to limit the scope of protection of the present application.
- For the specific working processes of the units and modules in the above system please refer to the corresponding processes in the foregoing method embodiments, and will not be described again here.
- the integrated module/unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
- the present application can implement all or part of the processes in the methods of the above embodiments, which can also be completed by instructing relevant hardware through a computer program.
- the computer program can be stored in a computer-readable storage medium, and the computer can When the program is executed by the processor, the steps of each of the above method embodiments can be implemented.
- the computer program includes computer program code, which may be in the form of source code, object code, executable file or some intermediate form.
- the computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media, etc.
- ROM Read-Only Memory
- RAM Random Access Memory
- electrical carrier signals telecommunications signals
- software distribution media etc.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Bioethics (AREA)
- Databases & Information Systems (AREA)
- Storage Device Security (AREA)
Abstract
本申请适用于数据安全技术领域,提供一种密文数据的存放方法、装置、设备及存储介质,其方法包括:将业务系统产生的业务数据加密成密文数据并获取密文数据的加密信息;根据密文数据的加密信息,按照预设的数据头生成规则生成密文数据对应的数据头信息,其中,数据头信息表征为包含有若干个字符的字符串,字符串中的字符用于标识密文数据的加密信息;将数据头信息添加到密文数据的头部位置,生成目标数据,将目标数据存放于业务系统的密文数据库中。基于该方法,可以解决业务系统混合使用多种密码算法的情况下难以区分密文所使用的算法、业务系统出现密钥更换的场景时无法找到密文对应密钥以及业务系统中密文数据的关系无从追溯等技术问题。
Description
本申请要求于2022年03月24日提交中国专利局,申请号为202210294093.8,发明名称为“密文数据的存放方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及数据安全技术领域,尤其涉及一种密文数据的存放方法、装置、设备及存储介质。
随着互联网技术的发展,在大数据的环境下,数据安全技术越来越受到人们的关注。为了避免敏感数据被泄露或被盗用,目前很多企业使用的线上业务系统都可以对业务产生的数据进行加密存储处理。然而,发明人意识到目前现有的数据加密存储方案大多为采用加密算法将数据明文进行加密后得到的密文原始数据进行直接存放。由于在业务系统场景中,数据是不断产生的,数据量多且繁杂,将密文原始数据进行直接存放的方法在业务系统中,在业务系统混合使用多种密码算法的情况下,由于密文数据无法记录算法信息而难以对密文数据所使用的算法信息进行区分,且在业务系统出现密钥更换的场景中,由于密钥信息与密文数据无法对应而导致无法根据密文判断密钥情况,无法做到业务系统平滑过渡,另外在业务系统中,密文数据的关系也无从追溯。
发明内容
有鉴于此,本申请实施例提供了一种密文数据的存放方法、装置、设备及存储介质,可以至少解决在业务系统混合使用多种密码算法的情况下难以区分密文所使用的算法、在业务系统出现密钥更换的场景中无法找到密文对应密钥以及在业务系统中密文数据的关系无从追溯等技术问题之一。
本申请实施例的第一方面提供了一种密文数据的存放方法,包括:
将业务系统产生的业务数据加密成密文数据并获取所述密文数据的加密信息;
根据所述密文数据的加密信息,按照预设的数据头生成规则生成所述密文数据对应的数据头信息,其中,所述数据头信息表征为包含有若干个字符的字符串,所述字符串中的字符用于标识所述密文数据的加密信息;
将所述数据头信息添加到所述密文数据的头部位置,生成目标数据,将所述目标数据存放于所述业务系统的密文数据库中。
本申请实施例的第二方面提供了一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在电子设备上运行的计算机程序,所述处理器执行所述计算机程序时实现第一方面提供的密文数据的存放方法的各步骤:
将业务系统产生的业务数据加密成密文数据并获取所述密文数据的加密信息;
根据所述密文数据的加密信息,按照预设的数据头生成规则生成所述密文数据对应的数据头信息,其中,所述数据头信息表征为包含有若干个字符的字符串,所述字符串中的字符用于标识所述密文数据的加密信息;
将所述数据头信息添加到所述密文数据的头部位置,生成目标数据,将所述目标数据存放于所述业务系统的密文数据库中。
本申请实施例的第三方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现第一方面提供的密文数据的存放方法的各步骤:
将业务系统产生的业务数据加密成密文数据并获取所述密文数据的加密信息;
根据所述密文数据的加密信息,按照预设的数据头生成规则生成所述密文数据对应的数据头信息,其中,所述数据头信息表征为包含有若干个字符的字符串,所述字符串中的字符用于标识所述密文数据的加密信息;
将所述数据头信息添加到所述密文数据的头部位置,生成目标数据,将所述目标数据存放于所述业务系统的密文数据库中。
本申请实施例的第四方面提供了一种密文数据的存放装置,所述密文数据的存放装置包括:
获取模块,用于将业务系统产生的业务数据加密成密文数据并获取所述密文数据的加密信息;
生成模块,用于根据所述密文数据的加密信息,按照预设的数据头生成规则生成所述密文数据对应的数据头信息,其中,所述数据头信息表征为包含有若干个字符的字符串,所述字符串中的字符用于标识所述密文数据的加密信息;
存放模块,用于将所述数据头信息添加到所述密文数据的头部位置,生成目标数据,将所述目标数据存放于所述业务系统的密文数据库中。
本申请实施例提供的一种密文数据的存放方法、装置、设备及存储介质,具有以下有益效果:
本申请实施例通过将业务系统产生的业务数据加密成密文数据,然后通过根据密文数据的加密信息,按照预先设定好的数据头生成规则生成该密文数据对应的数据头信息,进而将该数据头信息添加到密文数据的头部位置,生成目标数据,使得该目标数据中包含有密文数据的加密信息。以此实现在业务系统中,通过解析密文数据的数据头信息可以获得该密文数据所使用的加密算法、所采用的密钥版本信息和数据来源位置信息,从而解决在业务系统混合使用多种密码算法的情况下难以区分密文所使用的算法的问题,解决在业务系统出现密钥 更换的场景中无法找到密文对应密钥的问题,以及解决业务系统中密文数据的关系无从追溯的问题。
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种密文数据的存放方法的实现流程图;
图2为本申请实施例提供的密文数据的存放方法中生成数据头信息的一种方法流程示意图;
图3为本申请实施例提供的密文数据的存放方法中设置固定字符的一种方法流程示意图;
图4为本申请实施例提供的一种密文数据的存放装置的基础结构框图;
图5为本申请实施例提供的密文数据的存放装置中的一种细化结构框图;
图6为本申请实施例提供的一种电子设备的基本结构框图。
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例提供的密文数据的存放方法应用在业务系统及智慧城市中,用于对业务系统处理业务过程中产生的业务数据进行加密存放。具体请参阅图1,图1为本申请实施例提供的一种密文数据的存放方法的实现流程图。详述如下:
S11:将业务系统产生的业务数据加密成密文数据并获取所述密文数据的加密信息。
本实施例中,业务系统通过将业务产生的业务数据加密成密文数据,以避免业务数据被泄露或被盗用,保证数据安全。密文数据的加密信息包括加密算法信息、密钥版本信息和数据来源位置信息。在本实施例中,在将业务系统产生的业务数据进行加密时,可以根据业务数据的类型、数据量或内容形式等因素选择不同加密算法进行加密。具体地,可以在业务系统预先配置有多种加密算法,例如包括但不限于DES算法、SM4算法、SM3算法、HASH算法、RSA算法等。业务系统基于这些预先配置的多种加密算法,在处理业务产生业务数据后,通过业务数据的类型、数据量和内容形式,遍历各加密算法的适用条件,从该多种加密算法中选择一种与该业务数据匹配度较高的加密算法进行加密,以获得该业务数据加密后对应的密文数据。在将业务系统产生的业务数据加密成密文数据后,获取该密文数据所对应的加密信息,其中,加密信息包括将业务数据加密成密文数据时所使用的加密算法信息、将业务数据加密成密文数据时业务系统所使用的密钥版本信息、业务数据获取的数据来源位置信 息。在本实施例中,业务系统可以根据业务需求不定时地更新用于对业务数据进行加密处理的密钥版本,在将业务系统产生的业务数据进行加密时,业务系统则使用当前最新版本的密钥进行加密。而业务系统使用过的所有版本的密钥都会保存在业务系统以供查询。示例性的,加密算法信息可以表示为业务数据加密成密文数据时所使用的加密算法的名称信息,密钥版本信息可以表示为业务数据加密成密文数据时所使用的密钥版本号,数据来源位置信息可以表示为业务数据所在的数据库、数据表、数据列信息。
S12:根据所述密文数据的加密信息,按照预设的数据头生成规则生成所述密文数据对应的数据头信息,其中,所述数据头信息表征为包含有若干个字符的字符串,所述字符串中的字符用于标识所述密文数据的加密信息。
本实施例中,按照预设的数据头生成规则,可以根据密文数据的加密信息生成一个包含有若干个字符的字符串作为该密文数据的数据头信息。其中,字符串由用于标识密文数据加密时所使用的加密算法信息的字符、用于标识密文数据加密时所使用的密钥版本信息的字符和用于标识密文数据的数据来源位置信息的字符进行组合形成。示例性的,用于组合形成字符串的每一个字符采用ASCII字符集中的62个可见字符表示,其中,ASCII字符集中的62个可见字符包含有26个大写英文字母字符、26个小写英文字母字符和10个数字字符。字符串中的每个字符均表示为该62个可见字符中的任意一个字符。在本实施例中,针对业务系统中预先设置的多种加密算法,每种加密算法对应一个唯一的可见字符。针对业务系统使用过的所有密钥版本,每种密钥版本对应一个唯一的可见字符。针对业务系统产生的业务数据的数据来源位置,可以采用多个可见字符进行排列组合来表示,在该多个可见字符的排列组合中采用62进制,以增加位置空间一个数据来源位置对应一个字符排列组合。
S13:将所述数据头信息添加到所述密文数据的头部位置,生成目标数据,将所述目标数据存放于所述业务系统的密文数据库中。
本实施例中,在生成数据头信息后,可以通过嵌入的方式将数据头信息添加到密文数据的头部位置,生成目标数据。该目标数据即为添加有数据头信息的密文数据。通过将目标数据存放于业务系统的密文数据库中,可以使得业务系统的业务数据以密文的形式存放,且在密文数据库中,每一条密文数据头可以通过解析其数据头信息来进行溯源,获取密文数据的实际产生来源,另外根据数据头信息获取该密文数据进行加密时所使用的加密算法和密钥版本,可以快速地对该密文数据进行解密处理。
以上可以看出,本实施例提供的密文数据的存放方法中,通过将业务系统产生的业务数据加密成密文数据,然后通过根据密文数据的加密信息,按照预先设定好的数据头生成规则生成该密文数据对应的数据头信息,进而将该数据头信息添加到密文数据的头部位置,生成目标数据,使得该目标数据中包含有密文数据的加密信息。以此实现在业务系统中,通过解析密文数据的数据头信息可以获得该密文数据所使用的加密算法、所采用的密钥版本信息和数据来源位置信息,从而解决在业务系统混合使用多种密码算法的情况下难以区分密文所使用的算法的问题,解决在业务系统出现密钥更换的场景中无法找到密文对应密钥的问题,以 及解决业务系统中密文数据的关系无从追溯的问题。
本申请的一些实施例中,预设的数据头生成规则为标识唯一规则,其中包括:一个数据来源位置对应一种标识字符的规则、一种加密算法对应一种标识字符的规则、一种密钥版本对应一种标识字符的规则。请参阅图2,图2位本申请实施例提供的密文数据的存放方法中生成数据头信息的一种方法流程示意图。详细如下:
S21:根据所述一个数据来源位置对应一种标识字符的规则,基于预设的字符集随机生成与所述数据来源位置信息对应的位置字符,所述位置字符用于标识所述密文数据的数据来源位置;
S22:根据所述一种加密算法对应一种标识的规则,基于预设的字符集随机生成与所述加密算法信息对应的算法字符,所述算法字符用于标识密文数据加密时所使用的加密算法;
S23:根据所述一种密钥版本对应一种标识字符的规则,基于预设的字符集随机生成与所述密钥版本信息对应的密钥版本字符,所述密钥版本字符用于标识密文数据加密时所使用的密钥版本;
S24:将所述位置字符、所述算法字符和所述密钥版本字符进行串连,生成所述密文数据对应的数据头信息。
本实施例中,在生成数据头信息时,可以将数据头信息预先规定为包含有若干个字符的字符串,其中,每个字符占用一个字符位,每个字符位基于预设的字符集形成六十二进制。预设的字符集中包含有62个ASCII可见字符,具体由26个大写英文字母字符、26个小写英文字母字符和10个数字字符组成。在本实施例中,根据一个数据来源位置对应一种标识字符的规则,基于预设的字符集随机生成与密文数据的数据来源位置信息对应的位置字符,采用位置字符标识所述密文数据的数据来源位置。该位置字符的每一位字符都有62种可能,由五位六十二进制的字符组合形成且组合方式唯一,确保在业务系统中,不同的数据来源位置对应生成不同的位置字符,一个数据来源位置对应一个唯一的位置字符。在本实施例中,根据一种加密算法对应一种标识的规则,针对业务系统中预先配置的多种加密算法,每一种加密算法采用预设的字符集中一种字符来表示,不同的加密算法对应采用不同的字符。具体地,可以基于预设的字符集生成与加密算法信息对应的算法字符,采用算法字符标识密文数据加密时所使用的加密算法。在本实施例种,根据一种密钥版本对应一种标识字符的规则,针对业务系统中使用过的密钥版本,每一个密钥版本采用预设的字符集中一种字符来表示,不同的密钥版本对应采用不同的字符。具体地,可以基于预设的字符集生成与密钥版本信息对应的密钥版本字符,采用密钥版本字符标识密文数据加密时所使用的密钥版本。当分别生成固定字符、位置字符、算法字符、密钥版本字符后,将该生成的固定字符、位置字符、算法字符和密钥版本字符进行串连,即可形成密文数据对应的数据头信息。
本申请的一些实施例中,还可以按照预设的固定字符生成条件,从基于预设的字符集提取出满足固定字符生成条件的字符,将满足所述固定字符生成条件的字符设置为固定字符并串连到数据头信息中,以采用固定字符标识所述密文数据为已加密数据。示例性的,在本实 施例中,通过将由三个字符代表的固定字符、由五个字符代表的位置字符、由一个字符代表的算法字符和由一个字符代表的密钥版本字符进行串连形成密文数据的数据头信息。在本实施例中,预先配置固定字符生成条件为字符集中数据表示使用最少的字符,按照预设的固定字符生成条件,分析字符集中各字符用于数据表示的使用频繁程度,根据各字符用于数据表示使用频繁程度,从基于预设的字符集提取出满足固定字符生成条件的字符,进而将满足固定字符生成条件的字符设置为固定字符,采用固定字符来标识密文数据为已加密数据。
本申请的一些实施例中,请参阅图3,图3为本申请实施例提供的密文数据的存放方法中设置固定字符的一种方法流程示意图。详细如下:
S31:收集预设数量个明文数据样本;
S32:基于预设的字符集,遍历所述预设数量个明文数据样本,统计出所述预设的字符集中各字符在所述预设数量个明文数据样本中的出现次数;
S33:将所述各字符在所述预设数量个明文数据样本中的出现次数进行顺序排序,选取排序中前三个字符设置为固定字符,采用所述固定字符标识所述密文数据为已加密数据。
本实施例中,可以通过大数据分析的方式来设置固定字符,具体地,首先收集大量明文数据样本,例如,明文数据样本的预设数量设置为大于100,以确保大数据分析的准确性。然后基于预设的字符集,通过遍历预设数量个明文数据样本,统计出预设的字符集中各字符在预设数量个明文数据样本中的出现次数,通过将各字符对应的出现次数进行排序,最后根据各字符在预设数量个明文数据样本中的出现次数,选取出现次数由低至高排序的前三个字符设置为固定字符,从而采用固定字符标识所述密文数据为已加密数据。在本实施例中,统计得出的三个字符为zo0,在业务系统中,将该zo0设置为固定字符,可以快速确认数据是否为已加密的密文数据,因为zo0在明文数据样本中出现的频率低,可以避免产生冲突的情况,提高确认数据为已加密的密文数据的准确性。
可以理解的是,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
本申请的一些实施例中,请参阅图4,图4为本申请实施例提供的一种密文数据的存放装置的基础结构框图。本实施例中该装置包括的各单元用于执行上述方法实施例中的各步骤。具体请参阅上述方法实施例中的相关描述。为了便于说明,仅示出了与本实施例相关的部分。如图4所示,密文数据的存放装置包括:获取模块41、生成模块42以及存放模块43。其中:所述获取模块41用于将业务系统产生的业务数据加密成密文数据并获取所述密文数据的加密信息。所述生成模块42用于根据所述密文数据的加密信息,按照预设的数据头生成规则生成所述密文数据对应的数据头信息,其中,所述数据头信息表征为包含有若干个字符的字符串,所述字符串中的字符用于标识所述密文数据的加密信息。所述存放模块43用于将所述数据头信息添加到所述密文数据的头部位置,生成目标数据,将所述目标数据存放于所述业务系统的密文数据库中。
本申请的一些实施例中,请参阅图5,图5为本申请实施例提供的密文数据的存放装置 中的一种细化结构框图。如图5所示,所述密文数据的存放装置还包括第一生成子模块51、第二生成子模块52、第三生成子模块53以及第一串连子模块54。其中,所述第一生成子模块51用于根据所述一个数据来源位置对应一种标识字符的规则,基于预设的字符集随机生成与所述数据来源位置信息对应的位置字符,所述位置字符用于标识所述密文数据的数据来源位置。所述第二生成子模块52用于根据所述一种加密算法对应一种标识的规则,基于预设的字符集随机生成与所述加密算法信息对应的算法字符,所述算法字符用于标识密文数据加密时所使用的加密算法。所述第三生成子模块53用于根据所述一种密钥版本对应一种标识字符的规则,基于预设的字符集随机生成与所述密钥版本信息对应的密钥版本字符,所述密钥版本字符用于标识密文数据加密时所使用的密钥版本。所述第一串连子模块54用于将所述位置字符、所述算法字符和所述密钥版本字符进行串连,生成所述密文数据对应的数据头信息。
本申请的一些实施例中,请参阅图6,图6为本申请实施例提供的一种电子设备的基本结构框图。如图6所示,该实施例的电子设备6包括:处理器61、存储器62以及存储在所述存储器62中并可在所述处理器61上运行的计算机程序63,例如密文数据的存放方法的程序。处理器61执行所述计算机程序63时实现上述各个密文数据的存放方法各实施例中的步骤。或者,所述处理器61执行所述计算机程序63时实现上述密文数据的存放装置对应的实施例中各模块的功能。具体请参阅实施例中的相关描述,此处不赘述。
示例性的,所述计算机程序63可以被分割成一个或多个模块(单元),所述一个或者多个模块被存储在所述存储器62中,并由所述处理器61执行,以完成本申请。所述一个或多个模块可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序63在所述电子设备6中的执行过程。例如,所述计算机程序63可以被分割成获取模块、生成模块以及存放模块,各模块具体功能如上所述。
所述电子设备可包括,但不仅限于,处理器61、存储器62。本领域技术人员可以理解,图6仅仅是电子设备6的示例,并不构成对电子设备6的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述电子设备还可以包括输入输出设备、网络接入设备、总线等。
所述处理器61可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器62可以是所述电子设备6的内部存储单元,例如电子设备6的硬盘或内存。所述存储器62也可以是所述电子设备6的外部存储设备,例如所述电子设备6上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器62还可以既包括所述电子设备6的内部存 储单元也包括外部存储设备。所述存储器62用于存储所述计算机程序以及所述电子设备所需的其他程序和数据。所述存储器62还可以用于暂时地存储已经输出或者将要输出的数据。
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。在本实施例中,所述计算机可读存储介质可以是非易失性的存储介质,也可以是易失性的存储介质。
本申请实施例提供了一种计算机程序产品,当计算机程序产品在移动终端上运行时,使得移动终端执行时实现可实现上述各个方法实施例中的步骤。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括是电载波信号和电信信号。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
Claims (20)
- 一种密文数据的存放方法,其中,包括:将业务系统产生的业务数据加密成密文数据并获取所述密文数据的加密信息;根据所述密文数据的加密信息,按照预设的数据头生成规则生成所述密文数据对应的数据头信息,其中,所述数据头信息表征为包含有若干个字符的字符串,所述字符串中的字符用于标识所述密文数据的加密信息;将所述数据头信息添加到所述密文数据的头部位置,生成目标数据,将所述目标数据存放于所述业务系统的密文数据库中。
- 根据权利要求1所述的密文数据的存放方法,其中,所述加密信息包括数据来源位置信息、加密算法信息、密钥版本信息。
- 根据权利要求2所述的密文数据的存放方法,其中,所述预设的数据头生成规则为标识唯一规则,包括:一个数据来源位置对应一种标识字符的规则、一种加密算法对应一种标识字符的规则、一种密钥版本对应一种标识字符的规则。
- 根据权利要求3所述的密文数据的存放方法,其中,所述根据所述密文数据的加密信息,按照预设的数据头生成规则生成所述密文数据对应的数据头信息,所述数据头信息表征为包含有若干个字符的字符串,所述字符串中的字符用于标识所述密文数据的加密信息的步骤,包括:根据所述一个数据来源位置对应一种标识字符的规则,基于预设的字符集随机生成与所述数据来源位置信息对应的位置字符,所述位置字符用于标识所述密文数据的数据来源位置;根据所述一种加密算法对应一种标识的规则,基于预设的字符集随机生成与所述加密算法信息对应的算法字符,所述算法字符用于标识密文数据加密时所使用的加密算法;根据所述一种密钥版本对应一种标识字符的规则,基于预设的字符集随机生成与所述密钥版本信息对应的密钥版本字符,所述密钥版本字符用于标识密文数据加密时所使用的密钥版本;将所述位置字符、所述算法字符和所述密钥版本字符进行串连,生成所述密文数据对应的数据头信息。
- 根据权利要求4所述的密文数据的存放方法,其中,所述根据所述密文数据的加密信息,按照预设的数据头生成规则生成所述密文数据对应的数据头信息,所述数据头信息表征为包含有若干个字符的字符串,所述字符串中的字符用于标识所述密文数据的加密信息的步骤,包括:按照预设的固定字符生成条件,从基于预设的字符集提取出满足所述固定字符生成条件的字符,将所述满足所述固定字符生成条件的字符设置为固定字符并串连到所述数据头信息中,所述固定字符用于标识所述密文数据为已加密数据。
- 根据权利要求5所述的密文数据的存放方法,其中,所述按照预设的固定字符生成条 件,从基于预设的字符集提取出满足所述固定字符生成条件的字符,将所述满足所述固定字符生成条件的字符设置为固定字符并串连到所述数据头信息中,所述固定字符用于标识所述密文数据为已加密数据的步骤,包括:收集预设数量个明文数据样本;基于预设的字符集,遍历所述预设数量个明文数据样本,统计出所述预设的字符集中各字符在所述预设数量个明文数据样本中的出现次数;将所述各字符在所述预设数量个明文数据样本中的出现次数进行顺序排序,选取排序中前三个字符设置为固定字符,采用所述固定字符标识所述密文数据为已加密数据。
- 一种密文数据的存放装置,其中,所述密文数据的存放装置包括:获取模块,用于将业务系统产生的业务数据加密成密文数据并获取所述密文数据的加密信息;生成模块,用于根据所述密文数据的加密信息,按照预设的数据头生成规则生成所述密文数据对应的数据头信息,其中,所述数据头信息表征为包含有若干个字符的字符串,所述字符串中的字符用于标识所述密文数据的加密信息;存放模块,用于将所述数据头信息添加到所述密文数据的头部位置,生成目标数据,将所述目标数据存放于所述业务系统的密文数据库中。
- 根据权利要求7所述的密文数据的存放装置,其中,所述密文数据的存放装置还包括:第一生成子模块,用于根据所述一个数据来源位置对应一种标识字符的规则,基于预设的字符集随机生成与所述数据来源位置信息对应的位置字符,所述位置字符用于标识所述密文数据的数据来源位置;第二生成子模块,用于根据所述一种加密算法对应一种标识的规则,基于预设的字符集随机生成与所述加密算法信息对应的算法字符,所述算法字符用于标识密文数据加密时所使用的加密算法;第三生成子模块,用于根据所述一种密钥版本对应一种标识字符的规则,基于预设的字符集随机生成与所述密钥版本信息对应的密钥版本字符,所述密钥版本字符用于标识密文数据加密时所使用的密钥版本;第一串连子模块,用于将所述位置字符、所述算法字符和所述密钥版本字符进行串连,生成所述密文数据对应的数据头信息。
- 一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现以下步骤:将业务系统产生的业务数据加密成密文数据并获取所述密文数据的加密信息;根据所述密文数据的加密信息,按照预设的数据头生成规则生成所述密文数据对应的数据头信息,其中,所述数据头信息表征为包含有若干个字符的字符串,所述字符串中的字符用于标识所述密文数据的加密信息;将所述数据头信息添加到所述密文数据的头部位置,生成目标数据,将所述目标数据存 放于所述业务系统的密文数据库中。
- 根据权利要求9所述的电子设备,其中,所述加密信息包括数据来源位置信息、加密算法信息、密钥版本信息。
- 根据权利要求10所述的电子设备,其中,所述预设的数据头生成规则为标识唯一规则,包括:一个数据来源位置对应一种标识字符的规则、一种加密算法对应一种标识字符的规则、一种密钥版本对应一种标识字符的规则。
- 根据权利要求11所述的电子设备,其中,在所述根据所述密文数据的加密信息,按照预设的数据头生成规则生成所述密文数据对应的数据头信息,所述数据头信息表征为包含有若干个字符的字符串,所述字符串中的字符用于标识所述密文数据的加密信息时,所述处理器执行所述计算机程序时实现以下步骤:根据所述一个数据来源位置对应一种标识字符的规则,基于预设的字符集随机生成与所述数据来源位置信息对应的位置字符,所述位置字符用于标识所述密文数据的数据来源位置;根据所述一种加密算法对应一种标识的规则,基于预设的字符集随机生成与所述加密算法信息对应的算法字符,所述算法字符用于标识密文数据加密时所使用的加密算法;根据所述一种密钥版本对应一种标识字符的规则,基于预设的字符集随机生成与所述密钥版本信息对应的密钥版本字符,所述密钥版本字符用于标识密文数据加密时所使用的密钥版本;将所述位置字符、所述算法字符和所述密钥版本字符进行串连,生成所述密文数据对应的数据头信息。
- 根据权利要求12所述的电子设备,其中,在所述根据所述密文数据的加密信息,按照预设的数据头生成规则生成所述密文数据对应的数据头信息,所述数据头信息表征为包含有若干个字符的字符串,所述字符串中的字符用于标识所述密文数据的加密信息时,所述处理器执行所述计算机程序时实现以下步骤:按照预设的固定字符生成条件,从基于预设的字符集提取出满足所述固定字符生成条件的字符,将所述满足所述固定字符生成条件的字符设置为固定字符并串连到所述数据头信息中,所述固定字符用于标识所述密文数据为已加密数据。
- 根据权利要求13所述的电子设备,其中,在所述按照预设的固定字符生成条件,从基于预设的字符集提取出满足所述固定字符生成条件的字符,将所述满足所述固定字符生成条件的字符设置为固定字符并串连到所述数据头信息中,所述固定字符用于标识所述密文数据为已加密数据时,所述处理器执行所述计算机程序时实现以下步骤:收集预设数量个明文数据样本;基于预设的字符集,遍历所述预设数量个明文数据样本,统计出所述预设的字符集中各字符在所述预设数量个明文数据样本中的出现次数;将所述各字符在所述预设数量个明文数据样本中的出现次数进行顺序排序,选取排序中前三个字符设置为固定字符,采用所述固定字符标识所述密文数据为已加密数据。
- 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其中,所述计算机程序被处理器执行时实现以下步骤:将业务系统产生的业务数据加密成密文数据并获取所述密文数据的加密信息;根据所述密文数据的加密信息,按照预设的数据头生成规则生成所述密文数据对应的数据头信息,其中,所述数据头信息表征为包含有若干个字符的字符串,所述字符串中的字符用于标识所述密文数据的加密信息;将所述数据头信息添加到所述密文数据的头部位置,生成目标数据,将所述目标数据存放于所述业务系统的密文数据库中。
- 根据权利要求15所述的存储介质,其中,所述加密信息包括数据来源位置信息、加密算法信息、密钥版本信息。
- 根据权利要求16所述的存储介质,其中,所述预设的数据头生成规则为标识唯一规则,包括:一个数据来源位置对应一种标识字符的规则、一种加密算法对应一种标识字符的规则、一种密钥版本对应一种标识字符的规则。
- 根据权利要求17所述的存储介质,其中,在所述根据所述密文数据的加密信息,按照预设的数据头生成规则生成所述密文数据对应的数据头信息,所述数据头信息表征为包含有若干个字符的字符串,所述字符串中的字符用于标识所述密文数据的加密信息时,所述计算机程序被处理器执行时实现以下步骤:根据所述一个数据来源位置对应一种标识字符的规则,基于预设的字符集随机生成与所述数据来源位置信息对应的位置字符,所述位置字符用于标识所述密文数据的数据来源位置;根据所述一种加密算法对应一种标识的规则,基于预设的字符集随机生成与所述加密算法信息对应的算法字符,所述算法字符用于标识密文数据加密时所使用的加密算法;根据所述一种密钥版本对应一种标识字符的规则,基于预设的字符集随机生成与所述密钥版本信息对应的密钥版本字符,所述密钥版本字符用于标识密文数据加密时所使用的密钥版本;将所述位置字符、所述算法字符和所述密钥版本字符进行串连,生成所述密文数据对应的数据头信息。
- 根据权利要求18所述的存储介质,其中,在所述根据所述密文数据的加密信息,按照预设的数据头生成规则生成所述密文数据对应的数据头信息,所述数据头信息表征为包含有若干个字符的字符串,所述字符串中的字符用于标识所述密文数据的加密信息时,所述计算机程序被处理器执行时实现以下步骤:按照预设的固定字符生成条件,从基于预设的字符集提取出满足所述固定字符生成条件的字符,将所述满足所述固定字符生成条件的字符设置为固定字符并串连到所述数据头信息中,所述固定字符用于标识所述密文数据为已加密数据。
- 根据权利要求19所述的存储介质,其中,在所述按照预设的固定字符生成条件,从基于预设的字符集提取出满足所述固定字符生成条件的字符,将所述满足所述固定字符生成 条件的字符设置为固定字符并串连到所述数据头信息中,所述固定字符用于标识所述密文数据为已加密数据时,所述计算机程序被处理器执行时实现以下步骤:收集预设数量个明文数据样本;基于预设的字符集,遍历所述预设数量个明文数据样本,统计出所述预设的字符集中各字符在所述预设数量个明文数据样本中的出现次数;将所述各字符在所述预设数量个明文数据样本中的出现次数进行顺序排序,选取排序中前三个字符设置为固定字符,采用所述固定字符标识所述密文数据为已加密数据。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210294093.8A CN114662146A (zh) | 2022-03-24 | 2022-03-24 | 密文数据的存放方法、装置、设备及存储介质 |
| CN202210294093.8 | 2022-03-24 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2023178792A1 true WO2023178792A1 (zh) | 2023-09-28 |
Family
ID=82030894
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2022/089999 Ceased WO2023178792A1 (zh) | 2022-03-24 | 2022-04-28 | 密文数据的存放方法、装置、设备及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN114662146A (zh) |
| WO (1) | WO2023178792A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118101197A (zh) * | 2024-04-23 | 2024-05-28 | 四川省电子产品监督检验所 | 电力系统通信的网络安全防护方法及系统 |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115828281A (zh) * | 2022-11-28 | 2023-03-21 | 中国农业银行股份有限公司 | 文本加密方法、装置、电子设备及存储介质 |
Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2018166356A1 (zh) * | 2017-03-15 | 2018-09-20 | 阿里巴巴集团控股有限公司 | 一种密钥加密方法、装置和系统 |
| CN111159757A (zh) * | 2019-12-18 | 2020-05-15 | 成都烽创科技有限公司 | 文件加密方法、解密方法及相应装置 |
| CN112055004A (zh) * | 2020-08-26 | 2020-12-08 | 中国建设银行股份有限公司 | 一种基于小程序的数据处理方法和系统 |
| CN112182109A (zh) * | 2020-10-13 | 2021-01-05 | 宁波金狮科技有限公司 | 基于区块链的分布式数据编码存储方法和电子设备 |
| CN112492352A (zh) * | 2020-11-17 | 2021-03-12 | 北京慕华信息科技有限公司 | 一种视频加解密方法、装置、电子设备及存储介质 |
| CN112597521A (zh) * | 2020-12-30 | 2021-04-02 | 厦门市美亚柏科信息股份有限公司 | 业务数据存储方法及计算机可读存储介质 |
| CN113792319A (zh) * | 2021-09-18 | 2021-12-14 | 深圳须弥云图空间科技有限公司 | 文件加密方法、装置、存储介质与电子设备 |
| CN113824728A (zh) * | 2021-09-27 | 2021-12-21 | 南京华远时代科技有限公司 | 一种基于数据加密的网络通信方法及系统 |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112257115A (zh) * | 2020-12-21 | 2021-01-22 | 北京联想协同科技有限公司 | 一种文件处理方法、装置及存储介质 |
-
2022
- 2022-03-24 CN CN202210294093.8A patent/CN114662146A/zh active Pending
- 2022-04-28 WO PCT/CN2022/089999 patent/WO2023178792A1/zh not_active Ceased
Patent Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2018166356A1 (zh) * | 2017-03-15 | 2018-09-20 | 阿里巴巴集团控股有限公司 | 一种密钥加密方法、装置和系统 |
| CN111159757A (zh) * | 2019-12-18 | 2020-05-15 | 成都烽创科技有限公司 | 文件加密方法、解密方法及相应装置 |
| CN112055004A (zh) * | 2020-08-26 | 2020-12-08 | 中国建设银行股份有限公司 | 一种基于小程序的数据处理方法和系统 |
| CN112182109A (zh) * | 2020-10-13 | 2021-01-05 | 宁波金狮科技有限公司 | 基于区块链的分布式数据编码存储方法和电子设备 |
| CN112492352A (zh) * | 2020-11-17 | 2021-03-12 | 北京慕华信息科技有限公司 | 一种视频加解密方法、装置、电子设备及存储介质 |
| CN112597521A (zh) * | 2020-12-30 | 2021-04-02 | 厦门市美亚柏科信息股份有限公司 | 业务数据存储方法及计算机可读存储介质 |
| CN113792319A (zh) * | 2021-09-18 | 2021-12-14 | 深圳须弥云图空间科技有限公司 | 文件加密方法、装置、存储介质与电子设备 |
| CN113824728A (zh) * | 2021-09-27 | 2021-12-21 | 南京华远时代科技有限公司 | 一种基于数据加密的网络通信方法及系统 |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118101197A (zh) * | 2024-04-23 | 2024-05-28 | 四川省电子产品监督检验所 | 电力系统通信的网络安全防护方法及系统 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114662146A (zh) | 2022-06-24 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109525608B (zh) | 日志上报方法和装置、日志管理方法和装置及终端设备 | |
| US20250190614A1 (en) | Encrypting data records and processing encrypted records without exposing plaintext | |
| CN112929172B (zh) | 基于密钥库动态加密数据的系统、方法及装置 | |
| CN108520183B (zh) | 一种数据存储方法及装置 | |
| US10284372B2 (en) | Method and system for secure management of computer applications | |
| US11494499B1 (en) | Searching encrypted data stores | |
| CN108256340B (zh) | 数据采集方法、装置、终端设备及存储介质 | |
| US9953184B2 (en) | Customized trusted computer for secure data processing and storage | |
| CN107707347B (zh) | 用户密钥的备份方法及装置、用户密钥的导入方法及装置 | |
| CN112163412B (zh) | 数据校验方法、装置、电子设备及存储介质 | |
| CN114840867B (zh) | 基于可交换加密数据混淆的数据查询方法、装置和系统 | |
| CN108038128B (zh) | 一种加密文件的检索方法、系统、终端设备及存储介质 | |
| US8769302B2 (en) | Encrypting data and characterization data that describes valid contents of a column | |
| CN111753320A (zh) | 基于拦截器的数据加密方法、装置及计算机设备 | |
| WO2023178792A1 (zh) | 密文数据的存放方法、装置、设备及存储介质 | |
| CN112235104B (zh) | 一种数据加密传输方法、系统、终端及存储介质 | |
| CN113626847B (zh) | 一种数据处理的方法和装置 | |
| EP4379581B1 (en) | Data processing method and apparatus, electronic device and storage medium | |
| CN118606999A (zh) | 数据脱敏方法、装置、存储介质及电子设备 | |
| CN108540513A (zh) | 请求重放攻击的判定方法和装置 | |
| US11101987B2 (en) | Adaptive encryption for entity resolution | |
| CN111859351A (zh) | 向芯片写入信息的方法、系统、服务器及存储介质 | |
| CN113434535B (zh) | 数据处理方法、通信系统、设备、产品及存储介质 | |
| CN118233098A (zh) | 基于国密算法的json字段数据加密方法、装置及存储介质 | |
| CN114239028A (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: 22932849 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: 22932849 Country of ref document: EP Kind code of ref document: A1 |