CN115934648A - Multimedia file digital signature and verification method, equipment and storage medium - Google Patents

Multimedia file digital signature and verification method, equipment and storage medium Download PDF

Info

Publication number
CN115934648A
CN115934648A CN202211297150.4A CN202211297150A CN115934648A CN 115934648 A CN115934648 A CN 115934648A CN 202211297150 A CN202211297150 A CN 202211297150A CN 115934648 A CN115934648 A CN 115934648A
Authority
CN
China
Prior art keywords
multimedia file
sample
verification
preset
hash
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
CN202211297150.4A
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.)
Shenzhen National Engineering Laboratory Of Digital Television Co ltd
Original Assignee
Shenzhen National Engineering Laboratory Of Digital Television 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 Shenzhen National Engineering Laboratory Of Digital Television Co ltd filed Critical Shenzhen National Engineering Laboratory Of Digital Television Co ltd
Priority to CN202211297150.4A priority Critical patent/CN115934648A/en
Publication of CN115934648A publication Critical patent/CN115934648A/en
Pending legal-status Critical Current

Links

Images

Abstract

The method, the device and the storage medium for digitally signing and verifying the multimedia file are characterized in that a server divides the acquired multimedia file to obtain preset fragmentation samples, determines a first hash value according to the data size and the offset and determines data to be signed, signs and integrates the data to be signed to obtain the multimedia file, and sends the multimedia file and a decryption public key to a client; the multimedia file and the signature public key are received at the client, a playing instruction is responded, the public key is used for verification, then a preset fragmentation sample is obtained according to the data size and the offset, the hash value verification is carried out, and when the verification is passed, the content corresponding to the sample is played. The hash value calculation of the source file content is realized by using two types of information, namely the data size and the offset, the hash operation efficiency is improved, the asynchronous processing of quickly generating verification information at a server side and playing the verification information at a client side is realized, the verification flow is optimized, and the verification efficiency is improved.

Description

