A method for secure storage of financial data

By combining the Rubik's Cube principle with the AES algorithm, financial data is encrypted, solving the problem of high-cost encryption in existing technologies and achieving low-cost, high-efficiency secure data storage.

CN116756756BActive Publication Date: 2026-11-17JILIN YOULE NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310761414.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-26
Publication Date
2026-11-17
Estimated Expiration
2043-06-26

AI Technical Summary

Technical Problem

Existing financial data encryption algorithms such as AES require a large amount of computation to ensure data security, resulting in high hardware requirements and high costs, and the problems of over-encryption and cost waste.

Method used

The data is encrypted using the Rubik's Cube principle. The cube is rotated in the fewest possible steps to make the front faces identical. The priority is calculated based on the distribution of 0s and 1s in the cube. The cube order is adjusted to adapt to the encryption requirements of different data scenarios. The AES algorithm is used for secondary encryption of small amounts of data.

Benefits of technology

It reduces encryption costs, shortens encryption time, ensures data security, adapts to the encryption requirements of different financial data, and avoids over-encryption and cost waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116756756B_ABST
    Figure CN116756756B_ABST
Patent Text Reader

Abstract

This invention relates to the field of secure storage technology, specifically to a method for securely storing financial data, comprising: preprocessing data to obtain a binary string; dividing the binary string into several substrings, obtaining a complete Rubik's Cube based on the Rubik's Cube to be filled, calculating the first priority and second priority of the complete Rubik's Cube, obtaining the target data of the complete Rubik's Cube based on the first priority and second priority, obtaining ciphertext and a new Rubik's Cube to be filled based on the target data of the complete Rubik's Cube; encrypting all substrings to obtain a ciphertext sequence; obtaining an authentication data sequence and a key, and securely storing the ciphertext sequence, authentication data sequence, and key; and decrypting and verifying the ciphertext sequence based on the key and authentication data sequence. The encryption process of this invention is simple, reduces encryption costs and shortens encryption time, while ensuring data security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of secure storage technology, and more specifically to a method for securely storing financial data. Background Technology

[0002] In the era of big data, the security of mining and financial data is of extremely high priority. Due to the virtualization of data storage and transmission in the network era, the security risks of data are relatively high. Financial data is also of high importance in daily data. Therefore, the development of security methods for financial data storage and transmission is extremely rapid. Among them, the more classic storage methods are B-trees and LSM trees, while financial data encryption algorithms include DES and AES.

[0003] Different financial data have different requirements for data encryption, so the data encryption methods should also be different. The most commonly used existing financial data encryption algorithm, AES, requires a lot of data computation support while ensuring data security, so it has high hardware requirements for users, resulting in high costs. Data encryption may also lead to over-encryption and cost waste. Therefore, this embodiment proposes a financial data encryption algorithm that uses the Rubik's Cube principle. It achieves data encryption by finding the same data on one side of the Rubik's Cube in the fewest possible steps. It has a wide range of applications and can be used to encrypt and store everyday financial data. Summary of the Invention

[0004] This invention provides a method for securely storing financial data to solve existing problems.

[0005] The present invention provides a method for securely storing financial data, which employs the following technical solution:

[0006] One embodiment of the present invention provides a method for securely storing financial data, the method comprising the following steps:

[0007] The data is preprocessed to obtain a binary string;

[0008] Divide the binary string into several substrings, obtain the Rubik's Cube to be filled through data initialization operations, obtain the ciphertext of the substrings and the new Rubik's Cube to be filled, including: obtaining the complete Rubik's Cube from the Rubik's Cube to be filled, calculating the first priority and the second priority of the complete Rubik's Cube, obtaining the target data of the complete Rubik's Cube from the first priority and the second priority, and obtaining the ciphertext and the new Rubik's Cube to be filled from the target data of the complete Rubik's Cube.

[0009] Repeat the process of obtaining the ciphertext of the substring and the new Rubik's Cube to be filled until the ciphertext of all substrings is obtained. The ciphertext sequence is formed by reversing all the ciphertexts and is called the ciphertext sequence. The ciphertext sequence is the encrypted result of the binary string.

[0010] Obtain the authentication data sequence and key, and securely store the ciphertext sequence, authentication data sequence, and key;

[0011] The ciphertext sequence is decrypted and verified based on the key and the authentication data sequence.

[0012] Furthermore, the specific steps involved in obtaining the Rubik's Cube to be filled through data initialization are as follows:

