Efficient encryption method for financial data based on blockchain

By using blockchain technology to perform adaptive feature analysis and distributed storage in financial data encryption, the problem of low efficiency and security of financial data encryption is solved, and efficient and secure financial data encryption is achieved.

CN118520478BActive Publication Date: 2024-11-29BEIJING DIANKONG INTERNET INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410668265.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-28
Publication Date
2024-11-29
Estimated Expiration
2044-05-28

AI Technical Summary

Technical Problem

The existing financial data encryption methods have problems such as poor efficiency and low security, especially because the cryptobook compilation cycle is long and error-prone, resulting in low efficiency and insufficient security in financial data encryption.

Method used

Using blockchain-based financial data efficient encryption method, the target encryption key is generated by performing adaptive feature analysis of financial data within each preset time period, and the encrypted cryptographic text is stored in the blocks in the blockchain. Inside, avoid password book compilation and improve encryption efficiency and security.

Benefits of technology

The distributed encryption of financial data is realized, which reduces the risk of a single point of failure, improves encryption efficiency and security, avoids time waste and security issues caused by cryptobook compilation, and improves key derivation by comprehensively considering the characteristics of financial data. The uniqueness of salt and encryption security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118520478B_ABST
    Figure CN118520478B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data encryption technology, and in particular to an efficient encryption method for financial data based on blockchain, the method comprising: obtaining financial data within each preset time period; performing adaptive feature analysis and processing on the financial data within each preset time period, and generating a target encryption key corresponding to each preset time period, comprising: obtaining the target encryption key corresponding to the first preset time period through a key generation algorithm; performing feature analysis and processing on the financial data within a reference time period; generating a key derivation salt corresponding to the reference time period; performing key derivation on the target encryption key corresponding to the previous preset time period of the reference time period; encrypting the financial data within the preset time period; and sequentially storing the encrypted ciphertexts corresponding to all preset time periods in blocks in the blockchain. The present invention is based on blockchain, realizes distributed encryption of financial data, avoids the compilation of a code book, and thus improves the security of encrypting financial data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data encryption, and in particular to an efficient encryption method for financial data based on blockchain. Background Art

[0002] With the development of digital economy, the security and privacy protection of financial data have attracted more and more attention. Therefore, it is very important to encrypt financial data. At present, financial data encryption protection mostly relies on centralized databases, which not only exposes financial data to the risk of a single point of failure, but also makes it easier to become a target of malicious attacks, resulting in poor security of financial data encryption.

[0003] Secondly, there is also a data encryption method that currently exists: compile a code book according to the data that needs to be encrypted, and encrypt the data that needs to be encrypted according to the compiled code book.

[0004] However, when encrypting financial data by compiling a code book, the following technical problems often occur:

[0005] First, since the amount of financial data to be encrypted is often large, the codebook compilation cycle is often long, and financial data often changes in real time, and the newly generated financial data may no longer be suitable for the original codebook. Therefore, when encrypting financial data, it may be necessary to compile a codebook in real time, resulting in poor efficiency in encrypting financial data.

[0006] Second, since financial data and its data types are often large, the compiled code book may contain some financial data without password rules or with incorrect password rules, resulting in incorrect ciphertext, which in turn leads to poor security in encrypting financial data. Summary of the invention

[0007] In order to solve the technical problem of poor security in encrypting financial data, the present invention proposes an efficient encryption method for financial data based on blockchain.

[0008] The present invention provides a blockchain-based efficient encryption method for financial data, the method comprising:

[0009] Get financial data for each preset time period;

[0010] Adaptively analyzing and processing the financial data within each preset time period to generate a target encryption key corresponding to each preset time period includes: obtaining the target encryption key corresponding to the first preset time period through a key generation algorithm; determining a preset time period other than the first preset time period as a reference time period, and obtaining the target encryption key corresponding to the reference time period by: analyzing and processing the characteristics of the financial data within the reference time period according to the data volume, data update status and data type of the financial data within the reference time period to obtain a data characteristic factor corresponding to the reference time period; generating a key derivation salt corresponding to the reference time period according to the data characteristic factor corresponding to the reference time period; and deriving a key from the target encryption key corresponding to the previous preset time period of the reference time period according to the key derivation salt corresponding to the reference time period to generate a target encryption key corresponding to the reference time period;

