Method, device, equipment and medium for encrypted transmission of video data
By dividing the video data into data blocks and index files, and only encrypted files to be encrypted, the problem of low -decryption and decryption efficiency of large data volume video data is solved, and efficient and secure video data transmission is achieved.
Patent Information
- Application Number
- CN202411195509.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-08-29
AI Technical Summary
In the prior art, the encryption and decryption efficiency of video data for large data volumes is low, which affects system performance.
By setting up the blocking method of video data, the original video data is divided into multiple data blocks and index files, and only encrypted files are encrypted during the data transmission process, and the original video data with huge amount of data transmission data is used.
It improves the efficiency of large data volume data transmission, while ensuring the security of transmission, and avoiding the impact on the performance of the Unity engine or VR device.
Smart Images

Figure CN118740517B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data encryption, and in particular to an encryption transmission method, device, equipment and medium suitable for video data. Background Art
[0002] With the popularity and development of virtual reality (VR) technology, VR video content has become an important part of digital content. These videos not only contain the wisdom and labor of the creators, but also often have extremely high commercial value. Therefore, protecting these video contents from infringement has become a vital task. Encryption technology, as an effective means of protection, can provide a layer of security for VR videos, protect video content from unauthorized copying, distribution or abuse, and protect user privacy and data security.
[0003] Specifically, the necessity of VR video encryption is reflected in the following aspects:
[0004] Prevent content theft: Unencrypted VR videos can be easily illegally copied, disseminated, or even used for unauthorized commercial purposes, which not only infringes the copyright of the original creator but also damages their economic interests. Encryption technology can effectively prevent such unauthorized copying and distribution.
[0005] Protect user privacy: In areas such as online education, teaching videos are core resources that contain students' personal information and learning data. Encryption technology can ensure the security of this information during transmission and storage, protecting user privacy.
[0006] Improve data security: Encryption is not only applicable to VR videos, but also to various forms of media content, including pictures, audio, etc. Through encryption and decryption technology, the security of data during transmission and storage can be ensured to prevent malicious attacks or unauthorized access.
[0007] In summary, VR video data encryption is not only necessary to protect the rights of creators, but also an important means to maintain data security and user privacy. By adopting appropriate encryption schemes and technologies, the security of VR video content can be effectively improved to ensure its legal use and dissemination.
[0008] Existing encryption methods often require data encryption before the system runs, which may increase the startup time, and the encryption and decryption of large amounts of video data will affect the performance of the Unity engine or VR devices. Summary of the invention
[0009] In view of this, an embodiment of the present invention provides an encryption transmission method applicable to video data to solve the technical problem of low efficiency in encryption and decryption of large amounts of video data in the prior art. The method comprises:
[0010] Setting a block division method for the original video data, dividing the original video data into multiple data blocks and index files corresponding to the data blocks according to the block division method, and packaging the block division method and the index files into the file to be encrypted;
[0011] An encrypted communication channel based on a secure transport layer protocol is established between a data sending end and a data receiving end. The data sending end encrypts the file to be encrypted to generate encrypted data, transmits the encrypted data to the data receiving end through the encrypted communication channel, and decrypts the encrypted data at the data receiving end to generate a decrypted file.
[0012] Generate a first verification hash value for the encrypted file using a cryptographic hash function, transmit the first verification hash value to a data receiving end through an encrypted communication channel, and verify the integrity of the decrypted file using the first verification hash value;
[0013] If the decrypted file is complete, the multiple data blocks are transmitted from the data sending end to the data receiving end through the data transmission channel, and the multiple data blocks are restored to the original video data according to the block division method and index file in the decrypted file.
[0014] The embodiment of the present invention also provides an encryption device suitable for video data to solve the technical problem of low efficiency in encryption and decryption of large amounts of video data in the prior art. The device includes:
[0015] The data segmentation module is used to set the segmentation mode of the original video data, segment the original video data into multiple data blocks and index files corresponding to the data blocks according to the segmentation mode, and package the segmentation mode and index files into the file to be encrypted;
[0016] The encryption and decryption module is used to establish an encrypted communication channel based on the secure transport layer protocol between the data sending end and the data receiving end, encrypt the encrypted file at the data sending end to generate encrypted data, transmit the encrypted data to the data receiving end through the encrypted communication channel, and decrypt the encrypted data at the data receiving end to generate a decrypted file;
[0017] A data verification module, used to generate a first verification hash value for the encrypted file using a cryptographic hash function, transmit the first verification hash value to a data receiving end through an encrypted communication channel, and verify the integrity of the decrypted file through the first verification hash value;
[0018] The data restoration module is used to transmit multiple data blocks from the data sending end to the data receiving end through the data transmission channel if the decrypted file is complete, and restore the multiple data blocks to the original video data according to the block division method and index file in the decrypted file.
[0019] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-mentioned encryption and transmission methods applicable to video data when executing the computer program, so as to solve the technical problem of low efficiency in encryption and decryption of video data with large amounts of data in the prior art.
[0020] An embodiment of the present invention also provides a computer-readable storage medium storing a computer program for executing any of the above-mentioned encryption and transmission methods applicable to video data, so as to solve the technical problem of low efficiency in encryption and decryption of large amounts of video data in the prior art.
[0021] Compared with the prior art, the at least one technical solution adopted in the embodiments of this specification can achieve the following beneficial effects:
[0022] Only the files to be encrypted are encrypted (since they only contain block mode and index files, the file size is very small), and other ordinary transmission channels that do not require encryption and have fast transmission are used to transmit huge amounts of original video data, which improves the efficiency of large-scale data transmission and ensures the security of transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 is a flow chart of a method for encrypting and transmitting video data provided by an embodiment of the present invention;
[0025] Figure 2 is a flow chart of encrypting a file to be encrypted provided by an embodiment of the present invention;
[0026] Figure 3 is a structural block diagram of a computer device provided by an embodiment of the present invention;
[0027] Figure 4 It is a structural block diagram of a device for encrypting and transmitting video data provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0028] The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0029] The following describes the implementation methods of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that, in the absence of conflict, the following embodiments and the features in the embodiments can be combined with each other. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work belong to the scope of protection of the present application.
[0030] In an embodiment of the present invention, a method for encrypting and transmitting video data is provided. Figure 1 As shown, the method includes:
[0031] Step S101: setting a block division method for the original video data, dividing the original video data into a plurality of data blocks and index files corresponding to the data blocks according to the block division method, and packaging the block division method and the index files into a file to be encrypted;
[0032] Step S102: establishing an encrypted communication channel based on a secure transport layer protocol between the data sending end and the data receiving end, encrypting the file to be encrypted at the data sending end to generate encrypted data, transmitting the encrypted data to the data receiving end through the encrypted communication channel, and decrypting the encrypted data at the data receiving end to generate a decrypted file;
[0033] Step S103: Generate a first verification hash value for the file to be encrypted using a cryptographic hash function, transmit the first verification hash value to a data receiving end through an encrypted communication channel, and verify the integrity of the decrypted file using the first verification hash value;
[0034] Step S104: If the decrypted file is complete, the multiple data blocks are transmitted from the data sending end to the data receiving end through the data transmission channel, and the multiple data blocks are restored to the original video data according to the block division method and index file in the decrypted file.
[0035] In the specific implementation, in order to combine the advantages of symmetric encryption algorithms and asymmetric encryption algorithms, improve the security of the entire encryption system, and solve the problem that the number of keys generated by the two encryption algorithms is different, the following steps are performed to encrypt the file to be encrypted at the data sending end to generate encrypted data, transmit the encrypted data to the data receiving end through an encrypted communication channel, and decrypt the encrypted data at the data receiving end to generate a decrypted file:
[0036] A first key pair is generated at a data receiving end, and a first public key in the first key pair is transmitted to a data sending end through an encrypted communication channel; a second key is generated at the data sending end, and the second key is encrypted using the first public key to generate an encrypted second key, and the encrypted second key is transmitted to the data receiving end through an encrypted communication channel; after receiving the encrypted second key at the data receiving end, the encrypted second key is decrypted using the first private key in the first key pair to generate a decrypted second key; the second key is used to encrypt a file to be encrypted at the data sending end to generate an encrypted file ciphertext; the encrypted file ciphertext is transmitted to the data receiving end through an encrypted communication channel, and the encrypted file ciphertext is decrypted using the decrypted second key to generate a decrypted file.
[0037] In specific implementation, in order to quickly encrypt the file to be encrypted by using a symmetric encryption algorithm, the following steps are performed to encrypt the file to be encrypted by using the second key at the data sending end to generate the encrypted file ciphertext:
[0038] A second key of a specified length is randomly generated, where the specified length is 128 bits, 192 bits or 256 bits; an encryption mode is selected, and a random initialization vector is generated according to the encryption mode; the file to be encrypted is divided into file blocks of a specified length, and if the size of the last file block is less than the specified length, the last file block is supplemented until the specified length is met; the file to be encrypted is encrypted by the second key to generate an encrypted file ciphertext, and the initialization vector is attached to the beginning of the encrypted file ciphertext.
[0039] Specifically, Figure 2 As shown in the figure, regarding the process of encrypting the files to be encrypted, we enhance the security of AES (symmetric encryption algorithm) by introducing other algorithm protocols. AES (symmetric encryption algorithm) and RSA (asymmetric encryption algorithm) are used together for encryption to achieve hybrid encryption. RSA (asymmetric encryption algorithm) can be used to generate and distribute AES (symmetric encryption algorithm) keys, and AES (symmetric encryption algorithm) can be used to encrypt actual data (i.e., files to be encrypted). The hybrid encryption method can combine the advantages of RSA (asymmetric encryption algorithm) and AES (symmetric encryption algorithm) to improve the security of the entire encryption system, but because the number of keys generated by the two algorithms is different, the two encryption methods cannot be simply integrated.
[0040] The receiver generates an RSA (asymmetric encryption algorithm) key pair (including RSA public key and RSA private key), passes the RSA public key to the sender (authentication is required for the receiver to establish a connection with the sender, for example, the SSL / TLS protocol can ensure the security and integrity of the RSA public key), and then uses the RSA public key to encrypt the AES (symmetric encryption algorithm) key. The encrypted result is passed to the receiver. The receiver uses the RSA private key to decrypt and obtain the decrypted AES (symmetric encryption algorithm) key. Finally, the decrypted AES (symmetric encryption algorithm) key is used to decrypt the ciphertext and generate plaintext, thereby achieving the purpose of secure data exchange.
[0041] Specifically, a secure key management system is also needed to generate, store, manage and destroy keys, and ensure the security of keys to prevent unauthorized access and disclosure.
[0042] In the specific implementation, in order to further improve the security of the original video data, the key frames in the original video data are extracted through the following steps, and the key frames are packaged into the file to be encrypted: after the original video data is divided into blocks, the key frames in each data block are extracted from the data blocks respectively, and the key frame data and the data blocks after the key frames are extracted are generated, wherein the key frame data includes the key frames, the order of the key frames and the timestamps of the key frames; the key frame data is packaged into the file to be encrypted, and the encrypted data is decrypted at the data receiving end to generate a decrypted file containing the key frame data; after the multiple data blocks after the key frames are extracted are transmitted from the data sending end to the data receiving end, the multiple data blocks after the key frames are extracted are restored to multiple data blocks through the key frame data.
[0043] Specifically, video key frame is a term in video compression and encoding, which refers to the frames used for reference in the video sequence. Other frames (such as P frames and B frames) can rely on these key frames for prediction and encoding. Key frames play an important role in video encoding, transmission, and storage. Encrypting only key frames can avoid encryption of the entire video data and greatly save the size of the data transmitted by encryption and encryption channels. Key frames can be used for copyright protection of original video data. By extracting key frames and encrypting them, it is used to prevent the copying or theft of video content.
[0044] In the specific implementation, in order to confirm the integrity of the decrypted file, ensure the correctness of the encryption, and avoid errors in transmission, the integrity of the decrypted file is verified by the first verification hash value through the following steps:
[0045] After obtaining the decrypted file, obtain the parameters of the cryptographic hash function used to generate the first verification hash value, and generate a second verification hash value for the decrypted file through the parameters, wherein the parameters include the output length of the hash value; compare the second verification hash value with the first verification hash value, if the two are the same, the integrity verification succeeds, if the two are different, the integrity verification fails.
[0046] Specifically, a hash verification algorithm is used to verify the integrity and authenticity of the decrypted file.
[0047] In a specific implementation, in order to divide the original video data into data blocks according to the specific situation of the original video data, the following steps are performed to implement the block division of the original video data, including any of the following block division methods:
[0048] The original video data is divided into a plurality of data blocks at a fixed time interval; the original video data is divided into a plurality of data blocks of a fixed size according to a fixed number of frames; the original video data is divided into different data blocks by using scene detection technology when a scene in the original video data changes significantly; key frames in the video encoding of the original video data are obtained, and the original video data is divided into different data blocks at each key frame; if the original video data contains relevant metadata and / or timestamp information, the metadata and / or timestamp information is used to divide the original video data into different data blocks.
[0049] Specifically, convolutional neural networks or recurrent neural networks can also be used to automatically learn segmentation features. Each method has its applicable scenarios and advantages and disadvantages. Time-based segmentation is simple and easy, but may not capture the actual changes in video content; content-based segmentation can better understand video semantics, but the algorithm complexity is high. Choosing a suitable segmentation method usually depends on the specific application requirements and available computing resources. The corresponding block division method can be selected according to the specific situation of the original video data in the embodiment of the present invention.
[0050] In specific implementation, in order to enhance the security of data transmission, the following steps are performed to close the communication channel for data transmission after encryption and decryption are completed:
[0051] After each encryption and decryption step is completed, the encrypted communication channel is closed. If a new round of encryption and decryption operations is required, the encrypted communication channel is rebuilt.
[0052] The encryption transmission method of the embodiment of the present invention is suitable for encrypting video data of VR devices. In particular, when multiple people need to synchronize VR scenes, the huge amount of video data, using a conventional encryption algorithm, usually requires a huge amount of calculation and cannot provide a good user experience. The encryption transmission method of the embodiment of the present invention can encrypt sensitive data in real time when the VR scene is running, without affecting the performance of the VR device.
[0053] The encryption transmission method of the embodiment of the present invention can also be applied to the encryption of the Unity project. In computer game development, data security is an important issue. Especially for game engines such as Unity, developers need to protect game resources and user data to prevent unauthorized access and tampering. Existing encryption methods often need to encrypt data before the game is run, which may increase the startup time of the game and have an impact on the game performance. The encryption transmission method of the embodiment is integrated into the Unity engine, so that encryption and decryption operations are automatically performed when the game is running (encrypting sensitive data in real time when the game is running), without affecting the game performance.
[0054] In this embodiment, a computer device is provided, such as Figure 3 As shown, it includes a memory 301, a processor 302, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, any of the above-mentioned encryption transmission methods applicable to video data is implemented.
[0055] Specifically, the computer device may be a computer terminal, a server or a similar computing device.
[0056] In this embodiment, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program for executing any of the above-mentioned encryption transmission methods applicable to video data.
[0057] Specifically, computer-readable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, modules of programs or other data. Examples of computer-readable storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable storage media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0058] Based on the same inventive concept, an encryption transmission device suitable for video data is also provided in an embodiment of the present invention, as described in the following embodiments. Since the principle of solving the problem by the encryption transmission device suitable for video data is similar to that of the encryption transmission method suitable for video data, the implementation of the encryption transmission device suitable for video data can refer to the implementation of the encryption transmission method suitable for video data, and the repeated parts will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0059] Figure 4 is a structural block diagram of a device for encrypting and transmitting video data according to an embodiment of the present invention. Figure 4 As shown, it includes: a data segmentation module 401, an encryption and decryption module 402, a data verification module 403 and a data restoration module 404. The structure is described below.
[0060] The data segmentation module 401 is used to set the segmentation mode of the original video data, segment the original video data into a plurality of data blocks and index files corresponding to the data blocks according to the segmentation mode, and package the segmentation mode and the index files into the file to be encrypted;
[0061] The encryption and decryption module 402 is used to establish an encrypted communication channel based on the secure transport layer protocol between the data sending end and the data receiving end, encrypt the file to be encrypted at the data sending end to generate encrypted data, transmit the encrypted data to the data receiving end through the encrypted communication channel, and decrypt the encrypted data at the data receiving end to generate a decrypted file;
[0062] The data verification module 403 is used to generate a first verification hash value for the encrypted file using a cryptographic hash function, transmit the first verification hash value to the data receiving end through an encrypted communication channel, and verify the integrity of the decrypted file through the first verification hash value;
[0063] The data restoration module 404 is used to transmit multiple data blocks from the data sending end to the data receiving end through the data transmission channel if the decrypted file is complete, and restore the multiple data blocks to the original video data according to the block division method and index file in the decrypted file.
[0064] In one embodiment, the data segmentation module includes:
[0065] A time interval segmentation unit is used to segment the original video data into multiple data blocks according to fixed time intervals;
[0066] A fixed-size segmentation unit is used to segment the original video data into multiple data blocks of fixed sizes according to the number of frames of fixed sizes;
[0067] A scene change segmentation unit is used to segment the original video data into different data blocks by using scene detection technology when a scene in the original video data changes significantly;
[0068] According to the key frame segmentation unit, a key frame in the video encoding of the original video data is obtained, and the original video data is segmented into different data blocks at each key frame;
[0069] The timestamp segmentation unit is used to segment the original video data into different data blocks by using the metadata and / or timestamp information if the original video data contains relevant metadata and / or timestamp information.
[0070] In one embodiment, the encryption and decryption module includes:
[0071] A public key transmission unit, used to generate a first key pair at the data receiving end, and transmit a first public key in the first key pair to the data sending end through an encrypted communication channel;
[0072] A second key generation unit is used to generate a second key at the data sending end, encrypt the second key using the first public key to generate an encrypted second key, and transmit the encrypted second key to the data receiving end through an encrypted communication channel;
[0073] A second key decryption unit is used to decrypt the encrypted second key by using the first private key in the first key pair after receiving the encrypted second key at the data receiving end, so as to generate a decrypted second key;
[0074] A file encryption unit, used to encrypt the file to be encrypted using the second key at the data sending end to generate an encrypted file ciphertext;
[0075] The file decryption unit is used to transmit the encrypted file ciphertext to the data receiving end through the encrypted communication channel, and use the decrypted second key to decrypt the encrypted file ciphertext to generate a decrypted file.
[0076] In one embodiment, the file encryption unit is used to randomly generate a second key of a specified length of bits, where the specified length of bits is 128 bits, 192 bits or 256 bits; select an encryption mode, and generate a random initialization vector according to the encryption mode; divide the file to be encrypted into file blocks of the specified length of bits, and if the size of the last file block is less than the specified length of bits, fill the last file block until the specified length of bits is met; encrypt the file to be encrypted using the second key to generate an encrypted file ciphertext, and attach the initialization vector to the beginning of the encrypted file ciphertext.
[0077] In one embodiment, the data verification module includes:
[0078] A second verification hash value generating unit is used to, after receiving the encrypted data, obtain the parameters of the cryptographic hash function used to generate the first verification hash value, and generate a second verification hash value for the encrypted data according to the parameters, wherein the parameters include an output length of the hash value;
[0079] The integrity verification unit is used to compare the second verification hash value with the first verification hash value. If the two are the same, the integrity verification succeeds; if the two are different, the integrity verification fails.
[0080] In one embodiment, the above device further includes: a key frame extraction module.
[0081] In one embodiment, the key frame extraction module includes:
[0082] A key frame extraction unit is used to extract key frames in each data block from the data blocks after dividing the original video data into blocks, and generate key frame data and data blocks after the key frames are extracted, wherein the key frame data includes key frames, the order of key frames and the time stamp of key frames;
[0083] A key frame packaging unit is used to package the key frame data into a file to be encrypted, decrypt the encrypted data at the data receiving end, and generate a decrypted file containing the key frame data;
[0084] The data block restoration unit is used to restore the multiple data blocks after the key frames are extracted into multiple data blocks through the key frame data after transmitting the multiple data blocks after the key frames are extracted from the data sending end to the data receiving end.
[0085] In one embodiment, the above device further includes: a channel resetting module.
[0086] In one embodiment, the channel reset module includes:
[0087] A channel closing unit, used to close the encrypted communication channel after each encryption and decryption step is completed;
[0088] The channel resetting unit is used to rebuild the encrypted communication channel if a new round of encryption and decryption operations is required.
[0089] The embodiments of the present invention achieve the following technical effects:
[0090] When the VR device synchronizes video data, only the file to be encrypted is encrypted (since it only contains block mode and index files, the file size is very small), and other ordinary transmission channels that do not require encryption and have fast transmission are used to transmit the original video data with a huge amount of data, which improves the efficiency of large-scale data transmission and ensures the security of transmission; the encryption method of this embodiment is integrated into the Unity engine, so that developers can easily implement data protection during the development process without the need for additional complex coding; the symmetric encryption algorithm and the asymmetric algorithm use their own keys for encryption and decryption respectively, wherein the public key of the asymmetric algorithm is used for encryption, the private key is used for decryption, and the key of the symmetric encryption algorithm is used for encryption and decryption. The entire encryption process adopts a hybrid encryption method, which makes full use of the respective advantages of the asymmetric algorithm and the symmetric encryption algorithm, and improves the security and efficiency of encryption; by extracting key frames and encrypting the key frames, it is used to prevent the copying or theft of video content; the hash verification algorithm is used to verify the integrity and authenticity of the decrypted file, further enhancing the security of the encrypted transmission process.
[0091] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present invention are not limited to any specific combination of hardware and software.
[0092] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for encrypted transmission of video data, characterized in that: include: Setting a block division method for the original video data, dividing the original video data into a plurality of data blocks and index files corresponding to the data blocks according to the block division method, and packaging the block division method and the index files into a file to be encrypted; Establishing an encrypted communication channel based on a secure transport layer protocol between a data sending end and a data receiving end, encrypting the file to be encrypted at the data sending end to generate encrypted data, transmitting the encrypted data to the data receiving end through the encrypted communication channel, and decrypting the encrypted data at the data receiving end to generate a decrypted file; Generate a first key pair at the data receiving end, and transmit a first public key in the first key pair to the data sending end through the encrypted communication channel; Generate a second key at the data sending end, encrypt the second key using the first public key to generate an encrypted second key, and transmit the encrypted second key to the data receiving end through the encrypted communication channel; After receiving the encrypted second key, the data receiving end decrypts the encrypted second key using the first private key in the first key pair to generate a decrypted second key; The method comprises: randomly generating a second key of a specified length of bits, wherein the specified length of bits is 128 bits, 192 bits or 256 bits; selecting an encryption mode, and generating a random initialization vector according to the encryption mode; dividing the file to be encrypted into file blocks of the specified length of bits, and if the size of the last file block is smaller than the specified length of bits, supplementing the last file block until the specified length of bits is met; encrypting the file to be encrypted by the second key to generate the encrypted file ciphertext, and attaching the initialization vector to the beginning of the encrypted file ciphertext; The encrypted file ciphertext is transmitted to the data receiving end through the encrypted communication channel, and the encrypted file ciphertext is decrypted using the decrypted second key to generate the decrypted file; Store, manage and destroy keys through a key management system; Generate a first verification hash value for the file to be encrypted using a cryptographic hash function, transmit the first verification hash value to the data receiving end through the encrypted communication channel, and verify the integrity of the decrypted file using the first verification hash value; If the decrypted file is complete, the multiple data blocks are transmitted from the data sending end to the data receiving end through a data transmission channel, and the multiple data blocks are restored to the original video data according to the block division method and the index file in the decrypted file.
2. The method for encrypted transmission of video data as claimed in claim 1, characterized in that: Also includes: After the original video data is divided into blocks, key frames in each of the data blocks are extracted from the data blocks to generate key frame data and the data blocks after the key frames are extracted, wherein the key frame data includes key frames, the order of the key frames and the timestamps of the key frames; Packing the key frame data into the file to be encrypted, decrypting the encrypted data at the data receiving end to generate the decrypted file containing the key frame data; After the multiple data blocks after the key frame is extracted are transmitted from the data transmitting end to the data receiving end, the multiple data blocks after the key frame is extracted are restored into multiple data blocks through the key frame data.
3. The method for encrypted transmission of video data as claimed in claim 1, characterized in that: Verifying the integrity of the decrypted file by using the first verification hash value includes: After obtaining the decrypted file, obtaining the parameters of the cryptographic hash function used when generating the first verification hash value, and generating a second verification hash value for the decrypted file using the parameters, wherein the parameters include an output length of the hash value; The second verification hash value is compared with the first verification hash value. If the two are the same, the integrity verification succeeds; if the two are different, the integrity verification fails.
4. The method for encrypted transmission of video data according to any one of claims 1 to 3, characterized in that: The original video data may be divided into blocks in any of the following ways: Dividing the original video data into a plurality of data blocks at fixed time intervals; Dividing the original video data into a plurality of data blocks of a fixed size according to a fixed number of frames; Using scene detection technology, when a scene in the original video data changes significantly, the original video data is divided into different data blocks; Acquire key frames in the video encoding of the original video data, and divide the original video data into different data blocks at each key frame; If the original video data contains relevant metadata and / or time stamp information, the original video data is segmented into different data blocks using the metadata and / or the time stamp information.
5. The method for encrypted transmission of video data according to any one of claims 1 to 3, characterized in that: Also includes: After each encryption and decryption step is completed, the encrypted communication channel is closed; If a new round of encryption and decryption operations is required, the encrypted communication channel is rebuilt.
6. An encryption device suitable for video data, characterized in that: include: A data segmentation module, used for setting a segmentation mode of the original video data, segmenting the original video data into a plurality of data blocks and index files corresponding to the data blocks according to the segmentation mode, and packaging the segmentation mode and the index files into a file to be encrypted; An encryption and decryption module is used to establish an encrypted communication channel based on a secure transport layer protocol between a data sending end and a data receiving end, encrypt the file to be encrypted at the data sending end to generate encrypted data, transmit the encrypted data to the data receiving end through the encrypted communication channel, and decrypt the encrypted data at the data receiving end to generate a decrypted file; Encryption and decryption modules, including: A public key transmission unit, used to generate a first key pair at the data receiving end, and transmit a first public key in the first key pair to the data sending end through an encrypted communication channel; A second key generation unit is used to generate a second key at the data sending end, encrypt the second key using the first public key to generate an encrypted second key, and transmit the encrypted second key to the data receiving end through an encrypted communication channel; A second key decryption unit is used to decrypt the encrypted second key by using the first private key in the first key pair after receiving the encrypted second key at the data receiving end, so as to generate a decrypted second key; A file encryption unit, used to encrypt the file to be encrypted using the second key at the data sending end to generate an encrypted file ciphertext; A file decryption unit, used to transmit the encrypted file ciphertext to the data receiving end through the encrypted communication channel, and decrypt the encrypted file ciphertext using the decrypted second key to generate a decrypted file; The file encryption unit is used to randomly generate a second key of a specified length of bits, where the specified length of bits is 128 bits, 192 bits or 256 bits; select an encryption mode, and generate a random initialization vector according to the encryption mode; divide the file to be encrypted into file blocks of the specified length of bits, and if the size of the last file block is less than the specified length of bits, fill the last file block until the specified length of bits is met; encrypt the file to be encrypted by the second key, generate an encrypted file ciphertext, and attach the initialization vector to the beginning of the encrypted file ciphertext; A data verification module, configured to generate a first verification hash value for the file to be encrypted using a cryptographic hash function, transmit the first verification hash value to the data receiving end through the encrypted communication channel, and verify the integrity of the decrypted file using the first verification hash value; A data restoration module is used to transmit the multiple data blocks from the data sending end to the data receiving end through a data transmission channel if the decrypted file is complete, and restore the multiple data blocks to the original video data according to the block division method and the index file in the decrypted file.
7. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the encryption transmission method applicable to video data according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for executing the encryption transmission method for video data according to any one of claims 1 to 5.
Citation Information
Patent Citations
Video transmission method and device, server, equipment and medium
CN111741268A
File encryption and decryption method and device
CN115146285A
File verification method, device and system based on composite encryption and storage medium
CN116644442A