Encryption method, system and equipment of offline media and medium

By using AES-CTR encryption and device feature information to generate encrypted relationship files in offline video encryption, the simple and easy-to-break and data redundancy problems of offline video encryption in the prior art are solved, and the secure playback of multiple devices and multiple videos is realized. Data management.

CN119071539APending Publication Date: 2024-12-03INSPUR FINANCIAL INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410995455.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

In the prior art, offline video encryption has problems such as simple and easy to break and data redundant. Especially when there are many devices and large video volumes, it is difficult to effectively protect the security of multiple videos.

Method used

The media files are encrypted using AES-CTR method. By adding message identifiers to the head of the media file, and generating encrypted relationship files, and key generation and decryption are performed in combination with device feature information to ensure the secure storage and playback of media files.

Benefits of technology

It realizes effective offline encryption for multiple devices and multiple videos, ensures video security, reduces data redundancy, and improves encryption flexibility and operability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119071539A_ABST
    Figure CN119071539A_ABST
Patent Text Reader

Abstract

The invention discloses an offline media encryption method, system and device and a medium, and the method comprises the following steps: encrypting a media file at an encryption end, and obtaining an encrypted ciphertext based on an encryption key; adding a corresponding message identifier to the encrypted header of the media file; generating an encryption relation file based on the encryption key of the media file, the encryption key of the message identifier and the encryption ciphertext; storing the encrypted relation file along with the encrypted media file; in response to playing of the media file, calling a terminal player to obtain a key of the media file and a key of the equipment identifier; calling a terminal player to obtain the encrypted relation file, and decrypting and playing the media file according to the obtained encrypted relation file, the secret key of the media file and the secret key of the equipment identifier; according to the invention, off-line encryption can be effectively and flexibly carried out, multi-device and multi-video playing is supported, and multi-video security is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of media security encryption, and in particular to an encryption method, system, device and medium for offline media. Background Art

[0002] Currently, video encryption is generally performed through a DRM system, which is mainly aimed at online content protection. In addition, offline encryption and management are relatively complex and costly.

[0003] Specifically, current offline video encryption generally adds a password to the entire video file, which has the problem of simple encryption and easy cracking, or offline encryption combines media data and encryption configuration files into one file, resulting in a large media file. When there are many authorized devices and a large amount of videos, each video is combined with configuration encryption information, resulting in data redundancy and the problem of video being too large. Summary of the invention

[0004] The object of the present invention is to provide an offline media encryption method, system, device and medium, thereby solving all or one of the above-mentioned problems existing in the prior art.

[0005] In order to solve the above technical problems, the specific technical solutions of the present invention are as follows: In one aspect, the present invention provides an offline media encryption method, comprising the following steps: First encryption step: Encrypt the media file at the encryption end and obtain the encrypted ciphertext based on the encryption key; Steps to add logo: Adding a corresponding message identifier to the encrypted header of the media file; Second encryption step: Generate an encrypted relationship file based on the encryption key of the media file, the encryption key of the message identifier, and the encrypted ciphertext; Data transfer steps: storing the encrypted relationship file together with the encrypted media file; Steps to obtain the file: In response to the playing of the media file, calling the terminal player to obtain the key of the media file and the key of the device identification; Decryption and playback steps: The terminal player is called to obtain the encrypted relationship file, and the media file is decrypted and played according to the obtained encrypted relationship file, the key of the media file and the key of the device identifier.

[0006] As an improved solution, the first encryption step further includes: Encrypting the video frame and audio of the media file by AES-CTR method; The media encryption key is encrypted by using the authorized device feature to obtain the encrypted ciphertext.

[0007] As an improved solution, the second encryption step further includes: The encryption key of the message identifier, the encryption key of the media file and the encrypted ciphertext are used to create a corresponding relationship file and encrypt the files to obtain the encrypted relationship file.

[0008] As an improved solution, the data transfer step further includes: The encrypted relationship file is stored in a local disk or a mobile device along with the encrypted media file.

[0009] As an improved solution, the file acquisition step further includes: According to the CPU serial number of the terminal and the device mainboard serial number, a preset salt value is added and combined as agreed, and then md5 is performed to obtain the key of the media file and the key of the device identification.