Method, equipment and storage medium for digitally signing and verifying multimedia file
Technical Field
The present application relates to the field of multimedia technologies, and in particular, to a method, a device, and a storage medium for digitally signing and verifying a multimedia file.
Background
At present, with the development of culture and science, the demand of the public for multimedia is increasing, and the multimedia technology is rapidly developed. With the improvement of multimedia technologies such as picture technology and the like, the volume of a multimedia file is increased more and more, the existing verification technology is difficult to smoothly verify the multimedia file with larger volume, the verification process consumes longer time, and the instant playing is influenced.
Disclosure of Invention
The embodiment of the application mainly aims to provide a method, equipment and a storage medium for digitally signing and verifying a multimedia file, and aims to improve verification efficiency.
In order to achieve the above object, a first aspect of an embodiment of the present application provides a multimedia file digital signature method, which is applied to a server, and the method includes:
acquiring a multimedia file;
dividing the multimedia file based on a preset fragment size to obtain a plurality of preset fragment samples;
determining a first hash value corresponding to each preset fragmentation sample according to the data size of each preset fragmentation sample and the offset relative to the starting position of the multimedia file;
determining data to be signed corresponding to the multimedia file according to the data size, the offset and the first hash value of each preset fragmentation sample;
performing signature processing on the data to be signed according to a preset signature private key to obtain signature verification information corresponding to the multimedia file;
and taking the signature verification information and the data size, the offset and the first hash value corresponding to each preset fragmentation sample as target verification information of the multimedia file, and sending the multimedia file, the target verification information and a signature public key corresponding to the signature private key to a client.
In some possible embodiments of the present application, before the multimedia file is divided based on a preset fragment size to obtain a plurality of preset fragment samples, the method includes:
acquiring a file unit list of the multimedia file, wherein the file unit list comprises a plurality of data storage units;
the dividing processing is performed on the multimedia file based on the preset fragment size to obtain a plurality of preset fragment samples, and the method comprises the following steps:
when the data size of the data storage unit is larger than a preset fragmentation size, dividing the data storage unit according to the preset fragmentation size to obtain a plurality of preset fragmentation samples;
or when the data size of the data storage unit is smaller than or equal to a preset fragmentation size, taking the data storage unit as a preset fragmentation sample.
In some possible embodiments of the present application, the determining, according to the data size of each preset fragmentation sample and the offset relative to the starting position of the multimedia file, a first hash value corresponding to each preset fragmentation sample includes:
determining a first hash value corresponding to each preset fragmentation sample according to the data size, the offset and the playing time information of each preset fragmentation sample;
the determining data to be signed corresponding to the multimedia file according to the data size, the offset and the first hash value of each preset fragmentation sample includes:
determining data to be signed corresponding to the multimedia file according to the data size, the offset, the first hash value and the playing time information of each preset fragmentation sample;
the taking the signature verification information and the data size, the offset and the first hash value corresponding to each preset fragmentation sample as target verification information of the multimedia file includes:
and taking the signature verification information and the data size, the offset, the first hash value and the playing time information corresponding to each preset fragmentation sample as target verification information of the multimedia file.
In some possible embodiments of the present application, the sending the multimedia file, the target verification information, and the public signature key corresponding to the private signature key to a client includes:
generating a verification file corresponding to the multimedia file according to the target verification information;
sending the multimedia file, the verification file and a signature public key corresponding to the signature private key to a client; alternatively, the first and second electrodes may be,
writing the target verification information into the multimedia file;
and sending the multimedia file carrying the target verification information and the signature public key corresponding to the signature private key to a client.
In some possible embodiments of the present application, the determining, according to the data size of each preset fragmentation sample and the offset relative to the starting position of the multimedia file, a first hash value corresponding to each preset fragmentation sample includes:
acquiring sample data corresponding to each preset slicing sample from the multimedia file according to the data size of each preset slicing sample and the offset relative to the starting position of the multimedia file;
and performing hash calculation on the sample data corresponding to each preset fragmentation sample to obtain a first hash value corresponding to each preset fragmentation sample.
In order to achieve the above object, a second aspect of the embodiments of the present application further provides a multimedia file verification method applied to a client, where the method includes:
receiving a multimedia file, target verification information and a signature public key from a server, wherein the target verification information comprises signature verification information, data sizes corresponding to preset fragmentation samples in the multimedia file, an offset relative to the starting position of the multimedia file and a first hash value;
responding to a playing instruction of the multimedia file, playing the multimedia file, and performing signature verification processing on the signature verification information based on the signature public key to obtain a signature verification result corresponding to the multimedia file;
when the signature verification result is characterized and verified to pass, performing hash verification processing on each preset fragmentation sample in sequence, wherein the hash verification processing comprises:
determining a second hash value corresponding to each preset fragmentation sample according to the data size of the preset fragmentation sample and the offset relative to the starting position of the multimedia file;
comparing a second hash value corresponding to the preset fragmentation sample with the first hash value to obtain a hash verification result corresponding to the preset fragmentation sample;
and when the hash verification result corresponding to the preset fragmentation sample represents that the verification is not passed, stopping playing the multimedia file.
In some possible embodiments of the present application, the target verification information further includes playing time information corresponding to each of the preset slicing samples;
the hash verification processing of each preset fragmentation sample includes:
and sequentially carrying out Hash verification processing on each preset fragmentation sample according to the playing time sequence based on the playing time information corresponding to each preset fragmentation sample.
In some possible embodiments of the present application, after comparing the second hash value corresponding to the preset fragmentation sample with the first hash value to obtain a hash verification result, the method further includes:
updating a preset verification state record table according to the hash verification result corresponding to the preset fragmentation sample, wherein the verification state record table is used for recording the hash verification state of each preset fragmentation sample;
in the playing process of the multimedia file, the method further comprises the following steps:
responding to a jump playing instruction of the multimedia file, and determining a target slicing sample according to a playing time point corresponding to the jump playing instruction and playing time information corresponding to each preset slicing sample, wherein the target slicing sample is a preset slicing sample corresponding to the playing time point;
obtaining a hash verification state corresponding to the target fragment sample from the verification state record table;
when the hash verification state representation corresponding to the target slicing sample passes verification, playing the multimedia file from the playing time point;
or when the hash verification state representation corresponding to the target fragmentation sample is not verified, performing hash verification processing on the target fragmentation sample.
In order to achieve the above object, a third aspect of the embodiments of the present application provides an electronic device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the method of the first aspect or the second aspect when executing the computer program.
To achieve the above object, a fourth aspect of the embodiments of the present application proposes a computer-readable storage medium storing a computer program, which when executed by a processor implements the method of the first aspect or the second aspect.
According to the method, the device and the storage medium for digitally signing and verifying the multimedia file, a server side divides the acquired multimedia file to obtain preset fragment samples, determines a first hash value according to the data size and the offset, determines data to be signed according to the data size, the offset and the first hash value, signs the data to be signed, and sends the data to a client side according to the data size, the offset, the first hash value and the signature data and a decryption public key; the multimedia file and the signature public key are received at the client, the playing instruction is responded, the public key is used for verifying the multimedia file, then the hash value corresponding to the preset fragmentation sample is verified according to the data size and the offset, and when the hash value corresponding to the preset fragmentation sample passes the verification, the content corresponding to the sample is played. The hash value corresponding to the content of the source file is calculated instead of the whole source file, so that the hash operation speed is increased, the asynchronous processing of quickly generating verification information at the server side and realizing verification and playing at the client side is realized, the hash calculation of the whole multimedia file is avoided consuming too much time, the verification time is reduced, the verification flow is optimized, and the verification efficiency is improved.
Drawings
Fig. 1 is a schematic diagram illustrating steps of a method for digitally signing a multimedia file according to an embodiment of the present application;
FIG. 2 is a schematic diagram of the steps of FIG. 2 for another embodiment of the method provided in the first aspect of the present application;
FIG. 3 is a schematic diagram of the substeps of step S103 in FIG. 1;
FIG. 4 is a schematic diagram of the substeps of step S106 in FIG. 1;
FIG. 5 is a flowchart illustrating a method for verifying a multimedia file according to an embodiment of the present application;
fig. 6 is a schematic diagram showing the steps of the hash verification process of step S503 in fig. 5;
FIG. 7 is a schematic representation of the steps of another embodiment of a method provided in the second aspect of the present application;
fig. 8 is a schematic structural diagram of an electronic device provided in a third aspect of the embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It should be noted that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described may be performed in the order in the flowcharts. The terms first, second and the like in the description and in the claims, and the drawings described above, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.
First, several terms referred to in the present application are resolved:
hash (hash), commonly referred to as hash, or transliteration as a hash, is the conversion of an input of arbitrary length (also called pre-mapped pre-image) into an output of fixed length by a hash algorithm, the output value being referred to as a hash value.
Public Key Infrastructure (PKI), a technology and specification that provides a set of secure foundation platforms for the development of electronic commerce using Public Key cryptography in compliance with standards, is a system composed of a digital Certificate, a Certificate Authority (CA), and other registrars that check and verify the legitimacy of parties involved in electronic transactions, and is used to describe policies, standards, and software that regulate or manipulate certificates, public keys, and private keys, and is generally installed in a server.
At present, with the development of culture and science, the demand of the public for multimedia is increasing, and the multimedia technology is rapidly developed. However, problems also arise in the course of multimedia applications.
With the improvement of multimedia technologies such as picture technology, the volume of multimedia files is increased more and more, the existing verification technology is difficult to smoothly verify the multimedia files with larger volume, the verification process consumes longer time, and the instant playing is influenced.
Based on this, the embodiment of the application provides a method, a device and a storage medium for digitally signing and verifying a multimedia file, and aims to improve verification efficiency.
The embodiment of the application provides a digital signature method for a multimedia file, and relates to the technical field of multimedia. The multimedia file digital signature method provided by the embodiment of the application can be applied to a server side and can also be software running in the server side. In some embodiments, the server side may be configured as an independent physical server, may also be configured as a server cluster or a distributed system formed by a plurality of physical servers, and may also be configured as a cloud server that provides basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, middleware service, a domain name service, a security service, a CDN, and a big data and artificial intelligence platform; the software may be an application or the like implementing a method of digitally signing a multimedia file, but is not limited to the above form.
The embodiment of the application provides a multimedia file verification method, and relates to the technical field of multimedia. The multimedia file verification method provided by the embodiment of the application can be applied to a terminal and can also be software running in the terminal. In some embodiments, the terminal may be a smartphone, tablet, laptop, desktop computer, or the like; the software may be an implementation, application of a multimedia file authentication method, and the like, but is not limited to the above form.
The application is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
Specifically, the following embodiments are provided to describe a method, a device, and a storage medium for digitally signing and verifying a multimedia file, and first describe a method for digitally signing a multimedia file provided in a first aspect of the embodiments of the present application.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating steps of a method for digitally signing a multimedia file according to an embodiment of the present disclosure, where the method in fig. 1 may include, but is not limited to, steps S101 to S107.
Step S101: and acquiring the multimedia file.
It should be understood that the multimedia file format described in step S101 is various, and exemplary formats, such as AVI format, MOV format, WAV format, MID format, MP4 format, MP3 format, etc., and those skilled in the art can obtain the multimedia file in the corresponding format according to actual needs, and the application is not limited thereto.
It should be understood that, the manner of acquiring the multimedia file here is various, and the server may pull the multimedia file from another server, or may upload the multimedia file from an external terminal, and a person skilled in the art may determine the manner of acquiring the multimedia file according to actual situations, which is not limited in this application.
Step S102: and dividing the multimedia file based on the preset fragment size to obtain a plurality of preset fragment samples.
It should be understood that the dividing process is a progressive dividing, in which the multimedia file is divided for the first time to obtain a preset slicing sample, and then the remaining multimedia file is divided, so that the multimedia file is progressively divided for a plurality of times until the sample is divided to be smaller than or equal to the preset slicing size, and the division is stopped.
It should be understood that the preset fragmentation sample refers to some representation data for characterizing specific data on the multimedia file, and not specific data divided on the multimedia file, for example, 0 to 1023 bytes conform to the preset fragmentation size, and the byte positions corresponding to the 1 st byte and the 1024 th byte can be taken as the preset fragmentation sample instead of a specific numerical value of each byte.
It should be understood that the divided predetermined sliced samples are stored in a total sample list, where the total sample list is used for the corresponding hash value obtained by the subsequent recording.
Referring to fig. 2, fig. 2 is a schematic step diagram of another embodiment of the method according to the first aspect of the present application.
In some possible embodiments of the present application, between step S101 and step S102, the following steps are included, but not limited thereto.
Step S201: and acquiring a file unit list of the multimedia file.
It should be understood that, the file unit list is self-contained in the multimedia file, and when the hash verification status representation corresponding to the target fragmentation sample is not verified. And under the condition that the multimedia file is normally played, acquiring the content to be played at the current time point according to the file unit list.
It should be understood that the type of the data storage unit herein is various, and may be a data storage unit used for storing specific data only, or a storage unit of the data storage unit, and the present application is not limited thereto.
It should be understood that the storage unit of the data storage unit stores data storage units, which are various, and may be one or more, and the present application is not limited thereto.
For example, taking multimedia files in MP4 format as an example, a basic data storage unit of an MP4 file is a box, and the box may store data, or may be a container (container box) to store other boxes, such as a moov box in an MP4 root box, and this moov box includes boxes for storing specific data, such as a trak box.
In some possible embodiments of the present application, step S102 includes, but is not limited to, the following sub-steps.
Step S202: and when the data size of the data storage unit is larger than the preset fragmentation size, dividing the data storage unit according to the preset fragmentation size to obtain a plurality of preset fragmentation samples.
It should be understood that the data storage unit in step S202 is obtained by traversing the file unit list in step S201.
It should be understood that the data size and offset are obtained directly from the multimedia file and the data size data and offset data are stored in the data storage unit.
It should be understood that the data size herein refers to the size of the data storage unit, illustratively, 1MB,2MB.
It should be understood that the preset tile size is used for a specific value, which is not necessarily equal to the data size, and the specific value of the preset tile size can be set by those skilled in the art according to practical situations, which is not limited in the present application.
It should be understood that information for dividing the preset samples, such as data size, offset, etc., may also be stored in the total sample list.
Specifically, for a currently traversed data storage unit, the data size of the data storage unit is obtained and compared with the preset fragmentation size, and when the data size of the data storage unit is larger than the preset fragmentation size, cyclic division is performed according to the preset size until all samples obtained through division are smaller than or equal to the preset fragmentation size.
For example, taking an MP4 format multimedia file as an example, if the data size of the current data storage unit, i.e. the box, is 2MB and the predetermined slice size is 1.5MB, the data storage unit may be divided into a predetermined slice sample of 1.5MB and a predetermined slice sample of 0.5 MB.
It should be understood that, in step S301, the preset sliced sample obtained by dividing the current data storage unit is not directly stored in the total sample list in step S102, but is temporarily stored in a sliced sample list, and when the data storage unit finishes dividing the preset sliced sample, the sliced sample list is merged into the total sample list.
Step S203: and when the data size of the data storage unit is smaller than the preset fragmentation size, taking the data storage unit as a preset fragmentation sample.
It should be understood that the data storage unit in step S203 is obtained by traversing the file unit list in step S201.
Specifically, for a currently traversed data storage unit, the data size of the data storage unit is obtained and compared with a preset fragmentation size, and when the data size of the data storage unit is smaller than the preset fragmentation size, the data storage unit is determined as a preset fragmentation sample.
It should be understood that, in step S203, the preset sliced samples obtained by dividing the current data storage unit are directly stored in the total sample list referred to in step S102.
It should be understood that step S202 and step S203 are parallel steps, and step S202 is not implemented if step S202 is implemented, and step S202 is not implemented if step S203 is implemented.
According to the embodiment of the application, the preset fragmentation sample is obtained through the preset fragmentation size, the unit for calculating the hash value is reduced to the range of the preset fragmentation sample, and the data volume calculated by the hash value of the server is reduced.
Step S103: and determining a first hash value corresponding to each preset fragmentation sample according to the data size of each preset fragmentation sample and the offset relative to the starting position of the multimedia file.
It should be understood that the offset is used to determine the original position of the preset slicing sample in the multimedia file, and the specific value of the offset is not proportional to the preset slicing size, but is related to the data size of the preset slicing sample.
It should be understood that, the first hash value here is not directly calculated from the data size and the offset, but is obtained by obtaining corresponding sample data from the data size and the offset, and performing a hash calculation on the sample data.
It should be understood that the first hash value corresponding to each preset fragmentation sample is stored in the corresponding position of the total sample list.
In some possible embodiments of the present application, in step 103, the first hash value of each preset fragmentation sample may also be determined according to the playing time information, that is, the first hash value corresponding to each preset fragmentation sample is determined according to the data size, the offset, and the playing time information of each preset fragmentation sample.
According to the method and the device, the corresponding content is extracted by using the playing time information, the hash value is calculated and stored according to the playing time information sequence, the verification is carried out according to the playing time when the multimedia file is played at the client side, the effect of playing and verifying is achieved, the verification efficiency is improved, and the user experience is improved.
The following is an example of a multimedia file in MP4 format.
In MP4, what can be played back, or what can be heard as audio, or what can be seen as subtitles, these are what people only have to feel, and are called track, that is, what is called track, sound track, etc., the basic component unit of track is chunk, the basic component unit of chunk is sample, several samples constitute one chunk, several chunks constitute one track, and all of the track, chunk and sample are stored in the corresponding box. Calculating hash values for the track, and acquiring the offset of each chunk, the data size of each sample, the number of all samples and playing time information for all chunks; dividing according to the self offset of the chunk, the data size of each sample below the chunk and the number of all samples to obtain a plurality of preset fragmentation samples, acquiring specific content of a part of the corresponding chunk or the whole chunk as a target according to the data size of the corresponding sample, the number of all samples and playing time information of each preset fragmentation sample, and performing hash calculation on the target to obtain a first hash value.
Referring to fig. 3, fig. 3 is a schematic view of the substeps of step S103 in fig. 1. In some possible embodiments of the present application, step S103 includes, but is not limited to, the following substeps.
Step S301: and acquiring sample data corresponding to each preset fragment sample from the multimedia file according to the data size of each preset fragment sample and the offset relative to the starting position of the multimedia file.
It should be understood that the offset is used to quickly read sample data, where the corresponding sample data refers to specific data obtained from the multimedia file according to the data size and the offset of the preset sample, and for example, in the example of step S101, the data size is 1KB, and the offset is 1KB, the sample data corresponding to the preset fragmentation sample is a specific value of each byte from 1025 th byte to 2048 th byte.
Specifically, the total sample list is traversed, and for the traversed preset fragmentation sample, sample data corresponding to the multimedia file is obtained according to the data size and the offset of the preset fragmentation sample.
In some possible embodiments of the present application, in step S301, sample data corresponding to the preset fragmentation sample may also be obtained from the multimedia file according to the playing time information, that is, sample data corresponding to each preset fragmentation sample is obtained from the multimedia file according to the data size of each preset fragmentation sample, the offset relative to the starting position of the multimedia file, and the playing time information.
Step S302, performing hash calculation on sample data corresponding to each preset fragmentation sample to obtain a first hash value corresponding to each preset fragmentation sample.
It should be understood that the hash algorithm used for obtaining the first hash value here is various, and may be an MD5 algorithm, an SHA-256 algorithm, or an SHA-512 algorithm, and a person skilled in the art may select a suitable hash algorithm to perform the calculation of the first hash value according to actual needs, and a person skilled in the art may select a suitable hash algorithm to calculate the first calculated hash value according to actual needs, which is not limited in this application.
Step S104: and determining the data to be signed corresponding to the multimedia file according to the data size, the offset and the first hash value of each preset fragmentation sample.
It should be understood that the data to be signed is generated based on the total sample list, and includes the data size, offset, and first hash value of each preset fragmentation sample, and may also include other information that can be obtained from the data size, offset, and first hash value of each preset fragmentation sample, such as algorithm identification information for calculating the first hash value, and preset fragmentation sample number information.
It should be understood that, here, the information of the algorithm and the information of the number of the preset fragmentation samples, those skilled in the art may obtain the information of the algorithm and the information of the number of the preset fragmentation samples according to the actual situation, for example, the number of the data sizes of the preset fragmentation samples is obtained, and may also be determined according to the number of the traversal times in step S301; for another example, if the corresponding hash algorithm information may be obtained according to a preset algorithm id, which is not limited in this application.
It should be understood that the data to be signed may include other information besides the above listed information, for example, the position information of the preset sample fragment in the total sample list, the time playing information of the preset sample fragment, and the like.
In some possible examples of the present application, step S104 may further determine, according to the time information, data to be signed corresponding to the multimedia file, that is, determine, according to the data size, the offset, the first hash value, and the playing time information of each preset fragmentation sample, the data to be signed corresponding to the multimedia file.
According to the method and the device, the data to be signed is determined by adding the playing time information, the sample list sequencing in the verification information obtained at the client side is guaranteed to have the playing time characteristic, and the samples are verified according to the playing time sequencing, so that the effect of playing the multimedia file according to the playing time and verifying the multimedia file is achieved, the verification efficiency is improved, and the user experience is improved.
Step S105: and signing the data to be signed according to a preset signature private key to obtain signature verification information corresponding to the multimedia file.
Specifically, the signature private key is used for processing, the data to be signed is analyzed, encryption calculation is carried out, signature processing is completed, and signature verification information is obtained.
It should be understood that the sources of the private key herein are various, and the private key may be a private key signing device that is configured to implement the exemplary server in the present application, or a server of a private key signing apparatus that is independently configured, and a person skilled in the art may select a suitable server to sign data to be signed according to actual needs, which is not limited in the present application.
Step S106: and taking the signature verification information, the data size, the offset and the first hash value corresponding to each preset fragment sample as target verification information of the multimedia file, and sending the multimedia file, the target verification information and a signature public key corresponding to the signature private key to the client.
It should be understood that the form of sending the multimedia file, the target verification information and the signature public key corresponding to the signature private key to the client is various, and for example, the target verification information and the signature public key are stored as separate files, and the multimedia file and the other two files are sent to the client; and if the target verification information and the multimedia file are integrated, writing the target verification information into the multimedia file, and sending the multimedia file and the file carrying the signature public key to the client.
In some embodiments of the present application, step S106 includes: and integrating the data size, the offset, the first hash value and the playing time information of each preset fragment sample and the signature verification information to obtain the multimedia file.
It should be understood that the public signature key is sent in the form of a certificate of authenticity, and the sending of the public signature key is implemented by relying on the PKI device in the server to send the certificate.
It should be understood that the transmission timing of the multimedia file and the public signature key herein may be various, and may be synchronous transmission or asynchronous transmission, and those skilled in the art may determine the specific transmission mode according to actual needs, and the application is not limited thereto.
In some embodiments of the present application, in step S106, the playing time information may also be used as target verification information, that is, the signature verification information and the data size, offset, first hash value, and playing time information corresponding to each preset segment sample are used as target verification information of the multimedia file.
Referring to fig. 4, fig. 4 is a schematic view illustrating the sub-steps of step S106 in fig. 1. In some possible embodiments of the present application, step S106 includes, but is not limited to, the following substeps.
Step S401: and generating a verification file corresponding to the multimedia file according to the target verification information.
It should be understood that the authentication file is stored separately from the multimedia file; the verification file herein includes, in addition to the data size, the offset, and the first hash value of each preset fragmentation sample, information of an algorithm for calculating the first hash value, information of the number of preset fragmentation samples, and other information that can be obtained from the data size, the offset, and the first hash value of each preset fragmentation sample, and the application is not limited thereto.
Step S402: and sending the multimedia file, the verification file and the signature public key corresponding to the signature private key to the client.
It should be understood that the transmission herein refers to the transmission of a separate file, which may take various forms, such as, for example, the integration of an authentication file with a multimedia file into a file form that is advantageous for transmission to a client, such as a compressed packet format like zip, rar, etc.; and for example, the three files are respectively sent to the client.
A person skilled in the art can select a suitable sending method according to actual needs to send the multimedia file, the verification file, and the signature public key corresponding to the signature private key to the client, which is not limited in the present application.
According to the embodiment of the application, the verification data are independently generated into the file to be stored, so that the data size, the offset, the hash value and the verification information are prevented from being changed when the multimedia file is modified on the premise that the signature key is known from the outside, and the safety of the multimedia file is improved.
Step S403: and writing the target verification information into the multimedia file.
It should be understood that writing herein refers to writing to the self-defined storage area of the multimedia file itself. In addition to the basic components, the multimedia file also includes an area for storing user self-editing data, i.e. a custom area, for example, in the MP4 format multimedia file, in addition to the basic box, a uuid box is also provided in the component unit of the MP4 file, and this box is used for storing custom data, for example, it is intended to store some verification data in the uuid box, i.e. it is possible to convert these verification data into data in the box unit for storing uuid box.
Step S404: and sending the multimedia file carrying the target verification information and the signature public key corresponding to the signature private key to the client.
It should be understood that the multimedia file herein refers to a multimedia file having the same format as the multimedia file in step S101; the term "generating" refers to generating a multimedia file according to the data of the custom memory area and the original data of the multimedia file.
It should be understood that the multimedia file herein has a data size larger than that of the multimedia file due to the presence of the written information.
It should be understood that steps S401 to S402 and steps S403 to S404 are parallel steps, steps S403 to S404 are not performed when steps S401 to S402 are performed, and steps S401 to S402 are not performed when steps S403 to S404 are performed.
According to the method provided by the first aspect of the embodiment of the application, the server side divides the acquired multimedia file to obtain the preset fragment sample, determines the first hash value according to the data size and the offset, determines the data to be signed according to the data size, the offset and the first hash value, signs the data to be signed, integrates the data size, the offset, the first hash value and the signed data to obtain the multimedia file, and sends the multimedia file and the decryption public key to the client side. The hash value is obtained by dividing the data size and the offset into samples, a mode of completing the verification of the whole file by the hash values of the samples is established, verification information is generated quickly, the hash operation efficiency is improved, the hash calculation of the whole multimedia file by consuming too much time is avoided, the verification time is reduced, the follow-up verification process of a client is optimized, and the verification efficiency is improved.
The multimedia file verification method provided by the embodiment of the application is specifically explained by the following embodiment.
Referring to fig. 5, fig. 5 is a schematic diagram illustrating steps of a multimedia file authentication method according to an embodiment of the present application, where the method in fig. 5 includes, but is not limited to, the following steps.
Step S501: and receiving the multimedia file, the target verification information and the signature public key from the server.
It should be understood that the server is connected to the client, and the server includes a PKI device, and the PKI device sends a certificate to the client, where the certificate includes a public signature key corresponding to the signature verification information of the multimedia file.
It should be understood that the target verification information herein includes signature verification information, a data size corresponding to each predetermined sliced sample in the multimedia file, an offset from a start position of the multimedia file, and a first hash value.
It should be understood that the multimedia file may also carry other information besides the above-mentioned information, and all the information is stored in the total sample list, for example, the time information corresponding to the preset fragmentation sample, which is not limited in this application.
In some possible embodiments of the present application, the multimedia file further carries algorithm identification information, which is used to obtain a hash algorithm corresponding to the first hash value.
Step S502: and responding to a playing instruction of the multimedia file, playing the multimedia file, and performing signature verification processing on the signature verification information based on the signature public key to obtain a signature verification result corresponding to the multimedia file.
It should be understood that the play instruction herein refers to an instruction to play multimedia content from the start position of the multimedia file, and is not an instruction to click on the multimedia file, nor an instruction to jump to play.
It should be understood that the signature verification process herein includes two verifications, the first verification is to verify the validity of the certificate, the verification is to verify whether the source of the certificate is legal, and if not, the next verification is not performed; the second verification is public key verification, which is used to verify whether the public key carried by the certificate corresponds to the public key, if not, the verification information encrypted by the private key cannot be decrypted, so that the subsequent verification of the verification information cannot be performed.
Step S503: and when the signature verification result is characterized and verified, sequentially performing hash verification processing on each preset fragmentation sample.
Specifically, after the signature verification result is represented, a total sample list is extracted from the multimedia file, corresponding content is extracted according to target verification information in the total sample list, a hash value is calculated, and hash value comparison is performed, so that hash verification processing is completed.
It should be understood that, here, performing the hash verification processing sequentially refers to traversing the total sample list by using a traversal method, and performing the hash verification processing on the currently traversed preset fragmentation sample which meets the preset rule.
It should be understood that the preset rule herein refers to determining an order of hash verification according to some information in the preset samples, for example, determining the preset fragmentation sample currently subjected to hash verification processing in an adding order of the preset fragmentation samples in the total sample list.
Referring to fig. 6, fig. 6 is a schematic diagram illustrating a step of the hash verification process in step S503 of fig. 5. In some possible embodiments of the present application, the hash verification process includes, but is not limited to, the following steps.
Step S601: and determining a second hash value corresponding to each preset fragmentation sample according to the data size of the preset fragmentation sample and the offset relative to the starting position of the multimedia file.
Specifically, sample data corresponding to each preset fragmentation sample is acquired from the multimedia file according to the data size of each preset fragmentation sample and the offset relative to the starting position of the multimedia file, and a second hash value is calculated on the sample data by using a hash algorithm.
It should be understood that the hash algorithm herein may be obtained by the total sample list carrying the corresponding algorithm identification information, or the server side may separately send the algorithm identification information to notify the client of the specific algorithm used in the playing, which is not limited in this application.
It should be understood that the second hash value and the first hash value represent different meanings, the first hash value is a hash value of sample data corresponding to the multimedia file in step S101, and the second hash value is a hash value of sample data corresponding to the multimedia file in step S501; since the hash algorithms used by the corresponding preset fragmentation samples are the same, the data magnitudes of the first hash value and the second hash value are the same, and the specific values are not necessarily the same, for example, if the value of the first hash value has 256 bits, the value of the second hash value also has 256 bits, but the specific values of the first hash value and the second hash value may be the same or different, depending on the corresponding sample data in the multimedia file received by the client.
Step S602: and comparing the second hash value corresponding to the preset fragmentation sample with the first hash value to obtain a hash verification result corresponding to the preset fragmentation sample.
Specifically, a specific numerical value of the first hash value and a specific numerical value of the second hash value are compared to determine whether the two values are the same; if the sample data corresponding to the corresponding preset fragmentation sample is not modified during the period of sending the multimedia file to the client, the first hash value is the same as the second hash value; and if the sample data corresponding to the corresponding preset fragmentation sample is modified during the period of sending the multimedia file to the client, the first hash value is different from the second hash value.
According to the embodiment of the application, the hash value is calculated by dividing the sample, the multi-media file segmentation verification is realized by utilizing the plurality of sample hash values, and the verification efficiency of the large-size multi-media file is improved.
Step S504: and when the hash verification result corresponding to the preset fragmentation sample represents that the verification is not passed, stopping playing the multimedia file.
It should be understood that step S504 is an asynchronous playing, and is executed asynchronously with step S503, that is, the hash verification is performed on the corresponding preset segment sample, and when the hash verification represents that the verification is passed, the multimedia content corresponding to the preset segment sample is played; and stopping playing the multimedia content corresponding to the preset fragment sample when the representation fails.
Step S504 is exemplified below.
Assuming that the sequence hash verification processing sequence of the sample A is before the sample B, the content played and sent by the sample A is from the 1 st frame to the 30 th frame of the multimedia file, the content played and sent by the sample B is from the 31 st frame to the 60 th frame of the multimedia file, when the verification representation of the sample A passes, the first frame to the 30 th frame are played, and during the period from the playing of the 1 st frame to the 30 th frame, the sample B is subjected to hash verification processing and the hash verification of the sample B is completed before the playing of the 1 st frame to the 30 th frame is completed; and when the verification result characterization of the sample B passes, playing the 31 st frame after the playing of the 30 th frame is finished, and stopping playing the multimedia file if the verification result characterization of the sample B does not pass after the playing of the 30 th frame is finished.
Referring to fig. 7, fig. 7 is a schematic step diagram of another embodiment of a method provided in the second aspect of the present application. In some possible embodiments of the present application, between step S503 and step S504, the following steps are also included, but not limited to.
Step S701: and updating a preset verification state record table according to the hash verification result corresponding to the preset fragmentation sample.
It should be understood that the verification state recording table herein is used to record the hash verification state of each preset fragmentation sample, the verification state table may be obtained in various manners, and may be generated according to the total sample list, or may be designed by itself, and a person skilled in the art may design and obtain a suitable verification state table format according to an actual situation, which is not limited in this application.
It should be understood that the verification status herein includes whether the predetermined fragmented sample is verified and whether the verification is passed, and in addition, other information about the verification status may be included, for example, the time for performing the verification on the predetermined fragmented sample is not limited in this application.
In some possible embodiments of the present application, the total sample list of the multimedia file in step S501 further carries playing time information corresponding to each preset fragmentation sample, hash verification processing is performed on the corresponding preset fragmentation samples according to a playing time sequence based on the playing time information corresponding to each preset fragmentation sample, when the multimedia file is played, the preset fragmentation sample corresponding to a next time of the current time is verified, and the playing is performed while the verification is performed according to the time information.
According to the embodiment of the application, the hash verification is carried out on the sample data corresponding to the next moment according to the time sequence, when the hash verification shows that the sample data passes, the content at the next moment can be played, the effect of playing the current content and verifying the content at the next moment is realized, and the verification efficiency and the user impression experience are improved.
The following steps are included in the playback process, but not limited thereto.
Step S702: and responding to a jump playing instruction of the multimedia file, and determining a target fragment sample according to a playing time point corresponding to the jump playing instruction and playing time information corresponding to each preset fragment sample.
It should be understood that, the target slicing sample here is a preset slicing sample corresponding to the playing time point; the determining of the target segment sample is to determine the target segment sample according to a time range that the playing time point falls into, where the time range is obtained from the playing time information corresponding to the preset segment sample, and for example, if the playing time point is 15 th S and the time information of the sample a is 10 th S and 20 th S, the time range that can be obtained from the sample a is 10 th to 20 th S, and the playing time point falls into this range, it is determined that the sample a is the target segment sample.
Step S703: and acquiring the hash verification state corresponding to the target fragment sample from the verification state record table.
Specifically, a verification state record table is queried, and the hash verification state of the target fragmentation sample in the verification state record table is obtained.
Step S704: and when the hash verification state representation corresponding to the target slicing sample passes verification, playing the multimedia file from the playing time point.
It should be understood that, in the step of playing the multimedia file from the play time point, steps S503 to S504 are executed until the playing of the entire multimedia file is completed or the next skip play instruction is responded.
Step S705: and when the hash verification state representation corresponding to the target fragment sample is not verified, performing hash verification processing on the target fragment sample.
It should be understood that, here, performing the hash verification processing on the target segment sample refers to skipping to step S503 to perform the hash verification processing when the corresponding hash verification status representation of the target segment sample is not verified.
It should be understood that steps S704 and S705 are parallel steps, step S705 is not performed when step S704 is performed, and step S704 is not performed when step S705 is performed.
It should be understood that the hash verification status obtained here is also recorded into the verification status record table.
In the method provided by the second aspect of the embodiment of the present application, the multimedia file and the signature public key are received at the client, the play instruction is responded, the multimedia file is verified by using the public key, then the hash value corresponding to the preset fragmentation sample is verified according to the data size and the offset, and when the hash value corresponding to the preset fragmentation sample passes verification, the content corresponding to the sample is played. The hash value is obtained by dividing the data size and the offset into samples, the verification of the whole file is completed by the hash values of the samples, the hash operation speed is improved, the hash calculation of the whole multimedia file in too much time is avoided, the verification time is reduced, the verification process is optimized, and the verification efficiency is improved.
The embodiment of the present application further provides an apparatus, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the above-mentioned method for digitally signing a multimedia file or the method for verifying a multimedia file when executing the computer program. The equipment can be any intelligent terminal including a tablet computer, a vehicle-mounted computer and the like.
Referring to fig. 8, fig. 8 is a schematic structural diagram of an apparatus according to a third aspect of the embodiment of the present application, where the apparatus 900 includes:
the processor 901 may be implemented by a general-purpose CPU (central processing unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits, and is configured to execute a relevant program to implement the technical solution provided in the embodiment of the present application;
the memory 902 may be implemented in the form of a Read Only Memory (ROM), a static storage device, a dynamic storage device, or a Random Access Memory (RAM). The memory 902 may store an operating system and other application programs, and when the technical solution provided by the embodiments of the present disclosure is implemented by software or firmware, the relevant program codes are stored in the memory 902 and called by the processor 901 to execute a multimedia file digital signature method of the first aspect or a multimedia file verification method of the second aspect of the embodiments of the present disclosure;
an input/output interface 903 for implementing information input and output;
a communication interface 904, configured to implement communication interaction between the device and another device, where communication may be implemented in a wired manner (e.g., USB, network cable, etc.), and communication may also be implemented in a wireless manner (e.g., mobile network, WIFI, bluetooth, etc.);
a bus 905 that transfers information between various components of the device (e.g., the processor 901, the memory 902, the input/output interface 903, and the communication interface 904);
wherein the processor 901, the memory 902, the input/output interface 903 and the communication interface 904 enable a communication connection within the device with each other through a bus 905.
An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the method for digitally signing a multimedia file according to the first aspect or the method for verifying a multimedia file according to the second aspect.
The memory, as a non-transitory computer-readable storage medium, may be used to store non-transitory software programs as well as non-transitory computer-executable programs. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The method, the device and the storage medium for digitally signing and verifying the multimedia file are characterized in that a server divides the acquired multimedia file to obtain preset fragmentation samples, determines a first hash value according to the data size and the offset, determines data to be signed according to the data size, the offset and the first hash value, signs the data to be signed, integrates the data to be signed with the signature data and sends the data to a client together with a decryption public key according to the data size, the offset, the first hash value and the signature data; the multimedia file and the signature public key are received at the client, a playing instruction is responded, the public key is used for verifying the multimedia file, then the hash value corresponding to the preset fragmentation sample is verified according to the data size and the offset, and when the hash value corresponding to the preset fragmentation sample passes verification, the content corresponding to the sample is played. The hash value corresponding to the content of the source file is calculated instead of the whole source file by using the two types of information such as the data size and the offset to divide the sample, so that the hash operation speed is improved, the asynchronous processing of quickly generating the verification information at the server side and realizing verification and playing at the client side is realized, the hash calculation of the whole multimedia file is avoided consuming too much time, the verification time is reduced, the verification process is optimized, and the verification efficiency is improved.
The embodiments described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation to the technical solutions provided in the embodiments of the present application, and it is obvious to those skilled in the art that the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems with the evolution of technology and the emergence of new application scenarios.
It will be appreciated by those skilled in the art that the embodiments shown in the figures are not intended to limit the embodiments of the present application and may include more or fewer steps than those shown, or some of the steps may be combined, or different steps may be included.
One of ordinary skill in the art will appreciate that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof.
The terms "first," "second," "third," "fourth," and the like (if any) in the description of the present application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the above-described device is only one implementation division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes multiple instructions for causing a computer device (which may be a personal computer, a server, or a network device) to perform all or part of the steps of the method of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing programs, such as a usb disk, a portable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The preferred embodiments of the present application have been described above with reference to the accompanying drawings, and the scope of the claims of the embodiments of the present application is not limited thereby. Any modifications, equivalents and improvements that may occur to those skilled in the art without departing from the scope and spirit of the embodiments of the present application are intended to be within the scope of the claims of the embodiments of the present application.

Claims (10)

1. A multimedia file digital signature method is applied to a server side, and is characterized by comprising the following steps:
acquiring a multimedia file;
dividing the multimedia file based on a preset fragment size to obtain a plurality of preset fragment samples;
determining a first hash value corresponding to each preset fragmentation sample according to the data size of each preset fragmentation sample and the offset relative to the starting position of the multimedia file;
determining data to be signed corresponding to the multimedia file according to the data size, the offset and the first hash value of each preset fragmentation sample;
signing the data to be signed according to a preset signature private key to obtain signature verification information corresponding to the multimedia file;
and taking the signature verification information and the data size, the offset and the first hash value corresponding to each preset fragmentation sample as target verification information of the multimedia file, and sending the multimedia file, the target verification information and a signature public key corresponding to the signature private key to a client.
2. The method for digitally signing a multimedia file according to claim 1, wherein before the multimedia file is divided based on a predetermined tile size to obtain a plurality of predetermined tile samples, the method comprises:
acquiring a file unit list of the multimedia file, wherein the file unit list comprises a plurality of data storage units;
the dividing processing of the multimedia file based on the preset fragment size to obtain a plurality of preset fragment samples comprises the following steps:
when the data size of the data storage unit is larger than a preset fragmentation size, dividing the data storage unit according to the preset fragmentation size to obtain a plurality of preset fragmentation samples;
or when the data size of the data storage unit is smaller than or equal to a preset fragmentation size, taking the data storage unit as a preset fragmentation sample.
3. The method according to claim 2, wherein the determining the first hash value corresponding to each of the predetermined fragmentation samples according to the data size of each of the predetermined fragmentation samples and the offset from the start position of the multimedia file comprises:
determining a first hash value corresponding to each preset fragmentation sample according to the data size, the offset and the playing time information of each preset fragmentation sample;
the determining data to be signed corresponding to the multimedia file according to the data size, the offset and the first hash value of each preset fragmentation sample comprises:
determining data to be signed corresponding to the multimedia file according to the data size, the offset, the first hash value and the playing time information of each preset fragmentation sample;
the taking the signature verification information and the data size, the offset and the first hash value corresponding to each preset fragmentation sample as target verification information of the multimedia file includes:
and taking the signature verification information and the data size, the offset, the first hash value and the playing time information corresponding to each preset slicing sample as target verification information of the multimedia file.
4. The method of claim 1, wherein sending the multimedia file, the target verification information, and the public signature key corresponding to the private signature key to a client comprises:
generating a verification file corresponding to the multimedia file according to the target verification information;
sending the multimedia file, the verification file and a signature public key corresponding to the signature private key to a client; alternatively, the first and second electrodes may be,
writing the target verification information into the multimedia file;
and sending the multimedia file carrying the target verification information and the signature public key corresponding to the signature private key to a client.
5. The method for digitally signing a multimedia file according to claim 1, wherein the determining the first hash value corresponding to each of the predetermined fragmentation samples according to the data size of each of the predetermined fragmentation samples and the offset from the start position of the multimedia file comprises:
acquiring sample data corresponding to each preset slicing sample from the multimedia file according to the data size of each preset slicing sample and the offset relative to the starting position of the multimedia file;
and performing hash calculation on the sample data corresponding to each preset fragmentation sample to obtain a first hash value corresponding to each preset fragmentation sample.
6. A multimedia file verification method is applied to a client side, and is characterized by comprising the following steps:
receiving a multimedia file, target verification information and a signature public key from a server, wherein the target verification information comprises signature verification information, data sizes corresponding to preset fragmentation samples in the multimedia file, an offset relative to the starting position of the multimedia file and a first hash value;
responding to a playing instruction of the multimedia file, playing the multimedia file, and performing signature verification processing on the signature verification information based on the signature public key to obtain a signature verification result corresponding to the multimedia file; when the signature verification result is characterized and verified to pass, performing hash verification processing on each preset fragmentation sample in sequence, wherein the hash verification processing comprises:
determining a second hash value corresponding to each preset fragmentation sample according to the data size of the preset fragmentation sample and the offset relative to the starting position of the multimedia file;
comparing a second hash value corresponding to the preset fragmentation sample with the first hash value to obtain a hash verification result corresponding to the preset fragmentation sample;
and when the hash verification result corresponding to the preset fragmentation sample represents that the verification fails, stopping playing the multimedia file.
7. The method for validating a multimedia file according to claim 6, wherein the target validation information further includes playing time information corresponding to each of the predetermined slicing samples;
the hash verification processing of each preset fragmentation sample includes:
and sequentially carrying out Hash verification processing on each preset fragmentation sample according to the playing time sequence based on the playing time information corresponding to each preset fragmentation sample.
8. The method of claim 7, wherein after comparing the second hash value corresponding to the predetermined slicing sample with the first hash value to obtain a hash verification result, the method further comprises:
updating a preset verification state record table according to a hash verification result corresponding to the preset fragmentation sample, wherein the verification state record table is used for recording the hash verification state of each preset fragmentation sample;
in the playing process of the multimedia file, the method further comprises the following steps:
responding to a jump playing instruction of the multimedia file, and determining a target slicing sample according to a playing time point corresponding to the jump playing instruction and playing time information corresponding to each preset slicing sample, wherein the target slicing sample is a preset slicing sample corresponding to the playing time point;
obtaining a hash verification state corresponding to the target fragment sample from the verification state record table;
when the hash verification state representation corresponding to the target fragment sample passes verification, playing the multimedia file from the playing time point;
or when the hash verification state representation corresponding to the target fragmentation sample is not verified, performing hash verification processing on the target fragmentation sample.
9. An electronic device, characterized in that the electronic device comprises a memory storing a computer program and a processor implementing the method of any of claims 1 to 8 when the processor executes the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method of any one of claims 1 to 8.
CN202211297150.4A 2022-10-21 2022-10-21 Multimedia file digital signature and verification method, equipment and storage medium Pending CN115934648A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211297150.4A CN115934648A (en) 2022-10-21 2022-10-21 Multimedia file digital signature and verification method, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211297150.4A CN115934648A (en) 2022-10-21 2022-10-21 Multimedia file digital signature and verification method, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115934648A true CN115934648A (en) 2023-04-07

Family

ID=86554801

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211297150.4A Pending CN115934648A (en) 2022-10-21 2022-10-21 Multimedia file digital signature and verification method, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115934648A (en)

Similar Documents

Publication Publication Date Title
US9870508B1 (en) Securely authenticating a recording file from initial collection through post-production and distribution
CN111628868B (en) Digital signature generation method and device, computer equipment and storage medium
US20210209373A1 (en) Media authentication using distributed ledger
WO2020233373A1 (en) Application configuration file management method and device
US20160127131A1 (en) Distributed Validation of Digitally Signed Electronic Documents
WO2022052630A1 (en) Method and apparatus for processing multimedia information, and electronic device and storage medium
CN111177801B (en) Signature method and device of electronic document, storage medium and electronic equipment
US8819361B2 (en) Retaining verifiability of extracted data from signed archives
CN105391717A (en) APK signature authentication method and APK signature authentication system
US11449584B1 (en) Generating authenticable digital content
CN106789091B (en) Method and device for realizing Open XML document digital signature and signature verification
CN107888591B (en) Method and system for electronic data preservation
US20140237252A1 (en) Techniques for validating data exchange
EP3819802A1 (en) Data consistency checking method and data uploading/downloading apparatus
CN113452526B (en) Electronic file certification method, verification method and corresponding devices
CN116015945A (en) Electronic file secure transmission method, system and medium based on electronic signature
CN107171808B (en) A kind of verification method and device of electronic record authenticity
CN112149168A (en) File data encryption method and device and electronic equipment
CN110826091A (en) File signature method and device, electronic equipment and readable storage medium
CN104168117A (en) Voice digital signature method
CN116032613A (en) Block chain digital certificate exchange method, file storage access method and system
CN115952560A (en) Method, system, equipment and medium for verifying authenticity of electronic archive file based on original handwriting signature
CN114785524A (en) Electronic seal generation method, device, equipment and medium
CN102340399A (en) Information processing apparatus and information processing method
CN108563396B (en) Safe cloud object storage method

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