[0013] The Rubik's Cube has 6 faces: front, back, left, right, top, and bottom. The other 5 faces (excluding the front) are filled with a number of randomly generated 1s and 0s, with the sum of the number of 0s and 1s equal to L. The filled Rubik's Cube is then designated as the first Rubik's Cube to be filled, thus completing the data initialization. The front of the first Rubik's Cube to be filled is empty.

[0014] Furthermore, the specific steps involved in calculating the first and second priorities of the complete Rubik's Cube are as follows:

[0015] The first priority of the first complete Rubik's Cube is calculated based on the number of 0s in it. The specific calculation formula is as follows:

[0016]

[0017] In the formula, Y J1 This indicates the first priority of the J-th complete Rubik's Cube, w represents the preset weight, and X represents the first priority of the J-th complete Rubik's Cube. J Let represent the number of 0s in the 5 faces (excluding the top faces) of the J-th complete Rubik's Cube, m represent the number of faces of the cube, i represent the order of the cube, n represent the length of the substring, and x represent the number of zeros in the substring. Jk This represents the k-th data element in the J-th substring. This represents the mean of all data in the J-th substring;

[0018] The second priority of the first complete Rubik's Cube is calculated based on the number of 1s in it. The specific calculation formula is as follows:

[0019]

[0020] In the formula, Y J2 This indicates the second priority of the Jth complete Rubik's Cube, w represents the preset weight, and X... J ′ Let m represent the number of 1s on the 5 faces (excluding the top faces) of the J-th complete Rubik's Cube, m represent the number of faces of the cube, i represent the order of the cube, n represent the length of the substring, and x represent the number of 1s on the other 5 faces. Jk This represents the k-th data element in the J-th substring. This represents the mean of all data in the J-th substring.

[0021] Furthermore, the specific steps for obtaining the target data of the complete Rubik's Cube based on the first priority and the second priority are as follows:

[0022] If Y J1 ≥Y J2 If the target value of the Jth complete Rubik's Cube is 0, then the target value of the Jth complete Rubik's Cube is 1; otherwise, the target value of the Jth complete Rubik's Cube is 1. J1 Y represents the first priority of the Jth complete Rubik's Cube. J2 This indicates the second priority of the Jth complete Rubik's Cube.

[0023] Furthermore, the specific steps involved in obtaining the ciphertext and the new Rubik's Cube to be filled based on the target data of the complete Rubik's Cube are as follows:

[0024] By performing a number of rotations on the Jth complete Rubik's Cube, so that the entire front face of the Jth complete Rubik's Cube is composed of the target data of the Jth complete Rubik's Cube, the rotation process that achieves this with the fewest number of rotations is taken as the encryption result of the Jth substring, and the encryption result of the target data of the Jth complete Rubik's Cube and the Jth substring is recorded as the Jth ciphertext; the front face of the Jth complete Rubik's Cube after the fewest rotations is cleared, and the incomplete Rubik's Cube after clearing is recorded as the (J+1)th Rubik's Cube to be filled.

[0025] Furthermore, the specific steps for obtaining a complete Rubik's Cube from the cube to be filled are as follows:

[0026] Fill the first substring onto the front of the first cube to be filled using an S-shaped scanning pattern to obtain the first complete cube.

[0027] Furthermore, the specific steps for obtaining the regularity of each pixel in each video frame are as follows:

[0028] The partition length is obtained based on the preset order L. 2 The binary string is divided into several substrings according to the partition length. If the length of the last substring is less than L, it is padded with zeros to make it a substring of length L. The number of substrings obtained is... Where N represents the length of the binary string, This indicates rounding up to the nearest integer.

[0029] Furthermore, the specific steps for obtaining the authentication data sequence and key are as follows:

[0030] When the data initialization is complete, the data randomly filled in the other 5 faces (excluding the front face) will be recorded as the authentication data sequence.

[0031] Clear the front face of the Mth complete Rubik's Cube after the minimum number of rotations. Record the cleared incomplete Rubik's Cube as the (M+1)th Rubik's Cube to be filled. Record the data in the other 5 faces of the (M+1)th Rubik's Cube to be filled as the key. M represents the number of substrings obtained.

[0032] Furthermore, the specific steps for decrypting and verifying the ciphertext sequence based on the key and authentication data sequence are as follows:

[0033] K0. Obtain the first Rubik's Cube to be filled based on the key. The specific method is as follows: fill the data in the key into the other 5 faces of the Rubik's Cube except for the front face, and record the filled Rubik's Cube as the first Rubik's Cube to be filled.

[0034] K1. Based on the target data in the first ciphertext in the ciphertext sequence, fill the front face of the first cube to be filled with the target data in the first ciphertext, and record the filled cube as the first complete cube. Rotate the first complete cube in reverse order of the rotation process of the encryption result in the first ciphertext. Record the sequence of all data in the front face of the rotated cube as the first plaintext. Clear the front face of the rotated cube. Record the cleared incomplete cube as the second cube to be filled.

[0035] K2. Similarly, based on the target data in the second ciphertext of the ciphertext sequence, fill the front face of the second cube to be filled with the target data in the second ciphertext. Record the filled cube as the second complete cube. Rotate the second complete cube in reverse order of the rotation process of the encryption result in the second ciphertext. Record the sequence of all data in the front face of the rotated cube as the second plaintext. Clear the front face of the rotated cube. Record the incomplete cube after clearing as the third cube to be filled. Repeat K1 until the Mth plaintext is obtained. All plaintexts are arranged in reverse order to form a binary string. The binary string is the decryption result of the ciphertext sequence.

[0036] After rotating the Mth complete Rubik's Cube, clear the front face of the cube. Record the data of the other 5 faces of the incomplete cube after clearing as the verification data sequence. Compare the verification data sequence with the authentication data sequence. If the two data sequences are the same, it means that they have not been tampered with during storage. Otherwise, it means that they have been tampered with during storage.

[0037] The beneficial effects of the technical solution of the present invention are:

[0038] 1. This invention adjusts the order of the Rubik's Cube to adjust the encryption level based on the different encryption requirements of various data scenarios. It converts the data into binary and fills the blank spaces on the front of the Rubik's Cube with the converted binary data. By rotating the cube, the front faces are made to have the same data. The rotation with the fewest rotations is taken as the ciphertext. The front faces are cleared, and the data filling and encryption process continues until the data encryption is complete. This invention encrypts binary strings using a simple Rubik's Cube principle to obtain a ciphertext sequence. The encryption process is simple, reduces encryption costs, and shortens encryption time. It achieves encryption of financial data, ensures data security, and solves the problems of over-encryption and cost waste caused by high data encryption costs. It meets the encryption requirements and conditions of a wide range of financial data.

[0039] 2. This invention combines the distribution of 0s and 1s in the Rubik's Cube to calculate the priority of making all the front faces of the Rubik's Cube 1s or all the front faces 0s. Then, based on the two priorities, it determines whether to make all the front faces of the Rubik's Cube 1s or all the front faces 0s through rotation. Compared with traversing all the rotation steps to make all the front faces of the Rubik's Cube 1s or all the front faces 0s, the encryption method of this invention reduces the encryption cost and shortens the encryption time. At the same time, it ensures that the encryption does not terminate, guarantees the randomness of the data in the Rubik's Cube and that the values ​​of 1s and 0s remain basically equal, thereby ensuring a certain level of encryption.

[0040] 3. This invention uses the AES algorithm to perform secondary encryption on the small amount of obtained key and authentication data sequence to ensure the data encryption level, while ensuring that the stored encryption result can be verified through the authentication data sequence, thereby improving data security. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 This is a flowchart illustrating the steps of a secure financial data storage method according to the present invention. Detailed Implementation

[0043] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following detailed description, in conjunction with the accompanying drawings and preferred embodiments, provides a method for secure storage of financial data according to the present invention, including its specific implementation, structure, features, and effects. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.

[0044] Unless otherwise defined, 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 pertains.

[0045] The following description, in conjunction with the accompanying drawings, details a specific scheme for a secure financial data storage method provided by the present invention.

[0046] Please see Figure 1 The diagram illustrates a flowchart of a method for securely storing financial data according to an embodiment of the present invention. The method includes the following steps:

[0047] S001. Preprocess the data to obtain a binary string.

[0048] It's important to note that financial data is highly variable in type and volume, with distinct layers of security, ranging from transaction records to personal accounts, and from consumer spending to bank account security. Therefore, not all scenarios are suitable for high-level encryption, lengthy encryption operations, or costly encryption methods. Consequently, financial data encryption should be diverse, employing different methods in different scenarios. This can significantly reduce encryption costs, shorten encryption time, and improve the applicability of encryption methods, ultimately saving costs for data encryption users and enhancing the suitability of the encryption methods.

