CN114091080A - Subtitle file encryption and decryption method, system, storage medium and electronic equipment - Google Patents

Subtitle file encryption and decryption method, system, storage medium and electronic equipment Download PDF

Info

Publication number
CN114091080A
CN114091080A CN202111431011.1A CN202111431011A CN114091080A CN 114091080 A CN114091080 A CN 114091080A CN 202111431011 A CN202111431011 A CN 202111431011A CN 114091080 A CN114091080 A CN 114091080A
Authority
CN
China
Prior art keywords
character
subtitle file
file
representation data
decrypted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111431011.1A
Other languages
Chinese (zh)
Inventor
陈钢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202111431011.1A priority Critical patent/CN114091080A/en
Publication of CN114091080A publication Critical patent/CN114091080A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6209Protecting access to data via a platform, e.g. using keys or access control rules to a single file or object, e.g. in a secure envelope, encrypted and accessed using a key, or with access control rules appended to the object itself
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2107File encryption

Abstract

The embodiment of the invention provides a method, a system, a storage medium and electronic equipment for encrypting and decrypting subtitles, wherein the method comprises the steps of obtaining encryption parameters and subtitle files to be encrypted; encrypting the subtitle file to be encrypted by using the encryption parameters to obtain an encrypted subtitle file; carrying out encryption operation on the encryption parameters by using a white box library to obtain encrypted parameters; and transmitting the encrypted subtitle file and the encrypted parameters to the client side in which the white box library is stored. The invention can solve the problem that the caption stream is stolen because the caption is transmitted in the plain text.

Description

