Video encryption and playing method and system

Through the combination of asymmetric and symmetric encryption technologies, verification certificates and embedded keys are generated to ensure that videos are played safely in ocean ships, solving the security and stability problems of video encryption systems in offline environments in the existing technology, and achieving high efficiency encryption and decryption process.

CN119325004APending Publication Date: 2025-01-17SHENZHEN COSCO SHIPPING DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411501262.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-01-17

AI Technical Summary

Technical Problem

The existing video encryption system in ocean-going ships is unable to ensure the security and stable playback of video content in offline environments due to the high real-time communication costs and poor signal coverage in ocean-going ships. The keys are easily stolen, resulting in the leakage of encrypted video content.

Method used

Using a combination of asymmetric encryption and symmetric encryption technology, a private key and public key are generated for verification of certificates and symmetric key encryption, embedded in video data, and through identity authentication, ensuring that only authorized ships receive private keys for decryption and playback, avoiding real-time Communication dependency.

Benefits of technology

It realizes the high security and efficiency of video content during transmission and playback, ensures that only certified ships can watch videos, and solves the playback restrictions and security issues in the absence of network or network instability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119325004A_ABST
    Figure CN119325004A_ABST
Patent Text Reader

Abstract

The invention relates to the field of navigation safety, in particular to a video encryption and playing method and system, and the method comprises the steps: generating a private key and a public key when a video encryption instruction is received, and generating a verification certificate through the private key; obtaining video data needing to be encrypted, and generating a symmetric key according to the video data; encrypting the symmetric key by using the public key to obtain an encrypted symmetric key, encrypting the video data by using the symmetric key, and embedding the encrypted symmetric key into bytes of the video data to obtain encrypted video data; respectively sending the public key, the verification certificate and the encrypted video data to the target ship; when a sending playing instruction of a target ship is received, acquiring a public key and a verification certificate of the target ship, and judging whether the target ship meets identity authentication or not; when identity authentication is satisfied, sending a private key to the target ship, and receiving a decryption result of the target ship; and if the result is consistent, obtaining the symmetric key, and decrypting and playing the video data by the target ship according to the symmetric key.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of maritime safety technology, and in particular to a video encryption and playback method and system. Background Art

[0002] In the field of navigation, especially on ocean-going ships, when encrypted videos need to be sent to ocean-going ships, an encryption process is first used to protect the video content from unauthorized access. The existing video encryption and decryption system requires the client and server to communicate over the Internet in real time. However, in ocean voyages, satellite communications are expensive and have limited bandwidth. Real-time communication not only increases operating costs, but also in sea areas with poor signal coverage, the communication quality and stability cannot be guaranteed.

[0003] Therefore, the existing technology cannot play encrypted videos in an offline environment even if the ship has authorization because the system design relies on real-time communication with the server. This is a serious limitation for ocean-going ships that are often without a network or with an unstable network. In the above process, once the key is sent to the ship, if the ship's security measures are not sound enough, the key may be stolen, resulting in the leakage of encrypted video content. Secondly, in the existing video encryption and playback technology, once the video data encounters problems when decrypting in an offline environment, the system often lacks effective error recovery or provides effective strategies.

[0004] Therefore, the prior art has defects and needs to be improved. Summary of the invention

[0005] In order to solve one or several problems in the prior art, the main purpose of this application is to provide a video encryption and playback method and system.

[0006] In order to achieve the above-mentioned invention object, the present application proposes a video encryption and playback method, the method comprising:

[0007] When receiving a video encryption instruction, generating a private key and a public key, and using the private key to generate a verification certificate, the verification certificate is used to verify the decryption process;

[0008] Acquire video data to be encrypted, and generate a symmetric key according to the video data for encrypting the video data;

[0009] Encrypting the symmetric key with the public key to obtain an encrypted symmetric key, encrypting the video data with the symmetric key, and embedding the encrypted symmetric key into bytes of the video data to obtain encrypted video data;

[0010] Sending the public key, the verification certificate and the encrypted video data to the target ship respectively;

[0011] When receiving a send play instruction from a target ship, obtaining the public key and verification certificate of the target ship, and judging whether the target ship meets the identity authentication requirements according to the public key and verification certificate of the target ship;

[0012] When the target ship meets the identity authentication requirements, the private key is sent to the target ship, and a decryption result of the encrypted symmetric key by the target ship using the private key is received;

