CN117150548A - Data transmission method based on block chain - Google Patents

Data transmission method based on block chain Download PDF

Info

Publication number
CN117150548A
CN117150548A CN202311062865.6A CN202311062865A CN117150548A CN 117150548 A CN117150548 A CN 117150548A CN 202311062865 A CN202311062865 A CN 202311062865A CN 117150548 A CN117150548 A CN 117150548A
Authority
CN
China
Prior art keywords
data
printed
ciphertext
encryption algorithm
printing
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
CN202311062865.6A
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.)
SHANXI POLYTECHNIC COLLEGE
Original Assignee
SHANXI POLYTECHNIC COLLEGE
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 SHANXI POLYTECHNIC COLLEGE filed Critical SHANXI POLYTECHNIC COLLEGE
Priority to CN202311062865.6A priority Critical patent/CN117150548A/en
Publication of CN117150548A publication Critical patent/CN117150548A/en
Pending legal-status Critical Current

Links

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/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6236Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database between heterogeneous systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • 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
    • H04L67/104Peer-to-peer [P2P] networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention belongs to the technical field of block chains, and discloses a data transmission method based on a block chain. The method comprises the following steps: acquiring data to be printed, and analyzing the data to be printed to obtain a data type identifier of the data to be printed; determining a first encryption algorithm based on the data to be printed and the data type identifier; encrypting the printing data based on a first encryption algorithm to obtain a first abstract of the data to be printed; encrypting the data to be printed and the first abstract based on a key of the second encryption algorithm to obtain a first ciphertext; encrypting the key of the second encryption algorithm based on the public key of the third encryption algorithm in the printing party node to obtain a second ciphertext; and sending the first ciphertext and the second ciphertext to the printing party node so as to enable the printing party node to decrypt and obtain the data to be printed. Through the mode, the block chain is utilized for data transmission during printing, so that a safe and reliable data transmission mode is realized.

Description