[0011] Encrypt the financial data in each preset time period according to the target encryption key corresponding to each preset time period to obtain the encrypted ciphertext corresponding to each preset time period;

[0012] The encrypted ciphertexts corresponding to all preset time periods are stored in blocks in the blockchain in sequence.

[0013] Optionally, the analyzing and processing of the characteristics of the financial data within the reference time period according to the data volume, data update status and data type of the financial data within the reference time period to obtain the data characteristic factors corresponding to the reference time period includes:

[0014] Cluster the financial data within the reference time period to obtain a target cluster set corresponding to the reference time period;

[0015] Determine the financial attribute characteristics corresponding to the reference time period according to the amount of financial data in the reference time period, the total number of times the financial data is updated in the reference time period, and the target cluster set corresponding to the reference time period, wherein the total number of times the financial data is updated in the reference time period represents the data update status of the financial data in the reference time period;

[0016] According to the data volume of financial data in each target cluster in the target cluster set corresponding to the reference time period and the financial attribute characteristics corresponding to the reference time period, the data characteristic factor corresponding to the reference time period is determined.

[0017] Optionally, clustering the financial data within the reference time period to obtain a target cluster set corresponding to the reference time period includes:

[0018] All financial data belonging to the same data type within the reference time period are formed into target clusters, and a target cluster set corresponding to the reference time period is obtained.

[0019] Optionally, the formula corresponding to the financial attribute feature corresponding to the reference time period is:

[0020] Among them, S is the financial attribute feature corresponding to the reference time period; n is the amount of financial data in the reference time period; T is the duration corresponding to the reference time period; N is the total number of financial data updates in the reference time period; exp() is an exponential function with a natural constant as the base; A is the number of target clusters in the target cluster set corresponding to the reference time period; a is the serial number of the target cluster in the target cluster set corresponding to the reference time period; M a is the number of financial data in the ath target cluster in the target cluster set corresponding to the reference time period; M is the number of financial data in the reference time period; The base is 2 The logarithm of .

[0021] Optionally, the formula corresponding to the data characteristic factor corresponding to the reference time period is:

[0022] Among them, TZ is the data characteristic factor corresponding to the reference time period; S is the financial attribute characteristic corresponding to the reference time period; A is the number of target clusters in the target cluster set corresponding to the reference time period; a is the sequence number of the target cluster in the target cluster set corresponding to the reference time period; L a is the mean number of characters corresponding to all financial data in the ath target cluster in the target cluster set corresponding to the reference time period; n a is the amount of financial data in the ath target cluster in the target cluster set corresponding to the reference time period; n is the amount of financial data in the reference time period.

[0023] Optionally, generating a key derivation salt corresponding to the reference time period according to a data characteristic factor corresponding to the reference time period includes:

[0024] Determine the block feature code corresponding to the reference time period according to the block identifier and blockchain code of the target block corresponding to the reference time period, wherein the target block corresponding to the reference time period is a block for storing financial data within the reference time period;

[0025] According to the block characteristic code and data characteristic factor corresponding to the reference time period, a key derivation salt corresponding to the reference time period is generated.

[0026] Optionally, the formula for the key derivation salt corresponding to the reference time period is:

[0027]

[0028] Salt i =Bc i>>((TZ) i mod Q); where Salt i is the i-th character in the key derivation salt corresponding to the reference time period; Bc i is the i-th character in BC; BC is the block characteristic code corresponding to the reference time period; TZ is the data characteristic factor corresponding to the reference time period; mod is the remainder operation; Q is the length of the ASCII table; >> represents the right shift operation; Characterization The corresponding character in the ASCII table; Ascii (BID) represents the binary number corresponding to BID in the ASCII table; Ascii (CID) represents the binary number corresponding to CID in the ASCII table; BID is the block identifier of the target block corresponding to the reference time period; CID is the blockchain code of the target block corresponding to the reference time period; Represents a bitwise exclusive-or operation; i is the ordinal number of a character in the key-derivation salt or BC.

