A video watermarking method
By describing the steganographic method of video watermarks, the problems of easy cracking and detection of existing video watermarks are solved, and higher security and concealment are achieved, providing video creators with more effective copyright protection.
Patent Information
- Application Number
- CN202510312810.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-03-17
AI Technical Summary
The existing video watermarking technology is easy to be cracked and detected, resulting in infringement of the copyright of video authors and hindering the healthy dissemination of video content.
A video watermark steganography method is adopted. By obtaining the key, text information and video, pre-processing and encryption processing is performed, the Camellia algorithm or SM4 algorithm is selected to encrypt the hash key, generate the wheel key, and LSB steganography is performed on the video frame based on the wheel key and ciphertext to form a steganography video.
It significantly enhances the security and concealment of video watermarks, provides more effective copyright protection methods, and prevents video watermarks from being maliciously removed or tampered with.
Smart Images

Figure CN119815138B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data encryption, and in particular to a video watermark steganography method. Background Art
[0002] With the rapid development of digital multimedia technology, the dissemination of video content on the Internet has become more and more widespread. As a carrier of information, the copyright protection of video has become increasingly prominent. Current video watermarking technologies mostly use a single encryption algorithm or steganography, but these technologies have easy-to-break and detect defense lines. Once the video watermark is maliciously removed or tampered with, the legitimate copyright of the video author will be seriously infringed, which not only damages the interests of the creator, but also hinders the healthy dissemination of video content.
[0003] Therefore, how to provide video creators with more effective copyright protection measures is a technical problem that needs to be solved urgently. Summary of the invention
[0004] In view of the above problems, the present invention provides a video watermark steganography method that overcomes the above problems or at least partially solves the above problems.
[0005] In a first aspect, the present invention provides a video watermark steganography method, comprising:
[0006] Obtain the key, text information of the video to be embedded, and the video to be processed;
[0007] Preprocessing the key, the text information and the video to be processed respectively to obtain a hash key, an encoded text and a target video;
[0008] Get the frame number of the target video;
[0009] Based on the number of frames, select a Camellia algorithm or an SM4 algorithm to encrypt the hash key to generate a round key;
[0010] Based on the Camellia algorithm and the hash key, the encoded text is processed to generate a ciphertext;
[0011] Selecting key frames from the target video according to preset rules to form a key frame candidate set;
[0012] Selecting a target frame from a random position in the key frame candidate set, where the number of the target frames meets a preset number;
[0013] Based on the round key and the ciphertext, the target frame is LSB steganographically processed to form a steganographic frame, and the target frame at the random position is replaced to form a steganographic video.
[0014] Preferably, the key, the text information and the video to be processed are preprocessed respectively to obtain a hash key, an encoded text and a target video, including:
[0015] Performing SHA-256 hash processing and MD5 algorithm processing on the key to obtain a hash key;
[0016] Performing Basr64 encoding on the text information to obtain encoded text;
[0017] Perform frame extraction and denoising processing on the video to be processed to obtain a target video.
[0018] Preferably, the selecting a Camellia algorithm or an SM4 algorithm to encrypt the hash key based on the frame number to generate a round key includes:
[0019] Determining whether the number of frames is greater than or equal to a first preset number;
[0020] If yes, select SM4 algorithm to encrypt the hash key to generate the first round key;
[0021] If not, select the Camellia algorithm to encrypt the hash key to generate a second round key.
[0022] Preferably, selecting key frames from the target video according to preset rules to form a key frame candidate set includes:
[0023] Based on the moving objects, regions, scene change features, and visual focus features in the target video, evaluating the complexity of each frame in the target video;
[0024] Determining a key frame based on the complexity of each frame, wherein the complexity of the key frame is greater than a second preset value;
[0025] Based on the key frames, a key frame candidate set is formed.
[0026] Preferably, selecting a target frame from a random position in the key frame candidate set, wherein the number of the target frames satisfies a preset number, comprises:
[0027] When performing LSB steganography based on the Camellia algorithm, a first target frame is selected from a first random position in the key frame candidate set, where the first random position is a first preset number of key frame positions;
[0028] When performing LSB steganography based on the SM4 algorithm, a second target frame is selected from a second random position in the key frame candidate set, where the second random position is a key frame position before a first preset number and a key frame position between the first preset number and a second preset number.
[0029] Preferably, before performing LSB steganography on the target frame based on the round key and the ciphertext to form a steganographic frame, and replacing the target frame at the random position to form a steganographic video, the method includes:
[0030] Based on the random position, generate an identity verification signature;
[0031] Based on the identity verification signature identifier, a verification code is obtained through character mapping;
[0032] The ciphertexts are grouped to obtain a preset number of ciphertext groups.
[0033] Preferably, based on the round key and the ciphertext, the target frame is LSB steganographically processed to form a steganographic frame, and the target frame at the random position is replaced to form a steganographic video, including:
[0034] Using the round key as an encryption key, embedding it into the ciphertext group, so as to perform LSB steganography on the target frame to form a steganographic frame;
[0035] The steganographic frame replaces the target frame at the random position to form a steganographic video.
[0036] Preferably, after performing LSB steganography on the target frame based on the round key and the ciphertext to form a steganographic frame, and replacing the target frame at the random position to form a steganographic video, the method further includes:
[0037] Extracting the steganographic frame from the steganographic video;
[0038] The steganographic frame is verified for signature.
[0039] Preferably, extracting a steganographic frame from the steganographic video comprises:
[0040] Based on the signature verification code, reverse mapping is performed to obtain the identity verification signature identifier;
[0041] Determining the random position based on the identity verification signature;
[0042] Based on the random position, the steganographic frame is found and the steganographic frame is extracted.
[0043] Preferably, verifying the signature of the steganographic frame includes:
[0044] Based on the stego frame and the round key, LSB hidden extraction is performed to obtain a ciphertext group;
[0045] The ciphertexts of the ciphertext group are connected in the order of the random positions, and decrypted by using Camellia algorithm and base64 decoding to obtain decrypted text information;
[0046] Determining whether the decrypted text information is consistent with the text information;
[0047] If yes, the signature verification is successful.
[0048] In a second aspect, the present invention further provides a video watermark steganography device, comprising:
[0049] A first acquisition module, used to acquire a key, text information to be embedded in a video, and a video to be processed;
[0050] An obtaining module is used to pre-process the key, the text information and the video to be processed respectively to obtain a hash key, a coded text and a target video;
[0051] The second acquisition module is used to obtain the frame number of the target video;
[0052] A first generating module, configured to select a Camellia algorithm or an SM4 algorithm to encrypt the hash key based on the frame number to generate a round key;
[0053] A second generating module is used to process the encoded text based on the Camellia algorithm and the hash key to generate a ciphertext;
[0054] A forming module, used for selecting key frames from the target video according to preset rules to form a key frame candidate set;
[0055] A selection module, used for selecting a target frame from a random position in the key frame candidate set, wherein the number of the target frames meets a preset number;
[0056] The steganographic module is used to perform LSB steganography on the target frame based on the round key and the ciphertext to form a steganographic frame, and replace the target frame at the random position to form a steganographic video.
[0057] In a third aspect, the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect when executing the program.
[0058] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.
[0059] One or more technical solutions in the embodiments of the present invention have at least the following technical effects or advantages:
[0060] The present invention provides a video watermark steganography method, comprising: obtaining a key, text information to be embedded in a video and a video to be processed; preprocessing the key, text information and the video to be processed respectively to obtain a hash key, a coded file and a target video; obtaining the number of frames of the target video; based on the number of frames, selecting a Camellia algorithm or an SM4 algorithm to encrypt the hash key to generate a round key; based on the Camellia algorithm and the hash key, processing the coded text to generate a ciphertext; selecting key frames from the target video according to preset rules to form a key frame candidate set; selecting target frames from random positions in the key frame candidate set, the number of target frames meeting a preset number; based on the round key and the ciphertext, performing LSB steganography on the target frame to form a steganographic frame, and replacing the target frame at the random position to form a steganographic video. The use of such a video steganography method can provide a more effective copyright protection means for video creators. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Also, throughout the accompanying drawings, the same reference figures are used to represent the same components. In the drawings:
[0062] Figure 1 A schematic diagram showing the steps of the video watermark steganography method in an embodiment of the present invention is shown;
[0063] Figure 2 A schematic diagram of round key generation in an embodiment of the present invention is shown;
[0064] Figure 3 A schematic diagram showing the process from video frame to steganographic frame and then to signature verification in an embodiment of the present invention is shown;
[0065] Figure 4 The schematic diagram of the overall idea of the video watermark steganography method in an embodiment of the present invention is shown;
[0066] Figure 5 A schematic diagram of the structure of a video watermark steganography device in an embodiment of the present invention is shown;
[0067] Figure 6 A schematic diagram of the structure of a computer device for implementing a video watermark steganography method in an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0068] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0069] Embodiment 1
[0070] The embodiment of the present invention provides a video watermark steganography method, such as Figure 1 As shown, including:
[0071] S101, obtaining a password, text information of a video to be embedded, and a video to be processed;
[0072] S102, pre-processing the key, the text information and the video to be processed respectively to obtain a hash key, a coded text and a target video;
[0073] S103, obtaining the frame number of the target video;
[0074] S104, based on the number of frames, select the Camellia algorithm or the SM4 algorithm to encrypt the hash key and generate a round key;
[0075] S105, based on the Camellia algorithm and the hash key, the encoded text is processed to generate a ciphertext;
[0076] S106, selecting key frames from the target video according to a preset rule to form a key frame candidate set;
[0077] S107, selecting a target frame from a random position in the key frame candidate set, where the number of the target frames meets a preset number;
[0078] S108, based on the round key and the ciphertext, LSB steganography is performed on the target frame to form a steganographic frame, and the target frame at a random position is replaced to form a steganographic video.
[0079] Among them, Camellia algorithm and SM4 algorithm are both internationally recognized encryption standards with high security and reliability. Camellia algorithm is a block cipher algorithm with 128-bit block size and multiple key length options, which is widely used in various security fields. SM4 algorithm is a block cipher algorithm of national cryptographic standard, which also has excellent encryption performance. By combining the advantages of these two algorithms, it can provide dual encryption protection for video watermarks and significantly enhance the security of watermark information.
[0080] LSB steganography is a steganographic method that embeds secret information into the least significant bit of the carrier data. It has the characteristics of high concealment and little impact on the carrier data. By embedding the watermark information into the least significant bit of the video frame, the watermark information can be made more concealed and difficult to observe, thereby further improving the concealment of the video watermark.
[0081] The present invention is a video watermark steganography method based on the Camellia algorithm, the SM4 algorithm and the LSB (Least Significant Bit) steganography technology to solve the problem that the existing video watermark is easy to be cracked and detected, thereby providing video creators with a safer and more reliable copyright protection method.
[0082] Next, the overall solution is described in detail:
[0083] S101, obtaining a key, text information to be embedded in a video, and a video to be processed.
[0084] The video to be processed may be a video of any size that needs to be embedded with a watermark, denoted by V, for example, it may be a video with a duration of 10 seconds and a frame rate of 20 per second.
[0085] The key is a string of any length selected by the user, denoted by K.
[0086] The text information to be embedded in the video is the video text information selected by the user to be embedded, denoted as I. For example, it can be the personal information of the video creator, organization or enterprise logo, specific logo and code, etc., of course, it can also be a string of arbitrary length input by the user.
[0087] Next, S102 is executed to pre-process the key, the text information and the video to be processed respectively to obtain a hash key, an encoded text and a target video.
[0088] Specifically, the video V is subjected to frame extraction and denoising to obtain a clear target video. The tool for video frame extraction can be FFmpeg. Frame division is performed by command:
[0089] The command is as follows:
[0090] ffmpeg -i test.mp4 -vf "select='eq(n\,mod(n\,20))'" -vsync 0 frame_%03d.png
[0091] Taking the above 10-second video as an example, since the frame rate is 20 per second, the tool divides the video V into 20 frames, that is, 20 png images per second. In this way, the 10-second video will be divided into 200 png images.
[0092] The key K is hashed using SHA-256 and processed using the MD5 algorithm to obtain a hash key.
[0093] Specifically, the key K is first hashed using SHA-256, and the resulting value is then hashed using the MD5 algorithm to obtain a 128-bit hash value. The formula is as follows:
[0094] K_hash=MD5(SHA-256(K))
[0095] By combining SHA-256 and MD5, the complexity and security of the hash value can be increased and the possibility of MD5 value collision can be reduced. The implementation of this algorithm can borrow Python's built-in hashlib library, which will not be described in detail here.
[0096] Perform Base64 encoding on the text information I to obtain the encoded text I_Ba64. The formula is as follows:
[0097] I_Ba64=base64(I)
[0098] Next, execute S103 to obtain the frame number of the target video.
[0099] Next, in S104, based on the number of frames, the Camellia algorithm or the SM4 algorithm is selected to encrypt the hash key to generate a round key.
[0100] Specifically, determining whether the number of frames is greater than or equal to a first preset number;
[0101] If yes, select SM4 algorithm to encrypt the hash key and generate the first round key;
[0102] If not, select the Camellia algorithm to encrypt the hash key and generate the second round key.
[0103] The judgment criteria here are: if the number of frames of the target video is less than 1000, the Camellia algorithm is selected to encrypt the hash key and generate the second round of keys; if the number of frames of the target video is greater than or equal to 1000, the SM4 algorithm is selected to encrypt the hash key and generate the first round of keys.
[0104] like Figure 2 As shown, the two algorithms are introduced below:
[0105] It takes 18 rounds to encrypt the hash key using the Camellia algorithm, so the final number of round keys generated is 18, which we can record as k1, k2...k18.
[0106] The hash key is defined as KL(128)||KR(128)=K_hash||0^^128. After the Camellia algorithm, 18 round keys are obtained, each with a length of 64 bits.
[0107] The SM4 algorithm is used to encrypt the hash key through 32 rounds, so 32 round keys are finally generated, denoted as k1, k2...k32, and each key is 32 bits long.
[0108] Next, S105 is executed to process the encoded text based on the Camellia algorithm and the hash key to generate a ciphertext.
[0109] The specific formula is as follows:
[0110] C=Camellia(I_Ba64,K_hash)
[0111] Specifically, the 128-bit Camellia algorithm is used to encrypt the encoded text with the hash key to form the ciphertext C.
[0112] Next, S106 is executed to select key frames from the target video according to a preset rule to form a key frame candidate set.
[0113] Specifically, based on the moving objects, regions, scene change features, and visual focus features in the target video, the complexity of each frame in the target video is evaluated;
[0114] Determining a key frame based on the complexity of each frame, wherein the complexity of the key frame is greater than a second preset value;
[0115] Based on the key frames, a key frame candidate set is formed.
[0116] When filtering key frames, you can filter from multiple angles, including: content analysis, using motion detection algorithms to identify moving objects and distinctions in the video, and record motion information. Scene change detection, analyzing the changes in color, brightness, texture and other features between video frames, determining whether the scene has changed, and recording scene change information. Visual focus detection, identifying the visual focus in the video, such as faces, objects, etc., and recording visual focus information. Use edge detection and texture analysis to quantify the complexity of the frame and perform complexity evaluation on the frame. Finally, according to the complexity evaluation results, sort the complexity of the video frames from high to low, and record the position of the video frames.
[0117] After the key frame candidate set is obtained, S107 is executed to select a target frame from a random position in the key frame candidate set, and the number of the target frames meets the preset number.
[0118] Specifically, the selection of the target frame is related to the number of the key frames. When performing LSB steganography based on the Camellia algorithm, the first target frame is selected from the first random position in the key frame candidate set, and the first random position is the first preset number of key frame positions;
[0119] When LSB steganography is performed based on the SM4 algorithm, a second target frame is selected from a second random position in the key frame candidate set, and the second random position is a key frame position before a first preset number and a key frame position between the first preset number and the second preset number.
[0120] Here are some examples:
[0121] When performing LSB steganography based on the Camellia algorithm, 18 pictures are randomly selected from the first 1000 pictures in the key frame candidate set. If the number of frames extracted from the video is greater than 1000, other pictures after 1000 are not considered, and the positions of the selected pictures are recorded, that is, the random positions are recorded. For example, if there are 200 pictures, the corresponding positions are the 6th, 8th, 23rd, 67th, 87th, ... 127th, and 198th pictures.
[0122] When performing LSB steganography based on the SM4 algorithm, 11 pictures are randomly selected from the first 1000 pictures in the key frame candidate set. If the number of frames extracted from the video is greater than 1000, 21 pictures are randomly selected from pictures 1000 to 10000. Pictures exceeding 10000 are not considered. The positions of the selected pictures are recorded as follows. For example, among 29302 pictures, we select 11 pictures, namely, the 6th, 8th, 23rd, 67th, ... 127th, and 198th pictures in the first 1000 pictures, and select 21 pictures, namely, the 1011th, 2099th, 3097th ... 8971st pictures, from pictures 1000 to 10000.
[0123] Next, before performing LSB steganography, you need to generate a signature verification code and ciphertext group.
[0124] Specifically, an identity verification signature identifier is generated based on a random position; a verification code is obtained through character mapping based on the identity verification signature identifier; and ciphertexts are grouped to obtain a preset number of ciphertext groups.
[0125] Take the above example of selecting a target frame at a random position. When performing LSB steganography based on the Camellia algorithm, the signature code generation strategy is as follows:
[0126] If the length of the random position is less than 3, add 0 in front. The numbers after adding 0 are: 006, 008, 023, 067, 087...127, 198, a total of 18. They are naturally connected as the identity verification mark to obtain a fixed-length digital string: 006008023067087...127198, with a length of 54. Then the digital string is grouped, with two numbers in a group, and a string mapping table is involved, which contains character mappings from 00 to 99. For example, the character corresponding to 00 is a, 60 is K, 08 is 6, 02 is m... The digital string is replaced according to the character mapping table to obtain ak6m..., a string of length 27, recorded as DK1, which is the verification code.
[0127] When performing LSB steganography based on the SM4 algorithm, the signature verification code generation strategy is as follows:
[0128] If the length of the random position is less than 3, add 0 in front. The numbers after adding 0 are: 006, 008, 023, 067, 087…127, 198, a total of 11, and get 006008023067087…127198, a number string of 33 in length, recorded as Si1. In the 1000th to 10000th pictures, connect the numbers, and dei to 101120993097…8971, a number string of 84 in length, recorded as Si2. We record Si3=Si1+1+Si2, and get a number string of 118 in length. Group the number string, and each two numbers are a group. According to the grandfather mapping table, we get a string of 59 in length, which we record as DK2, which is the signature verification code.
[0129] Next, we will group the ciphertexts and introduce the Camellia algorithm and SM4 algorithm respectively.
[0130] Before steganography based on the Camellia algorithm, the ciphertext C is grouped. First, check whether the result of length(C)%18 is 0. If it is 0, the number of groups = length(C). If it is not 0, the number of groups = length(C) / / 18+1. / / is divisible. If the number of groups divided is less than 18, the character "_" is filled as the content of the group according to the number of missing groups. The number of characters filled in each group is the same as the non-filled group until the number of groups is filled to 18, which are recorded as c1, c2...c18.
[0131] Before steganography based on the SM4 algorithm, the ciphertext C is grouped. First, check whether the result of length(C)%32 is 0. If it is 0, the number of groups = length(C); if it is not 0, the number of groups = length(C) / / 32+1. If the number of groups is less than 32, the character "_" is added as the content of the group according to the missing number of groups. The characters filled in each group are the same as those of the non-filled group until the number of groups is filled to 32, which are recorded as c1, c2...c32.
[0132] Next, S108 is executed to perform LSB steganography on the target frame based on the round key and the ciphertext to form a steganographic frame, and replace the target frame at a random position to form a steganographic video.
[0133] Specifically, the round key is used as an encryption key and embedded in a ciphertext group to perform LSB steganography on a target frame to form a steganographic frame; the steganographic frame replaces a target frame at a random position to form a steganographic video.
[0134] For the two algorithms, the corresponding steganographic frames are different:
[0135] The round key based on the Camellia algorithm is embedded in the ciphertext group as the encryption key. The formula is as follows:
[0136] Newpng1=LSB(c18,k18,png).
[0137] After 18 cycles of processing, 18 new pictures with watermarks are obtained. Then, these 18 pictures replace the original pictures according to their original positions, that is, replace the target frames at random positions, and then synthesize the pictures and the original video sound and other information into a processed watermarked video.
[0138] The round key based on the SM4 algorithm is embedded in the ciphertext group as the encryption key. The formula is as follows:
[0139] Newpng2=LSB(c32,k32,png)
[0140] After 32 cycles of processing, 32 new pictures with watermarks are obtained. These 32 new pictures are selected to replace the original pictures according to their original positions, that is, to replace the target frames at random positions, and then the pictures and the original video sound and other information are synthesized into a processed watermarked video.
[0141] Any of the above LSB steganography methods is embedded in the least significant bit of the image, that is, to evaluate how much watermark information the LSB can accommodate without affecting the image quality. According to the different areas and features of the image, the strength and method of LSB embedding are adaptively adjusted. A stronger LSB embedding strength can be used in areas with rich textures, while a weaker embedding strength or a different embedding method can be used in smooth or significant areas.
[0142] The above process completes the steganographic operation of the video watermark. In order to prove the copyright identity of the creator, the steganographic frame needs to be signed, such as Figure 3 shown.
[0143] That is, after S108, the process further includes: extracting a steganographic frame from the steganographic video; and verifying the signature of the steganographic frame.
[0144] The process of extracting steganographic frames:
[0145] Based on the signature verification code, reverse mapping is performed to obtain the identity verification identifier;
[0146] Based on the identity verification signature, determine the random location;
[0147] Based on the random position, the stego frame is found and the stego frame is extracted.
[0148] Finally, the signature of the steganographic frame is verified, including:
[0149] Based on the stego frame and the round key, LSB hidden extraction is performed to obtain the ciphertext group;
[0150] The ciphertexts of the ciphertext group are connected in the order of random positions, and the Camellia algorithm is used to decrypt and base64 decode to obtain the decrypted text information;
[0151] Determine whether the decrypted text information is consistent with the text information;
[0152] If yes, the signature verification is successful.
[0153] Of course, if they are inconsistent, the signature verification fails. If the signature verification succeeds, it can prove the copyright ownership of the steganographic video.
[0154] The following is a detailed description of the process of extracting the steganographic frame and verifying the signature.
[0155] If the Camellia algorithm is used for signature verification, the string DK1 (verification code) is replaced according to the character mapping table to obtain numbers, and then the position of the steganographic image is obtained in groups of three numbers, that is, the random position, and a total of 18 images are obtained.
[0156] If the SM4 algorithm is used for signature verification, the string DK2 (signature verification code) is replaced according to the character mapping table, the 34th digit, i.e. 1, is removed, the first 33 digits are grouped into groups of three to obtain the positions of the first 11 steganographic images, and the last 84 digits are grouped into groups of four to obtain the positions of the last 21 steganographic images.
[0157] Next, the key K is processed by SHA and MD5 algorithms to obtain K_hash=MD5(SHA-256(K)), and then K_hash is processed by Camellia algorithm and SM4 algorithm respectively to obtain 18 round keys and 32 round keys. Then the round keys are used to perform LSB hidden extraction according to the corresponding image positions to obtain the grouped ciphertext C. All ciphertexts are connected in the order of image positions, and the padding character "_" is removed. Then the Camellia algorithm is used for decryption and base decoding to obtain the information hidden in the image. In this way, it is determined whether the information is consistent with the previously prepared text information. If it is consistent, the signature verification is successful.
[0158] like Figure 4 It is a schematic diagram of the overall idea in the embodiment of the present invention.
[0159] One or more technical solutions in the embodiments of the present invention have at least the following technical effects or advantages:
[0160] The present invention provides a video watermark steganography method, comprising: obtaining a key, text information to be embedded in a video and a video to be processed; preprocessing the key, text information and the video to be processed respectively to obtain a hash key, a coded file and a target video; obtaining the number of frames of the target video; based on the number of frames, selecting a Camellia algorithm or an SM4 algorithm to encrypt the hash key to generate a round key; based on the Camellia algorithm and the hash key, processing the coded text to generate a ciphertext; selecting key frames from the target video according to preset rules to form a key frame candidate set; selecting target frames from random positions in the key frame candidate set, the number of target frames meeting a preset number; based on the round key and the ciphertext, performing LSB steganography on the target frame to form a steganographic frame, and replacing the target frame at the random position to form a steganographic video. The use of such a video steganography method can provide a more effective copyright protection means for video creators.
[0161] Embodiment 2
[0162] Based on the same inventive concept, the embodiment of the present invention also provides a video watermark steganography device, such as Figure 5 As shown, including:
[0163] A first acquisition module 501 is used to acquire a key, text information to be embedded in a video, and a video to be processed;
[0164] The obtaining module 502 is used to pre-process the key, the text information and the video to be processed respectively to obtain a hash key, a coded text and a target video;
[0165] The second acquisition module 503 is used to acquire the frame number of the target video;
[0166] A first generating module 504 is used to select a Camellia algorithm or an SM4 algorithm to encrypt the hash key based on the frame number to generate a round key;
[0167] A second generating module 505 is used to process the encoded text based on the Camellia algorithm and the hash key to generate a ciphertext;
[0168] A forming module 506, configured to select key frames from the target video according to a preset rule to form a key frame candidate set;
[0169] A selection module 507 is used to select a target frame from a random position in the key frame candidate set, and the number of the target frames meets a preset number;
[0170] The steganographic module 508 is used to perform LSB steganography on the target frame based on the round key and the ciphertext to form a steganographic frame, and replace the target frame at the random position to form a steganographic video.
[0171] In an optional implementation, a module 502 is obtained for:
[0172] Performing SHA-256 hash processing and MD5 algorithm processing on the key to obtain a hash key;
[0173] Performing Basr64 encoding on the text information to obtain encoded text;
[0174] Perform frame extraction and denoising processing on the video to be processed to obtain a target video.
[0175] In an optional implementation, the first generating module 504 is configured to:
[0176] Determining whether the number of frames is greater than or equal to a first preset number;
[0177] If yes, select SM4 algorithm to encrypt the hash key to generate the first round key;
[0178] If not, select the Camellia algorithm to encrypt the hash key to generate a second round key.
[0179] In an optional embodiment, a module 506 is formed for:
[0180] Based on the moving objects and regions, scene change characteristics, and visual focus characteristics in the target video, evaluating the complexity of each frame in the target video;
[0181] Determining a key frame based on the complexity of each frame, wherein the complexity of the key frame is greater than a second preset value;
[0182] Based on the key frames, a key frame candidate set is formed.
[0183] In an optional implementation, the selection module 507 is used to:
[0184] When performing LSB steganography based on the Camellia algorithm, a first target frame is selected from a first random position in the key frame candidate set, where the first random position is a first preset number of key frame positions;
[0185] When performing LSB steganography based on the SM4 algorithm, a second target frame is selected from a second random position in the key frame candidate set, where the second random position is a key frame position before a first preset number and a key frame position between the first preset number and a second preset number.
[0186] In an optional implementation, the system further includes: a signature verification code generation module, configured to:
[0187] Based on the random position, generate an identity verification signature;
[0188] Based on the identity verification signature identifier, a verification code is obtained through character mapping;
[0189] The ciphertext grouping module is used to group the ciphertext to obtain a preset number of ciphertext groups.
[0190] In an optional implementation, the steganography module 508 is used to:
[0191] Using the round key as an encryption key, embedding it into the ciphertext group, so as to perform LSB steganography on the target frame to form a steganographic frame;
[0192] The steganographic frame replaces the target frame at the random position to form a steganographic video.
[0193] In an optional implementation, the method further includes: a signature verification module, configured to:
[0194] Extracting the steganographic frame from the steganographic video;
[0195] The steganographic frame is verified for signature.
[0196] In an optional implementation, the signature verification module is further used to:
[0197] Based on the signature verification code, reverse mapping is performed to obtain the identity verification signature identifier;
[0198] Determining the random position based on the identity verification signature;
[0199] Based on the random position, the steganographic frame is found and the steganographic frame is extracted.
[0200] In an optional implementation, the signature verification module is further used to:
[0201] Based on the stego frame and the round key, LSB hidden extraction is performed to obtain a ciphertext group;
[0202] The ciphertexts of the ciphertext group are connected in the order of the random positions, and decrypted by using Camellia algorithm and base64 decoding to obtain decrypted text information;
[0203] Determining whether the decrypted text information is consistent with the text information;
[0204] If yes, the signature verification is successful.
[0205] Embodiment 3
[0206] Based on the same inventive concept, an embodiment of the present invention provides a computer device, such as Figure 6 As shown, it includes a memory 604, a processor 602, and a computer program stored in the memory 604 and executable on the processor 602. When the processor 602 executes the program, the steps of the above-mentioned video watermark steganography method are implemented.
[0207] Among them, Figure 6 In the embodiment of the present invention, a bus architecture (represented by bus 600) is shown, and bus 600 may include any number of interconnected buses and bridges, and bus 600 links various circuits including one or more processors represented by processor 602 and memory represented by memory 604. Bus 600 may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. Bus interface 606 provides an interface between bus 600 and receiver 601 and transmitter 603. Receiver 601 and transmitter 603 may be the same element, i.e., a transceiver, providing a unit for communicating with various other devices on a transmission medium. Processor 602 is responsible for managing bus 600 and general processing, while memory 604 may be used to store data used by processor 602 when performing operations.
[0208] Embodiment 4
[0209] Based on the same inventive concept, an embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the above-mentioned video watermark steganography method are implemented.
[0210] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific languages is for disclosing the best mode of the present invention.
[0211] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0212] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than the features explicitly recorded in each embodiment. More specifically, as reflected in each embodiment, the inventive aspects lie in less than all the features of the single embodiment disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
[0213] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and further may be divided into a plurality of submodules or subunits or subcomponents. All features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device so disclosed may be combined in any combination, except that at least some of such features and / or processes or units are mutually exclusive. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature that provides the same, equivalent or similar purpose.
[0214] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in a specific embodiment, any one of the claimed embodiments may be used in any combination.
[0215] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all functions of some or all components of a video watermark steganography device or a computer device according to an embodiment of the present invention. The present invention may also be implemented as a device or device program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program for implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0216] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.
Claims
1. A video watermark steganography method, characterized in that: include: Obtain the key, text information of the video to be embedded, and the video to be processed; Preprocessing the key, the text information and the video to be processed respectively to obtain a hash key, an encoded text and a target video; Get the frame number of the target video; Based on the number of frames, select a Camellia algorithm or an SM4 algorithm to encrypt the hash key to generate a round key; Based on the Camellia algorithm and the hash key, the encoded text is processed to generate a ciphertext; Selecting key frames from the target video according to preset rules to form a key frame candidate set; Selecting a target frame from a random position in the key frame candidate set, where the number of the target frames meets a preset number; Based on the round key and the ciphertext, the target frame is LSB steganographically processed to form a steganographic frame, and the target frame at the random position is replaced to form a steganographic video.
2. The method according to claim 1, characterized in that The key, the text information and the video to be processed are preprocessed respectively to obtain a hash key, an encoded text and a target video, including: Performing SHA-256 hash processing and MD5 algorithm processing on the key to obtain a hash key; Performing Basr64 encoding on the text information to obtain encoded text; Perform frame extraction and denoising processing on the video to be processed to obtain a target video.
3. The method according to claim 1, characterized in that The step of selecting a Camellia algorithm or an SM4 algorithm to encrypt the hash key based on the number of frames to generate a round key includes: Determining whether the number of frames is greater than or equal to a first preset number; If yes, select SM4 algorithm to encrypt the hash key to generate the first round key; If not, select the Camellia algorithm to encrypt the hash key to generate a second round key.
4. The method according to claim 1, characterized in that Selecting key frames from the target video according to a preset rule to form a key frame candidate set includes: Based on the moving objects, regions, scene change features, and visual focus features in the target video, evaluating the complexity of each frame in the target video; Determining a key frame based on the complexity of each frame, wherein the complexity of the key frame is greater than a second preset value; Based on the key frames, a key frame candidate set is formed.
5. The method according to claim 1, characterized in that Selecting a target frame from a random position in the key frame candidate set, where the number of the target frames meets a preset number, includes: When performing LSB steganography based on the Camellia algorithm, a first target frame is selected from a first random position in the key frame candidate set, where the first random position is a first preset number of key frame positions; When performing LSB steganography based on the SM4 algorithm, a second target frame is selected from a second random position in the key frame candidate set, where the second random position is a key frame position before a first preset number and a key frame position between the first preset number and a second preset number.
6. The method according to claim 1, characterized in that Before performing LSB steganography on the target frame based on the round key and the ciphertext to form a steganographic frame and replacing the target frame at the random position to form a steganographic video, the method includes: Based on the random position, generate an identity verification signature; Based on the identity verification signature identifier, a verification code is obtained through character mapping; The ciphertexts are grouped to obtain a preset number of ciphertext groups.
7. The method according to claim 6, characterized in that Based on the round key and the ciphertext, the target frame is LSB-steganographically written to form a steganographic frame, and the target frame at the random position is replaced to form a steganographic video, including: Using the round key as an encryption key, embedding it into the ciphertext group, so as to perform LSB steganography on the target frame to form a steganographic frame; The steganographic frame replaces the target frame at the random position to form a steganographic video.
8. The method according to claim 6, characterized in that After performing LSB steganography on the target frame based on the round key and the ciphertext to form a steganographic frame, and replacing the target frame at the random position to form a steganographic video, the method further includes: Extracting the steganographic frame from the steganographic video; The steganographic frame is verified for signature.
9. The method according to claim 8, characterized in that Extracting a steganographic frame from the steganographic video includes: Based on the signature verification code, reverse mapping is performed to obtain the identity verification signature identifier; Determining the random position based on the identity verification signature; Based on the random position, the steganographic frame is found and the steganographic frame is extracted.
10. The method according to claim 9, characterized in that Verifying the signature of the steganographic frame includes: Based on the stego frame and the round key, LSB hidden extraction is performed to obtain a ciphertext group; The ciphertexts of the ciphertext group are connected in the order of the random positions, and decrypted by using Camellia algorithm and base64 decoding to obtain decrypted text information; Determining whether the decrypted text information is consistent with the text information; If yes, the signature verification is successful.
Citation Information
Patent Citations
Digital image steganography method based on best key searching
CN107169913A
Improved LSB (Least Significant Bit) image steganography method combining cryptology
CN109547663A