[0013] If the decryption result is consistent with the preset decryption result, a symmetric key is obtained, and the target ship decrypts and plays the video data according to the symmetric key.

[0014] The embodiment of the present application also provides a video encryption and playback system, including:

[0015] A receiving module, configured to generate a private key and a public key upon receiving a video encryption instruction, and to use the private key to generate a verification certificate, wherein the verification certificate is used to verify the decryption process;

[0016] An acquisition module, used for acquiring video data to be encrypted, generating a symmetric key according to the video data, and encrypting the video data;

[0017] An embedding module, used for encrypting the symmetric key with the public key to obtain an encrypted symmetric key, encrypting the video data with the symmetric key, and embedding the encrypted symmetric key into bytes of the video data to obtain encrypted video data;

[0018] A first sending module, used for sending the public key, the verification certificate and the encrypted video data to the target ship respectively;

[0019] A judgment module, used for obtaining the public key and verification certificate of the target ship when receiving the send play instruction from the target ship, and judging whether the target ship meets the identity authentication according to the public key and verification certificate of the target ship;

[0020] A second sending module is used to send the private key to the target ship when the target ship meets the identity authentication, and receive the decryption result of the encrypted symmetric key by the target ship using the private key;

[0021] The analysis module is used to obtain a symmetric key if the decryption result is consistent with a preset decryption result, and the target ship decrypts and plays the video data according to the symmetric key.

[0022] The present application also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.

[0023] The present application also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the above-mentioned methods are implemented.

[0024] The video encryption and playback method and system of the embodiment of the present application, by combining asymmetric encryption and symmetric encryption technology, ensures the high security of video content during transmission and playback. First, by generating a private key and a public key, and using the private key to generate a verification certificate, a security guarantee is provided for the encryption and decryption process of the video, ensuring the authenticity of the encryption operation and the data has not been tampered with. Secondly, by utilizing the efficiency of the symmetric key, a large amount of video data can be quickly encrypted, thereby protecting the content from unauthorized access while also ensuring the high efficiency of the encryption process. In addition, by embedding the encrypted symmetric key into the video data and encrypting it with the public key, an additional security layer is provided for the video data, ensuring that even if the video data is intercepted during transmission, unauthorized users cannot decrypt and access the video content. Sending the public key, verification certificate and encrypted video data to the target ship prepares for subsequent decryption and playback, ensuring that the target ship has all the information required for decryption. In the process of identity authentication and private key sending, by verifying the identity of the target ship, it is ensured that only authenticated ships can receive the private key, thereby further ensuring the security of the video content. Finally, the private key is used to decrypt the symmetric key, and the symmetric key is used to decrypt the video playback, thereby achieving secure playback of the video and ensuring that only the target ship with the private key can watch the video, thus achieving encrypted video playback in an offline environment. Since it does not rely on real-time communication with the server, it can solve the limitations and security issues of playing encrypted videos at sea when there is no network or the network is unstable. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 A schematic diagram of a flow chart of a video encryption and playback method according to an embodiment of the present application;

[0026] Figure 2 A schematic diagram of a flow chart of a video encryption and playback method according to an embodiment of the present application;

[0027] Figure 3 This is a schematic block diagram of the structure of a video encryption and playback system according to an embodiment of the present application;

[0028] Figure 4 A schematic block diagram of the structure of a computer device according to an embodiment of the present application.

[0029] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0031] Reference Figure 1 In an embodiment of the present application, a video encryption and playback method is provided, the method comprising:

[0032] S1. When receiving a video encryption instruction, generate a private key and a public key, and use the private key to generate a verification certificate, which is used to verify the decryption process;

[0033] S2. Obtain video data to be encrypted, and generate a symmetric key according to the video data for encrypting the video data;

[0034] S3, encrypting the symmetric key with the public key to obtain an encrypted symmetric key, encrypting the video data with the symmetric key, and embedding the encrypted symmetric key into bytes of the video data to obtain encrypted video data;

[0035] S4, sending the public key, verification certificate and encrypted video data to the target ship respectively;

[0036] S5. When receiving a broadcast instruction from a target ship, obtaining a public key and a verification certificate of the target ship, and judging whether the target ship meets the identity authentication requirements according to the public key and the verification certificate of the target ship;