[0010] As an improved solution, the decryption and playback step further includes: Call the terminal player to read the encrypted media file and read the identification information; Call the terminal player to retrieve the encryption relationship file, take out the encrypted ciphertext required by the current media file, obtain a certain position of MD5 as the key to decrypt the encrypted ciphertext through the specific combination of the device's CPU serial number and motherboard information, and use the decrypted ciphertext as the corresponding decryption key to decrypt the audio and video of the media; Call the terminal player to play the decrypted audio and video.

[0011] As an improved solution, the identification adding step further includes: A four-byte identifier, a two-byte identifier for the protocol version, a four-byte identifier for the information length, an encrypted information body, and a thirty-two-byte checksum are sequentially appended to the header of the encrypted media file.

[0012] In another aspect, the present invention further provides an encryption system for offline media, comprising: The first encryption module is used to: encrypt the media file at the encryption end and obtain the encrypted ciphertext based on the encryption key; An identification adding module, used to: add a corresponding message identification to the encrypted header of the media file; A second encryption module, configured to generate an encrypted relationship file based on an encryption key of the media file, an encryption key of the message identifier, and the encrypted ciphertext; A data transfer module, used to store the encrypted relationship file together with the encrypted media file; The file acquisition module is used to: in response to the playing of the media file, call the terminal player to obtain the key of the media file and the key of the device identification; The decryption and playback module is used to: call the terminal player to obtain the encrypted relationship file, and decrypt and play the media file according to the obtained encrypted relationship file, the key of the media file and the key of the device identifier.

[0013] On the other hand, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the offline media encryption method are implemented.

[0014] On the other hand, the present invention further provides a computer device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein: The memory is used to store computer programs; The processor is used to execute the steps of the offline media encryption method by running the program stored in the memory.

[0015] The beneficial effects of the technical solution of the present invention are: 1. The offline media encryption method described in the present invention can realize effective and flexible offline encryption, support the playback of multiple devices and multiple videos, and ensure the security of multiple videos; at the same time, in order to solve the problems of a large number of devices and a large amount of videos, it can effectively perform offline encryption to ensure security, and at the same time ensure the security of multiple videos, which makes up for the defects of the existing technology and has a high application value.

[0016] 2. The offline media encryption system described in the present invention can implement the offline media encryption method described in the present invention through the mutual cooperation of system modules.

[0017] 3. The computer-readable storage medium described in the present invention can cooperate with the boot system module to implement the offline media encryption method described in the present invention, and the computer-readable storage medium described in the present invention also effectively improves the operability of the offline media encryption method.

[0018] 4. The computer device described in the present invention can store and execute the computer-readable storage medium, thereby implementing the offline media encryption method described in the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 is a flow chart of the offline media encryption method according to Embodiment 1 of the present invention; Figure 2 is a logical flow diagram of the offline media encryption method described in Embodiment 1 of the present invention; Figure 3 It is a schematic diagram of the structure of identification information in the encryption method of offline media according to Embodiment 1 of the present invention; Figure 4 is a schematic diagram of the architecture of an encryption system for offline media according to Embodiment 2 of the present invention; Figure 5 is a schematic diagram of the structure of the computer device described in Example 4 of the present invention; The symbols in the accompanying drawings are explained as follows: 1501, processor; 1502, communication interface; 1503, memory; 1504, communication bus. DETAILED DESCRIPTION

[0021] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby making a clearer and more definite definition of the protection scope of the present invention.

[0022] In the description of the present invention, it should be noted that the embodiments described in the present invention are only part of the embodiments of the present invention, rather than all of the embodiments; based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present invention.

[0023] The terms "first", "second", etc. in the specification and claims of this article and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of this article described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment. Example 1

[0024] This embodiment provides an encryption method for offline media, such as Figure 1~Figure 3 As shown, the following steps are included: S100, first encryption step: In this step, the media is encrypted by the encryption device at the encryption end, the video frame and audio of the media are encrypted by the "AES-CTR" method, and the media encryption key KEY is encrypted by the authorized device feature to obtain the encrypted ciphertext S; Specifically, the CPU serial number of the terminal device, the device motherboard serial number, and the agreed salt value are combined as agreed and then taken as the content md5 (hereinafter referred to as M), and used as the key to encrypt the video encryption key1 to obtain S; S200, steps for adding identification: In this step, a corresponding message identifier is added to the encrypted header of the media file. The identifier information structure is as follows: Figure 3 As shown; Specifically, the encrypted file identifier has the first 4 bytes of identification, which in this scheme are 0x0D, 0x0C, 0x0B, 0x0A; Specifically, the current protocol version information is identified by 2 bytes; Specifically, the length of the current identification information body is identified by 4 bytes; Specifically, the information body is the encrypted information of the encrypted media basic information, mainly including: the encryption time of the media file and the md5 of the encrypted media data (hereinafter referred to as MediaM) and other basic information; Specifically, the last 32 bytes are the MD5 of all the previous data (the information body + all the previous content), which is used for data verification.

