CN116091224A - Blockchain transaction method and device based on hybrid encryption and electronic equipment - Google Patents

Blockchain transaction method and device based on hybrid encryption and electronic equipment Download PDF

Info

Publication number
CN116091224A
CN116091224A CN202211614168.2A CN202211614168A CN116091224A CN 116091224 A CN116091224 A CN 116091224A CN 202211614168 A CN202211614168 A CN 202211614168A CN 116091224 A CN116091224 A CN 116091224A
Authority
CN
China
Prior art keywords
key
transaction
temporary
blockchain
user public
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.)
Pending
Application number
CN202211614168.2A
Other languages
Chinese (zh)
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.)
Chengdu Quality Starker Technology Co Ltd
Original Assignee
Chengdu Quality Starker 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 Chengdu Quality Starker Technology Co Ltd filed Critical Chengdu Quality Starker Technology Co Ltd
Priority to CN202211614168.2A priority Critical patent/CN116091224A/en
Publication of CN116091224A publication Critical patent/CN116091224A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/045Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply hybrid encryption, i.e. combination of symmetric and asymmetric encryption

Abstract

The invention belongs to the technical field of blockchains, solves the problem of low successful execution rate of transactions caused by different blockchain versions in the prior art, and provides a blockchain transaction method and device based on hybrid encryption and electronic equipment. Comprising the following steps: acquiring a temporary key and a user public key, wherein the temporary key is a key randomly generated according to a transaction request of a first service node, and the user public key is a key published on a blockchain by a second service node; then, carrying out mixed encryption on transaction data plaintext of the transaction request by utilizing the temporary key and the user public key, and carrying out uplink transaction on the obtained transaction ciphertext; by adding the temporary key and utilizing the temporary key and the user public key to carry out mixed encryption on the transaction data, the problem of easiness in cracking of encryption by using the public user public key can be solved, and therefore the privacy security of the transaction data is improved.

Description