[0037] S6. When the target ship meets the identity authentication requirements, the private key is sent to the target ship, and a decryption result of the encrypted symmetric key by the target ship using the private key is received;

[0038] S7. If the decryption result is consistent with the preset decryption result, a symmetric key is obtained, and the target ship decrypts and plays the video data according to the symmetric key.

[0039] As described in steps S1-S2 above, when a video encryption instruction is received, the system generates a pair of public and private keys. The private key is used to generate a verification certificate, which is a mechanism to ensure that only legitimate users can decrypt the video. Through the cooperation of public and private keys, asymmetric encryption can be achieved to ensure the security of data. For example, even if the video data is intercepted, an attacker without a private key cannot decrypt it. At the same time, the verification certificate enhances the reliability of identity authentication and ensures that only authenticated devices can access the video content. The system obtains the video data to be encrypted and generates a symmetric key based on this data. The symmetric key is used to quickly encrypt and decrypt the video data. Symmetric encryption is usually faster than asymmetric encryption and is suitable for processing large-scale data, such as video files. This method can effectively reduce the time required for encryption and decryption and improve the smoothness of playback.

[0040] As described in the above steps S3-S5, the system uses the public key to encrypt the generated symmetric key, obtains the encrypted symmetric key, and then embeds the key into the bytes of the video data. This allows the decryption process to be performed directly in the video stream. This embedding method makes the encryption and decryption process more compact and avoids additional storage and transmission costs. At the same time, it ensures that even if the video data is stolen, the attacker cannot easily extract the symmetric key. The system sends the public key, verification certificate and encrypted video data to the target ship respectively. After receiving this information, the target ship prepares to authenticate the identity. It ensures that only authorized ships can receive the video data, thereby protecting the copyright and confidentiality of the content. After the target ship sends the play command, the system obtains the public key and verification certificate of the target ship, and uses the public key of the target ship for identity authentication to confirm whether it is a legitimate user. Through identity authentication, the system can prevent unauthorized users from accessing protected video content and ensure the security and integrity of information.

[0041] As described in steps S6-S7 above, after successful identity authentication, the system sends a private key to the target ship. The target ship uses the private key to decrypt the previously encrypted symmetric key, and then obtains the key to decrypt the video data. This process ensures that only legitimate users can decrypt and play the video content, further improving the security and controllability of the overall system. Once the target ship obtains the symmetric key, it can use the key to decrypt the embedded video data and finally achieve video playback. Users can play the video content smoothly without worrying about data security issues. This method not only ensures a smooth user experience, but also ensures the protection of video content.

[0042] As described above, by combining asymmetric encryption and symmetric encryption technology, the high security of video content during transmission and playback is ensured. First, by generating private keys and public keys, and using the private key to generate a verification certificate, security is provided for the encryption and decryption process of the video, ensuring the authenticity of the encryption operation and that the data has not been tampered with. Secondly, by utilizing the efficiency of symmetric keys, a large amount of video data can be quickly encrypted, thereby protecting the content from unauthorized access while ensuring the high efficiency of the encryption process. In addition, by embedding the encrypted symmetric key into the video data and encrypting it with the public key, an additional layer of security is provided for the video data, ensuring that even if the video data is intercepted during transmission, unauthorized users cannot decrypt and access the video content. Sending the public key, verification certificate and encrypted video data to the target ship prepares for subsequent decryption and playback, ensuring that the target ship has all the information required for decryption. In the process of identity authentication and private key sending, by verifying the identity of the target ship, it is ensured that only authenticated ships can receive the private key, thereby further ensuring the security of the video content. Finally, the private key is used to decrypt the symmetric key, and the symmetric key is used to decrypt the video playback, thereby achieving secure playback of the video and ensuring that only the target ship with the private key can watch the video, thus achieving encrypted video playback in an offline environment. Since it does not rely on real-time communication with the server, it can solve the limitations and security issues of playing encrypted videos at sea when there is no network or the network is unstable.

[0043] Reference Figure 2 In one embodiment, the sending of the private key to the target vessel comprises:

[0044] S61, obtaining the location information and itinerary information of the target ship in real time;

[0045] S62, when the location information of the target ship enters a preset coordinate range, triggering location verification to determine whether the location information is within the itinerary location range of the itinerary information;

[0046] S63, if the location information is within the itinerary location range of the itinerary information, then determining that the target ship meets the location verification requirement;