[0029] Optionally, the preset time periods are sorted in chronological order.

[0030] Optionally, encrypting the financial data in each preset time period according to the target encryption key corresponding to each preset time period to obtain the encrypted ciphertext corresponding to each preset time period includes:

[0031] According to the target encryption key corresponding to each preset time period, the financial data within each preset time period is encrypted by DES to obtain the encrypted ciphertext corresponding to each preset time period.

[0032] Optionally, the step of sequentially storing the encrypted ciphertexts corresponding to all preset time periods in blocks in the blockchain includes:

[0033] The encrypted ciphertexts corresponding to all preset time periods are stored in blocks in the blockchain in chronological order.

[0034] The present invention has the following beneficial effects:

[0035] The efficient encryption method for financial data based on blockchain of the present invention realizes distributed encryption of financial data based on blockchain, avoids the compilation of codebooks, solves the technical problems of poor efficiency and security of encrypting financial data, thereby improving the efficiency and security of encrypting financial data. First, compared with the encryption of financial data relying on a centralized database, the present invention stores the encrypted ciphertexts corresponding to all preset time periods in blocks in the blockchain in sequence, realizes distributed encryption of financial data, and can reduce the risk of single failure points faced by financial data to a certain extent, thereby improving the security of financial data encryption. Secondly, compared with encrypting financial data by compiling a codebook, the present invention performs adaptive feature analysis and processing on the financial data in each preset time period, generates a target encryption key corresponding to each preset time period, and encrypts the financial data in each preset time period based on the target encryption key corresponding to each preset time period, which can realize the encryption of financial data without compiling a codebook, thereby reducing the time waste caused by compiling a codebook to a certain extent, and can avoid the situation of poor encryption security of financial data caused by errors in compiling a codebook to a certain extent. Finally, when generating the key-derived salt corresponding to the reference time period, the present invention comprehensively considers a variety of indicators related to the characteristics of financial data, such as the amount of financial data, data update status and data type, etc., which improves the accuracy of determining the data characteristic factors to a certain extent, so that the generated key-derived salt combines the characteristics of financial data to a certain extent, thereby improving the uniqueness of the key-derived salt and thus improving the security of subsequent encryption. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0037] Figure 1 This is a flow chart of the blockchain-based efficient financial data encryption method of the present invention;

[0038] Figure 2 A flowchart of a method for obtaining a target encryption key of the present invention;

[0039] Figure 3 is a flow chart of a method for determining a data characteristic factor of the present invention;

[0040] Figure 4 This is another flow chart of the efficient blockchain-based financial data encryption method of the present invention. DETAILED DESCRIPTION

[0041] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the technical solutions proposed by the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0042] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0043] refer to Figure 1 , showing the process of some embodiments of the efficient encryption method of financial data based on blockchain according to the present invention. The efficient encryption method of financial data based on blockchain includes the following steps:

[0044] Step S1, obtaining financial data within each preset time period.

[0045] Among them, the preset time period can be a pre-set time period. For example, the duration corresponding to the preset time period can be 8 hours. The end time of the previous preset time period can be the start time of the next preset time period. The preset time periods can be sorted in chronological order, and the end time of the last preset time period can be the current time. For example, if the duration corresponding to the preset time period is 1 day, and there are 3 preset time periods in total, the 3 preset time periods can be: the day before yesterday, yesterday and today respectively. Financial data can be data related to finance. For example, financial data can be but is not limited to: user information of financial transactions, stock prices, bond yields, currency exchange rates and economic indicators.

[0046] As an example, financial data representing the financial situation in each preset time period may be collected as the financial data in each preset time period.

