CN108769807A - A kind of video encryption method based on Android platform - Google Patents
A kind of video encryption method based on Android platform Download PDFInfo
- Publication number
- CN108769807A CN108769807A CN201810351588.3A CN201810351588A CN108769807A CN 108769807 A CN108769807 A CN 108769807A CN 201810351588 A CN201810351588 A CN 201810351588A CN 108769807 A CN108769807 A CN 108769807A
- Authority
- CN
- China
- Prior art keywords
- video
- encryption
- file
- encrypted
- saved
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 17
- 238000011017 operating method Methods 0.000 claims abstract description 4
- 230000011218 segmentation Effects 0.000 claims description 7
- 230000000717 retained effect Effects 0.000 claims description 2
- 238000013478 data encryption standard Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000012360 testing method Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/44—Processing 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/4408—Processing 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
- H04L9/0618—Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
- H04L9/0631—Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Multimedia (AREA)
- Mobile Radio Communication Systems (AREA)
- Studio Devices (AREA)
Abstract
The invention discloses a kind of video encryption methods based on Android platform, which is characterized in that operating procedure is as follows:Using mobile phone recorded video, select two ways that video is encrypted, i.e., complete encryption or sectional encryption;If selecting complete cipher mode, after video record terminates, background encryption program reads the video recorded, and video is encrypted using AES, and encryption deletes original after completing, and encrypted video file is saved in specified folder;If selecting sectional encryption mode, after then video record terminates, background encryption program reads the video recorded, the ffmpeg orders being transplanted on Android platform are called to set the key frame of video to every 1s mono-, mp4parser is reused to be split video, finally every section of video is encrypted using AES, is output in a file stream, an encryption file is saved as.The present invention can effectively be encrypted the video of shooting, and encryption/decryption speed is taken into account under the premise of ensureing safety.
Description
Technical field
The present invention relates to a kind of video encryption methods based on Android platform, belong to technical field of video coding.
Background technology
With extensive universal and signal processing technology the rapid development of computer network, digital entertainment is answered as network
One importance, the video data of large information capacity have been more and more widely used.But from digital video supplier
Angle set out, how to ensure only to allow and authorize legal user that can receive digital video services to become a new problem.Such as make
As soon as user only wants to oneself in shooting section video can watch the content of video, he needs to carry out the video of shooting
Then encryption is decrypted it when viewing and then watches, other people do not have key that can not watch the video.It is this to regard
Frequently encrypted method should take into account speed while ensuring safety, for one section of video, when user can not possibly endure colored very long
Between it is encrypted and decrypted, so enciphering rate is also critically important one side.
Invention content
The present invention is directed to the vacancy of Android platform video-encryption, it is proposed that a kind of video-encryption side based on Android platform
Method can effectively be encrypted the video of shooting, and speed is taken into account under the premise of ensureing safety.
To achieve the above objectives, conception of the invention is:
For Encryption Algorithm, asymmetric arithmetic safety is higher, but encrypted speed is very slow, and be suitble to small data quantity adds solution
Close processing;In comparison the safety of symmetry algorithm is lower, but the speed of encryption and decryption is many soon, is suitble to big data quantity
Encryption and decryption processing.So it is relatively good selection that video, which is encrypted, in selection symmetry algorithm, AES is selected in symmetry algorithm
(Advanced Encryption Standard, Advanced Encryption Standard)Algorithm, because it compares DES(Data Encryption
Standard, data encryption standards)Faster, and 256 AES also can guarantee certain safety to arithmetic speed.
According to above-mentioned design, the present invention adopts the following technical scheme that:
A kind of video encryption method based on Android platform, operating procedure are as follows:Using mobile phone recorded video, two ways is selected
Video is encrypted, i.e., complete encryption or sectional encryption;If selecting complete cipher mode, after video record terminates,
Background encryption program reads the video recorded, and video is encrypted using AES, and encryption deletes original after completing, will
Encrypted video file is saved in specified folder;If selecting sectional encryption mode, after video record terminates, after
Platform encipheror reads the video recorded, calls the ffmpeg orders being transplanted on Android platform that the key frame of video is arranged
It for every 1s mono-, reuses mp4parser and is split video, finally every section of video is encrypted using AES, is output to
In one file stream, an encryption file is saved as.
Further, the complete cipher mode of the selection the specific steps are:
1)Video data is acquired by mobile phone camera;
2)Background encryption program reads the video data of acquisition, and as general binary data, the random length that generates is
256 keys are encrypted video using AES, and encryption deletes original video file after completing;
3)Encrypted video file is saved in a specified file, uses video player not play directly at this time
Encrypted video file;
4)When decryption, the encrypted video file to be decrypted is selected, using 256 key pairs used when encrypting, it is decrypted,
Be saved in a specified file, the video after decryption can normal play, duration and quality do not change;Original encryption text
Part, which can be retained, to be deleted.
The advantages of selecting complete cipher mode be:It is easy to operate, do not need additional operation, it is only necessary to which video usually is clapped
Take the photograph the encryption that operates and can be completed to shooting video;Be using the video of AES encryption and the size of original video it is essentially identical, no
The exceptional space of mobile phone can be occupied.
Further, it is described selection sectional encryption mode the specific steps are:
1)Video data is acquired by mobile phone camera;
2)Background encryption program reads video file, calls the ffmpeg being transplanted on Android platform(It can be used for recording, converting
Digital audio, video, and the program of increasing income of stream can be translated into)Order sets the key frame of video to every 1s mono-, makes
It is divided into a sub-video to preserve per 1s according to key frame video with mp4parser, the sub-video after original video segmentation is pressed
It is named successively according to timeline;
3)A file output stream is created, output stream name is identical with the video of recording, reads each section after segmentation in order
Sub-video, the random key for generating length and being 256, is output to same file output after video is encrypted using AES
In stream, these sub-videos can be all deleted after encryption, ensure that safety;It is simultaneously that the data after each cross-talk video-encryption are big
Small to be saved in a text file, the name of text file is consistent with the name of file after encryption, and a list is obtained after encryption
One encrypted video file and a corresponding text information file;
4)When decryption, the encrypted video file to be decrypted is selected, background program is read automatically and this encrypted video file name
Identical text file reads data of corresponding size in encrypted video file and is decrypted according to the data in text file,
Then every section of video is exported, is saved in a specified file, every section of video can be played individually after decryption.
Most of Video coding mode of present mobile phone shooting is all h.264, when adding key frame to it using ffmpeg
There is no problem, can realize per mono- key frame of 1s.But for using the h.265 video of coding mode, it can only be arranged at present
It is split at mono- key frame of 2s, it, can only be by recompiling if the too small of setting will destroy image group therein
It completes.
Compared with prior art, the present invention has the advantage that:
The method of the present invention, which is suitable for the video of h.264 coded format commonly used now and future, to become mainstream h.265
The video of coded format.Encryption of the present invention in addition to that can realize one section of complete video, makes it that can not be played using player, decryption
It later can be except normal play, moreover it is possible to realize the sectional encryption of complete video, after sectional encryption, if the data of a segmentation
Destroyed to decrypt the decryption for not interfering with video entirety, only that section of data corruption can not play, other part
Remain to normal play.The present invention can effectively be encrypted the video of shooting, take into account and add under the premise of ensureing safety
Decrypt speed.
Description of the drawings
Fig. 1 is the flow chart of ciphering process.
Fig. 2 is the flow chart of decrypting process.
Specific implementation mode
Details are as follows for the preferred embodiment of the present invention combination attached drawing:
As depicted in figs. 1 and 2, a kind of video encryption method based on Android platform, operating procedure are as follows:It is regarded using mobile phone recording
Frequently, video is encrypted in selection two ways, i.e., complete encryption or sectional encryption;If selecting complete cipher mode, depending on
After frequency recording terminates, background encryption program reads the video recorded, and video is encrypted using AES, encryption completion
After delete original, encrypted video file is saved in specified folder;If selecting sectional encryption mode, video
After recording terminates, background encryption program reads the video recorded, calls the ffmpeg orders being transplanted on Android platform will
The key frame of video is set as every 1s mono-, reuses mp4parser and is split video, is finally regarded to every section using AES
Frequency is encrypted, and is output in a file stream, saves as an encryption file.
In the present embodiment, the video encryption method of complete cipher mode is selected, is as follows:
(1)Using Samsung S7 mobile phones as test machine, into handset program, calling mobile phone camera starts recorded video, here
The video of a length of 35s when recording.
(2)Recording finishes click stop button, and video resolution is 1280 × 720 here, and coded format is h.264, to protect
Save as the file of MP4 formats, file size 51.38Mb.Background scheduling encipheror generates 256 keys and is encrypted.
(3)The file that whether there is entitled enc in mobile phone is detected, if not then creates one.The text that will have been encrypted
Part is saved in wherein, and encrypted file name is identical with the name of recorded video, while deleting original video file, encryption knot
Beam.
(4)The file to be decrypted first is chosen when decryption from enc files, choosing when rear background program calls encryption makes
256 keys are decrypted.The file that whether there is entitled dec in mobile phone is detected, after not being created that and decrypting
File preserve wherein, name and encryption file it is of the same name.
By test, the video for encrypting this section of 51.38Mb takes 1135ms, and decryption time is similar, speed, substantially
On ciphering process can be completed after pressing stop button.Because it is to treat as video file commonly to be encrypted using AES
Binary data is tested, the speed of encryption and decryption so the speed of encryption and decryption is related with the size of file on Samsung S7 mobile phones
Degree is almost 44Mb/s, and without the sense that significantly pauses when use, experience is preferable.
In the present embodiment, the video encryption method of sectional encryption mode is selected, is as follows:
(1)Using Samsung S7 mobile phones as test machine, into handset program, calling mobile phone camera starts recorded video, equally
The video of 35s is recorded as Sample video.
(2)Recording finishes click stop button, and video resolution is 1280 × 720 here, and coded format is h.264, to protect
Save as the file of MP4 formats, file size 51.38Mb.After recorded video terminates, first call ffmpeg orders by video
Key frame is set as 1s mono-, and the video set is split using mp4parser, obtains 35 cross-talk videos, orders respectively
Entitled 1 arrives 35.mp4.
(3)A file output stream is created, output stream name is identical with the video of recording, reads in order every after segmentation
One cross-talk video, the random key for generating length and being 256, same file is output to after video is encrypted using AES
In output stream, these sub-videos can be all deleted after encryption, while the size of data after each cross-talk video-encryption being saved in
In one text file, the name of text file is consistent with the name of file after encryption, and a single encryption is obtained after encryption
Video file and a corresponding text information file;It is all saved in enc files.
(4)When decryption, select the video to be decrypted, background program that can read text file identical with its name automatically,
The video to be decrypted is successively read according to size of data therein to be decrypted, the video after decryption is stored in dec files.
The video of this section of 51.38Mb of sectional encryption takes 2600ms in total, wherein video file segmentation is taken
1610ms has used 990ms, it is seen that it is very time-consuming operation to be split video.Decryption is not because close video
At operation, the operation only decrypted take 1310ms so many soon.Although slow compared to complete enciphering rate one
A bit, but also within the scope of receptible.
Claims (3)
1. a kind of video encryption method based on Android platform, which is characterized in that operating procedure is as follows:It is regarded using mobile phone recording
Frequently, video is encrypted in selection two ways, i.e., complete encryption or sectional encryption;If selecting complete cipher mode, depending on
After frequency recording terminates, background encryption program reads the video recorded, and video is encrypted using AES, encryption completion
After delete original, encrypted video file is saved in specified folder;If selecting sectional encryption mode, video
After recording terminates, background encryption program reads the video recorded, calls the ffmpeg orders being transplanted on Android platform will
The key frame of video is set as every 1s mono-, reuses mp4parser and is split video, is finally regarded to every section using AES
Frequency is encrypted, and is output in a file stream, saves as an encryption file.
2. the video encryption method according to claim 1 based on Android platform, which is characterized in that the selection adds completely
Close mode the specific steps are:
1)Video data is acquired by mobile phone camera;
2)Background encryption program reads the video data of acquisition, and as general binary data, the random length that generates is
256 keys are encrypted video using AES, and encryption deletes original video file after completing;
3)Encrypted video file is saved in a specified file, uses video player not play directly at this time
Encrypted video file;
4)When decryption, the encrypted video file to be decrypted is selected, using 256 key pairs used when encrypting, it is decrypted,
Be saved in a specified file, the video after decryption can normal play, duration and quality do not change;Original encryption text
Part, which can be retained, to be deleted.
3. the video encryption method according to claim 1 based on Android platform, which is characterized in that the selection segmentation adds
Close mode the specific steps are:
1)Video data is acquired by mobile phone camera;
2)Background encryption program reads video file, and calling is transplanted to the ffmpeg orders on Android platform by the key frame of video
It is set as every 1s mono-, is divided into a sub-video to preserve per 1s according to key frame video using mp4parser, original video point
Sub-video after cutting is named successively according to timeline;
3)A file output stream is created, output stream name is identical with the video of recording, reads each section after segmentation in order
Sub-video, the random key for generating length and being 256, is output to same file output after video is encrypted using AES
In stream, these sub-videos can be all deleted after encryption, ensure that safety;It is simultaneously that the data after each cross-talk video-encryption are big
Small to be saved in a text file, the name of text file is consistent with the name of file after encryption, and a list is obtained after encryption
One encrypted video file and a corresponding text information file;
4)When decryption, the encrypted video file to be decrypted is selected, background program is read automatically and this encrypted video file name
Identical text file reads data of corresponding size in encrypted video file and is decrypted according to the data in text file,
Then every section of video is exported, is saved in a specified file, every section of video can be played individually after decryption.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810351588.3A CN108769807A (en) | 2018-04-19 | 2018-04-19 | A kind of video encryption method based on Android platform |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810351588.3A CN108769807A (en) | 2018-04-19 | 2018-04-19 | A kind of video encryption method based on Android platform |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108769807A true CN108769807A (en) | 2018-11-06 |
Family
ID=64011146
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810351588.3A Pending CN108769807A (en) | 2018-04-19 | 2018-04-19 | A kind of video encryption method based on Android platform |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108769807A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109348292A (en) * | 2018-11-20 | 2019-02-15 | 广州易方信息科技股份有限公司 | A kind of video segment method based on slice file byte-threshold |
CN109525893A (en) * | 2018-11-20 | 2019-03-26 | 广州易方信息科技股份有限公司 | Video segment method based on slice file duration threshold value |
CN109743601A (en) * | 2018-12-24 | 2019-05-10 | 上海大学 | Method is investigated in digital video secret protection and copyright based on block platform chain |
CN113014965A (en) * | 2021-03-03 | 2021-06-22 | 成都知了汇智科技有限公司 | Video processing method in TF card |
CN114996747A (en) * | 2022-08-03 | 2022-09-02 | 中科雨辰科技有限公司 | Method and system for off-line playing of encrypted file |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101163228A (en) * | 2007-10-24 | 2008-04-16 | 中国电信股份有限公司 | Video data encrypted system and method for network video monitoring |
CN103179455A (en) * | 2013-04-01 | 2013-06-26 | 上海盛本通讯科技有限公司 | Android-system-based video encryption system and encrypting and decrypting method thereof |
CN104284208A (en) * | 2014-10-23 | 2015-01-14 | 航天数字传媒有限公司 | Method and system for conducting parallel encryption through AES-CBC algorithm |
CN104581201A (en) * | 2014-12-31 | 2015-04-29 | 乐视网信息技术(北京)股份有限公司 | Video encryption method and device |
CN104735457A (en) * | 2015-03-27 | 2015-06-24 | 南京中新赛克科技有限责任公司 | Video encryption and decryption method based on H.264 code |
CN104915610A (en) * | 2015-06-15 | 2015-09-16 | 广州市久邦数码科技有限公司 | Privacy picture implementation method and privacy picture implementation system |
US20160241900A1 (en) * | 2013-10-03 | 2016-08-18 | British Telecommunications Public Limited Company | Descrambling of data according to the properties of the control words |
CN106254896A (en) * | 2016-08-05 | 2016-12-21 | 中国传媒大学 | A kind of distributed cryptographic method for real-time video |
CN107105273A (en) * | 2017-02-28 | 2017-08-29 | 广东工业大学 | A kind of real-time video encrypted transmission method based on AES encryption |
-
2018
- 2018-04-19 CN CN201810351588.3A patent/CN108769807A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101163228A (en) * | 2007-10-24 | 2008-04-16 | 中国电信股份有限公司 | Video data encrypted system and method for network video monitoring |
CN103179455A (en) * | 2013-04-01 | 2013-06-26 | 上海盛本通讯科技有限公司 | Android-system-based video encryption system and encrypting and decrypting method thereof |
US20160241900A1 (en) * | 2013-10-03 | 2016-08-18 | British Telecommunications Public Limited Company | Descrambling of data according to the properties of the control words |
CN104284208A (en) * | 2014-10-23 | 2015-01-14 | 航天数字传媒有限公司 | Method and system for conducting parallel encryption through AES-CBC algorithm |
CN104581201A (en) * | 2014-12-31 | 2015-04-29 | 乐视网信息技术(北京)股份有限公司 | Video encryption method and device |
CN104735457A (en) * | 2015-03-27 | 2015-06-24 | 南京中新赛克科技有限责任公司 | Video encryption and decryption method based on H.264 code |
CN104915610A (en) * | 2015-06-15 | 2015-09-16 | 广州市久邦数码科技有限公司 | Privacy picture implementation method and privacy picture implementation system |
CN106254896A (en) * | 2016-08-05 | 2016-12-21 | 中国传媒大学 | A kind of distributed cryptographic method for real-time video |
CN107105273A (en) * | 2017-02-28 | 2017-08-29 | 广东工业大学 | A kind of real-time video encrypted transmission method based on AES encryption |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109348292A (en) * | 2018-11-20 | 2019-02-15 | 广州易方信息科技股份有限公司 | A kind of video segment method based on slice file byte-threshold |
CN109525893A (en) * | 2018-11-20 | 2019-03-26 | 广州易方信息科技股份有限公司 | Video segment method based on slice file duration threshold value |
CN109743601A (en) * | 2018-12-24 | 2019-05-10 | 上海大学 | Method is investigated in digital video secret protection and copyright based on block platform chain |
CN109743601B (en) * | 2018-12-24 | 2021-04-09 | 上海大学 | Digital video privacy protection and copyright tracking method based on block chain platform |
CN113014965A (en) * | 2021-03-03 | 2021-06-22 | 成都知了汇智科技有限公司 | Video processing method in TF card |
CN114996747A (en) * | 2022-08-03 | 2022-09-02 | 中科雨辰科技有限公司 | Method and system for off-line playing of encrypted file |
CN114996747B (en) * | 2022-08-03 | 2022-10-04 | 中科雨辰科技有限公司 | Method and system for off-line playing of encrypted file |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108769807A (en) | A kind of video encryption method based on Android platform | |
WO2005101215A1 (en) | Terminal device and copyright protection system | |
CN1287249C (en) | Access control for digital content | |
JP4060271B2 (en) | Content processing apparatus and content protection program | |
CN1767032B (en) | Multi-streaming apparatus and muti-streaming method using temporary storage medium | |
EP2352251A1 (en) | Content decoding apparatus, content decoding method and integrated circuit | |
WO2017215148A1 (en) | File protection method and device | |
CN1224910C (en) | Enciphering method, decipher method and device and information recording medium | |
CN101969545A (en) | Encryption method and device of multimedia file | |
JPH05199424A (en) | Picture encoding reproducing device | |
JP2002244929A5 (en) | Digital content generation method and related apparatus | |
RU2012130005A (en) | CONTENT RECEPTION DEVICE, CONTENT PLAYBACK DEVICE, CONTENT RECEPTION AND PLAYBACK DEVICE, CONTENT RECEPTION METHOD AND PROGRAM | |
CN1925048A (en) | Information processing apparatus and information processing method | |
JPH11205738A (en) | Image input device, its method and storage medium | |
JPWO2006112046A1 (en) | Recording / reproducing apparatus and recording / reproducing method | |
CN110035319A (en) | A kind of encryption and decryption method of audio, video data, device and playback equipment | |
KR20060130760A (en) | Content movement device, content movement method, computer program, recording medium, and content movement system | |
CN102142072A (en) | Encryption processing and decryption processing method and device of electronic files | |
JP2004318927A5 (en) | Digital data storage method, storage device, reproduction device and recording medium | |
JP2009284019A (en) | Media processor, and recording medium control method | |
CN112887800A (en) | Method for encrypting and protecting PVR (personal video recorder) of set top box | |
US8108934B2 (en) | Information processing apparatus and method, and a program | |
CN113672876B (en) | OTG-based method and device for quickly obtaining evidence of mobile phone | |
JP4731619B2 (en) | Storage / playback device | |
JP2006085815A (en) | Recording and reproducing apparatus, content reproducing method, and content recording 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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181106 |