Blockchain transaction method and device based on hybrid encryption and electronic equipment
Technical Field
The present invention relates to the field of blockchain technologies, and in particular, to a blockchain transaction method and apparatus based on hybrid encryption, and an electronic device.
Background
The block chain technology is built on a transmission network (also called a block chain network), distributed node equipment (hereinafter called nodes for short) in the transmission network generates block data by a preset consensus strategy by running a block chain program, and verifies and stores the block data by utilizing a chain data structure, so that a data tamper-proof mechanism is finally realized, and a safe and reliable technical new idea is provided for service development.
In the prior art, the blockchain adopts a distributed account book technology, and privacy problems are encountered when transactions are carried out on the blockchain, because once transaction data is released to the blockchain, the transaction data can be acquired by all nodes on the blockchain, so that privacy leakage is caused; how to guarantee the privacy security of transaction data on a blockchain is a problem to be solved.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide a blockchain transaction method, device and electronic equipment based on hybrid encryption, which are used for solving the technical problem of how to guarantee the privacy and security of transaction data on a blockchain in the prior art.
The technical scheme adopted by the invention is as follows:
in one aspect, the present invention provides a blockchain transaction method based on hybrid encryption, the method comprising:
acquiring a temporary key and a user public key, wherein the temporary key is a key randomly generated according to a transaction request of a first service node, and the user public key is a key published on a blockchain by a second service node;
carrying out mixed encryption on transaction data plaintext of the transaction request by utilizing the temporary key and the user public key, and carrying out uplink transaction on the obtained transaction ciphertext;
the first service node is a member node on a blockchain corresponding to a service initiator, and the second service node is a member node on a blockchain corresponding to a service receiver.
Preferably, the obtaining a temporary key and a user public key, where the temporary key is a key randomly generated according to a transaction request of a first service node, and the user public key is a key published on a blockchain for a second service node includes:
responding to the received transaction request of the first service node;
generating the temporary key using a first encryption algorithm based on the transaction request;
wherein the first encryption algorithm comprises an elliptic curve encryption algorithm and the temporary key comprises a temporary private key and a temporary public key.
Preferably, the encrypting the transaction data plaintext of the transaction request by using the temporary key and the user public key, and uplink the obtained transaction ciphertext comprises:
generating a negotiation key by using a second encryption algorithm according to the user public key and the temporary key;
encrypting the transaction data of the transaction request by using the negotiation key to obtain the transaction ciphertext and uploading the transaction ciphertext;
wherein the second encryption algorithm comprises an elliptic curve encryption algorithm.
Preferably, said generating a negotiation key from said user public key and said temporary key using a second encryption algorithm comprises:
generating a basic key by utilizing a second encryption algorithm according to the user public key and the temporary key;
and encrypting the basic key by using the temporary private key of the temporary key to obtain the negotiation key.
Preferably, encrypting the transaction data of the transaction request by using the negotiation key to obtain the transaction ciphertext and uplink transaction includes:
and uploading the transaction ciphertext and the temporary key.
Preferably, the step of linking the transaction cryptogram and the temporary key comprises:
and encrypting the temporary key by using the user public key to obtain the encrypted temporary key.
Preferably, the decrypting the transaction cryptogram by the second service node includes:
acquiring a user private key corresponding to the user public key;
and decrypting the transaction ciphertext by using the user private key and the temporary key to obtain the transaction data plaintext of the transaction request.
In another aspect, the present invention also provides a blockchain transaction device based on hybrid encryption, including:
and a data acquisition module: the method comprises the steps of obtaining a temporary key and a user public key, wherein the temporary key is a key which is randomly generated according to a transaction request of a first service node, and the user public key is a key which is published on a blockchain for a second service node;
and a data encryption module: the method comprises the steps of performing mixed encryption on transaction data plaintext of the transaction request by utilizing the temporary key and the user public key, and performing uplink transaction on the obtained transaction ciphertext;
the first service node is a member node on a blockchain corresponding to a service initiator, and the second service node is a member node on a blockchain corresponding to a service receiver.
The invention also provides an electronic device, comprising: at least one processor, at least one memory, and computer program instructions stored in the memory, which when executed by the processor, implement the method of any of the above.
The invention also provides a medium having stored thereon computer program instructions which when executed by a processor implement a method as claimed in any one of the preceding claims.
In summary, the beneficial effects of the invention are as follows:
the invention provides a blockchain transaction method and device based on hybrid encryption and an electronic device, comprising the following steps: acquiring a temporary key and a user public key, wherein the temporary key is a key randomly generated according to a transaction request of a first service node, and the user public key is a key published on a blockchain by a second service node; dividing member nodes participating in transaction into a first service node, a second service node and other service nodes according to service relations, wherein the first service node is a member node corresponding to a service initiator, the second service node is a member node using service data, the first service node and the second service node can be regarded as service nodes corresponding to both sides of the transaction, and the other service nodes are other member nodes participating in the transaction, including consensus nodes, sequencing nodes and the like; when a user issues a transaction request to a blockchain through a first service node of a client, a temporary key is generated in response to the transaction request, then the transaction data plaintext of the transaction request is subjected to mixed encryption by utilizing the temporary key and the user public key, and the obtained transaction ciphertext is subjected to uplink transaction; by adding the temporary key and utilizing the temporary key and the user public key to carry out mixed encryption on the transaction data, the problem of easiness in cracking of encryption by using the public user public key can be solved, and therefore the privacy security of the transaction data is improved.
Drawings
In order to more clearly illustrate the technical solution of the embodiments of the present invention, the drawings required to be used in the embodiments of the present invention will be briefly described, and it is within the scope of the present invention to obtain other drawings according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a blockchain transaction method based on hybrid encryption in embodiment 1 of the present invention;
fig. 2 is a schematic flow chart of generating a temporary key based on a first encryption algorithm in embodiment 1 of the present invention;
fig. 3 is a flow chart of acquiring ciphertext uplink after hybrid encryption in embodiment 1 of the present invention;
fig. 4 is a schematic diagram of a decryption flow for obtaining a hybrid encrypted ciphertext according to embodiment 1 of the invention;
FIG. 5 is a block chain transaction device based on hybrid encryption in accordance with the embodiment 2 of the present invention;
fig. 6 is a schematic structural diagram of an electronic device in embodiment 3 of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. In the description of the present invention, it should be understood that the terms "center," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," and the like indicate orientations or positional relationships based on the orientation or positional relationships shown in the drawings, merely to facilitate description of the present application and simplify the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present invention. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element. The various features of the invention and of the embodiments may be combined with one another without conflict, and are within the scope of the invention.
For ease of understanding herein, a brief description of the blockchain structure is provided herein: blockchains primarily complete transactions through smart contracts, where smart contracts primarily involve three important classes of nodes. The method comprises the steps of respectively obtaining member nodes, endorsement nodes and ordering nodes, wherein the endorsement nodes and the ordering nodes are special member nodes. The member node may be connected to the client, and the user may initiate an intelligent contract transaction by connecting the member node to the client, i.e. the user may send a transaction request using the member node. An endorsement node refers to a node that endorses an intelligent contract, i.e., a node that simulates executing an intelligent contract. That is, the endorsement node can simulate and execute the intelligent contract to obtain the execution result of the intelligent contract; the ordering node receives the transaction containing the endorsement signature, orders the unpacked transaction to generate a block, and broadcasts the block to the common node for execution.
Example 1
Referring to fig. 1, fig. 1 is a block chain transaction method based on hybrid encryption in embodiment 1 of the present invention, where the method includes:
s1: acquiring a temporary key and a user public key, wherein the temporary key is a key randomly generated according to a transaction request of a first service node, and the user public key is a key published on a blockchain by a second service node;
specifically, in response to a transaction request sent by a user to a blockchain through a first service node, a temporary key corresponding to the transaction request is generated based on the transaction request, the temporary key and a user public key are obtained, the user public key is a key which is published on the blockchain in advance for a second service node, a user private key corresponds to the user public key, and the user private key is stored at a user end corresponding to the second service node.
S2: carrying out mixed encryption on transaction data plaintext of the transaction request by utilizing the temporary key and the user public key, and carrying out uplink transaction on the obtained transaction ciphertext;
the first service node is a member node on a blockchain corresponding to a service initiator, and the second service node is a member node on a blockchain corresponding to a service receiver.
Specifically, after the temporary key is obtained, the transaction data plaintext of the transaction request is encrypted by combining the temporary key and the user public key, and the temporary key is a key temporarily generated based on the actual transaction request, so that the temporary key does not exist in advance on the blockchain or the user side, and the data security of the transaction data can be improved.
In one embodiment, referring to fig. 2, the step S1 includes:
s11: responding to the received transaction request of the first service node;
s12: generating the temporary key using a first encryption algorithm based on the transaction request;
wherein the first encryption algorithm comprises an elliptic curve encryption algorithm and the temporary key comprises a temporary private key and a temporary public key.
Specifically, after the blockchain receives a transaction request of a first service node, a preset first encryption algorithm is utilized to generate a corresponding temporary key, the first encryption algorithm is an elliptic curve encryption algorithm, preferably, the encryption algorithm corresponding to the temporary key is consistent with the encryption algorithm corresponding to a private key of a user and a public key of the user, such as an ECC algorithm, an ECDH algorithm, an SM2 algorithm and the like, the public key is used for encrypting plaintext to be encrypted, and the private key is used for decrypting ciphertext encrypted by the public key.
In one embodiment, referring to fig. 3, the step S2 includes:
s21: generating a negotiation key by using a second encryption algorithm according to the user public key and the temporary key;
s22: and encrypting the transaction data of the transaction request by using the negotiation key to obtain the transaction ciphertext and uploading the transaction ciphertext.
Specifically, the specific way of carrying out mixed encryption on the transaction request by the user public key and the temporary key is that the user public key and the temporary key are subjected to second encryption algorithm operation so as to obtain a negotiation key; encrypting transaction data by using the negotiation key, and realizing hybrid encryption to improve encryption complexity; the first encryption algorithm comprises an ECC algorithm, an ECDH algorithm and an SM2 algorithm in an elliptic curve encryption algorithm.
In an embodiment, the step S21 includes:
s211: generating a basic key by utilizing a second encryption algorithm according to the user public key and the temporary key;
s212: and encrypting the basic key by using the temporary private key of the temporary key to obtain the negotiation key.
Specifically, a second encryption algorithm operation is performed on the user public key and the temporary key to obtain a basic key, then the basic key is encrypted by using the temporary private key of the temporary key, a self-locking negotiation key of the basic key is realized, transaction data is encrypted by using the negotiation key, and data security is improved.
In an embodiment, the S22 includes:
and uploading the transaction ciphertext and the temporary key.
In an embodiment, the step of linking the transaction cryptogram to the temporary key comprises, prior to:
and encrypting the temporary key by using the user public key to obtain the encrypted temporary key.
Specifically, after the transaction data plaintext of the transaction request is encrypted to obtain a transaction ciphertext, the transaction ciphertext is uplink, and the temporary key is uplink at the same time; it should be noted that: before the temporary key is linked, the temporary key is encrypted by using a user public key to complete the interlocking of the temporary key, and the encrypted temporary key is linked; the probability of the temporary key being broken can be improved. In a specific embodiment, the temporary key and the transaction ciphertext may be packaged into one transaction for uplink, or the transaction ciphertext and the temporary key may be used as a plurality of transactions for uplink, which is not limited in particular.
In an embodiment, said linking said transaction cryptogram to said temporary key comprises:
acquiring a first transaction corresponding to the transaction ciphertext and a second transaction corresponding to the temporary key;
establishing a corresponding relation between the first transaction and the second transaction;
and respectively linking the first transaction and the second transaction, wherein the transaction ciphertext comprises the corresponding relation and transaction data plaintext of the transaction request.
Specifically, the temporary secret key and the transaction ciphertext are used as a plurality of transactions to be uplink, so that data leakage caused by interception of one transaction can be avoided, the transaction ciphertext is used as a first transaction, and the temporary secret key is used as a second transaction; establishing a corresponding relation between the first transaction and the second transaction, wherein the corresponding relation comprises a generation mode of a negotiation key, a first encryption algorithm, a second encryption algorithm and a temporary key encryption mode; if the first encryption algorithm and the second encryption algorithm are both ECDH algorithm, the temporary key is the key encrypted by the user public key, and the negotiation key is the user public key and the temporary public key, the first encryption algorithm is operated to obtain; in a specific embodiment, the plaintext corresponding to the transaction ciphertext includes the plaintext of the corresponding relationship and the plaintext of the transaction data of the transaction request, that is, after the content of the corresponding relationship is determined, the plaintext data of the first transaction is encrypted by the negotiation key, so as to obtain the transaction ciphertext of the first transaction for uplink.
In an embodiment, the first block height is spaced between the first transaction and the second transaction, and privacy security of transaction data is improved by spacing the first block height.
In an embodiment, the height of the first block is a dynamic value, so that different first service nodes can be conveniently set according to the service characteristics of the first service nodes by setting the height of the first block as the dynamic value, and the flexibility of service transaction is improved; the dynamic value comprises a time difference value and a block number difference value; the time difference is that a first transaction is uplink at a first time and a second transaction is uplink at a second time; the difference in the number of blocks is the second transaction after the first transaction is uplink and N blocks are separated.
In another embodiment, the first transaction includes ciphertext of the transaction data and plaintext of the correspondence, wherein the first transaction lags the second transaction. By executing the transaction including the correspondence with a delay, it is possible to avoid locking the second transaction in advance after the correspondence is taken.
In one embodiment, referring to fig. 4, the decrypting the transaction ciphertext by the second service node includes:
s3: acquiring a user private key corresponding to the user public key;
s4: and decrypting the transaction ciphertext by using the user private key and the temporary key to obtain a transaction plaintext of the transaction request.
In an embodiment, the S4 includes:
s41: decrypting the temporary encryption key by using the user private key to obtain the temporary key;
s42: generating the negotiation key based on a second encryption algorithm according to the user public key and the temporary key;
s43: and decrypting the transaction ciphertext by using the negotiation key to obtain a transaction plaintext of the transaction request.
Specifically, after receiving the transaction ciphertext, the second service node acquires a user private key and a temporary key corresponding to the user public key, and similarly, the user public key and the temporary key perform second encryption algorithm operation to generate a negotiation key again, and decrypt the transaction ciphertext by using the negotiation key, thereby obtaining a transaction plaintext of the transaction request; in a specific embodiment, the encrypted temporary key is decrypted by using a user private key corresponding to the user public key, the decrypted temporary key and the user public key are subjected to a second encryption algorithm operation to generate a negotiation key again, and then the transaction ciphertext is decrypted by using the negotiation key, so that the encryption and decryption process of the transaction data of the transaction request is completed, and the secret transaction is realized.
It should be noted that: the elliptic curve encryption algorithm is an existing algorithm, and under the condition that a pair of user private keys and a pair of user public keys of the second service node are existing, a pair of temporary private keys and a pair of temporary public keys are randomly generated, so that the result obtained by carrying out elliptic curve encryption algorithm operation on the temporary private keys or the temporary public keys and the existing user public keys each time is the same.
The invention provides a blockchain transaction method based on mixed encryption, which comprises the following steps: acquiring a temporary key and a user public key, wherein the temporary key is a key randomly generated according to a transaction request of a first service node, and the user public key is a key published on a blockchain by a second service node; dividing member nodes participating in transaction into a first service node, a second service node and other service nodes according to service relations, wherein the first service node is a member node corresponding to a service initiator, the second service node is a member node using service data, the first service node and the second service node can be regarded as service nodes corresponding to both sides of the transaction, and the other service nodes are other member nodes participating in the transaction, including consensus nodes, sequencing nodes and the like; when a user issues a transaction request to a blockchain through a first service node of a client, a temporary key is generated in response to the transaction request, then the transaction data plaintext of the transaction request is subjected to mixed encryption by utilizing the temporary key and the user public key, and the obtained transaction ciphertext is subjected to uplink transaction; by adding the temporary key and utilizing the temporary key and the user public key to carry out mixed encryption on the transaction data, the problem of easiness in cracking of encryption by using the public user public key can be solved, and therefore the privacy security of the transaction data is improved.
Example 2
Referring to fig. 5, the blockchain transaction method based on the hybrid encryption of the present invention based on embodiment 1 further provides a blockchain transaction device based on the hybrid encryption, the device includes:
and a data acquisition module: the method comprises the steps of obtaining a temporary key and a user public key, wherein the temporary key is a key which is randomly generated according to a transaction request of a first service node, and the user public key is a key which is published on a blockchain for a second service node;
and a data encryption module: the method comprises the steps of performing mixed encryption on transaction data plaintext of the transaction request by utilizing the temporary key and the user public key, and performing uplink transaction on the obtained transaction ciphertext;
the first service node is a member node on a blockchain corresponding to a service initiator, and the second service node is a member node on a blockchain corresponding to a service receiver.
The invention provides a blockchain transaction device based on mixed encryption, which comprises: acquiring a temporary key and a user public key, wherein the temporary key is a key randomly generated according to a transaction request of a first service node, and the user public key is a key published on a blockchain by a second service node; dividing member nodes participating in transaction into a first service node, a second service node and other service nodes according to service relations, wherein the first service node is a member node corresponding to a service initiator, the second service node is a member node using service data, the first service node and the second service node can be regarded as service nodes corresponding to both sides of the transaction, and the other service nodes are other member nodes participating in the transaction, including consensus nodes, sequencing nodes and the like; when a user issues a transaction request to a blockchain through a first service node of a client, a temporary key is generated in response to the transaction request, then the transaction data plaintext of the transaction request is subjected to mixed encryption by utilizing the temporary key and the user public key, and the obtained transaction ciphertext is subjected to uplink transaction; by adding the temporary key and utilizing the temporary key and the user public key to carry out mixed encryption on the transaction data, the problem of easiness in cracking of encryption by using the public user public key can be solved, and therefore the privacy security of the transaction data is improved.
In one embodiment, the data acquisition module includes:
a transaction response unit: responding to the received transaction request of the first service node;
a key generation unit: generating the temporary key using a first encryption algorithm based on the transaction request;
wherein the first encryption algorithm comprises an elliptic curve encryption algorithm and the temporary key comprises a temporary private key and a temporary public key.
In one embodiment, the data encryption module includes:
key negotiation unit: generating a negotiation key by using a second encryption algorithm according to the user public key and the temporary key;
hybrid encryption unit: encrypting the transaction data of the transaction request by using the negotiation key to obtain the transaction ciphertext and uploading the transaction ciphertext;
wherein the second encryption algorithm comprises an elliptic curve encryption algorithm.
In an embodiment, the key negotiation unit comprises:
a first key unit: generating a basic key by utilizing a second encryption algorithm according to the user public key and the temporary key;
a key encryption unit: and encrypting the basic key by using the temporary private key of the temporary key to obtain the negotiation key.
In an embodiment, the hybrid encryption unit includes:
and uploading the transaction ciphertext and the temporary key.
Preferably, the key interlock unit includes:
and encrypting the temporary key by using the user public key to obtain the encrypted temporary key.
Preferably, the ciphertext decryption module includes:
a key acquisition unit: acquiring a user private key corresponding to the user public key;
ciphertext decryption unit: and decrypting the transaction ciphertext by using the user private key and the temporary key to obtain the transaction data plaintext of the transaction request.
The invention provides a blockchain transaction device based on mixed encryption, which comprises: acquiring a temporary key and a user public key, wherein the temporary key is a key randomly generated according to a transaction request of a first service node, and the user public key is a key published on a blockchain by a second service node; dividing member nodes participating in transaction into a first service node, a second service node and other service nodes according to service relations, wherein the first service node is a member node corresponding to a service initiator, the second service node is a member node using service data, the first service node and the second service node can be regarded as service nodes corresponding to both sides of the transaction, and the other service nodes are other member nodes participating in the transaction, including consensus nodes, sequencing nodes and the like; when a user issues a transaction request to a blockchain through a first service node of a client, a temporary key is generated in response to the transaction request, then the transaction data plaintext of the transaction request is subjected to mixed encryption by utilizing the temporary key and the user public key, and the obtained transaction ciphertext is subjected to uplink transaction; by adding the temporary key and utilizing the temporary key and the user public key to carry out mixed encryption on the transaction data, the problem of easiness in cracking of encryption by using the public user public key can be solved, and therefore the privacy security of the transaction data is improved.
Example 3
The present invention provides an electronic device and a storage medium, please refer to fig. 6, comprising at least one processor, at least one memory and computer program instructions stored in the memory.
In particular, the processor may comprise a Central Processing Unit (CPU), or an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or may be configured as one or more integrated circuits implementing embodiments of the present invention, the electronic device comprising at least one of: computers, mobile terminals, PCs, tablet computers, etc.
The memory may include mass storage for data or instructions. By way of example, and not limitation, the memory may comprise a Hard Disk Drive (HDD), floppy Disk Drive, flash memory, optical Disk, magneto-optical Disk, magnetic tape, or universal serial bus (Universal Serial Bus, USB) Drive, or a combination of two or more of the foregoing. The memory may include removable or non-removable (or fixed) media, where appropriate. The memory may be internal or external to the data processing apparatus, where appropriate. In a particular embodiment, the memory is a non-volatile solid state memory. In a particular embodiment, the memory includes Read Only Memory (ROM). The ROM may be mask programmed ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically Erasable PROM (EEPROM), electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these, where appropriate.
The processor reads and executes the computer program instructions stored in the memory to implement any of the blockchain transaction methods based on hybrid encryption in accordance with the first embodiment.
In one example, the electronic device may also include a communication interface and a bus. The processor, the memory and the communication interface are connected through a bus and complete communication with each other.
The communication interface is mainly used for realizing communication among the modules, the devices, the units and/or the equipment in the embodiment of the invention.
The bus includes hardware, software, or both that couple components of the electronic device to each other. By way of example, and not limitation, the buses may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an infiniband interconnect, a Low Pin Count (LPC) bus, a memory bus, a micro channel architecture (MCa) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a video electronics standards association local (VLB) bus, or other suitable bus, or a combination of two or more of the above. The bus may include one or more buses, where appropriate. Although embodiments of the invention have been described and illustrated with respect to a particular bus, the invention contemplates any suitable bus or interconnect.
It should be understood that the invention is not limited to the particular arrangements and instrumentality described above and shown in the drawings. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present invention are not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between steps, after appreciating the spirit of the present invention.
The functional blocks shown in the above-described structural block diagrams may be implemented in hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, a plug-in, a function card, or the like. When implemented in software, the elements of the invention are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine readable medium or transmitted over transmission media or communication links by a data signal carried in a carrier wave. A "machine-readable medium" may include any medium that can store or transfer information. Examples of machine-readable media include electronic circuitry, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio Frequency (RF) links, and the like. The code segments may be downloaded via computer networks such as the internet, intranets, etc.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the invention.