[0047] It should be noted that the current financial data protection strategies mostly rely on centralized databases, which not only exposes the data to the risk of a single point of failure, but also makes it more likely to become a target of malicious attacks. With the increasing frequency of financial activities, the existing data protection framework seems to be unable to cope with the growing data management challenges. In order to meet these challenges, innovative solutions are urgently needed to strengthen the security of financial data. Blockchain technology, with its distributed ledger characteristics and tamper-proof data recording method, provides a new security protection idea. This technology ensures the security and integrity of the data by dispersing and storing data in a wide range of network nodes, and combines it with advanced encryption technology, thereby fundamentally overcoming the defects of traditional financial data protection models. Therefore, the present invention encrypts financial data based on blockchain technology.

[0048] Step S2, performing adaptive feature analysis on the financial data within each preset time period to generate a target encryption key corresponding to each preset time period.

[0049] The target encryption key corresponding to the preset time period may be an encryption key used to encrypt financial data within the preset time period. The target encryption key corresponding to the first preset time period may be obtained by a key generation algorithm. A preset time period other than the first preset time period may be determined as a reference time period.

[0050] It should be noted that financial data within a preset time period often needs to be encrypted and stored in a block in the blockchain. For financial data under the blockchain, due to its unique and tamper-proof characteristics, the financial data stored in each block is often different, that is, the data linked to the blockchain each time is often dynamically changing, and the dynamically changing key is exactly what is needed in a highly public and decentralized blockchain. Therefore, dynamically changing financial data can provide sufficient dynamic characteristics when generating keys to a certain extent. Therefore, the financial data within the preset time period is subjected to adaptive feature analysis and processing, and the target encryption key corresponding to the preset time period generated is the dynamically changing key required to encrypt the financial data within the preset time period.

[0051] As an example, the method for obtaining the target encryption key corresponding to the reference time period can be as follows: Figure 2 As shown, the following steps may be specifically included:

[0052] Step 201 , analyzing and processing the characteristics of the financial data within the reference time period according to the data volume, data update status and data type of the financial data within the reference time period, to obtain the data characteristic factors corresponding to the reference time period.

[0053] The amount of financial data in the reference time period can be represented by the number of characters of all financial data in the reference time period. The data type can be a conventional data type or a financial data type. For example, conventional data types can be, but are not limited to, integer, floating point, character, string, and Boolean. Financial data types can be, but are not limited to, stock data, bond data, currency data, economic indicators, fund data, and risk data.

[0054] For example, the method for determining the data characteristic factor corresponding to the reference time period can be as follows: Figure 3 As shown, the following steps may be specifically included:

[0055] Step 301 , clustering the financial data within a reference time period to obtain a target cluster set corresponding to the reference time period.

[0056] For example, all financial data belonging to the same data type within a reference time period may be formed into a target cluster, and a target cluster set corresponding to the reference time period may be obtained.

[0057] Step 302 : determining the financial attribute characteristics corresponding to the reference time period according to the amount of financial data in the reference time period, the total number of times the financial data is updated in the reference time period, and the target cluster set corresponding to the reference time period.

[0058] The total number of financial data updates within the reference time period can represent the data update status of the financial data within the reference time period. The method for obtaining the total number of financial data updates within the reference time period can be: divide the reference time period equally to obtain multiple sub-time periods, and if the financial data within the sub-time period is updated, then the sub-time period is recorded as a candidate time period, and the number of candidate time periods is the total number of financial data updates within the reference time period. For example, if the reference time period is divided into 3 sub-time periods, and there are 2 sub-time periods in which financial data updates occur among the 3 sub-time periods, then the total number of financial data updates within the reference time period can be 2.

[0059] It should be noted that financial data is often updated within a period of time. For example, stock data in financial data is often updated in real time.

[0060] For example, the formula corresponding to the financial attribute characteristics corresponding to the reference time period can be:

[0061] Where S is the financial attribute feature corresponding to the reference time period. n is the amount of financial data in the reference time period. T is the duration corresponding to the reference time period. N is the total number of financial data updates in the reference time period. exp() is an exponential function with a natural constant as the base. A is the number of target clusters in the target cluster set corresponding to the reference time period. a is the sequence number of the target cluster in the target cluster set corresponding to the reference time period. M a is the number of financial data in the ath target cluster in the target cluster set corresponding to the reference time period. M is the number of financial data in the reference time period. The base is 2 The logarithm of .

[0062] It should be noted that financial data is complex and diverse, and most of the financial data is related to the financial-related events it contains. Moreover, these financial data are often collected in the order in which the financial events occurred. Therefore, they often have a time span of data, and during the collection process, there may be update operations such as adding and modifying data as time changes. Therefore, the characteristics of the financial data in the reference time period can be represented by the data volume, data update status and data type in the reference time period. It can represent the average update times of financial data within a reference time period. It can characterize the chaotic distribution of financial data within the reference time period. Therefore, S can characterize the data distribution characteristics, update changes and data volume of financial data within the reference time period, and thus can characterize the characteristics of financial data within the reference time period.

[0063] Step 303: determine the data characteristic factor corresponding to the reference time period according to the data volume of the financial data in each target cluster in the target cluster set corresponding to the reference time period and the financial attribute characteristics corresponding to the reference time period.

[0064] The amount of financial data in the target cluster can be represented by the number of characters of all financial data in the target cluster.

[0065] For example, the formula corresponding to the data characteristic factor corresponding to the reference time period can be:

[0066] Where TZ is the data feature factor corresponding to the reference time period. S is the financial attribute feature corresponding to the reference time period. A is the number of target clusters in the target cluster set corresponding to the reference time period. a is the sequence number of the target cluster in the target cluster set corresponding to the reference time period. L aIt is the mean value of the number of characters corresponding to all financial data in the ath target cluster in the target cluster set corresponding to the reference time period. The number of characters corresponding to financial data, that is, the number of characters in financial data. The number of characters corresponding to financial data can represent the length of financial data. a is the amount of financial data in the ath target cluster in the target cluster set corresponding to the reference time period. n is the amount of financial data in the reference time period.

[0067] It should be noted that for financial data, due to its privacy, if the content therein is used to extract data features, it may lead to reverse cracking of the data, thereby causing data leakage. Therefore, the embodiments of the present invention do not consider the specific content contained in the financial data when extracting data features. Among them, reverse cracking is a cracking method that uses deep learning and artificial intelligence to analyze features and vulnerabilities. The embodiments of the present invention use the relevant statistical features of characters in the financial data to extract features. For different financial data, due to their different data types or internal details, there may be changes in the statistical features of the relevant characters. Therefore, by using the statistical features of the characters, while completing the feature extraction of the financial data, it is also possible to protect data privacy. S can characterize the data distribution characteristics, update changes and data volume of the financial data within the reference time period, so that the characteristics of the financial data within the reference time period can be characterized. It can characterize the changes in the number of characters and the amount of data of different financial data within the reference time period, and can characterize the changes in the statistical characteristics of related characters of different financial data within the reference time period. Therefore, TZ can characterize the characteristics of dynamic changes in financial data within the reference time period.

[0068] Step 202, generating a key derivation salt corresponding to the reference time period according to the data characteristic factor corresponding to the reference time period may include the following steps:

[0069] The first step is to determine the block feature code corresponding to the reference time period based on the block identifier and blockchain code of the target block corresponding to the reference time period.

[0070] The target block corresponding to the reference time period is the block in which the financial data within the reference time period is to be stored. The block in which the financial data within the reference time period is to be stored is the block in which the financial data within the reference time period needs to be stored. For example, if a reference time period is the second preset time period, the target block corresponding to the reference time period may be the second block in the blockchain. A block identifier is a string of numbers and letters that uniquely identifies a block. A blockchain code is a code used to identify a blockchain.

[0071] The second step is to generate the key derivation salt corresponding to the reference time period based on the block characteristic code and data characteristic factor corresponding to the reference time period.