Data transmission method based on block chain
Technical Field
The invention relates to the technical field of block chains, in particular to a data transmission method based on a block chain.
Background
With the continuous development and application of interconnection technology, people rely more and more on information interaction through the internet, even important data or data needing confidentiality are transmitted through the internet, for example, when printing, file data is usually transmitted through the internet, but risks of information leakage easily occur when the file data is transmitted through the internet, and some important research data or graduation papers may be stolen maliciously.
The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present invention and is not intended to represent an admission that the foregoing is prior art.
Disclosure of Invention
The invention mainly aims to provide a data transmission method based on a blockchain, which aims to solve the technical problem that information leakage easily occurs through internet transmission during printing in the prior art.
To achieve the above object, the present invention provides a data transmission method based on a blockchain, the method including the steps of:
determining a first encryption algorithm based on the data to be printed and the data type identifier;
encrypting the data to be printed based on the first encryption algorithm to obtain a first abstract of the data to be printed;
encrypting the data to be printed and the first abstract based on a key of a second encryption algorithm to obtain a first ciphertext;
encrypting the key of the second encryption algorithm based on the public key of the third encryption algorithm in the printing party node to obtain a second ciphertext;
and sending the first ciphertext and the second ciphertext to the printing party node so as to enable the printing party node to decrypt and obtain the data to be printed.
Optionally, the determining a first encryption algorithm based on the data to be printed and the data type identifier includes:
acquiring transmission basic information, and determining data information characteristics of the data to be printed according to the transmission basic information and the data to be printed;
determining the data type characteristics of the data to be printed according to the data type identifier;
inputting the data information characteristics and the data type characteristics of the data to be printed into an algorithm classifier to obtain the type prediction probability of the data to be printed;
and determining the first encryption algorithm in a preset algorithm based on the type prediction probability of the data to be printed.
Optionally, the blockchain-based data transmission method further includes:
according to the preset algorithm, determining an input data type and an application scene corresponding to the preset algorithm;
determining sample type characteristics based on input data types corresponding to the preset algorithm, and determining sample information characteristics based on application scenes corresponding to the preset algorithm;
and training an initial classifier model based on the sample information features and the sample type features to obtain the algorithm classifier.
Optionally, the encrypting the data to be printed and the first digest by the key based on the second encryption algorithm to obtain a first ciphertext includes:
combining the data to be printed and the first abstract into a target character string;
and encrypting the target character string based on the key of the second encryption algorithm to obtain the first ciphertext.
Optionally, the second encryption algorithm is a symmetric encryption algorithm, and before encrypting the data to be printed and the first digest by using the key based on the second encryption algorithm to obtain the first ciphertext, the method further includes:
randomly sampling in a preset random distribution set to obtain a random sample;
determining a set of uniform distributions based on the random samples;
determining a uniform sample based on the uniform distribution set;
when the uniform sample is less than or equal to the random sample sampling probability, determining that a key of the second encryption algorithm is the random sample;
and when the uniform sample is larger than the random sample sampling probability, returning to execute the step of randomly sampling in a preset random distribution set to obtain a random sample.
Optionally, the sending the first ciphertext and the second ciphertext to the printing node to decrypt the printing node to obtain the data to be printed includes:
compressing the first ciphertext and the second ciphertext to obtain a compressed ciphertext;
and sending the compressed ciphertext to the printing party node so that the printing party node decompresses the compressed ciphertext to obtain the first ciphertext and the second ciphertext, decrypting the second ciphertext according to the public key of the third encryption algorithm to obtain the key of the second encryption algorithm, decrypting the first ciphertext according to the key of the second encryption algorithm to obtain a first abstract and the data to be printed.
Optionally, after the sending the first ciphertext and the second ciphertext to the printing node to enable the printing node to decrypt the data to be printed, the method further includes:
and sending printing notification information to the printing party node so that the printing party node encrypts the data to be printed according to the first encryption algorithm to obtain a second abstract, verifying the first abstract and the second abstract, and sending the data to be printed to a target printer for printing and deleting the second abstract after the verification is passed.
Optionally, before encrypting the data to be printed based on the first encryption algorithm to obtain the first digest of the data to be printed, the method further includes:
acquiring the printing security level of the data to be printed, and determining whether sensitive data exists in the data to be printed according to the data type identification of the data to be printed when the printing security level is greater than a preset level;
and when sensitive data exist in the data to be printed, desensitizing the sensitive data.
Optionally, after the sending the first ciphertext and the second ciphertext to the printing node, the method further includes:
and deleting the generated first digest and the key of the second encryption algorithm.
Optionally, the blockchain-based data transmission method further includes:
recording the first encryption algorithm, the printing transmission time, the printing time and the codes of the printing party nodes, and generating a printing record.
In addition, in order to achieve the above object, the present invention also provides a data transmission device based on a blockchain, the data transmission device based on a blockchain includes:
the identification module is used for acquiring data to be printed, analyzing the data to be printed and obtaining a data type identification of the data to be printed;
the encryption module is used for determining a first encryption algorithm based on the data to be printed and the data type identifier;
the encryption module is further configured to encrypt the data to be printed based on the first encryption algorithm, so as to obtain a first abstract of the data to be printed;
the encryption module is further used for encrypting the data to be printed and the first abstract based on a key of a second encryption algorithm to obtain a first ciphertext;
the encryption module is further used for encrypting the key of the second encryption algorithm based on the public key of the third encryption algorithm in the printing party node to obtain a second ciphertext;
and the transmission module is used for transmitting the first ciphertext and the second ciphertext to the printing party node so as to enable the printing party node to decrypt and obtain the data to be printed.
In addition, to achieve the above object, the present invention also proposes a blockchain-based data transmission device including: a memory, a processor, and a blockchain-based data transfer program stored on the memory and executable on the processor, the blockchain-based data transfer program configured to implement the steps of the blockchain-based data transfer method as described above.
In addition, in order to achieve the above object, the present invention also proposes a storage medium having stored thereon a blockchain-based data transmission program which, when executed by a processor, implements the steps of the blockchain-based data transmission method as described above.
In the method, data to be printed is obtained, the data to be printed is analyzed to obtain a data type identifier of the data to be printed, a first encryption algorithm is determined based on the data to be printed and the data type identifier, the print data is encrypted based on the first encryption algorithm to obtain a first abstract of the data to be printed, the data to be printed and the first abstract are encrypted based on a key of a second encryption algorithm to obtain a first ciphertext, the key of the second encryption algorithm is encrypted based on a public key of a third encryption algorithm in a printing party node to obtain a second ciphertext, and the first ciphertext and the second ciphertext are sent to the printing party node to enable the printing party node to decrypt to obtain the data to be printed. Compared with the method for directly using the Internet to transmit the file data during printing, the method realizes a safe and reliable data transmission mode based on the blockchain, encrypts for 3 times in the data transmission process, randomly generates key keys, reduces the risk of theft caused by long-time key storage, reduces the inconvenience caused by frequent replacement of all keys, and can record the transmission process and ensure the traceability of the data.
Drawings
FIG. 1 is a schematic diagram of a block chain based data transfer device of a hardware operating environment in accordance with an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a blockchain-based data transmission method of the present invention;
FIG. 3 is a flowchart illustrating a second embodiment of a blockchain-based data transmission method of the present invention;
fig. 4 is a block diagram of a first embodiment of a blockchain-based data transmission device of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a blockchain-based data transmission device in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the blockchain-based data transmission device may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (Wi-Fi) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) Memory or a stable nonvolatile Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the structure shown in fig. 1 is not limiting of a blockchain-based data transmission device and may include more or fewer components than shown, or may combine certain components, or may be arranged in different components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a blockchain-based data transmission program may be included in the memory 1005 as one storage medium.
In the blockchain-based data transmission device shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the blockchain-based data transmission device of the present invention may be disposed in the blockchain-based data transmission device, and the blockchain-based data transmission device invokes the blockchain-based data transmission program stored in the memory 1005 through the processor 1001 and executes the blockchain-based data transmission method provided by the embodiment of the present invention.
An embodiment of the present invention provides a data transmission method based on a blockchain, and referring to fig. 2, fig. 2 is a flow chart of a first embodiment of the data transmission method based on a blockchain.
In this embodiment, the data transmission method based on the blockchain includes the following steps:
step S10: and acquiring data to be printed, and analyzing the data to be printed to obtain a data type identifier of the data to be printed.
It should be noted that, the execution body of the present embodiment is a sender node (sender node) in the blockchain.
It is understood that the data to be printed refers to data that a user needs to print. The data type identifier refers to type information of the data to be printed, such as file format type, file size information, file uploading time, etc., and the identifier can help the sender node to know the types of the data so as to process them correctly, and the data type identifier can be obtained in any suitable manner without limitation.
Step S20: and determining a first encryption algorithm based on the data to be printed and the data type identifier.
It will be appreciated that since different types of data have different characteristics, the encryption algorithms appropriate for them will also be different. Therefore, the transmitting node needs to select an appropriate encryption algorithm to encrypt the data to be printed according to the data type identification. Every transmission needs to find the most suitable encryption algorithm according to the data type identification. The first encryption algorithm is an algorithm used for the first encryption, and may be an SM3 algorithm (domestic hash algorithm) or other algorithms using a cryptographic hash function, which needs to be determined according to the actual situation, and this embodiment is not limited.
Step S30: and encrypting the data to be printed based on the first encryption algorithm to obtain a first abstract of the data to be printed.
It should be noted that the first abstract is encrypted data obtained by encrypting the data to be printed through a first encryption algorithm. The first abstracts obtained by encrypting different data to be printed by using a first encryption algorithm are different.
Further, before the step S30, the method further includes: acquiring the printing security level of the data to be printed, and determining whether sensitive data exists in the data to be printed according to the data type identification of the data to be printed when the printing security level is greater than a preset level; and when sensitive data exist in the data to be printed, desensitizing the sensitive data.
It will be appreciated that some sensitive data may exist in the data to be printed, and therefore, before the data is transmitted, it is required to determine whether the data to be transmitted has sensitive data according to the data type identifier carried by the data, and if the data has sensitive data, it is required to perform desensitization processing to protect the privacy and security of the data. If sensitive data is not present, the encryption process may continue to protect the confidentiality of the data. Sensitive data refers to data containing sensitive information such as personal privacy or business confidentiality, and special protection measures are needed for the data to ensure confidentiality and security. In the process of data transmission, sensitive data needs to be specially processed so as to avoid information leakage and data theft by an attacker. The desensitization processing refers to de-identification processing of sensitive data to reduce the sensitivity degree, for example, the last digits of the identification card number can be replaced by special symbols, the first digits and the last digits of the bank account number are hidden, and the like, so that the confidentiality of the data can be ensured, and the personal privacy and the security of business confidentiality can be protected.
Step S40: and encrypting the data to be printed and the first abstract based on a key of a second encryption algorithm to obtain a first ciphertext.
Further, the step S40 includes: combining the data to be printed and the first abstract into a target character string; and encrypting the target character string based on the key of the second encryption algorithm to obtain the first ciphertext.
It should be understood that the target character string is a character string obtained by combining, firstly, the data to be printed and the first abstract are combined into a target character string, and then the target character string is encrypted, so that the data to be printed and the first abstract are encrypted at one time. In order to enable the printing party node to distinguish the data to be printed and the first abstract in the target character string after receiving the first ciphertext and decrypting to obtain the target character string, the embodiment distinguishes the two parts by setting the separator, wherein the separator can be a predetermined separator or can be a relatively obvious separator, for example: the present embodiment is not limited to this, either using a header or using a blank line.
Further, before the step S40, the method further includes: randomly sampling in a preset random distribution set to obtain a random sample; determining a set of uniform distributions based on the random samples; determining a uniform sample based on the uniform distribution set; when the uniform sample is smaller than or equal to the sampling probability of the random sample, determining that the key of the second encryption algorithm is the random sample; and when the uniform sample is larger than the random sample sampling probability, returning to execute the step of randomly sampling in a preset random distribution set to obtain a random sample.
In this embodiment, the key of the second encryption algorithm is determined in a random manner. The process of randomly generating data is converted into a mathematical sampling process, i.e. a process of generating a random number subject to p (x), where the value range of x is set to a, b. The preset random distribution set is a preset random distribution set Q (x), the value interval of x is [ a, b ], and the value interval of x is required to be c multiplied by Q (x) > p (x), x is epsilon [ a, b ], and x is obtained by randomly sampling from Q (x), namely a random sample. U, i.e. a uniform sample, is then sampled from the uniform distribution (uniform distribution set) of U (0, c×q (x)). Then, the sampling probability of the random sample x is calculated, if u > P (x), the value is discarded, the random sample is regenerated, and if u.ltoreq.P (x), the value is accepted as the key of the current second encryption algorithm. The constant c should be chosen as small as possible, since the sampling efficiency is inversely proportional to c, and c=mmxp (x)/Q (x), x e a, b, where Q (x) may be uniformly distributed, so that two of the second uniform distributions may obtain any other analog samples.
Step S50: and encrypting the key of the second encryption algorithm based on the public key of the third encryption algorithm in the printing party node to obtain a second ciphertext.
It will be appreciated that, since the first ciphertext is encrypted by using the key of the second encryption algorithm, the printing party node must also possess the key of the second encryption algorithm, and when the symmetric encryption algorithm is adopted in the prior art, the key is usually determined by the sender and the receiver before data transmission, or the key is sent to the receiver in advance by the sender, but is provided to the receiver in advance, the key of the second encryption algorithm needs to be additionally sent to the receiver, if the receiver performs data interaction with multiple senders, the receiver needs to store the keys of the multiple senders, and the storage and management of the key will cause a great burden on the receiver, which is also a great disadvantage of the symmetric encryption algorithm. To avoid this problem, in the present embodiment, only one data transmission is performed, and the key of the second encryption algorithm is transmitted together with the data to be printed to the receiving side by the transmitting side node.
It will be appreciated that the second encryption algorithm needs to be encrypted in order to ensure its security during transmission of the key. The third encryption algorithm in this embodiment is an encryption algorithm stored at the printer node (receiver node), typically an asymmetric encryption algorithm, where the public key of the third encryption algorithm is public and the private key of the third encryption algorithm is private to the printer node. After the public key of the third encryption algorithm of the printing party node is used for encryption, the encrypted data is sent to the printing party node, and the data encrypted by the public key of the third encryption algorithm can be decrypted only by the private key stored by the printing party node, so that the safety of data transmission can be effectively ensured.
Step S60: and sending the first ciphertext and the second ciphertext to the printing party node so as to enable the printing party node to decrypt and obtain the data to be printed.
Further, the step S60 includes: compressing the first ciphertext and the second ciphertext to obtain a compressed ciphertext; and sending the compressed ciphertext to the printing party node so that the printing party node decompresses the compressed ciphertext to obtain the first ciphertext and the second ciphertext, decrypting the second ciphertext according to the public key of the third encryption algorithm to obtain the key of the second encryption algorithm, decrypting the first ciphertext according to the key of the second encryption algorithm to obtain a first abstract and the data to be printed.
In a specific implementation, the application of encryption and compression techniques can reduce the bandwidth and storage space required for data transmission while ensuring the security and integrity of the data. This means that a large amount of computing resources need not be used during data transmission, thereby improving transmission efficiency and system performance.
Further, after the step S60, the method further includes: and sending printing notification information to the printing party node so that the printing party node encrypts the data to be printed according to the key of the first encryption algorithm to obtain a second abstract, verifying the first abstract and the second abstract, and sending the data to be printed to a target printer for printing and deleting the second abstract after the first abstract and the second abstract pass the verification.
It should be noted that, the abstracts obtained by the same data through the first encryption algorithm are the same, so the printing party node can encrypt the obtained data to be printed through the first encryption algorithm to obtain the second abstracts after obtaining the data to be printed, and then determine whether the obtained data to be printed is completely consistent with the data to be printed to be sent by the transmission party node through comparing the first abstracts with the second abstracts, if so, the data to be printed is verified to be passed, the printing operation is performed, if not, the verification is not passed, the printing operation is not performed, and the transmission safety is further ensured.
Further, after the first ciphertext and the second ciphertext are sent to the printing party node, the method further includes: and deleting the generated keys of the first digest and the second encryption algorithm.
In a specific implementation, after the first ciphertext and the second ciphertext are sent to the printing party node, in order to avoid the secret key from being stolen and also to avoid the occupied space, the transmission party node may delete important information, including the first digest, the secret key of the second encryption algorithm and the second digest, wherein the second digest is deleted by the printing party node.
Further, the blockchain-based data transmission method further includes: recording the first encryption algorithm, the printing transmission time, the printing time and the codes of the printing party nodes, and generating a printing record.
It will be appreciated that this embodiment will record important information during each transmission for later data trace back.
In this embodiment, the data type identifier of the data to be printed is obtained by obtaining the data to be printed and analyzing the data to be printed, the first encryption algorithm is determined based on the data to be printed and the data type identifier, the print data is encrypted based on the first encryption algorithm to obtain a first abstract of the data to be printed, the data to be printed and the first abstract are encrypted based on the key of the second encryption algorithm to obtain a first ciphertext, the key of the second encryption algorithm is encrypted based on the public key of the third encryption algorithm in the printing party node to obtain a second ciphertext, and the first ciphertext and the second ciphertext are sent to the printing party node to enable the printing party node to decrypt the data to be printed. Compared with the method that the internet is directly used for transmitting the file data during printing, the method realizes a safe and reliable data transmission mode based on the blockchain, performs encryption for 3 times in the data transmission process, randomly generates key keys, reduces the theft risk caused by long-time key storage, reduces inconvenience caused by frequent replacement of all keys, and can record the transmission process and ensure the traceability of the data.
Referring to fig. 3, fig. 3 is a flowchart of a second embodiment of a data transmission method based on a blockchain according to the present invention.
Based on the above embodiment, in this embodiment, the step S20 includes:
step S201: and acquiring transmission basic information, and determining the data information characteristics of the data to be printed according to the transmission basic information and the data to be printed.
It should be noted that, basic information, that is, related information of the current transmission procedure, is transmitted, for example: the size of the data, the source of the data, the destination of the data, etc. The data information features are features related to basic information in the data to be printed.
Step S202: and determining the data type characteristics of the data to be printed according to the data type identifier.
It is understood that the data type feature refers to a feature related to the data type of the data to be printed.
Step S203: inputting the data information characteristics and the data type characteristics of the data to be printed into an algorithm classifier to obtain the type prediction probability of the data to be printed.
In a specific implementation, after the features are input to the algorithm classifier, the algorithm classifier processes and analyzes the features to generate a probability vector, which indicates that the data to be printed belongs to different types of probability values.
Further, before the step S203, the method further includes: according to the preset algorithm, determining an input data type and an application scene corresponding to the preset algorithm; determining sample type characteristics based on input data types corresponding to the preset algorithm, and determining sample information characteristics based on application scenes corresponding to the preset algorithm; and training an initial classifier model based on the sample information features and the sample type features to obtain the algorithm classifier.
It should be appreciated that the algorithm classifier may be obtained through a machine learning algorithm, such as a deep neural network or a support vector machine, using a large amount of sample data for model training, and finally obtaining an algorithm classifier, which may perform classification prediction on new data. Specifically, the input eigenvalues are mapped to the input layer of the model, and the corresponding probability vectors are finally output through a series of hidden layer processing.
Step S204: and determining the first encryption algorithm in a preset algorithm based on the type prediction probability of the data to be printed.
It should be noted that, in this embodiment, the corresponding first encryption algorithm is selected according to the magnitude of the type prediction probability. The type prediction probability, i.e., the prediction result, can be regarded as a probability distribution of the type to which the data to be printed belongs, and the larger the probability value is, the greater the probability of belonging to the type is. According to different probability distributions, different encryption algorithms can be selected to ensure the security of data transmission. And determining the required encryption strength according to the size of the probability distribution vector. In general, the higher the maximum probability value in the probability distribution vector, the higher the encryption strength. If the maximum probability value is less than 0.5, encryption is not required. If the maximum probability value is between 0.5 and 0.8, a symmetric encryption algorithm, such as the AES (Advanced Encryption Standard ) algorithm, and a strong cipher may be selected for encryption. If the maximum probability value is equal to or greater than 0.8, a higher strength encryption algorithm, such as an RSA algorithm or an elliptic curve encryption algorithm (ECC), is selected. An appropriate encryption algorithm is selected based on the determined encryption strength. Different encryption algorithms, such as a symmetric encryption algorithm and an asymmetric encryption algorithm, are selected according to the difference of encryption strength. Symmetric encryption algorithms are suitable for scenes with low encryption strength requirements, and are characterized in that the same secret key is used for encryption and decryption, such as an AES algorithm, a DES (Data Encryption Standard ) algorithm and the like. Whereas asymmetric encryption algorithms are suitable for scenes with high encryption strength requirements, they are characterized in that different keys are used for encryption and decryption, such as RSA algorithm, ECC algorithm, etc. For the selected encryption algorithm, an appropriate key length is selected. For symmetric encryption algorithms, the key length is typically 128 bits or 256 bits. For asymmetric encryption algorithms, the key length should be long enough, typically 2048 bits or 4096 bits.
In this embodiment, the transmission basic information is acquired, the data information characteristic of the data to be printed is determined according to the transmission basic information and the data to be printed, the data type characteristic of the data to be printed is determined according to the data type identifier, the data information characteristic and the data type characteristic of the data to be printed are input into the algorithm classifier, the type prediction probability of the data to be printed is obtained, and the first encryption algorithm is determined in the preset algorithm based on the type prediction probability of the data to be printed. The embodiment realizes a safe and reliable data transmission mode based on the blockchain, performs encryption for 3 times in the data transmission process, randomly generates key keys, reduces the theft risk caused by long-time storage of the key, ensures the safety of data transmission, simultaneously reduces the inconvenience caused by frequent replacement of all the keys, and can record the transmission process and ensure the traceability of the data.
In addition, the embodiment of the invention also provides a storage medium, wherein the storage medium is stored with a data transmission program based on the block chain, and the data transmission program based on the block chain realizes the steps of the data transmission method based on the block chain when being executed by a processor.
Referring to fig. 4, fig. 4 is a block diagram illustrating a first embodiment of a block chain based data transmission device according to the present invention.
As shown in fig. 4, a data transmission apparatus based on a blockchain according to an embodiment of the present invention includes:
the identification module 10 is configured to obtain data to be printed, and parse the data to be printed to obtain a data type identification of the data to be printed.
The encryption module 20 is configured to determine a first encryption algorithm based on the data to be printed and the data type identifier.
The encryption module 20 is further configured to encrypt the data to be printed based on the first encryption algorithm, to obtain a first digest of the data to be printed.
The encryption module 20 is further configured to encrypt the data to be printed and the first digest based on a key of a second encryption algorithm, to obtain a first ciphertext.
The encryption module 20 is further configured to encrypt a key of the second encryption algorithm based on a public key of a third encryption algorithm in the printing party node, to obtain a second ciphertext.
And the transmission module 30 is configured to send the first ciphertext and the second ciphertext to the printing node, so that the printing node decrypts the data to be printed.
In this embodiment, the data type identifier of the data to be printed is obtained by obtaining the data to be printed and analyzing the data to be printed, the first encryption algorithm is determined based on the data to be printed and the data type identifier, the print data is encrypted based on the first encryption algorithm to obtain a first abstract of the data to be printed, the data to be printed and the first abstract are encrypted based on the key of the second encryption algorithm to obtain a first ciphertext, the key of the second encryption algorithm is encrypted based on the public key of the third encryption algorithm in the printing party node to obtain a second ciphertext, and the first ciphertext and the second ciphertext are sent to the printing party node to enable the printing party node to decrypt the data to be printed. Compared with the method that the internet is directly used for transmitting the file data during printing, the method realizes a safe and reliable data transmission mode based on the blockchain, performs encryption for 3 times in the data transmission process, randomly generates key keys, reduces the theft risk caused by long-time key storage, reduces inconvenience caused by frequent replacement of all keys, and can record the transmission process and ensure the traceability of the data.
In an embodiment, the encryption module 20 is further configured to obtain transmission basic information, and determine a data information feature of the data to be printed according to the transmission basic information and the data to be printed;
determining the data type characteristics of the data to be printed according to the data type identifier;
inputting the data information characteristics and the data type characteristics of the data to be printed into an algorithm classifier to obtain the type prediction probability of the data to be printed;
and determining the first encryption algorithm in a preset algorithm based on the type prediction probability of the data to be printed.
In an embodiment, the encryption module 20 is further configured to determine, according to the preset algorithm, an input data type and an application scenario corresponding to the preset algorithm;
determining sample type characteristics based on input data types corresponding to the preset algorithm, and determining sample information characteristics based on application scenes corresponding to the preset algorithm;
and training an initial classifier model based on the sample information features and the sample type features to obtain the algorithm classifier.
In an embodiment, the encryption module 20 is further configured to combine the data to be printed and the first digest into a target string;
and encrypting the target character string based on the key of the second encryption algorithm to obtain the first ciphertext.
In an embodiment, the encryption module 20 is further configured to randomly sample in a preset random distribution set to obtain a random sample;
determining a set of uniform distributions based on the random samples;
determining a uniform sample based on the uniform distribution set;
when the uniform sample is less than or equal to the random sample sampling probability, determining that a key of the second encryption algorithm is the random sample;
and when the uniform sample is larger than the random sample sampling probability, returning to execute the step of randomly sampling in a preset random distribution set to obtain a random sample.
In an embodiment, the transmission module 30 is further configured to compress the first ciphertext and the second ciphertext to obtain a compressed ciphertext;
and sending the compressed ciphertext to the printing party node so that the printing party node decompresses the compressed ciphertext to obtain the first ciphertext and the second ciphertext, decrypting the second ciphertext according to the public key of the third encryption algorithm to obtain the key of the second encryption algorithm, decrypting the first ciphertext according to the key of the second encryption algorithm to obtain a first abstract and the data to be printed.
In an embodiment, the transmission module 30 is further configured to send print notification information to the printing party node, so that the printing party node encrypts the data to be printed according to the first encryption algorithm to obtain a second digest, verifies the first digest and the second digest, sends the data to be printed to a target printer for printing after the verification is passed, and deletes the second digest.
In an embodiment, the identification module 10 is further configured to obtain a print security level of the data to be printed, and determine whether sensitive data exists in the data to be printed according to a data type identifier of the data to be printed when the print security level is greater than a preset level;
and when sensitive data exist in the data to be printed, desensitizing the sensitive data.
In an embodiment, the encryption module 20 is further configured to delete the generated first digest and the key of the second encryption algorithm.
In an embodiment, the transmission module 30 is further configured to record the first encryption algorithm, the printing transmission time, the printing time, and the code of the printing party node, and generate a printing record.
It should be understood that the foregoing is illustrative only and is not limiting, and that in specific applications, those skilled in the art may set the invention as desired, and the invention is not limited thereto.
It should be noted that the above-described working procedure is merely illustrative, and does not limit the scope of the present invention, and in practical application, a person skilled in the art may select part or all of them according to actual needs to achieve the purpose of the embodiment, which is not limited herein.
In addition, technical details not described in detail in this embodiment may refer to the blockchain-based data transmission method provided in any embodiment of the present invention, which is not described herein.
Furthermore, it should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system 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 system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. Read Only Memory)/RAM, magnetic disk, optical disk) and including several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (10)