[0047] S64, based on the result of satisfying the location verification, analyzing whether the current time is within a preset time window;

[0048] S65. If the current time is within the preset time window, an unlocking key for decrypting the private key is sent to the target ship.

[0049] As described in the above steps, the system can track and record the location information and itinerary information of the target ship in real time through GPS or other positioning technologies. It ensures the system's dynamic monitoring of the target ship and provides an accurate data basis for subsequent location verification. Real-time acquisition of location and itinerary information is to ensure that the private key is only sent when the ship ahead is in a specific location and itinerary, thereby improving security. The system presets a coordinate range, and when the location information of the target ship enters this range, the system automatically starts the location verification process. It ensures that the private key is sent within the predetermined geographical area of ​​the ship, increasing the controllability of the sending process. Through location verification, the private key can be prevented from being sent to unauthorized areas, reducing the risk of private key leakage. The system compares the real-time location information of the target ship with its preset itinerary information to confirm whether the ship is traveling as planned. It ensures that the target ship is on the correct route, providing an additional security check for the sending of the private key. This step prevents the ship from accidentally or intentionally receiving the private key due to deviation from the route. If the location information matches the itinerary information, the system determines that the target ship has passed the location verification. It provides the necessary location verification pass signal for the sending of the private key. It ensures that only ships sailing on schedule can receive the private key, improving security. The system checks whether the current time is within the preset time window, which is the allowed time range for sending the private key. This further limits the time when the private key is sent, increasing the security of the sending process. By setting the time window, the private key can be prevented from being sent or received at unauthorized times. After both the position verification and the time window check are passed, the system sends the unlocking key to the target ship, which is used to decrypt the private key. This ensures that the private key is securely sent to the target ship only at the right time and location. In this way, the security risks of the private key during transmission can be minimized, ensuring that only authorized and qualified ships can receive and use the private key.

[0050] In one embodiment, when the video data is encrypted using the symmetric key, the method includes:

[0051] Acquire the video data, and divide the video data into multiple segments;

[0052] Creating metadata for each segment, the metadata including the segment's frame rate, sequence, timestamp, and size;

[0053] The symmetric key is obtained, and metadata is encrypted using the symmetric key.

[0054] As described above, the system divides the complete video file into multiple small segments. Doing so can improve the efficiency of encryption and decryption and allow for more flexible video processing. Video fragmentation makes the encryption process more efficient and facilitates transmission when network conditions are poor. Fragmentation can reduce the amount of data for a single encryption operation, improve processing speed, and if a segment is lost or damaged during transmission, only the segment needs to be retransmitted instead of the entire video. Metadata containing key information is created for each video segment, which describes the basic properties of the segment and its position in the entire video. Metadata provides detailed information about the video segment, which helps to correctly reassemble and present the video during decryption and playback. Metadata ensures that the video segments can be played correctly according to the original order and timestamps after decryption, maintaining the continuity and viewing experience of the video. The metadata of each video segment is encrypted using the symmetric key generated previously to ensure the security of the metadata. Encrypting metadata can prevent unauthorized users from obtaining detailed information about the video segment, thereby increasing the security of the video content. Metadata contains key information about the video segment. If the metadata is accessed without authorization, the structural information of the video content may be leaked, so it is necessary to encrypt the metadata.

[0055] In one embodiment, the method of embedding the encrypted symmetric key into bytes of video data to obtain encrypted video data includes:

[0056] Obtaining the encrypted symmetric key, and calculating a hash value of the encrypted symmetric key as a key fingerprint;

[0057] Acquire the number of segments after the video data is segmented, and according to the number of segments after the video data is segmented, segment the key fingerprint into a plurality of small blocks corresponding to the number of segments, so that each key fingerprint small block independently verifies and decrypts the corresponding video data segment;

[0058] Based on the segmentation result, all the cryptographic fingerprint blocks are embedded into the bytes of the video data in a preset manner to obtain the encrypted video data.

