CN111934874A - Block chain-based data encryption and decryption method, equipment and medium - Google Patents

Block chain-based data encryption and decryption method, equipment and medium Download PDF

Info

Publication number
CN111934874A
CN111934874A CN202010575774.2A CN202010575774A CN111934874A CN 111934874 A CN111934874 A CN 111934874A CN 202010575774 A CN202010575774 A CN 202010575774A CN 111934874 A CN111934874 A CN 111934874A
Authority
CN
China
Prior art keywords
key
public key
block chain
node
preset algorithm
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
CN202010575774.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.)
Shandong Inspur Quality Chain Technology Co Ltd
Original Assignee
Shandong Inspur Quality Chain 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 Shandong Inspur Quality Chain Technology Co Ltd filed Critical Shandong Inspur Quality Chain Technology Co Ltd
Priority to CN202010575774.2A priority Critical patent/CN111934874A/en
Publication of CN111934874A publication Critical patent/CN111934874A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/14Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms
    • 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
    • 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/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0631Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • H04L9/0825Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) using asymmetric-key encryption or public key infrastructure [PKI], e.g. key signature or public key certificates

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Storage Device Security (AREA)

Abstract

The application discloses a block chain-based data encryption and decryption method, device and medium, comprising: determining a first public key and a first private key of a first node according to a first preset algorithm, and uploading the first public key to a block chain; acquiring a second public key of a second node on the block chain, and operating the first private key and the second public key through the first preset algorithm to determine a symmetric secret key; and encrypting data according to the symmetric secret key, and writing the encrypted data into the block chain through an intelligent contract. In the embodiment of the specification, the first private key and the second public key are operated through a first preset algorithm to determine the symmetric secret key, and data is encrypted through the symmetric secret key.

Description