[0072] For example, the formula for the key derivation salt corresponding to the reference time period can be:

[0073]

[0074] Salt i =Bc i >>((TZ) i mod Q); where Salt i is the i-th character in the key derivation salt corresponding to the reference time period. i It is the i-th character in BC. BC is the block characteristic code corresponding to the reference time period. TZ is the data characteristic factor corresponding to the reference time period. mod is the remainder operation. Q is the length of the ASCII table. For example, the length of the ASCII table can be represented by the number of characters in the ASCII (American Standard Code for Information Interchange) table. As shown in Table 1, the number of characters in the partial ASCII table is 4, namely D, E, F and G. And the binary numbers corresponding to D, E, F and G in the ASCII table are 1000100, 1000101, 1000110 and 1000111 respectively. >> represents the right shift operation. That is, Bc i >>((TZ) i mod Q) represents the same as Bc in the ASCII table i Same character after (TZ) i mod Q characters. If the ASCII table matches Bc i The same character is not followed by a string (TZ) i mod Q characters, the missing characters can be supplemented in order with the previous characters in the ASCII table. For example, if Bc i The character represented is the last character in the ASCII table, and (TZ) i mod Q is equal to 6, then Bc i >>((TZ) i mod Q) can be represented by the sixth character in the ASCII table. Characterization The corresponding character in the ASCII table. Ascii(BID) represents the binary number corresponding to BID in the ASCII table. Ascii(CID) represents the binary number corresponding to CID in the ASCII table. BID is the block identifier of the target block corresponding to the reference time period. CID is the blockchain code of the target block corresponding to the reference time period. Indicates a bitwise XOR operation. For example, 10101000 10010101 can be 00111101. i is the ordinal number of a character in the key derivation salt or BC.

[0075] Table 1

[0076] character Binary Decimal hexadecimal … … … … D 1000100 68 44 E 1000101 69 45 F 1000110 70 46 G 1000111 71 47 … … … …

[0077] It should be noted that for financial data, since it is based on blockchain, the blockchain code of the entire blockchain is fixed, but the block identifier corresponding to the newly added block is random. Therefore, it can be used to extract features of the current blockchain structure and obtain the block feature code; then the data feature factor and the block feature code are used to generate a unique key derivation salt. Therefore, it is necessary to use XOR operation to confuse this information, so that although the key-derived salt is generated by the above information, the result is that the binary obfuscation is used. After converting it back to a string, a code with no correlation with the original generated content in character expression will be obtained. Finally, the data feature factor is used to confuse it again using the Caesar encryption method, so that the key-derived salt is unique and difficult to be parsed and decomposed, further enhancing the security of subsequent encryption operations.

[0078] Step 203 , based on the key derivation salt corresponding to the reference time period, derive the target encryption key corresponding to the previous preset time period of the reference time period to generate the target encryption key corresponding to the reference time period.

[0079] For example, a key can be derived using a PBKDF (Password-Based Key Derivation Function) key derivation algorithm based on a key derivation salt corresponding to a reference time period and a target encryption key corresponding to a previous preset time period, and the obtained encryption key is the target encryption key corresponding to the reference time period.

[0080] Step S3, encrypting the financial data in each preset time period according to the target encryption key corresponding to each preset time period to obtain the encrypted ciphertext corresponding to each preset time period.

[0081] As an example, the financial data in each preset time period may be encrypted using DES (Data Encryption Standard) according to the target encryption key corresponding to each preset time period to obtain an encrypted ciphertext corresponding to each preset time period.

[0082] Step S4, storing the encrypted ciphertexts corresponding to all preset time periods in blocks in the blockchain in sequence.

[0083] As an example, the encrypted ciphertexts corresponding to all preset time periods can be stored in blocks in the blockchain in chronological order. That is, the encrypted ciphertext corresponding to the first preset time period can be stored in the first block in the blockchain, the encrypted ciphertext corresponding to the second preset time period can be stored in the second block in the blockchain, the encrypted ciphertext corresponding to the third preset time period can be stored in the third block in the blockchain, and so on, until the encrypted ciphertexts corresponding to all preset time periods are stored in the blockchain.