[0059] As described above, a hash function (such as SHA-256) is used to calculate the hash value of the encrypted symmetric key, which is used as the key fingerprint to verify the integrity of the key. The key fingerprint provides a unique identifier for each encrypted video clip, which can be used in the subsequent verification process. The hash value can ensure that the key has not been tampered with during transmission, because any slight change to the key will cause the hash value to change. According to the number of segments after the video data is segmented, the key fingerprint is divided into multiple small blocks of the same number. Each small block will be independently associated with the corresponding video data segment. This method allows each video segment to be independently verified and decrypted, improving the flexibility and robustness of the system. The segmented key fingerprint ensures that even if a segment is lost or damaged during transmission, other segments can still be independently verified and decrypted. The segmented key fingerprint small blocks are embedded into the byte stream of the video data according to the preset rules, so that each video segment contains the corresponding key fingerprint information. In this way, the encrypted video data not only contains the video content, but also implies the key fingerprint information for decryption, without the need for additional data transmission. Embedding the key fingerprint into the video data ensures that the decryption process can access the key fingerprint, thereby verifying the authenticity and integrity of the video clip, while avoiding the security risks that may be caused by transmitting the key fingerprint separately.

[0060] In one embodiment, after the step of determining that the decrypted video data cannot be played normally, the method further includes:

[0061] Based on the result that the video cannot be played normally, a hash value and an original hash value of the decrypted video data are obtained;

[0062] Analyzing the hash value of the decrypted video data and the original hash value to determine whether the error between the two is within a preset error value range;

[0063] If the error values ​​of the two are within a preset error value range, a playback test is performed on the decrypted video data, the playback test comprising: extracting the metadata of the decrypted video data; obtaining the frame rate of each segment in the metadata according to the extraction result; identifying the key frames in the frame rate of each segment; and reorganizing all the key frames and performing a playback test according to the order, timestamp and key frames of each segment in the metadata;

[0064] If the playback test can be played normally, the repair is completed based on the result of normal playback.

[0065] As described above, after decrypting the video data, its hash value is calculated and compared with the hash value of the original video data. By comparing the hash values, it is possible to detect whether the decrypted video data is consistent with the original data, thereby determining whether the data has been tampered with or damaged during the decryption process. Hash value comparison is a fast and effective method to detect data integrity and ensure that no errors are introduced during the decryption process. Compare the difference between the two hash values ​​and check whether the difference is within an acceptable error range. If the error value is within the preset range, it indicates that the damage to the video data may be repairable; if it is out of the range, the data may need to be re-acquired. This method provides a standard to determine the degree of damage to the video data and decide whether to make further repair attempts. The metadata of the decrypted video data is extracted, and the key frames of each segment are identified and reassembled according to the information in the metadata (such as frame rate, sequence, and timestamp), and then a playback test is performed. Through the playback test, it is possible to verify whether the video data can work properly in actual playback, not just the integrity at the data level. The playback test ensures the availability of the video content in actual use and is the last step in verifying the video repair effect. If the playback test shows that the video can be played normally, the repair process is considered successful and the video can be viewed normally by the user. This method can automatically repair some common video playback problems, improving user experience and system reliability. The automatic repair process reduces the need for manual intervention, improves efficiency, and can restore video playback without manual intervention. It is worth mentioning that in ocean-going ships, there may be some sensitive video content, such as military training videos, safety operation guides, emergency response procedures, etc., which need to be kept confidential and prevent unauthorized access. Copyright protection: Entertainment videos on ships may contain copyrighted content, and encryption can prevent illegal copying and distribution. Ensure that video content is not tampered with during transmission and storage, and maintain the integrity of information. For example, a training video on ship emergency escape procedures is critical to the life safety of crew members. It is necessary to ensure that the video content is accurate and can only be viewed by authorized personnel. During ocean voyages, network connections may be unstable or completely unavailable, so videos need to be stored and played offline. In emergency situations, such as in bad weather or accidents, instructional videos need to be accessed immediately, and network delays may result in untimely information acquisition. Satellite communications are costly, and reducing online playback can save communication resources. For example, during a storm, crew members may need to immediately view instructional videos on how to properly operate the ship to avoid danger. In this case, videos stored offline can provide immediate assistance.

[0066] In one embodiment, after the step of analyzing whether the error between the hash value of the decrypted video data and the original hash value is within a preset error value range, the method further includes:

[0067] If the error values ​​of the two are not within the preset error value range, it is determined that there is a data error in the video data decryption process;

[0068] An instruction for reusing the symmetric key to decrypt the video data is sent to the target ship.