Block chain-based data encryption and decryption method, equipment and medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, and a medium for data encryption and decryption based on a blockchain.
Background
In a blockchain system, data on the chain has the property of being non-tamperable, but at the same time is also visible to all members. Therefore, for privacy protection purposes, the sensitive data of the uplink typically needs to be encrypted by a data encryption algorithm.
When data is encrypted, a symmetric encryption algorithm is mostly used, but in the existing symmetric encryption algorithm, potential safety hazards may be generated when symmetric keys are generated and transmitted, and the security of the encrypted data cannot be guaranteed.
Disclosure of Invention
In view of this, embodiments of the present application provide a method, device, and medium for encrypting and decrypting data based on a block chain, so as to solve the problem in the prior art that encrypting data is not safe.
The embodiment of the application adopts the following technical scheme:
the embodiment of the application provides a data encryption method based on a block chain, which comprises the following steps:
determining a first public key and a first private key of a first node according to a first preset algorithm, and uploading the first public key to a block chain;
acquiring a second public key of a second node on the block chain, and operating the first private key and the second public key through the first preset algorithm to determine a symmetric secret key;
and encrypting data according to the symmetric secret key, and writing the encrypted data into the block chain through an intelligent contract.
It should be noted that, in the embodiment of the present specification, a first preset algorithm is used to perform an operation on a first private key and a second public key, to determine a symmetric key, and encrypt data by using the symmetric key, because the first private key is only present in a first node and cannot be obtained by other nodes, the security of the first node for generating the symmetric key is ensured, and the security of the first node for performing data encryption is also ensured.
Further, the first public key is obtained by computing the first private key and a base point in the first preset algorithm.
It should be noted that the first public key may be obtained by computing the first private key and a base point in a first preset algorithm, which indicates that there is a relationship between the first public key, the first private key and the base point in the first preset algorithm, but the first private key cannot be obtained by computing the first public key and the base point in the first algorithm.
Further, the first preset algorithm is an elliptic curve digital signature algorithm, the first private key is a positive integer, and the first public key is a point on an elliptic curve.
It should be noted that, the public key and the private key obtained according to the elliptic curve data signature algorithm satisfy that the private key is a positive integer and the public key is a point on the elliptic curve, and meanwhile, there is a base point, and the public key can be obtained through the operation of the private key and the base point.
Further, encrypting data according to the symmetric key specifically includes:
and encrypting the data according to the symmetric secret key and a second preset algorithm.
Further, the second preset algorithm is an AES algorithm.
It should be noted that AES encryption has many rounds of repetition and transformation. The AES algorithm is a symmetric encryption algorithm. The symmetric encryption means that the encryption password is the same as the decryption password.
The embodiment of the present application further provides a data decryption method based on a block chain, where the method includes:
obtaining a second public key and a second private key of a second node through a first preset algorithm, and uploading the second public key to a block chain;
acquiring encrypted data and a first public key of a first node on a block chain;
calculating the second private key and the first public key through the first preset algorithm to determine a symmetric secret key;
and decoding the encrypted data according to the symmetric secret key to obtain the decrypted data.
It should be noted that, in this embodiment of the present specification, when the second node decrypts encrypted data by using the symmetric key, the symmetric key sent by the first node is not received, and the second private key and the first public key are operated by using a first preset algorithm, so as to determine the same symmetric key as that of the first node. The second private key only exists in the second node, and other nodes cannot obtain the second private key, so that the security of the second node for generating the symmetric private key is ensured, and the security of the second node for decrypting the encrypted data is also ensured.
Further, the second public key is obtained by the operation of the second private key and a base point in the first preset algorithm.
An embodiment of the present application further provides a data encryption device based on a block chain, where the device includes:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
determining a first public key and a first private key of a first node according to a first preset algorithm, and uploading the first public key to a block chain;
acquiring a second public key of a second node on the block chain, and operating the first private key and the second public key through the first preset algorithm to determine a symmetric secret key;
and encrypting data according to the symmetric secret key, and writing the encrypted data into the block chain through an intelligent contract.
An embodiment of the present application further provides a data encryption medium based on a blockchain, in which computer-executable instructions are stored, where the computer-executable instructions are set to:
determining a first public key and a first private key of a first node according to a first preset algorithm, and uploading the first public key to a block chain;
acquiring a second public key of a second node on the block chain, and operating the first private key and the second public key through the first preset algorithm to determine a symmetric secret key;
and encrypting data according to the symmetric secret key, and writing the encrypted data into the block chain through an intelligent contract.
An embodiment of the present application further provides a data decryption device based on a block chain, where the device includes:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
obtaining a second public key and a second private key of a second node through a first preset algorithm, and uploading the second public key to a block chain;
acquiring encrypted data and a first public key of a first node on a block chain;
calculating the second private key and the first public key through the first preset algorithm to determine a symmetric secret key;
and decoding the encrypted data according to the symmetric secret key to obtain the decrypted data.
The embodiment of the application adopts at least one technical scheme which can achieve the following beneficial effects:
1. the embodiment of the specification calculates the first private key and the second public key through a first preset algorithm to determine a symmetric secret key, and encrypts data through the symmetric secret key, wherein the first private key only exists in the first node, and other nodes cannot obtain the first private key, so that the security of the first node for generating the symmetric secret key is ensured, and the security of the first node for encrypting data is also ensured;
2. when the second node decrypts encrypted data by using the symmetric key, the symmetric key sent by the first node is not received, but the second private key and the first public key are operated by using a first preset algorithm, so as to determine the symmetric key the same as that of the first node. The second private key only exists in the second node, and other nodes cannot obtain the second private key, so that the security of the second node for generating the symmetric private key is ensured, and the security of the second node for decrypting the encrypted data is also ensured.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic flowchart of a data encryption method based on a blockchain according to a first embodiment of the present disclosure;
fig. 2 is a flowchart illustrating a data decryption method based on a block chain according to a second embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of a block chain-based data encryption method provided in an embodiment of the present specification, where the embodiment of the present specification may be implemented by a first node, and specifically includes:
step S101, the first node determines a first public key and a first private key of the first node according to a first preset algorithm, and uploads the first public key to a block chain.
In step S101 in this embodiment of the present specification, the first public key is obtained by computing the first private key and a base point in the first preset algorithm.
The first preset algorithm may be an elliptic curve digital signature algorithm. Elliptic Curve Digital Signature Algorithm (ECDSA) is a simulation of Digital Signature Algorithm (DSA) using Elliptic Curve Cryptography (ECC). The first private key obtained by the first preset algorithm may be a relatively large positive integer, the first public key may be a point on an elliptic curve, and the following relationship exists between the first public key and the first private key:
Pa=Sag, wherein PaIs a first public key, SaG is a base point of an elliptic curve in the elliptic curve digital signature algorithm, and is an operation (not a multiplication operation) in the elliptic curve digital signature algorithm.
It should be noted that the first private key SaCannot pass the first public key PaCalculated with the base point G.
Step S102, the first node obtains a second public key of the second node on the block chain, and performs an operation on the first private key and the second public key through the first preset algorithm to determine a symmetric key.
In step S102 of this specification embodiment, the second public key of the second node is sent to the block chain by the second node in advance.
The first node may calculate the symmetric key by the following formula:
Kab1=Sa*Pbwherein, K isabIs a symmetric key, PbAs the second public key, as the number of elliptic curvesOperations in a word signature algorithm.
If S is known, S isaAnd PbIn the case of (2), K can be easily calculatedab1However, if K is knownab1And PbIn the case of (2), S cannot be reversely deriveda
And step S103, the first node encrypts data according to the symmetric secret key and writes the encrypted data into the block chain through the intelligent contract.
Encrypting data according to the symmetric key specifically comprises:
and encrypting the data according to the symmetric secret key and a second preset algorithm.
The second preset algorithm may be an aes (advanced Encryption standard) algorithm. The AES-encrypted data block packet length must be 128 bits, and the key length may be any one of 128 bits, 192 bits, and 256 bits (if the data block and key lengths are insufficient, they will be padded). AES encryption has many rounds of repetition and transformation. The AES algorithm is a symmetric encryption algorithm. The symmetric encryption means that the encryption password is the same as the decryption password.
In the embodiment of the specification, the first private key and the second public key are operated through a first preset algorithm to determine the symmetric secret key, and data is encrypted through the symmetric secret key.
Corresponding to the first embodiment of the present specification, fig. 2 is a schematic flowchart of a data decryption method based on a block chain according to the second embodiment of the present specification, where the second node may perform the following steps, which specifically include:
step S201, the second node obtains a second public key and a second private key of the second node through a first preset algorithm, and uploads the second public key to the block chain.
In step S201 of the embodiment of the present specification, the second public key is obtained by calculating the second private key and the base point in the first preset algorithm.
The first preset algorithm may be an elliptic curve digital signature algorithm. Elliptic Curve Digital Signature Algorithm (ECDSA) is a simulation of Digital Signature Algorithm (DSA) using Elliptic Curve Cryptography (ECC). The second private key obtained by the first preset algorithm is substantially a relatively large positive integer, the second public key is substantially a point on the elliptic curve, and the second public key and the second private key have the following relationship:
Pb=Sbg, wherein PbIs a first public key, SbG is the base point of the elliptic curve in the elliptic curve digital signature algorithm (same as G in the first embodiment), and is the operation (not the multiplication) in the elliptic curve digital signature algorithm.
In step S202, the second node obtains the encrypted data and the first public key of the first node on the blockchain.
In step S202 of this specification embodiment, the encrypted data and the first public key of the first node are sent by the first node to the block chain in advance.
In step S203, the second node calculates the second private key and the first public key through the first preset algorithm to determine a symmetric key.
In step S102 in this embodiment of the present specification, the first node may calculate the symmetric key by the following formula:
Kab2=Sb*Pawherein, K isabIs a symmetric key, PbAnd the second public key is an operation in the elliptic curve digital signature algorithm.
Due to Pa=Sa*G、Pb=Sb*G,Kab1=Sa*Pb=Sa*Sb*G=Sa*G*Sb=Sb*Pa=Kab2Therefore, the second node calculates the symmetric key to be the same as the symmetric key of the first node, and the second node can decrypt the encrypted data through the symmetric key.
In step S204, the second node decodes the encrypted data according to the symmetric key to obtain the decrypted data.
It should be noted that, the symmetric key in the specification embodiment is calculated by the first node and the second node itself, there is no propagation process, and the private key of the first node or the second node itself is used in the calculation process of the symmetric key, and if the private key of the first node or the second node is not obtained by other nodes, the symmetric key cannot be calculated.
When the second node decrypts encrypted data by using the symmetric key, the symmetric key sent by the first node is not received, but the second private key and the first public key are operated by using a first preset algorithm, so as to determine the symmetric key the same as that of the first node. The second private key only exists in the second node, and other nodes cannot obtain the second private key, so that the security of the second node for generating the symmetric private key is ensured, and the security of the second node for decrypting the encrypted data is also ensured.
An embodiment of the present application further provides a data encryption device based on a block chain, where the device includes:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
determining a first public key and a first private key of a first node according to a first preset algorithm, and uploading the first public key to a block chain;
acquiring a second public key of a second node on the block chain, and operating the first private key and the second public key through the first preset algorithm to determine a symmetric secret key;
and encrypting data according to the symmetric secret key, and writing the encrypted data into the block chain through an intelligent contract.
An embodiment of the present application further provides a data encryption medium based on a blockchain, in which computer-executable instructions are stored, where the computer-executable instructions are set to:
determining a first public key and a first private key of a first node according to a first preset algorithm, and uploading the first public key to a block chain;
acquiring a second public key of a second node on the block chain, and operating the first private key and the second public key through the first preset algorithm to determine a symmetric secret key;
and encrypting data according to the symmetric secret key, and writing the encrypted data into the block chain through an intelligent contract.
An embodiment of the present application further provides a data decryption device based on a block chain, where the device includes:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
obtaining a second public key and a second private key of a second node through a first preset algorithm, and uploading the second public key to a block chain;
acquiring encrypted data and a first public key of a first node on a block chain;
calculating the second private key and the first public key through the first preset algorithm to determine a symmetric secret key;
decoding the encrypted data according to the symmetric secret key to obtain decrypted data
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium which can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that 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 an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A method for encrypting data based on a blockchain, the method comprising:
determining a first public key and a first private key of a first node according to a first preset algorithm, and uploading the first public key to a block chain;
acquiring a second public key of a second node on the block chain, and operating the first private key and the second public key through the first preset algorithm to determine a symmetric secret key;
and encrypting data according to the symmetric secret key, and writing the encrypted data into the block chain through an intelligent contract.
2. The blockchain-based data encryption method according to claim 1, wherein the first public key is obtained by the first private key and a base point operation in the first preset algorithm.
3. The blockchain-based data encryption method according to claim 2, wherein the first preset algorithm is an elliptic curve digital signature algorithm, the first private key is a positive integer, and the first public key is a point on an elliptic curve.
4. The block chain-based data encryption method according to claim 1, wherein encrypting data according to the symmetric key specifically includes:
and encrypting the data according to the symmetric secret key and a second preset algorithm.
5. The blockchain-based data encryption method according to claim 4, wherein the second preset algorithm is an AES algorithm.
6. A method for decrypting data based on a blockchain, the method comprising:
obtaining a second public key and a second private key of a second node through a first preset algorithm, and uploading the second public key to a block chain;
acquiring encrypted data and a first public key of a first node on a block chain;
calculating the second private key and the first public key through the first preset algorithm to determine a symmetric secret key;
and decoding the encrypted data according to the symmetric secret key to obtain the decrypted data.
7. The block chain-based data decryption method according to claim 6, wherein the second public key is obtained by the second private key and a base point operation in the first preset algorithm.
8. A blockchain-based data encryption device, the device comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
determining a first public key and a first private key of a first node according to a first preset algorithm, and uploading the first public key to a block chain;
acquiring a second public key of a second node on the block chain, and operating the first private key and the second public key through the first preset algorithm to determine a symmetric secret key;
and encrypting data according to the symmetric secret key, and writing the encrypted data into the block chain through an intelligent contract.
9. A blockchain-based data encryption medium having stored thereon computer-executable instructions configured to:
determining a first public key and a first private key of a first node according to a first preset algorithm, and uploading the first public key to a block chain;
acquiring a second public key of a second node on the block chain, and operating the first private key and the second public key through the first preset algorithm to determine a symmetric secret key;
and encrypting data according to the symmetric secret key, and writing the encrypted data into the block chain through an intelligent contract.
10. A block chain based data decryption device, characterized in that the device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
obtaining a second public key and a second private key of a second node through a first preset algorithm, and uploading the second public key to a block chain;
acquiring encrypted data and a first public key of a first node on a block chain;
calculating the second private key and the first public key through the first preset algorithm to determine a symmetric secret key;
and decoding the encrypted data according to the symmetric secret key to obtain the decrypted data.
CN202010575774.2A 2020-06-22 2020-06-22 Block chain-based data encryption and decryption method, equipment and medium Pending CN111934874A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010575774.2A CN111934874A (en) 2020-06-22 2020-06-22 Block chain-based data encryption and decryption method, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010575774.2A CN111934874A (en) 2020-06-22 2020-06-22 Block chain-based data encryption and decryption method, equipment and medium