[0084] It should be noted that all financial data is stored in blocks in the blockchain, and a hash algorithm is used to calculate the data summary, so that the content stored in the block can be guaranteed to be unique within the block, without any readability and digability. The data summary is completed and the summary content is stored in a new block, which is connected to the previous block in the blockchain to complete the data upload work of this supply link, and wait for the call when the next link generates a block and the subsequent block connection.

[0085] Another flow chart of the present invention can be as follows Figure 4 shown.

[0086] In summary, compared with the encryption of financial data relying on a centralized database, the present invention stores the encrypted ciphertexts corresponding to all preset time periods in the blocks in the blockchain in sequence, realizes the distributed encryption of financial data, can reduce the risk of single failure points faced by financial data to a certain extent, thereby improving the security of financial data encryption. Secondly, compared with encrypting financial data by compiling a code book, the present invention performs adaptive feature analysis and processing on the financial data in each preset time period, generates a target encryption key corresponding to each preset time period, and encrypts the financial data in each preset time period based on the target encryption key corresponding to each preset time period, can realize the encryption of financial data without compiling a code book, thereby reducing the time waste caused by compiling a code book to a certain extent, and can avoid the situation of poor security of financial data encryption caused by errors in compiling a code book to a certain extent. Finally, when generating the key derivation salt corresponding to the reference time period, the present invention comprehensively considers a variety of indicators related to the characteristics of financial data, such as the amount of financial data, data update status and data type, etc., to a certain extent, improves the accuracy of determining the data characteristic factor, so that the generated key derivation salt combines the characteristics of financial data to a certain extent, thereby improving the uniqueness of the key derivation salt, thereby improving the security of subsequent encryption.

[0087] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. An efficient encryption method for financial data based on blockchain, characterized in that: The following steps are involved: Get financial data for each preset time period; Adaptively analyzing and processing the financial data within each preset time period to generate a target encryption key corresponding to each preset time period includes: obtaining the target encryption key corresponding to the first preset time period through a key generation algorithm; determining a preset time period other than the first preset time period as a reference time period, and obtaining the target encryption key corresponding to the reference time period by: analyzing and processing the characteristics of the financial data within the reference time period according to the data volume, data update status and data type of the financial data within the reference time period to obtain a data characteristic factor corresponding to the reference time period; generating a key derivation salt corresponding to the reference time period according to the data characteristic factor corresponding to the reference time period; and deriving a key from the target encryption key corresponding to the previous preset time period of the reference time period according to the key derivation salt corresponding to the reference time period to generate a target encryption key corresponding to the reference time period; Encrypt the financial data in each preset time period according to the target encryption key corresponding to each preset time period to obtain the encrypted ciphertext corresponding to each preset time period; The encrypted ciphertexts corresponding to all preset time periods are stored in blocks in the blockchain in sequence; The method of analyzing and processing the characteristics of the financial data within the reference time period according to the data volume, data update status and data type of the financial data within the reference time period to obtain the data characteristic factors corresponding to the reference time period includes: Cluster the financial data within the reference time period to obtain a target cluster set corresponding to the reference time period; Determine the financial attribute characteristics corresponding to the reference time period according to the amount of financial data in the reference time period, the total number of times the financial data is updated in the reference time period, and the target cluster set corresponding to the reference time period, wherein the total number of times the financial data is updated in the reference time period represents the data update status of the financial data in the reference time period; According to the data volume of financial data in each target cluster in the target cluster set corresponding to the reference time period and the financial attribute characteristics corresponding to the reference time period, the data characteristic factor corresponding to the reference time period is determined.

2. According to the blockchain-based efficient financial data encryption method of claim 1, it is characterized in that: The step of clustering the financial data within the reference time period to obtain a target cluster set corresponding to the reference time period includes: All financial data belonging to the same data type within the reference time period are formed into target clusters, and a target cluster set corresponding to the reference time period is obtained.