[0069] As described above, after comparing the hash value of the decrypted video data with the original hash value, if the error value between the two exceeds the preset error value range, the system will determine that an error may have occurred in the decryption process of the video data. This step can identify data damage or tampering that may have occurred during the decryption process to ensure the integrity and reliability of the video content. Data errors in the decryption process may cause the video to not play properly or the content to be distorted, so these errors need to be detected and processed to ensure the availability of the video content. When an error is detected in the decrypted video data, the system will send an instruction to the target ship, instructing it to re-use the previously generated symmetric key to decrypt the video data. By re-decrypting, you can try to correct the data errors that occurred during the decryption process, thereby restoring the original state of the video data. If an error occurs during the decryption process, re-using the correct symmetric key for decryption is an effective way to recover the video data. It can solve the problem of video not being able to play due to data errors.

[0070] It should be added that the hash function is a one-way encryption algorithm that can convert data of any length into a fixed-length hash value. Due to the uniqueness of the hash value, even if the data only changes slightly, the hash value will change significantly. By comparing the hash value of the decrypted video data with the original hash value, it is possible to quickly detect whether the data has been tampered with or damaged during the decryption process.

[0071] The video encryption and playback method of the present application, by combining asymmetric encryption and symmetric encryption technology, ensures the high security of video content during transmission and playback. First, by generating private keys and public keys, and using private keys to generate verification certificates, security is provided for the encryption and decryption process of the video, ensuring the authenticity of the encryption operation and that the data has not been tampered with. Secondly, by utilizing the efficiency of symmetric keys, a large amount of video data can be quickly encrypted, thereby protecting the content from unauthorized access while also ensuring the high efficiency of the encryption process. In addition, by embedding the encrypted symmetric key into the video data and encrypting it with the public key, an additional security layer is provided for the video data, ensuring that even if the video data is intercepted during transmission, unauthorized users cannot decrypt and access the video content. Sending the public key, verification certificate and encrypted video data to the target ship prepares for subsequent decryption and playback, ensuring that the target ship has all the information required for decryption. In the process of identity authentication and private key sending, by verifying the identity of the target ship, it is ensured that only authenticated ships can receive the private key, thereby further ensuring the security of the video content. Finally, the private key is used to decrypt the symmetric key, and the symmetric key is used to decrypt the video playback, thereby achieving secure playback of the video and ensuring that only the target ship with the private key can watch the video, thus achieving encrypted video playback in an offline environment. Since it does not rely on real-time communication with the server, it can solve the limitations and security issues of playing encrypted videos at sea when there is no network or the network is unstable.

[0072] Reference Figure 3 In an embodiment of the present application, a video encryption and playback system is also provided, including:

[0073] Receiving module 1, used for generating a private key and a public key when receiving a video encryption instruction, and using the private key to generate a verification certificate, wherein the verification certificate is used to verify the decryption process;

[0074] An acquisition module 2 is used to acquire video data to be encrypted, and to generate a symmetric key according to the video data for encrypting the video data;

[0075] Embedding module 3, used for encrypting the symmetric key with the public key to obtain an encrypted symmetric key, encrypting the video data with the symmetric key, and embedding the encrypted symmetric key into the bytes of the video data to obtain encrypted video data;

[0076] A first sending module 4, used to send the public key, the verification certificate and the encrypted video data to the target ship respectively;

[0077] The judgment module 5 is used to obtain the public key and verification certificate of the target ship when receiving the send play instruction from the target ship, and judge whether the target ship meets the identity authentication according to the public key and verification certificate of the target ship;

[0078] The second sending module 6 is used to send the private key to the target ship when the target ship meets the identity authentication, and receive the decryption result of the symmetric key encrypted by the target ship using the private key;

[0079] The analysis module 7 is used to obtain a symmetric key if the decryption result is consistent with a preset decryption result, and the target ship decrypts and plays the video data according to the symmetric key.

[0080] As described above, it can be understood that the various components of the video encryption and playback system proposed in this application can realize the functions of any one of the video encryption and playback methods described above, and the specific structure will not be repeated.

[0081] Reference Figure 4 In an embodiment of the present application, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as monitoring data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a video encryption and playback method is implemented.