Publications (1)

Publication Number Publication Date
CN111934874A true CN111934874A (en) 2020-11-13

Family

ID=73317638

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010575774.2A Pending CN111934874A (en) 2020-06-22 2020-06-22 Block chain-based data encryption and decryption method, equipment and medium

Country Status (1)

Country Link
CN (1) CN111934874A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114547641A (en) * 2022-01-05 2022-05-27 山东浪潮工业互联网产业股份有限公司 Industrial data tracking method, device, equipment and medium based on block chain
CN114553612A (en) * 2022-04-27 2022-05-27 深圳市一航网络信息技术有限公司 Data encryption and decryption method and device, storage medium and electronic equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114547641A (en) * 2022-01-05 2022-05-27 山东浪潮工业互联网产业股份有限公司 Industrial data tracking method, device, equipment and medium based on block chain
CN114547641B (en) * 2022-01-05 2024-04-26 浪潮工业互联网股份有限公司 Industrial data tracking method, device, equipment and medium based on block chain
CN114553612A (en) * 2022-04-27 2022-05-27 深圳市一航网络信息技术有限公司 Data encryption and decryption method and device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN108932297B (en) Data query method, data sharing method, device and equipment
TWI686071B (en) Key management method, device and equipment
CN111885024B (en) Login information processing method and equipment
CN108055125B (en) Method and device for encrypting and decrypting product information
KR102272117B1 (en) Blockchain-based data processing method and device
WO2021013245A1 (en) Data key protection method and system, electronic device and storage medium
CN112016120B (en) Event prediction method and device based on user privacy protection
CN107122634B (en) Reinforcement protection method and device for software installation package
CN111741028B (en) Service processing method, device, equipment and system
TW202009775A (en) Device for receiving secured software update information from server
CN110008715B (en) Method for realizing privacy protection in block chain, node and storage medium
CN111934878A (en) Block chain-based data encryption and decryption method, equipment and medium
US10922422B2 (en) Blockchain-based image processing method and apparatus
WO2020228366A1 (en) Picture processing method and apparatus based on block chain
CN111342966B (en) Data storage method, data recovery method, device and equipment
TW201923647A (en) Traceable multi-party data processing method, apparatus and device
CN111934874A (en) Block chain-based data encryption and decryption method, equipment and medium
CN107592963B (en) Method and computing device for performing secure computations
CN109560927B (en) Equipment fingerprint implementation method and device
CN107025390A (en) The reinforcement means and device of software installation bag
CN103605927A (en) Encryption and decryption method based on embedded Linux system
CN111104693A (en) Android platform software data cracking method, terminal device and storage medium
CN116361849A (en) Backup data encryption and decryption method and device for encrypted database
CN111641499A (en) Block chain-based private key restoration method, device, equipment and medium
CN110995447B (en) Data storage method, device, equipment and medium

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