Summary of the invention
Purpose of this disclosure is to provide a kind of communication means based on distributed network, device, storage medium and electronics to set
Standby, for solving in the related technology, communicating pair is easy monitored or intercepts there are communication channel, it is caused to communicate concealed degree
Lower technical problem.
To achieve the goals above, the embodiment of the present disclosure in a first aspect, providing a kind of communication based on distributed network
Method, the distributed network include the block chain network for being deployed with intelligent contract, and real based on interspace file system IPFS
Existing IPFS network, which comprises
The encryption information that first terminal is sent is received, and the encryption information is stored in the distributed network;
Recognize second terminal transmission for being based on the distributed network after obtaining the request of the encryption information
Multiple network nodes described in encryption information be sent to the second terminal.
Optionally, the encryption information for receiving first terminal and sending, and the encryption information is stored in the distribution
In network, comprising:
Receive the encryption information that the first terminal is sent;
When the memory space needed for the encryption information is less than or equal to memory space threshold value, the encryption information is deposited
Enter the intelligent contract for being deployed in the block chain network;
It, will be described in the encryption information deposit when memory space needed for the encryption information is greater than memory space threshold value
IPFS network.
It is optionally, described that the encryption information is stored in the IPFS network, comprising:
Encryption information dispersion is stored in multiple public network nodes of the IPFS network.
Optionally, described to be based on the distributed network after the IPFS network by encryption information deposit
Multiple network nodes described in encryption information be sent to before the second terminal, the method also includes:
Encryption digital finger-print information deposit is deployed in the intelligent contract of the block chain network, wherein for encrypting
Plaintext to the encryption digital finger-print information includes referring to for searching for the number of the encryption information in the IPFS network
Line;
Encryption information described in multiple network nodes based on the distributed network is sent to the second terminal,
Include:
Receive the digital finger-print that the second terminal is sent, the digital finger-print is by the second terminal from being deployed in the area
Encryption digital finger-print information is obtained in the intelligent contract of block chain network, and the encryption digital finger-print information is decrypted to obtain;
The encryption information corresponding to the digital finger-print is searched in the IPFS network based on the digital finger-print;
The encryption information that multiple network nodes based on the IPFS network are searched for is sent to described second
Terminal.
Optionally, the encryption digital finger-print information is based on to the digital finger-print and the progress of receiving end identification information
What encryption obtained.
Optionally, the encryption information is based on being encrypted to data information and receiving end identification information.
The second aspect of the embodiment of the present disclosure provides a kind of communication device based on distributed network, the distributed network
Network includes the block chain network for being deployed with intelligent contract, and the IPFS network realized based on interspace file system IPFS, described
Device includes:
Memory module is received, for receiving the encryption information of first terminal transmission, and will be described in encryption information deposit
In distributed network;
Identify sending module, for recognize second terminal transmission for after obtaining the request of the encryption information,
Encryption information described in multiple network nodes based on the distributed network is sent to the second terminal.
Optionally, the reception memory module includes:
Encryption information receiving submodule, the encryption information sent for receiving the first terminal;
First sub-module stored is less than or equal to memory space threshold value for the memory space needed for the encryption information
When, encryption information deposit is deployed in the intelligent contract of the block chain network;
Second sub-module stored will when being greater than memory space threshold value for the memory space needed for the encryption information
The encryption information is stored in the IPFS network.
Optionally, second sub-module stored is used for:
Encryption information dispersion is stored in multiple public network nodes of the IPFS network.
Optionally, described device further include:
Digital finger-print information storage module is encrypted, for the encryption information to be stored in institute in second sub-module stored
After stating IPFS network, and letter is encrypted described in identification multiple network nodes of the sending module based on the distributed network
Breath is sent to before the second terminal, will encrypt the intelligent conjunction that the deposit of digital finger-print information is deployed in the block chain network
About, wherein for encrypt obtain it is described encryption digital finger-print information plaintext include for searching for institute in the IPFS network
State the digital finger-print of encryption information;
The identification sending module includes:
Digital finger-print receiving submodule, the digital finger-print sent for receiving the second terminal, the digital finger-print is by institute
It states second terminal and obtains encryption digital finger-print information from the intelligent contract for being deployed in the block chain network, and to the encryption number
Word finger print information is decrypted to obtain;
Encryption information searches for submodule, corresponds to the number for searching in the IPFS network based on the digital finger-print
The encryption information of fingerprint;
Encryption information sending submodule, search for for multiple network nodes based on the IPFS network described in
Encryption information is sent to the second terminal.
Optionally, the encryption digital finger-print information is based on to the digital finger-print and the progress of receiving end identification information
What encryption obtained.
Optionally, the encryption information is based on being encrypted to data information and receiving end identification information.
The third aspect of the embodiment of the present disclosure provides a kind of computer readable storage medium, is stored thereon with computer journey
The step of sequence, which realizes any one of above-mentioned first aspect the method when being executed by processor.
The fourth aspect of the embodiment of the present disclosure, provides a kind of electronic equipment, comprising:
Memory is stored thereon with computer program;
Processor, it is any in above-mentioned first aspect to realize for executing the computer program in the memory
The step of item the method.
Through the above technical solutions, encryption information is stored in distributed after receiving the encryption information that first terminal is sent
In network;Recognize second terminal transmission for being based on the distributed network after obtaining the request of the encryption information
Multiple network nodes described in encryption information be sent to the second terminal, and then second terminal can encryption to receiving
Information is decrypted, and obtains the data information in first terminal write-in encryption information, above-mentioned distributed network includes block link network
Network and IPFS network are point-to-point distributed network, and second terminal obtains encryption information by multiple network nodes, into
And third party is difficult to know the specific object for obtaining encryption information from distributed network, it is difficult to communicating pair is associated with, so that
Communication process is more concealed, improves the safety of communication.
Other feature and advantage of the disclosure will the following detailed description will be given in the detailed implementation section.
Specific embodiment
It is described in detail below in conjunction with specific embodiment of the attached drawing to the disclosure.It should be understood that this place is retouched
The specific embodiment stated is only used for describing and explaining the disclosure, is not limited to the disclosure.
Fig. 1 is a kind of flow chart of communication means based on distributed network shown according to an exemplary embodiment, institute
Stating distributed network includes the block chain network for being deployed with intelligent contract, and the IPFS realized based on interspace file system IPFS
Network, as shown in Figure 1, this method comprises:
S11 receives the encryption information that first terminal is sent, and the encryption information is stored in the distributed network.
In the disclosure, the public block platform chain with intelligent contract function is can be directly used in block chain network, such as
Ether mill (Ethereum) can first carry out intelligent conjunction before first terminal is communicated with second terminal on ether mill
Deployment about.IPFS (Inter-Planetary File System, interspace file system) network can be real based on the prior art
Existing, the disclosure is not specifically described.
The data information that first terminal can will be sent to second terminal is encrypted to obtain encryption information, cipher mode
Asymmetric encryption can be used, i.e. first terminal is encrypted using the public key that second terminal is distributed.First terminal believes encryption
Breath is sent to the server for being deployed with above-mentioned block chain network and IPFS network, and then the encryption information is stored in point by server
In cloth network.
S13, recognize second terminal transmission for being based on the distribution after obtaining the request of the encryption information
Encryption information described in multiple network nodes of network is sent to the second terminal.
Specifically, distributed network can be monitored, when having detected that distributed network is written in encryption information,
Prompt information can be sent to second terminal, and then second terminal is sent to the server for being deployed with distributed network for obtaining
The request of the encryption information, server recognize second terminal transmission for after obtaining the request of the encryption information,
From multiple network nodes of distributed network, the encryption information is transmitted to second terminal, and then second terminal can use accordingly
Key such as oneself private key the encryption information is decrypted to obtain data information therein.Certainly, it is detecting
When distributed network is written in encryption information, second terminal can also directly send to the server for being deployed with distributed network and be used for
The request of the encryption information is obtained, so that encryption information is sent to second terminal after being requested by server.It needs
Bright, being monitored to block chain network, which can be, is monitored the intelligent contract being deployed in block chain network, right
IPFS network is monitored can be and be monitored to the network node of IPFS network, and no matter to the monitoring of intelligent contract or
The monitoring of IPFS network is the prior art, and the disclosure is not specifically addressed it.
Through the above technical solutions, encryption information is stored in distributed after receiving the encryption information that first terminal is sent
In network;Recognize second terminal transmission for being based on the distributed network after obtaining the request of the encryption information
Multiple network nodes described in encryption information be sent to the second terminal, and then second terminal can encryption to receiving
Information is decrypted, and obtains the data information in first terminal write-in encryption information, above-mentioned distributed network includes block link network
Network and IPFS network are point-to-point distributed network, and second terminal obtains encryption information by multiple network nodes, into
And third party is difficult to know the specific object for obtaining encryption information from distributed network, it is difficult to communicating pair is associated with, so that
Communication process is more concealed, improves the safety of communication.
The above-mentioned communication means based on distributed network is further elaborated below in conjunction with Fig. 2.
As shown in Fig. 2, in step s 11, receiving the encryption information that first terminal is sent, and the encryption information is stored in
In the distributed network, may include:
S111 receives the encryption information that the first terminal is sent.
Specifically, referring to fig. 2, first terminal encrypts data information to obtain encryption information, data information
The plaintext of one terminal second terminal to be sent to, is specifically as follows text, picture, audio or video, before being communicated,
One terminal and second terminal can the mode of such as mail, phone otherwise arrange the key for communication.It needs to lead to
When letter, encryption information is sent to the server for being deployed with above-mentioned distributed network by first terminal.
The size for the encryption information that can be stored due to block chain network is limited, therefore receives first terminal hair in server
After the encryption information sent, whether memory space needed for judging the encryption information is greater than memory space threshold value, if described add
Memory space needed for confidential information is less than or equal to memory space threshold value, executes step S112;If needed for the encryption information
Memory space is greater than memory space threshold value, executes step S113.
It should be noted that above-mentioned deterministic process can be executed by server.Separately due to data information and encryption information
Size difference is simultaneously little, therefore the memory space needed for can judging encryption information according to the size of data information as first terminal is
No to be greater than memory space threshold value, memory space threshold value is determined by the block chain network and IPFS network specifically used, can regard tool
Body situation determine, the disclosure to it with no restriction.
S112, when the memory space needed for the encryption information is less than or equal to memory space threshold value, by the encryption
Information is stored in the intelligent contract for being deployed in the block chain network.
If encryption information deposit is deployed in the intelligent contract of the block chain network, intelligent contract can be being monitored
In when having encryption information deposit, encryption information is sent to second terminal, and then second terminal can solve encryption information
It is close to obtain data information.
In a kind of possible embodiment, encryption information be can be based on to data information and receiving end identification information
It is encrypted, wherein receiving end identification information communicates targeted specific receiving end, and then second with this is characterized
Terminal available data information and receiving end identification information after encryption information is decrypted, if receiving end identification information table
This communication is levied for second terminal, then reads data information, if receiving end identification information characterizes this communication not
It is not read data information then for second terminal, abandon this communication.So it can pretend to be first terminal to avoid third party
It being communicated, receiving end identification information can the mode of such as mail, phone be arranged otherwise before communicating, and
After first time arranges, the receiving end identification information for being used to communicate next time can be passed through during communicating each time
Encryption information is transferred to second terminal, so only needs once to arrange, reduces the number of agreement, and receiving end identification information
Arrange to complete in primary agreement with the agreement of the key for communicating, such as completes in a Phone process to reception
Hold the agreement of identification information and key.
S113 deposits the encryption information when memory space needed for the encryption information is greater than memory space threshold value
Enter the IPFS network.
Specifically, the encryption information can be dispersed to the multiple public network nodes for being stored in the IPFS network
In.In order to which encryption information dispersion to be stored in multiple public network nodes of the IPFS network, first terminal is logical
It crosses after the IPFS network in the network node encryption information deposit server of the IPFS network where itself, institute can be passed through
The multiple public network nodes for stating IPFS network access to the encryption information on the IPFS network, so that
Encryption information dispersion is stored in multiple public network nodes of the IPFS network.In this way, second terminal is obtaining encryption
Encryption information is downloaded by multiple public network nodes of the IPFS network when information, due to the public net of IPFS network
The data transmission of network node is more frequent, and then the biography of encryption information is carried out by multiple public network nodes of IPFS network
It is defeated, transmission process can be made to be difficult to be identified, and then increase the concealed degree of communication.
Further, if encryption information is stored in the IPFS network, the encryption information can be stored in the IPFS
After network, encryption information described in multiple network nodes based on the distributed network be sent to the second terminal it
Before, execute step S12 as shown in Figure 2:
Encryption digital finger-print information deposit is deployed in the intelligent contract of the block chain network, wherein for adding by S12
The close plaintext for obtaining the encryption digital finger-print information includes the number for searching for the encryption information in the IPFS network
Word fingerprint.
Specifically, server generates the digital finger-print for searching for the encryption information in the IPFS network, and
The digital finger-print is sent to first terminal, and then first terminal can encrypt digital finger-print to obtain encryption digital finger-print
Information, first terminal is sent to server for digital finger-print information is encrypted later, will encrypt the deposit deployment of digital finger-print information
It in the intelligent contract of the block chain network, and then only needs to be monitored intelligent contract, without to IPFS network
It is monitored, realizes simpler.
When server has encryption digital finger-print information write-in in detecting intelligent contract, by the encryption digital finger-print information
It is sent to second terminal, and then second terminal can be decrypted to obtain digital finger-print to the encryption digital finger-print information.One
In the possible embodiment of kind, encryption digital finger-print information be can be based on to the digital finger-print and receiving end identification information
It is encrypted, and then second terminal decrypts available digital finger-print to encryption digital finger-print information and receiving end identifies
Information, if it is not that can directly abandon this communication for second terminal that the receiving end identification information, which characterizes this communication,
If receiving end this communication of mark characterization is to be directed to second terminal, can be based on multiple network sections of the distributed network
The encryption information is sent to the second terminal by point.
Specifically, as shown in Fig. 2, encryption information described in multiple network nodes based on the distributed network is sent
To the second terminal, comprising:
S131 receives the digital finger-print that the second terminal is sent.
The digital finger-print is obtained encryption number by the second terminal from the intelligent contract for being deployed in the block chain network
Word finger print information, and the encryption digital finger-print information is decrypted to obtain.It should be noted that digital finger-print and data information into
Row, which encrypts used key, to be identical key, to simplify communication process.
S132 searches for the encryption information corresponding to the digital finger-print based on the digital finger-print in the IPFS network.
S133, the encryption information that multiple network nodes based on the IPFS network are searched for are sent to described
Second terminal.
For example, server can pass through the IPFS after searching the encryption information corresponding to the digital finger-print
The encryption information that multiple public network nodes of network are searched for is sent to second terminal, and then second terminal adds this
Confidential information is decrypted to obtain data information.
Fig. 3 is a kind of block diagram of communication device based on distributed network shown according to an exemplary embodiment, described
Distributed network includes the block chain network for being deployed with intelligent contract, and the IPFS net realized based on interspace file system IPFS
Network, as shown in figure 3, the device 100 includes:
Memory module 110 is received, is stored in institute for receiving the encryption information of first terminal transmission, and by the encryption information
It states in distributed network;
Sending module 120 is identified, in the request for being used to obtain the encryption information for recognizing second terminal transmission
Afterwards, encryption information described in multiple network nodes based on the distributed network is sent to the second terminal.
Through the above technical solutions, encryption information is stored in distributed after receiving the encryption information that first terminal is sent
In network;Recognize second terminal transmission for being based on the distributed network after obtaining the request of the encryption information
Multiple network nodes described in encryption information be sent to the second terminal, and then second terminal can encryption to receiving
Information is decrypted, and obtains the data information in first terminal write-in encryption information, above-mentioned distributed network includes block link network
Network and IPFS network are point-to-point distributed network, and second terminal obtains encryption information by multiple network nodes, into
And third party is difficult to know the specific object for obtaining encryption information from distributed network, it is difficult to communicating pair is associated with, so that
Communication process is more concealed, improves the safety of communication.
Optionally, the reception memory module 110 includes:
Encryption information receiving submodule, the encryption information sent for receiving the first terminal;
First sub-module stored is less than or equal to memory space threshold value for the memory space needed for the encryption information
When, encryption information deposit is deployed in the intelligent contract of the block chain network;
Second sub-module stored will when being greater than memory space threshold value for the memory space needed for the encryption information
The encryption information is stored in the IPFS network.
Optionally, second sub-module stored is used for:
Encryption information dispersion is stored in multiple public network nodes of the IPFS network.
Optionally, described device 100 is in addition to including to receive memory module 110 and identification sending module 120, further includes:
Digital finger-print information storage module is encrypted, for the encryption information to be stored in institute in second sub-module stored
After stating IPFS network, and add described in identification multiple network nodes of the sending module 120 based on the distributed network
Confidential information is sent to before the second terminal, and encryption digital finger-print information deposit is deployed in the intelligence of the block chain network
Contract, wherein for encrypt obtain it is described encryption digital finger-print information plaintext include for being searched in the IPFS network
The digital finger-print of the encryption information;
The identification sending module 120 includes:
Digital finger-print receiving submodule, the digital finger-print sent for receiving the second terminal, the digital finger-print is by institute
It states second terminal and obtains encryption digital finger-print information from the intelligent contract for being deployed in the block chain network, and to the encryption number
Word finger print information is decrypted to obtain;
Encryption information searches for submodule, corresponds to the number for searching in the IPFS network based on the digital finger-print
The encryption information of fingerprint;
Encryption information sending submodule, search for for multiple network nodes based on the IPFS network described in
Encryption information is sent to the second terminal.
Optionally, the encryption digital finger-print information is based on to the digital finger-print and the progress of receiving end identification information
What encryption obtained.
Optionally, the encryption information is based on being encrypted to data information and receiving end identification information.
About the device in above-described embodiment, wherein modules execute the concrete mode of operation in related this method
Embodiment in be described in detail, no detailed explanation will be given here.
Fig. 4 is the block diagram of a kind of electronic equipment shown according to an exemplary embodiment.For example, electronic equipment 1900 can be with
It is provided as a server.Referring to Fig. 4, electronic equipment 1900 includes processor 1922, and quantity can be one or more, with
And memory 1932, for storing the computer program that can be executed by processor 1922.The computer stored in memory 1932
Program may include it is one or more each correspond to one group of instruction module.In addition, processor 1922 can be by
It is configured to execute the computer program, to execute the above-mentioned communication means based on distributed network.
In addition, electronic equipment 1900 can also include power supply module 1926 and communication component 1950, the power supply module 1926
It can be configured as the power management for executing electronic equipment 1900, which can be configured as realization electronic equipment
1900 communication, for example, wired or wireless communication.In addition, the electronic equipment 1900 can also include that input/output (I/O) connects
Mouth 1958.Electronic equipment 1900 can be operated based on the operating system for being stored in memory 1932, such as Windows
ServerTM, Mac OS XTM, UnixTM, LinuxTM etc..
In a further exemplary embodiment, a kind of computer readable storage medium including program instruction is additionally provided, it should
The step of above-mentioned communication means based on distributed network is realized when program instruction is executed by processor.For example, the computer
Readable storage medium storing program for executing can be the above-mentioned memory 1932 including program instruction, and above procedure instruction can be by electronic equipment 1900
Processor 1922 is executed to complete the above-mentioned communication means based on distributed network.
The preferred embodiment of the disclosure is described in detail in conjunction with attached drawing above, still, the disclosure is not limited to above-mentioned reality
The detail in mode is applied, in the range of the technology design of the disclosure, a variety of letters can be carried out to the technical solution of the disclosure
Monotropic type, these simple variants belong to the protection scope of the disclosure.
It is further to note that specific technical features described in the above specific embodiments, in not lance
In the case where shield, it can be combined in any appropriate way.In order to avoid unnecessary repetition, the disclosure to it is various can
No further explanation will be given for the combination of energy.
In addition, any combination can also be carried out between a variety of different embodiments of the disclosure, as long as it is without prejudice to originally
Disclosed thought equally should be considered as disclosure disclosure of that.