[0082] The processor executes the video encryption and playback method, including: when receiving a video encryption instruction, generating a private key and a public key, and using the private key to generate a verification certificate, the verification certificate is used to verify the decryption process; obtaining video data to be encrypted, generating a symmetric key according to the video data, and encrypting the video data; encrypting the symmetric key with the public key to obtain an encrypted symmetric key, encrypting the video data with the symmetric key, and embedding the encrypted symmetric key into the bytes of the video data to obtain the encrypted video data; sending the public key, the verification certificate and the encrypted video data to the target ship respectively; when receiving a send and play instruction from the target ship, obtaining the public key and the verification certificate of the target ship, and judging whether the target ship meets the identity authentication according to the public key and the verification certificate of the target ship; when the target ship meets the identity authentication, sending the private key to the target ship, and receiving the decryption result of the encrypted symmetric key by the target ship using the private key; if the decryption result is consistent with the preset decryption result, the symmetric key is obtained, and the target ship decrypts and plays the video data according to the symmetric key.

[0083] The above-mentioned video encryption and playback method, by combining asymmetric encryption and symmetric encryption technology, ensures the high security of video content during transmission and playback. First, by generating private keys and public keys, and using the private key to generate a verification certificate, security is provided for the encryption and decryption process of the video, ensuring the authenticity of the encryption operation and that the data has not been tampered with. Secondly, by utilizing the efficiency of symmetric keys, a large amount of video data can be quickly encrypted, thereby protecting the content from unauthorized access while ensuring the high efficiency of the encryption process. In addition, by embedding the encrypted symmetric key into the video data and encrypting it with the public key, an additional security layer is provided for the video data, ensuring that even if the video data is intercepted during transmission, unauthorized users cannot decrypt and access the video content. Sending the public key, verification certificate and encrypted video data to the target ship prepares for subsequent decryption and playback, ensuring that the target ship has all the information required for decryption. In the process of identity authentication and private key sending, by verifying the identity of the target ship, it is ensured that only authenticated ships can receive the private key, thereby further ensuring the security of the video content. Finally, the private key is used to decrypt the symmetric key, and the symmetric key is used to decrypt the video playback, thereby achieving secure playback of the video and ensuring that only the target ship with the private key can watch the video, thus achieving encrypted video playback in an offline environment. Since it does not rely on real-time communication with the server, it can solve the limitations and security issues of playing encrypted videos at sea when there is no network or the network is unstable.

[0084] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, a video encryption and playback method is implemented, including the following steps: when a video encryption instruction is received, a private key and a public key are generated, and a verification certificate is generated using the private key, and the verification certificate is used to verify the decryption process; video data to be encrypted is obtained, and a symmetric key is generated according to the video data, and is used to encrypt the video data; the symmetric key is encrypted with the public key to obtain the encrypted symmetric key, the video data is encrypted with the symmetric key, and the encrypted symmetric key is embedded in the video data. bytes, and obtain the encrypted video data; send the public key, verification certificate and encrypted video data to the target ship respectively; when receiving the send and play instruction of the target ship, obtain the public key and verification certificate of the target ship, and judge whether the target ship meets the identity authentication according to the public key and verification certificate of the target ship; when the target ship meets the identity authentication, send the private key to the target ship, and receive the decryption result of the encrypted symmetric key by the target ship using the private key; if the decryption result is consistent with the preset decryption result, the symmetric key is obtained, and the target ship decrypts and plays the video data according to the symmetric key.

[0085] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0086] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.

[0087] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A video encryption and playback method, characterized in that: The method comprises: When receiving a video encryption instruction, generating a private key and a public key, and using the private key to generate a verification certificate, the verification certificate is used to verify the decryption process; Acquire video data to be encrypted, and generate a symmetric key according to the video data for encrypting the video data; Encrypting the symmetric key with the public key to obtain an encrypted symmetric key, encrypting the video data with the symmetric key, and embedding the encrypted symmetric key into bytes of the video data to obtain encrypted video data; Sending the public key, the verification certificate and the encrypted video data to the target ship respectively; When receiving a send play instruction from a target ship, obtaining the public key and verification certificate of the target ship, and judging whether the target ship meets the identity authentication requirements according to the public key and verification certificate of the target ship; When the target ship meets the identity authentication requirements, the private key is sent to the target ship, and a decryption result of the encrypted symmetric key by the target ship using the private key is received; If the decryption result is consistent with the preset decryption result, a symmetric key is obtained, and the target ship decrypts and plays the video data according to the symmetric key.