Claims (10)

1. A blockchain transaction method based on hybrid encryption, the method comprising:
acquiring a temporary key and a user public key, wherein the temporary key is a key randomly generated according to a transaction request of a first service node, and the user public key is a key published on a blockchain by a second service node;
carrying out mixed encryption on transaction data plaintext of the transaction request by utilizing the temporary key and the user public key, and carrying out uplink transaction on the obtained transaction ciphertext;
the first service node is a member node on a blockchain corresponding to a service initiator, and the second service node is a member node on a blockchain corresponding to a service receiver.
2. The hybrid encryption based blockchain transaction method of claim 1, wherein the obtaining a temporary key and a user public key, wherein the temporary key is a key randomly generated according to a transaction request of a first service node, and wherein the user public key is a key published on a blockchain for a second service node comprises:
responding to the received transaction request of the first service node;
generating the temporary key using a first encryption algorithm based on the transaction request;
wherein the first encryption algorithm comprises an elliptic curve encryption algorithm and the temporary key comprises a temporary private key and a temporary public key.
3. The blockchain transaction method based on hybrid encryption of claim 1, wherein the encrypting the transaction data plaintext of the transaction request using the temporary key and the user public key and uploading the resulting transaction ciphertext into a transaction comprises:
generating a negotiation key by using a second encryption algorithm according to the user public key and the temporary key;
encrypting the transaction data of the transaction request by using the negotiation key to obtain the transaction ciphertext and uploading the transaction ciphertext;
wherein the second encryption algorithm comprises an elliptic curve encryption algorithm.
4. The hybrid encryption based blockchain transaction method of claim 3, wherein the generating a negotiation key from the user public key and the temporary key using a second encryption algorithm includes:
generating a basic key by utilizing a second encryption algorithm according to the user public key and the temporary key;
and encrypting the basic key by using the temporary private key of the temporary key to obtain the negotiation key.
5. The hybrid encryption based blockchain transaction method of claim 3, wherein encrypting the transaction data of the transaction request using the negotiation key to obtain the transaction ciphertext and uplink the transaction comprises:
and uploading the transaction ciphertext and the temporary key.
6. The hybrid encryption based blockchain transaction method of claim 5, wherein the step of prior to the step of uplink the transaction ciphertext and the temporary key comprises:
and encrypting the temporary key by using the user public key to obtain the encrypted temporary key.
7. The hybrid encryption based blockchain transaction method according to any of claims 1 to 6, wherein the second service node decrypting the transaction ciphertext includes:
acquiring a user private key corresponding to the user public key;
and decrypting the transaction ciphertext by using the user private key and the temporary key to obtain the transaction data plaintext of the transaction request.
8. A blockchain transaction device based on hybrid encryption, comprising:
and a data acquisition module: the method comprises the steps of obtaining a temporary key and a user public key, wherein the temporary key is a key which is randomly generated according to a transaction request of a first service node, and the user public key is a key which is published on a blockchain for a second service node;
and a data encryption module: the method comprises the steps of performing mixed encryption on transaction data plaintext of the transaction request by utilizing the temporary key and the user public key, and performing uplink transaction on the obtained transaction ciphertext;
the first service node is a member node on a blockchain corresponding to a service initiator, and the second service node is a member node on a blockchain corresponding to a service receiver.
9. An electronic device, comprising: at least one processor, at least one memory, and computer program instructions stored in the memory, which when executed by the processor, implement the method of any one of claims 1-7.
10. A storage medium having stored thereon computer program instructions, which when executed by a processor, implement the method of any of claims 1-7.
CN202211614168.2A 2022-12-15 2022-12-15 Blockchain transaction method and device based on hybrid encryption and electronic equipment Pending CN116091224A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211614168.2A CN116091224A (en) 2022-12-15 2022-12-15 Blockchain transaction method and device based on hybrid encryption and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211614168.2A CN116091224A (en) 2022-12-15 2022-12-15 Blockchain transaction method and device based on hybrid encryption and electronic equipment