[0025] S300, second encryption step: In this step, MediaM, M and encrypted ciphertext S are established into a corresponding file D and encrypted to form file D; Specifically, the file D is not limited to the form of text document, XML, JSON or database; Specifically, the code for this step is as follows: { "MediaM1": { "M1": "S1", "M2": "S2" }, "MediaM2": { "M1": "S1", "M2": "S2" }} S400, data transfer steps: In this step, the corresponding relationship is stored together with the encrypted media file in a local disk or a mobile device, etc.; S500, file acquisition steps: In this step, the terminal player first adds the agreed salt value according to the terminal's CPU serial number and the device motherboard serial number and performs md5 to obtain the corresponding device identifier MD5 to obtain the M of the current device; S600, decryption and playback steps: In this step, the terminal player plays the encrypted file, reads the encrypted media file and reads the identification information, obtains the corresponding media MediaM information after decryption, retrieves the encrypted relationship file D, takes out the S required by the current media file, and uses a certain position of the MD5 obtained through a specific combination of the device's CPU serial number and motherboard information as a key to decrypt S, and after decryption, uses it as the corresponding decryption KEY to decrypt the audio and video of the media; Specifically, the encryption and decryption of S is not limited to symmetric encryption such as AES or a combination of multiple encryption methods; Specifically, the terminal player plays the decrypted video normally, and repeats steps S500 to S600 to play other videos.

[0026] It should be noted that the examples herein are only for explaining the present invention and are not intended to limit the protection scope of the present invention. Example 2

[0027] This embodiment is based on the same inventive concept as the offline media encryption method described in Embodiment 1, and provides an offline media encryption system, such as Figure 4 As shown, including: The first encryption module is used to: encrypt the media file at the encryption end and obtain the encrypted ciphertext based on the encryption key; An identification adding module, used to: add a corresponding message identification to the encrypted header of the media file; A second encryption module is used to generate an encrypted relationship file based on the encryption key of the media file, the encryption key of the message identifier and the encrypted ciphertext; A data transfer module, used to store the encrypted relationship file together with the encrypted media file; The file acquisition module is used to: in response to the playing of the media file, call the terminal player to obtain the key of the media file and the key of the device identification; The decryption and playback module is used to: call the terminal player to obtain the encrypted relationship file, and decrypt and play the media file according to the obtained encrypted relationship file, the key of the media file and the key of the device identifier. Example 3

[0028] This embodiment provides a computer-readable storage medium, including: The storage medium is used to store computer software instructions used to implement the offline media encryption method described in the above-mentioned embodiment 1, which includes a program for executing the above-mentioned program set for the offline media encryption method; specifically, the executable program can be built into the offline media encryption system described in the embodiment 2, so that the offline media encryption system can implement the offline media encryption method described in the embodiment 1 by executing the built-in executable program.

[0029] In addition, the computer-readable storage medium of this embodiment may adopt any combination of one or more computer-readable storage media, wherein the computer-readable storage medium includes electrical, optical, electromagnetic, infrared or semiconductor systems, devices or components, or any combination thereof. Example 4

[0030] This embodiment provides an electronic device, such as Figure 5 As shown, the electronic device may include: a processor 1501 , a communication interface 1502 , a memory 1503 and a communication bus 1504 , wherein the processor 1501 , the communication interface 1502 , and the memory 1503 communicate with each other via the communication bus 1504 .

[0031] Memory 1503, used for storing computer programs; The processor 1501 is used to implement the steps of the offline media encryption method described in the above-mentioned embodiment 1 when executing the computer program stored in the memory 1503.

[0032] As an embodiment of the present invention, the communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0033] As an implementation mode of the present invention, the communication interface is used for communication between the above-mentioned terminal and other devices.