2. The video encryption and playback method according to claim 1, characterized in that: The method of sending the private key to the target ship comprises: Obtain the location and itinerary information of the target ship in real time; When the position information of the target ship enters the preset coordinate range, the position verification is triggered to determine whether the position information is within the itinerary position range of the itinerary information; If the location information is within the itinerary location range of the itinerary information, it is determined that the target ship meets the location verification requirement; Based on the result of satisfying the location verification, analyze whether the current time is within the preset time window; If the current time is within the preset time window, an unlocking key for decrypting the private key is sent to the target ship.

3. The video encryption and playback method according to claim 1, characterized in that: When the video data is encrypted with the symmetric key, the method comprises: Acquire the video data, and divide the video data into multiple segments; Creating metadata for each segment, the metadata including the segment's frame rate, sequence, timestamp, and size; The symmetric key is obtained, and metadata is encrypted using the symmetric key.

4. The video encryption and playback method according to claim 3, characterized in that: The method of embedding the encrypted symmetric key into the bytes of the video data to obtain the encrypted video data comprises: Obtaining the encrypted symmetric key, and calculating a hash value of the encrypted symmetric key as a key fingerprint; Acquire the number of segments after the video data is segmented, and according to the number of segments after the video data is segmented, segment the key fingerprint into a plurality of small blocks corresponding to the number of segments, so that each key fingerprint small block independently verifies and decrypts the corresponding video data segment; Based on the segmentation result, all the cryptographic fingerprint blocks are embedded into the bytes of the video data in a preset manner to obtain the encrypted video data.

5. The video encryption and playback method according to claim 3, characterized in that: After the step of the target ship decrypting and playing the video data according to the symmetric key, the method further comprises: Obtaining an original hash value of the video data; Calculating a hash value of the decrypted video data, and determining whether the hash value of the decrypted video data corresponds to the original hash value; If the hash value of the decrypted video data corresponds to the original hash value, it is determined that the decrypted video data can be played normally; If the hash value of the decrypted video data does not correspond to the original hash value, it is determined that the decrypted video data cannot be played normally.

6. The video encryption and playback method according to claim 5, characterized in that: After the step of determining that the decrypted video data cannot be played normally, the method further includes: Based on the result that the video cannot be played normally, a hash value and an original hash value of the decrypted video data are obtained; Analyzing the hash value of the decrypted video data and the original hash value to determine whether the error between the two is within a preset error value range; If the error values ​​of the two are within a preset error value range, a playback test is performed on the decrypted video data, the playback test comprising: extracting the metadata of the decrypted video data; obtaining the frame rate of each segment in the metadata according to the extraction result; identifying the key frames in the frame rate of each segment; and reorganizing all the key frames and performing a playback test according to the order, timestamp and key frames of each segment in the metadata; If the playback test can be played normally, the repair is completed based on the result of normal playback.

7. The video encryption and playback method according to claim 6, characterized in that: After the step of analyzing whether the error values ​​of the hash value of the decrypted video data and the original hash value are within a preset error value range, the method further includes: If the error values ​​of the two are not within the preset error value range, it is determined that there is a data error in the video data decryption process; An instruction for reusing the symmetric key to decrypt the video data is sent to the target ship.

8. A video encryption and playback system, characterized in that: include: A receiving module, configured to generate a private key and a public key upon receiving a video encryption instruction, and to use the private key to generate a verification certificate, wherein the verification certificate is used to verify the decryption process; An acquisition module, used for acquiring video data to be encrypted, generating a symmetric key according to the video data, and encrypting the video data; An embedding module, used for encrypting the symmetric key with the public key to obtain an encrypted symmetric key, encrypting the video data with the symmetric key, and embedding the encrypted symmetric key into bytes of the video data to obtain encrypted video data; A first sending module, used for sending the public key, the verification certificate and the encrypted video data to the target ship respectively; A judgment module, used for obtaining the public key and verification certificate of the target ship when receiving the send play instruction from the target ship, and judging whether the target ship meets the identity authentication according to the public key and verification certificate of the target ship; A second sending module is used to send the private key to the target ship when the target ship meets the identity authentication, and receive the decryption result of the encrypted symmetric key by the target ship using the private key; The analysis module is used to obtain a symmetric key if the decryption result is consistent with a preset decryption result, and the target ship decrypts and plays the video data according to the symmetric key.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Video playing method and video playing system

    CN122160193A