Subtitle file encryption and decryption method, system, storage medium and electronic equipment
Technical Field
The present invention relates to the technical field of subtitle security, and in particular, to a method, a system, a storage medium, and an electronic device for encrypting and decrypting a subtitle file.
Background
With the enhancement of the awareness of Digital Rights, a DRM (Digital Rights Management) system has come into play, and the DRM system can effectively protect the copyright of the played Digital video content, so as to prevent the Digital video content from being illegally copied, copied and spread, and prevent an illegal or unauthorized user from normally playing the video program.
However, when playing video with subtitles, the video stream can be protected by the DRM system, but cannot be protected by the independent subtitle stream, and most of the independent subtitle streams are transmitted in plaintext. Therefore, how to prevent the independent subtitle stream from being stolen by illegal users or unauthorized users becomes an urgent problem to be solved.
Disclosure of Invention
An object of the embodiments of the present invention is to provide a method, a system, a storage medium, and an electronic device for encrypting and decrypting a subtitle file, which can solve the problem that a subtitle stream is stolen due to the transmission of subtitles in the clear text. The specific technical scheme is as follows:
the invention provides a subtitle file encryption method, which is applied to a server side, wherein a white box library is stored in the server side, and the method comprises the following steps:
acquiring encryption parameters and a subtitle file to be encrypted;
encrypting the subtitle file to be encrypted by using the encryption parameters to obtain an encrypted subtitle file;
carrying out encryption operation on the encryption parameters by using the white box library to obtain encrypted parameters;
and transmitting the encrypted subtitle file and the encrypted parameters to a client in which the white box library is stored.
Optionally, the method further includes:
acquiring a subtitle file playing rule file;
packaging the subtitle file playing rule file and the encryption parameters to obtain a playing permission file;
the encrypting operation is performed on the encryption parameters by using the white box library to obtain encrypted parameters, and the method comprises the following steps:
carrying out encryption operation on the play permission file by using the white box library to obtain an encrypted play permission file;
the transmitting the encrypted subtitle file and the encrypted parameters to the client storing the white-box library includes:
and transmitting the encrypted subtitle file and the encrypted play permission file to a client side storing the white box library.
Optionally, the subtitle file includes a plurality of sets of sentences having a play period flag; the sentence comprises one or more characters;
the encrypting the subtitle file to be encrypted by using the encryption parameter to obtain the encrypted subtitle file specifically includes:
obtaining encryption parameters corresponding to the characters in the sentence according to the character comparison table; the encryption parameter is character representation data, the character representation data is used for representing the character through data different from the character, the character comparison table is used for representing the corresponding relation between the character and the character representation data, and the character representation data corresponding to different characters are different;
replacing characters in the sentence with character representation data corresponding to the characters, and setting arrangement positions of the character representation data according to the arrangement positions of the characters in the sentence to obtain a character representation data set;
and splicing the character representation data sets into encrypted subtitle files according to the playing time intervals of the sentences corresponding to the character representation data sets.
Optionally, the method for generating the character representation data specifically includes:
acquiring a character image;
generating image encoding data of the character image;
and taking the image coded data as character representation data corresponding to characters in the character image.
Optionally, each character representation data in the character comparison table has a sequence mark set according to a preset sequence, and different character representation data have different sequence marks;
the replacing characters in the sentence with character representation data corresponding to the characters, and setting arrangement positions of the character representation data according to the arrangement positions of the characters in the sentence to obtain a character representation data set, including:
expressing the characters in the sentence by using sequence marks of character expression data corresponding to the characters, and setting the arrangement positions of the sequence marks according to the arrangement positions of the characters in the sentence to obtain a sequence mark set corresponding to the sentence;
the splicing the character representation data set into an encrypted subtitle file according to the playing time interval of the sentence corresponding to the character representation data set includes:
and splicing the sequence mark sets into encrypted subtitle files according to the playing time intervals of the sentences corresponding to the sequence mark sets.
The invention also provides a caption file encryption system, which is applied to a server, wherein the server stores a white box library, and the system comprises:
the first acquisition module is used for acquiring the encryption parameters and the subtitle files to be encrypted;
the first encryption module is used for encrypting the subtitle file to be encrypted by using the encryption parameters to obtain an encrypted subtitle file;
the second encryption module is used for carrying out encryption operation on the encryption parameters by utilizing the white box library to obtain encrypted parameters;
and the first file transmission module is used for transmitting the encrypted subtitle file and the encrypted parameters to the client side in which the white box library is stored.
The invention also provides a subtitle file decryption method, which is applied to a client, wherein the client stores a white box library, and the method comprises the following steps:
acquiring a file to be decrypted; the file to be decrypted comprises a subtitle file to be decrypted and an encryption parameter to be decrypted, wherein the subtitle file to be decrypted is encrypted through the encryption parameter;
carrying out decryption operation on the encryption parameter to be decrypted by using the white box library to obtain a decrypted encryption parameter;
and decrypting the subtitle file to be decrypted by using the decrypted encryption parameter to obtain the decrypted subtitle file.
Optionally, the file to be decrypted further includes: playing a rule file for the subtitle file to be decrypted;
the subtitle file decryption method further comprises the following steps:
decrypting the subtitle file playing rule file to be decrypted by using the white box library to obtain a decrypted subtitle file playing rule file; and the subtitle file playing rule file is used for enabling the decrypted subtitle file to be played according to the subtitle file playing rule.
Optionally, the subtitle file to be decrypted includes a plurality of character representation data sets spliced according to a playing time period sequence; the character representation data set comprises a plurality of character representation data with arrangement sequence, the character representation data are the encryption parameters, and the arrangement sequence of the character representation data represents the arrangement sequence of characters in the sentence of the subtitle file; the character representation data is used for representing the character through data different from the character;
the decrypting the subtitle file to be decrypted by using the decrypted encryption parameter to obtain the decrypted subtitle file specifically includes:
acquiring a character representation data set corresponding to a playing time interval from the subtitle file to be decrypted;
performing character conversion on the character representation data in the character representation data set according to a character comparison table to obtain characters corresponding to the playing time period; the character comparison table is used for representing the corresponding relation between characters and character representation data, and the character representation data corresponding to different characters are different;
and sequencing the characters according to the arrangement sequence of the character representation data in the character representation data set to obtain the sentence corresponding to the playing time interval.
The invention also provides a caption file decryption system, which is applied to a client, wherein the client stores a white box library, and the system comprises:
the second acquisition module is used for acquiring the file to be decrypted; the file to be decrypted comprises a subtitle file to be decrypted and an encryption parameter to be decrypted, wherein the subtitle file to be decrypted is encrypted through the encryption parameter;
the first decryption module is used for decrypting the encryption parameter to be decrypted by using the white box library to obtain a decrypted encryption parameter;
and the second decryption module is used for decrypting the subtitle file to be decrypted by using the decrypted encryption parameter to obtain the decrypted subtitle file.
The present invention also provides a computer-readable storage medium having stored thereon a program that, when executed by a processor, implements the above-described subtitle file encryption method and/or the above-described subtitle file decryption method.
The present invention also provides an electronic device comprising:
at least one processor, and at least one memory, bus connected with the processor;
the processor and the memory complete mutual communication through the bus; the processor is used for calling the program instructions in the memory to execute the subtitle file encryption method and/or the subtitle file decryption method.
According to the subtitle encryption and decryption method, the subtitle encryption and decryption system, the storage medium and the electronic equipment, the subtitle file to be encrypted is encrypted by the encryption parameters, and the encryption parameters are encrypted by the white box library, so that an attacker can be prevented from decrypting the subtitle file, the protection of the subtitle file is enhanced, and the problem that a subtitle stream is stolen due to the fact that subtitles are transmitted in a plain text is solved.
Of course, it is not necessary for any product or method of practicing the invention to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a subtitle file encryption method according to an embodiment of the present invention;
fig. 2 is a flowchart of a subtitle file encryption method according to another embodiment of the present invention;
fig. 3 is a structural diagram of a subtitle file encryption system according to an embodiment of the present invention;
fig. 4 is a structural diagram of a subtitle file encryption system according to another embodiment of the present invention;
fig. 5 is a flowchart of a subtitle file decryption method according to an embodiment of the present invention;
fig. 6 is a flowchart of a subtitle file decryption method according to another embodiment of the present invention;
fig. 7 is a block diagram of a subtitle file decryption system according to an embodiment of the present invention;
fig. 8 is a block diagram of a subtitle file decryption system according to another embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention provides a subtitle file encryption method which can be applied to a server side. The server may be a server providing various services, for example, a background server providing support for the terminal device. The background server can respond to the information acquisition request sent by the terminal device, analyze and process the request, obtain a processing result and return the processing result. The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
Various client applications, such as a video playing application, an audio playing application, and the like, may be installed on the terminal device. The terminal device may be hardware or software. When the terminal device is hardware, it may be various electronic devices, including but not limited to a smart phone, a tablet computer, an e-book reader, an MP3(Moving Picture Experts Group Audio Layer III, mpeg Audio Layer 3) player, an MP4(Moving Picture Experts Group Audio Layer IV, mpeg Audio Layer 4) player, a desktop computer, an ultra mobile personal computer, a laptop computer, and the like. When the terminal device is software, the terminal device can be installed in the electronic devices listed above. The embodiment of the present application does not set any limit to the specific type of the electronic device.
It should be noted that the subtitle file encryption method provided by the embodiment of the present application is generally executed by a server. As shown in fig. 1, the subtitle file encryption method includes:
step 101: and acquiring encryption parameters and a subtitle file to be encrypted.
In this embodiment, the server may obtain the encryption parameter and the subtitle file to be encrypted. The encryption parameter may be data used when the subtitle file to be encrypted is encrypted, such as a key and character representation data. Alternatively, the character representing data may represent the character by data different from the character. The subtitle file may include a plurality of sets of sentences having a play period marker, and the sentences may include one or more characters.
In video playing, the time interval of playing voice is usually accompanied by subtitles, and the video accompanied by subtitles is beneficial for a viewer to know the content of the video presentation more clearly. Subtitles in video are more necessary if the language being played in the video needs to be translated to enable the viewer to understand the content of the video. The plaintext subtitle does not play a role in protecting the subtitle, and the subtitle needs to be encrypted to achieve subtitle protection.
The subtitle file is a file in which a playing period corresponds to a playing sentence, and the subtitle sentence (playing sentence) corresponding to the period can be displayed when the video is played for a certain period (playing period) in the process of playing the video. Within a preset time period, there may be a sentence with multiple characters or a sentence with only one character, or even no sentence. For a complete video, the total playing time of the video needs to be divided into a plurality of playing time intervals, and then the playing time intervals correspond to the sentences needing to be presented, so as to generate a subtitle file.
Xml, for example, the file name of a subtitle file to be encrypted is sub, and some part of the subtitle file is as follows:
135000000 first sentence >
135000012 second sentence >
That is, under the file name sub, the sentence "first sentence" is output when the playback period is labeled 135000000, and the sentence "second sentence" is output when the playback period is labeled 135000012.
Step 102: and encrypting the subtitle file to be encrypted by using the encryption parameters to obtain the encrypted subtitle file.
As an optional implementation manner, the subtitle file to be encrypted may be encrypted by using a key to obtain an encrypted subtitle file. Optionally, the key may be a symmetric key, and the method for encrypting the subtitle file to be encrypted may be a symmetric encryption algorithm.
As another optional implementation manner, encrypting the subtitle file to be encrypted by using the encryption parameter to obtain the encrypted subtitle file may be: obtaining encryption parameters corresponding to the characters in the sentence according to the character comparison table; the encryption parameter is character representation data, the character representation data are used for representing characters through data different from the characters, the character comparison table is used for representing the corresponding relation between the characters and the character representation data, and the character representation data corresponding to different characters are different; replacing characters in a sentence with character representation data corresponding to the characters, and setting the arrangement position of each character representation data according to the arrangement position of the characters in the sentence to obtain a character representation data set; and splicing the character representation data sets into the encrypted subtitle files according to the playing time intervals of the sentences corresponding to the character representation data sets.
When a subtitle file to be encrypted is encrypted, statements in each playing time interval can be used as an encrypted subfile to be encrypted, and the processing mode is used for decrypting the statements in the time interval to be played only in the subsequent decryption process instead of decrypting all characters in the encrypted subtitle, so that the risk that the subtitle is stolen due to premature decryption is prevented. Meanwhile, the decryption processing time can be greatly reduced in the subsequent decryption by taking the statement according to the playing time interval as an encryption subunit, so that the problem that the normal playing of the subtitles is influenced due to overlong decryption time is avoided.
Optionally, the character representation data has two generation manners, which are only exemplary and not specifically limited:
in the first mode, character representation data is generated using a symbol such as a character string, a figure, a letter, a number, or a combination thereof. The characters in the sentence are subjected to symbol conversion, and the characters appearing in the caption are replaced by different symbol marks, so that the aim of being incapable of acquiring the characters in the caption under the condition of not obtaining a character comparison table is achieved, and the encryption effect is achieved.
In the second mode, the character indicating data is image coded data of a character image. When generating character representation data, first, a character image is acquired, image coded data of the character image is generated, and the image coded data is used as character representation data corresponding to characters in the character image.
When the character representation data is image coded data of a character image, the character image has character texture describing the character, and the character texture information can be obtained after the image coded data is restored to the character image. Optionally, the characters in the subtitle are in a dot matrix font, the dot matrix font is formed by dividing one character into 16 × 16 or 24 × 24 dots, and then the outline of the character is represented by the virtual and real of each dot. Dot matrix fonts, also called bitmap fonts, each glyph is represented by a set of two-dimensional pixel information. Thus, the character representation data is the pixel information array corresponding to the dot matrix font or the binary array converted by the pixel information array. Of course, the character image may be an image containing only one character, and in order to save space, the generated image encoding data of the character image is preferably image compression encoding, and storing the character image by image compression encoding can reduce the storage volume.
Optionally, the generation manner of the character comparison table includes the following three implementation manners, which are only exemplary and not specifically limited:
as an embodiment, the generating method of the character comparison table specifically includes: carrying out duplication elimination processing on characters in the subtitle file to be encrypted to obtain duplicated characters; selecting character representation data from the first set to obtain the selected character representation data; the selected character representation data are different from the characters after the duplication removal, and the number of the selected character representation data is not less than the number of the characters after the duplication removal; and corresponding the de-duplicated characters with the selected character representation data, so that each de-duplicated character corresponds to at least one selected character representation data and the character representation data corresponding to different characters are different, and generating a character comparison table.
The characters in the subtitle file to be encrypted are subjected to duplication elimination processing, different characters can be obtained, the different characters need to be distinguished by using different character representation data, and the same character representation data can be used for the same characters. And the character representation data and the characters are corresponding, and at least one character representation data is corresponding to each of the characters after the duplication is removed. Alternatively, a character has only one character representing data corresponding thereto, or a character has two or more character representing data corresponding thereto, as long as it is ensured that the character representing data corresponding to the character does not correspond to other characters than the character. When the character indicating data is image coded data of a character image, since there are a plurality of types of font types of characters, there are a plurality of types of image coded data of character images for the same character, and naturally, when the character image is a hand-drawn image, there are a plurality of types of image coded data of corresponding character images. Any kind of image encoding data can uniquely represent the same character.
The generation mode of the character comparison table can be generated for different subtitle files, when the subtitle files are changed, the characters are correspondingly changed, and the character comparison table is changed accordingly. The character comparison table is generated for each subtitle file, so that a cracker needs to find the character comparison table when cracking an encrypted subtitle file, and even if the character comparison table corresponding to one subtitle file is obtained, the comparison table cannot be applied to other subtitle files except the subtitle file, and the cracking workload of the cracker is increased.
Xml, first, all characters used by video in a subtitle file are deduplicated to obtain the following deduplicated characters, wherein the deduplicated characters are represented by a character array charList.
charList [ "first", "sentence", "word", "two" ]
And selecting character representation data from the first set to obtain the selected character representation data. There are a plurality of character indicating data in the first set, and at least 5 characters selected from the set are associated with the de-duplicated characters. When the character representation data are symbol marks such as character strings, graphs, characters, numbers or combinations thereof, the character representation data are randomly selected from the first set; when the character representation data is the image coding data of the character image, the image coding data of the character image corresponding to the character is selected from the first set, and at the moment, one or more image coding data corresponding to the character are stored in the first set.
For example, the selected character indicating data '0 x 1111111' corresponds to "the th", the selected character indicating data '0 x 22222' corresponds to "one", the selected symbol indicating data '0 x 333333' corresponds to "sentence", the selected character indicating data '0 x 4444444' corresponds to "speech", and the selected character indicating data '0 x 55555' corresponds to "two". Thus, character representation data files textureList [ [0x1111111], [0x22222], [0x333333], [0x4444444], [0x55555] ] are obtained. A character corresponds to a character representing a data size of about 0.2Kbyte, and assuming that a movie has 20,000 non-repeating characters, the textrueList is stored in a file size of about 4 MBbyte. The character comparison table is shown in table 1 after the de-duplicated characters are corresponded to the selected character representation data.
TABLE 1 character comparison Table
Character(s) First, the A Sentence Telephone II
Character representation data 0x1111111 0x22222 0x333333 0x4444444 0x55555
From the perspective of the client, UTF8 codes (8-bit, Unicode Transformation Format, for Unicode variable length character coding) of several characters in the caption, namely the "first sentence" and the "second sentence", have not appeared in the memory or the network, and the several characters seen by the user are the result of symbol conversion, that is, the character representation data, that is, the character string, the graph, the character, the number and their combination or the image coding data, are seen.
Compared with the generation of a character comparison table for the whole UTF code table, the generation of a character comparison table for each subtitle file saves the space for storing the character comparison table on one hand, and on the other hand, because the characters after de-duplication in one subtitle file are relatively less, the time for searching the corresponding characters from the table during decompression can be shortened, thereby being beneficial to improving the decompression speed. For example, the total number of the characters obtained after the characters in one video are deduplicated is 1000, and all the characters are far greater than 1000, so that the time for finding the corresponding character from the 1000 characters is far shorter than the time for finding the corresponding character from all the characters.
As another embodiment, the generation method of the character comparison table specifically includes: acquiring a common character set and a second set; the number of the character representation data in the second set is not less than the number of the symbols in the common symbol set; selecting character representation data from the second set to correspond to characters in the common character set, enabling each character in the common character set to correspond to at least one character representation data in the second set and enabling the character representation data corresponding to different characters to be different, and generating a character comparison table.
The characters in the common character set are frequently appearing characters, the number of Chinese characters is about one hundred thousand, the number of common characters is small, generally, 1000 common characters can cover 92% of written data, 2000 common characters can cover 98% of written data, and 3000 common characters can cover 99% of written data. Therefore, the generation of the character comparison table corresponding to the characters in the common character set can meet the requirement of subtitles in the video. The number of the character representation data in the second set is not less than that of the symbols in the common symbol set, one character representation data can only correspond to one common character, and one common character can be represented by one or more character representation data. For the condition that one common character corresponds to a plurality of character representation data, when the subtitle file is decrypted, the decryption operation can be completed as long as one character is uniquely determined according to the character representation data.
Compared with the method for generating a character comparison table aiming at the whole UTF code table, the method for generating the character comparison table by utilizing the common character set can also save the space for storing the character comparison table. And the number of the commonly used characters is in the range of 1000, 4000, so that the corresponding characters can not be searched from the table in the decompression process, and the decompression speed can be improved.
As another embodiment, the generation method of the character comparison table specifically includes: acquiring a corresponding relation file; the corresponding relation file comprises corresponding relations of a plurality of groups of characters and character representation data, the characters in each group of corresponding relations are different from the character representation data, and the character representation data in different corresponding relations are different; and selecting the corresponding relation between the characters matched with the characters in the subtitle file to be encrypted and the character representation data from the corresponding relation file to generate a character comparison table.
Different from the two generation methods of the character comparison table, the character comparison table generated in this embodiment is generated according to the corresponding relationship between the characters and the character representation data, that is, the character representation data corresponding to each character is fixed and does not change with the difference of the subtitle file, and the character representation data set is not selected for each character in a randomized manner.
After obtaining encryption parameters (namely character representation data) corresponding to characters in a sentence, replacing the characters in the sentence with the character representation data corresponding to the characters, and setting the arrangement positions of the character representation data according to the arrangement positions of the characters in the sentence to obtain a character representation data set; and splicing the character representation data sets into the encrypted subtitle files according to the playing time intervals of the sentences corresponding to the character representation data sets.
As another optional implementation, characters in a sentence are replaced by character representation data corresponding to the characters, and the arrangement positions of the character representation data are set according to the arrangement positions of the characters in the sentence, so as to obtain a character representation data set; the method for splicing the character representation data set into the encrypted subtitle file according to the playing time interval of the sentence corresponding to the character representation data set may further include:
the method comprises the steps that characters in a sentence are represented by sequence marks of character representation data corresponding to the characters, and the arrangement positions of the sequence marks are set according to the arrangement positions of the characters in the sentence, so that a sequence mark set corresponding to the sentence is obtained; and splicing the sequence mark sets into the encrypted subtitle files according to the playing time intervals of the sentences corresponding to the sequence mark sets.
Optionally, each character representation data in the character comparison table has a sequence mark set according to a preset sequence, and different character representation data have different sequence marks. The preset sequence may be generated in various ways, and one of the following two ways is only exemplary and not specifically limited:
in a first mode, the preset ordering is determined according to the arrangement position of the character representation data in the sentence in the character comparison table.
In this way, because the appearance sequence of the characters in each video is different, the character representation data corresponding to the characters is also different. For example, the character "th" appears first in the subtitle file sub.xml, the order of the character representation data '0 x 1111111', corresponding to the "th" word, is marked as 0. While the "th" word may not appear first in other videos, so the corresponding sequence flag is not necessarily 0.
In the second mode, the preset ordering is determined according to the arrangement position of the character representation data in the character comparison table.
In this way, the sequence mark of the character representation data does not change along with the difference of the appearance sequence of the characters, and the sequence mark of the character representation data is determined according to the arrangement position of the character representation data in the character comparison table. For example, the serial number of the character "the first" in the character comparison table is 3, and the sequence number of the corresponding character representing data is 3 no matter when the "the first" appears in the subtitle file.
The characters in the sentence are represented by the sequence marks, and the corresponding character representation data can be directly obtained through the sequence marks, and the characters in the sentence can not be directly obtained through the sequence marks, so that a cracker obtains the character representation data which is not a caption file in a video but is different from the characters in the caption file by cracking the sequence marks, and if the cracker wants to further obtain the characters in the caption, the cracker needs to crack to obtain the corresponding relation between the characters and the character representation data, and then the character information in the caption can be extracted. The method can further increase the difficulty and the cracking cost of illegal users or unauthorized users for cracking the characters in the subtitle files.
As an embodiment, when the preset ordering is determined according to the arrangement position of the character representation data in the sentence in the character comparison table, for the subtitle file sub.xml, the sequence of the occurrence of the characters is "first", "sentence", "words", "second", and then, it can be derived from the correspondence relationship between the characters and the character representation data that the sequence of '0 x 1111111' is marked as 0, the sequence of [0x22222] is marked as 1, the sequence of [0x 33333333 ] is marked as 2, the sequence of [0x4444444] is marked as 3, and the sequence of [0x55555] is marked as 4. The characters in the sentence are represented by the sequence marks of the character representation data corresponding to the characters, and the sequence mark set corresponding to the first sentence is [0,1,2,3], and the sequence mark set corresponding to the second sentence is [0,4,2,3 ].
As another embodiment, when the preset sequence is determined according to the arrangement position of the character representation data in the character comparison table, as shown in table 1, since the arrangement position of the "first" character in the character comparison table is the head, the sequence flag of '0 x 1111111' is marked as 0, since the arrangement position of the symbol represented in the character comparison table and the arrangement position of the character representation data in the sentence are the same, the sequence flag set corresponding to the "first sentence" is set as [0,1,2,3], and the sequence flag set corresponding to the "second sentence" is set as [0,4,2,3 ].
The encrypted caption file is a plurality of sequence mark sets with playing time intervals, the encrypted caption file has no characters in the original caption file and no character representation data corresponding to the characters in the original caption file, and the encrypted caption file has a good caption protection effect.
And encrypting the sub.xml of the subtitle file to be encrypted to obtain the new _ sub.xml of the encrypted subtitle file.
Wherein, the encrypted subtitle file new _ sub.xml is as follows:
135000000> [0,1,2,3]// charList [0], charList [1], charList [2], charList [3]
135000012> [0,4,2,3]// charList [0], charList [4], charList [2], charList [3]
Through the steps, the sub.xml of the subtitle file to be encrypted can be converted into the new _ sub.xml of the encrypted subtitle file.
Step 103: and carrying out encryption operation on the encryption parameters by using the white box library to obtain the encrypted parameters.
In the present embodiment, the server stores a white box library. When the encryption parameter is a symmetric key, the symmetric key may be encrypted by using the white box library to obtain an encrypted parameter. When the encryption parameter is character representation data, the character representation data file textureList may be encrypted to obtain an encrypted parameter. Of course, if the client does not store the character comparison table, the white box library can be used for encrypting the character comparison table. The method and the device utilize the white-box library to encrypt the encryption parameters, have short encryption time compared with the method of utilizing the white-box library to encrypt the subtitle file, and are beneficial to improving the encryption efficiency.
Step 104: and transmitting the encrypted subtitle file and the encrypted parameters to the client side in which the white box library is stored.
In this embodiment, the client may store the same white box library as the server. Therefore, the client can decrypt the encrypted parameters by using the white box library to obtain the decrypted encrypted parameters, and then decrypt the encrypted subtitle file by using the decrypted encrypted parameters, so that the decrypted subtitle file is played.
Fig. 2 is a flowchart illustrating a subtitle file encryption method according to another exemplary embodiment, and as shown in fig. 2, a subtitle file encryption method is applied to a server side storing a white-box library, and the method includes the following steps.
Step 201: and acquiring encryption parameters and a subtitle file to be encrypted.
Step 201 is similar to step 101 shown in fig. 1 and is not described again.
Step 202: and encrypting the subtitle file to be encrypted by using the encryption parameters to obtain the encrypted subtitle file.
Step 202 is similar to step 102 shown in fig. 1 and will not be described again.
Step 203: acquiring a subtitle file playing rule file; and packaging the subtitle file playing rule file and the encryption parameters to obtain a playing permission file.
The subtitle file playing rule file can be used for managing the authority of equipment for playing the subtitle file, managing the place for playing the subtitle file, or managing the playing duration and the like. After the server transmits the subtitle file playing rule file to the client, the client can play the subtitle file based on the playing rule.
Step 204: and carrying out encryption operation on the play permission file by using the white box library to obtain the encrypted play permission file.
In this embodiment, the white box library may be used to encrypt the closed caption file playing rule file and the encryption parameter. Of course, the white box library may also be used to perform encryption operations on the subtitle file playing rule file and the encryption parameters, respectively, to obtain an encrypted playing permission file. The method for performing encryption operation on the encryption parameters by using the white-box library is similar to step 103 in fig. 1, and is not described again.
Step 205: and transmitting the encrypted subtitle file and the encrypted play permission file to the client side in which the white box library is stored.
In this embodiment, the client may store the same white box library as the server. In this way, the client can decrypt the encrypted playing permission file by using the white box library to obtain the decrypted encryption parameter and the decrypted playing permission rule, and play the decrypted subtitle file according to the playing permission rule after decrypting the encrypted subtitle file by using the decrypted encryption parameter.
The invention also provides a subtitle file encryption system which is generally arranged at the server side, and the white box library is stored at the server side. As shown in fig. 3, the system includes:
the first obtaining module 301 is configured to obtain an encryption parameter and a subtitle file to be encrypted.
Optionally, the subtitle file includes a plurality of sets of sentences having play period markers; a sentence includes one or more characters.
The first encryption module 302 is configured to encrypt the subtitle file to be encrypted by using the encryption parameter to obtain an encrypted subtitle file.
The first encryption module 302 is specifically configured to:
obtaining encryption parameters corresponding to the characters in the sentence according to the character comparison table; the encryption parameter is character representation data, the character representation data are used for representing characters through data different from the characters, the character comparison table is used for representing the corresponding relation between the characters and the character representation data, and the character representation data corresponding to different characters are different; replacing characters in a sentence with character representation data corresponding to the characters, and setting the arrangement position of each character representation data according to the arrangement position of the characters in the sentence to obtain a character representation data set; and splicing the character representation data sets into the encrypted subtitle files according to the playing time intervals of the sentences corresponding to the character representation data sets.
Optionally, the method for generating character representation data specifically includes: acquiring a character image; generating image encoding data of a character image; the image encoding data is taken as character representation data corresponding to characters in the character image.
Optionally, each character representation data in the character comparison table has a sequence mark set according to a preset sequence, and different character representation data have different sequence marks.
The first encryption module 302 may be further configured to: obtaining encryption parameters corresponding to the characters in the sentence according to the character comparison table; the encryption parameter is character representation data, the character representation data are used for representing characters through data different from the characters, the character comparison table is used for representing the corresponding relation between the characters and the character representation data, and the character representation data corresponding to different characters are different; the method comprises the steps that characters in a sentence are represented by sequence marks of character representation data corresponding to the characters, and the arrangement positions of the sequence marks are set according to the arrangement positions of the characters in the sentence, so that a sequence mark set corresponding to the sentence is obtained; and splicing the sequence mark sets into the encrypted subtitle files according to the playing time intervals of the sentences corresponding to the sequence mark sets.
And the second encryption module 303 is configured to perform an encryption operation on the encryption parameter by using the white box library to obtain an encrypted parameter.
And the first file transmission module 304 is configured to transmit the encrypted subtitle file and the encrypted parameters to the client storing the white-box library.
Fig. 4 is a diagram illustrating a structure of a subtitle file encryption system according to another exemplary embodiment, as shown in fig. 4, the system including:
a first obtaining module 401, configured to obtain the encryption parameter and the subtitle file to be encrypted.
The first obtaining module 401 is similar to the first obtaining module 301 shown in fig. 3, and is not described again.
The first encryption module 402 is configured to encrypt the subtitle file to be encrypted by using the encryption parameter, so as to obtain an encrypted subtitle file.
The first encryption module 402 is similar to the first encryption module 302 shown in fig. 3, and is not described in detail.
A playing permission file generating module 403, configured to obtain a subtitle file playing rule file; and packaging the subtitle file playing rule file and the encryption parameters to obtain a playing permission file.
And a third encryption module 404, configured to perform an encryption operation on the play permission file by using the white box library, so as to obtain an encrypted play permission file.
And a second file transmission module 405, configured to transmit the encrypted subtitle file and the encrypted play permission file to the client storing the white box library.
The invention also provides a method for decrypting the subtitle file, which is applied to a client, the client stores a white box library, as shown in fig. 5, the method for decrypting the subtitle file corresponds to the method for encrypting the subtitle file, and the method for decrypting the subtitle file comprises the following steps:
step 501: and acquiring the file to be decrypted. The file to be decrypted comprises a subtitle file to be decrypted and an encryption parameter to be decrypted, wherein the subtitle file to be decrypted is encrypted through the encryption parameter.
In this embodiment, the encryption parameter may be a key or character representation data. When the encryption parameter is character representation data, the subtitle file to be decrypted comprises a plurality of character representation data sets spliced according to the sequence of the playing time interval; the character representation data set comprises a plurality of character representation data with arrangement sequence, and the arrangement sequence of the character representation data represents the arrangement sequence of characters in the sentence of the subtitle file; character representation data is used to represent a character by data different from the character.
Step 502: and carrying out decryption operation on the encryption parameters to be decrypted by using the white box library to obtain the decrypted encryption parameters.
In this embodiment, since the client stores the white-box library which is the same as the server, the white-box library can be used to perform decryption operation on the encryption parameter to be decrypted, so as to obtain the decrypted encryption parameter.
Step 503: and carrying out decryption operation on the subtitle file to be decrypted by using the decrypted encryption parameter to obtain the decrypted subtitle file.
As an optional implementation manner, step 503 specifically includes: acquiring a character representation data set corresponding to a playing time interval from a subtitle file to be decrypted; performing character conversion on character representation data in the character representation data set according to the character comparison table to obtain characters corresponding to the playing time period; the character comparison table is used for representing the corresponding relation between the characters and the character representation data, and the character representation data corresponding to different characters are different; and sequencing the characters according to the arrangement sequence of the character representation data in the character representation data set to obtain the sentence corresponding to the playing time interval. And splicing the sentences corresponding to the playing time interval to obtain the decrypted subtitle file.
As an optional implementation manner, the subtitle file to be decrypted includes a plurality of sequence marker sets spliced according to the sequence of the playing time period; the sequence flag set includes a plurality of sequence flags having an arrangement order, the arrangement order of the sequence flags representing an arrangement order of characters in a sentence of the subtitle file.
The subtitle file to be decrypted is provided with a plurality of sequence mark sets, each sequence mark set corresponds to one playing time interval, and when a certain playing time interval is to be played, the sequence mark sets corresponding to the current playing time interval or the time interval to be played are decrypted, so that the effect of decrypting the subtitle file while watching a video is achieved. Compared with the method of decrypting the subtitle file and playing the video content after the subtitle file is decrypted, the method of decrypting while watching can avoid the problem of subtitle decryption caused by early decryption.
Xml, the subtitle file to be decrypted includes two sequential mark sets, one is [0,1,2,3], the corresponding playing time is sub time 135000000, the other is [0,4,2,3], and the corresponding playing time is sub time 135000012.
Since the arrangement order of the sequence numbers represents the arrangement order of characters in the sentence of the subtitle file, when the sequence numbers are 0,1,2, and 3, it means that the character corresponding to 0 is arranged at the first position in the sentence of the subtitle file, the character corresponding to 1 is arranged at the second position in the sentence of the subtitle file, the character corresponding to 2 is arranged at the third position in the sentence of the subtitle file, and the character corresponding to 3 is arranged at the fourth position in the sentence of the subtitle file.
Optionally, a sequence mark set corresponding to the playing time period is obtained from the subtitle file to be decrypted, so as to obtain the sequence mark set.
The sequence mark set corresponding to the playing time interval is obtained in the process of playing the video, optionally, the sequence mark set corresponding to the later time intervals of the current playing time interval can also be obtained in the process of playing the video, so that the subsequent sequence mark set is decrypted in advance, and the risk that the normal playing of the subtitles in the video is influenced due to long decryption time can be prevented.
If the subtitle file to be decrypted is new _ sub.xml, when the current playing time period is 135000000, determining that the current sequence tag set is [0,1,2,3], and decrypting the sequence tag set [0,1,2,3 ]; when the current playing time interval is 135000012, the current sequence mark set is determined to be [0,4,2,3], and the decryption operation is performed on the sequence mark set [0,4,2,3 ].
Optionally, the sequence mark set is represented by character representation data having sequence marks set according to a preset sequence, and the arrangement position of each character representation data is set according to the arrangement position of the sequence marks in the sequence mark set, so as to obtain a character representation data set corresponding to the sequence mark set; character representation data is used to represent a character by data different from the character.
Since the character representation data has the sequence marks set according to the preset sequence, the character representation data corresponding to the sequence marks can be converted according to the sequence marks. Optionally, the preset sequence has two generation manners, one is determined according to the arrangement position of the character representation data in the character comparison table in the sentence, and the other is determined according to the arrangement position of the character representation data in the character comparison table. The generation process of the two kinds of preset orderings is similar to the preset ordering generation mode in step 102 shown in fig. 1, and is not described again.
And setting the arrangement position of each character representation data according to the arrangement position of the sequence mark in the current sequence mark set to obtain a character representation data set corresponding to the current sequence mark set. The order of the character representation data in the generated character representation data set can reflect the order of appearance of characters in the sentence of the subtitle file.
If the subtitle file to be decrypted is new _ sub.xml, the current sequence flag set is [0,1,2,3], the character representation data corresponding to the sequence flag 0 is '0 x 1111111', the character representation data corresponding to the sequence flag 1 is '0 x 22222', the character representation data corresponding to the sequence flag 2 is '0 x 333333', the character representation data corresponding to the sequence flag 3 is '0 x 44444', and the character representation data set corresponding to the current sequence flag set [0,1,2,3] can be obtained as [0x1111111,0x22222,0x 333333333333, 0x44444 ] according to the preset arrangement sequence of the character representation data.
Optionally, performing character conversion on the character representation data in the character representation data set according to the character comparison table to obtain characters corresponding to the playing time period; the character comparison table is used for representing the corresponding relation between the characters and the character representation data, and the character representation data corresponding to different characters are different.
When character representation data in the character representation data set is subjected to character conversion, the character representation data is converted into characters in the subtitle file by using the character comparison table, and the characters are obtained through decryption. If one character corresponds to a plurality of character representation data, the corresponding character can be obtained by conversion as long as the character representation data can uniquely identify one character. When the character representation data is the image coding data of the character image, the image coding data needs to be decoded and restored to the character image when the character representation data is subjected to character conversion, and then the character displayed at the client is restored according to the character style during coding, for example, for the 'middle' character, the font type during coding is the 'middle' character represented by song, and the font type obtained by decoding is the 'middle' character represented by song. When the character representation data is a symbol mark such as a character string, a figure, a character, a number or a combination thereof, the character corresponding to the character representation data is directly obtained through the character comparison table.
If the subtitle file to be decrypted is new _ sub.xml and the character representation data set is [0x1111111,0x22222,0x333333,0x4444444], when the character representation data '0 x 1111111' is converted, a character comparison table is searched, and as shown in table 1, the corresponding character can be obtained as the 'th'; when the character representation data '0 x 22222' is converted, the corresponding character is found to be 'one'; when the character representation data '0 x 333333' is converted, the corresponding character is found to be a 'sentence'; when the character representation data '0 x 4444444' is converted, the corresponding character is found to be "speech", and the characters corresponding to the current playing time period are the first, sentence and speech, respectively.
The generation manner of the character comparison table is similar to that of the character comparison table in step 102 in fig. 1, and is not described again. There are two ways of generating the character representing data, which are similar to the way of generating the character representing data in step 102 in fig. 1 and are not described again.
Optionally, the characters are sorted according to the arrangement order of the character representation data in the character representation data set, so as to obtain the sentence corresponding to the playing time interval.
And sequencing the characters to obtain the sentences corresponding to the current playing time interval, so that the decryption operation from the sequence mark set corresponding to the current playing time interval to the sentences corresponding to the current playing time interval is completed. In the decryption process, decryption is performed for one playing time interval, and the effect of generating video subtitles while watching videos can be realized by performing decryption operation in which playing time interval is played or which time interval is to be played.
Fig. 6 is a flowchart illustrating a subtitle file decryption method according to another exemplary embodiment, and as shown in fig. 6, a subtitle file decryption method applied to a client storing a white-box library includes the following steps.
Step 601: and acquiring the file to be decrypted.
Optionally, the file to be decrypted includes a subtitle file to be decrypted, an encryption parameter to be decrypted, and a subtitle file playing rule file to be decrypted. And the subtitle file to be decrypted is encrypted through the encryption parameters.
Step 602: and carrying out decryption operation on the encryption parameters to be decrypted by using the white box library to obtain the decrypted encryption parameters.
Step 602 is similar to step 502 shown in fig. 5 and will not be described again.
Step 603: and carrying out decryption operation on the subtitle file to be decrypted by using the decrypted encryption parameter to obtain the decrypted subtitle file.
Step 603 is similar to step 503 shown in fig. 5 and will not be described again.
Step 604: carrying out decryption operation on the subtitle file playing rule file to be decrypted by using a white box library to obtain a decrypted subtitle file playing rule file; the caption file playing rule file is used for enabling the decrypted caption file to be played according to the caption file playing rule.
The present invention further provides a subtitle file decryption system, which is applied to a client, where a white box library is stored in the client, as shown in fig. 7, the system includes:
a second obtaining module 701, configured to obtain a file to be decrypted; the file to be decrypted comprises a subtitle file to be decrypted and an encryption parameter to be decrypted, wherein the subtitle file to be decrypted is encrypted through the encryption parameter.
The first decryption module 702 is configured to perform a decryption operation on the encryption parameter to be decrypted by using the white box library, so as to obtain a decrypted encryption parameter.
The subtitle file to be decrypted comprises a plurality of character representation data sets spliced according to the playing time interval sequence; the character representation data set comprises a plurality of character representation data with arrangement sequence, the character representation data are encryption parameters, and the arrangement sequence of the character representation data represents the arrangement sequence of characters in the sentence of the subtitle file; character representation data is used to represent a character by data different from the character.
The second decryption module 703 is configured to perform decryption operation on the subtitle file to be decrypted by using the decrypted encryption parameter, so as to obtain a decrypted subtitle file.
The second decryption module 703 is specifically configured to: acquiring a character representation data set corresponding to a playing time interval from a subtitle file to be decrypted; performing character conversion on character representation data in the character representation data set according to the character comparison table to obtain characters corresponding to the playing time period; the character comparison table is used for representing the corresponding relation between the characters and the character representation data, and the character representation data corresponding to different characters are different; and sequencing the characters according to the arrangement sequence of the character representation data in the character representation data set to obtain the sentence corresponding to the playing time interval.
Fig. 8 is a diagram illustrating a subtitle file decryption system according to another exemplary embodiment, and as shown in fig. 8, the system includes:
a third obtaining module 801, configured to obtain a file to be decrypted.
Optionally, the file to be decrypted includes a subtitle file to be decrypted, an encryption parameter to be decrypted, and a subtitle file playing rule file to be decrypted. And the subtitle file to be decrypted is encrypted through the encryption parameters.
The first decryption module 802 is configured to perform a decryption operation on the encryption parameter to be decrypted by using the white box library, so as to obtain a decrypted encryption parameter.
The first decryption module 802 is similar to the first decryption module 702 shown in fig. 7, and is not described in detail.
The second decryption module 803 is configured to perform decryption operation on the subtitle file to be decrypted by using the decrypted encryption parameter, so as to obtain a decrypted subtitle file.
The second decryption module 803 is similar to the second decryption module 703 shown in fig. 7, and is not described in detail.
The third decryption module 804 is configured to perform decryption operation on the subtitle file playing rule file to be decrypted by using the white box library to obtain a decrypted subtitle file playing rule file; the caption file playing rule file is used for enabling the decrypted caption file to be played according to the caption file playing rule.
An embodiment of the present invention provides a computer-readable storage medium on which a program is stored, which, when executed by a processor, implements the above-described subtitle file encryption method and/or subtitle file decryption method.
An embodiment of the present invention provides an electronic device, as shown in fig. 9, an electronic device 90 includes at least one processor 901, at least one memory 902 connected to the processor 901, and a bus 903; the processor 901 and the memory 902 complete communication with each other through the bus 903; the processor 901 is configured to call program instructions in the memory 902 to execute the subtitle file encryption method and/or the subtitle file decryption method described above. The electronic device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application also provides a computer program product adapted to execute a program initialized with the steps comprised by the above-mentioned subtitle file encryption method and/or subtitle file decryption method, when executed on a data processing device.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, systems and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a device includes one or more processors (CPUs), memory, and a bus. The device may also include input/output interfaces, network interfaces, and the like.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer 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, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (12)