[0049] It should be further explained that, for specific data scenarios, data is acquired, such as local database transaction information, market financial data circulation information, and company order logistics information. The information is read from the database or manually read and written, and is strictly sorted according to the information characteristics and logical order of the data.

[0050] Specifically, this embodiment addresses the scenario of financial data encryption, where the types of financial data include text data, transaction data, location data, etc. The binary conversion is performed on various types of data, and the binary data after binary conversion is concatenated into a binary string in sequence.

[0051] S002. Divide the binary string into several substrings, encrypt all substrings, and obtain the ciphertext sequence.

[0052] It should be noted that this embodiment determines the data encryption rules based on the Rubik's Cube principle. After the data is converted into a binary string, the Rubik's Cube data is initialized before data filling. A binary string is randomly generated and filled into the Rubik's Cube. Plaintext data is filled into the blank space on the front of the Rubik's Cube. Then, rotation encryption is performed. After obtaining the same data on one side, the rotation steps are extracted, recorded and saved, the front side is cleared, and data filling encryption is continued until the data encryption is completed.

[0053] 1. Divide the binary string into several substrings.

[0054] It should be noted that, according to the Rubik's Cube principle, the higher the order of the Rubik's Cube, the higher the encryption level of the data and the better the encryption effect. However, at the same time, the encryption cost is higher and the encryption time is longer. Therefore, in this embodiment, the order of the Rubik's Cube can be adjusted appropriately according to different data scenarios, thereby adjusting the encryption level of the data. Since the encryption process in this embodiment requires filling the front face of the Rubik's Cube with binary strings, the order of the Rubik's Cube determines the length of the substrings into which the binary string is divided.

[0055] A predetermined order L is set. In this embodiment, L=3 is used as an example. This embodiment does not impose any specific limitations. The value of L depends on the specific implementation.

[0056] Specifically, the partition length L is obtained based on the order L. 2 The binary string is divided into several substrings according to the partition length. If the length of the last substring is less than L, it is padded with zeros to make it a substring of length L. The number of substrings obtained is... Where N represents the length of the binary string, This indicates rounding up to the nearest integer.

[0057] 2. Encrypt all substrings to obtain the ciphertext sequence.

[0058] It should be noted that the encryption method in this embodiment is based on the principle of the Rubik's Cube. The front face of the Rubik's Cube is fixed, and the data enters the Rubik's Cube in the form of a binary string. After being encrypted by rotation, the data is extracted and then the data is repeatedly filled. Since the Rubik's Cube has six faces, and each face contains data with the same attributes, the Rubik's Cube data needs to be initialized. Except for the front face data, the data of the other five faces is randomly generated as 1 or 0 and filled into each block. At this time, the Rubik's Cube data initialization is completed, and the Rubik's Cube data at this time is recorded. Finally, the data in the Rubik's Cube, the data of each face consists of several 0s and several 1s. After rotating the Rubik's Cube, the front face of the Rubik's Cube is made to be all 1s or all 0s. The rotation step with the fewest rotations is recorded.

[0059] Specifically, each substring is encrypted, and the specific process is as follows:

[0060] K0. Obtain the Rubik's Cube to be filled through data initialization. The specific method is as follows: The Rubik's Cube has 6 faces, namely the front, back, left, right, top, and bottom faces; fill the other 5 faces except the front face with a number of randomly generated 1s and 0s, requiring the sum of the number of 0s and 1s to be equal to L. Record the filled Rubik's Cube as the first Rubik's Cube to be filled, and complete the data initialization; it should be noted that the front face of the first Rubik's Cube to be filled is empty.

[0061] K1. Obtain the first complete cube from the first unfilled cube, and calculate the first and second priorities of the first complete cube. The specific method is as follows:

[0062] It should be noted that in this embodiment, the Rubik's Cube is rotated so that all the front faces are either 1 or 0, and the rotation step with the fewest rotations is recorded as the ciphertext. However, if all the rotation steps that make all the front faces of the Rubik's Cube 1 or 0 are traversed during the rotation process, the encryption cost is high and the encryption time is long. Therefore, this embodiment calculates the priority of making all the front faces of the Rubik's Cube 1 or 0 based on the distribution of 0 and 1 in the Rubik's Cube, and then determines whether to make all the front faces of the Rubik's Cube 1 or 0 based on the two priorities.