1. A blockchain-based data transmission method, comprising:
acquiring data to be printed, and analyzing the data to be printed to obtain a data type identifier of the data to be printed;
determining a first encryption algorithm based on the data to be printed and the data type identifier;
encrypting the data to be printed based on the first encryption algorithm to obtain a first abstract of the data to be printed;
encrypting the data to be printed and the first abstract based on a key of a second encryption algorithm to obtain a first ciphertext;
encrypting the key of the second encryption algorithm based on the public key of the third encryption algorithm in the printing party node to obtain a second ciphertext;
and sending the first ciphertext and the second ciphertext to the printing party node so as to enable the printing party node to decrypt and obtain the data to be printed.
2. The method of claim 1, wherein the determining a first encryption algorithm based on the data to be printed and the data type identification comprises:
acquiring transmission basic information, and determining data information characteristics of the data to be printed according to the transmission basic information and the data to be printed;
determining the data type characteristics of the data to be printed according to the data type identifier;
inputting the data information characteristics and the data type characteristics of the data to be printed into an algorithm classifier to obtain the type prediction probability of the data to be printed;
and determining the first encryption algorithm in a preset algorithm based on the type prediction probability of the data to be printed.
3. The method of claim 2, wherein the blockchain-based data transmission method further comprises:
according to the preset algorithm, determining an input data type and an application scene corresponding to the preset algorithm;
determining sample type characteristics based on input data types corresponding to the preset algorithm, and determining sample information characteristics based on application scenes corresponding to the preset algorithm;
and training an initial classifier model based on the sample information features and the sample type features to obtain the algorithm classifier.
4. The method of claim 1, wherein encrypting the data to be printed and the first digest with the second encryption algorithm-based key to obtain a first ciphertext comprises:
combining the data to be printed and the first abstract into a target character string;
and encrypting the target character string based on the key of the second encryption algorithm to obtain the first ciphertext.
5. The method of claim 1, wherein the second encryption algorithm is a symmetric encryption algorithm, and wherein the second encryption algorithm-based key encrypts the data to be printed and the first digest to obtain a first ciphertext, and further comprising:
randomly sampling in a preset random distribution set to obtain a random sample;
determining a set of uniform distributions based on the random samples;
determining a uniform sample based on the uniform distribution set;
when the uniform sample is less than or equal to the random sample sampling probability, determining that a key of the second encryption algorithm is the random sample;
and when the uniform sample is larger than the random sample sampling probability, returning to execute the step of randomly sampling in a preset random distribution set to obtain a random sample.
6. The method of claim 1, wherein the sending the first ciphertext and the second ciphertext to the printer node to decrypt the data to be printed by the printer node comprises:
compressing the first ciphertext and the second ciphertext to obtain a compressed ciphertext;
and sending the compressed ciphertext to the printing party node so that the printing party node decompresses the compressed ciphertext to obtain the first ciphertext and the second ciphertext, decrypting the second ciphertext according to the public key of the third encryption algorithm to obtain the key of the second encryption algorithm, decrypting the first ciphertext according to the key of the second encryption algorithm to obtain a first abstract and the data to be printed.
7. The method of claim 6, wherein the sending the first ciphertext and the second ciphertext to the printer node to decrypt the data to be printed by the printer node further comprises:
and sending printing notification information to the printing party node so that the printing party node encrypts the data to be printed according to the first encryption algorithm to obtain a second abstract, verifying the first abstract and the second abstract, and sending the data to be printed to a target printer for printing and deleting the second abstract after the verification is passed.
8. The method of claim 1, wherein the encrypting the data to be printed based on the first encryption algorithm further comprises, before obtaining the first digest of the data to be printed:
acquiring the printing security level of the data to be printed, and determining whether sensitive data exists in the data to be printed according to the data type identification of the data to be printed when the printing security level is greater than a preset level;
and when sensitive data exist in the data to be printed, desensitizing the sensitive data.
9. The method of claim 1, wherein after the sending the first ciphertext and the second ciphertext to the printer node, further comprises:
and deleting the generated keys of the first digest and the second encryption algorithm.
10. The method of any of claims 1 to 9, wherein the blockchain-based data transmission method further comprises:
recording the first encryption algorithm, the printing transmission time, the printing time and the codes of the printing party nodes, and generating a printing record.
CN202311062865.6A 2023-08-22 2023-08-22 Data transmission method based on block chain Pending CN117150548A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311062865.6A CN117150548A (en) 2023-08-22 2023-08-22 Data transmission method based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311062865.6A CN117150548A (en) 2023-08-22 2023-08-22 Data transmission method based on block chain

