CN115760126B - Financial transaction information encryption method - Google Patents

Financial transaction information encryption method Download PDF

Info

Publication number
CN115760126B
CN115760126B CN202310036270.7A CN202310036270A CN115760126B CN 115760126 B CN115760126 B CN 115760126B CN 202310036270 A CN202310036270 A CN 202310036270A CN 115760126 B CN115760126 B CN 115760126B
Authority
CN
China
Prior art keywords
node
edge
code sequence
transaction
encryption
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310036270.7A
Other languages
Chinese (zh)
Other versions
CN115760126A (en
Inventor
李光顺
闵宗印
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Aotongping Technology Co ltd
Original Assignee
Beijing Houfang Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Houfang Technology Co ltd filed Critical Beijing Houfang Technology Co ltd
Priority to CN202310036270.7A priority Critical patent/CN115760126B/en
Publication of CN115760126A publication Critical patent/CN115760126A/en
Application granted granted Critical
Publication of CN115760126B publication Critical patent/CN115760126B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Storage Device Security (AREA)

Abstract

The invention relates to the technical field of data encryption, in particular to a financial transaction information encryption method. The method comprises the following steps: constructing a graph structure based on transaction information, and obtaining a node coding sequence of each node and an edge coding sequence of an edge between the nodes; shortest paths from the reference node to other nodes in the structure diagram; setting the number of encryption rounds, the first round of encryption of the graph structure is: and when the reference node moves on each shortest path, encrypting the edge coding sequence of the edge in each shortest path and the node coding sequence of the node according to the node coding sequence of the reference node, the path number of the shortest path, the edge label of the edge and the node label of the node, completing one round of encryption of the graph structure, and the like, sequentially selecting the node as the reference node according to the complexity of the node to carry out each round of encryption of the graph structure until the set encryption round number is completed, thereby obtaining the encrypted transaction information. The invention can improve the confusion degree and the security of the encrypted transaction information.

Description

Financial transaction information encryption method
Technical Field
The invention relates to the technical field of data encryption, in particular to a financial transaction information encryption method.
Background
In the field of financial transaction, along with the development of mobile payment, the type of swiping cards is gradually increased, and the method is not only limited to swiping cards by using entity cards, but also includes swiping cards by using two-dimensional codes, such as common bus two-dimensional code swiping cards, and transaction data are generated by each card swiping transaction of the card swiping device, at this time, the transaction information comprises personal information of a cardholder and consumed financial information, and the user privacy leakage or economic loss can be caused by malicious reading or destruction of the transaction information in the management of the transaction information, so that the transaction information needs to be encrypted.
The encryption of data is generally based on the relation between the original data and the data for replacing or scrambling, but the transaction time and the transaction user exist repeatedly for the transaction data of the card swiping device, and the relation between the transaction data of different times is obvious, but the existing encryption method does not utilize the relation between the transaction data, but directly utilizes the existing encryption algorithm to encrypt the data based on the original transaction data, at the moment, the disorder degree of the encrypted transaction data is not enough, the encryption effect is poor, the relation between the data is less, the key required by encryption is overlarge, and the storage of encrypted ciphertext and the safety of financial transaction are not facilitated.
Disclosure of Invention
In order to solve the technical problems, the invention aims to provide a financial transaction information encryption method, which adopts the following technical scheme:
one embodiment of the invention provides a financial transaction information encryption method, which comprises the following steps: acquiring transaction information of a card reader, wherein the transaction information comprises a transaction user, transaction time and transaction amount; constructing a transaction graph structure based on transaction information, wherein nodes in the transaction graph structure are used for representing transaction users and transaction time respectively, and the length of a side connected between the nodes is used for representing transaction amount; obtaining a node coding sequence of each node and an edge coding sequence of an edge between the nodes;
the product of the number of edges connected with a node and the number of edges between the nodes connected with the node is the complexity of the node, and the node with the highest complexity is a reference node; obtaining the shortest path from the reference node to other nodes in the structure diagram; numbering the shortest paths according to the sequence of the reference nodes moving along the shortest paths to obtain path numbers; numbering the edges and the nodes according to the sequence of the edges and the nodes in each shortest path to obtain edge labels and node labels;
setting the number of encryption rounds, the first round of encryption of the graph structure is: and when the reference node moves on each shortest path, encrypting the edge coding sequence of the edge in each shortest path and the node coding sequence of the node according to the node coding sequence of the reference node, the path number of the shortest path, the edge label of the edge and the node label of the node, completing one round of encryption of the graph structure, and the like, sequentially selecting the node as the reference node according to the complexity of the node to carry out each round of encryption of the graph structure until the set encryption round number is completed, thereby obtaining the encrypted transaction information.
Preferably, constructing a transaction map structure based on transaction information includes: respectively taking a transaction user and transaction time as nodes in the graph structure; and connecting the node representing the transaction user with the node representing the transaction time according to the transaction time of one transaction user to form a graph structure.
Preferably, obtaining a node code sequence of each node and an edge code sequence of an edge between the nodes includes: converting transaction user data representing nodes of a transaction user into binary codes to obtain a node coding sequence; converting transaction time data of nodes representing transaction time into binary codes to obtain node coding sequences; and converting the transaction amount represented by the length of the edge in the structure diagram into binary codes to obtain an edge code sequence of the edge.
Preferably, obtaining the shortest path from the reference node to each other node in the structure comprises: obtaining the shortest path from the reference node to each node in the structure diagram by using a breadth-first search algorithm; when the shortest paths from the reference node to one node in the structure diagram are more than one, the aggregation coefficient of each node on each shortest path corresponding to the node is obtained, and the shortest path with the largest sum of the aggregation coefficients is the shortest path of the node.
Preferably, encrypting the edge code sequence of the edge and the node code sequence of the node in each shortest path according to the node code sequence of the reference node, the path number of the shortest path, the edge label of the edge, and the node label of the node when the reference node moves on each shortest path, includes:
when the reference node moves on the shortest path with the path number of 1 and passes by the edge with the edge number of 1, extracting a first code in the node code sequence of the reference node to obtain a moving code and a new node code sequence of the reference node, and moving the moving code to a first position in the edge code sequence of the edge with the edge number of 1 to obtain an encrypted code sequence of the edge with the edge number of 1; when the reference node moves to the node with the node number of 1, connecting the new node code sequence of the reference node with the node code sequence of the node with the node number of 1 end to end and moving one bit backward to obtain a segmentation code sequence, and segmenting the segmentation code sequence according to the number of codes in the new node code sequence and the node code sequence of the node with the node number of 1 to obtain a first new node code sequence and an encryption code sequence of the reference node and the node with the node number of 1 respectively;
when the reference node moves to the edge with the edge number of 2, extracting a first code in a first new node code sequence of the reference node to obtain a mobile code and a second new node code sequence of the reference node, and moving the mobile code to a second position in the edge code sequence of the edge with the edge number of 2 to obtain an encrypted code sequence of the edge with the edge number of 2; when the reference node moves to the node with the node number of 2, connecting a second new node code sequence of the reference node with the node code sequence of the node with the node number of 2 end to end and moving two bits backwards to obtain a first segmentation code sequence, and segmenting the first segmentation code sequence according to the second new node code sequence and the number of codes in the node code sequence of the node with the node number of 2 to respectively obtain a third new node code sequence and an encryption code sequence of the reference node and the node with the node number of 2; and by analogy, the encryption of the node code sequence of the node and the edge code sequence of the edge on the shortest path with the path number of 1 is completed, and the encryption code sequence of the last node on the shortest path with the path number of 1 is used as a replacement code sequence of a reference node; and encrypting the edge code sequence of the edge and the node code sequence of the node on the path number 2 by using the replacement code sequence of the reference node, and the like, and encrypting the edge code sequences of the edges and the node code sequences of the nodes on all the shortest paths in the structure diagram to complete the first round of encryption of the structure diagram.
Preferably, before extracting the first code in the node code sequence of the reference node, the method further comprises: and comparing the number of codes in the node code sequence of the reference node with the number of edges in the shortest path with the path number of 1, and if the number of codes in the node code sequence of the reference node is smaller than the number of edges in the shortest path with the path number of 1, adding binary codes from the tail end of the node code sequence of the reference node so that the number of codes in the node code sequence of the reference node is equal to the number of edges in the shortest path with the path number of 1.
The embodiment of the invention has at least the following beneficial effects: the invention constructs the graph structure by utilizing the user data, the time data and the transaction amount in the transaction information of the card reader, encrypts the transaction information of the card reader based on the graph structure, increases the safety of the encrypted data, and simultaneously highlights the relationship between the transaction data; the node with the highest complexity in the graph structure is obtained and used as a reference node, so that the comprehensiveness of encrypting the edge code sequence of the edge and the node code sequence of the node in the graph structure by using the node code sequence of the reference node can be ensured; further, the shortest path from the reference node to other nodes is obtained, so that the calculated amount of transaction data can be reduced; finally, encrypting the edge coding sequence of the edge and the node coding sequence of the node in each shortest path according to the node coding sequence of the reference node, the path number of the shortest path, the edge number of the edge and the node number of the node, completing one round of encryption of the graph structure, combining the relation between transaction data, changing the original transaction information represented by the node and the edge in each shortest path, improving the complexity of the transaction information of the encrypted card swiping device, ensuring the security of the transaction information, and carrying out multiple rounds of encryption on the graph structure to further ensure the security of the encrypted transaction information; and because the relation between transaction data is combined in each round of encryption process of the graph structure, the encryption carried out by using original transaction information, namely the encryption carried out by using the node coding sequence of the reference node, the key is smaller, the storage of the encrypted data is facilitated, and the safety of financial transaction is ensured.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions and advantages of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for encrypting financial transaction information according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a portion of a block diagram provided by an embodiment of the present invention.
Detailed Description
In order to further describe the technical means and effects adopted by the present invention to achieve the preset purpose, the following detailed description refers to specific embodiments, structures, features and effects of a method for encrypting financial transaction information according to the present invention with reference to the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The following specifically describes a specific scheme of the encryption method for financial transaction information provided by the invention with reference to the accompanying drawings.
Examples:
the main application scene of the invention is as follows: in the field of financial transactions, since transaction information of a card reader includes user privacy information, it is generally necessary to encrypt the transaction information. The invention establishes a graph structure aiming at the corresponding relation between the user and the transaction time, uses the connection of graph nodes to represent the corresponding relation between all the users and the transaction time, and uses the movement of the nodes in the graph structure to encrypt the original transaction information of the card reader.
Referring to fig. 1, a method flowchart of a method for encrypting financial transaction information according to an embodiment of the invention is shown, the method includes the following steps:
step S1, transaction information of a card reader is obtained, wherein the transaction information comprises user data, time data and transaction amount; constructing a transaction graph structure based on transaction information, wherein nodes in the transaction graph structure are used for representing user data and time data respectively, and the length of edges connected between the nodes is used for representing transaction amount; a node code sequence for each node and an edge code sequence for an edge between the nodes are obtained.
When each card swiping transaction is completed, the storage unit inside the card swiping device directly recordsEach transaction contains information such as transaction users, transaction time, transaction amount, and the like. The invention relates to a method for processing a transaction by a card reader, which comprises the steps of obtaining transaction information of the card reader from a storage unit of the card reader, wherein the transaction information comprises transaction users, transaction time and transaction amount, the transaction can be performed at a plurality of times for the same transaction user, and the transaction can be performed by a plurality of users at the same transaction time, so each transaction information for performing the card reading can be repeated with the prior information, and at the moment, for the characteristics that one transaction user corresponds to a plurality of transaction times and one transaction time corresponds to a plurality of users, the invention constructs a graph structure, wherein one node represents the transaction time or the user represents the corresponding relationship of the transaction information, one node in the graph structure represents the transaction user or the transaction time, and the time of the transaction user is determined, namely the transaction time of the transaction user, the node representing the transaction user is connected with the node representing the transaction time of the transaction user, and the node representing the transaction time of the transaction user is connected with the node representing the transaction time, and the length of the edge between two nodes represents the transaction, and the graph structure is represented by the length of the side, and the graph structure is represented by the graph, as shown in figure 2, the graph in the part of figure 2 is shown in the figure 2
Figure SMS_1
To represent nodes of a transacting user, one of the nodes representing a transacting user contains transacting user data, FIG. 2
Figure SMS_2
To represent nodes of transaction time, one of the nodes representing transaction time contains transaction time data, and the length of an edge in the graph structure represents the transaction amount.
In the complete graph structure, the node representing the transaction user is
Figure SMS_6
Wherein
Figure SMS_8
Representing the number of transaction users, the node representing the transaction time is
Figure SMS_9
Wherein
Figure SMS_5
Representing the amount of time a transaction has occurred, each connected in the block diagram
Figure SMS_10
And
Figure SMS_12
i.e. representing a card swipe transaction,
Figure SMS_13
and
Figure SMS_4
respectively representing the time of transaction and the user, one
Figure SMS_7
Connecting a plurality of
Figure SMS_11
Indicating that there are multiple users to conduct card swiping transaction at the same transaction time, one
Figure SMS_14
Connecting a plurality of
Figure SMS_3
Indicating that the same user has performed a swipe transaction at multiple times.
The method has the advantages that the graph structure representing the transaction information is obtained, the transaction user and the transaction time are taken as nodes, the original transaction information is converted into the graph structure, the repeated transaction time and the repeated transaction user in the original transaction information are represented as one node, the redundancy of original data is greatly reduced, the encryption and the storage of the data are facilitated, the safety of the encrypted data is improved, the relationship among the transaction data is revealed, and the subsequent encryption of the graph structure based on the relationship among the transaction data is facilitated.
In the encryption process, data is usually required to be converted into binary codes, so that the transaction user data of the node representing the transaction user in the graph structure is converted into binary codes to obtain a node code sequence, the transaction time data of the node representing the transaction time is converted into binary codes to obtain a node code sequence, and the transaction amount represented by the length of the edge in the structure diagram is converted into the binary codes to obtain an edge code sequence of the edge, so that the subsequent encryption is convenient, and the conversion of the data into binary codes is a well-known technology, and will not be described in detail herein.
Step S2, multiplying the number of edges connected with one node by the number of edges between nodes connected with the node to obtain a product, wherein the product is the complexity of the node, and the node with the highest complexity is a reference node; obtaining the shortest path from the reference node to other nodes in the structure diagram; numbering the shortest paths according to the sequence of the reference nodes moving along the shortest paths to obtain path numbers; and numbering the edges and the nodes according to the sequence of the edges and the nodes in each shortest path to obtain edge labels and node labels.
In step S1, transaction information conversion is obtained, and at this time, the transaction information of the card reader is encrypted by using the relationship of the edge connection nodes in the graph structure. In the invention, the relationship of the edges between the nodes is utilized to replace and scramble the graph structure information, so as to encrypt the original transaction information.
In order to unify the relationship expression between the nodes, the node expressing the transaction user in step S1 is not distinguished from the node expressing the transaction time, and is unified as
Figure SMS_15
N represents the number of nodes in the current graph structure. Firstly, according to the current constructed graph structure and the complexity of the side relationship corresponding to the nodes, selecting one node as a reference node for encrypting the current graph structure, wherein the complexity of each node is as follows:
Figure SMS_16
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_18
representing the complexity of the v-th node,
Figure SMS_20
representing the number of edges to which the v-th node is connected,
Figure SMS_22
representing the number of edges between nodes connected to the v-th node.
Figure SMS_19
A larger represents a greater complexity of the v-th node,
Figure SMS_21
the larger the v-th node, the higher the local concentration of edges, i.e. the more complex the edge relationship of the node,
Figure SMS_23
i.e. the complexity of the edge relationship corresponding to the v-th node,
Figure SMS_24
the larger the v-th node is, the more complex the side relationship is, and the higher the association between the v-th node and other nodes is, so when the graph structure is encrypted by using the relationship between the nodes, the node with the highest complexity is selected as the reference node, and the reference node is expressed as
Figure SMS_17
The reference node with the most complex edge relation is obtained, and the most nodes can be covered from the reference node, so that the encryption process involves more nodes, the encryption of the graph structure is more comprehensive, the comprehensiveness of the encryption of the graph structure is ensured, and the encryption effect is improved.
Further, a graph structure constructed by the transaction information of the original card reader is obtained, the expression forms of the transaction information in the current graph structure are different, in order to facilitate the hiding of the expression forms and the graph structure information of the graph structure, in step S1, the information represented by the nodes and the information represented by the edges in the graph structure are firstly encoded, the node coding sequence of the nodes and the edge coding sequence of the edges are obtained, and at the moment, the node coding sequence of the nodes and the edge coding sequence of the edges are replaced and scrambled according to the connection relation of the nodes, so that the encryption of the original transaction information is realized.
Since the node code sequences of other nodes and the edge code sequences of edges on the graph structure are encrypted based on the node code sequences of the reference nodes, the reference nodes are used for moving on the structure diagram, so that the shortest path between the reference nodes and the other nodes on the structure diagram is required to be obtained, and the specific process is as follows:
the node code sequence of the reference node is expressed as
Figure SMS_25
In the graph structure, the graph moves to other nodes through connecting edges, and the shortest path between the reference node and the other nodes, namely the moving path, is determined first. After the graph structure is input, outputting the shortest paths of the reference node and the rest nodes by using the existing breadth-first search algorithm, and obtaining the moving path of the reference node; when a plurality of shortest paths exist between the reference node and one node, the aggregation coefficient of each node on each shortest path corresponding to the node is obtained, and the shortest path with the largest sum of the aggregation coefficients of all the included nodes is selected as the shortest path of the node. The aggregation coefficient is the characteristic quantity of the graph structure, one node and all nodes connected with the node are input, the aggregation coefficient of the corresponding node is output, and the acquisition of the aggregation coefficient of one node is the prior art.
In the process of moving the reference node to other nodes, the information represented by each node and each side on the shortest path is changed, and the change of the information represented by each node and each side on the shortest path has a corresponding relation with the movement of the reference node, so that in order to record the corresponding relation between the change of the information represented by each node and each side on the shortest path and the movement of the reference node, the movement sequence of the reference node to different nodes needs to be set before the movement, and the information is stored as a secret key. That is, each shortest path needs to be numbered, specifically, when the reference node moves for the first time along the first shortest path corresponding to the first node to reach the first node, the path number corresponding to the node is 1, when the reference node moves for the second time along the second shortest path corresponding to the second node to reach the second node, the path number corresponding to the node is 2, and so on, the shortest paths are numbered according to the sequence of the movement of the reference node along the shortest paths to obtain the path number, and when the path number of each shortest path is obtained, it needs to be explained that the implementer can number according to specific condition setting rules.
So far, the moving path and the moving sequence of the reference node in the graph structure are obtained, the unique corresponding relation between the change of the information represented by each node and each edge and the movement of the reference node is ensured, and the data decryption is ensured.
Finally, the edge and the node are numbered according to the sequence of the edge and the node in each shortest path to obtain the edge label and the node label, specifically, the edge label of the first edge on one shortest path is 1, the node label of the first node is also 1, the edge label of the second edge is 2, the node label of the second node is also 2, and the like to obtain the edge label of each edge on one shortest path and the node label of each node. The preparation work before encrypting the graph structure by using that reference node is completed, and the encryption process can be determined by using the path number of the shortest path, the edge number of the edge and the node number of the node.
Step S3, setting the number of encryption rounds, and encrypting the first round of the graph structure as follows: and when the reference node moves on each shortest path, encrypting the edge coding sequence of the edge in each shortest path and the node coding sequence of the node according to the node coding sequence of the reference node, the path number of the shortest path, the edge label of the edge and the node label of the node, completing one round of encryption of the graph structure, and the like, sequentially selecting the node as the reference node according to the complexity of the node to carry out each round of encryption of the graph structure until the set encryption round number is completed, thereby obtaining the encrypted transaction information.
If only one round of encryption is performed on the graph structure, the situation that the encryption of the graph structure is incomplete may occur, so that multiple rounds of encryption are needed on the graph structure, reference nodes used by each round of encryption are different, the node with the highest complexity is used as the reference node in the first round of encryption, the first round of encryption is described below, only the reference nodes are different in each round of encryption, and the encryption process is the same.
In each round of encryption process, when the reference node moves on a shortest path, the code sequence of the edge of the shortest path has an adsorption effect and a blocking effect on codes in the node code sequence of the reference node, specifically, taking the first round of encryption as an example, the adsorption effect is represented as follows: when the reference node moves on the shortest path with the path number of 1 and passes through the edge with the edge number of 1, the first code in the node code sequence of the reference node is extracted to obtain a moving code and a new node code sequence of the reference node, the moving code is moved to the first position in the edge code sequence of the edge with the edge number of 1 to obtain an encrypted code sequence of the edge with the edge number of 1, and at the moment, the edge with the edge number of 1 adsorbs the code in the node code sequence of the reference node to the edge code sequence of the edge with the edge number of 1, for example, the node code sequence of the reference node is
Figure SMS_26
Edge code sequence with edge number 1 on shortest path with path number 1 is
Figure SMS_27
After the adsorption of the edge with the edge number of 1, the mobile code is 1, and the new node code sequence of the reference node is
Figure SMS_28
Encryption coding sequence of edge with edge number 1
Figure SMS_29
At this time, encryption of the edge code sequence of the first edge of the path number 1 by the reference node is completed.
Further, the method comprises the steps of,when the reference node moves to the node with the node number 1, the node with the node number 1 has a blocking effect on the new node coding sequence of the reference node, and the blocking effect is represented as follows: the new node coding sequence of the reference node is connected with the node coding sequence of the node with the node number of 1 in an end-to-end mode and moves backwards by one bit to obtain a segmentation coding sequence, and the segmentation coding sequence is segmented according to the number of codes in the new node coding sequence and the node coding sequence of the node with the node number of 1 to respectively obtain a first new node coding sequence and an encryption coding sequence of the reference node and the node with the node number of 1; the new node code sequence of the reference node is as follows
Figure SMS_30
The node code sequence of the node with the node number of 1 is
Figure SMS_31
The code sequence generated by end-to-end connection is
Figure SMS_32
The code sequences generated by end-to-end are moved backwards by one bit to obtain a segmented code sequence
Figure SMS_33
The first new node code sequence of the reference node obtained after segmentation is
Figure SMS_34
The encryption code sequence of the node with the node number of 1 is
Figure SMS_35
Encryption of the node code sequence of the first node is completed.
Then, the reference node continues to move, when the reference node moves to the edge with the edge number of 2, the first code in the first new node code sequence of the reference node is extracted to obtain a moving code and a second new node code sequence of the reference node, the moving code is moved to the second position in the edge code sequence of the edge with the edge number of 2, and at the moment, the first new node code sequence is
Figure SMS_36
The mobile code is 0, and the second new node code sequence of the reference node is
Figure SMS_37
The edge code sequence of the edge with the edge number of 2 is
Figure SMS_38
By "adsorption" the encryption coding sequence of the edge numbered 2
Figure SMS_39
When the reference node moves to the node with the node number of 2, connecting a second new node code sequence of the reference node with the node code sequence of the node with the node number of 2 in an end-to-end manner and moving two bits backwards to obtain a first segmentation code sequence, and segmenting the first segmentation code sequence according to the second new node code sequence and the number of codes in the node code sequence of the node with the node number of 2 to respectively obtain a third new node code sequence and an encryption code sequence of the reference node and the node with the node number of 2; for example, the second new node code sequence of the reference node is
Figure SMS_40
Node coding sequence of node with node number 2
Figure SMS_41
The code sequence generated by end-to-end connection is
Figure SMS_42
The code sequence is moved two bits backward to obtain a first divided code sequence
Figure SMS_43
Dividing the first divided code sequence to obtain a third new node code sequence of the reference node
Figure SMS_44
Reference numerals and signsThe encryption coding sequence of the node with 2 is
Figure SMS_45
. The encryption of the edge code sequence of the edge on the shortest path with the path number 1 and the node code sequence of the node can be completed by using the reference node, further, the encryption code sequence of the last node on the shortest path with the path number 1 is used as the replacement code sequence of the reference node, the edge code sequence of the edge on the path number 2 and the node code sequence of the node are encrypted by using the replacement code sequence of the reference node, the encryption mode is the same as the encryption mode of the shortest path with the path number 1, at this time, the replacement code sequence of the reference node is obtained because the length of the node code sequence of the reference node is continuously reduced in the moving process, the length of the node code sequence of the reference node after one movement is possibly insufficient to continue the next movement of the reference node, so that the replacement code sequence of the reference node is obtained to ensure that the length of the replacement code sequence of the reference node moves next on the shortest path, and the encryption code sequence of the reference node is replaced by using the original node code sequence of the reference node when moving on the shortest path with the path number 1 is completed when the shortest path is moved.
It should be noted that, when encrypting the edge code sequence of an edge, the edge label of the edge may be greater than the length of the edge code sequence of the edge, and when searching for where the motion code is added to the edge code sequence, the motion code needs to be continuously searched from the last bit to the first bit of the edge code sequence, for example, the edge label of one edge is 10, the edge code sequence is 00110110, and the edge encrypted code sequence is 010110110. Meanwhile, when encrypting the edge code sequence of the edge and the node code sequence of the node on a moving path, determining whether the node code sequence length of the reference node supports encryption of a shortest path, taking the shortest path with the path number of 1 as an example, comparing the number of codes in the node code sequence of the reference node with the number of edges in the shortest path with the path number of 1, and if the number of codes in the node code sequence of the reference node is smaller than the number of edges in the shortest path with the path number of 1, adding binary codes from the end of the node code sequence of the reference node, so that the number of codes in the node code sequence of the reference node is equal to the number of edges in the shortest path with the path number of 1. When the edge code sequence of the edge in the shortest path of the path number 2 and the node code sequence of the node are encrypted by using the substitution code sequence of the reference node, the number of codes in the substitution code sequence of the reference node is compared with the number of the shortest path edges of the path number 2, and whether the substitution code sequence needs to be complemented is determined. And similarly, the first round of encryption of the graph structure is completed, and the first round of encryption graph structure is obtained.
Finally, the number of encryption rounds is set, preferably, the number of decryption rounds is set to 5 in this embodiment, and it should be noted that the practitioner may set the number of encryption rounds according to the specific situation. In the second round of encryption, the encryption is performed on the first round of encryption graph structure, and the connection relation of the graph structure is not changed, so that the node with the second highest complexity is selected as a reference node for mobile encryption at the moment, in the same way, in the third round of encryption, the node with the third highest complexity is selected as the reference node for mobile encryption, in the fifth round of encryption, the node with the fifth highest complexity is selected as the reference node for mobile encryption, and thus all encryption rounds of the graph structure are completed, and the encrypted transaction information is obtained.
In each round of encryption process, the node coding sequence of the reference node and the edge coding sequence of the edge are changed through the 'adsorption' of the edge to the code of the reference node, and the coding information of the reference node and the coding information of the node are changed through the 'blocking' of the node to the code of the reference node, so that the confusion degree of an encryption result is improved, no additional parameter is required to be set in the changing process, the original data is encrypted by utilizing the attribute of the graph structure, the key required to be stored is smaller, and the storage of the encrypted data is facilitated. The encryption effect is further guaranteed by multiple rounds of encryption, and the more complex the connection relation of the graph structure is, the better the encryption effect is.
Thus, the encryption of the transaction information of the card reader is completed, the encrypted transaction information is obtained, and the security of the transaction information in financial transaction can be ensured, so that the transaction information is not easy to crack.
It should be noted that: the sequence of the embodiments of the present invention is only for description, and does not represent the advantages and disadvantages of the embodiments. And the foregoing description has been directed to specific embodiments of this specification. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.
The above embodiments are only preferred embodiments of the present invention, and are not intended to limit the present invention, and any modifications, equivalent substitutions, improvements, etc. within the scope of the present invention should be included.

Claims (5)

1. A method for encrypting financial transaction information, the method comprising:
acquiring transaction information of a card reader, wherein the transaction information comprises a transaction user, transaction time and transaction amount; constructing a transaction graph structure based on transaction information, wherein nodes in the transaction graph structure are used for representing transaction users and transaction time respectively, and the length of a side connected between the nodes is used for representing transaction amount; obtaining a node coding sequence of each node and an edge coding sequence of an edge between the nodes;
the product of the number of edges connected with a node and the number of edges between the nodes connected with the node is the complexity of the node, and the node with the highest complexity is a reference node; obtaining the shortest path from the reference node to other nodes in the structure diagram; numbering the shortest paths according to the sequence of the reference nodes moving along the shortest paths to obtain path numbers; numbering the edges and the nodes according to the sequence of the edges and the nodes in each shortest path to obtain edge labels and node labels;
setting the number of encryption rounds, the first round of encryption of the graph structure is: when the reference node moves on each shortest path, encrypting the edge coding sequence of the edge and the node coding sequence of the node in each shortest path according to the node coding sequence of the reference node, the path number of the shortest path, the edge label of the edge and the node label of the node, completing one round of encryption of the graph structure, and the like, sequentially selecting the node as the reference node according to the complexity of the node to encrypt each round of encryption of the graph structure until the set encryption round number is completed, and obtaining encrypted transaction information;
when the reference node moves on each shortest path, encrypting the edge coding sequence of the edge and the node coding sequence of the node in each shortest path according to the node coding sequence of the reference node, the path number of the shortest path, the edge label of the edge and the node label of the node, and the method comprises the following steps:
when the reference node moves on the shortest path with the path number of 1 and passes by the edge with the edge number of 1, extracting a first code in the node code sequence of the reference node to obtain a moving code and a new node code sequence of the reference node, and moving the moving code to a first position in the edge code sequence of the edge with the edge number of 1 to obtain an encrypted code sequence of the edge with the edge number of 1; when the reference node moves to the node with the node number of 1, connecting the new node code sequence of the reference node with the node code sequence of the node with the node number of 1 end to end and moving one bit backward to obtain a segmentation code sequence, and segmenting the segmentation code sequence according to the number of codes in the new node code sequence and the node code sequence of the node with the node number of 1 to obtain a first new node code sequence and an encryption code sequence of the reference node and the node with the node number of 1 respectively;
when the reference node moves to the edge with the edge number of 2, extracting a first code in a first new node code sequence of the reference node to obtain a mobile code and a second new node code sequence of the reference node, and moving the mobile code to a second position in the edge code sequence of the edge with the edge number of 2 to obtain an encrypted code sequence of the edge with the edge number of 2; when the reference node moves to the node with the node number of 2, connecting a second new node code sequence of the reference node with the node code sequence of the node with the node number of 2 end to end and moving two bits backwards to obtain a first segmentation code sequence, and segmenting the first segmentation code sequence according to the second new node code sequence and the number of codes in the node code sequence of the node with the node number of 2 to respectively obtain a third new node code sequence and an encryption code sequence of the reference node and the node with the node number of 2; and by analogy, the encryption of the node code sequence of the node and the edge code sequence of the edge on the shortest path with the path number of 1 is completed, and the encryption code sequence of the last node on the shortest path with the path number of 1 is used as a replacement code sequence of a reference node; and encrypting the edge code sequence of the edge and the node code sequence of the node on the path number 2 by using the replacement code sequence of the reference node, and the like, and encrypting the edge code sequences of the edges and the node code sequences of the nodes on all the shortest paths in the structure diagram to complete the first round of encryption of the structure diagram.
2. The method of claim 1, wherein the constructing a transaction map structure based on the transaction information comprises: respectively taking a transaction user and transaction time as nodes in the graph structure; and connecting the node representing the transaction user with the node representing the transaction time according to the transaction time of one transaction user to form a graph structure.
3. The method according to claim 1, wherein the obtaining the node code sequence of each node and the edge code sequence of the edge between the nodes comprises: converting transaction user data representing nodes of a transaction user into binary codes to obtain a node coding sequence; converting transaction time data of nodes representing transaction time into binary codes to obtain node coding sequences; and converting the transaction amount represented by the length of the edge in the structure diagram into binary codes to obtain an edge code sequence of the edge.
4. The method of claim 1, wherein obtaining the shortest path from the reference node to each other node in the structure comprises: obtaining the shortest path from the reference node to each node in the structure diagram by using a breadth-first search algorithm; when the shortest paths from the reference node to one node in the structure diagram are more than one, the aggregation coefficient of each node on each shortest path corresponding to the node is obtained, and the shortest path with the largest sum of the aggregation coefficients is the shortest path of the node.
5. The method of claim 1, further comprising, prior to extracting the first code in the node code sequence of the reference node: and comparing the number of codes in the node code sequence of the reference node with the number of edges in the shortest path with the path number of 1, and if the number of codes in the node code sequence of the reference node is smaller than the number of edges in the shortest path with the path number of 1, adding binary codes from the tail end of the node code sequence of the reference node so that the number of codes in the node code sequence of the reference node is equal to the number of edges in the shortest path with the path number of 1.
CN202310036270.7A 2023-01-10 2023-01-10 Financial transaction information encryption method Active CN115760126B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310036270.7A CN115760126B (en) 2023-01-10 2023-01-10 Financial transaction information encryption method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310036270.7A CN115760126B (en) 2023-01-10 2023-01-10 Financial transaction information encryption method

Publications (2)

Publication Number Publication Date
CN115760126A CN115760126A (en) 2023-03-07
CN115760126B true CN115760126B (en) 2023-05-02

Family

ID=85348966

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310036270.7A Active CN115760126B (en) 2023-01-10 2023-01-10 Financial transaction information encryption method

Country Status (1)

Country Link
CN (1) CN115760126B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116150714B (en) * 2023-04-20 2023-06-27 无锡弘鼎软件科技有限公司 Security management method for software development data

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200084027A1 (en) * 2018-09-06 2020-03-12 Bank Of Montreal Systems and methods for encryption of data on a blockchain
CN113240420A (en) * 2021-05-23 2021-08-10 上海瞳越科技有限公司 Financial encryption payment method and system based on big data
CN114513297A (en) * 2022-01-26 2022-05-17 湖南管章科技有限公司 POS machine data encryption method and device
CN114884968A (en) * 2022-04-29 2022-08-09 深圳市迅雷网络技术有限公司 Situation awareness method based on block chain privacy transaction and related device
CN115270165B (en) * 2022-09-28 2022-12-13 南通佳茂霖智能科技有限公司 Information management method for engineering survey
CN115470508B (en) * 2022-11-02 2023-01-31 北京点聚信息技术有限公司 Format file vectorization encryption method

Also Published As

Publication number Publication date
CN115760126A (en) 2023-03-07

Similar Documents

Publication Publication Date Title
Wang et al. Reversible data hiding in encrypted images with block-based adaptive MSB encoding
CN107276744B (en) File storage encryption method and system
JP2021513141A (en) Generation and identification of 2D barcodes
CN115760126B (en) Financial transaction information encryption method
JPH09230786A (en) Encoding method of data and device therefor
CN115865953B (en) Distributed storage system based on cross-border payment
Namasudra et al. Applications and future trends of DNA computing
CN104636673B (en) A kind of secure storage method of data under big data background
CN115659409A (en) Financial asset transaction data safe storage method
Wu et al. Encryption of accounting data using DES algorithm in computing environment
Gao et al. High-performance reversible data hiding in encrypted images with adaptive Huffman code
Tahbaz et al. Evolutionary-based image encryption using Magic Square Chaotic algorithm and RNA codons truth table
CN116506105B (en) Data theft and tampering prevention encryption method based on block chain
CN111737713B (en) Two-dimensional code secret sharing method based on visual password
CN111083119B (en) Two-dimensional code-based large-capacity information transmission method
CN116756758A (en) Data encryption and decryption method and device, computer equipment and storage medium
CN109033853A (en) Physical layer information hidden method, device and terminal based on convolutional code
CN106156655B (en) A kind of compressing file and authentication method towards cloud storage
Satrio et al. Hiding Document Format Files Using Video Steganography Techniques with Least Significant Bit Method
CN113965312A (en) Space encryption method based on three-dimensional CAP constellation
CN110071927A (en) A kind of information ciphering method, system and associated component
CN117540441B (en) Transaction data secure storage method for hall type cloud terminal
Long et al. A novel medical image encryption scheme based on deep learning feature encoding and decoding
Luo et al. Robust secret image sharing scheme with improved anti-noise capability
Al-Jarrah et al. Word-based encryption algorithm using dictionary indexing with variable encryption key length

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230630

Address after: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Patentee after: Shenzhen aotongping Technology Co.,Ltd.

Address before: No. J4, 17/F, No. 1, Zhongguancun Street, Haidian District, Beijing, 100000

Patentee before: Beijing Houfang Technology Co.,Ltd.