1. A subtitle file encryption method is applied to a server side, and the server side stores a white box library, and the method comprises the following steps:
acquiring encryption parameters and a subtitle file to be encrypted;
encrypting the subtitle file to be encrypted by using the encryption parameters to obtain an encrypted subtitle file;
carrying out encryption operation on the encryption parameters by using the white box library to obtain encrypted parameters;
and transmitting the encrypted subtitle file and the encrypted parameters to a client in which the white box library is stored.
2. The subtitle file encryption method according to claim 1, further comprising:
acquiring a subtitle file playing rule file;
packaging the subtitle file playing rule file and the encryption parameters to obtain a playing permission file;
the encrypting operation is performed on the encryption parameters by using the white box library to obtain encrypted parameters, and the method comprises the following steps:
carrying out encryption operation on the play permission file by using the white box library to obtain an encrypted play permission file;
the transmitting the encrypted subtitle file and the encrypted parameters to the client storing the white-box library includes:
and transmitting the encrypted subtitle file and the encrypted play permission file to a client side storing the white box library.
3. The subtitle file encryption method according to any one of claims 1-2, wherein the subtitle file includes a plurality of sets of sentences having a play period flag; the sentence comprises one or more characters;
the encrypting the subtitle file to be encrypted by using the encryption parameter to obtain the encrypted subtitle file specifically includes:
obtaining encryption parameters corresponding to the characters in the sentence according to the character comparison table; the encryption parameter is character representation data, the character representation data is used for representing the character through data different from the character, the character comparison table is used for representing the corresponding relation between the character and the character representation data, and the character representation data corresponding to different characters are different;
replacing characters in the sentence with character representation data corresponding to the characters, and setting arrangement positions of the character representation data according to the arrangement positions of the characters in the sentence to obtain a character representation data set;
and splicing the character representation data sets into encrypted subtitle files according to the playing time intervals of the sentences corresponding to the character representation data sets.
4. The subtitle file encryption method according to claim 3, wherein the method for generating the character representation data specifically comprises:
acquiring a character image;
generating image encoding data of the character image;
and taking the image coded data as character representation data corresponding to characters in the character image.
5. The encryption method for subtitle files according to claim 3, wherein each character representation data in the character comparison table has a sequence mark set according to a preset sequence, and different character representation data have different sequence marks;
the replacing characters in the sentence with character representation data corresponding to the characters, and setting arrangement positions of the character representation data according to the arrangement positions of the characters in the sentence to obtain a character representation data set, including:
expressing the characters in the sentence by using sequence marks of character expression data corresponding to the characters, and setting the arrangement positions of the sequence marks according to the arrangement positions of the characters in the sentence to obtain a sequence mark set corresponding to the sentence;
the splicing the character representation data set into an encrypted subtitle file according to the playing time interval of the sentence corresponding to the character representation data set includes:
and splicing the sequence mark sets into encrypted subtitle files according to the playing time intervals of the sentences corresponding to the sequence mark sets.
6. A subtitle file encryption system, applied to a server side, wherein a white box library is stored in the server side, the system comprising:
the first acquisition module is used for acquiring the encryption parameters and the subtitle files to be encrypted;
the first encryption module is used for encrypting the subtitle file to be encrypted by using the encryption parameters to obtain an encrypted subtitle file;
the second encryption module is used for carrying out encryption operation on the encryption parameters by utilizing the white box library to obtain encrypted parameters;
and the first file transmission module is used for transmitting the encrypted subtitle file and the encrypted parameters to the client side in which the white box library is stored.
7. A subtitle file decryption method applied to a client storing a white-box library, the method comprising:
acquiring a file to be decrypted; the file to be decrypted comprises a subtitle file to be decrypted and an encryption parameter to be decrypted, wherein the subtitle file to be decrypted is encrypted through the encryption parameter;
carrying out decryption operation on the encryption parameter to be decrypted by using the white box library to obtain a decrypted encryption parameter;
and decrypting the subtitle file to be decrypted by using the decrypted encryption parameter to obtain the decrypted subtitle file.
8. The subtitle file decryption method according to claim 7, wherein the file to be decrypted further comprises: playing a rule file for the subtitle file to be decrypted;
the subtitle file decryption method further comprises the following steps:
decrypting the subtitle file playing rule file to be decrypted by using the white box library to obtain a decrypted subtitle file playing rule file; and the subtitle file playing rule file is used for enabling the decrypted subtitle file to be played according to the subtitle file playing rule.
9. The subtitle file decryption method according to any one of claims 7 to 8, wherein the subtitle file to be decrypted includes a plurality of character representation data sets spliced in a play period order; the character representation data set comprises a plurality of character representation data with arrangement sequence, the character representation data are the encryption parameters, and the arrangement sequence of the character representation data represents the arrangement sequence of characters in the sentence of the subtitle file; the character representation data is used for representing the character through data different from the character;
the decrypting the subtitle file to be decrypted by using the decrypted encryption parameter to obtain the decrypted subtitle file specifically includes:
acquiring a character representation data set corresponding to a playing time interval from the subtitle file to be decrypted;
performing character conversion on the character representation data in the character representation data set according to a character comparison table to obtain characters corresponding to the playing time period; the character comparison table is used for representing the corresponding relation between characters and character representation data, and the character representation data corresponding to different characters are different;
and sequencing the characters according to the arrangement sequence of the character representation data in the character representation data set to obtain the sentence corresponding to the playing time interval.
10. A subtitle file decryption system applied to a client storing a white-box library, the system comprising:
the second acquisition module is used for acquiring the file to be decrypted; the file to be decrypted comprises a subtitle file to be decrypted and an encryption parameter to be decrypted, wherein the subtitle file to be decrypted is encrypted through the encryption parameter;
the first decryption module is used for decrypting the encryption parameter to be decrypted by using the white box library to obtain a decrypted encryption parameter;
and the second decryption module is used for decrypting the subtitle file to be decrypted by using the decrypted encryption parameter to obtain the decrypted subtitle file.
11. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a program which, when executed by a processor, implements the subtitle file encryption method according to any one of claims 1 to 5 and/or the subtitle file decryption method according to claims 7 to 9.
12. An electronic device, comprising:
at least one processor, and at least one memory, bus connected with the processor;
the processor and the memory complete mutual communication through the bus; the processor is configured to call program instructions in the memory to perform the subtitle file encryption method of any one of claims 1-5 and/or the subtitle file decryption method of claims 7-9.
CN202111431011.1A 2021-11-29 2021-11-29 Subtitle file encryption and decryption method, system, storage medium and electronic equipment Pending CN114091080A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111431011.1A CN114091080A (en) 2021-11-29 2021-11-29 Subtitle file encryption and decryption method, system, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111431011.1A CN114091080A (en) 2021-11-29 2021-11-29 Subtitle file encryption and decryption method, system, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN114091080A true CN114091080A (en) 2022-02-25