Publications (1)

Publication Number Publication Date
CN117150548A true CN117150548A (en) 2023-12-01

Family

ID=88883522

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311062865.6A Pending CN117150548A (en) 2023-08-22 2023-08-22 Data transmission method based on block chain

Country Status (1)

Country Link
CN (1) CN117150548A (en)

Similar Documents

Publication Publication Date Title
US10853497B2 (en) Method and system for providing an update of code on a memory-constrained device
US10243744B2 (en) Residue message authentication code
CN113067699B (en) Data sharing method and device based on quantum key and computer equipment
CN109688098B (en) Method, device and equipment for secure communication of data and computer readable storage medium
CN111294203B (en) Information transmission method
KR20080025121A (en) Generating a secret key from an asymmetric private key
CN111131282B (en) Request encryption method and device, electronic equipment and storage medium
US20210288946A1 (en) Methods and apparatuses for oblivious transfer using trusted environment
US11888832B2 (en) System and method to improve user authentication for enhanced security of cryptographically protected communication sessions
JP2020524864A (en) Controlling access to data
CN113918977A (en) User information transmission device based on Internet of things and big data analysis
CN116455572B (en) Data encryption method, device and equipment
Roth et al. A secure submission system for online whistleblowing platforms
Shirole et al. Review paper on data security in cloud computing environment
CN113672955B (en) Data processing method, system and device
JP2001142396A (en) Ciphering device, its method, ciphering/deciphering device, its method and communication system
CN113595982B (en) Data transmission method and device, electronic equipment and storage medium
CN117150548A (en) Data transmission method based on block chain
CN114462088A (en) Method and device for de-identifying shared data
CN116032509A (en) Mail encryption and decryption method and device
Ratshinanga et al. A security mechanism for secure sms communication
Ciobanu et al. SCONeP: Steganography and Cryptography approach for UDP and ICMP
Olaleye et al. SoloEncrypt: A Smartphone Storage Enhancement Security Model for Securing users Sensitive Data
Arshad et al. Hill Matrix and Radix-64 Bit Algorithm to Preserve Data Confidentiality.
CN115242540B (en) Data processing method and system

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