[0063] It's important to further explain that for each substring added to the cube, it needs to be filled onto the front face of the cube. If the middle data is 0, it's more likely that the front face will be filled with 0s with fewer rotations; in this case, the priority of filling the front face with 0s is higher. If the middle data is 1, it's more likely that the front face will be filled with 1s with fewer rotations; in this case, the priority of filling the front face with 1s is higher. Therefore, the first weight is obtained based on the value of the middle data of the front face. Combining this with the proportion of 1s or 0s in all the data across all faces, if the proportion of 0s is larger, it's more likely that the front face will be filled with 0s with fewer rotations; in this case, the priority of filling the front face with 0s is higher. If the proportion of 1s is larger, it's more likely that the front face will be filled with 1s with fewer rotations; in this case, the priority of filling the front face with 1s is higher. Therefore, the second weight is obtained based on the proportion of 1s or 0s in all the data across all faces. For each substring added to the cube, it needs to be filled onto the front faces of the cube. Considering the degree of data fluctuation in the substring, the smaller the fluctuation, the more likely it is to make all the front faces of the cube full of 1s or 0s with fewer rotations. In this case, the priority of making all the front faces full of 1s or 0s is higher. Therefore, a third weight is obtained based on the degree of data fluctuation in the substring. The priority of making all the front faces of the cube full of 1s or 0s is determined based on these three weights.

[0064] Specifically, the first substring is filled into the front face of the first cube to be filled using an S-shaped scanning pattern to obtain the first complete cube; based on the number of 0s in the first complete cube, the first priority of the first complete cube is calculated, and the specific calculation formula is as follows:

[0065]

[0066] In the formula, Y J1 w represents the first priority of the Jth complete Rubik's Cube. J Let w represent the weight of the Jth complete Rubik's Cube. If the middle value of the face of the Jth complete Rubik's Cube is 0, then w... J =0.7, if the middle number of the front face of the Jth complete Rubik's Cube is 1, then w J =0.3, X J Let represent the number of 0s on all faces of the J-th complete Rubik's Cube, m represent the number of faces of the cube, i represent the order of the cube, n represent the length of the substring, and x represent the number of faces. Jk This represents the k-th data element in the J-th substring. This represents the mean of all data in the J-th substring.

[0067] The second priority of the first complete Rubik's Cube is calculated based on the number of 1s in it. The specific calculation formula is as follows:

[0068]

[0069] In the formula, Y J1 w represents the second priority of the Jth complete Rubik's Cube. J Let w represent the weight of the Jth complete Rubik's Cube. If the middle value of the face of the Jth complete Rubik's Cube is 0, then w... J =0.7, if the middle number of the front face of the Jth complete Rubik's Cube is 1, then w J =0.3, X J ′ Let m represent the number of 1s on all faces of the J-th complete Rubik's Cube, m represent the number of faces of the cube, i represent the order of the cube, n represent the length of the substring, and x represent the number of faces. Jk This represents the k-th data element in the J-th substring. This represents the mean of all data in the J-th substring.

[0070] It should be noted that this embodiment calculates the priority of making all the front faces of the Rubik's Cube 1 or 0 based on the distribution of 0 and 1 in the Rubik's Cube. Then, based on the two priorities, it determines whether to make all the front faces of the Rubik's Cube 1 or 0 through rotation. Compared with traversing all the rotation steps to make all the front faces of the Rubik's Cube 1 or 0, the encryption method of this embodiment reduces the encryption cost and shortens the encryption time. At the same time, it ensures that the encryption does not terminate, guarantees the randomness of the data in the Rubik's Cube and that the values ​​of 1 and 0 remain basically equal, thereby ensuring a certain level of encryption.

[0071] K2. Obtain the target data for the first complete Rubik's Cube based on the first and second priorities. The specific method is as follows: If Y 11 ≥Y 12 If the target value is 0, then the target value of the first complete Rubik's Cube is 0; otherwise, the target value of the first complete Rubik's Cube is 1.

[0072] K3: Obtain the first ciphertext and the second unfilled cube based on the target data of the first complete cube. The specific method is as follows:

[0073] By rotating the first complete Rubik's Cube a certain number of times, so that the entire front face of the first complete Rubik's Cube is composed of the target data of the first complete Rubik's Cube, the rotation process that makes the entire front face of the first complete Rubik's Cube composed of the target data of the first complete Rubik's Cube with the fewest number of rotations is taken as the encryption result of the first substring, and the encryption result of the target data of the first complete Rubik's Cube and the first substring is recorded as the first ciphertext; the front face of the first complete Rubik's Cube after the fewest number of rotations is cleared, and the cleared incomplete Rubik's Cube is recorded as the second Rubik's Cube to be filled.

[0074] K4. Similarly, based on the second cube to be filled, obtain the second complete cube, calculate the first priority and the second priority of the second complete cube, obtain the target data of the second complete cube based on the first priority and the second priority, and obtain the second ciphertext and the third cube to be filled based on the target data of the second complete cube; repeat K1-K3 until the Mth ciphertext is obtained, and form a sequence of all ciphertexts in reverse order, which is called the ciphertext sequence. The ciphertext sequence is the encrypted result of the binary string.

[0075] S003. Obtain the authentication data sequence and key, and securely store the ciphertext sequence, authentication data sequence and key.

[0076] 1. Obtain the authentication data sequence and key.

[0077] The data randomly filled in the other 5 faces (excluding the front face) during data initialization in step K0 is recorded as the authentication data sequence.

[0078] Clear the front face of the Mth complete Rubik's Cube after the minimum number of rotations. Record the cleared incomplete Rubik's Cube as the (M+1)th Rubik's Cube to be filled. Record the data in the other 5 faces of the (M+1)th Rubik's Cube to be filled as the key. M represents the number of substrings obtained.

[0079] 2. Securely store the ciphertext sequence, authentication data sequence, and key.

[0080] It should be noted that the most commonly used existing financial data encryption algorithm, AES, requires a large amount of data computation to ensure data security, thus placing high demands on the user's hardware and resulting in high costs. It may also lead to over-encryption and waste of resources. Therefore, the encryption method in this embodiment encrypts binary strings, stores the large ciphertext sequence normally, and performs secondary encryption of the small key and authentication data sequences using AES for secure storage.

[0081] The ciphertext sequence is stored, and the authentication data sequence and key are encrypted a second time using the AES algorithm before storage.

[0082] It should be noted that this embodiment uses a simple Rubik's Cube principle to encrypt binary strings to obtain ciphertext sequences. The encryption process is simple, reduces encryption costs, and shortens the encryption time. At the same time, the small amount of data obtained, the key and authentication data sequences, are encrypted a second time using the AES algorithm to ensure the data encryption level and to ensure that the stored encryption results can be verified through the authentication data sequences, thereby improving data security.

[0083] S004. Decrypt and verify the ciphertext sequence based on the key and the authentication data sequence.

[0084] 1. Decrypt the ciphertext sequence using the key.

[0085] Specifically, the ciphertext sequence is decrypted using the key, and the specific method is as follows:

[0086] K0. Obtain the first Rubik's Cube to be filled based on the key. The specific method is as follows: fill the data in the key into the other 5 faces of the Rubik's Cube, except for the front face. Record the filled Rubik's Cube as the first Rubik's Cube to be filled.

[0087] K1. Each ciphertext in the ciphertext sequence consists of target data and encryption result. The essence of the encryption result is a rotation process. Therefore, based on the target data in the first ciphertext in the ciphertext sequence, the front face of the first cube to be filled is filled with the target data in the first ciphertext. The filled cube is recorded as the first complete cube. The first complete cube is rotated in reverse order of the rotation process of the encryption result in the first ciphertext. The sequence of all data on the front face of the rotated cube is recorded as the first plaintext. The front face of the rotated cube is cleared. The incomplete cube after clearing is recorded as the second cube to be filled.

[0088] K2. Similarly, based on the target data in the second ciphertext of the ciphertext sequence, fill the front face of the second cube to be filled with the target data in the second ciphertext. Record the filled cube as the second complete cube. Rotate the second complete cube in reverse order of the rotation process of the encryption result in the second ciphertext. Record the sequence of all data in the front face of the rotated cube as the second plaintext. Clear the front face of the rotated cube. Record the incomplete cube after clearing as the third cube to be filled. Repeat K1 until the Mth plaintext is obtained. All plaintexts are arranged in reverse order to form a binary string. The binary string is the decryption result of the ciphertext sequence. M represents the number of substrings obtained.

[0089] 2. Verify the ciphertext sequence based on the authentication data sequence.