Publications (1)

Publication Number Publication Date
CN116091224A true CN116091224A (en) 2023-05-09

Family

ID=86187716

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211614168.2A Pending CN116091224A (en) 2022-12-15 2022-12-15 Blockchain transaction method and device based on hybrid encryption and electronic equipment

Country Status (1)

Country Link
CN (1) CN116091224A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117032592A (en) * 2023-10-08 2023-11-10 湖南省金河计算机科技有限公司 Cash register collection data storage system based on blockchain

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117032592A (en) * 2023-10-08 2023-11-10 湖南省金河计算机科技有限公司 Cash register collection data storage system based on blockchain
CN117032592B (en) * 2023-10-08 2023-12-12 湖南省金河计算机科技有限公司 Cash register collection data storage system based on blockchain

Similar Documents

Publication Publication Date Title
CN110995642B (en) Providing secure connections using pre-shared keys
EP3318043B1 (en) Mutual authentication of confidential communication
US9979703B2 (en) Updating software on a secure element
CN101098222B (en) Wireless communication system, wireless communication apparatus, and method of exchanging cryptography key between wireless communication apparatuses
US8332643B2 (en) Establishing secure mutual trust using an insecure password
CN111435913B (en) Identity authentication method and device for terminal of Internet of things and storage medium
CN113569267B (en) Privacy safety data set intersection method, device, equipment and storage medium
EP2961094A1 (en) System and method for generating a random number
US11310039B2 (en) Lightweight distributed signature protocol for mobile computing and IoT devices
JP2018516509A (en) System and method for distance bounding to a device to be authenticated
CN109361508A (en) Data transmission method, electronic equipment and computer readable storage medium
CN111418182B (en) Information processing apparatus, registration apparatus, information processing method, registration method, and computer program
US20200015078A1 (en) Efficient and secure distributed signing protocol for mobile devices in wireless networks
CN116091224A (en) Blockchain transaction method and device based on hybrid encryption and electronic equipment
CN115208557A (en) Data encryption method and device, electronic equipment and computer storage medium
CN104868994A (en) Collaboration secret key management method, device and system
CN116228228A (en) Block chain encryption transaction method, device, equipment and storage medium
US11909867B2 (en) Key exchange system, method and program for generating a shared key for secure communication
CN114172923A (en) Data transmission method, communication system and communication device
CN103929743B (en) A kind of encryption method to mobile intelligent terminal transmission data
CN112464262B (en) Alliance chain encryption method, device, equipment and storage medium
CN109347735A (en) A kind of secure data exchange method based on application integration plug-in unit
CN114915487B (en) Terminal authentication method, system, device, equipment and storage medium
US11343078B2 (en) System and method for secure input at a remote service
KR102626868B1 (en) Signature method and system based on key insulation

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