CN112464262B - Alliance chain encryption method, device, equipment and storage medium - Google Patents

Alliance chain encryption method, device, equipment and storage medium Download PDF

Info

Publication number
CN112464262B
CN112464262B CN202011400221.XA CN202011400221A CN112464262B CN 112464262 B CN112464262 B CN 112464262B CN 202011400221 A CN202011400221 A CN 202011400221A CN 112464262 B CN112464262 B CN 112464262B
Authority
CN
China
Prior art keywords
preset
plaintext
encryption
character string
encrypted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011400221.XA
Other languages
Chinese (zh)
Other versions
CN112464262A (en
Inventor
何东
梁操
马惠鑫
袁长猛
顾宗杰
高秀寒
甄昊
李彦青
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hebei Shengnuo United Technology Co ltd
Original Assignee
Hebei Shengnuo United 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 Hebei Shengnuo United Technology Co ltd filed Critical Hebei Shengnuo United Technology Co ltd
Priority to CN202011400221.XA priority Critical patent/CN112464262B/en
Publication of CN112464262A publication Critical patent/CN112464262A/en
Application granted granted Critical
Publication of CN112464262B publication Critical patent/CN112464262B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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

Abstract

The invention provides a method, a device, equipment and a storage medium for encrypting a alliance chain, which are suitable for the technical field of block chains, and the method comprises the following steps: encrypting a preset character string according to a pre-distributed public key to obtain an encrypted character string; the preset character string is obtained by converting a plurality of state channel parameters of the alliance chain according to the corresponding relation between letters and binary numbers; adding the encrypted character string and a preset identifier to a preset position of a first plaintext to be encrypted to obtain a second plaintext; and encrypting the second plaintext for preset times according to the public key to obtain a final ciphertext corresponding to the first plaintext. The invention can improve the security of the alliance chain encryption.

Description

Alliance chain encryption method, device, equipment and storage medium
Technical Field
The invention belongs to the technical field of block chains, and particularly relates to a method, a device, equipment and a storage medium for encrypting a alliance chain.
Background
The block chain technology is also called as distributed book technology, and is characterized by decentralization and transparent disclosure. There are currently three major classifications of blockchains, public, private, and alliance. The alliance chain has the characteristics of decentralized public chain and rapid transaction of the private chain, and the alliance chain is developed rapidly.
The existing alliance chain encryption method is low in security, and an alliance chain encryption method with higher security is urgently needed.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a device, and a storage medium for federation chain encryption, so as to solve the problem in the prior art that the security of a federation chain encryption method is low. In order to achieve the purpose, the invention adopts the technical scheme that:
a first aspect of an embodiment of the present invention provides a federation chain encryption method, including:
encrypting a preset character string according to a pre-distributed public key to obtain an encrypted character string; the preset character string is obtained by converting a plurality of state channel parameters of the alliance chain according to the corresponding relation between letters and binary numbers;
adding the encrypted character string and a preset identifier to a preset position of a first plaintext to be encrypted to obtain a second plaintext;
encrypting the second plaintext for a preset number of times according to the public key to obtain a final ciphertext corresponding to the first plaintext; wherein the encrypted object of the first encryption performed on the second plaintext is the second plaintext; the encryption object for the Nth time of encryption of the second plaintext is the second plaintext added with an intermediate ciphertext and a preset identifier at a preset position, the intermediate ciphertext is a ciphertext obtained by performing the N-1 th time of encryption on the second plaintext, N is a positive integer greater than or equal to 2, and N is less than or equal to a preset number of times.
Optionally, before encrypting the preset character string according to the pre-allocated public key, the federation chain encryption method further includes:
acquiring a plurality of state channel parameters of a alliance chain;
and converting the plurality of state channel parameters according to the corresponding relation between the letters and the binary numbers to obtain a preset character string.
Optionally, converting the multiple state channel parameters according to the correspondence between the letters and the binary numbers to obtain a preset character string, including:
converting each letter in the plurality of state channel parameters into a corresponding binary number according to the corresponding relation between the letter and the binary number;
sequentially adding each binary number to a preset matrix according to a preset sequence; the preset sequence is the sequence of the number of letters contained in the state channel parameters from most to less;
and sequentially connecting binary numbers of each row in the preset matrix according to the matrix row number to obtain the preset character string.
Optionally, the federation chain encryption method further includes:
decrypting the final ciphertext according to the pre-distributed private key, the preset position and the preset identification to obtain a first plaintext; the private key corresponds to the public key.
Optionally, the public key is obtained based on an asymmetric encryption algorithm.
A second aspect of an embodiment of the present invention provides a federation chain encryption apparatus, including:
the first encryption module is used for encrypting the preset character string according to the pre-distributed public key to obtain an encrypted character string; the preset character string is obtained by converting a plurality of state channel parameters of the alliance chain according to the corresponding relation between letters and binary numbers;
the adding module is used for adding the encrypted character string and the preset identifier to a preset position of the first plaintext to be encrypted to obtain a second plaintext;
the second encryption module is used for encrypting the second plaintext for preset times according to the public key to obtain a final ciphertext corresponding to the first plaintext;
wherein the encrypted object of the first encryption performed on the second plaintext is the second plaintext; the encryption object for encrypting the second plaintext for the Nth time is the second plaintext added with an intermediate ciphertext and a preset identifier at a preset position, the intermediate ciphertext is a ciphertext obtained by encrypting the second plaintext for the N-1 th time, N is a positive integer greater than or equal to 2, and N is less than or equal to the preset times.
Optionally, the federation chain encryption apparatus further includes an obtaining module, configured to:
acquiring a plurality of state channel parameters of a alliance chain;
and converting the plurality of state channel parameters according to the corresponding relation between the letters and the binary numbers to obtain a preset character string.
Optionally, the obtaining module is further configured to:
converting each letter in the plurality of state channel parameters into a corresponding binary number according to the corresponding relation between the letter and the binary number;
sequentially adding each binary number to a preset matrix according to a preset sequence; the preset sequence is the sequence of the number of letters contained in the state channel parameters from most to least;
and sequentially connecting binary numbers of each row in the preset matrix according to the matrix row number to obtain the preset character string.
Optionally, the federation chain encryption apparatus further includes a decryption module, configured to:
decrypting the final ciphertext according to the pre-distributed private key, the preset position and the preset identification to obtain a first plaintext; the private key corresponds to the public key.
Optionally, the public key is obtained based on an asymmetric encryption algorithm.
A third aspect of an embodiment of the present invention provides a node device, including: a processor and a memory storing a computer program; the processor, when executing the computer program, realizes the steps of the method according to the first aspect.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium, which stores a computer program that, when executed by a processor, implements the steps of the method according to the first aspect.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
compared with the prior art, in the embodiment of the invention, when node equipment in the alliance chain encrypts the plaintext, the encryption character string and the preset identification can be added to the preset position of the first plaintext to obtain the second plaintext, and then the second plaintext is encrypted for the preset times according to the public key. Because the encrypted character string is obtained by encrypting the preset character string, and the preset character string is obtained by converting the state channel parameters of the alliance chain according to the corresponding relation between the letters and the binary numbers, the specific state channel parameters in the alliance chain are utilized during encryption, and the encryption safety of the alliance chain can be improved. In addition, the second plaintext is encrypted for a preset number of times, and products obtained after the previous encryption are added to the encrypted object from the second encryption, so that the complexity of the ciphertext is increased, and the security of the alliance chain encryption is further improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart illustrating steps of a federation chain encryption method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a federation chain encryption apparatus according to an embodiment of the present invention.
Fig. 3 is a schematic diagram of a node device according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
In order to solve the problem of the prior art, embodiments of the present invention provide a method, an apparatus, a device, and a storage medium for federation chain encryption. The federation chain encryption method provided by the embodiment of the invention is described below.
As shown in fig. 1, a federation chain encryption method provided in an embodiment of the present invention includes the following steps:
s110, encrypting the preset character string according to the pre-distributed public key to obtain an encrypted character string.
The preset character string is obtained by converting a plurality of state channel parameters of the alliance chain according to the corresponding relation between letters and binary numbers. The Algorithm for encrypting the preset character string may be a Data Encryption Algorithm (DEA).
In some embodiments, the federation chain may be built using a back-end as a Service (BaaS) platform. The BaaS platform is an open platform with a block chain frame embedded into a cloud computing platform, can provide a convenient and high-performance block chain ecological environment and supporting services for users by using the deployment and management advantages of cloud service infrastructure, and supports the service expansion and block chain operation of the users, such as equipment access, access control, service monitoring, block chain platforms and the like.
In some embodiments, the execution subject of the federation chain encryption method may be any node in the federation chain, and the node may be a master node or a member node in the federation chain. The node may be a node device such as a personal computer, server, etc.
In some embodiments, the node device needs to obtain the encryption string before encrypting the plaintext to be encrypted. Specifically, the node device may encrypt the preset character string according to the pre-assigned public key to obtain the encrypted character string.
Optionally, the preset character string may be obtained according to the state channel parameter of the alliance chain, and the corresponding processing may be as follows: acquiring a plurality of state channel parameters of a alliance chain; and converting the plurality of state channel parameters according to the corresponding relation between the letters and the binary numbers to obtain a preset character string.
In some embodiments, the correspondence between the letters and the binary numbers may be a correspondence between 26 English letters and binary numbers 0 and 1. For example, the correspondence between the letters and the binary numbers may be configured in a =1 manner, a =2 manner, a 8230a, a =25 manner, and a Z =26 manner, and accordingly, the binary number corresponding to the letter a is 00001, the binary number corresponding to the letter B is 00010, and the binary number corresponding to the letter Z is 11010.
In some embodiments, the node device may obtain multiple status channel parameters of the federation chain, for example, the federation chain has 10 status channels, and the node device may obtain the status channel parameters of the 10 status channels respectively. And then, the node equipment can convert the acquired multiple state channel parameters according to the corresponding relation between the letters and the binary numbers to obtain a preset character string.
Optionally, the preset character string may be obtained in a matrix manner, and the corresponding processing may be as follows: converting each letter in the plurality of state channel parameters into a corresponding binary number according to the corresponding relation between the letter and the binary number; sequentially adding each binary number to a preset matrix according to a preset sequence; and sequentially connecting binary numbers of each row in the preset matrix according to the matrix row number to obtain the preset character string.
In some embodiments, the preset order may be an order of the number of letters included in the status channel parameter from the most to the least. Taking a federation chain with 10 state channels as an example, the state channel parameters of the 10 state channels may be sorted in order of the number of letters contained in the state channel parameters. The predetermined matrix may be a matrix composed of rows and columns.
In some embodiments, after obtaining the plurality of status channel parameters of the federation chain, the node device may convert each letter of the plurality of status channel parameters into a corresponding binary number according to a correspondence between the letter and the binary number, so that a plurality of sets of binary numbers may be obtained, where each set of binary numbers corresponds to one status channel parameter. Thereafter, the node device may sequentially add each binary number to the preset matrix in a preset order. Then, the node device may sequentially connect the binary numbers of each row in the preset matrix according to the matrix row number to obtain the preset character string.
And S120, adding the encryption character string and the preset identifier to a preset position of the first plaintext to be encrypted to obtain a second plaintext.
In some embodiments, the predetermined identifier may be an identifier for distinguishing between the first plaintext and the encrypted string, for example 100010001000. The preset position may be a head or a tail. Taking the preset position as the tail part as an example, the encrypted character string and the preset identifier may be added to the tail part of the first plaintext to obtain the second plaintext.
S130, encrypting the second plaintext for preset times according to the public key to obtain a final ciphertext corresponding to the first plaintext.
In some embodiments, the public key may be derived based on an asymmetric cryptographic algorithm, such as the RSA algorithm.
In some embodiments, the encrypted object of the first encryption of the second plaintext may be the second plaintext.
In some embodiments, the encrypted object of the nth encryption of the second plaintext may be the second plaintext to which an intermediate ciphertext and a preset identifier are added at a preset position, the intermediate ciphertext may be a ciphertext obtained by encrypting the second plaintext for the N-1 th time, N is a positive integer greater than or equal to 2, and N is less than or equal to a preset number of times.
For example, the encryption target of the 2 nd encryption performed on the second plaintext may be the second plaintext to which the ciphertext obtained by the 1 st encryption performed on the second plaintext is added. The encryption target of the 3 rd encryption performed on the second plaintext may be the second plaintext to which the ciphertext obtained by the 2 nd encryption performed on the second plaintext is added.
It should be noted that the intermediate ciphertext is added to the preset position of the second plaintext, and the processing of the obtained second plaintext can be kept consistent, so that the encryption process can be simplified on the premise of ensuring the encryption security.
Optionally, the final ciphertext may be decrypted, and the corresponding processing may be as follows: and decrypting the final ciphertext according to the pre-distributed private key, the preset position and the preset identification to obtain a first plaintext.
In some embodiments, the private key is a key corresponding to the public key.
In some embodiments, the final ciphertext may be decrypted according to an inverse process of the encryption flow described above to obtain the first plaintext. Specifically, the final ciphertext may be decrypted according to a private key corresponding to the public key, and then, data corresponding to a preset position in the decrypted data may be removed to obtain a second plaintext, and then, data corresponding to a preset position in the second plaintext may be removed again to obtain the first plaintext.
In the embodiment of the present invention, when node devices in a federation chain encrypt plaintext, an encryption character string and a preset identifier may be added to a preset position of a first plaintext to obtain a second plaintext, and then the second plaintext may be encrypted for a preset number of times according to a public key. Because the encrypted character string is obtained by encrypting the preset character string, and the preset character string is obtained by converting the plurality of state channel parameters of the alliance chain according to the corresponding relation between the letters and the binary numbers, the encryption method utilizes the specific state channel parameters in the alliance chain, and can improve the encryption safety of the alliance chain. In addition, the second plaintext is encrypted for a preset number of times, and products obtained after the previous encryption are added to the encrypted object from the second encryption, so that the complexity of the ciphertext is increased, and the security of the alliance chain encryption is further improved.
Based on the federation chain encryption method provided by the above embodiment, correspondingly, the present invention also provides a specific implementation manner of a federation chain encryption apparatus applied to the federation chain encryption method. Please see the examples below.
As shown in fig. 2, there is provided a federation chain encryption apparatus including:
the first encryption module 210 is configured to encrypt a preset character string according to a pre-allocated public key to obtain an encrypted character string; the preset character string is obtained by converting a plurality of state channel parameters of the alliance chain according to the corresponding relation between letters and binary numbers;
the adding module 220 is configured to add the encrypted character string and the preset identifier to a preset position of the first plaintext to be encrypted, so as to obtain a second plaintext;
the second encryption module 230 is configured to encrypt the second plaintext for a preset number of times according to the public key, so as to obtain a final ciphertext corresponding to the first plaintext;
wherein the encrypted object of the first encryption performed on the second plaintext is the second plaintext; the encryption object for encrypting the second plaintext for the Nth time is the second plaintext added with an intermediate ciphertext and a preset identifier at a preset position, the intermediate ciphertext is a ciphertext obtained by encrypting the second plaintext for the N-1 th time, N is a positive integer greater than or equal to 2, and N is less than or equal to the preset times.
Optionally, the federation chain encryption apparatus further includes an obtaining module, configured to:
acquiring a plurality of state channel parameters of a alliance chain;
and converting the plurality of state channel parameters according to the corresponding relation between the letters and the binary numbers to obtain a preset character string.
Optionally, the obtaining module is further configured to:
converting each letter in the plurality of state channel parameters into a corresponding binary number according to the corresponding relation between the letter and the binary number;
sequentially adding each binary number to a preset matrix according to a preset sequence; the preset sequence is the sequence of the number of letters contained in the state channel parameters from most to least;
and sequentially connecting binary numbers of each row in the preset matrix according to the matrix row number to obtain the preset character string.
Optionally, the federation chain encryption apparatus further includes a decryption module, configured to:
decrypting the final ciphertext according to the pre-distributed private key, the preset position and the preset identification to obtain a first plaintext; the private key corresponds to the public key.
Optionally, the public key is obtained based on an asymmetric encryption algorithm.
In the embodiment of the present invention, when node devices in a federation chain encrypt a plaintext, an encryption character string and a preset identifier may be added to a preset position of a first plaintext to obtain a second plaintext, and then the second plaintext may be encrypted for a preset number of times according to a public key. Because the encrypted character string is obtained by encrypting the preset character string, and the preset character string is obtained by converting the plurality of state channel parameters of the alliance chain according to the corresponding relation between the letters and the binary numbers, the encryption method utilizes the specific state channel parameters in the alliance chain, and can improve the encryption safety of the alliance chain. In addition, the second plaintext is encrypted for a preset number of times, and products obtained after the previous encryption are added to the encrypted object from the second encryption, so that the complexity of the ciphertext is increased, and the security of the alliance chain encryption is further improved.
Fig. 3 is a schematic diagram of a hardware structure of a node device for implementing various embodiments of the present invention.
The node device may comprise a processor 301 and a memory 302 in which the computer program is stored.
In particular, the processor 301 may include a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured as one or more Integrated circuits implementing embodiments of the present invention.
Memory 302 may include mass storage for data or instructions. By way of example, and not limitation, memory 302 may include a Hard Disk Drive (HDD), floppy Disk Drive, flash memory, optical Disk, magneto-optical Disk, tape, or Universal Serial Bus (USB) Drive or a combination of two or more of these. Memory 302 may include removable or non-removable (or fixed) media, where appropriate. The memory 302 may be internal or external to the integrated gateway disaster recovery device, where appropriate. In a particular embodiment, the memory 302 is a non-volatile solid-state memory. In a particular embodiment, the memory 302 includes Read Only Memory (ROM). Where appropriate, 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.
The processor 301 realizes any one of the above embodiments of the federation chain encryption method by reading and executing a computer program stored in the memory 302.
In one example, the node device may also include a communication interface 303 and a bus 310. As shown in fig. 3, the processor 301, the memory 302, and the communication interface 303 are connected via a bus 310 to complete communication therebetween.
The communication interface 303 is mainly used for implementing communication between modules, apparatuses, units and/or devices in the embodiment of the present invention.
Bus 310 comprises hardware, software, or both to couple the components of the node device to each other. By way of example, and not limitation, a bus 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 these. Bus 310 may include one or more buses, where appropriate. Although specific buses have been described and illustrated with respect to embodiments of the invention, any suitable buses or interconnects are contemplated by the invention.
The embodiment of the invention also provides a computer readable storage medium, wherein the computer storage medium is stored with a computer program; when being executed by a processor, the computer program realizes the processes of the above embodiments of the federation chain encryption method, and can achieve the same technical effect, and is not described herein again in order to avoid repetition.
It is to be understood that the invention is not limited to the precise arrangements and instrumentalities shown. A detailed description of known methods is omitted herein for the sake of brevity. 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 illustrated, and those skilled in the art can make various changes, modifications and additions or change the order between the steps after comprehending the spirit of the present invention.
The functional blocks shown in the above-described structural block diagrams may be implemented as 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, plug-in, 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 can be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include an electronic circuit, a semiconductor memory device, a ROM, a flash memory, an Erasable ROM (EROM), a floppy disk, a CD-ROM, an optical disk, a hard disk, an optical fiber medium, a Radio Frequency (RF) link, and so forth. The code segments may be downloaded via computer networks such as the internet, intranets, etc.
It should also be noted that the exemplary embodiments mentioned in this patent describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps may be performed in the order mentioned in the embodiments, may be performed in an order different from the order in the embodiments, or may be performed at the same time.
As described above, only the specific embodiments of the present invention are provided, and it can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the module and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. It should be understood that the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present invention, and these modifications or substitutions should be covered within the scope of the present invention.

Claims (7)

1. A federation chain encryption method, comprising:
acquiring a plurality of state channel parameters of the alliance chain;
converting each letter in the plurality of state channel parameters into a corresponding binary number according to the corresponding relation between the letter and the binary number;
sequentially adding each binary number to a preset matrix according to a preset sequence; the preset sequence is the sequence of the number of letters contained in the state channel parameters from most to least;
sequentially connecting binary numbers of each row in the preset matrix according to the matrix row number to obtain a preset character string;
encrypting a preset character string according to a pre-distributed public key to obtain an encrypted character string;
adding the encryption character string and a preset identifier to a preset position of a first plaintext to be encrypted to obtain a second plaintext;
encrypting the second plaintext for a preset number of times according to the public key to obtain a final ciphertext corresponding to the first plaintext;
wherein an encrypted object of the first encryption performed on the second plaintext is the second plaintext; the encryption object of the Nth time of encryption of the second plaintext is the second plaintext added with the intermediate ciphertext and the preset identifier at the preset position, the intermediate ciphertext is a ciphertext obtained by performing the N-1 th time of encryption on the second plaintext, N is a positive integer greater than or equal to 2, and N is less than or equal to the preset times.
2. A federation chain encryption method as recited in claim 1, wherein the method further comprises:
decrypting the final ciphertext according to a pre-distributed private key, the preset position and the preset identification to obtain the first plaintext; the private key and the public key correspond.
3. A federation chain encryption method as claimed in any one of claims 1 to 2 wherein the public key is derived based on an asymmetric encryption algorithm.
4. A federation chain encryption apparatus, comprising:
the obtaining module is used for obtaining a plurality of state channel parameters of the alliance chain; converting each letter in the plurality of state channel parameters into a corresponding binary number according to the corresponding relation between the letter and the binary number; sequentially adding each binary number to a preset matrix according to a preset sequence; the preset sequence is the sequence of the number of letters contained in the state channel parameters from most to least; sequentially connecting binary numbers of each row in the preset matrix according to the matrix row number to obtain a preset character string;
the first encryption module is used for encrypting the preset character string according to the pre-distributed public key to obtain an encrypted character string; the preset character string is obtained by converting a plurality of state channel parameters of the alliance chain according to the corresponding relation between letters and binary numbers;
the adding module is used for adding the encrypted character string and the preset identifier to a preset position of the first plaintext to be encrypted to obtain a second plaintext;
the second encryption module is used for encrypting the second plaintext for preset times according to the public key to obtain a final ciphertext corresponding to the first plaintext;
wherein an encrypted object of the first encryption performed on the second plaintext is the second plaintext; the encryption object for encrypting the second plaintext for the nth time is the second plaintext added with an intermediate ciphertext and the preset identifier at the preset position, the intermediate ciphertext is a ciphertext obtained by encrypting the second plaintext for the N-1 th time, N is a positive integer greater than or equal to 2, and N is less than or equal to the preset number.
5. A Federation chain encryption device in accordance with claim 4, wherein the device further comprises a decryption module to:
decrypting the final ciphertext according to a pre-distributed private key, the preset position and the preset identification to obtain the first plaintext; the private key and the public key correspond.
6. A node apparatus, comprising: a processor and a memory storing a computer program;
the processor, when executing the computer program, realizes the steps of the method according to any of claims 1-3.
7. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 3.
CN202011400221.XA 2020-12-04 2020-12-04 Alliance chain encryption method, device, equipment and storage medium Active CN112464262B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011400221.XA CN112464262B (en) 2020-12-04 2020-12-04 Alliance chain encryption method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011400221.XA CN112464262B (en) 2020-12-04 2020-12-04 Alliance chain encryption method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112464262A CN112464262A (en) 2021-03-09
CN112464262B true CN112464262B (en) 2022-10-28

Family

ID=74806150

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011400221.XA Active CN112464262B (en) 2020-12-04 2020-12-04 Alliance chain encryption method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112464262B (en)

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104254004A (en) * 2013-06-28 2014-12-31 中国科学院声学研究所 Digital rights management method and system suitable for high-bit-rate audio and video content
US11146380B2 (en) * 2017-08-03 2021-10-12 Parity Technologies Ltd. Methods and systems for a heterogeneous multi-chain framework
CN107819569B (en) * 2017-12-14 2018-09-11 平安科技(深圳)有限公司 The encryption method and terminal device of log-on message
CN108055274B (en) * 2017-12-22 2020-09-11 广东工业大学 Encryption and sharing method and system based on alliance chain storage data
CN111371790B (en) * 2020-03-05 2022-06-17 中国工商银行股份有限公司 Data encryption sending method based on alliance chain, related method, device and system
CN111967023A (en) * 2020-07-03 2020-11-20 浙江数链科技有限公司 Data encryption and decryption method, device, system and readable storage medium
CN111835500B (en) * 2020-07-08 2022-07-26 浙江工商大学 Searchable encryption data secure sharing method based on homomorphic encryption and block chain

Also Published As

Publication number Publication date
CN112464262A (en) 2021-03-09

Similar Documents

Publication Publication Date Title
CN108377183B (en) XDR data information encryption method, device, equipment and medium
EP1396169B1 (en) Local authentification in a communication system
CN109617680B (en) Encryption method, device, equipment and medium
CN107769910B (en) DES (data encryption Standard) protection method and circuit for resisting side channel attack based on L atch PUF (physical unclonable function)
CN113569267B (en) Privacy safety data set intersection method, device, equipment and storage medium
CN111435913A (en) Identity authentication method and device for terminal of Internet of things and storage medium
CN106131021B (en) Request authentication method and system
CN111148094B (en) Registration method of 5G user terminal, user terminal equipment and medium
CN110768799A (en) Digital signature method, device, equipment, medium and system
CN106100823B (en) Password protection device
CN106576047A (en) Protecting against malicious modification in cryptographic operations
US20140237237A1 (en) Message authentication using a universal hash function computed with carryless multiplication
CN112464262B (en) Alliance chain encryption method, device, equipment and storage medium
WO2018196638A1 (en) Information bearing method and device
CN111147249B (en) Data processing method, device, equipment and medium
CN115208557A (en) Data encryption method and device, electronic equipment and computer storage medium
CN116633526A (en) Data processing method, device, equipment and medium
CN115333753A (en) Internet protocol address generation method and device, storage medium and electronic equipment
CN104868994A (en) Collaboration secret key management method, device and system
CN115344848A (en) Identification obtaining method, device, equipment and computer readable storage medium
CN115391846A (en) PUF key transmission
CN113573306A (en) 5G-fused heterogeneous networking gateway encryption method and system
CN107959670B (en) Dynamic password generation method and device, terminal equipment and storage medium
Ji et al. A Side-Channel Attack on a Masked Hardware Implementation of CRYSTALS-Kyber
CN115204320B (en) Naive Bayes model training method, device, equipment and computer storage 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
GR01 Patent grant
GR01 Patent grant
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: He Dong

Inventor after: He Bingcong

Inventor after: Chen Peikuan

Inventor after: Gu Zongjie

Inventor after: Gao Xiuhan

Inventor before: He Dong

Inventor before: Liang Cao

Inventor before: Ma Huixin

Inventor before: Yuan Changmeng

Inventor before: Gu Zongjie

Inventor before: Gao Xiuhan

Inventor before: Zhen Hao

Inventor before: Li Yanqing