CN114119332A - Block chain-based digital watermark writing and reading method and device - Google Patents

Block chain-based digital watermark writing and reading method and device Download PDF

Info

Publication number
CN114119332A
CN114119332A CN202111341467.9A CN202111341467A CN114119332A CN 114119332 A CN114119332 A CN 114119332A CN 202111341467 A CN202111341467 A CN 202111341467A CN 114119332 A CN114119332 A CN 114119332A
Authority
CN
China
Prior art keywords
digital watermark
writing
written
character string
hash value
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
CN202111341467.9A
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.)
Bank of China Ltd
Original Assignee
Bank of China 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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202111341467.9A priority Critical patent/CN114119332A/en
Publication of CN114119332A publication Critical patent/CN114119332A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • 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

Abstract

The invention discloses a block chain-based digital watermark writing and reading method and device, and relates to the technical field of block chains, wherein the block chain-based digital watermark writing method comprises the following steps: acquiring user identity information to be written into a target picture from the block chain: a hash value and a preset key; encrypting the hash value by using the preset key to obtain a digital watermark; carrying out binary conversion on the digital watermark to obtain a binary character string of the digital watermark; determining a plurality of pixel points to be written with digital watermarks and an RGB value writing channel according to the preset key and the number of digits of the binary character string; and correspondingly writing the number of each digit of the binary character string into the RGB values of the plurality of pixel points in a writing channel based on the LSB steganography technology to obtain the target picture written with the digital watermark. The invention can improve the safety of digital watermark writing and the writing efficiency of the digital watermark.

Description