[0090] After rotating the Mth complete Rubik's Cube, clear the front face of the cube. For the incomplete cube after clearing, record the data of the other 5 faces (excluding the front face) as the verification data sequence, where M represents the number of substrings obtained. Compare the verification data sequence with the authentication data sequence. If the two data sequences are the same, it means that the cube has not been tampered with during storage; otherwise, it means that the cube has been tampered with during storage.

[0091] This invention adjusts the order of the Rubik's Cube to adjust the encryption level based on the different encryption requirements of various data scenarios. It converts the data into binary and fills the blank front faces of the cube with the converted binary data. By rotating the cube, the front faces are made to have identical data. The rotation with the fewest rotations is taken as the ciphertext. The front faces are then cleared, and the data filling and encryption process continues until encryption is complete. This invention encrypts binary strings using a simple Rubik's Cube principle to obtain a ciphertext sequence. The encryption process is simple, reduces encryption costs, and shortens encryption time. It achieves encryption of financial data, ensures data security, and solves the problems of over-encryption and cost waste caused by high encryption costs. It meets the encryption requirements and conditions of a wide range of financial data. This invention combines the distribution of 0s and 1s in a Rubik's Cube to calculate the priority of making all the front faces of the cube full of 1s or all of 0s. Based on these two priorities, it determines whether to perform a rotation to make all the front faces full of 1s or all of 0s. Compared to traversing all rotations to make all the front faces full of 1s or all of 0s, this invention reduces encryption costs and time. It also ensures that encryption does not terminate, maintaining the randomness of the data in the Rubik's Cube and keeping the values ​​of 1s and 0s approximately equal, thus guaranteeing a certain level of encryption. This invention uses the AES algorithm for secondary encryption of small amounts of key and authentication data sequences to ensure the data encryption level and to guarantee that the stored encryption result can be verified through the authentication data sequence, thereby improving data security.

[0092] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0093] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

Claims

1. A financial data security storage method characterized by comprising: The method includes the following steps: The data is preprocessed to obtain a binary string; Divide the binary string into several substrings, obtain the Rubik's Cube to be filled through data initialization operations, obtain the ciphertext of the substrings and the new Rubik's Cube to be filled, including: obtaining the complete Rubik's Cube from the Rubik's Cube to be filled, calculating the first priority and the second priority of the complete Rubik's Cube, obtaining the target data of the complete Rubik's Cube from the first priority and the second priority, and obtaining the ciphertext and the new Rubik's Cube to be filled from the target data of the complete Rubik's Cube. Repeat the process of obtaining the ciphertext of the substring and the new Rubik's Cube to be filled until the ciphertext of all substrings is obtained. The ciphertext sequence is formed by reversing all the ciphertexts and is called the ciphertext sequence. The ciphertext sequence is the encrypted result of the binary string. Obtain the authentication data sequence and key, and securely store the ciphertext sequence, authentication data sequence, and key; Decrypt and verify the ciphertext sequence based on the key and authentication data sequence; The specific steps involved in calculating the first and second priorities of a complete Rubik's Cube are as follows: The first priority of the first complete Rubik's Cube is calculated based on the number of 0s in it. The specific calculation formula is as follows: In the formula, This indicates the first priority of the Jth complete Rubik's Cube. Indicates the preset weights. Let m represent the number of 0s in the 5 faces (excluding the top faces) of the J-th complete Rubik's Cube, m represent the number of faces of the Rubik's Cube, i represent the order of the Rubik's Cube, and n represent the length of the substring. This represents the k-th data element in the J-th substring. This represents the mean of all data in the J-th substring; The second priority of the first complete Rubik's Cube is calculated based on the number of 1s in it. The specific calculation formula is as follows: In the formula, This indicates the second priority of the Jth complete Rubik's Cube. Indicates the preset weights. Let m represent the number of 1s on the 5 faces (excluding the top faces) of the J-th complete Rubik's Cube, m represent the number of faces of the cube, i represent the order of the cube, and n represent the length of the substring. This represents the k-th data element in the J-th substring. This represents the mean of all data in the J-th substring; The specific steps involved in obtaining the target data for the complete Rubik's Cube based on the first and second priorities are as follows: if If the condition is met, the target data for the Jth complete Rubik's Cube is 0; otherwise, the target data for the Jth complete Rubik's Cube is 1. This indicates the first priority of the Jth complete Rubik's Cube. This indicates the second priority of the Jth complete Rubik's Cube; The specific steps involved in obtaining the ciphertext and the new Rubik's Cube to be filled based on the target data of the complete Rubik's Cube are as follows: By performing a number of rotations on the Jth complete Rubik's Cube, so that the entire front face of the Jth complete Rubik's Cube is composed of the target data of the Jth complete Rubik's Cube, the rotation process that achieves this with the fewest number of rotations is taken as the encryption result of the Jth substring, and the encryption result of the target data of the Jth complete Rubik's Cube and the Jth substring is recorded as the Jth ciphertext; the front face of the Jth complete Rubik's Cube after the fewest rotations is cleared, and the incomplete Rubik's Cube after clearing is recorded as the (J+1)th Rubik's Cube to be filled.

