A security detection method based on blockchain and digital currency
By using persistent memory and encryption engines to generate currency ciphertexts in the blockchain system, combining encryption counters and combination strategies, the problem of incomplete digital currency transaction security detection is solved, and higher security and transaction data protection is achieved .
Patent Information
- Application Number
- CN202211102315.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-09
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2042-09-09
AI Technical Summary
The security detection mechanism for existing digital currency transactions is incomplete, with high risks, and there is a risk of tampering and intrusion.
Adopt data security detection methods based on blockchain and digital currency, and by introducing persistent memory and encryption engines into the blockchain system, generating currency ciphertexts and performing XOR operations, combining encryption counters and combination strategies to realize digital currency Safety inspection.
It improves the security of digital currency transactions, reduces the risk of transaction data leakage, and ensures the encryption and integrity of the transaction process.
Smart Images

Figure CN116318760B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to a data security detection method based on blockchain and digital currency. Background Art
[0002] With the development of science and technology, the use of digital currency has become more and more frequent. The circulation of existing digital currency is typically through UTXO. The transaction address serves as the payment or payment end of virtual digital currency. Each transaction core contains the payment end transaction address, the payment end transaction address and the amount. Users hold virtual digital currency by calculating the UTXO of the transaction address they own. Users pay virtual digital currency by initiating new transactions, thereby changing the UTXO balance of the payment and payment end transaction addresses. In essence, there is no transfer of currency in the current circulation of virtual digital currency, but only a set of continuous transaction records.
[0003] In summary, there is essentially no money transfer in digital currency transactions, only continuous transaction records. Therefore, the security requirements for digital currency transactions are very high to prevent abnormal transaction records due to tampering or intrusion. However, the existing security detection mechanism for digital currency transactions is imperfect and the risk is relatively high. Summary of the invention
[0004] The present invention provides a data security detection method based on blockchain and digital currency, the main purpose of which is to solve the problems of imperfect security detection mechanism and high risk of existing digital currency transactions.
[0005] To achieve the above purpose, the present invention provides a data security detection method based on blockchain and digital currency, comprising:
[0006] Receiving a digital currency transfer instruction, and starting a blockchain system where a digital currency transaction is located according to the digital currency transfer instruction, wherein the blockchain system includes a payment block, a central transaction block, a payment block, and a persistent memory, and the persistent memory includes an encryption engine and an encryption counter;
[0007] Determine the transfer amount of the digital currency transfer instruction, and select a digital currency string set from the payment block according to the transfer amount;
[0008] Generate a notification instruction to be encrypted, and notify the persistent memory to perform a digital currency string encryption operation according to the notification instruction to be encrypted, and when receiving an executable encryption instruction fed back by the persistent memory, send the digital currency string set to the persistent memory;
[0009] A cache line address is opened in the persistent memory, and the count value of the encryption counter is read at this time, and the digital currency string set, the cache line address and the count value are input into the encryption engine for encryption to obtain a one-time filling value;
[0010] Performing an XOR operation on the one-time filling value and the cache line address to obtain a currency ciphertext, and sending the currency ciphertext to the central transaction block;
[0011] When the central transaction block receives the currency ciphertext, it verifies the security of the payment block according to the security agreement signed in advance with the payment block. When the payment block passes the security verification, it extracts the one-time filling value from the currency ciphertext, registers the one-time filling value as invalid, and generates a filling value destination string;
[0012] The destination string of the filling value is sent to the payment block, and according to the encryption and decryption protocol signed between the payment block and the persistent memory, the destination string of the filling value is parsed to obtain the transfer amount, thereby completing the security detection of the digital currency.
[0013] Optionally, the step of obtaining a digital currency string set from the payment block according to the transfer amount comprises:
[0014] Extracting existing digital currency characters from the payment block to obtain one or more currency characters to be combined, wherein the currency characters to be combined include a combined currency character representing the number 1;
[0015] Selecting a combination strategy corresponding to the transfer amount from a pre-defined combination strategy set, and combining one or more of the currency characters to be combined using the combination strategy to obtain a currency string set to be proofread;
[0016] Extracting the memory value of the currency string set to be collated, and determining whether the memory value is greater than a specified memory threshold;
[0017] If the memory value is greater than the specified memory threshold, apply to the central transaction block to obtain the application currency character set, and use the application currency character set and the currency character set to be combined to obtain the currency string set to be proofread;
[0018] Until the memory value is less than or equal to the specified memory threshold, the currency string set to be verified is determined to be the digital currency string set.
[0019] Optionally, the step of combining one or more of the currency characters to be combined using the combination strategy to obtain a currency string set to be proofread includes:
[0020] Determine whether the existing digital currency characters can be combined to obtain a digital currency string set corresponding to the transfer amount;
[0021] If the existing digital currency characters can be directly combined to obtain a digital currency string set corresponding to the transfer amount, directly use the combination strategy to combine one or more of the currency characters to be combined to obtain a currency string set to be verified;
[0022] If the existing digital currency characters cannot be combined to obtain a digital currency character set corresponding to the transfer amount, apply to the central transaction block to obtain a supplementary currency character set;
[0023] The supplementary currency character set and one or more of the currency characters to be combined are combined using the combination strategy to obtain a currency string set to be collated.
[0024] Optionally, the step of allocating a cache line address in the persistent memory includes:
[0025] Reading one or more free memory areas of the persistent memory;
[0026] Selecting an idle memory area corresponding to the memory value of the digital currency string set from one or more of the idle memory areas to obtain a currency storage area;
[0027] The first row storage address of the currency storage area is read row by row, and the first row storage address is converted into a binary form to obtain the cache row address.
[0028] Optionally, reading the count value of the encryption counter at this time includes:
[0029] Determining the number of encryption bits of the encryption counter;
[0030] Read the encrypted binary value of each encryption bit in turn, and record the reading time corresponding to each encrypted binary value;
[0031] Each encrypted binary value is combined in sequence to obtain the count value.
[0032] Optionally, the step of inputting the digital currency string set, the cache line address and the count value into the encryption engine for encryption to obtain a one-time filling value includes:
[0033] Obtain the binary number corresponding to the digital currency string set to obtain the digital currency binary number;
[0034] Convert the digital currency binary, cache row address and count value into decimal to obtain digital currency decimal, cache address decimal and count decimal;
[0035] The digital currency decimal, cache address decimal and counting decimal are used as input parameters of the encryption function pre-built in the encryption engine to calculate the one-time filling value.
[0036] Optionally, the one-time filling value is calculated from the input parameter of the encryption function pre-built in the encryption engine, including:
[0037] The following encryption function is used to receive the digital currency in decimal, the cache address in decimal, and the counting in decimal, and the one-time filling value is calculated:
[0038]
[0039] Among them, f(w; x; y) represents the one-time filling value, w is the cache address in decimal, x is the digital currency in decimal, y is the counting in decimal, α, γ, η, β1 and β2 are predetermined encryption fixed parameters.
[0040] Optionally, performing an XOR operation on the one-time filling value and the cache line address to obtain the currency ciphertext includes:
[0041] Converting the one-time filling value into binary form to obtain a binary filling value;
[0042] Match the binary fill value to the cache line address in one-to-one correspondence according to the number of bits. If the number of bits of the binary fill value is less than the number of bits of the cache line address, or the number of bits of the cache line address is less than the number of bits of the binary fill value, fill the missing bits with the number 0 until the number of bits of the binary fill value corresponds to the number of bits of the cache line address in one-to-one correspondence;
[0043] The currency ciphertext is obtained by performing an XOR operation on each group of corresponding digits.
[0044] Optionally, registering the one-time filling value as an invalid state includes:
[0045] Add a specified identifier before the first digit of the one-time filling value to obtain an invalid filling value;
[0046] Binding the voided filling value to the one-time filling value to obtain a one-time-voided filling value;
[0047] The one-time filling value stored in the payment block and the persistent memory is replaced with the one-time-invalidated filling value to complete the registration of the invalidated status of the one-time filling value.
[0048] In order to solve the above problems, the present invention also provides a cloud computing center device based on blockchain and digital currency data security detection, the cloud computing center device comprising:
[0049] A digital currency transaction initiation module, configured to receive a digital currency transfer instruction, and initiate a blockchain system where a digital currency transaction is located according to the digital currency transfer instruction, wherein the blockchain system includes a payment block, a central transaction block, a payment collection block, and a persistent memory, and the persistent memory includes an encryption engine and an encryption counter;
[0050] The persistent memory data receiving module is used to determine the transfer amount of the digital currency transfer instruction, select a digital currency string set from the payment block according to the transfer amount, generate a notification instruction to be encrypted, and notify the persistent memory to perform a digital currency string encryption operation according to the notification instruction to be encrypted, and when receiving an executable encryption instruction fed back by the persistent memory, send the digital currency string set to the persistent memory;
[0051] An encryption module is used to allocate a cache line address in the persistent memory, read the count value of the encryption counter at this time, input the digital currency string set, the cache line address and the count value into the encryption engine for encryption, obtain a one-time filling value, perform an XOR operation on the one-time filling value and the cache line address to obtain a currency ciphertext, and send the currency ciphertext to the central transaction block;
[0052] A security verification module, configured to verify the security of the payment block according to a security agreement signed in advance with the payment block when the central transaction block receives the currency ciphertext; when the payment block passes the security verification, extract the one-time filling value from the currency ciphertext, register the one-time filling value as invalid, and generate a filling value destination string;
[0053] The currency transfer module is used to send the filling value destination string to the payment block, parse the filling value destination string according to the encryption and decryption protocol signed between the payment block and the persistent memory, obtain the transfer amount, and complete the security detection of the digital currency.
[0054] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0055] a memory storing at least one instruction; and
[0056] The processor executes the instructions stored in the memory to implement the data security detection method based on blockchain and digital currency as described above.
[0057] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one instruction is stored. The at least one instruction is executed by a processor in an electronic device to implement the above-mentioned data security detection method based on blockchain and digital currency.
[0058] In order to solve the problems described in the background technology, the embodiment of the present invention integrates the entire digital currency transaction into the blockchain system, that is, receives a digital currency transfer instruction, and starts the blockchain system where the digital currency transaction is located according to the digital currency transfer instruction, wherein the blockchain system includes a payment block, a central transaction block, a collection block and a persistent memory, and the persistent memory includes an encryption engine and an encryption counter. Compared with the traditional blockchain system, the implementation of the present invention also adds a persistent memory, wherein the persistent memory is used to encrypt the digital amount of the entire transaction, further improving the transaction security. In detail, in order to prevent the problem of being easily cracked by directly using the digital amount to execute the transaction, the embodiment of the present invention selects a digital currency string set from the payment block according to the transfer amount, and the character amount is more secure than the digital amount. In addition, a cache line address is opened in the persistent memory, and the count value of the encryption counter is read at this time, and the digital currency string set, the cache line address and the count value are input into the encryption engine for encryption to obtain a one-time filling value, and the one-time filling value is XORed with the cache line address to obtain a currency ciphertext, and the currency ciphertext is obtained. The text is sent to the central transaction block, thereby the entire digital currency transaction process is cleverly converted into an encryption process. Even if the transaction status is cracked, the risk of transaction data leakage can be effectively reduced due to the protection of the encryption operation. Finally, when the central transaction block receives the currency ciphertext, it verifies the security of the payment block according to the security agreement signed in advance with the payment block. When the payment block passes the security check, the one-time filling value is extracted from the currency ciphertext, and the one-time filling value is registered as an invalid state. Then, a filling value destination string is generated, and the filling value destination string is sent to the payment block. According to the encryption and decryption protocol signed between the payment block and the persistent memory, the filling value destination string is parsed to obtain the transfer amount, and the security detection of the digital currency is completed. Therefore, the data security detection method, device, electronic device and computer-readable storage medium based on blockchain and digital currency proposed in the present invention can solve the problems of imperfect security detection mechanism and high risk of existing digital currency transactions. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 A flowchart of a data security detection method based on blockchain and digital currency provided by an embodiment of the present invention;
[0060] Figure 2 for Figure 1 A detailed implementation flow chart of one of the steps in the process;
[0061] Figure 3 for Figure 1 Example diagram of an encrypted counter;
[0062] Figure 4 A functional module diagram of a cloud computing center device for data security detection based on blockchain and digital currency provided by one embodiment of the present invention;
[0063] Figure 5 A schematic diagram of the structure of an electronic device for implementing the data security detection method based on blockchain and digital currency provided in one embodiment of the present invention.
[0064] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0065] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0066] The embodiment of the present application provides a data security detection method based on blockchain and digital currency. The execution subject of the data security detection method based on blockchain and digital currency includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the data security detection method based on blockchain and digital currency can be executed by software or hardware installed on a terminal device or a server device. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.
[0067] Reference Figure 1 As shown, it is a flow chart of a data security detection method based on blockchain and digital currency provided by an embodiment of the present invention. In this embodiment, the data security detection method based on blockchain and digital currency includes:
[0068] S1. Receive a digital currency transfer instruction, and start a blockchain system where the digital currency transaction is located according to the digital currency transfer instruction, wherein the blockchain system includes a payment block, a central transaction block, a collection block and a persistent memory, and the persistent memory includes an encryption engine and an encryption counter.
[0069] It should be understood that digital currency has transaction attributes, so the digital currency transfer instruction described in the embodiment of the present invention is generally a transfer instruction initiated by the digital currency initiator, has transaction attributes and includes a numerical value. For example, Company A needs to pay Company B a project fee of three million, so a digital currency transfer instruction with a value of three million is generated through a pre-built transfer system.
[0070] Furthermore, in order to improve the security of digital currency transactions, all transaction processes in the embodiments of the present invention are completed based on blockchain technology, and a blockchain system is constructed based on blockchain technology for digital currency transactions.
[0071] What needs to be understood in detail is that the blockchain system includes a payment block, a central transaction block, a collection block and a persistent memory, and the persistent memory includes an encryption engine and an encryption counter. Among them, the payment block is generally connected to the transfer system. When the transfer system generates a digital currency transfer instruction, it will notify the payment block to start executing the digital currency transaction; the central transaction block is used to uniformly manage the collection and payment work of different payment blocks and collection blocks, so the collection block, payment block and central transaction block are in a many-to-one relationship; when the central transaction block completes the clearing of digital currency, transaction records and other tasks, it will notify the collection block to implement the collection operation.
[0072] In addition, since the blockchain system already has the characteristic of high security, the embodiment of the present invention further adds a core technical point to the entire blockchain system, namely: persistent memory, in order to further improve the security of digital currency.
[0073] It should be explained that in recent years, persistent memory, referred to as PM (persistent memory, PM), is constructed based on the new non-volatile memory (NVM) installed on the memory bus of the blockchain system. Among them, the new non-volatile memory includes phase change memory (PCM), resistive random access memory (ReRAM), etc. Compared with traditional storage devices, such as hard disk drive (HDD) and solid state drive (SSD), persistent memory has the advantages of low access latency, byte addressability, high storage density, and low static power consumption. After combining with the blockchain system, the security of digital currency transactions is greatly improved.
[0074] Furthermore, the persistent memory includes an encryption engine and an encryption counter. The encryption engine is mainly used to encrypt the transfer amount initiated by the subsequent payment block. The encryption counter generates a count value before the encryption engine performs encryption to improve encryption security, and uses the count value as one of the encryption parameters, thereby improving encryption security.
[0075] S2. Determine the transfer amount of the digital currency transfer instruction, and select a digital currency string set from the payment block according to the transfer amount.
[0076] For example, if Company A initiates a digital currency transfer instruction of three million to Company B, the corresponding transfer amount is 3,000,000.
[0077] However, strictly speaking, the digital transfer amount has a simple structure and is at great risk of being cracked during the digital currency transmission process. Therefore, in order to improve transmission security, the embodiment of the present invention needs to select the currency in character form according to the transfer amount, that is, the digital currency string set.
[0078] For details, see Figure 2 As shown, the digital currency string set is obtained by selecting from the payment block according to the transfer amount, including:
[0079] S21, extracting existing digital currency characters from the payment block to obtain one or more currency characters to be combined, wherein the currency characters to be combined include a combined currency character representing the number 1;
[0080] S22, selecting a combination strategy corresponding to the transfer amount from a pre-defined combination strategy set, and combining one or more of the currency characters to be combined using the combination strategy to obtain a currency string set to be proofread;
[0081] S23, extracting the memory value of the currency string set to be collated, and determining whether the memory value is greater than a specified memory threshold;
[0082] S24. If the memory value is greater than the specified memory threshold, apply to the central transaction block to obtain an application currency character set, and use the application currency character set and the currency character set to be combined to obtain a currency string set to be collated;
[0083] S25. Until the memory value is less than or equal to the specified memory threshold, determine that the currency string set to be verified is the digital currency string set.
[0084] Furthermore, the method of combining one or more of the currency characters to be combined using the combination strategy to obtain a currency string set to be proofread includes:
[0085] Determine whether the existing digital currency characters can be combined to obtain a digital currency string set corresponding to the transfer amount;
[0086] If the existing digital currency characters can be directly combined to obtain a digital currency string set corresponding to the transfer amount, one or more of the to-be-combined currency characters are combined using the combination strategy to obtain a to-be-checked currency string set;
[0087] If the existing digital currency characters cannot be combined to obtain a digital currency character set corresponding to the transfer amount, apply to the central transaction block to obtain a supplementary currency character set;
[0088] Combining the supplementary currency character set with existing digital currency characters to obtain one or more currency characters to be combined;
[0089] One or more of the currency characters to be combined are combined using the combination strategy to obtain a currency string set to be proofread.
[0090] It should be explained that the digital currency characters are authorized and issued by the central transaction block and are issued accordingly based on the historical transaction data of each payment block. For example, the first payment block has 30 historical transactions and the transaction amount of each transaction is no more than one thousand yuan. The digital currency characters given to the first payment block by the central transaction block may include "zero, one, two, three, four, five, six, seven, eight, nine, and ten". In contrast, the second payment block has 3,000 historical transactions and the transaction amount of a single transaction involves tens of millions of yuan. In addition to "one, two, six, four, five, six, six, eight, nine, and ten", the digital currency characters given to the first payment block by the central transaction block may also include combined character strings such as "hundred, thousand, ten thousand, one hundred million, one two, six six, and eighty six".
[0091] It should be emphasized that, in the embodiment of the present invention, the combination strategy includes character operations constructed by addition, subtraction, multiplication and division. For example, the transfer amount initiated by Company A to Company B is 3,000,000, but the digital currency characters corresponding to the payment block of Company A only include zero, one, two, hundred, thousand and ten thousand, so the generated currency characters to be combined can be "one + two zero zero zero zero zero zero".
[0092] Furthermore, in order to solve the problem that the number of existing digital currency characters in the payment block is too small and the transfer amount is too large, so that the existing digital currency characters cannot be combined to obtain the transfer amount, it is necessary to apply to the central transaction block for a supplementary currency character set, and use the supplementary currency character set and the existing digital currency characters to recombine to obtain the currency string set to be proofread.
[0093] And in order to reduce the excessive memory storage pressure caused by string combinations, when the memory value of the currency string set to be verified is greater than the specified memory threshold, as in the embodiment of the present invention, the specified memory threshold is 50KB, an application currency character set is applied for from the central transaction block, and the currency string set to be verified is recombined using the application currency character set and the currency characters to be combined, where the character level of the application currency character set is generally larger, such as "hundred million, trillion, quadrillion".
[0094] S3. Generate a notification instruction to be encrypted, and notify the persistent memory to perform the digital currency string encryption operation according to the notification instruction to be encrypted. When the executable encryption instruction fed back by the persistent memory is received, the digital currency string set is sent to the persistent memory.
[0095] It should be understood that when the digital currency string set is less than or equal to the specified memory threshold, it means that the generated digital currency string set meets the requirements. Therefore, the persistent memory needs to be notified to start performing the encryption operation.
[0096] To prevent abnormal phenomena in the persistent memory, a notification instruction to be encrypted is generated to notify the persistent memory to perform the digital currency string encryption operation before sending the digital currency string set. If the persistent memory is in a working state and no abnormality occurs, an executable encryption instruction is generated, so as to send the digital currency string set from the payment block to the persistent memory.
[0097] S4. Allocate a cache line address in the persistent memory, and read the count value of the encryption counter at this time. Input the digital currency string set, the cache line address, and the count value into the encryption engine for encryption to obtain a one-time padding value.
[0098] Specifically, the allocation of the cache line address in the persistent memory includes:
[0099] Read one or more free memory areas of the persistent memory;
[0100] Select a free memory area corresponding to the memory value of the digital currency string set from one or more of the free memory areas to obtain a currency storage area;
[0101] Read the first row storage address of the currency storage area row by row, and convert the first row storage address into a binary form to obtain the cache line address.
[0102] Exemplarily, there are 3 free memory areas in the persistent memory, and the storage values of each area are 10M, 26M, and 1M respectively. Assuming that the memory value of the digital currency string set is 10KB, in order to make full use of the free memory areas, the 1M free memory area can be selected as the currency storage area.
[0103] Furthermore, in order to improve encryption security, the embodiment of the present invention introduces an encryption counter, wherein the encryption counter is a regular binary variable of a specified number of bits, such as Figure 3 As shown, it is a 12-digit encryption counter. Regularity means that the numbers of each encryption digit have a regularity. For example, in the embodiment of the present invention, the digital display of each encryption digit corresponds to the time. The first encryption digit is 0 when the time is a whole hour, and the encrypted binary value is 1 at other times. For example, at 1 o'clock, 2 o'clock, 3 o'clock, etc., the encrypted binary value of the first encryption digit is 0; the second encryption digit is 0 when the time is a whole minute, and 1 at other times... It will not be repeated here. In detail, the reading of the count value of the encryption counter at this time includes:
[0104] Determining the number of encryption bits of the encryption counter;
[0105] Read the encrypted binary value of each encryption bit in turn, and record the reading time corresponding to each encrypted binary value;
[0106] Each encrypted binary value is combined in sequence to obtain the count value.
[0107] For example, Figure 3 As shown, the count value is 001110110101, and each encrypted binary value includes a reading time for checking the correctness of subsequent readings.
[0108] It should be explained that the one-time pad value is referred to as OTP (one-time pad, OTP), which is an industry term in the field of encryption technology and will not be elaborated here.
[0109] In detail, the step of inputting the digital currency string set, cache line address and count value into the encryption engine for encryption to obtain a one-time filling value includes:
[0110] Obtain the binary number corresponding to the digital currency string set to obtain the digital currency binary number;
[0111] Convert the digital currency binary, cache row address and count value into decimal to obtain digital currency decimal, cache address decimal and count decimal;
[0112] The digital currency decimal, cache address decimal and counting decimal are used as input parameters of the encryption function pre-built in the encryption engine to calculate the one-time filling value.
[0113] Furthermore, the one-time filling value is calculated by taking the digital currency decimal, the cache address decimal and the counting decimal as input parameters of an encryption function pre-built in the encryption engine, including:
[0114] The following encryption function is used to receive the digital currency in decimal, the cache address in decimal, and the counting in decimal, and the one-time filling value is calculated:
[0115]
[0116] Among them, f(w; x; y) represents the one-time filling value, w is the cache address in decimal, x is the digital currency in decimal, y is the counting in decimal, α, γ, η, β1 and β2 are predetermined encryption fixed parameters, which are adjusted by the user.
[0117] S5. Perform an XOR operation on the one-time filling value and the cache line address to obtain a currency ciphertext, and send the currency ciphertext to the central transaction block.
[0118] In detail, performing an XOR operation on the one-time filling value and the cache line address to obtain a currency ciphertext includes:
[0119] Converting the one-time filling value into binary form to obtain a binary filling value;
[0120] Match the binary fill value to the cache line address in one-to-one correspondence according to the number of bits. If the number of bits of the binary fill value is less than the number of bits of the cache line address, or the number of bits of the cache line address is less than the number of bits of the binary fill value, fill the missing bits with the number 0 until the number of bits of the binary fill value corresponds to the number of bits of the cache line address in one-to-one correspondence;
[0121] The currency ciphertext is obtained by performing an XOR operation on each group of corresponding digits.
[0122] It should be explained that, if the binary fill value is 001110 and the cache line address is 1101, the cache line address is supplemented from 1101 to 110100, so that the number of bits is unified and then an XOR operation is performed to obtain the currency ciphertext.
[0123] S6. When the central transaction block receives the currency ciphertext, it verifies the security of the payment block according to the security agreement signed in advance with the payment block. When the payment block passes the security verification, it extracts the one-time filling value from the currency ciphertext, registers the one-time filling value as invalid, and generates a filling value destination string.
[0124] In the embodiment of the present invention, the security protocol includes but is not limited to the Secure Hypertext Transfer Protocol (S-HTTP), Secure Electronic Transaction (SET), etc.
[0125] Furthermore, after the central transaction block has extracted the one-time filling value, in order to prevent the one-time filling value from being reused, the one-time filling value will be registered as an invalid state. Specifically, the one-time filling value is registered as an invalid state, including:
[0126] Add a specified identifier before the first digit of the one-time filling value to obtain an invalid filling value;
[0127] Binding the voided filling value to the one-time filling value to obtain a one-time-voided filling value;
[0128] The one-time filling value stored in the payment block and the persistent memory is replaced with the one-time-invalidated filling value to complete the registration of the invalidated status of the one-time filling value.
[0129] S7. Send the filling value destination string to the payment block, parse the filling value destination string according to the encryption and decryption protocol signed between the payment block and the persistent memory, obtain the transfer amount, and complete the security detection of the digital currency.
[0130] In an embodiment of the present invention, the payment block will perform a decryption operation to generate a digital currency string set according to the encryption process of the aforementioned persistent memory, and parse the digital currency string set according to the aforementioned combination strategy to obtain the transfer amount, thereby completing the security detection of the digital currency during the transaction process.
[0131] In order to solve the problems described in the background technology, the embodiment of the present invention integrates the entire digital currency transaction into the blockchain system, that is, receives a digital currency transfer instruction, and starts the blockchain system where the digital currency transaction is located according to the digital currency transfer instruction, wherein the blockchain system includes a payment block, a central transaction block, a collection block and a persistent memory, and the persistent memory includes an encryption engine and an encryption counter. Compared with the traditional blockchain system, the implementation of the present invention also adds a persistent memory, wherein the persistent memory is used to encrypt the digital amount of the entire transaction, further improving the transaction security. In detail, in order to prevent the problem of being easily cracked by directly using the digital amount to execute the transaction, the embodiment of the present invention selects a digital currency string set from the payment block according to the transfer amount, and the character amount is more secure than the digital amount. In addition, a cache line address is opened in the persistent memory, and the count value of the encryption counter is read at this time, and the digital currency string set, the cache line address and the count value are input into the encryption engine for encryption to obtain a one-time filling value, and the one-time filling value is XORed with the cache line address to obtain a currency ciphertext, and the currency ciphertext is obtained. The text is sent to the central transaction block, thereby the entire digital currency transaction process is cleverly converted into an encryption process. Even if the transaction status is cracked, the risk of transaction data leakage can be effectively reduced due to the protection of the encryption operation. Finally, when the central transaction block receives the currency ciphertext, it verifies the security of the payment block according to the security agreement signed in advance with the payment block. When the payment block passes the security check, the one-time filling value is extracted from the currency ciphertext, and the one-time filling value is registered as an invalid state. Then, a filling value destination string is generated, and the filling value destination string is sent to the payment block. According to the encryption and decryption protocol signed between the payment block and the persistent memory, the filling value destination string is parsed to obtain the transfer amount, and the security detection of the digital currency is completed. Therefore, the data security detection method, device, electronic device and computer-readable storage medium based on blockchain and digital currency proposed in the present invention can solve the problems of imperfect security detection mechanism and high risk of existing digital currency transactions.
[0132] like Figure 4 As shown, it is a functional module diagram of a cloud computing center device for data security detection based on blockchain and digital currency provided by one embodiment of the present invention.
[0133] The cloud computing center device 100 based on blockchain and digital currency data security detection of the present invention can be installed in an electronic device. According to the functions implemented, the cloud computing center device 100 based on blockchain and digital currency data security detection can include a digital currency transaction startup module 101, a persistent memory data receiving module 102, an encryption module 103, a security verification module 104 and a currency transfer module 105. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.
[0134] The digital currency transaction initiation module 101 is used to receive a digital currency transfer instruction, and initiate a blockchain system where the digital currency transaction is located according to the digital currency transfer instruction, wherein the blockchain system includes a payment block, a central transaction block, a payment block and a persistent memory, and the persistent memory includes an encryption engine and an encryption counter;
[0135] The persistent memory data receiving module 102 is used to determine the transfer amount of the digital currency transfer instruction, select a digital currency string set from the payment block according to the transfer amount, generate a notification instruction to be encrypted, and notify the persistent memory to perform a digital currency string encryption operation according to the notification instruction to be encrypted, and when receiving the executable encryption instruction fed back by the persistent memory, send the digital currency string set to the persistent memory;
[0136] The encryption module 103 is used to allocate a cache line address in the persistent memory, read the count value of the encryption counter at this time, input the digital currency string set, the cache line address and the count value into the encryption engine for encryption, obtain a one-time filling value, perform an XOR operation on the one-time filling value and the cache line address to obtain a currency ciphertext, and send the currency ciphertext to the central transaction block;
[0137] The security verification module 104 is used for verifying the security of the payment block according to the security agreement signed in advance with the payment block when the central transaction block receives the currency ciphertext. When the payment block passes the security verification, the one-time filling value is extracted from the currency ciphertext, and the one-time filling value is registered as invalid, and then a filling value destination string is generated;
[0138] The currency transfer module 105 is used to send the filling value destination string to the payment block, parse the filling value destination string according to the encryption and decryption protocol signed between the payment block and the persistent memory, obtain the transfer amount, and complete the security detection of the digital currency.
[0139] In detail, the specific implementation methods of using each module in the cloud computing center device 100 for data security detection based on blockchain and digital currency in the embodiment of the present invention are the same as those in Example 1 and will not be repeated here.
[0140] like Figure 5 , is a schematic diagram of the structure of an electronic device for implementing a data security detection method based on blockchain and digital currency provided by an embodiment of the present invention.
[0141] The electronic device 1 may include a processor 10, a memory 11 and a bus 12, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a data security detection method program based on blockchain and digital currency.
[0142] Among them, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. The memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device 1, such as the code of the data security detection method program based on blockchain and digital currency, but also can be used to temporarily store data that has been output or is to be output.
[0143] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect the various components of the entire electronic device, and executes or executes the programs or modules stored in the memory 11 (such as data security detection method programs based on blockchain and digital currency, etc.), and calls the data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
[0144] The bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus 12 may be divided into an address bus, a data bus, a control bus, etc. The bus 12 is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.
[0145] Figure 5 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 5 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0146] For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0147] Furthermore, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices.
[0148] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.
[0149] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0150] The data security detection method program based on blockchain and digital currency stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve:
[0151] Receiving a digital currency transfer instruction, and starting a blockchain system where a digital currency transaction is located according to the digital currency transfer instruction, wherein the blockchain system includes a payment block, a central transaction block, a payment block, and a persistent memory, and the persistent memory includes an encryption engine and an encryption counter;
[0152] Determine the transfer amount of the digital currency transfer instruction, and select a digital currency string set from the payment block according to the transfer amount;
[0153] Generate a notification instruction to be encrypted, and notify the persistent memory to perform a digital currency string encryption operation according to the notification instruction to be encrypted, and when receiving an executable encryption instruction fed back by the persistent memory, send the digital currency string set to the persistent memory;
[0154] A cache line address is opened in the persistent memory, and the count value of the encryption counter is read at this time, and the digital currency string set, the cache line address and the count value are input into the encryption engine for encryption to obtain a one-time filling value;
[0155] Performing an XOR operation on the one-time filling value and the cache line address to obtain a currency ciphertext, and sending the currency ciphertext to the central transaction block;
[0156] When the central transaction block receives the currency ciphertext, it verifies the security of the payment block according to the security agreement signed in advance with the payment block. When the payment block passes the security verification, it extracts the one-time filling value from the currency ciphertext, registers the one-time filling value as invalid, and generates a filling value destination string;
[0157] The destination string of the filling value is sent to the payment block, and according to the encryption and decryption protocol signed between the payment block and the persistent memory, the destination string of the filling value is parsed to obtain the transfer amount, thereby completing the security detection of the digital currency.
[0158] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to Figures 1 to 5 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0159] Furthermore, if the module / unit integrated in the electronic device 1 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 computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0160] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:
[0161] Receiving a digital currency transfer instruction, and starting a blockchain system where a digital currency transaction is located according to the digital currency transfer instruction, wherein the blockchain system includes a payment block, a central transaction block, a payment block, and a persistent memory, and the persistent memory includes an encryption engine and an encryption counter;
[0162] Determine the transfer amount of the digital currency transfer instruction, and select a digital currency string set from the payment block according to the transfer amount;
[0163] Generate a notification instruction to be encrypted, and notify the persistent memory to perform a digital currency string encryption operation according to the notification instruction to be encrypted, and when receiving an executable encryption instruction fed back by the persistent memory, send the digital currency string set to the persistent memory;
[0164] A cache line address is opened in the persistent memory, and the count value of the encryption counter is read at this time, and the digital currency string set, the cache line address and the count value are input into the encryption engine for encryption to obtain a one-time filling value;
[0165] Performing an XOR operation on the one-time filling value and the cache line address to obtain a currency ciphertext, and sending the currency ciphertext to the central transaction block;
[0166] When the central transaction block receives the currency ciphertext, it verifies the security of the payment block according to the security agreement signed in advance with the payment block. When the payment block passes the security verification, it extracts the one-time filling value from the currency ciphertext, registers the one-time filling value as invalid, and generates a filling value destination string;
[0167] The destination string of the filling value is sent to the payment block, and according to the encryption and decryption protocol signed between the payment block and the persistent memory, the destination string of the filling value is parsed to obtain the transfer amount, thereby completing the security detection of the digital currency.
[0168] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0169] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0170] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0171] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0172] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0173] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, but not to indicate any particular order.
[0174] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A data security detection method based on blockchain and digital currency, characterized in that: The method comprises: Receiving a digital currency transfer instruction, and starting a blockchain system where a digital currency transaction is located according to the digital currency transfer instruction, wherein the blockchain system includes a payment block, a central transaction block, a payment block, and a persistent memory, and the persistent memory includes an encryption engine and an encryption counter; Determine the transfer amount of the digital currency transfer instruction, and select a digital currency string set from the payment block according to the transfer amount; wherein the digital currency string set selected from the payment block according to the transfer amount includes: Extracting existing digital currency characters from the payment block to obtain one or more currency characters to be combined, wherein the currency characters to be combined include a combined currency character representing the number 1; Selecting a combination strategy corresponding to the transfer amount from a pre-defined combination strategy set, and combining one or more of the currency characters to be combined using the combination strategy to obtain a currency string set to be collated; wherein combining one or more of the currency characters to be combined using the combination strategy to obtain a currency string set to be collated comprises: Determine whether the existing digital currency characters can be combined to obtain a digital currency string set corresponding to the transfer amount; If the existing digital currency characters can be directly combined to obtain a digital currency string set corresponding to the transfer amount, directly use the combination strategy to combine one or more of the currency characters to be combined to obtain a currency string set to be verified; If the existing digital currency characters cannot be combined to obtain a digital currency character set corresponding to the transfer amount, apply to the central transaction block to obtain a supplementary currency character set; Combining the supplementary currency character set and one or more of the currency characters to be combined using the combination strategy to obtain a currency string set to be collated; Extracting the memory value of the currency string set to be collated, and determining whether the memory value is greater than a specified memory threshold; If the memory value is greater than the specified memory threshold, apply to the central transaction block to obtain the application currency character set, and use the application currency character set and the currency character set to be combined to obtain the currency string set to be proofread; Until the memory value is less than or equal to the specified memory threshold, determining that the currency string set to be verified is the digital currency string set; Generate a notification instruction to be encrypted, and notify the persistent memory to perform a digital currency string encryption operation according to the notification instruction to be encrypted, and when receiving an executable encryption instruction fed back by the persistent memory, send the digital currency string set to the persistent memory; A cache line address is opened in the persistent memory, and the count value of the encryption counter is read at this time, and the digital currency string set, the cache line address and the count value are input into the encryption engine for encryption to obtain a one-time filling value; Wherein, the step of opening up a cache line address in the persistent memory includes: Reading one or more free memory areas of the persistent memory; Selecting an idle memory area corresponding to the memory value of the digital currency string set from one or more of the idle memory areas to obtain a currency storage area; Read the first row storage address of the currency storage area row by row, and convert the first row storage address into binary form to obtain the cache row address; Wherein, the reading of the count value of the encryption counter at this time includes: Determining the number of encryption bits of the encryption counter; Read the encrypted binary value of each encryption bit in turn, and record the reading time corresponding to each encrypted binary value; Combining each encrypted binary value in order to obtain the count value; The step of inputting the digital currency string set, cache line address and count value into the encryption engine for encryption to obtain a one-time filling value comprises: Obtain the binary number corresponding to the digital currency string set to obtain the digital currency binary number; The digital currency binary, cache line address and count value are all converted into decimal to obtain the digital currency decimal, cache address decimal and count decimal; The digital currency decimal, the cache address decimal and the counting decimal are used as input parameters of the encryption function pre-built in the encryption engine to calculate the one-time filling value; wherein the input parameters of the encryption function pre-built in the encryption engine to calculate the one-time filling value include: The following encryption function is used to receive the digital currency in decimal, the cache address in decimal, and the counting in decimal, and the one-time filling value is calculated: Wherein, f(w; x; y) represents the one-time filling value, w is the cache address in decimal, x is the digital currency in decimal, y is the counting in decimal, α, γ, η, β1 and β2 are predetermined encryption fixed parameters; Performing an XOR operation on the one-time filling value and the cache line address to obtain a currency ciphertext, and sending the currency ciphertext to the central transaction block; When the central transaction block receives the currency ciphertext, it verifies the security of the payment block according to the security agreement signed in advance with the payment block. When the payment block passes the security verification, it extracts the one-time filling value from the currency ciphertext, registers the one-time filling value as invalid, and generates a filling value destination string; wherein, registering the one-time filling value as invalid includes: Add a specified identifier before the first digit of the one-time filling value to obtain an invalid filling value; Binding the voided filling value to the one-time filling value to obtain a one-time-voided filling value; Replacing the one-time filling value stored in the payment block and the persistent memory with the one-time-invalidated filling value, completing the registration of the invalidated status of the one-time filling value; The destination string of the filling value is sent to the payment block, and according to the encryption and decryption protocol signed between the payment block and the persistent memory, the destination string of the filling value is parsed to obtain the transfer amount, thereby completing the security detection of the digital currency.
2. The data security detection method based on blockchain and digital currency as claimed in claim 1, characterized in that: The performing an XOR operation on the one-time filling value and the cache line address to obtain the currency ciphertext includes: Converting the one-time filling value into binary form to obtain a binary filling value; Match the binary fill value to the cache line address in one-to-one correspondence according to the number of bits. If the number of bits of the binary fill value is less than the number of bits of the cache line address, or the number of bits of the cache line address is less than the number of bits of the binary fill value, fill the missing bits with the number 0 until the number of bits of the binary fill value corresponds to the number of bits of the cache line address in one-to-one correspondence; The currency ciphertext is obtained by performing an XOR operation on each group of corresponding digits.