[0034] As an embodiment of the present invention, the memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0035] As an embodiment of the present invention, the above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0036] Different from the existing technology, the offline media encryption method, system, device and medium of the present application can effectively and flexibly perform offline encryption, support the playback of multiple devices and multiple videos, and ensure the security of multiple videos; at the same time, in order to address the problems of a large number of devices and a large amount of videos, it can effectively perform offline encryption to ensure security, and at the same time ensure the security of multiple videos, which makes up for the shortcomings of the existing technology and has a high application value.

[0037] It should be understood that in the various embodiments of this document, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this document.

[0038] It should also be understood that in the embodiments of this article, the term "and / or" is only a description of the association relationship of the associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0039] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this article.

[0040] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0041] In the several embodiments provided herein, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or can be electrical, mechanical or other forms of connection.

[0042] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of this article.

[0043] In addition, each functional unit in each embodiment of this invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional unit.

[0044] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this article is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of this article. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0045] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for encrypting offline media, characterized in that: The following steps are involved: First encryption step: Encrypt the media file at the encryption end and obtain the encrypted ciphertext based on the encryption key; Steps to add logo: Adding a corresponding message identifier to the encrypted header of the media file; Second encryption step: Generate an encrypted relationship file based on the encryption key of the media file, the encryption key of the message identifier, and the encrypted ciphertext; Data transfer steps: storing the encrypted relationship file together with the encrypted media file; Steps to obtain the file: In response to the playing of the media file, calling the terminal player to obtain the key of the media file and the key of the device identification; Decryption and playback steps: The terminal player is called to obtain the encrypted relationship file, and the media file is decrypted and played according to the obtained encrypted relationship file, the key of the media file and the key of the device identifier.

2. The offline media encryption method according to claim 1, characterized in that: The first encryption step further comprises: Encrypting the video frame and audio of the media file by AES-CTR method; The media encryption key is encrypted by using the authorized device feature to obtain the encrypted ciphertext.

3. The offline media encryption method according to claim 1, characterized in that: The second encryption step further comprises: The encryption key of the message identifier, the encryption key of the media file and the encrypted ciphertext are used to create a corresponding relationship file and encrypt the files to obtain the encrypted relationship file.

4. The offline media encryption method according to claim 1, characterized in that: The data transfer step further comprises: The encrypted relationship file is stored in a local disk or a mobile device along with the encrypted media file.

5. The offline media encryption method according to claim 1, characterized in that: The file acquisition step further comprises: According to the CPU serial number of the terminal and the device mainboard serial number, a preset salt value is added and combined as agreed, and then md5 is performed to obtain the key of the media file and the key of the device identification.

6. The off-line media encryption method according to claim 1, characterized in that: The decryption and playback step further comprises: Call the terminal player to read the encrypted media file and read the identification information; Call the terminal player to retrieve the encryption relationship file, take out the encrypted ciphertext required by the current media file, obtain a certain position of MD5 as the key to decrypt the encrypted ciphertext through the specific combination of the device's CPU serial number and motherboard information, and use the decrypted ciphertext as the corresponding decryption key to decrypt the audio and video of the media; Call the terminal player to play the decrypted audio and video.

7. The offline media encryption method according to claim 1, characterized in that: The identification adding step further comprises: A four-byte identifier, a two-byte identifier for the protocol version, a four-byte identifier for the information length, an encrypted information body, and a thirty-two-byte checksum are sequentially appended to the header of the encrypted media file.

8. An encryption system for offline media, characterized in that: include: The first encryption module is used to: encrypt the media file at the encryption end and obtain the encrypted ciphertext based on the encryption key; An identification adding module, used to: add a corresponding message identification to the encrypted header of the media file; A second encryption module, configured to generate an encrypted relationship file based on an encryption key of the media file, an encryption key of the message identifier, and the encrypted ciphertext; A data transfer module, used to store the encrypted relationship file together with the encrypted media file; The file acquisition module is used to: in response to the playing of the media file, call the terminal player to obtain the key of the media file and the key of the device identification; The decryption and playback module is used to: call the terminal player to obtain the encrypted relationship file, and decrypt and play the media file according to the obtained encrypted relationship file, the key of the media file and the key of the device identifier.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the offline media encryption method described in any one of claims 1 to 7 are implemented.

10. A computer device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; wherein: The memory is used to store computer programs; The processor is used to execute the steps of the offline media encryption method described in any one of claims 1 to 7 by running the program stored in the memory.