2. The financial data secure storage method of claim 1, wherein, The specific steps involved in obtaining the Rubik's Cube to be filled through data initialization are as follows: The Rubik's Cube has 6 faces: front, back, left, right, top, and bottom. The other 5 faces (excluding the front) are filled with randomly generated 1s and 0s, such that the sum of the number of 0s and 1s equals a certain value. The filled cube is designated as the first cube to be filled, and the data initialization is completed; the front face of the first cube to be filled is empty.

3. The method for securely storing financial data according to claim 1, characterized in that, The specific steps involved in obtaining a complete Rubik's Cube from the cube to be filled are as follows: Fill the first substring onto the front of the first cube to be filled using an S-shaped scanning pattern to obtain the first complete cube.

4. The method for securely storing financial data according to claim 1, characterized in that, The specific steps involved in dividing the binary string into several substrings are as follows: The division length is obtained based on the preset order L. The binary string is divided into several substrings based on the partition length. If the length of the last substring is less than the required length... Then, by padding with zeros, the last substring is padded to a length equal to... If the substring is a given substring, then the number of substrings obtained is . Where N represents the length of the binary string, This indicates rounding up to the nearest integer.

5. A method for securely storing financial data according to claim 1, characterized in that, The specific steps involved in obtaining the authentication data sequence and key are as follows: When the data initialization is complete, the data randomly filled in the other 5 faces (excluding the front face) will be recorded as the authentication data sequence. Clear the front face of the Mth complete Rubik's Cube after the minimum number of rotations. Record the cleared incomplete Rubik's Cube as the (M+1)th Rubik's Cube to be filled. Record the data in the other 5 faces of the (M+1)th Rubik's Cube to be filled as the key. M represents the number of substrings obtained.

6. The method for securely storing financial data according to claim 1, characterized in that, The specific steps involved in decrypting and verifying the ciphertext sequence based on the key and authentication data sequence are as follows: K0. Obtain the first Rubik's Cube to be filled based on the key. The specific method is as follows: fill the data in the key into the other 5 faces of the Rubik's Cube except for the front face, and record the filled Rubik's Cube as the first Rubik's Cube to be filled. K1. Based on the target data in the first ciphertext in the ciphertext sequence, fill the front face of the first cube to be filled with the target data in the first ciphertext, and record the filled cube as the first complete cube. Rotate the first complete cube in reverse order of the rotation process of the encryption result in the first ciphertext. Record the sequence of all data in the front face of the rotated cube as the first plaintext. Clear the front face of the rotated cube. Record the cleared incomplete cube as the second cube to be filled. K2. Similarly, based on the target data in the second ciphertext in the ciphertext sequence, fill the front face of the second cube to be filled with the target data in the second ciphertext, and record the filled cube as the second complete cube. Rotate the second complete cube in reverse order of the rotation process of the encryption result in the second ciphertext. Record the sequence of all data in the front face of the rotated cube as the second plaintext. Clear the front face of the rotated cube, and record the cleared incomplete cube as the third cube to be filled. Repeat K1 until the Mth plaintext is obtained. All plaintexts are arranged in reverse order to form a binary string, which is the decryption result of the ciphertext sequence. After rotating the Mth complete Rubik's Cube, clear the front face of the cube. Record the data of the other 5 faces of the incomplete cube after clearing as the verification data sequence. Compare the verification data sequence with the authentication data sequence. If the two data sequences are the same, it means that they have not been tampered with during storage. Otherwise, it means that they have been tampered with during storage.

Citation Information

Patent Citations

  • Magic cube encryption and decryption method

    CN102752108A

  • Sponge and hash functions using a rubik's cube puzzle process

    US20110040977A1