Nothing Special   »   [go: up one dir, main page]

CN111372023B - Code stream encryption and decryption method and device - Google Patents

Code stream encryption and decryption method and device Download PDF

Info

Publication number
CN111372023B
CN111372023B CN201811589437.8A CN201811589437A CN111372023B CN 111372023 B CN111372023 B CN 111372023B CN 201811589437 A CN201811589437 A CN 201811589437A CN 111372023 B CN111372023 B CN 111372023B
Authority
CN
China
Prior art keywords
face
data
code stream
processed
face model
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.)
Active
Application number
CN201811589437.8A
Other languages
Chinese (zh)
Other versions
CN111372023A (en
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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201811589437.8A priority Critical patent/CN111372023B/en
Publication of CN111372023A publication Critical patent/CN111372023A/en
Application granted granted Critical
Publication of CN111372023B publication Critical patent/CN111372023B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3226Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using a predetermined code, e.g. password, passphrase or PIN
    • H04L9/3231Biological data, e.g. fingerprint, voice or retina
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4405Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving video stream decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4408Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving video stream encryption, e.g. re-encrypting a decrypted video stream for redistribution in a home network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/441Acquiring end-user identification, e.g. using personal code sent by the remote control or by inserting a card
    • H04N21/4415Acquiring end-user identification, e.g. using personal code sent by the remote control or by inserting a card using biometric characteristics of the user, e.g. by voice recognition or fingerprint scanning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • H04N5/91Television signal processing therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Human Computer Interaction (AREA)
  • Biomedical Technology (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biodiversity & Conservation Biology (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Collating Specific Patterns (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The embodiment of the application provides a code stream encryption and decryption method and device, in the scheme, face data are stored in the code stream, namely the face data are used for encrypting the code stream, so that a user does not need to memorize a secret key, and convenience is improved. In addition, when the code stream is decrypted, the face data to be verified is matched with the face data in the code stream, if the matching is successful, the decryption is successful, namely, the code stream is verified through the face data, and compared with a secret key, the face data is higher in safety.

Description

Code stream encryption and decryption method and device
Technical Field
The present application relates to the field of video processing technologies, and in particular, to a method and an apparatus for encrypting and decrypting a code stream.
Background
In order to improve security, in some cases, the recorded code stream needs to be encrypted. In the related scheme, the code stream is mostly encrypted by an AES (Advanced Encryption Standard). The encryption method needs to provide a key for the user, the key is usually complex, and the user is easy to forget, which brings great inconvenience to the user.
Disclosure of Invention
The embodiment of the application aims to provide a method and a device for encrypting and decrypting a code stream so as to improve convenience.
In order to achieve the above object, an embodiment of the present application provides a code stream encryption method, including:
acquiring face data and a code stream to be processed;
and storing the face data into the code stream to be processed.
Optionally, the acquiring the face data includes:
acquiring a face image to be processed;
carrying out face modeling on the face image to be processed by using a face recognition algorithm to obtain modeling data;
and storing the modeling data through a preset structural body to obtain the face data.
Optionally, the acquiring the face image to be processed includes:
acquiring a face image to be processed from a pre-stored image;
or, carrying out face acquisition on authorized personnel to obtain a face image to be processed.
Optionally, the storing the face data into the code stream to be processed includes:
and storing the face data between the head of the code stream to be processed and the video data.
In order to achieve the above object, an embodiment of the present application further provides a method for decrypting a code stream, including:
acquiring a code stream to be played, and reading face data in the code stream to be played;
acquiring face data to be verified, and matching the face data to be verified with the read face data;
if the matching is successful, the decoding of the code stream to be played is successful.
Optionally, the acquiring the face data to be verified includes:
acquiring a face image of a person to be checked;
and performing face modeling on the acquired face image by using a face recognition algorithm to obtain the data of the face to be verified.
Optionally, the code stream to be played includes multiple pieces of face data; the matching of the face data to be verified and the read face data comprises:
and matching the face data to be verified with each face data in the code stream to be played, wherein if the face data matched with the face data to be verified exists in the code stream to be played, the matching is successful.
Optionally, under the condition that the matching between the face data to be verified and the read face data is successful, the method further includes:
and playing the video data in the code stream to be played.
In order to achieve the above object, an embodiment of the present application further provides a code stream encryption apparatus, including:
the first acquisition module is used for acquiring face data;
the second acquisition module is used for acquiring the code stream to be processed;
and the encryption module is used for storing the face data into the code stream to be processed.
Optionally, the first obtaining module includes:
the acquisition submodule is used for acquiring a face image to be processed;
the modeling submodule is used for carrying out face modeling on the face image to be processed by utilizing a face recognition algorithm to obtain modeling data;
and the storage submodule is used for storing the modeling data through a preset structural body to obtain the face data.
Optionally, the obtaining sub-module is specifically configured to: acquiring a face image to be processed from a pre-stored image; or, carrying out face acquisition on authorized personnel to obtain a face image to be processed.
Optionally, the encryption module is specifically configured to:
and storing the face data between the head of the code stream to be processed and the video data.
In order to achieve the above object, an embodiment of the present application further provides a device for decrypting a code stream, including:
the third acquisition module is used for acquiring the code stream to be played and reading the face data in the code stream to be played;
the fourth acquisition module is used for acquiring the face data to be checked;
the matching module is used for matching the face data to be verified with the read face data; if the matching is successful, the decoding of the code stream to be played is successful.
Optionally, the fourth obtaining module is specifically configured to:
acquiring a face image of a person to be checked;
and performing face modeling on the acquired face image by using a face recognition algorithm to obtain the data of the face to be verified.
Optionally, the matching module is specifically configured to:
and matching the face data to be verified with each face data in the code stream to be played, wherein if the face data matched with the face data to be verified exists in the code stream to be played, the matching is successful.
Optionally, the apparatus further comprises:
and the playing module is used for playing the video data in the code stream to be played under the condition that the matching between the face data to be verified and the read face data is successful.
In order to achieve the above object, an embodiment of the present application further provides an electronic device, including a processor and a memory;
a memory for storing a computer program;
and the processor is used for realizing any one of the code stream encryption method or the code stream decryption method when executing the program stored in the memory.
In the embodiment of the application, the face data is stored in the code stream, namely the code stream is encrypted by using the face data, so that a user does not need to memorize a secret key, and the convenience is improved. In addition, when the code stream is decrypted, the face data to be verified is matched with the face data in the code stream, if the matching is successful, the decryption is successful, namely, the code stream is verified through the face data, and compared with a secret key, the face data is higher in safety.
Of course, not all advantages described above need to be achieved at the same time in the practice of any one product or method of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application 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 application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a code stream encryption method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a second flow chart of a code stream encryption method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a first method for decrypting a code stream according to an embodiment of the present application;
fig. 4 is a schematic flowchart of a second method for decrypting a code stream according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a code stream encryption apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a code stream decryption apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, 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 application.
In order to solve the above technical problem, embodiments of the present application provide a method and an apparatus for encrypting and decrypting a code stream. The encryption method and apparatus may be applied to various electronic devices such as a PC (personal computer), a mobile phone, a tablet computer, and a server, and are not particularly limited. The decryption method and apparatus may be applied to various electronic devices such as a PC (personal computer), a mobile phone, a tablet computer, and a server, and are not particularly limited. First, a detailed description is given below of a code stream encryption method provided in the embodiment of the present application.
Fig. 1 is a schematic flowchart of a first flow of a codestream encryption method provided in an embodiment of the present application, and for convenience of description, an execution subject in the embodiment of fig. 1 is referred to as an encryption device. Fig. 1 includes the following steps:
s101: and acquiring face data and a code stream to be processed.
In one case, the user may select whether to encrypt the code stream, if the user selects encryption, the embodiment shown in fig. 1 is performed, and if the user selects no encryption, the code stream may be directly packaged and stored.
The code stream to be processed is a code stream that needs to be encrypted, for example, the code stream may be a code stream previewed in real time or a code stream played back remotely, which is not limited specifically.
The face data acquired in S101 may be understood as face data of an authorized person. The acquisition mode of the face data may include: acquiring a face image to be processed; carrying out face modeling on the face image to be processed by using a face recognition algorithm to obtain modeling data; and storing the modeling data through a preset structural body to obtain the face data.
In one case, a face image to be processed can be obtained from a pre-stored image; or, in another case, the face of the authorized person may be acquired to obtain the face image to be processed.
For example, a face image of an authorized person may be locally searched in the encryption device as a face image to be processed. For another example, the encryption device may be connected to a camera, or the encryption device may have a built-in camera, and the camera collects a face image of an authorized person as a face image to be processed.
In one case, the locally located face image to be processed may be JPEG (Joint Photographic Experts Group) format data, and the face image to be processed collected by the camera may be YUV (Y represents brightness, and U and V represent chroma and concentration) format data.
And then, carrying out face modeling on the obtained face image to be processed by using a face recognition algorithm to obtain modeling data. In one case, the modeling data can be stored through a preset structure body to obtain face data; alternatively, the modeling data may be stored in other forms. For the purpose of distinguishing the description, the stored modeling data is referred to as face data.
For example, the predetermined structure may be as follows:
# define MOEL _ MAX _ SUM 1024// maximum number of face models supported
// face model result structure
typedef struct_FACE_RESULT_
{
Signaled int nModelSum; // total number of face models
FACE _ MODEL stFaceModel [ MOEL _ MAX _ SUM ]; // face model data summation
}FACE_RESULT;
The nModelSum represents the total number of the face models, and the stFaceModel is used for storing corresponding data of each face model.
The face model data can be an unscheduled char array with a maximum of 256, and can be specifically represented by the following structural body:
# define MODEL _ MAX _ SIZE 256// face MODEL data SIZE MAX support 256
V/face model Structure
typedef struct_FACE_MODLE_
{
Designed int nModelSize; // face model size
An unused char strModel [ MODEL _ MAX _ SIZE ]; // face model data
}FACE_MODLE;
As shown in the FACE _ mode structure, the FACE recognition algorithm may return and store the resulting modeling data into a strModel array, where nModelSize represents the FACE model size.
The above-described structure is merely an example, and does not limit the embodiments of the present application. The specific data such as the size of the array, the number of the supported face models, the size of the face model data and the like in the structure body are not limited.
If only one piece of face model data is obtained, the total number nModelSum of the face models in the structure is 1.
S102: and storing the face data into the code stream to be processed.
As an embodiment, S102 may include: and storing the face data between the head of the code stream to be processed and the video data. Alternatively, the face data may be stored in other positions of the code stream, such as before the header, or after the video data, and the like, and the specific position of the face data in the code stream is not limited.
Continuing with the above example of the structure, the FACE data can be completely stored in the code stream by the FACE _ mode structure and the FACE _ RESULT structure. For example, assuming that the bitstream header includes 40 bytes, the first stFaceModel may be stored after the 40 bytes by storing nModelSum with 4 bytes, storing nModelSize with 4 bytes, and storing strModel with 256 bytes. The storage of other stFaceModels may then continue in this manner until the nModelSum stFaceModel stores are complete. After the nModelSum stfacemodels, the video data in the bitstream is packetized and stored, for example, the video data may be packetized and stored in a PS (Program Stream) encapsulation manner.
And storing the face data into the code stream, namely encrypting the code stream. In the scheme, the code stream is encrypted by using the face data, so that a user does not need to memorize a secret key, and convenience is improved.
One specific embodiment is described below with reference to fig. 2:
firstly, starting a video recording function, and selecting whether to encrypt a video code stream by a user; if not, the code stream is directly stored in a PS packaging form. If encrypted, a face input source is selected, which may include a local image of the encryption device and a camera preview image. After the face input source is selected, a face recognition algorithm is started, a face image input by the input source is transmitted into the face recognition algorithm, face modeling is carried out, and the face modeling can support 256 face inputs at most. After modeling is completed, the face recognition algorithm returns modeling data, and the modeling data can be stored in the form of the structural body. And storing the structure body into a video code stream to obtain an encrypted code stream.
Fig. 3 is a first flowchart of the code stream decryption method provided in the embodiment of the present application, and for convenience of description, an execution main body in the embodiment of fig. 3 is referred to as a playing device. Fig. 3 includes the following steps:
s301: and acquiring a code stream to be played, and reading the face data in the code stream to be played.
For example, after the embodiment shown in fig. 1 of the present application is used to obtain a code stream including face data, the code stream may be transmitted to a playing device as a code stream to be played. Alternatively, the encryption device and the playback device may be the same device, and are not limited specifically. Or, the playing device may also obtain the code stream including the face data in other manners.
In the above one embodiment, the modeling data is stored by a preset structure to obtain face data, and the face data is stored in the code stream; in this case, the code stream may be analyzed according to the structure, and then the face data in the code stream may be read.
For example, 4 bytes of nModelSum may be parsed first, and how many FACE _ modes are stored in the codestream may be learned through nModelSum; and then, analyzing each FACE _ mode respectively to obtain FACE model data, wherein the FACE model data belongs to FACE data.
S302: and acquiring the face data to be verified, and matching the face data to be verified with the read face data.
The face data to be verified is the face data of the person to be authenticated, the face data in the code stream to be played is the face data of the authorized person, and the face data to be verified is matched with the read face data, namely, whether the person to be authenticated is the authorized person is judged.
As an embodiment, the acquiring the face data to be verified may include: acquiring a face image of a person to be checked; and performing face modeling on the acquired face image by using a face recognition algorithm to obtain the data of the face to be verified.
In one case, the face image of the person to be verified can be obtained from the pre-stored image; or, in another case, the face of the person to be verified can be acquired to obtain a face image of the person to be verified.
For example, the face image of the person to be verified can be searched locally in the playing device. For another example, the playing device may be connected to a camera, or the playing device may have a built-in camera that collects a face image of the person to be verified. In one case, the locally found face image may be JPEG format data, and the face image collected by the camera may be YUV format data.
And then, carrying out face modeling on the obtained face image by using a face recognition algorithm to obtain the data of the face to be verified. In one case, the obtained face data to be verified can be directly matched with the face data in the code stream to be played.
Or, in another case, the obtained face data to be verified may be stored first, and then the stored face data to be verified is matched with the face data in the code stream to be played. The FACE data to be verified can be stored through the structure, for example, the parsed model data can be stored in a local FACE _ RESULT of the playback device.
As an implementation manner, the code stream to be played may include multiple pieces of face data; matching the face data to be verified with the read face data may include: and matching the face data to be verified with each face data in the code stream to be played, wherein if the face data matched with the face data to be verified exists in the code stream to be played, the matching is successful.
For example, there may be a plurality of authorized persons, and the code stream includes face data of the plurality of authorized persons; in this case, the face data to be verified may be respectively matched with the face data of each authorized person, and if the face data is matched with the face data of one authorized person, it indicates that the matching is successful. Thus, one-to-many face matching is achieved.
S303: if the matching is successful, the decoding of the code stream to be played is successful.
As an implementation manner, under the condition that the matching between the face data to be verified and the read face data is successful, the video data in the code stream to be played can also be played.
It can be understood that after the stream decryption succeeds, operations such as parsing, decoding, rendering, and playing of video data in the stream can be performed, which are not described in detail herein.
Or, successful matching can also be understood as that the code stream passes the verification. If the matching in the S302 is unsuccessful, it indicates that the code stream is not verified, and the video data in the code stream is not played. In one case, if the matching in S302 is unsuccessful, a message of decryption failure may be returned.
When the embodiment is applied to decryption of a code stream, on the first hand, the face data to be verified is matched with the face data in the code stream, if the matching is successful, the decryption is successful, that is, the code stream is verified through the face data, and the face data has higher safety compared with a secret key.
In the related scheme, the code stream is encrypted in an AES mode, the encryption mode needs to provide a secret key for a user, the secret key is easily stolen by an illegal user, and by applying the embodiment, the code stream is verified through the face data, the face data is not easily stolen, so that the safety is higher.
In the second aspect, the accuracy of the face recognition algorithm is high, so that the accuracy of checking the code stream (judging whether to play the code stream) is high. In the third aspect, by using the playing code stream of the embodiment, the user does not need to memorize the key, thereby improving the convenience.
One specific embodiment is described below with reference to fig. 4:
and starting the encrypted video playing, and analyzing the face model data (the face model data belongs to the face data) from the encrypted video code stream. Specifically, the 4 bytes of nModelSum may be parsed from the encrypted video stream, where nModelSum FACE _ mode is stored in the stream. And analyzing the FACE _ MODEL one by one, and storing the human FACE model data obtained after analysis into the local FACE _ RESULT of the playing equipment. Then, selecting a mode for acquiring the face data to be checked, wherein the acquiring mode can comprise: and selecting a local image of the playing device, or acquiring YUV data by starting a camera for previewing. And starting a face recognition algorithm, transmitting the acquired face data to be verified into the face recognition algorithm, executing face modeling operation, and performing traversal model comparison on the model data obtained by modeling and the face model data analyzed from the video code stream. If the comparison is successful, the decryption is successful, and the video code stream is analyzed, decoded and rendered for playing. If the comparison fails, the decryption fails, and the playing failure can be returned.
Corresponding to the foregoing method embodiment, an embodiment of the present application further provides a code stream encryption apparatus, as shown in fig. 5, including:
a first obtaining module 501, configured to obtain face data;
a second obtaining module 502, configured to obtain a code stream to be processed;
and the encryption module 503 is configured to store the face data into the code stream to be processed.
As an implementation manner, the first obtaining module 501 includes: an acquisition sub-module, a modeling sub-module, and a storage sub-module (not shown), wherein,
the acquisition submodule is used for acquiring a face image to be processed;
the modeling submodule is used for carrying out face modeling on the face image to be processed by utilizing a face recognition algorithm to obtain modeling data;
and the storage submodule is used for storing the modeling data through a preset structural body to obtain the face data.
As an embodiment, the obtaining submodule is specifically configured to: acquiring a face image to be processed from a pre-stored image; or, carrying out face acquisition on authorized personnel to obtain a face image to be processed.
As an embodiment, the encryption module 503 is specifically configured to:
and storing the face data between the head of the code stream to be processed and the video data.
By applying the embodiment shown in fig. 5 of the application, the code stream is encrypted by using the face data, so that a user does not need to memorize a secret key, and the convenience is improved.
Corresponding to the foregoing method embodiment, an embodiment of the present application further provides a device for decrypting a code stream, as shown in fig. 6, including:
a third obtaining module 601, configured to obtain a code stream to be played, and read face data in the code stream to be played;
a fourth obtaining module 602, configured to obtain face data to be verified;
a matching module 603, configured to match the face data to be verified with the read face data; if the matching is successful, the decoding of the code stream to be played is successful.
As an embodiment, the fourth obtaining module 602 is specifically configured to:
acquiring a face image of a person to be checked; and performing face modeling on the acquired face image by using a face recognition algorithm to obtain the data of the face to be verified.
As an embodiment, the matching module 603 is specifically configured to:
and matching the face data to be verified with each face data in the code stream to be played, wherein if the face data matched with the face data to be verified exists in the code stream to be played, the matching is successful.
As an embodiment, the apparatus further comprises:
and a playing module (not shown in the figure) for playing the video data in the code stream to be played under the condition that the matching between the face data to be verified and the read face data is successful.
When the embodiment is applied to decryption of a code stream, on the first hand, the face data to be verified is matched with the face data in the code stream, if the matching is successful, the decryption is successful, that is, the code stream is verified through the face data, and the face data has higher safety compared with a secret key. In the second aspect, the accuracy of the face recognition algorithm is high, so that the accuracy of checking the code stream (judging whether to play the code stream) is high. In the third aspect, by using the playing code stream of the embodiment, the user does not need to memorize the key, thereby improving the convenience.
Embodiments of the present application also provide an electronic device, as shown in fig. 7, including a processor 701 and a memory 702,
a memory 702 for storing a computer program;
the processor 701 is configured to implement any one of the above-described methods for encrypting and/or decrypting a code stream when executing the program stored in the memory 702.
The Memory mentioned in the electronic device may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), for example, at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements any one of the above methods for encrypting and/or decrypting a code stream.
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. Also, 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 a … …" does not exclude the presence of another identical element in a 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 differences from other embodiments. In particular, as for the apparatus embodiment, the device embodiment and the computer-readable storage medium embodiment, since they are substantially similar to the method embodiment, the description is relatively simple, and the relevant points can be referred to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (12)

1. A code stream encryption method is characterized by comprising the following steps:
acquiring a code stream to be processed;
starting a video recording function, and selecting whether to encrypt the code stream to be processed by a user;
if not, storing the code stream to be processed in a packaging form;
if the face image is encrypted, selecting a face input source and acquiring a face image to be processed;
carrying out face modeling on the face image to be processed by using a face recognition algorithm to obtain modeling data;
storing the modeling data through a preset structural body to obtain face data, wherein the preset structural body comprises: the face model structure, the face model result structure and the maximum number of the face model structures supported by the face model result structure, each face model structure is used for storing corresponding modeling data, and the face model structure comprises: the face model result structure is used for storing each face model structure, and the face model result structure comprises: each stored face model structure and the total number of the stored face model structures;
storing the face data into the code stream to be processed;
and packaging the code stream to be processed, which stores the face data, by adopting a program stream PS packaging mode.
2. The method according to claim 1, wherein the acquiring the face image to be processed comprises:
acquiring a face image to be processed from a prestored image;
or, carrying out face acquisition on authorized personnel to obtain a face image to be processed.
3. The method according to claim 1, wherein the storing the face data into the codestream to be processed comprises:
and storing the face data between the head of the code stream to be processed and the video data.
4. A method for decrypting a code stream, comprising:
acquiring a code stream to be played, which is packaged in a program stream PS packaging mode, and reading face data in the code stream to be played; the face data is obtained by encrypting a code stream to be processed selected by a user, selecting a face input source, performing face modeling on a face image to be processed input by the face input source by using a face recognition algorithm to obtain modeling data, and storing the modeling data through a preset structure, wherein the preset structure comprises: the face model structure, the face model result structure and the maximum number of the face model structures supported by the face model result structure, each face model structure is used for storing corresponding modeling data, and the face model structure comprises: the face model result structure is used for storing each face model structure, and the face model result structure comprises: each stored face model structure and the total number of the stored face model structures;
acquiring a face image of a person to be checked; carrying out face modeling on the acquired face image by using a face recognition algorithm to obtain face data to be verified, and matching the face data to be verified with the read face data;
if the matching is successful, the decoding of the code stream to be played is successful.
5. The method according to claim 4, wherein the code stream to be played comprises a plurality of pieces of face data; the matching of the face data to be verified and the read face data includes:
and matching the face data to be verified with each face data in the code stream to be played, and if the face data matched with the face data to be verified exists in the code stream to be played, indicating that the matching is successful.
6. The method according to claim 4, wherein in case that the matching between the face data to be verified and the read face data is successful, the method further comprises:
and playing the video data in the code stream to be played.
7. A code stream encryption apparatus, comprising:
the second acquisition module is used for acquiring the code stream to be processed;
the first acquisition module is used for starting a video recording function and selecting whether to encrypt the code stream to be processed by a user; if not, storing the code stream to be processed in a packaging form; if the data is encrypted, selecting a face input source and acquiring face data;
the encryption module is used for storing the face data into the code stream to be processed and packaging the code stream to be processed, in which the face data is stored, in a program stream PS (packet switched) packaging mode;
wherein, the first obtaining module comprises:
the acquisition submodule is used for acquiring a face image to be processed;
the modeling submodule is used for carrying out face modeling on the face image to be processed by utilizing a face recognition algorithm to obtain modeling data;
the storage submodule is used for storing the modeling data through a preset structural body to obtain face data, wherein the preset structural body comprises: the face model structure, the face model result structure and the maximum number of the face model structures supported by the face model result structure, each face model structure is used for storing corresponding modeling data, and the face model structure comprises: the face model result structure is used for storing each face model structure, and the face model result structure comprises: the stored individual face model structures and the total number of stored face model structures.
8. The apparatus of claim 7, wherein the obtaining submodule is specifically configured to: acquiring a face image to be processed from a pre-stored image; or, carrying out face acquisition on authorized personnel to obtain a face image to be processed.
9. The apparatus according to claim 7, wherein the encryption module is specifically configured to:
and storing the face data between the head of the code stream to be processed and the video data.
10. A stream decryption apparatus, comprising:
the third acquisition module is used for acquiring the code stream to be played, which is packaged in a program stream PS packaging mode, and reading the face data in the code stream to be played; the face data is obtained by encrypting a code stream to be processed selected by a user, selecting a face input source, performing face modeling on a face image to be processed input by the face input source by using a face recognition algorithm to obtain modeling data, and storing the modeling data through a preset structure, wherein the preset structure comprises: the face model structure, the face model result structure and the maximum number of the face model structures supported by the face model result structure, each face model structure is used for storing corresponding modeling data, and the face model structure comprises: the face model result structure is used for storing each face model structure, and the face model result structure comprises: each stored face model structure and the total number of the stored face model structures;
the fourth acquisition module is used for acquiring a face image of the person to be verified; carrying out face modeling on the acquired face image by using a face recognition algorithm to obtain face data to be verified;
the matching module is used for matching the face data to be verified with the read face data; if the matching is successful, the decoding of the code stream to be played is successful.
11. The apparatus of claim 10, wherein the matching module is specifically configured to:
and matching the face data to be verified with each face data in the code stream to be played, wherein if the face data matched with the face data to be verified exists in the code stream to be played, the matching is successful.
12. The apparatus of claim 10, further comprising:
and the playing module is used for playing the video data in the code stream to be played under the condition that the face data to be checked is successfully matched with the read face data.
CN201811589437.8A 2018-12-25 2018-12-25 Code stream encryption and decryption method and device Active CN111372023B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811589437.8A CN111372023B (en) 2018-12-25 2018-12-25 Code stream encryption and decryption method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811589437.8A CN111372023B (en) 2018-12-25 2018-12-25 Code stream encryption and decryption method and device

Publications (2)

Publication Number Publication Date
CN111372023A CN111372023A (en) 2020-07-03
CN111372023B true CN111372023B (en) 2023-04-07

Family

ID=71211347

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811589437.8A Active CN111372023B (en) 2018-12-25 2018-12-25 Code stream encryption and decryption method and device

Country Status (1)

Country Link
CN (1) CN111372023B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101221612A (en) * 2007-01-11 2008-07-16 上海银晨智能识别科技有限公司 Method for enciphering and deciphering electric document file by face recognition
CN104159116A (en) * 2014-08-26 2014-11-19 江苏瑞奥风软件科技有限公司 Method of adding face recognition information into H264 video stream

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006115195A (en) * 2004-10-14 2006-04-27 Toshiba Corp Portable recording/reproducing device, recording/reproducing system, and recording/reproducing method
FR2932045B1 (en) * 2008-06-03 2010-08-20 Thales Sa METHOD AND SYSTEM FOR PROTECTING THE DATA CONFIDENTIALITY OF A VIDEO STREAM DURING ITS TRANSMISSION
CN104821942B (en) * 2015-04-22 2017-11-14 广州大学 Face identification method and system
CN105760817A (en) * 2016-01-28 2016-07-13 深圳泰首智能技术有限公司 Method and device for recognizing, authenticating, unlocking and encrypting storage space by using human face
CN107066983B (en) * 2017-04-20 2022-08-09 腾讯科技(上海)有限公司 Identity verification method and device
CN107221094A (en) * 2017-08-09 2017-09-29 电子科技大学 A kind of information encryption and identification system for unmanned delivery equipment
CN108347629A (en) * 2018-03-16 2018-07-31 中影数字巨幕(北京)有限公司 Video file processing method, device, server and storage medium
CN108810570A (en) * 2018-06-08 2018-11-13 安磊 Artificial intelligence video gene encryption method, device and equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101221612A (en) * 2007-01-11 2008-07-16 上海银晨智能识别科技有限公司 Method for enciphering and deciphering electric document file by face recognition
CN104159116A (en) * 2014-08-26 2014-11-19 江苏瑞奥风软件科技有限公司 Method of adding face recognition information into H264 video stream

Also Published As

Publication number Publication date
CN111372023A (en) 2020-07-03

Similar Documents

Publication Publication Date Title
JP4755189B2 (en) Content encryption method, network content providing system and method using the same
JP4740157B2 (en) Protect digital data content
CN107169374B (en) Encryption and decryption system and method based on voiceprint and voice recognition technology
CN103999090B (en) Improve the startup time of streaming digital media playback
KR20010041400A (en) Transmitting reviews with digital signatures
EP2439672A2 (en) Information processing apparatus, information processing method, and program
CN1581957A (en) Access control for digital video stream data
CN113411638A (en) Video file playing processing method and device, electronic equipment and storage medium
JP2018502524A (en) Encryption control for information, information analysis method, system and terminal
CN101969545A (en) Encryption method and device of multimedia file
CN103237010B (en) The server end of digital content is cryptographically provided
CN110232021A (en) The method and device of page test
CN108431819B (en) Method and system for protecting client access to service of DRM agent of video player
CN108073820A (en) Security processing, device and the mobile terminal of data
US8645687B2 (en) Electronic file access control system and method
CN107809677A (en) A kind of preset Widevine Key of batch in a television set system and method
CN103237011B (en) Digital content encryption transmission method and server end
WO2015196642A1 (en) Data encryption method, decryption method and device
WO2017137481A1 (en) A removable security device and a method to prevent unauthorized exploitation and control access to files
CN111372023B (en) Code stream encryption and decryption method and device
KR101748627B1 (en) Web-based electronic document service apparatus capable of authenticating a document and operating method thereof
CN108595920B (en) Network audio-visual management support copyright service subsystem
KR102236897B1 (en) Video data protection system and method
CN112434327A (en) Information protection method and device and electronic equipment
US11928187B1 (en) Media hosting system employing a secured video stream

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
GR01 Patent grant
GR01 Patent grant