Block chain-based digital watermark writing and reading method and device
Technical Field
The present invention relates to the field of block chain technology, and in particular, to a block chain-based digital watermark writing and reading method and apparatus.
Background
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
At present, there are generally two methods of writing digital watermarks as follows:
the first spatial domain watermarking algorithm: the digital watermark is directly added to the data by using a plurality of methods, which are simple but easy to attack, so that the security of writing the digital watermark is low.
Second, frequency domain watermarking algorithm: the spatial domain coefficients of the digital image are converted into frequency domain coefficients by various transformation methods, and then the frequency domain coefficients and the inverse coding or deformation are carried out. And thirdly, determining a certain rule or algorithm to modify the frequency domain coefficient sequence, and finally inversely transforming the frequency domain coefficient into spatial domain data. Although the method has high security, the operation is complex, and the writing efficiency of the digital watermark is easily influenced.
Disclosure of Invention
The embodiment of the invention provides a block chain-based digital watermark writing method, which is used for improving the safety of digital watermark writing and the writing efficiency of digital watermarks and comprises the following steps:
acquiring user identity information to be written into a target picture from the block chain: a hash value and a preset key;
encrypting the hash value by using the preset key to obtain a digital watermark; the digital watermark is a hash value character string after encryption processing;
carrying out binary conversion on the digital watermark to obtain a binary character string of the digital watermark;
determining a plurality of pixel points to be written with digital watermarks and an RGB value writing channel according to the preset key and the number of digits of the binary character string;
based on the LSB steganography technology, correspondingly writing the number of each digit of the binary character string into the RGB values of the plurality of pixel points to obtain a target picture written with the digital watermark; wherein, the number on each digit corresponds to the RGB value writing channel of a pixel point.
The embodiment of the present invention further provides a block chain-based digital watermark writing device, for improving the security of digital watermark writing and the writing efficiency of digital watermark, the device includes:
the first data acquisition module is used for acquiring the user identity information to be written into the target picture from the block chain: a hash value and a preset key;
the encryption processing module is used for carrying out encryption processing on the hash value by using the preset secret key to obtain a digital watermark; the digital watermark is a hash value character string after encryption processing;
the binary conversion module is used for carrying out binary conversion on the digital watermark to obtain a binary character string of the digital watermark;
the first pixel point and RGB value write-in channel determining module is used for determining a plurality of pixel points to be written with digital watermarks and RGB values write-in channels according to the preset key and the number of digits of the binary character string;
the digital watermark writing module is used for correspondingly writing the number of each digit of the binary character string into the RGB values of the pixel points in the writing channel based on the LSB steganography technology to obtain a target picture written with the digital watermark; wherein, the number on each digit corresponds to the RGB value writing channel of a pixel point.
The embodiment of the invention also provides a block chain-based digital watermark reading method for improving the safety of digital watermark writing and the writing efficiency of the digital watermark, which comprises the following steps:
acquiring the identity information of the user to be verified corresponding to the target picture from the block chain: a hash value and a preset key;
determining a plurality of pixel points written with digital watermarks and RGB values writing channels in a target picture according to a preset key;
and sequentially reading the numerical values of the plurality of pixel points corresponding to the RGB values written in the channel to obtain the binary character string of the digital watermark.
An embodiment of the present invention further provides a block chain-based digital watermark reading apparatus for improving the security of digital watermark writing and the writing efficiency of digital watermark, where the apparatus includes:
the second data storage module is used for acquiring the identity information of the user to be verified corresponding to the target picture from the block chain: a hash value and a preset key;
the second pixel point and RGB value write-in channel determining module is used for determining a plurality of pixel points and RGB value write-in channels, in which digital watermarks are written, in the target picture according to a preset secret key;
and the binary character string reading module of the digital watermark is used for sequentially reading the numerical values of the plurality of pixel points corresponding to the RGB values written in the channel to obtain the binary character string of the digital watermark.
The embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the method for writing and reading a digital watermark based on a block chain is implemented.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program for executing the above block chain-based digital watermark writing and reading method is stored in the computer-readable storage medium.
In the embodiment of the present invention, the user identity information corresponding to the target picture to be written is obtained from the block chain: a hash value and a preset key; encrypting the hash value by using the preset key to obtain a digital watermark; the digital watermark is a hash value character string after encryption processing; carrying out binary conversion on the digital watermark to obtain a binary character string of the digital watermark; determining a plurality of pixel points to be written with digital watermarks and an RGB value writing channel according to the preset key and the number of digits of the binary character string; based on the LSB steganography technology, correspondingly writing the number of each digit of the binary character string into the RGB values of the plurality of pixel points to obtain a target picture written with the digital watermark; compared with the technical scheme of writing digital watermarks in the prior art based on a spatial domain watermark algorithm, the digital watermarks can be written in the RGB values of the pixel points of the picture by using an LSB steganography technology, so that the writing safety of the digital watermarks can be effectively ensured; compared with the technical scheme of writing digital watermarks based on the frequency domain watermark algorithm in the prior art, the digital watermarks are only required to be written into the RGB values of the picture pixel points, the digital watermarks can be conveniently written, and the writing efficiency of the digital watermarks is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
fig. 1 is a schematic flowchart of a block chain-based digital watermark writing method according to an embodiment of the present invention;
fig. 2 is a diagram illustrating an example of a structure of a block chain-based digital watermark writing apparatus according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a block chain-based digital watermark reading method according to an embodiment of the present invention;
fig. 4 is a diagram illustrating an exemplary structure of a block chain-based digital watermark reading apparatus according to an embodiment of the present invention;
fig. 5 is a specific schematic diagram of a block chain-based digital watermark writing and reading apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
Embodiments of the present invention relate to the following terms, which are explained as follows:
block chains: a decentralized, non-falsifiable and credible distributed account book has the characteristics of non-falsification, whole-course trace keeping, traceability, public transparency, collective maintenance and the like.
Steganography: steganography is a skill and discipline related to information hiding, which refers to the passing of events or content of information that does not let anyone other than the intended recipient know the information.
Digital watermarking: techniques for embedding specific digital signals in digital products to protect the copyright or integrity of the digital products.
LSB: LSB steganography is the modification of the least binary bits, i.e., the Least Significant Bits (LSBs), of the RGB color components, without the human eye noticing the change before and after, and each pixel can carry 3 bits of information.
At present, there are generally two methods of writing digital watermarks as follows:
the first spatial domain watermarking algorithm: the digital watermark is directly added to the data by using a plurality of methods, which are simple but easy to attack, so that the security of writing the digital watermark is low.
Second, frequency domain watermarking algorithm: the spatial domain coefficients of the digital image are converted into frequency domain coefficients by various transformation methods, and then the frequency domain coefficients and the inverse coding or deformation are carried out. And thirdly, determining a certain rule or algorithm to modify the frequency domain coefficient sequence, and finally inversely transforming the frequency domain coefficient into spatial domain data. Although the method has high security, the operation is complex, and the writing efficiency of the digital watermark is easily influenced.
An embodiment of the present invention provides a block chain-based digital watermark writing method for improving the security of digital watermark writing and the writing efficiency of digital watermark, as shown in fig. 1, the method includes:
step 101: acquiring user identity information to be written into a target picture from the block chain: a hash value and a preset key;
step 102: encrypting the hash value by using the preset key to obtain a digital watermark; the digital watermark is a hash value character string after encryption processing;
step 103: carrying out binary conversion on the digital watermark to obtain a binary character string of the digital watermark;
step 104: determining a plurality of pixel points to be written with digital watermarks and an RGB value writing channel according to the preset key and the number of digits of the binary character string;
step 105: based on LSB steganography technology, correspondingly writing the number of each digit of the binary character string into the RGB values of the pixel points to obtain a target picture written with digital watermarks; wherein, the number on each digit corresponds to the RGB value writing channel of a pixel point.
In the embodiment of the present invention, the user identity information corresponding to the target picture to be written is obtained from the block chain: a hash value and a preset key; encrypting the hash value by using the preset key to obtain a digital watermark; the digital watermark is a hash value character string after encryption processing; carrying out binary conversion on the digital watermark to obtain a binary character string of the digital watermark; determining a plurality of pixel points to be written with digital watermarks and an RGB value writing channel according to the preset key and the number of digits of the binary character string; based on LSB steganography technology, correspondingly writing the number of each digit of the binary character string into the RGB values of the pixel points to obtain a target picture written with digital watermarks; compared with the technical scheme of writing digital watermarks in the prior art based on a spatial domain watermark algorithm, the digital watermarks can be written in the RGB values of the pixel points of the picture by using an LSB steganography technology, so that the writing safety of the digital watermarks can be effectively ensured; compared with the technical scheme of writing digital watermarks based on the frequency domain watermark algorithm in the prior art, the digital watermarks are only required to be written into the RGB values of the picture pixel points, the digital watermarks can be conveniently written, and the writing efficiency of the digital watermarks is improved.
In specific implementation, firstly, the user identity information corresponding to the target picture to be written is obtained from the block chain: a hash value and a preset key.
In an embodiment, the user to be written into the target picture may be a writer of the picture, and the target picture may be applied to copyright protection of digitized images, videos, audio-visual products and electronic documents. When copyright disputes occur, the digital watermark can be extracted through the corresponding algorithm of the invention, thereby verifying the ownership of the copyright, ensuring the legal benefit of the author and avoiding the threat of illegal piracy.
In an embodiment, the hash value of the user identity information to be written into the target picture may be obtained by associating information about the author, including the name, identification number, date of authoring, and the like of the author. The preset key corresponding to the user identity information to be written into the target picture can be randomly generated and corresponds to the user identity one to one.
In specific implementation, in the block chain, the user identity information corresponding to the target picture to be written is acquired: after the hash value and the preset key are obtained, the preset key is used for encrypting the hash value to obtain a digital watermark; the digital watermark is a hash value character string after encryption processing.
In an embodiment, the preset key may be a private key of a digital watermark queried from a blockchain. The encrypting the hash value may include: and signing the hash value of the user information by using the digital watermark private key inquired from the block chain, thereby obtaining a signed character string, namely the digital watermark.
In specific implementation, the preset key is used for encrypting the hash value to obtain a digital watermark; and after the digital watermark is the encrypted hash value character string, performing binary conversion on the digital watermark to obtain a binary character string of the digital watermark.
In specific implementation, after the digital watermark is subjected to binary conversion to obtain a binary character string of the digital watermark, a plurality of pixel points and an RGB value writing channel to be written with the digital watermark are determined according to a preset key and the number of digits of the binary character string.
In an embodiment, the preset key is a hexadecimal character string;
determining a plurality of pixel points to be written with digital watermarks and an RGB value writing channel according to the preset key and the number of digits of the binary character string, and the method comprises the following steps:
carrying out summation operation on the decimal conversion result of the digits on each digit of the preset key to obtain a summation operation result;
determining a plurality of pixel points to be written with digital watermarks according to the preset initial pixel point position, the summation operation result and the number of digits of the binary character string;
respectively carrying out XOR operation and XNOR operation on the numbers on each digit of the preset key converted into the binary string to obtain an XOR operation result and an XNOR operation result;
determining RGB values of the pixel points to be written into a channel according to an exclusive-OR operation result and an exclusive-OR operation result; the RGB value writing channels comprise an R value writing channel, a G value writing channel and a B value writing channel.
In the above embodiment, the digital watermark can be written into the RGB values of the picture pixel points by using the LSB steganography technique, which can effectively ensure the security of digital watermark writing.
During specific implementation, after a plurality of pixel points and RGB values to be written with digital watermarks are determined to be written into a channel according to a preset key and the number of digits of a binary character string, correspondingly writing the digits on each digit of the binary character string into the channels according to the RGB values of the pixel points based on the LSB steganography technology, and obtaining a target picture written with the digital watermarks; wherein, the number on each digit corresponds to the RGB value writing channel of a pixel point.
In the embodiment, the pixels can be numbered in the sequence from left to right and from top to bottom on the picture, the digits on each digit of the binary character string are also numbered in the sequence from left to right, and the digits on each digit of the binary character string are correspondingly written into the RGB value writing channels of the pixels, so that the numbers are correspondingly replaced, and the target picture with the digital watermark written therein is obtained.
In specific implementation, the method for writing and reading a digital watermark based on a block chain according to the embodiment of the present invention may further include: calculating hash values of different user identity information;
randomly generating keys corresponding to different user identity information as preset keys corresponding to the user identity information;
and storing the hash values and the preset keys corresponding to different user identity information into the block chain.
In an embodiment, the hash value of different user identity information can be calculated according to the user name, the identity card number and the picture generation date.
In the above embodiment, by using the blockchain to store hash values and preset keys of different users, the encryption protection of the above information can be realized by virtue of the security of the blockchain.
An embodiment of the present invention further provides a block chain-based digital watermark writing apparatus, configured to improve the security of digital watermark writing and the writing efficiency of digital watermark, as shown in fig. 2, where the apparatus includes:
the first data obtaining module 201 is configured to obtain, from the blockchain, user identity information to be written into the target picture: a hash value and a preset key;
an encryption processing module 202, configured to encrypt the hash value with the preset key to obtain a digital watermark; the digital watermark is a hash value character string after encryption processing;
the binary conversion module 203 is configured to perform binary conversion on the digital watermark to obtain a binary character string of the digital watermark;
a first pixel point and RGB value write channel determination module 204, configured to determine, according to a preset key and the number of digits of a binary string, a plurality of pixel points and RGB value write channels to be written with a digital watermark;
a digital watermark writing module 205, configured to write the number of each digit of the binary string into the RGB values of the multiple pixel points correspondingly based on the LSB steganography technique, so as to obtain a target picture with a digital watermark written therein; wherein, the number on each digit corresponds to the RGB value writing channel of a pixel point.
In one embodiment, further comprising:
a blockchain storage module to:
calculating hash values of different user identity information;
randomly generating keys corresponding to different user identity information as preset keys corresponding to the user identity information;
and storing the hash values and the preset keys corresponding to different user identity information into the block chain.
In one embodiment, the predetermined key is a hexadecimal string;
the pixel point and RGB value write-in channel determination module is specifically configured to:
carrying out summation operation on the decimal conversion result of the digits on each digit of the preset key to obtain a summation operation result;
determining a plurality of pixel points to be written with digital watermarks according to the preset initial pixel point position, the summation operation result and the number of digits of the binary character string;
respectively carrying out XOR operation and XNOR operation on the numbers on each digit of the preset key converted into the binary string to obtain an XOR operation result and an XNOR operation result;
determining RGB values of the pixel points to be written into a channel according to an exclusive-OR operation result and an exclusive-OR operation result; the RGB value writing channels comprise an R value writing channel, a G value writing channel and a B value writing channel.
In the embodiment of the present invention, the user identity information corresponding to the target picture to be written is obtained from the block chain: a hash value and a preset key; encrypting the hash value by using the preset key to obtain a digital watermark; the digital watermark is a hash value character string after encryption processing; carrying out binary conversion on the digital watermark to obtain a binary character string of the digital watermark; determining a plurality of pixel points to be written with digital watermarks and an RGB value writing channel according to the preset key and the number of digits of the binary character string; based on LSB steganography technology, correspondingly writing the number of each digit of the binary character string into the RGB values of the pixel points to obtain a target picture written with digital watermarks; compared with the technical scheme of writing digital watermarks in the prior art based on a spatial domain watermark algorithm, the digital watermarks can be written in the RGB values of the pixel points of the picture by using an LSB steganography technology, so that the writing safety of the digital watermarks can be effectively ensured; compared with the technical scheme of writing digital watermarks based on the frequency domain watermark algorithm in the prior art, the digital watermarks are only required to be written into the RGB values of the picture pixel points, the digital watermarks can be conveniently written, and the writing efficiency of the digital watermarks is improved.
An embodiment of the present invention further provides a block chain-based digital watermark reading method for improving the security of digital watermark writing and the writing efficiency of digital watermark, as shown in fig. 3, the method includes:
step 301: acquiring the identity information of the user to be verified corresponding to the target picture from the block chain: a hash value and a preset key;
step 302: determining a plurality of pixel points written with digital watermarks and RGB values writing channels in a target picture according to a preset key;
step 303: and sequentially reading the numerical values of the plurality of pixel points corresponding to the RGB values written in the channel to obtain the binary character string of the digital watermark.
In one embodiment, further comprising:
decrypting the binary string of the digital watermark by using a preset key to obtain a first hash value;
and when the matching between the first hash value and the hash value of the user identity information to be verified is successful, sending out the notification information that the user identity information to be verified of the target picture is verified successfully.
An embodiment of the present invention further provides a block chain-based digital watermark reading apparatus, configured to improve security of digital watermark writing and writing efficiency of digital watermark, as shown in fig. 4, where the apparatus includes:
the second data storage module 401 is configured to obtain, from the blockchain, user identity information to be verified corresponding to the target picture: a hash value and a preset key;
a second pixel point and RGB value write channel determination module 402, configured to determine, according to a preset key, a plurality of pixel points and RGB value write channels in which digital watermarks have been written in a target picture;
the binary string reading module 403 of the digital watermark is configured to sequentially read the numerical values of the plurality of pixel points corresponding to the RGB values written in the channel, so as to obtain the binary string of the digital watermark.
In one embodiment, further comprising:
a hash value matching module to:
decrypting the binary string of the digital watermark by using a preset key to obtain a first hash value;
and when the matching between the first hash value and the hash value of the user identity information to be verified is successful, sending out the notification information that the user identity information to be verified of the target picture is verified successfully.
A specific embodiment is given below to illustrate the specific application of the above-mentioned block chain-based digital watermark reading apparatus and block chain-based digital watermark writing apparatus of the present invention, in which the analysis is performed by combining two apparatuses, which may be referred to as "block chain and LSB-based digital watermark system"; referring to fig. 5, this example may include the following modules:
the third party connecting module is responsible for connecting a third party system and receiving the image files transmitted by the third party system.
In this example, the third party system may be any device that needs to read and write a digital watermark. The third-party connection module can provide an interface for connecting the third-party system, and is used for connecting the device in the embodiment with the third-party system.
II, an image processing module: the specific workflow of processing the input image and extracting or writing the LSB steganographic data can be as follows:
1. writing digital watermarks
Before the digital watermark s is written, the encryption and decryption module signs the hash value of the author information (the author refers to the target user of the device in the example) to obtain signed data s, and the digital watermark s is obtained.
(1) Separating pixel points in the image file in an RGB format, and converting color components of each channel into binary systems;
(2) and converting the signed character string s into a binary system s _ b, wherein the length of the s _ b is marked as L.
(3) A hexadecimal number which is randomly generated is used and is called as a digital watermark key, the key is stored in a block chain to serve as a preset key corresponding to the author, and when the preset key is stored, the preset key can correspond to the author and the authorship and is added with a timestamp, so that the one-to-one corresponding relation between the preset key and the author is ensured. Carrying out XOR operation on the digits of the key, and recording the result as m; carrying out the exclusive OR operation on the values of all the bits, and recording the result as n;
for example: when the value of the watermark key is '1001', m ═ 1 ^ 0 ^ 1 ^ 0, n ═ 1 ^ 0 ^ 1 ^ 0, and n ^ 1 ^ 0 ^ 1
(4) Converting the hexadecimal number on each bit of the watermark key into decimal and summing the decimal number respectively, and recording the result as r; for example: the watermark key is "7 a8 f", then r is 7+ a +8+ f is 7+10+8+15 is 40;
(5) determining an RGB value writing channel according to a preset key and the number of digits of a binary string, for example, when m is 0, writing a watermark in an R channel; when m is 1 and n is 0, writing a watermark in the G channel; when m is 1 and n is 1, writing a watermark in the B channel;
(6) determining a plurality of pixel points to be written with digital watermarks and an RGB value writing channel according to the preset key and the number of digits of the binary character string; for example, take the 1 st pixel of the picture under the determined RGB value writing channel, shift r bits backward, i.e. the r +1 th pixel of the picture, and set the last bit of the color component of the pixel and the following L bits to 0. The binary number s _ b is filled in on the color component just set to 0. The last change of the color component is extremely subtle and the change is not at all discernible to the naked eye.
2. Reading digital watermarks
And connecting a block chain to obtain a watermark key, and solving the offset and the color channel in which the watermark is written according to the watermark key.
The digital watermark information is read out according to the digital watermark key information (namely the preset key), and the public key is used for decryption to obtain the information hash value of the author, and the information hash value is compared with the record on the block chain.
It should be noted that the default key used in the step of "reading the watermark key" may be in an asymmetric relationship with the default key used in the step of "writing the digital watermark", that is, the author information is encrypted by an asymmetric encryption algorithm.
3. An encryption and decryption module: and the data of the input user identity information is encrypted or decrypted.
3.1, encryption
(1) Receiving user information u input by a third-party system, and processing author-related information according to a preset fixed format, wherein the author-related information includes author names, identification numbers, author dates and other information, and the author-related information includes:
{ username ═ zhangsan'; id ═ 110101199001011234'; date ═ 20190405'; … … }
(2) And calculating the hash values corresponding to different users according to the information to obtain the hash value plaintext p.
(3) And then, a block chain is removed to inquire a digital watermark private key d (namely the preset key), and the private key d is used for signing the user information hash value p to obtain a signed character string s.
3.2 decryption
(1) After reading out the watermark information according to the watermark key information, then removing the block chain to inquire a digital watermark public key e (the public key corresponds to the private key) and decrypting by using the public key e to obtain a plaintext;
4. block chain drive module: and the system is responsible for connecting a block chain and inquiring the related information of the author and the preset key.
The information stored by the blockchain includes: the system comprises a public key, a private key, author information, a hash value of the author information, a hash value of an author, a watermark key and a timestamp.
In practical applications, the information of the author needs to be put into a fixed format, and the hash value of the author information needs to be calculated to distinguish the unique individuals of the author. By storing the above information in a block chain in a prescribed format. When a third-party system needs to use the device, the third-party system only needs to access the device, the third-party system can transmit the digital image and the information of the author into the device, then the device inquires the exclusive hash value of the author through the deblocking chain, and writes the image by using the LSB steganography technology after the signature is carried out by using the private key of the system. When copyright dispute occurs or digital watermark needs to be extracted due to other reasons, the LSB technology is used for extracting and the public key of the device is used for decryption, and copyright ownership can be proved by contrasting the hash value of the information of the copyright holder. Therefore, the device can be used for solving the problem of copyright protection of digitized images, videos, audio-visual products and electronic documents. When copyright disputes occur, the digital watermark is extracted through a corresponding algorithm, so that the attribution of the copyright is verified, the legal benefit of a writer is ensured, and the threat of illegal piracy is avoided.
As described above, the embodiments of the present invention have the following advantages:
1. the LSB steganography technology is used for adding the author information hash value as a digital watermark, and the digital watermark is relatively hidden and is not easy to be found by people.
2. The blockchain is used to store author information, encrypt keys, and provide queries to prevent tampering.
3. And the author information is encrypted by using an asymmetric encryption algorithm to prevent tampering. Because the encrypted ciphertext is written into the LSB of the picture, a falsifier does not know the secret key, and subsequent decryption is inevitably failed if the ciphertext is falsified, so that falsification prevention is realized.
The embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the method for writing and reading a digital watermark based on a block chain is implemented.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program for executing the above block chain-based digital watermark writing and reading method is stored in the computer-readable storage medium.
In the embodiment of the present invention, the user identity information corresponding to the target picture to be written is obtained from the block chain: a hash value and a preset key; encrypting the hash value by using the preset key to obtain a digital watermark; the digital watermark is a hash value character string after encryption processing; carrying out binary conversion on the digital watermark to obtain a binary character string of the digital watermark; determining a plurality of pixel points to be written with digital watermarks and an RGB value writing channel according to the preset key and the number of digits of the binary character string; based on the LSB steganography technology, correspondingly writing the number of each digit of the binary character string into the RGB values of the plurality of pixel points to obtain a target picture written with the digital watermark; compared with the technical scheme of writing digital watermarks in the prior art based on a spatial domain watermark algorithm, the digital watermarks can be written in the RGB values of the pixel points of the picture by using an LSB steganography technology, so that the writing safety of the digital watermarks can be effectively ensured; compared with the technical scheme of writing digital watermarks based on the frequency domain watermark algorithm in the prior art, the digital watermarks are only required to be written into the RGB values of the picture pixel points, the digital watermarks can be conveniently written, and the writing efficiency of the digital watermarks is improved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (12)

1. A block chain-based digital watermark writing method is characterized by comprising the following steps:
acquiring user identity information to be written into a target picture from the block chain: a hash value and a preset key;
encrypting the hash value by using the preset key to obtain a digital watermark; the digital watermark is a hash value character string after encryption processing;
carrying out binary conversion on the digital watermark to obtain a binary character string of the digital watermark;
determining a plurality of pixel points to be written with digital watermarks and an RGB value writing channel according to the preset key and the number of digits of the binary character string;
based on the LSB steganography technology, correspondingly writing the number of each digit of the binary character string into the RGB values of the plurality of pixel points to obtain a target picture written with the digital watermark; wherein, the number on each digit corresponds to the RGB value writing channel of a pixel point.
2. The method of claim 1, further comprising:
calculating hash values of different user identity information;
randomly generating keys corresponding to different user identity information as preset keys corresponding to the user identity information;
and storing the hash values and the preset keys corresponding to different user identity information into the block chain.
3. The method of claim 1, wherein the pre-key is a hexadecimal string;
determining a plurality of pixel points to be written with digital watermarks and an RGB value writing channel according to the preset key and the number of digits of the binary character string, and the method comprises the following steps:
carrying out summation operation on the decimal conversion result of the digits on each digit of the preset key to obtain a summation operation result;
determining a plurality of pixel points to be written with digital watermarks according to the preset initial pixel point position, the summation operation result and the number of digits of the binary character string;
respectively carrying out XOR operation and XNOR operation on the numbers on each digit of the preset key converted into the binary string to obtain an XOR operation result and an XNOR operation result;
determining RGB values of the plurality of pixel points to be written into a channel according to the XOR operation result and the XNOR operation result; the RGB value writing channels comprise an R value writing channel, a G value writing channel and a B value writing channel.
4. A block chain-based digital watermark writing apparatus, comprising:
the first data acquisition module is used for acquiring the user identity information to be written into the target picture from the block chain: a hash value and a preset key;
the encryption processing module is used for carrying out encryption processing on the hash value by using the preset secret key to obtain a digital watermark; the digital watermark is a hash value character string after encryption processing;
the binary conversion module is used for carrying out binary conversion on the digital watermark to obtain a binary character string of the digital watermark;
the first pixel point and RGB value write-in channel determining module is used for determining a plurality of pixel points to be written with digital watermarks and RGB values write-in channels according to the preset key and the number of digits of the binary character string;
the digital watermark writing module is used for correspondingly writing the number of each digit of the binary character string into the RGB values of the pixel points in the writing channel based on the LSB steganography technology to obtain a target picture written with the digital watermark; wherein, the number on each digit corresponds to the RGB value writing channel of a pixel point.
5. The apparatus of claim 4, further comprising:
a blockchain storage module to:
calculating hash values of different user identity information;
randomly generating keys corresponding to different user identity information as preset keys corresponding to the user identity information;
and storing the hash values and the preset keys corresponding to different user identity information into the block chain.
6. The apparatus of claim 4, wherein the pre-key is a hexadecimal string;
the pixel point and RGB value write-in channel determination module is specifically configured to:
carrying out summation operation on the decimal conversion result of the digits on each digit of the preset key to obtain a summation operation result;
determining a plurality of pixel points to be written with digital watermarks according to the preset initial pixel point position, the summation operation result and the number of digits of the binary character string;
respectively carrying out XOR operation and XNOR operation on the numbers on each digit of the preset key converted into the binary string to obtain an XOR operation result and an XNOR operation result;
determining RGB values of the plurality of pixel points to be written into a channel according to the XOR operation result and the XNOR operation result; the RGB value writing channels comprise an R value writing channel, a G value writing channel and a B value writing channel.
7. A digital watermark reading method based on a block chain is characterized by comprising the following steps:
acquiring the identity information of the user to be verified corresponding to the target picture from the block chain: a hash value and a preset key;
determining a plurality of pixel points written with digital watermarks and RGB values writing channels in a target picture according to a preset key;
and sequentially reading the numerical values of the plurality of pixel points corresponding to the RGB values written in the channel to obtain the binary character string of the digital watermark.
8. The method of claim 7, further comprising:
decrypting the binary string of the digital watermark by using a preset key to obtain a first hash value;
and when the matching between the first hash value and the hash value of the user identity information to be verified is successful, sending out the notification information that the user identity information to be verified of the target picture is verified successfully.
9. A block chain-based digital watermark reading apparatus, comprising:
the second data storage module is used for acquiring the identity information of the user to be verified corresponding to the target picture from the block chain: a hash value and a preset key;
the second pixel point and RGB value write-in channel determining module is used for determining a plurality of pixel points and RGB value write-in channels, in which digital watermarks are written, in the target picture according to a preset secret key;
and the binary character string reading module of the digital watermark is used for sequentially reading the numerical values of the plurality of pixel points corresponding to the RGB values written in the channel to obtain the binary character string of the digital watermark.
10. The apparatus of claim 9, further comprising:
a hash value matching module to:
decrypting the binary string of the digital watermark by using a preset key to obtain a first hash value;
and when the matching between the first hash value and the hash value of the user identity information to be verified is successful, sending out the notification information that the user identity information to be verified of the target picture is verified successfully.
11. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 3 and 7 to 8 when executing the computer program.
12. A computer-readable storage medium storing a computer program for executing the method according to any one of claims 1 to 3 and 7 to 8.
CN202111341467.9A 2021-11-12 2021-11-12 Block chain-based digital watermark writing and reading method and device Pending CN114119332A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111341467.9A CN114119332A (en) 2021-11-12 2021-11-12 Block chain-based digital watermark writing and reading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111341467.9A CN114119332A (en) 2021-11-12 2021-11-12 Block chain-based digital watermark writing and reading method and device

Publications (1)

Publication Number Publication Date
CN114119332A true CN114119332A (en) 2022-03-01

Family

ID=80379244

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111341467.9A Pending CN114119332A (en) 2021-11-12 2021-11-12 Block chain-based digital watermark writing and reading method and device

Country Status (1)

Country Link
CN (1) CN114119332A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117056877A (en) * 2023-07-18 2023-11-14 深圳有方信息技术有限公司 Tamper-proof processing method, terminal equipment and storage medium for electronic document after decryption

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117056877A (en) * 2023-07-18 2023-11-14 深圳有方信息技术有限公司 Tamper-proof processing method, terminal equipment and storage medium for electronic document after decryption

Similar Documents

Publication Publication Date Title
US7146502B2 (en) Information processing apparatus and its control method, computer program, and storage medium
US8612765B2 (en) Security based on subliminal and supraliminal channels for data objects
JP4625841B2 (en) System and method for digital content security
CN110753226B (en) High-capacity ciphertext domain image reversible data hiding method
CN109803142B (en) Encrypted domain image reversible data hiding method based on neighborhood prediction
CN109348230B (en) Ciphertext domain high-capacity image reversible data hiding method
CN106709853B (en) Image retrieval method and system
CN111177666A (en) Forensic document anti-counterfeiting and anti-tampering method and system based on fragile watermark
CN113114869B (en) Ciphertext domain high-capacity image reversible data hiding method based on MSB prediction
CN114567711A (en) Large-capacity encrypted image information hiding method based on block capacity label
CN114119332A (en) Block chain-based digital watermark writing and reading method and device
CN115955308B (en) Digital asset processing method, device, equipment and medium based on quantum-resistant key
Benrhouma Cryptanalysis and improvement of a semi-fragile watermarking technique for tamper detection and recovery
CN115719300A (en) Personnel information management method for big data
Gupta et al. A new approach for information security using asymmetric encryption and watermarking technique
Vaish et al. A systematic review on various reversible data hiding techniques in digital images
Lim Data security and protection for medical images
Dadkhah et al. Efficient image authentication and tamper localization algorithm using active watermarking
Joseph et al. Publicly Verifiable Digital Watermarking Technique for Copyright Property Protection
Bhatia 8-Rooks Solutions for Image Steganography Technique.
Bouslimi et al. Encryption and Watermarking for medical Image Protection
Faluyi et al. Secured Online Transcript Issuing and Processing Using Crypto-Steganography Technique
Shinde et al. A Review Paper on Image Authentication Scheme
CN116366232A (en) Digital asset processing method, device, equipment and medium based on quantum-resistant key
Seshubhavan et al. A Novel Approach for Data Security for Cloud Data using Image Steganography and Genetic Algorithms.

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