3. According to the blockchain-based efficient financial data encryption method of claim 1, it is characterized in that: The formula corresponding to the financial attribute characteristics of the reference time period is: Among them, S is the financial attribute feature corresponding to the reference time period; n is the amount of financial data in the reference time period; T is the duration corresponding to the reference time period; N is the total number of financial data updates in the reference time period; exp() is an exponential function with a natural constant as the base; A is the number of target clusters in the target cluster set corresponding to the reference time period; a is the serial number of the target cluster in the target cluster set corresponding to the reference time period; M a is the number of financial data in the ath target cluster in the target cluster set corresponding to the reference time period; M is the number of financial data in the reference time period; The base is 2 The logarithm of .

4. According to the blockchain-based efficient financial data encryption method of claim 1, it is characterized in that: The formula corresponding to the data characteristic factor corresponding to the reference time period is: Among them, TZ is the data characteristic factor corresponding to the reference time period; S is the financial attribute characteristic corresponding to the reference time period; A is the number of target clusters in the target cluster set corresponding to the reference time period; a is the sequence number of the target cluster in the target cluster set corresponding to the reference time period; L a is the mean number of characters corresponding to all financial data in the ath target cluster in the target cluster set corresponding to the reference time period; n a is the amount of financial data in the ath target cluster in the target cluster set corresponding to the reference time period; n is the amount of financial data in the reference time period.

5. According to the blockchain-based efficient financial data encryption method of claim 1, it is characterized in that: The step of generating a key derivation salt corresponding to the reference time period according to the data characteristic factor corresponding to the reference time period includes: Determine the block feature code corresponding to the reference time period according to the block identifier and blockchain code of the target block corresponding to the reference time period, wherein the target block corresponding to the reference time period is a block for storing financial data within the reference time period; According to the block characteristic code and data characteristic factor corresponding to the reference time period, a key derivation salt corresponding to the reference time period is generated.

6. According to claim 5, a blockchain-based efficient financial data encryption method is characterized in that: The formula for the key derivation salt corresponding to the reference time period is: Salt i =Bc i >>((TZ) i mod Q); where Salt i is the i-th character in the key derivation salt corresponding to the reference time period; Bc i is the i-th character in BC; BC is the block characteristic code corresponding to the reference time period; TZ is the data characteristic factor corresponding to the reference time period; mod is the remainder operation; Q is the length of the ASCII table; >> represents the right shift operation; Characterization The corresponding character in the ASCII table; Ascii (BID) represents the binary number corresponding to BID in the ASCII table; Ascii (CID) represents the binary number corresponding to CID in the ASCII table; BID is the block identifier of the target block corresponding to the reference time period; CID is the blockchain code of the target block corresponding to the reference time period; Represents a bitwise exclusive-or operation; i is the ordinal number of a character in the key-derivation salt or BC.

7. The efficient encryption method for financial data based on blockchain according to claim 1 is characterized in that: The preset time periods are sorted in chronological order.

8. The efficient encryption method for financial data based on blockchain according to claim 1 is characterized in that: The method of encrypting the financial data in each preset time period according to the target encryption key corresponding to each preset time period to obtain the encrypted ciphertext corresponding to each preset time period includes: According to the target encryption key corresponding to each preset time period, the financial data within each preset time period is encrypted by DES to obtain the encrypted ciphertext corresponding to each preset time period.

9. The efficient encryption method for financial data based on blockchain according to claim 1 is characterized in that: The step of sequentially storing the encrypted ciphertexts corresponding to all preset time periods in blocks in the blockchain includes: The encrypted ciphertexts corresponding to all preset time periods are stored in blocks in the blockchain in chronological order.

Citation Information

Patent Citations

  • Video encryption and decryption method and system

    CN109413449A

  • Electric energy quality data encryption method and device

    CN116170193A

  • Distributed, centrally authored block chain network

    US20170366357A1