Family

ID=80305384

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111431011.1A Pending CN114091080A (en) 2021-11-29 2021-11-29 Subtitle file encryption and decryption method, system, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114091080A (en)

Similar Documents

Publication Publication Date Title
Rizzo et al. Fine-grain watermarking for intellectual property protection
Chen et al. Coverless information hiding method based on the Chinese mathematical expression
CN100378706C (en) Method for encrypting and decrypting metadata and method for managing metadata and system thereof
CN102542212B (en) Text information hiding method and device
CN104361268A (en) Watermark embedding and reading method, device and system
CN104850765A (en) Watermark processing method, device and system
Al-maweri et al. Robust digital text watermarking algorithm based on unicode extended characters
CN109981266B (en) Method and device for storing and reading key and sensitive information
WO2016045641A2 (en) Data block storage method, data query method and data modification method
CN102402542A (en) Video tagging method and system
CN110288504A (en) It is a kind of to automatically add water impression method towards block chain digital education platform
CN104517045A (en) Method for creating protected digital file
CN110874456B (en) Watermark embedding method, watermark extracting method, watermark embedding device, watermark extracting device and data processing method
US9268713B2 (en) Methods, systems and apparatus for managing data entries on a database
Alsaadi et al. Text steganography in font color of MS excel sheet
KR20110036678A (en) Searchable color encoded file composing method and searchable color encoded file system
CN114091080A (en) Subtitle file encryption and decryption method, system, storage medium and electronic equipment
CN115913660A (en) Data encryption method and device, electronic equipment and readable storage medium
Jaiswal et al. Implementation of a new technique for web document protection using unicode
CN114091081A (en) Subtitle file encryption and decryption method, system, storage medium and electronic equipment
CN108595920A (en) Network video listens management support rights service subsystem
Sharma et al. A study of steganography based data hiding techniques
CN114626968A (en) Watermark embedding method, watermark extracting method and device
CN110008663B (en) Method for quickly embedding and extracting information for PDF document protection and distribution tracking
CN110378080B (en) Publication with copyright protection mechanism

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination